@ainyc/canonry 1.24.0 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,20 @@
1
- function mk(e,t){for(var s=0;s<t.length;s++){const a=t[s];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in e)){const c=Object.getOwnPropertyDescriptor(a,r);c&&Object.defineProperty(e,r,c.get?c:{enumerable:!0,get:()=>a[r]})}}}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 r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function s(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(r){if(r.ep)return;r.ep=!0;const c=s(r);fetch(r.href,c)}})();function Yb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vh={exports:{}},Mo={};var Iv;function pk(){if(Iv)return Mo;Iv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(a,r,c){var d=null;if(c!==void 0&&(d=""+c),r.key!==void 0&&(d=""+r.key),"key"in r){c={};for(var f in r)f!=="key"&&(c[f]=r[f])}else c=r;return r=c.ref,{$$typeof:e,type:a,key:d,ref:r!==void 0?r:null,props:c}}return Mo.Fragment=t,Mo.jsx=s,Mo.jsxs=s,Mo}var Bv;function gk(){return Bv||(Bv=1,vh.exports=pk()),vh.exports}var l=gk(),xh={exports:{}},Ee={};var qv;function yk(){if(qv)return Ee;qv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function b(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(O,Z,ie){this.props=O,this.context=Z,this.refs=C,this.updater=ie||w}k.prototype.isReactComponent={},k.prototype.setState=function(O,Z){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,Z,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function E(){}E.prototype=k.prototype;function A(O,Z,ie){this.props=O,this.context=Z,this.refs=C,this.updater=ie||w}var z=A.prototype=new E;z.constructor=A,S(z,k.prototype),z.isPureReactComponent=!0;var L=Array.isArray;function M(){}var R={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function P(O,Z,ie){var re=ie.ref;return{$$typeof:e,type:O,key:Z,ref:re!==void 0?re:null,props:ie}}function J(O,Z){return P(O.type,Z,O.props)}function Q(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function se(O){var Z={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ie){return Z[ie]})}var pe=/\/+/g;function ke(O,Z){return typeof O=="object"&&O!==null&&O.key!=null?se(""+O.key):Z.toString(36)}function je(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(M,M):(O.status="pending",O.then(function(Z){O.status==="pending"&&(O.status="fulfilled",O.value=Z)},function(Z){O.status==="pending"&&(O.status="rejected",O.reason=Z)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function B(O,Z,ie,re,ue){var he=typeof O;(he==="undefined"||he==="boolean")&&(O=null);var de=!1;if(O===null)de=!0;else switch(he){case"bigint":case"string":case"number":de=!0;break;case"object":switch(O.$$typeof){case e:case t:de=!0;break;case v:return de=O._init,B(de(O._payload),Z,ie,re,ue)}}if(de)return ue=ue(O),de=re===""?"."+ke(O,0):re,L(ue)?(ie="",de!=null&&(ie=de.replace(pe,"$&/")+"/"),B(ue,Z,ie,"",function(Ke){return Ke})):ue!=null&&(Q(ue)&&(ue=J(ue,ie+(ue.key==null||O&&O.key===ue.key?"":(""+ue.key).replace(pe,"$&/")+"/")+de)),Z.push(ue)),1;de=0;var Me=re===""?".":re+":";if(L(O))for(var ge=0;ge<O.length;ge++)re=O[ge],he=Me+ke(re,ge),de+=B(re,Z,ie,he,ue);else if(ge=b(O),typeof ge=="function")for(O=ge.call(O),ge=0;!(re=O.next()).done;)re=re.value,he=Me+ke(re,ge++),de+=B(re,Z,ie,he,ue);else if(he==="object"){if(typeof O.then=="function")return B(je(O),Z,ie,re,ue);throw Z=String(O),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return de}function G(O,Z,ie){if(O==null)return O;var re=[],ue=0;return B(O,re,"","",function(he){return Z.call(ie,he,ue++)}),re}function oe(O){if(O._status===-1){var Z=O._result;Z=Z(),Z.then(function(ie){(O._status===0||O._status===-1)&&(O._status=1,O._result=ie)},function(ie){(O._status===0||O._status===-1)&&(O._status=2,O._result=ie)}),O._status===-1&&(O._status=0,O._result=Z)}if(O._status===1)return O._result.default;throw O._result}var q=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},X={map:G,forEach:function(O,Z,ie){G(O,function(){Z.apply(this,arguments)},ie)},count:function(O){var Z=0;return G(O,function(){Z++}),Z},toArray:function(O){return G(O,function(Z){return Z})||[]},only:function(O){if(!Q(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ee.Activity=y,Ee.Children=X,Ee.Component=k,Ee.Fragment=s,Ee.Profiler=r,Ee.PureComponent=A,Ee.StrictMode=a,Ee.Suspense=p,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(O){return R.H.useMemoCache(O)}},Ee.cache=function(O){return function(){return O.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(O,Z,ie){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var re=S({},O.props),ue=O.key;if(Z!=null)for(he in Z.key!==void 0&&(ue=""+Z.key),Z)!T.call(Z,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&Z.ref===void 0||(re[he]=Z[he]);var he=arguments.length-2;if(he===1)re.children=ie;else if(1<he){for(var de=Array(he),Me=0;Me<he;Me++)de[Me]=arguments[Me+2];re.children=de}return P(O.type,ue,re)},Ee.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:c,_context:O},O},Ee.createElement=function(O,Z,ie){var re,ue={},he=null;if(Z!=null)for(re in Z.key!==void 0&&(he=""+Z.key),Z)T.call(Z,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ue[re]=Z[re]);var de=arguments.length-2;if(de===1)ue.children=ie;else if(1<de){for(var Me=Array(de),ge=0;ge<de;ge++)Me[ge]=arguments[ge+2];ue.children=Me}if(O&&O.defaultProps)for(re in de=O.defaultProps,de)ue[re]===void 0&&(ue[re]=de[re]);return P(O,he,ue)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(O){return{$$typeof:f,render:O}},Ee.isValidElement=Q,Ee.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:oe}},Ee.memo=function(O,Z){return{$$typeof:m,type:O,compare:Z===void 0?null:Z}},Ee.startTransition=function(O){var Z=R.T,ie={};R.T=ie;try{var re=O(),ue=R.S;ue!==null&&ue(ie,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(M,q)}catch(he){q(he)}finally{Z!==null&&ie.types!==null&&(Z.types=ie.types),R.T=Z}},Ee.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Ee.use=function(O){return R.H.use(O)},Ee.useActionState=function(O,Z,ie){return R.H.useActionState(O,Z,ie)},Ee.useCallback=function(O,Z){return R.H.useCallback(O,Z)},Ee.useContext=function(O){return R.H.useContext(O)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(O,Z){return R.H.useDeferredValue(O,Z)},Ee.useEffect=function(O,Z){return R.H.useEffect(O,Z)},Ee.useEffectEvent=function(O){return R.H.useEffectEvent(O)},Ee.useId=function(){return R.H.useId()},Ee.useImperativeHandle=function(O,Z,ie){return R.H.useImperativeHandle(O,Z,ie)},Ee.useInsertionEffect=function(O,Z){return R.H.useInsertionEffect(O,Z)},Ee.useLayoutEffect=function(O,Z){return R.H.useLayoutEffect(O,Z)},Ee.useMemo=function(O,Z){return R.H.useMemo(O,Z)},Ee.useOptimistic=function(O,Z){return R.H.useOptimistic(O,Z)},Ee.useReducer=function(O,Z,ie){return R.H.useReducer(O,Z,ie)},Ee.useRef=function(O){return R.H.useRef(O)},Ee.useState=function(O){return R.H.useState(O)},Ee.useSyncExternalStore=function(O,Z,ie){return R.H.useSyncExternalStore(O,Z,ie)},Ee.useTransition=function(){return R.H.useTransition()},Ee.version="19.2.4",Ee}var Hv;function ll(){return Hv||(Hv=1,xh.exports=yk()),xh.exports}var N=ll();const is=Yb(N),qm=mk({__proto__:null,default:is},[N]);var bh={exports:{}},Uo={},Sh={exports:{}},jh={};var Gv;function vk(){return Gv||(Gv=1,(function(e){function t(B,G){var oe=B.length;B.push(G);e:for(;0<oe;){var q=oe-1>>>1,X=B[q];if(0<r(X,G))B[q]=G,B[oe]=X,oe=q;else break e}}function s(B){return B.length===0?null:B[0]}function a(B){if(B.length===0)return null;var G=B[0],oe=B.pop();if(oe!==G){B[0]=oe;e:for(var q=0,X=B.length,O=X>>>1;q<O;){var Z=2*(q+1)-1,ie=B[Z],re=Z+1,ue=B[re];if(0>r(ie,oe))re<X&&0>r(ue,ie)?(B[q]=ue,B[re]=oe,q=re):(B[q]=ie,B[Z]=oe,q=Z);else if(re<X&&0>r(ue,oe))B[q]=ue,B[re]=oe,q=re;else break e}}return G}function r(B,G){var oe=B.sortIndex-G.sortIndex;return oe!==0?oe:B.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],m=[],v=1,y=null,x=3,b=!1,w=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function z(B){for(var G=s(m);G!==null;){if(G.callback===null)a(m);else if(G.startTime<=B)a(m),G.sortIndex=G.expirationTime,t(p,G);else break;G=s(m)}}function L(B){if(S=!1,z(B),!w)if(s(p)!==null)w=!0,M||(M=!0,se());else{var G=s(m);G!==null&&je(L,G.startTime-B)}}var M=!1,R=-1,T=5,P=-1;function J(){return C?!0:!(e.unstable_now()-P<T)}function Q(){if(C=!1,M){var B=e.unstable_now();P=B;var G=!0;try{e:{w=!1,S&&(S=!1,E(R),R=-1),b=!0;var oe=x;try{t:{for(z(B),y=s(p);y!==null&&!(y.expirationTime>B&&J());){var q=y.callback;if(typeof q=="function"){y.callback=null,x=y.priorityLevel;var X=q(y.expirationTime<=B);if(B=e.unstable_now(),typeof X=="function"){y.callback=X,z(B),G=!0;break t}y===s(p)&&a(p),z(B)}else a(p);y=s(p)}if(y!==null)G=!0;else{var O=s(m);O!==null&&je(L,O.startTime-B),G=!1}}break e}finally{y=null,x=oe,b=!1}G=void 0}}finally{G?se():M=!1}}}var se;if(typeof A=="function")se=function(){A(Q)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,ke=pe.port2;pe.port1.onmessage=Q,se=function(){ke.postMessage(null)}}else se=function(){k(Q,0)};function je(B,G){R=k(function(){B(e.unstable_now())},G)}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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(B){switch(x){case 1:case 2:case 3:var G=3;break;default:G=x}var oe=x;x=G;try{return B()}finally{x=oe}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var oe=x;x=B;try{return G()}finally{x=oe}},e.unstable_scheduleCallback=function(B,G,oe){var q=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?q+oe:q):oe=q,B){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=oe+X,B={id:v++,callback:G,priorityLevel:B,startTime:oe,expirationTime:X,sortIndex:-1},oe>q?(B.sortIndex=oe,t(m,B),s(p)===null&&B===s(m)&&(S?(E(R),R=-1):S=!0,je(L,oe-q))):(B.sortIndex=X,t(p,B),w||b||(w=!0,M||(M=!0,se()))),B},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(B){var G=x;return function(){var oe=x;x=G;try{return B.apply(this,arguments)}finally{x=oe}}}})(jh)),jh}var Fv;function xk(){return Fv||(Fv=1,Sh.exports=vk()),Sh.exports}var wh={exports:{}},tn={};var Zv;function bk(){if(Zv)return tn;Zv=1;var e=ll();function t(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},r=Symbol.for("react.portal");function c(p,m,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:p,containerInfo:m,implementation:v}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,tn.createPortal=function(p,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return c(p,m,null,v)},tn.flushSync=function(p){var m=d.T,v=a.p;try{if(d.T=null,a.p=2,p)return p()}finally{d.T=m,a.p=v,a.d.f()}},tn.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(p,m))},tn.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},tn.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var v=m.as,y=f(v,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,b=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?a.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:b}):v==="script"&&a.d.X(p,{crossOrigin:y,integrity:x,fetchPriority:b,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},tn.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=f(m.as,m.crossOrigin);a.d.M(p,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(p)},tn.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,y=f(v,m.crossOrigin);a.d.L(p,v,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},tn.preloadModule=function(p,m){if(typeof p=="string")if(m){var v=f(m.as,m.crossOrigin);a.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(p)},tn.requestFormReset=function(p){a.d.r(p)},tn.unstable_batchedUpdates=function(p,m){return p(m)},tn.useFormState=function(p,m,v){return d.H.useFormState(p,m,v)},tn.useFormStatus=function(){return d.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var Kv;function Jb(){if(Kv)return wh.exports;Kv=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(),wh.exports=bk(),wh.exports}var Vv;function Sk(){if(Vv)return Uo;Vv=1;var e=xk(),t=ll(),s=Jb();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,o=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(o=i.return),n=i.return;while(n)}return i.tag===3?o:null}function d(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function p(n){if(c(n)!==n)throw Error(a(188))}function m(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(a(188));return i!==n?null:n}for(var o=n,u=i;;){var h=o.return;if(h===null)break;var g=h.alternate;if(g===null){if(u=h.return,u!==null){o=u;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===o)return p(h),n;if(g===u)return p(h),i;g=g.sibling}throw Error(a(188))}if(o.return!==u.return)o=h,u=g;else{for(var j=!1,_=h.child;_;){if(_===o){j=!0,o=h,u=g;break}if(_===u){j=!0,u=h,o=g;break}_=_.sibling}if(!j){for(_=g.child;_;){if(_===o){j=!0,o=g,u=h;break}if(_===u){j=!0,u=g,o=h;break}_=_.sibling}if(!j)throw Error(a(189))}}if(o.alternate!==u)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?n:i}function v(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=v(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),A=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function se(n){return n===null||typeof n!="object"?null:(n=Q&&n[Q]||n["@@iterator"],typeof n=="function"?n:null)}var pe=Symbol.for("react.client.reference");function ke(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===pe?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case M:return"SuspenseList";case P:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case A:return n.displayName||"Context";case E:return(n._context.displayName||"Context")+".Consumer";case z:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case R:return i=n.displayName||null,i!==null?i:ke(n.type)||"Memo";case T:i=n._payload,n=n._init;try{return ke(n(i))}catch{}}return null}var je=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},q=[],X=-1;function O(n){return{current:n}}function Z(n){0>X||(n.current=q[X],q[X]=null,X--)}function ie(n,i){X++,q[X]=n.current,n.current=i}var re=O(null),ue=O(null),he=O(null),de=O(null);function Me(n,i){switch(ie(he,i),ie(ue,n),ie(re,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?cv(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=cv(i),n=uv(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Z(re),ie(re,n)}function ge(){Z(re),Z(ue),Z(he)}function Ke(n){n.memoizedState!==null&&ie(de,n);var i=re.current,o=uv(i,n.type);i!==o&&(ie(ue,n),ie(re,o))}function it(n){ue.current===n&&(Z(re),Z(ue)),de.current===n&&(Z(de),To._currentValue=oe)}var me,We;function dt(n){if(me===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);me=i&&i[1]||"",We=-1<o.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+me+n+We}var sn=!1;function _t(n,i){if(!n||sn)return"";sn=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Y){var V=Y}Reflect.construct(n,[],ne)}else{try{ne.call()}catch(Y){V=Y}n.call(ne.prototype)}}else{try{throw Error()}catch(Y){V=Y}(ne=n())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(Y){if(Y&&V&&typeof Y.stack=="string")return[Y.stack,V.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),j=g[0],_=g[1];if(j&&_){var D=j.split(`
1
+ function pk(e,t){for(var s=0;s<t.length;s++){const a=t[s];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in e)){const c=Object.getOwnPropertyDescriptor(a,r);c&&Object.defineProperty(e,r,c.get?c:{enumerable:!0,get:()=>a[r]})}}}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 r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function s(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(r){if(r.ep)return;r.ep=!0;const c=s(r);fetch(r.href,c)}})();function Yb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yh={exports:{}},Lo={};var Iv;function gk(){if(Iv)return Lo;Iv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(a,r,c){var d=null;if(c!==void 0&&(d=""+c),r.key!==void 0&&(d=""+r.key),"key"in r){c={};for(var f in r)f!=="key"&&(c[f]=r[f])}else c=r;return r=c.ref,{$$typeof:e,type:a,key:d,ref:r!==void 0?r:null,props:c}}return Lo.Fragment=t,Lo.jsx=s,Lo.jsxs=s,Lo}var Bv;function yk(){return Bv||(Bv=1,yh.exports=gk()),yh.exports}var o=yk(),vh={exports:{}},Ee={};var qv;function vk(){if(qv)return Ee;qv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function b(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(O,Z,ie){this.props=O,this.context=Z,this.refs=C,this.updater=ie||w}k.prototype.isReactComponent={},k.prototype.setState=function(O,Z){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,Z,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function E(){}E.prototype=k.prototype;function R(O,Z,ie){this.props=O,this.context=Z,this.refs=C,this.updater=ie||w}var z=R.prototype=new E;z.constructor=R,S(z,k.prototype),z.isPureReactComponent=!0;var L=Array.isArray;function M(){}var A={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function P(O,Z,ie){var re=ie.ref;return{$$typeof:e,type:O,key:Z,ref:re!==void 0?re:null,props:ie}}function J(O,Z){return P(O.type,Z,O.props)}function Q(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function se(O){var Z={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ie){return Z[ie]})}var pe=/\/+/g;function ke(O,Z){return typeof O=="object"&&O!==null&&O.key!=null?se(""+O.key):Z.toString(36)}function je(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(M,M):(O.status="pending",O.then(function(Z){O.status==="pending"&&(O.status="fulfilled",O.value=Z)},function(Z){O.status==="pending"&&(O.status="rejected",O.reason=Z)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function B(O,Z,ie,re,ue){var he=typeof O;(he==="undefined"||he==="boolean")&&(O=null);var de=!1;if(O===null)de=!0;else switch(he){case"bigint":case"string":case"number":de=!0;break;case"object":switch(O.$$typeof){case e:case t:de=!0;break;case v:return de=O._init,B(de(O._payload),Z,ie,re,ue)}}if(de)return ue=ue(O),de=re===""?"."+ke(O,0):re,L(ue)?(ie="",de!=null&&(ie=de.replace(pe,"$&/")+"/"),B(ue,Z,ie,"",function(Ke){return Ke})):ue!=null&&(Q(ue)&&(ue=J(ue,ie+(ue.key==null||O&&O.key===ue.key?"":(""+ue.key).replace(pe,"$&/")+"/")+de)),Z.push(ue)),1;de=0;var Me=re===""?".":re+":";if(L(O))for(var ge=0;ge<O.length;ge++)re=O[ge],he=Me+ke(re,ge),de+=B(re,Z,ie,he,ue);else if(ge=b(O),typeof ge=="function")for(O=ge.call(O),ge=0;!(re=O.next()).done;)re=re.value,he=Me+ke(re,ge++),de+=B(re,Z,ie,he,ue);else if(he==="object"){if(typeof O.then=="function")return B(je(O),Z,ie,re,ue);throw Z=String(O),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return de}function G(O,Z,ie){if(O==null)return O;var re=[],ue=0;return B(O,re,"","",function(he){return Z.call(ie,he,ue++)}),re}function oe(O){if(O._status===-1){var Z=O._result;Z=Z(),Z.then(function(ie){(O._status===0||O._status===-1)&&(O._status=1,O._result=ie)},function(ie){(O._status===0||O._status===-1)&&(O._status=2,O._result=ie)}),O._status===-1&&(O._status=0,O._result=Z)}if(O._status===1)return O._result.default;throw O._result}var q=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},X={map:G,forEach:function(O,Z,ie){G(O,function(){Z.apply(this,arguments)},ie)},count:function(O){var Z=0;return G(O,function(){Z++}),Z},toArray:function(O){return G(O,function(Z){return Z})||[]},only:function(O){if(!Q(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ee.Activity=y,Ee.Children=X,Ee.Component=k,Ee.Fragment=s,Ee.Profiler=r,Ee.PureComponent=R,Ee.StrictMode=a,Ee.Suspense=p,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(O){return A.H.useMemoCache(O)}},Ee.cache=function(O){return function(){return O.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(O,Z,ie){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var re=S({},O.props),ue=O.key;if(Z!=null)for(he in Z.key!==void 0&&(ue=""+Z.key),Z)!T.call(Z,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&Z.ref===void 0||(re[he]=Z[he]);var he=arguments.length-2;if(he===1)re.children=ie;else if(1<he){for(var de=Array(he),Me=0;Me<he;Me++)de[Me]=arguments[Me+2];re.children=de}return P(O.type,ue,re)},Ee.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:c,_context:O},O},Ee.createElement=function(O,Z,ie){var re,ue={},he=null;if(Z!=null)for(re in Z.key!==void 0&&(he=""+Z.key),Z)T.call(Z,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ue[re]=Z[re]);var de=arguments.length-2;if(de===1)ue.children=ie;else if(1<de){for(var Me=Array(de),ge=0;ge<de;ge++)Me[ge]=arguments[ge+2];ue.children=Me}if(O&&O.defaultProps)for(re in de=O.defaultProps,de)ue[re]===void 0&&(ue[re]=de[re]);return P(O,he,ue)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(O){return{$$typeof:f,render:O}},Ee.isValidElement=Q,Ee.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:oe}},Ee.memo=function(O,Z){return{$$typeof:m,type:O,compare:Z===void 0?null:Z}},Ee.startTransition=function(O){var Z=A.T,ie={};A.T=ie;try{var re=O(),ue=A.S;ue!==null&&ue(ie,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(M,q)}catch(he){q(he)}finally{Z!==null&&ie.types!==null&&(Z.types=ie.types),A.T=Z}},Ee.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Ee.use=function(O){return A.H.use(O)},Ee.useActionState=function(O,Z,ie){return A.H.useActionState(O,Z,ie)},Ee.useCallback=function(O,Z){return A.H.useCallback(O,Z)},Ee.useContext=function(O){return A.H.useContext(O)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(O,Z){return A.H.useDeferredValue(O,Z)},Ee.useEffect=function(O,Z){return A.H.useEffect(O,Z)},Ee.useEffectEvent=function(O){return A.H.useEffectEvent(O)},Ee.useId=function(){return A.H.useId()},Ee.useImperativeHandle=function(O,Z,ie){return A.H.useImperativeHandle(O,Z,ie)},Ee.useInsertionEffect=function(O,Z){return A.H.useInsertionEffect(O,Z)},Ee.useLayoutEffect=function(O,Z){return A.H.useLayoutEffect(O,Z)},Ee.useMemo=function(O,Z){return A.H.useMemo(O,Z)},Ee.useOptimistic=function(O,Z){return A.H.useOptimistic(O,Z)},Ee.useReducer=function(O,Z,ie){return A.H.useReducer(O,Z,ie)},Ee.useRef=function(O){return A.H.useRef(O)},Ee.useState=function(O){return A.H.useState(O)},Ee.useSyncExternalStore=function(O,Z,ie){return A.H.useSyncExternalStore(O,Z,ie)},Ee.useTransition=function(){return A.H.useTransition()},Ee.version="19.2.4",Ee}var Hv;function ol(){return Hv||(Hv=1,vh.exports=vk()),vh.exports}var N=ol();const is=Yb(N),qm=pk({__proto__:null,default:is},[N]);var xh={exports:{}},Mo={},bh={exports:{}},Sh={};var Gv;function xk(){return Gv||(Gv=1,(function(e){function t(B,G){var oe=B.length;B.push(G);e:for(;0<oe;){var q=oe-1>>>1,X=B[q];if(0<r(X,G))B[q]=G,B[oe]=X,oe=q;else break e}}function s(B){return B.length===0?null:B[0]}function a(B){if(B.length===0)return null;var G=B[0],oe=B.pop();if(oe!==G){B[0]=oe;e:for(var q=0,X=B.length,O=X>>>1;q<O;){var Z=2*(q+1)-1,ie=B[Z],re=Z+1,ue=B[re];if(0>r(ie,oe))re<X&&0>r(ue,ie)?(B[q]=ue,B[re]=oe,q=re):(B[q]=ie,B[Z]=oe,q=Z);else if(re<X&&0>r(ue,oe))B[q]=ue,B[re]=oe,q=re;else break e}}return G}function r(B,G){var oe=B.sortIndex-G.sortIndex;return oe!==0?oe:B.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],m=[],v=1,y=null,x=3,b=!1,w=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function z(B){for(var G=s(m);G!==null;){if(G.callback===null)a(m);else if(G.startTime<=B)a(m),G.sortIndex=G.expirationTime,t(p,G);else break;G=s(m)}}function L(B){if(S=!1,z(B),!w)if(s(p)!==null)w=!0,M||(M=!0,se());else{var G=s(m);G!==null&&je(L,G.startTime-B)}}var M=!1,A=-1,T=5,P=-1;function J(){return C?!0:!(e.unstable_now()-P<T)}function Q(){if(C=!1,M){var B=e.unstable_now();P=B;var G=!0;try{e:{w=!1,S&&(S=!1,E(A),A=-1),b=!0;var oe=x;try{t:{for(z(B),y=s(p);y!==null&&!(y.expirationTime>B&&J());){var q=y.callback;if(typeof q=="function"){y.callback=null,x=y.priorityLevel;var X=q(y.expirationTime<=B);if(B=e.unstable_now(),typeof X=="function"){y.callback=X,z(B),G=!0;break t}y===s(p)&&a(p),z(B)}else a(p);y=s(p)}if(y!==null)G=!0;else{var O=s(m);O!==null&&je(L,O.startTime-B),G=!1}}break e}finally{y=null,x=oe,b=!1}G=void 0}}finally{G?se():M=!1}}}var se;if(typeof R=="function")se=function(){R(Q)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,ke=pe.port2;pe.port1.onmessage=Q,se=function(){ke.postMessage(null)}}else se=function(){k(Q,0)};function je(B,G){A=k(function(){B(e.unstable_now())},G)}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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(B){switch(x){case 1:case 2:case 3:var G=3;break;default:G=x}var oe=x;x=G;try{return B()}finally{x=oe}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var oe=x;x=B;try{return G()}finally{x=oe}},e.unstable_scheduleCallback=function(B,G,oe){var q=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?q+oe:q):oe=q,B){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=oe+X,B={id:v++,callback:G,priorityLevel:B,startTime:oe,expirationTime:X,sortIndex:-1},oe>q?(B.sortIndex=oe,t(m,B),s(p)===null&&B===s(m)&&(S?(E(A),A=-1):S=!0,je(L,oe-q))):(B.sortIndex=X,t(p,B),w||b||(w=!0,M||(M=!0,se()))),B},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(B){var G=x;return function(){var oe=x;x=G;try{return B.apply(this,arguments)}finally{x=oe}}}})(Sh)),Sh}var Fv;function bk(){return Fv||(Fv=1,bh.exports=xk()),bh.exports}var jh={exports:{}},tn={};var Zv;function Sk(){if(Zv)return tn;Zv=1;var e=ol();function t(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},r=Symbol.for("react.portal");function c(p,m,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:p,containerInfo:m,implementation:v}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,tn.createPortal=function(p,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return c(p,m,null,v)},tn.flushSync=function(p){var m=d.T,v=a.p;try{if(d.T=null,a.p=2,p)return p()}finally{d.T=m,a.p=v,a.d.f()}},tn.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(p,m))},tn.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},tn.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var v=m.as,y=f(v,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,b=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?a.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:b}):v==="script"&&a.d.X(p,{crossOrigin:y,integrity:x,fetchPriority:b,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},tn.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=f(m.as,m.crossOrigin);a.d.M(p,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(p)},tn.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,y=f(v,m.crossOrigin);a.d.L(p,v,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},tn.preloadModule=function(p,m){if(typeof p=="string")if(m){var v=f(m.as,m.crossOrigin);a.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(p)},tn.requestFormReset=function(p){a.d.r(p)},tn.unstable_batchedUpdates=function(p,m){return p(m)},tn.useFormState=function(p,m,v){return d.H.useFormState(p,m,v)},tn.useFormStatus=function(){return d.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var Kv;function Jb(){if(Kv)return jh.exports;Kv=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(),jh.exports=Sk(),jh.exports}var Vv;function jk(){if(Vv)return Mo;Vv=1;var e=bk(),t=ol(),s=Jb();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,l=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(l=i.return),n=i.return;while(n)}return i.tag===3?l:null}function d(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function p(n){if(c(n)!==n)throw Error(a(188))}function m(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(a(188));return i!==n?null:n}for(var l=n,u=i;;){var h=l.return;if(h===null)break;var g=h.alternate;if(g===null){if(u=h.return,u!==null){l=u;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===l)return p(h),n;if(g===u)return p(h),i;g=g.sibling}throw Error(a(188))}if(l.return!==u.return)l=h,u=g;else{for(var j=!1,_=h.child;_;){if(_===l){j=!0,l=h,u=g;break}if(_===u){j=!0,u=h,l=g;break}_=_.sibling}if(!j){for(_=g.child;_;){if(_===l){j=!0,l=g,u=h;break}if(_===u){j=!0,u=g,l=h;break}_=_.sibling}if(!j)throw Error(a(189))}}if(l.alternate!==u)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?n:i}function v(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=v(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function se(n){return n===null||typeof n!="object"?null:(n=Q&&n[Q]||n["@@iterator"],typeof n=="function"?n:null)}var pe=Symbol.for("react.client.reference");function ke(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===pe?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case M:return"SuspenseList";case P:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case R:return n.displayName||"Context";case E:return(n._context.displayName||"Context")+".Consumer";case z:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case A:return i=n.displayName||null,i!==null?i:ke(n.type)||"Memo";case T:i=n._payload,n=n._init;try{return ke(n(i))}catch{}}return null}var je=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},q=[],X=-1;function O(n){return{current:n}}function Z(n){0>X||(n.current=q[X],q[X]=null,X--)}function ie(n,i){X++,q[X]=n.current,n.current=i}var re=O(null),ue=O(null),he=O(null),de=O(null);function Me(n,i){switch(ie(he,i),ie(ue,n),ie(re,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?cv(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=cv(i),n=uv(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Z(re),ie(re,n)}function ge(){Z(re),Z(ue),Z(he)}function Ke(n){n.memoizedState!==null&&ie(de,n);var i=re.current,l=uv(i,n.type);i!==l&&(ie(ue,n),ie(re,l))}function it(n){ue.current===n&&(Z(re),Z(ue)),de.current===n&&(Z(de),Ao._currentValue=oe)}var me,We;function dt(n){if(me===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);me=i&&i[1]||"",We=-1<l.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+me+n+We}var sn=!1;function kt(n,i){if(!n||sn)return"";sn=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Y){var V=Y}Reflect.construct(n,[],ne)}else{try{ne.call()}catch(Y){V=Y}n.call(ne.prototype)}}else{try{throw Error()}catch(Y){V=Y}(ne=n())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(Y){if(Y&&V&&typeof Y.stack=="string")return[Y.stack,V.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),j=g[0],_=g[1];if(j&&_){var D=j.split(`
4
4
  `),F=_.split(`
5
5
  `);for(h=u=0;u<D.length&&!D[u].includes("DetermineComponentFrameRoot");)u++;for(;h<F.length&&!F[h].includes("DetermineComponentFrameRoot");)h++;if(u===D.length||h===F.length)for(u=D.length-1,h=F.length-1;1<=u&&0<=h&&D[u]!==F[h];)h--;for(;1<=u&&0<=h;u--,h--)if(D[u]!==F[h]){if(u!==1||h!==1)do if(u--,h--,0>h||D[u]!==F[h]){var W=`
6
- `+D[u].replace(" at new "," at ");return n.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",n.displayName)),W}while(1<=u&&0<=h);break}}}finally{sn=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?dt(o):""}function an(n,i){switch(n.tag){case 26:case 27:case 5:return dt(n.type);case 16:return dt("Lazy");case 13:return n.child!==i&&i!==null?dt("Suspense Fallback"):dt("Suspense");case 19:return dt("SuspenseList");case 0:case 15:return _t(n.type,!1);case 11:return _t(n.type.render,!1);case 1:return _t(n.type,!0);case 31:return dt("Activity");default:return""}}function Vt(n){try{var i="",o=null;do i+=an(n,o),o=n,n=n.return;while(n);return i}catch(u){return`
6
+ `+D[u].replace(" at new "," at ");return n.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",n.displayName)),W}while(1<=u&&0<=h);break}}}finally{sn=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?dt(l):""}function an(n,i){switch(n.tag){case 26:case 27:case 5:return dt(n.type);case 16:return dt("Lazy");case 13:return n.child!==i&&i!==null?dt("Suspense Fallback"):dt("Suspense");case 19:return dt("SuspenseList");case 0:case 15:return kt(n.type,!1);case 11:return kt(n.type.render,!1);case 1:return kt(n.type,!0);case 31:return dt("Activity");default:return""}}function Vt(n){try{var i="",l=null;do i+=an(n,l),l=n,n=n.return;while(n);return i}catch(u){return`
7
7
  Error generating stack: `+u.message+`
8
- `+u.stack}}var zt=Object.prototype.hasOwnProperty,bt=e.unstable_scheduleCallback,mn=e.unstable_cancelCallback,le=e.unstable_shouldYield,Ie=e.unstable_requestPaint,Be=e.unstable_now,ze=e.unstable_getCurrentPriorityLevel,Ue=e.unstable_ImmediatePriority,pt=e.unstable_UserBlockingPriority,rn=e.unstable_NormalPriority,Ss=e.unstable_LowPriority,Ks=e.unstable_IdlePriority,js=e.log,Vs=e.unstable_setDisableYieldValue,ls=null,_e=null;function Ht(n){if(typeof js=="function"&&Vs(n),_e&&typeof _e.setStrictMode=="function")try{_e.setStrictMode(ls,n)}catch{}}var Ve=Math.clz32?Math.clz32:yl,ae=Math.log,Jn=Math.LN2;function yl(n){return n>>>=0,n===0?32:31-(ae(n)/Jn|0)|0}var Qs=256,ws=262144,Gi=4194304;function cs(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Oa(n,i,o){var u=n.pendingLanes;if(u===0)return 0;var h=0,g=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var _=u&134217727;return _!==0?(u=_&~g,u!==0?h=cs(u):(j&=_,j!==0?h=cs(j):o||(o=_&~n,o!==0&&(h=cs(o))))):(_=u&~g,_!==0?h=cs(_):j!==0?h=cs(j):o||(o=u&~n,o!==0&&(h=cs(o)))),h===0?0:i!==0&&i!==h&&(i&g)===0&&(g=h&-h,o=i&-i,g>=o||g===32&&(o&4194048)!==0)?i:h}function us(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function vl(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 xl(){var n=Gi;return Gi<<=1,(Gi&62914560)===0&&(Gi=4194304),n}function Da(n){for(var i=[],o=0;31>o;o++)i.push(n);return i}function Fi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function ld(n,i,o,u,h,g){var j=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var _=n.entanglements,D=n.expirationTimes,F=n.hiddenUpdates;for(o=j&~o;0<o;){var W=31-Ve(o),ne=1<<W;_[W]=0,D[W]=-1;var V=F[W];if(V!==null)for(F[W]=null,W=0;W<V.length;W++){var Y=V[W];Y!==null&&(Y.lane&=-536870913)}o&=~ne}u!==0&&bl(n,u,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(j&~i))}function bl(n,i,o){n.pendingLanes|=i,n.suspendedLanes&=~i;var u=31-Ve(i);n.entangledLanes|=i,n.entanglements[u]=n.entanglements[u]|1073741824|o&261930}function Sl(n,i){var o=n.entangledLanes|=i;for(n=n.entanglements;o;){var u=31-Ve(o),h=1<<u;h&i|n[u]&i&&(n[u]|=i),o&=~h}}function Zr(n,i){var o=i&-i;return o=(o&42)!==0?1:$(o),(o&(n.suspendedLanes|i))!==0?0:o}function $(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function fe(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function at(){var n=G.p;return n!==0?n:(n=window.event,n===void 0?32:Ov(n.type))}function Qt(n,i){var o=G.p;try{return G.p=n,i()}finally{G.p=o}}var Lt=Math.random().toString(36).slice(2),Et="__reactFiber$"+Lt,Nt="__reactProps$"+Lt,Cn="__reactContainer$"+Lt,en="__reactEvents$"+Lt,cd="__reactListeners$"+Lt,Ys="__reactHandles$"+Lt,Js="__reactResources$"+Lt,ds="__reactMarker$"+Lt;function La(n){delete n[Et],delete n[Nt],delete n[en],delete n[cd],delete n[Ys]}function Xs(n){var i=n[Et];if(i)return i;for(var o=n.parentNode;o;){if(i=o[Cn]||o[Et]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(n=yv(n);n!==null;){if(o=n[Et])return o;n=yv(n)}return i}n=o,o=n.parentNode}return null}function Xn(n){if(n=n[Et]||n[Cn]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function fs(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function Ws(n){var i=n[Js];return i||(i=n[Js]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Mt(n){n[ds]=!0}var qe=new Set,rt={};function Gt(n,i){on(n,i),on(n+"Capture",i)}function on(n,i){for(rt[n]=i,n=0;n<i.length;n++)qe.add(i[n])}var Ma=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]*$"),Kr={},eg={};function r1(n){return zt.call(eg,n)?!0:zt.call(Kr,n)?!1:Ma.test(n)?eg[n]=!0:(Kr[n]=!0,!1)}function jl(n,i,o){if(r1(i))if(o===null)n.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+o)}}function wl(n,i,o){if(o===null)n.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+o)}}function Ns(n,i,o,u){if(u===null)n.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(i,o,""+u)}}function On(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function tg(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function o1(n,i,o){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,g=u.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return h.call(this)},set:function(j){o=""+j,g.call(this,j)}}),Object.defineProperty(n,i,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(j){o=""+j},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function ud(n){if(!n._valueTracker){var i=tg(n)?"checked":"value";n._valueTracker=o1(n,i,""+n[i])}}function ng(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var o=i.getValue(),u="";return n&&(u=tg(n)?n.checked?"true":"false":n.value),n=u,n!==o?(i.setValue(n),!0):!1}function Nl(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var l1=/[\n"\\]/g;function Dn(n){return n.replace(l1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function dd(n,i,o,u,h,g,j,_){n.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.type=j:n.removeAttribute("type"),i!=null?j==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+On(i)):n.value!==""+On(i)&&(n.value=""+On(i)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),i!=null?fd(n,j,On(i)):o!=null?fd(n,j,On(o)):u!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.name=""+On(_):n.removeAttribute("name")}function sg(n,i,o,u,h,g,j,_){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||o!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){ud(n);return}o=o!=null?""+On(o):"",i=i!=null?""+On(i):o,_||i===n.value||(n.value=i),n.defaultValue=i}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=_?n.checked:!!u,n.defaultChecked=!!u,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j),ud(n)}function fd(n,i,o){i==="number"&&Nl(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Ua(n,i,o,u){if(n=n.options,i){i={};for(var h=0;h<o.length;h++)i["$"+o[h]]=!0;for(o=0;o<n.length;o++)h=i.hasOwnProperty("$"+n[o].value),n[o].selected!==h&&(n[o].selected=h),h&&u&&(n[o].defaultSelected=!0)}else{for(o=""+On(o),i=null,h=0;h<n.length;h++){if(n[h].value===o){n[h].selected=!0,u&&(n[h].defaultSelected=!0);return}i!==null||n[h].disabled||(i=n[h])}i!==null&&(i.selected=!0)}}function ig(n,i,o){if(i!=null&&(i=""+On(i),i!==n.value&&(n.value=i),o==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=o!=null?""+On(o):""}function ag(n,i,o,u){if(i==null){if(u!=null){if(o!=null)throw Error(a(92));if(je(u)){if(1<u.length)throw Error(a(93));u=u[0]}o=u}o==null&&(o=""),i=o}o=On(i),n.defaultValue=o,u=n.textContent,u===o&&u!==""&&u!==null&&(n.value=u),ud(n)}function $a(n,i){if(i){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=i;return}}n.textContent=i}var c1=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 rg(n,i,o){var u=i.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":u?n.setProperty(i,o):typeof o!="number"||o===0||c1.has(i)?i==="float"?n.cssFloat=o:n[i]=(""+o).trim():n[i]=o+"px"}function og(n,i,o){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var h in i)u=i[h],i.hasOwnProperty(h)&&o[h]!==u&&rg(n,h,u)}else for(var g in i)i.hasOwnProperty(g)&&rg(n,g,i[g])}function hd(n){if(n.indexOf("-")===-1)return!1;switch(n){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 u1=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"]]),d1=/^[\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 Cl(n){return d1.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Cs(){}var md=null;function pd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Pa=null,Ia=null;function lg(n){var i=Xn(n);if(i&&(n=i.stateNode)){var o=n[Nt]||null;e:switch(n=i.stateNode,i.type){case"input":if(dd(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),i=o.name,o.type==="radio"&&i!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Dn(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var u=o[i];if(u!==n&&u.form===n.form){var h=u[Nt]||null;if(!h)throw Error(a(90));dd(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<o.length;i++)u=o[i],u.form===n.form&&ng(u)}break e;case"textarea":ig(n,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Ua(n,!!o.multiple,i,!1)}}}var gd=!1;function cg(n,i,o){if(gd)return n(i,o);gd=!0;try{var u=n(i);return u}finally{if(gd=!1,(Pa!==null||Ia!==null)&&(fc(),Pa&&(i=Pa,n=Ia,Ia=Pa=null,lg(i),n)))for(i=0;i<n.length;i++)lg(n[i])}}function Vr(n,i){var o=n.stateNode;if(o===null)return null;var u=o[Nt]||null;if(u===null)return null;o=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(a(231,i,typeof o));return o}var ks=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yd=!1;if(ks)try{var Qr={};Object.defineProperty(Qr,"passive",{get:function(){yd=!0}}),window.addEventListener("test",Qr,Qr),window.removeEventListener("test",Qr,Qr)}catch{yd=!1}var ei=null,vd=null,kl=null;function ug(){if(kl)return kl;var n,i=vd,o=i.length,u,h="value"in ei?ei.value:ei.textContent,g=h.length;for(n=0;n<o&&i[n]===h[n];n++);var j=o-n;for(u=1;u<=j&&i[o-u]===h[g-u];u++);return kl=h.slice(n,1<u?1-u:void 0)}function _l(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function zl(){return!0}function dg(){return!1}function pn(n){function i(o,u,h,g,j){this._reactName=o,this._targetInst=h,this.type=u,this.nativeEvent=g,this.target=j,this.currentTarget=null;for(var _ in n)n.hasOwnProperty(_)&&(o=n[_],this[_]=o?o(g):g[_]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?zl:dg,this.isPropagationStopped=dg,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=zl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),i}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},El=pn(Zi),Yr=y({},Zi,{view:0,detail:0}),f1=pn(Yr),xd,bd,Jr,Al=y({},Yr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Jr&&(Jr&&n.type==="mousemove"?(xd=n.screenX-Jr.screenX,bd=n.screenY-Jr.screenY):bd=xd=0,Jr=n),xd)},movementY:function(n){return"movementY"in n?n.movementY:bd}}),fg=pn(Al),h1=y({},Al,{dataTransfer:0}),m1=pn(h1),p1=y({},Yr,{relatedTarget:0}),Sd=pn(p1),g1=y({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),y1=pn(g1),v1=y({},Zi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),x1=pn(v1),b1=y({},Zi,{data:0}),hg=pn(b1),S1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j1={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"},w1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function N1(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=w1[n])?!!i[n]:!1}function jd(){return N1}var C1=y({},Yr,{key:function(n){if(n.key){var i=S1[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=_l(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?j1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jd,charCode:function(n){return n.type==="keypress"?_l(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?_l(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),k1=pn(C1),_1=y({},Al,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mg=pn(_1),z1=y({},Yr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jd}),E1=pn(z1),A1=y({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),R1=pn(A1),T1=y({},Al,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),O1=pn(T1),D1=y({},Zi,{newState:0,oldState:0}),L1=pn(D1),M1=[9,13,27,32],wd=ks&&"CompositionEvent"in window,Xr=null;ks&&"documentMode"in document&&(Xr=document.documentMode);var U1=ks&&"TextEvent"in window&&!Xr,pg=ks&&(!wd||Xr&&8<Xr&&11>=Xr),gg=" ",yg=!1;function vg(n,i){switch(n){case"keyup":return M1.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ba=!1;function $1(n,i){switch(n){case"compositionend":return xg(i);case"keypress":return i.which!==32?null:(yg=!0,gg);case"textInput":return n=i.data,n===gg&&yg?null:n;default:return null}}function P1(n,i){if(Ba)return n==="compositionend"||!wd&&vg(n,i)?(n=ug(),kl=vd=ei=null,Ba=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return pg&&i.locale!=="ko"?null:i.data;default:return null}}var I1={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 bg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!I1[n.type]:i==="textarea"}function Sg(n,i,o,u){Pa?Ia?Ia.push(u):Ia=[u]:Pa=u,i=xc(i,"onChange"),0<i.length&&(o=new El("onChange","change",null,o,u),n.push({event:o,listeners:i}))}var Wr=null,eo=null;function B1(n){sv(n,0)}function Rl(n){var i=fs(n);if(ng(i))return n}function jg(n,i){if(n==="change")return i}var wg=!1;if(ks){var Nd;if(ks){var Cd="oninput"in document;if(!Cd){var Ng=document.createElement("div");Ng.setAttribute("oninput","return;"),Cd=typeof Ng.oninput=="function"}Nd=Cd}else Nd=!1;wg=Nd&&(!document.documentMode||9<document.documentMode)}function Cg(){Wr&&(Wr.detachEvent("onpropertychange",kg),eo=Wr=null)}function kg(n){if(n.propertyName==="value"&&Rl(eo)){var i=[];Sg(i,eo,n,pd(n)),cg(B1,i)}}function q1(n,i,o){n==="focusin"?(Cg(),Wr=i,eo=o,Wr.attachEvent("onpropertychange",kg)):n==="focusout"&&Cg()}function H1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Rl(eo)}function G1(n,i){if(n==="click")return Rl(i)}function F1(n,i){if(n==="input"||n==="change")return Rl(i)}function Z1(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var kn=typeof Object.is=="function"?Object.is:Z1;function to(n,i){if(kn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var o=Object.keys(n),u=Object.keys(i);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var h=o[u];if(!zt.call(i,h)||!kn(n[h],i[h]))return!1}return!0}function _g(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function zg(n,i){var o=_g(n);n=0;for(var u;o;){if(o.nodeType===3){if(u=n+o.textContent.length,n<=i&&u>=i)return{node:o,offset:i-n};n=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=_g(o)}}function Eg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Eg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Ag(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=Nl(n.document);i instanceof n.HTMLIFrameElement;){try{var o=typeof i.contentWindow.location.href=="string"}catch{o=!1}if(o)n=i.contentWindow;else break;i=Nl(n.document)}return i}function kd(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var K1=ks&&"documentMode"in document&&11>=document.documentMode,qa=null,_d=null,no=null,zd=!1;function Rg(n,i,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;zd||qa==null||qa!==Nl(u)||(u=qa,"selectionStart"in u&&kd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),no&&to(no,u)||(no=u,u=xc(_d,"onSelect"),0<u.length&&(i=new El("onSelect","select",null,i,o),n.push({event:i,listeners:u}),i.target=qa)))}function Ki(n,i){var o={};return o[n.toLowerCase()]=i.toLowerCase(),o["Webkit"+n]="webkit"+i,o["Moz"+n]="moz"+i,o}var Ha={animationend:Ki("Animation","AnimationEnd"),animationiteration:Ki("Animation","AnimationIteration"),animationstart:Ki("Animation","AnimationStart"),transitionrun:Ki("Transition","TransitionRun"),transitionstart:Ki("Transition","TransitionStart"),transitioncancel:Ki("Transition","TransitionCancel"),transitionend:Ki("Transition","TransitionEnd")},Ed={},Tg={};ks&&(Tg=document.createElement("div").style,"AnimationEvent"in window||(delete Ha.animationend.animation,delete Ha.animationiteration.animation,delete Ha.animationstart.animation),"TransitionEvent"in window||delete Ha.transitionend.transition);function Vi(n){if(Ed[n])return Ed[n];if(!Ha[n])return n;var i=Ha[n],o;for(o in i)if(i.hasOwnProperty(o)&&o in Tg)return Ed[n]=i[o];return n}var Og=Vi("animationend"),Dg=Vi("animationiteration"),Lg=Vi("animationstart"),V1=Vi("transitionrun"),Q1=Vi("transitionstart"),Y1=Vi("transitioncancel"),Mg=Vi("transitionend"),Ug=new Map,Ad="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(" ");Ad.push("scrollEnd");function Wn(n,i){Ug.set(n,i),Gt(i,[n])}var Tl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Ln=[],Ga=0,Rd=0;function Ol(){for(var n=Ga,i=Rd=Ga=0;i<n;){var o=Ln[i];Ln[i++]=null;var u=Ln[i];Ln[i++]=null;var h=Ln[i];Ln[i++]=null;var g=Ln[i];if(Ln[i++]=null,u!==null&&h!==null){var j=u.pending;j===null?h.next=h:(h.next=j.next,j.next=h),u.pending=h}g!==0&&$g(o,h,g)}}function Dl(n,i,o,u){Ln[Ga++]=n,Ln[Ga++]=i,Ln[Ga++]=o,Ln[Ga++]=u,Rd|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Td(n,i,o,u){return Dl(n,i,o,u),Ll(n)}function Qi(n,i){return Dl(n,null,null,i),Ll(n)}function $g(n,i,o){n.lanes|=o;var u=n.alternate;u!==null&&(u.lanes|=o);for(var h=!1,g=n.return;g!==null;)g.childLanes|=o,u=g.alternate,u!==null&&(u.childLanes|=o),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(h=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,h&&i!==null&&(h=31-Ve(o),n=g.hiddenUpdates,u=n[h],u===null?n[h]=[i]:u.push(i),i.lane=o|536870912),g):null}function Ll(n){if(50<Co)throw Co=0,qf=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Fa={};function J1(n,i,o,u){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(n,i,o,u){return new J1(n,i,o,u)}function Od(n){return n=n.prototype,!(!n||!n.isReactComponent)}function _s(n,i){var o=n.alternate;return o===null?(o=_n(n.tag,i,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=i,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,i=n.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function Pg(n,i){n.flags&=65011714;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,i=o.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Ml(n,i,o,u,h,g){var j=0;if(u=n,typeof n=="function")Od(n)&&(j=1);else if(typeof n=="string")j=nk(n,o,re.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case P:return n=_n(31,o,i,h),n.elementType=P,n.lanes=g,n;case S:return Yi(o.children,h,g,i);case C:j=8,h|=24;break;case k:return n=_n(12,o,i,h|2),n.elementType=k,n.lanes=g,n;case L:return n=_n(13,o,i,h),n.elementType=L,n.lanes=g,n;case M:return n=_n(19,o,i,h),n.elementType=M,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case A:j=10;break e;case E:j=9;break e;case z:j=11;break e;case R:j=14;break e;case T:j=16,u=null;break e}j=29,o=Error(a(130,n===null?"null":typeof n,"")),u=null}return i=_n(j,o,i,h),i.elementType=n,i.type=u,i.lanes=g,i}function Yi(n,i,o,u){return n=_n(7,n,u,i),n.lanes=o,n}function Dd(n,i,o){return n=_n(6,n,null,i),n.lanes=o,n}function Ig(n){var i=_n(18,null,null,0);return i.stateNode=n,i}function Ld(n,i,o){return i=_n(4,n.children!==null?n.children:[],n.key,i),i.lanes=o,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Bg=new WeakMap;function Mn(n,i){if(typeof n=="object"&&n!==null){var o=Bg.get(n);return o!==void 0?o:(i={value:n,source:i,stack:Vt(i)},Bg.set(n,i),i)}return{value:n,source:i,stack:Vt(i)}}var Za=[],Ka=0,Ul=null,so=0,Un=[],$n=0,ti=null,hs=1,ms="";function zs(n,i){Za[Ka++]=so,Za[Ka++]=Ul,Ul=n,so=i}function qg(n,i,o){Un[$n++]=hs,Un[$n++]=ms,Un[$n++]=ti,ti=n;var u=hs;n=ms;var h=32-Ve(u)-1;u&=~(1<<h),o+=1;var g=32-Ve(i)+h;if(30<g){var j=h-h%5;g=(u&(1<<j)-1).toString(32),u>>=j,h-=j,hs=1<<32-Ve(i)+h|o<<h|u,ms=g+n}else hs=1<<g|o<<h|u,ms=n}function Md(n){n.return!==null&&(zs(n,1),qg(n,1,0))}function Ud(n){for(;n===Ul;)Ul=Za[--Ka],Za[Ka]=null,so=Za[--Ka],Za[Ka]=null;for(;n===ti;)ti=Un[--$n],Un[$n]=null,ms=Un[--$n],Un[$n]=null,hs=Un[--$n],Un[$n]=null}function Hg(n,i){Un[$n++]=hs,Un[$n++]=ms,Un[$n++]=ti,hs=i.id,ms=i.overflow,ti=n}var Yt=null,ht=null,Fe=!1,ni=null,Pn=!1,$d=Error(a(519));function si(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw io(Mn(i,n)),$d}function Gg(n){var i=n.stateNode,o=n.type,u=n.memoizedProps;switch(i[Et]=n,i[Nt]=u,o){case"dialog":Pe("cancel",i),Pe("close",i);break;case"iframe":case"object":case"embed":Pe("load",i);break;case"video":case"audio":for(o=0;o<_o.length;o++)Pe(_o[o],i);break;case"source":Pe("error",i);break;case"img":case"image":case"link":Pe("error",i),Pe("load",i);break;case"details":Pe("toggle",i);break;case"input":Pe("invalid",i),sg(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Pe("invalid",i);break;case"textarea":Pe("invalid",i),ag(i,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||i.textContent===""+o||u.suppressHydrationWarning===!0||ov(i.textContent,o)?(u.popover!=null&&(Pe("beforetoggle",i),Pe("toggle",i)),u.onScroll!=null&&Pe("scroll",i),u.onScrollEnd!=null&&Pe("scrollend",i),u.onClick!=null&&(i.onclick=Cs),i=!0):i=!1,i||si(n,!0)}function Fg(n){for(Yt=n.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:Yt=Yt.return}}function Va(n){if(n!==Yt)return!1;if(!Fe)return Fg(n),Fe=!0,!1;var i=n.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||sh(n.type,n.memoizedProps)),o=!o),o&&ht&&si(n),Fg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=gv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=gv(n)}else i===27?(i=ht,yi(n.type)?(n=lh,lh=null,ht=n):ht=i):ht=Yt?Bn(n.stateNode.nextSibling):null;return!0}function Ji(){ht=Yt=null,Fe=!1}function Pd(){var n=ni;return n!==null&&(xn===null?xn=n:xn.push.apply(xn,n),ni=null),n}function io(n){ni===null?ni=[n]:ni.push(n)}var Id=O(null),Xi=null,Es=null;function ii(n,i,o){ie(Id,i._currentValue),i._currentValue=o}function As(n){n._currentValue=Id.current,Z(Id)}function Bd(n,i,o){for(;n!==null;){var u=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),n===o)break;n=n.return}}function qd(n,i,o,u){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var j=h.child;g=g.firstContext;e:for(;g!==null;){var _=g;g=h;for(var D=0;D<i.length;D++)if(_.context===i[D]){g.lanes|=o,_=g.alternate,_!==null&&(_.lanes|=o),Bd(g.return,o,n),u||(j=null);break e}g=_.next}}else if(h.tag===18){if(j=h.return,j===null)throw Error(a(341));j.lanes|=o,g=j.alternate,g!==null&&(g.lanes|=o),Bd(j,o,n),j=null}else j=h.child;if(j!==null)j.return=h;else for(j=h;j!==null;){if(j===n){j=null;break}if(h=j.sibling,h!==null){h.return=j.return,j=h;break}j=j.return}h=j}}function Qa(n,i,o,u){n=null;for(var h=i,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var j=h.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var _=h.type;kn(h.pendingProps.value,j.value)||(n!==null?n.push(_):n=[_])}}else if(h===de.current){if(j=h.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(To):n=[To])}h=h.return}n!==null&&qd(i,n,o,u),i.flags|=262144}function $l(n){for(n=n.firstContext;n!==null;){if(!kn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Wi(n){Xi=n,Es=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Jt(n){return Zg(Xi,n)}function Pl(n,i){return Xi===null&&Wi(n),Zg(n,i)}function Zg(n,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},Es===null){if(n===null)throw Error(a(308));Es=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Es=Es.next=i;return o}var X1=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(o,u){n.push(u)}};this.abort=function(){i.aborted=!0,n.forEach(function(o){return o()})}},W1=e.unstable_scheduleCallback,eC=e.unstable_NormalPriority,Ut={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hd(){return{controller:new X1,data:new Map,refCount:0}}function ao(n){n.refCount--,n.refCount===0&&W1(eC,function(){n.controller.abort()})}var ro=null,Gd=0,Ya=0,Ja=null;function tC(n,i){if(ro===null){var o=ro=[];Gd=0,Ya=Vf(),Ja={status:"pending",value:void 0,then:function(u){o.push(u)}}}return Gd++,i.then(Kg,Kg),i}function Kg(){if(--Gd===0&&ro!==null){Ja!==null&&(Ja.status="fulfilled");var n=ro;ro=null,Ya=0,Ja=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function nC(n,i){var o=[],u={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return n.then(function(){u.status="fulfilled",u.value=i;for(var h=0;h<o.length;h++)(0,o[h])(i)},function(h){for(u.status="rejected",u.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),u}var Vg=B.S;B.S=function(n,i){R0=Be(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&tC(n,i),Vg!==null&&Vg(n,i)};var ea=O(null);function Fd(){var n=ea.current;return n!==null?n:ut.pooledCache}function Il(n,i){i===null?ie(ea,ea.current):ie(ea,i.pool)}function Qg(){var n=Fd();return n===null?null:{parent:Ut._currentValue,pool:n}}var Xa=Error(a(460)),Zd=Error(a(474)),Bl=Error(a(542)),ql={then:function(){}};function Yg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Jg(n,i,o){switch(o=n[o],o===void 0?n.push(i):o!==i&&(i.then(Cs,Cs),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Wg(n),n;default:if(typeof i.status=="string")i.then(Cs,Cs);else{if(n=ut,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(u){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=u}},function(u){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=u}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Wg(n),n}throw na=i,Xa}}function ta(n){try{var i=n._init;return i(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(na=o,Xa):o}}var na=null;function Xg(){if(na===null)throw Error(a(459));var n=na;return na=null,n}function Wg(n){if(n===Xa||n===Bl)throw Error(a(483))}var Wa=null,oo=0;function Hl(n){var i=oo;return oo+=1,Wa===null&&(Wa=[]),Jg(Wa,n,i)}function lo(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Gl(n,i){throw i.$$typeof===x?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function ey(n){function i(I,U){if(n){var H=I.deletions;H===null?(I.deletions=[U],I.flags|=16):H.push(U)}}function o(I,U){if(!n)return null;for(;U!==null;)i(I,U),U=U.sibling;return null}function u(I){for(var U=new Map;I!==null;)I.key!==null?U.set(I.key,I):U.set(I.index,I),I=I.sibling;return U}function h(I,U){return I=_s(I,U),I.index=0,I.sibling=null,I}function g(I,U,H){return I.index=H,n?(H=I.alternate,H!==null?(H=H.index,H<U?(I.flags|=67108866,U):H):(I.flags|=67108866,U)):(I.flags|=1048576,U)}function j(I){return n&&I.alternate===null&&(I.flags|=67108866),I}function _(I,U,H,ee){return U===null||U.tag!==6?(U=Dd(H,I.mode,ee),U.return=I,U):(U=h(U,H),U.return=I,U)}function D(I,U,H,ee){var Ne=H.type;return Ne===S?W(I,U,H.props.children,ee,H.key):U!==null&&(U.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===T&&ta(Ne)===U.type)?(U=h(U,H.props),lo(U,H),U.return=I,U):(U=Ml(H.type,H.key,H.props,null,I.mode,ee),lo(U,H),U.return=I,U)}function F(I,U,H,ee){return U===null||U.tag!==4||U.stateNode.containerInfo!==H.containerInfo||U.stateNode.implementation!==H.implementation?(U=Ld(H,I.mode,ee),U.return=I,U):(U=h(U,H.children||[]),U.return=I,U)}function W(I,U,H,ee,Ne){return U===null||U.tag!==7?(U=Yi(H,I.mode,ee,Ne),U.return=I,U):(U=h(U,H),U.return=I,U)}function ne(I,U,H){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Dd(""+U,I.mode,H),U.return=I,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case b:return H=Ml(U.type,U.key,U.props,null,I.mode,H),lo(H,U),H.return=I,H;case w:return U=Ld(U,I.mode,H),U.return=I,U;case T:return U=ta(U),ne(I,U,H)}if(je(U)||se(U))return U=Yi(U,I.mode,H,null),U.return=I,U;if(typeof U.then=="function")return ne(I,Hl(U),H);if(U.$$typeof===A)return ne(I,Pl(I,U),H);Gl(I,U)}return null}function V(I,U,H,ee){var Ne=U!==null?U.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Ne!==null?null:_(I,U,""+H,ee);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return H.key===Ne?D(I,U,H,ee):null;case w:return H.key===Ne?F(I,U,H,ee):null;case T:return H=ta(H),V(I,U,H,ee)}if(je(H)||se(H))return Ne!==null?null:W(I,U,H,ee,null);if(typeof H.then=="function")return V(I,U,Hl(H),ee);if(H.$$typeof===A)return V(I,U,Pl(I,H),ee);Gl(I,H)}return null}function Y(I,U,H,ee,Ne){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return I=I.get(H)||null,_(U,I,""+ee,Ne);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return I=I.get(ee.key===null?H:ee.key)||null,D(U,I,ee,Ne);case w:return I=I.get(ee.key===null?H:ee.key)||null,F(U,I,ee,Ne);case T:return ee=ta(ee),Y(I,U,H,ee,Ne)}if(je(ee)||se(ee))return I=I.get(H)||null,W(U,I,ee,Ne,null);if(typeof ee.then=="function")return Y(I,U,H,Hl(ee),Ne);if(ee.$$typeof===A)return Y(I,U,H,Pl(U,ee),Ne);Gl(U,ee)}return null}function ve(I,U,H,ee){for(var Ne=null,Ye=null,Se=U,Te=U=0,Ge=null;Se!==null&&Te<H.length;Te++){Se.index>Te?(Ge=Se,Se=null):Ge=Se.sibling;var Je=V(I,Se,H[Te],ee);if(Je===null){Se===null&&(Se=Ge);break}n&&Se&&Je.alternate===null&&i(I,Se),U=g(Je,U,Te),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je,Se=Ge}if(Te===H.length)return o(I,Se),Fe&&zs(I,Te),Ne;if(Se===null){for(;Te<H.length;Te++)Se=ne(I,H[Te],ee),Se!==null&&(U=g(Se,U,Te),Ye===null?Ne=Se:Ye.sibling=Se,Ye=Se);return Fe&&zs(I,Te),Ne}for(Se=u(Se);Te<H.length;Te++)Ge=Y(Se,I,Te,H[Te],ee),Ge!==null&&(n&&Ge.alternate!==null&&Se.delete(Ge.key===null?Te:Ge.key),U=g(Ge,U,Te),Ye===null?Ne=Ge:Ye.sibling=Ge,Ye=Ge);return n&&Se.forEach(function(ji){return i(I,ji)}),Fe&&zs(I,Te),Ne}function Ce(I,U,H,ee){if(H==null)throw Error(a(151));for(var Ne=null,Ye=null,Se=U,Te=U=0,Ge=null,Je=H.next();Se!==null&&!Je.done;Te++,Je=H.next()){Se.index>Te?(Ge=Se,Se=null):Ge=Se.sibling;var ji=V(I,Se,Je.value,ee);if(ji===null){Se===null&&(Se=Ge);break}n&&Se&&ji.alternate===null&&i(I,Se),U=g(ji,U,Te),Ye===null?Ne=ji:Ye.sibling=ji,Ye=ji,Se=Ge}if(Je.done)return o(I,Se),Fe&&zs(I,Te),Ne;if(Se===null){for(;!Je.done;Te++,Je=H.next())Je=ne(I,Je.value,ee),Je!==null&&(U=g(Je,U,Te),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je);return Fe&&zs(I,Te),Ne}for(Se=u(Se);!Je.done;Te++,Je=H.next())Je=Y(Se,I,Te,Je.value,ee),Je!==null&&(n&&Je.alternate!==null&&Se.delete(Je.key===null?Te:Je.key),U=g(Je,U,Te),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je);return n&&Se.forEach(function(hk){return i(I,hk)}),Fe&&zs(I,Te),Ne}function ct(I,U,H,ee){if(typeof H=="object"&&H!==null&&H.type===S&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case b:e:{for(var Ne=H.key;U!==null;){if(U.key===Ne){if(Ne=H.type,Ne===S){if(U.tag===7){o(I,U.sibling),ee=h(U,H.props.children),ee.return=I,I=ee;break e}}else if(U.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===T&&ta(Ne)===U.type){o(I,U.sibling),ee=h(U,H.props),lo(ee,H),ee.return=I,I=ee;break e}o(I,U);break}else i(I,U);U=U.sibling}H.type===S?(ee=Yi(H.props.children,I.mode,ee,H.key),ee.return=I,I=ee):(ee=Ml(H.type,H.key,H.props,null,I.mode,ee),lo(ee,H),ee.return=I,I=ee)}return j(I);case w:e:{for(Ne=H.key;U!==null;){if(U.key===Ne)if(U.tag===4&&U.stateNode.containerInfo===H.containerInfo&&U.stateNode.implementation===H.implementation){o(I,U.sibling),ee=h(U,H.children||[]),ee.return=I,I=ee;break e}else{o(I,U);break}else i(I,U);U=U.sibling}ee=Ld(H,I.mode,ee),ee.return=I,I=ee}return j(I);case T:return H=ta(H),ct(I,U,H,ee)}if(je(H))return ve(I,U,H,ee);if(se(H)){if(Ne=se(H),typeof Ne!="function")throw Error(a(150));return H=Ne.call(H),Ce(I,U,H,ee)}if(typeof H.then=="function")return ct(I,U,Hl(H),ee);if(H.$$typeof===A)return ct(I,U,Pl(I,H),ee);Gl(I,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,U!==null&&U.tag===6?(o(I,U.sibling),ee=h(U,H),ee.return=I,I=ee):(o(I,U),ee=Dd(H,I.mode,ee),ee.return=I,I=ee),j(I)):o(I,U)}return function(I,U,H,ee){try{oo=0;var Ne=ct(I,U,H,ee);return Wa=null,Ne}catch(Se){if(Se===Xa||Se===Bl)throw Se;var Ye=_n(29,Se,null,I.mode);return Ye.lanes=ee,Ye.return=I,Ye}}}var sa=ey(!0),ty=ey(!1),ai=!1;function Kd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vd(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ri(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function oi(n,i,o){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Xe&2)!==0){var h=u.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),u.pending=i,i=Ll(n),$g(n,null,o),i}return Dl(n,u,i,o),Ll(n)}function co(n,i,o){if(i=i.updateQueue,i!==null&&(i=i.shared,(o&4194048)!==0)){var u=i.lanes;u&=n.pendingLanes,o|=u,i.lanes=o,Sl(n,o)}}function Qd(n,i){var o=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var h=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var j={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?h=g=j:g=g.next=j,o=o.next}while(o!==null);g===null?h=g=i:g=g.next=i}else h=g=i;o={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=i:n.next=i,o.lastBaseUpdate=i}var Yd=!1;function uo(){if(Yd){var n=Ja;if(n!==null)throw n}}function fo(n,i,o,u){Yd=!1;var h=n.updateQueue;ai=!1;var g=h.firstBaseUpdate,j=h.lastBaseUpdate,_=h.shared.pending;if(_!==null){h.shared.pending=null;var D=_,F=D.next;D.next=null,j===null?g=F:j.next=F,j=D;var W=n.alternate;W!==null&&(W=W.updateQueue,_=W.lastBaseUpdate,_!==j&&(_===null?W.firstBaseUpdate=F:_.next=F,W.lastBaseUpdate=D))}if(g!==null){var ne=h.baseState;j=0,W=F=D=null,_=g;do{var V=_.lane&-536870913,Y=V!==_.lane;if(Y?(He&V)===V:(u&V)===V){V!==0&&V===Ya&&(Yd=!0),W!==null&&(W=W.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ve=n,Ce=_;V=i;var ct=o;switch(Ce.tag){case 1:if(ve=Ce.payload,typeof ve=="function"){ne=ve.call(ct,ne,V);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Ce.payload,V=typeof ve=="function"?ve.call(ct,ne,V):ve,V==null)break e;ne=y({},ne,V);break e;case 2:ai=!0}}V=_.callback,V!==null&&(n.flags|=64,Y&&(n.flags|=8192),Y=h.callbacks,Y===null?h.callbacks=[V]:Y.push(V))}else Y={lane:V,tag:_.tag,payload:_.payload,callback:_.callback,next:null},W===null?(F=W=Y,D=ne):W=W.next=Y,j|=V;if(_=_.next,_===null){if(_=h.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,h.lastBaseUpdate=Y,h.shared.pending=null}}while(!0);W===null&&(D=ne),h.baseState=D,h.firstBaseUpdate=F,h.lastBaseUpdate=W,g===null&&(h.shared.lanes=0),fi|=j,n.lanes=j,n.memoizedState=ne}}function ny(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function sy(n,i){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)ny(o[n],i)}var er=O(null),Fl=O(0);function iy(n,i){n=Ps,ie(Fl,n),ie(er,i),Ps=n|i.baseLanes}function Jd(){ie(Fl,Ps),ie(er,er.current)}function Xd(){Ps=Fl.current,Z(er),Z(Fl)}var zn=O(null),In=null;function li(n){var i=n.alternate;ie(At,At.current&1),ie(zn,n),In===null&&(i===null||er.current!==null||i.memoizedState!==null)&&(In=n)}function Wd(n){ie(At,At.current),ie(zn,n),In===null&&(In=n)}function ay(n){n.tag===22?(ie(At,At.current),ie(zn,n),In===null&&(In=n)):ci()}function ci(){ie(At,At.current),ie(zn,zn.current)}function En(n){Z(zn),In===n&&(In=null),Z(At)}var At=O(0);function Zl(n){for(var i=n;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||rh(o)||oh(o)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Rs=0,Re=null,ot=null,$t=null,Kl=!1,tr=!1,ia=!1,Vl=0,ho=0,nr=null,sC=0;function Ct(){throw Error(a(321))}function ef(n,i){if(i===null)return!1;for(var o=0;o<i.length&&o<n.length;o++)if(!kn(n[o],i[o]))return!1;return!0}function tf(n,i,o,u,h,g){return Rs=g,Re=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,B.H=n===null||n.memoizedState===null?qy:yf,ia=!1,g=o(u,h),ia=!1,tr&&(g=oy(i,o,u,h)),ry(n),g}function ry(n){B.H=go;var i=ot!==null&&ot.next!==null;if(Rs=0,$t=ot=Re=null,Kl=!1,ho=0,nr=null,i)throw Error(a(300));n===null||Pt||(n=n.dependencies,n!==null&&$l(n)&&(Pt=!0))}function oy(n,i,o,u){Re=n;var h=0;do{if(tr&&(nr=null),ho=0,tr=!1,25<=h)throw Error(a(301));if(h+=1,$t=ot=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}B.H=Hy,g=i(o,u)}while(tr);return g}function iC(){var n=B.H,i=n.useState()[0];return i=typeof i.then=="function"?mo(i):i,n=n.useState()[0],(ot!==null?ot.memoizedState:null)!==n&&(Re.flags|=1024),i}function nf(){var n=Vl!==0;return Vl=0,n}function sf(n,i,o){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~o}function af(n){if(Kl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Kl=!1}Rs=0,$t=ot=Re=null,tr=!1,ho=Vl=0,nr=null}function ln(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Re.memoizedState=$t=n:$t=$t.next=n,$t}function Rt(){if(ot===null){var n=Re.alternate;n=n!==null?n.memoizedState:null}else n=ot.next;var i=$t===null?Re.memoizedState:$t.next;if(i!==null)$t=i,ot=n;else{if(n===null)throw Re.alternate===null?Error(a(467)):Error(a(310));ot=n,n={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},$t===null?Re.memoizedState=$t=n:$t=$t.next=n}return $t}function Ql(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function mo(n){var i=ho;return ho+=1,nr===null&&(nr=[]),n=Jg(nr,n,i),i=Re,($t===null?i.memoizedState:$t.next)===null&&(i=i.alternate,B.H=i===null||i.memoizedState===null?qy:yf),n}function Yl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return mo(n);if(n.$$typeof===A)return Jt(n)}throw Error(a(438,String(n)))}function rf(n){var i=null,o=Re.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var u=Re.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),o===null&&(o=Ql(),Re.updateQueue=o),o.memoCache=i,o=i.data[i.index],o===void 0)for(o=i.data[i.index]=Array(n),u=0;u<n;u++)o[u]=J;return i.index++,o}function Ts(n,i){return typeof i=="function"?i(n):i}function Jl(n){var i=Rt();return of(i,ot,n)}function of(n,i,o){var u=n.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=o;var h=n.baseQueue,g=u.pending;if(g!==null){if(h!==null){var j=h.next;h.next=g.next,g.next=j}i.baseQueue=h=g,u.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var _=j=null,D=null,F=i,W=!1;do{var ne=F.lane&-536870913;if(ne!==F.lane?(He&ne)===ne:(Rs&ne)===ne){var V=F.revertLane;if(V===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ne===Ya&&(W=!0);else if((Rs&V)===V){F=F.next,V===Ya&&(W=!0);continue}else ne={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=ne,j=g):D=D.next=ne,Re.lanes|=V,fi|=V;ne=F.action,ia&&o(g,ne),g=F.hasEagerState?F.eagerState:o(g,ne)}else V={lane:ne,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=V,j=g):D=D.next=V,Re.lanes|=ne,fi|=ne;F=F.next}while(F!==null&&F!==i);if(D===null?j=g:D.next=_,!kn(g,n.memoizedState)&&(Pt=!0,W&&(o=Ja,o!==null)))throw o;n.memoizedState=g,n.baseState=j,n.baseQueue=D,u.lastRenderedState=g}return h===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function lf(n){var i=Rt(),o=i.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=n;var u=o.dispatch,h=o.pending,g=i.memoizedState;if(h!==null){o.pending=null;var j=h=h.next;do g=n(g,j.action),j=j.next;while(j!==h);kn(g,i.memoizedState)||(Pt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),o.lastRenderedState=g}return[g,u]}function ly(n,i,o){var u=Re,h=Rt(),g=Fe;if(g){if(o===void 0)throw Error(a(407));o=o()}else o=i();var j=!kn((ot||h).memoizedState,o);if(j&&(h.memoizedState=o,Pt=!0),h=h.queue,df(dy.bind(null,u,h,n),[n]),h.getSnapshot!==i||j||$t!==null&&$t.memoizedState.tag&1){if(u.flags|=2048,sr(9,{destroy:void 0},uy.bind(null,u,h,o,i),null),ut===null)throw Error(a(349));g||(Rs&127)!==0||cy(u,i,o)}return o}function cy(n,i,o){n.flags|=16384,n={getSnapshot:i,value:o},i=Re.updateQueue,i===null?(i=Ql(),Re.updateQueue=i,i.stores=[n]):(o=i.stores,o===null?i.stores=[n]:o.push(n))}function uy(n,i,o,u){i.value=o,i.getSnapshot=u,fy(i)&&hy(n)}function dy(n,i,o){return o(function(){fy(i)&&hy(n)})}function fy(n){var i=n.getSnapshot;n=n.value;try{var o=i();return!kn(n,o)}catch{return!0}}function hy(n){var i=Qi(n,2);i!==null&&bn(i,n,2)}function cf(n){var i=ln();if(typeof n=="function"){var o=n;if(n=o(),ia){Ht(!0);try{o()}finally{Ht(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:n},i}function my(n,i,o,u){return n.baseState=o,of(n,ot,typeof u=="function"?u:Ts)}function aC(n,i,o,u,h){if(ec(n))throw Error(a(485));if(n=i.action,n!==null){var g={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){g.listeners.push(j)}};B.T!==null?o(!0):g.isTransition=!1,u(g),o=i.pending,o===null?(g.next=i.pending=g,py(i,g)):(g.next=o.next,i.pending=o.next=g)}}function py(n,i){var o=i.action,u=i.payload,h=n.state;if(i.isTransition){var g=B.T,j={};B.T=j;try{var _=o(h,u),D=B.S;D!==null&&D(j,_),gy(n,i,_)}catch(F){uf(n,i,F)}finally{g!==null&&j.types!==null&&(g.types=j.types),B.T=g}}else try{g=o(h,u),gy(n,i,g)}catch(F){uf(n,i,F)}}function gy(n,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){yy(n,i,u)},function(u){return uf(n,i,u)}):yy(n,i,o)}function yy(n,i,o){i.status="fulfilled",i.value=o,vy(i),n.state=o,i=n.pending,i!==null&&(o=i.next,o===i?n.pending=null:(o=o.next,i.next=o,py(n,o)))}function uf(n,i,o){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=o,vy(i),i=i.next;while(i!==u)}n.action=null}function vy(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function xy(n,i){return i}function by(n,i){if(Fe){var o=ut.formState;if(o!==null){e:{var u=Re;if(Fe){if(ht){t:{for(var h=ht,g=Pn;h.nodeType!==8;){if(!g){h=null;break t}if(h=Bn(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){ht=Bn(h.nextSibling),u=h.data==="F!";break e}}si(u)}u=!1}u&&(i=o[0])}}return o=ln(),o.memoizedState=o.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xy,lastRenderedState:i},o.queue=u,o=Py.bind(null,Re,u),u.dispatch=o,u=cf(!1),g=gf.bind(null,Re,!1,u.queue),u=ln(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,o=aC.bind(null,Re,h,g,o),h.dispatch=o,u.memoizedState=n,[i,o,!1]}function Sy(n){var i=Rt();return jy(i,ot,n)}function jy(n,i,o){if(i=of(n,i,xy)[0],n=Jl(Ts)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=mo(i)}catch(j){throw j===Xa?Bl:j}else u=i;i=Rt();var h=i.queue,g=h.dispatch;return o!==i.memoizedState&&(Re.flags|=2048,sr(9,{destroy:void 0},rC.bind(null,h,o),null)),[u,g,n]}function rC(n,i){n.action=i}function wy(n){var i=Rt(),o=ot;if(o!==null)return jy(i,o,n);Rt(),i=i.memoizedState,o=Rt();var u=o.queue.dispatch;return o.memoizedState=n,[i,u,!1]}function sr(n,i,o,u){return n={tag:n,create:o,deps:u,inst:i,next:null},i=Re.updateQueue,i===null&&(i=Ql(),Re.updateQueue=i),o=i.lastEffect,o===null?i.lastEffect=n.next=n:(u=o.next,o.next=n,n.next=u,i.lastEffect=n),n}function Ny(){return Rt().memoizedState}function Xl(n,i,o,u){var h=ln();Re.flags|=n,h.memoizedState=sr(1|i,{destroy:void 0},o,u===void 0?null:u)}function Wl(n,i,o,u){var h=Rt();u=u===void 0?null:u;var g=h.memoizedState.inst;ot!==null&&u!==null&&ef(u,ot.memoizedState.deps)?h.memoizedState=sr(i,g,o,u):(Re.flags|=n,h.memoizedState=sr(1|i,g,o,u))}function Cy(n,i){Xl(8390656,8,n,i)}function df(n,i){Wl(2048,8,n,i)}function oC(n){Re.flags|=4;var i=Re.updateQueue;if(i===null)i=Ql(),Re.updateQueue=i,i.events=[n];else{var o=i.events;o===null?i.events=[n]:o.push(n)}}function ky(n){var i=Rt().memoizedState;return oC({ref:i,nextImpl:n}),function(){if((Xe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function _y(n,i){return Wl(4,2,n,i)}function zy(n,i){return Wl(4,4,n,i)}function Ey(n,i){if(typeof i=="function"){n=n();var o=i(n);return function(){typeof o=="function"?o():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Ay(n,i,o){o=o!=null?o.concat([n]):null,Wl(4,4,Ey.bind(null,i,n),o)}function ff(){}function Ry(n,i){var o=Rt();i=i===void 0?null:i;var u=o.memoizedState;return i!==null&&ef(i,u[1])?u[0]:(o.memoizedState=[n,i],n)}function Ty(n,i){var o=Rt();i=i===void 0?null:i;var u=o.memoizedState;if(i!==null&&ef(i,u[1]))return u[0];if(u=n(),ia){Ht(!0);try{n()}finally{Ht(!1)}}return o.memoizedState=[u,i],u}function hf(n,i,o){return o===void 0||(Rs&1073741824)!==0&&(He&261930)===0?n.memoizedState=i:(n.memoizedState=o,n=O0(),Re.lanes|=n,fi|=n,o)}function Oy(n,i,o,u){return kn(o,i)?o:er.current!==null?(n=hf(n,o,u),kn(n,i)||(Pt=!0),n):(Rs&42)===0||(Rs&1073741824)!==0&&(He&261930)===0?(Pt=!0,n.memoizedState=o):(n=O0(),Re.lanes|=n,fi|=n,i)}function Dy(n,i,o,u,h){var g=G.p;G.p=g!==0&&8>g?g:8;var j=B.T,_={};B.T=_,gf(n,!1,i,o);try{var D=h(),F=B.S;if(F!==null&&F(_,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var W=nC(D,u);po(n,i,W,Tn(n))}else po(n,i,u,Tn(n))}catch(ne){po(n,i,{then:function(){},status:"rejected",reason:ne},Tn())}finally{G.p=g,j!==null&&_.types!==null&&(j.types=_.types),B.T=j}}function lC(){}function mf(n,i,o,u){if(n.tag!==5)throw Error(a(476));var h=Ly(n).queue;Dy(n,h,i,oe,o===null?lC:function(){return My(n),o(u)})}function Ly(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:oe},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:o},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function My(n){var i=Ly(n);i.next===null&&(i=n.alternate.memoizedState),po(n,i.next.queue,{},Tn())}function pf(){return Jt(To)}function Uy(){return Rt().memoizedState}function $y(){return Rt().memoizedState}function cC(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var o=Tn();n=ri(o);var u=oi(i,n,o);u!==null&&(bn(u,i,o),co(u,i,o)),i={cache:Hd()},n.payload=i;return}i=i.return}}function uC(n,i,o){var u=Tn();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ec(n)?Iy(i,o):(o=Td(n,i,o,u),o!==null&&(bn(o,n,u),By(o,i,u)))}function Py(n,i,o){var u=Tn();po(n,i,o,u)}function po(n,i,o,u){var h={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(ec(n))Iy(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var j=i.lastRenderedState,_=g(j,o);if(h.hasEagerState=!0,h.eagerState=_,kn(_,j))return Dl(n,i,h,0),ut===null&&Ol(),!1}catch{}if(o=Td(n,i,h,u),o!==null)return bn(o,n,u),By(o,i,u),!0}return!1}function gf(n,i,o,u){if(u={lane:2,revertLane:Vf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ec(n)){if(i)throw Error(a(479))}else i=Td(n,o,u,2),i!==null&&bn(i,n,2)}function ec(n){var i=n.alternate;return n===Re||i!==null&&i===Re}function Iy(n,i){tr=Kl=!0;var o=n.pending;o===null?i.next=i:(i.next=o.next,o.next=i),n.pending=i}function By(n,i,o){if((o&4194048)!==0){var u=i.lanes;u&=n.pendingLanes,o|=u,i.lanes=o,Sl(n,o)}}var go={readContext:Jt,use:Yl,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};go.useEffectEvent=Ct;var qy={readContext:Jt,use:Yl,useCallback:function(n,i){return ln().memoizedState=[n,i===void 0?null:i],n},useContext:Jt,useEffect:Cy,useImperativeHandle:function(n,i,o){o=o!=null?o.concat([n]):null,Xl(4194308,4,Ey.bind(null,i,n),o)},useLayoutEffect:function(n,i){return Xl(4194308,4,n,i)},useInsertionEffect:function(n,i){Xl(4,2,n,i)},useMemo:function(n,i){var o=ln();i=i===void 0?null:i;var u=n();if(ia){Ht(!0);try{n()}finally{Ht(!1)}}return o.memoizedState=[u,i],u},useReducer:function(n,i,o){var u=ln();if(o!==void 0){var h=o(i);if(ia){Ht(!0);try{o(i)}finally{Ht(!1)}}}else h=i;return u.memoizedState=u.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},u.queue=n,n=n.dispatch=uC.bind(null,Re,n),[u.memoizedState,n]},useRef:function(n){var i=ln();return n={current:n},i.memoizedState=n},useState:function(n){n=cf(n);var i=n.queue,o=Py.bind(null,Re,i);return i.dispatch=o,[n.memoizedState,o]},useDebugValue:ff,useDeferredValue:function(n,i){var o=ln();return hf(o,n,i)},useTransition:function(){var n=cf(!1);return n=Dy.bind(null,Re,n.queue,!0,!1),ln().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,o){var u=Re,h=ln();if(Fe){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),ut===null)throw Error(a(349));(He&127)!==0||cy(u,i,o)}h.memoizedState=o;var g={value:o,getSnapshot:i};return h.queue=g,Cy(dy.bind(null,u,g,n),[n]),u.flags|=2048,sr(9,{destroy:void 0},uy.bind(null,u,g,o,i),null),o},useId:function(){var n=ln(),i=ut.identifierPrefix;if(Fe){var o=ms,u=hs;o=(u&~(1<<32-Ve(u)-1)).toString(32)+o,i="_"+i+"R_"+o,o=Vl++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=sC++,i="_"+i+"r_"+o.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:pf,useFormState:by,useActionState:by,useOptimistic:function(n){var i=ln();i.memoizedState=i.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=gf.bind(null,Re,!0,o),o.dispatch=i,[n,i]},useMemoCache:rf,useCacheRefresh:function(){return ln().memoizedState=cC.bind(null,Re)},useEffectEvent:function(n){var i=ln(),o={impl:n};return i.memoizedState=o,function(){if((Xe&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},yf={readContext:Jt,use:Yl,useCallback:Ry,useContext:Jt,useEffect:df,useImperativeHandle:Ay,useInsertionEffect:_y,useLayoutEffect:zy,useMemo:Ty,useReducer:Jl,useRef:Ny,useState:function(){return Jl(Ts)},useDebugValue:ff,useDeferredValue:function(n,i){var o=Rt();return Oy(o,ot.memoizedState,n,i)},useTransition:function(){var n=Jl(Ts)[0],i=Rt().memoizedState;return[typeof n=="boolean"?n:mo(n),i]},useSyncExternalStore:ly,useId:Uy,useHostTransitionStatus:pf,useFormState:Sy,useActionState:Sy,useOptimistic:function(n,i){var o=Rt();return my(o,ot,n,i)},useMemoCache:rf,useCacheRefresh:$y};yf.useEffectEvent=ky;var Hy={readContext:Jt,use:Yl,useCallback:Ry,useContext:Jt,useEffect:df,useImperativeHandle:Ay,useInsertionEffect:_y,useLayoutEffect:zy,useMemo:Ty,useReducer:lf,useRef:Ny,useState:function(){return lf(Ts)},useDebugValue:ff,useDeferredValue:function(n,i){var o=Rt();return ot===null?hf(o,n,i):Oy(o,ot.memoizedState,n,i)},useTransition:function(){var n=lf(Ts)[0],i=Rt().memoizedState;return[typeof n=="boolean"?n:mo(n),i]},useSyncExternalStore:ly,useId:Uy,useHostTransitionStatus:pf,useFormState:wy,useActionState:wy,useOptimistic:function(n,i){var o=Rt();return ot!==null?my(o,ot,n,i):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:rf,useCacheRefresh:$y};Hy.useEffectEvent=ky;function vf(n,i,o,u){i=n.memoizedState,o=o(u,i),o=o==null?i:y({},i,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var xf={enqueueSetState:function(n,i,o){n=n._reactInternals;var u=Tn(),h=ri(u);h.payload=i,o!=null&&(h.callback=o),i=oi(n,h,u),i!==null&&(bn(i,n,u),co(i,n,u))},enqueueReplaceState:function(n,i,o){n=n._reactInternals;var u=Tn(),h=ri(u);h.tag=1,h.payload=i,o!=null&&(h.callback=o),i=oi(n,h,u),i!==null&&(bn(i,n,u),co(i,n,u))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var o=Tn(),u=ri(o);u.tag=2,i!=null&&(u.callback=i),i=oi(n,u,o),i!==null&&(bn(i,n,o),co(i,n,o))}};function Gy(n,i,o,u,h,g,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,g,j):i.prototype&&i.prototype.isPureReactComponent?!to(o,u)||!to(h,g):!0}function Fy(n,i,o,u){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(o,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(o,u),i.state!==n&&xf.enqueueReplaceState(i,i.state,null)}function aa(n,i){var o=i;if("ref"in i){o={};for(var u in i)u!=="ref"&&(o[u]=i[u])}if(n=n.defaultProps){o===i&&(o=y({},o));for(var h in n)o[h]===void 0&&(o[h]=n[h])}return o}function Zy(n){Tl(n)}function Ky(n){console.error(n)}function Vy(n){Tl(n)}function tc(n,i){try{var o=n.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function Qy(n,i,o){try{var u=n.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function bf(n,i,o){return o=ri(o),o.tag=3,o.payload={element:null},o.callback=function(){tc(n,i)},o}function Yy(n){return n=ri(n),n.tag=3,n}function Jy(n,i,o,u){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var g=u.value;n.payload=function(){return h(g)},n.callback=function(){Qy(i,o,u)}}var j=o.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){Qy(i,o,u),typeof h!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var _=u.stack;this.componentDidCatch(u.value,{componentStack:_!==null?_:""})})}function dC(n,i,o,u,h){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=o.alternate,i!==null&&Qa(i,o,h,!0),o=zn.current,o!==null){switch(o.tag){case 31:case 13:return In===null?hc():o.alternate===null&&kt===0&&(kt=3),o.flags&=-257,o.flags|=65536,o.lanes=h,u===ql?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([u]):i.add(u),Ff(n,u,h)),!1;case 22:return o.flags|=65536,u===ql?o.flags|=16384:(i=o.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=i):(o=i.retryQueue,o===null?i.retryQueue=new Set([u]):o.add(u)),Ff(n,u,h)),!1}throw Error(a(435,o.tag))}return Ff(n,u,h),hc(),!1}if(Fe)return i=zn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,u!==$d&&(n=Error(a(422),{cause:u}),io(Mn(n,o)))):(u!==$d&&(i=Error(a(423),{cause:u}),io(Mn(i,o))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,u=Mn(u,o),h=bf(n.stateNode,u,h),Qd(n,h),kt!==4&&(kt=2)),!1;var g=Error(a(520),{cause:u});if(g=Mn(g,o),No===null?No=[g]:No.push(g),kt!==4&&(kt=2),i===null)return!0;u=Mn(u,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,n=h&-h,o.lanes|=n,n=bf(o.stateNode,u,n),Qd(o,n),!1;case 1:if(i=o.type,g=o.stateNode,(o.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(hi===null||!hi.has(g))))return o.flags|=65536,h&=-h,o.lanes|=h,h=Yy(h),Jy(h,n,o,u),Qd(o,h),!1}o=o.return}while(o!==null);return!1}var Sf=Error(a(461)),Pt=!1;function Xt(n,i,o,u){i.child=n===null?ty(i,null,o,u):sa(i,n.child,o,u)}function Xy(n,i,o,u,h){o=o.render;var g=i.ref;if("ref"in u){var j={};for(var _ in u)_!=="ref"&&(j[_]=u[_])}else j=u;return Wi(i),u=tf(n,i,o,j,g,h),_=nf(),n!==null&&!Pt?(sf(n,i,h),Os(n,i,h)):(Fe&&_&&Md(i),i.flags|=1,Xt(n,i,u,h),i.child)}function Wy(n,i,o,u,h){if(n===null){var g=o.type;return typeof g=="function"&&!Od(g)&&g.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=g,e0(n,i,g,u,h)):(n=Ml(o.type,null,u,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!Ef(n,h)){var j=g.memoizedProps;if(o=o.compare,o=o!==null?o:to,o(j,u)&&n.ref===i.ref)return Os(n,i,h)}return i.flags|=1,n=_s(g,u),n.ref=i.ref,n.return=i,i.child=n}function e0(n,i,o,u,h){if(n!==null){var g=n.memoizedProps;if(to(g,u)&&n.ref===i.ref)if(Pt=!1,i.pendingProps=u=g,Ef(n,h))(n.flags&131072)!==0&&(Pt=!0);else return i.lanes=n.lanes,Os(n,i,h)}return jf(n,i,o,u,h)}function t0(n,i,o,u){var h=u.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|o:o,n!==null){for(u=i.child=n.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~g}else u=0,i.child=null;return n0(n,i,g,o,u)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Il(i,g!==null?g.cachePool:null),g!==null?iy(i,g):Jd(),ay(i);else return u=i.lanes=536870912,n0(n,i,g!==null?g.baseLanes|o:o,o,u)}else g!==null?(Il(i,g.cachePool),iy(i,g),ci(),i.memoizedState=null):(n!==null&&Il(i,null),Jd(),ci());return Xt(n,i,h,o),i.child}function yo(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function n0(n,i,o,u,h){var g=Fd();return g=g===null?null:{parent:Ut._currentValue,pool:g},i.memoizedState={baseLanes:o,cachePool:g},n!==null&&Il(i,null),Jd(),ay(i),n!==null&&Qa(n,i,u,!0),i.childLanes=h,null}function nc(n,i){return i=ic({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function s0(n,i,o){return sa(i,n.child,null,o),n=nc(i,i.pendingProps),n.flags|=2,En(i),i.memoizedState=null,n}function fC(n,i,o){var u=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Fe){if(u.mode==="hidden")return n=nc(i,u),i.lanes=536870912,yo(null,n);if(Wd(i),(n=ht)?(n=pv(n,Pn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ti!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},o=Ig(n),o.return=i,i.child=o,Yt=i,ht=null)):n=null,n===null)throw si(i);return i.lanes=536870912,null}return nc(i,u)}var g=n.memoizedState;if(g!==null){var j=g.dehydrated;if(Wd(i),h)if(i.flags&256)i.flags&=-257,i=s0(n,i,o);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(Pt||Qa(n,i,o,!1),h=(o&n.childLanes)!==0,Pt||h){if(u=ut,u!==null&&(j=Zr(u,o),j!==0&&j!==g.retryLane))throw g.retryLane=j,Qi(n,j),bn(u,n,j),Sf;hc(),i=s0(n,i,o)}else n=g.treeContext,ht=Bn(j.nextSibling),Yt=i,Fe=!0,ni=null,Pn=!1,n!==null&&Hg(i,n),i=nc(i,u),i.flags|=4096;return i}return n=_s(n.child,{mode:u.mode,children:u.children}),n.ref=i.ref,i.child=n,n.return=i,n}function sc(n,i){var o=i.ref;if(o===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(n===null||n.ref!==o)&&(i.flags|=4194816)}}function jf(n,i,o,u,h){return Wi(i),o=tf(n,i,o,u,void 0,h),u=nf(),n!==null&&!Pt?(sf(n,i,h),Os(n,i,h)):(Fe&&u&&Md(i),i.flags|=1,Xt(n,i,o,h),i.child)}function i0(n,i,o,u,h,g){return Wi(i),i.updateQueue=null,o=oy(i,u,o,h),ry(n),u=nf(),n!==null&&!Pt?(sf(n,i,g),Os(n,i,g)):(Fe&&u&&Md(i),i.flags|=1,Xt(n,i,o,g),i.child)}function a0(n,i,o,u,h){if(Wi(i),i.stateNode===null){var g=Fa,j=o.contextType;typeof j=="object"&&j!==null&&(g=Jt(j)),g=new o(u,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=xf,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=u,g.state=i.memoizedState,g.refs={},Kd(i),j=o.contextType,g.context=typeof j=="object"&&j!==null?Jt(j):Fa,g.state=i.memoizedState,j=o.getDerivedStateFromProps,typeof j=="function"&&(vf(i,o,j,u),g.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(j=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),j!==g.state&&xf.enqueueReplaceState(g,g.state,null),fo(i,u,g,h),uo(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(n===null){g=i.stateNode;var _=i.memoizedProps,D=aa(o,_);g.props=D;var F=g.context,W=o.contextType;j=Fa,typeof W=="object"&&W!==null&&(j=Jt(W));var ne=o.getDerivedStateFromProps;W=typeof ne=="function"||typeof g.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,W||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(_||F!==j)&&Fy(i,g,u,j),ai=!1;var V=i.memoizedState;g.state=V,fo(i,u,g,h),uo(),F=i.memoizedState,_||V!==F||ai?(typeof ne=="function"&&(vf(i,o,ne,u),F=i.memoizedState),(D=ai||Gy(i,o,D,u,V,F,j))?(W||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(i.flags|=4194308)):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=u,i.memoizedState=F),g.props=u,g.state=F,g.context=j,u=D):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{g=i.stateNode,Vd(n,i),j=i.memoizedProps,W=aa(o,j),g.props=W,ne=i.pendingProps,V=g.context,F=o.contextType,D=Fa,typeof F=="object"&&F!==null&&(D=Jt(F)),_=o.getDerivedStateFromProps,(F=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(j!==ne||V!==D)&&Fy(i,g,u,D),ai=!1,V=i.memoizedState,g.state=V,fo(i,u,g,h),uo();var Y=i.memoizedState;j!==ne||V!==Y||ai||n!==null&&n.dependencies!==null&&$l(n.dependencies)?(typeof _=="function"&&(vf(i,o,_,u),Y=i.memoizedState),(W=ai||Gy(i,o,W,u,V,Y,D)||n!==null&&n.dependencies!==null&&$l(n.dependencies))?(F||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,Y,D),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,Y,D)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=Y),g.props=u,g.state=Y,g.context=D,u=W):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=1024),u=!1)}return g=u,sc(n,i),u=(i.flags&128)!==0,g||u?(g=i.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&u?(i.child=sa(i,n.child,null,h),i.child=sa(i,null,o,h)):Xt(n,i,o,h),i.memoizedState=g.state,n=i.child):n=Os(n,i,h),n}function r0(n,i,o,u){return Ji(),i.flags|=256,Xt(n,i,o,u),i.child}var wf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nf(n){return{baseLanes:n,cachePool:Qg()}}function Cf(n,i,o){return n=n!==null?n.childLanes&~o:0,i&&(n|=Rn),n}function o0(n,i,o){var u=i.pendingProps,h=!1,g=(i.flags&128)!==0,j;if((j=g)||(j=n!==null&&n.memoizedState===null?!1:(At.current&2)!==0),j&&(h=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,n===null){if(Fe){if(h?li(i):ci(),(n=ht)?(n=pv(n,Pn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ti!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},o=Ig(n),o.return=i,i.child=o,Yt=i,ht=null)):n=null,n===null)throw si(i);return oh(n)?i.lanes=32:i.lanes=536870912,null}var _=u.children;return u=u.fallback,h?(ci(),h=i.mode,_=ic({mode:"hidden",children:_},h),u=Yi(u,h,o,null),_.return=i,u.return=i,_.sibling=u,i.child=_,u=i.child,u.memoizedState=Nf(o),u.childLanes=Cf(n,j,o),i.memoizedState=wf,yo(null,u)):(li(i),kf(i,_))}var D=n.memoizedState;if(D!==null&&(_=D.dehydrated,_!==null)){if(g)i.flags&256?(li(i),i.flags&=-257,i=_f(n,i,o)):i.memoizedState!==null?(ci(),i.child=n.child,i.flags|=128,i=null):(ci(),_=u.fallback,h=i.mode,u=ic({mode:"visible",children:u.children},h),_=Yi(_,h,o,null),_.flags|=2,u.return=i,_.return=i,u.sibling=_,i.child=u,sa(i,n.child,null,o),u=i.child,u.memoizedState=Nf(o),u.childLanes=Cf(n,j,o),i.memoizedState=wf,i=yo(null,u));else if(li(i),oh(_)){if(j=_.nextSibling&&_.nextSibling.dataset,j)var F=j.dgst;j=F,u=Error(a(419)),u.stack="",u.digest=j,io({value:u,source:null,stack:null}),i=_f(n,i,o)}else if(Pt||Qa(n,i,o,!1),j=(o&n.childLanes)!==0,Pt||j){if(j=ut,j!==null&&(u=Zr(j,o),u!==0&&u!==D.retryLane))throw D.retryLane=u,Qi(n,u),bn(j,n,u),Sf;rh(_)||hc(),i=_f(n,i,o)}else rh(_)?(i.flags|=192,i.child=n.child,i=null):(n=D.treeContext,ht=Bn(_.nextSibling),Yt=i,Fe=!0,ni=null,Pn=!1,n!==null&&Hg(i,n),i=kf(i,u.children),i.flags|=4096);return i}return h?(ci(),_=u.fallback,h=i.mode,D=n.child,F=D.sibling,u=_s(D,{mode:"hidden",children:u.children}),u.subtreeFlags=D.subtreeFlags&65011712,F!==null?_=_s(F,_):(_=Yi(_,h,o,null),_.flags|=2),_.return=i,u.return=i,u.sibling=_,i.child=u,yo(null,u),u=i.child,_=n.child.memoizedState,_===null?_=Nf(o):(h=_.cachePool,h!==null?(D=Ut._currentValue,h=h.parent!==D?{parent:D,pool:D}:h):h=Qg(),_={baseLanes:_.baseLanes|o,cachePool:h}),u.memoizedState=_,u.childLanes=Cf(n,j,o),i.memoizedState=wf,yo(n.child,u)):(li(i),o=n.child,n=o.sibling,o=_s(o,{mode:"visible",children:u.children}),o.return=i,o.sibling=null,n!==null&&(j=i.deletions,j===null?(i.deletions=[n],i.flags|=16):j.push(n)),i.child=o,i.memoizedState=null,o)}function kf(n,i){return i=ic({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function ic(n,i){return n=_n(22,n,null,i),n.lanes=0,n}function _f(n,i,o){return sa(i,n.child,null,o),n=kf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function l0(n,i,o){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i),Bd(n.return,i,o)}function zf(n,i,o,u,h,g){var j=n.memoizedState;j===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:h,treeForkCount:g}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=u,j.tail=o,j.tailMode=h,j.treeForkCount=g)}function c0(n,i,o){var u=i.pendingProps,h=u.revealOrder,g=u.tail;u=u.children;var j=At.current,_=(j&2)!==0;if(_?(j=j&1|2,i.flags|=128):j&=1,ie(At,j),Xt(n,i,u,o),u=Fe?so:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&l0(n,o,i);else if(n.tag===19)l0(n,o,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(o=i.child,h=null;o!==null;)n=o.alternate,n!==null&&Zl(n)===null&&(h=o),o=o.sibling;o=h,o===null?(h=i.child,i.child=null):(h=o.sibling,o.sibling=null),zf(i,!1,h,o,g,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,h=i.child,i.child=null;h!==null;){if(n=h.alternate,n!==null&&Zl(n)===null){i.child=h;break}n=h.sibling,h.sibling=o,o=h,h=n}zf(i,!0,o,null,g,u);break;case"together":zf(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Os(n,i,o){if(n!==null&&(i.dependencies=n.dependencies),fi|=i.lanes,(o&i.childLanes)===0)if(n!==null){if(Qa(n,i,o,!1),(o&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,o=_s(n,n.pendingProps),i.child=o,o.return=i;n.sibling!==null;)n=n.sibling,o=o.sibling=_s(n,n.pendingProps),o.return=i;o.sibling=null}return i.child}function Ef(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&$l(n)))}function hC(n,i,o){switch(i.tag){case 3:Me(i,i.stateNode.containerInfo),ii(i,Ut,n.memoizedState.cache),Ji();break;case 27:case 5:Ke(i);break;case 4:Me(i,i.stateNode.containerInfo);break;case 10:ii(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Wd(i),null;break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(li(i),i.flags|=128,null):(o&i.child.childLanes)!==0?o0(n,i,o):(li(i),n=Os(n,i,o),n!==null?n.sibling:null);li(i);break;case 19:var h=(n.flags&128)!==0;if(u=(o&i.childLanes)!==0,u||(Qa(n,i,o,!1),u=(o&i.childLanes)!==0),h){if(u)return c0(n,i,o);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ie(At,At.current),u)break;return null;case 22:return i.lanes=0,t0(n,i,o,i.pendingProps);case 24:ii(i,Ut,n.memoizedState.cache)}return Os(n,i,o)}function u0(n,i,o){if(n!==null)if(n.memoizedProps!==i.pendingProps)Pt=!0;else{if(!Ef(n,o)&&(i.flags&128)===0)return Pt=!1,hC(n,i,o);Pt=(n.flags&131072)!==0}else Pt=!1,Fe&&(i.flags&1048576)!==0&&qg(i,so,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(n=ta(i.elementType),i.type=n,typeof n=="function")Od(n)?(u=aa(n,u),i.tag=1,i=a0(null,i,n,u,o)):(i.tag=0,i=jf(null,i,n,u,o));else{if(n!=null){var h=n.$$typeof;if(h===z){i.tag=11,i=Xy(null,i,n,u,o);break e}else if(h===R){i.tag=14,i=Wy(null,i,n,u,o);break e}}throw i=ke(n)||n,Error(a(306,i,""))}}return i;case 0:return jf(n,i,i.type,i.pendingProps,o);case 1:return u=i.type,h=aa(u,i.pendingProps),a0(n,i,u,h,o);case 3:e:{if(Me(i,i.stateNode.containerInfo),n===null)throw Error(a(387));u=i.pendingProps;var g=i.memoizedState;h=g.element,Vd(n,i),fo(i,u,null,o);var j=i.memoizedState;if(u=j.cache,ii(i,Ut,u),u!==g.cache&&qd(i,[Ut],o,!0),uo(),u=j.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=r0(n,i,u,o);break e}else if(u!==h){h=Mn(Error(a(424)),i),io(h),i=r0(n,i,u,o);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,ht=Bn(n.firstChild),Yt=i,Fe=!0,ni=null,Pn=!0,o=ty(i,null,u,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Ji(),u===h){i=Os(n,i,o);break e}Xt(n,i,u,o)}i=i.child}return i;case 26:return sc(n,i),n===null?(o=Sv(i.type,null,i.pendingProps,null))?i.memoizedState=o:Fe||(o=i.type,n=i.pendingProps,u=bc(he.current).createElement(o),u[Et]=i,u[Nt]=n,Wt(u,o,n),Mt(u),i.stateNode=u):i.memoizedState=Sv(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ke(i),n===null&&Fe&&(u=i.stateNode=vv(i.type,i.pendingProps,he.current),Yt=i,Pn=!0,h=ht,yi(i.type)?(lh=h,ht=Bn(u.firstChild)):ht=h),Xt(n,i,i.pendingProps.children,o),sc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Fe&&((h=u=ht)&&(u=HC(u,i.type,i.pendingProps,Pn),u!==null?(i.stateNode=u,Yt=i,ht=Bn(u.firstChild),Pn=!1,h=!0):h=!1),h||si(i)),Ke(i),h=i.type,g=i.pendingProps,j=n!==null?n.memoizedProps:null,u=g.children,sh(h,g)?u=null:j!==null&&sh(h,j)&&(i.flags|=32),i.memoizedState!==null&&(h=tf(n,i,iC,null,null,o),To._currentValue=h),sc(n,i),Xt(n,i,u,o),i.child;case 6:return n===null&&Fe&&((n=o=ht)&&(o=GC(o,i.pendingProps,Pn),o!==null?(i.stateNode=o,Yt=i,ht=null,n=!0):n=!1),n||si(i)),null;case 13:return o0(n,i,o);case 4:return Me(i,i.stateNode.containerInfo),u=i.pendingProps,n===null?i.child=sa(i,null,u,o):Xt(n,i,u,o),i.child;case 11:return Xy(n,i,i.type,i.pendingProps,o);case 7:return Xt(n,i,i.pendingProps,o),i.child;case 8:return Xt(n,i,i.pendingProps.children,o),i.child;case 12:return Xt(n,i,i.pendingProps.children,o),i.child;case 10:return u=i.pendingProps,ii(i,i.type,u.value),Xt(n,i,u.children,o),i.child;case 9:return h=i.type._context,u=i.pendingProps.children,Wi(i),h=Jt(h),u=u(h),i.flags|=1,Xt(n,i,u,o),i.child;case 14:return Wy(n,i,i.type,i.pendingProps,o);case 15:return e0(n,i,i.type,i.pendingProps,o);case 19:return c0(n,i,o);case 31:return fC(n,i,o);case 22:return t0(n,i,o,i.pendingProps);case 24:return Wi(i),u=Jt(Ut),n===null?(h=Fd(),h===null&&(h=ut,g=Hd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=o),h=g),i.memoizedState={parent:u,cache:h},Kd(i),ii(i,Ut,h)):((n.lanes&o)!==0&&(Vd(n,i),fo(i,null,null,o),uo()),h=n.memoizedState,g=i.memoizedState,h.parent!==u?(h={parent:u,cache:u},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),ii(i,Ut,u)):(u=g.cache,ii(i,Ut,u),u!==h.cache&&qd(i,[Ut],o,!0))),Xt(n,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ds(n){n.flags|=4}function Af(n,i,o,u,h){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if(U0())n.flags|=8192;else throw na=ql,Zd}else n.flags&=-16777217}function d0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!kv(i))if(U0())n.flags|=8192;else throw na=ql,Zd}function ac(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?xl():536870912,n.lanes|=i,or|=i)}function vo(n,i){if(!Fe)switch(n.tailMode){case"hidden":i=n.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function mt(n){var i=n.alternate!==null&&n.alternate.child===n.child,o=0,u=0;if(i)for(var h=n.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=u,n.childLanes=o,i}function mC(n,i,o){var u=i.pendingProps;switch(Ud(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(i),null;case 1:return mt(i),null;case 3:return o=i.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),As(Ut),ge(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(Va(i)?Ds(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Pd())),mt(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?(Ds(i),g!==null?(mt(i),d0(i,g)):(mt(i),Af(i,h,null,u,o))):g?g!==n.memoizedState?(Ds(i),mt(i),d0(i,g)):(mt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&Ds(i),mt(i),Af(i,h,n,u,o)),null;case 27:if(it(i),o=he.current,h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ds(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return mt(i),null}n=re.current,Va(i)?Gg(i):(n=vv(h,u,o),i.stateNode=n,Ds(i))}return mt(i),null;case 5:if(it(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ds(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return mt(i),null}if(g=re.current,Va(i))Gg(i);else{var j=bc(he.current);switch(g){case 1:g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=j.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?j.createElement("select",{is:u.is}):j.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?j.createElement(h,{is:u.is}):j.createElement(h)}}g[Et]=i,g[Nt]=u;e:for(j=i.child;j!==null;){if(j.tag===5||j.tag===6)g.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===i)break e;for(;j.sibling===null;){if(j.return===null||j.return===i)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}i.stateNode=g;e:switch(Wt(g,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Ds(i)}}return mt(i),Af(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,o),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==u&&Ds(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(a(166));if(n=he.current,Va(i)){if(n=i.stateNode,o=i.memoizedProps,u=null,h=Yt,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}n[Et]=i,n=!!(n.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||ov(n.nodeValue,o)),n||si(i,!0)}else n=bc(n).createTextNode(u),n[Et]=i,i.stateNode=n}return mt(i),null;case 31:if(o=i.memoizedState,n===null||n.memoizedState!==null){if(u=Va(i),o!==null){if(n===null){if(!u)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[Et]=i}else Ji(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),n=!1}else o=Pd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return i.flags&256?(En(i),i):(En(i),null);if((i.flags&128)!==0)throw Error(a(558))}return mt(i),null;case 13:if(u=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Va(i),u!==null&&u.dehydrated!==null){if(n===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Et]=i}else Ji(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),h=!1}else h=Pd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(En(i),i):(En(i),null)}return En(i),(i.flags&128)!==0?(i.lanes=o,i):(o=u!==null,n=n!==null&&n.memoizedState!==null,o&&(u=i.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==h&&(u.flags|=2048)),o!==n&&o&&(i.child.flags|=8192),ac(i,i.updateQueue),mt(i),null);case 4:return ge(),n===null&&Xf(i.stateNode.containerInfo),mt(i),null;case 10:return As(i.type),mt(i),null;case 19:if(Z(At),u=i.memoizedState,u===null)return mt(i),null;if(h=(i.flags&128)!==0,g=u.rendering,g===null)if(h)vo(u,!1);else{if(kt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Zl(n),g!==null){for(i.flags|=128,vo(u,!1),n=g.updateQueue,i.updateQueue=n,ac(i,n),i.subtreeFlags=0,n=o,o=i.child;o!==null;)Pg(o,n),o=o.sibling;return ie(At,At.current&1|2),Fe&&zs(i,u.treeForkCount),i.child}n=n.sibling}u.tail!==null&&Be()>uc&&(i.flags|=128,h=!0,vo(u,!1),i.lanes=4194304)}else{if(!h)if(n=Zl(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,ac(i,n),vo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!Fe)return mt(i),null}else 2*Be()-u.renderingStartTime>uc&&o!==536870912&&(i.flags|=128,h=!0,vo(u,!1),i.lanes=4194304);u.isBackwards?(g.sibling=i.child,i.child=g):(n=u.last,n!==null?n.sibling=g:i.child=g,u.last=g)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=Be(),n.sibling=null,o=At.current,ie(At,h?o&1|2:o&1),Fe&&zs(i,u.treeForkCount),n):(mt(i),null);case 22:case 23:return En(i),Xd(),u=i.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(o&536870912)!==0&&(i.flags&128)===0&&(mt(i),i.subtreeFlags&6&&(i.flags|=8192)):mt(i),o=i.updateQueue,o!==null&&ac(i,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==o&&(i.flags|=2048),n!==null&&Z(ea),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),As(Ut),mt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function pC(n,i){switch(Ud(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return As(Ut),ge(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return it(i),null;case 31:if(i.memoizedState!==null){if(En(i),i.alternate===null)throw Error(a(340));Ji()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(En(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Ji()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return Z(At),null;case 4:return ge(),null;case 10:return As(i.type),null;case 22:case 23:return En(i),Xd(),n!==null&&Z(ea),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return As(Ut),null;case 25:return null;default:return null}}function f0(n,i){switch(Ud(i),i.tag){case 3:As(Ut),ge();break;case 26:case 27:case 5:it(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&En(i);break;case 13:En(i);break;case 19:Z(At);break;case 10:As(i.type);break;case 22:case 23:En(i),Xd(),n!==null&&Z(ea);break;case 24:As(Ut)}}function xo(n,i){try{var o=i.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&n)===n){u=void 0;var g=o.create,j=o.inst;u=g(),j.destroy=u}o=o.next}while(o!==h)}}catch(_){tt(i,i.return,_)}}function ui(n,i,o){try{var u=i.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var g=h.next;u=g;do{if((u.tag&n)===n){var j=u.inst,_=j.destroy;if(_!==void 0){j.destroy=void 0,h=i;var D=o,F=_;try{F()}catch(W){tt(h,D,W)}}}u=u.next}while(u!==g)}}catch(W){tt(i,i.return,W)}}function h0(n){var i=n.updateQueue;if(i!==null){var o=n.stateNode;try{sy(i,o)}catch(u){tt(n,n.return,u)}}}function m0(n,i,o){o.props=aa(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(u){tt(n,i,u)}}function bo(n,i){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof o=="function"?n.refCleanup=o(u):o.current=u}}catch(h){tt(n,i,h)}}function ps(n,i){var o=n.ref,u=n.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(h){tt(n,i,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){tt(n,i,h)}else o.current=null}function p0(n){var i=n.type,o=n.memoizedProps,u=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(h){tt(n,n.return,h)}}function Rf(n,i,o){try{var u=n.stateNode;UC(u,n.type,o,i),u[Nt]=i}catch(h){tt(n,n.return,h)}}function g0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&yi(n.type)||n.tag===4}function Tf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||g0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&yi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Of(n,i,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,i):(i=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.appendChild(n),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=Cs));else if(u!==4&&(u===27&&yi(n.type)&&(o=n.stateNode,i=null),n=n.child,n!==null))for(Of(n,i,o),n=n.sibling;n!==null;)Of(n,i,o),n=n.sibling}function rc(n,i,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?o.insertBefore(n,i):o.appendChild(n);else if(u!==4&&(u===27&&yi(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(rc(n,i,o),n=n.sibling;n!==null;)rc(n,i,o),n=n.sibling}function y0(n){var i=n.stateNode,o=n.memoizedProps;try{for(var u=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);Wt(i,u,o),i[Et]=n,i[Nt]=o}catch(g){tt(n,n.return,g)}}var Ls=!1,It=!1,Df=!1,v0=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function gC(n,i){if(n=n.containerInfo,th=_c,n=Ag(n),kd(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var h=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var j=0,_=-1,D=-1,F=0,W=0,ne=n,V=null;t:for(;;){for(var Y;ne!==o||h!==0&&ne.nodeType!==3||(_=j+h),ne!==g||u!==0&&ne.nodeType!==3||(D=j+u),ne.nodeType===3&&(j+=ne.nodeValue.length),(Y=ne.firstChild)!==null;)V=ne,ne=Y;for(;;){if(ne===n)break t;if(V===o&&++F===h&&(_=j),V===g&&++W===u&&(D=j),(Y=ne.nextSibling)!==null)break;ne=V,V=ne.parentNode}ne=Y}o=_===-1||D===-1?null:{start:_,end:D}}else o=null}o=o||{start:0,end:0}}else o=null;for(nh={focusedElem:n,selectionRange:o},_c=!1,Kt=i;Kt!==null;)if(i=Kt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Kt=n;else for(;Kt!==null;){switch(i=Kt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(o=0;o<n.length;o++)h=n[o],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,o=i,h=g.memoizedProps,g=g.memoizedState,u=o.stateNode;try{var ve=aa(o.type,h);n=u.getSnapshotBeforeUpdate(ve,g),u.__reactInternalSnapshotBeforeUpdate=n}catch(Ce){tt(o,o.return,Ce)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,o=n.nodeType,o===9)ah(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ah(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Kt=n;break}Kt=i.return}}function x0(n,i,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:Us(n,o),u&4&&xo(5,o);break;case 1:if(Us(n,o),u&4)if(n=o.stateNode,i===null)try{n.componentDidMount()}catch(j){tt(o,o.return,j)}else{var h=aa(o.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(j){tt(o,o.return,j)}}u&64&&h0(o),u&512&&bo(o,o.return);break;case 3:if(Us(n,o),u&64&&(n=o.updateQueue,n!==null)){if(i=null,o.child!==null)switch(o.child.tag){case 27:case 5:i=o.child.stateNode;break;case 1:i=o.child.stateNode}try{sy(n,i)}catch(j){tt(o,o.return,j)}}break;case 27:i===null&&u&4&&y0(o);case 26:case 5:Us(n,o),i===null&&u&4&&p0(o),u&512&&bo(o,o.return);break;case 12:Us(n,o);break;case 31:Us(n,o),u&4&&j0(n,o);break;case 13:Us(n,o),u&4&&w0(n,o),u&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=CC.bind(null,o),FC(n,o))));break;case 22:if(u=o.memoizedState!==null||Ls,!u){i=i!==null&&i.memoizedState!==null||It,h=Ls;var g=It;Ls=u,(It=i)&&!g?$s(n,o,(o.subtreeFlags&8772)!==0):Us(n,o),Ls=h,It=g}break;case 30:break;default:Us(n,o)}}function b0(n){var i=n.alternate;i!==null&&(n.alternate=null,b0(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&La(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var gt=null,gn=!1;function Ms(n,i,o){for(o=o.child;o!==null;)S0(n,i,o),o=o.sibling}function S0(n,i,o){if(_e&&typeof _e.onCommitFiberUnmount=="function")try{_e.onCommitFiberUnmount(ls,o)}catch{}switch(o.tag){case 26:It||ps(o,i),Ms(n,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:It||ps(o,i);var u=gt,h=gn;yi(o.type)&&(gt=o.stateNode,gn=!1),Ms(n,i,o),Eo(o.stateNode),gt=u,gn=h;break;case 5:It||ps(o,i);case 6:if(u=gt,h=gn,gt=null,Ms(n,i,o),gt=u,gn=h,gt!==null)if(gn)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(o.stateNode)}catch(g){tt(o,i,g)}else try{gt.removeChild(o.stateNode)}catch(g){tt(o,i,g)}break;case 18:gt!==null&&(gn?(n=gt,hv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),pr(n)):hv(gt,o.stateNode));break;case 4:u=gt,h=gn,gt=o.stateNode.containerInfo,gn=!0,Ms(n,i,o),gt=u,gn=h;break;case 0:case 11:case 14:case 15:ui(2,o,i),It||ui(4,o,i),Ms(n,i,o);break;case 1:It||(ps(o,i),u=o.stateNode,typeof u.componentWillUnmount=="function"&&m0(o,i,u)),Ms(n,i,o);break;case 21:Ms(n,i,o);break;case 22:It=(u=It)||o.memoizedState!==null,Ms(n,i,o),It=u;break;default:Ms(n,i,o)}}function j0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{pr(n)}catch(o){tt(i,i.return,o)}}}function w0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{pr(n)}catch(o){tt(i,i.return,o)}}function yC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new v0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new v0),i;default:throw Error(a(435,n.tag))}}function oc(n,i){var o=yC(n);i.forEach(function(u){if(!o.has(u)){o.add(u);var h=kC.bind(null,n,u);u.then(h,h)}})}function yn(n,i){var o=i.deletions;if(o!==null)for(var u=0;u<o.length;u++){var h=o[u],g=n,j=i,_=j;e:for(;_!==null;){switch(_.tag){case 27:if(yi(_.type)){gt=_.stateNode,gn=!1;break e}break;case 5:gt=_.stateNode,gn=!1;break e;case 3:case 4:gt=_.stateNode.containerInfo,gn=!0;break e}_=_.return}if(gt===null)throw Error(a(160));S0(g,j,h),gt=null,gn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)N0(i,n),i=i.sibling}var es=null;function N0(n,i){var o=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:yn(i,n),vn(n),u&4&&(ui(3,n,n.return),xo(3,n),ui(5,n,n.return));break;case 1:yn(i,n),vn(n),u&512&&(It||o===null||ps(o,o.return)),u&64&&Ls&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var h=es;if(yn(i,n),vn(n),u&512&&(It||o===null||ps(o,o.return)),u&4){var g=o!==null?o.memoizedState:null;if(u=n.memoizedState,o===null)if(u===null)if(n.stateNode===null){e:{u=n.type,o=n.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ds]||g[Et]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(u),h.head.insertBefore(g,h.querySelector("head > title"))),Wt(g,u,o),g[Et]=n,Mt(g),u=g;break e;case"link":var j=Nv("link","href",h).get(u+(o.href||""));if(j){for(var _=0;_<j.length;_++)if(g=j[_],g.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&g.getAttribute("rel")===(o.rel==null?null:o.rel)&&g.getAttribute("title")===(o.title==null?null:o.title)&&g.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){j.splice(_,1);break t}}g=h.createElement(u),Wt(g,u,o),h.head.appendChild(g);break;case"meta":if(j=Nv("meta","content",h).get(u+(o.content||""))){for(_=0;_<j.length;_++)if(g=j[_],g.getAttribute("content")===(o.content==null?null:""+o.content)&&g.getAttribute("name")===(o.name==null?null:o.name)&&g.getAttribute("property")===(o.property==null?null:o.property)&&g.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&g.getAttribute("charset")===(o.charSet==null?null:o.charSet)){j.splice(_,1);break t}}g=h.createElement(u),Wt(g,u,o),h.head.appendChild(g);break;default:throw Error(a(468,u))}g[Et]=n,Mt(g),u=g}n.stateNode=u}else Cv(h,n.type,n.stateNode);else n.stateNode=wv(h,u,n.memoizedProps);else g!==u?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,u===null?Cv(h,n.type,n.stateNode):wv(h,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Rf(n,n.memoizedProps,o.memoizedProps)}break;case 27:yn(i,n),vn(n),u&512&&(It||o===null||ps(o,o.return)),o!==null&&u&4&&Rf(n,n.memoizedProps,o.memoizedProps);break;case 5:if(yn(i,n),vn(n),u&512&&(It||o===null||ps(o,o.return)),n.flags&32){h=n.stateNode;try{$a(h,"")}catch(ve){tt(n,n.return,ve)}}u&4&&n.stateNode!=null&&(h=n.memoizedProps,Rf(n,h,o!==null?o.memoizedProps:h)),u&1024&&(Df=!0);break;case 6:if(yn(i,n),vn(n),u&4){if(n.stateNode===null)throw Error(a(162));u=n.memoizedProps,o=n.stateNode;try{o.nodeValue=u}catch(ve){tt(n,n.return,ve)}}break;case 3:if(wc=null,h=es,es=Sc(i.containerInfo),yn(i,n),es=h,vn(n),u&4&&o!==null&&o.memoizedState.isDehydrated)try{pr(i.containerInfo)}catch(ve){tt(n,n.return,ve)}Df&&(Df=!1,C0(n));break;case 4:u=es,es=Sc(n.stateNode.containerInfo),yn(i,n),vn(n),es=u;break;case 12:yn(i,n),vn(n);break;case 31:yn(i,n),vn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,oc(n,u)));break;case 13:yn(i,n),vn(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(cc=Be()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,oc(n,u)));break;case 22:h=n.memoizedState!==null;var D=o!==null&&o.memoizedState!==null,F=Ls,W=It;if(Ls=F||h,It=W||D,yn(i,n),It=W,Ls=F,vn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(o===null||D||Ls||It||ra(n)),o=null,i=n;;){if(i.tag===5||i.tag===26){if(o===null){D=o=i;try{if(g=D.stateNode,h)j=g.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{_=D.stateNode;var ne=D.memoizedProps.style,V=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;_.style.display=V==null||typeof V=="boolean"?"":(""+V).trim()}}catch(ve){tt(D,D.return,ve)}}}else if(i.tag===6){if(o===null){D=i;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(ve){tt(D,D.return,ve)}}}else if(i.tag===18){if(o===null){D=i;try{var Y=D.stateNode;h?mv(Y,!0):mv(D.stateNode,!1)}catch(ve){tt(D,D.return,ve)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;o===i&&(o=null),i=i.return}o===i&&(o=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=n.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,oc(n,o))));break;case 19:yn(i,n),vn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,oc(n,u)));break;case 30:break;case 21:break;default:yn(i,n),vn(n)}}function vn(n){var i=n.flags;if(i&2){try{for(var o,u=n.return;u!==null;){if(g0(u)){o=u;break}u=u.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,g=Tf(n);rc(n,g,h);break;case 5:var j=o.stateNode;o.flags&32&&($a(j,""),o.flags&=-33);var _=Tf(n);rc(n,_,j);break;case 3:case 4:var D=o.stateNode.containerInfo,F=Tf(n);Of(n,F,D);break;default:throw Error(a(161))}}catch(W){tt(n,n.return,W)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function C0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;C0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Us(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)x0(n,i.alternate,i),i=i.sibling}function ra(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:ui(4,i,i.return),ra(i);break;case 1:ps(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&m0(i,i.return,o),ra(i);break;case 27:Eo(i.stateNode);case 26:case 5:ps(i,i.return),ra(i);break;case 22:i.memoizedState===null&&ra(i);break;case 30:ra(i);break;default:ra(i)}n=n.sibling}}function $s(n,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,h=n,g=i,j=g.flags;switch(g.tag){case 0:case 11:case 15:$s(h,g,o),xo(4,g);break;case 1:if($s(h,g,o),u=g,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(F){tt(u,u.return,F)}if(u=g,h=u.updateQueue,h!==null){var _=u.stateNode;try{var D=h.shared.hiddenCallbacks;if(D!==null)for(h.shared.hiddenCallbacks=null,h=0;h<D.length;h++)ny(D[h],_)}catch(F){tt(u,u.return,F)}}o&&j&64&&h0(g),bo(g,g.return);break;case 27:y0(g);case 26:case 5:$s(h,g,o),o&&u===null&&j&4&&p0(g),bo(g,g.return);break;case 12:$s(h,g,o);break;case 31:$s(h,g,o),o&&j&4&&j0(h,g);break;case 13:$s(h,g,o),o&&j&4&&w0(h,g);break;case 22:g.memoizedState===null&&$s(h,g,o),bo(g,g.return);break;case 30:break;default:$s(h,g,o)}i=i.sibling}}function Lf(n,i){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&ao(o))}function Mf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&ao(n))}function ts(n,i,o,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)k0(n,i,o,u),i=i.sibling}function k0(n,i,o,u){var h=i.flags;switch(i.tag){case 0:case 11:case 15:ts(n,i,o,u),h&2048&&xo(9,i);break;case 1:ts(n,i,o,u);break;case 3:ts(n,i,o,u),h&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&ao(n)));break;case 12:if(h&2048){ts(n,i,o,u),n=i.stateNode;try{var g=i.memoizedProps,j=g.id,_=g.onPostCommit;typeof _=="function"&&_(j,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(D){tt(i,i.return,D)}}else ts(n,i,o,u);break;case 31:ts(n,i,o,u);break;case 13:ts(n,i,o,u);break;case 23:break;case 22:g=i.stateNode,j=i.alternate,i.memoizedState!==null?g._visibility&2?ts(n,i,o,u):So(n,i):g._visibility&2?ts(n,i,o,u):(g._visibility|=2,ir(n,i,o,u,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Lf(j,i);break;case 24:ts(n,i,o,u),h&2048&&Mf(i.alternate,i);break;default:ts(n,i,o,u)}}function ir(n,i,o,u,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,j=i,_=o,D=u,F=j.flags;switch(j.tag){case 0:case 11:case 15:ir(g,j,_,D,h),xo(8,j);break;case 23:break;case 22:var W=j.stateNode;j.memoizedState!==null?W._visibility&2?ir(g,j,_,D,h):So(g,j):(W._visibility|=2,ir(g,j,_,D,h)),h&&F&2048&&Lf(j.alternate,j);break;case 24:ir(g,j,_,D,h),h&&F&2048&&Mf(j.alternate,j);break;default:ir(g,j,_,D,h)}i=i.sibling}}function So(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var o=n,u=i,h=u.flags;switch(u.tag){case 22:So(o,u),h&2048&&Lf(u.alternate,u);break;case 24:So(o,u),h&2048&&Mf(u.alternate,u);break;default:So(o,u)}i=i.sibling}}var jo=8192;function ar(n,i,o){if(n.subtreeFlags&jo)for(n=n.child;n!==null;)_0(n,i,o),n=n.sibling}function _0(n,i,o){switch(n.tag){case 26:ar(n,i,o),n.flags&jo&&n.memoizedState!==null&&sk(o,es,n.memoizedState,n.memoizedProps);break;case 5:ar(n,i,o);break;case 3:case 4:var u=es;es=Sc(n.stateNode.containerInfo),ar(n,i,o),es=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=jo,jo=16777216,ar(n,i,o),jo=u):ar(n,i,o));break;default:ar(n,i,o)}}function z0(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function wo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var u=i[o];Kt=u,A0(u,n)}z0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)E0(n),n=n.sibling}function E0(n){switch(n.tag){case 0:case 11:case 15:wo(n),n.flags&2048&&ui(9,n,n.return);break;case 3:wo(n);break;case 12:wo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,lc(n)):wo(n);break;default:wo(n)}}function lc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var u=i[o];Kt=u,A0(u,n)}z0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:ui(8,i,i.return),lc(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,lc(i));break;default:lc(i)}n=n.sibling}}function A0(n,i){for(;Kt!==null;){var o=Kt;switch(o.tag){case 0:case 11:case 15:ui(8,o,i);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:ao(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,Kt=u;else e:for(o=n;Kt!==null;){u=Kt;var h=u.sibling,g=u.return;if(b0(u),u===o){Kt=null;break e}if(h!==null){h.return=g,Kt=h;break e}Kt=g}}}var vC={getCacheForType:function(n){var i=Jt(Ut),o=i.data.get(n);return o===void 0&&(o=n(),i.data.set(n,o)),o},cacheSignal:function(){return Jt(Ut).controller.signal}},xC=typeof WeakMap=="function"?WeakMap:Map,Xe=0,ut=null,$e=null,He=0,et=0,An=null,di=!1,rr=!1,Uf=!1,Ps=0,kt=0,fi=0,oa=0,$f=0,Rn=0,or=0,No=null,xn=null,Pf=!1,cc=0,R0=0,uc=1/0,dc=null,hi=null,Ft=0,mi=null,lr=null,Is=0,If=0,Bf=null,T0=null,Co=0,qf=null;function Tn(){return(Xe&2)!==0&&He!==0?He&-He:B.T!==null?Vf():at()}function O0(){if(Rn===0)if((He&536870912)===0||Fe){var n=ws;ws<<=1,(ws&3932160)===0&&(ws=262144),Rn=n}else Rn=536870912;return n=zn.current,n!==null&&(n.flags|=32),Rn}function bn(n,i,o){(n===ut&&(et===2||et===9)||n.cancelPendingCommit!==null)&&(cr(n,0),pi(n,He,Rn,!1)),Fi(n,o),((Xe&2)===0||n!==ut)&&(n===ut&&((Xe&2)===0&&(oa|=o),kt===4&&pi(n,He,Rn,!1)),gs(n))}function D0(n,i,o){if((Xe&6)!==0)throw Error(a(327));var u=!o&&(i&127)===0&&(i&n.expiredLanes)===0||us(n,i),h=u?jC(n,i):Gf(n,i,!0),g=u;do{if(h===0){rr&&!u&&pi(n,i,0,!1);break}else{if(o=n.current.alternate,g&&!bC(o)){h=Gf(n,i,!1),g=!1;continue}if(h===2){if(g=i,n.errorRecoveryDisabledLanes&g)var j=0;else j=n.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var _=n;h=No;var D=_.current.memoizedState.isDehydrated;if(D&&(cr(_,j).flags|=256),j=Gf(_,j,!1),j!==2){if(Uf&&!D){_.errorRecoveryDisabledLanes|=g,oa|=g,h=4;break e}g=xn,xn=h,g!==null&&(xn===null?xn=g:xn.push.apply(xn,g))}h=j}if(g=!1,h!==2)continue}}if(h===1){cr(n,0),pi(n,i,0,!0);break}e:{switch(u=n,g=h,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:pi(u,i,Rn,!di);break e;case 2:xn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=cc+300-Be(),10<h)){if(pi(u,i,Rn,!di),Oa(u,0,!0)!==0)break e;Is=i,u.timeoutHandle=dv(L0.bind(null,u,o,xn,dc,Pf,i,Rn,oa,or,di,g,"Throttled",-0,0),h);break e}L0(u,o,xn,dc,Pf,i,Rn,oa,or,di,g,null,-0,0)}}break}while(!0);gs(n)}function L0(n,i,o,u,h,g,j,_,D,F,W,ne,V,Y){if(n.timeoutHandle=-1,ne=i.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Cs},_0(i,g,ne);var ve=(g&62914560)===g?cc-Be():(g&4194048)===g?R0-Be():0;if(ve=ik(ne,ve),ve!==null){Is=g,n.cancelPendingCommit=ve(H0.bind(null,n,i,g,o,u,h,j,_,D,W,ne,null,V,Y)),pi(n,g,j,!F);return}}H0(n,i,g,o,u,h,j,_,D)}function bC(n){for(var i=n;;){var o=i.tag;if((o===0||o===11||o===15)&&i.flags&16384&&(o=i.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var h=o[u],g=h.getSnapshot;h=h.value;try{if(!kn(g(),h))return!1}catch{return!1}}if(o=i.child,i.subtreeFlags&16384&&o!==null)o.return=i,i=o;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function pi(n,i,o,u){i&=~$f,i&=~oa,n.suspendedLanes|=i,n.pingedLanes&=~i,u&&(n.warmLanes|=i),u=n.expirationTimes;for(var h=i;0<h;){var g=31-Ve(h),j=1<<g;u[g]=-1,h&=~j}o!==0&&bl(n,o,i)}function fc(){return(Xe&6)===0?(ko(0),!1):!0}function Hf(){if($e!==null){if(et===0)var n=$e.return;else n=$e,Es=Xi=null,af(n),Wa=null,oo=0,n=$e;for(;n!==null;)f0(n.alternate,n),n=n.return;$e=null}}function cr(n,i){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,IC(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),Is=0,Hf(),ut=n,$e=o=_s(n.current,null),He=i,et=0,An=null,di=!1,rr=us(n,i),Uf=!1,or=Rn=$f=oa=fi=kt=0,xn=No=null,Pf=!1,(i&8)!==0&&(i|=i&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=i;0<u;){var h=31-Ve(u),g=1<<h;i|=n[h],u&=~g}return Ps=i,Ol(),o}function M0(n,i){Re=null,B.H=go,i===Xa||i===Bl?(i=Xg(),et=3):i===Zd?(i=Xg(),et=4):et=i===Sf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,An=i,$e===null&&(kt=1,tc(n,Mn(i,n.current)))}function U0(){var n=zn.current;return n===null?!0:(He&4194048)===He?In===null:(He&62914560)===He||(He&536870912)!==0?n===In:!1}function $0(){var n=B.H;return B.H=go,n===null?go:n}function P0(){var n=B.A;return B.A=vC,n}function hc(){kt=4,di||(He&4194048)!==He&&zn.current!==null||(rr=!0),(fi&134217727)===0&&(oa&134217727)===0||ut===null||pi(ut,He,Rn,!1)}function Gf(n,i,o){var u=Xe;Xe|=2;var h=$0(),g=P0();(ut!==n||He!==i)&&(dc=null,cr(n,i)),i=!1;var j=kt;e:do try{if(et!==0&&$e!==null){var _=$e,D=An;switch(et){case 8:Hf(),j=6;break e;case 3:case 2:case 9:case 6:zn.current===null&&(i=!0);var F=et;if(et=0,An=null,ur(n,_,D,F),o&&rr){j=0;break e}break;default:F=et,et=0,An=null,ur(n,_,D,F)}}SC(),j=kt;break}catch(W){M0(n,W)}while(!0);return i&&n.shellSuspendCounter++,Es=Xi=null,Xe=u,B.H=h,B.A=g,$e===null&&(ut=null,He=0,Ol()),j}function SC(){for(;$e!==null;)I0($e)}function jC(n,i){var o=Xe;Xe|=2;var u=$0(),h=P0();ut!==n||He!==i?(dc=null,uc=Be()+500,cr(n,i)):rr=us(n,i);e:do try{if(et!==0&&$e!==null){i=$e;var g=An;t:switch(et){case 1:et=0,An=null,ur(n,i,g,1);break;case 2:case 9:if(Yg(g)){et=0,An=null,B0(i);break}i=function(){et!==2&&et!==9||ut!==n||(et=7),gs(n)},g.then(i,i);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Yg(g)?(et=0,An=null,B0(i)):(et=0,An=null,ur(n,i,g,7));break;case 5:var j=null;switch($e.tag){case 26:j=$e.memoizedState;case 5:case 27:var _=$e;if(j?kv(j):_.stateNode.complete){et=0,An=null;var D=_.sibling;if(D!==null)$e=D;else{var F=_.return;F!==null?($e=F,mc(F)):$e=null}break t}}et=0,An=null,ur(n,i,g,5);break;case 6:et=0,An=null,ur(n,i,g,6);break;case 8:Hf(),kt=6;break e;default:throw Error(a(462))}}wC();break}catch(W){M0(n,W)}while(!0);return Es=Xi=null,B.H=u,B.A=h,Xe=o,$e!==null?0:(ut=null,He=0,Ol(),kt)}function wC(){for(;$e!==null&&!le();)I0($e)}function I0(n){var i=u0(n.alternate,n,Ps);n.memoizedProps=n.pendingProps,i===null?mc(n):$e=i}function B0(n){var i=n,o=i.alternate;switch(i.tag){case 15:case 0:i=i0(o,i,i.pendingProps,i.type,void 0,He);break;case 11:i=i0(o,i,i.pendingProps,i.type.render,i.ref,He);break;case 5:af(i);default:f0(o,i),i=$e=Pg(i,Ps),i=u0(o,i,Ps)}n.memoizedProps=n.pendingProps,i===null?mc(n):$e=i}function ur(n,i,o,u){Es=Xi=null,af(i),Wa=null,oo=0;var h=i.return;try{if(dC(n,h,i,o,He)){kt=1,tc(n,Mn(o,n.current)),$e=null;return}}catch(g){if(h!==null)throw $e=h,g;kt=1,tc(n,Mn(o,n.current)),$e=null;return}i.flags&32768?(Fe||u===1?n=!0:rr||(He&536870912)!==0?n=!1:(di=n=!0,(u===2||u===9||u===3||u===6)&&(u=zn.current,u!==null&&u.tag===13&&(u.flags|=16384))),q0(i,n)):mc(i)}function mc(n){var i=n;do{if((i.flags&32768)!==0){q0(i,di);return}n=i.return;var o=mC(i.alternate,i,Ps);if(o!==null){$e=o;return}if(i=i.sibling,i!==null){$e=i;return}$e=i=n}while(i!==null);kt===0&&(kt=5)}function q0(n,i){do{var o=pC(n.alternate,n);if(o!==null){o.flags&=32767,$e=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(n=n.sibling,n!==null)){$e=n;return}$e=n=o}while(n!==null);kt=6,$e=null}function H0(n,i,o,u,h,g,j,_,D){n.cancelPendingCommit=null;do pc();while(Ft!==0);if((Xe&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Rd,ld(n,o,g,j,_,D),n===ut&&($e=ut=null,He=0),lr=i,mi=n,Is=o,If=g,Bf=h,T0=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,_C(rn,function(){return V0(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=B.T,B.T=null,h=G.p,G.p=2,j=Xe,Xe|=4;try{gC(n,i,o)}finally{Xe=j,G.p=h,B.T=u}}Ft=1,G0(),F0(),Z0()}}function G0(){if(Ft===1){Ft=0;var n=mi,i=lr,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=B.T,B.T=null;var u=G.p;G.p=2;var h=Xe;Xe|=4;try{N0(i,n);var g=nh,j=Ag(n.containerInfo),_=g.focusedElem,D=g.selectionRange;if(j!==_&&_&&_.ownerDocument&&Eg(_.ownerDocument.documentElement,_)){if(D!==null&&kd(_)){var F=D.start,W=D.end;if(W===void 0&&(W=F),"selectionStart"in _)_.selectionStart=F,_.selectionEnd=Math.min(W,_.value.length);else{var ne=_.ownerDocument||document,V=ne&&ne.defaultView||window;if(V.getSelection){var Y=V.getSelection(),ve=_.textContent.length,Ce=Math.min(D.start,ve),ct=D.end===void 0?Ce:Math.min(D.end,ve);!Y.extend&&Ce>ct&&(j=ct,ct=Ce,Ce=j);var I=zg(_,Ce),U=zg(_,ct);if(I&&U&&(Y.rangeCount!==1||Y.anchorNode!==I.node||Y.anchorOffset!==I.offset||Y.focusNode!==U.node||Y.focusOffset!==U.offset)){var H=ne.createRange();H.setStart(I.node,I.offset),Y.removeAllRanges(),Ce>ct?(Y.addRange(H),Y.extend(U.node,U.offset)):(H.setEnd(U.node,U.offset),Y.addRange(H))}}}}for(ne=[],Y=_;Y=Y.parentNode;)Y.nodeType===1&&ne.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ne.length;_++){var ee=ne[_];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}_c=!!th,nh=th=null}finally{Xe=h,G.p=u,B.T=o}}n.current=i,Ft=2}}function F0(){if(Ft===2){Ft=0;var n=mi,i=lr,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=B.T,B.T=null;var u=G.p;G.p=2;var h=Xe;Xe|=4;try{x0(n,i.alternate,i)}finally{Xe=h,G.p=u,B.T=o}}Ft=3}}function Z0(){if(Ft===4||Ft===3){Ft=0,Ie();var n=mi,i=lr,o=Is,u=T0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ft=5:(Ft=0,lr=mi=null,K0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(hi=null),fe(o),i=i.stateNode,_e&&typeof _e.onCommitFiberRoot=="function")try{_e.onCommitFiberRoot(ls,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=B.T,h=G.p,G.p=2,B.T=null;try{for(var g=n.onRecoverableError,j=0;j<u.length;j++){var _=u[j];g(_.value,{componentStack:_.stack})}}finally{B.T=i,G.p=h}}(Is&3)!==0&&pc(),gs(n),h=n.pendingLanes,(o&261930)!==0&&(h&42)!==0?n===qf?Co++:(Co=0,qf=n):Co=0,ko(0)}}function K0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,ao(i)))}function pc(){return G0(),F0(),Z0(),V0()}function V0(){if(Ft!==5)return!1;var n=mi,i=If;If=0;var o=fe(Is),u=B.T,h=G.p;try{G.p=32>o?32:o,B.T=null,o=Bf,Bf=null;var g=mi,j=Is;if(Ft=0,lr=mi=null,Is=0,(Xe&6)!==0)throw Error(a(331));var _=Xe;if(Xe|=4,E0(g.current),k0(g,g.current,j,o),Xe=_,ko(0,!1),_e&&typeof _e.onPostCommitFiberRoot=="function")try{_e.onPostCommitFiberRoot(ls,g)}catch{}return!0}finally{G.p=h,B.T=u,K0(n,i)}}function Q0(n,i,o){i=Mn(o,i),i=bf(n.stateNode,i,2),n=oi(n,i,2),n!==null&&(Fi(n,2),gs(n))}function tt(n,i,o){if(n.tag===3)Q0(n,n,o);else for(;i!==null;){if(i.tag===3){Q0(i,n,o);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(hi===null||!hi.has(u))){n=Mn(o,n),o=Yy(2),u=oi(i,o,2),u!==null&&(Jy(o,u,i,n),Fi(u,2),gs(u));break}}i=i.return}}function Ff(n,i,o){var u=n.pingCache;if(u===null){u=n.pingCache=new xC;var h=new Set;u.set(i,h)}else h=u.get(i),h===void 0&&(h=new Set,u.set(i,h));h.has(o)||(Uf=!0,h.add(o),n=NC.bind(null,n,i,o),i.then(n,n))}function NC(n,i,o){var u=n.pingCache;u!==null&&u.delete(i),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,ut===n&&(He&o)===o&&(kt===4||kt===3&&(He&62914560)===He&&300>Be()-cc?(Xe&2)===0&&cr(n,0):$f|=o,or===He&&(or=0)),gs(n)}function Y0(n,i){i===0&&(i=xl()),n=Qi(n,i),n!==null&&(Fi(n,i),gs(n))}function CC(n){var i=n.memoizedState,o=0;i!==null&&(o=i.retryLane),Y0(n,o)}function kC(n,i){var o=0;switch(n.tag){case 31:case 13:var u=n.stateNode,h=n.memoizedState;h!==null&&(o=h.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(i),Y0(n,o)}function _C(n,i){return bt(n,i)}var gc=null,dr=null,Zf=!1,yc=!1,Kf=!1,gi=0;function gs(n){n!==dr&&n.next===null&&(dr===null?gc=dr=n:dr=dr.next=n),yc=!0,Zf||(Zf=!0,EC())}function ko(n,i){if(!Kf&&yc){Kf=!0;do for(var o=!1,u=gc;u!==null;){if(n!==0){var h=u.pendingLanes;if(h===0)var g=0;else{var j=u.suspendedLanes,_=u.pingedLanes;g=(1<<31-Ve(42|n)+1)-1,g&=h&~(j&~_),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,ev(u,g))}else g=He,g=Oa(u,u===ut?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||us(u,g)||(o=!0,ev(u,g));u=u.next}while(o);Kf=!1}}function zC(){J0()}function J0(){yc=Zf=!1;var n=0;gi!==0&&PC()&&(n=gi);for(var i=Be(),o=null,u=gc;u!==null;){var h=u.next,g=X0(u,i);g===0?(u.next=null,o===null?gc=h:o.next=h,h===null&&(dr=o)):(o=u,(n!==0||(g&3)!==0)&&(yc=!0)),u=h}Ft!==0&&Ft!==5||ko(n),gi!==0&&(gi=0)}function X0(n,i){for(var o=n.suspendedLanes,u=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var j=31-Ve(g),_=1<<j,D=h[j];D===-1?((_&o)===0||(_&u)!==0)&&(h[j]=vl(_,i)):D<=i&&(n.expiredLanes|=_),g&=~_}if(i=ut,o=He,o=Oa(n,n===i?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,o===0||n===i&&(et===2||et===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&mn(u),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||us(n,o)){if(i=o&-o,i===n.callbackPriority)return i;switch(u!==null&&mn(u),fe(o)){case 2:case 8:o=pt;break;case 32:o=rn;break;case 268435456:o=Ks;break;default:o=rn}return u=W0.bind(null,n),o=bt(o,u),n.callbackPriority=i,n.callbackNode=o,i}return u!==null&&u!==null&&mn(u),n.callbackPriority=2,n.callbackNode=null,2}function W0(n,i){if(Ft!==0&&Ft!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(pc()&&n.callbackNode!==o)return null;var u=He;return u=Oa(n,n===ut?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(D0(n,u,i),X0(n,Be()),n.callbackNode!=null&&n.callbackNode===o?W0.bind(null,n):null)}function ev(n,i){if(pc())return null;D0(n,i,!0)}function EC(){BC(function(){(Xe&6)!==0?bt(Ue,zC):J0()})}function Vf(){if(gi===0){var n=Ya;n===0&&(n=Qs,Qs<<=1,(Qs&261888)===0&&(Qs=256)),gi=n}return gi}function tv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Cl(""+n)}function nv(n,i){var o=i.ownerDocument.createElement("input");return o.name=i.name,o.value=i.value,n.id&&o.setAttribute("form",n.id),i.parentNode.insertBefore(o,i),n=new FormData(n),o.parentNode.removeChild(o),n}function AC(n,i,o,u,h){if(i==="submit"&&o&&o.stateNode===h){var g=tv((h[Nt]||null).action),j=u.submitter;j&&(i=(i=j[Nt]||null)?tv(i.formAction):j.getAttribute("formAction"),i!==null&&(g=i,j=null));var _=new El("action","action",null,u,h);n.push({event:_,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(gi!==0){var D=j?nv(h,j):new FormData(h);mf(o,{pending:!0,data:D,method:h.method,action:g},null,D)}}else typeof g=="function"&&(_.preventDefault(),D=j?nv(h,j):new FormData(h),mf(o,{pending:!0,data:D,method:h.method,action:g},g,D))},currentTarget:h}]})}}for(var Qf=0;Qf<Ad.length;Qf++){var Yf=Ad[Qf],RC=Yf.toLowerCase(),TC=Yf[0].toUpperCase()+Yf.slice(1);Wn(RC,"on"+TC)}Wn(Og,"onAnimationEnd"),Wn(Dg,"onAnimationIteration"),Wn(Lg,"onAnimationStart"),Wn("dblclick","onDoubleClick"),Wn("focusin","onFocus"),Wn("focusout","onBlur"),Wn(V1,"onTransitionRun"),Wn(Q1,"onTransitionStart"),Wn(Y1,"onTransitionCancel"),Wn(Mg,"onTransitionEnd"),on("onMouseEnter",["mouseout","mouseover"]),on("onMouseLeave",["mouseout","mouseover"]),on("onPointerEnter",["pointerout","pointerover"]),on("onPointerLeave",["pointerout","pointerover"]),Gt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _o="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(" "),OC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_o));function sv(n,i){i=(i&4)!==0;for(var o=0;o<n.length;o++){var u=n[o],h=u.event;u=u.listeners;e:{var g=void 0;if(i)for(var j=u.length-1;0<=j;j--){var _=u[j],D=_.instance,F=_.currentTarget;if(_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(W){Tl(W)}h.currentTarget=null,g=D}else for(j=0;j<u.length;j++){if(_=u[j],D=_.instance,F=_.currentTarget,_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(W){Tl(W)}h.currentTarget=null,g=D}}}}function Pe(n,i){var o=i[en];o===void 0&&(o=i[en]=new Set);var u=n+"__bubble";o.has(u)||(iv(i,n,2,!1),o.add(u))}function Jf(n,i,o){var u=0;i&&(u|=4),iv(o,n,u,i)}var vc="_reactListening"+Math.random().toString(36).slice(2);function Xf(n){if(!n[vc]){n[vc]=!0,qe.forEach(function(o){o!=="selectionchange"&&(OC.has(o)||Jf(o,!1,n),Jf(o,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[vc]||(i[vc]=!0,Jf("selectionchange",!1,i))}}function iv(n,i,o,u){switch(Ov(i)){case 2:var h=ok;break;case 8:h=lk;break;default:h=hh}o=h.bind(null,i,o,n),h=void 0,!yd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),u?h!==void 0?n.addEventListener(i,o,{capture:!0,passive:h}):n.addEventListener(i,o,!0):h!==void 0?n.addEventListener(i,o,{passive:h}):n.addEventListener(i,o,!1)}function Wf(n,i,o,u,h){var g=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var j=u.tag;if(j===3||j===4){var _=u.stateNode.containerInfo;if(_===h)break;if(j===4)for(j=u.return;j!==null;){var D=j.tag;if((D===3||D===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;_!==null;){if(j=Xs(_),j===null)return;if(D=j.tag,D===5||D===6||D===26||D===27){u=g=j;continue e}_=_.parentNode}}u=u.return}cg(function(){var F=g,W=pd(o),ne=[];e:{var V=Ug.get(n);if(V!==void 0){var Y=El,ve=n;switch(n){case"keypress":if(_l(o)===0)break e;case"keydown":case"keyup":Y=k1;break;case"focusin":ve="focus",Y=Sd;break;case"focusout":ve="blur",Y=Sd;break;case"beforeblur":case"afterblur":Y=Sd;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=fg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=m1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=E1;break;case Og:case Dg:case Lg:Y=y1;break;case Mg:Y=R1;break;case"scroll":case"scrollend":Y=f1;break;case"wheel":Y=O1;break;case"copy":case"cut":case"paste":Y=x1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=mg;break;case"toggle":case"beforetoggle":Y=L1}var Ce=(i&4)!==0,ct=!Ce&&(n==="scroll"||n==="scrollend"),I=Ce?V!==null?V+"Capture":null:V;Ce=[];for(var U=F,H;U!==null;){var ee=U;if(H=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||H===null||I===null||(ee=Vr(U,I),ee!=null&&Ce.push(zo(U,ee,H))),ct)break;U=U.return}0<Ce.length&&(V=new Y(V,ve,null,o,W),ne.push({event:V,listeners:Ce}))}}if((i&7)===0){e:{if(V=n==="mouseover"||n==="pointerover",Y=n==="mouseout"||n==="pointerout",V&&o!==md&&(ve=o.relatedTarget||o.fromElement)&&(Xs(ve)||ve[Cn]))break e;if((Y||V)&&(V=W.window===W?W:(V=W.ownerDocument)?V.defaultView||V.parentWindow:window,Y?(ve=o.relatedTarget||o.toElement,Y=F,ve=ve?Xs(ve):null,ve!==null&&(ct=c(ve),Ce=ve.tag,ve!==ct||Ce!==5&&Ce!==27&&Ce!==6)&&(ve=null)):(Y=null,ve=F),Y!==ve)){if(Ce=fg,ee="onMouseLeave",I="onMouseEnter",U="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=mg,ee="onPointerLeave",I="onPointerEnter",U="pointer"),ct=Y==null?V:fs(Y),H=ve==null?V:fs(ve),V=new Ce(ee,U+"leave",Y,o,W),V.target=ct,V.relatedTarget=H,ee=null,Xs(W)===F&&(Ce=new Ce(I,U+"enter",ve,o,W),Ce.target=H,Ce.relatedTarget=ct,ee=Ce),ct=ee,Y&&ve)t:{for(Ce=DC,I=Y,U=ve,H=0,ee=I;ee;ee=Ce(ee))H++;ee=0;for(var Ne=U;Ne;Ne=Ce(Ne))ee++;for(;0<H-ee;)I=Ce(I),H--;for(;0<ee-H;)U=Ce(U),ee--;for(;H--;){if(I===U||U!==null&&I===U.alternate){Ce=I;break t}I=Ce(I),U=Ce(U)}Ce=null}else Ce=null;Y!==null&&av(ne,V,Y,Ce,!1),ve!==null&&ct!==null&&av(ne,ct,ve,Ce,!0)}}e:{if(V=F?fs(F):window,Y=V.nodeName&&V.nodeName.toLowerCase(),Y==="select"||Y==="input"&&V.type==="file")var Ye=jg;else if(bg(V))if(wg)Ye=F1;else{Ye=H1;var Se=q1}else Y=V.nodeName,!Y||Y.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?F&&hd(F.elementType)&&(Ye=jg):Ye=G1;if(Ye&&(Ye=Ye(n,F))){Sg(ne,Ye,o,W);break e}Se&&Se(n,V,F),n==="focusout"&&F&&V.type==="number"&&F.memoizedProps.value!=null&&fd(V,"number",V.value)}switch(Se=F?fs(F):window,n){case"focusin":(bg(Se)||Se.contentEditable==="true")&&(qa=Se,_d=F,no=null);break;case"focusout":no=_d=qa=null;break;case"mousedown":zd=!0;break;case"contextmenu":case"mouseup":case"dragend":zd=!1,Rg(ne,o,W);break;case"selectionchange":if(K1)break;case"keydown":case"keyup":Rg(ne,o,W)}var Te;if(wd)e:{switch(n){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else Ba?vg(n,o)&&(Ge="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(Ge="onCompositionStart");Ge&&(pg&&o.locale!=="ko"&&(Ba||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&Ba&&(Te=ug()):(ei=W,vd="value"in ei?ei.value:ei.textContent,Ba=!0)),Se=xc(F,Ge),0<Se.length&&(Ge=new hg(Ge,n,null,o,W),ne.push({event:Ge,listeners:Se}),Te?Ge.data=Te:(Te=xg(o),Te!==null&&(Ge.data=Te)))),(Te=U1?$1(n,o):P1(n,o))&&(Ge=xc(F,"onBeforeInput"),0<Ge.length&&(Se=new hg("onBeforeInput","beforeinput",null,o,W),ne.push({event:Se,listeners:Ge}),Se.data=Te)),AC(ne,n,F,o,W)}sv(ne,i)})}function zo(n,i,o){return{instance:n,listener:i,currentTarget:o}}function xc(n,i){for(var o=i+"Capture",u=[];n!==null;){var h=n,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Vr(n,o),h!=null&&u.unshift(zo(n,h,g)),h=Vr(n,i),h!=null&&u.push(zo(n,h,g))),n.tag===3)return u;n=n.return}return[]}function DC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function av(n,i,o,u,h){for(var g=i._reactName,j=[];o!==null&&o!==u;){var _=o,D=_.alternate,F=_.stateNode;if(_=_.tag,D!==null&&D===u)break;_!==5&&_!==26&&_!==27||F===null||(D=F,h?(F=Vr(o,g),F!=null&&j.unshift(zo(o,F,D))):h||(F=Vr(o,g),F!=null&&j.push(zo(o,F,D)))),o=o.return}j.length!==0&&n.push({event:i,listeners:j})}var LC=/\r\n?/g,MC=/\u0000|\uFFFD/g;function rv(n){return(typeof n=="string"?n:""+n).replace(LC,`
9
- `).replace(MC,"")}function ov(n,i){return i=rv(i),rv(n)===i}function lt(n,i,o,u,h,g){switch(o){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||$a(n,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&$a(n,""+u);break;case"className":wl(n,"class",u);break;case"tabIndex":wl(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":wl(n,o,u);break;case"style":og(n,u,g);break;case"data":if(i!=="object"){wl(n,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||o!=="href")){n.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=Cl(""+u),n.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(o,"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 g=="function"&&(o==="formAction"?(i!=="input"&&lt(n,i,"name",h.name,h,null),lt(n,i,"formEncType",h.formEncType,h,null),lt(n,i,"formMethod",h.formMethod,h,null),lt(n,i,"formTarget",h.formTarget,h,null)):(lt(n,i,"encType",h.encType,h,null),lt(n,i,"method",h.method,h,null),lt(n,i,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=Cl(""+u),n.setAttribute(o,u);break;case"onClick":u!=null&&(n.onclick=Cs);break;case"onScroll":u!=null&&Pe("scroll",n);break;case"onScrollEnd":u!=null&&Pe("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=o}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}o=Cl(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""+u):n.removeAttribute(o);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":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":u===!0?n.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,u):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(o,u):n.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(o):n.setAttribute(o,u);break;case"popover":Pe("beforetoggle",n),Pe("toggle",n),jl(n,"popover",u);break;case"xlinkActuate":Ns(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ns(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ns(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ns(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ns(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ns(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ns(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ns(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ns(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":jl(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=u1.get(o)||o,jl(n,o,u))}}function eh(n,i,o,u,h,g){switch(o){case"style":og(n,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=o}}break;case"children":typeof u=="string"?$a(n,u):(typeof u=="number"||typeof u=="bigint")&&$a(n,""+u);break;case"onScroll":u!=null&&Pe("scroll",n);break;case"onScrollEnd":u!=null&&Pe("scrollend",n);break;case"onClick":u!=null&&(n.onclick=Cs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rt.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),i=o.slice(2,h?o.length-7:void 0),g=n[Nt]||null,g=g!=null?g[o]:null,typeof g=="function"&&n.removeEventListener(i,g,h),typeof u=="function")){typeof g!="function"&&g!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(i,u,h);break e}o in n?n[o]=u:u===!0?n.setAttribute(o,""):jl(n,o,u)}}}function Wt(n,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",n),Pe("load",n);var u=!1,h=!1,g;for(g in o)if(o.hasOwnProperty(g)){var j=o[g];if(j!=null)switch(g){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(n,i,g,j,o,null)}}h&&lt(n,i,"srcSet",o.srcSet,o,null),u&&lt(n,i,"src",o.src,o,null);return;case"input":Pe("invalid",n);var _=g=j=h=null,D=null,F=null;for(u in o)if(o.hasOwnProperty(u)){var W=o[u];if(W!=null)switch(u){case"name":h=W;break;case"type":j=W;break;case"checked":D=W;break;case"defaultChecked":F=W;break;case"value":g=W;break;case"defaultValue":_=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:lt(n,i,u,W,o,null)}}sg(n,g,_,D,F,j,h,!1);return;case"select":Pe("invalid",n),u=j=g=null;for(h in o)if(o.hasOwnProperty(h)&&(_=o[h],_!=null))switch(h){case"value":g=_;break;case"defaultValue":j=_;break;case"multiple":u=_;default:lt(n,i,h,_,o,null)}i=g,o=j,n.multiple=!!u,i!=null?Ua(n,!!u,i,!1):o!=null&&Ua(n,!!u,o,!0);return;case"textarea":Pe("invalid",n),g=h=u=null;for(j in o)if(o.hasOwnProperty(j)&&(_=o[j],_!=null))switch(j){case"value":u=_;break;case"defaultValue":h=_;break;case"children":g=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:lt(n,i,j,_,o,null)}ag(n,u,h,g);return;case"option":for(D in o)o.hasOwnProperty(D)&&(u=o[D],u!=null)&&(D==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":lt(n,i,D,u,o,null));return;case"dialog":Pe("beforetoggle",n),Pe("toggle",n),Pe("cancel",n),Pe("close",n);break;case"iframe":case"object":Pe("load",n);break;case"video":case"audio":for(u=0;u<_o.length;u++)Pe(_o[u],n);break;case"image":Pe("error",n),Pe("load",n);break;case"details":Pe("toggle",n);break;case"embed":case"source":case"link":Pe("error",n),Pe("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in o)if(o.hasOwnProperty(F)&&(u=o[F],u!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(n,i,F,u,o,null)}return;default:if(hd(i)){for(W in o)o.hasOwnProperty(W)&&(u=o[W],u!==void 0&&eh(n,i,W,u,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(u=o[_],u!=null&&lt(n,i,_,u,o,null))}function UC(n,i,o,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,j=null,_=null,D=null,F=null,W=null;for(Y in o){var ne=o[Y];if(o.hasOwnProperty(Y)&&ne!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":D=ne;default:u.hasOwnProperty(Y)||lt(n,i,Y,null,u,ne)}}for(var V in u){var Y=u[V];if(ne=o[V],u.hasOwnProperty(V)&&(Y!=null||ne!=null))switch(V){case"type":g=Y;break;case"name":h=Y;break;case"checked":F=Y;break;case"defaultChecked":W=Y;break;case"value":j=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:Y!==ne&&lt(n,i,V,Y,u,ne)}}dd(n,j,_,D,F,W,g,h);return;case"select":Y=j=_=V=null;for(g in o)if(D=o[g],o.hasOwnProperty(g)&&D!=null)switch(g){case"value":break;case"multiple":Y=D;default:u.hasOwnProperty(g)||lt(n,i,g,null,u,D)}for(h in u)if(g=u[h],D=o[h],u.hasOwnProperty(h)&&(g!=null||D!=null))switch(h){case"value":V=g;break;case"defaultValue":_=g;break;case"multiple":j=g;default:g!==D&&lt(n,i,h,g,u,D)}i=_,o=j,u=Y,V!=null?Ua(n,!!o,V,!1):!!u!=!!o&&(i!=null?Ua(n,!!o,i,!0):Ua(n,!!o,o?[]:"",!1));return;case"textarea":Y=V=null;for(_ in o)if(h=o[_],o.hasOwnProperty(_)&&h!=null&&!u.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:lt(n,i,_,null,u,h)}for(j in u)if(h=u[j],g=o[j],u.hasOwnProperty(j)&&(h!=null||g!=null))switch(j){case"value":V=h;break;case"defaultValue":Y=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==g&&lt(n,i,j,h,u,g)}ig(n,V,Y);return;case"option":for(var ve in o)V=o[ve],o.hasOwnProperty(ve)&&V!=null&&!u.hasOwnProperty(ve)&&(ve==="selected"?n.selected=!1:lt(n,i,ve,null,u,V));for(D in u)V=u[D],Y=o[D],u.hasOwnProperty(D)&&V!==Y&&(V!=null||Y!=null)&&(D==="selected"?n.selected=V&&typeof V!="function"&&typeof V!="symbol":lt(n,i,D,V,u,Y));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 Ce in o)V=o[Ce],o.hasOwnProperty(Ce)&&V!=null&&!u.hasOwnProperty(Ce)&&lt(n,i,Ce,null,u,V);for(F in u)if(V=u[F],Y=o[F],u.hasOwnProperty(F)&&V!==Y&&(V!=null||Y!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(a(137,i));break;default:lt(n,i,F,V,u,Y)}return;default:if(hd(i)){for(var ct in o)V=o[ct],o.hasOwnProperty(ct)&&V!==void 0&&!u.hasOwnProperty(ct)&&eh(n,i,ct,void 0,u,V);for(W in u)V=u[W],Y=o[W],!u.hasOwnProperty(W)||V===Y||V===void 0&&Y===void 0||eh(n,i,W,V,u,Y);return}}for(var I in o)V=o[I],o.hasOwnProperty(I)&&V!=null&&!u.hasOwnProperty(I)&&lt(n,i,I,null,u,V);for(ne in u)V=u[ne],Y=o[ne],!u.hasOwnProperty(ne)||V===Y||V==null&&Y==null||lt(n,i,ne,V,u,Y)}function lv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $C(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var h=o[u],g=h.transferSize,j=h.initiatorType,_=h.duration;if(g&&_&&lv(j)){for(j=0,_=h.responseEnd,u+=1;u<o.length;u++){var D=o[u],F=D.startTime;if(F>_)break;var W=D.transferSize,ne=D.initiatorType;W&&lv(ne)&&(D=D.responseEnd,j+=W*(D<_?1:(_-F)/(D-F)))}if(--u,i+=8*(g+j)/(h.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var th=null,nh=null;function bc(n){return n.nodeType===9?n:n.ownerDocument}function cv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function uv(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function sh(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ih=null;function PC(){var n=window.event;return n&&n.type==="popstate"?n===ih?!1:(ih=n,!0):(ih=null,!1)}var dv=typeof setTimeout=="function"?setTimeout:void 0,IC=typeof clearTimeout=="function"?clearTimeout:void 0,fv=typeof Promise=="function"?Promise:void 0,BC=typeof queueMicrotask=="function"?queueMicrotask:typeof fv<"u"?function(n){return fv.resolve(null).then(n).catch(qC)}:dv;function qC(n){setTimeout(function(){throw n})}function yi(n){return n==="head"}function hv(n,i){var o=i,u=0;do{var h=o.nextSibling;if(n.removeChild(o),h&&h.nodeType===8)if(o=h.data,o==="/$"||o==="/&"){if(u===0){n.removeChild(h),pr(i);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")Eo(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,Eo(o);for(var g=o.firstChild;g;){var j=g.nextSibling,_=g.nodeName;g[ds]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=j}}else o==="body"&&Eo(n.ownerDocument.body);o=h}while(o);pr(i)}function mv(n,i){var o=n;n=0;do{var u=o.nextSibling;if(o.nodeType===1?i?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(i?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=u}while(o)}function ah(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var o=i;switch(i=i.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":ah(o),La(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function HC(n,i,o,u){for(;n.nodeType===1;){var h=o;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[ds])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=Bn(n.nextSibling),n===null)break}return null}function GC(n,i,o){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Bn(n.nextSibling),n===null))return null;return n}function pv(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Bn(n.nextSibling),n===null))return null;return n}function rh(n){return n.data==="$?"||n.data==="$~"}function oh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function FC(n,i){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||o.readyState!=="loading")i();else{var u=function(){i(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function Bn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var lh=null;function gv(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(i===0)return Bn(n.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}n=n.nextSibling}return null}function yv(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(i===0)return n;i--}else o!=="/$"&&o!=="/&"||i++}n=n.previousSibling}return null}function vv(n,i,o){switch(i=bc(o),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function Eo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);La(n)}var qn=new Map,xv=new Set;function Sc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Bs=G.d;G.d={f:ZC,r:KC,D:VC,C:QC,L:YC,m:JC,X:WC,S:XC,M:ek};function ZC(){var n=Bs.f(),i=fc();return n||i}function KC(n){var i=Xn(n);i!==null&&i.tag===5&&i.type==="form"?My(i):Bs.r(n)}var fr=typeof document>"u"?null:document;function bv(n,i,o){var u=fr;if(u&&typeof i=="string"&&i){var h=Dn(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),xv.has(h)||(xv.add(h),n={rel:n,crossOrigin:o,href:i},u.querySelector(h)===null&&(i=u.createElement("link"),Wt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function VC(n){Bs.D(n),bv("dns-prefetch",n,null)}function QC(n,i){Bs.C(n,i),bv("preconnect",n,i)}function YC(n,i,o){Bs.L(n,i,o);var u=fr;if(u&&n&&i){var h='link[rel="preload"][as="'+Dn(i)+'"]';i==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+Dn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+Dn(o.imageSizes)+'"]')):h+='[href="'+Dn(n)+'"]';var g=h;switch(i){case"style":g=hr(n);break;case"script":g=mr(n)}qn.has(g)||(n=y({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:n,as:i},o),qn.set(g,n),u.querySelector(h)!==null||i==="style"&&u.querySelector(Ao(g))||i==="script"&&u.querySelector(Ro(g))||(i=u.createElement("link"),Wt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function JC(n,i){Bs.m(n,i);var o=fr;if(o&&n){var u=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Dn(u)+'"][href="'+Dn(n)+'"]',g=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=mr(n)}if(!qn.has(g)&&(n=y({rel:"modulepreload",href:n},i),qn.set(g,n),o.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Ro(g)))return}u=o.createElement("link"),Wt(u,"link",n),Mt(u),o.head.appendChild(u)}}}function XC(n,i,o){Bs.S(n,i,o);var u=fr;if(u&&n){var h=Ws(u).hoistableStyles,g=hr(n);i=i||"default";var j=h.get(g);if(!j){var _={loading:0,preload:null};if(j=u.querySelector(Ao(g)))_.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},o),(o=qn.get(g))&&ch(n,o);var D=j=u.createElement("link");Mt(D),Wt(D,"link",n),D._p=new Promise(function(F,W){D.onload=F,D.onerror=W}),D.addEventListener("load",function(){_.loading|=1}),D.addEventListener("error",function(){_.loading|=2}),_.loading|=4,jc(j,i,u)}j={type:"stylesheet",instance:j,count:1,state:_},h.set(g,j)}}}function WC(n,i){Bs.X(n,i);var o=fr;if(o&&n){var u=Ws(o).hoistableScripts,h=mr(n),g=u.get(h);g||(g=o.querySelector(Ro(h)),g||(n=y({src:n,async:!0},i),(i=qn.get(h))&&uh(n,i),g=o.createElement("script"),Mt(g),Wt(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function ek(n,i){Bs.M(n,i);var o=fr;if(o&&n){var u=Ws(o).hoistableScripts,h=mr(n),g=u.get(h);g||(g=o.querySelector(Ro(h)),g||(n=y({src:n,async:!0,type:"module"},i),(i=qn.get(h))&&uh(n,i),g=o.createElement("script"),Mt(g),Wt(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function Sv(n,i,o,u){var h=(h=he.current)?Sc(h):null;if(!h)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(i=hr(o.href),o=Ws(h).hoistableStyles,u=o.get(i),u||(u={type:"style",instance:null,count:0,state:null},o.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=hr(o.href);var g=Ws(h).hoistableStyles,j=g.get(n);if(j||(h=h.ownerDocument||h,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,j),(g=h.querySelector(Ao(n)))&&!g._p&&(j.instance=g,j.state.loading=5),qn.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},qn.set(n,o),g||tk(h,n,o,j.state))),i&&u===null)throw Error(a(528,""));return j}if(i&&u!==null)throw Error(a(529,""));return null;case"script":return i=o.async,o=o.src,typeof o=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=mr(o),o=Ws(h).hoistableScripts,u=o.get(i),u||(u={type:"script",instance:null,count:0,state:null},o.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function hr(n){return'href="'+Dn(n)+'"'}function Ao(n){return'link[rel="stylesheet"]['+n+"]"}function jv(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function tk(n,i,o,u){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=n.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),Wt(i,"link",o),Mt(i),n.head.appendChild(i))}function mr(n){return'[src="'+Dn(n)+'"]'}function Ro(n){return"script[async]"+n}function wv(n,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var u=n.querySelector('style[data-href~="'+Dn(o.href)+'"]');if(u)return i.instance=u,Mt(u),u;var h=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),Mt(u),Wt(u,"style",h),jc(u,o.precedence,n),i.instance=u;case"stylesheet":h=hr(o.href);var g=n.querySelector(Ao(h));if(g)return i.state.loading|=4,i.instance=g,Mt(g),g;u=jv(o),(h=qn.get(h))&&ch(u,h),g=(n.ownerDocument||n).createElement("link"),Mt(g);var j=g;return j._p=new Promise(function(_,D){j.onload=_,j.onerror=D}),Wt(g,"link",u),i.state.loading|=4,jc(g,o.precedence,n),i.instance=g;case"script":return g=mr(o.src),(h=n.querySelector(Ro(g)))?(i.instance=h,Mt(h),h):(u=o,(h=qn.get(g))&&(u=y({},o),uh(u,h)),n=n.ownerDocument||n,h=n.createElement("script"),Mt(h),Wt(h,"link",u),n.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(u=i.instance,i.state.loading|=4,jc(u,o.precedence,n));return i.instance}function jc(n,i,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,g=h,j=0;j<u.length;j++){var _=u[j];if(_.dataset.precedence===i)g=_;else if(g!==h)break}g?g.parentNode.insertBefore(n,g.nextSibling):(i=o.nodeType===9?o.head:o,i.insertBefore(n,i.firstChild))}function ch(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function uh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var wc=null;function Nv(n,i,o){if(wc===null){var u=new Map,h=wc=new Map;h.set(o,u)}else h=wc,u=h.get(o),u||(u=new Map,h.set(o,u));if(u.has(n))return u;for(u.set(n,null),o=o.getElementsByTagName(n),h=0;h<o.length;h++){var g=o[h];if(!(g[ds]||g[Et]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var j=g.getAttribute(i)||"";j=n+j;var _=u.get(j);_?_.push(g):u.set(j,[g])}}return u}function Cv(n,i,o){n=n.ownerDocument||n,n.head.insertBefore(o,i==="title"?n.querySelector("head > title"):null)}function nk(n,i,o){if(o===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(n=i.disabled,typeof i.precedence=="string"&&n==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function kv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function sk(n,i,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var h=hr(u.href),g=i.querySelector(Ao(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Nc.bind(n),i.then(n,n)),o.state.loading|=4,o.instance=g,Mt(g);return}g=i.ownerDocument||i,u=jv(u),(h=qn.get(h))&&ch(u,h),g=g.createElement("link"),Mt(g);var j=g;j._p=new Promise(function(_,D){j.onload=_,j.onerror=D}),Wt(g,"link",u),o.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,i),(i=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=Nc.bind(n),i.addEventListener("load",o),i.addEventListener("error",o))}}var dh=0;function ik(n,i){return n.stylesheets&&n.count===0&&kc(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var u=setTimeout(function(){if(n.stylesheets&&kc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&dh===0&&(dh=62500*$C());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&kc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>dh?50:800)+i);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function Nc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Cc=null;function kc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Cc=new Map,i.forEach(ak,n),Cc=null,Nc.call(n))}function ak(n,i){if(!(i.state.loading&4)){var o=Cc.get(n);if(o)var u=o.get(null);else{o=new Map,Cc.set(n,o);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var j=h[g];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(o.set(j.dataset.precedence,j),u=j)}u&&o.set(null,u)}h=i.instance,j=h.getAttribute("data-precedence"),g=o.get(j)||u,g===u&&o.set(null,h),o.set(j,h),this.count++,u=Nc.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),g?g.parentNode.insertBefore(h,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),i.state.loading|=4}}var To={$$typeof:A,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function rk(n,i,o,u,h,g,j,_,D){this.tag=1,this.containerInfo=n,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=Da(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Da(0),this.hiddenUpdates=Da(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function _v(n,i,o,u,h,g,j,_,D,F,W,ne){return n=new rk(n,i,o,j,D,F,W,ne,_),i=1,g===!0&&(i|=24),g=_n(3,null,null,i),n.current=g,g.stateNode=n,i=Hd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:u,isDehydrated:o,cache:i},Kd(g),n}function zv(n){return n?(n=Fa,n):Fa}function Ev(n,i,o,u,h,g){h=zv(h),u.context===null?u.context=h:u.pendingContext=h,u=ri(i),u.payload={element:o},g=g===void 0?null:g,g!==null&&(u.callback=g),o=oi(n,u,i),o!==null&&(bn(o,n,i),co(o,n,i))}function Av(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<i?o:i}}function fh(n,i){Av(n,i),(n=n.alternate)&&Av(n,i)}function Rv(n){if(n.tag===13||n.tag===31){var i=Qi(n,67108864);i!==null&&bn(i,n,67108864),fh(n,67108864)}}function Tv(n){if(n.tag===13||n.tag===31){var i=Tn();i=$(i);var o=Qi(n,i);o!==null&&bn(o,n,i),fh(n,i)}}var _c=!0;function ok(n,i,o,u){var h=B.T;B.T=null;var g=G.p;try{G.p=2,hh(n,i,o,u)}finally{G.p=g,B.T=h}}function lk(n,i,o,u){var h=B.T;B.T=null;var g=G.p;try{G.p=8,hh(n,i,o,u)}finally{G.p=g,B.T=h}}function hh(n,i,o,u){if(_c){var h=mh(u);if(h===null)Wf(n,i,u,zc,o),Dv(n,u);else if(uk(h,n,i,o,u))u.stopPropagation();else if(Dv(n,u),i&4&&-1<ck.indexOf(n)){for(;h!==null;){var g=Xn(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var j=cs(g.pendingLanes);if(j!==0){var _=g;for(_.pendingLanes|=2,_.entangledLanes|=2;j;){var D=1<<31-Ve(j);_.entanglements[1]|=D,j&=~D}gs(g),(Xe&6)===0&&(uc=Be()+500,ko(0))}}break;case 31:case 13:_=Qi(g,2),_!==null&&bn(_,g,2),fc(),fh(g,2)}if(g=mh(u),g===null&&Wf(n,i,u,zc,o),g===h)break;h=g}h!==null&&u.stopPropagation()}else Wf(n,i,u,null,o)}}function mh(n){return n=pd(n),ph(n)}var zc=null;function ph(n){if(zc=null,n=Xs(n),n!==null){var i=c(n);if(i===null)n=null;else{var o=i.tag;if(o===13){if(n=d(i),n!==null)return n;n=null}else if(o===31){if(n=f(i),n!==null)return n;n=null}else if(o===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return zc=n,null}function Ov(n){switch(n){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(ze()){case Ue:return 2;case pt:return 8;case rn:case Ss:return 32;case Ks:return 268435456;default:return 32}default:return 32}}var gh=!1,vi=null,xi=null,bi=null,Oo=new Map,Do=new Map,Si=[],ck="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 Dv(n,i){switch(n){case"focusin":case"focusout":vi=null;break;case"dragenter":case"dragleave":xi=null;break;case"mouseover":case"mouseout":bi=null;break;case"pointerover":case"pointerout":Oo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Do.delete(i.pointerId)}}function Lo(n,i,o,u,h,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:o,eventSystemFlags:u,nativeEvent:g,targetContainers:[h]},i!==null&&(i=Xn(i),i!==null&&Rv(i)),n):(n.eventSystemFlags|=u,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function uk(n,i,o,u,h){switch(i){case"focusin":return vi=Lo(vi,n,i,o,u,h),!0;case"dragenter":return xi=Lo(xi,n,i,o,u,h),!0;case"mouseover":return bi=Lo(bi,n,i,o,u,h),!0;case"pointerover":var g=h.pointerId;return Oo.set(g,Lo(Oo.get(g)||null,n,i,o,u,h)),!0;case"gotpointercapture":return g=h.pointerId,Do.set(g,Lo(Do.get(g)||null,n,i,o,u,h)),!0}return!1}function Lv(n){var i=Xs(n.target);if(i!==null){var o=c(i);if(o!==null){if(i=o.tag,i===13){if(i=d(o),i!==null){n.blockedOn=i,Qt(n.priority,function(){Tv(o)});return}}else if(i===31){if(i=f(o),i!==null){n.blockedOn=i,Qt(n.priority,function(){Tv(o)});return}}else if(i===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Ec(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var o=mh(n.nativeEvent);if(o===null){o=n.nativeEvent;var u=new o.constructor(o.type,o);md=u,o.target.dispatchEvent(u),md=null}else return i=Xn(o),i!==null&&Rv(i),n.blockedOn=o,!1;i.shift()}return!0}function Mv(n,i,o){Ec(n)&&o.delete(i)}function dk(){gh=!1,vi!==null&&Ec(vi)&&(vi=null),xi!==null&&Ec(xi)&&(xi=null),bi!==null&&Ec(bi)&&(bi=null),Oo.forEach(Mv),Do.forEach(Mv)}function Ac(n,i){n.blockedOn===i&&(n.blockedOn=null,gh||(gh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,dk)))}var Rc=null;function Uv(n){Rc!==n&&(Rc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Rc===n&&(Rc=null);for(var i=0;i<n.length;i+=3){var o=n[i],u=n[i+1],h=n[i+2];if(typeof u!="function"){if(ph(u||o)===null)continue;break}var g=Xn(o);g!==null&&(n.splice(i,3),i-=3,mf(g,{pending:!0,data:h,method:o.method,action:u},u,h))}}))}function pr(n){function i(D){return Ac(D,n)}vi!==null&&Ac(vi,n),xi!==null&&Ac(xi,n),bi!==null&&Ac(bi,n),Oo.forEach(i),Do.forEach(i);for(var o=0;o<Si.length;o++){var u=Si[o];u.blockedOn===n&&(u.blockedOn=null)}for(;0<Si.length&&(o=Si[0],o.blockedOn===null);)Lv(o),o.blockedOn===null&&Si.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var h=o[u],g=o[u+1],j=h[Nt]||null;if(typeof g=="function")j||Uv(o);else if(j){var _=null;if(g&&g.hasAttribute("formAction")){if(h=g,j=g[Nt]||null)_=j.formAction;else if(ph(h)!==null)continue}else _=j.action;typeof _=="function"?o[u+1]=_:(o.splice(u,3),u-=3),Uv(o)}}}function $v(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(j){return h=j})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function yh(n){this._internalRoot=n}Tc.prototype.render=yh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,u=Tn();Ev(o,u,n,i,null,null)},Tc.prototype.unmount=yh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Ev(n.current,2,null,n,null,null),fc(),i[Cn]=null}};function Tc(n){this._internalRoot=n}Tc.prototype.unstable_scheduleHydration=function(n){if(n){var i=at();n={blockedOn:null,target:n,priority:i};for(var o=0;o<Si.length&&i!==0&&i<Si[o].priority;o++);Si.splice(o,0,n),o===0&&Lv(n)}};var Pv=t.version;if(Pv!=="19.2.4")throw Error(a(527,Pv,"19.2.4"));G.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=m(i),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var fk={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Oc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oc.isDisabled&&Oc.supportsFiber)try{ls=Oc.inject(fk),_e=Oc}catch{}}return Uo.createRoot=function(n,i){if(!r(n))throw Error(a(299));var o=!1,u="",h=Zy,g=Ky,j=Vy;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError)),i=_v(n,1,!1,null,null,o,u,null,h,g,j,$v),n[Cn]=i.current,Xf(n),new yh(i)},Uo.hydrateRoot=function(n,i,o){if(!r(n))throw Error(a(299));var u=!1,h="",g=Zy,j=Ky,_=Vy,D=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(j=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError),o.formState!==void 0&&(D=o.formState)),i=_v(n,1,!0,i,o??null,u,h,D,g,j,_,$v),i.context=zv(null),o=i.current,u=Tn(),u=$(u),h=ri(u),h.callback=null,oi(o,h,u),o=u,i.current.lanes=o,Fi(i,o),gs(i),n[Cn]=i.current,Xf(n),new Tc(i)},Uo.version="19.2.4",Uo}var Qv;function jk(){if(Qv)return bh.exports;Qv=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(),bh.exports=Sk(),bh.exports}var wk=jk(),$r=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(){}},Nk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ck=class{#t=Nk;#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)}},fa=new Ck;function kk(e){setTimeout(e,0)}var Na=typeof window>"u"||"Deno"in globalThis;function un(){}function _k(e,t){return typeof e=="function"?e(t):e}function nm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ti(e,t){return typeof e=="function"?e(t):e}function Hn(e,t){return typeof e=="function"?e(t):e}function Yv(e,t){const{type:s="all",exact:a,fetchStatus:r,predicate:c,queryKey:d,stale:f}=e;if(d){if(a){if(t.queryHash!==Hm(d,t.options))return!1}else if(!Xo(t.queryKey,d))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||r&&r!==t.state.fetchStatus||c&&!c(t))}function Jv(e,t){const{exact:s,status:a,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Jo(t.options.mutationKey)!==Jo(c))return!1}else if(!Xo(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||r&&!r(t))}function Hm(e,t){return(t?.queryKeyHashFn||Jo)(e)}function Jo(e){return JSON.stringify(e,(t,s)=>sm(s)?Object.keys(s).sort().reduce((a,r)=>(a[r]=s[r],a),{}):s)}function Xo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Xo(e[s],t[s])):!1}var zk=Object.prototype.hasOwnProperty;function Gm(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=Xv(e)&&Xv(t);if(!a&&!(sm(e)&&sm(t)))return t;const c=(a?e:Object.keys(e)).length,d=a?t:Object.keys(t),f=d.length,p=a?new Array(f):{};let m=0;for(let v=0;v<f;v++){const y=a?v:d[v],x=e[y],b=t[y];if(x===b){p[y]=x,(a?v<c:zk.call(e,y))&&m++;continue}if(x===null||b===null||typeof x!="object"||typeof b!="object"){p[y]=b;continue}const w=Gm(x,b,s+1);p[y]=w,w===x&&m++}return c===f&&m===c?e:p}function uu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Xv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function sm(e){if(!Wv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Wv(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Wv(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ek(e){return new Promise(t=>{fa.setTimeout(t,e)})}function im(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Gm(e,t):t}function Ak(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function Rk(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var Fm=Symbol();function Wb(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Fm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function eS(e,t){return typeof e=="function"?e(...t):!!e}function Tk(e,t,s){let a=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),a||(a=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),e}var Ok=class extends $r{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Na&&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"}},Zm=new Ok;function am(){let e,t;const s=new Promise((r,c)=>{e=r,t=c});s.status="pending",s.catch(()=>{});function a(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{a({status:"fulfilled",value:r}),e(r)},s.reject=r=>{a({status:"rejected",reason:r}),t(r)},s}var Dk=kk;function Lk(){let e=[],t=0,s=f=>{f()},a=f=>{f()},r=Dk;const c=f=>{t?e.push(f):r(()=>{s(f)})},d=()=>{const f=e;e=[],f.length&&r(()=>{a(()=>{f.forEach(p=>{s(p)})})})};return{batch:f=>{let p;t++;try{p=f()}finally{t--,t||d()}return p},batchCalls:f=>(...p)=>{c(()=>{f(...p)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{r=f}}}var Bt=Lk(),Mk=class extends $r{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Na&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}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(s=>{s(e)}))}isOnline(){return this.#t}},du=new Mk;function Uk(e){return Math.min(1e3*2**e,3e4)}function tS(e){return(e??"online")==="online"?du.isOnline():!0}var rm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function nS(e){let t=!1,s=0,a;const r=am(),c=()=>r.status!=="pending",d=S=>{if(!c()){const C=new rm(S);x(C),e.onCancel?.(C)}},f=()=>{t=!0},p=()=>{t=!1},m=()=>Zm.isFocused()&&(e.networkMode==="always"||du.isOnline())&&e.canRun(),v=()=>tS(e.networkMode)&&e.canRun(),y=S=>{c()||(a?.(),r.resolve(S))},x=S=>{c()||(a?.(),r.reject(S))},b=()=>new Promise(S=>{a=C=>{(c()||m())&&S(C)},e.onPause?.()}).then(()=>{a=void 0,c()||e.onContinue?.()}),w=()=>{if(c())return;let S;const C=s===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(k){S=Promise.reject(k)}Promise.resolve(S).then(y).catch(k=>{if(c())return;const E=e.retry??(Na?0:3),A=e.retryDelay??Uk,z=typeof A=="function"?A(s,k):A,L=E===!0||typeof E=="number"&&s<E||typeof E=="function"&&E(s,k);if(t||!L){x(k);return}s++,e.onFail?.(s,k),Ek(z).then(()=>m()?void 0:b()).then(()=>{t?x(k):w()})})};return{promise:r,status:()=>r.status,cancel:d,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:p,canStart:v,start:()=>(v()?w():b().then(w),r)}}var sS=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nm(this.gcTime)&&(this.#t=fa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Na?1/0:300*1e3))}clearGcTimeout(){this.#t&&(fa.clearTimeout(this.#t),this.#t=void 0)}},$k=class extends sS{#t;#e;#n;#i;#s;#r;#o;constructor(e){super(),this.#o=!1,this.#r=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=tx(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#r,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=tx(this.options);t.data!==void 0&&(this.setState(ex(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=im(this.state.data,e,this.options);return this.#a({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(un).catch(un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Hn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Fm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ti(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:!Xb(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.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.#s&&(this.#o?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},r=()=>{const f=Wb(this.options,t),m=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(v),v})();return this.#o=!1,this.options.persister?this.options.persister(f,m,this):f(m)},d=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:r};return a(f),f})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#a({type:"fetch",meta:d.fetchOptions?.meta}),this.#s=nS({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:f=>{f instanceof rm&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(f,p)=>{this.#a({type:"failed",failureCount:f,error:p})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const f=await this.#s.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof rm){if(f.silent)return this.#s.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#a({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#a(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...iS(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...ex(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?a:void 0,a;case"error":const r=e.error;return{...s,error:r,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),Bt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function iS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ex(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function tx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,a=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Km=class extends $r{constructor(e,t){super(),this.options=t,this.#t=e,this.#a=null,this.#o=am(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#r;#o;#a;#m;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),nx(this.#e,this.options)?this.#p():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return om(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return om(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,s=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 Hn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!uu(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&sx(this.#e,s,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==s||Hn(this.options.enabled,this.#e)!==Hn(t.enabled,this.#e)||Ti(this.options.staleTime,this.#e)!==Ti(t.staleTime,this.#e))&&this.#g();const r=this.#y();a&&(this.#e!==s||Hn(this.options.enabled,this.#e)!==Hn(t.enabled,this.#e)||r!==this.#l)&&this.#v(r)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(t,e);return Ik(this,s)&&(this.#i=s,this.#r=this.options,this.#s=this.#e.state),s}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(s,a)=>(this.trackProp(a),t?.(a),a==="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(s,a))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),s=this.#t.getQueryCache().build(this.#t,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#p(e){this.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(un)),t}#g(){this.#b();const e=Ti(this.options.staleTime,this.#e);if(Na||this.#i.isStale||!nm(e))return;const s=Xb(this.#i.dataUpdatedAt,e)+1;this.#c=fa.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#l=e,!(Na||Hn(this.options.enabled,this.#e)===!1||!nm(this.#l)||this.#l===0)&&(this.#u=fa.setInterval(()=>{(this.options.refetchIntervalInBackground||Zm.isFocused())&&this.#p()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(fa.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(fa.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const s=this.#e,a=this.options,r=this.#i,c=this.#s,d=this.#r,p=e!==s?e.state:this.#n,{state:m}=e;let v={...m},y=!1,x;if(t._optimisticResults){const T=this.hasListeners(),P=!T&&nx(e,t),J=T&&sx(e,s,t,a);(P||J)&&(v={...v,...iS(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=v;x=v.data;let C=!1;if(t.placeholderData!==void 0&&x===void 0&&S==="pending"){let T;r?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(T=r.data,C=!0):T=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,T!==void 0&&(S="success",x=im(r?.data,T,t),y=!0)}if(t.select&&x!==void 0&&!C)if(r&&x===c?.data&&t.select===this.#m)x=this.#d;else try{this.#m=t.select,x=t.select(x),x=im(r?.data,x,t),this.#d=x,this.#a=null}catch(T){this.#a=T}this.#a&&(b=this.#a,x=this.#d,w=Date.now(),S="error");const k=v.fetchStatus==="fetching",E=S==="pending",A=S==="error",z=E&&k,L=x!==void 0,R={status:S,fetchStatus:v.fetchStatus,isPending:E,isSuccess:S==="success",isError:A,isInitialLoading:z,isLoading:z,data:x,dataUpdatedAt:v.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:A&&!L,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:A&&L,isStale:Vm(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Hn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=R.data!==void 0,P=R.status==="error"&&!T,J=pe=>{P?pe.reject(R.error):T&&pe.resolve(R.data)},Q=()=>{const pe=this.#o=R.promise=am();J(pe)},se=this.#o;switch(se.status){case"pending":e.queryHash===s.queryHash&&J(se);break;case"fulfilled":(P||R.data!==se.value)&&Q();break;case"rejected":(!P||R.error!==se.reason)&&Q();break}}return R}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#r=this.options,this.#s.data!==void 0&&(this.#f=this.#e),uu(t,e))return;this.#i=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,r=typeof a=="function"?a():a;if(r==="all"||!r&&!this.#h.size)return!0;const c=new Set(r??this.#h);return this.options.throwOnError&&c.add("error"),Object.keys(this.#i).some(d=>{const f=d;return this.#i[f]!==e[f]&&c.has(f)})};this.#w({listeners:s()})}#j(){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()}#w(e){Bt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Pk(e,t){return Hn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function nx(e,t){return Pk(e,t)||e.state.data!==void 0&&om(e,t,t.refetchOnMount)}function om(e,t,s){if(Hn(t.enabled,e)!==!1&&Ti(t.staleTime,e)!=="static"){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&Vm(e,t)}return!1}function sx(e,t,s,a){return(e!==t||Hn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Vm(e,s)}function Vm(e,t){return Hn(t.enabled,e)!==!1&&e.isStaleByTime(Ti(t.staleTime,e))}function Ik(e,t){return!uu(e.getCurrentResult(),t)}function ix(e){return{onFetch:(t,s)=>{const a=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const y=w=>{Tk(w,()=>t.signal,()=>v=!0)},x=Wb(t.options,t.fetchOptions),b=async(w,S,C)=>{if(v)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return y(M),M})(),A=await x(E),{maxPages:z}=t.options,L=C?Rk:Ak;return{pages:L(w.pages,A,z),pageParams:L(w.pageParams,S,z)}};if(r&&c.length){const w=r==="backward",S=w?Bk:ax,C={pages:c,pageParams:d},k=S(a,C);f=await b(C,k,w)}else{const w=e??c.length;do{const S=p===0?d[0]??a.initialPageParam:ax(a,f);if(p>0&&S==null)break;f=await b(f,S),p++}while(p<w)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=m}}}function ax(e,{pages:t,pageParams:s}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,s[a],s):void 0}function Bk(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var qk=class extends sS{#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||Hk(),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.#s({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=nS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",r=!this.#i.canStart();try{if(a)t();else{this.#s({type:"pending",variables:e,isPaused:r}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const d=await this.options.onMutate?.(e,s);d!==this.state.context&&this.#s({type:"pending",context:d,variables:e,isPaused:r})}const c=await this.#i.start();return await this.#n.config.onSuccess?.(c,e,this.state.context,this,s),await this.options.onSuccess?.(c,e,this.state.context,s),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(c,null,e,this.state.context,s),this.#s({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,e,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onError?.(c,e,this.state.context,s)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,s)}catch(d){Promise.reject(d)}throw this.#s({type:"error",error:c}),c}finally{this.#n.runNext(this)}}#s(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,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{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Bt.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Hk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var aS=class extends $r{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,s){const a=new qk({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:s});return this.add(a),a}add(e){this.#t.add(e);const t=Dc(e);if(typeof t=="string"){const s=this.#e.get(t);s?s.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Dc(e);if(typeof t=="string"){const s=this.#e.get(t);if(s)if(s.length>1){const a=s.indexOf(e);a!==-1&&s.splice(a,1)}else s[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Dc(e);if(typeof t=="string"){const a=this.#e.get(t)?.find(r=>r.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Dc(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Bt.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(s=>Jv(t,s))}findAll(e={}){return this.getAll().filter(t=>Jv(e,t))}notify(e){Bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Bt.batch(()=>Promise.all(e.map(t=>t.continue().catch(un))))}};function Dc(e){return e.options.scope?.id}function rx(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function Gk(e,t,s){const a=e.slice(0);return a[t]=s,a}var Fk=class extends $r{#t;#e;#n;#i;#s;#r;#o;#a;#m;#d=[];constructor(e,t,s){super(),this.#t=e,this.#i=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,Bt.batch(()=>{const s=this.#s,a=this.#u(this.#n);a.forEach(v=>v.observer.setOptions(v.defaultedQueryOptions));const r=a.map(v=>v.observer),c=r.map(v=>v.getCurrentResult()),d=s.length!==r.length,f=r.some((v,y)=>v!==s[y]),p=d||f,m=p?!0:c.some((v,y)=>{const x=this.#e[y];return!x||!uu(v,x)});!p&&!m||(p&&(this.#d=a,this.#s=r),this.#e=c,this.hasListeners()&&(p&&(rx(s,r).forEach(v=>{v.destroy()}),rx(r,s).forEach(v=>{v.subscribe(y=>{this.#l(v,y)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const s=this.#u(e),a=s.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),r=s.map(c=>c.defaultedQueryOptions.queryHash);return[a,c=>this.#c(c??a,t,r),()=>this.#f(a,s)]}#f(e,t){return t.map((s,a)=>{const r=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,c=>{t.forEach(d=>{d.observer.trackProp(c)})})})}#c(e,t,s){if(t){const a=this.#m,r=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((c,d)=>c!==a[d]));return(!this.#r||this.#e!==this.#a||r||t!==this.#o)&&(this.#o=t,this.#a=this.#e,s!==void 0&&(this.#m=s),this.#r=Gm(this.#r,t(e))),this.#r}return e}#u(e){const t=new Map;this.#s.forEach(a=>{const r=a.options.queryHash;if(!r)return;const c=t.get(r);c?c.push(a):t.set(r,[a])});const s=[];return e.forEach(a=>{const r=this.#t.defaultQueryOptions(a),d=t.get(r.queryHash)?.shift()??new Km(this.#t,r);s.push({defaultedQueryOptions:r,observer:d})}),s}#l(e,t){const s=this.#s.indexOf(e);s!==-1&&(this.#e=Gk(this.#e,s,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#r,t=this.#f(this.#e,this.#d),s=this.#c(t,this.#i?.combine);e!==s&&Bt.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}},Zk=class extends $r{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const a=t.queryKey,r=t.queryHash??Hm(a,t);let c=this.get(r);return c||(c=new $k({client:e,queryKey:a,queryHash:r,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(a)}),this.add(c)),c}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(){Bt.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(s=>Yv(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>Yv(e,s)):t}notify(e){Bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Kk=class{#t;#e;#n;#i;#s;#r;#o;#a;constructor(e={}){this.#t=e.queryCache||new Zk,this.#e=e.mutationCache||new aS,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=Zm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=du.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=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),s=this.#t.build(this,t),a=s.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Ti(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:s})=>{const a=s.data;return[t,a]})}setQueryData(e,t,s){const a=this.defaultQueryOptions({queryKey:e}),c=this.#t.get(a.queryHash)?.state.data,d=_k(t,c);if(d!==void 0)return this.#t.build(this,a).setData(d,{...s,manual:!0})}setQueriesData(e,t,s){return Bt.batch(()=>this.#t.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;Bt.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#t;return Bt.batch(()=>(s.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},a=Bt.batch(()=>this.#t.findAll(e).map(r=>r.cancel(s)));return Promise.all(a).then(un).catch(un)}invalidateQueries(e,t={}){return Bt.batch(()=>(this.#t.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},a=Bt.batch(()=>this.#t.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let c=r.fetch(void 0,s);return s.throwOnError||(c=c.catch(un)),r.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(un)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#t.build(this,t);return s.isStaleByTime(Ti(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(un).catch(un)}fetchInfiniteQuery(e){return e.behavior=ix(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(un).catch(un)}ensureInfiniteQueryData(e){return e.behavior=ix(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return du.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(Jo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(a=>{Xo(e,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(e,t){this.#s.set(Jo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(a=>{Xo(e,a.mutationKey)&&Object.assign(s,a.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Hm(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===Fm&&(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()}},rS=N.createContext(void 0),oS=e=>{const t=N.useContext(rS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Vk=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(rS.Provider,{value:e,children:t})),lS=N.createContext(!1),cS=()=>N.useContext(lS);lS.Provider;function Qk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Yk=N.createContext(Qk()),uS=()=>N.useContext(Yk),dS=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?eS(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},fS=e=>{N.useEffect(()=>{e.clearReset()},[e])},hS=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||eS(s,[e.error,a])),mS=e=>{if(e.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...r)=>s(a(...r)):s(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Jk=(e,t)=>e.isLoading&&e.isFetching&&!t,lm=(e,t)=>e?.suspense&&t.isPending,cm=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Xk({queries:e,...t},s){const a=oS(),r=cS(),c=uS(),d=N.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=r?"isRestoring":"optimistic",C}),[e,a,r]);d.forEach(S=>{mS(S);const C=a.getQueryCache().get(S.queryHash);dS(S,c,C)}),fS(c);const[f]=N.useState(()=>new Fk(a,d,t)),[p,m,v]=f.getOptimisticResult(d,t.combine),y=!r&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(S=>y?f.subscribe(Bt.batchCalls(S)):un,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),N.useEffect(()=>{f.setQueries(d,t)},[d,t,f]);const b=p.some((S,C)=>lm(d[C],S))?p.flatMap((S,C)=>{const k=d[C];if(k&&lm(k,S)){const E=new Km(a,k);return cm(k,E,c)}return[]}):[];if(b.length>0)throw Promise.all(b);const w=p.find((S,C)=>{const k=d[C];return k&&hS({result:S,errorResetBoundary:c,throwOnError:k.throwOnError,query:a.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(w?.error)throw w.error;return m(v())}function Wk(e,t,s){const a=cS(),r=uS(),c=oS(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=c.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",mS(d),dS(d,r,f),fS(r);const p=!c.getQueryCache().get(d.queryHash),[m]=N.useState(()=>new t(c,d)),v=m.getOptimisticResult(d),y=!a&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(x=>{const b=y?m.subscribe(Bt.batchCalls(x)):un;return m.updateResult(),b},[m,y]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),N.useEffect(()=>{m.setOptions(d)},[d,m]),lm(d,v))throw cm(d,m,r);if(hS({result:v,errorResetBoundary:r,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw v.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,v),d.experimental_prefetchInRender&&!Na&&Jk(v,a)&&(p?cm(d,m,r):f?.promise)?.catch(un).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?v:m.trackResult(v)}function Zo(e,t){return Wk(e,Km)}var Lc=typeof window<"u"?N.useLayoutEffect:N.useEffect;function Nh(e){const t=N.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function e_(e,t,s={},a={}){N.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([c])=>{t(c)},s);return r.observe(e.current),()=>{r.disconnect()}},[t,s,a.disabled,e])}function t_(e){const t=N.useRef(null);return N.useImperativeHandle(e,()=>t.current,[]),t}var n_=!1;function Wo(e){return e[e.length-1]}function s_(e){return typeof e=="function"}function zi(e,t){return s_(e)?e(t):e}var i_=Object.prototype.hasOwnProperty,ox=Object.prototype.propertyIsEnumerable,a_=()=>Object.create(null),la=(e,t)=>ha(e,t,a_);function ha(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const r=t,c=ux(e)&&ux(r);if(!c&&!(fu(e)&&fu(r)))return r;const d=c?e:lx(e);if(!d)return r;const f=c?r:lx(r);if(!f)return r;const p=d.length,m=f.length,v=c?new Array(m):s();let y=0;for(let x=0;x<m;x++){const b=c?x:f[x],w=e[b],S=r[b];if(w===S){v[b]=w,(c?x<p:i_.call(e,b))&&y++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){v[b]=S;continue}const C=ha(w,S,s,a+1);v[b]=C,C===w&&y++}return p===m&&y===p?e:v}function lx(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!ox.call(e,r))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return t;const a=t;for(const r of s){if(!ox.call(e,r))return!1;a.push(r)}return a}function fu(e){if(!cx(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!cx(s)||!s.hasOwnProperty("isPrototypeOf"))}function cx(e){return Object.prototype.toString.call(e)==="[object Object]"}function ux(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function va(e,t,s){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 a=0,r=e.length;a<r;a++)if(!va(e[a],t[a],s))return!1;return!0}if(fu(e)&&fu(t)){const a=s?.ignoreUndefined??!0;if(s?.partial){for(const d in t)if((!a||t[d]!==void 0)&&!va(e[d],t[d],s))return!1;return!0}let r=0;if(!a)r=Object.keys(e).length;else for(const d in e)e[d]!==void 0&&r++;let c=0;for(const d in t)if((!a||t[d]!==void 0)&&(c++,c>r||!va(e[d],t[d],s)))return!1;return r===c}return!1}function Tr(e){let t,s;const a=new Promise((r,c)=>{t=r,s=c});return a.status="pending",a.resolve=r=>{a.status="resolved",a.value=r,t(r),e?.(r)},a.reject=r=>{a.status="rejected",s(r)},a}function el(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function r_(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function dx(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return r_(t)}var o_=["http:","https:","mailto:","tel:"];function hu(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}function $o(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 s=0,a="",r;for(;(r=t.exec(e))!==null;)a+=dx(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+dx(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function l_(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function mu(e){const t=new Map;let s,a;const r=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,a&&(a.next=c,c.prev=a)):(c.next.prev=void 0,s=c.next,c.next=void 0,a&&(c.prev=a,a.next=c)),a=c)};return{get(c){const d=t.get(c);if(d)return r(d),d.value},set(c,d){if(t.size>=e&&s){const p=s;t.delete(p.key),p.next&&(s=p.next,p.next.prev=void 0),p===a&&(a=void 0)}const f=t.get(c);if(f)f.value=d,r(f);else{const p={key:c,value:d,prev:a};a&&(a.next=p),a=p,s||(s=p),t.set(c,p)}},clear(){t.clear(),s=void 0,a=void 0}}}var c_="Invariant failed";function Ui(e,t){if(!e)throw new Error(c_)}var ma=4,pS=5;function u_(e){const t=e.indexOf("{");if(t===-1)return null;const s=e.indexOf("}",t);return s===-1||t+1>=e.length?null:[t,s]}function Qm(e,t,s=new Uint16Array(6)){const a=e.indexOf("/",t),r=a===-1?e.length:a,c=e.substring(t,r);if(!c||!c.includes("$"))return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s;if(c==="$"){const f=e.length;return s[0]=2,s[1]=t,s[2]=t,s[3]=f,s[4]=f,s[5]=f,s}if(c.charCodeAt(0)===36)return s[0]=1,s[1]=t,s[2]=t+1,s[3]=r,s[4]=r,s[5]=r,s;const d=u_(c);if(d){const[f,p]=d,m=c.charCodeAt(f+1);if(m===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const v=f+3,y=p;if(v<y)return s[0]=3,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+p+1,s[5]=r,s}}else if(m===36){const v=f+1,y=f+2;return y===p?(s[0]=2,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+p+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+y,s[3]=t+p,s[4]=t+p+1,s[5]=r,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s}function Ru(e,t,s,a,r,c,d){d?.(s);let f=a;{const p=s.fullPath??s.from,m=p.length,v=s.options?.caseSensitive??e,y=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<m;){const b=Qm(p,f,t);let w;const S=f,C=b[5];switch(f=C+1,c++,b[0]){case 0:{const k=p.substring(b[2],b[3]);if(v){const E=r.static?.get(k);if(E)w=E;else{r.static??=new Map;const A=pa(s.fullPath??s.from);A.parent=r,A.depth=c,w=A,r.static.set(k,A)}}else{const E=k.toLowerCase(),A=r.staticInsensitive?.get(E);if(A)w=A;else{r.staticInsensitive??=new Map;const z=pa(s.fullPath??s.from);z.parent=r,z.depth=c,w=z,r.staticInsensitive.set(E,z)}}break}case 1:{const k=p.substring(S,b[1]),E=p.substring(b[4],C),A=v&&!!(k||E),z=k?A?k:k.toLowerCase():void 0,L=E?A?E:E.toLowerCase():void 0,M=!y&&r.dynamic?.find(R=>!R.skipOnParamError&&R.caseSensitive===A&&R.prefix===z&&R.suffix===L);if(M)w=M;else{const R=kh(1,s.fullPath??s.from,A,z,L);w=R,R.depth=c,R.parent=r,r.dynamic??=[],r.dynamic.push(R)}break}case 3:{const k=p.substring(S,b[1]),E=p.substring(b[4],C),A=v&&!!(k||E),z=k?A?k:k.toLowerCase():void 0,L=E?A?E:E.toLowerCase():void 0,M=!y&&r.optional?.find(R=>!R.skipOnParamError&&R.caseSensitive===A&&R.prefix===z&&R.suffix===L);if(M)w=M;else{const R=kh(3,s.fullPath??s.from,A,z,L);w=R,R.parent=r,R.depth=c,r.optional??=[],r.optional.push(R)}break}case 2:{const k=p.substring(S,b[1]),E=p.substring(b[4],C),A=v&&!!(k||E),z=k?A?k:k.toLowerCase():void 0,L=E?A?E:E.toLowerCase():void 0,M=kh(2,s.fullPath??s.from,A,z,L);w=M,M.parent=r,M.depth=c,r.wildcard??=[],r.wildcard.push(M)}}r=w}if(y&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const b=pa(s.fullPath??s.from);b.kind=pS,b.parent=r,c++,b.depth=c,r.pathless??=[],r.pathless.push(b),r=b}const x=(s.path||!s.children)&&!s.isRoot;if(x&&p.endsWith("/")){const b=pa(s.fullPath??s.from);b.kind=ma,b.parent=r,c++,b.depth=c,r.index=b,r=b}r.parse=s.options?.params?.parse??null,r.skipOnParamError=y,r.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,x&&!r.route&&(r.route=s,r.fullPath=s.fullPath??s.from)}if(s.children)for(const p of s.children)Ru(e,t,p,f,r,c,d)}function Ch(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 ki(e){if(e.pathless)for(const t of e.pathless)ki(t);if(e.static)for(const t of e.static.values())ki(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ki(t);if(e.dynamic?.length){e.dynamic.sort(Ch);for(const t of e.dynamic)ki(t)}if(e.optional?.length){e.optional.sort(Ch);for(const t of e.optional)ki(t)}if(e.wildcard?.length){e.wildcard.sort(Ch);for(const t of e.wildcard)ki(t)}}function pa(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 kh(e,t,s,a,r){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:s,prefix:a,suffix:r}}function d_(e,t){const s=pa("/"),a=new Uint16Array(6);for(const r of e)Ru(!1,a,r,1,s,0);ki(s),t.masksTree=s,t.flatCache=mu(1e3)}function f_(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const a=Ym(e,t.masksTree);return t.flatCache.set(e,a),a}function h_(e,t,s,a,r){e||="/",a||="/";const c=t?`case\0${e}`:e;let d=r.singleCache.get(c);return d||(d=pa("/"),Ru(t,new Uint16Array(6),{from:e},1,d,0),r.singleCache.set(c,d)),Ym(a,d,s)}function m_(e,t,s=!1){const a=s?e:`nofuzz\0${e}`,r=t.matchCache.get(a);if(r!==void 0)return r;e||="/";let c;try{c=Ym(e,t.segmentTree,s)}catch(d){if(d instanceof URIError)c=null;else throw d}return c&&(c.branch=y_(c.route)),t.matchCache.set(a,c),c}function p_(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function g_(e,t=!1,s){const a=pa(e.fullPath),r=new Uint16Array(6),c={},d={};let f=0;return Ru(t,r,e,1,a,0,p=>{if(s?.(p,f),Ui(!(p.id in c),`Duplicate routes found with id: ${String(p.id)}`),c[p.id]=p,f!==0&&p.path){const m=p_(p.fullPath);(!d[m]||p.fullPath.endsWith("/"))&&(d[m]=p)}f++}),ki(a),{processedTree:{segmentTree:a,singleCache:mu(1e3),matchCache:mu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:d}}function Ym(e,t,s=!1){const a=e.split("/"),r=x_(e,a,t,s);if(!r)return null;const[c]=gS(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function gS(e,t,s){const a=v_(s.node);let r=null;const c=Object.create(null);let d=s.extract?.part??0,f=s.extract?.node??0,p=s.extract?.path??0,m=s.extract?.segment??0;for(;f<a.length;d++,f++,p++,m++){const v=a[f];if(v.kind===ma)break;if(v.kind===pS){m--,d--,p--;continue}const y=t[d],x=p;if(y&&(p+=y.length),v.kind===1){r??=s.node.fullPath.split("/");const b=r[m],w=v.prefix?.length??0;if(b.charCodeAt(w)===123){const S=v.suffix?.length??0,C=b.substring(w+2,b.length-S-1),k=y.substring(w,y.length-S);c[C]=decodeURIComponent(k)}else{const S=b.substring(1);c[S]=decodeURIComponent(y)}}else if(v.kind===3){if(s.skipped&1<<f){d--,p=x-1;continue}r??=s.node.fullPath.split("/");const b=r[m],w=v.prefix?.length??0,S=v.suffix?.length??0,C=b.substring(w+3,b.length-S-1),k=v.suffix||v.prefix?y.substring(w,y.length-S):y;k&&(c[C]=decodeURIComponent(k))}else if(v.kind===2){const b=v,w=e.substring(x+(b.prefix?.length??0),e.length-(b.suffix?.length??0)),S=decodeURIComponent(w);c["*"]=S,c._splat=S;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:d,node:f,path:p,segment:m}]}function y_(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function v_(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function x_(e,t,s,a){if(e==="/"&&s.index)return{node:s.index,skipped:0};const r=!Wo(t),c=r&&e!=="/",d=t.length-(r?1:0),f=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let p=null,m=null,v=null;for(;f.length;){const y=f.pop(),{node:x,index:b,skipped:w,depth:S,statics:C,dynamics:k,optionals:E}=y;let{extract:A,rawParams:z,parsedParams:L}=y;if(x.skipOnParamError){if(!_h(e,t,y))continue;z=y.rawParams,A=y.extract,L=y.parsedParams}a&&x.route&&x.kind!==ma&&Po(m,y)&&(m=y);const M=b===d;if(M&&(x.route&&!c&&Po(v,y)&&(v=y),!x.optional&&!x.wildcard&&!x.index&&!x.pathless))continue;const R=M?void 0:t[b];let T;if(M&&x.index){const P={node:x.index,index:b,skipped:w,depth:S+1,statics:C,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:L};let J=!0;if(x.index.skipOnParamError&&(_h(e,t,P)||(J=!1)),J){if(C===d&&!k&&!E&&!w)return P;Po(v,P)&&(v=P)}}if(x.wildcard&&Po(p,y))for(const P of x.wildcard){const{prefix:J,suffix:Q}=P;if(J&&(M||!(P.caseSensitive?R:T??=R.toLowerCase()).startsWith(J)))continue;if(Q){if(M)continue;const pe=t.slice(b).join("/").slice(-Q.length);if((P.caseSensitive?pe:pe.toLowerCase())!==Q)continue}const se={node:P,index:d,skipped:w,depth:S,statics:C,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:L};if(!(P.skipOnParamError&&!_h(e,t,se))){p=se;break}}if(x.optional){const P=w|1<<S,J=S+1;for(let Q=x.optional.length-1;Q>=0;Q--){const se=x.optional[Q];f.push({node:se,index:b,skipped:P,depth:J,statics:C,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:L})}if(!M)for(let Q=x.optional.length-1;Q>=0;Q--){const se=x.optional[Q],{prefix:pe,suffix:ke}=se;if(pe||ke){const je=se.caseSensitive?R:T??=R.toLowerCase();if(pe&&!je.startsWith(pe)||ke&&!je.endsWith(ke))continue}f.push({node:se,index:b+1,skipped:w,depth:J,statics:C,dynamics:k,optionals:E+1,extract:A,rawParams:z,parsedParams:L})}}if(!M&&x.dynamic&&R)for(let P=x.dynamic.length-1;P>=0;P--){const J=x.dynamic[P],{prefix:Q,suffix:se}=J;if(Q||se){const pe=J.caseSensitive?R:T??=R.toLowerCase();if(Q&&!pe.startsWith(Q)||se&&!pe.endsWith(se))continue}f.push({node:J,index:b+1,skipped:w,depth:S+1,statics:C,dynamics:k+1,optionals:E,extract:A,rawParams:z,parsedParams:L})}if(!M&&x.staticInsensitive){const P=x.staticInsensitive.get(T??=R.toLowerCase());P&&f.push({node:P,index:b+1,skipped:w,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:L})}if(!M&&x.static){const P=x.static.get(R);P&&f.push({node:P,index:b+1,skipped:w,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:L})}if(x.pathless){const P=S+1;for(let J=x.pathless.length-1;J>=0;J--){const Q=x.pathless[J];f.push({node:Q,index:b,skipped:w,depth:P,statics:C,dynamics:k,optionals:E,extract:A,rawParams:z,parsedParams:L})}}}if(v&&p)return Po(p,v)?v:p;if(v)return v;if(p)return p;if(a&&m){let y=m.index;for(let b=0;b<m.index;b++)y+=t[b].length;const x=y===e.length?"/":e.slice(y);return m.rawParams??=Object.create(null),m.rawParams["**"]=decodeURIComponent(x),m}return null}function _h(e,t,s){try{const[a,r]=gS(e,t,s);s.rawParams=a,s.extract=r;const c=s.node.parse(a);return s.parsedParams=Object.assign(Object.create(null),s.parsedParams,c),!0}catch{return null}}function Po(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===ma)>(e.node.kind===ma)||t.node.kind===ma==(e.node.kind===ma)&&t.depth>e.depth))):!0}function tu(e){return Jm(e.filter(t=>t!==void 0).join("/"))}function Jm(e){return e.replace(/\/{2,}/g,"/")}function yS(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Oi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function vS(e){return Oi(yS(e))}function pu(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function b_(e,t,s){return pu(e,s)===pu(t,s)}function S_({base:e,to:t,trailingSlash:s="never",cache:a}){const r=t.startsWith("/"),c=!r&&t===".";let d;if(a){d=r?t:c?e:e+"\0"+t;const y=a.get(d);if(y)return y}let f;if(c)f=e.split("/");else if(r)f=t.split("/");else{for(f=e.split("/");f.length>1&&Wo(f)==="";)f.pop();const y=t.split("/");for(let x=0,b=y.length;x<b;x++){const w=y[x];w===""?x?x===b-1&&f.push(w):f=[w]:w===".."?f.pop():w==="."||f.push(w)}}f.length>1&&(Wo(f)===""?s==="never"&&f.pop():s==="always"&&f.push(""));let p,m="";for(let y=0;y<f.length;y++){y>0&&(m+="/");const x=f[y];if(!x)continue;p=Qm(x,0,p);const b=p[0];if(b===0){m+=x;continue}const w=p[5],S=x.substring(0,p[1]),C=x.substring(p[4],w),k=x.substring(p[2],p[3]);b===1?m+=S||C?`${S}{$${k}}${C}`:`$${k}`:b===2?m+=S||C?`${S}{$}${C}`:"$":m+=`${S}{-$${k}}${C}`}m=Jm(m);const v=m||"/";return d&&a&&a.set(d,v),v}function j_(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),s=Array.from(t.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(s,"g");return r=>r.replace(a,c=>t.get(c)??c)}function zh(e,t,s){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(r=>hx(r,s)).join("/"):hx(a,s)}function fx({path:e,params:t,decoder:s,...a}){let r=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:r};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:r};const d=e.length;let f=0,p,m="";for(;f<d;){const v=f;p=Qm(e,v,p);const y=p[5];if(f=y+1,v===y)continue;const x=p[0];if(x===0){m+="/"+e.substring(v,y);continue}if(x===2){const b=t._splat;c._splat=b,c["*"]=b;const w=e.substring(v,p[1]),S=e.substring(p[4],y);if(!b){r=!0,(w||S)&&(m+="/"+w+S);continue}const C=zh("_splat",t,s);m+="/"+w+C+S;continue}if(x===1){const b=e.substring(p[2],p[3]);!r&&!(b in t)&&(r=!0),c[b]=t[b];const w=e.substring(v,p[1]),S=e.substring(p[4],y),C=zh(b,t,s)??"undefined";m+="/"+w+C+S;continue}if(x===3){const b=e.substring(p[2],p[3]),w=t[b];if(w==null)continue;c[b]=w;const S=e.substring(v,p[1]),C=e.substring(p[4],y),k=zh(b,t,s)??"";m+="/"+S+k+C;continue}}return e.endsWith("/")&&(m+="/"),{usedParams:c,interpolatedPath:m||"/",isMissingParams:r}}function hx(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function fn(e){return!!e?.isNotFound}function w_(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var um="tsr-scroll-restoration-v1_3",N_=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function C_(){const e=w_();if(!e)return null;const t=e.getItem(um);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=zi(a,s)||s;try{e.setItem(um,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Mc=C_(),k_=e=>e.state.__TSR_key||e.href;function __(e){const t=[];let s;for(;s=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${t.reverse().join(" > ")}`.toLowerCase()}var gu=!1;function z_({storageKey:e,key:t,behavior:s,shouldScrollRestoration:a,scrollToTopSelectors:r,location:c}){let d;try{d=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(m){console.error(m);return}const f=t||window.history.state?.__TSR_key,p=d[f];gu=!0;e:{if(a&&p&&Object.keys(p).length>0){for(const y in p){const x=p[y];if(y==="window")window.scrollTo({top:x.scrollY,left:x.scrollX,behavior:s});else if(y){const b=document.querySelector(y);b&&(b.scrollLeft=x.scrollX,b.scrollTop=x.scrollY)}}break e}const m=(c??window.location).hash.split("#",2)[1];if(m){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const x=document.getElementById(m);x&&x.scrollIntoView(y)}break e}const v={top:0,left:0,behavior:s};if(window.scrollTo(v),r)for(const y of r){if(y==="window")continue;const x=typeof y=="function"?y():document.querySelector(y);x&&x.scrollTo(v)}}gu=!1}function E_(e,t){if(!Mc||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Mc))return;e.isScrollRestorationSetup=!0,gu=!1;const s=e.options.getScrollRestorationKey||k_;window.history.scrollRestoration="manual";const a=r=>{if(gu||!e.isScrollRestoring)return;let c="";if(r.target===document||r.target===window)c="window";else{const f=r.target.getAttribute("data-scroll-restoration-id");f?c=`[data-scroll-restoration-id="${f}"]`:c=__(r.target)}const d=s(e.state.location);Mc.set(f=>{const p=f[d]||={},m=p[c]||={};if(c==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(c){const v=document.querySelector(c);v&&(m.scrollX=v.scrollLeft||0,m.scrollY=v.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",N_(a,100),!0),e.subscribe("onRendered",r=>{const c=s(r.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(z_({storageKey:um,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Mc.set(d=>(d[c]||={},d)))})}function A_(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const s=document.getElementById(e.state.location.hash);s&&s.scrollIntoView(t)}}}function R_(e,t=String){const s=new URLSearchParams;for(const a in e){const r=e[a];r!==void 0&&s.set(a,t(r))}return s.toString()}function Eh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function T_(e){const t=new URLSearchParams(e),s=Object.create(null);for(const[a,r]of t.entries()){const c=s[a];c==null?s[a]=Eh(r):Array.isArray(c)?c.push(Eh(r)):s[a]=[c,Eh(r)]}return s}var O_=L_(JSON.parse),D_=M_(JSON.stringify,JSON.parse);function L_(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=T_(t);for(const a in s){const r=s[a];if(typeof r=="string")try{s[a]=e(r)}catch{}}return s}}function M_(e,t){const s=typeof t=="function";function a(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(s&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const c=R_(r,a);return c?`?${c}`:""}}var xa="__root__";function Xm(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 s=new Response(null,{status:e.statusCode,headers:t});if(s.options=e,e.throw)throw s;return s}function Sn(e){return e instanceof Response&&!!e.options}function U_(e){return{input:({url:t})=>{for(const s of e)t=dm(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=xS(e[s],t);return t}}}function $_(e){const t=vS(e.basepath),s=`/${t}`,a=`${s}/`,r=e.caseSensitive?s:s.toLowerCase(),c=e.caseSensitive?a:a.toLowerCase();return{input:({url:d})=>{const f=e.caseSensitive?d.pathname:d.pathname.toLowerCase();return f===r?d.pathname="/":f.startsWith(c)&&(d.pathname=d.pathname.slice(s.length)),d},output:({url:d})=>(d.pathname=tu(["/",t,d.pathname]),d)}}function dm(e,t){const s=e?.input?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function xS(e,t){const s=e?.output?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}var vt=(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))(vt||{});function bS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:d,shallowPropagate:f};function a(m,v,y){const x=v.depsTail;if(x!==void 0&&x.dep===m)return;const b=x!==void 0?x.nextDep:v.deps;if(b!==void 0&&b.dep===m){b.version=y,v.depsTail=b;return}const w=m.subsTail;if(w!==void 0&&w.version===y&&w.sub===v)return;const S=v.depsTail=m.subsTail={version:y,dep:m,sub:v,prevDep:x,nextDep:b,prevSub:w,nextSub:void 0};b!==void 0&&(b.prevDep=S),x!==void 0?x.nextDep=S:v.deps=S,w!==void 0?w.nextSub=S:m.subs=S}function r(m,v=m.sub){const y=m.dep,x=m.prevDep,b=m.nextDep,w=m.nextSub,S=m.prevSub;return b!==void 0?b.prevDep=x:v.depsTail=x,x!==void 0?x.nextDep=b:v.deps=b,w!==void 0?w.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=w:(y.subs=w)===void 0&&s(y),b}function c(m){let v=m.nextSub,y;e:do{const x=m.sub;let b=x.flags;if(b&60?b&12?b&4?!(b&48)&&p(m,x)?(x.flags=b|40,b&=1):b=0:x.flags=b&-9|32:b=0:x.flags=b|32,b&2&&t(x),b&1){const w=x.subs;if(w!==void 0){const S=(m=w).nextSub;S!==void 0&&(y={value:v,prev:y},v=S);continue}}if((m=v)!==void 0){v=m.nextSub;continue}for(;y!==void 0;)if(m=y.value,y=y.prev,m!==void 0){v=m.nextSub;continue e}break}while(!0)}function d(m,v){let y,x=0,b=!1;e:do{const w=m.dep,S=w.flags;if(v.flags&16)b=!0;else if((S&17)===17){if(e(w)){const C=w.subs;C.nextSub!==void 0&&f(C),b=!0}}else if((S&33)===33){(m.nextSub!==void 0||m.prevSub!==void 0)&&(y={value:m,prev:y}),m=w.deps,v=w,++x;continue}if(!b){const C=m.nextDep;if(C!==void 0){m=C;continue}}for(;x--;){const C=v.subs,k=C.nextSub!==void 0;if(k?(m=y.value,y=y.prev):m=C,b){if(e(v)){k&&f(C),v=m.sub;continue}b=!1}else v.flags&=-33;v=m.sub;const E=m.nextDep;if(E!==void 0){m=E;continue e}}return b}while(!0)}function f(m){do{const v=m.sub,y=v.flags;(y&48)===32&&(v.flags=y|16,(y&6)===2&&t(v))}while((m=m.nextSub)!==void 0)}function p(m,v){let y=v.depsTail;for(;y!==void 0;){if(y===m)return!0;y=y.prevDep}return!1}}let Wm=0,ca=0,Ko=0;const Hs=[],{link:T4,unlink:SS,propagate:O4,checkDirty:P_,shallowPropagate:D4}=bS({update(e){return e.depsTail!==void 0?H_(e):G_(e)},notify(e){let t=Ko,s=t;do if(Hs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Ko=t;s<--t;){const a=Hs[s];Hs[s++]=Hs[t],Hs[t]=a}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Tu(e)):K_.call(e)}});function I_(){return Wm}function B_(){++Wm}function q_(){--Wm||Z_()}function H_(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Tu(e)}}function G_(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function F_(e){const t=e.flags;if(t&16||t&32&&P_(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Tu(e)}}else e.flags=2}function Z_(){try{for(;ca<Ko;){const e=Hs[ca];Hs[ca++]=void 0,F_(e)}}finally{for(;ca<Ko;){const e=Hs[ca];Hs[ca++]=void 0,e.flags|=10}ca=0,Ko=0}}function K_(){this.depsTail=void 0,this.flags=0,Tu(this);const e=this.subs;e!==void 0&&SS(e)}function Tu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=SS(s,e)}function ep(e,t,s){const a=typeof e=="object",r=a?e:void 0;return{next:(a?e.next:e)?.bind(r),error:(a?e.error:t)?.bind(r),complete:(a?e.complete:s)?.bind(r)}}const fm=[];let nu=0;const{link:mx,unlink:V_,propagate:Q_,checkDirty:jS,shallowPropagate:px}=bS({update(e){return e._update()},notify(e){fm[hm++]=e,e.flags&=~vt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=vt.Mutable|vt.Dirty,yu(e))}});let Uc=0,hm=0,ys;function yu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=V_(s,e)}function wS(){if(!(I_()>0)){for(;Uc<hm;){const e=fm[Uc];fm[Uc++]=void 0,e.notify()}Uc=0,hm=0}}function NS(e,t){const s=typeof e=="function",a=e,r={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?vt.None:vt.Mutable,get(){return ys!==void 0&&mx(r,ys,nu),r._snapshot},subscribe(c){const d=ep(c),f={current:!1},p=Y_(()=>{r.get(),f.current?d.next?.(r._snapshot):f.current=!0});return{unsubscribe:()=>{p.stop()}}},_update(c){const d=ys,f=Object.is;if(s)ys=r,++nu,r.depsTail=void 0;else if(c===void 0)return!1;s&&(r.flags=vt.Mutable|vt.RecursedCheck);try{const p=r._snapshot,m=typeof c=="function"?c(p):c===void 0&&s?a(p):c;return p===void 0||!f(p,m)?(r._snapshot=m,!0):!1}finally{ys=d,s&&(r.flags&=~vt.RecursedCheck),yu(r)}}};return s?(r.flags=vt.Mutable|vt.Dirty,r.get=function(){const c=r.flags;if(c&vt.Dirty||c&vt.Pending&&jS(r.deps,r)){if(r._update()){const d=r.subs;d!==void 0&&px(d)}}else c&vt.Pending&&(r.flags=c&~vt.Pending);return ys!==void 0&&mx(r,ys,nu),r._snapshot}):r.set=function(c){if(r._update(c)){const d=r.subs;d!==void 0&&(Q_(d),px(d),wS())}},r}function Y_(e){const t=()=>{const a=ys;ys=s,++nu,s.depsTail=void 0,s.flags=vt.Watching|vt.RecursedCheck;try{return e()}finally{ys=a,s.flags&=~vt.RecursedCheck,yu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:vt.Watching|vt.RecursedCheck,notify(){const a=this.flags;a&vt.Dirty||a&vt.Pending&&jS(this.deps,this)?t():this.flags=vt.Watching},stop(){this.flags=vt.None,this.depsTail=void 0,yu(this)}};return t(),s}class J_{constructor(t){this.atom=NS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ep(t))}}class X_{constructor(t){this.atom=NS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ep(t))}}function W_(e){return typeof e=="function"?new X_(e):new J_(e)}function ez(e){try{B_(),e()}finally{q_(),wS()}}function Vo(e){let t;return ez(()=>{t=e()}),t}var mm=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ou=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),ba=(e,t,s=!0)=>{const a={...e.router.options.context??{}},r=s?t:t-1;for(let c=0;c<=r;c++){const d=e.matches[c];if(!d)continue;const f=e.router.getMatch(d.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},gx=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,a=e.matches.findIndex(d=>d.routeId===e.router.routeTree.id),r=a>=0?a:0;let c=s?e.matches.findIndex(d=>d.routeId===s):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=r);for(let d=c;d>=0;d--){const f=e.matches[d];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return d}return s?c:r},Ei=(e,t,s)=>{if(!(!Sn(s)&&!fn(s)))throw Sn(s)&&s.redirectHandled&&!s.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=s,e.updateMatch(t.id,a=>({...a,status:Sn(s)?"redirected":a.status==="pending"?"success":a.status,context:ba(e,t.index),isFetching:!1,error:s})),fn(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Sn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},CS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},yx=(e,t,s)=>{const a=ba(e,s);e.updateMatch(t,r=>({...r,context:a}))},Io=(e,t,s,a)=>{const{id:r,routeId:c}=e.matches[t],d=e.router.looseRoutesById[c];if(s instanceof Promise)throw s;s.routerCode=a,e.firstBadMatchIndex??=t,Ei(e,e.router.getMatch(r),s);try{d.options.onError?.(s)}catch(f){s=f,Ei(e,e.router.getMatch(r),s)}e.updateMatch(r,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Sn(s)&&!fn(s)&&(e.serialError??=s)},kS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ou(e,t)&&(s.options.loader||s.options.beforeLoad||zS(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{mm(e)},r);a._nonReactive.pendingTimeout=c}},tz=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;kS(e,t,s,a);const r=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Ei(e,c,c.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(r):r()},nz=(e,t,s,a)=>{const r=e.router.getMatch(t);let c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Tr(()=>{c?.resolve(),c=void 0});const{paramsError:d,searchError:f}=r;d&&Io(e,s,d,"PARSE_PARAMS"),f&&Io(e,s,f,"VALIDATE_SEARCH"),kS(e,t,a,r);const p=new AbortController;let m=!1;const v=()=>{m||(m=!0,e.updateMatch(t,z=>({...z,isFetching:"beforeLoad",fetchCount:z.fetchCount+1,abortController:p})))},y=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,z=>({...z,isFetching:!1}))};if(!a.options.beforeLoad){Vo(()=>{v(),y()});return}r._nonReactive.beforeLoadPromise=Tr();const x={...ba(e,s,!1),...r.__routeContext},{search:b,params:w,cause:S}=r,C=Ou(e,t),k={search:b,abortController:p,params:w,preload:C,context:x,location:e.location,navigate:z=>e.router.navigate({...z,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":S,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},E=z=>{if(z===void 0){Vo(()=>{v(),y()});return}(Sn(z)||fn(z))&&(v(),Io(e,s,z,"BEFORE_LOAD")),Vo(()=>{v(),e.updateMatch(t,L=>({...L,__beforeLoadContext:z})),y()})};let A;try{if(A=a.options.beforeLoad(k),el(A))return v(),A.catch(z=>{Io(e,s,z,"BEFORE_LOAD")}).then(E)}catch(z){v(),Io(e,s,z,"BEFORE_LOAD")}E(A)},sz=(e,t)=>{const{id:s,routeId:a}=e.matches[t],r=e.router.looseRoutesById[a],c=()=>f(),d=()=>nz(e,s,t,r),f=()=>{if(CS(e,s))return;const p=tz(e,s,r);return el(p)?p.then(d):d()};return c()},iz=(e,t,s)=>{const a=e.router.getMatch(t);if(!a||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([s.options.head?.(r),s.options.scripts?.(r),s.options.headers?.(r)]).then(([c,d,f])=>({meta:c?.meta,links:c?.links,headScripts:c?.scripts,headers:f,scripts:d,styles:c?.styles}))},_S=(e,t,s,a,r)=>{const c=t[a-1],{params:d,loaderDeps:f,abortController:p,cause:m}=e.router.getMatch(s),v=ba(e,a),y=Ou(e,s);return{params:d,deps:f,preload:!!y,parentMatchPromise:c,abortController:p,context:v,location:e.location,navigate:x=>e.router.navigate({...x,_fromLocation:e.location}),cause:y?"preload":m,route:r,...e.router.options.additionalContext}},vx=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!(n_??e.router.isServer)||c.ssr===!0)&&tl(r);const d=r.options.loader,f=typeof d=="function"?d:d?.handler,p=f?.(_S(e,t,s,a,r)),m=!!f&&el(p);if((m||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(s,y=>({...y,isFetching:"loader"})),f){const y=m?await p:p;Ei(e,e.router.getMatch(s),y),y!==void 0&&e.updateMatch(s,x=>({...x,loaderData:y}))}r._lazyPromise&&await r._lazyPromise;const v=c._nonReactive.minPendingPromise;v&&await v,r._componentsPromise&&await r._componentsPromise,e.updateMatch(s,y=>({...y,error:void 0,context:ba(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let f=d;if(f?.name==="AbortError"){if(c.abortController.signal.aborted){c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:ba(e,a)}));return}const p=c._nonReactive.minPendingPromise;p&&await p,fn(d)&&await r.options.notFoundComponent?.preload?.(),Ei(e,e.router.getMatch(s),d);try{r.options.onError?.(d)}catch(m){f=m,Ei(e,e.router.getMatch(s),m)}!Sn(f)&&!fn(f)&&await tl(r,["errorComponent"]),e.updateMatch(s,m=>({...m,error:f,context:ba(e,a),status:"error",isFetching:!1}))}}catch(c){const d=e.router.getMatch(s);d&&(d._nonReactive.loaderPromise=void 0),Ei(e,d,c)}},az=async(e,t,s)=>{async function a(b,w,S,C,k){const E=Date.now()-w.updatedAt,A=b?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,z=k.options.shouldReload,L=typeof z=="function"?z(_S(e,t,r,s,k)):z,{status:M,invalid:R}=C,T=E>A&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);d=M==="success"&&(R||(L??T)),b&&k.options.preload===!1||(d&&!e.sync&&v?(f=!0,(async()=>{try{await vx(e,t,r,s,k);const P=e.router.getMatch(r);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0,P._nonReactive.loadPromise=void 0}catch(P){Sn(P)&&await e.router.navigate(P.options)}})()):M!=="success"||d?await vx(e,t,r,s,k):yx(e,r,s))}const{id:r,routeId:c}=e.matches[s];let d=!1,f=!1;const p=e.router.looseRoutesById[c],m=p.options.loader,v=((typeof m=="function"?void 0:m?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(CS(e,r)){if(!e.router.getMatch(r))return e.matches[s];yx(e,r,s)}else{const b=e.router.getMatch(r),w=e.router.state.matches[s]?.routeId===c?e.router.state.matches[s].id:e.router.state.matches.find(C=>C.routeId===c)?.id,S=Ou(e,r);if(b._nonReactive.loaderPromise){if(b.status==="success"&&!e.sync&&!b.preload&&v)return b;await b._nonReactive.loaderPromise;const C=e.router.getMatch(r),k=C._nonReactive.error||C.error;k&&Ei(e,C,k),C.status==="pending"&&await a(S,b,w,C,p)}else{const C=S&&!e.router.state.matches.some(E=>E.id===r),k=e.router.getMatch(r);k._nonReactive.loaderPromise=Tr(),C!==k.preload&&e.updateMatch(r,E=>({...E,preload:C})),await a(S,b,w,k,p)}}const y=e.router.getMatch(r);f||(y._nonReactive.loaderPromise?.resolve(),y._nonReactive.loadPromise?.resolve(),y._nonReactive.loadPromise=void 0),clearTimeout(y._nonReactive.pendingTimeout),y._nonReactive.pendingTimeout=void 0,f||(y._nonReactive.loaderPromise=void 0),y._nonReactive.dehydrated=void 0;const x=f?y.isFetching:!1;return x!==y.isFetching||y.invalid!==!1?(e.updateMatch(r,b=>({...b,isFetching:x,invalid:!1})),e.router.getMatch(r)):y};async function xx(e){const t=e,s=[];t.router.state.matches.some(x=>x._forcePending)&&mm(t);let a;for(let x=0;x<t.matches.length;x++){try{const b=sz(t,x);el(b)&&await b}catch(b){if(Sn(b))throw b;if(fn(b))a=b;else if(!t.preload)throw b;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,c=a&&!t.preload?gx(t,a):void 0,d=a&&t.preload?0:c!==void 0?Math.min(c+1,r):r;let f,p;for(let x=0;x<d;x++)s.push(az(t,s,x));try{await Promise.all(s)}catch{const x=await Promise.allSettled(s);for(const b of x){if(b.status!=="rejected")continue;const w=b.reason;if(Sn(w))throw w;fn(w)?f??=w:p??=w}if(p!==void 0)throw p}const m=f??(a&&!t.preload?a:void 0);let v=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!m&&a&&t.preload)return t.matches;if(m){const x=gx(t,m);Ui(x!==void 0);const b=t.matches[x],w=t.router.looseRoutesById[b.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),m.routeId=b.routeId;const C=b.routeId===t.router.routeTree.id;t.updateMatch(b.id,k=>({...k,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:m},isFetching:!1})),v=x,await tl(w,["notFoundComponent"])}else if(!t.preload){const x=t.matches[0];x.globalNotFound||t.router.getMatch(x.id)?.globalNotFound&&t.updateMatch(x.id,b=>({...b,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const x=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await tl(x,["errorComponent"])}for(let x=0;x<=v;x++){const{id:b,routeId:w}=t.matches[x],S=t.router.looseRoutesById[w];try{const C=iz(t,b,S);if(C){const k=await C;t.updateMatch(b,E=>({...E,...k}))}}catch(C){console.error(`Error executing head for route ${w}:`,C)}}const y=mm(t);if(el(y)&&await y,m)throw m;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function bx(e,t){const s=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function tl(e,t=su){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:r,...c}=a.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:t===su?(()=>{if(e._componentsPromise===void 0){const a=bx(e,su);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():bx(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function zS(e){for(const t of su)if(e.options[t]?.preload)return!0;return!1}var su=["component","errorComponent","pendingComponent","notFoundComponent"],Di="__TSR_index",Sx="popstate",jx="beforeunload";function rz(e){let t=e.getLocation();const s=new Set,a=d=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:d}))},r=d=>{e.notifyOnIndexChange??!0?a(d):t=e.getLocation()},c=async({task:d,navigateOpts:f,...p})=>{if(f?.ignoreBlocker??!1){d();return}const m=e.getBlockers?.()??[],v=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&m.length&&v)for(const y of m){const x=vu(p.path,p.state);if(await y.blockerFn({currentLocation:t,nextLocation:x,action:p.type})){e.onBlocked?.();return}}d()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:d=>(s.add(d),()=>{s.delete(d)}),push:(d,f,p)=>{const m=t.state[Di];f=wx(m+1,f),c({task:()=>{e.pushState(d,f),a({type:"PUSH"})},navigateOpts:p,type:"PUSH",path:d,state:f})},replace:(d,f,p)=>{const m=t.state[Di];f=wx(m,f),c({task:()=>{e.replaceState(d,f),a({type:"REPLACE"})},navigateOpts:p,type:"REPLACE",path:d,state:f})},go:(d,f)=>{c({task:()=>{e.go(d),r({type:"GO",index:d})},navigateOpts:f,type:"GO"})},back:d=>{c({task:()=>{e.back(d?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:d,type:"BACK"})},forward:d=>{c({task:()=>{e.forward(d?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:d,type:"FORWARD"})},canGoBack:()=>t.state[Di]!==0,createHref:d=>e.createHref(d),block:d=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,d]),()=>{const p=e.getBlockers?.()??[];e.setBlockers?.(p.filter(m=>m!==d))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function wx(e,t){t||(t={});const s=tp();return{...t,key:s,__TSR_key:s,[Di]:e}}function oz(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,a=t.history.replaceState;let r=[];const c=()=>r,d=T=>r=T,f=(T=>T),p=(()=>vu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const T=tp();t.history.replaceState({[Di]:0,key:T,__TSR_key:T},"")}let m=p(),v,y=!1,x=!1,b=!1,w=!1;const S=()=>m;let C,k;const E=()=>{C&&(R._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),R._ignoreSubscribers=!1,C=void 0,k=void 0,v=void 0)},A=(T,P,J)=>{const Q=f(P);k||(v=m),m=vu(P,J),C={href:Q,state:J,isPush:C?.isPush||T==="push"},k||(k=Promise.resolve().then(()=>E()))},z=T=>{m=p(),R.notify({type:T})},L=async()=>{if(x){x=!1;return}const T=p(),P=T.state[Di]-m.state[Di],J=P===1,Q=P===-1,se=!J&&!Q||y;y=!1;const pe=se?"GO":Q?"BACK":"FORWARD",ke=se?{type:"GO",index:P}:{type:Q?"BACK":"FORWARD"};if(b)b=!1;else{const je=c();if(typeof document<"u"&&je.length){for(const B of je)if(await B.blockerFn({currentLocation:m,nextLocation:T,action:pe})){x=!0,t.history.go(1),R.notify(ke);return}}}m=p(),R.notify(ke)},M=T=>{if(w){w=!1;return}let P=!1;const J=c();if(typeof document<"u"&&J.length)for(const Q of J){const se=Q.enableBeforeUnload??!0;if(se===!0){P=!0;break}if(typeof se=="function"&&se()===!0){P=!0;break}}if(P)return T.preventDefault(),T.returnValue=""},R=rz({getLocation:S,getLength:()=>t.history.length,pushState:(T,P)=>A("push",T,P),replaceState:(T,P)=>A("replace",T,P),back:T=>(T&&(b=!0),w=!0,t.history.back()),forward:T=>{T&&(b=!0),w=!0,t.history.forward()},go:T=>{y=!0,t.history.go(T)},createHref:T=>f(T),flush:E,destroy:()=>{t.history.pushState=s,t.history.replaceState=a,t.removeEventListener(jx,M,{capture:!0}),t.removeEventListener(Sx,L)},onBlocked:()=>{v&&m!==v&&(m=v)},getBlockers:c,setBlockers:d,notifyOnIndexChange:!1});return t.addEventListener(jx,M,{capture:!0}),t.addEventListener(Sx,L),t.history.pushState=function(...T){const P=s.apply(t.history,T);return R._ignoreSubscribers||z("PUSH"),P},t.history.replaceState=function(...T){const P=a.apply(t.history,T);return R._ignoreSubscribers||z("REPLACE"),P},R}function lz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function vu(e,t){const s=lz(e),a=s.indexOf("#"),r=s.indexOf("?"),c=tp();return{href:s,pathname:s.substring(0,a>0?r>0?Math.min(a,r):a:r>0?r:s.length),hash:a>-1?s.substring(a):"",search:r>-1?s.slice(r,a===-1?void 0:a):"",state:t||{[Di]:0,key:c,__TSR_key:c}}}function tp(){return(Math.random()+1).toString(36).substring(7)}function Sa(e){const t=e.resolvedLocation,s=e.location;return{fromLocation:t,toLocation:s,pathChanged:t?.pathname!==s.pathname,hrefChanged:t?.href!==s.href,hashChanged:t?.hash!==s.hash}}function cz(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var uz=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 s=this.options,a=this.basepath??s?.basepath??"/",r=this.basepath===void 0,c=s?.rewrite;if(this.options={...s,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=j_(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=oz()),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 m;this.resolvePathCache=mu(1e3),m=this.buildRouteTree(),this.setRoutes(m)}!this.__store&&this.latestLocation&&(this.__store=W_(fz(this.latestLocation)),E_(this));let d=!1;const f=this.options.basepath??"/",p=this.options.rewrite;if(r||a!==f||c!==p){this.basepath=f;const m=[],v=vS(f);v&&v!=="/"&&m.push($_({basepath:f})),p&&m.push(p),this.rewrite=m.length===0?void 0:m.length===1?m[0]:U_(m),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&this.__store.setState(m=>({...m,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=g_(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&d_(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,s)=>{const a={eventType:t,fn:s};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const a=({pathname:f,search:p,hash:m,href:v,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const C=this.options.parseSearch(p),k=this.options.stringifySearch(C);return{href:f+k+m,publicHref:v,pathname:$o(f).path,external:!1,searchStr:k,search:la(s?.search,C),hash:$o(m.slice(1)).path,state:ha(s?.state,y)}}const x=new URL(v,this.origin),b=dm(this.rewrite,x),w=this.options.parseSearch(b.search),S=this.options.stringifySearch(w);return b.search=S,{href:b.href.replace(b.origin,""),publicHref:v,pathname:$o(b.pathname).path,external:!!this.rewrite&&b.origin!==this.origin,searchStr:S,search:la(s?.search,w),hash:$o(b.hash.slice(1)).path,state:ha(s?.state,y)}},r=a(t),{__tempLocation:c,__tempKey:d}=r.state;if(c&&(!d||d===this.tempLocationKey)){const f=a(c);return f.state.key=r.state.key,f.state.__TSR_key=r.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:r}}return r},this.resolvePathWithBase=(t,s)=>S_({base:t,to:Jm(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,s,a)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:s},a):this.matchRoutesInternal(t,s),this.getMatchedRoutes=t=>hz({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const s=this.getMatch(t);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=t=>{const s=(r={})=>{const c=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(c);r.from;const f=r.unsafeRelative==="path"?c.pathname:r.from??d.fullPath,p=this.resolvePathWithBase(f,"."),m=d.search,v=Object.assign(Object.create(null),d.params),y=r.to?this.resolvePathWithBase(p,`${r.to}`):this.resolvePathWithBase(p,"."),x=r.params===!1||r.params===null?Object.create(null):(r.params??!0)===!0?v:Object.assign(v,zi(r.params,v)),b=this.getMatchedRoutes(y);let w=b.matchedRoutes;if((!b.foundRoute||b.foundRoute.path!=="/"&&b.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(x).length>0)for(const P of w){const J=P.options.params?.stringify??P.options.stringifyParams;if(J)try{Object.assign(x,J(x))}catch{}}const S=t.leaveParams?y:$o(fx({path:y,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=m;if(t._includeValidateSearch&&this.options.search?.strict){const P={};w.forEach(J=>{if(J.options.validateSearch)try{Object.assign(P,iu(J.options.validateSearch,{...P,...C}))}catch{}}),C=P}C=mz({search:C,dest:r,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),C=la(m,C);const k=this.options.stringifySearch(C),E=r.hash===!0?c.hash:r.hash?zi(r.hash,c.hash):void 0,A=E?`#${E}`:"";let z=r.state===!0?c.state:r.state?zi(r.state,c.state):{};z=ha(c.state,z);const L=`${S}${k}${A}`;let M,R,T=!1;if(this.rewrite){const P=new URL(L,this.origin),J=xS(this.rewrite,P);M=P.href.replace(P.origin,""),J.origin!==this.origin?(R=J.href,T=!0):R=J.pathname+J.search+J.hash}else M=l_(L),R=M;return{publicHref:R,href:M,pathname:S,search:C,searchStr:k,state:z,hash:E??"",external:T,unmaskOnReload:r.unmaskOnReload}},a=(r={},c)=>{const d=s(r);let f=c?s(c):void 0;if(!f){const p=Object.create(null);if(this.options.routeMasks){const m=f_(d.pathname,this.processedTree);if(m){Object.assign(p,m.rawParams);const{from:v,params:y,...x}=m.route,b=y===!1||y===null?Object.create(null):(y??!0)===!0?p:Object.assign(p,zi(y,p));c={from:t.from,...x,params:b},f=s(c)}}}return f&&(d.maskedLocation=f),d};return t.mask?a(t,{from:t.from,...t.mask}):a(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:s,...a})=>{const r=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(m=>{a.state[m]=this.latestLocation.state[m]});const p=va(a.state,this.latestLocation.state);return f.forEach(m=>{delete a.state[m]}),p},c=Oi(this.latestLocation.href)===Oi(a.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Tr(()=>{d?.resolve(),d=void 0}),c&&r())this.load();else{let{maskedLocation:f,hashScrollIntoView:p,...m}=a;f&&(m={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:s})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:a,viewTransition:r,ignoreBlocker:c,href:d,...f}={})=>{if(d){const v=this.history.location.state.__TSR_index,y=vu(d,{__TSR_index:t?v:v+1}),x=new URL(y.pathname,this.origin);f.to=dm(this.rewrite,x).pathname,f.search=this.options.parseSearch(y.search),f.hash=y.hash.slice(1)}const p=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const m=this.commitLocation({...p,viewTransition:r,replace:t,resetScroll:s,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:t,reloadDocument:s,href:a,publicHref:r,...c})=>{let d=!1;if(a)try{new URL(`${a}`),d=!0}catch{}if(d&&!s&&(s=!0),s){if(t!==void 0||!a){const p=this.buildLocation({to:t,...c});a=a??p.publicHref,r=r??p.publicHref}const f=!d&&r?r:a;if(hu(f,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const m of p)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...c,href:a,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:s.cachedMatches.filter(a=>!t.some(r=>r.id===a.id))}))},this.load=async t=>{let s,a,r;const c=this.state.resolvedLocation??this.state.location;for(r=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const p=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Sa({resolvedLocation:m,location:p})}),this.emit({type:"onBeforeLoad",...Sa({resolvedLocation:m,location:p})}),await xx({router:this,sync:t?.sync,forceStaleReload:c.href===p.href,matches:this.state.pendingMatches,location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],y=[],x=[],b=[];Vo(()=>{this.__store.setState(w=>{const S=w.matches,C=w.pendingMatches||w.matches;return v=S.filter(k=>!C.some(E=>E.id===k.id)),y=S.filter(k=>!C.some(E=>E.routeId===k.routeId)),x=C.filter(k=>!S.some(E=>E.routeId===k.routeId)),b=C.filter(k=>S.some(E=>E.routeId===k.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...v.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[x,"onEnter"],[b,"onStay"]].forEach(([w,S])=>{w.forEach(C=>{this.looseRoutesById[C.routeId].options[S]?.(C)})})})})}})}catch(p){Sn(p)?(s=p,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):fn(p)&&(a=p),this.__store.setState(m=>({...m,statusCode:s?s.status:a?404:m.matches.some(v=>v.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.__store.state.matches.some(f=>f.status==="error")&&(d=500),d!==void 0&&this.__store.setState(f=>({...f,statusCode:d}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,c=this.state.resolvedLocation,d=typeof s.types=="function"?s.types(Sa({resolvedLocation:c,location:r})):s.types;if(d===!1){t();return}a={update:t,types:d}}else a=t;document.startViewTransition(a)}else t()},this.updateMatch=(t,s)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(r=>r.id===t)?"pendingMatches":this.state.matches.some(r=>r.id===t)?"matches":this.state.cachedMatches.some(r=>r.id===t)?"cachedMatches":"";a&&(a==="cachedMatches"?this.__store.setState(r=>({...r,cachedMatches:cz(r.cachedMatches.map(c=>c.id===t?s(c):c))})):this.__store.setState(r=>({...r,[a]:r[a]?.map(c=>c.id===t?s(c):c)})))})},this.getMatch=t=>{const s=a=>a.id===t;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=t=>{const s=a=>t?.filter?.(a)??!0?{...a,invalid:!0,...t?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(s),cachedMatches:a.cachedMatches.map(s),pendingMatches:a.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const s=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const a=t.options._builtLocation??this.buildLocation(t.options),r=this.getParsedLocationHref(a);t.options.href=r,t.headers.set("Location",r)}else if(s)try{const a=new URL(s);if(this.origin&&a.origin===this.origin){const r=a.pathname+a.search+a.hash;t.options.href=r,t.headers.set("Location",r)}}catch{}if(t.options.href&&!t.options._builtLocation&&hu(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 s=t?.filter;s!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(r=>!s(r))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=s=>{const a=this.looseRoutesById[s.routeId];if(!a.options.loader)return!0;const r=(s.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:t})},this.loadRouteChunk=tl,this.preloadRoute=async t=>{const s=t._builtLocation??this.buildLocation(t);let a=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:t});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),c=new Set([...r,...this.state.cachedMatches.map(d=>d.id)]);Vo(()=>{a.forEach(d=>{c.has(d.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,d]}))})});try{return a=await xx({router:this,matches:a,location:s,preload:!0,updateMatch:(d,f)=>{r.has(d)?a=a.map(p=>p.id===d?f(p):p):this.updateMatch(d,f)}}),a}catch(d){if(Sn(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:s});fn(d)||console.error(d);return}},this.matchRoute=(t,s)=>{const a={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},r=this.buildLocation(a);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=h_(r.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!d||t.params&&!va(d.rawParams,t.params,{partial:!0})?!1:s?.includeSearch??!0?va(c.search,r.search,{partial:!0})?d.rawParams:!1:d.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??D_,parseSearch:e.parseSearch??O_,protocolAllowlist:e.protocolAllowlist??o_}),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:s}){this.routesById=e,this.routesByPath=t,this.processedTree=s;const a=this.options.notFoundRoute;a&&(a.init({originalIndex:99999999999}),this.routesById[a.id]=a)}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 s=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:r,parsedParams:c}=s;let{matchedRoutes:d}=s,f=!1;(a?a.path!=="/"&&r["**"]:Oi(e.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:f=!0);const p=f?gz(this.options.notFoundMode,d):void 0,m=new Array(d.length),v=new Map(this.state.matches.map(y=>[y.routeId,y]));for(let y=0;y<d.length;y++){const x=d[y],b=m[y-1];let w,S,C;{const pe=b?.search??e.search,ke=b?._strictSearch??void 0;try{const je=iu(x.options.validateSearch,{...pe})??void 0;w={...pe,...je},S={...ke,...je},C=void 0}catch(je){let B=je;if(je instanceof xu||(B=new xu(je.message,{cause:je})),t?.throwOnError)throw B;w=pe,S={},C=B}}const k=x.options.loaderDeps?.({search:w})??"",E=k?JSON.stringify(k):"",{interpolatedPath:A,usedParams:z}=fx({path:x.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),L=x.id+A+E,M=this.getMatch(L),R=v.get(x.id),T=M?._strictParams??z;let P;if(!M)try{Nx(x,z,c,T)}catch(pe){if(fn(pe)||Sn(pe)?P=pe:P=new dz(pe.message,{cause:pe}),t?.throwOnError)throw P}Object.assign(r,T);const J=R?"stay":"enter";let Q;if(M)Q={...M,cause:J,params:R?.params??r,_strictParams:T,search:la(R?R.search:M.search,w),_strictSearch:S};else{const pe=x.options.loader||x.options.beforeLoad||x.lazyFn||zS(x)?"pending":"success";Q={id:L,ssr:x.options.ssr,index:y,routeId:x.id,params:R?.params??r,_strictParams:T,pathname:A,updatedAt:Date.now(),search:R?la(R.search,w):w,_strictSearch:S,searchError:void 0,status:pe,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Tr()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:J,loaderDeps:R?ha(R.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}t?.preload||(Q.globalNotFound=p===x.id),Q.searchError=C;const se=this.getParentContext(b);Q.context={...se,...Q.__routeContext,...Q.__beforeLoadContext},m[y]=Q}for(let y=0;y<m.length;y++){const x=m[y],b=this.looseRoutesById[x.routeId],w=this.getMatch(x.id),S=v.get(x.routeId);if(x.params=S?la(S.params,r):r,!w){const C=m[y-1],k=this.getParentContext(C);if(b.options.context){const E={deps:x.loaderDeps,params:x.params,context:k??{},location:e,navigate:A=>this.navigate({...A,_fromLocation:e}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:m,routeId:b.id};x.__routeContext=b.options.context(E)??void 0}x.context={...k,...x.__routeContext,...x.__beforeLoadContext}}}return m}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:s,parsedParams:a}=this.getMatchedRoutes(e.pathname),r=Wo(t),c={...e.search};for(const m of t)try{Object.assign(c,iu(m.options.validateSearch,c))}catch{}const d=Wo(this.state.matches),f=d&&d.routeId===r.id&&e.pathname===this.state.location.pathname;let p;if(f)p=d.params;else{const m=Object.assign(Object.create(null),s);for(const v of t)try{Nx(v,s,a??{},m)}catch{}p=m}return{matchedRoutes:t,fullPath:r.fullPath,search:c,params:p}}},xu=class extends Error{},dz=class extends Error{};function fz(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function iu(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new xu("Async validation not supported");if(s.issues)throw new xu(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function hz({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),r=Oi(e);let c,d;const f=m_(r,s,!0);return f&&(c=f.route,Object.assign(a,f.rawParams),d=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:a,foundRoute:c,parsedParams:d}}function mz({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return pz(s)(e,t,a??!1)}function pz(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const c=({search:d,next:f})=>{let p=d;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(p=r.options.preSearchFilters.reduce((v,y)=>y(v),d));const m=f(p);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((v,y)=>y(v),m):m};t.middlewares.push(c)}if(r.options.validateSearch){const c=({search:d,next:f})=>{const p=f(d);if(!t._includeValidateSearch)return p;try{return{...p,...iu(r.options.validateSearch,p)??void 0}}catch{return p}};t.middlewares.push(c)}}const s=({search:r})=>{const c=t.dest;return c.search?c.search===!0?r:zi(c.search,r):{}};t.middlewares.push(s);const a=(r,c,d)=>{if(r>=d.length)return c;const f=d[r];return f({search:c,next:m=>a(r+1,m,d)})};return function(c,d,f){return t.dest=d,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function gz(e,t){if(e!=="root")for(let s=t.length-1;s>=0;s--){const a=t[s];if(a.children)return a.id}return xa}function Nx(e,t,s,a){const r=e.options.params?.parse??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const c in t)c in s&&(a[c]=s[c]);else{const c=r(a);Object.assign(a,c)}}var yz="Error preloading route! ☝️",ES=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 s=this.options,a=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=xa:this.parentRoute||Ui(!1);let r=a?xa:s?.path;r&&r!=="/"&&(r=yS(r));const c=s?.id||r;let d=a?xa:tu([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);r==="__root__"&&(r="/"),d!=="__root__"&&(d=tu(["/",d]));const f=d==="__root__"?"/":tu([this.parentRoute.fullPath,r]);this._path=r,this._id=d,this._fullPath=f,this._to=Oi(f)},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=>Xm({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.")}},vz=class extends ES{constructor(e){super(e)}};function np(e){const t=e.errorComponent??sp;return l.jsx(xz,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?N.createElement(t,{error:s,reset:a}):e.children})}var xz=class extends N.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 sp({error:e}){const[t,s]=N.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:()=>s(a=>!a),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 bz({children:e,fallback:t=null}){return AS()?l.jsx(is.Fragment,{children:e}):l.jsx(is.Fragment,{children:t})}function AS(){return is.useSyncExternalStore(Sz,()=>!0,()=>!1)}function Sz(){return()=>{}}var RS=N.createContext(null);function Kn(e){const t=N.useContext(RS);return e?.warn,t}var Ah={exports:{}},Rh={},Th={exports:{}},Oh={};var Cx;function jz(){if(Cx)return Oh;Cx=1;var e=ll();function t(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var s=typeof Object.is=="function"?Object.is:t,a=e.useState,r=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(y,x){var b=x(),w=a({inst:{value:b,getSnapshot:x}}),S=w[0].inst,C=w[1];return c(function(){S.value=b,S.getSnapshot=x,p(S)&&C({inst:S})},[y,b,x]),r(function(){return p(S)&&C({inst:S}),y(function(){p(S)&&C({inst:S})})},[y]),d(b),b}function p(y){var x=y.getSnapshot;y=y.value;try{var b=x();return!s(y,b)}catch{return!0}}function m(y,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Oh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Oh}var kx;function wz(){return kx||(kx=1,Th.exports=jz()),Th.exports}var _x;function Nz(){if(_x)return Rh;_x=1;var e=ll(),t=wz();function s(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var a=typeof Object.is=="function"?Object.is:s,r=t.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,p=e.useDebugValue;return Rh.useSyncExternalStoreWithSelector=function(m,v,y,x,b){var w=c(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=f(function(){function k(M){if(!E){if(E=!0,A=M,M=x(M),b!==void 0&&S.hasValue){var R=S.value;if(b(R,M))return z=R}return z=M}if(R=z,a(A,M))return R;var T=x(M);return b!==void 0&&b(R,T)?(A=M,R):(A=M,z=T)}var E=!1,A,z,L=y===void 0?null:y;return[function(){return k(v())},L===null?void 0:function(){return k(L())}]},[v,y,x,b]);var C=r(m,w[0],w[1]);return d(function(){S.hasValue=!0,S.value=C},[C]),p(C),C},Rh}var zx;function Cz(){return zx||(zx=1,Ah.exports=Nz()),Ah.exports}var kz=Cz();function _z(e,t){return e===t}function zz(e,t,s=_z){const a=N.useCallback(d=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(d);return f},[e]),r=N.useCallback(()=>e?.get(),[e]);return kz.useSyncExternalStoreWithSelector(a,r,r,t,s)}function jn(e){const t=Kn({warn:e?.router===void 0}),s=e?.router||t,a=N.useRef(void 0);return zz(s.__store,r=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const c=ha(a.current,e.select(r));return a.current=c,c}return e.select(r)}return r})}var Du=N.createContext(void 0),Ez=N.createContext(void 0);function Ii(e){const t=N.useContext(e.from?Ez:Du);return jn({select:s=>{const a=s.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if(Ui(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function ip(e){return Ii({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ap(e){const{select:t,...s}=e;return Ii({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Lu(e){return Ii({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const s=e.strict===!1?t.params:t._strictParams;return e.select?e.select(s):s}})}function Mu(e){return Ii({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function _a(e){const t=Kn();return N.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function rp(e){return Ii({...e,select:t=>e.select?e.select(t.context):t.context})}var op=Jb();const Az=Yb(op);function Rz(e,t){const s=Kn(),a=t_(t),{activeProps:r,inactiveProps:c,activeOptions:d,to:f,preload:p,preloadDelay:m,hashScrollIntoView:v,replace:y,startTransition:x,resetScroll:b,viewTransition:w,children:S,target:C,disabled:k,style:E,className:A,onClick:z,onBlur:L,onFocus:M,onMouseEnter:R,onMouseLeave:T,onTouchStart:P,ignoreBlocker:J,params:Q,search:se,hash:pe,state:ke,mask:je,reloadDocument:B,unsafeRelative:G,from:oe,_fromLocation:q,...X}=e,O=AS(),Z=jn({select:ze=>{const Ue=ze.matches[ze.matches.length-1];return{search:Ue?.search,hash:ze.location.hash,path:Ue?.pathname}},structuralSharing:!0}),ie=e.from,re=N.useMemo(()=>({...e,from:ie}),[s,Z,ie,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ue=N.useMemo(()=>s.buildLocation({...re}),[s,re]),he=ue.maskedLocation?ue.maskedLocation.publicHref:ue.publicHref,de=ue.maskedLocation?ue.maskedLocation.external:ue.external,Me=N.useMemo(()=>Uz(he,de,s.history,k),[k,de,he,s.history]),ge=N.useMemo(()=>{if(Me?.external)return hu(Me.href,s.protocolAllowlist)?void 0:Me.href;if(!$z(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),hu(f,s.protocolAllowlist)?void 0:f}catch{}},[f,Me,s.protocolAllowlist]),Ke=jn({select:ze=>{if(ge)return!1;if(d?.exact){if(!b_(ze.location.pathname,ue.pathname,s.basepath))return!1}else{const Ue=pu(ze.location.pathname,s.basepath),pt=pu(ue.pathname,s.basepath);if(!(Ue.startsWith(pt)&&(Ue.length===pt.length||Ue[pt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!va(ze.location.search,ue.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?O&&ze.location.hash===ue.hash:!0}}),it=Ke?zi(r,{})??Tz:Dh,me=Ke?Dh:zi(c,{})??Dh,We=[A,it.className,me.className].filter(Boolean).join(" "),dt=(E||it.style||me.style)&&{...E,...it.style,...me.style},[sn,_t]=N.useState(!1),an=N.useRef(!1),Vt=e.reloadDocument||ge?!1:p??s.options.defaultPreload,zt=m??s.options.defaultPreloadDelay??0,bt=N.useCallback(()=>{s.preloadRoute({...re,_builtLocation:ue}).catch(ze=>{console.warn(ze),console.warn(yz)})},[s,re,ue]);e_(a,N.useCallback(ze=>{ze?.isIntersecting&&bt()},[bt]),Mz,{disabled:!!k||Vt!=="viewport"}),N.useEffect(()=>{an.current||!k&&Vt==="render"&&(bt(),an.current=!0)},[k,bt,Vt]);const mn=ze=>{const Ue=ze.currentTarget.getAttribute("target"),pt=C!==void 0?C:Ue;if(!k&&!Pz(ze)&&!ze.defaultPrevented&&(!pt||pt==="_self")&&ze.button===0){ze.preventDefault(),op.flushSync(()=>{_t(!0)});const rn=s.subscribe("onResolved",()=>{rn(),_t(!1)});s.navigate({...re,replace:y,resetScroll:b,hashScrollIntoView:v,startTransition:x,viewTransition:w,ignoreBlocker:J})}};if(ge)return{...X,ref:a,href:ge,...S&&{children:S},...C&&{target:C},...k&&{disabled:k},...E&&{style:E},...A&&{className:A},...z&&{onClick:z},...L&&{onBlur:L},...M&&{onFocus:M},...R&&{onMouseEnter:R},...T&&{onMouseLeave:T},...P&&{onTouchStart:P}};const le=ze=>{if(k||Vt!=="intent")return;if(!zt){bt();return}const Ue=ze.currentTarget;if(Bo.has(Ue))return;const pt=setTimeout(()=>{Bo.delete(Ue),bt()},zt);Bo.set(Ue,pt)},Ie=ze=>{k||Vt!=="intent"||bt()},Be=ze=>{if(k||!Vt||!zt)return;const Ue=ze.currentTarget,pt=Bo.get(Ue);pt&&(clearTimeout(pt),Bo.delete(Ue))};return{...X,...it,...me,href:Me?.href,ref:a,onClick:gr([z,mn]),onBlur:gr([L,Be]),onFocus:gr([M,le]),onMouseEnter:gr([R,le]),onMouseLeave:gr([T,Be]),onTouchStart:gr([P,Ie]),disabled:!!k,target:C,...dt&&{style:dt},...We&&{className:We},...k&&Oz,...Ke&&Dz,...O&&sn&&Lz}}var Dh={},Tz={className:"active"},Oz={role:"link","aria-disabled":!0},Dz={"data-status":"active","aria-current":"page"},Lz={"data-transitioning":"transitioning"},Bo=new WeakMap,Mz={rootMargin:"100px"},gr=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function Uz(e,t,s,a){if(!a)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function $z(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var yt=N.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:r,...c}=Rz(a,t),d=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!s){const{disabled:f,...p}=c;return N.createElement("a",p,d)}return N.createElement(s,c,d)});function Pz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Iz=class extends ES{constructor(e){super(e),this.useMatch=t=>Ii({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>rp({...t,from:this.id}),this.useSearch=t=>Mu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ap({...t,from:this.id}),this.useLoaderData=t=>ip({...t,from:this.id}),this.useNavigate=()=>_a({from:this.fullPath}),this.Link=is.forwardRef((t,s)=>l.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Vn(e){return new Iz(e)}function Bz(){return e=>Hz(e)}var qz=class extends vz{constructor(e){super(e),this.useMatch=t=>Ii({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>rp({...t,from:this.id}),this.useSearch=t=>Mu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ap({...t,from:this.id}),this.useLoaderData=t=>ip({...t,from:this.id}),this.useNavigate=()=>_a({from:this.fullPath}),this.Link=is.forwardRef((t,s)=>l.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Hz(e){return new qz(e)}function Ex(e){return typeof e=="object"?new Ax(e,{silent:!0}).createRoute(e):new Ax(e,{silent:!0}).createRoute}var Ax=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=Vn(s);return a.isRoot=!1,a},this.silent=t?.silent}},Rx=class{constructor(e){this.useMatch=t=>Ii({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>rp({...t,from:this.options.id}),this.useSearch=t=>Mu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>ap({...t,from:this.options.id}),this.useLoaderData=t=>ip({...t,from:this.options.id}),this.useNavigate=()=>_a({from:Kn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Tx(e){return typeof e=="object"?new Rx(e):t=>new Rx({id:e,...t})}function Gz(e){const t=jn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return l.jsx(np,{getResetKey:()=>t,onCatch:(s,a)=>{if(fn(s))e.onCatch?.(s,a);else throw s},errorComponent:({error:s})=>{if(fn(s))return e.fallback?.(s);throw s},children:e.children})}function Fz(){return l.jsx("p",{children:"Not Found"})}function jr(e){return l.jsx(l.Fragment,{children:e.children})}function TS(e,t,s){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...s}):l.jsx(Fz,{})}function Zz(){return Kn().isScrollRestoring,null}var OS=N.memo(function({matchId:t}){const s=Kn(),a=jn({select:w=>{const S=w.matches.findIndex(k=>k.id===t),C=w.matches[S];return Ui(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[S-1]?.routeId}},structuralSharing:!0}),r=s.routesById[a.routeId],c=r.options.pendingComponent??s.options.defaultPendingComponent,d=c?l.jsx(c,{}):null,f=r.options.errorComponent??s.options.defaultErrorComponent,p=r.options.onCatch??s.options.defaultOnCatch,m=r.isRoot?r.options.notFoundComponent??s.options.notFoundRoute?.options.component:r.options.notFoundComponent,v=a.ssr===!1||a.ssr==="data-only",y=(!r.isRoot||r.options.wrapInSuspense||v)&&(r.options.wrapInSuspense??c??(r.options.errorComponent?.preload||v))?N.Suspense:jr,x=f?np:jr,b=m?Gz:jr;return l.jsxs(r.isRoot?r.options.shellComponent??jr:jr,{children:[l.jsx(Du.Provider,{value:t,children:l.jsx(y,{fallback:d,children:l.jsx(x,{getResetKey:()=>a.resetKey,errorComponent:f||sp,onCatch:(w,S)=>{if(fn(w))throw w;p?.(w,S)},children:l.jsx(b,{fallback:w=>{if(!m||w.routeId&&w.routeId!==a.routeId||!w.routeId&&!r.isRoot)throw w;return N.createElement(m,w)},children:v||a._displayPending?l.jsx(bz,{fallback:d,children:l.jsx(Ox,{matchId:t})}):l.jsx(Ox,{matchId:t})})})})}),a.parentRouteId===xa&&s.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(Kz,{}),l.jsx(Zz,{})]}):null]})});function Kz(){const e=Kn(),t=N.useRef(void 0);return l.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Sa(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Ox=N.memo(function({matchId:t}){const s=Kn(),{match:a,key:r,routeId:c}=jn({select:p=>{const m=p.matches.find(x=>x.id===t),v=m.routeId,y=(s.routesById[v].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:v,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:m.id,status:m.status,error:m.error,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),d=s.routesById[c],f=N.useMemo(()=>{const p=d.options.component??s.options.defaultComponent;return p?l.jsx(p,{},r):l.jsx(lp,{})},[r,d.options.component,s.options.defaultComponent]);if(a._displayPending)throw s.getMatch(a.id)?._nonReactive.displayPendingPromise;if(a._forcePending)throw s.getMatch(a.id)?._nonReactive.minPendingPromise;if(a.status==="pending"){const p=d.options.pendingMinMs??s.options.defaultPendingMinMs;if(p){const m=s.getMatch(a.id);if(m&&!m._nonReactive.minPendingPromise){const v=Tr();m._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),m._nonReactive.minPendingPromise=void 0},p)}}throw s.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return Ui(fn(a.error)),TS(s,d,a.error);if(a.status==="redirected")throw Ui(Sn(a.error)),s.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),lp=N.memo(function(){const t=Kn(),s=N.useContext(Du),a=jn({select:m=>m.matches.find(v=>v.id===s)?.routeId}),r=t.routesById[a],c=jn({select:m=>{const v=m.matches.find(y=>y.id===s);return Ui(v),v.globalNotFound}}),d=jn({select:m=>{const v=m.matches;return v[v.findIndex(y=>y.id===s)+1]?.id}}),f=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(c)return TS(t,r,void 0);if(!d)return null;const p=l.jsx(OS,{matchId:d});return a===xa?l.jsx(N.Suspense,{fallback:f,children:p}):p});function Vz(){const e=Kn(),t=N.useRef({router:e,mounted:!1}),[s,a]=N.useState(!1),{hasPendingMatches:r,isLoading:c}=jn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(x=>x.status==="pending")}),structuralSharing:!0}),d=Nh(c),f=c||s||r,p=Nh(f),m=c||r,v=Nh(m);return e.startTransition=y=>{a(!0),N.startTransition(()=>{y(),a(!1)})},N.useEffect(()=>{const y=e.history.subscribe(e.load),x=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Oi(e.latestLocation.publicHref)!==Oi(x.publicHref)&&e.commitLocation({...x,replace:!0}),()=>{y()}},[e,e.history]),Lc(()=>{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(x){console.error(x)}})()},[e]),Lc(()=>{d&&!c&&e.emit({type:"onLoad",...Sa(e.state)})},[d,e,c]),Lc(()=>{v&&!m&&e.emit({type:"onBeforeRouteMount",...Sa(e.state)})},[m,v,e]),Lc(()=>{if(p&&!f){const y=Sa(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(x=>({...x,status:"idle",resolvedLocation:x.location})),y.hrefChanged&&A_(e)}},[f,p,e]),null}function Qz(){const e=Kn(),t=e.routesById[xa].options.pendingComponent??e.options.defaultPendingComponent,s=t?l.jsx(t,{}):null,a=l.jsxs(typeof document<"u"&&e.ssr?jr:N.Suspense,{fallback:s,children:[l.jsx(Vz,{}),l.jsx(Yz,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:a}):a}function Yz(){const e=Kn(),t=jn({select:r=>r.matches[0]?.id}),s=jn({select:r=>r.loadedAt}),a=t?l.jsx(OS,{matchId:t}):null;return l.jsx(Du.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:l.jsx(np,{getResetKey:()=>s,errorComponent:sp,onCatch:void 0,children:a})})}var Jz=e=>new Xz(e),Xz=class extends uz{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Ex,globalThis.createLazyFileRoute=Tx):typeof window<"u"&&(window.createFileRoute=Ex,window.createLazyFileRoute=Tx);function Wz({router:e,children:t,...s}){Object.keys(s).length>0&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const a=l.jsx(RS.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:a}):a}function e2({router:e,...t}){return l.jsx(Wz,{router:e,...t,children:l.jsx(Qz,{})})}function t2(e){return jn({select:t=>t.location})}let Ai=[],n2=0;const pm=new Set;function DS(){const e=[...Ai];for(const t of pm)t(e)}function s2(e,t="negative",s=6e3){const a=String(++n2),r={id:a,message:e,tone:t,expiresAt:Date.now()+s};return Ai=[...Ai,r],DS(),setTimeout(()=>{LS(a)},s),a}function LS(e){const t=Ai.length;Ai=Ai.filter(s=>s.id!==e),Ai.length!==t&&DS()}function i2(e){return pm.add(e),()=>{pm.delete(e)}}function Dx(){return Ai}function a2(){return new Kk({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new aS({onError:e=>{s2(e instanceof Error?e.message:"An unexpected error occurred","negative")}})})}const r2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),o2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),Lx=e=>{const t=o2(e);return t.charAt(0).toUpperCase()+t.slice(1)},MS=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),l2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var c2={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 u2=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:r="",children:c,iconNode:d,...f},p)=>N.createElement("svg",{ref:p,...c2,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:MS("lucide",r),...!c&&!l2(f)&&{"aria-hidden":"true"},...f},[...d.map(([m,v])=>N.createElement(m,v)),...Array.isArray(c)?c:[c]]));const nn=(e,t)=>{const s=N.forwardRef(({className:a,...r},c)=>N.createElement(u2,{ref:c,iconNode:t,className:MS(`lucide-${r2(Lx(e))}`,`lucide-${e}`,a),...r}));return s.displayName=Lx(e),s};const d2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Uu=nn("chevron-right",d2);const f2=[["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"}]],h2=nn("download",f2);const m2=[["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"}]],p2=nn("github",m2);const g2=[["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"}]],y2=nn("globe",g2);const v2=[["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"}]],x2=nn("layout-dashboard",v2);const b2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],S2=nn("menu",b2);const j2=[["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"}]],w2=nn("play",j2);const N2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mx=nn("plus",N2);const C2=[["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"}]],Ux=nn("refresh-cw",C2);const k2=[["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"}]],_2=nn("rocket",k2);const z2=[["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"}]],E2=nn("rotate-ccw",z2);const A2=[["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"}]],R2=nn("settings",A2);const T2=[["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"}]],O2=nn("trash-2",T2);const D2=[["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"}]],L2=nn("triangle-alert",D2);const M2=[["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"}]],U2=nn("unplug",M2);const $2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$u=nn("x",$2);function P2(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const s=t[1],a=t[2],r=a.indexOf("{");if(r>=0){const c=a.slice(0,r).trim(),d=a.slice(r);try{const f=JSON.parse(d);return`${s} ${c}
8
+ `+u.stack}}var _t=Object.prototype.hasOwnProperty,zt=e.unstable_scheduleCallback,mn=e.unstable_cancelCallback,le=e.unstable_shouldYield,Ie=e.unstable_requestPaint,Be=e.unstable_now,ze=e.unstable_getCurrentPriorityLevel,Ue=e.unstable_ImmediatePriority,pt=e.unstable_UserBlockingPriority,rn=e.unstable_NormalPriority,Ss=e.unstable_LowPriority,Vs=e.unstable_IdlePriority,js=e.log,Qs=e.unstable_setDisableYieldValue,ls=null,_e=null;function Ht(n){if(typeof js=="function"&&Qs(n),_e&&typeof _e.setStrictMode=="function")try{_e.setStrictMode(ls,n)}catch{}}var Ve=Math.clz32?Math.clz32:gl,ae=Math.log,Jn=Math.LN2;function gl(n){return n>>>=0,n===0?32:31-(ae(n)/Jn|0)|0}var Ys=256,ws=262144,Fi=4194304;function cs(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ta(n,i,l){var u=n.pendingLanes;if(u===0)return 0;var h=0,g=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var _=u&134217727;return _!==0?(u=_&~g,u!==0?h=cs(u):(j&=_,j!==0?h=cs(j):l||(l=_&~n,l!==0&&(h=cs(l))))):(_=u&~g,_!==0?h=cs(_):j!==0?h=cs(j):l||(l=u&~n,l!==0&&(h=cs(l)))),h===0?0:i!==0&&i!==h&&(i&g)===0&&(g=h&-h,l=i&-i,g>=l||g===32&&(l&4194048)!==0)?i:h}function us(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function yl(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 vl(){var n=Fi;return Fi<<=1,(Fi&62914560)===0&&(Fi=4194304),n}function Oa(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Zi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function od(n,i,l,u,h,g){var j=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var _=n.entanglements,D=n.expirationTimes,F=n.hiddenUpdates;for(l=j&~l;0<l;){var W=31-Ve(l),ne=1<<W;_[W]=0,D[W]=-1;var V=F[W];if(V!==null)for(F[W]=null,W=0;W<V.length;W++){var Y=V[W];Y!==null&&(Y.lane&=-536870913)}l&=~ne}u!==0&&xl(n,u,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(j&~i))}function xl(n,i,l){n.pendingLanes|=i,n.suspendedLanes&=~i;var u=31-Ve(i);n.entangledLanes|=i,n.entanglements[u]=n.entanglements[u]|1073741824|l&261930}function bl(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var u=31-Ve(l),h=1<<u;h&i|n[u]&i&&(n[u]|=i),l&=~h}}function Fr(n,i){var l=i&-i;return l=(l&42)!==0?1:$(l),(l&(n.suspendedLanes|i))!==0?0:l}function $(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function fe(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function at(){var n=G.p;return n!==0?n:(n=window.event,n===void 0?32:Ov(n.type))}function Qt(n,i){var l=G.p;try{return G.p=n,i()}finally{G.p=l}}var Lt=Math.random().toString(36).slice(2),Et="__reactFiber$"+Lt,wt="__reactProps$"+Lt,Cn="__reactContainer$"+Lt,en="__reactEvents$"+Lt,ld="__reactListeners$"+Lt,Js="__reactHandles$"+Lt,Xs="__reactResources$"+Lt,ds="__reactMarker$"+Lt;function Da(n){delete n[Et],delete n[wt],delete n[en],delete n[ld],delete n[Js]}function Ws(n){var i=n[Et];if(i)return i;for(var l=n.parentNode;l;){if(i=l[Cn]||l[Et]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=yv(n);n!==null;){if(l=n[Et])return l;n=yv(n)}return i}n=l,l=n.parentNode}return null}function Xn(n){if(n=n[Et]||n[Cn]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function fs(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function ei(n){var i=n[Xs];return i||(i=n[Xs]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Mt(n){n[ds]=!0}var qe=new Set,rt={};function Gt(n,i){on(n,i),on(n+"Capture",i)}function on(n,i){for(rt[n]=i,n=0;n<i.length;n++)qe.add(i[n])}var La=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]*$"),Zr={},eg={};function o1(n){return _t.call(eg,n)?!0:_t.call(Zr,n)?!1:La.test(n)?eg[n]=!0:(Zr[n]=!0,!1)}function Sl(n,i,l){if(o1(i))if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+l)}}function jl(n,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+l)}}function Ns(n,i,l,u){if(u===null)n.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(i,l,""+u)}}function On(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function tg(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function l1(n,i,l){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,g=u.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return h.call(this)},set:function(j){l=""+j,g.call(this,j)}}),Object.defineProperty(n,i,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(j){l=""+j},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function cd(n){if(!n._valueTracker){var i=tg(n)?"checked":"value";n._valueTracker=l1(n,i,""+n[i])}}function ng(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),u="";return n&&(u=tg(n)?n.checked?"true":"false":n.value),n=u,n!==l?(i.setValue(n),!0):!1}function wl(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var c1=/[\n"\\]/g;function Dn(n){return n.replace(c1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function ud(n,i,l,u,h,g,j,_){n.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.type=j:n.removeAttribute("type"),i!=null?j==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+On(i)):n.value!==""+On(i)&&(n.value=""+On(i)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),i!=null?dd(n,j,On(i)):l!=null?dd(n,j,On(l)):u!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.name=""+On(_):n.removeAttribute("name")}function sg(n,i,l,u,h,g,j,_){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||l!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){cd(n);return}l=l!=null?""+On(l):"",i=i!=null?""+On(i):l,_||i===n.value||(n.value=i),n.defaultValue=i}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=_?n.checked:!!u,n.defaultChecked=!!u,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j),cd(n)}function dd(n,i,l){i==="number"&&wl(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function Ma(n,i,l,u){if(n=n.options,i){i={};for(var h=0;h<l.length;h++)i["$"+l[h]]=!0;for(l=0;l<n.length;l++)h=i.hasOwnProperty("$"+n[l].value),n[l].selected!==h&&(n[l].selected=h),h&&u&&(n[l].defaultSelected=!0)}else{for(l=""+On(l),i=null,h=0;h<n.length;h++){if(n[h].value===l){n[h].selected=!0,u&&(n[h].defaultSelected=!0);return}i!==null||n[h].disabled||(i=n[h])}i!==null&&(i.selected=!0)}}function ig(n,i,l){if(i!=null&&(i=""+On(i),i!==n.value&&(n.value=i),l==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=l!=null?""+On(l):""}function ag(n,i,l,u){if(i==null){if(u!=null){if(l!=null)throw Error(a(92));if(je(u)){if(1<u.length)throw Error(a(93));u=u[0]}l=u}l==null&&(l=""),i=l}l=On(i),n.defaultValue=l,u=n.textContent,u===l&&u!==""&&u!==null&&(n.value=u),cd(n)}function Ua(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var u1=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 rg(n,i,l){var u=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":u?n.setProperty(i,l):typeof l!="number"||l===0||u1.has(i)?i==="float"?n.cssFloat=l:n[i]=(""+l).trim():n[i]=l+"px"}function og(n,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var h in i)u=i[h],i.hasOwnProperty(h)&&l[h]!==u&&rg(n,h,u)}else for(var g in i)i.hasOwnProperty(g)&&rg(n,g,i[g])}function fd(n){if(n.indexOf("-")===-1)return!1;switch(n){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 d1=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"]]),f1=/^[\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 Nl(n){return f1.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Cs(){}var hd=null;function md(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var $a=null,Pa=null;function lg(n){var i=Xn(n);if(i&&(n=i.stateNode)){var l=n[wt]||null;e:switch(n=i.stateNode,i.type){case"input":if(ud(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Dn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var u=l[i];if(u!==n&&u.form===n.form){var h=u[wt]||null;if(!h)throw Error(a(90));ud(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<l.length;i++)u=l[i],u.form===n.form&&ng(u)}break e;case"textarea":ig(n,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Ma(n,!!l.multiple,i,!1)}}}var pd=!1;function cg(n,i,l){if(pd)return n(i,l);pd=!0;try{var u=n(i);return u}finally{if(pd=!1,($a!==null||Pa!==null)&&(dc(),$a&&(i=$a,n=Pa,Pa=$a=null,lg(i),n)))for(i=0;i<n.length;i++)lg(n[i])}}function Kr(n,i){var l=n.stateNode;if(l===null)return null;var u=l[wt]||null;if(u===null)return null;l=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var ks=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gd=!1;if(ks)try{var Vr={};Object.defineProperty(Vr,"passive",{get:function(){gd=!0}}),window.addEventListener("test",Vr,Vr),window.removeEventListener("test",Vr,Vr)}catch{gd=!1}var ti=null,yd=null,Cl=null;function ug(){if(Cl)return Cl;var n,i=yd,l=i.length,u,h="value"in ti?ti.value:ti.textContent,g=h.length;for(n=0;n<l&&i[n]===h[n];n++);var j=l-n;for(u=1;u<=j&&i[l-u]===h[g-u];u++);return Cl=h.slice(n,1<u?1-u:void 0)}function kl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function _l(){return!0}function dg(){return!1}function pn(n){function i(l,u,h,g,j){this._reactName=l,this._targetInst=h,this.type=u,this.nativeEvent=g,this.target=j,this.currentTarget=null;for(var _ in n)n.hasOwnProperty(_)&&(l=n[_],this[_]=l?l(g):g[_]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?_l:dg,this.isPropagationStopped=dg,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=_l)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=_l)},persist:function(){},isPersistent:_l}),i}var Ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zl=pn(Ki),Qr=y({},Ki,{view:0,detail:0}),h1=pn(Qr),vd,xd,Yr,El=y({},Qr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Yr&&(Yr&&n.type==="mousemove"?(vd=n.screenX-Yr.screenX,xd=n.screenY-Yr.screenY):xd=vd=0,Yr=n),vd)},movementY:function(n){return"movementY"in n?n.movementY:xd}}),fg=pn(El),m1=y({},El,{dataTransfer:0}),p1=pn(m1),g1=y({},Qr,{relatedTarget:0}),bd=pn(g1),y1=y({},Ki,{animationName:0,elapsedTime:0,pseudoElement:0}),v1=pn(y1),x1=y({},Ki,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),b1=pn(x1),S1=y({},Ki,{data:0}),hg=pn(S1),j1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w1={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"},N1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function C1(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=N1[n])?!!i[n]:!1}function Sd(){return C1}var k1=y({},Qr,{key:function(n){if(n.key){var i=j1[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=kl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?w1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sd,charCode:function(n){return n.type==="keypress"?kl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?kl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),_1=pn(k1),z1=y({},El,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mg=pn(z1),E1=y({},Qr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sd}),R1=pn(E1),A1=y({},Ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),T1=pn(A1),O1=y({},El,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),D1=pn(O1),L1=y({},Ki,{newState:0,oldState:0}),M1=pn(L1),U1=[9,13,27,32],jd=ks&&"CompositionEvent"in window,Jr=null;ks&&"documentMode"in document&&(Jr=document.documentMode);var $1=ks&&"TextEvent"in window&&!Jr,pg=ks&&(!jd||Jr&&8<Jr&&11>=Jr),gg=" ",yg=!1;function vg(n,i){switch(n){case"keyup":return U1.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ia=!1;function P1(n,i){switch(n){case"compositionend":return xg(i);case"keypress":return i.which!==32?null:(yg=!0,gg);case"textInput":return n=i.data,n===gg&&yg?null:n;default:return null}}function I1(n,i){if(Ia)return n==="compositionend"||!jd&&vg(n,i)?(n=ug(),Cl=yd=ti=null,Ia=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return pg&&i.locale!=="ko"?null:i.data;default:return null}}var B1={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 bg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!B1[n.type]:i==="textarea"}function Sg(n,i,l,u){$a?Pa?Pa.push(u):Pa=[u]:$a=u,i=vc(i,"onChange"),0<i.length&&(l=new zl("onChange","change",null,l,u),n.push({event:l,listeners:i}))}var Xr=null,Wr=null;function q1(n){sv(n,0)}function Rl(n){var i=fs(n);if(ng(i))return n}function jg(n,i){if(n==="change")return i}var wg=!1;if(ks){var wd;if(ks){var Nd="oninput"in document;if(!Nd){var Ng=document.createElement("div");Ng.setAttribute("oninput","return;"),Nd=typeof Ng.oninput=="function"}wd=Nd}else wd=!1;wg=wd&&(!document.documentMode||9<document.documentMode)}function Cg(){Xr&&(Xr.detachEvent("onpropertychange",kg),Wr=Xr=null)}function kg(n){if(n.propertyName==="value"&&Rl(Wr)){var i=[];Sg(i,Wr,n,md(n)),cg(q1,i)}}function H1(n,i,l){n==="focusin"?(Cg(),Xr=i,Wr=l,Xr.attachEvent("onpropertychange",kg)):n==="focusout"&&Cg()}function G1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Rl(Wr)}function F1(n,i){if(n==="click")return Rl(i)}function Z1(n,i){if(n==="input"||n==="change")return Rl(i)}function K1(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var kn=typeof Object.is=="function"?Object.is:K1;function eo(n,i){if(kn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),u=Object.keys(i);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var h=l[u];if(!_t.call(i,h)||!kn(n[h],i[h]))return!1}return!0}function _g(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function zg(n,i){var l=_g(n);n=0;for(var u;l;){if(l.nodeType===3){if(u=n+l.textContent.length,n<=i&&u>=i)return{node:l,offset:i-n};n=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=_g(l)}}function Eg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Eg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Rg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=wl(n.document);i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=wl(n.document)}return i}function Cd(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var V1=ks&&"documentMode"in document&&11>=document.documentMode,Ba=null,kd=null,to=null,_d=!1;function Ag(n,i,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;_d||Ba==null||Ba!==wl(u)||(u=Ba,"selectionStart"in u&&Cd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),to&&eo(to,u)||(to=u,u=vc(kd,"onSelect"),0<u.length&&(i=new zl("onSelect","select",null,i,l),n.push({event:i,listeners:u}),i.target=Ba)))}function Vi(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var qa={animationend:Vi("Animation","AnimationEnd"),animationiteration:Vi("Animation","AnimationIteration"),animationstart:Vi("Animation","AnimationStart"),transitionrun:Vi("Transition","TransitionRun"),transitionstart:Vi("Transition","TransitionStart"),transitioncancel:Vi("Transition","TransitionCancel"),transitionend:Vi("Transition","TransitionEnd")},zd={},Tg={};ks&&(Tg=document.createElement("div").style,"AnimationEvent"in window||(delete qa.animationend.animation,delete qa.animationiteration.animation,delete qa.animationstart.animation),"TransitionEvent"in window||delete qa.transitionend.transition);function Qi(n){if(zd[n])return zd[n];if(!qa[n])return n;var i=qa[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in Tg)return zd[n]=i[l];return n}var Og=Qi("animationend"),Dg=Qi("animationiteration"),Lg=Qi("animationstart"),Q1=Qi("transitionrun"),Y1=Qi("transitionstart"),J1=Qi("transitioncancel"),Mg=Qi("transitionend"),Ug=new Map,Ed="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(" ");Ed.push("scrollEnd");function Wn(n,i){Ug.set(n,i),Gt(i,[n])}var Al=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Ln=[],Ha=0,Rd=0;function Tl(){for(var n=Ha,i=Rd=Ha=0;i<n;){var l=Ln[i];Ln[i++]=null;var u=Ln[i];Ln[i++]=null;var h=Ln[i];Ln[i++]=null;var g=Ln[i];if(Ln[i++]=null,u!==null&&h!==null){var j=u.pending;j===null?h.next=h:(h.next=j.next,j.next=h),u.pending=h}g!==0&&$g(l,h,g)}}function Ol(n,i,l,u){Ln[Ha++]=n,Ln[Ha++]=i,Ln[Ha++]=l,Ln[Ha++]=u,Rd|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Ad(n,i,l,u){return Ol(n,i,l,u),Dl(n)}function Yi(n,i){return Ol(n,null,null,i),Dl(n)}function $g(n,i,l){n.lanes|=l;var u=n.alternate;u!==null&&(u.lanes|=l);for(var h=!1,g=n.return;g!==null;)g.childLanes|=l,u=g.alternate,u!==null&&(u.childLanes|=l),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(h=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,h&&i!==null&&(h=31-Ve(l),n=g.hiddenUpdates,u=n[h],u===null?n[h]=[i]:u.push(i),i.lane=l|536870912),g):null}function Dl(n){if(50<No)throw No=0,Bf=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ga={};function X1(n,i,l,u){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(n,i,l,u){return new X1(n,i,l,u)}function Td(n){return n=n.prototype,!(!n||!n.isReactComponent)}function _s(n,i){var l=n.alternate;return l===null?(l=_n(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function Pg(n,i){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,i=l.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Ll(n,i,l,u,h,g){var j=0;if(u=n,typeof n=="function")Td(n)&&(j=1);else if(typeof n=="string")j=sk(n,l,re.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case P:return n=_n(31,l,i,h),n.elementType=P,n.lanes=g,n;case S:return Ji(l.children,h,g,i);case C:j=8,h|=24;break;case k:return n=_n(12,l,i,h|2),n.elementType=k,n.lanes=g,n;case L:return n=_n(13,l,i,h),n.elementType=L,n.lanes=g,n;case M:return n=_n(19,l,i,h),n.elementType=M,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:j=10;break e;case E:j=9;break e;case z:j=11;break e;case A:j=14;break e;case T:j=16,u=null;break e}j=29,l=Error(a(130,n===null?"null":typeof n,"")),u=null}return i=_n(j,l,i,h),i.elementType=n,i.type=u,i.lanes=g,i}function Ji(n,i,l,u){return n=_n(7,n,u,i),n.lanes=l,n}function Od(n,i,l){return n=_n(6,n,null,i),n.lanes=l,n}function Ig(n){var i=_n(18,null,null,0);return i.stateNode=n,i}function Dd(n,i,l){return i=_n(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Bg=new WeakMap;function Mn(n,i){if(typeof n=="object"&&n!==null){var l=Bg.get(n);return l!==void 0?l:(i={value:n,source:i,stack:Vt(i)},Bg.set(n,i),i)}return{value:n,source:i,stack:Vt(i)}}var Fa=[],Za=0,Ml=null,no=0,Un=[],$n=0,ni=null,hs=1,ms="";function zs(n,i){Fa[Za++]=no,Fa[Za++]=Ml,Ml=n,no=i}function qg(n,i,l){Un[$n++]=hs,Un[$n++]=ms,Un[$n++]=ni,ni=n;var u=hs;n=ms;var h=32-Ve(u)-1;u&=~(1<<h),l+=1;var g=32-Ve(i)+h;if(30<g){var j=h-h%5;g=(u&(1<<j)-1).toString(32),u>>=j,h-=j,hs=1<<32-Ve(i)+h|l<<h|u,ms=g+n}else hs=1<<g|l<<h|u,ms=n}function Ld(n){n.return!==null&&(zs(n,1),qg(n,1,0))}function Md(n){for(;n===Ml;)Ml=Fa[--Za],Fa[Za]=null,no=Fa[--Za],Fa[Za]=null;for(;n===ni;)ni=Un[--$n],Un[$n]=null,ms=Un[--$n],Un[$n]=null,hs=Un[--$n],Un[$n]=null}function Hg(n,i){Un[$n++]=hs,Un[$n++]=ms,Un[$n++]=ni,hs=i.id,ms=i.overflow,ni=n}var Yt=null,ht=null,Fe=!1,si=null,Pn=!1,Ud=Error(a(519));function ii(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw so(Mn(i,n)),Ud}function Gg(n){var i=n.stateNode,l=n.type,u=n.memoizedProps;switch(i[Et]=n,i[wt]=u,l){case"dialog":Pe("cancel",i),Pe("close",i);break;case"iframe":case"object":case"embed":Pe("load",i);break;case"video":case"audio":for(l=0;l<ko.length;l++)Pe(ko[l],i);break;case"source":Pe("error",i);break;case"img":case"image":case"link":Pe("error",i),Pe("load",i);break;case"details":Pe("toggle",i);break;case"input":Pe("invalid",i),sg(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Pe("invalid",i);break;case"textarea":Pe("invalid",i),ag(i,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||u.suppressHydrationWarning===!0||ov(i.textContent,l)?(u.popover!=null&&(Pe("beforetoggle",i),Pe("toggle",i)),u.onScroll!=null&&Pe("scroll",i),u.onScrollEnd!=null&&Pe("scrollend",i),u.onClick!=null&&(i.onclick=Cs),i=!0):i=!1,i||ii(n,!0)}function Fg(n){for(Yt=n.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:Yt=Yt.return}}function Ka(n){if(n!==Yt)return!1;if(!Fe)return Fg(n),Fe=!0,!1;var i=n.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||nh(n.type,n.memoizedProps)),l=!l),l&&ht&&ii(n),Fg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=gv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=gv(n)}else i===27?(i=ht,vi(n.type)?(n=oh,oh=null,ht=n):ht=i):ht=Yt?Bn(n.stateNode.nextSibling):null;return!0}function Xi(){ht=Yt=null,Fe=!1}function $d(){var n=si;return n!==null&&(xn===null?xn=n:xn.push.apply(xn,n),si=null),n}function so(n){si===null?si=[n]:si.push(n)}var Pd=O(null),Wi=null,Es=null;function ai(n,i,l){ie(Pd,i._currentValue),i._currentValue=l}function Rs(n){n._currentValue=Pd.current,Z(Pd)}function Id(n,i,l){for(;n!==null;){var u=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),n===l)break;n=n.return}}function Bd(n,i,l,u){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var j=h.child;g=g.firstContext;e:for(;g!==null;){var _=g;g=h;for(var D=0;D<i.length;D++)if(_.context===i[D]){g.lanes|=l,_=g.alternate,_!==null&&(_.lanes|=l),Id(g.return,l,n),u||(j=null);break e}g=_.next}}else if(h.tag===18){if(j=h.return,j===null)throw Error(a(341));j.lanes|=l,g=j.alternate,g!==null&&(g.lanes|=l),Id(j,l,n),j=null}else j=h.child;if(j!==null)j.return=h;else for(j=h;j!==null;){if(j===n){j=null;break}if(h=j.sibling,h!==null){h.return=j.return,j=h;break}j=j.return}h=j}}function Va(n,i,l,u){n=null;for(var h=i,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var j=h.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var _=h.type;kn(h.pendingProps.value,j.value)||(n!==null?n.push(_):n=[_])}}else if(h===de.current){if(j=h.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(Ao):n=[Ao])}h=h.return}n!==null&&Bd(i,n,l,u),i.flags|=262144}function Ul(n){for(n=n.firstContext;n!==null;){if(!kn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ea(n){Wi=n,Es=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Jt(n){return Zg(Wi,n)}function $l(n,i){return Wi===null&&ea(n),Zg(n,i)}function Zg(n,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Es===null){if(n===null)throw Error(a(308));Es=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Es=Es.next=i;return l}var W1=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(l,u){n.push(u)}};this.abort=function(){i.aborted=!0,n.forEach(function(l){return l()})}},eC=e.unstable_scheduleCallback,tC=e.unstable_NormalPriority,Ut={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qd(){return{controller:new W1,data:new Map,refCount:0}}function io(n){n.refCount--,n.refCount===0&&eC(tC,function(){n.controller.abort()})}var ao=null,Hd=0,Qa=0,Ya=null;function nC(n,i){if(ao===null){var l=ao=[];Hd=0,Qa=Kf(),Ya={status:"pending",value:void 0,then:function(u){l.push(u)}}}return Hd++,i.then(Kg,Kg),i}function Kg(){if(--Hd===0&&ao!==null){Ya!==null&&(Ya.status="fulfilled");var n=ao;ao=null,Qa=0,Ya=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function sC(n,i){var l=[],u={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return n.then(function(){u.status="fulfilled",u.value=i;for(var h=0;h<l.length;h++)(0,l[h])(i)},function(h){for(u.status="rejected",u.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),u}var Vg=B.S;B.S=function(n,i){A0=Be(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&nC(n,i),Vg!==null&&Vg(n,i)};var ta=O(null);function Gd(){var n=ta.current;return n!==null?n:ut.pooledCache}function Pl(n,i){i===null?ie(ta,ta.current):ie(ta,i.pool)}function Qg(){var n=Gd();return n===null?null:{parent:Ut._currentValue,pool:n}}var Ja=Error(a(460)),Fd=Error(a(474)),Il=Error(a(542)),Bl={then:function(){}};function Yg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Jg(n,i,l){switch(l=n[l],l===void 0?n.push(i):l!==i&&(i.then(Cs,Cs),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Wg(n),n;default:if(typeof i.status=="string")i.then(Cs,Cs);else{if(n=ut,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(u){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=u}},function(u){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=u}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Wg(n),n}throw sa=i,Ja}}function na(n){try{var i=n._init;return i(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(sa=l,Ja):l}}var sa=null;function Xg(){if(sa===null)throw Error(a(459));var n=sa;return sa=null,n}function Wg(n){if(n===Ja||n===Il)throw Error(a(483))}var Xa=null,ro=0;function ql(n){var i=ro;return ro+=1,Xa===null&&(Xa=[]),Jg(Xa,n,i)}function oo(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Hl(n,i){throw i.$$typeof===x?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function ey(n){function i(I,U){if(n){var H=I.deletions;H===null?(I.deletions=[U],I.flags|=16):H.push(U)}}function l(I,U){if(!n)return null;for(;U!==null;)i(I,U),U=U.sibling;return null}function u(I){for(var U=new Map;I!==null;)I.key!==null?U.set(I.key,I):U.set(I.index,I),I=I.sibling;return U}function h(I,U){return I=_s(I,U),I.index=0,I.sibling=null,I}function g(I,U,H){return I.index=H,n?(H=I.alternate,H!==null?(H=H.index,H<U?(I.flags|=67108866,U):H):(I.flags|=67108866,U)):(I.flags|=1048576,U)}function j(I){return n&&I.alternate===null&&(I.flags|=67108866),I}function _(I,U,H,ee){return U===null||U.tag!==6?(U=Od(H,I.mode,ee),U.return=I,U):(U=h(U,H),U.return=I,U)}function D(I,U,H,ee){var Ne=H.type;return Ne===S?W(I,U,H.props.children,ee,H.key):U!==null&&(U.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===T&&na(Ne)===U.type)?(U=h(U,H.props),oo(U,H),U.return=I,U):(U=Ll(H.type,H.key,H.props,null,I.mode,ee),oo(U,H),U.return=I,U)}function F(I,U,H,ee){return U===null||U.tag!==4||U.stateNode.containerInfo!==H.containerInfo||U.stateNode.implementation!==H.implementation?(U=Dd(H,I.mode,ee),U.return=I,U):(U=h(U,H.children||[]),U.return=I,U)}function W(I,U,H,ee,Ne){return U===null||U.tag!==7?(U=Ji(H,I.mode,ee,Ne),U.return=I,U):(U=h(U,H),U.return=I,U)}function ne(I,U,H){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Od(""+U,I.mode,H),U.return=I,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case b:return H=Ll(U.type,U.key,U.props,null,I.mode,H),oo(H,U),H.return=I,H;case w:return U=Dd(U,I.mode,H),U.return=I,U;case T:return U=na(U),ne(I,U,H)}if(je(U)||se(U))return U=Ji(U,I.mode,H,null),U.return=I,U;if(typeof U.then=="function")return ne(I,ql(U),H);if(U.$$typeof===R)return ne(I,$l(I,U),H);Hl(I,U)}return null}function V(I,U,H,ee){var Ne=U!==null?U.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Ne!==null?null:_(I,U,""+H,ee);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return H.key===Ne?D(I,U,H,ee):null;case w:return H.key===Ne?F(I,U,H,ee):null;case T:return H=na(H),V(I,U,H,ee)}if(je(H)||se(H))return Ne!==null?null:W(I,U,H,ee,null);if(typeof H.then=="function")return V(I,U,ql(H),ee);if(H.$$typeof===R)return V(I,U,$l(I,H),ee);Hl(I,H)}return null}function Y(I,U,H,ee,Ne){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return I=I.get(H)||null,_(U,I,""+ee,Ne);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return I=I.get(ee.key===null?H:ee.key)||null,D(U,I,ee,Ne);case w:return I=I.get(ee.key===null?H:ee.key)||null,F(U,I,ee,Ne);case T:return ee=na(ee),Y(I,U,H,ee,Ne)}if(je(ee)||se(ee))return I=I.get(H)||null,W(U,I,ee,Ne,null);if(typeof ee.then=="function")return Y(I,U,H,ql(ee),Ne);if(ee.$$typeof===R)return Y(I,U,H,$l(U,ee),Ne);Hl(U,ee)}return null}function ve(I,U,H,ee){for(var Ne=null,Ye=null,Se=U,Te=U=0,Ge=null;Se!==null&&Te<H.length;Te++){Se.index>Te?(Ge=Se,Se=null):Ge=Se.sibling;var Je=V(I,Se,H[Te],ee);if(Je===null){Se===null&&(Se=Ge);break}n&&Se&&Je.alternate===null&&i(I,Se),U=g(Je,U,Te),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je,Se=Ge}if(Te===H.length)return l(I,Se),Fe&&zs(I,Te),Ne;if(Se===null){for(;Te<H.length;Te++)Se=ne(I,H[Te],ee),Se!==null&&(U=g(Se,U,Te),Ye===null?Ne=Se:Ye.sibling=Se,Ye=Se);return Fe&&zs(I,Te),Ne}for(Se=u(Se);Te<H.length;Te++)Ge=Y(Se,I,Te,H[Te],ee),Ge!==null&&(n&&Ge.alternate!==null&&Se.delete(Ge.key===null?Te:Ge.key),U=g(Ge,U,Te),Ye===null?Ne=Ge:Ye.sibling=Ge,Ye=Ge);return n&&Se.forEach(function(wi){return i(I,wi)}),Fe&&zs(I,Te),Ne}function Ce(I,U,H,ee){if(H==null)throw Error(a(151));for(var Ne=null,Ye=null,Se=U,Te=U=0,Ge=null,Je=H.next();Se!==null&&!Je.done;Te++,Je=H.next()){Se.index>Te?(Ge=Se,Se=null):Ge=Se.sibling;var wi=V(I,Se,Je.value,ee);if(wi===null){Se===null&&(Se=Ge);break}n&&Se&&wi.alternate===null&&i(I,Se),U=g(wi,U,Te),Ye===null?Ne=wi:Ye.sibling=wi,Ye=wi,Se=Ge}if(Je.done)return l(I,Se),Fe&&zs(I,Te),Ne;if(Se===null){for(;!Je.done;Te++,Je=H.next())Je=ne(I,Je.value,ee),Je!==null&&(U=g(Je,U,Te),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je);return Fe&&zs(I,Te),Ne}for(Se=u(Se);!Je.done;Te++,Je=H.next())Je=Y(Se,I,Te,Je.value,ee),Je!==null&&(n&&Je.alternate!==null&&Se.delete(Je.key===null?Te:Je.key),U=g(Je,U,Te),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je);return n&&Se.forEach(function(mk){return i(I,mk)}),Fe&&zs(I,Te),Ne}function ct(I,U,H,ee){if(typeof H=="object"&&H!==null&&H.type===S&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case b:e:{for(var Ne=H.key;U!==null;){if(U.key===Ne){if(Ne=H.type,Ne===S){if(U.tag===7){l(I,U.sibling),ee=h(U,H.props.children),ee.return=I,I=ee;break e}}else if(U.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===T&&na(Ne)===U.type){l(I,U.sibling),ee=h(U,H.props),oo(ee,H),ee.return=I,I=ee;break e}l(I,U);break}else i(I,U);U=U.sibling}H.type===S?(ee=Ji(H.props.children,I.mode,ee,H.key),ee.return=I,I=ee):(ee=Ll(H.type,H.key,H.props,null,I.mode,ee),oo(ee,H),ee.return=I,I=ee)}return j(I);case w:e:{for(Ne=H.key;U!==null;){if(U.key===Ne)if(U.tag===4&&U.stateNode.containerInfo===H.containerInfo&&U.stateNode.implementation===H.implementation){l(I,U.sibling),ee=h(U,H.children||[]),ee.return=I,I=ee;break e}else{l(I,U);break}else i(I,U);U=U.sibling}ee=Dd(H,I.mode,ee),ee.return=I,I=ee}return j(I);case T:return H=na(H),ct(I,U,H,ee)}if(je(H))return ve(I,U,H,ee);if(se(H)){if(Ne=se(H),typeof Ne!="function")throw Error(a(150));return H=Ne.call(H),Ce(I,U,H,ee)}if(typeof H.then=="function")return ct(I,U,ql(H),ee);if(H.$$typeof===R)return ct(I,U,$l(I,H),ee);Hl(I,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,U!==null&&U.tag===6?(l(I,U.sibling),ee=h(U,H),ee.return=I,I=ee):(l(I,U),ee=Od(H,I.mode,ee),ee.return=I,I=ee),j(I)):l(I,U)}return function(I,U,H,ee){try{ro=0;var Ne=ct(I,U,H,ee);return Xa=null,Ne}catch(Se){if(Se===Ja||Se===Il)throw Se;var Ye=_n(29,Se,null,I.mode);return Ye.lanes=ee,Ye.return=I,Ye}}}var ia=ey(!0),ty=ey(!1),ri=!1;function Zd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kd(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function oi(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function li(n,i,l){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Xe&2)!==0){var h=u.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),u.pending=i,i=Dl(n),$g(n,null,l),i}return Ol(n,u,i,l),Dl(n)}function lo(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var u=i.lanes;u&=n.pendingLanes,l|=u,i.lanes=l,bl(n,l)}}function Vd(n,i){var l=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var h=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var j={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};g===null?h=g=j:g=g.next=j,l=l.next}while(l!==null);g===null?h=g=i:g=g.next=i}else h=g=i;l={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}var Qd=!1;function co(){if(Qd){var n=Ya;if(n!==null)throw n}}function uo(n,i,l,u){Qd=!1;var h=n.updateQueue;ri=!1;var g=h.firstBaseUpdate,j=h.lastBaseUpdate,_=h.shared.pending;if(_!==null){h.shared.pending=null;var D=_,F=D.next;D.next=null,j===null?g=F:j.next=F,j=D;var W=n.alternate;W!==null&&(W=W.updateQueue,_=W.lastBaseUpdate,_!==j&&(_===null?W.firstBaseUpdate=F:_.next=F,W.lastBaseUpdate=D))}if(g!==null){var ne=h.baseState;j=0,W=F=D=null,_=g;do{var V=_.lane&-536870913,Y=V!==_.lane;if(Y?(He&V)===V:(u&V)===V){V!==0&&V===Qa&&(Qd=!0),W!==null&&(W=W.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ve=n,Ce=_;V=i;var ct=l;switch(Ce.tag){case 1:if(ve=Ce.payload,typeof ve=="function"){ne=ve.call(ct,ne,V);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Ce.payload,V=typeof ve=="function"?ve.call(ct,ne,V):ve,V==null)break e;ne=y({},ne,V);break e;case 2:ri=!0}}V=_.callback,V!==null&&(n.flags|=64,Y&&(n.flags|=8192),Y=h.callbacks,Y===null?h.callbacks=[V]:Y.push(V))}else Y={lane:V,tag:_.tag,payload:_.payload,callback:_.callback,next:null},W===null?(F=W=Y,D=ne):W=W.next=Y,j|=V;if(_=_.next,_===null){if(_=h.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,h.lastBaseUpdate=Y,h.shared.pending=null}}while(!0);W===null&&(D=ne),h.baseState=D,h.firstBaseUpdate=F,h.lastBaseUpdate=W,g===null&&(h.shared.lanes=0),hi|=j,n.lanes=j,n.memoizedState=ne}}function ny(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function sy(n,i){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)ny(l[n],i)}var Wa=O(null),Gl=O(0);function iy(n,i){n=Ps,ie(Gl,n),ie(Wa,i),Ps=n|i.baseLanes}function Yd(){ie(Gl,Ps),ie(Wa,Wa.current)}function Jd(){Ps=Gl.current,Z(Wa),Z(Gl)}var zn=O(null),In=null;function ci(n){var i=n.alternate;ie(Rt,Rt.current&1),ie(zn,n),In===null&&(i===null||Wa.current!==null||i.memoizedState!==null)&&(In=n)}function Xd(n){ie(Rt,Rt.current),ie(zn,n),In===null&&(In=n)}function ay(n){n.tag===22?(ie(Rt,Rt.current),ie(zn,n),In===null&&(In=n)):ui()}function ui(){ie(Rt,Rt.current),ie(zn,zn.current)}function En(n){Z(zn),In===n&&(In=null),Z(Rt)}var Rt=O(0);function Fl(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||ah(l)||rh(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var As=0,Ae=null,ot=null,$t=null,Zl=!1,er=!1,aa=!1,Kl=0,fo=0,tr=null,iC=0;function Nt(){throw Error(a(321))}function Wd(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!kn(n[l],i[l]))return!1;return!0}function ef(n,i,l,u,h,g){return As=g,Ae=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,B.H=n===null||n.memoizedState===null?qy:gf,aa=!1,g=l(u,h),aa=!1,er&&(g=oy(i,l,u,h)),ry(n),g}function ry(n){B.H=po;var i=ot!==null&&ot.next!==null;if(As=0,$t=ot=Ae=null,Zl=!1,fo=0,tr=null,i)throw Error(a(300));n===null||Pt||(n=n.dependencies,n!==null&&Ul(n)&&(Pt=!0))}function oy(n,i,l,u){Ae=n;var h=0;do{if(er&&(tr=null),fo=0,er=!1,25<=h)throw Error(a(301));if(h+=1,$t=ot=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}B.H=Hy,g=i(l,u)}while(er);return g}function aC(){var n=B.H,i=n.useState()[0];return i=typeof i.then=="function"?ho(i):i,n=n.useState()[0],(ot!==null?ot.memoizedState:null)!==n&&(Ae.flags|=1024),i}function tf(){var n=Kl!==0;return Kl=0,n}function nf(n,i,l){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~l}function sf(n){if(Zl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Zl=!1}As=0,$t=ot=Ae=null,er=!1,fo=Kl=0,tr=null}function ln(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Ae.memoizedState=$t=n:$t=$t.next=n,$t}function At(){if(ot===null){var n=Ae.alternate;n=n!==null?n.memoizedState:null}else n=ot.next;var i=$t===null?Ae.memoizedState:$t.next;if(i!==null)$t=i,ot=n;else{if(n===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));ot=n,n={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},$t===null?Ae.memoizedState=$t=n:$t=$t.next=n}return $t}function Vl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ho(n){var i=fo;return fo+=1,tr===null&&(tr=[]),n=Jg(tr,n,i),i=Ae,($t===null?i.memoizedState:$t.next)===null&&(i=i.alternate,B.H=i===null||i.memoizedState===null?qy:gf),n}function Ql(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return ho(n);if(n.$$typeof===R)return Jt(n)}throw Error(a(438,String(n)))}function af(n){var i=null,l=Ae.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var u=Ae.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Vl(),Ae.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(n),u=0;u<n;u++)l[u]=J;return i.index++,l}function Ts(n,i){return typeof i=="function"?i(n):i}function Yl(n){var i=At();return rf(i,ot,n)}function rf(n,i,l){var u=n.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=l;var h=n.baseQueue,g=u.pending;if(g!==null){if(h!==null){var j=h.next;h.next=g.next,g.next=j}i.baseQueue=h=g,u.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var _=j=null,D=null,F=i,W=!1;do{var ne=F.lane&-536870913;if(ne!==F.lane?(He&ne)===ne:(As&ne)===ne){var V=F.revertLane;if(V===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ne===Qa&&(W=!0);else if((As&V)===V){F=F.next,V===Qa&&(W=!0);continue}else ne={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=ne,j=g):D=D.next=ne,Ae.lanes|=V,hi|=V;ne=F.action,aa&&l(g,ne),g=F.hasEagerState?F.eagerState:l(g,ne)}else V={lane:ne,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=V,j=g):D=D.next=V,Ae.lanes|=ne,hi|=ne;F=F.next}while(F!==null&&F!==i);if(D===null?j=g:D.next=_,!kn(g,n.memoizedState)&&(Pt=!0,W&&(l=Ya,l!==null)))throw l;n.memoizedState=g,n.baseState=j,n.baseQueue=D,u.lastRenderedState=g}return h===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function of(n){var i=At(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=n;var u=l.dispatch,h=l.pending,g=i.memoizedState;if(h!==null){l.pending=null;var j=h=h.next;do g=n(g,j.action),j=j.next;while(j!==h);kn(g,i.memoizedState)||(Pt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,u]}function ly(n,i,l){var u=Ae,h=At(),g=Fe;if(g){if(l===void 0)throw Error(a(407));l=l()}else l=i();var j=!kn((ot||h).memoizedState,l);if(j&&(h.memoizedState=l,Pt=!0),h=h.queue,uf(dy.bind(null,u,h,n),[n]),h.getSnapshot!==i||j||$t!==null&&$t.memoizedState.tag&1){if(u.flags|=2048,nr(9,{destroy:void 0},uy.bind(null,u,h,l,i),null),ut===null)throw Error(a(349));g||(As&127)!==0||cy(u,i,l)}return l}function cy(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=Ae.updateQueue,i===null?(i=Vl(),Ae.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function uy(n,i,l,u){i.value=l,i.getSnapshot=u,fy(i)&&hy(n)}function dy(n,i,l){return l(function(){fy(i)&&hy(n)})}function fy(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!kn(n,l)}catch{return!0}}function hy(n){var i=Yi(n,2);i!==null&&bn(i,n,2)}function lf(n){var i=ln();if(typeof n=="function"){var l=n;if(n=l(),aa){Ht(!0);try{l()}finally{Ht(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:n},i}function my(n,i,l,u){return n.baseState=l,rf(n,ot,typeof u=="function"?u:Ts)}function rC(n,i,l,u,h){if(Wl(n))throw Error(a(485));if(n=i.action,n!==null){var g={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){g.listeners.push(j)}};B.T!==null?l(!0):g.isTransition=!1,u(g),l=i.pending,l===null?(g.next=i.pending=g,py(i,g)):(g.next=l.next,i.pending=l.next=g)}}function py(n,i){var l=i.action,u=i.payload,h=n.state;if(i.isTransition){var g=B.T,j={};B.T=j;try{var _=l(h,u),D=B.S;D!==null&&D(j,_),gy(n,i,_)}catch(F){cf(n,i,F)}finally{g!==null&&j.types!==null&&(g.types=j.types),B.T=g}}else try{g=l(h,u),gy(n,i,g)}catch(F){cf(n,i,F)}}function gy(n,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){yy(n,i,u)},function(u){return cf(n,i,u)}):yy(n,i,l)}function yy(n,i,l){i.status="fulfilled",i.value=l,vy(i),n.state=l,i=n.pending,i!==null&&(l=i.next,l===i?n.pending=null:(l=l.next,i.next=l,py(n,l)))}function cf(n,i,l){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=l,vy(i),i=i.next;while(i!==u)}n.action=null}function vy(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function xy(n,i){return i}function by(n,i){if(Fe){var l=ut.formState;if(l!==null){e:{var u=Ae;if(Fe){if(ht){t:{for(var h=ht,g=Pn;h.nodeType!==8;){if(!g){h=null;break t}if(h=Bn(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){ht=Bn(h.nextSibling),u=h.data==="F!";break e}}ii(u)}u=!1}u&&(i=l[0])}}return l=ln(),l.memoizedState=l.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xy,lastRenderedState:i},l.queue=u,l=Py.bind(null,Ae,u),u.dispatch=l,u=lf(!1),g=pf.bind(null,Ae,!1,u.queue),u=ln(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,l=rC.bind(null,Ae,h,g,l),h.dispatch=l,u.memoizedState=n,[i,l,!1]}function Sy(n){var i=At();return jy(i,ot,n)}function jy(n,i,l){if(i=rf(n,i,xy)[0],n=Yl(Ts)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=ho(i)}catch(j){throw j===Ja?Il:j}else u=i;i=At();var h=i.queue,g=h.dispatch;return l!==i.memoizedState&&(Ae.flags|=2048,nr(9,{destroy:void 0},oC.bind(null,h,l),null)),[u,g,n]}function oC(n,i){n.action=i}function wy(n){var i=At(),l=ot;if(l!==null)return jy(i,l,n);At(),i=i.memoizedState,l=At();var u=l.queue.dispatch;return l.memoizedState=n,[i,u,!1]}function nr(n,i,l,u){return n={tag:n,create:l,deps:u,inst:i,next:null},i=Ae.updateQueue,i===null&&(i=Vl(),Ae.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=n.next=n:(u=l.next,l.next=n,n.next=u,i.lastEffect=n),n}function Ny(){return At().memoizedState}function Jl(n,i,l,u){var h=ln();Ae.flags|=n,h.memoizedState=nr(1|i,{destroy:void 0},l,u===void 0?null:u)}function Xl(n,i,l,u){var h=At();u=u===void 0?null:u;var g=h.memoizedState.inst;ot!==null&&u!==null&&Wd(u,ot.memoizedState.deps)?h.memoizedState=nr(i,g,l,u):(Ae.flags|=n,h.memoizedState=nr(1|i,g,l,u))}function Cy(n,i){Jl(8390656,8,n,i)}function uf(n,i){Xl(2048,8,n,i)}function lC(n){Ae.flags|=4;var i=Ae.updateQueue;if(i===null)i=Vl(),Ae.updateQueue=i,i.events=[n];else{var l=i.events;l===null?i.events=[n]:l.push(n)}}function ky(n){var i=At().memoizedState;return lC({ref:i,nextImpl:n}),function(){if((Xe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function _y(n,i){return Xl(4,2,n,i)}function zy(n,i){return Xl(4,4,n,i)}function Ey(n,i){if(typeof i=="function"){n=n();var l=i(n);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Ry(n,i,l){l=l!=null?l.concat([n]):null,Xl(4,4,Ey.bind(null,i,n),l)}function df(){}function Ay(n,i){var l=At();i=i===void 0?null:i;var u=l.memoizedState;return i!==null&&Wd(i,u[1])?u[0]:(l.memoizedState=[n,i],n)}function Ty(n,i){var l=At();i=i===void 0?null:i;var u=l.memoizedState;if(i!==null&&Wd(i,u[1]))return u[0];if(u=n(),aa){Ht(!0);try{n()}finally{Ht(!1)}}return l.memoizedState=[u,i],u}function ff(n,i,l){return l===void 0||(As&1073741824)!==0&&(He&261930)===0?n.memoizedState=i:(n.memoizedState=l,n=O0(),Ae.lanes|=n,hi|=n,l)}function Oy(n,i,l,u){return kn(l,i)?l:Wa.current!==null?(n=ff(n,l,u),kn(n,i)||(Pt=!0),n):(As&42)===0||(As&1073741824)!==0&&(He&261930)===0?(Pt=!0,n.memoizedState=l):(n=O0(),Ae.lanes|=n,hi|=n,i)}function Dy(n,i,l,u,h){var g=G.p;G.p=g!==0&&8>g?g:8;var j=B.T,_={};B.T=_,pf(n,!1,i,l);try{var D=h(),F=B.S;if(F!==null&&F(_,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var W=sC(D,u);mo(n,i,W,Tn(n))}else mo(n,i,u,Tn(n))}catch(ne){mo(n,i,{then:function(){},status:"rejected",reason:ne},Tn())}finally{G.p=g,j!==null&&_.types!==null&&(j.types=_.types),B.T=j}}function cC(){}function hf(n,i,l,u){if(n.tag!==5)throw Error(a(476));var h=Ly(n).queue;Dy(n,h,i,oe,l===null?cC:function(){return My(n),l(u)})}function Ly(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:oe},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:l},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function My(n){var i=Ly(n);i.next===null&&(i=n.alternate.memoizedState),mo(n,i.next.queue,{},Tn())}function mf(){return Jt(Ao)}function Uy(){return At().memoizedState}function $y(){return At().memoizedState}function uC(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var l=Tn();n=oi(l);var u=li(i,n,l);u!==null&&(bn(u,i,l),lo(u,i,l)),i={cache:qd()},n.payload=i;return}i=i.return}}function dC(n,i,l){var u=Tn();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Wl(n)?Iy(i,l):(l=Ad(n,i,l,u),l!==null&&(bn(l,n,u),By(l,i,u)))}function Py(n,i,l){var u=Tn();mo(n,i,l,u)}function mo(n,i,l,u){var h={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Wl(n))Iy(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var j=i.lastRenderedState,_=g(j,l);if(h.hasEagerState=!0,h.eagerState=_,kn(_,j))return Ol(n,i,h,0),ut===null&&Tl(),!1}catch{}if(l=Ad(n,i,h,u),l!==null)return bn(l,n,u),By(l,i,u),!0}return!1}function pf(n,i,l,u){if(u={lane:2,revertLane:Kf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Wl(n)){if(i)throw Error(a(479))}else i=Ad(n,l,u,2),i!==null&&bn(i,n,2)}function Wl(n){var i=n.alternate;return n===Ae||i!==null&&i===Ae}function Iy(n,i){er=Zl=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function By(n,i,l){if((l&4194048)!==0){var u=i.lanes;u&=n.pendingLanes,l|=u,i.lanes=l,bl(n,l)}}var po={readContext:Jt,use:Ql,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};po.useEffectEvent=Nt;var qy={readContext:Jt,use:Ql,useCallback:function(n,i){return ln().memoizedState=[n,i===void 0?null:i],n},useContext:Jt,useEffect:Cy,useImperativeHandle:function(n,i,l){l=l!=null?l.concat([n]):null,Jl(4194308,4,Ey.bind(null,i,n),l)},useLayoutEffect:function(n,i){return Jl(4194308,4,n,i)},useInsertionEffect:function(n,i){Jl(4,2,n,i)},useMemo:function(n,i){var l=ln();i=i===void 0?null:i;var u=n();if(aa){Ht(!0);try{n()}finally{Ht(!1)}}return l.memoizedState=[u,i],u},useReducer:function(n,i,l){var u=ln();if(l!==void 0){var h=l(i);if(aa){Ht(!0);try{l(i)}finally{Ht(!1)}}}else h=i;return u.memoizedState=u.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},u.queue=n,n=n.dispatch=dC.bind(null,Ae,n),[u.memoizedState,n]},useRef:function(n){var i=ln();return n={current:n},i.memoizedState=n},useState:function(n){n=lf(n);var i=n.queue,l=Py.bind(null,Ae,i);return i.dispatch=l,[n.memoizedState,l]},useDebugValue:df,useDeferredValue:function(n,i){var l=ln();return ff(l,n,i)},useTransition:function(){var n=lf(!1);return n=Dy.bind(null,Ae,n.queue,!0,!1),ln().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,l){var u=Ae,h=ln();if(Fe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),ut===null)throw Error(a(349));(He&127)!==0||cy(u,i,l)}h.memoizedState=l;var g={value:l,getSnapshot:i};return h.queue=g,Cy(dy.bind(null,u,g,n),[n]),u.flags|=2048,nr(9,{destroy:void 0},uy.bind(null,u,g,l,i),null),l},useId:function(){var n=ln(),i=ut.identifierPrefix;if(Fe){var l=ms,u=hs;l=(u&~(1<<32-Ve(u)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Kl++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=iC++,i="_"+i+"r_"+l.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:mf,useFormState:by,useActionState:by,useOptimistic:function(n){var i=ln();i.memoizedState=i.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=pf.bind(null,Ae,!0,l),l.dispatch=i,[n,i]},useMemoCache:af,useCacheRefresh:function(){return ln().memoizedState=uC.bind(null,Ae)},useEffectEvent:function(n){var i=ln(),l={impl:n};return i.memoizedState=l,function(){if((Xe&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},gf={readContext:Jt,use:Ql,useCallback:Ay,useContext:Jt,useEffect:uf,useImperativeHandle:Ry,useInsertionEffect:_y,useLayoutEffect:zy,useMemo:Ty,useReducer:Yl,useRef:Ny,useState:function(){return Yl(Ts)},useDebugValue:df,useDeferredValue:function(n,i){var l=At();return Oy(l,ot.memoizedState,n,i)},useTransition:function(){var n=Yl(Ts)[0],i=At().memoizedState;return[typeof n=="boolean"?n:ho(n),i]},useSyncExternalStore:ly,useId:Uy,useHostTransitionStatus:mf,useFormState:Sy,useActionState:Sy,useOptimistic:function(n,i){var l=At();return my(l,ot,n,i)},useMemoCache:af,useCacheRefresh:$y};gf.useEffectEvent=ky;var Hy={readContext:Jt,use:Ql,useCallback:Ay,useContext:Jt,useEffect:uf,useImperativeHandle:Ry,useInsertionEffect:_y,useLayoutEffect:zy,useMemo:Ty,useReducer:of,useRef:Ny,useState:function(){return of(Ts)},useDebugValue:df,useDeferredValue:function(n,i){var l=At();return ot===null?ff(l,n,i):Oy(l,ot.memoizedState,n,i)},useTransition:function(){var n=of(Ts)[0],i=At().memoizedState;return[typeof n=="boolean"?n:ho(n),i]},useSyncExternalStore:ly,useId:Uy,useHostTransitionStatus:mf,useFormState:wy,useActionState:wy,useOptimistic:function(n,i){var l=At();return ot!==null?my(l,ot,n,i):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:af,useCacheRefresh:$y};Hy.useEffectEvent=ky;function yf(n,i,l,u){i=n.memoizedState,l=l(u,i),l=l==null?i:y({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var vf={enqueueSetState:function(n,i,l){n=n._reactInternals;var u=Tn(),h=oi(u);h.payload=i,l!=null&&(h.callback=l),i=li(n,h,u),i!==null&&(bn(i,n,u),lo(i,n,u))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var u=Tn(),h=oi(u);h.tag=1,h.payload=i,l!=null&&(h.callback=l),i=li(n,h,u),i!==null&&(bn(i,n,u),lo(i,n,u))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=Tn(),u=oi(l);u.tag=2,i!=null&&(u.callback=i),i=li(n,u,l),i!==null&&(bn(i,n,l),lo(i,n,l))}};function Gy(n,i,l,u,h,g,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,g,j):i.prototype&&i.prototype.isPureReactComponent?!eo(l,u)||!eo(h,g):!0}function Fy(n,i,l,u){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,u),i.state!==n&&vf.enqueueReplaceState(i,i.state,null)}function ra(n,i){var l=i;if("ref"in i){l={};for(var u in i)u!=="ref"&&(l[u]=i[u])}if(n=n.defaultProps){l===i&&(l=y({},l));for(var h in n)l[h]===void 0&&(l[h]=n[h])}return l}function Zy(n){Al(n)}function Ky(n){console.error(n)}function Vy(n){Al(n)}function ec(n,i){try{var l=n.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function Qy(n,i,l){try{var u=n.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function xf(n,i,l){return l=oi(l),l.tag=3,l.payload={element:null},l.callback=function(){ec(n,i)},l}function Yy(n){return n=oi(n),n.tag=3,n}function Jy(n,i,l,u){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var g=u.value;n.payload=function(){return h(g)},n.callback=function(){Qy(i,l,u)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){Qy(i,l,u),typeof h!="function"&&(mi===null?mi=new Set([this]):mi.add(this));var _=u.stack;this.componentDidCatch(u.value,{componentStack:_!==null?_:""})})}function fC(n,i,l,u,h){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=l.alternate,i!==null&&Va(i,l,h,!0),l=zn.current,l!==null){switch(l.tag){case 31:case 13:return In===null?fc():l.alternate===null&&Ct===0&&(Ct=3),l.flags&=-257,l.flags|=65536,l.lanes=h,u===Bl?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([u]):i.add(u),Gf(n,u,h)),!1;case 22:return l.flags|=65536,u===Bl?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([u]):l.add(u)),Gf(n,u,h)),!1}throw Error(a(435,l.tag))}return Gf(n,u,h),fc(),!1}if(Fe)return i=zn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,u!==Ud&&(n=Error(a(422),{cause:u}),so(Mn(n,l)))):(u!==Ud&&(i=Error(a(423),{cause:u}),so(Mn(i,l))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,u=Mn(u,l),h=xf(n.stateNode,u,h),Vd(n,h),Ct!==4&&(Ct=2)),!1;var g=Error(a(520),{cause:u});if(g=Mn(g,l),wo===null?wo=[g]:wo.push(g),Ct!==4&&(Ct=2),i===null)return!0;u=Mn(u,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,n=h&-h,l.lanes|=n,n=xf(l.stateNode,u,n),Vd(l,n),!1;case 1:if(i=l.type,g=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(mi===null||!mi.has(g))))return l.flags|=65536,h&=-h,l.lanes|=h,h=Yy(h),Jy(h,n,l,u),Vd(l,h),!1}l=l.return}while(l!==null);return!1}var bf=Error(a(461)),Pt=!1;function Xt(n,i,l,u){i.child=n===null?ty(i,null,l,u):ia(i,n.child,l,u)}function Xy(n,i,l,u,h){l=l.render;var g=i.ref;if("ref"in u){var j={};for(var _ in u)_!=="ref"&&(j[_]=u[_])}else j=u;return ea(i),u=ef(n,i,l,j,g,h),_=tf(),n!==null&&!Pt?(nf(n,i,h),Os(n,i,h)):(Fe&&_&&Ld(i),i.flags|=1,Xt(n,i,u,h),i.child)}function Wy(n,i,l,u,h){if(n===null){var g=l.type;return typeof g=="function"&&!Td(g)&&g.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=g,e0(n,i,g,u,h)):(n=Ll(l.type,null,u,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!zf(n,h)){var j=g.memoizedProps;if(l=l.compare,l=l!==null?l:eo,l(j,u)&&n.ref===i.ref)return Os(n,i,h)}return i.flags|=1,n=_s(g,u),n.ref=i.ref,n.return=i,i.child=n}function e0(n,i,l,u,h){if(n!==null){var g=n.memoizedProps;if(eo(g,u)&&n.ref===i.ref)if(Pt=!1,i.pendingProps=u=g,zf(n,h))(n.flags&131072)!==0&&(Pt=!0);else return i.lanes=n.lanes,Os(n,i,h)}return Sf(n,i,l,u,h)}function t0(n,i,l,u){var h=u.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|l:l,n!==null){for(u=i.child=n.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~g}else u=0,i.child=null;return n0(n,i,g,l,u)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Pl(i,g!==null?g.cachePool:null),g!==null?iy(i,g):Yd(),ay(i);else return u=i.lanes=536870912,n0(n,i,g!==null?g.baseLanes|l:l,l,u)}else g!==null?(Pl(i,g.cachePool),iy(i,g),ui(),i.memoizedState=null):(n!==null&&Pl(i,null),Yd(),ui());return Xt(n,i,h,l),i.child}function go(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function n0(n,i,l,u,h){var g=Gd();return g=g===null?null:{parent:Ut._currentValue,pool:g},i.memoizedState={baseLanes:l,cachePool:g},n!==null&&Pl(i,null),Yd(),ay(i),n!==null&&Va(n,i,u,!0),i.childLanes=h,null}function tc(n,i){return i=sc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function s0(n,i,l){return ia(i,n.child,null,l),n=tc(i,i.pendingProps),n.flags|=2,En(i),i.memoizedState=null,n}function hC(n,i,l){var u=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Fe){if(u.mode==="hidden")return n=tc(i,u),i.lanes=536870912,go(null,n);if(Xd(i),(n=ht)?(n=pv(n,Pn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ni!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},l=Ig(n),l.return=i,i.child=l,Yt=i,ht=null)):n=null,n===null)throw ii(i);return i.lanes=536870912,null}return tc(i,u)}var g=n.memoizedState;if(g!==null){var j=g.dehydrated;if(Xd(i),h)if(i.flags&256)i.flags&=-257,i=s0(n,i,l);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(Pt||Va(n,i,l,!1),h=(l&n.childLanes)!==0,Pt||h){if(u=ut,u!==null&&(j=Fr(u,l),j!==0&&j!==g.retryLane))throw g.retryLane=j,Yi(n,j),bn(u,n,j),bf;fc(),i=s0(n,i,l)}else n=g.treeContext,ht=Bn(j.nextSibling),Yt=i,Fe=!0,si=null,Pn=!1,n!==null&&Hg(i,n),i=tc(i,u),i.flags|=4096;return i}return n=_s(n.child,{mode:u.mode,children:u.children}),n.ref=i.ref,i.child=n,n.return=i,n}function nc(n,i){var l=i.ref;if(l===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(n===null||n.ref!==l)&&(i.flags|=4194816)}}function Sf(n,i,l,u,h){return ea(i),l=ef(n,i,l,u,void 0,h),u=tf(),n!==null&&!Pt?(nf(n,i,h),Os(n,i,h)):(Fe&&u&&Ld(i),i.flags|=1,Xt(n,i,l,h),i.child)}function i0(n,i,l,u,h,g){return ea(i),i.updateQueue=null,l=oy(i,u,l,h),ry(n),u=tf(),n!==null&&!Pt?(nf(n,i,g),Os(n,i,g)):(Fe&&u&&Ld(i),i.flags|=1,Xt(n,i,l,g),i.child)}function a0(n,i,l,u,h){if(ea(i),i.stateNode===null){var g=Ga,j=l.contextType;typeof j=="object"&&j!==null&&(g=Jt(j)),g=new l(u,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=vf,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=u,g.state=i.memoizedState,g.refs={},Zd(i),j=l.contextType,g.context=typeof j=="object"&&j!==null?Jt(j):Ga,g.state=i.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(yf(i,l,j,u),g.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(j=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),j!==g.state&&vf.enqueueReplaceState(g,g.state,null),uo(i,u,g,h),co(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(n===null){g=i.stateNode;var _=i.memoizedProps,D=ra(l,_);g.props=D;var F=g.context,W=l.contextType;j=Ga,typeof W=="object"&&W!==null&&(j=Jt(W));var ne=l.getDerivedStateFromProps;W=typeof ne=="function"||typeof g.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,W||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(_||F!==j)&&Fy(i,g,u,j),ri=!1;var V=i.memoizedState;g.state=V,uo(i,u,g,h),co(),F=i.memoizedState,_||V!==F||ri?(typeof ne=="function"&&(yf(i,l,ne,u),F=i.memoizedState),(D=ri||Gy(i,l,D,u,V,F,j))?(W||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(i.flags|=4194308)):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=u,i.memoizedState=F),g.props=u,g.state=F,g.context=j,u=D):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{g=i.stateNode,Kd(n,i),j=i.memoizedProps,W=ra(l,j),g.props=W,ne=i.pendingProps,V=g.context,F=l.contextType,D=Ga,typeof F=="object"&&F!==null&&(D=Jt(F)),_=l.getDerivedStateFromProps,(F=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(j!==ne||V!==D)&&Fy(i,g,u,D),ri=!1,V=i.memoizedState,g.state=V,uo(i,u,g,h),co();var Y=i.memoizedState;j!==ne||V!==Y||ri||n!==null&&n.dependencies!==null&&Ul(n.dependencies)?(typeof _=="function"&&(yf(i,l,_,u),Y=i.memoizedState),(W=ri||Gy(i,l,W,u,V,Y,D)||n!==null&&n.dependencies!==null&&Ul(n.dependencies))?(F||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,Y,D),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,Y,D)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=Y),g.props=u,g.state=Y,g.context=D,u=W):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=1024),u=!1)}return g=u,nc(n,i),u=(i.flags&128)!==0,g||u?(g=i.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&u?(i.child=ia(i,n.child,null,h),i.child=ia(i,null,l,h)):Xt(n,i,l,h),i.memoizedState=g.state,n=i.child):n=Os(n,i,h),n}function r0(n,i,l,u){return Xi(),i.flags|=256,Xt(n,i,l,u),i.child}var jf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wf(n){return{baseLanes:n,cachePool:Qg()}}function Nf(n,i,l){return n=n!==null?n.childLanes&~l:0,i&&(n|=An),n}function o0(n,i,l){var u=i.pendingProps,h=!1,g=(i.flags&128)!==0,j;if((j=g)||(j=n!==null&&n.memoizedState===null?!1:(Rt.current&2)!==0),j&&(h=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,n===null){if(Fe){if(h?ci(i):ui(),(n=ht)?(n=pv(n,Pn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ni!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},l=Ig(n),l.return=i,i.child=l,Yt=i,ht=null)):n=null,n===null)throw ii(i);return rh(n)?i.lanes=32:i.lanes=536870912,null}var _=u.children;return u=u.fallback,h?(ui(),h=i.mode,_=sc({mode:"hidden",children:_},h),u=Ji(u,h,l,null),_.return=i,u.return=i,_.sibling=u,i.child=_,u=i.child,u.memoizedState=wf(l),u.childLanes=Nf(n,j,l),i.memoizedState=jf,go(null,u)):(ci(i),Cf(i,_))}var D=n.memoizedState;if(D!==null&&(_=D.dehydrated,_!==null)){if(g)i.flags&256?(ci(i),i.flags&=-257,i=kf(n,i,l)):i.memoizedState!==null?(ui(),i.child=n.child,i.flags|=128,i=null):(ui(),_=u.fallback,h=i.mode,u=sc({mode:"visible",children:u.children},h),_=Ji(_,h,l,null),_.flags|=2,u.return=i,_.return=i,u.sibling=_,i.child=u,ia(i,n.child,null,l),u=i.child,u.memoizedState=wf(l),u.childLanes=Nf(n,j,l),i.memoizedState=jf,i=go(null,u));else if(ci(i),rh(_)){if(j=_.nextSibling&&_.nextSibling.dataset,j)var F=j.dgst;j=F,u=Error(a(419)),u.stack="",u.digest=j,so({value:u,source:null,stack:null}),i=kf(n,i,l)}else if(Pt||Va(n,i,l,!1),j=(l&n.childLanes)!==0,Pt||j){if(j=ut,j!==null&&(u=Fr(j,l),u!==0&&u!==D.retryLane))throw D.retryLane=u,Yi(n,u),bn(j,n,u),bf;ah(_)||fc(),i=kf(n,i,l)}else ah(_)?(i.flags|=192,i.child=n.child,i=null):(n=D.treeContext,ht=Bn(_.nextSibling),Yt=i,Fe=!0,si=null,Pn=!1,n!==null&&Hg(i,n),i=Cf(i,u.children),i.flags|=4096);return i}return h?(ui(),_=u.fallback,h=i.mode,D=n.child,F=D.sibling,u=_s(D,{mode:"hidden",children:u.children}),u.subtreeFlags=D.subtreeFlags&65011712,F!==null?_=_s(F,_):(_=Ji(_,h,l,null),_.flags|=2),_.return=i,u.return=i,u.sibling=_,i.child=u,go(null,u),u=i.child,_=n.child.memoizedState,_===null?_=wf(l):(h=_.cachePool,h!==null?(D=Ut._currentValue,h=h.parent!==D?{parent:D,pool:D}:h):h=Qg(),_={baseLanes:_.baseLanes|l,cachePool:h}),u.memoizedState=_,u.childLanes=Nf(n,j,l),i.memoizedState=jf,go(n.child,u)):(ci(i),l=n.child,n=l.sibling,l=_s(l,{mode:"visible",children:u.children}),l.return=i,l.sibling=null,n!==null&&(j=i.deletions,j===null?(i.deletions=[n],i.flags|=16):j.push(n)),i.child=l,i.memoizedState=null,l)}function Cf(n,i){return i=sc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function sc(n,i){return n=_n(22,n,null,i),n.lanes=0,n}function kf(n,i,l){return ia(i,n.child,null,l),n=Cf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function l0(n,i,l){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i),Id(n.return,i,l)}function _f(n,i,l,u,h,g){var j=n.memoizedState;j===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:h,treeForkCount:g}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=u,j.tail=l,j.tailMode=h,j.treeForkCount=g)}function c0(n,i,l){var u=i.pendingProps,h=u.revealOrder,g=u.tail;u=u.children;var j=Rt.current,_=(j&2)!==0;if(_?(j=j&1|2,i.flags|=128):j&=1,ie(Rt,j),Xt(n,i,u,l),u=Fe?no:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&l0(n,l,i);else if(n.tag===19)l0(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(l=i.child,h=null;l!==null;)n=l.alternate,n!==null&&Fl(n)===null&&(h=l),l=l.sibling;l=h,l===null?(h=i.child,i.child=null):(h=l.sibling,l.sibling=null),_f(i,!1,h,l,g,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=i.child,i.child=null;h!==null;){if(n=h.alternate,n!==null&&Fl(n)===null){i.child=h;break}n=h.sibling,h.sibling=l,l=h,h=n}_f(i,!0,l,null,g,u);break;case"together":_f(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Os(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),hi|=i.lanes,(l&i.childLanes)===0)if(n!==null){if(Va(n,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,l=_s(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=_s(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function zf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Ul(n)))}function mC(n,i,l){switch(i.tag){case 3:Me(i,i.stateNode.containerInfo),ai(i,Ut,n.memoizedState.cache),Xi();break;case 27:case 5:Ke(i);break;case 4:Me(i,i.stateNode.containerInfo);break;case 10:ai(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Xd(i),null;break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(ci(i),i.flags|=128,null):(l&i.child.childLanes)!==0?o0(n,i,l):(ci(i),n=Os(n,i,l),n!==null?n.sibling:null);ci(i);break;case 19:var h=(n.flags&128)!==0;if(u=(l&i.childLanes)!==0,u||(Va(n,i,l,!1),u=(l&i.childLanes)!==0),h){if(u)return c0(n,i,l);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ie(Rt,Rt.current),u)break;return null;case 22:return i.lanes=0,t0(n,i,l,i.pendingProps);case 24:ai(i,Ut,n.memoizedState.cache)}return Os(n,i,l)}function u0(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps)Pt=!0;else{if(!zf(n,l)&&(i.flags&128)===0)return Pt=!1,mC(n,i,l);Pt=(n.flags&131072)!==0}else Pt=!1,Fe&&(i.flags&1048576)!==0&&qg(i,no,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(n=na(i.elementType),i.type=n,typeof n=="function")Td(n)?(u=ra(n,u),i.tag=1,i=a0(null,i,n,u,l)):(i.tag=0,i=Sf(null,i,n,u,l));else{if(n!=null){var h=n.$$typeof;if(h===z){i.tag=11,i=Xy(null,i,n,u,l);break e}else if(h===A){i.tag=14,i=Wy(null,i,n,u,l);break e}}throw i=ke(n)||n,Error(a(306,i,""))}}return i;case 0:return Sf(n,i,i.type,i.pendingProps,l);case 1:return u=i.type,h=ra(u,i.pendingProps),a0(n,i,u,h,l);case 3:e:{if(Me(i,i.stateNode.containerInfo),n===null)throw Error(a(387));u=i.pendingProps;var g=i.memoizedState;h=g.element,Kd(n,i),uo(i,u,null,l);var j=i.memoizedState;if(u=j.cache,ai(i,Ut,u),u!==g.cache&&Bd(i,[Ut],l,!0),co(),u=j.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=r0(n,i,u,l);break e}else if(u!==h){h=Mn(Error(a(424)),i),so(h),i=r0(n,i,u,l);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,ht=Bn(n.firstChild),Yt=i,Fe=!0,si=null,Pn=!0,l=ty(i,null,u,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Xi(),u===h){i=Os(n,i,l);break e}Xt(n,i,u,l)}i=i.child}return i;case 26:return nc(n,i),n===null?(l=Sv(i.type,null,i.pendingProps,null))?i.memoizedState=l:Fe||(l=i.type,n=i.pendingProps,u=xc(he.current).createElement(l),u[Et]=i,u[wt]=n,Wt(u,l,n),Mt(u),i.stateNode=u):i.memoizedState=Sv(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ke(i),n===null&&Fe&&(u=i.stateNode=vv(i.type,i.pendingProps,he.current),Yt=i,Pn=!0,h=ht,vi(i.type)?(oh=h,ht=Bn(u.firstChild)):ht=h),Xt(n,i,i.pendingProps.children,l),nc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Fe&&((h=u=ht)&&(u=GC(u,i.type,i.pendingProps,Pn),u!==null?(i.stateNode=u,Yt=i,ht=Bn(u.firstChild),Pn=!1,h=!0):h=!1),h||ii(i)),Ke(i),h=i.type,g=i.pendingProps,j=n!==null?n.memoizedProps:null,u=g.children,nh(h,g)?u=null:j!==null&&nh(h,j)&&(i.flags|=32),i.memoizedState!==null&&(h=ef(n,i,aC,null,null,l),Ao._currentValue=h),nc(n,i),Xt(n,i,u,l),i.child;case 6:return n===null&&Fe&&((n=l=ht)&&(l=FC(l,i.pendingProps,Pn),l!==null?(i.stateNode=l,Yt=i,ht=null,n=!0):n=!1),n||ii(i)),null;case 13:return o0(n,i,l);case 4:return Me(i,i.stateNode.containerInfo),u=i.pendingProps,n===null?i.child=ia(i,null,u,l):Xt(n,i,u,l),i.child;case 11:return Xy(n,i,i.type,i.pendingProps,l);case 7:return Xt(n,i,i.pendingProps,l),i.child;case 8:return Xt(n,i,i.pendingProps.children,l),i.child;case 12:return Xt(n,i,i.pendingProps.children,l),i.child;case 10:return u=i.pendingProps,ai(i,i.type,u.value),Xt(n,i,u.children,l),i.child;case 9:return h=i.type._context,u=i.pendingProps.children,ea(i),h=Jt(h),u=u(h),i.flags|=1,Xt(n,i,u,l),i.child;case 14:return Wy(n,i,i.type,i.pendingProps,l);case 15:return e0(n,i,i.type,i.pendingProps,l);case 19:return c0(n,i,l);case 31:return hC(n,i,l);case 22:return t0(n,i,l,i.pendingProps);case 24:return ea(i),u=Jt(Ut),n===null?(h=Gd(),h===null&&(h=ut,g=qd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=l),h=g),i.memoizedState={parent:u,cache:h},Zd(i),ai(i,Ut,h)):((n.lanes&l)!==0&&(Kd(n,i),uo(i,null,null,l),co()),h=n.memoizedState,g=i.memoizedState,h.parent!==u?(h={parent:u,cache:u},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),ai(i,Ut,u)):(u=g.cache,ai(i,Ut,u),u!==h.cache&&Bd(i,[Ut],l,!0))),Xt(n,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ds(n){n.flags|=4}function Ef(n,i,l,u,h){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if(U0())n.flags|=8192;else throw sa=Bl,Fd}else n.flags&=-16777217}function d0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!kv(i))if(U0())n.flags|=8192;else throw sa=Bl,Fd}function ic(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?vl():536870912,n.lanes|=i,rr|=i)}function yo(n,i){if(!Fe)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function mt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,u=0;if(i)for(var h=n.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=u,n.childLanes=l,i}function pC(n,i,l){var u=i.pendingProps;switch(Md(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(i),null;case 1:return mt(i),null;case 3:return l=i.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Rs(Ut),ge(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(Ka(i)?Ds(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,$d())),mt(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?(Ds(i),g!==null?(mt(i),d0(i,g)):(mt(i),Ef(i,h,null,u,l))):g?g!==n.memoizedState?(Ds(i),mt(i),d0(i,g)):(mt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&Ds(i),mt(i),Ef(i,h,n,u,l)),null;case 27:if(it(i),l=he.current,h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ds(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return mt(i),null}n=re.current,Ka(i)?Gg(i):(n=vv(h,u,l),i.stateNode=n,Ds(i))}return mt(i),null;case 5:if(it(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ds(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return mt(i),null}if(g=re.current,Ka(i))Gg(i);else{var j=xc(he.current);switch(g){case 1:g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=j.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?j.createElement("select",{is:u.is}):j.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?j.createElement(h,{is:u.is}):j.createElement(h)}}g[Et]=i,g[wt]=u;e:for(j=i.child;j!==null;){if(j.tag===5||j.tag===6)g.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===i)break e;for(;j.sibling===null;){if(j.return===null||j.return===i)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}i.stateNode=g;e:switch(Wt(g,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Ds(i)}}return mt(i),Ef(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,l),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==u&&Ds(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(a(166));if(n=he.current,Ka(i)){if(n=i.stateNode,l=i.memoizedProps,u=null,h=Yt,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}n[Et]=i,n=!!(n.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||ov(n.nodeValue,l)),n||ii(i,!0)}else n=xc(n).createTextNode(u),n[Et]=i,i.stateNode=n}return mt(i),null;case 31:if(l=i.memoizedState,n===null||n.memoizedState!==null){if(u=Ka(i),l!==null){if(n===null){if(!u)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[Et]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),n=!1}else l=$d(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return i.flags&256?(En(i),i):(En(i),null);if((i.flags&128)!==0)throw Error(a(558))}return mt(i),null;case 13:if(u=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Ka(i),u!==null&&u.dehydrated!==null){if(n===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Et]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),h=!1}else h=$d(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(En(i),i):(En(i),null)}return En(i),(i.flags&128)!==0?(i.lanes=l,i):(l=u!==null,n=n!==null&&n.memoizedState!==null,l&&(u=i.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==h&&(u.flags|=2048)),l!==n&&l&&(i.child.flags|=8192),ic(i,i.updateQueue),mt(i),null);case 4:return ge(),n===null&&Jf(i.stateNode.containerInfo),mt(i),null;case 10:return Rs(i.type),mt(i),null;case 19:if(Z(Rt),u=i.memoizedState,u===null)return mt(i),null;if(h=(i.flags&128)!==0,g=u.rendering,g===null)if(h)yo(u,!1);else{if(Ct!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Fl(n),g!==null){for(i.flags|=128,yo(u,!1),n=g.updateQueue,i.updateQueue=n,ic(i,n),i.subtreeFlags=0,n=l,l=i.child;l!==null;)Pg(l,n),l=l.sibling;return ie(Rt,Rt.current&1|2),Fe&&zs(i,u.treeForkCount),i.child}n=n.sibling}u.tail!==null&&Be()>cc&&(i.flags|=128,h=!0,yo(u,!1),i.lanes=4194304)}else{if(!h)if(n=Fl(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,ic(i,n),yo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!Fe)return mt(i),null}else 2*Be()-u.renderingStartTime>cc&&l!==536870912&&(i.flags|=128,h=!0,yo(u,!1),i.lanes=4194304);u.isBackwards?(g.sibling=i.child,i.child=g):(n=u.last,n!==null?n.sibling=g:i.child=g,u.last=g)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=Be(),n.sibling=null,l=Rt.current,ie(Rt,h?l&1|2:l&1),Fe&&zs(i,u.treeForkCount),n):(mt(i),null);case 22:case 23:return En(i),Jd(),u=i.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(l&536870912)!==0&&(i.flags&128)===0&&(mt(i),i.subtreeFlags&6&&(i.flags|=8192)):mt(i),l=i.updateQueue,l!==null&&ic(i,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==l&&(i.flags|=2048),n!==null&&Z(ta),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Rs(Ut),mt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function gC(n,i){switch(Md(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Rs(Ut),ge(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return it(i),null;case 31:if(i.memoizedState!==null){if(En(i),i.alternate===null)throw Error(a(340));Xi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(En(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Xi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return Z(Rt),null;case 4:return ge(),null;case 10:return Rs(i.type),null;case 22:case 23:return En(i),Jd(),n!==null&&Z(ta),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Rs(Ut),null;case 25:return null;default:return null}}function f0(n,i){switch(Md(i),i.tag){case 3:Rs(Ut),ge();break;case 26:case 27:case 5:it(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&En(i);break;case 13:En(i);break;case 19:Z(Rt);break;case 10:Rs(i.type);break;case 22:case 23:En(i),Jd(),n!==null&&Z(ta);break;case 24:Rs(Ut)}}function vo(n,i){try{var l=i.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var h=u.next;l=h;do{if((l.tag&n)===n){u=void 0;var g=l.create,j=l.inst;u=g(),j.destroy=u}l=l.next}while(l!==h)}}catch(_){tt(i,i.return,_)}}function di(n,i,l){try{var u=i.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var g=h.next;u=g;do{if((u.tag&n)===n){var j=u.inst,_=j.destroy;if(_!==void 0){j.destroy=void 0,h=i;var D=l,F=_;try{F()}catch(W){tt(h,D,W)}}}u=u.next}while(u!==g)}}catch(W){tt(i,i.return,W)}}function h0(n){var i=n.updateQueue;if(i!==null){var l=n.stateNode;try{sy(i,l)}catch(u){tt(n,n.return,u)}}}function m0(n,i,l){l.props=ra(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(u){tt(n,i,u)}}function xo(n,i){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof l=="function"?n.refCleanup=l(u):l.current=u}}catch(h){tt(n,i,h)}}function ps(n,i){var l=n.ref,u=n.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(h){tt(n,i,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){tt(n,i,h)}else l.current=null}function p0(n){var i=n.type,l=n.memoizedProps,u=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(h){tt(n,n.return,h)}}function Rf(n,i,l){try{var u=n.stateNode;$C(u,n.type,l,i),u[wt]=i}catch(h){tt(n,n.return,h)}}function g0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&vi(n.type)||n.tag===4}function Af(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||g0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&vi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Tf(n,i,l){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(n),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=Cs));else if(u!==4&&(u===27&&vi(n.type)&&(l=n.stateNode,i=null),n=n.child,n!==null))for(Tf(n,i,l),n=n.sibling;n!==null;)Tf(n,i,l),n=n.sibling}function ac(n,i,l){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(u!==4&&(u===27&&vi(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(ac(n,i,l),n=n.sibling;n!==null;)ac(n,i,l),n=n.sibling}function y0(n){var i=n.stateNode,l=n.memoizedProps;try{for(var u=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);Wt(i,u,l),i[Et]=n,i[wt]=l}catch(g){tt(n,n.return,g)}}var Ls=!1,It=!1,Of=!1,v0=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function yC(n,i){if(n=n.containerInfo,eh=kc,n=Rg(n),Cd(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var h=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var j=0,_=-1,D=-1,F=0,W=0,ne=n,V=null;t:for(;;){for(var Y;ne!==l||h!==0&&ne.nodeType!==3||(_=j+h),ne!==g||u!==0&&ne.nodeType!==3||(D=j+u),ne.nodeType===3&&(j+=ne.nodeValue.length),(Y=ne.firstChild)!==null;)V=ne,ne=Y;for(;;){if(ne===n)break t;if(V===l&&++F===h&&(_=j),V===g&&++W===u&&(D=j),(Y=ne.nextSibling)!==null)break;ne=V,V=ne.parentNode}ne=Y}l=_===-1||D===-1?null:{start:_,end:D}}else l=null}l=l||{start:0,end:0}}else l=null;for(th={focusedElem:n,selectionRange:l},kc=!1,Kt=i;Kt!==null;)if(i=Kt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Kt=n;else for(;Kt!==null;){switch(i=Kt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)h=n[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,l=i,h=g.memoizedProps,g=g.memoizedState,u=l.stateNode;try{var ve=ra(l.type,h);n=u.getSnapshotBeforeUpdate(ve,g),u.__reactInternalSnapshotBeforeUpdate=n}catch(Ce){tt(l,l.return,Ce)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,l=n.nodeType,l===9)ih(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ih(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Kt=n;break}Kt=i.return}}function x0(n,i,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:Us(n,l),u&4&&vo(5,l);break;case 1:if(Us(n,l),u&4)if(n=l.stateNode,i===null)try{n.componentDidMount()}catch(j){tt(l,l.return,j)}else{var h=ra(l.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(j){tt(l,l.return,j)}}u&64&&h0(l),u&512&&xo(l,l.return);break;case 3:if(Us(n,l),u&64&&(n=l.updateQueue,n!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{sy(n,i)}catch(j){tt(l,l.return,j)}}break;case 27:i===null&&u&4&&y0(l);case 26:case 5:Us(n,l),i===null&&u&4&&p0(l),u&512&&xo(l,l.return);break;case 12:Us(n,l);break;case 31:Us(n,l),u&4&&j0(n,l);break;case 13:Us(n,l),u&4&&w0(n,l),u&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=kC.bind(null,l),ZC(n,l))));break;case 22:if(u=l.memoizedState!==null||Ls,!u){i=i!==null&&i.memoizedState!==null||It,h=Ls;var g=It;Ls=u,(It=i)&&!g?$s(n,l,(l.subtreeFlags&8772)!==0):Us(n,l),Ls=h,It=g}break;case 30:break;default:Us(n,l)}}function b0(n){var i=n.alternate;i!==null&&(n.alternate=null,b0(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Da(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var gt=null,gn=!1;function Ms(n,i,l){for(l=l.child;l!==null;)S0(n,i,l),l=l.sibling}function S0(n,i,l){if(_e&&typeof _e.onCommitFiberUnmount=="function")try{_e.onCommitFiberUnmount(ls,l)}catch{}switch(l.tag){case 26:It||ps(l,i),Ms(n,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:It||ps(l,i);var u=gt,h=gn;vi(l.type)&&(gt=l.stateNode,gn=!1),Ms(n,i,l),zo(l.stateNode),gt=u,gn=h;break;case 5:It||ps(l,i);case 6:if(u=gt,h=gn,gt=null,Ms(n,i,l),gt=u,gn=h,gt!==null)if(gn)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(l.stateNode)}catch(g){tt(l,i,g)}else try{gt.removeChild(l.stateNode)}catch(g){tt(l,i,g)}break;case 18:gt!==null&&(gn?(n=gt,hv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),mr(n)):hv(gt,l.stateNode));break;case 4:u=gt,h=gn,gt=l.stateNode.containerInfo,gn=!0,Ms(n,i,l),gt=u,gn=h;break;case 0:case 11:case 14:case 15:di(2,l,i),It||di(4,l,i),Ms(n,i,l);break;case 1:It||(ps(l,i),u=l.stateNode,typeof u.componentWillUnmount=="function"&&m0(l,i,u)),Ms(n,i,l);break;case 21:Ms(n,i,l);break;case 22:It=(u=It)||l.memoizedState!==null,Ms(n,i,l),It=u;break;default:Ms(n,i,l)}}function j0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{mr(n)}catch(l){tt(i,i.return,l)}}}function w0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{mr(n)}catch(l){tt(i,i.return,l)}}function vC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new v0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new v0),i;default:throw Error(a(435,n.tag))}}function rc(n,i){var l=vC(n);i.forEach(function(u){if(!l.has(u)){l.add(u);var h=_C.bind(null,n,u);u.then(h,h)}})}function yn(n,i){var l=i.deletions;if(l!==null)for(var u=0;u<l.length;u++){var h=l[u],g=n,j=i,_=j;e:for(;_!==null;){switch(_.tag){case 27:if(vi(_.type)){gt=_.stateNode,gn=!1;break e}break;case 5:gt=_.stateNode,gn=!1;break e;case 3:case 4:gt=_.stateNode.containerInfo,gn=!0;break e}_=_.return}if(gt===null)throw Error(a(160));S0(g,j,h),gt=null,gn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)N0(i,n),i=i.sibling}var es=null;function N0(n,i){var l=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:yn(i,n),vn(n),u&4&&(di(3,n,n.return),vo(3,n),di(5,n,n.return));break;case 1:yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),u&64&&Ls&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var h=es;if(yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),u&4){var g=l!==null?l.memoizedState:null;if(u=n.memoizedState,l===null)if(u===null)if(n.stateNode===null){e:{u=n.type,l=n.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ds]||g[Et]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(u),h.head.insertBefore(g,h.querySelector("head > title"))),Wt(g,u,l),g[Et]=n,Mt(g),u=g;break e;case"link":var j=Nv("link","href",h).get(u+(l.href||""));if(j){for(var _=0;_<j.length;_++)if(g=j[_],g.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&g.getAttribute("rel")===(l.rel==null?null:l.rel)&&g.getAttribute("title")===(l.title==null?null:l.title)&&g.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){j.splice(_,1);break t}}g=h.createElement(u),Wt(g,u,l),h.head.appendChild(g);break;case"meta":if(j=Nv("meta","content",h).get(u+(l.content||""))){for(_=0;_<j.length;_++)if(g=j[_],g.getAttribute("content")===(l.content==null?null:""+l.content)&&g.getAttribute("name")===(l.name==null?null:l.name)&&g.getAttribute("property")===(l.property==null?null:l.property)&&g.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&g.getAttribute("charset")===(l.charSet==null?null:l.charSet)){j.splice(_,1);break t}}g=h.createElement(u),Wt(g,u,l),h.head.appendChild(g);break;default:throw Error(a(468,u))}g[Et]=n,Mt(g),u=g}n.stateNode=u}else Cv(h,n.type,n.stateNode);else n.stateNode=wv(h,u,n.memoizedProps);else g!==u?(g===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):g.count--,u===null?Cv(h,n.type,n.stateNode):wv(h,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Rf(n,n.memoizedProps,l.memoizedProps)}break;case 27:yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),l!==null&&u&4&&Rf(n,n.memoizedProps,l.memoizedProps);break;case 5:if(yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),n.flags&32){h=n.stateNode;try{Ua(h,"")}catch(ve){tt(n,n.return,ve)}}u&4&&n.stateNode!=null&&(h=n.memoizedProps,Rf(n,h,l!==null?l.memoizedProps:h)),u&1024&&(Of=!0);break;case 6:if(yn(i,n),vn(n),u&4){if(n.stateNode===null)throw Error(a(162));u=n.memoizedProps,l=n.stateNode;try{l.nodeValue=u}catch(ve){tt(n,n.return,ve)}}break;case 3:if(jc=null,h=es,es=bc(i.containerInfo),yn(i,n),es=h,vn(n),u&4&&l!==null&&l.memoizedState.isDehydrated)try{mr(i.containerInfo)}catch(ve){tt(n,n.return,ve)}Of&&(Of=!1,C0(n));break;case 4:u=es,es=bc(n.stateNode.containerInfo),yn(i,n),vn(n),es=u;break;case 12:yn(i,n),vn(n);break;case 31:yn(i,n),vn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,rc(n,u)));break;case 13:yn(i,n),vn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(lc=Be()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,rc(n,u)));break;case 22:h=n.memoizedState!==null;var D=l!==null&&l.memoizedState!==null,F=Ls,W=It;if(Ls=F||h,It=W||D,yn(i,n),It=W,Ls=F,vn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(l===null||D||Ls||It||oa(n)),l=null,i=n;;){if(i.tag===5||i.tag===26){if(l===null){D=l=i;try{if(g=D.stateNode,h)j=g.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{_=D.stateNode;var ne=D.memoizedProps.style,V=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;_.style.display=V==null||typeof V=="boolean"?"":(""+V).trim()}}catch(ve){tt(D,D.return,ve)}}}else if(i.tag===6){if(l===null){D=i;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(ve){tt(D,D.return,ve)}}}else if(i.tag===18){if(l===null){D=i;try{var Y=D.stateNode;h?mv(Y,!0):mv(D.stateNode,!1)}catch(ve){tt(D,D.return,ve)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=n.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,rc(n,l))));break;case 19:yn(i,n),vn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,rc(n,u)));break;case 30:break;case 21:break;default:yn(i,n),vn(n)}}function vn(n){var i=n.flags;if(i&2){try{for(var l,u=n.return;u!==null;){if(g0(u)){l=u;break}u=u.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var h=l.stateNode,g=Af(n);ac(n,g,h);break;case 5:var j=l.stateNode;l.flags&32&&(Ua(j,""),l.flags&=-33);var _=Af(n);ac(n,_,j);break;case 3:case 4:var D=l.stateNode.containerInfo,F=Af(n);Tf(n,F,D);break;default:throw Error(a(161))}}catch(W){tt(n,n.return,W)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function C0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;C0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Us(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)x0(n,i.alternate,i),i=i.sibling}function oa(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:di(4,i,i.return),oa(i);break;case 1:ps(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&m0(i,i.return,l),oa(i);break;case 27:zo(i.stateNode);case 26:case 5:ps(i,i.return),oa(i);break;case 22:i.memoizedState===null&&oa(i);break;case 30:oa(i);break;default:oa(i)}n=n.sibling}}function $s(n,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,h=n,g=i,j=g.flags;switch(g.tag){case 0:case 11:case 15:$s(h,g,l),vo(4,g);break;case 1:if($s(h,g,l),u=g,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(F){tt(u,u.return,F)}if(u=g,h=u.updateQueue,h!==null){var _=u.stateNode;try{var D=h.shared.hiddenCallbacks;if(D!==null)for(h.shared.hiddenCallbacks=null,h=0;h<D.length;h++)ny(D[h],_)}catch(F){tt(u,u.return,F)}}l&&j&64&&h0(g),xo(g,g.return);break;case 27:y0(g);case 26:case 5:$s(h,g,l),l&&u===null&&j&4&&p0(g),xo(g,g.return);break;case 12:$s(h,g,l);break;case 31:$s(h,g,l),l&&j&4&&j0(h,g);break;case 13:$s(h,g,l),l&&j&4&&w0(h,g);break;case 22:g.memoizedState===null&&$s(h,g,l),xo(g,g.return);break;case 30:break;default:$s(h,g,l)}i=i.sibling}}function Df(n,i){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&io(l))}function Lf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&io(n))}function ts(n,i,l,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)k0(n,i,l,u),i=i.sibling}function k0(n,i,l,u){var h=i.flags;switch(i.tag){case 0:case 11:case 15:ts(n,i,l,u),h&2048&&vo(9,i);break;case 1:ts(n,i,l,u);break;case 3:ts(n,i,l,u),h&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&io(n)));break;case 12:if(h&2048){ts(n,i,l,u),n=i.stateNode;try{var g=i.memoizedProps,j=g.id,_=g.onPostCommit;typeof _=="function"&&_(j,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(D){tt(i,i.return,D)}}else ts(n,i,l,u);break;case 31:ts(n,i,l,u);break;case 13:ts(n,i,l,u);break;case 23:break;case 22:g=i.stateNode,j=i.alternate,i.memoizedState!==null?g._visibility&2?ts(n,i,l,u):bo(n,i):g._visibility&2?ts(n,i,l,u):(g._visibility|=2,sr(n,i,l,u,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Df(j,i);break;case 24:ts(n,i,l,u),h&2048&&Lf(i.alternate,i);break;default:ts(n,i,l,u)}}function sr(n,i,l,u,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,j=i,_=l,D=u,F=j.flags;switch(j.tag){case 0:case 11:case 15:sr(g,j,_,D,h),vo(8,j);break;case 23:break;case 22:var W=j.stateNode;j.memoizedState!==null?W._visibility&2?sr(g,j,_,D,h):bo(g,j):(W._visibility|=2,sr(g,j,_,D,h)),h&&F&2048&&Df(j.alternate,j);break;case 24:sr(g,j,_,D,h),h&&F&2048&&Lf(j.alternate,j);break;default:sr(g,j,_,D,h)}i=i.sibling}}function bo(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=n,u=i,h=u.flags;switch(u.tag){case 22:bo(l,u),h&2048&&Df(u.alternate,u);break;case 24:bo(l,u),h&2048&&Lf(u.alternate,u);break;default:bo(l,u)}i=i.sibling}}var So=8192;function ir(n,i,l){if(n.subtreeFlags&So)for(n=n.child;n!==null;)_0(n,i,l),n=n.sibling}function _0(n,i,l){switch(n.tag){case 26:ir(n,i,l),n.flags&So&&n.memoizedState!==null&&ik(l,es,n.memoizedState,n.memoizedProps);break;case 5:ir(n,i,l);break;case 3:case 4:var u=es;es=bc(n.stateNode.containerInfo),ir(n,i,l),es=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=So,So=16777216,ir(n,i,l),So=u):ir(n,i,l));break;default:ir(n,i,l)}}function z0(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function jo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var u=i[l];Kt=u,R0(u,n)}z0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)E0(n),n=n.sibling}function E0(n){switch(n.tag){case 0:case 11:case 15:jo(n),n.flags&2048&&di(9,n,n.return);break;case 3:jo(n);break;case 12:jo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,oc(n)):jo(n);break;default:jo(n)}}function oc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var u=i[l];Kt=u,R0(u,n)}z0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:di(8,i,i.return),oc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,oc(i));break;default:oc(i)}n=n.sibling}}function R0(n,i){for(;Kt!==null;){var l=Kt;switch(l.tag){case 0:case 11:case 15:di(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:io(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,Kt=u;else e:for(l=n;Kt!==null;){u=Kt;var h=u.sibling,g=u.return;if(b0(u),u===l){Kt=null;break e}if(h!==null){h.return=g,Kt=h;break e}Kt=g}}}var xC={getCacheForType:function(n){var i=Jt(Ut),l=i.data.get(n);return l===void 0&&(l=n(),i.data.set(n,l)),l},cacheSignal:function(){return Jt(Ut).controller.signal}},bC=typeof WeakMap=="function"?WeakMap:Map,Xe=0,ut=null,$e=null,He=0,et=0,Rn=null,fi=!1,ar=!1,Mf=!1,Ps=0,Ct=0,hi=0,la=0,Uf=0,An=0,rr=0,wo=null,xn=null,$f=!1,lc=0,A0=0,cc=1/0,uc=null,mi=null,Ft=0,pi=null,or=null,Is=0,Pf=0,If=null,T0=null,No=0,Bf=null;function Tn(){return(Xe&2)!==0&&He!==0?He&-He:B.T!==null?Kf():at()}function O0(){if(An===0)if((He&536870912)===0||Fe){var n=ws;ws<<=1,(ws&3932160)===0&&(ws=262144),An=n}else An=536870912;return n=zn.current,n!==null&&(n.flags|=32),An}function bn(n,i,l){(n===ut&&(et===2||et===9)||n.cancelPendingCommit!==null)&&(lr(n,0),gi(n,He,An,!1)),Zi(n,l),((Xe&2)===0||n!==ut)&&(n===ut&&((Xe&2)===0&&(la|=l),Ct===4&&gi(n,He,An,!1)),gs(n))}function D0(n,i,l){if((Xe&6)!==0)throw Error(a(327));var u=!l&&(i&127)===0&&(i&n.expiredLanes)===0||us(n,i),h=u?wC(n,i):Hf(n,i,!0),g=u;do{if(h===0){ar&&!u&&gi(n,i,0,!1);break}else{if(l=n.current.alternate,g&&!SC(l)){h=Hf(n,i,!1),g=!1;continue}if(h===2){if(g=i,n.errorRecoveryDisabledLanes&g)var j=0;else j=n.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var _=n;h=wo;var D=_.current.memoizedState.isDehydrated;if(D&&(lr(_,j).flags|=256),j=Hf(_,j,!1),j!==2){if(Mf&&!D){_.errorRecoveryDisabledLanes|=g,la|=g,h=4;break e}g=xn,xn=h,g!==null&&(xn===null?xn=g:xn.push.apply(xn,g))}h=j}if(g=!1,h!==2)continue}}if(h===1){lr(n,0),gi(n,i,0,!0);break}e:{switch(u=n,g=h,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:gi(u,i,An,!fi);break e;case 2:xn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=lc+300-Be(),10<h)){if(gi(u,i,An,!fi),Ta(u,0,!0)!==0)break e;Is=i,u.timeoutHandle=dv(L0.bind(null,u,l,xn,uc,$f,i,An,la,rr,fi,g,"Throttled",-0,0),h);break e}L0(u,l,xn,uc,$f,i,An,la,rr,fi,g,null,-0,0)}}break}while(!0);gs(n)}function L0(n,i,l,u,h,g,j,_,D,F,W,ne,V,Y){if(n.timeoutHandle=-1,ne=i.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Cs},_0(i,g,ne);var ve=(g&62914560)===g?lc-Be():(g&4194048)===g?A0-Be():0;if(ve=ak(ne,ve),ve!==null){Is=g,n.cancelPendingCommit=ve(H0.bind(null,n,i,g,l,u,h,j,_,D,W,ne,null,V,Y)),gi(n,g,j,!F);return}}H0(n,i,g,l,u,h,j,_,D)}function SC(n){for(var i=n;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var h=l[u],g=h.getSnapshot;h=h.value;try{if(!kn(g(),h))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function gi(n,i,l,u){i&=~Uf,i&=~la,n.suspendedLanes|=i,n.pingedLanes&=~i,u&&(n.warmLanes|=i),u=n.expirationTimes;for(var h=i;0<h;){var g=31-Ve(h),j=1<<g;u[g]=-1,h&=~j}l!==0&&xl(n,l,i)}function dc(){return(Xe&6)===0?(Co(0),!1):!0}function qf(){if($e!==null){if(et===0)var n=$e.return;else n=$e,Es=Wi=null,sf(n),Xa=null,ro=0,n=$e;for(;n!==null;)f0(n.alternate,n),n=n.return;$e=null}}function lr(n,i){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,BC(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Is=0,qf(),ut=n,$e=l=_s(n.current,null),He=i,et=0,Rn=null,fi=!1,ar=us(n,i),Mf=!1,rr=An=Uf=la=hi=Ct=0,xn=wo=null,$f=!1,(i&8)!==0&&(i|=i&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=i;0<u;){var h=31-Ve(u),g=1<<h;i|=n[h],u&=~g}return Ps=i,Tl(),l}function M0(n,i){Ae=null,B.H=po,i===Ja||i===Il?(i=Xg(),et=3):i===Fd?(i=Xg(),et=4):et=i===bf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Rn=i,$e===null&&(Ct=1,ec(n,Mn(i,n.current)))}function U0(){var n=zn.current;return n===null?!0:(He&4194048)===He?In===null:(He&62914560)===He||(He&536870912)!==0?n===In:!1}function $0(){var n=B.H;return B.H=po,n===null?po:n}function P0(){var n=B.A;return B.A=xC,n}function fc(){Ct=4,fi||(He&4194048)!==He&&zn.current!==null||(ar=!0),(hi&134217727)===0&&(la&134217727)===0||ut===null||gi(ut,He,An,!1)}function Hf(n,i,l){var u=Xe;Xe|=2;var h=$0(),g=P0();(ut!==n||He!==i)&&(uc=null,lr(n,i)),i=!1;var j=Ct;e:do try{if(et!==0&&$e!==null){var _=$e,D=Rn;switch(et){case 8:qf(),j=6;break e;case 3:case 2:case 9:case 6:zn.current===null&&(i=!0);var F=et;if(et=0,Rn=null,cr(n,_,D,F),l&&ar){j=0;break e}break;default:F=et,et=0,Rn=null,cr(n,_,D,F)}}jC(),j=Ct;break}catch(W){M0(n,W)}while(!0);return i&&n.shellSuspendCounter++,Es=Wi=null,Xe=u,B.H=h,B.A=g,$e===null&&(ut=null,He=0,Tl()),j}function jC(){for(;$e!==null;)I0($e)}function wC(n,i){var l=Xe;Xe|=2;var u=$0(),h=P0();ut!==n||He!==i?(uc=null,cc=Be()+500,lr(n,i)):ar=us(n,i);e:do try{if(et!==0&&$e!==null){i=$e;var g=Rn;t:switch(et){case 1:et=0,Rn=null,cr(n,i,g,1);break;case 2:case 9:if(Yg(g)){et=0,Rn=null,B0(i);break}i=function(){et!==2&&et!==9||ut!==n||(et=7),gs(n)},g.then(i,i);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Yg(g)?(et=0,Rn=null,B0(i)):(et=0,Rn=null,cr(n,i,g,7));break;case 5:var j=null;switch($e.tag){case 26:j=$e.memoizedState;case 5:case 27:var _=$e;if(j?kv(j):_.stateNode.complete){et=0,Rn=null;var D=_.sibling;if(D!==null)$e=D;else{var F=_.return;F!==null?($e=F,hc(F)):$e=null}break t}}et=0,Rn=null,cr(n,i,g,5);break;case 6:et=0,Rn=null,cr(n,i,g,6);break;case 8:qf(),Ct=6;break e;default:throw Error(a(462))}}NC();break}catch(W){M0(n,W)}while(!0);return Es=Wi=null,B.H=u,B.A=h,Xe=l,$e!==null?0:(ut=null,He=0,Tl(),Ct)}function NC(){for(;$e!==null&&!le();)I0($e)}function I0(n){var i=u0(n.alternate,n,Ps);n.memoizedProps=n.pendingProps,i===null?hc(n):$e=i}function B0(n){var i=n,l=i.alternate;switch(i.tag){case 15:case 0:i=i0(l,i,i.pendingProps,i.type,void 0,He);break;case 11:i=i0(l,i,i.pendingProps,i.type.render,i.ref,He);break;case 5:sf(i);default:f0(l,i),i=$e=Pg(i,Ps),i=u0(l,i,Ps)}n.memoizedProps=n.pendingProps,i===null?hc(n):$e=i}function cr(n,i,l,u){Es=Wi=null,sf(i),Xa=null,ro=0;var h=i.return;try{if(fC(n,h,i,l,He)){Ct=1,ec(n,Mn(l,n.current)),$e=null;return}}catch(g){if(h!==null)throw $e=h,g;Ct=1,ec(n,Mn(l,n.current)),$e=null;return}i.flags&32768?(Fe||u===1?n=!0:ar||(He&536870912)!==0?n=!1:(fi=n=!0,(u===2||u===9||u===3||u===6)&&(u=zn.current,u!==null&&u.tag===13&&(u.flags|=16384))),q0(i,n)):hc(i)}function hc(n){var i=n;do{if((i.flags&32768)!==0){q0(i,fi);return}n=i.return;var l=pC(i.alternate,i,Ps);if(l!==null){$e=l;return}if(i=i.sibling,i!==null){$e=i;return}$e=i=n}while(i!==null);Ct===0&&(Ct=5)}function q0(n,i){do{var l=gC(n.alternate,n);if(l!==null){l.flags&=32767,$e=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(n=n.sibling,n!==null)){$e=n;return}$e=n=l}while(n!==null);Ct=6,$e=null}function H0(n,i,l,u,h,g,j,_,D){n.cancelPendingCommit=null;do mc();while(Ft!==0);if((Xe&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Rd,od(n,l,g,j,_,D),n===ut&&($e=ut=null,He=0),or=i,pi=n,Is=l,Pf=g,If=h,T0=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,zC(rn,function(){return V0(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=B.T,B.T=null,h=G.p,G.p=2,j=Xe,Xe|=4;try{yC(n,i,l)}finally{Xe=j,G.p=h,B.T=u}}Ft=1,G0(),F0(),Z0()}}function G0(){if(Ft===1){Ft=0;var n=pi,i=or,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=B.T,B.T=null;var u=G.p;G.p=2;var h=Xe;Xe|=4;try{N0(i,n);var g=th,j=Rg(n.containerInfo),_=g.focusedElem,D=g.selectionRange;if(j!==_&&_&&_.ownerDocument&&Eg(_.ownerDocument.documentElement,_)){if(D!==null&&Cd(_)){var F=D.start,W=D.end;if(W===void 0&&(W=F),"selectionStart"in _)_.selectionStart=F,_.selectionEnd=Math.min(W,_.value.length);else{var ne=_.ownerDocument||document,V=ne&&ne.defaultView||window;if(V.getSelection){var Y=V.getSelection(),ve=_.textContent.length,Ce=Math.min(D.start,ve),ct=D.end===void 0?Ce:Math.min(D.end,ve);!Y.extend&&Ce>ct&&(j=ct,ct=Ce,Ce=j);var I=zg(_,Ce),U=zg(_,ct);if(I&&U&&(Y.rangeCount!==1||Y.anchorNode!==I.node||Y.anchorOffset!==I.offset||Y.focusNode!==U.node||Y.focusOffset!==U.offset)){var H=ne.createRange();H.setStart(I.node,I.offset),Y.removeAllRanges(),Ce>ct?(Y.addRange(H),Y.extend(U.node,U.offset)):(H.setEnd(U.node,U.offset),Y.addRange(H))}}}}for(ne=[],Y=_;Y=Y.parentNode;)Y.nodeType===1&&ne.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ne.length;_++){var ee=ne[_];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}kc=!!eh,th=eh=null}finally{Xe=h,G.p=u,B.T=l}}n.current=i,Ft=2}}function F0(){if(Ft===2){Ft=0;var n=pi,i=or,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=B.T,B.T=null;var u=G.p;G.p=2;var h=Xe;Xe|=4;try{x0(n,i.alternate,i)}finally{Xe=h,G.p=u,B.T=l}}Ft=3}}function Z0(){if(Ft===4||Ft===3){Ft=0,Ie();var n=pi,i=or,l=Is,u=T0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ft=5:(Ft=0,or=pi=null,K0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(mi=null),fe(l),i=i.stateNode,_e&&typeof _e.onCommitFiberRoot=="function")try{_e.onCommitFiberRoot(ls,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=B.T,h=G.p,G.p=2,B.T=null;try{for(var g=n.onRecoverableError,j=0;j<u.length;j++){var _=u[j];g(_.value,{componentStack:_.stack})}}finally{B.T=i,G.p=h}}(Is&3)!==0&&mc(),gs(n),h=n.pendingLanes,(l&261930)!==0&&(h&42)!==0?n===Bf?No++:(No=0,Bf=n):No=0,Co(0)}}function K0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,io(i)))}function mc(){return G0(),F0(),Z0(),V0()}function V0(){if(Ft!==5)return!1;var n=pi,i=Pf;Pf=0;var l=fe(Is),u=B.T,h=G.p;try{G.p=32>l?32:l,B.T=null,l=If,If=null;var g=pi,j=Is;if(Ft=0,or=pi=null,Is=0,(Xe&6)!==0)throw Error(a(331));var _=Xe;if(Xe|=4,E0(g.current),k0(g,g.current,j,l),Xe=_,Co(0,!1),_e&&typeof _e.onPostCommitFiberRoot=="function")try{_e.onPostCommitFiberRoot(ls,g)}catch{}return!0}finally{G.p=h,B.T=u,K0(n,i)}}function Q0(n,i,l){i=Mn(l,i),i=xf(n.stateNode,i,2),n=li(n,i,2),n!==null&&(Zi(n,2),gs(n))}function tt(n,i,l){if(n.tag===3)Q0(n,n,l);else for(;i!==null;){if(i.tag===3){Q0(i,n,l);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(mi===null||!mi.has(u))){n=Mn(l,n),l=Yy(2),u=li(i,l,2),u!==null&&(Jy(l,u,i,n),Zi(u,2),gs(u));break}}i=i.return}}function Gf(n,i,l){var u=n.pingCache;if(u===null){u=n.pingCache=new bC;var h=new Set;u.set(i,h)}else h=u.get(i),h===void 0&&(h=new Set,u.set(i,h));h.has(l)||(Mf=!0,h.add(l),n=CC.bind(null,n,i,l),i.then(n,n))}function CC(n,i,l){var u=n.pingCache;u!==null&&u.delete(i),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,ut===n&&(He&l)===l&&(Ct===4||Ct===3&&(He&62914560)===He&&300>Be()-lc?(Xe&2)===0&&lr(n,0):Uf|=l,rr===He&&(rr=0)),gs(n)}function Y0(n,i){i===0&&(i=vl()),n=Yi(n,i),n!==null&&(Zi(n,i),gs(n))}function kC(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),Y0(n,l)}function _C(n,i){var l=0;switch(n.tag){case 31:case 13:var u=n.stateNode,h=n.memoizedState;h!==null&&(l=h.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(i),Y0(n,l)}function zC(n,i){return zt(n,i)}var pc=null,ur=null,Ff=!1,gc=!1,Zf=!1,yi=0;function gs(n){n!==ur&&n.next===null&&(ur===null?pc=ur=n:ur=ur.next=n),gc=!0,Ff||(Ff=!0,RC())}function Co(n,i){if(!Zf&&gc){Zf=!0;do for(var l=!1,u=pc;u!==null;){if(n!==0){var h=u.pendingLanes;if(h===0)var g=0;else{var j=u.suspendedLanes,_=u.pingedLanes;g=(1<<31-Ve(42|n)+1)-1,g&=h&~(j&~_),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,ev(u,g))}else g=He,g=Ta(u,u===ut?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||us(u,g)||(l=!0,ev(u,g));u=u.next}while(l);Zf=!1}}function EC(){J0()}function J0(){gc=Ff=!1;var n=0;yi!==0&&IC()&&(n=yi);for(var i=Be(),l=null,u=pc;u!==null;){var h=u.next,g=X0(u,i);g===0?(u.next=null,l===null?pc=h:l.next=h,h===null&&(ur=l)):(l=u,(n!==0||(g&3)!==0)&&(gc=!0)),u=h}Ft!==0&&Ft!==5||Co(n),yi!==0&&(yi=0)}function X0(n,i){for(var l=n.suspendedLanes,u=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var j=31-Ve(g),_=1<<j,D=h[j];D===-1?((_&l)===0||(_&u)!==0)&&(h[j]=yl(_,i)):D<=i&&(n.expiredLanes|=_),g&=~_}if(i=ut,l=He,l=Ta(n,n===i?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,l===0||n===i&&(et===2||et===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&mn(u),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||us(n,l)){if(i=l&-l,i===n.callbackPriority)return i;switch(u!==null&&mn(u),fe(l)){case 2:case 8:l=pt;break;case 32:l=rn;break;case 268435456:l=Vs;break;default:l=rn}return u=W0.bind(null,n),l=zt(l,u),n.callbackPriority=i,n.callbackNode=l,i}return u!==null&&u!==null&&mn(u),n.callbackPriority=2,n.callbackNode=null,2}function W0(n,i){if(Ft!==0&&Ft!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(mc()&&n.callbackNode!==l)return null;var u=He;return u=Ta(n,n===ut?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(D0(n,u,i),X0(n,Be()),n.callbackNode!=null&&n.callbackNode===l?W0.bind(null,n):null)}function ev(n,i){if(mc())return null;D0(n,i,!0)}function RC(){qC(function(){(Xe&6)!==0?zt(Ue,EC):J0()})}function Kf(){if(yi===0){var n=Qa;n===0&&(n=Ys,Ys<<=1,(Ys&261888)===0&&(Ys=256)),yi=n}return yi}function tv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Nl(""+n)}function nv(n,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,n.id&&l.setAttribute("form",n.id),i.parentNode.insertBefore(l,i),n=new FormData(n),l.parentNode.removeChild(l),n}function AC(n,i,l,u,h){if(i==="submit"&&l&&l.stateNode===h){var g=tv((h[wt]||null).action),j=u.submitter;j&&(i=(i=j[wt]||null)?tv(i.formAction):j.getAttribute("formAction"),i!==null&&(g=i,j=null));var _=new zl("action","action",null,u,h);n.push({event:_,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(yi!==0){var D=j?nv(h,j):new FormData(h);hf(l,{pending:!0,data:D,method:h.method,action:g},null,D)}}else typeof g=="function"&&(_.preventDefault(),D=j?nv(h,j):new FormData(h),hf(l,{pending:!0,data:D,method:h.method,action:g},g,D))},currentTarget:h}]})}}for(var Vf=0;Vf<Ed.length;Vf++){var Qf=Ed[Vf],TC=Qf.toLowerCase(),OC=Qf[0].toUpperCase()+Qf.slice(1);Wn(TC,"on"+OC)}Wn(Og,"onAnimationEnd"),Wn(Dg,"onAnimationIteration"),Wn(Lg,"onAnimationStart"),Wn("dblclick","onDoubleClick"),Wn("focusin","onFocus"),Wn("focusout","onBlur"),Wn(Q1,"onTransitionRun"),Wn(Y1,"onTransitionStart"),Wn(J1,"onTransitionCancel"),Wn(Mg,"onTransitionEnd"),on("onMouseEnter",["mouseout","mouseover"]),on("onMouseLeave",["mouseout","mouseover"]),on("onPointerEnter",["pointerout","pointerover"]),on("onPointerLeave",["pointerout","pointerover"]),Gt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ko="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(" "),DC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ko));function sv(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var u=n[l],h=u.event;u=u.listeners;e:{var g=void 0;if(i)for(var j=u.length-1;0<=j;j--){var _=u[j],D=_.instance,F=_.currentTarget;if(_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(W){Al(W)}h.currentTarget=null,g=D}else for(j=0;j<u.length;j++){if(_=u[j],D=_.instance,F=_.currentTarget,_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(W){Al(W)}h.currentTarget=null,g=D}}}}function Pe(n,i){var l=i[en];l===void 0&&(l=i[en]=new Set);var u=n+"__bubble";l.has(u)||(iv(i,n,2,!1),l.add(u))}function Yf(n,i,l){var u=0;i&&(u|=4),iv(l,n,u,i)}var yc="_reactListening"+Math.random().toString(36).slice(2);function Jf(n){if(!n[yc]){n[yc]=!0,qe.forEach(function(l){l!=="selectionchange"&&(DC.has(l)||Yf(l,!1,n),Yf(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[yc]||(i[yc]=!0,Yf("selectionchange",!1,i))}}function iv(n,i,l,u){switch(Ov(i)){case 2:var h=lk;break;case 8:h=ck;break;default:h=fh}l=h.bind(null,i,l,n),h=void 0,!gd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),u?h!==void 0?n.addEventListener(i,l,{capture:!0,passive:h}):n.addEventListener(i,l,!0):h!==void 0?n.addEventListener(i,l,{passive:h}):n.addEventListener(i,l,!1)}function Xf(n,i,l,u,h){var g=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var j=u.tag;if(j===3||j===4){var _=u.stateNode.containerInfo;if(_===h)break;if(j===4)for(j=u.return;j!==null;){var D=j.tag;if((D===3||D===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;_!==null;){if(j=Ws(_),j===null)return;if(D=j.tag,D===5||D===6||D===26||D===27){u=g=j;continue e}_=_.parentNode}}u=u.return}cg(function(){var F=g,W=md(l),ne=[];e:{var V=Ug.get(n);if(V!==void 0){var Y=zl,ve=n;switch(n){case"keypress":if(kl(l)===0)break e;case"keydown":case"keyup":Y=_1;break;case"focusin":ve="focus",Y=bd;break;case"focusout":ve="blur",Y=bd;break;case"beforeblur":case"afterblur":Y=bd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=fg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=p1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=R1;break;case Og:case Dg:case Lg:Y=v1;break;case Mg:Y=T1;break;case"scroll":case"scrollend":Y=h1;break;case"wheel":Y=D1;break;case"copy":case"cut":case"paste":Y=b1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=mg;break;case"toggle":case"beforetoggle":Y=M1}var Ce=(i&4)!==0,ct=!Ce&&(n==="scroll"||n==="scrollend"),I=Ce?V!==null?V+"Capture":null:V;Ce=[];for(var U=F,H;U!==null;){var ee=U;if(H=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||H===null||I===null||(ee=Kr(U,I),ee!=null&&Ce.push(_o(U,ee,H))),ct)break;U=U.return}0<Ce.length&&(V=new Y(V,ve,null,l,W),ne.push({event:V,listeners:Ce}))}}if((i&7)===0){e:{if(V=n==="mouseover"||n==="pointerover",Y=n==="mouseout"||n==="pointerout",V&&l!==hd&&(ve=l.relatedTarget||l.fromElement)&&(Ws(ve)||ve[Cn]))break e;if((Y||V)&&(V=W.window===W?W:(V=W.ownerDocument)?V.defaultView||V.parentWindow:window,Y?(ve=l.relatedTarget||l.toElement,Y=F,ve=ve?Ws(ve):null,ve!==null&&(ct=c(ve),Ce=ve.tag,ve!==ct||Ce!==5&&Ce!==27&&Ce!==6)&&(ve=null)):(Y=null,ve=F),Y!==ve)){if(Ce=fg,ee="onMouseLeave",I="onMouseEnter",U="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=mg,ee="onPointerLeave",I="onPointerEnter",U="pointer"),ct=Y==null?V:fs(Y),H=ve==null?V:fs(ve),V=new Ce(ee,U+"leave",Y,l,W),V.target=ct,V.relatedTarget=H,ee=null,Ws(W)===F&&(Ce=new Ce(I,U+"enter",ve,l,W),Ce.target=H,Ce.relatedTarget=ct,ee=Ce),ct=ee,Y&&ve)t:{for(Ce=LC,I=Y,U=ve,H=0,ee=I;ee;ee=Ce(ee))H++;ee=0;for(var Ne=U;Ne;Ne=Ce(Ne))ee++;for(;0<H-ee;)I=Ce(I),H--;for(;0<ee-H;)U=Ce(U),ee--;for(;H--;){if(I===U||U!==null&&I===U.alternate){Ce=I;break t}I=Ce(I),U=Ce(U)}Ce=null}else Ce=null;Y!==null&&av(ne,V,Y,Ce,!1),ve!==null&&ct!==null&&av(ne,ct,ve,Ce,!0)}}e:{if(V=F?fs(F):window,Y=V.nodeName&&V.nodeName.toLowerCase(),Y==="select"||Y==="input"&&V.type==="file")var Ye=jg;else if(bg(V))if(wg)Ye=Z1;else{Ye=G1;var Se=H1}else Y=V.nodeName,!Y||Y.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?F&&fd(F.elementType)&&(Ye=jg):Ye=F1;if(Ye&&(Ye=Ye(n,F))){Sg(ne,Ye,l,W);break e}Se&&Se(n,V,F),n==="focusout"&&F&&V.type==="number"&&F.memoizedProps.value!=null&&dd(V,"number",V.value)}switch(Se=F?fs(F):window,n){case"focusin":(bg(Se)||Se.contentEditable==="true")&&(Ba=Se,kd=F,to=null);break;case"focusout":to=kd=Ba=null;break;case"mousedown":_d=!0;break;case"contextmenu":case"mouseup":case"dragend":_d=!1,Ag(ne,l,W);break;case"selectionchange":if(V1)break;case"keydown":case"keyup":Ag(ne,l,W)}var Te;if(jd)e:{switch(n){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else Ia?vg(n,l)&&(Ge="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(Ge="onCompositionStart");Ge&&(pg&&l.locale!=="ko"&&(Ia||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&Ia&&(Te=ug()):(ti=W,yd="value"in ti?ti.value:ti.textContent,Ia=!0)),Se=vc(F,Ge),0<Se.length&&(Ge=new hg(Ge,n,null,l,W),ne.push({event:Ge,listeners:Se}),Te?Ge.data=Te:(Te=xg(l),Te!==null&&(Ge.data=Te)))),(Te=$1?P1(n,l):I1(n,l))&&(Ge=vc(F,"onBeforeInput"),0<Ge.length&&(Se=new hg("onBeforeInput","beforeinput",null,l,W),ne.push({event:Se,listeners:Ge}),Se.data=Te)),AC(ne,n,F,l,W)}sv(ne,i)})}function _o(n,i,l){return{instance:n,listener:i,currentTarget:l}}function vc(n,i){for(var l=i+"Capture",u=[];n!==null;){var h=n,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Kr(n,l),h!=null&&u.unshift(_o(n,h,g)),h=Kr(n,i),h!=null&&u.push(_o(n,h,g))),n.tag===3)return u;n=n.return}return[]}function LC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function av(n,i,l,u,h){for(var g=i._reactName,j=[];l!==null&&l!==u;){var _=l,D=_.alternate,F=_.stateNode;if(_=_.tag,D!==null&&D===u)break;_!==5&&_!==26&&_!==27||F===null||(D=F,h?(F=Kr(l,g),F!=null&&j.unshift(_o(l,F,D))):h||(F=Kr(l,g),F!=null&&j.push(_o(l,F,D)))),l=l.return}j.length!==0&&n.push({event:i,listeners:j})}var MC=/\r\n?/g,UC=/\u0000|\uFFFD/g;function rv(n){return(typeof n=="string"?n:""+n).replace(MC,`
9
+ `).replace(UC,"")}function ov(n,i){return i=rv(i),rv(n)===i}function lt(n,i,l,u,h,g){switch(l){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||Ua(n,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&Ua(n,""+u);break;case"className":jl(n,"class",u);break;case"tabIndex":jl(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":jl(n,l,u);break;case"style":og(n,u,g);break;case"data":if(i!=="object"){jl(n,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||l!=="href")){n.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(l);break}u=Nl(""+u),n.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(l,"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 g=="function"&&(l==="formAction"?(i!=="input"&&lt(n,i,"name",h.name,h,null),lt(n,i,"formEncType",h.formEncType,h,null),lt(n,i,"formMethod",h.formMethod,h,null),lt(n,i,"formTarget",h.formTarget,h,null)):(lt(n,i,"encType",h.encType,h,null),lt(n,i,"method",h.method,h,null),lt(n,i,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(l);break}u=Nl(""+u),n.setAttribute(l,u);break;case"onClick":u!=null&&(n.onclick=Cs);break;case"onScroll":u!=null&&Pe("scroll",n);break;case"onScrollEnd":u!=null&&Pe("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=l}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}l=Nl(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,""+u):n.removeAttribute(l);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":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":u===!0?n.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,u):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(l,u):n.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(l):n.setAttribute(l,u);break;case"popover":Pe("beforetoggle",n),Pe("toggle",n),Sl(n,"popover",u);break;case"xlinkActuate":Ns(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ns(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ns(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ns(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ns(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ns(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ns(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ns(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ns(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Sl(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=d1.get(l)||l,Sl(n,l,u))}}function Wf(n,i,l,u,h,g){switch(l){case"style":og(n,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=l}}break;case"children":typeof u=="string"?Ua(n,u):(typeof u=="number"||typeof u=="bigint")&&Ua(n,""+u);break;case"onScroll":u!=null&&Pe("scroll",n);break;case"onScrollEnd":u!=null&&Pe("scrollend",n);break;case"onClick":u!=null&&(n.onclick=Cs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rt.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(h=l.endsWith("Capture"),i=l.slice(2,h?l.length-7:void 0),g=n[wt]||null,g=g!=null?g[l]:null,typeof g=="function"&&n.removeEventListener(i,g,h),typeof u=="function")){typeof g!="function"&&g!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(i,u,h);break e}l in n?n[l]=u:u===!0?n.setAttribute(l,""):Sl(n,l,u)}}}function Wt(n,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",n),Pe("load",n);var u=!1,h=!1,g;for(g in l)if(l.hasOwnProperty(g)){var j=l[g];if(j!=null)switch(g){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(n,i,g,j,l,null)}}h&&lt(n,i,"srcSet",l.srcSet,l,null),u&&lt(n,i,"src",l.src,l,null);return;case"input":Pe("invalid",n);var _=g=j=h=null,D=null,F=null;for(u in l)if(l.hasOwnProperty(u)){var W=l[u];if(W!=null)switch(u){case"name":h=W;break;case"type":j=W;break;case"checked":D=W;break;case"defaultChecked":F=W;break;case"value":g=W;break;case"defaultValue":_=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:lt(n,i,u,W,l,null)}}sg(n,g,_,D,F,j,h,!1);return;case"select":Pe("invalid",n),u=j=g=null;for(h in l)if(l.hasOwnProperty(h)&&(_=l[h],_!=null))switch(h){case"value":g=_;break;case"defaultValue":j=_;break;case"multiple":u=_;default:lt(n,i,h,_,l,null)}i=g,l=j,n.multiple=!!u,i!=null?Ma(n,!!u,i,!1):l!=null&&Ma(n,!!u,l,!0);return;case"textarea":Pe("invalid",n),g=h=u=null;for(j in l)if(l.hasOwnProperty(j)&&(_=l[j],_!=null))switch(j){case"value":u=_;break;case"defaultValue":h=_;break;case"children":g=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:lt(n,i,j,_,l,null)}ag(n,u,h,g);return;case"option":for(D in l)l.hasOwnProperty(D)&&(u=l[D],u!=null)&&(D==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":lt(n,i,D,u,l,null));return;case"dialog":Pe("beforetoggle",n),Pe("toggle",n),Pe("cancel",n),Pe("close",n);break;case"iframe":case"object":Pe("load",n);break;case"video":case"audio":for(u=0;u<ko.length;u++)Pe(ko[u],n);break;case"image":Pe("error",n),Pe("load",n);break;case"details":Pe("toggle",n);break;case"embed":case"source":case"link":Pe("error",n),Pe("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in l)if(l.hasOwnProperty(F)&&(u=l[F],u!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(n,i,F,u,l,null)}return;default:if(fd(i)){for(W in l)l.hasOwnProperty(W)&&(u=l[W],u!==void 0&&Wf(n,i,W,u,l,void 0));return}}for(_ in l)l.hasOwnProperty(_)&&(u=l[_],u!=null&&lt(n,i,_,u,l,null))}function $C(n,i,l,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,j=null,_=null,D=null,F=null,W=null;for(Y in l){var ne=l[Y];if(l.hasOwnProperty(Y)&&ne!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":D=ne;default:u.hasOwnProperty(Y)||lt(n,i,Y,null,u,ne)}}for(var V in u){var Y=u[V];if(ne=l[V],u.hasOwnProperty(V)&&(Y!=null||ne!=null))switch(V){case"type":g=Y;break;case"name":h=Y;break;case"checked":F=Y;break;case"defaultChecked":W=Y;break;case"value":j=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:Y!==ne&&lt(n,i,V,Y,u,ne)}}ud(n,j,_,D,F,W,g,h);return;case"select":Y=j=_=V=null;for(g in l)if(D=l[g],l.hasOwnProperty(g)&&D!=null)switch(g){case"value":break;case"multiple":Y=D;default:u.hasOwnProperty(g)||lt(n,i,g,null,u,D)}for(h in u)if(g=u[h],D=l[h],u.hasOwnProperty(h)&&(g!=null||D!=null))switch(h){case"value":V=g;break;case"defaultValue":_=g;break;case"multiple":j=g;default:g!==D&&lt(n,i,h,g,u,D)}i=_,l=j,u=Y,V!=null?Ma(n,!!l,V,!1):!!u!=!!l&&(i!=null?Ma(n,!!l,i,!0):Ma(n,!!l,l?[]:"",!1));return;case"textarea":Y=V=null;for(_ in l)if(h=l[_],l.hasOwnProperty(_)&&h!=null&&!u.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:lt(n,i,_,null,u,h)}for(j in u)if(h=u[j],g=l[j],u.hasOwnProperty(j)&&(h!=null||g!=null))switch(j){case"value":V=h;break;case"defaultValue":Y=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==g&&lt(n,i,j,h,u,g)}ig(n,V,Y);return;case"option":for(var ve in l)V=l[ve],l.hasOwnProperty(ve)&&V!=null&&!u.hasOwnProperty(ve)&&(ve==="selected"?n.selected=!1:lt(n,i,ve,null,u,V));for(D in u)V=u[D],Y=l[D],u.hasOwnProperty(D)&&V!==Y&&(V!=null||Y!=null)&&(D==="selected"?n.selected=V&&typeof V!="function"&&typeof V!="symbol":lt(n,i,D,V,u,Y));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 Ce in l)V=l[Ce],l.hasOwnProperty(Ce)&&V!=null&&!u.hasOwnProperty(Ce)&&lt(n,i,Ce,null,u,V);for(F in u)if(V=u[F],Y=l[F],u.hasOwnProperty(F)&&V!==Y&&(V!=null||Y!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(a(137,i));break;default:lt(n,i,F,V,u,Y)}return;default:if(fd(i)){for(var ct in l)V=l[ct],l.hasOwnProperty(ct)&&V!==void 0&&!u.hasOwnProperty(ct)&&Wf(n,i,ct,void 0,u,V);for(W in u)V=u[W],Y=l[W],!u.hasOwnProperty(W)||V===Y||V===void 0&&Y===void 0||Wf(n,i,W,V,u,Y);return}}for(var I in l)V=l[I],l.hasOwnProperty(I)&&V!=null&&!u.hasOwnProperty(I)&&lt(n,i,I,null,u,V);for(ne in u)V=u[ne],Y=l[ne],!u.hasOwnProperty(ne)||V===Y||V==null&&Y==null||lt(n,i,ne,V,u,Y)}function lv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function PC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var h=l[u],g=h.transferSize,j=h.initiatorType,_=h.duration;if(g&&_&&lv(j)){for(j=0,_=h.responseEnd,u+=1;u<l.length;u++){var D=l[u],F=D.startTime;if(F>_)break;var W=D.transferSize,ne=D.initiatorType;W&&lv(ne)&&(D=D.responseEnd,j+=W*(D<_?1:(_-F)/(D-F)))}if(--u,i+=8*(g+j)/(h.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var eh=null,th=null;function xc(n){return n.nodeType===9?n:n.ownerDocument}function cv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function uv(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function nh(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var sh=null;function IC(){var n=window.event;return n&&n.type==="popstate"?n===sh?!1:(sh=n,!0):(sh=null,!1)}var dv=typeof setTimeout=="function"?setTimeout:void 0,BC=typeof clearTimeout=="function"?clearTimeout:void 0,fv=typeof Promise=="function"?Promise:void 0,qC=typeof queueMicrotask=="function"?queueMicrotask:typeof fv<"u"?function(n){return fv.resolve(null).then(n).catch(HC)}:dv;function HC(n){setTimeout(function(){throw n})}function vi(n){return n==="head"}function hv(n,i){var l=i,u=0;do{var h=l.nextSibling;if(n.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(u===0){n.removeChild(h),mr(i);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")zo(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,zo(l);for(var g=l.firstChild;g;){var j=g.nextSibling,_=g.nodeName;g[ds]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&g.rel.toLowerCase()==="stylesheet"||l.removeChild(g),g=j}}else l==="body"&&zo(n.ownerDocument.body);l=h}while(l);mr(i)}function mv(n,i){var l=n;n=0;do{var u=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=u}while(l)}function ih(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":ih(l),Da(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function GC(n,i,l,u){for(;n.nodeType===1;){var h=l;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[ds])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=Bn(n.nextSibling),n===null)break}return null}function FC(n,i,l){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=Bn(n.nextSibling),n===null))return null;return n}function pv(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Bn(n.nextSibling),n===null))return null;return n}function ah(n){return n.data==="$?"||n.data==="$~"}function rh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function ZC(n,i){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||l.readyState!=="loading")i();else{var u=function(){i(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function Bn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var oh=null;function gv(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(i===0)return Bn(n.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}n=n.nextSibling}return null}function yv(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return n;i--}else l!=="/$"&&l!=="/&"||i++}n=n.previousSibling}return null}function vv(n,i,l){switch(i=xc(l),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function zo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Da(n)}var qn=new Map,xv=new Set;function bc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Bs=G.d;G.d={f:KC,r:VC,D:QC,C:YC,L:JC,m:XC,X:ek,S:WC,M:tk};function KC(){var n=Bs.f(),i=dc();return n||i}function VC(n){var i=Xn(n);i!==null&&i.tag===5&&i.type==="form"?My(i):Bs.r(n)}var dr=typeof document>"u"?null:document;function bv(n,i,l){var u=dr;if(u&&typeof i=="string"&&i){var h=Dn(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),xv.has(h)||(xv.add(h),n={rel:n,crossOrigin:l,href:i},u.querySelector(h)===null&&(i=u.createElement("link"),Wt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function QC(n){Bs.D(n),bv("dns-prefetch",n,null)}function YC(n,i){Bs.C(n,i),bv("preconnect",n,i)}function JC(n,i,l){Bs.L(n,i,l);var u=dr;if(u&&n&&i){var h='link[rel="preload"][as="'+Dn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+Dn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+Dn(l.imageSizes)+'"]')):h+='[href="'+Dn(n)+'"]';var g=h;switch(i){case"style":g=fr(n);break;case"script":g=hr(n)}qn.has(g)||(n=y({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:n,as:i},l),qn.set(g,n),u.querySelector(h)!==null||i==="style"&&u.querySelector(Eo(g))||i==="script"&&u.querySelector(Ro(g))||(i=u.createElement("link"),Wt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function XC(n,i){Bs.m(n,i);var l=dr;if(l&&n){var u=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Dn(u)+'"][href="'+Dn(n)+'"]',g=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=hr(n)}if(!qn.has(g)&&(n=y({rel:"modulepreload",href:n},i),qn.set(g,n),l.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Ro(g)))return}u=l.createElement("link"),Wt(u,"link",n),Mt(u),l.head.appendChild(u)}}}function WC(n,i,l){Bs.S(n,i,l);var u=dr;if(u&&n){var h=ei(u).hoistableStyles,g=fr(n);i=i||"default";var j=h.get(g);if(!j){var _={loading:0,preload:null};if(j=u.querySelector(Eo(g)))_.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},l),(l=qn.get(g))&&lh(n,l);var D=j=u.createElement("link");Mt(D),Wt(D,"link",n),D._p=new Promise(function(F,W){D.onload=F,D.onerror=W}),D.addEventListener("load",function(){_.loading|=1}),D.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Sc(j,i,u)}j={type:"stylesheet",instance:j,count:1,state:_},h.set(g,j)}}}function ek(n,i){Bs.X(n,i);var l=dr;if(l&&n){var u=ei(l).hoistableScripts,h=hr(n),g=u.get(h);g||(g=l.querySelector(Ro(h)),g||(n=y({src:n,async:!0},i),(i=qn.get(h))&&ch(n,i),g=l.createElement("script"),Mt(g),Wt(g,"link",n),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function tk(n,i){Bs.M(n,i);var l=dr;if(l&&n){var u=ei(l).hoistableScripts,h=hr(n),g=u.get(h);g||(g=l.querySelector(Ro(h)),g||(n=y({src:n,async:!0,type:"module"},i),(i=qn.get(h))&&ch(n,i),g=l.createElement("script"),Mt(g),Wt(g,"link",n),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function Sv(n,i,l,u){var h=(h=he.current)?bc(h):null;if(!h)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=fr(l.href),l=ei(h).hoistableStyles,u=l.get(i),u||(u={type:"style",instance:null,count:0,state:null},l.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=fr(l.href);var g=ei(h).hoistableStyles,j=g.get(n);if(j||(h=h.ownerDocument||h,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,j),(g=h.querySelector(Eo(n)))&&!g._p&&(j.instance=g,j.state.loading=5),qn.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},qn.set(n,l),g||nk(h,n,l,j.state))),i&&u===null)throw Error(a(528,""));return j}if(i&&u!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=hr(l),l=ei(h).hoistableScripts,u=l.get(i),u||(u={type:"script",instance:null,count:0,state:null},l.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function fr(n){return'href="'+Dn(n)+'"'}function Eo(n){return'link[rel="stylesheet"]['+n+"]"}function jv(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function nk(n,i,l,u){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=n.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),Wt(i,"link",l),Mt(i),n.head.appendChild(i))}function hr(n){return'[src="'+Dn(n)+'"]'}function Ro(n){return"script[async]"+n}function wv(n,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var u=n.querySelector('style[data-href~="'+Dn(l.href)+'"]');if(u)return i.instance=u,Mt(u),u;var h=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),Mt(u),Wt(u,"style",h),Sc(u,l.precedence,n),i.instance=u;case"stylesheet":h=fr(l.href);var g=n.querySelector(Eo(h));if(g)return i.state.loading|=4,i.instance=g,Mt(g),g;u=jv(l),(h=qn.get(h))&&lh(u,h),g=(n.ownerDocument||n).createElement("link"),Mt(g);var j=g;return j._p=new Promise(function(_,D){j.onload=_,j.onerror=D}),Wt(g,"link",u),i.state.loading|=4,Sc(g,l.precedence,n),i.instance=g;case"script":return g=hr(l.src),(h=n.querySelector(Ro(g)))?(i.instance=h,Mt(h),h):(u=l,(h=qn.get(g))&&(u=y({},l),ch(u,h)),n=n.ownerDocument||n,h=n.createElement("script"),Mt(h),Wt(h,"link",u),n.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(u=i.instance,i.state.loading|=4,Sc(u,l.precedence,n));return i.instance}function Sc(n,i,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,g=h,j=0;j<u.length;j++){var _=u[j];if(_.dataset.precedence===i)g=_;else if(g!==h)break}g?g.parentNode.insertBefore(n,g.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(n,i.firstChild))}function lh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function ch(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var jc=null;function Nv(n,i,l){if(jc===null){var u=new Map,h=jc=new Map;h.set(l,u)}else h=jc,u=h.get(l),u||(u=new Map,h.set(l,u));if(u.has(n))return u;for(u.set(n,null),l=l.getElementsByTagName(n),h=0;h<l.length;h++){var g=l[h];if(!(g[ds]||g[Et]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var j=g.getAttribute(i)||"";j=n+j;var _=u.get(j);_?_.push(g):u.set(j,[g])}}return u}function Cv(n,i,l){n=n.ownerDocument||n,n.head.insertBefore(l,i==="title"?n.querySelector("head > title"):null)}function sk(n,i,l){if(l===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(n=i.disabled,typeof i.precedence=="string"&&n==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function kv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function ik(n,i,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=fr(u.href),g=i.querySelector(Eo(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=wc.bind(n),i.then(n,n)),l.state.loading|=4,l.instance=g,Mt(g);return}g=i.ownerDocument||i,u=jv(u),(h=qn.get(h))&&lh(u,h),g=g.createElement("link"),Mt(g);var j=g;j._p=new Promise(function(_,D){j.onload=_,j.onerror=D}),Wt(g,"link",u),l.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=wc.bind(n),i.addEventListener("load",l),i.addEventListener("error",l))}}var uh=0;function ak(n,i){return n.stylesheets&&n.count===0&&Cc(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var u=setTimeout(function(){if(n.stylesheets&&Cc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&uh===0&&(uh=62500*PC());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Cc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>uh?50:800)+i);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Nc=null;function Cc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Nc=new Map,i.forEach(rk,n),Nc=null,wc.call(n))}function rk(n,i){if(!(i.state.loading&4)){var l=Nc.get(n);if(l)var u=l.get(null);else{l=new Map,Nc.set(n,l);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var j=h[g];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(l.set(j.dataset.precedence,j),u=j)}u&&l.set(null,u)}h=i.instance,j=h.getAttribute("data-precedence"),g=l.get(j)||u,g===u&&l.set(null,h),l.set(j,h),this.count++,u=wc.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),g?g.parentNode.insertBefore(h,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),i.state.loading|=4}}var Ao={$$typeof:R,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function ok(n,i,l,u,h,g,j,_,D){this.tag=1,this.containerInfo=n,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=Oa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oa(0),this.hiddenUpdates=Oa(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function _v(n,i,l,u,h,g,j,_,D,F,W,ne){return n=new ok(n,i,l,j,D,F,W,ne,_),i=1,g===!0&&(i|=24),g=_n(3,null,null,i),n.current=g,g.stateNode=n,i=qd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:u,isDehydrated:l,cache:i},Zd(g),n}function zv(n){return n?(n=Ga,n):Ga}function Ev(n,i,l,u,h,g){h=zv(h),u.context===null?u.context=h:u.pendingContext=h,u=oi(i),u.payload={element:l},g=g===void 0?null:g,g!==null&&(u.callback=g),l=li(n,u,i),l!==null&&(bn(l,n,i),lo(l,n,i))}function Rv(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function dh(n,i){Rv(n,i),(n=n.alternate)&&Rv(n,i)}function Av(n){if(n.tag===13||n.tag===31){var i=Yi(n,67108864);i!==null&&bn(i,n,67108864),dh(n,67108864)}}function Tv(n){if(n.tag===13||n.tag===31){var i=Tn();i=$(i);var l=Yi(n,i);l!==null&&bn(l,n,i),dh(n,i)}}var kc=!0;function lk(n,i,l,u){var h=B.T;B.T=null;var g=G.p;try{G.p=2,fh(n,i,l,u)}finally{G.p=g,B.T=h}}function ck(n,i,l,u){var h=B.T;B.T=null;var g=G.p;try{G.p=8,fh(n,i,l,u)}finally{G.p=g,B.T=h}}function fh(n,i,l,u){if(kc){var h=hh(u);if(h===null)Xf(n,i,u,_c,l),Dv(n,u);else if(dk(h,n,i,l,u))u.stopPropagation();else if(Dv(n,u),i&4&&-1<uk.indexOf(n)){for(;h!==null;){var g=Xn(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var j=cs(g.pendingLanes);if(j!==0){var _=g;for(_.pendingLanes|=2,_.entangledLanes|=2;j;){var D=1<<31-Ve(j);_.entanglements[1]|=D,j&=~D}gs(g),(Xe&6)===0&&(cc=Be()+500,Co(0))}}break;case 31:case 13:_=Yi(g,2),_!==null&&bn(_,g,2),dc(),dh(g,2)}if(g=hh(u),g===null&&Xf(n,i,u,_c,l),g===h)break;h=g}h!==null&&u.stopPropagation()}else Xf(n,i,u,null,l)}}function hh(n){return n=md(n),mh(n)}var _c=null;function mh(n){if(_c=null,n=Ws(n),n!==null){var i=c(n);if(i===null)n=null;else{var l=i.tag;if(l===13){if(n=d(i),n!==null)return n;n=null}else if(l===31){if(n=f(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return _c=n,null}function Ov(n){switch(n){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(ze()){case Ue:return 2;case pt:return 8;case rn:case Ss:return 32;case Vs:return 268435456;default:return 32}default:return 32}}var ph=!1,xi=null,bi=null,Si=null,To=new Map,Oo=new Map,ji=[],uk="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 Dv(n,i){switch(n){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":bi=null;break;case"mouseover":case"mouseout":Si=null;break;case"pointerover":case"pointerout":To.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oo.delete(i.pointerId)}}function Do(n,i,l,u,h,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:l,eventSystemFlags:u,nativeEvent:g,targetContainers:[h]},i!==null&&(i=Xn(i),i!==null&&Av(i)),n):(n.eventSystemFlags|=u,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function dk(n,i,l,u,h){switch(i){case"focusin":return xi=Do(xi,n,i,l,u,h),!0;case"dragenter":return bi=Do(bi,n,i,l,u,h),!0;case"mouseover":return Si=Do(Si,n,i,l,u,h),!0;case"pointerover":var g=h.pointerId;return To.set(g,Do(To.get(g)||null,n,i,l,u,h)),!0;case"gotpointercapture":return g=h.pointerId,Oo.set(g,Do(Oo.get(g)||null,n,i,l,u,h)),!0}return!1}function Lv(n){var i=Ws(n.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=d(l),i!==null){n.blockedOn=i,Qt(n.priority,function(){Tv(l)});return}}else if(i===31){if(i=f(l),i!==null){n.blockedOn=i,Qt(n.priority,function(){Tv(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function zc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=hh(n.nativeEvent);if(l===null){l=n.nativeEvent;var u=new l.constructor(l.type,l);hd=u,l.target.dispatchEvent(u),hd=null}else return i=Xn(l),i!==null&&Av(i),n.blockedOn=l,!1;i.shift()}return!0}function Mv(n,i,l){zc(n)&&l.delete(i)}function fk(){ph=!1,xi!==null&&zc(xi)&&(xi=null),bi!==null&&zc(bi)&&(bi=null),Si!==null&&zc(Si)&&(Si=null),To.forEach(Mv),Oo.forEach(Mv)}function Ec(n,i){n.blockedOn===i&&(n.blockedOn=null,ph||(ph=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fk)))}var Rc=null;function Uv(n){Rc!==n&&(Rc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Rc===n&&(Rc=null);for(var i=0;i<n.length;i+=3){var l=n[i],u=n[i+1],h=n[i+2];if(typeof u!="function"){if(mh(u||l)===null)continue;break}var g=Xn(l);g!==null&&(n.splice(i,3),i-=3,hf(g,{pending:!0,data:h,method:l.method,action:u},u,h))}}))}function mr(n){function i(D){return Ec(D,n)}xi!==null&&Ec(xi,n),bi!==null&&Ec(bi,n),Si!==null&&Ec(Si,n),To.forEach(i),Oo.forEach(i);for(var l=0;l<ji.length;l++){var u=ji[l];u.blockedOn===n&&(u.blockedOn=null)}for(;0<ji.length&&(l=ji[0],l.blockedOn===null);)Lv(l),l.blockedOn===null&&ji.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var h=l[u],g=l[u+1],j=h[wt]||null;if(typeof g=="function")j||Uv(l);else if(j){var _=null;if(g&&g.hasAttribute("formAction")){if(h=g,j=g[wt]||null)_=j.formAction;else if(mh(h)!==null)continue}else _=j.action;typeof _=="function"?l[u+1]=_:(l.splice(u,3),u-=3),Uv(l)}}}function $v(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(j){return h=j})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function gh(n){this._internalRoot=n}Ac.prototype.render=gh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,u=Tn();Ev(l,u,n,i,null,null)},Ac.prototype.unmount=gh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Ev(n.current,2,null,n,null,null),dc(),i[Cn]=null}};function Ac(n){this._internalRoot=n}Ac.prototype.unstable_scheduleHydration=function(n){if(n){var i=at();n={blockedOn:null,target:n,priority:i};for(var l=0;l<ji.length&&i!==0&&i<ji[l].priority;l++);ji.splice(l,0,n),l===0&&Lv(n)}};var Pv=t.version;if(Pv!=="19.2.4")throw Error(a(527,Pv,"19.2.4"));G.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=m(i),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var hk={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tc.isDisabled&&Tc.supportsFiber)try{ls=Tc.inject(hk),_e=Tc}catch{}}return Mo.createRoot=function(n,i){if(!r(n))throw Error(a(299));var l=!1,u="",h=Zy,g=Ky,j=Vy;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError)),i=_v(n,1,!1,null,null,l,u,null,h,g,j,$v),n[Cn]=i.current,Jf(n),new gh(i)},Mo.hydrateRoot=function(n,i,l){if(!r(n))throw Error(a(299));var u=!1,h="",g=Zy,j=Ky,_=Vy,D=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(g=l.onUncaughtError),l.onCaughtError!==void 0&&(j=l.onCaughtError),l.onRecoverableError!==void 0&&(_=l.onRecoverableError),l.formState!==void 0&&(D=l.formState)),i=_v(n,1,!0,i,l??null,u,h,D,g,j,_,$v),i.context=zv(null),l=i.current,u=Tn(),u=$(u),h=oi(u),h.callback=null,li(l,h,u),l=u,i.current.lanes=l,Zi(i,l),gs(i),n[Cn]=i.current,Jf(n),new Ac(i)},Mo.version="19.2.4",Mo}var Qv;function wk(){if(Qv)return xh.exports;Qv=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(),xh.exports=jk(),xh.exports}var Nk=wk(),Ur=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(){}},Ck={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kk=class{#t=Ck;#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)}},ha=new kk;function _k(e){setTimeout(e,0)}var wa=typeof window>"u"||"Deno"in globalThis;function un(){}function zk(e,t){return typeof e=="function"?e(t):e}function nm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Oi(e,t){return typeof e=="function"?e(t):e}function Hn(e,t){return typeof e=="function"?e(t):e}function Yv(e,t){const{type:s="all",exact:a,fetchStatus:r,predicate:c,queryKey:d,stale:f}=e;if(d){if(a){if(t.queryHash!==Hm(d,t.options))return!1}else if(!Jo(t.queryKey,d))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||r&&r!==t.state.fetchStatus||c&&!c(t))}function Jv(e,t){const{exact:s,status:a,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Yo(t.options.mutationKey)!==Yo(c))return!1}else if(!Jo(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||r&&!r(t))}function Hm(e,t){return(t?.queryKeyHashFn||Yo)(e)}function Yo(e){return JSON.stringify(e,(t,s)=>sm(s)?Object.keys(s).sort().reduce((a,r)=>(a[r]=s[r],a),{}):s)}function Jo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Jo(e[s],t[s])):!1}var Ek=Object.prototype.hasOwnProperty;function Gm(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=Xv(e)&&Xv(t);if(!a&&!(sm(e)&&sm(t)))return t;const c=(a?e:Object.keys(e)).length,d=a?t:Object.keys(t),f=d.length,p=a?new Array(f):{};let m=0;for(let v=0;v<f;v++){const y=a?v:d[v],x=e[y],b=t[y];if(x===b){p[y]=x,(a?v<c:Ek.call(e,y))&&m++;continue}if(x===null||b===null||typeof x!="object"||typeof b!="object"){p[y]=b;continue}const w=Gm(x,b,s+1);p[y]=w,w===x&&m++}return c===f&&m===c?e:p}function cu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Xv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function sm(e){if(!Wv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Wv(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Wv(e){return Object.prototype.toString.call(e)==="[object Object]"}function Rk(e){return new Promise(t=>{ha.setTimeout(t,e)})}function im(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Gm(e,t):t}function Ak(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function Tk(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var Fm=Symbol();function Wb(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Fm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function eS(e,t){return typeof e=="function"?e(...t):!!e}function Ok(e,t,s){let a=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),a||(a=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),e}var Dk=class extends Ur{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!wa&&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"}},Zm=new Dk;function am(){let e,t;const s=new Promise((r,c)=>{e=r,t=c});s.status="pending",s.catch(()=>{});function a(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{a({status:"fulfilled",value:r}),e(r)},s.reject=r=>{a({status:"rejected",reason:r}),t(r)},s}var Lk=_k;function Mk(){let e=[],t=0,s=f=>{f()},a=f=>{f()},r=Lk;const c=f=>{t?e.push(f):r(()=>{s(f)})},d=()=>{const f=e;e=[],f.length&&r(()=>{a(()=>{f.forEach(p=>{s(p)})})})};return{batch:f=>{let p;t++;try{p=f()}finally{t--,t||d()}return p},batchCalls:f=>(...p)=>{c(()=>{f(...p)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{r=f}}}var Bt=Mk(),Uk=class extends Ur{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!wa&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}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(s=>{s(e)}))}isOnline(){return this.#t}},uu=new Uk;function $k(e){return Math.min(1e3*2**e,3e4)}function tS(e){return(e??"online")==="online"?uu.isOnline():!0}var rm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function nS(e){let t=!1,s=0,a;const r=am(),c=()=>r.status!=="pending",d=S=>{if(!c()){const C=new rm(S);x(C),e.onCancel?.(C)}},f=()=>{t=!0},p=()=>{t=!1},m=()=>Zm.isFocused()&&(e.networkMode==="always"||uu.isOnline())&&e.canRun(),v=()=>tS(e.networkMode)&&e.canRun(),y=S=>{c()||(a?.(),r.resolve(S))},x=S=>{c()||(a?.(),r.reject(S))},b=()=>new Promise(S=>{a=C=>{(c()||m())&&S(C)},e.onPause?.()}).then(()=>{a=void 0,c()||e.onContinue?.()}),w=()=>{if(c())return;let S;const C=s===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(k){S=Promise.reject(k)}Promise.resolve(S).then(y).catch(k=>{if(c())return;const E=e.retry??(wa?0:3),R=e.retryDelay??$k,z=typeof R=="function"?R(s,k):R,L=E===!0||typeof E=="number"&&s<E||typeof E=="function"&&E(s,k);if(t||!L){x(k);return}s++,e.onFail?.(s,k),Rk(z).then(()=>m()?void 0:b()).then(()=>{t?x(k):w()})})};return{promise:r,status:()=>r.status,cancel:d,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:p,canStart:v,start:()=>(v()?w():b().then(w),r)}}var sS=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nm(this.gcTime)&&(this.#t=ha.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wa?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ha.clearTimeout(this.#t),this.#t=void 0)}},Pk=class extends sS{#t;#e;#n;#i;#s;#r;#o;constructor(e){super(),this.#o=!1,this.#r=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=tx(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#r,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=tx(this.options);t.data!==void 0&&(this.setState(ex(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=im(this.state.data,e,this.options);return this.#a({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(un).catch(un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Hn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Fm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Oi(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:!Xb(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.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.#s&&(this.#o?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},r=()=>{const f=Wb(this.options,t),m=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(v),v})();return this.#o=!1,this.options.persister?this.options.persister(f,m,this):f(m)},d=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:r};return a(f),f})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#a({type:"fetch",meta:d.fetchOptions?.meta}),this.#s=nS({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:f=>{f instanceof rm&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(f,p)=>{this.#a({type:"failed",failureCount:f,error:p})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const f=await this.#s.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof rm){if(f.silent)return this.#s.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#a({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#a(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...iS(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...ex(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?a:void 0,a;case"error":const r=e.error;return{...s,error:r,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),Bt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function iS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ex(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function tx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,a=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Km=class extends Ur{constructor(e,t){super(),this.options=t,this.#t=e,this.#a=null,this.#o=am(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#r;#o;#a;#m;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),nx(this.#e,this.options)?this.#p():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return om(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return om(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,s=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 Hn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!cu(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&sx(this.#e,s,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==s||Hn(this.options.enabled,this.#e)!==Hn(t.enabled,this.#e)||Oi(this.options.staleTime,this.#e)!==Oi(t.staleTime,this.#e))&&this.#g();const r=this.#y();a&&(this.#e!==s||Hn(this.options.enabled,this.#e)!==Hn(t.enabled,this.#e)||r!==this.#l)&&this.#v(r)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(t,e);return Bk(this,s)&&(this.#i=s,this.#r=this.options,this.#s=this.#e.state),s}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(s,a)=>(this.trackProp(a),t?.(a),a==="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(s,a))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),s=this.#t.getQueryCache().build(this.#t,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#p(e){this.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(un)),t}#g(){this.#b();const e=Oi(this.options.staleTime,this.#e);if(wa||this.#i.isStale||!nm(e))return;const s=Xb(this.#i.dataUpdatedAt,e)+1;this.#c=ha.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#l=e,!(wa||Hn(this.options.enabled,this.#e)===!1||!nm(this.#l)||this.#l===0)&&(this.#u=ha.setInterval(()=>{(this.options.refetchIntervalInBackground||Zm.isFocused())&&this.#p()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(ha.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(ha.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const s=this.#e,a=this.options,r=this.#i,c=this.#s,d=this.#r,p=e!==s?e.state:this.#n,{state:m}=e;let v={...m},y=!1,x;if(t._optimisticResults){const T=this.hasListeners(),P=!T&&nx(e,t),J=T&&sx(e,s,t,a);(P||J)&&(v={...v,...iS(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=v;x=v.data;let C=!1;if(t.placeholderData!==void 0&&x===void 0&&S==="pending"){let T;r?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(T=r.data,C=!0):T=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,T!==void 0&&(S="success",x=im(r?.data,T,t),y=!0)}if(t.select&&x!==void 0&&!C)if(r&&x===c?.data&&t.select===this.#m)x=this.#d;else try{this.#m=t.select,x=t.select(x),x=im(r?.data,x,t),this.#d=x,this.#a=null}catch(T){this.#a=T}this.#a&&(b=this.#a,x=this.#d,w=Date.now(),S="error");const k=v.fetchStatus==="fetching",E=S==="pending",R=S==="error",z=E&&k,L=x!==void 0,A={status:S,fetchStatus:v.fetchStatus,isPending:E,isSuccess:S==="success",isError:R,isInitialLoading:z,isLoading:z,data:x,dataUpdatedAt:v.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:R&&!L,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:R&&L,isStale:Vm(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Hn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=A.data!==void 0,P=A.status==="error"&&!T,J=pe=>{P?pe.reject(A.error):T&&pe.resolve(A.data)},Q=()=>{const pe=this.#o=A.promise=am();J(pe)},se=this.#o;switch(se.status){case"pending":e.queryHash===s.queryHash&&J(se);break;case"fulfilled":(P||A.data!==se.value)&&Q();break;case"rejected":(!P||A.error!==se.reason)&&Q();break}}return A}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#r=this.options,this.#s.data!==void 0&&(this.#f=this.#e),cu(t,e))return;this.#i=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,r=typeof a=="function"?a():a;if(r==="all"||!r&&!this.#h.size)return!0;const c=new Set(r??this.#h);return this.options.throwOnError&&c.add("error"),Object.keys(this.#i).some(d=>{const f=d;return this.#i[f]!==e[f]&&c.has(f)})};this.#w({listeners:s()})}#j(){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()}#w(e){Bt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Ik(e,t){return Hn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function nx(e,t){return Ik(e,t)||e.state.data!==void 0&&om(e,t,t.refetchOnMount)}function om(e,t,s){if(Hn(t.enabled,e)!==!1&&Oi(t.staleTime,e)!=="static"){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&Vm(e,t)}return!1}function sx(e,t,s,a){return(e!==t||Hn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Vm(e,s)}function Vm(e,t){return Hn(t.enabled,e)!==!1&&e.isStaleByTime(Oi(t.staleTime,e))}function Bk(e,t){return!cu(e.getCurrentResult(),t)}function ix(e){return{onFetch:(t,s)=>{const a=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const y=w=>{Ok(w,()=>t.signal,()=>v=!0)},x=Wb(t.options,t.fetchOptions),b=async(w,S,C)=>{if(v)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return y(M),M})(),R=await x(E),{maxPages:z}=t.options,L=C?Tk:Ak;return{pages:L(w.pages,R,z),pageParams:L(w.pageParams,S,z)}};if(r&&c.length){const w=r==="backward",S=w?qk:ax,C={pages:c,pageParams:d},k=S(a,C);f=await b(C,k,w)}else{const w=e??c.length;do{const S=p===0?d[0]??a.initialPageParam:ax(a,f);if(p>0&&S==null)break;f=await b(f,S),p++}while(p<w)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=m}}}function ax(e,{pages:t,pageParams:s}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,s[a],s):void 0}function qk(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var Hk=class extends sS{#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||Gk(),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.#s({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=nS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",r=!this.#i.canStart();try{if(a)t();else{this.#s({type:"pending",variables:e,isPaused:r}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const d=await this.options.onMutate?.(e,s);d!==this.state.context&&this.#s({type:"pending",context:d,variables:e,isPaused:r})}const c=await this.#i.start();return await this.#n.config.onSuccess?.(c,e,this.state.context,this,s),await this.options.onSuccess?.(c,e,this.state.context,s),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(c,null,e,this.state.context,s),this.#s({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,e,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onError?.(c,e,this.state.context,s)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,s)}catch(d){Promise.reject(d)}throw this.#s({type:"error",error:c}),c}finally{this.#n.runNext(this)}}#s(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,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{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Bt.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Gk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var aS=class extends Ur{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,s){const a=new Hk({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:s});return this.add(a),a}add(e){this.#t.add(e);const t=Oc(e);if(typeof t=="string"){const s=this.#e.get(t);s?s.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Oc(e);if(typeof t=="string"){const s=this.#e.get(t);if(s)if(s.length>1){const a=s.indexOf(e);a!==-1&&s.splice(a,1)}else s[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Oc(e);if(typeof t=="string"){const a=this.#e.get(t)?.find(r=>r.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Oc(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Bt.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(s=>Jv(t,s))}findAll(e={}){return this.getAll().filter(t=>Jv(e,t))}notify(e){Bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Bt.batch(()=>Promise.all(e.map(t=>t.continue().catch(un))))}};function Oc(e){return e.options.scope?.id}function rx(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function Fk(e,t,s){const a=e.slice(0);return a[t]=s,a}var Zk=class extends Ur{#t;#e;#n;#i;#s;#r;#o;#a;#m;#d=[];constructor(e,t,s){super(),this.#t=e,this.#i=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,Bt.batch(()=>{const s=this.#s,a=this.#u(this.#n);a.forEach(v=>v.observer.setOptions(v.defaultedQueryOptions));const r=a.map(v=>v.observer),c=r.map(v=>v.getCurrentResult()),d=s.length!==r.length,f=r.some((v,y)=>v!==s[y]),p=d||f,m=p?!0:c.some((v,y)=>{const x=this.#e[y];return!x||!cu(v,x)});!p&&!m||(p&&(this.#d=a,this.#s=r),this.#e=c,this.hasListeners()&&(p&&(rx(s,r).forEach(v=>{v.destroy()}),rx(r,s).forEach(v=>{v.subscribe(y=>{this.#l(v,y)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const s=this.#u(e),a=s.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),r=s.map(c=>c.defaultedQueryOptions.queryHash);return[a,c=>this.#c(c??a,t,r),()=>this.#f(a,s)]}#f(e,t){return t.map((s,a)=>{const r=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,c=>{t.forEach(d=>{d.observer.trackProp(c)})})})}#c(e,t,s){if(t){const a=this.#m,r=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((c,d)=>c!==a[d]));return(!this.#r||this.#e!==this.#a||r||t!==this.#o)&&(this.#o=t,this.#a=this.#e,s!==void 0&&(this.#m=s),this.#r=Gm(this.#r,t(e))),this.#r}return e}#u(e){const t=new Map;this.#s.forEach(a=>{const r=a.options.queryHash;if(!r)return;const c=t.get(r);c?c.push(a):t.set(r,[a])});const s=[];return e.forEach(a=>{const r=this.#t.defaultQueryOptions(a),d=t.get(r.queryHash)?.shift()??new Km(this.#t,r);s.push({defaultedQueryOptions:r,observer:d})}),s}#l(e,t){const s=this.#s.indexOf(e);s!==-1&&(this.#e=Fk(this.#e,s,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#r,t=this.#f(this.#e,this.#d),s=this.#c(t,this.#i?.combine);e!==s&&Bt.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}},Kk=class extends Ur{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const a=t.queryKey,r=t.queryHash??Hm(a,t);let c=this.get(r);return c||(c=new Pk({client:e,queryKey:a,queryHash:r,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(a)}),this.add(c)),c}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(){Bt.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(s=>Yv(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>Yv(e,s)):t}notify(e){Bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Vk=class{#t;#e;#n;#i;#s;#r;#o;#a;constructor(e={}){this.#t=e.queryCache||new Kk,this.#e=e.mutationCache||new aS,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=Zm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=uu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=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),s=this.#t.build(this,t),a=s.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Oi(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:s})=>{const a=s.data;return[t,a]})}setQueryData(e,t,s){const a=this.defaultQueryOptions({queryKey:e}),c=this.#t.get(a.queryHash)?.state.data,d=zk(t,c);if(d!==void 0)return this.#t.build(this,a).setData(d,{...s,manual:!0})}setQueriesData(e,t,s){return Bt.batch(()=>this.#t.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;Bt.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#t;return Bt.batch(()=>(s.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},a=Bt.batch(()=>this.#t.findAll(e).map(r=>r.cancel(s)));return Promise.all(a).then(un).catch(un)}invalidateQueries(e,t={}){return Bt.batch(()=>(this.#t.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},a=Bt.batch(()=>this.#t.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let c=r.fetch(void 0,s);return s.throwOnError||(c=c.catch(un)),r.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(un)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#t.build(this,t);return s.isStaleByTime(Oi(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(un).catch(un)}fetchInfiniteQuery(e){return e.behavior=ix(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(un).catch(un)}ensureInfiniteQueryData(e){return e.behavior=ix(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return uu.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(Yo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(a=>{Jo(e,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(e,t){this.#s.set(Yo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(a=>{Jo(e,a.mutationKey)&&Object.assign(s,a.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Hm(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===Fm&&(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()}},rS=N.createContext(void 0),oS=e=>{const t=N.useContext(rS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Qk=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(rS.Provider,{value:e,children:t})),lS=N.createContext(!1),cS=()=>N.useContext(lS);lS.Provider;function Yk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Jk=N.createContext(Yk()),uS=()=>N.useContext(Jk),dS=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?eS(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},fS=e=>{N.useEffect(()=>{e.clearReset()},[e])},hS=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||eS(s,[e.error,a])),mS=e=>{if(e.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...r)=>s(a(...r)):s(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Xk=(e,t)=>e.isLoading&&e.isFetching&&!t,lm=(e,t)=>e?.suspense&&t.isPending,cm=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Wk({queries:e,...t},s){const a=oS(),r=cS(),c=uS(),d=N.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=r?"isRestoring":"optimistic",C}),[e,a,r]);d.forEach(S=>{mS(S);const C=a.getQueryCache().get(S.queryHash);dS(S,c,C)}),fS(c);const[f]=N.useState(()=>new Zk(a,d,t)),[p,m,v]=f.getOptimisticResult(d,t.combine),y=!r&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(S=>y?f.subscribe(Bt.batchCalls(S)):un,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),N.useEffect(()=>{f.setQueries(d,t)},[d,t,f]);const b=p.some((S,C)=>lm(d[C],S))?p.flatMap((S,C)=>{const k=d[C];if(k&&lm(k,S)){const E=new Km(a,k);return cm(k,E,c)}return[]}):[];if(b.length>0)throw Promise.all(b);const w=p.find((S,C)=>{const k=d[C];return k&&hS({result:S,errorResetBoundary:c,throwOnError:k.throwOnError,query:a.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(w?.error)throw w.error;return m(v())}function e_(e,t,s){const a=cS(),r=uS(),c=oS(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=c.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",mS(d),dS(d,r,f),fS(r);const p=!c.getQueryCache().get(d.queryHash),[m]=N.useState(()=>new t(c,d)),v=m.getOptimisticResult(d),y=!a&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(x=>{const b=y?m.subscribe(Bt.batchCalls(x)):un;return m.updateResult(),b},[m,y]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),N.useEffect(()=>{m.setOptions(d)},[d,m]),lm(d,v))throw cm(d,m,r);if(hS({result:v,errorResetBoundary:r,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw v.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,v),d.experimental_prefetchInRender&&!wa&&Xk(v,a)&&(p?cm(d,m,r):f?.promise)?.catch(un).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?v:m.trackResult(v)}function Fo(e,t){return e_(e,Km)}var Dc=typeof window<"u"?N.useLayoutEffect:N.useEffect;function wh(e){const t=N.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function t_(e,t,s={},a={}){N.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([c])=>{t(c)},s);return r.observe(e.current),()=>{r.disconnect()}},[t,s,a.disabled,e])}function n_(e){const t=N.useRef(null);return N.useImperativeHandle(e,()=>t.current,[]),t}var s_=!1;function Xo(e){return e[e.length-1]}function i_(e){return typeof e=="function"}function Ei(e,t){return i_(e)?e(t):e}var a_=Object.prototype.hasOwnProperty,ox=Object.prototype.propertyIsEnumerable,r_=()=>Object.create(null),ca=(e,t)=>ma(e,t,r_);function ma(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const r=t,c=ux(e)&&ux(r);if(!c&&!(du(e)&&du(r)))return r;const d=c?e:lx(e);if(!d)return r;const f=c?r:lx(r);if(!f)return r;const p=d.length,m=f.length,v=c?new Array(m):s();let y=0;for(let x=0;x<m;x++){const b=c?x:f[x],w=e[b],S=r[b];if(w===S){v[b]=w,(c?x<p:a_.call(e,b))&&y++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){v[b]=S;continue}const C=ma(w,S,s,a+1);v[b]=C,C===w&&y++}return p===m&&y===p?e:v}function lx(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!ox.call(e,r))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return t;const a=t;for(const r of s){if(!ox.call(e,r))return!1;a.push(r)}return a}function du(e){if(!cx(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!cx(s)||!s.hasOwnProperty("isPrototypeOf"))}function cx(e){return Object.prototype.toString.call(e)==="[object Object]"}function ux(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xa(e,t,s){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 a=0,r=e.length;a<r;a++)if(!xa(e[a],t[a],s))return!1;return!0}if(du(e)&&du(t)){const a=s?.ignoreUndefined??!0;if(s?.partial){for(const d in t)if((!a||t[d]!==void 0)&&!xa(e[d],t[d],s))return!1;return!0}let r=0;if(!a)r=Object.keys(e).length;else for(const d in e)e[d]!==void 0&&r++;let c=0;for(const d in t)if((!a||t[d]!==void 0)&&(c++,c>r||!xa(e[d],t[d],s)))return!1;return r===c}return!1}function Ar(e){let t,s;const a=new Promise((r,c)=>{t=r,s=c});return a.status="pending",a.resolve=r=>{a.status="resolved",a.value=r,t(r),e?.(r)},a.reject=r=>{a.status="rejected",s(r)},a}function Wo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function o_(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function dx(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return o_(t)}var l_=["http:","https:","mailto:","tel:"];function fu(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}function Uo(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 s=0,a="",r;for(;(r=t.exec(e))!==null;)a+=dx(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+dx(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function c_(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function hu(e){const t=new Map;let s,a;const r=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,a&&(a.next=c,c.prev=a)):(c.next.prev=void 0,s=c.next,c.next=void 0,a&&(c.prev=a,a.next=c)),a=c)};return{get(c){const d=t.get(c);if(d)return r(d),d.value},set(c,d){if(t.size>=e&&s){const p=s;t.delete(p.key),p.next&&(s=p.next,p.next.prev=void 0),p===a&&(a=void 0)}const f=t.get(c);if(f)f.value=d,r(f);else{const p={key:c,value:d,prev:a};a&&(a.next=p),a=p,s||(s=p),t.set(c,p)}},clear(){t.clear(),s=void 0,a=void 0}}}var u_="Invariant failed";function $i(e,t){if(!e)throw new Error(u_)}var pa=4,pS=5;function d_(e){const t=e.indexOf("{");if(t===-1)return null;const s=e.indexOf("}",t);return s===-1||t+1>=e.length?null:[t,s]}function Qm(e,t,s=new Uint16Array(6)){const a=e.indexOf("/",t),r=a===-1?e.length:a,c=e.substring(t,r);if(!c||!c.includes("$"))return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s;if(c==="$"){const f=e.length;return s[0]=2,s[1]=t,s[2]=t,s[3]=f,s[4]=f,s[5]=f,s}if(c.charCodeAt(0)===36)return s[0]=1,s[1]=t,s[2]=t+1,s[3]=r,s[4]=r,s[5]=r,s;const d=d_(c);if(d){const[f,p]=d,m=c.charCodeAt(f+1);if(m===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const v=f+3,y=p;if(v<y)return s[0]=3,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+p+1,s[5]=r,s}}else if(m===36){const v=f+1,y=f+2;return y===p?(s[0]=2,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+p+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+y,s[3]=t+p,s[4]=t+p+1,s[5]=r,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s}function Ru(e,t,s,a,r,c,d){d?.(s);let f=a;{const p=s.fullPath??s.from,m=p.length,v=s.options?.caseSensitive??e,y=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<m;){const b=Qm(p,f,t);let w;const S=f,C=b[5];switch(f=C+1,c++,b[0]){case 0:{const k=p.substring(b[2],b[3]);if(v){const E=r.static?.get(k);if(E)w=E;else{r.static??=new Map;const R=ga(s.fullPath??s.from);R.parent=r,R.depth=c,w=R,r.static.set(k,R)}}else{const E=k.toLowerCase(),R=r.staticInsensitive?.get(E);if(R)w=R;else{r.staticInsensitive??=new Map;const z=ga(s.fullPath??s.from);z.parent=r,z.depth=c,w=z,r.staticInsensitive.set(E,z)}}break}case 1:{const k=p.substring(S,b[1]),E=p.substring(b[4],C),R=v&&!!(k||E),z=k?R?k:k.toLowerCase():void 0,L=E?R?E:E.toLowerCase():void 0,M=!y&&r.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===z&&A.suffix===L);if(M)w=M;else{const A=Ch(1,s.fullPath??s.from,R,z,L);w=A,A.depth=c,A.parent=r,r.dynamic??=[],r.dynamic.push(A)}break}case 3:{const k=p.substring(S,b[1]),E=p.substring(b[4],C),R=v&&!!(k||E),z=k?R?k:k.toLowerCase():void 0,L=E?R?E:E.toLowerCase():void 0,M=!y&&r.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===z&&A.suffix===L);if(M)w=M;else{const A=Ch(3,s.fullPath??s.from,R,z,L);w=A,A.parent=r,A.depth=c,r.optional??=[],r.optional.push(A)}break}case 2:{const k=p.substring(S,b[1]),E=p.substring(b[4],C),R=v&&!!(k||E),z=k?R?k:k.toLowerCase():void 0,L=E?R?E:E.toLowerCase():void 0,M=Ch(2,s.fullPath??s.from,R,z,L);w=M,M.parent=r,M.depth=c,r.wildcard??=[],r.wildcard.push(M)}}r=w}if(y&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const b=ga(s.fullPath??s.from);b.kind=pS,b.parent=r,c++,b.depth=c,r.pathless??=[],r.pathless.push(b),r=b}const x=(s.path||!s.children)&&!s.isRoot;if(x&&p.endsWith("/")){const b=ga(s.fullPath??s.from);b.kind=pa,b.parent=r,c++,b.depth=c,r.index=b,r=b}r.parse=s.options?.params?.parse??null,r.skipOnParamError=y,r.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,x&&!r.route&&(r.route=s,r.fullPath=s.fullPath??s.from)}if(s.children)for(const p of s.children)Ru(e,t,p,f,r,c,d)}function Nh(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 _i(e){if(e.pathless)for(const t of e.pathless)_i(t);if(e.static)for(const t of e.static.values())_i(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())_i(t);if(e.dynamic?.length){e.dynamic.sort(Nh);for(const t of e.dynamic)_i(t)}if(e.optional?.length){e.optional.sort(Nh);for(const t of e.optional)_i(t)}if(e.wildcard?.length){e.wildcard.sort(Nh);for(const t of e.wildcard)_i(t)}}function ga(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 Ch(e,t,s,a,r){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:s,prefix:a,suffix:r}}function f_(e,t){const s=ga("/"),a=new Uint16Array(6);for(const r of e)Ru(!1,a,r,1,s,0);_i(s),t.masksTree=s,t.flatCache=hu(1e3)}function h_(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const a=Ym(e,t.masksTree);return t.flatCache.set(e,a),a}function m_(e,t,s,a,r){e||="/",a||="/";const c=t?`case\0${e}`:e;let d=r.singleCache.get(c);return d||(d=ga("/"),Ru(t,new Uint16Array(6),{from:e},1,d,0),r.singleCache.set(c,d)),Ym(a,d,s)}function p_(e,t,s=!1){const a=s?e:`nofuzz\0${e}`,r=t.matchCache.get(a);if(r!==void 0)return r;e||="/";let c;try{c=Ym(e,t.segmentTree,s)}catch(d){if(d instanceof URIError)c=null;else throw d}return c&&(c.branch=v_(c.route)),t.matchCache.set(a,c),c}function g_(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function y_(e,t=!1,s){const a=ga(e.fullPath),r=new Uint16Array(6),c={},d={};let f=0;return Ru(t,r,e,1,a,0,p=>{if(s?.(p,f),$i(!(p.id in c),`Duplicate routes found with id: ${String(p.id)}`),c[p.id]=p,f!==0&&p.path){const m=g_(p.fullPath);(!d[m]||p.fullPath.endsWith("/"))&&(d[m]=p)}f++}),_i(a),{processedTree:{segmentTree:a,singleCache:hu(1e3),matchCache:hu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:d}}function Ym(e,t,s=!1){const a=e.split("/"),r=b_(e,a,t,s);if(!r)return null;const[c]=gS(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function gS(e,t,s){const a=x_(s.node);let r=null;const c=Object.create(null);let d=s.extract?.part??0,f=s.extract?.node??0,p=s.extract?.path??0,m=s.extract?.segment??0;for(;f<a.length;d++,f++,p++,m++){const v=a[f];if(v.kind===pa)break;if(v.kind===pS){m--,d--,p--;continue}const y=t[d],x=p;if(y&&(p+=y.length),v.kind===1){r??=s.node.fullPath.split("/");const b=r[m],w=v.prefix?.length??0;if(b.charCodeAt(w)===123){const S=v.suffix?.length??0,C=b.substring(w+2,b.length-S-1),k=y.substring(w,y.length-S);c[C]=decodeURIComponent(k)}else{const S=b.substring(1);c[S]=decodeURIComponent(y)}}else if(v.kind===3){if(s.skipped&1<<f){d--,p=x-1;continue}r??=s.node.fullPath.split("/");const b=r[m],w=v.prefix?.length??0,S=v.suffix?.length??0,C=b.substring(w+3,b.length-S-1),k=v.suffix||v.prefix?y.substring(w,y.length-S):y;k&&(c[C]=decodeURIComponent(k))}else if(v.kind===2){const b=v,w=e.substring(x+(b.prefix?.length??0),e.length-(b.suffix?.length??0)),S=decodeURIComponent(w);c["*"]=S,c._splat=S;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:d,node:f,path:p,segment:m}]}function v_(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function x_(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function b_(e,t,s,a){if(e==="/"&&s.index)return{node:s.index,skipped:0};const r=!Xo(t),c=r&&e!=="/",d=t.length-(r?1:0),f=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let p=null,m=null,v=null;for(;f.length;){const y=f.pop(),{node:x,index:b,skipped:w,depth:S,statics:C,dynamics:k,optionals:E}=y;let{extract:R,rawParams:z,parsedParams:L}=y;if(x.skipOnParamError){if(!kh(e,t,y))continue;z=y.rawParams,R=y.extract,L=y.parsedParams}a&&x.route&&x.kind!==pa&&$o(m,y)&&(m=y);const M=b===d;if(M&&(x.route&&!c&&$o(v,y)&&(v=y),!x.optional&&!x.wildcard&&!x.index&&!x.pathless))continue;const A=M?void 0:t[b];let T;if(M&&x.index){const P={node:x.index,index:b,skipped:w,depth:S+1,statics:C,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L};let J=!0;if(x.index.skipOnParamError&&(kh(e,t,P)||(J=!1)),J){if(C===d&&!k&&!E&&!w)return P;$o(v,P)&&(v=P)}}if(x.wildcard&&$o(p,y))for(const P of x.wildcard){const{prefix:J,suffix:Q}=P;if(J&&(M||!(P.caseSensitive?A:T??=A.toLowerCase()).startsWith(J)))continue;if(Q){if(M)continue;const pe=t.slice(b).join("/").slice(-Q.length);if((P.caseSensitive?pe:pe.toLowerCase())!==Q)continue}const se={node:P,index:d,skipped:w,depth:S,statics:C,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L};if(!(P.skipOnParamError&&!kh(e,t,se))){p=se;break}}if(x.optional){const P=w|1<<S,J=S+1;for(let Q=x.optional.length-1;Q>=0;Q--){const se=x.optional[Q];f.push({node:se,index:b,skipped:P,depth:J,statics:C,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L})}if(!M)for(let Q=x.optional.length-1;Q>=0;Q--){const se=x.optional[Q],{prefix:pe,suffix:ke}=se;if(pe||ke){const je=se.caseSensitive?A:T??=A.toLowerCase();if(pe&&!je.startsWith(pe)||ke&&!je.endsWith(ke))continue}f.push({node:se,index:b+1,skipped:w,depth:J,statics:C,dynamics:k,optionals:E+1,extract:R,rawParams:z,parsedParams:L})}}if(!M&&x.dynamic&&A)for(let P=x.dynamic.length-1;P>=0;P--){const J=x.dynamic[P],{prefix:Q,suffix:se}=J;if(Q||se){const pe=J.caseSensitive?A:T??=A.toLowerCase();if(Q&&!pe.startsWith(Q)||se&&!pe.endsWith(se))continue}f.push({node:J,index:b+1,skipped:w,depth:S+1,statics:C,dynamics:k+1,optionals:E,extract:R,rawParams:z,parsedParams:L})}if(!M&&x.staticInsensitive){const P=x.staticInsensitive.get(T??=A.toLowerCase());P&&f.push({node:P,index:b+1,skipped:w,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L})}if(!M&&x.static){const P=x.static.get(A);P&&f.push({node:P,index:b+1,skipped:w,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L})}if(x.pathless){const P=S+1;for(let J=x.pathless.length-1;J>=0;J--){const Q=x.pathless[J];f.push({node:Q,index:b,skipped:w,depth:P,statics:C,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L})}}}if(v&&p)return $o(p,v)?v:p;if(v)return v;if(p)return p;if(a&&m){let y=m.index;for(let b=0;b<m.index;b++)y+=t[b].length;const x=y===e.length?"/":e.slice(y);return m.rawParams??=Object.create(null),m.rawParams["**"]=decodeURIComponent(x),m}return null}function kh(e,t,s){try{const[a,r]=gS(e,t,s);s.rawParams=a,s.extract=r;const c=s.node.parse(a);return s.parsedParams=Object.assign(Object.create(null),s.parsedParams,c),!0}catch{return null}}function $o(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===pa)>(e.node.kind===pa)||t.node.kind===pa==(e.node.kind===pa)&&t.depth>e.depth))):!0}function eu(e){return Jm(e.filter(t=>t!==void 0).join("/"))}function Jm(e){return e.replace(/\/{2,}/g,"/")}function yS(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Di(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function vS(e){return Di(yS(e))}function mu(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function S_(e,t,s){return mu(e,s)===mu(t,s)}function j_({base:e,to:t,trailingSlash:s="never",cache:a}){const r=t.startsWith("/"),c=!r&&t===".";let d;if(a){d=r?t:c?e:e+"\0"+t;const y=a.get(d);if(y)return y}let f;if(c)f=e.split("/");else if(r)f=t.split("/");else{for(f=e.split("/");f.length>1&&Xo(f)==="";)f.pop();const y=t.split("/");for(let x=0,b=y.length;x<b;x++){const w=y[x];w===""?x?x===b-1&&f.push(w):f=[w]:w===".."?f.pop():w==="."||f.push(w)}}f.length>1&&(Xo(f)===""?s==="never"&&f.pop():s==="always"&&f.push(""));let p,m="";for(let y=0;y<f.length;y++){y>0&&(m+="/");const x=f[y];if(!x)continue;p=Qm(x,0,p);const b=p[0];if(b===0){m+=x;continue}const w=p[5],S=x.substring(0,p[1]),C=x.substring(p[4],w),k=x.substring(p[2],p[3]);b===1?m+=S||C?`${S}{$${k}}${C}`:`$${k}`:b===2?m+=S||C?`${S}{$}${C}`:"$":m+=`${S}{-$${k}}${C}`}m=Jm(m);const v=m||"/";return d&&a&&a.set(d,v),v}function w_(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),s=Array.from(t.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(s,"g");return r=>r.replace(a,c=>t.get(c)??c)}function _h(e,t,s){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(r=>hx(r,s)).join("/"):hx(a,s)}function fx({path:e,params:t,decoder:s,...a}){let r=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:r};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:r};const d=e.length;let f=0,p,m="";for(;f<d;){const v=f;p=Qm(e,v,p);const y=p[5];if(f=y+1,v===y)continue;const x=p[0];if(x===0){m+="/"+e.substring(v,y);continue}if(x===2){const b=t._splat;c._splat=b,c["*"]=b;const w=e.substring(v,p[1]),S=e.substring(p[4],y);if(!b){r=!0,(w||S)&&(m+="/"+w+S);continue}const C=_h("_splat",t,s);m+="/"+w+C+S;continue}if(x===1){const b=e.substring(p[2],p[3]);!r&&!(b in t)&&(r=!0),c[b]=t[b];const w=e.substring(v,p[1]),S=e.substring(p[4],y),C=_h(b,t,s)??"undefined";m+="/"+w+C+S;continue}if(x===3){const b=e.substring(p[2],p[3]),w=t[b];if(w==null)continue;c[b]=w;const S=e.substring(v,p[1]),C=e.substring(p[4],y),k=_h(b,t,s)??"";m+="/"+S+k+C;continue}}return e.endsWith("/")&&(m+="/"),{usedParams:c,interpolatedPath:m||"/",isMissingParams:r}}function hx(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function fn(e){return!!e?.isNotFound}function N_(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var um="tsr-scroll-restoration-v1_3",C_=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function k_(){const e=N_();if(!e)return null;const t=e.getItem(um);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=Ei(a,s)||s;try{e.setItem(um,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Lc=k_(),__=e=>e.state.__TSR_key||e.href;function z_(e){const t=[];let s;for(;s=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${t.reverse().join(" > ")}`.toLowerCase()}var pu=!1;function E_({storageKey:e,key:t,behavior:s,shouldScrollRestoration:a,scrollToTopSelectors:r,location:c}){let d;try{d=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(m){console.error(m);return}const f=t||window.history.state?.__TSR_key,p=d[f];pu=!0;e:{if(a&&p&&Object.keys(p).length>0){for(const y in p){const x=p[y];if(y==="window")window.scrollTo({top:x.scrollY,left:x.scrollX,behavior:s});else if(y){const b=document.querySelector(y);b&&(b.scrollLeft=x.scrollX,b.scrollTop=x.scrollY)}}break e}const m=(c??window.location).hash.split("#",2)[1];if(m){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const x=document.getElementById(m);x&&x.scrollIntoView(y)}break e}const v={top:0,left:0,behavior:s};if(window.scrollTo(v),r)for(const y of r){if(y==="window")continue;const x=typeof y=="function"?y():document.querySelector(y);x&&x.scrollTo(v)}}pu=!1}function R_(e,t){if(!Lc||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Lc))return;e.isScrollRestorationSetup=!0,pu=!1;const s=e.options.getScrollRestorationKey||__;window.history.scrollRestoration="manual";const a=r=>{if(pu||!e.isScrollRestoring)return;let c="";if(r.target===document||r.target===window)c="window";else{const f=r.target.getAttribute("data-scroll-restoration-id");f?c=`[data-scroll-restoration-id="${f}"]`:c=z_(r.target)}const d=s(e.state.location);Lc.set(f=>{const p=f[d]||={},m=p[c]||={};if(c==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(c){const v=document.querySelector(c);v&&(m.scrollX=v.scrollLeft||0,m.scrollY=v.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",C_(a,100),!0),e.subscribe("onRendered",r=>{const c=s(r.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(E_({storageKey:um,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Lc.set(d=>(d[c]||={},d)))})}function A_(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const s=document.getElementById(e.state.location.hash);s&&s.scrollIntoView(t)}}}function T_(e,t=String){const s=new URLSearchParams;for(const a in e){const r=e[a];r!==void 0&&s.set(a,t(r))}return s.toString()}function zh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function O_(e){const t=new URLSearchParams(e),s=Object.create(null);for(const[a,r]of t.entries()){const c=s[a];c==null?s[a]=zh(r):Array.isArray(c)?c.push(zh(r)):s[a]=[c,zh(r)]}return s}var D_=M_(JSON.parse),L_=U_(JSON.stringify,JSON.parse);function M_(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=O_(t);for(const a in s){const r=s[a];if(typeof r=="string")try{s[a]=e(r)}catch{}}return s}}function U_(e,t){const s=typeof t=="function";function a(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(s&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const c=T_(r,a);return c?`?${c}`:""}}var ba="__root__";function Xm(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 s=new Response(null,{status:e.statusCode,headers:t});if(s.options=e,e.throw)throw s;return s}function Sn(e){return e instanceof Response&&!!e.options}function $_(e){return{input:({url:t})=>{for(const s of e)t=dm(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=xS(e[s],t);return t}}}function P_(e){const t=vS(e.basepath),s=`/${t}`,a=`${s}/`,r=e.caseSensitive?s:s.toLowerCase(),c=e.caseSensitive?a:a.toLowerCase();return{input:({url:d})=>{const f=e.caseSensitive?d.pathname:d.pathname.toLowerCase();return f===r?d.pathname="/":f.startsWith(c)&&(d.pathname=d.pathname.slice(s.length)),d},output:({url:d})=>(d.pathname=eu(["/",t,d.pathname]),d)}}function dm(e,t){const s=e?.input?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function xS(e,t){const s=e?.output?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}var vt=(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))(vt||{});function bS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:d,shallowPropagate:f};function a(m,v,y){const x=v.depsTail;if(x!==void 0&&x.dep===m)return;const b=x!==void 0?x.nextDep:v.deps;if(b!==void 0&&b.dep===m){b.version=y,v.depsTail=b;return}const w=m.subsTail;if(w!==void 0&&w.version===y&&w.sub===v)return;const S=v.depsTail=m.subsTail={version:y,dep:m,sub:v,prevDep:x,nextDep:b,prevSub:w,nextSub:void 0};b!==void 0&&(b.prevDep=S),x!==void 0?x.nextDep=S:v.deps=S,w!==void 0?w.nextSub=S:m.subs=S}function r(m,v=m.sub){const y=m.dep,x=m.prevDep,b=m.nextDep,w=m.nextSub,S=m.prevSub;return b!==void 0?b.prevDep=x:v.depsTail=x,x!==void 0?x.nextDep=b:v.deps=b,w!==void 0?w.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=w:(y.subs=w)===void 0&&s(y),b}function c(m){let v=m.nextSub,y;e:do{const x=m.sub;let b=x.flags;if(b&60?b&12?b&4?!(b&48)&&p(m,x)?(x.flags=b|40,b&=1):b=0:x.flags=b&-9|32:b=0:x.flags=b|32,b&2&&t(x),b&1){const w=x.subs;if(w!==void 0){const S=(m=w).nextSub;S!==void 0&&(y={value:v,prev:y},v=S);continue}}if((m=v)!==void 0){v=m.nextSub;continue}for(;y!==void 0;)if(m=y.value,y=y.prev,m!==void 0){v=m.nextSub;continue e}break}while(!0)}function d(m,v){let y,x=0,b=!1;e:do{const w=m.dep,S=w.flags;if(v.flags&16)b=!0;else if((S&17)===17){if(e(w)){const C=w.subs;C.nextSub!==void 0&&f(C),b=!0}}else if((S&33)===33){(m.nextSub!==void 0||m.prevSub!==void 0)&&(y={value:m,prev:y}),m=w.deps,v=w,++x;continue}if(!b){const C=m.nextDep;if(C!==void 0){m=C;continue}}for(;x--;){const C=v.subs,k=C.nextSub!==void 0;if(k?(m=y.value,y=y.prev):m=C,b){if(e(v)){k&&f(C),v=m.sub;continue}b=!1}else v.flags&=-33;v=m.sub;const E=m.nextDep;if(E!==void 0){m=E;continue e}}return b}while(!0)}function f(m){do{const v=m.sub,y=v.flags;(y&48)===32&&(v.flags=y|16,(y&6)===2&&t(v))}while((m=m.nextSub)!==void 0)}function p(m,v){let y=v.depsTail;for(;y!==void 0;){if(y===m)return!0;y=y.prevDep}return!1}}let Wm=0,ua=0,Zo=0;const Hs=[],{link:L4,unlink:SS,propagate:M4,checkDirty:I_,shallowPropagate:U4}=bS({update(e){return e.depsTail!==void 0?G_(e):F_(e)},notify(e){let t=Zo,s=t;do if(Hs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Zo=t;s<--t;){const a=Hs[s];Hs[s++]=Hs[t],Hs[t]=a}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Au(e)):V_.call(e)}});function B_(){return Wm}function q_(){++Wm}function H_(){--Wm||K_()}function G_(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Au(e)}}function F_(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Z_(e){const t=e.flags;if(t&16||t&32&&I_(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Au(e)}}else e.flags=2}function K_(){try{for(;ua<Zo;){const e=Hs[ua];Hs[ua++]=void 0,Z_(e)}}finally{for(;ua<Zo;){const e=Hs[ua];Hs[ua++]=void 0,e.flags|=10}ua=0,Zo=0}}function V_(){this.depsTail=void 0,this.flags=0,Au(this);const e=this.subs;e!==void 0&&SS(e)}function Au(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=SS(s,e)}function ep(e,t,s){const a=typeof e=="object",r=a?e:void 0;return{next:(a?e.next:e)?.bind(r),error:(a?e.error:t)?.bind(r),complete:(a?e.complete:s)?.bind(r)}}const fm=[];let tu=0;const{link:mx,unlink:Q_,propagate:Y_,checkDirty:jS,shallowPropagate:px}=bS({update(e){return e._update()},notify(e){fm[hm++]=e,e.flags&=~vt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=vt.Mutable|vt.Dirty,gu(e))}});let Mc=0,hm=0,ys;function gu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=Q_(s,e)}function wS(){if(!(B_()>0)){for(;Mc<hm;){const e=fm[Mc];fm[Mc++]=void 0,e.notify()}Mc=0,hm=0}}function NS(e,t){const s=typeof e=="function",a=e,r={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?vt.None:vt.Mutable,get(){return ys!==void 0&&mx(r,ys,tu),r._snapshot},subscribe(c){const d=ep(c),f={current:!1},p=J_(()=>{r.get(),f.current?d.next?.(r._snapshot):f.current=!0});return{unsubscribe:()=>{p.stop()}}},_update(c){const d=ys,f=Object.is;if(s)ys=r,++tu,r.depsTail=void 0;else if(c===void 0)return!1;s&&(r.flags=vt.Mutable|vt.RecursedCheck);try{const p=r._snapshot,m=typeof c=="function"?c(p):c===void 0&&s?a(p):c;return p===void 0||!f(p,m)?(r._snapshot=m,!0):!1}finally{ys=d,s&&(r.flags&=~vt.RecursedCheck),gu(r)}}};return s?(r.flags=vt.Mutable|vt.Dirty,r.get=function(){const c=r.flags;if(c&vt.Dirty||c&vt.Pending&&jS(r.deps,r)){if(r._update()){const d=r.subs;d!==void 0&&px(d)}}else c&vt.Pending&&(r.flags=c&~vt.Pending);return ys!==void 0&&mx(r,ys,tu),r._snapshot}):r.set=function(c){if(r._update(c)){const d=r.subs;d!==void 0&&(Y_(d),px(d),wS())}},r}function J_(e){const t=()=>{const a=ys;ys=s,++tu,s.depsTail=void 0,s.flags=vt.Watching|vt.RecursedCheck;try{return e()}finally{ys=a,s.flags&=~vt.RecursedCheck,gu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:vt.Watching|vt.RecursedCheck,notify(){const a=this.flags;a&vt.Dirty||a&vt.Pending&&jS(this.deps,this)?t():this.flags=vt.Watching},stop(){this.flags=vt.None,this.depsTail=void 0,gu(this)}};return t(),s}class X_{constructor(t){this.atom=NS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ep(t))}}class W_{constructor(t){this.atom=NS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ep(t))}}function ez(e){return typeof e=="function"?new W_(e):new X_(e)}function tz(e){try{q_(),e()}finally{H_(),wS()}}function Ko(e){let t;return tz(()=>{t=e()}),t}var mm=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Tu=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),Sa=(e,t,s=!0)=>{const a={...e.router.options.context??{}},r=s?t:t-1;for(let c=0;c<=r;c++){const d=e.matches[c];if(!d)continue;const f=e.router.getMatch(d.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},gx=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,a=e.matches.findIndex(d=>d.routeId===e.router.routeTree.id),r=a>=0?a:0;let c=s?e.matches.findIndex(d=>d.routeId===s):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=r);for(let d=c;d>=0;d--){const f=e.matches[d];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return d}return s?c:r},Ri=(e,t,s)=>{if(!(!Sn(s)&&!fn(s)))throw Sn(s)&&s.redirectHandled&&!s.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=s,e.updateMatch(t.id,a=>({...a,status:Sn(s)?"redirected":a.status==="pending"?"success":a.status,context:Sa(e,t.index),isFetching:!1,error:s})),fn(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Sn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},CS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},yx=(e,t,s)=>{const a=Sa(e,s);e.updateMatch(t,r=>({...r,context:a}))},Po=(e,t,s,a)=>{const{id:r,routeId:c}=e.matches[t],d=e.router.looseRoutesById[c];if(s instanceof Promise)throw s;s.routerCode=a,e.firstBadMatchIndex??=t,Ri(e,e.router.getMatch(r),s);try{d.options.onError?.(s)}catch(f){s=f,Ri(e,e.router.getMatch(r),s)}e.updateMatch(r,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Sn(s)&&!fn(s)&&(e.serialError??=s)},kS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Tu(e,t)&&(s.options.loader||s.options.beforeLoad||zS(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{mm(e)},r);a._nonReactive.pendingTimeout=c}},nz=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;kS(e,t,s,a);const r=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Ri(e,c,c.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(r):r()},sz=(e,t,s,a)=>{const r=e.router.getMatch(t);let c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Ar(()=>{c?.resolve(),c=void 0});const{paramsError:d,searchError:f}=r;d&&Po(e,s,d,"PARSE_PARAMS"),f&&Po(e,s,f,"VALIDATE_SEARCH"),kS(e,t,a,r);const p=new AbortController;let m=!1;const v=()=>{m||(m=!0,e.updateMatch(t,z=>({...z,isFetching:"beforeLoad",fetchCount:z.fetchCount+1,abortController:p})))},y=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,z=>({...z,isFetching:!1}))};if(!a.options.beforeLoad){Ko(()=>{v(),y()});return}r._nonReactive.beforeLoadPromise=Ar();const x={...Sa(e,s,!1),...r.__routeContext},{search:b,params:w,cause:S}=r,C=Tu(e,t),k={search:b,abortController:p,params:w,preload:C,context:x,location:e.location,navigate:z=>e.router.navigate({...z,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":S,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},E=z=>{if(z===void 0){Ko(()=>{v(),y()});return}(Sn(z)||fn(z))&&(v(),Po(e,s,z,"BEFORE_LOAD")),Ko(()=>{v(),e.updateMatch(t,L=>({...L,__beforeLoadContext:z})),y()})};let R;try{if(R=a.options.beforeLoad(k),Wo(R))return v(),R.catch(z=>{Po(e,s,z,"BEFORE_LOAD")}).then(E)}catch(z){v(),Po(e,s,z,"BEFORE_LOAD")}E(R)},iz=(e,t)=>{const{id:s,routeId:a}=e.matches[t],r=e.router.looseRoutesById[a],c=()=>f(),d=()=>sz(e,s,t,r),f=()=>{if(CS(e,s))return;const p=nz(e,s,r);return Wo(p)?p.then(d):d()};return c()},az=(e,t,s)=>{const a=e.router.getMatch(t);if(!a||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([s.options.head?.(r),s.options.scripts?.(r),s.options.headers?.(r)]).then(([c,d,f])=>({meta:c?.meta,links:c?.links,headScripts:c?.scripts,headers:f,scripts:d,styles:c?.styles}))},_S=(e,t,s,a,r)=>{const c=t[a-1],{params:d,loaderDeps:f,abortController:p,cause:m}=e.router.getMatch(s),v=Sa(e,a),y=Tu(e,s);return{params:d,deps:f,preload:!!y,parentMatchPromise:c,abortController:p,context:v,location:e.location,navigate:x=>e.router.navigate({...x,_fromLocation:e.location}),cause:y?"preload":m,route:r,...e.router.options.additionalContext}},vx=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!(s_??e.router.isServer)||c.ssr===!0)&&el(r);const d=r.options.loader,f=typeof d=="function"?d:d?.handler,p=f?.(_S(e,t,s,a,r)),m=!!f&&Wo(p);if((m||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(s,y=>({...y,isFetching:"loader"})),f){const y=m?await p:p;Ri(e,e.router.getMatch(s),y),y!==void 0&&e.updateMatch(s,x=>({...x,loaderData:y}))}r._lazyPromise&&await r._lazyPromise;const v=c._nonReactive.minPendingPromise;v&&await v,r._componentsPromise&&await r._componentsPromise,e.updateMatch(s,y=>({...y,error:void 0,context:Sa(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let f=d;if(f?.name==="AbortError"){if(c.abortController.signal.aborted){c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:Sa(e,a)}));return}const p=c._nonReactive.minPendingPromise;p&&await p,fn(d)&&await r.options.notFoundComponent?.preload?.(),Ri(e,e.router.getMatch(s),d);try{r.options.onError?.(d)}catch(m){f=m,Ri(e,e.router.getMatch(s),m)}!Sn(f)&&!fn(f)&&await el(r,["errorComponent"]),e.updateMatch(s,m=>({...m,error:f,context:Sa(e,a),status:"error",isFetching:!1}))}}catch(c){const d=e.router.getMatch(s);d&&(d._nonReactive.loaderPromise=void 0),Ri(e,d,c)}},rz=async(e,t,s)=>{async function a(b,w,S,C,k){const E=Date.now()-w.updatedAt,R=b?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,z=k.options.shouldReload,L=typeof z=="function"?z(_S(e,t,r,s,k)):z,{status:M,invalid:A}=C,T=E>R&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);d=M==="success"&&(A||(L??T)),b&&k.options.preload===!1||(d&&!e.sync&&v?(f=!0,(async()=>{try{await vx(e,t,r,s,k);const P=e.router.getMatch(r);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0,P._nonReactive.loadPromise=void 0}catch(P){Sn(P)&&await e.router.navigate(P.options)}})()):M!=="success"||d?await vx(e,t,r,s,k):yx(e,r,s))}const{id:r,routeId:c}=e.matches[s];let d=!1,f=!1;const p=e.router.looseRoutesById[c],m=p.options.loader,v=((typeof m=="function"?void 0:m?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(CS(e,r)){if(!e.router.getMatch(r))return e.matches[s];yx(e,r,s)}else{const b=e.router.getMatch(r),w=e.router.state.matches[s]?.routeId===c?e.router.state.matches[s].id:e.router.state.matches.find(C=>C.routeId===c)?.id,S=Tu(e,r);if(b._nonReactive.loaderPromise){if(b.status==="success"&&!e.sync&&!b.preload&&v)return b;await b._nonReactive.loaderPromise;const C=e.router.getMatch(r),k=C._nonReactive.error||C.error;k&&Ri(e,C,k),C.status==="pending"&&await a(S,b,w,C,p)}else{const C=S&&!e.router.state.matches.some(E=>E.id===r),k=e.router.getMatch(r);k._nonReactive.loaderPromise=Ar(),C!==k.preload&&e.updateMatch(r,E=>({...E,preload:C})),await a(S,b,w,k,p)}}const y=e.router.getMatch(r);f||(y._nonReactive.loaderPromise?.resolve(),y._nonReactive.loadPromise?.resolve(),y._nonReactive.loadPromise=void 0),clearTimeout(y._nonReactive.pendingTimeout),y._nonReactive.pendingTimeout=void 0,f||(y._nonReactive.loaderPromise=void 0),y._nonReactive.dehydrated=void 0;const x=f?y.isFetching:!1;return x!==y.isFetching||y.invalid!==!1?(e.updateMatch(r,b=>({...b,isFetching:x,invalid:!1})),e.router.getMatch(r)):y};async function xx(e){const t=e,s=[];t.router.state.matches.some(x=>x._forcePending)&&mm(t);let a;for(let x=0;x<t.matches.length;x++){try{const b=iz(t,x);Wo(b)&&await b}catch(b){if(Sn(b))throw b;if(fn(b))a=b;else if(!t.preload)throw b;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,c=a&&!t.preload?gx(t,a):void 0,d=a&&t.preload?0:c!==void 0?Math.min(c+1,r):r;let f,p;for(let x=0;x<d;x++)s.push(rz(t,s,x));try{await Promise.all(s)}catch{const x=await Promise.allSettled(s);for(const b of x){if(b.status!=="rejected")continue;const w=b.reason;if(Sn(w))throw w;fn(w)?f??=w:p??=w}if(p!==void 0)throw p}const m=f??(a&&!t.preload?a:void 0);let v=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!m&&a&&t.preload)return t.matches;if(m){const x=gx(t,m);$i(x!==void 0);const b=t.matches[x],w=t.router.looseRoutesById[b.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),m.routeId=b.routeId;const C=b.routeId===t.router.routeTree.id;t.updateMatch(b.id,k=>({...k,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:m},isFetching:!1})),v=x,await el(w,["notFoundComponent"])}else if(!t.preload){const x=t.matches[0];x.globalNotFound||t.router.getMatch(x.id)?.globalNotFound&&t.updateMatch(x.id,b=>({...b,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const x=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await el(x,["errorComponent"])}for(let x=0;x<=v;x++){const{id:b,routeId:w}=t.matches[x],S=t.router.looseRoutesById[w];try{const C=az(t,b,S);if(C){const k=await C;t.updateMatch(b,E=>({...E,...k}))}}catch(C){console.error(`Error executing head for route ${w}:`,C)}}const y=mm(t);if(Wo(y)&&await y,m)throw m;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function bx(e,t){const s=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function el(e,t=nu){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:r,...c}=a.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:t===nu?(()=>{if(e._componentsPromise===void 0){const a=bx(e,nu);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():bx(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function zS(e){for(const t of nu)if(e.options[t]?.preload)return!0;return!1}var nu=["component","errorComponent","pendingComponent","notFoundComponent"],Li="__TSR_index",Sx="popstate",jx="beforeunload";function oz(e){let t=e.getLocation();const s=new Set,a=d=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:d}))},r=d=>{e.notifyOnIndexChange??!0?a(d):t=e.getLocation()},c=async({task:d,navigateOpts:f,...p})=>{if(f?.ignoreBlocker??!1){d();return}const m=e.getBlockers?.()??[],v=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&m.length&&v)for(const y of m){const x=yu(p.path,p.state);if(await y.blockerFn({currentLocation:t,nextLocation:x,action:p.type})){e.onBlocked?.();return}}d()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:d=>(s.add(d),()=>{s.delete(d)}),push:(d,f,p)=>{const m=t.state[Li];f=wx(m+1,f),c({task:()=>{e.pushState(d,f),a({type:"PUSH"})},navigateOpts:p,type:"PUSH",path:d,state:f})},replace:(d,f,p)=>{const m=t.state[Li];f=wx(m,f),c({task:()=>{e.replaceState(d,f),a({type:"REPLACE"})},navigateOpts:p,type:"REPLACE",path:d,state:f})},go:(d,f)=>{c({task:()=>{e.go(d),r({type:"GO",index:d})},navigateOpts:f,type:"GO"})},back:d=>{c({task:()=>{e.back(d?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:d,type:"BACK"})},forward:d=>{c({task:()=>{e.forward(d?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:d,type:"FORWARD"})},canGoBack:()=>t.state[Li]!==0,createHref:d=>e.createHref(d),block:d=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,d]),()=>{const p=e.getBlockers?.()??[];e.setBlockers?.(p.filter(m=>m!==d))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function wx(e,t){t||(t={});const s=tp();return{...t,key:s,__TSR_key:s,[Li]:e}}function lz(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,a=t.history.replaceState;let r=[];const c=()=>r,d=T=>r=T,f=(T=>T),p=(()=>yu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const T=tp();t.history.replaceState({[Li]:0,key:T,__TSR_key:T},"")}let m=p(),v,y=!1,x=!1,b=!1,w=!1;const S=()=>m;let C,k;const E=()=>{C&&(A._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),A._ignoreSubscribers=!1,C=void 0,k=void 0,v=void 0)},R=(T,P,J)=>{const Q=f(P);k||(v=m),m=yu(P,J),C={href:Q,state:J,isPush:C?.isPush||T==="push"},k||(k=Promise.resolve().then(()=>E()))},z=T=>{m=p(),A.notify({type:T})},L=async()=>{if(x){x=!1;return}const T=p(),P=T.state[Li]-m.state[Li],J=P===1,Q=P===-1,se=!J&&!Q||y;y=!1;const pe=se?"GO":Q?"BACK":"FORWARD",ke=se?{type:"GO",index:P}:{type:Q?"BACK":"FORWARD"};if(b)b=!1;else{const je=c();if(typeof document<"u"&&je.length){for(const B of je)if(await B.blockerFn({currentLocation:m,nextLocation:T,action:pe})){x=!0,t.history.go(1),A.notify(ke);return}}}m=p(),A.notify(ke)},M=T=>{if(w){w=!1;return}let P=!1;const J=c();if(typeof document<"u"&&J.length)for(const Q of J){const se=Q.enableBeforeUnload??!0;if(se===!0){P=!0;break}if(typeof se=="function"&&se()===!0){P=!0;break}}if(P)return T.preventDefault(),T.returnValue=""},A=oz({getLocation:S,getLength:()=>t.history.length,pushState:(T,P)=>R("push",T,P),replaceState:(T,P)=>R("replace",T,P),back:T=>(T&&(b=!0),w=!0,t.history.back()),forward:T=>{T&&(b=!0),w=!0,t.history.forward()},go:T=>{y=!0,t.history.go(T)},createHref:T=>f(T),flush:E,destroy:()=>{t.history.pushState=s,t.history.replaceState=a,t.removeEventListener(jx,M,{capture:!0}),t.removeEventListener(Sx,L)},onBlocked:()=>{v&&m!==v&&(m=v)},getBlockers:c,setBlockers:d,notifyOnIndexChange:!1});return t.addEventListener(jx,M,{capture:!0}),t.addEventListener(Sx,L),t.history.pushState=function(...T){const P=s.apply(t.history,T);return A._ignoreSubscribers||z("PUSH"),P},t.history.replaceState=function(...T){const P=a.apply(t.history,T);return A._ignoreSubscribers||z("REPLACE"),P},A}function cz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function yu(e,t){const s=cz(e),a=s.indexOf("#"),r=s.indexOf("?"),c=tp();return{href:s,pathname:s.substring(0,a>0?r>0?Math.min(a,r):a:r>0?r:s.length),hash:a>-1?s.substring(a):"",search:r>-1?s.slice(r,a===-1?void 0:a):"",state:t||{[Li]:0,key:c,__TSR_key:c}}}function tp(){return(Math.random()+1).toString(36).substring(7)}function ja(e){const t=e.resolvedLocation,s=e.location;return{fromLocation:t,toLocation:s,pathChanged:t?.pathname!==s.pathname,hrefChanged:t?.href!==s.href,hashChanged:t?.hash!==s.hash}}function uz(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var dz=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 s=this.options,a=this.basepath??s?.basepath??"/",r=this.basepath===void 0,c=s?.rewrite;if(this.options={...s,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=w_(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=lz()),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 m;this.resolvePathCache=hu(1e3),m=this.buildRouteTree(),this.setRoutes(m)}!this.__store&&this.latestLocation&&(this.__store=ez(hz(this.latestLocation)),R_(this));let d=!1;const f=this.options.basepath??"/",p=this.options.rewrite;if(r||a!==f||c!==p){this.basepath=f;const m=[],v=vS(f);v&&v!=="/"&&m.push(P_({basepath:f})),p&&m.push(p),this.rewrite=m.length===0?void 0:m.length===1?m[0]:$_(m),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&this.__store.setState(m=>({...m,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=y_(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&f_(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,s)=>{const a={eventType:t,fn:s};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const a=({pathname:f,search:p,hash:m,href:v,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const C=this.options.parseSearch(p),k=this.options.stringifySearch(C);return{href:f+k+m,publicHref:v,pathname:Uo(f).path,external:!1,searchStr:k,search:ca(s?.search,C),hash:Uo(m.slice(1)).path,state:ma(s?.state,y)}}const x=new URL(v,this.origin),b=dm(this.rewrite,x),w=this.options.parseSearch(b.search),S=this.options.stringifySearch(w);return b.search=S,{href:b.href.replace(b.origin,""),publicHref:v,pathname:Uo(b.pathname).path,external:!!this.rewrite&&b.origin!==this.origin,searchStr:S,search:ca(s?.search,w),hash:Uo(b.hash.slice(1)).path,state:ma(s?.state,y)}},r=a(t),{__tempLocation:c,__tempKey:d}=r.state;if(c&&(!d||d===this.tempLocationKey)){const f=a(c);return f.state.key=r.state.key,f.state.__TSR_key=r.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:r}}return r},this.resolvePathWithBase=(t,s)=>j_({base:t,to:Jm(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,s,a)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:s},a):this.matchRoutesInternal(t,s),this.getMatchedRoutes=t=>mz({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const s=this.getMatch(t);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=t=>{const s=(r={})=>{const c=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(c);r.from;const f=r.unsafeRelative==="path"?c.pathname:r.from??d.fullPath,p=this.resolvePathWithBase(f,"."),m=d.search,v=Object.assign(Object.create(null),d.params),y=r.to?this.resolvePathWithBase(p,`${r.to}`):this.resolvePathWithBase(p,"."),x=r.params===!1||r.params===null?Object.create(null):(r.params??!0)===!0?v:Object.assign(v,Ei(r.params,v)),b=this.getMatchedRoutes(y);let w=b.matchedRoutes;if((!b.foundRoute||b.foundRoute.path!=="/"&&b.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(x).length>0)for(const P of w){const J=P.options.params?.stringify??P.options.stringifyParams;if(J)try{Object.assign(x,J(x))}catch{}}const S=t.leaveParams?y:Uo(fx({path:y,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=m;if(t._includeValidateSearch&&this.options.search?.strict){const P={};w.forEach(J=>{if(J.options.validateSearch)try{Object.assign(P,su(J.options.validateSearch,{...P,...C}))}catch{}}),C=P}C=pz({search:C,dest:r,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),C=ca(m,C);const k=this.options.stringifySearch(C),E=r.hash===!0?c.hash:r.hash?Ei(r.hash,c.hash):void 0,R=E?`#${E}`:"";let z=r.state===!0?c.state:r.state?Ei(r.state,c.state):{};z=ma(c.state,z);const L=`${S}${k}${R}`;let M,A,T=!1;if(this.rewrite){const P=new URL(L,this.origin),J=xS(this.rewrite,P);M=P.href.replace(P.origin,""),J.origin!==this.origin?(A=J.href,T=!0):A=J.pathname+J.search+J.hash}else M=c_(L),A=M;return{publicHref:A,href:M,pathname:S,search:C,searchStr:k,state:z,hash:E??"",external:T,unmaskOnReload:r.unmaskOnReload}},a=(r={},c)=>{const d=s(r);let f=c?s(c):void 0;if(!f){const p=Object.create(null);if(this.options.routeMasks){const m=h_(d.pathname,this.processedTree);if(m){Object.assign(p,m.rawParams);const{from:v,params:y,...x}=m.route,b=y===!1||y===null?Object.create(null):(y??!0)===!0?p:Object.assign(p,Ei(y,p));c={from:t.from,...x,params:b},f=s(c)}}}return f&&(d.maskedLocation=f),d};return t.mask?a(t,{from:t.from,...t.mask}):a(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:s,...a})=>{const r=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(m=>{a.state[m]=this.latestLocation.state[m]});const p=xa(a.state,this.latestLocation.state);return f.forEach(m=>{delete a.state[m]}),p},c=Di(this.latestLocation.href)===Di(a.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Ar(()=>{d?.resolve(),d=void 0}),c&&r())this.load();else{let{maskedLocation:f,hashScrollIntoView:p,...m}=a;f&&(m={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:s})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:a,viewTransition:r,ignoreBlocker:c,href:d,...f}={})=>{if(d){const v=this.history.location.state.__TSR_index,y=yu(d,{__TSR_index:t?v:v+1}),x=new URL(y.pathname,this.origin);f.to=dm(this.rewrite,x).pathname,f.search=this.options.parseSearch(y.search),f.hash=y.hash.slice(1)}const p=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const m=this.commitLocation({...p,viewTransition:r,replace:t,resetScroll:s,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:t,reloadDocument:s,href:a,publicHref:r,...c})=>{let d=!1;if(a)try{new URL(`${a}`),d=!0}catch{}if(d&&!s&&(s=!0),s){if(t!==void 0||!a){const p=this.buildLocation({to:t,...c});a=a??p.publicHref,r=r??p.publicHref}const f=!d&&r?r:a;if(fu(f,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const m of p)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...c,href:a,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:s.cachedMatches.filter(a=>!t.some(r=>r.id===a.id))}))},this.load=async t=>{let s,a,r;const c=this.state.resolvedLocation??this.state.location;for(r=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const p=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ja({resolvedLocation:m,location:p})}),this.emit({type:"onBeforeLoad",...ja({resolvedLocation:m,location:p})}),await xx({router:this,sync:t?.sync,forceStaleReload:c.href===p.href,matches:this.state.pendingMatches,location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],y=[],x=[],b=[];Ko(()=>{this.__store.setState(w=>{const S=w.matches,C=w.pendingMatches||w.matches;return v=S.filter(k=>!C.some(E=>E.id===k.id)),y=S.filter(k=>!C.some(E=>E.routeId===k.routeId)),x=C.filter(k=>!S.some(E=>E.routeId===k.routeId)),b=C.filter(k=>S.some(E=>E.routeId===k.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...v.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[x,"onEnter"],[b,"onStay"]].forEach(([w,S])=>{w.forEach(C=>{this.looseRoutesById[C.routeId].options[S]?.(C)})})})})}})}catch(p){Sn(p)?(s=p,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):fn(p)&&(a=p),this.__store.setState(m=>({...m,statusCode:s?s.status:a?404:m.matches.some(v=>v.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.__store.state.matches.some(f=>f.status==="error")&&(d=500),d!==void 0&&this.__store.setState(f=>({...f,statusCode:d}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,c=this.state.resolvedLocation,d=typeof s.types=="function"?s.types(ja({resolvedLocation:c,location:r})):s.types;if(d===!1){t();return}a={update:t,types:d}}else a=t;document.startViewTransition(a)}else t()},this.updateMatch=(t,s)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(r=>r.id===t)?"pendingMatches":this.state.matches.some(r=>r.id===t)?"matches":this.state.cachedMatches.some(r=>r.id===t)?"cachedMatches":"";a&&(a==="cachedMatches"?this.__store.setState(r=>({...r,cachedMatches:uz(r.cachedMatches.map(c=>c.id===t?s(c):c))})):this.__store.setState(r=>({...r,[a]:r[a]?.map(c=>c.id===t?s(c):c)})))})},this.getMatch=t=>{const s=a=>a.id===t;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=t=>{const s=a=>t?.filter?.(a)??!0?{...a,invalid:!0,...t?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(s),cachedMatches:a.cachedMatches.map(s),pendingMatches:a.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const s=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const a=t.options._builtLocation??this.buildLocation(t.options),r=this.getParsedLocationHref(a);t.options.href=r,t.headers.set("Location",r)}else if(s)try{const a=new URL(s);if(this.origin&&a.origin===this.origin){const r=a.pathname+a.search+a.hash;t.options.href=r,t.headers.set("Location",r)}}catch{}if(t.options.href&&!t.options._builtLocation&&fu(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 s=t?.filter;s!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(r=>!s(r))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=s=>{const a=this.looseRoutesById[s.routeId];if(!a.options.loader)return!0;const r=(s.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:t})},this.loadRouteChunk=el,this.preloadRoute=async t=>{const s=t._builtLocation??this.buildLocation(t);let a=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:t});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),c=new Set([...r,...this.state.cachedMatches.map(d=>d.id)]);Ko(()=>{a.forEach(d=>{c.has(d.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,d]}))})});try{return a=await xx({router:this,matches:a,location:s,preload:!0,updateMatch:(d,f)=>{r.has(d)?a=a.map(p=>p.id===d?f(p):p):this.updateMatch(d,f)}}),a}catch(d){if(Sn(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:s});fn(d)||console.error(d);return}},this.matchRoute=(t,s)=>{const a={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},r=this.buildLocation(a);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=m_(r.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!d||t.params&&!xa(d.rawParams,t.params,{partial:!0})?!1:s?.includeSearch??!0?xa(c.search,r.search,{partial:!0})?d.rawParams:!1:d.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??L_,parseSearch:e.parseSearch??D_,protocolAllowlist:e.protocolAllowlist??l_}),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:s}){this.routesById=e,this.routesByPath=t,this.processedTree=s;const a=this.options.notFoundRoute;a&&(a.init({originalIndex:99999999999}),this.routesById[a.id]=a)}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 s=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:r,parsedParams:c}=s;let{matchedRoutes:d}=s,f=!1;(a?a.path!=="/"&&r["**"]:Di(e.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:f=!0);const p=f?yz(this.options.notFoundMode,d):void 0,m=new Array(d.length),v=new Map(this.state.matches.map(y=>[y.routeId,y]));for(let y=0;y<d.length;y++){const x=d[y],b=m[y-1];let w,S,C;{const pe=b?.search??e.search,ke=b?._strictSearch??void 0;try{const je=su(x.options.validateSearch,{...pe})??void 0;w={...pe,...je},S={...ke,...je},C=void 0}catch(je){let B=je;if(je instanceof vu||(B=new vu(je.message,{cause:je})),t?.throwOnError)throw B;w=pe,S={},C=B}}const k=x.options.loaderDeps?.({search:w})??"",E=k?JSON.stringify(k):"",{interpolatedPath:R,usedParams:z}=fx({path:x.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),L=x.id+R+E,M=this.getMatch(L),A=v.get(x.id),T=M?._strictParams??z;let P;if(!M)try{Nx(x,z,c,T)}catch(pe){if(fn(pe)||Sn(pe)?P=pe:P=new fz(pe.message,{cause:pe}),t?.throwOnError)throw P}Object.assign(r,T);const J=A?"stay":"enter";let Q;if(M)Q={...M,cause:J,params:A?.params??r,_strictParams:T,search:ca(A?A.search:M.search,w),_strictSearch:S};else{const pe=x.options.loader||x.options.beforeLoad||x.lazyFn||zS(x)?"pending":"success";Q={id:L,ssr:x.options.ssr,index:y,routeId:x.id,params:A?.params??r,_strictParams:T,pathname:R,updatedAt:Date.now(),search:A?ca(A.search,w):w,_strictSearch:S,searchError:void 0,status:pe,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Ar()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:J,loaderDeps:A?ma(A.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}t?.preload||(Q.globalNotFound=p===x.id),Q.searchError=C;const se=this.getParentContext(b);Q.context={...se,...Q.__routeContext,...Q.__beforeLoadContext},m[y]=Q}for(let y=0;y<m.length;y++){const x=m[y],b=this.looseRoutesById[x.routeId],w=this.getMatch(x.id),S=v.get(x.routeId);if(x.params=S?ca(S.params,r):r,!w){const C=m[y-1],k=this.getParentContext(C);if(b.options.context){const E={deps:x.loaderDeps,params:x.params,context:k??{},location:e,navigate:R=>this.navigate({...R,_fromLocation:e}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:m,routeId:b.id};x.__routeContext=b.options.context(E)??void 0}x.context={...k,...x.__routeContext,...x.__beforeLoadContext}}}return m}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:s,parsedParams:a}=this.getMatchedRoutes(e.pathname),r=Xo(t),c={...e.search};for(const m of t)try{Object.assign(c,su(m.options.validateSearch,c))}catch{}const d=Xo(this.state.matches),f=d&&d.routeId===r.id&&e.pathname===this.state.location.pathname;let p;if(f)p=d.params;else{const m=Object.assign(Object.create(null),s);for(const v of t)try{Nx(v,s,a??{},m)}catch{}p=m}return{matchedRoutes:t,fullPath:r.fullPath,search:c,params:p}}},vu=class extends Error{},fz=class extends Error{};function hz(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function su(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new vu("Async validation not supported");if(s.issues)throw new vu(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function mz({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),r=Di(e);let c,d;const f=p_(r,s,!0);return f&&(c=f.route,Object.assign(a,f.rawParams),d=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:a,foundRoute:c,parsedParams:d}}function pz({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return gz(s)(e,t,a??!1)}function gz(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const c=({search:d,next:f})=>{let p=d;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(p=r.options.preSearchFilters.reduce((v,y)=>y(v),d));const m=f(p);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((v,y)=>y(v),m):m};t.middlewares.push(c)}if(r.options.validateSearch){const c=({search:d,next:f})=>{const p=f(d);if(!t._includeValidateSearch)return p;try{return{...p,...su(r.options.validateSearch,p)??void 0}}catch{return p}};t.middlewares.push(c)}}const s=({search:r})=>{const c=t.dest;return c.search?c.search===!0?r:Ei(c.search,r):{}};t.middlewares.push(s);const a=(r,c,d)=>{if(r>=d.length)return c;const f=d[r];return f({search:c,next:m=>a(r+1,m,d)})};return function(c,d,f){return t.dest=d,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function yz(e,t){if(e!=="root")for(let s=t.length-1;s>=0;s--){const a=t[s];if(a.children)return a.id}return ba}function Nx(e,t,s,a){const r=e.options.params?.parse??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const c in t)c in s&&(a[c]=s[c]);else{const c=r(a);Object.assign(a,c)}}var vz="Error preloading route! ☝️",ES=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 s=this.options,a=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=ba:this.parentRoute||$i(!1);let r=a?ba:s?.path;r&&r!=="/"&&(r=yS(r));const c=s?.id||r;let d=a?ba:eu([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);r==="__root__"&&(r="/"),d!=="__root__"&&(d=eu(["/",d]));const f=d==="__root__"?"/":eu([this.parentRoute.fullPath,r]);this._path=r,this._id=d,this._fullPath=f,this._to=Di(f)},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=>Xm({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.")}},xz=class extends ES{constructor(e){super(e)}};function np(e){const t=e.errorComponent??sp;return o.jsx(bz,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?N.createElement(t,{error:s,reset:a}):e.children})}var bz=class extends N.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 sp({error:e}){const[t,s]=N.useState(!1);return o.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[o.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),o.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(a=>!a),children:t?"Hide Error":"Show Error"})]}),o.jsx("div",{style:{height:".25rem"}}),t?o.jsx("div",{children:o.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?o.jsx("code",{children:e.message}):null})}):null]})}function Sz({children:e,fallback:t=null}){return RS()?o.jsx(is.Fragment,{children:e}):o.jsx(is.Fragment,{children:t})}function RS(){return is.useSyncExternalStore(jz,()=>!0,()=>!1)}function jz(){return()=>{}}var AS=N.createContext(null);function Kn(e){const t=N.useContext(AS);return e?.warn,t}var Eh={exports:{}},Rh={},Ah={exports:{}},Th={};var Cx;function wz(){if(Cx)return Th;Cx=1;var e=ol();function t(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var s=typeof Object.is=="function"?Object.is:t,a=e.useState,r=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(y,x){var b=x(),w=a({inst:{value:b,getSnapshot:x}}),S=w[0].inst,C=w[1];return c(function(){S.value=b,S.getSnapshot=x,p(S)&&C({inst:S})},[y,b,x]),r(function(){return p(S)&&C({inst:S}),y(function(){p(S)&&C({inst:S})})},[y]),d(b),b}function p(y){var x=y.getSnapshot;y=y.value;try{var b=x();return!s(y,b)}catch{return!0}}function m(y,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Th.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Th}var kx;function Nz(){return kx||(kx=1,Ah.exports=wz()),Ah.exports}var _x;function Cz(){if(_x)return Rh;_x=1;var e=ol(),t=Nz();function s(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var a=typeof Object.is=="function"?Object.is:s,r=t.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,p=e.useDebugValue;return Rh.useSyncExternalStoreWithSelector=function(m,v,y,x,b){var w=c(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=f(function(){function k(M){if(!E){if(E=!0,R=M,M=x(M),b!==void 0&&S.hasValue){var A=S.value;if(b(A,M))return z=A}return z=M}if(A=z,a(R,M))return A;var T=x(M);return b!==void 0&&b(A,T)?(R=M,A):(R=M,z=T)}var E=!1,R,z,L=y===void 0?null:y;return[function(){return k(v())},L===null?void 0:function(){return k(L())}]},[v,y,x,b]);var C=r(m,w[0],w[1]);return d(function(){S.hasValue=!0,S.value=C},[C]),p(C),C},Rh}var zx;function kz(){return zx||(zx=1,Eh.exports=Cz()),Eh.exports}var _z=kz();function zz(e,t){return e===t}function Ez(e,t,s=zz){const a=N.useCallback(d=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(d);return f},[e]),r=N.useCallback(()=>e?.get(),[e]);return _z.useSyncExternalStoreWithSelector(a,r,r,t,s)}function jn(e){const t=Kn({warn:e?.router===void 0}),s=e?.router||t,a=N.useRef(void 0);return Ez(s.__store,r=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const c=ma(a.current,e.select(r));return a.current=c,c}return e.select(r)}return r})}var Ou=N.createContext(void 0),Rz=N.createContext(void 0);function Bi(e){const t=N.useContext(e.from?Rz:Ou);return jn({select:s=>{const a=s.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if($i(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function ip(e){return Bi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ap(e){const{select:t,...s}=e;return Bi({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Du(e){return Bi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const s=e.strict===!1?t.params:t._strictParams;return e.select?e.select(s):s}})}function Lu(e){return Bi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ka(e){const t=Kn();return N.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function rp(e){return Bi({...e,select:t=>e.select?e.select(t.context):t.context})}var op=Jb();const Az=Yb(op);function Tz(e,t){const s=Kn(),a=n_(t),{activeProps:r,inactiveProps:c,activeOptions:d,to:f,preload:p,preloadDelay:m,hashScrollIntoView:v,replace:y,startTransition:x,resetScroll:b,viewTransition:w,children:S,target:C,disabled:k,style:E,className:R,onClick:z,onBlur:L,onFocus:M,onMouseEnter:A,onMouseLeave:T,onTouchStart:P,ignoreBlocker:J,params:Q,search:se,hash:pe,state:ke,mask:je,reloadDocument:B,unsafeRelative:G,from:oe,_fromLocation:q,...X}=e,O=RS(),Z=jn({select:ze=>{const Ue=ze.matches[ze.matches.length-1];return{search:Ue?.search,hash:ze.location.hash,path:Ue?.pathname}},structuralSharing:!0}),ie=e.from,re=N.useMemo(()=>({...e,from:ie}),[s,Z,ie,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ue=N.useMemo(()=>s.buildLocation({...re}),[s,re]),he=ue.maskedLocation?ue.maskedLocation.publicHref:ue.publicHref,de=ue.maskedLocation?ue.maskedLocation.external:ue.external,Me=N.useMemo(()=>$z(he,de,s.history,k),[k,de,he,s.history]),ge=N.useMemo(()=>{if(Me?.external)return fu(Me.href,s.protocolAllowlist)?void 0:Me.href;if(!Pz(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),fu(f,s.protocolAllowlist)?void 0:f}catch{}},[f,Me,s.protocolAllowlist]),Ke=jn({select:ze=>{if(ge)return!1;if(d?.exact){if(!S_(ze.location.pathname,ue.pathname,s.basepath))return!1}else{const Ue=mu(ze.location.pathname,s.basepath),pt=mu(ue.pathname,s.basepath);if(!(Ue.startsWith(pt)&&(Ue.length===pt.length||Ue[pt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!xa(ze.location.search,ue.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?O&&ze.location.hash===ue.hash:!0}}),it=Ke?Ei(r,{})??Oz:Oh,me=Ke?Oh:Ei(c,{})??Oh,We=[R,it.className,me.className].filter(Boolean).join(" "),dt=(E||it.style||me.style)&&{...E,...it.style,...me.style},[sn,kt]=N.useState(!1),an=N.useRef(!1),Vt=e.reloadDocument||ge?!1:p??s.options.defaultPreload,_t=m??s.options.defaultPreloadDelay??0,zt=N.useCallback(()=>{s.preloadRoute({...re,_builtLocation:ue}).catch(ze=>{console.warn(ze),console.warn(vz)})},[s,re,ue]);t_(a,N.useCallback(ze=>{ze?.isIntersecting&&zt()},[zt]),Uz,{disabled:!!k||Vt!=="viewport"}),N.useEffect(()=>{an.current||!k&&Vt==="render"&&(zt(),an.current=!0)},[k,zt,Vt]);const mn=ze=>{const Ue=ze.currentTarget.getAttribute("target"),pt=C!==void 0?C:Ue;if(!k&&!Iz(ze)&&!ze.defaultPrevented&&(!pt||pt==="_self")&&ze.button===0){ze.preventDefault(),op.flushSync(()=>{kt(!0)});const rn=s.subscribe("onResolved",()=>{rn(),kt(!1)});s.navigate({...re,replace:y,resetScroll:b,hashScrollIntoView:v,startTransition:x,viewTransition:w,ignoreBlocker:J})}};if(ge)return{...X,ref:a,href:ge,...S&&{children:S},...C&&{target:C},...k&&{disabled:k},...E&&{style:E},...R&&{className:R},...z&&{onClick:z},...L&&{onBlur:L},...M&&{onFocus:M},...A&&{onMouseEnter:A},...T&&{onMouseLeave:T},...P&&{onTouchStart:P}};const le=ze=>{if(k||Vt!=="intent")return;if(!_t){zt();return}const Ue=ze.currentTarget;if(Io.has(Ue))return;const pt=setTimeout(()=>{Io.delete(Ue),zt()},_t);Io.set(Ue,pt)},Ie=ze=>{k||Vt!=="intent"||zt()},Be=ze=>{if(k||!Vt||!_t)return;const Ue=ze.currentTarget,pt=Io.get(Ue);pt&&(clearTimeout(pt),Io.delete(Ue))};return{...X,...it,...me,href:Me?.href,ref:a,onClick:pr([z,mn]),onBlur:pr([L,Be]),onFocus:pr([M,le]),onMouseEnter:pr([A,le]),onMouseLeave:pr([T,Be]),onTouchStart:pr([P,Ie]),disabled:!!k,target:C,...dt&&{style:dt},...We&&{className:We},...k&&Dz,...Ke&&Lz,...O&&sn&&Mz}}var Oh={},Oz={className:"active"},Dz={role:"link","aria-disabled":!0},Lz={"data-status":"active","aria-current":"page"},Mz={"data-transitioning":"transitioning"},Io=new WeakMap,Uz={rootMargin:"100px"},pr=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function $z(e,t,s,a){if(!a)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function Pz(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var yt=N.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:r,...c}=Tz(a,t),d=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!s){const{disabled:f,...p}=c;return N.createElement("a",p,d)}return N.createElement(s,c,d)});function Iz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Bz=class extends ES{constructor(e){super(e),this.useMatch=t=>Bi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>rp({...t,from:this.id}),this.useSearch=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ap({...t,from:this.id}),this.useLoaderData=t=>ip({...t,from:this.id}),this.useNavigate=()=>ka({from:this.fullPath}),this.Link=is.forwardRef((t,s)=>o.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Vn(e){return new Bz(e)}function qz(){return e=>Gz(e)}var Hz=class extends xz{constructor(e){super(e),this.useMatch=t=>Bi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>rp({...t,from:this.id}),this.useSearch=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ap({...t,from:this.id}),this.useLoaderData=t=>ip({...t,from:this.id}),this.useNavigate=()=>ka({from:this.fullPath}),this.Link=is.forwardRef((t,s)=>o.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Gz(e){return new Hz(e)}function Ex(e){return typeof e=="object"?new Rx(e,{silent:!0}).createRoute(e):new Rx(e,{silent:!0}).createRoute}var Rx=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=Vn(s);return a.isRoot=!1,a},this.silent=t?.silent}},Ax=class{constructor(e){this.useMatch=t=>Bi({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>rp({...t,from:this.options.id}),this.useSearch=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>ap({...t,from:this.options.id}),this.useLoaderData=t=>ip({...t,from:this.options.id}),this.useNavigate=()=>ka({from:Kn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Tx(e){return typeof e=="object"?new Ax(e):t=>new Ax({id:e,...t})}function Fz(e){const t=jn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return o.jsx(np,{getResetKey:()=>t,onCatch:(s,a)=>{if(fn(s))e.onCatch?.(s,a);else throw s},errorComponent:({error:s})=>{if(fn(s))return e.fallback?.(s);throw s},children:e.children})}function Zz(){return o.jsx("p",{children:"Not Found"})}function Sr(e){return o.jsx(o.Fragment,{children:e.children})}function TS(e,t,s){return t.options.notFoundComponent?o.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?o.jsx(e.options.defaultNotFoundComponent,{...s}):o.jsx(Zz,{})}function Kz(){return Kn().isScrollRestoring,null}var OS=N.memo(function({matchId:t}){const s=Kn(),a=jn({select:w=>{const S=w.matches.findIndex(k=>k.id===t),C=w.matches[S];return $i(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[S-1]?.routeId}},structuralSharing:!0}),r=s.routesById[a.routeId],c=r.options.pendingComponent??s.options.defaultPendingComponent,d=c?o.jsx(c,{}):null,f=r.options.errorComponent??s.options.defaultErrorComponent,p=r.options.onCatch??s.options.defaultOnCatch,m=r.isRoot?r.options.notFoundComponent??s.options.notFoundRoute?.options.component:r.options.notFoundComponent,v=a.ssr===!1||a.ssr==="data-only",y=(!r.isRoot||r.options.wrapInSuspense||v)&&(r.options.wrapInSuspense??c??(r.options.errorComponent?.preload||v))?N.Suspense:Sr,x=f?np:Sr,b=m?Fz:Sr;return o.jsxs(r.isRoot?r.options.shellComponent??Sr:Sr,{children:[o.jsx(Ou.Provider,{value:t,children:o.jsx(y,{fallback:d,children:o.jsx(x,{getResetKey:()=>a.resetKey,errorComponent:f||sp,onCatch:(w,S)=>{if(fn(w))throw w;p?.(w,S)},children:o.jsx(b,{fallback:w=>{if(!m||w.routeId&&w.routeId!==a.routeId||!w.routeId&&!r.isRoot)throw w;return N.createElement(m,w)},children:v||a._displayPending?o.jsx(Sz,{fallback:d,children:o.jsx(Ox,{matchId:t})}):o.jsx(Ox,{matchId:t})})})})}),a.parentRouteId===ba&&s.options.scrollRestoration?o.jsxs(o.Fragment,{children:[o.jsx(Vz,{}),o.jsx(Kz,{})]}):null]})});function Vz(){const e=Kn(),t=N.useRef(void 0);return o.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ja(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Ox=N.memo(function({matchId:t}){const s=Kn(),{match:a,key:r,routeId:c}=jn({select:p=>{const m=p.matches.find(x=>x.id===t),v=m.routeId,y=(s.routesById[v].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:v,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:m.id,status:m.status,error:m.error,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),d=s.routesById[c],f=N.useMemo(()=>{const p=d.options.component??s.options.defaultComponent;return p?o.jsx(p,{},r):o.jsx(lp,{})},[r,d.options.component,s.options.defaultComponent]);if(a._displayPending)throw s.getMatch(a.id)?._nonReactive.displayPendingPromise;if(a._forcePending)throw s.getMatch(a.id)?._nonReactive.minPendingPromise;if(a.status==="pending"){const p=d.options.pendingMinMs??s.options.defaultPendingMinMs;if(p){const m=s.getMatch(a.id);if(m&&!m._nonReactive.minPendingPromise){const v=Ar();m._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),m._nonReactive.minPendingPromise=void 0},p)}}throw s.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return $i(fn(a.error)),TS(s,d,a.error);if(a.status==="redirected")throw $i(Sn(a.error)),s.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),lp=N.memo(function(){const t=Kn(),s=N.useContext(Ou),a=jn({select:m=>m.matches.find(v=>v.id===s)?.routeId}),r=t.routesById[a],c=jn({select:m=>{const v=m.matches.find(y=>y.id===s);return $i(v),v.globalNotFound}}),d=jn({select:m=>{const v=m.matches;return v[v.findIndex(y=>y.id===s)+1]?.id}}),f=t.options.defaultPendingComponent?o.jsx(t.options.defaultPendingComponent,{}):null;if(c)return TS(t,r,void 0);if(!d)return null;const p=o.jsx(OS,{matchId:d});return a===ba?o.jsx(N.Suspense,{fallback:f,children:p}):p});function Qz(){const e=Kn(),t=N.useRef({router:e,mounted:!1}),[s,a]=N.useState(!1),{hasPendingMatches:r,isLoading:c}=jn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(x=>x.status==="pending")}),structuralSharing:!0}),d=wh(c),f=c||s||r,p=wh(f),m=c||r,v=wh(m);return e.startTransition=y=>{a(!0),N.startTransition(()=>{y(),a(!1)})},N.useEffect(()=>{const y=e.history.subscribe(e.load),x=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Di(e.latestLocation.publicHref)!==Di(x.publicHref)&&e.commitLocation({...x,replace:!0}),()=>{y()}},[e,e.history]),Dc(()=>{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(x){console.error(x)}})()},[e]),Dc(()=>{d&&!c&&e.emit({type:"onLoad",...ja(e.state)})},[d,e,c]),Dc(()=>{v&&!m&&e.emit({type:"onBeforeRouteMount",...ja(e.state)})},[m,v,e]),Dc(()=>{if(p&&!f){const y=ja(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(x=>({...x,status:"idle",resolvedLocation:x.location})),y.hrefChanged&&A_(e)}},[f,p,e]),null}function Yz(){const e=Kn(),t=e.routesById[ba].options.pendingComponent??e.options.defaultPendingComponent,s=t?o.jsx(t,{}):null,a=o.jsxs(typeof document<"u"&&e.ssr?Sr:N.Suspense,{fallback:s,children:[o.jsx(Qz,{}),o.jsx(Jz,{})]});return e.options.InnerWrap?o.jsx(e.options.InnerWrap,{children:a}):a}function Jz(){const e=Kn(),t=jn({select:r=>r.matches[0]?.id}),s=jn({select:r=>r.loadedAt}),a=t?o.jsx(OS,{matchId:t}):null;return o.jsx(Ou.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:o.jsx(np,{getResetKey:()=>s,errorComponent:sp,onCatch:void 0,children:a})})}var Xz=e=>new Wz(e),Wz=class extends dz{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Ex,globalThis.createLazyFileRoute=Tx):typeof window<"u"&&(window.createFileRoute=Ex,window.createLazyFileRoute=Tx);function e2({router:e,children:t,...s}){Object.keys(s).length>0&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const a=o.jsx(AS.Provider,{value:e,children:t});return e.options.Wrap?o.jsx(e.options.Wrap,{children:a}):a}function t2({router:e,...t}){return o.jsx(e2,{router:e,...t,children:o.jsx(Yz,{})})}function n2(e){return jn({select:t=>t.location})}let Ai=[],s2=0;const pm=new Set;function DS(){const e=[...Ai];for(const t of pm)t(e)}function i2(e,t="negative",s=6e3){const a=String(++s2),r={id:a,message:e,tone:t,expiresAt:Date.now()+s};return Ai=[...Ai,r],DS(),setTimeout(()=>{LS(a)},s),a}function LS(e){const t=Ai.length;Ai=Ai.filter(s=>s.id!==e),Ai.length!==t&&DS()}function a2(e){return pm.add(e),()=>{pm.delete(e)}}function Dx(){return Ai}function r2(){return new Vk({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new aS({onError:e=>{i2(e instanceof Error?e.message:"An unexpected error occurred","negative")}})})}const o2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),Lx=e=>{const t=l2(e);return t.charAt(0).toUpperCase()+t.slice(1)},MS=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),c2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var u2={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 d2=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:r="",children:c,iconNode:d,...f},p)=>N.createElement("svg",{ref:p,...u2,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:MS("lucide",r),...!c&&!c2(f)&&{"aria-hidden":"true"},...f},[...d.map(([m,v])=>N.createElement(m,v)),...Array.isArray(c)?c:[c]]));const nn=(e,t)=>{const s=N.forwardRef(({className:a,...r},c)=>N.createElement(d2,{ref:c,iconNode:t,className:MS(`lucide-${o2(Lx(e))}`,`lucide-${e}`,a),...r}));return s.displayName=Lx(e),s};const f2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Mu=nn("chevron-right",f2);const h2=[["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"}]],m2=nn("download",h2);const p2=[["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"}]],g2=nn("github",p2);const y2=[["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"}]],v2=nn("globe",y2);const x2=[["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"}]],b2=nn("layout-dashboard",x2);const S2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],j2=nn("menu",S2);const w2=[["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"}]],N2=nn("play",w2);const C2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mx=nn("plus",C2);const k2=[["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"}]],Ux=nn("refresh-cw",k2);const _2=[["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"}]],z2=nn("rocket",_2);const E2=[["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"}]],R2=nn("rotate-ccw",E2);const A2=[["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"}]],T2=nn("settings",A2);const O2=[["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"}]],D2=nn("trash-2",O2);const L2=[["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"}]],M2=nn("triangle-alert",L2);const U2=[["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"}]],$2=nn("unplug",U2);const P2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Uu=nn("x",P2);function I2(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const s=t[1],a=t[2],r=a.indexOf("{");if(r>=0){const c=a.slice(0,r).trim(),d=a.slice(r);try{const f=JSON.parse(d);return`${s} ${c}
10
10
 
11
11
  ${JSON.stringify(f,null,2)}`}catch{}}return`${s}
12
- ${a}`}try{const s=JSON.parse(e);return JSON.stringify(s,null,2)}catch{return e}}function Pu(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function vs(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function $x(e){return e===null?"Unknown":e?"Pass":"Fail"}function gm(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function I2(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function B2(e,t){if(!e)return{freq:"custom",hour:6,customCron:t};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const s=e.match(/^daily(?:@(\d+))?$/);if(s)return{freq:"daily",hour:s[1]?parseInt(s[1]):6,customCron:""};const a=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return a?{freq:a[1],hour:a[2]?parseInt(a[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:t}}function q2(e,t,s){const a=s==="UTC"?"UTC":s.split("/").pop()?.replace(/_/g," ")??s;if(!e)return`Custom: ${t} · ${a}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${a}`;const r=e.match(/^daily(?:@(\d+))?$/);if(r){const d=r[1]?parseInt(r[1]):6;return`Every day at ${gm(d)} · ${a}`}const c=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(c){const d={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},f=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${gm(f)} · ${a}`}return`${e} · ${a}`}function Px(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cp(...e){return t=>{let s=!1;const a=e.map(r=>{const c=Px(r,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let r=0;r<a.length;r++){const c=a[r];typeof c=="function"?c():Px(e[r],null)}}}}function za(...e){return N.useCallback(cp(...e),e)}var H2=Symbol.for("react.lazy"),bu=qm[" use ".trim().toString()];function G2(e){return typeof e=="object"&&e!==null&&"then"in e}function US(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===H2&&"_payload"in e&&G2(e._payload)}function F2(e){const t=K2(e),s=N.forwardRef((a,r)=>{let{children:c,...d}=a;US(c)&&typeof bu=="function"&&(c=bu(c._payload));const f=N.Children.toArray(c),p=f.find(Q2);if(p){const m=p.props.children,v=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,v):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}var Z2=F2("Slot");function K2(e){const t=N.forwardRef((s,a)=>{let{children:r,...c}=s;if(US(r)&&typeof bu=="function"&&(r=bu(r._payload)),N.isValidElement(r)){const d=J2(r),f=Y2(c,r.props);return r.type!==N.Fragment&&(f.ref=a?cp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var V2=Symbol("radix.slottable");function Q2(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===V2}function Y2(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const p=c(...f);return r(...f),p}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function J2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function $S(e){var t,s,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=$S(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function PS(){for(var e,t,s=0,a="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=$S(e))&&(a&&(a+=" "),a+=t);return a}const Ix=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Bx=PS,IS=(e,t)=>s=>{var a;if(t?.variants==null)return Bx(e,s?.class,s?.className);const{variants:r,defaultVariants:c}=t,d=Object.keys(r).map(m=>{const v=s?.[m],y=c?.[m];if(v===null)return null;const x=Ix(v)||Ix(y);return r[m][x]}),f=s&&Object.entries(s).reduce((m,v)=>{let[y,x]=v;return x===void 0||(m[y]=x),m},{}),p=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((m,v)=>{let{class:y,className:x,...b}=v;return Object.entries(b).every(w=>{let[S,C]=w;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...m,y,x]:m},[]);return Bx(e,d,p,s?.class,s?.className)},X2=(e,t)=>{const s=new Array(e.length+t.length);for(let a=0;a<e.length;a++)s[a]=e[a];for(let a=0;a<t.length;a++)s[e.length+a]=t[a];return s},W2=(e,t)=>({classGroupId:e,validator:t}),BS=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),Su="-",qx=[],eE="arbitrary..",tE=e=>{const t=sE(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return nE(d);const f=d.split(Su),p=f[0]===""&&f.length>1?1:0;return qS(f,p,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=a[d],m=s[d];return p?m?X2(m,p):p:m||qx}return s[d]||qx}}},qS=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],c=s.nextPart.get(r);if(c){const m=qS(e,t+1,c);if(m)return m}const d=s.validators;if(d===null)return;const f=t===0?e.join(Su):e.slice(t).join(Su),p=d.length;for(let m=0;m<p;m++){const v=d[m];if(v.validator(f))return v.classGroupId}},nE=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),a=t.slice(0,s);return a?eE+a:void 0})(),sE=e=>{const{theme:t,classGroups:s}=e;return iE(s,t)},iE=(e,t)=>{const s=BS();for(const a in e){const r=e[a];up(r,s,a,t)}return s},up=(e,t,s,a)=>{const r=e.length;for(let c=0;c<r;c++){const d=e[c];aE(d,t,s,a)}},aE=(e,t,s,a)=>{if(typeof e=="string"){rE(e,t,s);return}if(typeof e=="function"){oE(e,t,s,a);return}lE(e,t,s,a)},rE=(e,t,s)=>{const a=e===""?t:HS(t,e);a.classGroupId=s},oE=(e,t,s,a)=>{if(cE(e)){up(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(W2(s,e))},lE=(e,t,s,a)=>{const r=Object.entries(e),c=r.length;for(let d=0;d<c;d++){const[f,p]=r[d];up(p,HS(t,f),s,a)}},HS=(e,t)=>{let s=e;const a=t.split(Su),r=a.length;for(let c=0;c<r;c++){const d=a[c];let f=s.nextPart.get(d);f||(f=BS(),s.nextPart.set(d,f)),s=f}return s},cE=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,uE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),a=Object.create(null);const r=(c,d)=>{s[c]=d,t++,t>e&&(t=0,a=s,s=Object.create(null))};return{get(c){let d=s[c];if(d!==void 0)return d;if((d=a[c])!==void 0)return r(c,d),d},set(c,d){c in s?s[c]=d:r(c,d)}}},ym="!",Hx=":",dE=[],Gx=(e,t,s,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:r}),fE=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=r=>{const c=[];let d=0,f=0,p=0,m;const v=r.length;for(let S=0;S<v;S++){const C=r[S];if(d===0&&f===0){if(C===Hx){c.push(r.slice(p,S)),p=S+1;continue}if(C==="/"){m=S;continue}}C==="["?d++:C==="]"?d--:C==="("?f++:C===")"&&f--}const y=c.length===0?r:r.slice(p);let x=y,b=!1;y.endsWith(ym)?(x=y.slice(0,-1),b=!0):y.startsWith(ym)&&(x=y.slice(1),b=!0);const w=m&&m>p?m-p:void 0;return Gx(c,b,x,w)};if(t){const r=t+Hx,c=a;a=d=>d.startsWith(r)?c(d.slice(r.length)):Gx(dE,!1,d,void 0,!0)}if(s){const r=a;a=c=>s({className:c,parseClassName:r})}return a},hE=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,a)=>{t.set(s,1e6+a)}),s=>{const a=[];let r=[];for(let c=0;c<s.length;c++){const d=s[c],f=d[0]==="[",p=t.has(d);f||p?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(d)):r.push(d)}return r.length>0&&(r.sort(),a.push(...r)),a}},mE=e=>({cache:uE(e.cacheSize),parseClassName:fE(e),sortModifiers:hE(e),...tE(e)}),pE=/\s+/,gE=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:c}=t,d=[],f=e.trim().split(pE);let p="";for(let m=f.length-1;m>=0;m-=1){const v=f[m],{isExternal:y,modifiers:x,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:S}=s(v);if(y){p=v+(p.length>0?" "+p:p);continue}let C=!!S,k=a(C?w.substring(0,S):w);if(!k){if(!C){p=v+(p.length>0?" "+p:p);continue}if(k=a(w),!k){p=v+(p.length>0?" "+p:p);continue}C=!1}const E=x.length===0?"":x.length===1?x[0]:c(x).join(":"),A=b?E+ym:E,z=A+k;if(d.indexOf(z)>-1)continue;d.push(z);const L=r(k,C);for(let M=0;M<L.length;++M){const R=L[M];d.push(A+R)}p=v+(p.length>0?" "+p:p)}return p},yE=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=GS(s))&&(r&&(r+=" "),r+=a);return r},GS=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=GS(e[a]))&&(s&&(s+=" "),s+=t);return s},vE=(e,...t)=>{let s,a,r,c;const d=p=>{const m=t.reduce((v,y)=>y(v),e());return s=mE(m),a=s.cache.get,r=s.cache.set,c=f,f(p)},f=p=>{const m=a(p);if(m)return m;const v=gE(p,s);return r(p,v),v};return c=d,(...p)=>c(yE(...p))},xE=[],Zt=e=>{const t=s=>s[e]||xE;return t.isThemeGetter=!0,t},FS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ZS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,bE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,SE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jE=/\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$/,wE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,NE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wi=e=>bE.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Ni=e=>!!e&&Number.isInteger(Number(e)),Lh=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),qs=e=>SE.test(e),KS=()=>!0,kE=e=>jE.test(e)&&!wE.test(e),dp=()=>!1,_E=e=>NE.test(e),zE=e=>CE.test(e),EE=e=>!xe(e)&&!be(e),AE=e=>Bi(e,YS,dp),xe=e=>FS.test(e),ua=e=>Bi(e,JS,kE),Fx=e=>Bi(e,$E,Oe),RE=e=>Bi(e,WS,KS),TE=e=>Bi(e,XS,dp),Zx=e=>Bi(e,VS,dp),OE=e=>Bi(e,QS,zE),$c=e=>Bi(e,ej,_E),be=e=>ZS.test(e),qo=e=>Ea(e,JS),DE=e=>Ea(e,XS),Kx=e=>Ea(e,VS),LE=e=>Ea(e,YS),ME=e=>Ea(e,QS),Pc=e=>Ea(e,ej,!0),UE=e=>Ea(e,WS,!0),Bi=(e,t,s)=>{const a=FS.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},Ea=(e,t,s=!1)=>{const a=ZS.exec(e);return a?a[1]?t(a[1]):s:!1},VS=e=>e==="position"||e==="percentage",QS=e=>e==="image"||e==="url",YS=e=>e==="length"||e==="size"||e==="bg-size",JS=e=>e==="length",$E=e=>e==="number",XS=e=>e==="family-name",WS=e=>e==="number"||e==="weight",ej=e=>e==="shadow",PE=()=>{const e=Zt("color"),t=Zt("font"),s=Zt("text"),a=Zt("font-weight"),r=Zt("tracking"),c=Zt("leading"),d=Zt("breakpoint"),f=Zt("container"),p=Zt("spacing"),m=Zt("radius"),v=Zt("shadow"),y=Zt("inset-shadow"),x=Zt("text-shadow"),b=Zt("drop-shadow"),w=Zt("blur"),S=Zt("perspective"),C=Zt("aspect"),k=Zt("ease"),E=Zt("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...z(),be,xe],M=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],T=()=>[be,xe,p],P=()=>[wi,"full","auto",...T()],J=()=>[Ni,"none","subgrid",be,xe],Q=()=>["auto",{span:["full",Ni,be,xe]},Ni,be,xe],se=()=>[Ni,"auto",be,xe],pe=()=>["auto","min","max","fr",be,xe],ke=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],je=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...T()],G=()=>[wi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],oe=()=>[wi,"screen","full","dvw","lvw","svw","min","max","fit",...T()],q=()=>[wi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],X=()=>[e,be,xe],O=()=>[...z(),Kx,Zx,{position:[be,xe]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",LE,AE,{size:[be,xe]}],re=()=>[Lh,qo,ua],ue=()=>["","none","full",m,be,xe],he=()=>["",Oe,qo,ua],de=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[Oe,Lh,Kx,Zx],Ke=()=>["","none",w,be,xe],it=()=>["none",Oe,be,xe],me=()=>["none",Oe,be,xe],We=()=>[Oe,be,xe],dt=()=>[wi,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qs],breakpoint:[qs],color:[KS],container:[qs],"drop-shadow":[qs],ease:["in","out","in-out"],font:[EE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qs],shadow:[qs],spacing:["px",Oe],text:[qs],"text-shadow":[qs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wi,xe,be,C]}],container:["container"],columns:[{columns:[Oe,xe,be,f]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:L()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Ni,"auto",be,xe]}],basis:[{basis:[wi,"full","auto",f,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,wi,"auto","initial","none",xe]}],grow:[{grow:["",Oe,be,xe]}],shrink:[{shrink:["",Oe,be,xe]}],order:[{order:[Ni,"first","last","none",be,xe]}],"grid-cols":[{"grid-cols":J()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":J()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...ke(),"normal"]}],"justify-items":[{"justify-items":[...je(),"normal"]}],"justify-self":[{"justify-self":["auto",...je()]}],"align-content":[{content:["normal",...ke()]}],"align-items":[{items:[...je(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...je(),{baseline:["","last"]}]}],"place-content":[{"place-content":ke()}],"place-items":[{"place-items":[...je(),"baseline"]}],"place-self":[{"place-self":["auto",...je()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...oe()]}],"min-inline-size":[{"min-inline":["auto",...oe()]}],"max-inline-size":[{"max-inline":["none",...oe()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[f,"screen",...G()]}],"min-w":[{"min-w":[f,"screen","none",...G()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",s,qo,ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,UE,RE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lh,xe]}],"font-family":[{font:[DE,TE,t]}],"font-features":[{"font-features":[xe]}],"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:[r,be,xe]}],"line-clamp":[{"line-clamp":[Oe,"none",be,Fx]}],leading:[{leading:[c,...T()]}],"list-image":[{"list-image":["none",be,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",be,ua]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[Oe,"auto",be,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,xe]}],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",be,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ni,be,xe],radial:["",be,xe],conic:[Ni,be,xe]},ME,OE]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-bs":[{"border-bs":X()}],"border-color-be":[{"border-be":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,be,xe]}],"outline-w":[{outline:["",Oe,qo,ua]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",v,Pc,$c]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",y,Pc,$c]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[Oe,ua]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",x,Pc,$c]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[Oe,be,xe]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"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":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[be,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,xe]}],filter:[{filter:["","none",be,xe]}],blur:[{blur:Ke()}],brightness:[{brightness:[Oe,be,xe]}],contrast:[{contrast:[Oe,be,xe]}],"drop-shadow":[{"drop-shadow":["","none",b,Pc,$c]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",Oe,be,xe]}],"hue-rotate":[{"hue-rotate":[Oe,be,xe]}],invert:[{invert:["",Oe,be,xe]}],saturate:[{saturate:[Oe,be,xe]}],sepia:[{sepia:["",Oe,be,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",be,xe]}],"backdrop-blur":[{"backdrop-blur":Ke()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,be,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,be,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,be,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,be,xe]}],"backdrop-invert":[{"backdrop-invert":["",Oe,be,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,be,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,be,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,be,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",be,xe]}],ease:[{ease:["linear","initial",k,be,xe]}],delay:[{delay:[Oe,be,xe]}],animate:[{animate:["none",E,be,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,xe]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:it()}],"rotate-x":[{"rotate-x":it()}],"rotate-y":[{"rotate-y":it()}],"rotate-z":[{"rotate-z":it()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:We()}],"skew-x":[{"skew-x":We()}],"skew-y":[{"skew-y":We()}],transform:[{transform:[be,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:dt()}],"translate-x":[{"translate-x":dt()}],"translate-y":[{"translate-y":dt()}],"translate-z":[{"translate-z":dt()}],"translate-none":["translate-none"],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"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",be,xe]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",be,xe]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[Oe,qo,ua,Fx]}],stroke:[{stroke:["none",...X()]}],"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"]}},IE=vE(PE);function Qn(...e){return IE(PS(e))}const BE=IS("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"}}),ce=N.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,...r},c)=>{const d=a?Z2:"button";return l.jsx(d,{ref:c,className:Qn(BE({variant:t,size:s,className:e})),...r})});ce.displayName="Button";const qE=IS("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 tj({className:e,variant:t,...s}){return l.jsx("div",{className:Qn(qE({variant:t}),e),...s})}function Vx({compact:e=!1}){return l.jsxs(yt,{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"}),e?null:l.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function nl({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 ju(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function nj(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 HE(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 GE(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function nt({tone:e,children:t}){const s=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return l.jsx(tj,{variant:s,children:t})}function Iu({status:e}){return l.jsx(nt,{tone:nj(e),children:Pu(e)})}function Li(e,t,{checkForDefaultPrevented:s=!0}={}){return function(r){if(e?.(r),s===!1||!r.defaultPrevented)return t?.(r)}}function FE(e,t){const s=N.createContext(t),a=c=>{const{children:d,...f}=c,p=N.useMemo(()=>f,Object.values(f));return l.jsx(s.Provider,{value:p,children:d})};a.displayName=e+"Provider";function r(c){const d=N.useContext(s);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[a,r]}function ZE(e,t=[]){let s=[];function a(c,d){const f=N.createContext(d),p=s.length;s=[...s,d];const m=y=>{const{scope:x,children:b,...w}=y,S=x?.[e]?.[p]||f,C=N.useMemo(()=>w,Object.values(w));return l.jsx(S.Provider,{value:C,children:b})};m.displayName=c+"Provider";function v(y,x){const b=x?.[e]?.[p]||f,w=N.useContext(b);if(w)return w;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[m,v]}const r=()=>{const c=s.map(d=>N.createContext(d));return function(f){const p=f?.[e]||c;return N.useMemo(()=>({[`__scope${e}`]:{...f,[e]:p}}),[f,p])}};return r.scopeName=e,[a,KE(r,...t)]}function KE(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(c){const d=a.reduce((f,{useScope:p,scopeName:m})=>{const y=p(c)[`__scope${m}`];return{...f,...y}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}var sl=globalThis?.document?N.useLayoutEffect:()=>{},VE=qm[" useId ".trim().toString()]||(()=>{}),QE=0;function Mh(e){const[t,s]=N.useState(VE());return sl(()=>{s(a=>a??String(QE++))},[e]),e||(t?`radix-${t}`:"")}var YE=qm[" useInsertionEffect ".trim().toString()]||sl;function JE({prop:e,defaultProp:t,onChange:s=()=>{},caller:a}){const[r,c,d]=XE({defaultProp:t,onChange:s}),f=e!==void 0,p=f?e:r;{const v=N.useRef(e!==void 0);N.useEffect(()=>{const y=v.current;y!==f&&console.warn(`${a} is changing from ${y?"controlled":"uncontrolled"} to ${f?"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.`),v.current=f},[f,a])}const m=N.useCallback(v=>{if(f){const y=WE(v)?v(e):v;y!==e&&d.current?.(y)}else c(v)},[f,e,c,d]);return[p,m]}function XE({defaultProp:e,onChange:t}){const[s,a]=N.useState(e),r=N.useRef(s),c=N.useRef(t);return YE(()=>{c.current=t},[t]),N.useEffect(()=>{r.current!==s&&(c.current?.(s),r.current=s)},[s,r]),[s,a,c]}function WE(e){return typeof e=="function"}function sj(e){const t=eA(e),s=N.forwardRef((a,r)=>{const{children:c,...d}=a,f=N.Children.toArray(c),p=f.find(nA);if(p){const m=p.props.children,v=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,v):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}function eA(e){const t=N.forwardRef((s,a)=>{const{children:r,...c}=s;if(N.isValidElement(r)){const d=iA(r),f=sA(c,r.props);return r.type!==N.Fragment&&(f.ref=a?cp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tA=Symbol("radix.slottable");function nA(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tA}function sA(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const p=c(...f);return r(...f),p}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function iA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var aA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zs=aA.reduce((e,t)=>{const s=sj(`Primitive.${t}`),a=N.forwardRef((r,c)=>{const{asChild:d,...f}=r,p=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(p,{...f,ref:c})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function rA(e,t){e&&op.flushSync(()=>e.dispatchEvent(t))}function il(e){const t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...s)=>t.current?.(...s),[])}function oA(e,t=globalThis?.document){const s=il(e);N.useEffect(()=>{const a=r=>{r.key==="Escape"&&s(r)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[s,t])}var lA="DismissableLayer",vm="dismissableLayer.update",cA="dismissableLayer.pointerDownOutside",uA="dismissableLayer.focusOutside",Qx,ij=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),aj=N.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...p}=e,m=N.useContext(ij),[v,y]=N.useState(null),x=v?.ownerDocument??globalThis?.document,[,b]=N.useState({}),w=za(t,R=>y(R)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),E=v?S.indexOf(v):-1,A=m.layersWithOutsidePointerEventsDisabled.size>0,z=E>=k,L=hA(R=>{const T=R.target,P=[...m.branches].some(J=>J.contains(T));!z||P||(r?.(R),d?.(R),R.defaultPrevented||f?.())},x),M=mA(R=>{const T=R.target;[...m.branches].some(J=>J.contains(T))||(c?.(R),d?.(R),R.defaultPrevented||f?.())},x);return oA(R=>{E===m.layers.size-1&&(a?.(R),!R.defaultPrevented&&f&&(R.preventDefault(),f()))},x),N.useEffect(()=>{if(v)return s&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Qx=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(v)),m.layers.add(v),Yx(),()=>{s&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Qx)}},[v,x,s,m]),N.useEffect(()=>()=>{v&&(m.layers.delete(v),m.layersWithOutsidePointerEventsDisabled.delete(v),Yx())},[v,m]),N.useEffect(()=>{const R=()=>b({});return document.addEventListener(vm,R),()=>document.removeEventListener(vm,R)},[]),l.jsx(Zs.div,{...p,ref:w,style:{pointerEvents:A?z?"auto":"none":void 0,...e.style},onFocusCapture:Li(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Li(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Li(e.onPointerDownCapture,L.onPointerDownCapture)})});aj.displayName=lA;var dA="DismissableLayerBranch",fA=N.forwardRef((e,t)=>{const s=N.useContext(ij),a=N.useRef(null),r=za(t,a);return N.useEffect(()=>{const c=a.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),l.jsx(Zs.div,{...e,ref:r})});fA.displayName=dA;function hA(e,t=globalThis?.document){const s=il(e),a=N.useRef(!1),r=N.useRef(()=>{});return N.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let p=function(){rj(cA,s,m,{discrete:!0})};const m={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=p,t.addEventListener("click",r.current,{once:!0})):p()}else t.removeEventListener("click",r.current);a.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",c),t.removeEventListener("click",r.current)}},[t,s]),{onPointerDownCapture:()=>a.current=!0}}function mA(e,t=globalThis?.document){const s=il(e),a=N.useRef(!1);return N.useEffect(()=>{const r=c=>{c.target&&!a.current&&rj(uA,s,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,s]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Yx(){const e=new CustomEvent(vm);document.dispatchEvent(e)}function rj(e,t,s,{discrete:a}){const r=s.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&r.addEventListener(e,t,{once:!0}),a?rA(r,c):r.dispatchEvent(c)}var Uh="focusScope.autoFocusOnMount",$h="focusScope.autoFocusOnUnmount",Jx={bubbles:!1,cancelable:!0},pA="FocusScope",oj=N.forwardRef((e,t)=>{const{loop:s=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:c,...d}=e,[f,p]=N.useState(null),m=il(r),v=il(c),y=N.useRef(null),x=za(t,S=>p(S)),b=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(a){let S=function(A){if(b.paused||!f)return;const z=A.target;f.contains(z)?y.current=z:Ci(y.current,{select:!0})},C=function(A){if(b.paused||!f)return;const z=A.relatedTarget;z!==null&&(f.contains(z)||Ci(y.current,{select:!0}))},k=function(A){if(document.activeElement===document.body)for(const L of A)L.removedNodes.length>0&&Ci(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const E=new MutationObserver(k);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),E.disconnect()}}},[a,f,b.paused]),N.useEffect(()=>{if(f){Wx.add(b);const S=document.activeElement;if(!f.contains(S)){const k=new CustomEvent(Uh,Jx);f.addEventListener(Uh,m),f.dispatchEvent(k),k.defaultPrevented||(gA(SA(lj(f)),{select:!0}),document.activeElement===S&&Ci(f))}return()=>{f.removeEventListener(Uh,m),setTimeout(()=>{const k=new CustomEvent($h,Jx);f.addEventListener($h,v),f.dispatchEvent(k),k.defaultPrevented||Ci(S??document.body,{select:!0}),f.removeEventListener($h,v),Wx.remove(b)},0)}}},[f,m,v,b]);const w=N.useCallback(S=>{if(!s&&!a||b.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const E=S.currentTarget,[A,z]=yA(E);A&&z?!S.shiftKey&&k===z?(S.preventDefault(),s&&Ci(A,{select:!0})):S.shiftKey&&k===A&&(S.preventDefault(),s&&Ci(z,{select:!0})):k===E&&S.preventDefault()}},[s,a,b.paused]);return l.jsx(Zs.div,{tabIndex:-1,...d,ref:x,onKeyDown:w})});oj.displayName=pA;function gA(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(Ci(a,{select:t}),document.activeElement!==s)return}function yA(e){const t=lj(e),s=Xx(t,e),a=Xx(t.reverse(),e);return[s,a]}function lj(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function Xx(e,t){for(const s of e)if(!vA(s,{upTo:t}))return s}function vA(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 xA(e){return e instanceof HTMLInputElement&&"select"in e}function Ci(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&xA(e)&&t&&e.select()}}var Wx=bA();function bA(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=eb(e,t),e.unshift(t)},remove(t){e=eb(e,t),e[0]?.resume()}}}function eb(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function SA(e){return e.filter(t=>t.tagName!=="A")}var jA="Portal",cj=N.forwardRef((e,t)=>{const{container:s,...a}=e,[r,c]=N.useState(!1);sl(()=>c(!0),[]);const d=s||r&&globalThis?.document?.body;return d?Az.createPortal(l.jsx(Zs.div,{...a,ref:t}),d):null});cj.displayName=jA;function wA(e,t){return N.useReducer((s,a)=>t[s][a]??s,e)}var Bu=e=>{const{present:t,children:s}=e,a=NA(t),r=typeof s=="function"?s({present:a.isPresent}):N.Children.only(s),c=za(a.ref,CA(r));return typeof s=="function"||a.isPresent?N.cloneElement(r,{ref:c}):null};Bu.displayName="Presence";function NA(e){const[t,s]=N.useState(),a=N.useRef(null),r=N.useRef(e),c=N.useRef("none"),d=e?"mounted":"unmounted",[f,p]=wA(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const m=Ic(a.current);c.current=f==="mounted"?m:"none"},[f]),sl(()=>{const m=a.current,v=r.current;if(v!==e){const x=c.current,b=Ic(m);e?p("MOUNT"):b==="none"||m?.display==="none"?p("UNMOUNT"):p(v&&x!==b?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,p]),sl(()=>{if(t){let m;const v=t.ownerDocument.defaultView??window,y=b=>{const S=Ic(a.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(p("ANIMATION_END"),!r.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=b=>{b.target===t&&(c.current=Ic(a.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{v.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:N.useCallback(m=>{a.current=m?getComputedStyle(m):null,s(m)},[])}}function Ic(e){return e?.animationName||"none"}function CA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Ph=0;function kA(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tb()),document.body.insertAdjacentElement("beforeend",e[1]??tb()),Ph++,()=>{Ph===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ph--}},[])}function tb(){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 xs=function(){return xs=Object.assign||function(t){for(var s,a=1,r=arguments.length;a<r;a++){s=arguments[a];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(t[c]=s[c])}return t},xs.apply(this,arguments)};function uj(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s}function _A(e,t,s){if(s||arguments.length===2)for(var a=0,r=t.length,c;a<r;a++)(c||!(a in t))&&(c||(c=Array.prototype.slice.call(t,0,a)),c[a]=t[a]);return e.concat(c||Array.prototype.slice.call(t))}var au="right-scroll-bar-position",ru="width-before-scroll-bar",zA="with-scroll-bars-hidden",EA="--removed-body-scroll-bar-size";function Ih(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function AA(e,t){var s=N.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(a){var r=s.value;r!==a&&(s.value=a,s.callback(a,r))}}}})[0];return s.callback=t,s.facade}var RA=typeof window<"u"?N.useLayoutEffect:N.useEffect,nb=new WeakMap;function TA(e,t){var s=AA(null,function(a){return e.forEach(function(r){return Ih(r,a)})});return RA(function(){var a=nb.get(s);if(a){var r=new Set(a),c=new Set(e),d=s.current;r.forEach(function(f){c.has(f)||Ih(f,null)}),c.forEach(function(f){r.has(f)||Ih(f,d)})}nb.set(s,e)},[e]),s}function OA(e){return e}function DA(e,t){t===void 0&&(t=OA);var s=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var d=t(c,a);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(a=!0;s.length;){var d=s;s=[],d.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){a=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(c),d=s}var p=function(){var v=d;d=[],v.forEach(c)},m=function(){return Promise.resolve().then(p)};m(),s={push:function(v){d.push(v),m()},filter:function(v){return d=d.filter(v),s}}}};return r}function LA(e){e===void 0&&(e={});var t=DA(null);return t.options=xs({async:!0,ssr:!1},e),t}var dj=function(e){var t=e.sideCar,s=uj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return N.createElement(a,xs({},s))};dj.isSideCarExport=!0;function MA(e,t){return e.useMedium(t),dj}var fj=LA(),Bh=function(){},qu=N.forwardRef(function(e,t){var s=N.useRef(null),a=N.useState({onScrollCapture:Bh,onWheelCapture:Bh,onTouchMoveCapture:Bh}),r=a[0],c=a[1],d=e.forwardProps,f=e.children,p=e.className,m=e.removeScrollBar,v=e.enabled,y=e.shards,x=e.sideCar,b=e.noRelative,w=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,A=e.gapMode,z=uj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=x,M=TA([s,t]),R=xs(xs({},z),r);return N.createElement(N.Fragment,null,v&&N.createElement(L,{sideCar:fj,removeScrollBar:m,shards:y,noRelative:b,noIsolation:w,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:s,gapMode:A}),d?N.cloneElement(N.Children.only(f),xs(xs({},R),{ref:M})):N.createElement(E,xs({},R,{className:p,ref:M}),f))});qu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qu.classNames={fullWidth:ru,zeroRight:au};var UA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $A(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=UA();return t&&e.setAttribute("nonce",t),e}function PA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function IA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var BA=function(){var e=0,t=null;return{add:function(s){e==0&&(t=$A())&&(PA(t,s),IA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qA=function(){var e=BA();return function(t,s){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},hj=function(){var e=qA(),t=function(s){var a=s.styles,r=s.dynamic;return e(a,r),null};return t},HA={left:0,top:0,right:0,gap:0},qh=function(e){return parseInt(e||"",10)||0},GA=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[qh(s),qh(a),qh(r)]},FA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return HA;var t=GA(e),s=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-s+t[2]-t[0])}},ZA=hj(),zr="data-scroll-locked",KA=function(e,t,s,a){var r=e.left,c=e.top,d=e.right,f=e.gap;return s===void 0&&(s="margin"),`
13
- .`.concat(zA,` {
12
+ ${a}`}try{const s=JSON.parse(e);return JSON.stringify(s,null,2)}catch{return e}}function $u(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function vs(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function $x(e){return e===null?"Unknown":e?"Pass":"Fail"}function gm(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function B2(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function q2(e,t){if(!e)return{freq:"custom",hour:6,customCron:t};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const s=e.match(/^daily(?:@(\d+))?$/);if(s)return{freq:"daily",hour:s[1]?parseInt(s[1]):6,customCron:""};const a=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return a?{freq:a[1],hour:a[2]?parseInt(a[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:t}}function H2(e,t,s){const a=s==="UTC"?"UTC":s.split("/").pop()?.replace(/_/g," ")??s;if(!e)return`Custom: ${t} · ${a}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${a}`;const r=e.match(/^daily(?:@(\d+))?$/);if(r){const d=r[1]?parseInt(r[1]):6;return`Every day at ${gm(d)} · ${a}`}const c=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(c){const d={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},f=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${gm(f)} · ${a}`}return`${e} · ${a}`}function Px(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cp(...e){return t=>{let s=!1;const a=e.map(r=>{const c=Px(r,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let r=0;r<a.length;r++){const c=a[r];typeof c=="function"?c():Px(e[r],null)}}}}function _a(...e){return N.useCallback(cp(...e),e)}var G2=Symbol.for("react.lazy"),xu=qm[" use ".trim().toString()];function F2(e){return typeof e=="object"&&e!==null&&"then"in e}function US(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===G2&&"_payload"in e&&F2(e._payload)}function Z2(e){const t=V2(e),s=N.forwardRef((a,r)=>{let{children:c,...d}=a;US(c)&&typeof xu=="function"&&(c=xu(c._payload));const f=N.Children.toArray(c),p=f.find(Y2);if(p){const m=p.props.children,v=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return o.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,v):null})}return o.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}var K2=Z2("Slot");function V2(e){const t=N.forwardRef((s,a)=>{let{children:r,...c}=s;if(US(r)&&typeof xu=="function"&&(r=xu(r._payload)),N.isValidElement(r)){const d=X2(r),f=J2(c,r.props);return r.type!==N.Fragment&&(f.ref=a?cp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Q2=Symbol("radix.slottable");function Y2(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Q2}function J2(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const p=c(...f);return r(...f),p}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function X2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function $S(e){var t,s,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=$S(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function PS(){for(var e,t,s=0,a="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=$S(e))&&(a&&(a+=" "),a+=t);return a}const Ix=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Bx=PS,IS=(e,t)=>s=>{var a;if(t?.variants==null)return Bx(e,s?.class,s?.className);const{variants:r,defaultVariants:c}=t,d=Object.keys(r).map(m=>{const v=s?.[m],y=c?.[m];if(v===null)return null;const x=Ix(v)||Ix(y);return r[m][x]}),f=s&&Object.entries(s).reduce((m,v)=>{let[y,x]=v;return x===void 0||(m[y]=x),m},{}),p=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((m,v)=>{let{class:y,className:x,...b}=v;return Object.entries(b).every(w=>{let[S,C]=w;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...m,y,x]:m},[]);return Bx(e,d,p,s?.class,s?.className)},W2=(e,t)=>{const s=new Array(e.length+t.length);for(let a=0;a<e.length;a++)s[a]=e[a];for(let a=0;a<t.length;a++)s[e.length+a]=t[a];return s},eE=(e,t)=>({classGroupId:e,validator:t}),BS=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),bu="-",qx=[],tE="arbitrary..",nE=e=>{const t=iE(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return sE(d);const f=d.split(bu),p=f[0]===""&&f.length>1?1:0;return qS(f,p,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=a[d],m=s[d];return p?m?W2(m,p):p:m||qx}return s[d]||qx}}},qS=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],c=s.nextPart.get(r);if(c){const m=qS(e,t+1,c);if(m)return m}const d=s.validators;if(d===null)return;const f=t===0?e.join(bu):e.slice(t).join(bu),p=d.length;for(let m=0;m<p;m++){const v=d[m];if(v.validator(f))return v.classGroupId}},sE=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),a=t.slice(0,s);return a?tE+a:void 0})(),iE=e=>{const{theme:t,classGroups:s}=e;return aE(s,t)},aE=(e,t)=>{const s=BS();for(const a in e){const r=e[a];up(r,s,a,t)}return s},up=(e,t,s,a)=>{const r=e.length;for(let c=0;c<r;c++){const d=e[c];rE(d,t,s,a)}},rE=(e,t,s,a)=>{if(typeof e=="string"){oE(e,t,s);return}if(typeof e=="function"){lE(e,t,s,a);return}cE(e,t,s,a)},oE=(e,t,s)=>{const a=e===""?t:HS(t,e);a.classGroupId=s},lE=(e,t,s,a)=>{if(uE(e)){up(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(eE(s,e))},cE=(e,t,s,a)=>{const r=Object.entries(e),c=r.length;for(let d=0;d<c;d++){const[f,p]=r[d];up(p,HS(t,f),s,a)}},HS=(e,t)=>{let s=e;const a=t.split(bu),r=a.length;for(let c=0;c<r;c++){const d=a[c];let f=s.nextPart.get(d);f||(f=BS(),s.nextPart.set(d,f)),s=f}return s},uE=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,dE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),a=Object.create(null);const r=(c,d)=>{s[c]=d,t++,t>e&&(t=0,a=s,s=Object.create(null))};return{get(c){let d=s[c];if(d!==void 0)return d;if((d=a[c])!==void 0)return r(c,d),d},set(c,d){c in s?s[c]=d:r(c,d)}}},ym="!",Hx=":",fE=[],Gx=(e,t,s,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:r}),hE=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=r=>{const c=[];let d=0,f=0,p=0,m;const v=r.length;for(let S=0;S<v;S++){const C=r[S];if(d===0&&f===0){if(C===Hx){c.push(r.slice(p,S)),p=S+1;continue}if(C==="/"){m=S;continue}}C==="["?d++:C==="]"?d--:C==="("?f++:C===")"&&f--}const y=c.length===0?r:r.slice(p);let x=y,b=!1;y.endsWith(ym)?(x=y.slice(0,-1),b=!0):y.startsWith(ym)&&(x=y.slice(1),b=!0);const w=m&&m>p?m-p:void 0;return Gx(c,b,x,w)};if(t){const r=t+Hx,c=a;a=d=>d.startsWith(r)?c(d.slice(r.length)):Gx(fE,!1,d,void 0,!0)}if(s){const r=a;a=c=>s({className:c,parseClassName:r})}return a},mE=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,a)=>{t.set(s,1e6+a)}),s=>{const a=[];let r=[];for(let c=0;c<s.length;c++){const d=s[c],f=d[0]==="[",p=t.has(d);f||p?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(d)):r.push(d)}return r.length>0&&(r.sort(),a.push(...r)),a}},pE=e=>({cache:dE(e.cacheSize),parseClassName:hE(e),sortModifiers:mE(e),...nE(e)}),gE=/\s+/,yE=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:c}=t,d=[],f=e.trim().split(gE);let p="";for(let m=f.length-1;m>=0;m-=1){const v=f[m],{isExternal:y,modifiers:x,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:S}=s(v);if(y){p=v+(p.length>0?" "+p:p);continue}let C=!!S,k=a(C?w.substring(0,S):w);if(!k){if(!C){p=v+(p.length>0?" "+p:p);continue}if(k=a(w),!k){p=v+(p.length>0?" "+p:p);continue}C=!1}const E=x.length===0?"":x.length===1?x[0]:c(x).join(":"),R=b?E+ym:E,z=R+k;if(d.indexOf(z)>-1)continue;d.push(z);const L=r(k,C);for(let M=0;M<L.length;++M){const A=L[M];d.push(R+A)}p=v+(p.length>0?" "+p:p)}return p},vE=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=GS(s))&&(r&&(r+=" "),r+=a);return r},GS=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=GS(e[a]))&&(s&&(s+=" "),s+=t);return s},xE=(e,...t)=>{let s,a,r,c;const d=p=>{const m=t.reduce((v,y)=>y(v),e());return s=pE(m),a=s.cache.get,r=s.cache.set,c=f,f(p)},f=p=>{const m=a(p);if(m)return m;const v=yE(p,s);return r(p,v),v};return c=d,(...p)=>c(vE(...p))},bE=[],Zt=e=>{const t=s=>s[e]||bE;return t.isThemeGetter=!0,t},FS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ZS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wE=/\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$/,NE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,CE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ni=e=>SE.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Ci=e=>!!e&&Number.isInteger(Number(e)),Dh=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),qs=e=>jE.test(e),KS=()=>!0,_E=e=>wE.test(e)&&!NE.test(e),dp=()=>!1,zE=e=>CE.test(e),EE=e=>kE.test(e),RE=e=>!xe(e)&&!be(e),AE=e=>qi(e,YS,dp),xe=e=>FS.test(e),da=e=>qi(e,JS,_E),Fx=e=>qi(e,PE,Oe),TE=e=>qi(e,WS,KS),OE=e=>qi(e,XS,dp),Zx=e=>qi(e,VS,dp),DE=e=>qi(e,QS,EE),Uc=e=>qi(e,ej,zE),be=e=>ZS.test(e),Bo=e=>za(e,JS),LE=e=>za(e,XS),Kx=e=>za(e,VS),ME=e=>za(e,YS),UE=e=>za(e,QS),$c=e=>za(e,ej,!0),$E=e=>za(e,WS,!0),qi=(e,t,s)=>{const a=FS.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},za=(e,t,s=!1)=>{const a=ZS.exec(e);return a?a[1]?t(a[1]):s:!1},VS=e=>e==="position"||e==="percentage",QS=e=>e==="image"||e==="url",YS=e=>e==="length"||e==="size"||e==="bg-size",JS=e=>e==="length",PE=e=>e==="number",XS=e=>e==="family-name",WS=e=>e==="number"||e==="weight",ej=e=>e==="shadow",IE=()=>{const e=Zt("color"),t=Zt("font"),s=Zt("text"),a=Zt("font-weight"),r=Zt("tracking"),c=Zt("leading"),d=Zt("breakpoint"),f=Zt("container"),p=Zt("spacing"),m=Zt("radius"),v=Zt("shadow"),y=Zt("inset-shadow"),x=Zt("text-shadow"),b=Zt("drop-shadow"),w=Zt("blur"),S=Zt("perspective"),C=Zt("aspect"),k=Zt("ease"),E=Zt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...z(),be,xe],M=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],T=()=>[be,xe,p],P=()=>[Ni,"full","auto",...T()],J=()=>[Ci,"none","subgrid",be,xe],Q=()=>["auto",{span:["full",Ci,be,xe]},Ci,be,xe],se=()=>[Ci,"auto",be,xe],pe=()=>["auto","min","max","fr",be,xe],ke=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],je=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...T()],G=()=>[Ni,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],oe=()=>[Ni,"screen","full","dvw","lvw","svw","min","max","fit",...T()],q=()=>[Ni,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],X=()=>[e,be,xe],O=()=>[...z(),Kx,Zx,{position:[be,xe]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",ME,AE,{size:[be,xe]}],re=()=>[Dh,Bo,da],ue=()=>["","none","full",m,be,xe],he=()=>["",Oe,Bo,da],de=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[Oe,Dh,Kx,Zx],Ke=()=>["","none",w,be,xe],it=()=>["none",Oe,be,xe],me=()=>["none",Oe,be,xe],We=()=>[Oe,be,xe],dt=()=>[Ni,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qs],breakpoint:[qs],color:[KS],container:[qs],"drop-shadow":[qs],ease:["in","out","in-out"],font:[RE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qs],shadow:[qs],spacing:["px",Oe],text:[qs],"text-shadow":[qs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ni,xe,be,C]}],container:["container"],columns:[{columns:[Oe,xe,be,f]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:L()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Ci,"auto",be,xe]}],basis:[{basis:[Ni,"full","auto",f,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Ni,"auto","initial","none",xe]}],grow:[{grow:["",Oe,be,xe]}],shrink:[{shrink:["",Oe,be,xe]}],order:[{order:[Ci,"first","last","none",be,xe]}],"grid-cols":[{"grid-cols":J()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":J()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...ke(),"normal"]}],"justify-items":[{"justify-items":[...je(),"normal"]}],"justify-self":[{"justify-self":["auto",...je()]}],"align-content":[{content:["normal",...ke()]}],"align-items":[{items:[...je(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...je(),{baseline:["","last"]}]}],"place-content":[{"place-content":ke()}],"place-items":[{"place-items":[...je(),"baseline"]}],"place-self":[{"place-self":["auto",...je()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...oe()]}],"min-inline-size":[{"min-inline":["auto",...oe()]}],"max-inline-size":[{"max-inline":["none",...oe()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[f,"screen",...G()]}],"min-w":[{"min-w":[f,"screen","none",...G()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",s,Bo,da]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,$E,TE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Dh,xe]}],"font-family":[{font:[LE,OE,t]}],"font-features":[{"font-features":[xe]}],"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:[r,be,xe]}],"line-clamp":[{"line-clamp":[Oe,"none",be,Fx]}],leading:[{leading:[c,...T()]}],"list-image":[{"list-image":["none",be,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",be,da]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[Oe,"auto",be,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,xe]}],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",be,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ci,be,xe],radial:["",be,xe],conic:[Ci,be,xe]},UE,DE]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-bs":[{"border-bs":X()}],"border-color-be":[{"border-be":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,be,xe]}],"outline-w":[{outline:["",Oe,Bo,da]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",v,$c,Uc]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",y,$c,Uc]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[Oe,da]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",x,$c,Uc]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[Oe,be,xe]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"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":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[be,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,xe]}],filter:[{filter:["","none",be,xe]}],blur:[{blur:Ke()}],brightness:[{brightness:[Oe,be,xe]}],contrast:[{contrast:[Oe,be,xe]}],"drop-shadow":[{"drop-shadow":["","none",b,$c,Uc]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",Oe,be,xe]}],"hue-rotate":[{"hue-rotate":[Oe,be,xe]}],invert:[{invert:["",Oe,be,xe]}],saturate:[{saturate:[Oe,be,xe]}],sepia:[{sepia:["",Oe,be,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",be,xe]}],"backdrop-blur":[{"backdrop-blur":Ke()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,be,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,be,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,be,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,be,xe]}],"backdrop-invert":[{"backdrop-invert":["",Oe,be,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,be,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,be,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,be,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",be,xe]}],ease:[{ease:["linear","initial",k,be,xe]}],delay:[{delay:[Oe,be,xe]}],animate:[{animate:["none",E,be,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,xe]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:it()}],"rotate-x":[{"rotate-x":it()}],"rotate-y":[{"rotate-y":it()}],"rotate-z":[{"rotate-z":it()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:We()}],"skew-x":[{"skew-x":We()}],"skew-y":[{"skew-y":We()}],transform:[{transform:[be,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:dt()}],"translate-x":[{"translate-x":dt()}],"translate-y":[{"translate-y":dt()}],"translate-z":[{"translate-z":dt()}],"translate-none":["translate-none"],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"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",be,xe]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",be,xe]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[Oe,Bo,da,Fx]}],stroke:[{stroke:["none",...X()]}],"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"]}},BE=xE(IE);function Qn(...e){return BE(PS(e))}const qE=IS("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"}}),ce=N.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,...r},c)=>{const d=a?K2:"button";return o.jsx(d,{ref:c,className:Qn(qE({variant:t,size:s,className:e})),...r})});ce.displayName="Button";const HE=IS("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 tj({className:e,variant:t,...s}){return o.jsx("div",{className:Qn(HE({variant:t}),e),...s})}function Vx({compact:e=!1}){return o.jsxs(yt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[o.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"brand-copy",children:[o.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:o.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function tl({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 o.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 Su(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function nj(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 GE(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 FE(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function nt({tone:e,children:t}){const s=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return o.jsx(tj,{variant:s,children:t})}function Pu({status:e}){return o.jsx(nt,{tone:nj(e),children:$u(e)})}function Mi(e,t,{checkForDefaultPrevented:s=!0}={}){return function(r){if(e?.(r),s===!1||!r.defaultPrevented)return t?.(r)}}function ZE(e,t){const s=N.createContext(t),a=c=>{const{children:d,...f}=c,p=N.useMemo(()=>f,Object.values(f));return o.jsx(s.Provider,{value:p,children:d})};a.displayName=e+"Provider";function r(c){const d=N.useContext(s);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[a,r]}function KE(e,t=[]){let s=[];function a(c,d){const f=N.createContext(d),p=s.length;s=[...s,d];const m=y=>{const{scope:x,children:b,...w}=y,S=x?.[e]?.[p]||f,C=N.useMemo(()=>w,Object.values(w));return o.jsx(S.Provider,{value:C,children:b})};m.displayName=c+"Provider";function v(y,x){const b=x?.[e]?.[p]||f,w=N.useContext(b);if(w)return w;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[m,v]}const r=()=>{const c=s.map(d=>N.createContext(d));return function(f){const p=f?.[e]||c;return N.useMemo(()=>({[`__scope${e}`]:{...f,[e]:p}}),[f,p])}};return r.scopeName=e,[a,VE(r,...t)]}function VE(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(c){const d=a.reduce((f,{useScope:p,scopeName:m})=>{const y=p(c)[`__scope${m}`];return{...f,...y}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}var nl=globalThis?.document?N.useLayoutEffect:()=>{},QE=qm[" useId ".trim().toString()]||(()=>{}),YE=0;function Lh(e){const[t,s]=N.useState(QE());return nl(()=>{s(a=>a??String(YE++))},[e]),e||(t?`radix-${t}`:"")}var JE=qm[" useInsertionEffect ".trim().toString()]||nl;function XE({prop:e,defaultProp:t,onChange:s=()=>{},caller:a}){const[r,c,d]=WE({defaultProp:t,onChange:s}),f=e!==void 0,p=f?e:r;{const v=N.useRef(e!==void 0);N.useEffect(()=>{const y=v.current;y!==f&&console.warn(`${a} is changing from ${y?"controlled":"uncontrolled"} to ${f?"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.`),v.current=f},[f,a])}const m=N.useCallback(v=>{if(f){const y=eR(v)?v(e):v;y!==e&&d.current?.(y)}else c(v)},[f,e,c,d]);return[p,m]}function WE({defaultProp:e,onChange:t}){const[s,a]=N.useState(e),r=N.useRef(s),c=N.useRef(t);return JE(()=>{c.current=t},[t]),N.useEffect(()=>{r.current!==s&&(c.current?.(s),r.current=s)},[s,r]),[s,a,c]}function eR(e){return typeof e=="function"}function sj(e){const t=tR(e),s=N.forwardRef((a,r)=>{const{children:c,...d}=a,f=N.Children.toArray(c),p=f.find(sR);if(p){const m=p.props.children,v=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return o.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,v):null})}return o.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}function tR(e){const t=N.forwardRef((s,a)=>{const{children:r,...c}=s;if(N.isValidElement(r)){const d=aR(r),f=iR(c,r.props);return r.type!==N.Fragment&&(f.ref=a?cp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nR=Symbol("radix.slottable");function sR(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nR}function iR(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const p=c(...f);return r(...f),p}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function aR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var rR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ks=rR.reduce((e,t)=>{const s=sj(`Primitive.${t}`),a=N.forwardRef((r,c)=>{const{asChild:d,...f}=r,p=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(p,{...f,ref:c})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function oR(e,t){e&&op.flushSync(()=>e.dispatchEvent(t))}function sl(e){const t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...s)=>t.current?.(...s),[])}function lR(e,t=globalThis?.document){const s=sl(e);N.useEffect(()=>{const a=r=>{r.key==="Escape"&&s(r)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[s,t])}var cR="DismissableLayer",vm="dismissableLayer.update",uR="dismissableLayer.pointerDownOutside",dR="dismissableLayer.focusOutside",Qx,ij=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),aj=N.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...p}=e,m=N.useContext(ij),[v,y]=N.useState(null),x=v?.ownerDocument??globalThis?.document,[,b]=N.useState({}),w=_a(t,A=>y(A)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),E=v?S.indexOf(v):-1,R=m.layersWithOutsidePointerEventsDisabled.size>0,z=E>=k,L=mR(A=>{const T=A.target,P=[...m.branches].some(J=>J.contains(T));!z||P||(r?.(A),d?.(A),A.defaultPrevented||f?.())},x),M=pR(A=>{const T=A.target;[...m.branches].some(J=>J.contains(T))||(c?.(A),d?.(A),A.defaultPrevented||f?.())},x);return lR(A=>{E===m.layers.size-1&&(a?.(A),!A.defaultPrevented&&f&&(A.preventDefault(),f()))},x),N.useEffect(()=>{if(v)return s&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Qx=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(v)),m.layers.add(v),Yx(),()=>{s&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Qx)}},[v,x,s,m]),N.useEffect(()=>()=>{v&&(m.layers.delete(v),m.layersWithOutsidePointerEventsDisabled.delete(v),Yx())},[v,m]),N.useEffect(()=>{const A=()=>b({});return document.addEventListener(vm,A),()=>document.removeEventListener(vm,A)},[]),o.jsx(Ks.div,{...p,ref:w,style:{pointerEvents:R?z?"auto":"none":void 0,...e.style},onFocusCapture:Mi(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Mi(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Mi(e.onPointerDownCapture,L.onPointerDownCapture)})});aj.displayName=cR;var fR="DismissableLayerBranch",hR=N.forwardRef((e,t)=>{const s=N.useContext(ij),a=N.useRef(null),r=_a(t,a);return N.useEffect(()=>{const c=a.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),o.jsx(Ks.div,{...e,ref:r})});hR.displayName=fR;function mR(e,t=globalThis?.document){const s=sl(e),a=N.useRef(!1),r=N.useRef(()=>{});return N.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let p=function(){rj(uR,s,m,{discrete:!0})};const m={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=p,t.addEventListener("click",r.current,{once:!0})):p()}else t.removeEventListener("click",r.current);a.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",c),t.removeEventListener("click",r.current)}},[t,s]),{onPointerDownCapture:()=>a.current=!0}}function pR(e,t=globalThis?.document){const s=sl(e),a=N.useRef(!1);return N.useEffect(()=>{const r=c=>{c.target&&!a.current&&rj(dR,s,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,s]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Yx(){const e=new CustomEvent(vm);document.dispatchEvent(e)}function rj(e,t,s,{discrete:a}){const r=s.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&r.addEventListener(e,t,{once:!0}),a?oR(r,c):r.dispatchEvent(c)}var Mh="focusScope.autoFocusOnMount",Uh="focusScope.autoFocusOnUnmount",Jx={bubbles:!1,cancelable:!0},gR="FocusScope",oj=N.forwardRef((e,t)=>{const{loop:s=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:c,...d}=e,[f,p]=N.useState(null),m=sl(r),v=sl(c),y=N.useRef(null),x=_a(t,S=>p(S)),b=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(a){let S=function(R){if(b.paused||!f)return;const z=R.target;f.contains(z)?y.current=z:ki(y.current,{select:!0})},C=function(R){if(b.paused||!f)return;const z=R.relatedTarget;z!==null&&(f.contains(z)||ki(y.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const L of R)L.removedNodes.length>0&&ki(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const E=new MutationObserver(k);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),E.disconnect()}}},[a,f,b.paused]),N.useEffect(()=>{if(f){Wx.add(b);const S=document.activeElement;if(!f.contains(S)){const k=new CustomEvent(Mh,Jx);f.addEventListener(Mh,m),f.dispatchEvent(k),k.defaultPrevented||(yR(jR(lj(f)),{select:!0}),document.activeElement===S&&ki(f))}return()=>{f.removeEventListener(Mh,m),setTimeout(()=>{const k=new CustomEvent(Uh,Jx);f.addEventListener(Uh,v),f.dispatchEvent(k),k.defaultPrevented||ki(S??document.body,{select:!0}),f.removeEventListener(Uh,v),Wx.remove(b)},0)}}},[f,m,v,b]);const w=N.useCallback(S=>{if(!s&&!a||b.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const E=S.currentTarget,[R,z]=vR(E);R&&z?!S.shiftKey&&k===z?(S.preventDefault(),s&&ki(R,{select:!0})):S.shiftKey&&k===R&&(S.preventDefault(),s&&ki(z,{select:!0})):k===E&&S.preventDefault()}},[s,a,b.paused]);return o.jsx(Ks.div,{tabIndex:-1,...d,ref:x,onKeyDown:w})});oj.displayName=gR;function yR(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(ki(a,{select:t}),document.activeElement!==s)return}function vR(e){const t=lj(e),s=Xx(t,e),a=Xx(t.reverse(),e);return[s,a]}function lj(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function Xx(e,t){for(const s of e)if(!xR(s,{upTo:t}))return s}function xR(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 bR(e){return e instanceof HTMLInputElement&&"select"in e}function ki(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&bR(e)&&t&&e.select()}}var Wx=SR();function SR(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=eb(e,t),e.unshift(t)},remove(t){e=eb(e,t),e[0]?.resume()}}}function eb(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function jR(e){return e.filter(t=>t.tagName!=="A")}var wR="Portal",cj=N.forwardRef((e,t)=>{const{container:s,...a}=e,[r,c]=N.useState(!1);nl(()=>c(!0),[]);const d=s||r&&globalThis?.document?.body;return d?Az.createPortal(o.jsx(Ks.div,{...a,ref:t}),d):null});cj.displayName=wR;function NR(e,t){return N.useReducer((s,a)=>t[s][a]??s,e)}var Iu=e=>{const{present:t,children:s}=e,a=CR(t),r=typeof s=="function"?s({present:a.isPresent}):N.Children.only(s),c=_a(a.ref,kR(r));return typeof s=="function"||a.isPresent?N.cloneElement(r,{ref:c}):null};Iu.displayName="Presence";function CR(e){const[t,s]=N.useState(),a=N.useRef(null),r=N.useRef(e),c=N.useRef("none"),d=e?"mounted":"unmounted",[f,p]=NR(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const m=Pc(a.current);c.current=f==="mounted"?m:"none"},[f]),nl(()=>{const m=a.current,v=r.current;if(v!==e){const x=c.current,b=Pc(m);e?p("MOUNT"):b==="none"||m?.display==="none"?p("UNMOUNT"):p(v&&x!==b?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,p]),nl(()=>{if(t){let m;const v=t.ownerDocument.defaultView??window,y=b=>{const S=Pc(a.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(p("ANIMATION_END"),!r.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=b=>{b.target===t&&(c.current=Pc(a.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{v.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:N.useCallback(m=>{a.current=m?getComputedStyle(m):null,s(m)},[])}}function Pc(e){return e?.animationName||"none"}function kR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var $h=0;function _R(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tb()),document.body.insertAdjacentElement("beforeend",e[1]??tb()),$h++,()=>{$h===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),$h--}},[])}function tb(){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 xs=function(){return xs=Object.assign||function(t){for(var s,a=1,r=arguments.length;a<r;a++){s=arguments[a];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(t[c]=s[c])}return t},xs.apply(this,arguments)};function uj(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s}function zR(e,t,s){if(s||arguments.length===2)for(var a=0,r=t.length,c;a<r;a++)(c||!(a in t))&&(c||(c=Array.prototype.slice.call(t,0,a)),c[a]=t[a]);return e.concat(c||Array.prototype.slice.call(t))}var iu="right-scroll-bar-position",au="width-before-scroll-bar",ER="with-scroll-bars-hidden",RR="--removed-body-scroll-bar-size";function Ph(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function AR(e,t){var s=N.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(a){var r=s.value;r!==a&&(s.value=a,s.callback(a,r))}}}})[0];return s.callback=t,s.facade}var TR=typeof window<"u"?N.useLayoutEffect:N.useEffect,nb=new WeakMap;function OR(e,t){var s=AR(null,function(a){return e.forEach(function(r){return Ph(r,a)})});return TR(function(){var a=nb.get(s);if(a){var r=new Set(a),c=new Set(e),d=s.current;r.forEach(function(f){c.has(f)||Ph(f,null)}),c.forEach(function(f){r.has(f)||Ph(f,d)})}nb.set(s,e)},[e]),s}function DR(e){return e}function LR(e,t){t===void 0&&(t=DR);var s=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var d=t(c,a);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(a=!0;s.length;){var d=s;s=[],d.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){a=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(c),d=s}var p=function(){var v=d;d=[],v.forEach(c)},m=function(){return Promise.resolve().then(p)};m(),s={push:function(v){d.push(v),m()},filter:function(v){return d=d.filter(v),s}}}};return r}function MR(e){e===void 0&&(e={});var t=LR(null);return t.options=xs({async:!0,ssr:!1},e),t}var dj=function(e){var t=e.sideCar,s=uj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return N.createElement(a,xs({},s))};dj.isSideCarExport=!0;function UR(e,t){return e.useMedium(t),dj}var fj=MR(),Ih=function(){},Bu=N.forwardRef(function(e,t){var s=N.useRef(null),a=N.useState({onScrollCapture:Ih,onWheelCapture:Ih,onTouchMoveCapture:Ih}),r=a[0],c=a[1],d=e.forwardProps,f=e.children,p=e.className,m=e.removeScrollBar,v=e.enabled,y=e.shards,x=e.sideCar,b=e.noRelative,w=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,R=e.gapMode,z=uj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=x,M=OR([s,t]),A=xs(xs({},z),r);return N.createElement(N.Fragment,null,v&&N.createElement(L,{sideCar:fj,removeScrollBar:m,shards:y,noRelative:b,noIsolation:w,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:s,gapMode:R}),d?N.cloneElement(N.Children.only(f),xs(xs({},A),{ref:M})):N.createElement(E,xs({},A,{className:p,ref:M}),f))});Bu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bu.classNames={fullWidth:au,zeroRight:iu};var $R=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function PR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$R();return t&&e.setAttribute("nonce",t),e}function IR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function BR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var qR=function(){var e=0,t=null;return{add:function(s){e==0&&(t=PR())&&(IR(t,s),BR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},HR=function(){var e=qR();return function(t,s){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},hj=function(){var e=HR(),t=function(s){var a=s.styles,r=s.dynamic;return e(a,r),null};return t},GR={left:0,top:0,right:0,gap:0},Bh=function(e){return parseInt(e||"",10)||0},FR=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Bh(s),Bh(a),Bh(r)]},ZR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return GR;var t=FR(e),s=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-s+t[2]-t[0])}},KR=hj(),_r="data-scroll-locked",VR=function(e,t,s,a){var r=e.left,c=e.top,d=e.right,f=e.gap;return s===void 0&&(s="margin"),`
13
+ .`.concat(ER,` {
14
14
  overflow: hidden `).concat(a,`;
15
15
  padding-right: `).concat(f,"px ").concat(a,`;
16
16
  }
17
- body[`).concat(zr,`] {
17
+ body[`).concat(_r,`] {
18
18
  overflow: hidden `).concat(a,`;
19
19
  overscroll-behavior: contain;
20
20
  `).concat([t&&"position: relative ".concat(a,";"),s==="margin"&&`
@@ -27,35 +27,35 @@ ${a}`}try{const s=JSON.parse(e);return JSON.stringify(s,null,2)}catch{return e}}
27
27
  `),s==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
28
28
  }
29
29
 
30
- .`).concat(au,` {
30
+ .`).concat(iu,` {
31
31
  right: `).concat(f,"px ").concat(a,`;
32
32
  }
33
33
 
34
- .`).concat(ru,` {
34
+ .`).concat(au,` {
35
35
  margin-right: `).concat(f,"px ").concat(a,`;
36
36
  }
37
37
 
38
- .`).concat(au," .").concat(au,` {
38
+ .`).concat(iu," .").concat(iu,` {
39
39
  right: 0 `).concat(a,`;
40
40
  }
41
41
 
42
- .`).concat(ru," .").concat(ru,` {
42
+ .`).concat(au," .").concat(au,` {
43
43
  margin-right: 0 `).concat(a,`;
44
44
  }
45
45
 
46
- body[`).concat(zr,`] {
47
- `).concat(EA,": ").concat(f,`px;
46
+ body[`).concat(_r,`] {
47
+ `).concat(RR,": ").concat(f,`px;
48
48
  }
49
- `)},sb=function(){var e=parseInt(document.body.getAttribute(zr)||"0",10);return isFinite(e)?e:0},VA=function(){N.useEffect(function(){return document.body.setAttribute(zr,(sb()+1).toString()),function(){var e=sb()-1;e<=0?document.body.removeAttribute(zr):document.body.setAttribute(zr,e.toString())}},[])},QA=function(e){var t=e.noRelative,s=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;VA();var c=N.useMemo(function(){return FA(r)},[r]);return N.createElement(ZA,{styles:KA(c,!t,r,s?"":"!important")})},xm=!1;if(typeof window<"u")try{var Bc=Object.defineProperty({},"passive",{get:function(){return xm=!0,!0}});window.addEventListener("test",Bc,Bc),window.removeEventListener("test",Bc,Bc)}catch{xm=!1}var yr=xm?{passive:!1}:!1,YA=function(e){return e.tagName==="TEXTAREA"},mj=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!YA(e)&&s[t]==="visible")},JA=function(e){return mj(e,"overflowY")},XA=function(e){return mj(e,"overflowX")},ib=function(e,t){var s=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=pj(e,a);if(r){var c=gj(e,a),d=c[1],f=c[2];if(d>f)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},WA=function(e){var t=e.scrollTop,s=e.scrollHeight,a=e.clientHeight;return[t,s,a]},eR=function(e){var t=e.scrollLeft,s=e.scrollWidth,a=e.clientWidth;return[t,s,a]},pj=function(e,t){return e==="v"?JA(t):XA(t)},gj=function(e,t){return e==="v"?WA(t):eR(t)},tR=function(e,t){return e==="h"&&t==="rtl"?-1:1},nR=function(e,t,s,a,r){var c=tR(e,window.getComputedStyle(t).direction),d=c*a,f=s.target,p=t.contains(f),m=!1,v=d>0,y=0,x=0;do{if(!f)break;var b=gj(e,f),w=b[0],S=b[1],C=b[2],k=S-C-c*w;(w||k)&&pj(e,f)&&(y+=k,x+=w);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&f!==document.body||p&&(t.contains(f)||t===f));return(v&&Math.abs(y)<1||!v&&Math.abs(x)<1)&&(m=!0),m},qc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ab=function(e){return[e.deltaX,e.deltaY]},rb=function(e){return e&&"current"in e?e.current:e},sR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},iR=function(e){return`
49
+ `)},sb=function(){var e=parseInt(document.body.getAttribute(_r)||"0",10);return isFinite(e)?e:0},QR=function(){N.useEffect(function(){return document.body.setAttribute(_r,(sb()+1).toString()),function(){var e=sb()-1;e<=0?document.body.removeAttribute(_r):document.body.setAttribute(_r,e.toString())}},[])},YR=function(e){var t=e.noRelative,s=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;QR();var c=N.useMemo(function(){return ZR(r)},[r]);return N.createElement(KR,{styles:VR(c,!t,r,s?"":"!important")})},xm=!1;if(typeof window<"u")try{var Ic=Object.defineProperty({},"passive",{get:function(){return xm=!0,!0}});window.addEventListener("test",Ic,Ic),window.removeEventListener("test",Ic,Ic)}catch{xm=!1}var gr=xm?{passive:!1}:!1,JR=function(e){return e.tagName==="TEXTAREA"},mj=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!JR(e)&&s[t]==="visible")},XR=function(e){return mj(e,"overflowY")},WR=function(e){return mj(e,"overflowX")},ib=function(e,t){var s=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=pj(e,a);if(r){var c=gj(e,a),d=c[1],f=c[2];if(d>f)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},eA=function(e){var t=e.scrollTop,s=e.scrollHeight,a=e.clientHeight;return[t,s,a]},tA=function(e){var t=e.scrollLeft,s=e.scrollWidth,a=e.clientWidth;return[t,s,a]},pj=function(e,t){return e==="v"?XR(t):WR(t)},gj=function(e,t){return e==="v"?eA(t):tA(t)},nA=function(e,t){return e==="h"&&t==="rtl"?-1:1},sA=function(e,t,s,a,r){var c=nA(e,window.getComputedStyle(t).direction),d=c*a,f=s.target,p=t.contains(f),m=!1,v=d>0,y=0,x=0;do{if(!f)break;var b=gj(e,f),w=b[0],S=b[1],C=b[2],k=S-C-c*w;(w||k)&&pj(e,f)&&(y+=k,x+=w);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&f!==document.body||p&&(t.contains(f)||t===f));return(v&&Math.abs(y)<1||!v&&Math.abs(x)<1)&&(m=!0),m},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ab=function(e){return[e.deltaX,e.deltaY]},rb=function(e){return e&&"current"in e?e.current:e},iA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},aA=function(e){return`
50
50
  .block-interactivity-`.concat(e,` {pointer-events: none;}
51
51
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
52
- `)},aR=0,vr=[];function rR(e){var t=N.useRef([]),s=N.useRef([0,0]),a=N.useRef(),r=N.useState(aR++)[0],c=N.useState(hj)[0],d=N.useRef(e);N.useEffect(function(){d.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var S=_A([e.lockRef.current],(e.shards||[]).map(rb),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var f=N.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var k=qc(S),E=s.current,A="deltaX"in S?S.deltaX:E[0]-k[0],z="deltaY"in S?S.deltaY:E[1]-k[1],L,M=S.target,R=Math.abs(A)>Math.abs(z)?"h":"v";if("touches"in S&&R==="h"&&M.type==="range")return!1;var T=window.getSelection(),P=T&&T.anchorNode,J=P?P===M||P.contains(M):!1;if(J)return!1;var Q=ib(R,M);if(!Q)return!0;if(Q?L=R:(L=R==="v"?"h":"v",Q=ib(R,M)),!Q)return!1;if(!a.current&&"changedTouches"in S&&(A||z)&&(a.current=L),!L)return!0;var se=a.current||L;return nR(se,C,S,se==="h"?A:z)},[]),p=N.useCallback(function(S){var C=S;if(!(!vr.length||vr[vr.length-1]!==c)){var k="deltaY"in C?ab(C):qc(C),E=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&sR(L.delta,k)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var A=(d.current.shards||[]).map(rb).filter(Boolean).filter(function(L){return L.contains(C.target)}),z=A.length>0?f(C,A[0]):!d.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),m=N.useCallback(function(S,C,k,E){var A={name:S,delta:C,target:k,should:E,shadowParent:oR(k)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(z){return z!==A})},1)},[]),v=N.useCallback(function(S){s.current=qc(S),a.current=void 0},[]),y=N.useCallback(function(S){m(S.type,ab(S),S.target,f(S,e.lockRef.current))},[]),x=N.useCallback(function(S){m(S.type,qc(S),S.target,f(S,e.lockRef.current))},[]);N.useEffect(function(){return vr.push(c),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:x}),document.addEventListener("wheel",p,yr),document.addEventListener("touchmove",p,yr),document.addEventListener("touchstart",v,yr),function(){vr=vr.filter(function(S){return S!==c}),document.removeEventListener("wheel",p,yr),document.removeEventListener("touchmove",p,yr),document.removeEventListener("touchstart",v,yr)}},[]);var b=e.removeScrollBar,w=e.inert;return N.createElement(N.Fragment,null,w?N.createElement(c,{styles:iR(r)}):null,b?N.createElement(QA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function oR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lR=MA(fj,rR);var yj=N.forwardRef(function(e,t){return N.createElement(qu,xs({},e,{ref:t,sideCar:lR}))});yj.classNames=qu.classNames;var cR=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xr=new WeakMap,Hc=new WeakMap,Gc={},Hh=0,vj=function(e){return e&&(e.host||vj(e.parentNode))},uR=function(e,t){return t.map(function(s){if(e.contains(s))return s;var a=vj(s);return a&&e.contains(a)?a:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},dR=function(e,t,s,a){var r=uR(t,Array.isArray(e)?e:[e]);Gc[s]||(Gc[s]=new WeakMap);var c=Gc[s],d=[],f=new Set,p=new Set(r),m=function(y){!y||f.has(y)||(f.add(y),m(y.parentNode))};r.forEach(m);var v=function(y){!y||p.has(y)||Array.prototype.forEach.call(y.children,function(x){if(f.has(x))v(x);else try{var b=x.getAttribute(a),w=b!==null&&b!=="false",S=(xr.get(x)||0)+1,C=(c.get(x)||0)+1;xr.set(x,S),c.set(x,C),d.push(x),S===1&&w&&Hc.set(x,!0),C===1&&x.setAttribute(s,"true"),w||x.setAttribute(a,"true")}catch(k){console.error("aria-hidden: cannot operate on ",x,k)}})};return v(t),f.clear(),Hh++,function(){d.forEach(function(y){var x=xr.get(y)-1,b=c.get(y)-1;xr.set(y,x),c.set(y,b),x||(Hc.has(y)||y.removeAttribute(a),Hc.delete(y)),b||y.removeAttribute(s)}),Hh--,Hh||(xr=new WeakMap,xr=new WeakMap,Hc=new WeakMap,Gc={})}},fR=function(e,t,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=cR(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),dR(a,r,s,"aria-hidden")):function(){return null}},Hu="Dialog",[xj]=ZE(Hu),[hR,rs]=xj(Hu),bj=e=>{const{__scopeDialog:t,children:s,open:a,defaultOpen:r,onOpenChange:c,modal:d=!0}=e,f=N.useRef(null),p=N.useRef(null),[m,v]=JE({prop:a,defaultProp:r??!1,onChange:c,caller:Hu});return l.jsx(hR,{scope:t,triggerRef:f,contentRef:p,contentId:Mh(),titleId:Mh(),descriptionId:Mh(),open:m,onOpenChange:v,onOpenToggle:N.useCallback(()=>v(y=>!y),[v]),modal:d,children:s})};bj.displayName=Hu;var Sj="DialogTrigger",mR=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(Sj,s),c=za(t,r.triggerRef);return l.jsx(Zs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":mp(r.open),...a,ref:c,onClick:Li(e.onClick,r.onOpenToggle)})});mR.displayName=Sj;var fp="DialogPortal",[pR,jj]=xj(fp,{forceMount:void 0}),wj=e=>{const{__scopeDialog:t,forceMount:s,children:a,container:r}=e,c=rs(fp,t);return l.jsx(pR,{scope:t,forceMount:s,children:N.Children.map(a,d=>l.jsx(Bu,{present:s||c.open,children:l.jsx(cj,{asChild:!0,container:r,children:d})}))})};wj.displayName=fp;var wu="DialogOverlay",Nj=N.forwardRef((e,t)=>{const s=jj(wu,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=rs(wu,e.__scopeDialog);return c.modal?l.jsx(Bu,{present:a||c.open,children:l.jsx(yR,{...r,ref:t})}):null});Nj.displayName=wu;var gR=sj("DialogOverlay.RemoveScroll"),yR=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(wu,s);return l.jsx(yj,{as:gR,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(Zs.div,{"data-state":mp(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Ca="DialogContent",Cj=N.forwardRef((e,t)=>{const s=jj(Ca,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=rs(Ca,e.__scopeDialog);return l.jsx(Bu,{present:a||c.open,children:c.modal?l.jsx(vR,{...r,ref:t}):l.jsx(xR,{...r,ref:t})})});Cj.displayName=Ca;var vR=N.forwardRef((e,t)=>{const s=rs(Ca,e.__scopeDialog),a=N.useRef(null),r=za(t,s.contentRef,a);return N.useEffect(()=>{const c=a.current;if(c)return fR(c)},[]),l.jsx(kj,{...e,ref:r,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Li(e.onCloseAutoFocus,c=>{c.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Li(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&c.preventDefault()}),onFocusOutside:Li(e.onFocusOutside,c=>c.preventDefault())})}),xR=N.forwardRef((e,t)=>{const s=rs(Ca,e.__scopeDialog),a=N.useRef(!1),r=N.useRef(!1);return l.jsx(kj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(a.current||s.triggerRef.current?.focus(),c.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(a.current=!0,c.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const d=c.target;s.triggerRef.current?.contains(d)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&r.current&&c.preventDefault()}})}),kj=N.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:c,...d}=e,f=rs(Ca,s),p=N.useRef(null),m=za(t,p);return kA(),l.jsxs(l.Fragment,{children:[l.jsx(oj,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:c,children:l.jsx(aj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":mp(f.open),...d,ref:m,onDismiss:()=>f.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(bR,{titleId:f.titleId}),l.jsx(jR,{contentRef:p,descriptionId:f.descriptionId})]})]})}),hp="DialogTitle",_j=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(hp,s);return l.jsx(Zs.h2,{id:r.titleId,...a,ref:t})});_j.displayName=hp;var zj="DialogDescription",Ej=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(zj,s);return l.jsx(Zs.p,{id:r.descriptionId,...a,ref:t})});Ej.displayName=zj;var Aj="DialogClose",Rj=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(Aj,s);return l.jsx(Zs.button,{type:"button",...a,ref:t,onClick:Li(e.onClick,()=>r.onOpenChange(!1))})});Rj.displayName=Aj;function mp(e){return e?"open":"closed"}var Tj="DialogTitleWarning",[L4,Oj]=FE(Tj,{contentName:Ca,titleName:hp,docsSlug:"dialog"}),bR=({titleId:e})=>{const t=Oj(Tj),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
52
+ `)},rA=0,yr=[];function oA(e){var t=N.useRef([]),s=N.useRef([0,0]),a=N.useRef(),r=N.useState(rA++)[0],c=N.useState(hj)[0],d=N.useRef(e);N.useEffect(function(){d.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var S=zR([e.lockRef.current],(e.shards||[]).map(rb),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var f=N.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var k=Bc(S),E=s.current,R="deltaX"in S?S.deltaX:E[0]-k[0],z="deltaY"in S?S.deltaY:E[1]-k[1],L,M=S.target,A=Math.abs(R)>Math.abs(z)?"h":"v";if("touches"in S&&A==="h"&&M.type==="range")return!1;var T=window.getSelection(),P=T&&T.anchorNode,J=P?P===M||P.contains(M):!1;if(J)return!1;var Q=ib(A,M);if(!Q)return!0;if(Q?L=A:(L=A==="v"?"h":"v",Q=ib(A,M)),!Q)return!1;if(!a.current&&"changedTouches"in S&&(R||z)&&(a.current=L),!L)return!0;var se=a.current||L;return sA(se,C,S,se==="h"?R:z)},[]),p=N.useCallback(function(S){var C=S;if(!(!yr.length||yr[yr.length-1]!==c)){var k="deltaY"in C?ab(C):Bc(C),E=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&iA(L.delta,k)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(d.current.shards||[]).map(rb).filter(Boolean).filter(function(L){return L.contains(C.target)}),z=R.length>0?f(C,R[0]):!d.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),m=N.useCallback(function(S,C,k,E){var R={name:S,delta:C,target:k,should:E,shadowParent:lA(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(z){return z!==R})},1)},[]),v=N.useCallback(function(S){s.current=Bc(S),a.current=void 0},[]),y=N.useCallback(function(S){m(S.type,ab(S),S.target,f(S,e.lockRef.current))},[]),x=N.useCallback(function(S){m(S.type,Bc(S),S.target,f(S,e.lockRef.current))},[]);N.useEffect(function(){return yr.push(c),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:x}),document.addEventListener("wheel",p,gr),document.addEventListener("touchmove",p,gr),document.addEventListener("touchstart",v,gr),function(){yr=yr.filter(function(S){return S!==c}),document.removeEventListener("wheel",p,gr),document.removeEventListener("touchmove",p,gr),document.removeEventListener("touchstart",v,gr)}},[]);var b=e.removeScrollBar,w=e.inert;return N.createElement(N.Fragment,null,w?N.createElement(c,{styles:aA(r)}):null,b?N.createElement(YR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const cA=UR(fj,oA);var yj=N.forwardRef(function(e,t){return N.createElement(Bu,xs({},e,{ref:t,sideCar:cA}))});yj.classNames=Bu.classNames;var uA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vr=new WeakMap,qc=new WeakMap,Hc={},qh=0,vj=function(e){return e&&(e.host||vj(e.parentNode))},dA=function(e,t){return t.map(function(s){if(e.contains(s))return s;var a=vj(s);return a&&e.contains(a)?a:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},fA=function(e,t,s,a){var r=dA(t,Array.isArray(e)?e:[e]);Hc[s]||(Hc[s]=new WeakMap);var c=Hc[s],d=[],f=new Set,p=new Set(r),m=function(y){!y||f.has(y)||(f.add(y),m(y.parentNode))};r.forEach(m);var v=function(y){!y||p.has(y)||Array.prototype.forEach.call(y.children,function(x){if(f.has(x))v(x);else try{var b=x.getAttribute(a),w=b!==null&&b!=="false",S=(vr.get(x)||0)+1,C=(c.get(x)||0)+1;vr.set(x,S),c.set(x,C),d.push(x),S===1&&w&&qc.set(x,!0),C===1&&x.setAttribute(s,"true"),w||x.setAttribute(a,"true")}catch(k){console.error("aria-hidden: cannot operate on ",x,k)}})};return v(t),f.clear(),qh++,function(){d.forEach(function(y){var x=vr.get(y)-1,b=c.get(y)-1;vr.set(y,x),c.set(y,b),x||(qc.has(y)||y.removeAttribute(a),qc.delete(y)),b||y.removeAttribute(s)}),qh--,qh||(vr=new WeakMap,vr=new WeakMap,qc=new WeakMap,Hc={})}},hA=function(e,t,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=uA(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),fA(a,r,s,"aria-hidden")):function(){return null}},qu="Dialog",[xj]=KE(qu),[mA,rs]=xj(qu),bj=e=>{const{__scopeDialog:t,children:s,open:a,defaultOpen:r,onOpenChange:c,modal:d=!0}=e,f=N.useRef(null),p=N.useRef(null),[m,v]=XE({prop:a,defaultProp:r??!1,onChange:c,caller:qu});return o.jsx(mA,{scope:t,triggerRef:f,contentRef:p,contentId:Lh(),titleId:Lh(),descriptionId:Lh(),open:m,onOpenChange:v,onOpenToggle:N.useCallback(()=>v(y=>!y),[v]),modal:d,children:s})};bj.displayName=qu;var Sj="DialogTrigger",pA=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(Sj,s),c=_a(t,r.triggerRef);return o.jsx(Ks.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":mp(r.open),...a,ref:c,onClick:Mi(e.onClick,r.onOpenToggle)})});pA.displayName=Sj;var fp="DialogPortal",[gA,jj]=xj(fp,{forceMount:void 0}),wj=e=>{const{__scopeDialog:t,forceMount:s,children:a,container:r}=e,c=rs(fp,t);return o.jsx(gA,{scope:t,forceMount:s,children:N.Children.map(a,d=>o.jsx(Iu,{present:s||c.open,children:o.jsx(cj,{asChild:!0,container:r,children:d})}))})};wj.displayName=fp;var ju="DialogOverlay",Nj=N.forwardRef((e,t)=>{const s=jj(ju,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=rs(ju,e.__scopeDialog);return c.modal?o.jsx(Iu,{present:a||c.open,children:o.jsx(vA,{...r,ref:t})}):null});Nj.displayName=ju;var yA=sj("DialogOverlay.RemoveScroll"),vA=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(ju,s);return o.jsx(yj,{as:yA,allowPinchZoom:!0,shards:[r.contentRef],children:o.jsx(Ks.div,{"data-state":mp(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Na="DialogContent",Cj=N.forwardRef((e,t)=>{const s=jj(Na,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=rs(Na,e.__scopeDialog);return o.jsx(Iu,{present:a||c.open,children:c.modal?o.jsx(xA,{...r,ref:t}):o.jsx(bA,{...r,ref:t})})});Cj.displayName=Na;var xA=N.forwardRef((e,t)=>{const s=rs(Na,e.__scopeDialog),a=N.useRef(null),r=_a(t,s.contentRef,a);return N.useEffect(()=>{const c=a.current;if(c)return hA(c)},[]),o.jsx(kj,{...e,ref:r,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mi(e.onCloseAutoFocus,c=>{c.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Mi(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&c.preventDefault()}),onFocusOutside:Mi(e.onFocusOutside,c=>c.preventDefault())})}),bA=N.forwardRef((e,t)=>{const s=rs(Na,e.__scopeDialog),a=N.useRef(!1),r=N.useRef(!1);return o.jsx(kj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(a.current||s.triggerRef.current?.focus(),c.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(a.current=!0,c.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const d=c.target;s.triggerRef.current?.contains(d)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&r.current&&c.preventDefault()}})}),kj=N.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:c,...d}=e,f=rs(Na,s),p=N.useRef(null),m=_a(t,p);return _R(),o.jsxs(o.Fragment,{children:[o.jsx(oj,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:c,children:o.jsx(aj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":mp(f.open),...d,ref:m,onDismiss:()=>f.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(SA,{titleId:f.titleId}),o.jsx(wA,{contentRef:p,descriptionId:f.descriptionId})]})]})}),hp="DialogTitle",_j=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(hp,s);return o.jsx(Ks.h2,{id:r.titleId,...a,ref:t})});_j.displayName=hp;var zj="DialogDescription",Ej=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(zj,s);return o.jsx(Ks.p,{id:r.descriptionId,...a,ref:t})});Ej.displayName=zj;var Rj="DialogClose",Aj=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(Rj,s);return o.jsx(Ks.button,{type:"button",...a,ref:t,onClick:Mi(e.onClick,()=>r.onOpenChange(!1))})});Aj.displayName=Rj;function mp(e){return e?"open":"closed"}var Tj="DialogTitleWarning",[$4,Oj]=ZE(Tj,{contentName:Na,titleName:hp,docsSlug:"dialog"}),SA=({titleId:e})=>{const t=Oj(Tj),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
53
53
 
54
54
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
55
55
 
56
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},SR="DialogDescriptionWarning",jR=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Oj(SR).contentName}}.`;return N.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Dj=bj,Lj=wj,pp=Nj,gp=Cj,yp=_j,Mj=Ej,Uj=Rj;const wR=Dj,NR=Lj,$j=N.forwardRef(({className:e,...t},s)=>l.jsx(pp,{ref:s,className:Qn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));$j.displayName=pp.displayName;const CR=400,kR=1200,_R=720,Pj=N.forwardRef(({className:e,children:t,...s},a)=>{const[r,c]=N.useState(_R),d=N.useRef(!1),f=N.useRef(0),p=N.useRef(0),m=N.useCallback(x=>{d.current=!0,f.current=x.clientX,p.current=r,x.target.setPointerCapture(x.pointerId),x.preventDefault()},[r]),v=N.useCallback(x=>{if(!d.current)return;const b=f.current-x.clientX,w=Math.min(kR,Math.max(CR,p.current+b));c(w)},[]),y=N.useCallback(()=>{d.current=!1},[]);return l.jsxs(NR,{children:[l.jsx($j,{}),l.jsxs(gp,{ref:a,className:Qn("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(${r}px, 100vw)`},...s,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:m,onPointerMove:v,onPointerUp:y}),t,l.jsxs(Uj,{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($u,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Pj.displayName=gp.displayName;const zR=({className:e,...t})=>l.jsx("div",{className:Qn("flex flex-col gap-1.5 pr-10",e),...t}),Ij=N.forwardRef(({className:e,...t},s)=>l.jsx(yp,{ref:s,className:Qn("text-lg font-medium text-zinc-50",e),...t}));Ij.displayName=yp.displayName;const Bj=N.forwardRef(({className:e,...t},s)=>l.jsx(Mj,{ref:s,className:Qn("text-sm text-zinc-500",e),...t}));Bj.displayName=Mj.displayName;function ER({title:e,subtitle:t,children:s,open:a,onClose:r}){return l.jsx(wR,{open:a,onOpenChange:c=>c?void 0:r(),children:l.jsxs(Pj,{children:[l.jsxs(zR,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(Ij,{id:"drawer-title",children:e}),l.jsx(Bj,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:s})]})})}function te(e,t,s){function a(f,p){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:p,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,p);const m=d.prototype,v=Object.keys(m);for(let y=0;y<v.length;y++){const x=v[y];x in f||(f[x]=m[x].bind(f))}}const r=s?.Parent??Object;class c extends r{}Object.defineProperty(c,"name",{value:e});function d(f){var p;const m=s?.Parent?new c:this;a(m,f),(p=m._zod).deferred??(p.deferred=[]);for(const v of m._zod.deferred)v();return m}return Object.defineProperty(d,"init",{value:a}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>s?.Parent&&f instanceof s.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class Er extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class qj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Hj={};function $i(e){return Hj}function Gj(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,r])=>t.indexOf(+a)===-1).map(([a,r])=>r)}function bm(e,t){return typeof t=="bigint"?t.toString():t}function vp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function xp(e){return e==null}function bp(e){const t=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(t,s)}function AR(e,t){const s=(e.toString().split(".")[1]||"").length,a=t.toString();let r=(a.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(a)){const p=a.match(/\d?e-(\d?)/);p?.[1]&&(r=Number.parseInt(p[1]))}const c=s>r?s:r,d=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return d%f/10**c}const ob=Symbol("evaluating");function st(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==ob)return a===void 0&&(a=ob,a=s()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Aa(e,t,s){Object.defineProperty(e,t,{value:s,writable:!0,enumerable:!0,configurable:!0})}function qi(...e){const t={};for(const s of e){const a=Object.getOwnPropertyDescriptors(s);Object.assign(t,a)}return Object.defineProperties({},t)}function lb(e){return JSON.stringify(e)}function RR(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Fj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Nu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const TR=vp(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Or(e){if(Nu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(Nu(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function Zj(e){return Or(e)?{...e}:Array.isArray(e)?[...e]:e}const OR=new Set(["string","number","symbol"]);function Dr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hi(e,t,s){const a=new e._zod.constr(t??e._zod.def);return(!t||s?.parent)&&(a._zod.parent=e),a}function we(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 DR(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const LR={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 MR(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=qi(e._zod.def,{get shape(){const d={};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(d[f]=s.shape[f])}return Aa(this,"shape",d),d},checks:[]});return Hi(e,c)}function UR(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=qi(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete d[f]}return Aa(this,"shape",d),d},checks:[]});return Hi(e,c)}function $R(e,t){if(!Or(t))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0){const c=e._zod.def.shape;for(const d in t)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=qi(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Aa(this,"shape",c),c}});return Hi(e,r)}function PR(e,t){if(!Or(t))throw new Error("Invalid input to safeExtend: expected a plain object");const s=qi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Aa(this,"shape",a),a}});return Hi(e,s)}function IR(e,t){const s=qi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Aa(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Hi(e,s)}function BR(e,t,s){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=qi(t._zod.def,{get shape(){const f=t._zod.def.shape,p={...f};if(s)for(const m in s){if(!(m in f))throw new Error(`Unrecognized key: "${m}"`);s[m]&&(p[m]=e?new e({type:"optional",innerType:f[m]}):f[m])}else for(const m in f)p[m]=e?new e({type:"optional",innerType:f[m]}):f[m];return Aa(this,"shape",p),p},checks:[]});return Hi(t,d)}function qR(e,t,s){const a=qi(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(s)for(const d in s){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);s[d]&&(c[d]=new e({type:"nonoptional",innerType:r[d]}))}else for(const d in r)c[d]=new e({type:"nonoptional",innerType:r[d]});return Aa(this,"shape",c),c}});return Hi(t,a)}function wr(e,t=0){if(e.aborted===!0)return!0;for(let s=t;s<e.issues.length;s++)if(e.issues[s]?.continue!==!0)return!0;return!1}function Nr(e,t){return t.map(s=>{var a;return(a=s).path??(a.path=[]),s.path.unshift(e),s})}function Fc(e){return typeof e=="string"?e:e?.message}function Pi(e,t,s){const a={...e,path:e.path??[]};if(!e.message){const r=Fc(e.inst?._zod.def?.error?.(e))??Fc(t?.error?.(e))??Fc(s.customError?.(e))??Fc(s.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Sp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function al(...e){const[t,s,a]=e;return typeof t=="string"?{message:t,code:"custom",input:s,inst:a}:{...t}}const Kj=(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,bm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vj=te("$ZodError",Kj),Qj=te("$ZodError",Kj,{Parent:Error});function HR(e,t=s=>s.message){const s={},a=[];for(const r of e.issues)r.path.length>0?(s[r.path[0]]=s[r.path[0]]||[],s[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:s}}function GR(e,t=s=>s.message){const s={_errors:[]},a=r=>{for(const c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>a({issues:d}));else if(c.code==="invalid_key")a({issues:c.issues});else if(c.code==="invalid_element")a({issues:c.issues});else if(c.path.length===0)s._errors.push(t(c));else{let d=s,f=0;for(;f<c.path.length;){const p=c.path[f];f===c.path.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(t(c))):d[p]=d[p]||{_errors:[]},d=d[p],f++}}};return a(e),s}const jp=e=>(t,s,a,r)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise)throw new Er;if(d.issues.length){const f=new(r?.Err??e)(d.issues.map(p=>Pi(p,c,$i())));throw Fj(f,r?.callee),f}return d.value},wp=e=>async(t,s,a,r)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const f=new(r?.Err??e)(d.issues.map(p=>Pi(p,c,$i())));throw Fj(f,r?.callee),f}return d.value},Gu=e=>(t,s,a)=>{const r=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw new Er;return c.issues.length?{success:!1,error:new(e??Vj)(c.issues.map(d=>Pi(d,r,$i())))}:{success:!0,data:c.value}},FR=Gu(Qj),Fu=e=>async(t,s,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:s,issues:[]},r);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Pi(d,r,$i())))}:{success:!0,data:c.value}},ZR=Fu(Qj),KR=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return jp(e)(t,s,r)},VR=e=>(t,s,a)=>jp(e)(t,s,a),QR=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return wp(e)(t,s,r)},YR=e=>async(t,s,a)=>wp(e)(t,s,a),JR=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Gu(e)(t,s,r)},XR=e=>(t,s,a)=>Gu(e)(t,s,a),WR=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Fu(e)(t,s,r)},eT=e=>async(t,s,a)=>Fu(e)(t,s,a),tT=/^[cC][^\s-]{8,}$/,nT=/^[0-9a-z]+$/,sT=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,iT=/^[0-9a-vA-V]{20}$/,aT=/^[A-Za-z0-9]{27}$/,rT=/^[a-zA-Z0-9_-]{21}$/,oT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lT=/^([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})$/,cb=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)$/,cT=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function dT(){return new RegExp(uT,"u")}const fT=/^(?:(?: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])$/,hT=/^(([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}|:))$/,mT=/^((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])$/,pT=/^(([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])$/,gT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yj=/^[A-Za-z0-9_-]*$/,yT=/^\+[1-9]\d{6,14}$/,Jj="(?:(?:\\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])))",vT=new RegExp(`^${Jj}$`);function Xj(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 xT(e){return new RegExp(`^${Xj(e)}$`)}function bT(e){const t=Xj({precision:e.precision}),s=["Z"];e.local&&s.push(""),e.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${s.join("|")})`;return new RegExp(`^${Jj}T(?:${a})$`)}const ST=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},jT=/^-?\d+$/,Wj=/^-?\d+(?:\.\d+)?$/,wT=/^(?:true|false)$/i,NT=/^[^A-Z]*$/,CT=/^[^a-z]*$/,Nn=te("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),ew={number:"number",bigint:"bigint",object:"date"},tw=te("$ZodCheckLessThan",(e,t)=>{Nn.init(e,t);const s=ew[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:s,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nw=te("$ZodCheckGreaterThan",(e,t)=>{Nn.init(e,t);const s=ew[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:s,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),kT=te("$ZodCheckMultipleOf",(e,t)=>{Nn.init(e,t),e._zod.onattach.push(s=>{var a;(a=s._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=s=>{if(typeof s.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?s.value%t.value===BigInt(0):AR(s.value,t.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:t.value,input:s.value,inst:e,continue:!t.abort})}}),_T=te("$ZodCheckNumberFormat",(e,t)=>{Nn.init(e,t),t.format=t.format||"float64";const s=t.format?.includes("int"),a=s?"int":"number",[r,c]=LR[t.format];e._zod.onattach.push(d=>{const f=d._zod.bag;f.format=t.format,f.minimum=r,f.maximum=c,s&&(f.pattern=jT)}),e._zod.check=d=>{const f=d.value;if(s){if(!Number.isInteger(f)){d.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?d.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):d.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}f<r&&d.issues.push({origin:"number",input:f,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),f>c&&d.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),zT=te("$ZodCheckMaxLength",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!xp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const r=a.value;if(r.length<=t.maximum)return;const d=Sp(r);a.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ET=te("$ZodCheckMinLength",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!xp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const r=a.value;if(r.length>=t.minimum)return;const d=Sp(r);a.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),AT=te("$ZodCheckLengthEquals",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!xp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=a=>{const r=a.value,c=r.length;if(c===t.length)return;const d=Sp(r),f=c>t.length;a.issues.push({origin:d,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Zu=te("$ZodCheckStringFormat",(e,t)=>{var s,a;Nn.init(e,t),e._zod.onattach.push(r=>{const c=r._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(s=e._zod).check??(s.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),RT=te("$ZodCheckRegex",(e,t)=>{Zu.init(e,t),e._zod.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),TT=te("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=NT),Zu.init(e,t)}),OT=te("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=CT),Zu.init(e,t)}),DT=te("$ZodCheckIncludes",(e,t)=>{Nn.init(e,t);const s=Dr(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${s}`:s);t.pattern=a,e._zod.onattach.push(r=>{const c=r._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),LT=te("$ZodCheckStartsWith",(e,t)=>{Nn.init(e,t);const s=new RegExp(`^${Dr(t.prefix)}.*`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),MT=te("$ZodCheckEndsWith",(e,t)=>{Nn.init(e,t);const s=new RegExp(`.*${Dr(t.suffix)}$`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),UT=te("$ZodCheckOverwrite",(e,t)=>{Nn.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class $T{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 a=t.split(`
56
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},jA="DialogDescriptionWarning",wA=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Oj(jA).contentName}}.`;return N.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Dj=bj,Lj=wj,pp=Nj,gp=Cj,yp=_j,Mj=Ej,Uj=Aj;const NA=Dj,CA=Lj,$j=N.forwardRef(({className:e,...t},s)=>o.jsx(pp,{ref:s,className:Qn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));$j.displayName=pp.displayName;const kA=400,_A=1200,zA=720,Pj=N.forwardRef(({className:e,children:t,...s},a)=>{const[r,c]=N.useState(zA),d=N.useRef(!1),f=N.useRef(0),p=N.useRef(0),m=N.useCallback(x=>{d.current=!0,f.current=x.clientX,p.current=r,x.target.setPointerCapture(x.pointerId),x.preventDefault()},[r]),v=N.useCallback(x=>{if(!d.current)return;const b=f.current-x.clientX,w=Math.min(_A,Math.max(kA,p.current+b));c(w)},[]),y=N.useCallback(()=>{d.current=!1},[]);return o.jsxs(CA,{children:[o.jsx($j,{}),o.jsxs(gp,{ref:a,className:Qn("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(${r}px, 100vw)`},...s,children:[o.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:m,onPointerMove:v,onPointerUp:y}),t,o.jsxs(Uj,{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:[o.jsx(Uu,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Pj.displayName=gp.displayName;const EA=({className:e,...t})=>o.jsx("div",{className:Qn("flex flex-col gap-1.5 pr-10",e),...t}),Ij=N.forwardRef(({className:e,...t},s)=>o.jsx(yp,{ref:s,className:Qn("text-lg font-medium text-zinc-50",e),...t}));Ij.displayName=yp.displayName;const Bj=N.forwardRef(({className:e,...t},s)=>o.jsx(Mj,{ref:s,className:Qn("text-sm text-zinc-500",e),...t}));Bj.displayName=Mj.displayName;function RA({title:e,subtitle:t,children:s,open:a,onClose:r}){return o.jsx(NA,{open:a,onOpenChange:c=>c?void 0:r(),children:o.jsxs(Pj,{children:[o.jsxs(EA,{className:"drawer-head",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),o.jsx(Ij,{id:"drawer-title",children:e}),o.jsx(Bj,{className:"sr-only",children:t})]}),o.jsx("div",{className:"drawer-body",children:s})]})})}function te(e,t,s){function a(f,p){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:p,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,p);const m=d.prototype,v=Object.keys(m);for(let y=0;y<v.length;y++){const x=v[y];x in f||(f[x]=m[x].bind(f))}}const r=s?.Parent??Object;class c extends r{}Object.defineProperty(c,"name",{value:e});function d(f){var p;const m=s?.Parent?new c:this;a(m,f),(p=m._zod).deferred??(p.deferred=[]);for(const v of m._zod.deferred)v();return m}return Object.defineProperty(d,"init",{value:a}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>s?.Parent&&f instanceof s.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class zr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class qj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Hj={};function Pi(e){return Hj}function Gj(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,r])=>t.indexOf(+a)===-1).map(([a,r])=>r)}function bm(e,t){return typeof t=="bigint"?t.toString():t}function vp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function xp(e){return e==null}function bp(e){const t=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(t,s)}function AA(e,t){const s=(e.toString().split(".")[1]||"").length,a=t.toString();let r=(a.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(a)){const p=a.match(/\d?e-(\d?)/);p?.[1]&&(r=Number.parseInt(p[1]))}const c=s>r?s:r,d=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return d%f/10**c}const ob=Symbol("evaluating");function st(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==ob)return a===void 0&&(a=ob,a=s()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Ea(e,t,s){Object.defineProperty(e,t,{value:s,writable:!0,enumerable:!0,configurable:!0})}function Hi(...e){const t={};for(const s of e){const a=Object.getOwnPropertyDescriptors(s);Object.assign(t,a)}return Object.defineProperties({},t)}function lb(e){return JSON.stringify(e)}function TA(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Fj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const OA=vp(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Tr(e){if(wu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(wu(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function Zj(e){return Tr(e)?{...e}:Array.isArray(e)?[...e]:e}const DA=new Set(["string","number","symbol"]);function Or(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gi(e,t,s){const a=new e._zod.constr(t??e._zod.def);return(!t||s?.parent)&&(a._zod.parent=e),a}function we(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 LA(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const MA={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 UA(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Hi(e._zod.def,{get shape(){const d={};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(d[f]=s.shape[f])}return Ea(this,"shape",d),d},checks:[]});return Gi(e,c)}function $A(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Hi(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete d[f]}return Ea(this,"shape",d),d},checks:[]});return Gi(e,c)}function PA(e,t){if(!Tr(t))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0){const c=e._zod.def.shape;for(const d in t)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Hi(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Ea(this,"shape",c),c}});return Gi(e,r)}function IA(e,t){if(!Tr(t))throw new Error("Invalid input to safeExtend: expected a plain object");const s=Hi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ea(this,"shape",a),a}});return Gi(e,s)}function BA(e,t){const s=Hi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Ea(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Gi(e,s)}function qA(e,t,s){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=Hi(t._zod.def,{get shape(){const f=t._zod.def.shape,p={...f};if(s)for(const m in s){if(!(m in f))throw new Error(`Unrecognized key: "${m}"`);s[m]&&(p[m]=e?new e({type:"optional",innerType:f[m]}):f[m])}else for(const m in f)p[m]=e?new e({type:"optional",innerType:f[m]}):f[m];return Ea(this,"shape",p),p},checks:[]});return Gi(t,d)}function HA(e,t,s){const a=Hi(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(s)for(const d in s){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);s[d]&&(c[d]=new e({type:"nonoptional",innerType:r[d]}))}else for(const d in r)c[d]=new e({type:"nonoptional",innerType:r[d]});return Ea(this,"shape",c),c}});return Gi(t,a)}function jr(e,t=0){if(e.aborted===!0)return!0;for(let s=t;s<e.issues.length;s++)if(e.issues[s]?.continue!==!0)return!0;return!1}function wr(e,t){return t.map(s=>{var a;return(a=s).path??(a.path=[]),s.path.unshift(e),s})}function Gc(e){return typeof e=="string"?e:e?.message}function Ii(e,t,s){const a={...e,path:e.path??[]};if(!e.message){const r=Gc(e.inst?._zod.def?.error?.(e))??Gc(t?.error?.(e))??Gc(s.customError?.(e))??Gc(s.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Sp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function il(...e){const[t,s,a]=e;return typeof t=="string"?{message:t,code:"custom",input:s,inst:a}:{...t}}const Kj=(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,bm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vj=te("$ZodError",Kj),Qj=te("$ZodError",Kj,{Parent:Error});function GA(e,t=s=>s.message){const s={},a=[];for(const r of e.issues)r.path.length>0?(s[r.path[0]]=s[r.path[0]]||[],s[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:s}}function FA(e,t=s=>s.message){const s={_errors:[]},a=r=>{for(const c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>a({issues:d}));else if(c.code==="invalid_key")a({issues:c.issues});else if(c.code==="invalid_element")a({issues:c.issues});else if(c.path.length===0)s._errors.push(t(c));else{let d=s,f=0;for(;f<c.path.length;){const p=c.path[f];f===c.path.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(t(c))):d[p]=d[p]||{_errors:[]},d=d[p],f++}}};return a(e),s}const jp=e=>(t,s,a,r)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise)throw new zr;if(d.issues.length){const f=new(r?.Err??e)(d.issues.map(p=>Ii(p,c,Pi())));throw Fj(f,r?.callee),f}return d.value},wp=e=>async(t,s,a,r)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const f=new(r?.Err??e)(d.issues.map(p=>Ii(p,c,Pi())));throw Fj(f,r?.callee),f}return d.value},Hu=e=>(t,s,a)=>{const r=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw new zr;return c.issues.length?{success:!1,error:new(e??Vj)(c.issues.map(d=>Ii(d,r,Pi())))}:{success:!0,data:c.value}},ZA=Hu(Qj),Gu=e=>async(t,s,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:s,issues:[]},r);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Ii(d,r,Pi())))}:{success:!0,data:c.value}},KA=Gu(Qj),VA=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return jp(e)(t,s,r)},QA=e=>(t,s,a)=>jp(e)(t,s,a),YA=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return wp(e)(t,s,r)},JA=e=>async(t,s,a)=>wp(e)(t,s,a),XA=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Hu(e)(t,s,r)},WA=e=>(t,s,a)=>Hu(e)(t,s,a),eT=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Gu(e)(t,s,r)},tT=e=>async(t,s,a)=>Gu(e)(t,s,a),nT=/^[cC][^\s-]{8,}$/,sT=/^[0-9a-z]+$/,iT=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,aT=/^[0-9a-vA-V]{20}$/,rT=/^[A-Za-z0-9]{27}$/,oT=/^[a-zA-Z0-9_-]{21}$/,lT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cT=/^([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})$/,cb=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)$/,uT=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,dT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function fT(){return new RegExp(dT,"u")}const hT=/^(?:(?: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])$/,mT=/^(([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}|:))$/,pT=/^((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])$/,gT=/^(([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])$/,yT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yj=/^[A-Za-z0-9_-]*$/,vT=/^\+[1-9]\d{6,14}$/,Jj="(?:(?:\\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])))",xT=new RegExp(`^${Jj}$`);function Xj(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 bT(e){return new RegExp(`^${Xj(e)}$`)}function ST(e){const t=Xj({precision:e.precision}),s=["Z"];e.local&&s.push(""),e.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${s.join("|")})`;return new RegExp(`^${Jj}T(?:${a})$`)}const jT=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},wT=/^-?\d+$/,Wj=/^-?\d+(?:\.\d+)?$/,NT=/^(?:true|false)$/i,CT=/^[^A-Z]*$/,kT=/^[^a-z]*$/,Nn=te("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),ew={number:"number",bigint:"bigint",object:"date"},tw=te("$ZodCheckLessThan",(e,t)=>{Nn.init(e,t);const s=ew[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:s,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nw=te("$ZodCheckGreaterThan",(e,t)=>{Nn.init(e,t);const s=ew[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:s,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_T=te("$ZodCheckMultipleOf",(e,t)=>{Nn.init(e,t),e._zod.onattach.push(s=>{var a;(a=s._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=s=>{if(typeof s.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?s.value%t.value===BigInt(0):AA(s.value,t.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:t.value,input:s.value,inst:e,continue:!t.abort})}}),zT=te("$ZodCheckNumberFormat",(e,t)=>{Nn.init(e,t),t.format=t.format||"float64";const s=t.format?.includes("int"),a=s?"int":"number",[r,c]=MA[t.format];e._zod.onattach.push(d=>{const f=d._zod.bag;f.format=t.format,f.minimum=r,f.maximum=c,s&&(f.pattern=wT)}),e._zod.check=d=>{const f=d.value;if(s){if(!Number.isInteger(f)){d.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?d.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):d.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}f<r&&d.issues.push({origin:"number",input:f,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),f>c&&d.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),ET=te("$ZodCheckMaxLength",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!xp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const r=a.value;if(r.length<=t.maximum)return;const d=Sp(r);a.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),RT=te("$ZodCheckMinLength",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!xp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const r=a.value;if(r.length>=t.minimum)return;const d=Sp(r);a.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),AT=te("$ZodCheckLengthEquals",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!xp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=a=>{const r=a.value,c=r.length;if(c===t.length)return;const d=Sp(r),f=c>t.length;a.issues.push({origin:d,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Fu=te("$ZodCheckStringFormat",(e,t)=>{var s,a;Nn.init(e,t),e._zod.onattach.push(r=>{const c=r._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(s=e._zod).check??(s.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),TT=te("$ZodCheckRegex",(e,t)=>{Fu.init(e,t),e._zod.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),OT=te("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=CT),Fu.init(e,t)}),DT=te("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kT),Fu.init(e,t)}),LT=te("$ZodCheckIncludes",(e,t)=>{Nn.init(e,t);const s=Or(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${s}`:s);t.pattern=a,e._zod.onattach.push(r=>{const c=r._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),MT=te("$ZodCheckStartsWith",(e,t)=>{Nn.init(e,t);const s=new RegExp(`^${Or(t.prefix)}.*`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),UT=te("$ZodCheckEndsWith",(e,t)=>{Nn.init(e,t);const s=new RegExp(`.*${Or(t.suffix)}$`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),$T=te("$ZodCheckOverwrite",(e,t)=>{Nn.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class PT{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 a=t.split(`
57
57
  `).filter(d=>d),r=Math.min(...a.map(d=>d.length-d.trimStart().length)),c=a.map(d=>d.slice(r)).map(d=>" ".repeat(this.indent*2)+d);for(const d of c)this.content.push(d)}compile(){const t=Function,s=this?.args,r=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...s,r.join(`
58
- `))}}const PT={major:4,minor:3,patch:6},St=te("$ZodType",(e,t)=>{var s;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=PT;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const r of a)for(const c of r._zod.onattach)c(e);if(a.length===0)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(d,f,p)=>{let m=wr(d),v;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(d))continue}else if(m)continue;const x=d.issues.length,b=y._zod.check(d);if(b instanceof Promise&&p?.async===!1)throw new Er;if(v||b instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await b,d.issues.length!==x&&(m||(m=wr(d,x)))});else{if(d.issues.length===x)continue;m||(m=wr(d,x))}}return v?v.then(()=>d):d},c=(d,f,p)=>{if(wr(d))return d.aborted=!0,d;const m=r(f,a,p);if(m instanceof Promise){if(p.async===!1)throw new Er;return m.then(v=>e._zod.parse(v,p))}return e._zod.parse(m,p)};e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){const m=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(v=>c(v,d,f)):c(m,d,f)}const p=e._zod.parse(d,f);if(p instanceof Promise){if(f.async===!1)throw new Er;return p.then(m=>r(m,a,f))}return r(p,a,f)}}st(e,"~standard",()=>({validate:r=>{try{const c=FR(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return ZR(e,r).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),Np=te("$ZodString",(e,t)=>{St.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ST(e._zod.bag),e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),xt=te("$ZodStringFormat",(e,t)=>{Zu.init(e,t),Np.init(e,t)}),IT=te("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=lT),xt.init(e,t)}),BT=te("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=cb(a))}else t.pattern??(t.pattern=cb());xt.init(e,t)}),qT=te("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cT),xt.init(e,t)}),HT=te("$ZodURL",(e,t)=>{xt.init(e,t),e._zod.check=s=>{try{const a=s.value.trim(),r=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:s.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:s.value,inst:e,continue:!t.abort})),t.normalize?s.value=r.href:s.value=a;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!t.abort})}}}),GT=te("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=dT()),xt.init(e,t)}),FT=te("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=rT),xt.init(e,t)}),ZT=te("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=tT),xt.init(e,t)}),KT=te("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=nT),xt.init(e,t)}),VT=te("$ZodULID",(e,t)=>{t.pattern??(t.pattern=sT),xt.init(e,t)}),QT=te("$ZodXID",(e,t)=>{t.pattern??(t.pattern=iT),xt.init(e,t)}),YT=te("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=aT),xt.init(e,t)}),JT=te("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=bT(t)),xt.init(e,t)}),XT=te("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vT),xt.init(e,t)}),WT=te("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=xT(t)),xt.init(e,t)}),eO=te("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=oT),xt.init(e,t)}),tO=te("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fT),xt.init(e,t),e._zod.bag.format="ipv4"}),nO=te("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=hT),xt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=s=>{try{new URL(`http://[${s.value}]`)}catch{s.issues.push({code:"invalid_format",format:"ipv6",input:s.value,inst:e,continue:!t.abort})}}}),sO=te("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=mT),xt.init(e,t)}),iO=te("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=pT),xt.init(e,t),e._zod.check=s=>{const a=s.value.split("/");try{if(a.length!==2)throw new Error;const[r,c]=a;if(!c)throw new Error;const d=Number(c);if(`${d}`!==c)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${r}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:e,continue:!t.abort})}}});function sw(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const aO=te("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=gT),xt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{sw(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}});function rO(e){if(!Yj.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return sw(s)}const oO=te("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Yj),xt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{rO(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!t.abort})}}),lO=te("$ZodE164",(e,t)=>{t.pattern??(t.pattern=yT),xt.init(e,t)});function cO(e,t=null){try{const s=e.split(".");if(s.length!==3)return!1;const[a]=s;if(!a)return!1;const r=JSON.parse(atob(a));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}const uO=te("$ZodJWT",(e,t)=>{xt.init(e,t),e._zod.check=s=>{cO(s.value,t.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!t.abort})}}),iw=te("$ZodNumber",(e,t)=>{St.init(e,t),e._zod.pattern=e._zod.bag.pattern??Wj,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=Number(s.value)}catch{}const r=s.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return s;const c=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...c?{received:c}:{}}),s}}),dO=te("$ZodNumberFormat",(e,t)=>{_T.init(e,t),iw.init(e,t)}),fO=te("$ZodBoolean",(e,t)=>{St.init(e,t),e._zod.pattern=wT,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=!!s.value}catch{}const r=s.value;return typeof r=="boolean"||s.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),s}}),hO=te("$ZodUnknown",(e,t)=>{St.init(e,t),e._zod.parse=s=>s}),mO=te("$ZodNever",(e,t)=>{St.init(e,t),e._zod.parse=(s,a)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function ub(e,t,s){e.issues.length&&t.issues.push(...Nr(s,e.issues)),t.value[s]=e.value}const pO=te("$ZodArray",(e,t)=>{St.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Array.isArray(r))return s.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),s;s.value=Array(r.length);const c=[];for(let d=0;d<r.length;d++){const f=r[d],p=t.element._zod.run({value:f,issues:[]},a);p instanceof Promise?c.push(p.then(m=>ub(m,s,d))):ub(p,s,d)}return c.length?Promise.all(c).then(()=>s):s}});function Cu(e,t,s,a,r){if(e.issues.length){if(r&&!(s in a))return;t.issues.push(...Nr(s,e.issues))}e.value===void 0?s in a&&(t.value[s]=void 0):t.value[s]=e.value}function aw(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const s=DR(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function rw(e,t,s,a,r,c){const d=[],f=r.keySet,p=r.catchall._zod,m=p.def.type,v=p.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){d.push(y);continue}const x=p.run({value:t[y],issues:[]},a);x instanceof Promise?e.push(x.then(b=>Cu(b,s,y,t,v))):Cu(x,s,y,t,v)}return d.length&&s.issues.push({code:"unrecognized_keys",keys:d,input:t,inst:c}),e.length?Promise.all(e).then(()=>s):s}const gO=te("$ZodObject",(e,t)=>{if(St.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const p={...f};return Object.defineProperty(t,"shape",{value:p}),p}})}const a=vp(()=>aw(t));st(e._zod,"propValues",()=>{const f=t.shape,p={};for(const m in f){const v=f[m]._zod;if(v.values){p[m]??(p[m]=new Set);for(const y of v.values)p[m].add(y)}}return p});const r=Nu,c=t.catchall;let d;e._zod.parse=(f,p)=>{d??(d=a.value);const m=f.value;if(!r(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const v=[],y=d.shape;for(const x of d.keys){const b=y[x],w=b._zod.optout==="optional",S=b._zod.run({value:m[x],issues:[]},p);S instanceof Promise?v.push(S.then(C=>Cu(C,f,x,m,w))):Cu(S,f,x,m,w)}return c?rw(v,m,f,p,a.value,e):v.length?Promise.all(v).then(()=>f):f}}),yO=te("$ZodObjectJIT",(e,t)=>{gO.init(e,t);const s=e._zod.parse,a=vp(()=>aw(t)),r=x=>{const b=new $T(["shape","payload","ctx"]),w=a.value,S=A=>{const z=lb(A);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};b.write("const input = payload.value;");const C=Object.create(null);let k=0;for(const A of w.keys)C[A]=`key_${k++}`;b.write("const newResult = {};");for(const A of w.keys){const z=C[A],L=lb(A),R=x[A]?._zod?.optout==="optional";b.write(`const ${z} = ${S(A)};`),R?b.write(`
58
+ `))}}const IT={major:4,minor:3,patch:6},bt=te("$ZodType",(e,t)=>{var s;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=IT;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const r of a)for(const c of r._zod.onattach)c(e);if(a.length===0)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(d,f,p)=>{let m=jr(d),v;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(d))continue}else if(m)continue;const x=d.issues.length,b=y._zod.check(d);if(b instanceof Promise&&p?.async===!1)throw new zr;if(v||b instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await b,d.issues.length!==x&&(m||(m=jr(d,x)))});else{if(d.issues.length===x)continue;m||(m=jr(d,x))}}return v?v.then(()=>d):d},c=(d,f,p)=>{if(jr(d))return d.aborted=!0,d;const m=r(f,a,p);if(m instanceof Promise){if(p.async===!1)throw new zr;return m.then(v=>e._zod.parse(v,p))}return e._zod.parse(m,p)};e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){const m=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(v=>c(v,d,f)):c(m,d,f)}const p=e._zod.parse(d,f);if(p instanceof Promise){if(f.async===!1)throw new zr;return p.then(m=>r(m,a,f))}return r(p,a,f)}}st(e,"~standard",()=>({validate:r=>{try{const c=ZA(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return KA(e,r).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),Np=te("$ZodString",(e,t)=>{bt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??jT(e._zod.bag),e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),xt=te("$ZodStringFormat",(e,t)=>{Fu.init(e,t),Np.init(e,t)}),BT=te("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=cT),xt.init(e,t)}),qT=te("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=cb(a))}else t.pattern??(t.pattern=cb());xt.init(e,t)}),HT=te("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=uT),xt.init(e,t)}),GT=te("$ZodURL",(e,t)=>{xt.init(e,t),e._zod.check=s=>{try{const a=s.value.trim(),r=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:s.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:s.value,inst:e,continue:!t.abort})),t.normalize?s.value=r.href:s.value=a;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!t.abort})}}}),FT=te("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=fT()),xt.init(e,t)}),ZT=te("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=oT),xt.init(e,t)}),KT=te("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=nT),xt.init(e,t)}),VT=te("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=sT),xt.init(e,t)}),QT=te("$ZodULID",(e,t)=>{t.pattern??(t.pattern=iT),xt.init(e,t)}),YT=te("$ZodXID",(e,t)=>{t.pattern??(t.pattern=aT),xt.init(e,t)}),JT=te("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=rT),xt.init(e,t)}),XT=te("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ST(t)),xt.init(e,t)}),WT=te("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=xT),xt.init(e,t)}),eO=te("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=bT(t)),xt.init(e,t)}),tO=te("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=lT),xt.init(e,t)}),nO=te("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=hT),xt.init(e,t),e._zod.bag.format="ipv4"}),sO=te("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mT),xt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=s=>{try{new URL(`http://[${s.value}]`)}catch{s.issues.push({code:"invalid_format",format:"ipv6",input:s.value,inst:e,continue:!t.abort})}}}),iO=te("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=pT),xt.init(e,t)}),aO=te("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=gT),xt.init(e,t),e._zod.check=s=>{const a=s.value.split("/");try{if(a.length!==2)throw new Error;const[r,c]=a;if(!c)throw new Error;const d=Number(c);if(`${d}`!==c)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${r}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:e,continue:!t.abort})}}});function sw(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const rO=te("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yT),xt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{sw(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}});function oO(e){if(!Yj.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return sw(s)}const lO=te("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Yj),xt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{oO(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!t.abort})}}),cO=te("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vT),xt.init(e,t)});function uO(e,t=null){try{const s=e.split(".");if(s.length!==3)return!1;const[a]=s;if(!a)return!1;const r=JSON.parse(atob(a));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}const dO=te("$ZodJWT",(e,t)=>{xt.init(e,t),e._zod.check=s=>{uO(s.value,t.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!t.abort})}}),iw=te("$ZodNumber",(e,t)=>{bt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Wj,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=Number(s.value)}catch{}const r=s.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return s;const c=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...c?{received:c}:{}}),s}}),fO=te("$ZodNumberFormat",(e,t)=>{zT.init(e,t),iw.init(e,t)}),hO=te("$ZodBoolean",(e,t)=>{bt.init(e,t),e._zod.pattern=NT,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=!!s.value}catch{}const r=s.value;return typeof r=="boolean"||s.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),s}}),mO=te("$ZodUnknown",(e,t)=>{bt.init(e,t),e._zod.parse=s=>s}),pO=te("$ZodNever",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function ub(e,t,s){e.issues.length&&t.issues.push(...wr(s,e.issues)),t.value[s]=e.value}const gO=te("$ZodArray",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Array.isArray(r))return s.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),s;s.value=Array(r.length);const c=[];for(let d=0;d<r.length;d++){const f=r[d],p=t.element._zod.run({value:f,issues:[]},a);p instanceof Promise?c.push(p.then(m=>ub(m,s,d))):ub(p,s,d)}return c.length?Promise.all(c).then(()=>s):s}});function Nu(e,t,s,a,r){if(e.issues.length){if(r&&!(s in a))return;t.issues.push(...wr(s,e.issues))}e.value===void 0?s in a&&(t.value[s]=void 0):t.value[s]=e.value}function aw(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const s=LA(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function rw(e,t,s,a,r,c){const d=[],f=r.keySet,p=r.catchall._zod,m=p.def.type,v=p.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){d.push(y);continue}const x=p.run({value:t[y],issues:[]},a);x instanceof Promise?e.push(x.then(b=>Nu(b,s,y,t,v))):Nu(x,s,y,t,v)}return d.length&&s.issues.push({code:"unrecognized_keys",keys:d,input:t,inst:c}),e.length?Promise.all(e).then(()=>s):s}const yO=te("$ZodObject",(e,t)=>{if(bt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const p={...f};return Object.defineProperty(t,"shape",{value:p}),p}})}const a=vp(()=>aw(t));st(e._zod,"propValues",()=>{const f=t.shape,p={};for(const m in f){const v=f[m]._zod;if(v.values){p[m]??(p[m]=new Set);for(const y of v.values)p[m].add(y)}}return p});const r=wu,c=t.catchall;let d;e._zod.parse=(f,p)=>{d??(d=a.value);const m=f.value;if(!r(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const v=[],y=d.shape;for(const x of d.keys){const b=y[x],w=b._zod.optout==="optional",S=b._zod.run({value:m[x],issues:[]},p);S instanceof Promise?v.push(S.then(C=>Nu(C,f,x,m,w))):Nu(S,f,x,m,w)}return c?rw(v,m,f,p,a.value,e):v.length?Promise.all(v).then(()=>f):f}}),vO=te("$ZodObjectJIT",(e,t)=>{yO.init(e,t);const s=e._zod.parse,a=vp(()=>aw(t)),r=x=>{const b=new PT(["shape","payload","ctx"]),w=a.value,S=R=>{const z=lb(R);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};b.write("const input = payload.value;");const C=Object.create(null);let k=0;for(const R of w.keys)C[R]=`key_${k++}`;b.write("const newResult = {};");for(const R of w.keys){const z=C[R],L=lb(R),A=x[R]?._zod?.optout==="optional";b.write(`const ${z} = ${S(R)};`),A?b.write(`
59
59
  if (${z}.issues.length) {
60
60
  if (${L} in input) {
61
61
  payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
@@ -89,80 +89,80 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
89
89
  newResult[${L}] = ${z}.value;
90
90
  }
91
91
 
92
- `)}b.write("payload.value = newResult;"),b.write("return payload;");const E=b.compile();return(A,z)=>E(x,A,z)};let c;const d=Nu,f=!Hj.jitless,m=f&&TR.value,v=t.catchall;let y;e._zod.parse=(x,b)=>{y??(y=a.value);const w=x.value;return d(w)?f&&m&&b?.async===!1&&b.jitless!==!0?(c||(c=r(t.shape)),x=c(x,b),v?rw([],w,x,b,y,e):x):s(x,b):(x.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),x)}});function db(e,t,s,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const r=e.filter(c=>!wr(c));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:s,errors:e.map(c=>c.issues.map(d=>Pi(d,a,$i())))}),t)}const vO=te("$ZodUnion",(e,t)=>{St.init(e,t),st(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),st(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),st(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),st(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${r.map(c=>bp(c.source)).join("|")})$`)}});const s=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,c)=>{if(s)return a(r,c);let d=!1;const f=[];for(const p of t.options){const m=p._zod.run({value:r.value,issues:[]},c);if(m instanceof Promise)f.push(m),d=!0;else{if(m.issues.length===0)return m;f.push(m)}}return d?Promise.all(f).then(p=>db(p,r,e,c)):db(f,r,e,c)}}),xO=te("$ZodIntersection",(e,t)=>{St.init(e,t),e._zod.parse=(s,a)=>{const r=s.value,c=t.left._zod.run({value:r,issues:[]},a),d=t.right._zod.run({value:r,issues:[]},a);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([p,m])=>fb(s,p,m)):fb(s,c,d)}});function Sm(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(Or(e)&&Or(t)){const s=Object.keys(t),a=Object.keys(e).filter(c=>s.indexOf(c)!==-1),r={...e,...t};for(const c of a){const d=Sm(e[c],t[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};r[c]=d.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let a=0;a<e.length;a++){const r=e[a],c=t[a],d=Sm(r,c);if(!d.valid)return{valid:!1,mergeErrorPath:[a,...d.mergeErrorPath]};s.push(d.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}function fb(e,t,s){const a=new Map;let r;for(const f of t.issues)if(f.code==="unrecognized_keys"){r??(r=f);for(const p of f.keys)a.has(p)||a.set(p,{}),a.get(p).l=!0}else e.issues.push(f);for(const f of s.issues)if(f.code==="unrecognized_keys")for(const p of f.keys)a.has(p)||a.set(p,{}),a.get(p).r=!0;else e.issues.push(f);const c=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&r&&e.issues.push({...r,keys:c}),wr(e))return e;const d=Sm(t.value,s.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const bO=te("$ZodRecord",(e,t)=>{St.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Or(r))return s.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),s;const c=[],d=t.keyType._zod.values;if(d){s.value={};const f=new Set;for(const m of d)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){f.add(typeof m=="number"?m.toString():m);const v=t.valueType._zod.run({value:r[m],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...Nr(m,y.issues)),s.value[m]=y.value})):(v.issues.length&&s.issues.push(...Nr(m,v.issues)),s.value[m]=v.value)}let p;for(const m in r)f.has(m)||(p=p??[],p.push(m));p&&p.length>0&&s.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:p})}else{s.value={};for(const f of Reflect.ownKeys(r)){if(f==="__proto__")continue;let p=t.keyType._zod.run({value:f,issues:[]},a);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Wj.test(f)&&p.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(p=y)}if(p.issues.length){t.mode==="loose"?s.value[f]=r[f]:s.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(y=>Pi(y,a,$i())),input:f,path:[f],inst:e});continue}const v=t.valueType._zod.run({value:r[f],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...Nr(f,y.issues)),s.value[p.value]=y.value})):(v.issues.length&&s.issues.push(...Nr(f,v.issues)),s.value[p.value]=v.value)}}return c.length?Promise.all(c).then(()=>s):s}}),SO=te("$ZodEnum",(e,t)=>{St.init(e,t);const s=Gj(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>OR.has(typeof r)).map(r=>typeof r=="string"?Dr(r):r.toString()).join("|")})$`),e._zod.parse=(r,c)=>{const d=r.value;return a.has(d)||r.issues.push({code:"invalid_value",values:s,input:d,inst:e}),r}}),jO=te("$ZodLiteral",(e,t)=>{if(St.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const s=new Set(t.values);e._zod.values=s,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Dr(a):a?Dr(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,r)=>{const c=a.value;return s.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),wO=te("$ZodTransform",(e,t)=>{St.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new qj(e.constructor.name);const r=t.transform(s.value,s);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(d=>(s.value=d,s));if(r instanceof Promise)throw new Er;return s.value=r,s}});function hb(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ow=te("$ZodOptional",(e,t)=>{St.init(e,t),e._zod.optin="optional",e._zod.optout="optional",st(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),st(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${bp(s.source)})?$`):void 0}),e._zod.parse=(s,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>hb(c,s.value)):hb(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),NO=te("$ZodExactOptional",(e,t)=>{ow.init(e,t),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(s,a)=>t.innerType._zod.run(s,a)}),CO=te("$ZodNullable",(e,t)=>{St.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${bp(s.source)}|null)$`):void 0}),st(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(s,a)=>s.value===null?s:t.innerType._zod.run(s,a)}),kO=te("$ZodDefault",(e,t)=>{St.init(e,t),e._zod.optin="optional",st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);if(s.value===void 0)return s.value=t.defaultValue,s;const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>mb(c,t)):mb(r,t)}});function mb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const _O=te("$ZodPrefault",(e,t)=>{St.init(e,t),e._zod.optin="optional",st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>(a.direction==="backward"||s.value===void 0&&(s.value=t.defaultValue),t.innerType._zod.run(s,a))}),zO=te("$ZodNonOptional",(e,t)=>{St.init(e,t),st(e._zod,"values",()=>{const s=t.innerType._zod.values;return s?new Set([...s].filter(a=>a!==void 0)):void 0}),e._zod.parse=(s,a)=>{const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>pb(c,e)):pb(r,e)}});function pb(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 EO=te("$ZodCatch",(e,t)=>{St.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>(s.value=c.value,c.issues.length&&(s.value=t.catchValue({...s,error:{issues:c.issues.map(d=>Pi(d,a,$i()))},input:s.value}),s.issues=[]),s)):(s.value=r.value,r.issues.length&&(s.value=t.catchValue({...s,error:{issues:r.issues.map(c=>Pi(c,a,$i()))},input:s.value}),s.issues=[]),s)}}),AO=te("$ZodPipe",(e,t)=>{St.init(e,t),st(e._zod,"values",()=>t.in._zod.values),st(e._zod,"optin",()=>t.in._zod.optin),st(e._zod,"optout",()=>t.out._zod.optout),st(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(s,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(s,a);return c instanceof Promise?c.then(d=>Zc(d,t.in,a)):Zc(c,t.in,a)}const r=t.in._zod.run(s,a);return r instanceof Promise?r.then(c=>Zc(c,t.out,a)):Zc(r,t.out,a)}});function Zc(e,t,s){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},s)}const RO=te("$ZodReadonly",(e,t)=>{St.init(e,t),st(e._zod,"propValues",()=>t.innerType._zod.propValues),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"optin",()=>t.innerType?._zod?.optin),st(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(gb):gb(r)}});function gb(e){return e.value=Object.freeze(e.value),e}const TO=te("$ZodCustom",(e,t)=>{Nn.init(e,t),St.init(e,t),e._zod.parse=(s,a)=>s,e._zod.check=s=>{const a=s.value,r=t.fn(a);if(r instanceof Promise)return r.then(c=>yb(c,s,a,e));yb(r,s,a,e)}});function yb(e,t,s,a){if(!e){const r={code:"custom",input:s,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(al(r))}}var vb;class OO{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...s){const a=s[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const s=this._map.get(t);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(t),this}get(t){const s=t._zod.parent;if(s){const a={...this.get(s)??{}};delete a.id;const r={...a,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function DO(){return new OO}(vb=globalThis).__zod_globalRegistry??(vb.__zod_globalRegistry=DO());const Go=globalThis.__zod_globalRegistry;function LO(e,t){return new e({type:"string",...we(t)})}function MO(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...we(t)})}function xb(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...we(t)})}function UO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...we(t)})}function $O(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...we(t)})}function PO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...we(t)})}function IO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...we(t)})}function BO(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...we(t)})}function qO(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...we(t)})}function HO(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...we(t)})}function GO(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...we(t)})}function FO(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...we(t)})}function ZO(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...we(t)})}function KO(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...we(t)})}function VO(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...we(t)})}function QO(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...we(t)})}function YO(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...we(t)})}function JO(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...we(t)})}function XO(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...we(t)})}function WO(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...we(t)})}function eD(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...we(t)})}function tD(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...we(t)})}function nD(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...we(t)})}function sD(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...we(t)})}function iD(e,t){return new e({type:"string",format:"date",check:"string_format",...we(t)})}function aD(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...we(t)})}function rD(e,t){return new e({type:"string",format:"duration",check:"string_format",...we(t)})}function oD(e,t){return new e({type:"number",checks:[],...we(t)})}function lD(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...we(t)})}function cD(e,t){return new e({type:"boolean",...we(t)})}function uD(e){return new e({type:"unknown"})}function dD(e,t){return new e({type:"never",...we(t)})}function bb(e,t){return new tw({check:"less_than",...we(t),value:e,inclusive:!1})}function Gh(e,t){return new tw({check:"less_than",...we(t),value:e,inclusive:!0})}function Sb(e,t){return new nw({check:"greater_than",...we(t),value:e,inclusive:!1})}function Fh(e,t){return new nw({check:"greater_than",...we(t),value:e,inclusive:!0})}function jb(e,t){return new kT({check:"multiple_of",...we(t),value:e})}function lw(e,t){return new zT({check:"max_length",...we(t),maximum:e})}function ku(e,t){return new ET({check:"min_length",...we(t),minimum:e})}function cw(e,t){return new AT({check:"length_equals",...we(t),length:e})}function fD(e,t){return new RT({check:"string_format",format:"regex",...we(t),pattern:e})}function hD(e){return new TT({check:"string_format",format:"lowercase",...we(e)})}function mD(e){return new OT({check:"string_format",format:"uppercase",...we(e)})}function pD(e,t){return new DT({check:"string_format",format:"includes",...we(t),includes:e})}function gD(e,t){return new LT({check:"string_format",format:"starts_with",...we(t),prefix:e})}function yD(e,t){return new MT({check:"string_format",format:"ends_with",...we(t),suffix:e})}function Pr(e){return new UT({check:"overwrite",tx:e})}function vD(e){return Pr(t=>t.normalize(e))}function xD(){return Pr(e=>e.trim())}function bD(){return Pr(e=>e.toLowerCase())}function SD(){return Pr(e=>e.toUpperCase())}function jD(){return Pr(e=>RR(e))}function wD(e,t,s){return new e({type:"array",element:t,...we(s)})}function ND(e,t,s){return new e({type:"custom",check:"custom",fn:t,...we(s)})}function CD(e){const t=kD(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(al(a,s.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=s.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),s.issues.push(al(r))}},e(s.value,s)));return t}function kD(e,t){const s=new Nn({check:"custom",...we(t)});return s._zod.check=e,s}function uw(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??Go,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 qt(e,t,s={path:[],schemaPath:[]}){var a;const r=e._zod.def,c=t.seen.get(e);if(c)return c.count++,s.schemaPath.includes(e)&&(c.cycle=s.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:s.path};t.seen.set(e,d);const f=e._zod.toJSONSchema?.();if(f)d.schema=f;else{const v={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,d.schema,v);else{const x=d.schema,b=t.processors[r.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);b(e,t,x,v)}const y=e._zod.parent;y&&(d.ref||(d.ref=y),qt(y,t,v),t.seen.get(y).isParent=!0)}const p=t.metadataRegistry.get(e);return p&&Object.assign(d.schema,p),t.io==="input"&&cn(e)&&(delete d.schema.examples,delete d.schema.default),t.io==="input"&&d.schema._prefault&&((a=d.schema).default??(a.default=d.schema._prefault)),delete d.schema._prefault,t.seen.get(e).schema}function dw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const d of e.seen.entries()){const f=e.metadataRegistry.get(d[0])?.id;if(f){const p=a.get(f);if(p&&p!==d[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,d[0])}}const r=d=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(d[0])?.id,x=e.external.uri??(w=>w);if(y)return{ref:x(y)};const b=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=b,{defId:b,ref:`${x("__shared")}#/${f}/${b}`}}if(d[1]===s)return{ref:"#"};const m=`#/${f}/`,v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:m+v}},c=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:p,defId:m}=r(d);f.def={...f.schema},m&&(f.defId=m);const v=f.schema;for(const y in v)delete v[y];v.$ref=p};if(e.cycles==="throw")for(const d of e.seen.entries()){const f=d[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
92
+ `)}b.write("payload.value = newResult;"),b.write("return payload;");const E=b.compile();return(R,z)=>E(x,R,z)};let c;const d=wu,f=!Hj.jitless,m=f&&OA.value,v=t.catchall;let y;e._zod.parse=(x,b)=>{y??(y=a.value);const w=x.value;return d(w)?f&&m&&b?.async===!1&&b.jitless!==!0?(c||(c=r(t.shape)),x=c(x,b),v?rw([],w,x,b,y,e):x):s(x,b):(x.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),x)}});function db(e,t,s,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const r=e.filter(c=>!jr(c));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:s,errors:e.map(c=>c.issues.map(d=>Ii(d,a,Pi())))}),t)}const xO=te("$ZodUnion",(e,t)=>{bt.init(e,t),st(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),st(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),st(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),st(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${r.map(c=>bp(c.source)).join("|")})$`)}});const s=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,c)=>{if(s)return a(r,c);let d=!1;const f=[];for(const p of t.options){const m=p._zod.run({value:r.value,issues:[]},c);if(m instanceof Promise)f.push(m),d=!0;else{if(m.issues.length===0)return m;f.push(m)}}return d?Promise.all(f).then(p=>db(p,r,e,c)):db(f,r,e,c)}}),bO=te("$ZodIntersection",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value,c=t.left._zod.run({value:r,issues:[]},a),d=t.right._zod.run({value:r,issues:[]},a);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([p,m])=>fb(s,p,m)):fb(s,c,d)}});function Sm(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(Tr(e)&&Tr(t)){const s=Object.keys(t),a=Object.keys(e).filter(c=>s.indexOf(c)!==-1),r={...e,...t};for(const c of a){const d=Sm(e[c],t[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};r[c]=d.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let a=0;a<e.length;a++){const r=e[a],c=t[a],d=Sm(r,c);if(!d.valid)return{valid:!1,mergeErrorPath:[a,...d.mergeErrorPath]};s.push(d.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}function fb(e,t,s){const a=new Map;let r;for(const f of t.issues)if(f.code==="unrecognized_keys"){r??(r=f);for(const p of f.keys)a.has(p)||a.set(p,{}),a.get(p).l=!0}else e.issues.push(f);for(const f of s.issues)if(f.code==="unrecognized_keys")for(const p of f.keys)a.has(p)||a.set(p,{}),a.get(p).r=!0;else e.issues.push(f);const c=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&r&&e.issues.push({...r,keys:c}),jr(e))return e;const d=Sm(t.value,s.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const SO=te("$ZodRecord",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Tr(r))return s.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),s;const c=[],d=t.keyType._zod.values;if(d){s.value={};const f=new Set;for(const m of d)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){f.add(typeof m=="number"?m.toString():m);const v=t.valueType._zod.run({value:r[m],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...wr(m,y.issues)),s.value[m]=y.value})):(v.issues.length&&s.issues.push(...wr(m,v.issues)),s.value[m]=v.value)}let p;for(const m in r)f.has(m)||(p=p??[],p.push(m));p&&p.length>0&&s.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:p})}else{s.value={};for(const f of Reflect.ownKeys(r)){if(f==="__proto__")continue;let p=t.keyType._zod.run({value:f,issues:[]},a);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Wj.test(f)&&p.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(p=y)}if(p.issues.length){t.mode==="loose"?s.value[f]=r[f]:s.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(y=>Ii(y,a,Pi())),input:f,path:[f],inst:e});continue}const v=t.valueType._zod.run({value:r[f],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...wr(f,y.issues)),s.value[p.value]=y.value})):(v.issues.length&&s.issues.push(...wr(f,v.issues)),s.value[p.value]=v.value)}}return c.length?Promise.all(c).then(()=>s):s}}),jO=te("$ZodEnum",(e,t)=>{bt.init(e,t);const s=Gj(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>DA.has(typeof r)).map(r=>typeof r=="string"?Or(r):r.toString()).join("|")})$`),e._zod.parse=(r,c)=>{const d=r.value;return a.has(d)||r.issues.push({code:"invalid_value",values:s,input:d,inst:e}),r}}),wO=te("$ZodLiteral",(e,t)=>{if(bt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const s=new Set(t.values);e._zod.values=s,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Or(a):a?Or(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,r)=>{const c=a.value;return s.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),NO=te("$ZodTransform",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new qj(e.constructor.name);const r=t.transform(s.value,s);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(d=>(s.value=d,s));if(r instanceof Promise)throw new zr;return s.value=r,s}});function hb(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ow=te("$ZodOptional",(e,t)=>{bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",st(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),st(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${bp(s.source)})?$`):void 0}),e._zod.parse=(s,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>hb(c,s.value)):hb(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),CO=te("$ZodExactOptional",(e,t)=>{ow.init(e,t),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(s,a)=>t.innerType._zod.run(s,a)}),kO=te("$ZodNullable",(e,t)=>{bt.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${bp(s.source)}|null)$`):void 0}),st(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(s,a)=>s.value===null?s:t.innerType._zod.run(s,a)}),_O=te("$ZodDefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);if(s.value===void 0)return s.value=t.defaultValue,s;const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>mb(c,t)):mb(r,t)}});function mb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zO=te("$ZodPrefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>(a.direction==="backward"||s.value===void 0&&(s.value=t.defaultValue),t.innerType._zod.run(s,a))}),EO=te("$ZodNonOptional",(e,t)=>{bt.init(e,t),st(e._zod,"values",()=>{const s=t.innerType._zod.values;return s?new Set([...s].filter(a=>a!==void 0)):void 0}),e._zod.parse=(s,a)=>{const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>pb(c,e)):pb(r,e)}});function pb(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 RO=te("$ZodCatch",(e,t)=>{bt.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>(s.value=c.value,c.issues.length&&(s.value=t.catchValue({...s,error:{issues:c.issues.map(d=>Ii(d,a,Pi()))},input:s.value}),s.issues=[]),s)):(s.value=r.value,r.issues.length&&(s.value=t.catchValue({...s,error:{issues:r.issues.map(c=>Ii(c,a,Pi()))},input:s.value}),s.issues=[]),s)}}),AO=te("$ZodPipe",(e,t)=>{bt.init(e,t),st(e._zod,"values",()=>t.in._zod.values),st(e._zod,"optin",()=>t.in._zod.optin),st(e._zod,"optout",()=>t.out._zod.optout),st(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(s,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(s,a);return c instanceof Promise?c.then(d=>Fc(d,t.in,a)):Fc(c,t.in,a)}const r=t.in._zod.run(s,a);return r instanceof Promise?r.then(c=>Fc(c,t.out,a)):Fc(r,t.out,a)}});function Fc(e,t,s){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},s)}const TO=te("$ZodReadonly",(e,t)=>{bt.init(e,t),st(e._zod,"propValues",()=>t.innerType._zod.propValues),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"optin",()=>t.innerType?._zod?.optin),st(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(gb):gb(r)}});function gb(e){return e.value=Object.freeze(e.value),e}const OO=te("$ZodCustom",(e,t)=>{Nn.init(e,t),bt.init(e,t),e._zod.parse=(s,a)=>s,e._zod.check=s=>{const a=s.value,r=t.fn(a);if(r instanceof Promise)return r.then(c=>yb(c,s,a,e));yb(r,s,a,e)}});function yb(e,t,s,a){if(!e){const r={code:"custom",input:s,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(il(r))}}var vb;class DO{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...s){const a=s[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const s=this._map.get(t);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(t),this}get(t){const s=t._zod.parent;if(s){const a={...this.get(s)??{}};delete a.id;const r={...a,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function LO(){return new DO}(vb=globalThis).__zod_globalRegistry??(vb.__zod_globalRegistry=LO());const Ho=globalThis.__zod_globalRegistry;function MO(e,t){return new e({type:"string",...we(t)})}function UO(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...we(t)})}function xb(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...we(t)})}function $O(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...we(t)})}function PO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...we(t)})}function IO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...we(t)})}function BO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...we(t)})}function qO(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...we(t)})}function HO(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...we(t)})}function GO(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...we(t)})}function FO(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...we(t)})}function ZO(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...we(t)})}function KO(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...we(t)})}function VO(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...we(t)})}function QO(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...we(t)})}function YO(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...we(t)})}function JO(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...we(t)})}function XO(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...we(t)})}function WO(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...we(t)})}function e5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...we(t)})}function t5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...we(t)})}function n5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...we(t)})}function s5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...we(t)})}function i5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...we(t)})}function a5(e,t){return new e({type:"string",format:"date",check:"string_format",...we(t)})}function r5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...we(t)})}function o5(e,t){return new e({type:"string",format:"duration",check:"string_format",...we(t)})}function l5(e,t){return new e({type:"number",checks:[],...we(t)})}function c5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...we(t)})}function u5(e,t){return new e({type:"boolean",...we(t)})}function d5(e){return new e({type:"unknown"})}function f5(e,t){return new e({type:"never",...we(t)})}function bb(e,t){return new tw({check:"less_than",...we(t),value:e,inclusive:!1})}function Hh(e,t){return new tw({check:"less_than",...we(t),value:e,inclusive:!0})}function Sb(e,t){return new nw({check:"greater_than",...we(t),value:e,inclusive:!1})}function Gh(e,t){return new nw({check:"greater_than",...we(t),value:e,inclusive:!0})}function jb(e,t){return new _T({check:"multiple_of",...we(t),value:e})}function lw(e,t){return new ET({check:"max_length",...we(t),maximum:e})}function Cu(e,t){return new RT({check:"min_length",...we(t),minimum:e})}function cw(e,t){return new AT({check:"length_equals",...we(t),length:e})}function h5(e,t){return new TT({check:"string_format",format:"regex",...we(t),pattern:e})}function m5(e){return new OT({check:"string_format",format:"lowercase",...we(e)})}function p5(e){return new DT({check:"string_format",format:"uppercase",...we(e)})}function g5(e,t){return new LT({check:"string_format",format:"includes",...we(t),includes:e})}function y5(e,t){return new MT({check:"string_format",format:"starts_with",...we(t),prefix:e})}function v5(e,t){return new UT({check:"string_format",format:"ends_with",...we(t),suffix:e})}function $r(e){return new $T({check:"overwrite",tx:e})}function x5(e){return $r(t=>t.normalize(e))}function b5(){return $r(e=>e.trim())}function S5(){return $r(e=>e.toLowerCase())}function j5(){return $r(e=>e.toUpperCase())}function w5(){return $r(e=>TA(e))}function N5(e,t,s){return new e({type:"array",element:t,...we(s)})}function C5(e,t,s){return new e({type:"custom",check:"custom",fn:t,...we(s)})}function k5(e){const t=_5(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(il(a,s.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=s.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),s.issues.push(il(r))}},e(s.value,s)));return t}function _5(e,t){const s=new Nn({check:"custom",...we(t)});return s._zod.check=e,s}function uw(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??Ho,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 qt(e,t,s={path:[],schemaPath:[]}){var a;const r=e._zod.def,c=t.seen.get(e);if(c)return c.count++,s.schemaPath.includes(e)&&(c.cycle=s.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:s.path};t.seen.set(e,d);const f=e._zod.toJSONSchema?.();if(f)d.schema=f;else{const v={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,d.schema,v);else{const x=d.schema,b=t.processors[r.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);b(e,t,x,v)}const y=e._zod.parent;y&&(d.ref||(d.ref=y),qt(y,t,v),t.seen.get(y).isParent=!0)}const p=t.metadataRegistry.get(e);return p&&Object.assign(d.schema,p),t.io==="input"&&cn(e)&&(delete d.schema.examples,delete d.schema.default),t.io==="input"&&d.schema._prefault&&((a=d.schema).default??(a.default=d.schema._prefault)),delete d.schema._prefault,t.seen.get(e).schema}function dw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const d of e.seen.entries()){const f=e.metadataRegistry.get(d[0])?.id;if(f){const p=a.get(f);if(p&&p!==d[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,d[0])}}const r=d=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(d[0])?.id,x=e.external.uri??(w=>w);if(y)return{ref:x(y)};const b=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=b,{defId:b,ref:`${x("__shared")}#/${f}/${b}`}}if(d[1]===s)return{ref:"#"};const m=`#/${f}/`,v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:m+v}},c=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:p,defId:m}=r(d);f.def={...f.schema},m&&(f.defId=m);const v=f.schema;for(const y in v)delete v[y];v.$ref=p};if(e.cycles==="throw")for(const d of e.seen.entries()){const f=d[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
93
93
 
94
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const f=d[1];if(t===d[0]){c(d);continue}if(e.external){const m=e.external.registry.get(d[0])?.id;if(t!==d[0]&&m){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(f.cycle){c(d);continue}if(f.count>1&&e.reused==="ref"){c(d);continue}}}function fw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=d=>{const f=e.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,m={...p},v=f.ref;if(f.ref=null,v){a(v);const x=e.seen.get(v),b=x.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(b)):Object.assign(p,b),Object.assign(p,m),d._zod.parent===v)for(const S in p)S==="$ref"||S==="allOf"||S in m||delete p[S];if(b.$ref&&x.def)for(const S in p)S==="$ref"||S==="allOf"||S in x.def&&JSON.stringify(p[S])===JSON.stringify(x.def[S])&&delete p[S]}const y=d._zod.parent;if(y&&y!==v){a(y);const x=e.seen.get(y);if(x?.schema.$ref&&(p.$ref=x.schema.$ref,x.def))for(const b in p)b==="$ref"||b==="allOf"||b in x.def&&JSON.stringify(p[b])===JSON.stringify(x.def[b])&&delete p[b]}e.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...e.seen.entries()].reverse())a(d[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(d)}Object.assign(r,s.def??s.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const f=d[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?r.$defs=c:r.definitions=c);try{const d=JSON.parse(JSON.stringify(r));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input:_u(t,"input",e.processors),output:_u(t,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function cn(e,t){const s=t??{seen:new Set};if(s.seen.has(e))return!1;s.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return cn(a.element,s);if(a.type==="set")return cn(a.valueType,s);if(a.type==="lazy")return cn(a.getter(),s);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return cn(a.innerType,s);if(a.type==="intersection")return cn(a.left,s)||cn(a.right,s);if(a.type==="record"||a.type==="map")return cn(a.keyType,s)||cn(a.valueType,s);if(a.type==="pipe")return cn(a.in,s)||cn(a.out,s);if(a.type==="object"){for(const r in a.shape)if(cn(a.shape[r],s))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(cn(r,s))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(cn(r,s))return!0;return!!(a.rest&&cn(a.rest,s))}return!1}const _D=(e,t={})=>s=>{const a=uw({...s,processors:t});return qt(e,a),dw(a,e),fw(a,e)},_u=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},d=uw({...r??{},target:c,io:t,processors:s});return qt(e,d),dw(d,e),fw(d,e)},zD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ED=(e,t,s,a)=>{const r=s;r.type="string";const{minimum:c,maximum:d,format:f,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof c=="number"&&(r.minLength=c),typeof d=="number"&&(r.maxLength=d),f&&(r.format=zD[f]??f,r.format===""&&delete r.format,f==="time"&&delete r.format),m&&(r.contentEncoding=m),p&&p.size>0){const v=[...p];v.length===1?r.pattern=v[0].source:v.length>1&&(r.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},AD=(e,t,s,a)=>{const r=s,{minimum:c,maximum:d,format:f,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?r.type="integer":r.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=v,r.exclusiveMinimum=!0):r.exclusiveMinimum=v),typeof c=="number"&&(r.minimum=c,typeof v=="number"&&t.target!=="draft-04"&&(v>=c?delete r.minimum:delete r.exclusiveMinimum)),typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=m,r.exclusiveMaximum=!0):r.exclusiveMaximum=m),typeof d=="number"&&(r.maximum=d,typeof m=="number"&&t.target!=="draft-04"&&(m<=d?delete r.maximum:delete r.exclusiveMaximum)),typeof p=="number"&&(r.multipleOf=p)},RD=(e,t,s,a)=>{s.type="boolean"},TD=(e,t,s,a)=>{s.not={}},OD=(e,t,s,a)=>{},DD=(e,t,s,a)=>{const r=e._zod.def,c=Gj(r.entries);c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),s.enum=c},LD=(e,t,s,a)=>{const r=e._zod.def,c=[];for(const d of r.values)if(d===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(d))}else c.push(d);if(c.length!==0)if(c.length===1){const d=c[0];s.type=d===null?"null":typeof d,t.target==="draft-04"||t.target==="openapi-3.0"?s.enum=[d]:s.const=d}else c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),c.every(d=>typeof d=="boolean")&&(s.type="boolean"),c.every(d=>d===null)&&(s.type="null"),s.enum=c},MD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},UD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},$D=(e,t,s,a)=>{const r=s,c=e._zod.def,{minimum:d,maximum:f}=e._zod.bag;typeof d=="number"&&(r.minItems=d),typeof f=="number"&&(r.maxItems=f),r.type="array",r.items=qt(c.element,t,{...a,path:[...a.path,"items"]})},PD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object",r.properties={};const d=c.shape;for(const m in d)r.properties[m]=qt(d[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(d)),p=new Set([...f].filter(m=>{const v=c.shape[m]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));p.size>0&&(r.required=Array.from(p)),c.catchall?._zod.def.type==="never"?r.additionalProperties=!1:c.catchall?c.catchall&&(r.additionalProperties=qt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},ID=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,d=r.options.map((f,p)=>qt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",p]}));c?s.oneOf=d:s.anyOf=d},BD=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.left,t,{...a,path:[...a.path,"allOf",0]}),d=qt(r.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,p=[...f(c)?c.allOf:[c],...f(d)?d.allOf:[d]];s.allOf=p},qD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const d=c.keyType,p=d._zod.bag?.patterns;if(c.mode==="loose"&&p&&p.size>0){const v=qt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const y of p)r.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=qt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=qt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=d._zod.values;if(m){const v=[...m].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(r.required=v)}},HD=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.innerType,t,a),d=t.seen.get(e);t.target==="openapi-3.0"?(d.ref=r.innerType,s.nullable=!0):s.anyOf=[c,{type:"null"}]},GD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},FD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.default=JSON.parse(JSON.stringify(r.defaultValue))},ZD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,t.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},KD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType;let d;try{d=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=d},VD=(e,t,s,a)=>{const r=e._zod.def,c=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;qt(c,t,a);const d=t.seen.get(e);d.ref=c},QD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.readOnly=!0},hw=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},YD=te("ZodISODateTime",(e,t)=>{JT.init(e,t),wt.init(e,t)});function JD(e){return sD(YD,e)}const XD=te("ZodISODate",(e,t)=>{XT.init(e,t),wt.init(e,t)});function WD(e){return iD(XD,e)}const e5=te("ZodISOTime",(e,t)=>{WT.init(e,t),wt.init(e,t)});function t5(e){return aD(e5,e)}const n5=te("ZodISODuration",(e,t)=>{eO.init(e,t),wt.init(e,t)});function s5(e){return rD(n5,e)}const i5=(e,t)=>{Vj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>GR(e,s)},flatten:{value:s=>HR(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,bm,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,bm,2)}},isEmpty:{get(){return e.issues.length===0}}})},Yn=te("ZodError",i5,{Parent:Error}),a5=jp(Yn),r5=wp(Yn),o5=Gu(Yn),l5=Fu(Yn),c5=KR(Yn),u5=VR(Yn),d5=QR(Yn),f5=YR(Yn),h5=JR(Yn),m5=XR(Yn),p5=WR(Yn),g5=eT(Yn),jt=te("ZodType",(e,t)=>(St.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:_u(e,"input"),output:_u(e,"output")}}),e.toJSONSchema=_D(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...s)=>e.clone(qi(t,{checks:[...t.checks??[],...s.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(s,a)=>Hi(e,s,a),e.brand=()=>e,e.register=((s,a)=>(s.add(e,a),e)),e.parse=(s,a)=>a5(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>o5(e,s,a),e.parseAsync=async(s,a)=>r5(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>l5(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>c5(e,s,a),e.decode=(s,a)=>u5(e,s,a),e.encodeAsync=async(s,a)=>d5(e,s,a),e.decodeAsync=async(s,a)=>f5(e,s,a),e.safeEncode=(s,a)=>h5(e,s,a),e.safeDecode=(s,a)=>m5(e,s,a),e.safeEncodeAsync=async(s,a)=>p5(e,s,a),e.safeDecodeAsync=async(s,a)=>g5(e,s,a),e.refine=(s,a)=>e.check(uL(s,a)),e.superRefine=s=>e.check(dL(s)),e.overwrite=s=>e.check(Pr(s)),e.optional=()=>Cb(e),e.exactOptional=()=>J5(e),e.nullable=()=>kb(e),e.nullish=()=>Cb(kb(e)),e.nonoptional=s=>sL(e,s),e.array=()=>Qe(e),e.or=s=>H5([e,s]),e.and=s=>F5(e,s),e.transform=s=>_b(e,Q5(s)),e.default=s=>eL(e,s),e.prefault=s=>nL(e,s),e.catch=s=>aL(e,s),e.pipe=s=>_b(e,s),e.readonly=()=>lL(e),e.describe=s=>{const a=e.clone();return Go.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return Go.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Go.get(e);const a=e.clone();return Go.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),mw=te("_ZodString",(e,t)=>{Np.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>ED(e,a,r);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...a)=>e.check(fD(...a)),e.includes=(...a)=>e.check(pD(...a)),e.startsWith=(...a)=>e.check(gD(...a)),e.endsWith=(...a)=>e.check(yD(...a)),e.min=(...a)=>e.check(ku(...a)),e.max=(...a)=>e.check(lw(...a)),e.length=(...a)=>e.check(cw(...a)),e.nonempty=(...a)=>e.check(ku(1,...a)),e.lowercase=a=>e.check(hD(a)),e.uppercase=a=>e.check(mD(a)),e.trim=()=>e.check(xD()),e.normalize=(...a)=>e.check(vD(...a)),e.toLowerCase=()=>e.check(bD()),e.toUpperCase=()=>e.check(SD()),e.slugify=()=>e.check(jD())}),y5=te("ZodString",(e,t)=>{Np.init(e,t),mw.init(e,t),e.email=s=>e.check(MO(v5,s)),e.url=s=>e.check(BO(x5,s)),e.jwt=s=>e.check(nD(D5,s)),e.emoji=s=>e.check(qO(b5,s)),e.guid=s=>e.check(xb(wb,s)),e.uuid=s=>e.check(UO(Kc,s)),e.uuidv4=s=>e.check($O(Kc,s)),e.uuidv6=s=>e.check(PO(Kc,s)),e.uuidv7=s=>e.check(IO(Kc,s)),e.nanoid=s=>e.check(HO(S5,s)),e.guid=s=>e.check(xb(wb,s)),e.cuid=s=>e.check(GO(j5,s)),e.cuid2=s=>e.check(FO(w5,s)),e.ulid=s=>e.check(ZO(N5,s)),e.base64=s=>e.check(WO(R5,s)),e.base64url=s=>e.check(eD(T5,s)),e.xid=s=>e.check(KO(C5,s)),e.ksuid=s=>e.check(VO(k5,s)),e.ipv4=s=>e.check(QO(_5,s)),e.ipv6=s=>e.check(YO(z5,s)),e.cidrv4=s=>e.check(JO(E5,s)),e.cidrv6=s=>e.check(XO(A5,s)),e.e164=s=>e.check(tD(O5,s)),e.datetime=s=>e.check(JD(s)),e.date=s=>e.check(WD(s)),e.time=s=>e.check(t5(s)),e.duration=s=>e.check(s5(s))});function K(e){return LO(y5,e)}const wt=te("ZodStringFormat",(e,t)=>{xt.init(e,t),mw.init(e,t)}),v5=te("ZodEmail",(e,t)=>{qT.init(e,t),wt.init(e,t)}),wb=te("ZodGUID",(e,t)=>{IT.init(e,t),wt.init(e,t)}),Kc=te("ZodUUID",(e,t)=>{BT.init(e,t),wt.init(e,t)}),x5=te("ZodURL",(e,t)=>{HT.init(e,t),wt.init(e,t)}),b5=te("ZodEmoji",(e,t)=>{GT.init(e,t),wt.init(e,t)}),S5=te("ZodNanoID",(e,t)=>{FT.init(e,t),wt.init(e,t)}),j5=te("ZodCUID",(e,t)=>{ZT.init(e,t),wt.init(e,t)}),w5=te("ZodCUID2",(e,t)=>{KT.init(e,t),wt.init(e,t)}),N5=te("ZodULID",(e,t)=>{VT.init(e,t),wt.init(e,t)}),C5=te("ZodXID",(e,t)=>{QT.init(e,t),wt.init(e,t)}),k5=te("ZodKSUID",(e,t)=>{YT.init(e,t),wt.init(e,t)}),_5=te("ZodIPv4",(e,t)=>{tO.init(e,t),wt.init(e,t)}),z5=te("ZodIPv6",(e,t)=>{nO.init(e,t),wt.init(e,t)}),E5=te("ZodCIDRv4",(e,t)=>{sO.init(e,t),wt.init(e,t)}),A5=te("ZodCIDRv6",(e,t)=>{iO.init(e,t),wt.init(e,t)}),R5=te("ZodBase64",(e,t)=>{aO.init(e,t),wt.init(e,t)}),T5=te("ZodBase64URL",(e,t)=>{oO.init(e,t),wt.init(e,t)}),O5=te("ZodE164",(e,t)=>{lO.init(e,t),wt.init(e,t)}),D5=te("ZodJWT",(e,t)=>{uO.init(e,t),wt.init(e,t)}),pw=te("ZodNumber",(e,t)=>{iw.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>AD(e,a,r),e.gt=(a,r)=>e.check(Sb(a,r)),e.gte=(a,r)=>e.check(Fh(a,r)),e.min=(a,r)=>e.check(Fh(a,r)),e.lt=(a,r)=>e.check(bb(a,r)),e.lte=(a,r)=>e.check(Gh(a,r)),e.max=(a,r)=>e.check(Gh(a,r)),e.int=a=>e.check(Nb(a)),e.safe=a=>e.check(Nb(a)),e.positive=a=>e.check(Sb(0,a)),e.nonnegative=a=>e.check(Fh(0,a)),e.negative=a=>e.check(bb(0,a)),e.nonpositive=a=>e.check(Gh(0,a)),e.multipleOf=(a,r)=>e.check(jb(a,r)),e.step=(a,r)=>e.check(jb(a,r)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function Ze(e){return oD(pw,e)}const L5=te("ZodNumberFormat",(e,t)=>{dO.init(e,t),pw.init(e,t)});function Nb(e){return lD(L5,e)}const M5=te("ZodBoolean",(e,t)=>{fO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>RD(e,s,a)});function Ir(e){return cD(M5,e)}const U5=te("ZodUnknown",(e,t)=>{hO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>OD()});function jm(){return uD(U5)}const $5=te("ZodNever",(e,t)=>{mO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>TD(e,s,a)});function P5(e){return dD($5,e)}const I5=te("ZodArray",(e,t)=>{pO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>$D(e,s,a,r),e.element=t.element,e.min=(s,a)=>e.check(ku(s,a)),e.nonempty=s=>e.check(ku(1,s)),e.max=(s,a)=>e.check(lw(s,a)),e.length=(s,a)=>e.check(cw(s,a)),e.unwrap=()=>e.element});function Qe(e,t){return wD(I5,e,t)}const B5=te("ZodObject",(e,t)=>{yO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>PD(e,s,a,r),st(e,"shape",()=>t.shape),e.keyof=()=>wn(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:jm()}),e.loose=()=>e.clone({...e._zod.def,catchall:jm()}),e.strict=()=>e.clone({...e._zod.def,catchall:P5()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>$R(e,s),e.safeExtend=s=>PR(e,s),e.merge=s=>IR(e,s),e.pick=s=>MR(e,s),e.omit=s=>UR(e,s),e.partial=(...s)=>BR(gw,e,s[0]),e.required=(...s)=>qR(yw,e,s[0])});function Le(e,t){const s={type:"object",shape:e??{},...we(t)};return new B5(s)}const q5=te("ZodUnion",(e,t)=>{vO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ID(e,s,a,r),e.options=t.options});function H5(e,t){return new q5({type:"union",options:e,...we(t)})}const G5=te("ZodIntersection",(e,t)=>{xO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>BD(e,s,a,r)});function F5(e,t){return new G5({type:"intersection",left:e,right:t})}const Z5=te("ZodRecord",(e,t)=>{bO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>qD(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ku(e,t,s){return new Z5({type:"record",keyType:e,valueType:t,...we(s)})}const wm=te("ZodEnum",(e,t)=>{SO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>DD(e,a,r),e.enum=t.entries,e.options=Object.values(t.entries);const s=new Set(Object.keys(t.entries));e.extract=(a,r)=>{const c={};for(const d of a)if(s.has(d))c[d]=t.entries[d];else throw new Error(`Key ${d} not found in enum`);return new wm({...t,checks:[],...we(r),entries:c})},e.exclude=(a,r)=>{const c={...t.entries};for(const d of a)if(s.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new wm({...t,checks:[],...we(r),entries:c})}});function wn(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new wm({type:"enum",entries:s,...we(t)})}const K5=te("ZodLiteral",(e,t)=>{jO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>LD(e,s,a),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 zu(e,t){return new K5({type:"literal",values:Array.isArray(e)?e:[e],...we(t)})}const V5=te("ZodTransform",(e,t)=>{wO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>UD(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new qj(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(al(c,s.value,t));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=s.value),d.inst??(d.inst=e),s.issues.push(al(d))}};const r=t.transform(s.value,s);return r instanceof Promise?r.then(c=>(s.value=c,s)):(s.value=r,s)}});function Q5(e){return new V5({type:"transform",transform:e})}const gw=te("ZodOptional",(e,t)=>{ow.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function Cb(e){return new gw({type:"optional",innerType:e})}const Y5=te("ZodExactOptional",(e,t)=>{NO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function J5(e){return new Y5({type:"optional",innerType:e})}const X5=te("ZodNullable",(e,t)=>{CO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>HD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function kb(e){return new X5({type:"nullable",innerType:e})}const W5=te("ZodDefault",(e,t)=>{kO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>FD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eL(e,t){return new W5({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Zj(t)}})}const tL=te("ZodPrefault",(e,t)=>{_O.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ZD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function nL(e,t){return new tL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Zj(t)}})}const yw=te("ZodNonOptional",(e,t)=>{zO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>GD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function sL(e,t){return new yw({type:"nonoptional",innerType:e,...we(t)})}const iL=te("ZodCatch",(e,t)=>{EO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>KD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function aL(e,t){return new iL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const rL=te("ZodPipe",(e,t)=>{AO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>VD(e,s,a,r),e.in=t.in,e.out=t.out});function _b(e,t){return new rL({type:"pipe",in:e,out:t})}const oL=te("ZodReadonly",(e,t)=>{RO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>QD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function lL(e){return new oL({type:"readonly",innerType:e})}const cL=te("ZodCustom",(e,t)=>{TO.init(e,t),jt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>MD(e,s)});function uL(e,t={}){return ND(cL,e,t)}function dL(e){return CD(e)}Le({maxConcurrency:Ze().int().positive(),maxRequestsPerMinute:Ze().int().positive(),maxRequestsPerDay:Ze().int().positive()});const Br=K().min(1);K().min(1);const Cp=Le({label:K().min(1),city:K().min(1),region:K().min(1),country:K().length(2),timezone:K().optional()}),vw=wn(["citation.lost","citation.gained","run.completed","run.failed"]);Le({id:K(),projectId:K(),channel:zu("webhook"),url:K().url(),events:Qe(vw),enabled:Ir().default(!0),webhookSecret:K().optional(),createdAt:K(),updatedAt:K()});const xw=wn(["cli","api","config-file"]);function fL(e){const t=new Set,s=new Set;for(const a of e){if(t.has(a.label)){s.add(a.label);continue}t.add(a.label)}return[...s]}function hL(e,t){return t?e.some(s=>s.label===t):!0}Le({displayName:K().min(1),canonicalDomain:K().min(1),ownedDomains:Qe(K().min(1)).optional(),country:K().length(2),language:K().min(2),tags:Qe(K()).optional(),labels:Ku(K(),K()).optional(),providers:Qe(Br).optional(),locations:Qe(Cp).optional(),defaultLocation:K().nullable().optional(),configSource:xw.optional()});Le({id:K(),name:K(),displayName:K().optional(),canonicalDomain:K(),ownedDomains:Qe(K()).default([]),country:K().length(2),language:K().min(2),tags:Qe(K()).default([]),labels:Ku(K(),K()).default({}),locations:Qe(Cp).default([]),defaultLocation:K().nullable().optional(),configSource:xw.default("cli"),configRevision:Ze().int().positive().default(1),createdAt:K().optional(),updatedAt:K().optional()});function Nm(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function mL(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,a=[];for(const r of t){const c=r.trim();if(!c)continue;const d=Nm(c);s.has(d)||(s.add(d),a.push(c))}return a}const pL=Le({name:K().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:Ku(K(),K()).optional().default({})}),gL=Le({preset:K().optional(),cron:K().optional(),timezone:K().optional().default("UTC"),providers:Qe(Br).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),yL=Le({channel:zu("webhook"),url:K().url(),events:Qe(vw).min(1)}),vL=Le({gsc:Le({propertyUrl:K()}).optional(),syncSchedule:Le({preset:K().optional(),cron:K().optional()}).optional()}).optional(),xL=Le({displayName:K().min(1),canonicalDomain:K().min(1),ownedDomains:Qe(K().min(1)).optional().default([]),country:K().length(2),language:K().min(2),keywords:Qe(K().min(1)).optional().default([]),competitors:Qe(K().min(1)).optional().default([]),providers:Qe(Br).optional().default([]),locations:Qe(Cp).optional().default([]),defaultLocation:K().optional(),schedule:gL,notifications:Qe(yL).optional().default([]),google:vL}).superRefine((e,t)=>{const s=fL(e.locations);s.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${s.join(", ")}`,path:["locations"]}),hL(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Le({apiVersion:zu("canonry/v1"),kind:zu("Project"),metadata:pL,spec:xL});const bL=wn(["gsc","ga4"]);Le({id:K(),domain:K(),connectionType:bL,propertyId:K().nullable().optional(),sitemapUrl:K().nullable().optional(),scopes:Qe(K()).default([]),createdAt:K(),updatedAt:K()});Le({date:K(),query:K(),page:K(),country:K().nullable().optional(),device:K().nullable().optional(),clicks:Ze(),impressions:Ze(),ctr:Ze(),position:Ze()});const Cm=Le({id:K(),url:K(),indexingState:K().nullable().optional(),verdict:K().nullable().optional(),coverageState:K().nullable().optional(),pageFetchState:K().nullable().optional(),robotsTxtState:K().nullable().optional(),crawlTime:K().nullable().optional(),lastCrawlResult:K().nullable().optional(),isMobileFriendly:Ir().nullable().optional(),richResults:Qe(K()).default([]),inspectedAt:K()});wn(["stable","reindexed","deindexed","still-missing","new"]);const SL=Le({url:K(),previousState:K().nullable(),currentState:K().nullable(),transitionDate:K()}),jL=Le({reason:K(),count:Ze(),urls:Qe(Cm).default([])});Le({summary:Le({total:Ze(),indexed:Ze(),notIndexed:Ze(),deindexed:Ze(),percentage:Ze()}),lastInspectedAt:K().nullable(),indexed:Qe(Cm).default([]),notIndexed:Qe(Cm).default([]),deindexed:Qe(SL).default([]),reasonGroups:Qe(jL).default([])});Le({url:K(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:K()});Le({url:K(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:K(),status:wn(["success","error"]),error:K().optional()});Le({date:K(),indexed:Ze(),notIndexed:Ze(),reasonBreakdown:Ku(K(),Ze()).default({})});Le({id:K(),domain:K(),siteUrl:K().nullable().optional(),createdAt:K(),updatedAt:K()});const zb=Le({id:K(),url:K(),httpCode:Ze().nullable().optional(),inIndex:Ir().nullable().optional(),lastCrawledDate:K().nullable().optional(),inIndexDate:K().nullable().optional(),inspectedAt:K()});Le({summary:Le({total:Ze(),indexed:Ze(),notIndexed:Ze(),percentage:Ze()}),lastInspectedAt:K().nullable(),indexed:Qe(zb).default([]),notIndexed:Qe(zb).default([])});Le({query:K(),impressions:Ze(),clicks:Ze(),ctr:Ze(),averagePosition:Ze()});Le({url:K(),status:wn(["success","error"]),submittedAt:K(),error:K().optional()});const wL=wn(["queued","running","completed","partial","failed","cancelled"]),NL=wn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),CL=wn(["manual","scheduled","config-apply"]),kL=wn(["cited","not-cited"]),_L=wn(["new","cited","lost","emerging","not-cited"]);Le({id:K(),projectId:K(),kind:NL,status:wL,trigger:CL.default("manual"),location:K().nullable().optional(),startedAt:K().nullable().optional(),finishedAt:K().nullable().optional(),error:K().nullable().optional(),createdAt:K()});const zL=Le({uri:K(),title:K()});Le({id:K(),runId:K(),keywordId:K(),keyword:K().optional(),provider:Br,citationState:kL,transition:_L.optional(),answerText:K().nullable().optional(),citedDomains:Qe(K()).default([]),competitorOverlap:Qe(K()).default([]),groundingSources:Qe(zL).default([]),searchQueries:Qe(K()).default([]),model:K().nullable().optional(),location:K().nullable().optional(),createdAt:K()});Le({id:K(),projectId:K().nullable().optional(),actor:K(),action:K(),entityType:K(),entityId:K().nullable().optional(),diff:jm().optional(),createdAt:K()});Le({id:K(),projectId:K(),cronExpr:K(),preset:K().nullable().optional(),timezone:K().default("UTC"),enabled:Ir().default(!0),providers:Qe(Br).default([]),lastRunAt:K().nullable().optional(),nextRunAt:K().nullable().optional(),createdAt:K(),updatedAt:K()});Le({preset:K().optional(),cron:K().optional(),timezone:K().optional().default("UTC"),enabled:Ir().optional().default(!0),providers:Qe(Br).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});Le({id:K(),projectId:K(),propertyId:K(),clientEmail:K(),connected:Ir(),createdAt:K(),updatedAt:K()});Le({date:K(),landingPage:K(),sessions:Ze(),organicSessions:Ze(),users:Ze()});Le({totalSessions:Ze(),totalOrganicSessions:Ze(),totalUsers:Ze(),topPages:Qe(Le({landingPage:K(),sessions:Ze(),organicSessions:Ze(),users:Ze()})),lastSyncedAt:K().nullable()});function km({state:e}){return l.jsx(nt,{tone:HE(e),children:Pu(e)})}function Eb(e,t){const s=t.filter(d=>d.trim().length>1),a=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(d=>d.startsWith("**")&&d.endsWith("**")?{type:"bold",value:d.slice(2,-2)}:{type:"text",value:d});if(s.length===0)return a.map((d,f)=>d.type==="bold"?is.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},d.value):d.value).filter(Boolean);const r=s.map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${r.join("|")})`,"gi");return a.flatMap((d,f)=>d.value.split(c).map((m,v)=>m?v%2===1?d.type==="bold"?is.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},is.createElement("strong",{className:"text-zinc-200 font-semibold"},m)):is.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},m):d.type==="bold"?is.createElement("strong",{key:`b-${f}-${v}`,className:"text-zinc-200 font-semibold"},m):m:null)).filter(Boolean)}class bw extends Error{code;statusCode;constructor(t,s,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=s}}function EL(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const AL=EL();function RL(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.apiKey?window.__CANONRY_CONFIG__.apiKey:""}async function ye(e,t){const s=RL(),a=await fetch(`${AL}${e}`,{...t,headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{},...t?.headers}});if(!a.ok){const r=await a.text();let c=`API ${a.status}: ${a.statusText}`,d;if(r)try{const f=JSON.parse(r);typeof f.error=="string"?c=f.error:f.error?.message?(c=f.error.message,d=f.error.code):f.message&&(c=f.message)}catch{c=r}throw new bw(c,a.status,d)}if(a.status!==204)return a.json()}function Sw(){return ye("/projects")}function kp(e){return ye(`/projects/${encodeURIComponent(e)}`)}function jw(){return ye("/runs")}function Lr(e){return ye(`/runs/${encodeURIComponent(e)}`)}function ww(e){return ye(`/projects/${encodeURIComponent(e)}/keywords`)}function _p(e){return ye(`/projects/${encodeURIComponent(e)}/competitors`)}function zp(e,t){const s=new URLSearchParams;t!==void 0&&s.set("location",t);const a=s.toString();return ye(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function cl(e,t){return ye(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function Nw(e,t){return ye(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function Cw(e,t){return ye(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function Ep(e,t){return ye(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function _m(e,t){const s=await kp(e);return cl(e,{displayName:s.displayName,canonicalDomain:s.canonicalDomain,ownedDomains:t,country:s.country,language:s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:s.locations,defaultLocation:s.defaultLocation})}async function kw(e,t){const s=await kp(e);return cl(e,{displayName:t.displayName??s.displayName,canonicalDomain:t.canonicalDomain??s.canonicalDomain,ownedDomains:t.ownedDomains??s.ownedDomains,country:t.country??s.country,language:t.language??s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:t.locations??s.locations,defaultLocation:t.defaultLocation!==void 0?t.defaultLocation:s.defaultLocation})}function Ap(e,t){const s={};return ye(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function _w(e,t){return ye(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function zw(e,t){await ye(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function Ew(e,t){return ye(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function Aw(e){await ye(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function Rw(e){return ye(`/projects/${encodeURIComponent(e)}/export`)}function Vu(){return ye("/settings")}function Tw(e,t){return ye(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function Ow(e){return ye("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function Dw(e){try{return await ye(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function zm(e,t){return ye(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function Lw(e){await ye(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function Mw(e){return ye(`/projects/${encodeURIComponent(e)}/notifications`)}function Uw(e,t){return ye(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function $w(e,t){await ye(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Pw(e,t){return ye(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function Iw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function Bw(e){return ye("/apply",{method:"POST",body:JSON.stringify(e)})}function TL(e){return ye("/runs",{method:"POST",body:JSON.stringify(e??{})})}function Rp(e){return ye(`/projects/${encodeURIComponent(e)}/google/connections`)}function qw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function Hw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Gw(e){return ye(`/projects/${encodeURIComponent(e)}/google/properties`)}function Fw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function Zw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function Tp(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function Kw(e,t){const s=new URLSearchParams;t?.startDate&&s.set("startDate",t.startDate),t?.endDate&&s.set("endDate",t.endDate),t?.query&&s.set("query",t.query),t?.page&&s.set("page",t.page),t?.limit!==void 0&&s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/performance${a}`)}function Vw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function Qw(e,t){const s=new URLSearchParams;t?.url&&s.set("url",t.url),s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${a}`)}function Yw(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Op(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function Jw(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function Xw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function Ww(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function eN(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function Em(){return ye("/cdp/status")}function tN(e,t){return ye("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function Am(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function Dp(e){return ye(`/projects/${encodeURIComponent(e)}/bing/status`)}function nN(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function sN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function iN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/sites`)}function aN(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Lp(e){return ye(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function Mp(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function Up(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function Rm(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function rN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/performance`)}function oN(e){return ye("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function lN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function cN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function uN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/sources${s}`)}function Tm(e){return ye(`/projects/${encodeURIComponent(e)}/ga/status`)}function Om(e,t){return ye(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function dN(e,t){return ye(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function fN(e){return ye(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}async function hN(e,t){try{const s=await fetch(e);if(!s.ok)return{label:t,state:"error",detail:`HTTP ${s.status}`};const a=await s.json(),r=typeof a.version=="string"?a.version:"unknown",c=typeof a.databaseUrlConfigured=="boolean"?a.databaseUrlConfigured:void 0,d=typeof a.lastHeartbeatAt=="string"?a.lastHeartbeatAt:void 0,f=[r,c===!1?"database not configured":"database configured",d?`heartbeat ${d}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:r,databaseConfigured:c,lastHeartbeatAt:d}}catch(s){return{label:t,state:"error",detail:s instanceof Error?s.message:"unreachable"}}}const OL=Object.freeze(Object.defineProperty({__proto__:null,ApiError:bw,addLocation:_w,addNotification:Uw,appendKeywords:Cw,applyProjectConfig:Bw,bingConnect:nN,bingDisconnect:sN,bingRequestIndexing:Rm,bingSetSite:aN,configureCdp:tN,createProject:cl,deleteProject:Aw,disconnectGa:fN,fetchAllRuns:jw,fetchAnalyticsGaps:cN,fetchAnalyticsMetrics:lN,fetchAnalyticsSources:uN,fetchBingCoverage:Lp,fetchBingInspections:Mp,fetchBingPerformance:rN,fetchBingSites:iN,fetchBingStatus:Dp,fetchCdpStatus:Em,fetchCompetitors:_p,fetchExport:Rw,fetchGaStatus:Tm,fetchGaTraffic:Om,fetchGoogleConnections:Rp,fetchGoogleProperties:Gw,fetchGscCoverage:Op,fetchGscCoverageHistory:Jw,fetchGscDeindexed:Yw,fetchGscInspections:Qw,fetchGscPerformance:Kw,fetchGscSitemaps:Ww,fetchKeywords:ww,fetchProject:kp,fetchProjects:Sw,fetchRunDetail:Lr,fetchSchedule:Dw,fetchServiceStatus:hN,fetchSettings:Vu,fetchTimeline:zp,generateKeywords:Iw,googleConnect:qw,googleDisconnect:Hw,inspectBingUrl:Up,inspectGscUrl:Vw,listNotifications:Mw,removeLocation:zw,removeNotification:$w,removeSchedule:Lw,requestIndexing:Am,saveGoogleProperty:Fw,saveSchedule:zm,saveSitemapUrl:Zw,sendTestNotification:Pw,setCompetitors:Ep,setDefaultLocation:Ew,setKeywords:Nw,triggerAllRuns:TL,triggerDiscoverSitemaps:eN,triggerGaSync:dN,triggerGscSync:Tp,triggerInspectSitemap:Xw,triggerRun:Ap,updateBingApiKey:oN,updateGoogleAuthConfig:Ow,updateOwnedDomains:_m,updateProject:kw,updateProviderConfig:Tw},Symbol.toStringTag,{value:"Module"}));function DL({evidence:e,project:t,onClose:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(-1),[f,p]=N.useState(null),[m,v]=N.useState(!1),[y,x]=N.useState({}),b=mL(t.project),w=new Set(b.map(Nm)),S=e.runHistory,C=S.length>1,k=c>=0&&f!==null,E=k?f:{citationState:e.citationState,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.changeLabel,summary:e.summary},A=E.citationState==="cited"||E.citationState==="emerging",L=E.citedDomains.findIndex(G=>w.has(G.toLowerCase().replace(/^www\./,"")))+1,M=E.citedDomains.length,R=t.project.displayName||t.project.name,T=[...b.map(Nm),R,R.split(" ").slice(0,2).join(" ")].filter(G=>G.trim().length>2),P=A?"cited":E.citationState==="lost"?"lost":E.citationState==="pending"?"pending":"not-cited",J=N.useRef(0),Q=N.useCallback(async G=>{const oe=++J.current;if(G===-1||G===S.length-1){d(-1),p(null),r(!1);return}d(G),r(!1);const q=S[G],X=`${q.runId}::${e.keyword}::${e.provider}`;if(y[X]){p(y[X]);return}v(!0);try{const O=await Lr(q.runId);if(oe!==J.current)return;const Z=O.snapshots.find(re=>re.keyword===e.keyword&&re.provider===e.provider)??O.snapshots.find(re=>re.keyword===e.keyword),ie=Z?{citationState:Z.citationState,provider:Z.provider,model:Z.model??null,answerSnippet:Z.answerText??"",citedDomains:Z.citedDomains,competitorDomains:Z.competitorOverlap,groundingSources:Z.groundingSources,evidenceUrls:[],changeLabel:q.citationState,summary:""}:{citationState:q.citationState,provider:e.provider,model:q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:q.citationState,summary:"Snapshot data not available for this run."};x(re=>({...re,[X]:ie})),p(ie)}catch{if(oe!==J.current)return;p({citationState:q.citationState,provider:e.provider,model:q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:q.citationState,summary:"Failed to load historical run data."})}finally{oe===J.current&&v(!1)}},[S,e.keyword,e.provider,y]),pe=(k||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,ke=!k&&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(" · "):"",je=A&&L>0?{label:"Citation confirmed",title:`Cited #${L} of ${M} domain${M!==1?"s":""}`,meta:pe}:A?{label:"Citation confirmed",title:"Cited in this answer",meta:pe}:E.citationState==="lost"?{label:"Citation lost",title:M>0?`${M} domain${M!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:pe}:E.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:M>0?`${M} domain${M!==1?"s":""} cited instead`:"No domains cited for this query",meta:pe},B=()=>{if(!E.answerSnippet)return null;const G=E.answerSnippet.split(`
95
- `),oe=[];let q=[],X=0;const O=()=>{if(q.length===0)return;const Z=q.join(" ").trim();Z&&oe.push(l.jsx("p",{className:oe.length>0?"mt-2.5":"",children:Eb(Z,T)},X++)),q=[]};for(const Z of G){const ie=Z.trim();if(/^[-\u2013\u2014]{3,}$/.test(ie)){O(),oe.push(l.jsx("hr",{className:"border-zinc-800/60 my-3"},X++));continue}const re=ie.match(/^(#{1,3})\s+(.+)$/);if(re){O();const ue=re[1].length,he=re[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||re[2],de=ue===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":ue===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";oe.push(l.jsx("p",{className:de,children:Eb(he,T)},X++));continue}if(ie===""){O();continue}q.push(ie)}return O(),oe};return l.jsx(Dj,{open:!0,onOpenChange:G=>{G||s()},children:l.jsxs(Lj,{children:[l.jsx(pp,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),l.jsxs(gp,{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," \\u00b7 ",E.provider||"All providers"]}),l.jsx(yp,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),l.jsxs(Uj,{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($u,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]}),C&&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:S.map((G,oe)=>{const q=c===-1&&oe===S.length-1||c===oe,X=G.citationState==="cited"?"bg-emerald-400":G.citationState==="emerging"?"bg-amber-400":G.citationState==="lost"?"bg-rose-400":"bg-zinc-600",Z=new Date(G.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),ie=!!(G.model&&oe>0&&S[oe-1]?.model&&S[oe-1].model!==G.model);return l.jsxs("button",{type:"button",className:`evidence-run-dot ${q?"evidence-run-dot--selected":""}`,onClick:()=>Q(oe===S.length-1?-1:oe),"aria-label":[`Run ${Z}: ${G.citationState}`,G.model?`model ${G.model}`:null,ie?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":q,children:[l.jsx("span",{className:`size-2 rounded-full ${X} ${ie?"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:Z})]},oe)})}),c>=0&&c<S.length&&l.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(S[c].createdAt).toLocaleString()," \\u2014 ",l.jsx("span",{className:"capitalize",children:S[c].citationState}),l.jsx("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>Q(-1),children:"\\u2190 Back to latest"})]}),!k&&(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.jsx("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:"Loading historical run data\\u2026"}),!m&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"evidence-modal-main",children:[l.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${P}`,children:[l.jsx("p",{className:`evidence-position-label evidence-position-label--${P}`,children:je.label}),l.jsx("p",{className:`evidence-position-title evidence-position-title--${P}`,children:je.title}),l.jsx("p",{className:"evidence-position-meta",children:je.meta}),ke&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:ke})]}),E.answerSnippet&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),l.jsx("div",{className:`answer-snippet-block ${a?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:B()}),E.answerSnippet.length>280&&l.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>r(!a),children:a?"↑ Collapse":"↓ Show full answer"})]}),!E.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"}),!k&&e.relatedTechnicalSignals.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:A?"Why you're cited":"What to fix"}),l.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((G,oe)=>l.jsxs("div",{className:"action-item",children:[l.jsx("svg",{className:`action-item-icon ${A?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:A?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})]},oe))})]}),E.summary&&l.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),l.jsxs("div",{className:"evidence-modal-sidebar",children:[E.citedDomains.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"Who was cited \\u2014 in order"}),l.jsxs("div",{className:"citation-leaderboard",children:[E.citedDomains.map((G,oe)=>{const q=G.toLowerCase().replace(/^www\./,""),X=w.has(q),O=!X&&E.competitorDomains.some(ie=>ie.toLowerCase().replace(/^www\./,"")===q),Z=X?"you":O?"competitor":"other";return l.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${Z}`,children:[l.jsxs("span",{className:"citation-leaderboard-rank",children:["#",oe+1]}),l.jsx("span",{className:"citation-leaderboard-domain",children:G}),X&&l.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),O&&l.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},G)}),!A&&l.jsxs("div",{className:"citation-leaderboard-item citation-leaderboard-item--not-cited border-dashed",children:[l.jsx("span",{className:"citation-leaderboard-rank text-zinc-600",children:"\\u2014"}),l.jsx("span",{className:"citation-leaderboard-domain text-zinc-600",children:t.project.canonicalDomain}),l.jsx("span",{className:"citation-leaderboard-tag text-zinc-600",children:"Not cited"})]})]})]}),E.groundingSources.length>0&&l.jsxs("div",{children:[l.jsxs("p",{className:"drawer-section-label",children:["Grounding sources (",E.groundingSources.length,")"]}),l.jsx("ul",{className:"grid gap-0.5",children:E.groundingSources.map((G,oe)=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:G.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G.title||G.uri})},oe))})]}),E.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:E.evidenceUrls.map(G=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:G,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G})},G))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.evidenceUrls.length===0&&l.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No citation data ",k?"for this run":"yet"]})]})]})]})]})]})})}function ss(e){const t=new Date("2026-02-20");return e.map((s,a)=>({runId:`run_mock_${a+1}`,citationState:s,createdAt:new Date(t.getTime()+a*2*24*60*60*1e3).toISOString()}))}const Zh=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],country:"US",language:"en",tags:["lead gen"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1}];function Qu(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 LL=Qu({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"}),ML=Qu({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"}),UL=Qu({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"}),$L=Qu({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"}),PL=[{id:"evidence_citypoint_emergency_gemini",keyword:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:ss(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",keyword:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:ss(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",keyword:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",keyword:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",keyword:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:ss(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",keyword:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",keyword:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",keyword:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",keyword:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Zh[0],Zh[1],ss(["cited","cited","cited","cited","cited"]),Zh[2],ss(["not-cited","not-cited","not-cited","cited"]);function IL(e,t){return e.projects.find(s=>s.project.id===t)}function BL(e,t){return e.runs.find(s=>s.id===t)}function qL(e,t){for(const s of e.projects){const a=s.visibilityEvidence.find(r=>r.id===t);if(a)return{project:s,evidence:a}}}function mN(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,locations:e.locations??[],defaultLocation:e.defaultLocation??null,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Ab(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function HL(e,t){if(!e)return"Waiting";if(!t)return"Running";const s=new Date(t).getTime()-new Date(e).getTime();if(s<1e3)return"<1s";const a=Math.floor(s/1e3);if(a<60)return`${a}s`;const r=Math.floor(a/60),c=a%60;return`${r}m ${c}s`}function pN(e){return e==="answer-visibility"?"Answer visibility sweep":e}function GL(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function $p(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:pN(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Ab(e.startedAt):Ab(e.createdAt),duration:HL(e.startedAt,e.finishedAt),statusDetail:e.error?gN(e.error):FL(e),summary:ZL(e),triggerLabel:GL(e.trigger)}}function gN(e){try{const s=JSON.parse(e);if(typeof s=="object"&&s!==null){const a=s.message??s.error?.message??s[0]?.error?.message;if(typeof a=="string"&&a.length>0)return a.length>200?a.slice(0,200)+"…":a}}catch{}const t=e.match(/\[.*?\]\s*(.+)/);if(t){const s=t[1];return s.length>200?s.slice(0,200)+"…":s}return e.length>200?e.slice(0,200)+"…":e}function FL(e){switch(e.status){case"queued":return"Waiting for execution slot.";case"running":return"Provider queries in progress.";case"completed":return"All key phrases checked.";case"partial":return"Run completed with some key phrases skipped.";case"failed":return e.error?gN(e.error):"Run failed.";default:return""}}function ZL(e){switch(e.status){case"queued":return"Queued for execution";case"running":return"In progress";case"completed":return"Visibility sweep completed";case"partial":return"Partial completion";case"failed":return"Run failed";default:return e.status}}function yN(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const c of e){const d=c.keyword??c.id;t.has(d)||t.set(d,!1),c.citationState==="cited"&&t.set(d,!0)}const s=t.size,a=[...t.values()].filter(Boolean).length;return{score:s>0?Math.round(a/s*100):0,citedCount:a,totalCount:s}}function KL(e){return e>=70?"positive":e>=40?"caution":"negative"}function VL(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function vN(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const s=new Set(t);let a=0;for(const c of e)c.competitorOverlap.some(d=>s.has(d))&&a++;const r=a/e.length;return r>=.5?{label:"High",count:a}:r>=.2?{label:"Moderate",count:a}:{label:"Low",count:a}}function QL(e,t,s,a){const r=[];let c=0;const d=new Set;if(s){const f=new Map;for(const m of s.snapshots)if(m.keyword){const v=`${m.keyword}::${m.provider}`;f.set(v,m)}const p=[...new Set(s.snapshots.map(m=>m.provider))].sort();p.length===0&&p.push("gemini");for(const m of t){if(m.runs.length===0)continue;d.add(m.keyword);const y=m.runs.at(-1)?.transition??"not-cited",x=y==="lost"?"lost":y==="emerging"?"emerging":y==="cited"?"cited":"not-cited";for(const b of p){const w=f.get(`${m.keyword}::${b}`);if(!w&&p.length>1)continue;const S=w?.model??null,C=S?`${b}:${S}`:null,k=C?m.modelRuns?.[C]:void 0,E=m.providerRuns?.[b],A=(E?.length?E:null)??(k?.length?k:null),z=E?.length?"provider":k?.length?"model":"keyword",L=A?A.at(-1).transition:y,M=L==="lost"?"lost":L==="emerging"?"emerging":w?w.citationState==="cited"?"cited":"not-cited":x,R=Dm(A||m.runs),T=YL(m,b),P=(A??m.runs).map(pe=>({runId:pe.runId,citationState:pe.citationState,createdAt:pe.createdAt,model:T.get(pe.runId)??null})),J=JL(P),Q=z==="provider"&&J.length<=1?"model":z,se=XL(P);r.push({id:`evidence_${e}_${c++}`,keyword:m.keyword,provider:w?.provider??b,model:w?.model??null,location:w?.location??null,citationState:M,changeLabel:WL(L,R),answerSnippet:w?.answerText??"",citedDomains:w?.citedDomains??[],evidenceUrls:[],competitorDomains:w?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:w?.groundingSources??[],summary:eM(M,m.keyword),runHistory:P,historyScope:Q,modelsSeen:J,modelTransitions:se})}}}for(const f of a)d.has(f.keyword)||r.push({id:`evidence_${e}_${c++}`,keyword:f.keyword,provider:"",model:null,location:null,citationState:"pending",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${f.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return r}function YL(e,t){const s=new Map,a=`${t}:`;for(const[r,c]of Object.entries(e.modelRuns??{})){if(!r.startsWith(a))continue;const d=r.slice(a.length),f=d==="unknown"?null:d;for(const p of c)s.set(p.runId,f)}return s}function JL(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function XL(e){const t=[];let s=null;for(const a of e){const r=a.model??null;r!==s&&s!==null&&t.push({runId:a.runId,createdAt:a.createdAt,fromModel:s,toModel:r}),s=r}return t}function Dm(e){if(e.length===0)return 0;const t=e[e.length-1].citationState;let s=0;for(let a=e.length-1;a>=0&&e[a].citationState===t;a--)s++;return s}function WL(e,t){switch(e){case"new":return"First observation";case"cited":return t<=1?"Cited in latest run":`Cited for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return"First citation";case"not-cited":return t<=1?"Not cited in latest run":`Not cited across ${t} runs`;default:return e}}function eM(e,t){switch(e){case"cited":return`Your domain is cited in AI answers for "${t}".`;case"lost":return`Citation was lost for "${t}". Competitors may have gained ground.`;case"emerging":return`Your domain is starting to appear in answers for "${t}".`;case"not-cited":return`No citation detected for "${t}".`;case"pending":return`"${t}" has been added but no visibility run has been triggered yet.`}}function Rb(e,t){const s=new Set(t),a=new Map;for(const r of e)if(r.keyword)for(const c of r.competitorOverlap){if(!s.has(c))continue;const d=a.get(c)??new Set;d.add(r.keyword),a.set(c,d)}return a}const Kh=3;function tM(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:r,trackedCompetitors:c}=e,d=[],f=[],p=new Set;for(const k of t)k.citationState==="lost"&&(p.has(k.keyword)||(p.add(k.keyword),f.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"lost"})));f.length>0&&d.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${f.length} keyword${f.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:f});const m=Rb(a,c),v=Rb(r,c);for(const k of c){const E=m.get(k)??new Set,A=v.get(k)??new Set,z=[...E].filter(L=>!A.has(L));z.length>0&&d.push({id:`insight_comp_gained_${k}`,tone:"negative",title:`${k} appeared on ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:z.map(L=>{const M=t.find(R=>R.keyword===L);return{keyword:L,evidenceId:M?.id??"",citationState:"cited"}})})}const y=new Map;for(const k of s){const E=k.runs.at(-1);E&&y.set(k.keyword,{transition:E.transition,citationState:E.citationState})}const x=[],b=[],w=new Set;for(const[k,{transition:E,citationState:A}]of y){if(!(E==="emerging"||E==="new"&&A==="cited"))continue;w.add(k);const L=t.find(M=>M.keyword===k&&(M.citationState==="emerging"||M.citationState==="cited"));x.push({keyword:k,evidenceId:L?.id??"",provider:L?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(w.has(k.keyword)||b.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"emerging"}));if(b.length>0){const k=new Set(b.map(E=>E.keyword)).size;d.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${k} keyword${k>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:b})}x.length>0&&d.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${w.size} keyword${w.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:x});const S=new Set(t.map(k=>k.keyword)),C=[];for(const k of s){if(!S.has(k.keyword)||k.runs.length<Kh||k.runs.at(-1)?.citationState!=="not-cited")continue;if(Dm(k.runs)>=Kh){const z=t.find(L=>L.keyword===k.keyword);C.push({keyword:k.keyword,evidenceId:z?.id??"",citationState:"not-cited"})}}C.length>0&&d.push({id:"insight_persistent_gap",tone:"caution",title:`${C.length} keyword${C.length>1?"s":""} uncited for ${Kh}+ runs`,detail:"These keywords have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:C});for(const k of c){const E=m.get(k)??new Set,z=[...v.get(k)??new Set].filter(L=>!E.has(L));z.length>0&&d.push({id:`insight_comp_lost_${k}`,tone:"neutral",title:`${k} dropped from ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:z.map(L=>{const M=t.find(R=>R.keyword===L);return{keyword:L,evidenceId:M?.id??"",citationState:"not-cited"}})})}return d.length===0&&d.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),d}function nM(e){const t=e[0];if(!t)return{label:"Run Status",value:"None",delta:"No runs yet",tone:"neutral",description:"Trigger a visibility sweep to start tracking.",tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]};const s=t.status==="completed"?"Healthy":t.status==="running"?"Running":t.status==="queued"?"Queued":t.status==="partial"?"Partial":"Failed",a=t.status==="completed"?"positive":t.status==="failed"?"negative":t.status==="partial"?"caution":"neutral";return{label:"Run Status",value:s,delta:`${e.length} total runs`,tone:a,description:`Latest: ${pN(t.kind)} — ${t.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function sM(e){const t=mN(e.project),s=QL(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],r=yN(a),c=vN(a,e.competitors.map(y=>y.domain)),d=tM({evidence:s,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(y=>y.domain)}),f=[...e.runs].sort((y,x)=>x.createdAt.localeCompare(y.createdAt)),p=f.map(y=>$p(y,e.project.displayName||e.project.name)),m=new Map;for(const y of a){const x=y.provider||"gemini",b=y.model??null,w=`${x}::${b??"unknown"}`,S=m.get(w)??{provider:x,model:b,cited:0,total:0};S.total++,y.citationState==="cited"&&S.cited++,m.set(w,S)}const v=[...m.values()].sort((y,x)=>y.provider.localeCompare(x.provider)||(y.model??"").localeCompare(x.model??"")).map(({provider:y,model:x,cited:b,total:w})=>({provider:y,model:x,score:w>0?Math.round(b/w*100):0,cited:b,total:w}));return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:a.length>0?`${r.score}`:"No data",delta:a.length>0?`${r.citedCount} of ${r.totalCount} key phrases visible`:"Run a sweep first",tone:a.length>0?KL(r.score):"neutral",description:a.length>0?`${r.citedCount} of ${r.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[]},providerScores:v,competitorPressure:{label:"Competitor Pressure",value:c.label,delta:c.count>0?`${c.count} overlapping citations`:"No overlap detected",tone:VL(c.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:nM(f),insights:d,visibilityEvidence:s,competitors:e.competitors.map((y,x)=>{const b=new Set;for(const E of a)(E.competitorOverlap.includes(y.domain)||E.citedDomains.includes(y.domain))&&E.keyword&&b.add(E.keyword);const w=[...b],S=new Set(a.map(E=>E.keyword).filter(Boolean)),C=S.size>0?w.length/S.size:0,k=C>=.5?"High":C>=.2?"Moderate":w.length>0?"Low":"None";return{id:y.id||`comp_${x}`,domain:y.domain,citationCount:w.length,totalKeywords:S.size,pressureLabel:k,citedKeywords:w,movement:"",notes:""}}),recentRuns:p.slice(0,5)}}function iM(e){const t=mN(e.project),s=e.latestRunDetail?.snapshots??[],a=yN(s),r=vN(s,e.competitors.map(p=>p.domain)),d=[...e.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt))[0],f=d?$p(d,e.project.displayName||e.project.name):{id:"none",projectId:e.project.id,projectName:e.project.displayName||e.project.name,kind:"answer-visibility",kindLabel:"No runs yet",status:"queued",trigger:"manual",createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""};return{project:t,visibilityScore:a.score,visibilityDelta:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases`:"No data",lastRun:f,insight:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible across ${new Set(s.map(p=>p.provider)).size} provider${new Set(s.map(p=>p.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:r.label}}function aM(e,t){const s=[],a=[],r=[];for(const d of e){a.push(sM(d)),r.push(iM(d));const f=[...d.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt));for(const p of f)s.push($p(p,d.project.displayName||d.project.name))}s.sort((d,f)=>f.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:r,attentionItems:c?rM(a):[{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:s.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"}),...c?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:a,runs:s,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:c,ctaLabel:c?"Trigger run":"Create a project first",summary:c?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(d=>({name:d.name,displayName:d.displayName,keyUrl:d.keyUrl,modelHint:d.modelHint,model:d.model,state:d.configured?"ready":"needs-config",detail:d.configured?"Provider is configured.":"API key is missing.",quota:d.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 rM(e){const t=[];for(const s of e){const a=s.visibilityEvidence.filter(c=>c.citationState==="lost");a.length>0&&t.push({id:`attention_${s.project.id}_lost`,tone:"negative",title:`${s.project.displayName||s.project.name} lost citations`,detail:`${a.length} key phrase${a.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${s.project.id}`});const r=s.recentRuns.filter(c=>c.status==="running"||c.status==="queued");r.length>0&&t.push({id:`attention_${s.project.id}_active`,tone:"neutral",title:`${s.project.displayName||s.project.name} has active runs`,detail:`${r.length} run${r.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 Ri={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"]},xN=N.createContext(null);xN.Provider;function ul(){return N.useContext(xN)}function Ra(e){const s=ul()?.dashboard??null,a=Zo({queryKey:Ri.projects.all,queryFn:Sw,enabled:!s}),r=Zo({queryKey:Ri.runs.all,queryFn:jw,enabled:!s,refetchInterval:w=>w.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),c=Zo({queryKey:Ri.settings,queryFn:()=>Vu().catch(()=>null),enabled:!s}),d=a.data??[],f=r.data??[],p=Xk({queries:d.map(w=>{const S=f.filter(k=>k.projectId===w.id),C=S.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,E)=>E.createdAt.localeCompare(k.createdAt));return{queryKey:Ri.projects.detail(w.id,C[0]?.id),queryFn:async()=>{const[k,E,A,z,L]=await Promise.all([ww(w.name).catch(()=>[]),_p(w.name).catch(()=>[]),zp(w.name).catch(()=>[]),C[0]?Lr(C[0].id).catch(()=>null):Promise.resolve(null),C[1]?Lr(C[1].id).catch(()=>null):Promise.resolve(null)]);return{project:w,runs:S,keywords:k,competitors:E,timeline:A,latestRunDetail:z,previousRunDetail:L}},enabled:!s&&a.isSuccess&&r.isSuccess}})}),m=p.every(w=>w.isSuccess),v=N.useMemo(()=>{if(s)return s;if(!a.data||!r.data||d.length>0&&!m)return null;const w=p.map(S=>S.data).filter(S=>S!=null);return aM(w,c.data??null)},[s,a.data,r.data,c.data,m,p,d.length]),y=!s&&(a.isError||r.isError),x=!s&&!v&&!y,b=N.useCallback(async()=>{await Promise.all([a.refetch(),r.refetch(),c.refetch()])},[a.refetch,r.refetch,c.refetch]);return{dashboard:v,isLoading:x,isError:y,refetch:b}}function oM(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Tb=oM(),Lm=Tb==="/"?"":Tb.replace(/\/$/,"");async function lM(){const e=Lm?`${Lm}/health`:"/health",t=await hN(e,"API"),s=t.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:t.state,detail:"Depends on API"};return{apiStatus:t,workerStatus:s}}function Yu(e,t){return Zo({queryKey:Ri.health,queryFn:lM,enabled:e,refetchInterval:15e3,initialData:t})}function cM(e){return Zo({queryKey:Ri.runs.detail(e??""),queryFn:()=>Lr(e),enabled:!!e,refetchInterval:t=>{const s=t.state.data?.status;return s==="running"||s==="queued"?3e3:!1}})}function dl(){const e=_a(),t=Mu({strict:!1}),s=jn({select:p=>p.location.pathname}),a=t.runId??null,r=t.evidenceId??null;return{runId:a,evidenceId:r,openRun:p=>e({to:s,from:as.to,search:m=>({...m,runId:p,evidenceId:void 0})}),openEvidence:p=>e({to:s,from:as.to,search:m=>({...m,evidenceId:p,runId:void 0})}),closeDrawer:()=>e({to:s,from:as.to,search:p=>({...p,runId:void 0,evidenceId:void 0})})}}const Ob=[{label:"Architecture",href:"https://github.com/AINYC/canonry/blob/main/docs/architecture.md"},{label:"Testing Guide",href:"https://github.com/AINYC/canonry/blob/main/docs/testing.md"}],Db=e=>({label:e,state:"checking",detail:"Checking service health"}),uM={apiStatus:Db("API"),workerStatus:Db("Worker")};function dM(){const e=ul(),{dashboard:t,isLoading:s,refetch:a}=Ra(),d=Yu(!e,e?.health).data??e?.health??uM,f=t2(),{runId:p,evidenceId:m,closeDrawer:v}=dl(),[y,x]=N.useState(!1),b=cM(p),w=b.data??null,S=b.isLoading;N.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&a()},[w?.status,a]),N.useEffect(()=>{x(!1)},[f.pathname]),N.useEffect(()=>{if(typeof window>"u"||!p&&!m)return;const z=L=>{L.key==="Escape"&&v()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[p,m,v]);const C=t??e?.dashboard??null,k=p&&C?BL(C,p):void 0,E=m&&C?qL(C,m):void 0,A=(()=>{const z=f.pathname;if(z==="/")return"Portfolio";if(z==="/projects")return"Projects";if(z==="/runs")return"Runs";if(z==="/settings")return"Settings";if(z==="/setup")return"Setup";if(z.startsWith("/projects/")){const M=z.split("/").filter(Boolean)[1];if(M&&C){const R=C.projects.find(T=>T.project.id===M);if(R)return R.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(Vx,{})}),l.jsxs("nav",{className:"sidebar-nav",children:[l.jsxs(yt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(x2,{className:"sidebar-icon"}),l.jsx("span",{children:"Overview"})]}),l.jsxs(yt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[l.jsx(y2,{className:"sidebar-icon"}),l.jsx("span",{children:"Projects"})]}),l.jsxs(yt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(w2,{className:"sidebar-icon"}),l.jsx("span",{children:"Runs"})]}),l.jsxs(yt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(R2,{className:"sidebar-icon"}),l.jsx("span",{children:"Settings"})]}),s?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(z=>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+z*15}%`}})]},z))]}):C&&C.projects.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),C.projects.map(z=>{const L=z.visibilitySummary.tone;return l.jsxs(yt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[l.jsx("span",{className:`sidebar-dot sidebar-dot-${L}`}),l.jsx("span",{children:z.project.name})]},z.project.id)})]}):s?null:l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Resources"}),l.jsxs(yt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(_2,{className:"sidebar-icon"}),l.jsx("span",{children:"Setup"})]})]})]}),l.jsx("div",{className:"sidebar-footer",children:Ob.map(z=>l.jsx("a",{className:"sidebar-footer-link",href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]}),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(Vx,{compact:!0})}),l.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[l.jsx(yt,{to:"/",children:"Home"}),l.jsx(Uu,{className:"breadcrumb-sep size-3"}),l.jsx("span",{className:"breadcrumb-current",children:A})]})]}),l.jsxs("div",{className:"topbar-actions",children:[l.jsxs("div",{className:"health-pill-row",children:[l.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),l.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),l.jsxs(ce,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>x(z=>!z),children:[l.jsx(S2,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),l.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${y?"mobile-nav-open":""}`,children:[l.jsxs(ce,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>x(!1),children:[l.jsx($u,{className:"size-5"}),l.jsx("span",{className:"sr-only",children:"Close navigation"})]}),l.jsx(yt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),l.jsx(yt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),l.jsx(yt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),l.jsx(yt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),C&&C.projects.length>0?l.jsxs("div",{className:"mobile-nav-section",children:[l.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),C.projects.map(z=>l.jsx(yt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"mobile-nav-link",children:z.project.name},z.project.id))]}):null]}),l.jsx("main",{id:"content",className:"page-shell",children:s&&!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(z=>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"})]},z))}),l.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(z=>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(L=>l.jsx("div",{className:"skeleton-text-sm w-full"},L))})]},z))})]}):l.jsx(lp,{})}),l.jsxs("footer",{className:"footer",children:[l.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noreferrer",className:"footer-brand",children:[l.jsx(p2,{className:"size-3.5"}),l.jsx("span",{children:"Canonry"})]}),l.jsx("div",{className:"footer-links",children:Ob.map(z=>l.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),k?l.jsxs(ER,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:v,children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[l.jsx(Iu,{status:k.status}),l.jsx("span",{className:"text-zinc-400",children:k.startedAt}),l.jsx("span",{className:"text-zinc-500",children:k.duration}),l.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&l.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):w&&w.snapshots.length>0?l.jsxs("div",{className:"space-y-2",children:[w.snapshots.map(z=>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:z.keyword??"Unknown key phrase"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(nl,{provider:z.provider}),l.jsx(tj,{variant:z.citationState==="cited"?"success":"neutral",children:z.citationState})]})]}),z.model&&l.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:z.model}),z.citedDomains.length>0&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[l.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",z.citedDomains.join(", ")]}),z.competitorOverlap.length>0&&l.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",z.competitorOverlap.join(", ")]}),z.groundingSources&&z.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:[z.groundingSources.length," grounding source",z.groundingSources.length!==1?"s":""]}),l.jsx("ul",{className:"mt-1 space-y-0.5",children:z.groundingSources.map((L,M)=>l.jsx("li",{className:"text-xs text-zinc-500 truncate",children:l.jsx("a",{href:L.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:L.title||L.uri})},M))})]}),z.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:z.answerText})]})]},z.id)),w.status==="running"&&l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):w&&w.status==="running"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):w&&w.status==="queued"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):w&&w.error?l.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[l.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),l.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:P2(w.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?l.jsx(DL,{evidence:E.evidence,project:E.project,onClose:v}):null]})}class fM extends N.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,s){console.error("[ErrorBoundary]",t,s.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(L2,{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(ce,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[l.jsx(E2,{className:"size-3.5 mr-1.5"}),"Try again"]}),l.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const De=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Qn("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}));De.displayName="Card";const hM=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Qn("flex flex-col gap-1.5 p-5",e),...t}));hM.displayName="CardHeader";const mM=N.forwardRef(({className:e,...t},s)=>l.jsx("h3",{ref:s,className:Qn("font-medium tracking-tight text-zinc-50",e),...t}));mM.displayName="CardTitle";const pM=N.forwardRef(({className:e,...t},s)=>l.jsx("p",{ref:s,className:Qn("text-sm text-zinc-500",e),...t}));pM.displayName="CardDescription";const gM=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Qn("p-5 pt-0",e),...t}));gM.displayName="CardContent";function yM({points:e,tone:t}){const s=N.useId();if(e.length===0)return null;const a=42,r=132,c=5,d=Math.min(...e),p=Math.max(...e)-d||1,m=r-c*2,v=a-c*2,y=e.map((x,b)=>{const w=c+b/Math.max(e.length-1,1)*m,S=c+(1-(x-d)/p)*v;return`${w},${S}`}).join(" ");return l.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${r} ${a}`,"aria-hidden":"true",children:[l.jsx("defs",{children:l.jsx("clipPath",{id:s,children:l.jsx("rect",{x:c,y:c,width:m,height:v,rx:"8"})})}),l.jsx("line",{className:"sparkline-guide",x1:c,x2:r-c,y1:a-c,y2:a-c}),l.jsx("polyline",{clipPath:`url(#${s})`,points:y,vectorEffect:"non-scaling-stroke"})]})}function vM(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function xM(e,t,s){return e.map(a=>{if(a.id==="api")return{...a,tone:ju(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:ju(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const r=s.providerStatuses.filter(p=>p.state==="ready").length,c=s.providerStatuses.length,d=r>0,f=s.providerStatuses.filter(p=>p.state==="ready").map(p=>vM(p)).join(" · ");return{...a,label:"Providers",tone:d?"positive":"caution",detail:`${r} of ${c} configured`,meta:f||"None configured"}})}function bM(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(s=>s.state==="ready"))return"Launch is blocked until at least one provider is configured."}function SM(e,t,s){const a=bM(t,s),r=structuredClone(e);return r.healthChecks=r.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const d=s.providerStatuses.some(f=>f.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),r.launchState.enabled=a===void 0,r.launchState.blockedReason=a,r.launchState.summary=a??"Queue a visibility sweep first, then follow with a site audit to explain movement.",r}function jM({project:e}){return l.jsxs(yt,{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",children:e.visibilityScore}),l.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),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," · ",Pu(e.lastRun.status)]})]})}),l.jsx("div",{className:"project-row-chart",children:l.jsx(yM,{points:e.trend,tone:nj(e.lastRun.status)})}),l.jsx("span",{className:"project-row-link",children:l.jsx(Uu,{className:"h-4 w-4 text-zinc-500"})})]})}function wM(){const e=ul(),{dashboard:t,isLoading:s}=Ra(),a=t??e?.dashboard;if(!a||s)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(v=>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"})]},v))})]});const r=a.portfolioOverview,f=Yu(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},p=xM(r.systemHealth,f,a.settings),{openRun:m}=dl();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:r.lastUpdatedAt})})]}),r.projects.length>0?l.jsx("div",{className:"project-list project-list-scrollable",children:r.projects.map(v=>l.jsx(jM,{project:v},v.project.id))}):l.jsxs(De,{className:"surface-card empty-card",children:[l.jsx("h3",{children:r.emptyState?.title??"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:r.emptyState?.detail}),l.jsx(ce,{size:"sm",asChild:!0,children:l.jsx(yt,{to:r.emptyState?.ctaHref==="/setup"||!r.emptyState?.ctaHref?"/setup":"/",children:r.emptyState?.ctaLabel??"Launch setup"})})]}),l.jsxs("div",{className:"overview-secondary-grid",children:[r.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:r.attentionItems.map(v=>l.jsxs(yt,{to:v.href,className:`attention-item attention-item-${v.tone}`,children:[l.jsxs("div",{children:[l.jsx("p",{className:"attention-title",children:v.title}),l.jsx("p",{className:"attention-detail",children:v.detail})]}),l.jsx("span",{className:"attention-action",children:v.actionLabel})]},v.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:r.recentRuns.length>0?r.recentRuns.map(v=>l.jsxs("button",{className:"compact-run",type:"button",onClick:()=>m(v.id),children:[l.jsxs("div",{children:[l.jsx("p",{className:"compact-run-title",children:v.projectName}),l.jsx("p",{className:"compact-run-detail",children:v.summary})]}),l.jsx(Iu,{status:v.status})]},v.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:p.map(v=>l.jsxs(De,{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:v.label}),l.jsx("h3",{children:v.detail})]}),l.jsx(nt,{tone:v.tone,children:v.label})]}),l.jsx("p",{className:"supporting-copy",children:v.meta})]},v.id))})]})]})}const Pp=Symbol.for("yaml.alias"),Mm=Symbol.for("yaml.document"),Mi=Symbol.for("yaml.map"),bN=Symbol.for("yaml.pair"),bs=Symbol.for("yaml.scalar"),qr=Symbol.for("yaml.seq"),Zn=Symbol.for("yaml.node.type"),Ta=e=>!!e&&typeof e=="object"&&e[Zn]===Pp,Ju=e=>!!e&&typeof e=="object"&&e[Zn]===Mm,fl=e=>!!e&&typeof e=="object"&&e[Zn]===Mi,Dt=e=>!!e&&typeof e=="object"&&e[Zn]===bN,ft=e=>!!e&&typeof e=="object"&&e[Zn]===bs,hl=e=>!!e&&typeof e=="object"&&e[Zn]===qr;function Tt(e){if(e&&typeof e=="object")switch(e[Zn]){case Mi:case qr:return!0}return!1}function Ot(e){if(e&&typeof e=="object")switch(e[Zn]){case Pp:case Mi:case bs:case qr:return!0}return!1}const SN=e=>(ft(e)||Tt(e))&&!!e.anchor,da=Symbol("break visit"),NM=Symbol("skip children"),Qo=Symbol("remove node");function Hr(e,t){const s=CM(t);Ju(e)?Cr(null,e.contents,s,Object.freeze([e]))===Qo&&(e.contents=null):Cr(null,e,s,Object.freeze([]))}Hr.BREAK=da;Hr.SKIP=NM;Hr.REMOVE=Qo;function Cr(e,t,s,a){const r=kM(e,t,s,a);if(Ot(r)||Dt(r))return _M(e,a,r),Cr(e,r,s,a);if(typeof r!="symbol"){if(Tt(t)){a=Object.freeze(a.concat(t));for(let c=0;c<t.items.length;++c){const d=Cr(c,t.items[c],s,a);if(typeof d=="number")c=d-1;else{if(d===da)return da;d===Qo&&(t.items.splice(c,1),c-=1)}}}else if(Dt(t)){a=Object.freeze(a.concat(t));const c=Cr("key",t.key,s,a);if(c===da)return da;c===Qo&&(t.key=null);const d=Cr("value",t.value,s,a);if(d===da)return da;d===Qo&&(t.value=null)}}return r}function CM(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 kM(e,t,s,a){if(typeof s=="function")return s(e,t,a);if(fl(t))return s.Map?.(e,t,a);if(hl(t))return s.Seq?.(e,t,a);if(Dt(t))return s.Pair?.(e,t,a);if(ft(t))return s.Scalar?.(e,t,a);if(Ta(t))return s.Alias?.(e,t,a)}function _M(e,t,s){const a=t[t.length-1];if(Tt(a))a.items[e]=s;else if(Dt(a))e==="key"?a.key=s:a.value=s;else if(Ju(a))a.contents=s;else{const r=Ta(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const zM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},EM=e=>e.replace(/[!,[\]{}]/g,t=>zM[t]);class dn{constructor(t,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},dn.defaultYaml,t),this.tags=Object.assign({},dn.defaultTags,s)}clone(){const t=new dn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new dn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:dn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},dn.defaultTags);break}return t}add(t,s){this.atNextDocument&&(this.yaml={explicit:dn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},dn.defaultTags),this.atNextDocument=!1);const a=t.trim().split(/[ \t]+/),r=a.shift();switch(r){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[c,d]=a;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=a;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,d),!1}}default:return s(0,`Unknown directive ${r}`,!0),!1}}tagName(t,s){if(t==="!")return"!";if(t[0]!=="!")return s(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const d=t.slice(2,-1);return d==="!"||d==="!!"?(s(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&s("Verbatim tags must end with a >"),d)}const[,a,r]=t.match(/^(.*!)([^!]*)$/s);r||s(`The ${t} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(r)}catch(d){return s(String(d)),null}return a==="!"?t:(s(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[s,a]of Object.entries(this.tags))if(t.startsWith(a))return s+EM(t.substring(a.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let r;if(t&&a.length>0&&Ot(t.contents)){const c={};Hr(t.contents,(d,f)=>{Ot(f)&&f.tag&&(c[f.tag]=!0)}),r=Object.keys(c)}else r=[];for(const[c,d]of a)c==="!!"&&d==="tag:yaml.org,2002:"||(!t||r.some(f=>f.startsWith(d)))&&s.push(`%TAG ${c} ${d}`);return s.join(`
96
- `)}}dn.defaultYaml={explicit:!1,version:"1.2"};dn.defaultTags={"!!":"tag:yaml.org,2002:"};function jN(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(s)}return!0}function wN(e){const t=new Set;return Hr(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function NN(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function AM(e,t){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=wN(e));const d=NN(t,r);return r.add(d),d},setAnchors:()=>{for(const c of s){const d=a.get(c);if(typeof d=="object"&&d.anchor&&(ft(d.node)||Tt(d.node)))d.node.anchor=d.anchor;else{const f=new Error("Failed to resolve repeated object (this should not happen)");throw f.source=c,f}}},sourceObjects:a}}function kr(e,t,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,c=a.length;r<c;++r){const d=a[r],f=kr(e,a,String(r),d);f===void 0?delete a[r]:f!==d&&(a[r]=f)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const c=a.get(r),d=kr(e,a,r,c);d===void 0?a.delete(r):d!==c&&a.set(r,d)}else if(a instanceof Set)for(const r of Array.from(a)){const c=kr(e,a,r,r);c===void 0?a.delete(r):c!==r&&(a.delete(r),a.add(c))}else for(const[r,c]of Object.entries(a)){const d=kr(e,a,r,c);d===void 0?delete a[r]:d!==c&&(a[r]=d)}return e.call(t,s,a)}function Fn(e,t,s){if(Array.isArray(e))return e.map((a,r)=>Fn(a,String(r),s));if(e&&typeof e.toJSON=="function"){if(!s||!SN(e))return e.toJSON(t,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(e,a),s.onCreate=c=>{a.res=c,delete s.onCreate};const r=e.toJSON(t,s);return s.onCreate&&s.onCreate(r),r}return typeof e=="bigint"&&!s?.keep?Number(e):e}class Ip{constructor(t){Object.defineProperty(this,Zn,{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:s,maxAliasCount:a,onAnchor:r,reviver:c}={}){if(!Ju(t))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:t,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Fn(this,"",d);if(typeof r=="function")for(const{count:p,res:m}of d.anchors.values())r(m,p);return typeof c=="function"?kr(c,{"":f},"",f):f}}class Bp extends Ip{constructor(t){super(Pp),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,s){let a;s?.aliasResolveCache?a=s.aliasResolveCache:(a=[],Hr(t,{Node:(c,d)=>{(Ta(d)||SN(d))&&a.push(d)}}),s&&(s.aliasResolveCache=a));let r;for(const c of a){if(c===this)break;c.anchor===this.source&&(r=c)}return r}toJSON(t,s){if(!s)return{source:this.source};const{anchors:a,doc:r,maxAliasCount:c}=s,d=this.resolve(r,s);if(!d){const p=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(p)}let f=a.get(d);if(f||(Fn(d,null,s),f=a.get(d)),f?.res===void 0){const p="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(p)}if(c>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=ou(r,d,a)),f.count*f.aliasCount>c)){const p="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(p)}return f.res}toString(t,s,a){const r=`*${this.source}`;if(t){if(jN(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(t.implicitKey)return`${r} `}return r}}function ou(e,t,s){if(Ta(t)){const a=t.resolve(e),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(Tt(t)){let a=0;for(const r of t.items){const c=ou(e,r,s);c>a&&(a=c)}return a}else if(Dt(t)){const a=ou(e,t.key,s),r=ou(e,t.value,s);return Math.max(a,r)}return 1}const CN=e=>!e||typeof e!="function"&&typeof e!="object";class Ae extends Ip{constructor(t){super(bs),this.value=t}toJSON(t,s){return s?.keep?this.value:Fn(this.value,t,s)}toString(){return String(this.value)}}Ae.BLOCK_FOLDED="BLOCK_FOLDED";Ae.BLOCK_LITERAL="BLOCK_LITERAL";Ae.PLAIN="PLAIN";Ae.QUOTE_DOUBLE="QUOTE_DOUBLE";Ae.QUOTE_SINGLE="QUOTE_SINGLE";const RM="tag:yaml.org,2002:";function TM(e,t,s){if(t){const a=s.filter(c=>c.tag===t),r=a.find(c=>!c.format)??a[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return s.find(a=>a.identify?.(e)&&!a.format)}function rl(e,t,s){if(Ju(e)&&(e=e.contents),Ot(e))return e;if(Dt(e)){const y=s.schema[Mi].createNode?.(s.schema,null,s);return y.items.push(e),y}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:r,onTagObj:c,schema:d,sourceObjects:f}=s;let p;if(a&&e&&typeof e=="object"){if(p=f.get(e),p)return p.anchor??(p.anchor=r(e)),new Bp(p.anchor);p={anchor:null,node:null},f.set(e,p)}t?.startsWith("!!")&&(t=RM+t.slice(2));let m=TM(e,t,d.tags);if(!m){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Ae(e);return p&&(p.node=y),y}m=e instanceof Map?d[Mi]:Symbol.iterator in Object(e)?d[qr]:d[Mi]}c&&(c(m),delete s.onTagObj);const v=m?.createNode?m.createNode(s.schema,e,s):typeof m?.nodeClass?.from=="function"?m.nodeClass.from(s.schema,e,s):new Ae(e);return t?v.tag=t:m.default||(v.tag=m.tag),p&&(p.node=v),v}function Eu(e,t,s){let a=s;for(let r=t.length-1;r>=0;--r){const c=t[r];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const d=[];d[c]=a,a=d}else a=new Map([[c,a]])}return rl(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Fo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class kN extends Ip{constructor(t,s){super(t),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(t){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(s.schema=t),s.items=s.items.map(a=>Ot(a)||Dt(a)?a.clone(t):a),this.range&&(s.range=this.range.slice()),s}addIn(t,s){if(Fo(t))this.add(s);else{const[a,...r]=t,c=this.get(a,!0);if(Tt(c))c.addIn(r,s);else if(c===void 0&&this.schema)this.set(a,Eu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}deleteIn(t){const[s,...a]=t;if(a.length===0)return this.delete(s);const r=this.get(s,!0);if(Tt(r))return r.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(t,s){const[a,...r]=t,c=this.get(a,!0);return r.length===0?!s&&ft(c)?c.value:c:Tt(c)?c.getIn(r,s):void 0}hasAllNullValues(t){return this.items.every(s=>{if(!Dt(s))return!1;const a=s.value;return a==null||t&&ft(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(t){const[s,...a]=t;if(a.length===0)return this.has(s);const r=this.get(s,!0);return Tt(r)?r.hasIn(a):!1}setIn(t,s){const[a,...r]=t;if(r.length===0)this.set(a,s);else{const c=this.get(a,!0);if(Tt(c))c.setIn(r,s);else if(c===void 0&&this.schema)this.set(a,Eu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const OM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Gs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ga=(e,t,s)=>e.endsWith(`
94
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const f=d[1];if(t===d[0]){c(d);continue}if(e.external){const m=e.external.registry.get(d[0])?.id;if(t!==d[0]&&m){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(f.cycle){c(d);continue}if(f.count>1&&e.reused==="ref"){c(d);continue}}}function fw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=d=>{const f=e.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,m={...p},v=f.ref;if(f.ref=null,v){a(v);const x=e.seen.get(v),b=x.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(b)):Object.assign(p,b),Object.assign(p,m),d._zod.parent===v)for(const S in p)S==="$ref"||S==="allOf"||S in m||delete p[S];if(b.$ref&&x.def)for(const S in p)S==="$ref"||S==="allOf"||S in x.def&&JSON.stringify(p[S])===JSON.stringify(x.def[S])&&delete p[S]}const y=d._zod.parent;if(y&&y!==v){a(y);const x=e.seen.get(y);if(x?.schema.$ref&&(p.$ref=x.schema.$ref,x.def))for(const b in p)b==="$ref"||b==="allOf"||b in x.def&&JSON.stringify(p[b])===JSON.stringify(x.def[b])&&delete p[b]}e.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...e.seen.entries()].reverse())a(d[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(d)}Object.assign(r,s.def??s.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const f=d[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?r.$defs=c:r.definitions=c);try{const d=JSON.parse(JSON.stringify(r));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input:ku(t,"input",e.processors),output:ku(t,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function cn(e,t){const s=t??{seen:new Set};if(s.seen.has(e))return!1;s.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return cn(a.element,s);if(a.type==="set")return cn(a.valueType,s);if(a.type==="lazy")return cn(a.getter(),s);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return cn(a.innerType,s);if(a.type==="intersection")return cn(a.left,s)||cn(a.right,s);if(a.type==="record"||a.type==="map")return cn(a.keyType,s)||cn(a.valueType,s);if(a.type==="pipe")return cn(a.in,s)||cn(a.out,s);if(a.type==="object"){for(const r in a.shape)if(cn(a.shape[r],s))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(cn(r,s))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(cn(r,s))return!0;return!!(a.rest&&cn(a.rest,s))}return!1}const z5=(e,t={})=>s=>{const a=uw({...s,processors:t});return qt(e,a),dw(a,e),fw(a,e)},ku=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},d=uw({...r??{},target:c,io:t,processors:s});return qt(e,d),dw(d,e),fw(d,e)},E5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},R5=(e,t,s,a)=>{const r=s;r.type="string";const{minimum:c,maximum:d,format:f,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof c=="number"&&(r.minLength=c),typeof d=="number"&&(r.maxLength=d),f&&(r.format=E5[f]??f,r.format===""&&delete r.format,f==="time"&&delete r.format),m&&(r.contentEncoding=m),p&&p.size>0){const v=[...p];v.length===1?r.pattern=v[0].source:v.length>1&&(r.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},A5=(e,t,s,a)=>{const r=s,{minimum:c,maximum:d,format:f,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?r.type="integer":r.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=v,r.exclusiveMinimum=!0):r.exclusiveMinimum=v),typeof c=="number"&&(r.minimum=c,typeof v=="number"&&t.target!=="draft-04"&&(v>=c?delete r.minimum:delete r.exclusiveMinimum)),typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=m,r.exclusiveMaximum=!0):r.exclusiveMaximum=m),typeof d=="number"&&(r.maximum=d,typeof m=="number"&&t.target!=="draft-04"&&(m<=d?delete r.maximum:delete r.exclusiveMaximum)),typeof p=="number"&&(r.multipleOf=p)},T5=(e,t,s,a)=>{s.type="boolean"},O5=(e,t,s,a)=>{s.not={}},D5=(e,t,s,a)=>{},L5=(e,t,s,a)=>{const r=e._zod.def,c=Gj(r.entries);c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),s.enum=c},M5=(e,t,s,a)=>{const r=e._zod.def,c=[];for(const d of r.values)if(d===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(d))}else c.push(d);if(c.length!==0)if(c.length===1){const d=c[0];s.type=d===null?"null":typeof d,t.target==="draft-04"||t.target==="openapi-3.0"?s.enum=[d]:s.const=d}else c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),c.every(d=>typeof d=="boolean")&&(s.type="boolean"),c.every(d=>d===null)&&(s.type="null"),s.enum=c},U5=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},$5=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},P5=(e,t,s,a)=>{const r=s,c=e._zod.def,{minimum:d,maximum:f}=e._zod.bag;typeof d=="number"&&(r.minItems=d),typeof f=="number"&&(r.maxItems=f),r.type="array",r.items=qt(c.element,t,{...a,path:[...a.path,"items"]})},I5=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object",r.properties={};const d=c.shape;for(const m in d)r.properties[m]=qt(d[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(d)),p=new Set([...f].filter(m=>{const v=c.shape[m]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));p.size>0&&(r.required=Array.from(p)),c.catchall?._zod.def.type==="never"?r.additionalProperties=!1:c.catchall?c.catchall&&(r.additionalProperties=qt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},B5=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,d=r.options.map((f,p)=>qt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",p]}));c?s.oneOf=d:s.anyOf=d},q5=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.left,t,{...a,path:[...a.path,"allOf",0]}),d=qt(r.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,p=[...f(c)?c.allOf:[c],...f(d)?d.allOf:[d]];s.allOf=p},H5=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const d=c.keyType,p=d._zod.bag?.patterns;if(c.mode==="loose"&&p&&p.size>0){const v=qt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const y of p)r.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=qt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=qt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=d._zod.values;if(m){const v=[...m].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(r.required=v)}},G5=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.innerType,t,a),d=t.seen.get(e);t.target==="openapi-3.0"?(d.ref=r.innerType,s.nullable=!0):s.anyOf=[c,{type:"null"}]},F5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},Z5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.default=JSON.parse(JSON.stringify(r.defaultValue))},K5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,t.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},V5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType;let d;try{d=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=d},Q5=(e,t,s,a)=>{const r=e._zod.def,c=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;qt(c,t,a);const d=t.seen.get(e);d.ref=c},Y5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.readOnly=!0},hw=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},J5=te("ZodISODateTime",(e,t)=>{XT.init(e,t),jt.init(e,t)});function X5(e){return i5(J5,e)}const W5=te("ZodISODate",(e,t)=>{WT.init(e,t),jt.init(e,t)});function eD(e){return a5(W5,e)}const tD=te("ZodISOTime",(e,t)=>{eO.init(e,t),jt.init(e,t)});function nD(e){return r5(tD,e)}const sD=te("ZodISODuration",(e,t)=>{tO.init(e,t),jt.init(e,t)});function iD(e){return o5(sD,e)}const aD=(e,t)=>{Vj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>FA(e,s)},flatten:{value:s=>GA(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,bm,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,bm,2)}},isEmpty:{get(){return e.issues.length===0}}})},Yn=te("ZodError",aD,{Parent:Error}),rD=jp(Yn),oD=wp(Yn),lD=Hu(Yn),cD=Gu(Yn),uD=VA(Yn),dD=QA(Yn),fD=YA(Yn),hD=JA(Yn),mD=XA(Yn),pD=WA(Yn),gD=eT(Yn),yD=tT(Yn),St=te("ZodType",(e,t)=>(bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ku(e,"input"),output:ku(e,"output")}}),e.toJSONSchema=z5(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...s)=>e.clone(Hi(t,{checks:[...t.checks??[],...s.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(s,a)=>Gi(e,s,a),e.brand=()=>e,e.register=((s,a)=>(s.add(e,a),e)),e.parse=(s,a)=>rD(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>lD(e,s,a),e.parseAsync=async(s,a)=>oD(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>cD(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>uD(e,s,a),e.decode=(s,a)=>dD(e,s,a),e.encodeAsync=async(s,a)=>fD(e,s,a),e.decodeAsync=async(s,a)=>hD(e,s,a),e.safeEncode=(s,a)=>mD(e,s,a),e.safeDecode=(s,a)=>pD(e,s,a),e.safeEncodeAsync=async(s,a)=>gD(e,s,a),e.safeDecodeAsync=async(s,a)=>yD(e,s,a),e.refine=(s,a)=>e.check(dL(s,a)),e.superRefine=s=>e.check(fL(s)),e.overwrite=s=>e.check($r(s)),e.optional=()=>Cb(e),e.exactOptional=()=>XD(e),e.nullable=()=>kb(e),e.nullish=()=>Cb(kb(e)),e.nonoptional=s=>iL(e,s),e.array=()=>Qe(e),e.or=s=>GD([e,s]),e.and=s=>ZD(e,s),e.transform=s=>_b(e,YD(s)),e.default=s=>tL(e,s),e.prefault=s=>sL(e,s),e.catch=s=>rL(e,s),e.pipe=s=>_b(e,s),e.readonly=()=>cL(e),e.describe=s=>{const a=e.clone();return Ho.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return Ho.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Ho.get(e);const a=e.clone();return Ho.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),mw=te("_ZodString",(e,t)=>{Np.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,r,c)=>R5(e,a,r);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...a)=>e.check(h5(...a)),e.includes=(...a)=>e.check(g5(...a)),e.startsWith=(...a)=>e.check(y5(...a)),e.endsWith=(...a)=>e.check(v5(...a)),e.min=(...a)=>e.check(Cu(...a)),e.max=(...a)=>e.check(lw(...a)),e.length=(...a)=>e.check(cw(...a)),e.nonempty=(...a)=>e.check(Cu(1,...a)),e.lowercase=a=>e.check(m5(a)),e.uppercase=a=>e.check(p5(a)),e.trim=()=>e.check(b5()),e.normalize=(...a)=>e.check(x5(...a)),e.toLowerCase=()=>e.check(S5()),e.toUpperCase=()=>e.check(j5()),e.slugify=()=>e.check(w5())}),vD=te("ZodString",(e,t)=>{Np.init(e,t),mw.init(e,t),e.email=s=>e.check(UO(xD,s)),e.url=s=>e.check(qO(bD,s)),e.jwt=s=>e.check(s5(LD,s)),e.emoji=s=>e.check(HO(SD,s)),e.guid=s=>e.check(xb(wb,s)),e.uuid=s=>e.check($O(Zc,s)),e.uuidv4=s=>e.check(PO(Zc,s)),e.uuidv6=s=>e.check(IO(Zc,s)),e.uuidv7=s=>e.check(BO(Zc,s)),e.nanoid=s=>e.check(GO(jD,s)),e.guid=s=>e.check(xb(wb,s)),e.cuid=s=>e.check(FO(wD,s)),e.cuid2=s=>e.check(ZO(ND,s)),e.ulid=s=>e.check(KO(CD,s)),e.base64=s=>e.check(e5(TD,s)),e.base64url=s=>e.check(t5(OD,s)),e.xid=s=>e.check(VO(kD,s)),e.ksuid=s=>e.check(QO(_D,s)),e.ipv4=s=>e.check(YO(zD,s)),e.ipv6=s=>e.check(JO(ED,s)),e.cidrv4=s=>e.check(XO(RD,s)),e.cidrv6=s=>e.check(WO(AD,s)),e.e164=s=>e.check(n5(DD,s)),e.datetime=s=>e.check(X5(s)),e.date=s=>e.check(eD(s)),e.time=s=>e.check(nD(s)),e.duration=s=>e.check(iD(s))});function K(e){return MO(vD,e)}const jt=te("ZodStringFormat",(e,t)=>{xt.init(e,t),mw.init(e,t)}),xD=te("ZodEmail",(e,t)=>{HT.init(e,t),jt.init(e,t)}),wb=te("ZodGUID",(e,t)=>{BT.init(e,t),jt.init(e,t)}),Zc=te("ZodUUID",(e,t)=>{qT.init(e,t),jt.init(e,t)}),bD=te("ZodURL",(e,t)=>{GT.init(e,t),jt.init(e,t)}),SD=te("ZodEmoji",(e,t)=>{FT.init(e,t),jt.init(e,t)}),jD=te("ZodNanoID",(e,t)=>{ZT.init(e,t),jt.init(e,t)}),wD=te("ZodCUID",(e,t)=>{KT.init(e,t),jt.init(e,t)}),ND=te("ZodCUID2",(e,t)=>{VT.init(e,t),jt.init(e,t)}),CD=te("ZodULID",(e,t)=>{QT.init(e,t),jt.init(e,t)}),kD=te("ZodXID",(e,t)=>{YT.init(e,t),jt.init(e,t)}),_D=te("ZodKSUID",(e,t)=>{JT.init(e,t),jt.init(e,t)}),zD=te("ZodIPv4",(e,t)=>{nO.init(e,t),jt.init(e,t)}),ED=te("ZodIPv6",(e,t)=>{sO.init(e,t),jt.init(e,t)}),RD=te("ZodCIDRv4",(e,t)=>{iO.init(e,t),jt.init(e,t)}),AD=te("ZodCIDRv6",(e,t)=>{aO.init(e,t),jt.init(e,t)}),TD=te("ZodBase64",(e,t)=>{rO.init(e,t),jt.init(e,t)}),OD=te("ZodBase64URL",(e,t)=>{lO.init(e,t),jt.init(e,t)}),DD=te("ZodE164",(e,t)=>{cO.init(e,t),jt.init(e,t)}),LD=te("ZodJWT",(e,t)=>{dO.init(e,t),jt.init(e,t)}),pw=te("ZodNumber",(e,t)=>{iw.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,r,c)=>A5(e,a,r),e.gt=(a,r)=>e.check(Sb(a,r)),e.gte=(a,r)=>e.check(Gh(a,r)),e.min=(a,r)=>e.check(Gh(a,r)),e.lt=(a,r)=>e.check(bb(a,r)),e.lte=(a,r)=>e.check(Hh(a,r)),e.max=(a,r)=>e.check(Hh(a,r)),e.int=a=>e.check(Nb(a)),e.safe=a=>e.check(Nb(a)),e.positive=a=>e.check(Sb(0,a)),e.nonnegative=a=>e.check(Gh(0,a)),e.negative=a=>e.check(bb(0,a)),e.nonpositive=a=>e.check(Hh(0,a)),e.multipleOf=(a,r)=>e.check(jb(a,r)),e.step=(a,r)=>e.check(jb(a,r)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function Ze(e){return l5(pw,e)}const MD=te("ZodNumberFormat",(e,t)=>{fO.init(e,t),pw.init(e,t)});function Nb(e){return c5(MD,e)}const UD=te("ZodBoolean",(e,t)=>{hO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>T5(e,s,a)});function Pr(e){return u5(UD,e)}const $D=te("ZodUnknown",(e,t)=>{mO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>D5()});function jm(){return d5($D)}const PD=te("ZodNever",(e,t)=>{pO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>O5(e,s,a)});function ID(e){return f5(PD,e)}const BD=te("ZodArray",(e,t)=>{gO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>P5(e,s,a,r),e.element=t.element,e.min=(s,a)=>e.check(Cu(s,a)),e.nonempty=s=>e.check(Cu(1,s)),e.max=(s,a)=>e.check(lw(s,a)),e.length=(s,a)=>e.check(cw(s,a)),e.unwrap=()=>e.element});function Qe(e,t){return N5(BD,e,t)}const qD=te("ZodObject",(e,t)=>{vO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>I5(e,s,a,r),st(e,"shape",()=>t.shape),e.keyof=()=>wn(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:jm()}),e.loose=()=>e.clone({...e._zod.def,catchall:jm()}),e.strict=()=>e.clone({...e._zod.def,catchall:ID()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>PA(e,s),e.safeExtend=s=>IA(e,s),e.merge=s=>BA(e,s),e.pick=s=>UA(e,s),e.omit=s=>$A(e,s),e.partial=(...s)=>qA(gw,e,s[0]),e.required=(...s)=>HA(yw,e,s[0])});function Le(e,t){const s={type:"object",shape:e??{},...we(t)};return new qD(s)}const HD=te("ZodUnion",(e,t)=>{xO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>B5(e,s,a,r),e.options=t.options});function GD(e,t){return new HD({type:"union",options:e,...we(t)})}const FD=te("ZodIntersection",(e,t)=>{bO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>q5(e,s,a,r)});function ZD(e,t){return new FD({type:"intersection",left:e,right:t})}const KD=te("ZodRecord",(e,t)=>{SO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>H5(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function Zu(e,t,s){return new KD({type:"record",keyType:e,valueType:t,...we(s)})}const wm=te("ZodEnum",(e,t)=>{jO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,r,c)=>L5(e,a,r),e.enum=t.entries,e.options=Object.values(t.entries);const s=new Set(Object.keys(t.entries));e.extract=(a,r)=>{const c={};for(const d of a)if(s.has(d))c[d]=t.entries[d];else throw new Error(`Key ${d} not found in enum`);return new wm({...t,checks:[],...we(r),entries:c})},e.exclude=(a,r)=>{const c={...t.entries};for(const d of a)if(s.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new wm({...t,checks:[],...we(r),entries:c})}});function wn(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new wm({type:"enum",entries:s,...we(t)})}const VD=te("ZodLiteral",(e,t)=>{wO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>M5(e,s,a),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 _u(e,t){return new VD({type:"literal",values:Array.isArray(e)?e:[e],...we(t)})}const QD=te("ZodTransform",(e,t)=>{NO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>$5(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new qj(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(il(c,s.value,t));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=s.value),d.inst??(d.inst=e),s.issues.push(il(d))}};const r=t.transform(s.value,s);return r instanceof Promise?r.then(c=>(s.value=c,s)):(s.value=r,s)}});function YD(e){return new QD({type:"transform",transform:e})}const gw=te("ZodOptional",(e,t)=>{ow.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function Cb(e){return new gw({type:"optional",innerType:e})}const JD=te("ZodExactOptional",(e,t)=>{CO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function XD(e){return new JD({type:"optional",innerType:e})}const WD=te("ZodNullable",(e,t)=>{kO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>G5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function kb(e){return new WD({type:"nullable",innerType:e})}const eL=te("ZodDefault",(e,t)=>{_O.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Z5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tL(e,t){return new eL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Zj(t)}})}const nL=te("ZodPrefault",(e,t)=>{zO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>K5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function sL(e,t){return new nL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Zj(t)}})}const yw=te("ZodNonOptional",(e,t)=>{EO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>F5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function iL(e,t){return new yw({type:"nonoptional",innerType:e,...we(t)})}const aL=te("ZodCatch",(e,t)=>{RO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>V5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rL(e,t){return new aL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const oL=te("ZodPipe",(e,t)=>{AO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Q5(e,s,a,r),e.in=t.in,e.out=t.out});function _b(e,t){return new oL({type:"pipe",in:e,out:t})}const lL=te("ZodReadonly",(e,t)=>{TO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Y5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function cL(e){return new lL({type:"readonly",innerType:e})}const uL=te("ZodCustom",(e,t)=>{OO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>U5(e,s)});function dL(e,t={}){return C5(uL,e,t)}function fL(e){return k5(e)}Le({maxConcurrency:Ze().int().positive(),maxRequestsPerMinute:Ze().int().positive(),maxRequestsPerDay:Ze().int().positive()});const Ir=K().min(1);K().min(1);const Cp=Le({label:K().min(1),city:K().min(1),region:K().min(1),country:K().length(2),timezone:K().optional()}),vw=wn(["citation.lost","citation.gained","run.completed","run.failed"]);Le({id:K(),projectId:K(),channel:_u("webhook"),url:K().url(),events:Qe(vw),enabled:Pr().default(!0),webhookSecret:K().optional(),createdAt:K(),updatedAt:K()});const xw=wn(["cli","api","config-file"]);function hL(e){const t=new Set,s=new Set;for(const a of e){if(t.has(a.label)){s.add(a.label);continue}t.add(a.label)}return[...s]}function mL(e,t){return t?e.some(s=>s.label===t):!0}Le({displayName:K().min(1),canonicalDomain:K().min(1),ownedDomains:Qe(K().min(1)).optional(),country:K().length(2),language:K().min(2),tags:Qe(K()).optional(),labels:Zu(K(),K()).optional(),providers:Qe(Ir).optional(),locations:Qe(Cp).optional(),defaultLocation:K().nullable().optional(),configSource:xw.optional()});Le({id:K(),name:K(),displayName:K().optional(),canonicalDomain:K(),ownedDomains:Qe(K()).default([]),country:K().length(2),language:K().min(2),tags:Qe(K()).default([]),labels:Zu(K(),K()).default({}),locations:Qe(Cp).default([]),defaultLocation:K().nullable().optional(),configSource:xw.default("cli"),configRevision:Ze().int().positive().default(1),createdAt:K().optional(),updatedAt:K().optional()});function Nm(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function pL(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,a=[];for(const r of t){const c=r.trim();if(!c)continue;const d=Nm(c);s.has(d)||(s.add(d),a.push(c))}return a}const gL=Le({name:K().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:Zu(K(),K()).optional().default({})}),yL=Le({preset:K().optional(),cron:K().optional(),timezone:K().optional().default("UTC"),providers:Qe(Ir).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),vL=Le({channel:_u("webhook"),url:K().url(),events:Qe(vw).min(1)}),xL=Le({gsc:Le({propertyUrl:K()}).optional(),syncSchedule:Le({preset:K().optional(),cron:K().optional()}).optional()}).optional(),bL=Le({displayName:K().min(1),canonicalDomain:K().min(1),ownedDomains:Qe(K().min(1)).optional().default([]),country:K().length(2),language:K().min(2),keywords:Qe(K().min(1)).optional().default([]),competitors:Qe(K().min(1)).optional().default([]),providers:Qe(Ir).optional().default([]),locations:Qe(Cp).optional().default([]),defaultLocation:K().optional(),schedule:yL,notifications:Qe(vL).optional().default([]),google:xL}).superRefine((e,t)=>{const s=hL(e.locations);s.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${s.join(", ")}`,path:["locations"]}),mL(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Le({apiVersion:_u("canonry/v1"),kind:_u("Project"),metadata:gL,spec:bL});const SL=wn(["gsc","ga4"]);Le({id:K(),domain:K(),connectionType:SL,propertyId:K().nullable().optional(),sitemapUrl:K().nullable().optional(),scopes:Qe(K()).default([]),createdAt:K(),updatedAt:K()});Le({date:K(),query:K(),page:K(),country:K().nullable().optional(),device:K().nullable().optional(),clicks:Ze(),impressions:Ze(),ctr:Ze(),position:Ze()});const Cm=Le({id:K(),url:K(),indexingState:K().nullable().optional(),verdict:K().nullable().optional(),coverageState:K().nullable().optional(),pageFetchState:K().nullable().optional(),robotsTxtState:K().nullable().optional(),crawlTime:K().nullable().optional(),lastCrawlResult:K().nullable().optional(),isMobileFriendly:Pr().nullable().optional(),richResults:Qe(K()).default([]),inspectedAt:K()});wn(["stable","reindexed","deindexed","still-missing","new"]);const jL=Le({url:K(),previousState:K().nullable(),currentState:K().nullable(),transitionDate:K()}),wL=Le({reason:K(),count:Ze(),urls:Qe(Cm).default([])});Le({summary:Le({total:Ze(),indexed:Ze(),notIndexed:Ze(),deindexed:Ze(),percentage:Ze()}),lastInspectedAt:K().nullable(),indexed:Qe(Cm).default([]),notIndexed:Qe(Cm).default([]),deindexed:Qe(jL).default([]),reasonGroups:Qe(wL).default([])});Le({url:K(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:K()});Le({url:K(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:K(),status:wn(["success","error"]),error:K().optional()});Le({date:K(),indexed:Ze(),notIndexed:Ze(),reasonBreakdown:Zu(K(),Ze()).default({})});Le({id:K(),domain:K(),siteUrl:K().nullable().optional(),createdAt:K(),updatedAt:K()});const zb=Le({id:K(),url:K(),httpCode:Ze().nullable().optional(),inIndex:Pr().nullable().optional(),lastCrawledDate:K().nullable().optional(),inIndexDate:K().nullable().optional(),inspectedAt:K()});Le({summary:Le({total:Ze(),indexed:Ze(),notIndexed:Ze(),percentage:Ze()}),lastInspectedAt:K().nullable(),indexed:Qe(zb).default([]),notIndexed:Qe(zb).default([])});Le({query:K(),impressions:Ze(),clicks:Ze(),ctr:Ze(),averagePosition:Ze()});Le({url:K(),status:wn(["success","error"]),submittedAt:K(),error:K().optional()});const NL=wn(["queued","running","completed","partial","failed","cancelled"]),CL=wn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),kL=wn(["manual","scheduled","config-apply"]),_L=wn(["cited","not-cited"]),zL=wn(["new","cited","lost","emerging","not-cited"]);Le({id:K(),projectId:K(),kind:CL,status:NL,trigger:kL.default("manual"),location:K().nullable().optional(),startedAt:K().nullable().optional(),finishedAt:K().nullable().optional(),error:K().nullable().optional(),createdAt:K()});const EL=Le({uri:K(),title:K()});Le({id:K(),runId:K(),keywordId:K(),keyword:K().optional(),provider:Ir,citationState:_L,transition:zL.optional(),answerText:K().nullable().optional(),citedDomains:Qe(K()).default([]),competitorOverlap:Qe(K()).default([]),groundingSources:Qe(EL).default([]),searchQueries:Qe(K()).default([]),model:K().nullable().optional(),location:K().nullable().optional(),createdAt:K()});Le({id:K(),projectId:K().nullable().optional(),actor:K(),action:K(),entityType:K(),entityId:K().nullable().optional(),diff:jm().optional(),createdAt:K()});Le({id:K(),projectId:K(),cronExpr:K(),preset:K().nullable().optional(),timezone:K().default("UTC"),enabled:Pr().default(!0),providers:Qe(Ir).default([]),lastRunAt:K().nullable().optional(),nextRunAt:K().nullable().optional(),createdAt:K(),updatedAt:K()});Le({preset:K().optional(),cron:K().optional(),timezone:K().optional().default("UTC"),enabled:Pr().optional().default(!0),providers:Qe(Ir).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});Le({id:K(),projectId:K(),propertyId:K(),clientEmail:K(),connected:Pr(),createdAt:K(),updatedAt:K()});Le({date:K(),landingPage:K(),sessions:Ze(),organicSessions:Ze(),users:Ze()});Le({totalSessions:Ze(),totalOrganicSessions:Ze(),totalUsers:Ze(),topPages:Qe(Le({landingPage:K(),sessions:Ze(),organicSessions:Ze(),users:Ze()})),lastSyncedAt:K().nullable()});function km({state:e}){return o.jsx(nt,{tone:GE(e),children:$u(e)})}function Eb(e,t){const s=t.filter(d=>d.trim().length>1),a=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(d=>d.startsWith("**")&&d.endsWith("**")?{type:"bold",value:d.slice(2,-2)}:{type:"text",value:d});if(s.length===0)return a.map((d,f)=>d.type==="bold"?is.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},d.value):d.value).filter(Boolean);const r=s.map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${r.join("|")})`,"gi");return a.flatMap((d,f)=>d.value.split(c).map((m,v)=>m?v%2===1?d.type==="bold"?is.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},is.createElement("strong",{className:"text-zinc-200 font-semibold"},m)):is.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},m):d.type==="bold"?is.createElement("strong",{key:`b-${f}-${v}`,className:"text-zinc-200 font-semibold"},m):m:null)).filter(Boolean)}class bw extends Error{code;statusCode;constructor(t,s,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=s}}function RL(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const AL=RL();function TL(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.apiKey?window.__CANONRY_CONFIG__.apiKey:""}async function ye(e,t){const s=TL(),a=await fetch(`${AL}${e}`,{...t,headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{},...t?.headers}});if(!a.ok){const r=await a.text();let c=`API ${a.status}: ${a.statusText}`,d;if(r)try{const f=JSON.parse(r);typeof f.error=="string"?c=f.error:f.error?.message?(c=f.error.message,d=f.error.code):f.message&&(c=f.message)}catch{c=r}throw new bw(c,a.status,d)}if(a.status!==204)return a.json()}function Sw(){return ye("/projects")}function kp(e){return ye(`/projects/${encodeURIComponent(e)}`)}function jw(){return ye("/runs")}function Dr(e){return ye(`/runs/${encodeURIComponent(e)}`)}function ww(e){return ye(`/projects/${encodeURIComponent(e)}/keywords`)}function _p(e){return ye(`/projects/${encodeURIComponent(e)}/competitors`)}function zp(e,t){const s=new URLSearchParams;t!==void 0&&s.set("location",t);const a=s.toString();return ye(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function ll(e,t){return ye(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function Nw(e,t){return ye(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function Cw(e,t){return ye(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function Ep(e,t){return ye(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function _m(e,t){const s=await kp(e);return ll(e,{displayName:s.displayName,canonicalDomain:s.canonicalDomain,ownedDomains:t,country:s.country,language:s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:s.locations,defaultLocation:s.defaultLocation})}async function kw(e,t){const s=await kp(e);return ll(e,{displayName:t.displayName??s.displayName,canonicalDomain:t.canonicalDomain??s.canonicalDomain,ownedDomains:t.ownedDomains??s.ownedDomains,country:t.country??s.country,language:t.language??s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:t.locations??s.locations,defaultLocation:t.defaultLocation!==void 0?t.defaultLocation:s.defaultLocation})}function Rp(e,t){const s={};return ye(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function _w(e,t){return ye(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function zw(e,t){await ye(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function Ew(e,t){return ye(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function Rw(e){await ye(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function Aw(e){return ye(`/projects/${encodeURIComponent(e)}/export`)}function Ku(){return ye("/settings")}function Tw(e,t){return ye(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function Ow(e){return ye("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function Dw(e){try{return await ye(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function zm(e,t){return ye(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function Lw(e){await ye(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function Mw(e){return ye(`/projects/${encodeURIComponent(e)}/notifications`)}function Uw(e,t){return ye(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function $w(e,t){await ye(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Pw(e,t){return ye(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function Iw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function Bw(e){return ye("/apply",{method:"POST",body:JSON.stringify(e)})}function OL(e){return ye("/runs",{method:"POST",body:JSON.stringify(e??{})})}function Ap(e){return ye(`/projects/${encodeURIComponent(e)}/google/connections`)}function qw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function Hw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Gw(e){return ye(`/projects/${encodeURIComponent(e)}/google/properties`)}function Fw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function Zw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function Tp(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function Kw(e,t){const s=new URLSearchParams;t?.startDate&&s.set("startDate",t.startDate),t?.endDate&&s.set("endDate",t.endDate),t?.query&&s.set("query",t.query),t?.page&&s.set("page",t.page),t?.limit!==void 0&&s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/performance${a}`)}function Vw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function Qw(e,t){const s=new URLSearchParams;t?.url&&s.set("url",t.url),s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${a}`)}function Yw(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Op(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function Jw(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function Xw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function Ww(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function eN(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function Em(){return ye("/cdp/status")}function tN(e,t){return ye("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function Rm(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function Dp(e){return ye(`/projects/${encodeURIComponent(e)}/bing/status`)}function nN(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function sN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function iN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/sites`)}function aN(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Lp(e){return ye(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function Mp(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function Up(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function Am(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function rN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/performance`)}function oN(e){return ye("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function lN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function cN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function uN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/sources${s}`)}function Tm(e){return ye(`/projects/${encodeURIComponent(e)}/ga/status`)}function Om(e,t){return ye(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function dN(e,t){return ye(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function fN(e){return ye(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}async function hN(e,t){try{const s=await fetch(e);if(!s.ok)return{label:t,state:"error",detail:`HTTP ${s.status}`};const a=await s.json(),r=typeof a.version=="string"?a.version:"unknown",c=typeof a.databaseUrlConfigured=="boolean"?a.databaseUrlConfigured:void 0,d=typeof a.lastHeartbeatAt=="string"?a.lastHeartbeatAt:void 0,f=[r,c===!1?"database not configured":"database configured",d?`heartbeat ${d}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:r,databaseConfigured:c,lastHeartbeatAt:d}}catch(s){return{label:t,state:"error",detail:s instanceof Error?s.message:"unreachable"}}}const DL=Object.freeze(Object.defineProperty({__proto__:null,ApiError:bw,addLocation:_w,addNotification:Uw,appendKeywords:Cw,applyProjectConfig:Bw,bingConnect:nN,bingDisconnect:sN,bingRequestIndexing:Am,bingSetSite:aN,configureCdp:tN,createProject:ll,deleteProject:Rw,disconnectGa:fN,fetchAllRuns:jw,fetchAnalyticsGaps:cN,fetchAnalyticsMetrics:lN,fetchAnalyticsSources:uN,fetchBingCoverage:Lp,fetchBingInspections:Mp,fetchBingPerformance:rN,fetchBingSites:iN,fetchBingStatus:Dp,fetchCdpStatus:Em,fetchCompetitors:_p,fetchExport:Aw,fetchGaStatus:Tm,fetchGaTraffic:Om,fetchGoogleConnections:Ap,fetchGoogleProperties:Gw,fetchGscCoverage:Op,fetchGscCoverageHistory:Jw,fetchGscDeindexed:Yw,fetchGscInspections:Qw,fetchGscPerformance:Kw,fetchGscSitemaps:Ww,fetchKeywords:ww,fetchProject:kp,fetchProjects:Sw,fetchRunDetail:Dr,fetchSchedule:Dw,fetchServiceStatus:hN,fetchSettings:Ku,fetchTimeline:zp,generateKeywords:Iw,googleConnect:qw,googleDisconnect:Hw,inspectBingUrl:Up,inspectGscUrl:Vw,listNotifications:Mw,removeLocation:zw,removeNotification:$w,removeSchedule:Lw,requestIndexing:Rm,saveGoogleProperty:Fw,saveSchedule:zm,saveSitemapUrl:Zw,sendTestNotification:Pw,setCompetitors:Ep,setDefaultLocation:Ew,setKeywords:Nw,triggerAllRuns:OL,triggerDiscoverSitemaps:eN,triggerGaSync:dN,triggerGscSync:Tp,triggerInspectSitemap:Xw,triggerRun:Rp,updateBingApiKey:oN,updateGoogleAuthConfig:Ow,updateOwnedDomains:_m,updateProject:kw,updateProviderConfig:Tw},Symbol.toStringTag,{value:"Module"}));function LL({evidence:e,project:t,onClose:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(-1),[f,p]=N.useState(null),[m,v]=N.useState(!1),[y,x]=N.useState({}),b=pL(t.project),w=new Set(b.map(Nm)),S=e.runHistory,C=S.length>1,k=c>=0&&f!==null,E=k?f:{citationState:e.citationState,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.changeLabel,summary:e.summary},R=E.citationState==="cited"||E.citationState==="emerging",L=E.citedDomains.findIndex(G=>w.has(G.toLowerCase().replace(/^www\./,"")))+1,M=E.citedDomains.length,A=t.project.displayName||t.project.name,T=[...b.map(Nm),A,A.split(" ").slice(0,2).join(" ")].filter(G=>G.trim().length>2),P=R?"cited":E.citationState==="lost"?"lost":E.citationState==="pending"?"pending":"not-cited",J=N.useRef(0),Q=N.useCallback(async G=>{const oe=++J.current;if(G===-1||G===S.length-1){d(-1),p(null),r(!1);return}d(G),r(!1);const q=S[G],X=`${q.runId}::${e.keyword}::${e.provider}`;if(y[X]){p(y[X]);return}v(!0);try{const O=await Dr(q.runId);if(oe!==J.current)return;const Z=O.snapshots.find(re=>re.keyword===e.keyword&&re.provider===e.provider)??O.snapshots.find(re=>re.keyword===e.keyword),ie=Z?{citationState:Z.citationState,provider:Z.provider,model:Z.model??null,answerSnippet:Z.answerText??"",citedDomains:Z.citedDomains,competitorDomains:Z.competitorOverlap,groundingSources:Z.groundingSources,evidenceUrls:[],changeLabel:q.citationState,summary:""}:{citationState:q.citationState,provider:e.provider,model:q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:q.citationState,summary:"Snapshot data not available for this run."};x(re=>({...re,[X]:ie})),p(ie)}catch{if(oe!==J.current)return;p({citationState:q.citationState,provider:e.provider,model:q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:q.citationState,summary:"Failed to load historical run data."})}finally{oe===J.current&&v(!1)}},[S,e.keyword,e.provider,y]),pe=(k||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,ke=!k&&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(" · "):"",je=R&&L>0?{label:"Citation confirmed",title:`Cited #${L} of ${M} domain${M!==1?"s":""}`,meta:pe}:R?{label:"Citation confirmed",title:"Cited in this answer",meta:pe}:E.citationState==="lost"?{label:"Citation lost",title:M>0?`${M} domain${M!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:pe}:E.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:M>0?`${M} domain${M!==1?"s":""} cited instead`:"No domains cited for this query",meta:pe},B=()=>{if(!E.answerSnippet)return null;const G=E.answerSnippet.split(`
95
+ `),oe=[];let q=[],X=0;const O=()=>{if(q.length===0)return;const Z=q.join(" ").trim();Z&&oe.push(o.jsx("p",{className:oe.length>0?"mt-2.5":"",children:Eb(Z,T)},X++)),q=[]};for(const Z of G){const ie=Z.trim();if(/^[-\u2013\u2014]{3,}$/.test(ie)){O(),oe.push(o.jsx("hr",{className:"border-zinc-800/60 my-3"},X++));continue}const re=ie.match(/^(#{1,3})\s+(.+)$/);if(re){O();const ue=re[1].length,he=re[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||re[2],de=ue===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":ue===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";oe.push(o.jsx("p",{className:de,children:Eb(he,T)},X++));continue}if(ie===""){O();continue}q.push(ie)}return O(),oe};return o.jsx(Dj,{open:!0,onOpenChange:G=>{G||s()},children:o.jsxs(Lj,{children:[o.jsx(pp,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),o.jsxs(gp,{className:"evidence-modal","aria-describedby":void 0,children:[o.jsxs("div",{className:"evidence-modal-header",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," \\u00b7 ",E.provider||"All providers"]}),o.jsx(yp,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),o.jsxs(Uj,{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:[o.jsx(Uu,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]}),C&&o.jsxs("div",{className:"evidence-modal-timeline",children:[o.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),o.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:S.map((G,oe)=>{const q=c===-1&&oe===S.length-1||c===oe,X=G.citationState==="cited"?"bg-emerald-400":G.citationState==="emerging"?"bg-amber-400":G.citationState==="lost"?"bg-rose-400":"bg-zinc-600",Z=new Date(G.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),ie=!!(G.model&&oe>0&&S[oe-1]?.model&&S[oe-1].model!==G.model);return o.jsxs("button",{type:"button",className:`evidence-run-dot ${q?"evidence-run-dot--selected":""}`,onClick:()=>Q(oe===S.length-1?-1:oe),"aria-label":[`Run ${Z}: ${G.citationState}`,G.model?`model ${G.model}`:null,ie?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":q,children:[o.jsx("span",{className:`size-2 rounded-full ${X} ${ie?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),o.jsx("span",{className:"text-[10px] text-zinc-500",children:Z})]},oe)})}),c>=0&&c<S.length&&o.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(S[c].createdAt).toLocaleString()," \\u2014 ",o.jsx("span",{className:"capitalize",children:S[c].citationState}),o.jsx("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>Q(-1),children:"\\u2190 Back to latest"})]}),!k&&(e.modelTransitions?.length??0)>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(G=>o.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"}`))})]}),o.jsxs("div",{className:"evidence-modal-body",children:[m&&o.jsx("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:"Loading historical run data\\u2026"}),!m&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"evidence-modal-main",children:[o.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${P}`,children:[o.jsx("p",{className:`evidence-position-label evidence-position-label--${P}`,children:je.label}),o.jsx("p",{className:`evidence-position-title evidence-position-title--${P}`,children:je.title}),o.jsx("p",{className:"evidence-position-meta",children:je.meta}),ke&&o.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:ke})]}),E.answerSnippet&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),o.jsx("div",{className:`answer-snippet-block ${a?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:B()}),E.answerSnippet.length>280&&o.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>r(!a),children:a?"↑ Collapse":"↓ Show full answer"})]}),!E.answerSnippet&&!m&&o.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"}),!k&&e.relatedTechnicalSignals.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:R?"Why you're cited":"What to fix"}),o.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((G,oe)=>o.jsxs("div",{className:"action-item",children:[o.jsx("svg",{className:`action-item-icon ${R?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:R?o.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):o.jsxs(o.Fragment,{children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),o.jsx("span",{className:"action-item-text",children:G})]},oe))})]}),E.summary&&o.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),o.jsxs("div",{className:"evidence-modal-sidebar",children:[E.citedDomains.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"Who was cited \\u2014 in order"}),o.jsxs("div",{className:"citation-leaderboard",children:[E.citedDomains.map((G,oe)=>{const q=G.toLowerCase().replace(/^www\./,""),X=w.has(q),O=!X&&E.competitorDomains.some(ie=>ie.toLowerCase().replace(/^www\./,"")===q),Z=X?"you":O?"competitor":"other";return o.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${Z}`,children:[o.jsxs("span",{className:"citation-leaderboard-rank",children:["#",oe+1]}),o.jsx("span",{className:"citation-leaderboard-domain",children:G}),X&&o.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),O&&o.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},G)}),!R&&o.jsxs("div",{className:"citation-leaderboard-item citation-leaderboard-item--not-cited border-dashed",children:[o.jsx("span",{className:"citation-leaderboard-rank text-zinc-600",children:"\\u2014"}),o.jsx("span",{className:"citation-leaderboard-domain text-zinc-600",children:t.project.canonicalDomain}),o.jsx("span",{className:"citation-leaderboard-tag text-zinc-600",children:"Not cited"})]})]})]}),E.groundingSources.length>0&&o.jsxs("div",{children:[o.jsxs("p",{className:"drawer-section-label",children:["Grounding sources (",E.groundingSources.length,")"]}),o.jsx("ul",{className:"grid gap-0.5",children:E.groundingSources.map((G,oe)=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:G.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G.title||G.uri})},oe))})]}),E.evidenceUrls.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),o.jsx("ul",{className:"grid gap-1",children:E.evidenceUrls.map(G=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:G,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G})},G))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.evidenceUrls.length===0&&o.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No citation data ",k?"for this run":"yet"]})]})]})]})]})]})})}function ss(e){const t=new Date("2026-02-20");return e.map((s,a)=>({runId:`run_mock_${a+1}`,citationState:s,createdAt:new Date(t.getTime()+a*2*24*60*60*1e3).toISOString()}))}const Fh=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],country:"US",language:"en",tags:["lead gen"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1}];function Vu(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 ML=Vu({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"}),UL=Vu({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"}),$L=Vu({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"}),PL=Vu({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"}),IL=[{id:"evidence_citypoint_emergency_gemini",keyword:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:ss(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",keyword:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:ss(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",keyword:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",keyword:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",keyword:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:ss(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",keyword:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",keyword:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",keyword:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",keyword:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Fh[0],Fh[1],ss(["cited","cited","cited","cited","cited"]),Fh[2],ss(["not-cited","not-cited","not-cited","cited"]);function BL(e,t){return e.projects.find(s=>s.project.id===t)}function qL(e,t){return e.runs.find(s=>s.id===t)}function HL(e,t){for(const s of e.projects){const a=s.visibilityEvidence.find(r=>r.id===t);if(a)return{project:s,evidence:a}}}function mN(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,locations:e.locations??[],defaultLocation:e.defaultLocation??null,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Rb(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function GL(e,t){if(!e)return"Waiting";if(!t)return"Running";const s=new Date(t).getTime()-new Date(e).getTime();if(s<1e3)return"<1s";const a=Math.floor(s/1e3);if(a<60)return`${a}s`;const r=Math.floor(a/60),c=a%60;return`${r}m ${c}s`}function pN(e){return e==="answer-visibility"?"Answer visibility sweep":e}function FL(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function $p(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:pN(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Rb(e.startedAt):Rb(e.createdAt),duration:GL(e.startedAt,e.finishedAt),statusDetail:e.error?gN(e.error):ZL(e),summary:KL(e),triggerLabel:FL(e.trigger)}}function gN(e){try{const s=JSON.parse(e);if(typeof s=="object"&&s!==null){const a=s.message??s.error?.message??s[0]?.error?.message;if(typeof a=="string"&&a.length>0)return a.length>200?a.slice(0,200)+"…":a}}catch{}const t=e.match(/\[.*?\]\s*(.+)/);if(t){const s=t[1];return s.length>200?s.slice(0,200)+"…":s}return e.length>200?e.slice(0,200)+"…":e}function ZL(e){switch(e.status){case"queued":return"Waiting for execution slot.";case"running":return"Provider queries in progress.";case"completed":return"All key phrases checked.";case"partial":return"Run completed with some key phrases skipped.";case"failed":return e.error?gN(e.error):"Run failed.";default:return""}}function KL(e){switch(e.status){case"queued":return"Queued for execution";case"running":return"In progress";case"completed":return"Visibility sweep completed";case"partial":return"Partial completion";case"failed":return"Run failed";default:return e.status}}function yN(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const c of e){const d=c.keyword??c.id;t.has(d)||t.set(d,!1),c.citationState==="cited"&&t.set(d,!0)}const s=t.size,a=[...t.values()].filter(Boolean).length;return{score:s>0?Math.round(a/s*100):0,citedCount:a,totalCount:s}}function VL(e){return e>=70?"positive":e>=40?"caution":"negative"}function QL(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function vN(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const s=new Set(t);let a=0;for(const c of e)c.competitorOverlap.some(d=>s.has(d))&&a++;const r=a/e.length;return r>=.5?{label:"High",count:a}:r>=.2?{label:"Moderate",count:a}:{label:"Low",count:a}}function YL(e,t,s,a){const r=[];let c=0;const d=new Set;if(s){const f=new Map;for(const m of s.snapshots)if(m.keyword){const v=`${m.keyword}::${m.provider}`;f.set(v,m)}const p=[...new Set(s.snapshots.map(m=>m.provider))].sort();p.length===0&&p.push("gemini");for(const m of t){if(m.runs.length===0)continue;d.add(m.keyword);const y=m.runs.at(-1)?.transition??"not-cited",x=y==="lost"?"lost":y==="emerging"?"emerging":y==="cited"?"cited":"not-cited";for(const b of p){const w=f.get(`${m.keyword}::${b}`);if(!w&&p.length>1)continue;const S=w?.model??null,C=S?`${b}:${S}`:null,k=C?m.modelRuns?.[C]:void 0,E=m.providerRuns?.[b],R=(E?.length?E:null)??(k?.length?k:null),z=E?.length?"provider":k?.length?"model":"keyword",L=R?R.at(-1).transition:y,M=L==="lost"?"lost":L==="emerging"?"emerging":w?w.citationState==="cited"?"cited":"not-cited":x,A=Dm(R||m.runs),T=JL(m,b),P=(R??m.runs).map(pe=>({runId:pe.runId,citationState:pe.citationState,createdAt:pe.createdAt,model:T.get(pe.runId)??null})),J=XL(P),Q=z==="provider"&&J.length<=1?"model":z,se=WL(P);r.push({id:`evidence_${e}_${c++}`,keyword:m.keyword,provider:w?.provider??b,model:w?.model??null,location:w?.location??null,citationState:M,changeLabel:eM(L,A),answerSnippet:w?.answerText??"",citedDomains:w?.citedDomains??[],evidenceUrls:[],competitorDomains:w?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:w?.groundingSources??[],summary:tM(M,m.keyword),runHistory:P,historyScope:Q,modelsSeen:J,modelTransitions:se})}}}for(const f of a)d.has(f.keyword)||r.push({id:`evidence_${e}_${c++}`,keyword:f.keyword,provider:"",model:null,location:null,citationState:"pending",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${f.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return r}function JL(e,t){const s=new Map,a=`${t}:`;for(const[r,c]of Object.entries(e.modelRuns??{})){if(!r.startsWith(a))continue;const d=r.slice(a.length),f=d==="unknown"?null:d;for(const p of c)s.set(p.runId,f)}return s}function XL(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function WL(e){const t=[];let s=null;for(const a of e){const r=a.model??null;r!==s&&s!==null&&t.push({runId:a.runId,createdAt:a.createdAt,fromModel:s,toModel:r}),s=r}return t}function Dm(e){if(e.length===0)return 0;const t=e[e.length-1].citationState;let s=0;for(let a=e.length-1;a>=0&&e[a].citationState===t;a--)s++;return s}function eM(e,t){switch(e){case"new":return"First observation";case"cited":return t<=1?"Cited in latest run":`Cited for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return"First citation";case"not-cited":return t<=1?"Not cited in latest run":`Not cited across ${t} runs`;default:return e}}function tM(e,t){switch(e){case"cited":return`Your domain is cited in AI answers for "${t}".`;case"lost":return`Citation was lost for "${t}". Competitors may have gained ground.`;case"emerging":return`Your domain is starting to appear in answers for "${t}".`;case"not-cited":return`No citation detected for "${t}".`;case"pending":return`"${t}" has been added but no visibility run has been triggered yet.`}}function Ab(e,t){const s=new Set(t),a=new Map;for(const r of e)if(r.keyword)for(const c of r.competitorOverlap){if(!s.has(c))continue;const d=a.get(c)??new Set;d.add(r.keyword),a.set(c,d)}return a}const Zh=3;function nM(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:r,trackedCompetitors:c}=e,d=[],f=[],p=new Set;for(const k of t)k.citationState==="lost"&&(p.has(k.keyword)||(p.add(k.keyword),f.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"lost"})));f.length>0&&d.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${f.length} keyword${f.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:f});const m=Ab(a,c),v=Ab(r,c);for(const k of c){const E=m.get(k)??new Set,R=v.get(k)??new Set,z=[...E].filter(L=>!R.has(L));z.length>0&&d.push({id:`insight_comp_gained_${k}`,tone:"negative",title:`${k} appeared on ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:z.map(L=>{const M=t.find(A=>A.keyword===L);return{keyword:L,evidenceId:M?.id??"",citationState:"cited"}})})}const y=new Map;for(const k of s){const E=k.runs.at(-1);E&&y.set(k.keyword,{transition:E.transition,citationState:E.citationState})}const x=[],b=[],w=new Set;for(const[k,{transition:E,citationState:R}]of y){if(!(E==="emerging"||E==="new"&&R==="cited"))continue;w.add(k);const L=t.find(M=>M.keyword===k&&(M.citationState==="emerging"||M.citationState==="cited"));x.push({keyword:k,evidenceId:L?.id??"",provider:L?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(w.has(k.keyword)||b.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"emerging"}));if(b.length>0){const k=new Set(b.map(E=>E.keyword)).size;d.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${k} keyword${k>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:b})}x.length>0&&d.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${w.size} keyword${w.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:x});const S=new Set(t.map(k=>k.keyword)),C=[];for(const k of s){if(!S.has(k.keyword)||k.runs.length<Zh||k.runs.at(-1)?.citationState!=="not-cited")continue;if(Dm(k.runs)>=Zh){const z=t.find(L=>L.keyword===k.keyword);C.push({keyword:k.keyword,evidenceId:z?.id??"",citationState:"not-cited"})}}C.length>0&&d.push({id:"insight_persistent_gap",tone:"caution",title:`${C.length} keyword${C.length>1?"s":""} uncited for ${Zh}+ runs`,detail:"These keywords have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:C});for(const k of c){const E=m.get(k)??new Set,z=[...v.get(k)??new Set].filter(L=>!E.has(L));z.length>0&&d.push({id:`insight_comp_lost_${k}`,tone:"neutral",title:`${k} dropped from ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:z.map(L=>{const M=t.find(A=>A.keyword===L);return{keyword:L,evidenceId:M?.id??"",citationState:"not-cited"}})})}return d.length===0&&d.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),d}function sM(e,t){if(t.length===0){const p=new Set(e.filter(m=>m.citationState==="cited").map(m=>m.keyword)).size;return{gained:p,lost:0,tone:p>0?"positive":"neutral",hasPreviousRun:!1}}const s=p=>{const m=new Set;for(const v of p)v.citationState==="cited"&&v.keyword&&m.add(v.keyword);return m},a=s(e),r=s(t);let c=0,d=0;for(const p of a)r.has(p)||c++;for(const p of r)a.has(p)||d++;const f=d>c?"negative":c>d?"positive":"neutral";return{gained:c,lost:d,tone:f,hasPreviousRun:!0}}function iM(e){const t=e[0];if(!t)return{label:"Run Status",value:"None",delta:"No runs yet",tone:"neutral",description:"Trigger a visibility sweep to start tracking.",tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]};const s=t.status==="completed"?"Healthy":t.status==="running"?"Running":t.status==="queued"?"Queued":t.status==="partial"?"Partial":"Failed",a=t.status==="completed"?"positive":t.status==="failed"?"negative":t.status==="partial"?"caution":"neutral";return{label:"Run Status",value:s,delta:`${e.length} total runs`,tone:a,description:`Latest: ${pN(t.kind)} — ${t.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function aM(e){const t=mN(e.project),s=YL(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],r=yN(a),c=vN(a,e.competitors.map(y=>y.domain)),d=nM({evidence:s,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(y=>y.domain)}),f=[...e.runs].sort((y,x)=>x.createdAt.localeCompare(y.createdAt)),p=f.map(y=>$p(y,e.project.displayName||e.project.name)),m=new Map;for(const y of a){const x=y.provider||"gemini",b=y.model??null,w=`${x}::${b??"unknown"}`,S=m.get(w)??{provider:x,model:b,cited:0,total:0};S.total++,y.citationState==="cited"&&S.cited++,m.set(w,S)}const v=[...m.values()].sort((y,x)=>y.provider.localeCompare(x.provider)||(y.model??"").localeCompare(x.model??"")).map(({provider:y,model:x,cited:b,total:w})=>({provider:y,model:x,score:w>0?Math.round(b/w*100):0,cited:b,total:w}));return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:a.length>0?`${r.score}`:"No data",delta:a.length>0?`${r.citedCount} of ${r.totalCount} key phrases visible`:"Run a sweep first",tone:a.length>0?VL(r.score):"neutral",description:a.length>0?`${r.citedCount} of ${r.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[]},keywordCounts:{cited:r.citedCount,total:r.totalCount},providerScores:v,competitorPressure:{label:"Competitor Pressure",value:c.label,delta:c.count>0?`${c.count} overlapping citations`:"No overlap detected",tone:QL(c.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:iM(f),movementSummary:sM(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:d,visibilityEvidence:s,competitors:e.competitors.map((y,x)=>{const b=new Set;for(const E of a)(E.competitorOverlap.includes(y.domain)||E.citedDomains.includes(y.domain))&&E.keyword&&b.add(E.keyword);const w=[...b],S=new Set(a.map(E=>E.keyword).filter(Boolean)),C=S.size>0?w.length/S.size:0,k=C>=.5?"High":C>=.2?"Moderate":w.length>0?"Low":"None";return{id:y.id||`comp_${x}`,domain:y.domain,citationCount:w.length,totalKeywords:S.size,pressureLabel:k,citedKeywords:w,movement:"",notes:""}}),recentRuns:p.slice(0,5)}}function rM(e){const t=mN(e.project),s=e.latestRunDetail?.snapshots??[],a=yN(s),r=vN(s,e.competitors.map(p=>p.domain)),d=[...e.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt))[0],f=d?$p(d,e.project.displayName||e.project.name):{id:"none",projectId:e.project.id,projectName:e.project.displayName||e.project.name,kind:"answer-visibility",kindLabel:"No runs yet",status:"queued",trigger:"manual",createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""};return{project:t,visibilityScore:a.score,visibilityDelta:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases`:"No data",lastRun:f,insight:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible across ${new Set(s.map(p=>p.provider)).size} provider${new Set(s.map(p=>p.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:r.label}}function oM(e,t){const s=[],a=[],r=[];for(const d of e){a.push(aM(d)),r.push(rM(d));const f=[...d.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt));for(const p of f)s.push($p(p,d.project.displayName||d.project.name))}s.sort((d,f)=>f.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:r,attentionItems:c?lM(a):[{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:s.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"}),...c?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:a,runs:s,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:c,ctaLabel:c?"Trigger run":"Create a project first",summary:c?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(d=>({name:d.name,displayName:d.displayName,keyUrl:d.keyUrl,modelHint:d.modelHint,model:d.model,state:d.configured?"ready":"needs-config",detail:d.configured?"Provider is configured.":"API key is missing.",quota:d.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 lM(e){const t=[];for(const s of e){const a=s.visibilityEvidence.filter(c=>c.citationState==="lost");a.length>0&&t.push({id:`attention_${s.project.id}_lost`,tone:"negative",title:`${s.project.displayName||s.project.name} lost citations`,detail:`${a.length} key phrase${a.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${s.project.id}`});const r=s.recentRuns.filter(c=>c.status==="running"||c.status==="queued");r.length>0&&t.push({id:`attention_${s.project.id}_active`,tone:"neutral",title:`${s.project.displayName||s.project.name} has active runs`,detail:`${r.length} run${r.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return t.length===0&&t.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),t}const Ti={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"]},xN=N.createContext(null);xN.Provider;function cl(){return N.useContext(xN)}function Ra(e){const s=cl()?.dashboard??null,a=Fo({queryKey:Ti.projects.all,queryFn:Sw,enabled:!s}),r=Fo({queryKey:Ti.runs.all,queryFn:jw,enabled:!s,refetchInterval:w=>w.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),c=Fo({queryKey:Ti.settings,queryFn:()=>Ku().catch(()=>null),enabled:!s}),d=a.data??[],f=r.data??[],p=Wk({queries:d.map(w=>{const S=f.filter(k=>k.projectId===w.id),C=S.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,E)=>E.createdAt.localeCompare(k.createdAt));return{queryKey:Ti.projects.detail(w.id,C[0]?.id),queryFn:async()=>{const[k,E,R,z,L]=await Promise.all([ww(w.name).catch(()=>[]),_p(w.name).catch(()=>[]),zp(w.name).catch(()=>[]),C[0]?Dr(C[0].id).catch(()=>null):Promise.resolve(null),C[1]?Dr(C[1].id).catch(()=>null):Promise.resolve(null)]);return{project:w,runs:S,keywords:k,competitors:E,timeline:R,latestRunDetail:z,previousRunDetail:L}},enabled:!s&&a.isSuccess&&r.isSuccess}})}),m=p.every(w=>w.isSuccess),v=N.useMemo(()=>{if(s)return s;if(!a.data||!r.data||d.length>0&&!m)return null;const w=p.map(S=>S.data).filter(S=>S!=null);return oM(w,c.data??null)},[s,a.data,r.data,c.data,m,p,d.length]),y=!s&&(a.isError||r.isError),x=!s&&!v&&!y,b=N.useCallback(async()=>{await Promise.all([a.refetch(),r.refetch(),c.refetch()])},[a.refetch,r.refetch,c.refetch]);return{dashboard:v,isLoading:x,isError:y,refetch:b}}function cM(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Tb=cM(),Lm=Tb==="/"?"":Tb.replace(/\/$/,"");async function uM(){const e=Lm?`${Lm}/health`:"/health",t=await hN(e,"API"),s=t.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:t.state,detail:"Depends on API"};return{apiStatus:t,workerStatus:s}}function Qu(e,t){return Fo({queryKey:Ti.health,queryFn:uM,enabled:e,refetchInterval:15e3,initialData:t})}function dM(e){return Fo({queryKey:Ti.runs.detail(e??""),queryFn:()=>Dr(e),enabled:!!e,refetchInterval:t=>{const s=t.state.data?.status;return s==="running"||s==="queued"?3e3:!1}})}function ul(){const e=ka(),t=Lu({strict:!1}),s=jn({select:p=>p.location.pathname}),a=t.runId??null,r=t.evidenceId??null;return{runId:a,evidenceId:r,openRun:p=>e({to:s,from:as.to,search:m=>({...m,runId:p,evidenceId:void 0})}),openEvidence:p=>e({to:s,from:as.to,search:m=>({...m,evidenceId:p,runId:void 0})}),closeDrawer:()=>e({to:s,from:as.to,search:p=>({...p,runId:void 0,evidenceId:void 0})})}}const Ob=[{label:"Architecture",href:"https://github.com/AINYC/canonry/blob/main/docs/architecture.md"},{label:"Testing Guide",href:"https://github.com/AINYC/canonry/blob/main/docs/testing.md"}],Db=e=>({label:e,state:"checking",detail:"Checking service health"}),fM={apiStatus:Db("API"),workerStatus:Db("Worker")};function hM(){const e=cl(),{dashboard:t,isLoading:s,refetch:a}=Ra(),d=Qu(!e,e?.health).data??e?.health??fM,f=n2(),{runId:p,evidenceId:m,closeDrawer:v}=ul(),[y,x]=N.useState(!1),b=dM(p),w=b.data??null,S=b.isLoading;N.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&a()},[w?.status,a]),N.useEffect(()=>{x(!1)},[f.pathname]),N.useEffect(()=>{if(typeof window>"u"||!p&&!m)return;const z=L=>{L.key==="Escape"&&v()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[p,m,v]);const C=t??e?.dashboard??null,k=p&&C?qL(C,p):void 0,E=m&&C?HL(C,m):void 0,R=(()=>{const z=f.pathname;if(z==="/")return"Portfolio";if(z==="/projects")return"Projects";if(z==="/runs")return"Runs";if(z==="/settings")return"Settings";if(z==="/setup")return"Setup";if(z.startsWith("/projects/")){const M=z.split("/").filter(Boolean)[1];if(M&&C){const A=C.projects.find(T=>T.project.id===M);if(A)return A.project.name}return"Project"}return"Not found"})();return o.jsxs("div",{className:"app-shell",children:[o.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),o.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[o.jsx("div",{className:"sidebar-brand",children:o.jsx(Vx,{})}),o.jsxs("nav",{className:"sidebar-nav",children:[o.jsxs(yt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(b2,{className:"sidebar-icon"}),o.jsx("span",{children:"Overview"})]}),o.jsxs(yt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[o.jsx(v2,{className:"sidebar-icon"}),o.jsx("span",{children:"Projects"})]}),o.jsxs(yt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(N2,{className:"sidebar-icon"}),o.jsx("span",{children:"Runs"})]}),o.jsxs(yt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(T2,{className:"sidebar-icon"}),o.jsx("span",{children:"Settings"})]}),s?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(z=>o.jsxs("div",{className:"sidebar-skeleton-item",children:[o.jsx("span",{className:"skeleton-circle size-2"}),o.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+z*15}%`}})]},z))]}):C&&C.projects.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Projects"}),C.projects.map(z=>{const L=z.visibilitySummary.tone;return o.jsxs(yt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[o.jsx("span",{className:`sidebar-dot sidebar-dot-${L}`}),o.jsx("span",{children:z.project.name})]},z.project.id)})]}):s?null:o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Resources"}),o.jsxs(yt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(z2,{className:"sidebar-icon"}),o.jsx("span",{children:"Setup"})]})]})]}),o.jsx("div",{className:"sidebar-footer",children:Ob.map(z=>o.jsx("a",{className:"sidebar-footer-link",href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]}),o.jsxs("div",{className:"main-area",children:[o.jsxs("header",{className:"topbar",children:[o.jsxs("div",{className:"topbar-left",children:[o.jsx("div",{className:"topbar-brand-mobile",children:o.jsx(Vx,{compact:!0})}),o.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[o.jsx(yt,{to:"/",children:"Home"}),o.jsx(Mu,{className:"breadcrumb-sep size-3"}),o.jsx("span",{className:"breadcrumb-current",children:R})]})]}),o.jsxs("div",{className:"topbar-actions",children:[o.jsxs("div",{className:"health-pill-row",children:[o.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),o.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),o.jsxs(ce,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>x(z=>!z),children:[o.jsx(j2,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),o.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${y?"mobile-nav-open":""}`,children:[o.jsxs(ce,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>x(!1),children:[o.jsx(Uu,{className:"size-5"}),o.jsx("span",{className:"sr-only",children:"Close navigation"})]}),o.jsx(yt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),o.jsx(yt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),o.jsx(yt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),o.jsx(yt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),C&&C.projects.length>0?o.jsxs("div",{className:"mobile-nav-section",children:[o.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),C.projects.map(z=>o.jsx(yt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"mobile-nav-link",children:z.project.name},z.project.id))]}):null]}),o.jsx("main",{id:"content",className:"page-shell",children:s&&!e?o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-40"}),o.jsx("div",{className:"skeleton-text-sm w-72"})]}),o.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(z=>o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton-text w-full"}),o.jsx("div",{className:"skeleton-text-sm w-3/4"})]},z))}),o.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(z=>o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-20"}),o.jsx("div",{className:"space-y-2",children:[1,2,3].map(L=>o.jsx("div",{className:"skeleton-text-sm w-full"},L))})]},z))})]}):o.jsx(lp,{})}),o.jsxs("footer",{className:"footer",children:[o.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noreferrer",className:"footer-brand",children:[o.jsx(g2,{className:"size-3.5"}),o.jsx("span",{children:"Canonry"})]}),o.jsx("div",{className:"footer-links",children:Ob.map(z=>o.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),k?o.jsxs(RA,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:v,children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[o.jsx(Pu,{status:k.status}),o.jsx("span",{className:"text-zinc-400",children:k.startedAt}),o.jsx("span",{className:"text-zinc-500",children:k.duration}),o.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&o.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?o.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):w&&w.snapshots.length>0?o.jsxs("div",{className:"space-y-2",children:[w.snapshots.map(z=>o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:z.keyword??"Unknown key phrase"}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(tl,{provider:z.provider}),o.jsx(tj,{variant:z.citationState==="cited"?"success":"neutral",children:z.citationState})]})]}),z.model&&o.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:z.model}),z.citedDomains.length>0&&o.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[o.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",z.citedDomains.join(", ")]}),z.competitorOverlap.length>0&&o.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",z.competitorOverlap.join(", ")]}),z.groundingSources&&z.groundingSources.length>0&&o.jsxs("details",{className:"mt-2",children:[o.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[z.groundingSources.length," grounding source",z.groundingSources.length!==1?"s":""]}),o.jsx("ul",{className:"mt-1 space-y-0.5",children:z.groundingSources.map((L,M)=>o.jsx("li",{className:"text-xs text-zinc-500 truncate",children:o.jsx("a",{href:L.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:L.title||L.uri})},M))})]}),z.answerText&&o.jsxs("details",{className:"mt-1",children:[o.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),o.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:z.answerText})]})]},z.id)),w.status==="running"&&o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):w&&w.status==="running"?o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):w&&w.status==="queued"?o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):w&&w.error?o.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[o.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),o.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:I2(w.error)})]}):o.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?o.jsx(LL,{evidence:E.evidence,project:E.project,onClose:v}):null]})}class mM extends N.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,s){console.error("[ErrorBoundary]",t,s.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?o.jsx("div",{className:"page-container",children:o.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[o.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:o.jsx(M2,{className:"size-6 text-rose-400"})}),o.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),o.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),o.jsxs("div",{className:"flex gap-3 mt-2",children:[o.jsxs(ce,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[o.jsx(R2,{className:"size-3.5 mr-1.5"}),"Try again"]}),o.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const De=N.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Qn("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}));De.displayName="Card";const pM=N.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Qn("flex flex-col gap-1.5 p-5",e),...t}));pM.displayName="CardHeader";const gM=N.forwardRef(({className:e,...t},s)=>o.jsx("h3",{ref:s,className:Qn("font-medium tracking-tight text-zinc-50",e),...t}));gM.displayName="CardTitle";const yM=N.forwardRef(({className:e,...t},s)=>o.jsx("p",{ref:s,className:Qn("text-sm text-zinc-500",e),...t}));yM.displayName="CardDescription";const vM=N.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Qn("p-5 pt-0",e),...t}));vM.displayName="CardContent";function xM({points:e,tone:t}){const s=N.useId();if(e.length===0)return null;const a=42,r=132,c=5,d=Math.min(...e),p=Math.max(...e)-d||1,m=r-c*2,v=a-c*2,y=e.map((x,b)=>{const w=c+b/Math.max(e.length-1,1)*m,S=c+(1-(x-d)/p)*v;return`${w},${S}`}).join(" ");return o.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${r} ${a}`,"aria-hidden":"true",children:[o.jsx("defs",{children:o.jsx("clipPath",{id:s,children:o.jsx("rect",{x:c,y:c,width:m,height:v,rx:"8"})})}),o.jsx("line",{className:"sparkline-guide",x1:c,x2:r-c,y1:a-c,y2:a-c}),o.jsx("polyline",{clipPath:`url(#${s})`,points:y,vectorEffect:"non-scaling-stroke"})]})}function bM(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function SM(e,t,s){return e.map(a=>{if(a.id==="api")return{...a,tone:Su(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:Su(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const r=s.providerStatuses.filter(p=>p.state==="ready").length,c=s.providerStatuses.length,d=r>0,f=s.providerStatuses.filter(p=>p.state==="ready").map(p=>bM(p)).join(" · ");return{...a,label:"Providers",tone:d?"positive":"caution",detail:`${r} of ${c} configured`,meta:f||"None configured"}})}function jM(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(s=>s.state==="ready"))return"Launch is blocked until at least one provider is configured."}function wM(e,t,s){const a=jM(t,s),r=structuredClone(e);return r.healthChecks=r.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const d=s.providerStatuses.some(f=>f.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),r.launchState.enabled=a===void 0,r.launchState.blockedReason=a,r.launchState.summary=a??"Queue a visibility sweep first, then follow with a site audit to explain movement.",r}function NM({project:e}){return o.jsxs(yt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[o.jsxs("div",{className:"project-row-primary",children:[o.jsxs("div",{children:[o.jsx("p",{className:"project-name",children:e.project.name}),o.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),o.jsx("p",{className:"project-insight",children:e.insight})]}),o.jsx("div",{className:"project-row-stat",children:o.jsxs("div",{className:"metric-inline-block",children:[o.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),o.jsx("p",{className:"metric-inline-value",children:e.visibilityScore}),o.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),o.jsx("div",{className:"project-row-stat",children:o.jsxs("div",{className:"metric-inline-block",children:[o.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),o.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),o.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",$u(e.lastRun.status)]})]})}),o.jsx("div",{className:"project-row-chart",children:o.jsx(xM,{points:e.trend,tone:nj(e.lastRun.status)})}),o.jsx("span",{className:"project-row-link",children:o.jsx(Mu,{className:"h-4 w-4 text-zinc-500"})})]})}function CM(){const e=cl(),{dashboard:t,isLoading:s}=Ra(),a=t??e?.dashboard;if(!a||s)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-32"}),o.jsx("div",{className:"skeleton-text-sm w-64"})]}),o.jsx("div",{className:"space-y-3",children:[1,2,3].map(v=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("div",{className:"skeleton-text w-36"}),o.jsx("div",{className:"skeleton-text-sm w-48"})]}),o.jsx("div",{className:"skeleton-text w-16"}),o.jsx("div",{className:"skeleton-text w-16"}),o.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},v))})]});const r=a.portfolioOverview,f=Qu(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},p=SM(r.systemHealth,f,a.settings),{openRun:m}=ul();return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Portfolio"}),o.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),o.jsx("div",{className:"page-header-right",children:o.jsx("p",{className:"text-[11px] text-zinc-600",children:r.lastUpdatedAt})})]}),r.projects.length>0?o.jsx("div",{className:"project-list project-list-scrollable",children:r.projects.map(v=>o.jsx(NM,{project:v},v.project.id))}):o.jsxs(De,{className:"surface-card empty-card",children:[o.jsx("h3",{children:r.emptyState?.title??"No projects yet"}),o.jsx("p",{className:"supporting-copy",children:r.emptyState?.detail}),o.jsx(ce,{size:"sm",asChild:!0,children:o.jsx(yt,{to:r.emptyState?.ctaHref==="/setup"||!r.emptyState?.ctaHref?"/setup":"/",children:r.emptyState?.ctaLabel??"Launch setup"})})]}),o.jsxs("div",{className:"overview-secondary-grid",children:[r.attentionItems.length>0&&o.jsxs("section",{className:"overview-secondary-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),o.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),o.jsx("div",{className:"attention-list attention-list-scrollable",children:r.attentionItems.map(v=>o.jsxs(yt,{to:v.href,className:`attention-item attention-item-${v.tone}`,children:[o.jsxs("div",{children:[o.jsx("p",{className:"attention-title",children:v.title}),o.jsx("p",{className:"attention-detail",children:v.detail})]}),o.jsx("span",{className:"attention-action",children:v.actionLabel})]},v.id))})]}),o.jsxs("section",{className:"overview-secondary-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),o.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),o.jsx("div",{className:"compact-stack compact-stack-scrollable",children:r.recentRuns.length>0?r.recentRuns.map(v=>o.jsxs("button",{className:"compact-run",type:"button",onClick:()=>m(v.id),children:[o.jsxs("div",{children:[o.jsx("p",{className:"compact-run-title",children:v.projectName}),o.jsx("p",{className:"compact-run-detail",children:v.summary})]}),o.jsx(Pu,{status:v.status})]},v.id)):o.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),o.jsxs("section",{className:"page-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),o.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),o.jsx("div",{className:"health-grid",children:p.map(v=>o.jsxs(De,{className:"surface-card compact-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:v.label}),o.jsx("h3",{children:v.detail})]}),o.jsx(nt,{tone:v.tone,children:v.label})]}),o.jsx("p",{className:"supporting-copy",children:v.meta})]},v.id))})]})]})}const Pp=Symbol.for("yaml.alias"),Mm=Symbol.for("yaml.document"),Ui=Symbol.for("yaml.map"),bN=Symbol.for("yaml.pair"),bs=Symbol.for("yaml.scalar"),Br=Symbol.for("yaml.seq"),Zn=Symbol.for("yaml.node.type"),Aa=e=>!!e&&typeof e=="object"&&e[Zn]===Pp,Yu=e=>!!e&&typeof e=="object"&&e[Zn]===Mm,dl=e=>!!e&&typeof e=="object"&&e[Zn]===Ui,Dt=e=>!!e&&typeof e=="object"&&e[Zn]===bN,ft=e=>!!e&&typeof e=="object"&&e[Zn]===bs,fl=e=>!!e&&typeof e=="object"&&e[Zn]===Br;function Tt(e){if(e&&typeof e=="object")switch(e[Zn]){case Ui:case Br:return!0}return!1}function Ot(e){if(e&&typeof e=="object")switch(e[Zn]){case Pp:case Ui:case bs:case Br:return!0}return!1}const SN=e=>(ft(e)||Tt(e))&&!!e.anchor,fa=Symbol("break visit"),kM=Symbol("skip children"),Vo=Symbol("remove node");function qr(e,t){const s=_M(t);Yu(e)?Nr(null,e.contents,s,Object.freeze([e]))===Vo&&(e.contents=null):Nr(null,e,s,Object.freeze([]))}qr.BREAK=fa;qr.SKIP=kM;qr.REMOVE=Vo;function Nr(e,t,s,a){const r=zM(e,t,s,a);if(Ot(r)||Dt(r))return EM(e,a,r),Nr(e,r,s,a);if(typeof r!="symbol"){if(Tt(t)){a=Object.freeze(a.concat(t));for(let c=0;c<t.items.length;++c){const d=Nr(c,t.items[c],s,a);if(typeof d=="number")c=d-1;else{if(d===fa)return fa;d===Vo&&(t.items.splice(c,1),c-=1)}}}else if(Dt(t)){a=Object.freeze(a.concat(t));const c=Nr("key",t.key,s,a);if(c===fa)return fa;c===Vo&&(t.key=null);const d=Nr("value",t.value,s,a);if(d===fa)return fa;d===Vo&&(t.value=null)}}return r}function _M(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 zM(e,t,s,a){if(typeof s=="function")return s(e,t,a);if(dl(t))return s.Map?.(e,t,a);if(fl(t))return s.Seq?.(e,t,a);if(Dt(t))return s.Pair?.(e,t,a);if(ft(t))return s.Scalar?.(e,t,a);if(Aa(t))return s.Alias?.(e,t,a)}function EM(e,t,s){const a=t[t.length-1];if(Tt(a))a.items[e]=s;else if(Dt(a))e==="key"?a.key=s:a.value=s;else if(Yu(a))a.contents=s;else{const r=Aa(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const RM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},AM=e=>e.replace(/[!,[\]{}]/g,t=>RM[t]);class dn{constructor(t,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},dn.defaultYaml,t),this.tags=Object.assign({},dn.defaultTags,s)}clone(){const t=new dn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new dn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:dn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},dn.defaultTags);break}return t}add(t,s){this.atNextDocument&&(this.yaml={explicit:dn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},dn.defaultTags),this.atNextDocument=!1);const a=t.trim().split(/[ \t]+/),r=a.shift();switch(r){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[c,d]=a;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=a;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,d),!1}}default:return s(0,`Unknown directive ${r}`,!0),!1}}tagName(t,s){if(t==="!")return"!";if(t[0]!=="!")return s(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const d=t.slice(2,-1);return d==="!"||d==="!!"?(s(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&s("Verbatim tags must end with a >"),d)}const[,a,r]=t.match(/^(.*!)([^!]*)$/s);r||s(`The ${t} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(r)}catch(d){return s(String(d)),null}return a==="!"?t:(s(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[s,a]of Object.entries(this.tags))if(t.startsWith(a))return s+AM(t.substring(a.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let r;if(t&&a.length>0&&Ot(t.contents)){const c={};qr(t.contents,(d,f)=>{Ot(f)&&f.tag&&(c[f.tag]=!0)}),r=Object.keys(c)}else r=[];for(const[c,d]of a)c==="!!"&&d==="tag:yaml.org,2002:"||(!t||r.some(f=>f.startsWith(d)))&&s.push(`%TAG ${c} ${d}`);return s.join(`
96
+ `)}}dn.defaultYaml={explicit:!1,version:"1.2"};dn.defaultTags={"!!":"tag:yaml.org,2002:"};function jN(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(s)}return!0}function wN(e){const t=new Set;return qr(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function NN(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function TM(e,t){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=wN(e));const d=NN(t,r);return r.add(d),d},setAnchors:()=>{for(const c of s){const d=a.get(c);if(typeof d=="object"&&d.anchor&&(ft(d.node)||Tt(d.node)))d.node.anchor=d.anchor;else{const f=new Error("Failed to resolve repeated object (this should not happen)");throw f.source=c,f}}},sourceObjects:a}}function Cr(e,t,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,c=a.length;r<c;++r){const d=a[r],f=Cr(e,a,String(r),d);f===void 0?delete a[r]:f!==d&&(a[r]=f)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const c=a.get(r),d=Cr(e,a,r,c);d===void 0?a.delete(r):d!==c&&a.set(r,d)}else if(a instanceof Set)for(const r of Array.from(a)){const c=Cr(e,a,r,r);c===void 0?a.delete(r):c!==r&&(a.delete(r),a.add(c))}else for(const[r,c]of Object.entries(a)){const d=Cr(e,a,r,c);d===void 0?delete a[r]:d!==c&&(a[r]=d)}return e.call(t,s,a)}function Fn(e,t,s){if(Array.isArray(e))return e.map((a,r)=>Fn(a,String(r),s));if(e&&typeof e.toJSON=="function"){if(!s||!SN(e))return e.toJSON(t,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(e,a),s.onCreate=c=>{a.res=c,delete s.onCreate};const r=e.toJSON(t,s);return s.onCreate&&s.onCreate(r),r}return typeof e=="bigint"&&!s?.keep?Number(e):e}class Ip{constructor(t){Object.defineProperty(this,Zn,{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:s,maxAliasCount:a,onAnchor:r,reviver:c}={}){if(!Yu(t))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:t,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Fn(this,"",d);if(typeof r=="function")for(const{count:p,res:m}of d.anchors.values())r(m,p);return typeof c=="function"?Cr(c,{"":f},"",f):f}}class Bp extends Ip{constructor(t){super(Pp),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,s){let a;s?.aliasResolveCache?a=s.aliasResolveCache:(a=[],qr(t,{Node:(c,d)=>{(Aa(d)||SN(d))&&a.push(d)}}),s&&(s.aliasResolveCache=a));let r;for(const c of a){if(c===this)break;c.anchor===this.source&&(r=c)}return r}toJSON(t,s){if(!s)return{source:this.source};const{anchors:a,doc:r,maxAliasCount:c}=s,d=this.resolve(r,s);if(!d){const p=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(p)}let f=a.get(d);if(f||(Fn(d,null,s),f=a.get(d)),f?.res===void 0){const p="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(p)}if(c>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=ru(r,d,a)),f.count*f.aliasCount>c)){const p="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(p)}return f.res}toString(t,s,a){const r=`*${this.source}`;if(t){if(jN(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(t.implicitKey)return`${r} `}return r}}function ru(e,t,s){if(Aa(t)){const a=t.resolve(e),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(Tt(t)){let a=0;for(const r of t.items){const c=ru(e,r,s);c>a&&(a=c)}return a}else if(Dt(t)){const a=ru(e,t.key,s),r=ru(e,t.value,s);return Math.max(a,r)}return 1}const CN=e=>!e||typeof e!="function"&&typeof e!="object";class Re extends Ip{constructor(t){super(bs),this.value=t}toJSON(t,s){return s?.keep?this.value:Fn(this.value,t,s)}toString(){return String(this.value)}}Re.BLOCK_FOLDED="BLOCK_FOLDED";Re.BLOCK_LITERAL="BLOCK_LITERAL";Re.PLAIN="PLAIN";Re.QUOTE_DOUBLE="QUOTE_DOUBLE";Re.QUOTE_SINGLE="QUOTE_SINGLE";const OM="tag:yaml.org,2002:";function DM(e,t,s){if(t){const a=s.filter(c=>c.tag===t),r=a.find(c=>!c.format)??a[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return s.find(a=>a.identify?.(e)&&!a.format)}function al(e,t,s){if(Yu(e)&&(e=e.contents),Ot(e))return e;if(Dt(e)){const y=s.schema[Ui].createNode?.(s.schema,null,s);return y.items.push(e),y}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:r,onTagObj:c,schema:d,sourceObjects:f}=s;let p;if(a&&e&&typeof e=="object"){if(p=f.get(e),p)return p.anchor??(p.anchor=r(e)),new Bp(p.anchor);p={anchor:null,node:null},f.set(e,p)}t?.startsWith("!!")&&(t=OM+t.slice(2));let m=DM(e,t,d.tags);if(!m){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Re(e);return p&&(p.node=y),y}m=e instanceof Map?d[Ui]:Symbol.iterator in Object(e)?d[Br]:d[Ui]}c&&(c(m),delete s.onTagObj);const v=m?.createNode?m.createNode(s.schema,e,s):typeof m?.nodeClass?.from=="function"?m.nodeClass.from(s.schema,e,s):new Re(e);return t?v.tag=t:m.default||(v.tag=m.tag),p&&(p.node=v),v}function zu(e,t,s){let a=s;for(let r=t.length-1;r>=0;--r){const c=t[r];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const d=[];d[c]=a,a=d}else a=new Map([[c,a]])}return al(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Go=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class kN extends Ip{constructor(t,s){super(t),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(t){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(s.schema=t),s.items=s.items.map(a=>Ot(a)||Dt(a)?a.clone(t):a),this.range&&(s.range=this.range.slice()),s}addIn(t,s){if(Go(t))this.add(s);else{const[a,...r]=t,c=this.get(a,!0);if(Tt(c))c.addIn(r,s);else if(c===void 0&&this.schema)this.set(a,zu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}deleteIn(t){const[s,...a]=t;if(a.length===0)return this.delete(s);const r=this.get(s,!0);if(Tt(r))return r.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(t,s){const[a,...r]=t,c=this.get(a,!0);return r.length===0?!s&&ft(c)?c.value:c:Tt(c)?c.getIn(r,s):void 0}hasAllNullValues(t){return this.items.every(s=>{if(!Dt(s))return!1;const a=s.value;return a==null||t&&ft(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(t){const[s,...a]=t;if(a.length===0)return this.has(s);const r=this.get(s,!0);return Tt(r)?r.hasIn(a):!1}setIn(t,s){const[a,...r]=t;if(r.length===0)this.set(a,s);else{const c=this.get(a,!0);if(Tt(c))c.setIn(r,s);else if(c===void 0&&this.schema)this.set(a,zu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const LM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Gs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ya=(e,t,s)=>e.endsWith(`
97
97
  `)?Gs(s,t):s.includes(`
98
98
  `)?`
99
- `+Gs(s,t):(e.endsWith(" ")?"":" ")+s,_N="flow",Um="block",lu="quoted";function Xu(e,t,s="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:c=20,onFold:d,onOverflow:f}={}){if(!r||r<0)return e;r<c&&(c=0);const p=Math.max(1+c,1+r-t.length);if(e.length<=p)return e;const m=[],v={};let y=r-t.length;typeof a=="number"&&(a>r-Math.max(2,c)?m.push(0):y=r-a);let x,b,w=!1,S=-1,C=-1,k=-1;s===Um&&(S=Lb(e,S,t.length),S!==-1&&(y=S+p));for(let A;A=e[S+=1];){if(s===lu&&A==="\\"){switch(C=S,e[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}k=S}if(A===`
100
- `)s===Um&&(S=Lb(e,S,t.length)),y=S+t.length+p,x=void 0;else{if(A===" "&&b&&b!==" "&&b!==`
99
+ `+Gs(s,t):(e.endsWith(" ")?"":" ")+s,_N="flow",Um="block",ou="quoted";function Ju(e,t,s="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:c=20,onFold:d,onOverflow:f}={}){if(!r||r<0)return e;r<c&&(c=0);const p=Math.max(1+c,1+r-t.length);if(e.length<=p)return e;const m=[],v={};let y=r-t.length;typeof a=="number"&&(a>r-Math.max(2,c)?m.push(0):y=r-a);let x,b,w=!1,S=-1,C=-1,k=-1;s===Um&&(S=Lb(e,S,t.length),S!==-1&&(y=S+p));for(let R;R=e[S+=1];){if(s===ou&&R==="\\"){switch(C=S,e[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}k=S}if(R===`
100
+ `)s===Um&&(S=Lb(e,S,t.length)),y=S+t.length+p,x=void 0;else{if(R===" "&&b&&b!==" "&&b!==`
101
101
  `&&b!==" "){const z=e[S+1];z&&z!==" "&&z!==`
102
- `&&z!==" "&&(x=S)}if(S>=y)if(x)m.push(x),y=x+p,x=void 0;else if(s===lu){for(;b===" "||b===" ";)b=A,A=e[S+=1],w=!0;const z=S>k+1?S-2:C-1;if(v[z])return e;m.push(z),v[z]=!0,y=z+p,x=void 0}else w=!0}b=A}if(w&&f&&f(),m.length===0)return e;d&&d();let E=e.slice(0,m[0]);for(let A=0;A<m.length;++A){const z=m[A],L=m[A+1]||e.length;z===0?E=`
103
- ${t}${e.slice(0,L)}`:(s===lu&&v[z]&&(E+=`${e[z]}\\`),E+=`
102
+ `&&z!==" "&&(x=S)}if(S>=y)if(x)m.push(x),y=x+p,x=void 0;else if(s===ou){for(;b===" "||b===" ";)b=R,R=e[S+=1],w=!0;const z=S>k+1?S-2:C-1;if(v[z])return e;m.push(z),v[z]=!0,y=z+p,x=void 0}else w=!0}b=R}if(w&&f&&f(),m.length===0)return e;d&&d();let E=e.slice(0,m[0]);for(let R=0;R<m.length;++R){const z=m[R],L=m[R+1]||e.length;z===0?E=`
103
+ ${t}${e.slice(0,L)}`:(s===ou&&v[z]&&(E+=`${e[z]}\\`),E+=`
104
104
  ${t}${e.slice(z+1,L)}`)}return E}function Lb(e,t,s){let a=t,r=t+1,c=e[r];for(;c===" "||c===" ";)if(t<r+s)c=e[++t];else{do c=e[++t];while(c&&c!==`
105
- `);a=t,r=t+1,c=e[r]}return a}const Wu=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ed=e=>/^(%|---|\.\.\.)/m.test(e);function DM(e,t,s){if(!t||t<0)return!1;const a=t-s,r=e.length;if(r<=a)return!1;for(let c=0,d=0;c<r;++c)if(e[c]===`
106
- `){if(c-d>a)return!0;if(d=c+1,r-d<=a)return!1}return!0}function Yo(e,t){const s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=t,r=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(ed(e)?" ":"");let d="",f=0;for(let p=0,m=s[p];m;m=s[++p])if(m===" "&&s[p+1]==="\\"&&s[p+2]==="n"&&(d+=s.slice(f,p)+"\\ ",p+=1,f=p,m="\\"),m==="\\")switch(s[p+1]){case"u":{d+=s.slice(f,p);const v=s.substr(p+2,4);switch(v){case"0000":d+="\\0";break;case"0007":d+="\\a";break;case"000b":d+="\\v";break;case"001b":d+="\\e";break;case"0085":d+="\\N";break;case"00a0":d+="\\_";break;case"2028":d+="\\L";break;case"2029":d+="\\P";break;default:v.substr(0,2)==="00"?d+="\\x"+v.substr(2):d+=s.substr(p,6)}p+=5,f=p+1}break;case"n":if(a||s[p+2]==='"'||s.length<r)p+=1;else{for(d+=s.slice(f,p)+`
105
+ `);a=t,r=t+1,c=e[r]}return a}const Xu=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Wu=e=>/^(%|---|\.\.\.)/m.test(e);function MM(e,t,s){if(!t||t<0)return!1;const a=t-s,r=e.length;if(r<=a)return!1;for(let c=0,d=0;c<r;++c)if(e[c]===`
106
+ `){if(c-d>a)return!0;if(d=c+1,r-d<=a)return!1}return!0}function Qo(e,t){const s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=t,r=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(Wu(e)?" ":"");let d="",f=0;for(let p=0,m=s[p];m;m=s[++p])if(m===" "&&s[p+1]==="\\"&&s[p+2]==="n"&&(d+=s.slice(f,p)+"\\ ",p+=1,f=p,m="\\"),m==="\\")switch(s[p+1]){case"u":{d+=s.slice(f,p);const v=s.substr(p+2,4);switch(v){case"0000":d+="\\0";break;case"0007":d+="\\a";break;case"000b":d+="\\v";break;case"001b":d+="\\e";break;case"0085":d+="\\N";break;case"00a0":d+="\\_";break;case"2028":d+="\\L";break;case"2029":d+="\\P";break;default:v.substr(0,2)==="00"?d+="\\x"+v.substr(2):d+=s.substr(p,6)}p+=5,f=p+1}break;case"n":if(a||s[p+2]==='"'||s.length<r)p+=1;else{for(d+=s.slice(f,p)+`
107
107
 
108
108
  `;s[p+2]==="\\"&&s[p+3]==="n"&&s[p+4]!=='"';)d+=`
109
- `,p+=2;d+=c,s[p+2]===" "&&(d+="\\"),p+=1,f=p+1}break;default:p+=1}return d=f?d+s.slice(f):s,a?d:Xu(d,c,lu,Wu(t,!1))}function $m(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
110
- `)||/[ \t]\n|\n[ \t]/.test(e))return Yo(e,t);const s=t.indent||(ed(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
111
- ${s}`)+"'";return t.implicitKey?a:Xu(a,s,_N,Wu(t,!1))}function _r(e,t){const{singleQuote:s}=t.options;let a;if(s===!1)a=Yo;else{const r=e.includes('"'),c=e.includes("'");r&&!c?a=$m:c&&!r?a=Yo:a=s?$m:Yo}return a(e,t)}let Pm;try{Pm=new RegExp(`(^|(?<!
109
+ `,p+=2;d+=c,s[p+2]===" "&&(d+="\\"),p+=1,f=p+1}break;default:p+=1}return d=f?d+s.slice(f):s,a?d:Ju(d,c,ou,Xu(t,!1))}function $m(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
110
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Qo(e,t);const s=t.indent||(Wu(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
111
+ ${s}`)+"'";return t.implicitKey?a:Ju(a,s,_N,Xu(t,!1))}function kr(e,t){const{singleQuote:s}=t.options;let a;if(s===!1)a=Qo;else{const r=e.includes('"'),c=e.includes("'");r&&!c?a=$m:c&&!r?a=Qo:a=s?$m:Qo}return a(e,t)}let Pm;try{Pm=new RegExp(`(^|(?<!
112
112
  ))
113
113
  +(?!
114
- |$)`,"g")}catch{Pm=/\n+(?!\n|$)/g}function cu({comment:e,type:t,value:s},a,r,c){const{blockQuote:d,commentString:f,lineWidth:p}=a.options;if(!d||/\n[\t ]+$/.test(s))return _r(s,a);const m=a.indent||(a.forceBlockIndent||ed(s)?" ":""),v=d==="literal"?!0:d==="folded"||t===Ae.BLOCK_FOLDED?!1:t===Ae.BLOCK_LITERAL?!0:!DM(s,p,m.length);if(!s)return v?`|
114
+ |$)`,"g")}catch{Pm=/\n+(?!\n|$)/g}function lu({comment:e,type:t,value:s},a,r,c){const{blockQuote:d,commentString:f,lineWidth:p}=a.options;if(!d||/\n[\t ]+$/.test(s))return kr(s,a);const m=a.indent||(a.forceBlockIndent||Wu(s)?" ":""),v=d==="literal"?!0:d==="folded"||t===Re.BLOCK_FOLDED?!1:t===Re.BLOCK_LITERAL?!0:!MM(s,p,m.length);if(!s)return v?`|
115
115
  `:`>
116
116
  `;let y,x;for(x=s.length;x>0;--x){const L=s[x-1];if(L!==`
117
117
  `&&L!==" "&&L!==" ")break}let b=s.substring(x);const w=b.indexOf(`
118
118
  `);w===-1?y="-":s===b||w!==b.length-1?(y="+",c&&c()):y="",b&&(s=s.slice(0,-b.length),b[b.length-1]===`
119
119
  `&&(b=b.slice(0,-1)),b=b.replace(Pm,`$&${m}`));let S=!1,C,k=-1;for(C=0;C<s.length;++C){const L=s[C];if(L===" ")S=!0;else if(L===`
120
120
  `)k=C;else break}let E=s.substring(0,k<C?k+1:C);E&&(s=s.substring(E.length),E=E.replace(/\n+/g,`$&${m}`));let z=(S?m?"2":"1":"")+y;if(e&&(z+=" "+f(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!v){const L=s.replace(/\n+/g,`
121
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);let M=!1;const R=Wu(a,!0);d!=="folded"&&t!==Ae.BLOCK_FOLDED&&(R.onOverflow=()=>{M=!0});const T=Xu(`${E}${L}${b}`,m,Um,R);if(!M)return`>${z}
121
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);let M=!1;const A=Xu(a,!0);d!=="folded"&&t!==Re.BLOCK_FOLDED&&(A.onOverflow=()=>{M=!0});const T=Ju(`${E}${L}${b}`,m,Um,A);if(!M)return`>${z}
122
122
  ${m}${T}`}return s=s.replace(/\n+/g,`$&${m}`),`|${z}
123
- ${m}${E}${s}${b}`}function LM(e,t,s,a){const{type:r,value:c}=e,{actualString:d,implicitKey:f,indent:p,indentStep:m,inFlow:v}=t;if(f&&c.includes(`
124
- `)||v&&/[[\]{},]/.test(c))return _r(c,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return f||v||!c.includes(`
125
- `)?_r(c,t):cu(e,t,s,a);if(!f&&!v&&r!==Ae.PLAIN&&c.includes(`
126
- `))return cu(e,t,s,a);if(ed(c)){if(p==="")return t.forceBlockIndent=!0,cu(e,t,s,a);if(f&&p===m)return _r(c,t)}const y=c.replace(/\n+/g,`$&
127
- ${p}`);if(d){const x=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(y),{compat:b,tags:w}=t.doc.schema;if(w.some(x)||b?.some(x))return _r(c,t)}return f?y:Xu(y,p,_N,Wu(t,!1))}function qp(e,t,s,a){const{implicitKey:r,inFlow:c}=t,d=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:f}=e;f!==Ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(f=Ae.QUOTE_DOUBLE);const p=v=>{switch(v){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return r||c?_r(d.value,t):cu(d,t,s,a);case Ae.QUOTE_DOUBLE:return Yo(d.value,t);case Ae.QUOTE_SINGLE:return $m(d.value,t);case Ae.PLAIN:return LM(d,t,s,a);default:return null}};let m=p(f);if(m===null){const{defaultKeyType:v,defaultStringType:y}=t.options,x=r&&v||y;if(m=p(x),m===null)throw new Error(`Unsupported default string type ${x}`)}return m}function zN(e,t){const s=Object.assign({blockQuote:!0,commentString:OM,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 a;switch(s.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:a,options:s}}function MM(e,t){if(t.tag){const r=e.filter(c=>c.tag===t.tag);if(r.length>0)return r.find(c=>c.format===t.format)??r[0]}let s,a;if(ft(t)){a=t.value;let r=e.filter(c=>c.identify?.(a));if(r.length>1){const c=r.filter(d=>d.test);c.length>0&&(r=c)}s=r.find(c=>c.format===t.format)??r.find(c=>!c.format)}else a=t,s=e.find(r=>r.nodeClass&&a instanceof r.nodeClass);if(!s){const r=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${r} value`)}return s}function UM(e,t,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],c=(ft(e)||Tt(e))&&e.anchor;c&&jN(c)&&(s.add(c),r.push(`&${c}`));const d=e.tag??(t.default?null:t.tag);return d&&r.push(a.directives.tagString(d)),r.join(" ")}function Mr(e,t,s,a){if(Dt(e))return e.toString(t,s,a);if(Ta(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 r;const c=Ot(e)?e:t.doc.createNode(e,{onTagObj:p=>r=p});r??(r=MM(t.doc.schema.tags,c));const d=UM(c,r,t);d.length>0&&(t.indentAtStart=(t.indentAtStart??0)+d.length+1);const f=typeof r.stringify=="function"?r.stringify(c,t,s,a):ft(c)?qp(c,t,s,a):c.toString(t,s,a);return d?ft(c)||f[0]==="{"||f[0]==="["?`${d} ${f}`:`${d}
128
- ${t.indent}${f}`:f}function $M({key:e,value:t},s,a,r){const{allNullValues:c,doc:d,indent:f,indentStep:p,options:{commentString:m,indentSeq:v,simpleKeys:y}}=s;let x=Ot(e)&&e.comment||null;if(y){if(x)throw new Error("With simple keys, key nodes cannot have comments");if(Tt(e)||!Ot(e)&&typeof e=="object"){const R="With simple keys, collection cannot be used as a key value";throw new Error(R)}}let b=!y&&(!e||x&&t==null&&!s.inFlow||Tt(e)||(ft(e)?e.type===Ae.BLOCK_FOLDED||e.type===Ae.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!b&&(y||!c),indent:f+p});let w=!1,S=!1,C=Mr(e,s,()=>w=!0,()=>S=!0);if(!b&&!s.inFlow&&C.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");b=!0}if(s.inFlow){if(c||t==null)return w&&a&&a(),C===""?"?":b?`? ${C}`:C}else if(c&&!y||t==null&&b)return C=`? ${C}`,x&&!w?C+=ga(C,s.indent,m(x)):S&&r&&r(),C;w&&(x=null),b?(x&&(C+=ga(C,s.indent,m(x))),C=`? ${C}
129
- ${f}:`):(C=`${C}:`,x&&(C+=ga(C,s.indent,m(x))));let k,E,A;Ot(t)?(k=!!t.spaceBefore,E=t.commentBefore,A=t.comment):(k=!1,E=null,A=null,t&&typeof t=="object"&&(t=d.createNode(t))),s.implicitKey=!1,!b&&!x&&ft(t)&&(s.indentAtStart=C.length+1),S=!1,!v&&p.length>=2&&!s.inFlow&&!b&&hl(t)&&!t.flow&&!t.tag&&!t.anchor&&(s.indent=s.indent.substring(2));let z=!1;const L=Mr(t,s,()=>z=!0,()=>S=!0);let M=" ";if(x||k||E){if(M=k?`
130
- `:"",E){const R=m(E);M+=`
131
- ${Gs(R,s.indent)}`}L===""&&!s.inFlow?M===`
132
- `&&A&&(M=`
123
+ ${m}${E}${s}${b}`}function UM(e,t,s,a){const{type:r,value:c}=e,{actualString:d,implicitKey:f,indent:p,indentStep:m,inFlow:v}=t;if(f&&c.includes(`
124
+ `)||v&&/[[\]{},]/.test(c))return kr(c,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return f||v||!c.includes(`
125
+ `)?kr(c,t):lu(e,t,s,a);if(!f&&!v&&r!==Re.PLAIN&&c.includes(`
126
+ `))return lu(e,t,s,a);if(Wu(c)){if(p==="")return t.forceBlockIndent=!0,lu(e,t,s,a);if(f&&p===m)return kr(c,t)}const y=c.replace(/\n+/g,`$&
127
+ ${p}`);if(d){const x=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(y),{compat:b,tags:w}=t.doc.schema;if(w.some(x)||b?.some(x))return kr(c,t)}return f?y:Ju(y,p,_N,Xu(t,!1))}function qp(e,t,s,a){const{implicitKey:r,inFlow:c}=t,d=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:f}=e;f!==Re.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(f=Re.QUOTE_DOUBLE);const p=v=>{switch(v){case Re.BLOCK_FOLDED:case Re.BLOCK_LITERAL:return r||c?kr(d.value,t):lu(d,t,s,a);case Re.QUOTE_DOUBLE:return Qo(d.value,t);case Re.QUOTE_SINGLE:return $m(d.value,t);case Re.PLAIN:return UM(d,t,s,a);default:return null}};let m=p(f);if(m===null){const{defaultKeyType:v,defaultStringType:y}=t.options,x=r&&v||y;if(m=p(x),m===null)throw new Error(`Unsupported default string type ${x}`)}return m}function zN(e,t){const s=Object.assign({blockQuote:!0,commentString:LM,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 a;switch(s.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:a,options:s}}function $M(e,t){if(t.tag){const r=e.filter(c=>c.tag===t.tag);if(r.length>0)return r.find(c=>c.format===t.format)??r[0]}let s,a;if(ft(t)){a=t.value;let r=e.filter(c=>c.identify?.(a));if(r.length>1){const c=r.filter(d=>d.test);c.length>0&&(r=c)}s=r.find(c=>c.format===t.format)??r.find(c=>!c.format)}else a=t,s=e.find(r=>r.nodeClass&&a instanceof r.nodeClass);if(!s){const r=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${r} value`)}return s}function PM(e,t,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],c=(ft(e)||Tt(e))&&e.anchor;c&&jN(c)&&(s.add(c),r.push(`&${c}`));const d=e.tag??(t.default?null:t.tag);return d&&r.push(a.directives.tagString(d)),r.join(" ")}function Lr(e,t,s,a){if(Dt(e))return e.toString(t,s,a);if(Aa(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 r;const c=Ot(e)?e:t.doc.createNode(e,{onTagObj:p=>r=p});r??(r=$M(t.doc.schema.tags,c));const d=PM(c,r,t);d.length>0&&(t.indentAtStart=(t.indentAtStart??0)+d.length+1);const f=typeof r.stringify=="function"?r.stringify(c,t,s,a):ft(c)?qp(c,t,s,a):c.toString(t,s,a);return d?ft(c)||f[0]==="{"||f[0]==="["?`${d} ${f}`:`${d}
128
+ ${t.indent}${f}`:f}function IM({key:e,value:t},s,a,r){const{allNullValues:c,doc:d,indent:f,indentStep:p,options:{commentString:m,indentSeq:v,simpleKeys:y}}=s;let x=Ot(e)&&e.comment||null;if(y){if(x)throw new Error("With simple keys, key nodes cannot have comments");if(Tt(e)||!Ot(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let b=!y&&(!e||x&&t==null&&!s.inFlow||Tt(e)||(ft(e)?e.type===Re.BLOCK_FOLDED||e.type===Re.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!b&&(y||!c),indent:f+p});let w=!1,S=!1,C=Lr(e,s,()=>w=!0,()=>S=!0);if(!b&&!s.inFlow&&C.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");b=!0}if(s.inFlow){if(c||t==null)return w&&a&&a(),C===""?"?":b?`? ${C}`:C}else if(c&&!y||t==null&&b)return C=`? ${C}`,x&&!w?C+=ya(C,s.indent,m(x)):S&&r&&r(),C;w&&(x=null),b?(x&&(C+=ya(C,s.indent,m(x))),C=`? ${C}
129
+ ${f}:`):(C=`${C}:`,x&&(C+=ya(C,s.indent,m(x))));let k,E,R;Ot(t)?(k=!!t.spaceBefore,E=t.commentBefore,R=t.comment):(k=!1,E=null,R=null,t&&typeof t=="object"&&(t=d.createNode(t))),s.implicitKey=!1,!b&&!x&&ft(t)&&(s.indentAtStart=C.length+1),S=!1,!v&&p.length>=2&&!s.inFlow&&!b&&fl(t)&&!t.flow&&!t.tag&&!t.anchor&&(s.indent=s.indent.substring(2));let z=!1;const L=Lr(t,s,()=>z=!0,()=>S=!0);let M=" ";if(x||k||E){if(M=k?`
130
+ `:"",E){const A=m(E);M+=`
131
+ ${Gs(A,s.indent)}`}L===""&&!s.inFlow?M===`
132
+ `&&R&&(M=`
133
133
 
134
134
  `):M+=`
135
- ${s.indent}`}else if(!b&&Tt(t)){const R=L[0],T=L.indexOf(`
136
- `),P=T!==-1,J=s.inFlow??t.flow??t.items.length===0;if(P||!J){let Q=!1;if(P&&(R==="&"||R==="!")){let se=L.indexOf(" ");R==="&"&&se!==-1&&se<T&&L[se+1]==="!"&&(se=L.indexOf(" ",se+1)),(se===-1||T<se)&&(Q=!0)}Q||(M=`
135
+ ${s.indent}`}else if(!b&&Tt(t)){const A=L[0],T=L.indexOf(`
136
+ `),P=T!==-1,J=s.inFlow??t.flow??t.items.length===0;if(P||!J){let Q=!1;if(P&&(A==="&"||A==="!")){let se=L.indexOf(" ");A==="&"&&se!==-1&&se<T&&L[se+1]==="!"&&(se=L.indexOf(" ",se+1)),(se===-1||T<se)&&(Q=!0)}Q||(M=`
137
137
  ${s.indent}`)}}else(L===""||L[0]===`
138
- `)&&(M="");return C+=M+L,s.inFlow?z&&a&&a():A&&!z?C+=ga(C,s.indent,m(A)):S&&r&&r(),C}function PM(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Vc="<<",Fs={identify:e=>e===Vc||typeof e=="symbol"&&e.description===Vc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(Vc)),{addToJSMap:EN}),stringify:()=>Vc},IM=(e,t)=>(Fs.identify(t)||ft(t)&&(!t.type||t.type===Ae.PLAIN)&&Fs.identify(t.value))&&e?.doc.schema.tags.some(s=>s.tag===Fs.tag&&s.default);function EN(e,t,s){if(s=e&&Ta(s)?s.resolve(e.doc):s,hl(s))for(const a of s.items)Vh(e,t,a);else if(Array.isArray(s))for(const a of s)Vh(e,t,a);else Vh(e,t,s)}function Vh(e,t,s){const a=e&&Ta(s)?s.resolve(e.doc):s;if(!fl(a))throw new Error("Merge sources must be maps or map aliases");const r=a.toJSON(null,e,Map);for(const[c,d]of r)t instanceof Map?t.has(c)||t.set(c,d):t instanceof Set?t.add(c):Object.prototype.hasOwnProperty.call(t,c)||Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0});return t}function AN(e,t,{key:s,value:a}){if(Ot(s)&&s.addToJSMap)s.addToJSMap(e,t,a);else if(IM(e,s))EN(e,t,a);else{const r=Fn(s,"",e);if(t instanceof Map)t.set(r,Fn(a,r,e));else if(t instanceof Set)t.add(r);else{const c=BM(s,r,e),d=Fn(a,c,e);c in t?Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):t[c]=d}}return t}function BM(e,t,s){if(t===null)return"";if(typeof t!="object")return String(t);if(Ot(e)&&s?.doc){const a=zN(s.doc,{});a.anchors=new Set;for(const c of s.anchors.keys())a.anchors.add(c.anchor);a.inFlow=!0,a.inStringifyKey=!0;const r=e.toString(a);if(!s.mapKeyWarned){let c=JSON.stringify(r);c.length>40&&(c=c.substring(0,36)+'..."'),PM(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Hp(e,t,s){const a=rl(e,void 0,s),r=rl(t,void 0,s);return new hn(a,r)}class hn{constructor(t,s=null){Object.defineProperty(this,Zn,{value:bN}),this.key=t,this.value=s}clone(t){let{key:s,value:a}=this;return Ot(s)&&(s=s.clone(t)),Ot(a)&&(a=a.clone(t)),new hn(s,a)}toJSON(t,s){const a=s?.mapAsMap?new Map:{};return AN(s,a,this)}toString(t,s,a){return t?.doc?$M(this,t,s,a):JSON.stringify(this)}}function RN(e,t,s){return(t.inFlow??e.flow?HM:qM)(e,t,s)}function qM({comment:e,items:t},s,{blockItemPrefix:a,flowChars:r,itemIndent:c,onChompKeep:d,onComment:f}){const{indent:p,options:{commentString:m}}=s,v=Object.assign({},s,{indent:c,type:null});let y=!1;const x=[];for(let w=0;w<t.length;++w){const S=t[w];let C=null;if(Ot(S))!y&&S.spaceBefore&&x.push(""),Au(s,x,S.commentBefore,y),S.comment&&(C=S.comment);else if(Dt(S)){const E=Ot(S.key)?S.key:null;E&&(!y&&E.spaceBefore&&x.push(""),Au(s,x,E.commentBefore,y))}y=!1;let k=Mr(S,v,()=>C=null,()=>y=!0);C&&(k+=ga(k,c,m(C))),y&&C&&(y=!1),x.push(a+k)}let b;if(x.length===0)b=r.start+r.end;else{b=x[0];for(let w=1;w<x.length;++w){const S=x[w];b+=S?`
138
+ `)&&(M="");return C+=M+L,s.inFlow?z&&a&&a():R&&!z?C+=ya(C,s.indent,m(R)):S&&r&&r(),C}function BM(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Kc="<<",Fs={identify:e=>e===Kc||typeof e=="symbol"&&e.description===Kc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Re(Symbol(Kc)),{addToJSMap:EN}),stringify:()=>Kc},qM=(e,t)=>(Fs.identify(t)||ft(t)&&(!t.type||t.type===Re.PLAIN)&&Fs.identify(t.value))&&e?.doc.schema.tags.some(s=>s.tag===Fs.tag&&s.default);function EN(e,t,s){if(s=e&&Aa(s)?s.resolve(e.doc):s,fl(s))for(const a of s.items)Kh(e,t,a);else if(Array.isArray(s))for(const a of s)Kh(e,t,a);else Kh(e,t,s)}function Kh(e,t,s){const a=e&&Aa(s)?s.resolve(e.doc):s;if(!dl(a))throw new Error("Merge sources must be maps or map aliases");const r=a.toJSON(null,e,Map);for(const[c,d]of r)t instanceof Map?t.has(c)||t.set(c,d):t instanceof Set?t.add(c):Object.prototype.hasOwnProperty.call(t,c)||Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0});return t}function RN(e,t,{key:s,value:a}){if(Ot(s)&&s.addToJSMap)s.addToJSMap(e,t,a);else if(qM(e,s))EN(e,t,a);else{const r=Fn(s,"",e);if(t instanceof Map)t.set(r,Fn(a,r,e));else if(t instanceof Set)t.add(r);else{const c=HM(s,r,e),d=Fn(a,c,e);c in t?Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):t[c]=d}}return t}function HM(e,t,s){if(t===null)return"";if(typeof t!="object")return String(t);if(Ot(e)&&s?.doc){const a=zN(s.doc,{});a.anchors=new Set;for(const c of s.anchors.keys())a.anchors.add(c.anchor);a.inFlow=!0,a.inStringifyKey=!0;const r=e.toString(a);if(!s.mapKeyWarned){let c=JSON.stringify(r);c.length>40&&(c=c.substring(0,36)+'..."'),BM(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Hp(e,t,s){const a=al(e,void 0,s),r=al(t,void 0,s);return new hn(a,r)}class hn{constructor(t,s=null){Object.defineProperty(this,Zn,{value:bN}),this.key=t,this.value=s}clone(t){let{key:s,value:a}=this;return Ot(s)&&(s=s.clone(t)),Ot(a)&&(a=a.clone(t)),new hn(s,a)}toJSON(t,s){const a=s?.mapAsMap?new Map:{};return RN(s,a,this)}toString(t,s,a){return t?.doc?IM(this,t,s,a):JSON.stringify(this)}}function AN(e,t,s){return(t.inFlow??e.flow?FM:GM)(e,t,s)}function GM({comment:e,items:t},s,{blockItemPrefix:a,flowChars:r,itemIndent:c,onChompKeep:d,onComment:f}){const{indent:p,options:{commentString:m}}=s,v=Object.assign({},s,{indent:c,type:null});let y=!1;const x=[];for(let w=0;w<t.length;++w){const S=t[w];let C=null;if(Ot(S))!y&&S.spaceBefore&&x.push(""),Eu(s,x,S.commentBefore,y),S.comment&&(C=S.comment);else if(Dt(S)){const E=Ot(S.key)?S.key:null;E&&(!y&&E.spaceBefore&&x.push(""),Eu(s,x,E.commentBefore,y))}y=!1;let k=Lr(S,v,()=>C=null,()=>y=!0);C&&(k+=ya(k,c,m(C))),y&&C&&(y=!1),x.push(a+k)}let b;if(x.length===0)b=r.start+r.end;else{b=x[0];for(let w=1;w<x.length;++w){const S=x[w];b+=S?`
139
139
  ${p}${S}`:`
140
140
  `}}return e?(b+=`
141
- `+Gs(m(e),p),f&&f()):y&&d&&d(),b}function HM({items:e},t,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:c,flowCollectionPadding:d,options:{commentString:f}}=t;a+=c;const p=Object.assign({},t,{indent:a,inFlow:!0,type:null});let m=!1,v=0;const y=[];for(let w=0;w<e.length;++w){const S=e[w];let C=null;if(Ot(S))S.spaceBefore&&y.push(""),Au(t,y,S.commentBefore,!1),S.comment&&(C=S.comment);else if(Dt(S)){const E=Ot(S.key)?S.key:null;E&&(E.spaceBefore&&y.push(""),Au(t,y,E.commentBefore,!1),E.comment&&(m=!0));const A=Ot(S.value)?S.value:null;A?(A.comment&&(C=A.comment),A.commentBefore&&(m=!0)):S.value==null&&E?.comment&&(C=E.comment)}C&&(m=!0);let k=Mr(S,p,()=>C=null);w<e.length-1&&(k+=","),C&&(k+=ga(k,a,f(C))),!m&&(y.length>v||k.includes(`
141
+ `+Gs(m(e),p),f&&f()):y&&d&&d(),b}function FM({items:e},t,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:c,flowCollectionPadding:d,options:{commentString:f}}=t;a+=c;const p=Object.assign({},t,{indent:a,inFlow:!0,type:null});let m=!1,v=0;const y=[];for(let w=0;w<e.length;++w){const S=e[w];let C=null;if(Ot(S))S.spaceBefore&&y.push(""),Eu(t,y,S.commentBefore,!1),S.comment&&(C=S.comment);else if(Dt(S)){const E=Ot(S.key)?S.key:null;E&&(E.spaceBefore&&y.push(""),Eu(t,y,E.commentBefore,!1),E.comment&&(m=!0));const R=Ot(S.value)?S.value:null;R?(R.comment&&(C=R.comment),R.commentBefore&&(m=!0)):S.value==null&&E?.comment&&(C=E.comment)}C&&(m=!0);let k=Lr(S,p,()=>C=null);w<e.length-1&&(k+=","),C&&(k+=ya(k,a,f(C))),!m&&(y.length>v||k.includes(`
142
142
  `))&&(m=!0),y.push(k),v=y.length}const{start:x,end:b}=s;if(y.length===0)return x+b;if(!m){const w=y.reduce((S,C)=>S+C.length+2,2);m=t.options.lineWidth>0&&w>t.options.lineWidth}if(m){let w=x;for(const S of y)w+=S?`
143
143
  ${c}${r}${S}`:`
144
144
  `;return`${w}
145
- ${r}${b}`}else return`${x}${d}${y.join(" ")}${d}${b}`}function Au({indent:e,options:{commentString:t}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const c=Gs(t(a),e);s.push(c.trimStart())}}function ya(e,t){const s=ft(t)?t.value:t;for(const a of e)if(Dt(a)&&(a.key===t||a.key===s||ft(a.key)&&a.key.value===s))return a}class Gn extends kN{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Mi,t),this.items=[]}static from(t,s,a){const{keepUndefined:r,replacer:c}=a,d=new this(t),f=(p,m)=>{if(typeof c=="function")m=c.call(s,p,m);else if(Array.isArray(c)&&!c.includes(p))return;(m!==void 0||r)&&d.items.push(Hp(p,m,a))};if(s instanceof Map)for(const[p,m]of s)f(p,m);else if(s&&typeof s=="object")for(const p of Object.keys(s))f(p,s[p]);return typeof t.sortMapEntries=="function"&&d.items.sort(t.sortMapEntries),d}add(t,s){let a;Dt(t)?a=t:!t||typeof t!="object"||!("key"in t)?a=new hn(t,t?.value):a=new hn(t.key,t.value);const r=ya(this.items,a.key),c=this.schema?.sortMapEntries;if(r){if(!s)throw new Error(`Key ${a.key} already set`);ft(r.value)&&CN(a.value)?r.value.value=a.value:r.value=a.value}else if(c){const d=this.items.findIndex(f=>c(a,f)<0);d===-1?this.items.push(a):this.items.splice(d,0,a)}else this.items.push(a)}delete(t){const s=ya(this.items,t);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(t,s){const r=ya(this.items,t)?.value;return(!s&&ft(r)?r.value:r)??void 0}has(t){return!!ya(this.items,t)}set(t,s){this.add(new hn(t,s),!0)}toJSON(t,s,a){const r=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(r);for(const c of this.items)AN(s,r,c);return r}toString(t,s,a){if(!t)return JSON.stringify(this);for(const r of this.items)if(!Dt(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),RN(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:a,onComment:s})}}const Gr={collection:"map",default:!0,nodeClass:Gn,tag:"tag:yaml.org,2002:map",resolve(e,t){return fl(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,s)=>Gn.from(e,t,s)};class ka extends kN{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(qr,t),this.items=[]}add(t){this.items.push(t)}delete(t){const s=Qc(t);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(t,s){const a=Qc(t);if(typeof a!="number")return;const r=this.items[a];return!s&&ft(r)?r.value:r}has(t){const s=Qc(t);return typeof s=="number"&&s<this.items.length}set(t,s){const a=Qc(t);if(typeof a!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[a];ft(r)&&CN(s)?r.value=s:this.items[a]=s}toJSON(t,s){const a=[];s?.onCreate&&s.onCreate(a);let r=0;for(const c of this.items)a.push(Fn(c,String(r++),s));return a}toString(t,s,a){return t?RN(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(t,s,a){const{replacer:r}=a,c=new this(t);if(s&&Symbol.iterator in Object(s)){let d=0;for(let f of s){if(typeof r=="function"){const p=s instanceof Set?f:String(d++);f=r.call(s,p,f)}c.items.push(rl(f,void 0,a))}}return c}}function Qc(e){let t=ft(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Fr={collection:"seq",default:!0,nodeClass:ka,tag:"tag:yaml.org,2002:seq",resolve(e,t){return hl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,s)=>ka.from(e,t,s)},td={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,s,a){return t=Object.assign({actualString:!0},t),qp(e,t,s,a)}},nd={identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ae(null),stringify:({source:e},t)=>typeof e=="string"&&nd.test.test(e)?e:t.options.nullStr},Gp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ae(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&Gp.test.test(e)){const a=e[0]==="t"||e[0]==="T";if(t===a)return e}return t?s.options.trueStr:s.options.falseStr}};function os({format:e,minFractionDigits:t,tag:s,value:a}){if(typeof a=="bigint")return String(a);const r=typeof a=="number"?a:Number(a);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let c=Object.is(a,-0)?"-0":JSON.stringify(a);if(!e&&t&&(!s||s==="tag:yaml.org,2002:float")&&/^\d/.test(c)){let d=c.indexOf(".");d<0&&(d=c.length,c+=".");let f=t-(c.length-d-1);for(;f-- >0;)c+="0"}return c}const TN={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:os},ON={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():os(e)}},DN={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 Ae(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-s-1),t},stringify:os},sd=e=>typeof e=="bigint"||Number.isInteger(e),Fp=(e,t,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),s);function LN(e,t,s){const{value:a}=e;return sd(a)&&a>=0?s+a.toString(t):os(e)}const MN={identify:e=>sd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Fp(e,2,8,s),stringify:e=>LN(e,8,"0o")},UN={identify:sd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Fp(e,0,10,s),stringify:os},$N={identify:e=>sd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Fp(e,2,16,s),stringify:e=>LN(e,16,"0x")},GM=[Gr,Fr,td,nd,Gp,MN,UN,$N,TN,ON,DN];function Mb(e){return typeof e=="bigint"||Number.isInteger(e)}const Yc=({value:e})=>JSON.stringify(e),FM=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Yc},{identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Yc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Yc},{identify:Mb,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>Mb(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:Yc}],ZM={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},KM=[Gr,Fr].concat(FM,ZM),Zp={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let r=0;r<s.length;++r)a[r]=s.charCodeAt(r);return a}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},a,r,c){if(!s)return"";const d=s;let f;if(typeof btoa=="function"){let p="";for(let m=0;m<d.length;++m)p+=String.fromCharCode(d[m]);f=btoa(p)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Ae.BLOCK_LITERAL),t!==Ae.QUOTE_DOUBLE){const p=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),m=Math.ceil(f.length/p),v=new Array(m);for(let y=0,x=0;y<m;++y,x+=p)v[y]=f.substr(x,p);f=v.join(t===Ae.BLOCK_LITERAL?`
146
- `:" ")}return qp({comment:e,type:t,value:f},a,r,c)}};function PN(e,t){if(hl(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!Dt(a)){if(fl(a)){a.items.length>1&&t("Each pair must have its own sequence indicator");const r=a.items[0]||new hn(new Ae(null));if(a.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${a.commentBefore}
145
+ ${r}${b}`}else return`${x}${d}${y.join(" ")}${d}${b}`}function Eu({indent:e,options:{commentString:t}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const c=Gs(t(a),e);s.push(c.trimStart())}}function va(e,t){const s=ft(t)?t.value:t;for(const a of e)if(Dt(a)&&(a.key===t||a.key===s||ft(a.key)&&a.key.value===s))return a}class Gn extends kN{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ui,t),this.items=[]}static from(t,s,a){const{keepUndefined:r,replacer:c}=a,d=new this(t),f=(p,m)=>{if(typeof c=="function")m=c.call(s,p,m);else if(Array.isArray(c)&&!c.includes(p))return;(m!==void 0||r)&&d.items.push(Hp(p,m,a))};if(s instanceof Map)for(const[p,m]of s)f(p,m);else if(s&&typeof s=="object")for(const p of Object.keys(s))f(p,s[p]);return typeof t.sortMapEntries=="function"&&d.items.sort(t.sortMapEntries),d}add(t,s){let a;Dt(t)?a=t:!t||typeof t!="object"||!("key"in t)?a=new hn(t,t?.value):a=new hn(t.key,t.value);const r=va(this.items,a.key),c=this.schema?.sortMapEntries;if(r){if(!s)throw new Error(`Key ${a.key} already set`);ft(r.value)&&CN(a.value)?r.value.value=a.value:r.value=a.value}else if(c){const d=this.items.findIndex(f=>c(a,f)<0);d===-1?this.items.push(a):this.items.splice(d,0,a)}else this.items.push(a)}delete(t){const s=va(this.items,t);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(t,s){const r=va(this.items,t)?.value;return(!s&&ft(r)?r.value:r)??void 0}has(t){return!!va(this.items,t)}set(t,s){this.add(new hn(t,s),!0)}toJSON(t,s,a){const r=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(r);for(const c of this.items)RN(s,r,c);return r}toString(t,s,a){if(!t)return JSON.stringify(this);for(const r of this.items)if(!Dt(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),AN(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:a,onComment:s})}}const Hr={collection:"map",default:!0,nodeClass:Gn,tag:"tag:yaml.org,2002:map",resolve(e,t){return dl(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,s)=>Gn.from(e,t,s)};class Ca extends kN{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Br,t),this.items=[]}add(t){this.items.push(t)}delete(t){const s=Vc(t);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(t,s){const a=Vc(t);if(typeof a!="number")return;const r=this.items[a];return!s&&ft(r)?r.value:r}has(t){const s=Vc(t);return typeof s=="number"&&s<this.items.length}set(t,s){const a=Vc(t);if(typeof a!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[a];ft(r)&&CN(s)?r.value=s:this.items[a]=s}toJSON(t,s){const a=[];s?.onCreate&&s.onCreate(a);let r=0;for(const c of this.items)a.push(Fn(c,String(r++),s));return a}toString(t,s,a){return t?AN(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(t,s,a){const{replacer:r}=a,c=new this(t);if(s&&Symbol.iterator in Object(s)){let d=0;for(let f of s){if(typeof r=="function"){const p=s instanceof Set?f:String(d++);f=r.call(s,p,f)}c.items.push(al(f,void 0,a))}}return c}}function Vc(e){let t=ft(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Gr={collection:"seq",default:!0,nodeClass:Ca,tag:"tag:yaml.org,2002:seq",resolve(e,t){return fl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,s)=>Ca.from(e,t,s)},ed={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,s,a){return t=Object.assign({actualString:!0},t),qp(e,t,s,a)}},td={identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Re(null),stringify:({source:e},t)=>typeof e=="string"&&td.test.test(e)?e:t.options.nullStr},Gp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Re(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&Gp.test.test(e)){const a=e[0]==="t"||e[0]==="T";if(t===a)return e}return t?s.options.trueStr:s.options.falseStr}};function os({format:e,minFractionDigits:t,tag:s,value:a}){if(typeof a=="bigint")return String(a);const r=typeof a=="number"?a:Number(a);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let c=Object.is(a,-0)?"-0":JSON.stringify(a);if(!e&&t&&(!s||s==="tag:yaml.org,2002:float")&&/^\d/.test(c)){let d=c.indexOf(".");d<0&&(d=c.length,c+=".");let f=t-(c.length-d-1);for(;f-- >0;)c+="0"}return c}const TN={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:os},ON={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():os(e)}},DN={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 Re(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-s-1),t},stringify:os},nd=e=>typeof e=="bigint"||Number.isInteger(e),Fp=(e,t,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),s);function LN(e,t,s){const{value:a}=e;return nd(a)&&a>=0?s+a.toString(t):os(e)}const MN={identify:e=>nd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Fp(e,2,8,s),stringify:e=>LN(e,8,"0o")},UN={identify:nd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Fp(e,0,10,s),stringify:os},$N={identify:e=>nd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Fp(e,2,16,s),stringify:e=>LN(e,16,"0x")},ZM=[Hr,Gr,ed,td,Gp,MN,UN,$N,TN,ON,DN];function Mb(e){return typeof e=="bigint"||Number.isInteger(e)}const Qc=({value:e})=>JSON.stringify(e),KM=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Qc},{identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Qc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Qc},{identify:Mb,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>Mb(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:Qc}],VM={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},QM=[Hr,Gr].concat(KM,VM),Zp={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let r=0;r<s.length;++r)a[r]=s.charCodeAt(r);return a}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},a,r,c){if(!s)return"";const d=s;let f;if(typeof btoa=="function"){let p="";for(let m=0;m<d.length;++m)p+=String.fromCharCode(d[m]);f=btoa(p)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Re.BLOCK_LITERAL),t!==Re.QUOTE_DOUBLE){const p=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),m=Math.ceil(f.length/p),v=new Array(m);for(let y=0,x=0;y<m;++y,x+=p)v[y]=f.substr(x,p);f=v.join(t===Re.BLOCK_LITERAL?`
146
+ `:" ")}return qp({comment:e,type:t,value:f},a,r,c)}};function PN(e,t){if(fl(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!Dt(a)){if(dl(a)){a.items.length>1&&t("Each pair must have its own sequence indicator");const r=a.items[0]||new hn(new Re(null));if(a.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${a.commentBefore}
147
147
  ${r.key.commentBefore}`:a.commentBefore),a.comment){const c=r.value??r.key;c.comment=c.comment?`${a.comment}
148
- ${c.comment}`:a.comment}a=r}e.items[s]=Dt(a)?a:new hn(a)}}else t("Expected a sequence for this tag");return e}function IN(e,t,s){const{replacer:a}=s,r=new ka(e);r.tag="tag:yaml.org,2002:pairs";let c=0;if(t&&Symbol.iterator in Object(t))for(let d of t){typeof a=="function"&&(d=a.call(t,String(c++),d));let f,p;if(Array.isArray(d))if(d.length===2)f=d[0],p=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const m=Object.keys(d);if(m.length===1)f=m[0],p=d[f];else throw new TypeError(`Expected tuple with one key, not ${m.length} keys`)}else f=d;r.items.push(Hp(f,p,s))}return r}const Kp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:PN,createNode:IN};class Ar extends ka{constructor(){super(),this.add=Gn.prototype.add.bind(this),this.delete=Gn.prototype.delete.bind(this),this.get=Gn.prototype.get.bind(this),this.has=Gn.prototype.has.bind(this),this.set=Gn.prototype.set.bind(this),this.tag=Ar.tag}toJSON(t,s){if(!s)return super.toJSON(t);const a=new Map;s?.onCreate&&s.onCreate(a);for(const r of this.items){let c,d;if(Dt(r)?(c=Fn(r.key,"",s),d=Fn(r.value,c,s)):c=Fn(r,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,d)}return a}static from(t,s,a){const r=IN(t,s,a),c=new this;return c.items=r.items,c}}Ar.tag="tag:yaml.org,2002:omap";const Vp={collection:"seq",identify:e=>e instanceof Map,nodeClass:Ar,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=PN(e,t),a=[];for(const{key:r}of s.items)ft(r)&&(a.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):a.push(r.value));return Object.assign(new Ar,s)},createNode:(e,t,s)=>Ar.from(e,t,s)};function BN({value:e,source:t},s){return t&&(e?qN:HN).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const qN={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 Ae(!0),stringify:BN},HN={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 Ae(!1),stringify:BN},VM={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:os},QM={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():os(e)}},YM={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 Ae(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){const a=e.substring(s+1).replace(/_/g,"");a[a.length-1]==="0"&&(t.minFractionDigits=a.length)}return t},stringify:os},ml=e=>typeof e=="bigint"||Number.isInteger(e);function id(e,t,s,{intAsBigInt:a}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),a){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const d=BigInt(e);return r==="-"?BigInt(-1)*d:d}const c=parseInt(e,s);return r==="-"?-1*c:c}function Qp(e,t,s){const{value:a}=e;if(ml(a)){const r=a.toString(t);return a<0?"-"+s+r.substr(1):s+r}return os(e)}const JM={identify:ml,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>id(e,2,2,s),stringify:e=>Qp(e,2,"0b")},XM={identify:ml,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>id(e,1,8,s),stringify:e=>Qp(e,8,"0")},WM={identify:ml,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>id(e,0,10,s),stringify:os},e3={identify:ml,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>id(e,2,16,s),stringify:e=>Qp(e,16,"0x")};class Rr extends Gn{constructor(t){super(t),this.tag=Rr.tag}add(t){let s;Dt(t)?s=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?s=new hn(t.key,null):s=new hn(t,null),ya(this.items,s.key)||this.items.push(s)}get(t,s){const a=ya(this.items,t);return!s&&Dt(a)?ft(a.key)?a.key.value:a.key:a}set(t,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const a=ya(this.items,t);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new hn(t))}toJSON(t,s){return super.toJSON(t,s,Set)}toString(t,s,a){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),s,a);throw new Error("Set items must all have null values")}static from(t,s,a){const{replacer:r}=a,c=new this(t);if(s&&Symbol.iterator in Object(s))for(let d of s)typeof r=="function"&&(d=r.call(s,d,d)),c.items.push(Hp(d,null,a));return c}}Rr.tag="tag:yaml.org,2002:set";const Yp={collection:"map",identify:e=>e instanceof Set,nodeClass:Rr,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>Rr.from(e,t,s),resolve(e,t){if(fl(e)){if(e.hasAllNullValues(!0))return Object.assign(new Rr,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Jp(e,t){const s=e[0],a=s==="-"||s==="+"?e.substring(1):e,r=d=>t?BigInt(d):Number(d),c=a.replace(/_/g,"").split(":").reduce((d,f)=>d*r(60)+r(f),r(0));return s==="-"?r(-1)*c:c}function GN(e){let{value:t}=e,s=d=>d;if(typeof t=="bigint")s=d=>BigInt(d);else if(isNaN(t)||!isFinite(t))return os(e);let a="";t<0&&(a="-",t*=s(-1));const r=s(60),c=[t%r];return t<60?c.unshift(0):(t=(t-c[0])/r,c.unshift(t%r),t>=60&&(t=(t-c[0])/r,c.unshift(t))),a+c.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const FN={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:s})=>Jp(e,s),stringify:GN},ZN={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=>Jp(e,!1),stringify:GN},ad={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(ad.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,r,c,d,f]=t.map(Number),p=t[7]?Number((t[7]+"00").substr(1,3)):0;let m=Date.UTC(s,a-1,r,c||0,d||0,f||0,p);const v=t[8];if(v&&v!=="Z"){let y=Jp(v,!1);Math.abs(y)<30&&(y*=60),m-=6e4*y}return new Date(m)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Ub=[Gr,Fr,td,nd,qN,HN,JM,XM,WM,e3,VM,QM,YM,Zp,Fs,Vp,Kp,Yp,FN,ZN,ad],$b=new Map([["core",GM],["failsafe",[Gr,Fr,td]],["json",KM],["yaml11",Ub],["yaml-1.1",Ub]]),Pb={binary:Zp,bool:Gp,float:DN,floatExp:ON,floatNaN:TN,floatTime:ZN,int:UN,intHex:$N,intOct:MN,intTime:FN,map:Gr,merge:Fs,null:nd,omap:Vp,pairs:Kp,seq:Fr,set:Yp,timestamp:ad},t3={"tag:yaml.org,2002:binary":Zp,"tag:yaml.org,2002:merge":Fs,"tag:yaml.org,2002:omap":Vp,"tag:yaml.org,2002:pairs":Kp,"tag:yaml.org,2002:set":Yp,"tag:yaml.org,2002:timestamp":ad};function Qh(e,t,s){const a=$b.get(t);if(a&&!e)return s&&!a.includes(Fs)?a.concat(Fs):a.slice();let r=a;if(!r)if(Array.isArray(e))r=[];else{const c=Array.from($b.keys()).filter(d=>d!=="yaml11").map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)r=r.concat(c);else typeof e=="function"&&(r=e(r.slice()));return s&&(r=r.concat(Fs)),r.reduce((c,d)=>{const f=typeof d=="string"?Pb[d]:d;if(!f){const p=JSON.stringify(d),m=Object.keys(Pb).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${p}; use one of ${m}`)}return c.includes(f)||c.push(f),c},[])}const n3=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Xp{constructor({compat:t,customTags:s,merge:a,resolveKnownTags:r,schema:c,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(t)?Qh(t,"compat"):t?Qh(null,t):null,this.name=typeof c=="string"&&c||"core",this.knownTags=r?t3:{},this.tags=Qh(s,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,Mi,{value:Gr}),Object.defineProperty(this,bs,{value:td}),Object.defineProperty(this,qr,{value:Fr}),this.sortMapEntries=typeof d=="function"?d:d===!0?n3:null}clone(){const t=Object.create(Xp.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function s3(e,t){const s=[];let a=t.directives===!0;if(t.directives!==!1&&e.directives){const p=e.directives.toString(e);p?(s.push(p),a=!0):e.directives.docStart&&(a=!0)}a&&s.push("---");const r=zN(e,t),{commentString:c}=r.options;if(e.commentBefore){s.length!==1&&s.unshift("");const p=c(e.commentBefore);s.unshift(Gs(p,""))}let d=!1,f=null;if(e.contents){if(Ot(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const v=c(e.contents.commentBefore);s.push(Gs(v,""))}r.forceBlockIndent=!!e.comment,f=e.contents.comment}const p=f?void 0:()=>d=!0;let m=Mr(e.contents,r,()=>f=null,p);f&&(m+=ga(m,"",c(f))),(m[0]==="|"||m[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${m}`:s.push(m)}else s.push(Mr(e.contents,r));if(e.directives?.docEnd)if(e.comment){const p=c(e.comment);p.includes(`
148
+ ${c.comment}`:a.comment}a=r}e.items[s]=Dt(a)?a:new hn(a)}}else t("Expected a sequence for this tag");return e}function IN(e,t,s){const{replacer:a}=s,r=new Ca(e);r.tag="tag:yaml.org,2002:pairs";let c=0;if(t&&Symbol.iterator in Object(t))for(let d of t){typeof a=="function"&&(d=a.call(t,String(c++),d));let f,p;if(Array.isArray(d))if(d.length===2)f=d[0],p=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const m=Object.keys(d);if(m.length===1)f=m[0],p=d[f];else throw new TypeError(`Expected tuple with one key, not ${m.length} keys`)}else f=d;r.items.push(Hp(f,p,s))}return r}const Kp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:PN,createNode:IN};class Er extends Ca{constructor(){super(),this.add=Gn.prototype.add.bind(this),this.delete=Gn.prototype.delete.bind(this),this.get=Gn.prototype.get.bind(this),this.has=Gn.prototype.has.bind(this),this.set=Gn.prototype.set.bind(this),this.tag=Er.tag}toJSON(t,s){if(!s)return super.toJSON(t);const a=new Map;s?.onCreate&&s.onCreate(a);for(const r of this.items){let c,d;if(Dt(r)?(c=Fn(r.key,"",s),d=Fn(r.value,c,s)):c=Fn(r,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,d)}return a}static from(t,s,a){const r=IN(t,s,a),c=new this;return c.items=r.items,c}}Er.tag="tag:yaml.org,2002:omap";const Vp={collection:"seq",identify:e=>e instanceof Map,nodeClass:Er,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=PN(e,t),a=[];for(const{key:r}of s.items)ft(r)&&(a.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):a.push(r.value));return Object.assign(new Er,s)},createNode:(e,t,s)=>Er.from(e,t,s)};function BN({value:e,source:t},s){return t&&(e?qN:HN).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const qN={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 Re(!0),stringify:BN},HN={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 Re(!1),stringify:BN},YM={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:os},JM={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():os(e)}},XM={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 Re(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){const a=e.substring(s+1).replace(/_/g,"");a[a.length-1]==="0"&&(t.minFractionDigits=a.length)}return t},stringify:os},hl=e=>typeof e=="bigint"||Number.isInteger(e);function sd(e,t,s,{intAsBigInt:a}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),a){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const d=BigInt(e);return r==="-"?BigInt(-1)*d:d}const c=parseInt(e,s);return r==="-"?-1*c:c}function Qp(e,t,s){const{value:a}=e;if(hl(a)){const r=a.toString(t);return a<0?"-"+s+r.substr(1):s+r}return os(e)}const WM={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>sd(e,2,2,s),stringify:e=>Qp(e,2,"0b")},e3={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>sd(e,1,8,s),stringify:e=>Qp(e,8,"0")},t3={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>sd(e,0,10,s),stringify:os},n3={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>sd(e,2,16,s),stringify:e=>Qp(e,16,"0x")};class Rr extends Gn{constructor(t){super(t),this.tag=Rr.tag}add(t){let s;Dt(t)?s=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?s=new hn(t.key,null):s=new hn(t,null),va(this.items,s.key)||this.items.push(s)}get(t,s){const a=va(this.items,t);return!s&&Dt(a)?ft(a.key)?a.key.value:a.key:a}set(t,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const a=va(this.items,t);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new hn(t))}toJSON(t,s){return super.toJSON(t,s,Set)}toString(t,s,a){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),s,a);throw new Error("Set items must all have null values")}static from(t,s,a){const{replacer:r}=a,c=new this(t);if(s&&Symbol.iterator in Object(s))for(let d of s)typeof r=="function"&&(d=r.call(s,d,d)),c.items.push(Hp(d,null,a));return c}}Rr.tag="tag:yaml.org,2002:set";const Yp={collection:"map",identify:e=>e instanceof Set,nodeClass:Rr,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>Rr.from(e,t,s),resolve(e,t){if(dl(e)){if(e.hasAllNullValues(!0))return Object.assign(new Rr,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Jp(e,t){const s=e[0],a=s==="-"||s==="+"?e.substring(1):e,r=d=>t?BigInt(d):Number(d),c=a.replace(/_/g,"").split(":").reduce((d,f)=>d*r(60)+r(f),r(0));return s==="-"?r(-1)*c:c}function GN(e){let{value:t}=e,s=d=>d;if(typeof t=="bigint")s=d=>BigInt(d);else if(isNaN(t)||!isFinite(t))return os(e);let a="";t<0&&(a="-",t*=s(-1));const r=s(60),c=[t%r];return t<60?c.unshift(0):(t=(t-c[0])/r,c.unshift(t%r),t>=60&&(t=(t-c[0])/r,c.unshift(t))),a+c.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const FN={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:s})=>Jp(e,s),stringify:GN},ZN={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=>Jp(e,!1),stringify:GN},id={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(id.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,r,c,d,f]=t.map(Number),p=t[7]?Number((t[7]+"00").substr(1,3)):0;let m=Date.UTC(s,a-1,r,c||0,d||0,f||0,p);const v=t[8];if(v&&v!=="Z"){let y=Jp(v,!1);Math.abs(y)<30&&(y*=60),m-=6e4*y}return new Date(m)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Ub=[Hr,Gr,ed,td,qN,HN,WM,e3,t3,n3,YM,JM,XM,Zp,Fs,Vp,Kp,Yp,FN,ZN,id],$b=new Map([["core",ZM],["failsafe",[Hr,Gr,ed]],["json",QM],["yaml11",Ub],["yaml-1.1",Ub]]),Pb={binary:Zp,bool:Gp,float:DN,floatExp:ON,floatNaN:TN,floatTime:ZN,int:UN,intHex:$N,intOct:MN,intTime:FN,map:Hr,merge:Fs,null:td,omap:Vp,pairs:Kp,seq:Gr,set:Yp,timestamp:id},s3={"tag:yaml.org,2002:binary":Zp,"tag:yaml.org,2002:merge":Fs,"tag:yaml.org,2002:omap":Vp,"tag:yaml.org,2002:pairs":Kp,"tag:yaml.org,2002:set":Yp,"tag:yaml.org,2002:timestamp":id};function Vh(e,t,s){const a=$b.get(t);if(a&&!e)return s&&!a.includes(Fs)?a.concat(Fs):a.slice();let r=a;if(!r)if(Array.isArray(e))r=[];else{const c=Array.from($b.keys()).filter(d=>d!=="yaml11").map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)r=r.concat(c);else typeof e=="function"&&(r=e(r.slice()));return s&&(r=r.concat(Fs)),r.reduce((c,d)=>{const f=typeof d=="string"?Pb[d]:d;if(!f){const p=JSON.stringify(d),m=Object.keys(Pb).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${p}; use one of ${m}`)}return c.includes(f)||c.push(f),c},[])}const i3=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Xp{constructor({compat:t,customTags:s,merge:a,resolveKnownTags:r,schema:c,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(t)?Vh(t,"compat"):t?Vh(null,t):null,this.name=typeof c=="string"&&c||"core",this.knownTags=r?s3:{},this.tags=Vh(s,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,Ui,{value:Hr}),Object.defineProperty(this,bs,{value:ed}),Object.defineProperty(this,Br,{value:Gr}),this.sortMapEntries=typeof d=="function"?d:d===!0?i3:null}clone(){const t=Object.create(Xp.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function a3(e,t){const s=[];let a=t.directives===!0;if(t.directives!==!1&&e.directives){const p=e.directives.toString(e);p?(s.push(p),a=!0):e.directives.docStart&&(a=!0)}a&&s.push("---");const r=zN(e,t),{commentString:c}=r.options;if(e.commentBefore){s.length!==1&&s.unshift("");const p=c(e.commentBefore);s.unshift(Gs(p,""))}let d=!1,f=null;if(e.contents){if(Ot(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const v=c(e.contents.commentBefore);s.push(Gs(v,""))}r.forceBlockIndent=!!e.comment,f=e.contents.comment}const p=f?void 0:()=>d=!0;let m=Lr(e.contents,r,()=>f=null,p);f&&(m+=ya(m,"",c(f))),(m[0]==="|"||m[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${m}`:s.push(m)}else s.push(Lr(e.contents,r));if(e.directives?.docEnd)if(e.comment){const p=c(e.comment);p.includes(`
149
149
  `)?(s.push("..."),s.push(Gs(p,""))):s.push(`... ${p}`)}else s.push("...");else{let p=e.comment;p&&d&&(p=p.replace(/^\n+/,"")),p&&((!d||f)&&s[s.length-1]!==""&&s.push(""),s.push(Gs(c(p),"")))}return s.join(`
150
150
  `)+`
151
- `}class rd{constructor(t,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Zn,{value:Mm});let r=null;typeof s=="function"||Array.isArray(s)?r=s:a===void 0&&s&&(a=s,s=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=c;let{version:d}=c;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(d=this.directives.yaml.version)):this.directives=new dn({version:d}),this.setSchema(d,a),this.contents=t===void 0?null:this.createNode(t,r,a)}clone(){const t=Object.create(rd.prototype,{[Zn]:{value:Mm}});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=Ot(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){br(this.contents)&&this.contents.add(t)}addIn(t,s){br(this.contents)&&this.contents.addIn(t,s)}createAlias(t,s){if(!t.anchor){const a=wN(this);t.anchor=!s||a.has(s)?NN(s||"a",a):s}return new Bp(t.anchor)}createNode(t,s,a){let r;if(typeof s=="function")t=s.call({"":t},"",t),r=s;else if(Array.isArray(s)){const C=E=>typeof E=="number"||E instanceof String||E instanceof Number,k=s.filter(C).map(String);k.length>0&&(s=s.concat(k)),r=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:f,keepUndefined:p,onTagObj:m,tag:v}=a??{},{onAnchor:y,setAnchors:x,sourceObjects:b}=AM(this,d||"a"),w={aliasDuplicateObjects:c??!0,keepUndefined:p??!1,onAnchor:y,onTagObj:m,replacer:r,schema:this.schema,sourceObjects:b},S=rl(t,v,w);return f&&Tt(S)&&(S.flow=!0),x(),S}createPair(t,s,a={}){const r=this.createNode(t,null,a),c=this.createNode(s,null,a);return new hn(r,c)}delete(t){return br(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Fo(t)?this.contents==null?!1:(this.contents=null,!0):br(this.contents)?this.contents.deleteIn(t):!1}get(t,s){return Tt(this.contents)?this.contents.get(t,s):void 0}getIn(t,s){return Fo(t)?!s&&ft(this.contents)?this.contents.value:this.contents:Tt(this.contents)?this.contents.getIn(t,s):void 0}has(t){return Tt(this.contents)?this.contents.has(t):!1}hasIn(t){return Fo(t)?this.contents!==void 0:Tt(this.contents)?this.contents.hasIn(t):!1}set(t,s){this.contents==null?this.contents=Eu(this.schema,[t],s):br(this.contents)&&this.contents.set(t,s)}setIn(t,s){Fo(t)?this.contents=s:this.contents==null?this.contents=Eu(this.schema,Array.from(t),s):br(this.contents)&&this.contents.setIn(t,s)}setSchema(t,s={}){typeof t=="number"&&(t=String(t));let a;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new dn({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new dn({version:t}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new Xp(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:s,mapAsMap:a,maxAliasCount:r,onAnchor:c,reviver:d}={}){const f={anchors:new Map,doc:this,keep:!t,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},p=Fn(this.contents,s??"",f);if(typeof c=="function")for(const{count:m,res:v}of f.anchors.values())c(v,m);return typeof d=="function"?kr(d,{"":p},"",p):p}toJSON(t,s){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:s})}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 s=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return s3(this,t)}}function br(e){if(Tt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class KN extends Error{constructor(t,s,a,r){super(),this.name=t,this.code=a,this.message=r,this.pos=s}}class Jc extends KN{constructor(t,s,a){super("YAMLParseError",t,s,a)}}class i3 extends KN{constructor(t,s,a){super("YAMLWarning",t,s,a)}}const Ib=(e,t)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(f=>t.linePos(f));const{line:a,col:r}=s.linePos[0];s.message+=` at line ${a}, column ${r}`;let c=r-1,d=e.substring(t.lineStarts[a-1],t.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&d.length>80){const f=Math.min(c-39,d.length-79);d="…"+d.substring(f),c-=f-1}if(d.length>80&&(d=d.substring(0,79)+"…"),a>1&&/^ *$/.test(d.substring(0,c))){let f=e.substring(t.lineStarts[a-2],t.lineStarts[a-1]);f.length>80&&(f=f.substring(0,79)+`…
151
+ `}class ad{constructor(t,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Zn,{value:Mm});let r=null;typeof s=="function"||Array.isArray(s)?r=s:a===void 0&&s&&(a=s,s=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=c;let{version:d}=c;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(d=this.directives.yaml.version)):this.directives=new dn({version:d}),this.setSchema(d,a),this.contents=t===void 0?null:this.createNode(t,r,a)}clone(){const t=Object.create(ad.prototype,{[Zn]:{value:Mm}});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=Ot(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){xr(this.contents)&&this.contents.add(t)}addIn(t,s){xr(this.contents)&&this.contents.addIn(t,s)}createAlias(t,s){if(!t.anchor){const a=wN(this);t.anchor=!s||a.has(s)?NN(s||"a",a):s}return new Bp(t.anchor)}createNode(t,s,a){let r;if(typeof s=="function")t=s.call({"":t},"",t),r=s;else if(Array.isArray(s)){const C=E=>typeof E=="number"||E instanceof String||E instanceof Number,k=s.filter(C).map(String);k.length>0&&(s=s.concat(k)),r=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:f,keepUndefined:p,onTagObj:m,tag:v}=a??{},{onAnchor:y,setAnchors:x,sourceObjects:b}=TM(this,d||"a"),w={aliasDuplicateObjects:c??!0,keepUndefined:p??!1,onAnchor:y,onTagObj:m,replacer:r,schema:this.schema,sourceObjects:b},S=al(t,v,w);return f&&Tt(S)&&(S.flow=!0),x(),S}createPair(t,s,a={}){const r=this.createNode(t,null,a),c=this.createNode(s,null,a);return new hn(r,c)}delete(t){return xr(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Go(t)?this.contents==null?!1:(this.contents=null,!0):xr(this.contents)?this.contents.deleteIn(t):!1}get(t,s){return Tt(this.contents)?this.contents.get(t,s):void 0}getIn(t,s){return Go(t)?!s&&ft(this.contents)?this.contents.value:this.contents:Tt(this.contents)?this.contents.getIn(t,s):void 0}has(t){return Tt(this.contents)?this.contents.has(t):!1}hasIn(t){return Go(t)?this.contents!==void 0:Tt(this.contents)?this.contents.hasIn(t):!1}set(t,s){this.contents==null?this.contents=zu(this.schema,[t],s):xr(this.contents)&&this.contents.set(t,s)}setIn(t,s){Go(t)?this.contents=s:this.contents==null?this.contents=zu(this.schema,Array.from(t),s):xr(this.contents)&&this.contents.setIn(t,s)}setSchema(t,s={}){typeof t=="number"&&(t=String(t));let a;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new dn({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new dn({version:t}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new Xp(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:s,mapAsMap:a,maxAliasCount:r,onAnchor:c,reviver:d}={}){const f={anchors:new Map,doc:this,keep:!t,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},p=Fn(this.contents,s??"",f);if(typeof c=="function")for(const{count:m,res:v}of f.anchors.values())c(v,m);return typeof d=="function"?Cr(d,{"":p},"",p):p}toJSON(t,s){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:s})}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 s=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return a3(this,t)}}function xr(e){if(Tt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class KN extends Error{constructor(t,s,a,r){super(),this.name=t,this.code=a,this.message=r,this.pos=s}}class Yc extends KN{constructor(t,s,a){super("YAMLParseError",t,s,a)}}class r3 extends KN{constructor(t,s,a){super("YAMLWarning",t,s,a)}}const Ib=(e,t)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(f=>t.linePos(f));const{line:a,col:r}=s.linePos[0];s.message+=` at line ${a}, column ${r}`;let c=r-1,d=e.substring(t.lineStarts[a-1],t.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&d.length>80){const f=Math.min(c-39,d.length-79);d="…"+d.substring(f),c-=f-1}if(d.length>80&&(d=d.substring(0,79)+"…"),a>1&&/^ *$/.test(d.substring(0,c))){let f=e.substring(t.lineStarts[a-2],t.lineStarts[a-1]);f.length>80&&(f=f.substring(0,79)+`…
152
152
  `),d=f+d}if(/[^ ]/.test(d)){let f=1;const p=s.linePos[1];p?.line===a&&p.col>r&&(f=Math.max(1,Math.min(p.col-r,80-c)));const m=" ".repeat(c)+"^".repeat(f);s.message+=`:
153
153
 
154
154
  ${d}
155
155
  ${m}
156
- `}};function Ur(e,{flow:t,indicator:s,next:a,offset:r,onError:c,parentIndent:d,startOnNewline:f}){let p=!1,m=f,v=f,y="",x="",b=!1,w=!1,S=null,C=null,k=null,E=null,A=null,z=null,L=null;for(const T of e)switch(w&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&c(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),S&&(m&&T.type!=="comment"&&T.type!=="newline"&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),T.type){case"space":!t&&(s!=="doc-start"||a?.type!=="flow-collection")&&T.source.includes(" ")&&(S=T),v=!0;break;case"comment":{v||c(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const P=T.source.substring(1)||" ";y?y+=x+P:y=P,x="",m=!1;break}case"newline":m?y?y+=T.source:(!z||s!=="seq-item-ind")&&(p=!0):x+=T.source,m=!0,b=!0,(C||k)&&(E=T),v=!0;break;case"anchor":C&&c(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&c(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),C=T,L??(L=T.offset),m=!1,v=!1,w=!0;break;case"tag":{k&&c(T,"MULTIPLE_TAGS","A node can have at most one tag"),k=T,L??(L=T.offset),m=!1,v=!1,w=!0;break}case s:(C||k)&&c(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),z&&c(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`),z=T,m=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(t){A&&c(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),A=T,m=!1,v=!1;break}default:c(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),m=!1,v=!1}const M=e[e.length-1],R=M?M.offset+M.source.length:r;return w&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&c(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(m&&S.indent<=d||a?.type==="block-map"||a?.type==="block-seq")&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:A,found:z,spaceBefore:p,comment:y,hasNewline:b,anchor:C,tag:k,newlineAfterProp:E,end:R,start:L??R}}function ol(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
157
- `))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 s of t.start)if(s.type==="newline")return!0;if(t.sep){for(const s of t.sep)if(s.type==="newline")return!0}if(ol(t.key)||ol(t.value))return!0}return!1;default:return!0}}function Im(e,t,s){if(t?.type==="flow-collection"){const a=t.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&ol(t)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function VN(e,t,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const r=typeof a=="function"?a:(c,d)=>c===d||ft(c)&&ft(d)&&c.value===d.value;return t.some(c=>r(c.key,s))}const Bb="All mapping items must start at the same column";function a3({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Gn,f=new d(s.schema);s.atRoot&&(s.atRoot=!1);let p=a.offset,m=null;for(const v of a.items){const{start:y,key:x,sep:b,value:w}=v,S=Ur(y,{indicator:"explicit-key-ind",next:x??b?.[0],offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0}),C=!S.found;if(C){if(x&&(x.type==="block-seq"?r(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in x&&x.indent!==a.indent&&r(p,"BAD_INDENT",Bb)),!S.anchor&&!S.tag&&!b){m=S.end,S.comment&&(f.comment?f.comment+=`
158
- `+S.comment:f.comment=S.comment);continue}(S.newlineAfterProp||ol(x))&&r(x??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==a.indent&&r(p,"BAD_INDENT",Bb);s.atKey=!0;const k=S.end,E=x?e(s,x,S,r):t(s,k,y,null,S,r);s.schema.compat&&Im(a.indent,x,r),s.atKey=!1,VN(s,f.items,E)&&r(k,"DUPLICATE_KEY","Map keys must be unique");const A=Ur(b??[],{indicator:"map-value-ind",next:w,offset:E.range[2],onError:r,parentIndent:a.indent,startOnNewline:!x||x.type==="block-scalar"});if(p=A.end,A.found){C&&(w?.type==="block-map"&&!A.hasNewline&&r(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&S.start<A.found.offset-1024&&r(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const z=w?e(s,w,A,r):t(s,p,b,null,A,r);s.schema.compat&&Im(a.indent,w,r),p=z.range[2];const L=new hn(E,z);s.options.keepSourceTokens&&(L.srcToken=v),f.items.push(L)}else{C&&r(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(E.comment?E.comment+=`
159
- `+A.comment:E.comment=A.comment);const z=new hn(E);s.options.keepSourceTokens&&(z.srcToken=v),f.items.push(z)}}return m&&m<p&&r(m,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,p,m??p],f}function r3({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??ka,f=new d(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let p=a.offset,m=null;for(const{start:v,value:y}of a.items){const x=Ur(v,{indicator:"seq-item-ind",next:y,offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0});if(!x.found)if(x.anchor||x.tag||y)y?.type==="block-seq"?r(x.end,"BAD_INDENT","All sequence items must start at the same column"):r(p,"MISSING_CHAR","Sequence item without - indicator");else{m=x.end,x.comment&&(f.comment=x.comment);continue}const b=y?e(s,y,x,r):t(s,x.end,v,null,x,r);s.schema.compat&&Im(a.indent,y,r),p=b.range[2],f.items.push(b)}return f.range=[a.offset,p,m??p],f}function pl(e,t,s,a){let r="";if(e){let c=!1,d="";for(const f of e){const{source:p,type:m}=f;switch(m){case"space":c=!0;break;case"comment":{s&&!c&&a(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=p.substring(1)||" ";r?r+=d+v:r=v,d="";break}case"newline":r&&(d+=p),c=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${m} at node end`)}t+=p.length}}return{comment:r,offset:t}}const Yh="Block collections are not allowed within flow collections",Jh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function o3({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=a.start.source==="{",f=d?"flow map":"flow sequence",p=c?.nodeClass??(d?Gn:ka),m=new p(s.schema);m.flow=!0;const v=s.atRoot;v&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let y=a.offset+a.start.source.length;for(let C=0;C<a.items.length;++C){const k=a.items[C],{start:E,key:A,sep:z,value:L}=k,M=Ur(E,{flow:f,indicator:"explicit-key-ind",next:A??z?.[0],offset:y,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!z&&!L){C===0&&M.comma?r(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):C<a.items.length-1&&r(M.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),M.comment&&(m.comment?m.comment+=`
160
- `+M.comment:m.comment=M.comment),y=M.end;continue}!d&&s.options.strict&&ol(A)&&r(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)M.comma&&r(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(M.comma||r(M.start,"MISSING_CHAR",`Missing , between ${f} items`),M.comment){let R="";e:for(const T of E)switch(T.type){case"comma":case"space":break;case"comment":R=T.source.substring(1);break e;default:break e}if(R){let T=m.items[m.items.length-1];Dt(T)&&(T=T.value??T.key),T.comment?T.comment+=`
161
- `+R:T.comment=R,M.comment=M.comment.substring(R.length+1)}}if(!d&&!z&&!M.found){const R=L?e(s,L,M,r):t(s,M.end,z,null,M,r);m.items.push(R),y=R.range[2],Jh(L)&&r(R.range,"BLOCK_IN_FLOW",Yh)}else{s.atKey=!0;const R=M.end,T=A?e(s,A,M,r):t(s,R,E,null,M,r);Jh(A)&&r(T.range,"BLOCK_IN_FLOW",Yh),s.atKey=!1;const P=Ur(z??[],{flow:f,indicator:"map-value-ind",next:L,offset:T.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(P.found){if(!d&&!M.found&&s.options.strict){if(z)for(const se of z){if(se===P.found)break;if(se.type==="newline"){r(se,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}M.start<P.found.offset-1024&&r(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else L&&("source"in L&&L.source?.[0]===":"?r(L,"MISSING_CHAR",`Missing space after : in ${f}`):r(P.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const J=L?e(s,L,P,r):P.found?t(s,P.end,z,null,P,r):null;J?Jh(L)&&r(J.range,"BLOCK_IN_FLOW",Yh):P.comment&&(T.comment?T.comment+=`
162
- `+P.comment:T.comment=P.comment);const Q=new hn(T,J);if(s.options.keepSourceTokens&&(Q.srcToken=k),d){const se=m;VN(s,se.items,T)&&r(R,"DUPLICATE_KEY","Map keys must be unique"),se.items.push(Q)}else{const se=new Gn(s.schema);se.flow=!0,se.items.push(Q);const pe=(J??T).range;se.range=[T.range[0],pe[1],pe[2]],m.items.push(se)}y=J?J.range[2]:P.end}}const x=d?"}":"]",[b,...w]=a.end;let S=y;if(b?.source===x)S=b.offset+b.source.length;else{const C=f[0].toUpperCase()+f.substring(1),k=v?`${C} must end with a ${x}`:`${C} in block collection must be sufficiently indented and end with a ${x}`;r(y,v?"MISSING_CHAR":"BAD_INDENT",k),b&&b.source.length!==1&&w.unshift(b)}if(w.length>0){const C=pl(w,S,s.options.strict,r);C.comment&&(m.comment?m.comment+=`
163
- `+C.comment:m.comment=C.comment),m.range=[a.offset,S,C.offset]}else m.range=[a.offset,S,S];return m}function Xh(e,t,s,a,r,c){const d=s.type==="block-map"?a3(e,t,s,a,c):s.type==="block-seq"?r3(e,t,s,a,c):o3(e,t,s,a,c),f=d.constructor;return r==="!"||r===f.tagName?(d.tag=f.tagName,d):(r&&(d.tag=r),d)}function l3(e,t,s,a,r){const c=a.tag,d=c?t.directives.tagName(c.source,x=>r(c,"TAG_RESOLVE_FAILED",x)):null;if(s.type==="block-seq"){const{anchor:x,newlineAfterProp:b}=a,w=x&&c?x.offset>c.offset?x:c:x??c;w&&(!b||b.offset<w.offset)&&r(w,"MISSING_CHAR","Missing newline after block sequence props")}const f=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!c||!d||d==="!"||d===Gn.tagName&&f==="map"||d===ka.tagName&&f==="seq")return Xh(e,t,s,r,d);let p=t.schema.tags.find(x=>x.tag===d&&x.collection===f);if(!p){const x=t.schema.knownTags[d];if(x?.collection===f)t.schema.tags.push(Object.assign({},x,{default:!1})),p=x;else return x?r(c,"BAD_COLLECTION_TYPE",`${x.tag} used for ${f} collection, but expects ${x.collection??"scalar"}`,!0):r(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),Xh(e,t,s,r,d)}const m=Xh(e,t,s,r,d,p),v=p.resolve?.(m,x=>r(c,"TAG_RESOLVE_FAILED",x),t.options)??m,y=Ot(v)?v:new Ae(v);return y.range=m.range,y.tag=d,p?.format&&(y.format=p.format),y}function c3(e,t,s){const a=t.offset,r=u3(t,e.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const c=r.mode===">"?Ae.BLOCK_FOLDED:Ae.BLOCK_LITERAL,d=t.source?d3(t.source):[];let f=d.length;for(let S=d.length-1;S>=0;--S){const C=d[S][1];if(C===""||C==="\r")f=S;else break}if(f===0){const S=r.chomp==="+"&&d.length>0?`
156
+ `}};function Mr(e,{flow:t,indicator:s,next:a,offset:r,onError:c,parentIndent:d,startOnNewline:f}){let p=!1,m=f,v=f,y="",x="",b=!1,w=!1,S=null,C=null,k=null,E=null,R=null,z=null,L=null;for(const T of e)switch(w&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&c(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),S&&(m&&T.type!=="comment"&&T.type!=="newline"&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),T.type){case"space":!t&&(s!=="doc-start"||a?.type!=="flow-collection")&&T.source.includes(" ")&&(S=T),v=!0;break;case"comment":{v||c(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const P=T.source.substring(1)||" ";y?y+=x+P:y=P,x="",m=!1;break}case"newline":m?y?y+=T.source:(!z||s!=="seq-item-ind")&&(p=!0):x+=T.source,m=!0,b=!0,(C||k)&&(E=T),v=!0;break;case"anchor":C&&c(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&c(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),C=T,L??(L=T.offset),m=!1,v=!1,w=!0;break;case"tag":{k&&c(T,"MULTIPLE_TAGS","A node can have at most one tag"),k=T,L??(L=T.offset),m=!1,v=!1,w=!0;break}case s:(C||k)&&c(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),z&&c(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`),z=T,m=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(t){R&&c(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),R=T,m=!1,v=!1;break}default:c(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),m=!1,v=!1}const M=e[e.length-1],A=M?M.offset+M.source.length:r;return w&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&c(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(m&&S.indent<=d||a?.type==="block-map"||a?.type==="block-seq")&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:R,found:z,spaceBefore:p,comment:y,hasNewline:b,anchor:C,tag:k,newlineAfterProp:E,end:A,start:L??A}}function rl(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
157
+ `))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 s of t.start)if(s.type==="newline")return!0;if(t.sep){for(const s of t.sep)if(s.type==="newline")return!0}if(rl(t.key)||rl(t.value))return!0}return!1;default:return!0}}function Im(e,t,s){if(t?.type==="flow-collection"){const a=t.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&rl(t)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function VN(e,t,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const r=typeof a=="function"?a:(c,d)=>c===d||ft(c)&&ft(d)&&c.value===d.value;return t.some(c=>r(c.key,s))}const Bb="All mapping items must start at the same column";function o3({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Gn,f=new d(s.schema);s.atRoot&&(s.atRoot=!1);let p=a.offset,m=null;for(const v of a.items){const{start:y,key:x,sep:b,value:w}=v,S=Mr(y,{indicator:"explicit-key-ind",next:x??b?.[0],offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0}),C=!S.found;if(C){if(x&&(x.type==="block-seq"?r(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in x&&x.indent!==a.indent&&r(p,"BAD_INDENT",Bb)),!S.anchor&&!S.tag&&!b){m=S.end,S.comment&&(f.comment?f.comment+=`
158
+ `+S.comment:f.comment=S.comment);continue}(S.newlineAfterProp||rl(x))&&r(x??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==a.indent&&r(p,"BAD_INDENT",Bb);s.atKey=!0;const k=S.end,E=x?e(s,x,S,r):t(s,k,y,null,S,r);s.schema.compat&&Im(a.indent,x,r),s.atKey=!1,VN(s,f.items,E)&&r(k,"DUPLICATE_KEY","Map keys must be unique");const R=Mr(b??[],{indicator:"map-value-ind",next:w,offset:E.range[2],onError:r,parentIndent:a.indent,startOnNewline:!x||x.type==="block-scalar"});if(p=R.end,R.found){C&&(w?.type==="block-map"&&!R.hasNewline&&r(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&S.start<R.found.offset-1024&&r(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const z=w?e(s,w,R,r):t(s,p,b,null,R,r);s.schema.compat&&Im(a.indent,w,r),p=z.range[2];const L=new hn(E,z);s.options.keepSourceTokens&&(L.srcToken=v),f.items.push(L)}else{C&&r(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),R.comment&&(E.comment?E.comment+=`
159
+ `+R.comment:E.comment=R.comment);const z=new hn(E);s.options.keepSourceTokens&&(z.srcToken=v),f.items.push(z)}}return m&&m<p&&r(m,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,p,m??p],f}function l3({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Ca,f=new d(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let p=a.offset,m=null;for(const{start:v,value:y}of a.items){const x=Mr(v,{indicator:"seq-item-ind",next:y,offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0});if(!x.found)if(x.anchor||x.tag||y)y?.type==="block-seq"?r(x.end,"BAD_INDENT","All sequence items must start at the same column"):r(p,"MISSING_CHAR","Sequence item without - indicator");else{m=x.end,x.comment&&(f.comment=x.comment);continue}const b=y?e(s,y,x,r):t(s,x.end,v,null,x,r);s.schema.compat&&Im(a.indent,y,r),p=b.range[2],f.items.push(b)}return f.range=[a.offset,p,m??p],f}function ml(e,t,s,a){let r="";if(e){let c=!1,d="";for(const f of e){const{source:p,type:m}=f;switch(m){case"space":c=!0;break;case"comment":{s&&!c&&a(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=p.substring(1)||" ";r?r+=d+v:r=v,d="";break}case"newline":r&&(d+=p),c=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${m} at node end`)}t+=p.length}}return{comment:r,offset:t}}const Qh="Block collections are not allowed within flow collections",Yh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function c3({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=a.start.source==="{",f=d?"flow map":"flow sequence",p=c?.nodeClass??(d?Gn:Ca),m=new p(s.schema);m.flow=!0;const v=s.atRoot;v&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let y=a.offset+a.start.source.length;for(let C=0;C<a.items.length;++C){const k=a.items[C],{start:E,key:R,sep:z,value:L}=k,M=Mr(E,{flow:f,indicator:"explicit-key-ind",next:R??z?.[0],offset:y,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!z&&!L){C===0&&M.comma?r(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):C<a.items.length-1&&r(M.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),M.comment&&(m.comment?m.comment+=`
160
+ `+M.comment:m.comment=M.comment),y=M.end;continue}!d&&s.options.strict&&rl(R)&&r(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)M.comma&&r(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(M.comma||r(M.start,"MISSING_CHAR",`Missing , between ${f} items`),M.comment){let A="";e:for(const T of E)switch(T.type){case"comma":case"space":break;case"comment":A=T.source.substring(1);break e;default:break e}if(A){let T=m.items[m.items.length-1];Dt(T)&&(T=T.value??T.key),T.comment?T.comment+=`
161
+ `+A:T.comment=A,M.comment=M.comment.substring(A.length+1)}}if(!d&&!z&&!M.found){const A=L?e(s,L,M,r):t(s,M.end,z,null,M,r);m.items.push(A),y=A.range[2],Yh(L)&&r(A.range,"BLOCK_IN_FLOW",Qh)}else{s.atKey=!0;const A=M.end,T=R?e(s,R,M,r):t(s,A,E,null,M,r);Yh(R)&&r(T.range,"BLOCK_IN_FLOW",Qh),s.atKey=!1;const P=Mr(z??[],{flow:f,indicator:"map-value-ind",next:L,offset:T.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(P.found){if(!d&&!M.found&&s.options.strict){if(z)for(const se of z){if(se===P.found)break;if(se.type==="newline"){r(se,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}M.start<P.found.offset-1024&&r(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else L&&("source"in L&&L.source?.[0]===":"?r(L,"MISSING_CHAR",`Missing space after : in ${f}`):r(P.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const J=L?e(s,L,P,r):P.found?t(s,P.end,z,null,P,r):null;J?Yh(L)&&r(J.range,"BLOCK_IN_FLOW",Qh):P.comment&&(T.comment?T.comment+=`
162
+ `+P.comment:T.comment=P.comment);const Q=new hn(T,J);if(s.options.keepSourceTokens&&(Q.srcToken=k),d){const se=m;VN(s,se.items,T)&&r(A,"DUPLICATE_KEY","Map keys must be unique"),se.items.push(Q)}else{const se=new Gn(s.schema);se.flow=!0,se.items.push(Q);const pe=(J??T).range;se.range=[T.range[0],pe[1],pe[2]],m.items.push(se)}y=J?J.range[2]:P.end}}const x=d?"}":"]",[b,...w]=a.end;let S=y;if(b?.source===x)S=b.offset+b.source.length;else{const C=f[0].toUpperCase()+f.substring(1),k=v?`${C} must end with a ${x}`:`${C} in block collection must be sufficiently indented and end with a ${x}`;r(y,v?"MISSING_CHAR":"BAD_INDENT",k),b&&b.source.length!==1&&w.unshift(b)}if(w.length>0){const C=ml(w,S,s.options.strict,r);C.comment&&(m.comment?m.comment+=`
163
+ `+C.comment:m.comment=C.comment),m.range=[a.offset,S,C.offset]}else m.range=[a.offset,S,S];return m}function Jh(e,t,s,a,r,c){const d=s.type==="block-map"?o3(e,t,s,a,c):s.type==="block-seq"?l3(e,t,s,a,c):c3(e,t,s,a,c),f=d.constructor;return r==="!"||r===f.tagName?(d.tag=f.tagName,d):(r&&(d.tag=r),d)}function u3(e,t,s,a,r){const c=a.tag,d=c?t.directives.tagName(c.source,x=>r(c,"TAG_RESOLVE_FAILED",x)):null;if(s.type==="block-seq"){const{anchor:x,newlineAfterProp:b}=a,w=x&&c?x.offset>c.offset?x:c:x??c;w&&(!b||b.offset<w.offset)&&r(w,"MISSING_CHAR","Missing newline after block sequence props")}const f=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!c||!d||d==="!"||d===Gn.tagName&&f==="map"||d===Ca.tagName&&f==="seq")return Jh(e,t,s,r,d);let p=t.schema.tags.find(x=>x.tag===d&&x.collection===f);if(!p){const x=t.schema.knownTags[d];if(x?.collection===f)t.schema.tags.push(Object.assign({},x,{default:!1})),p=x;else return x?r(c,"BAD_COLLECTION_TYPE",`${x.tag} used for ${f} collection, but expects ${x.collection??"scalar"}`,!0):r(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),Jh(e,t,s,r,d)}const m=Jh(e,t,s,r,d,p),v=p.resolve?.(m,x=>r(c,"TAG_RESOLVE_FAILED",x),t.options)??m,y=Ot(v)?v:new Re(v);return y.range=m.range,y.tag=d,p?.format&&(y.format=p.format),y}function d3(e,t,s){const a=t.offset,r=f3(t,e.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const c=r.mode===">"?Re.BLOCK_FOLDED:Re.BLOCK_LITERAL,d=t.source?h3(t.source):[];let f=d.length;for(let S=d.length-1;S>=0;--S){const C=d[S][1];if(C===""||C==="\r")f=S;else break}if(f===0){const S=r.chomp==="+"&&d.length>0?`
164
164
  `.repeat(Math.max(1,d.length-1)):"";let C=a+r.length;return t.source&&(C+=t.source.length),{value:S,type:c,comment:r.comment,range:[a,C,C]}}let p=t.indent+r.indent,m=t.offset+r.length,v=0;for(let S=0;S<f;++S){const[C,k]=d[S];if(k===""||k==="\r")r.indent===0&&C.length>p&&(p=C.length);else{C.length<p&&s(m+C.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(p=C.length),v=S,p===0&&!e.atRoot&&s(m,"BAD_INDENT","Block scalar values in collections must be indented");break}m+=C.length+k.length+1}for(let S=d.length-1;S>=f;--S)d[S][0].length>p&&(f=S+1);let y="",x="",b=!1;for(let S=0;S<v;++S)y+=d[S][0].slice(p)+`
165
- `;for(let S=v;S<f;++S){let[C,k]=d[S];m+=C.length+k.length+1;const E=k[k.length-1]==="\r";if(E&&(k=k.slice(0,-1)),k&&C.length<p){const z=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(m-k.length-(E?2:1),"BAD_INDENT",z),C=""}c===Ae.BLOCK_LITERAL?(y+=x+C.slice(p)+k,x=`
165
+ `;for(let S=v;S<f;++S){let[C,k]=d[S];m+=C.length+k.length+1;const E=k[k.length-1]==="\r";if(E&&(k=k.slice(0,-1)),k&&C.length<p){const z=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(m-k.length-(E?2:1),"BAD_INDENT",z),C=""}c===Re.BLOCK_LITERAL?(y+=x+C.slice(p)+k,x=`
166
166
  `):C.length>p||k[0]===" "?(x===" "?x=`
167
167
  `:!b&&x===`
168
168
  `&&(x=`
@@ -175,54 +175,54 @@ ${m}
175
175
  `+d[S][0].slice(p);y[y.length-1]!==`
176
176
  `&&(y+=`
177
177
  `);break;default:y+=`
178
- `}const w=a+r.length+t.source.length;return{value:y,type:c,comment:r.comment,range:[a,w,w]}}function u3({offset:e,props:t},s,a){if(t[0].type!=="block-scalar-header")return a(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],c=r[0];let d=0,f="",p=-1;for(let x=1;x<r.length;++x){const b=r[x];if(!f&&(b==="-"||b==="+"))f=b;else{const w=Number(b);!d&&w?d=w:p===-1&&(p=e+x)}}p!==-1&&a(p,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let m=!1,v="",y=r.length;for(let x=1;x<t.length;++x){const b=t[x];switch(b.type){case"space":m=!0;case"newline":y+=b.source.length;break;case"comment":s&&!m&&a(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),y+=b.source.length,v=b.source.substring(1);break;case"error":a(b,"UNEXPECTED_TOKEN",b.message),y+=b.source.length;break;default:{const w=`Unexpected token in block scalar header: ${b.type}`;a(b,"UNEXPECTED_TOKEN",w);const S=b.source;S&&typeof S=="string"&&(y+=S.length)}}}return{mode:c,indent:d,chomp:f,comment:v,length:y}}function d3(e){const t=e.split(/\n( *)/),s=t[0],a=s.match(/^( *)/),c=[a?.[1]?[a[1],s.slice(a[1].length)]:["",s]];for(let d=1;d<t.length;d+=2)c.push([t[d],t[d+1]]);return c}function f3(e,t,s){const{offset:a,type:r,source:c,end:d}=e;let f,p;const m=(x,b,w)=>s(a+x,b,w);switch(r){case"scalar":f=Ae.PLAIN,p=h3(c,m);break;case"single-quoted-scalar":f=Ae.QUOTE_SINGLE,p=m3(c,m);break;case"double-quoted-scalar":f=Ae.QUOTE_DOUBLE,p=p3(c,m);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const v=a+c.length,y=pl(d,v,t,s);return{value:p,type:f,comment:y.comment,range:[a,v,y.offset]}}function h3(e,t){let s="";switch(e[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${e[0]}`;break}case"@":case"`":{s=`reserved character ${e[0]}`;break}}return s&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),QN(e)}function m3(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),QN(e.slice(1,-1)).replace(/''/g,"'")}function QN(e){let t,s;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
178
+ `}const w=a+r.length+t.source.length;return{value:y,type:c,comment:r.comment,range:[a,w,w]}}function f3({offset:e,props:t},s,a){if(t[0].type!=="block-scalar-header")return a(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],c=r[0];let d=0,f="",p=-1;for(let x=1;x<r.length;++x){const b=r[x];if(!f&&(b==="-"||b==="+"))f=b;else{const w=Number(b);!d&&w?d=w:p===-1&&(p=e+x)}}p!==-1&&a(p,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let m=!1,v="",y=r.length;for(let x=1;x<t.length;++x){const b=t[x];switch(b.type){case"space":m=!0;case"newline":y+=b.source.length;break;case"comment":s&&!m&&a(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),y+=b.source.length,v=b.source.substring(1);break;case"error":a(b,"UNEXPECTED_TOKEN",b.message),y+=b.source.length;break;default:{const w=`Unexpected token in block scalar header: ${b.type}`;a(b,"UNEXPECTED_TOKEN",w);const S=b.source;S&&typeof S=="string"&&(y+=S.length)}}}return{mode:c,indent:d,chomp:f,comment:v,length:y}}function h3(e){const t=e.split(/\n( *)/),s=t[0],a=s.match(/^( *)/),c=[a?.[1]?[a[1],s.slice(a[1].length)]:["",s]];for(let d=1;d<t.length;d+=2)c.push([t[d],t[d+1]]);return c}function m3(e,t,s){const{offset:a,type:r,source:c,end:d}=e;let f,p;const m=(x,b,w)=>s(a+x,b,w);switch(r){case"scalar":f=Re.PLAIN,p=p3(c,m);break;case"single-quoted-scalar":f=Re.QUOTE_SINGLE,p=g3(c,m);break;case"double-quoted-scalar":f=Re.QUOTE_DOUBLE,p=y3(c,m);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const v=a+c.length,y=ml(d,v,t,s);return{value:p,type:f,comment:y.comment,range:[a,v,y.offset]}}function p3(e,t){let s="";switch(e[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${e[0]}`;break}case"@":case"`":{s=`reserved character ${e[0]}`;break}}return s&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),QN(e)}function g3(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),QN(e.slice(1,-1)).replace(/''/g,"'")}function QN(e){let t,s;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
179
179
  `,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
180
180
  `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let a=t.exec(e);if(!a)return e;let r=a[1],c=" ",d=t.lastIndex;for(s.lastIndex=d;a=s.exec(e);)a[1]===""?c===`
181
181
  `?r+=c:c=`
182
- `:(r+=c+a[1],c=" "),d=s.lastIndex;const f=/[ \t]*(.*)/sy;return f.lastIndex=d,a=f.exec(e),r+c+(a?.[1]??"")}function p3(e,t){let s="";for(let a=1;a<e.length-1;++a){const r=e[a];if(!(r==="\r"&&e[a+1]===`
182
+ `:(r+=c+a[1],c=" "),d=s.lastIndex;const f=/[ \t]*(.*)/sy;return f.lastIndex=d,a=f.exec(e),r+c+(a?.[1]??"")}function y3(e,t){let s="";for(let a=1;a<e.length-1;++a){const r=e[a];if(!(r==="\r"&&e[a+1]===`
183
183
  `))if(r===`
184
- `){const{fold:c,offset:d}=g3(e,a);s+=c,a=d}else if(r==="\\"){let c=e[++a];const d=y3[c];if(d)s+=d;else if(c===`
184
+ `){const{fold:c,offset:d}=v3(e,a);s+=c,a=d}else if(r==="\\"){let c=e[++a];const d=x3[c];if(d)s+=d;else if(c===`
185
185
  `)for(c=e[a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="\r"&&e[a+1]===`
186
- `)for(c=e[++a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="x"||c==="u"||c==="U"){const f={x:2,u:4,U:8}[c];s+=v3(e,a+1,f,t),a+=f}else{const f=e.substr(a-1,2);t(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),s+=f}}else if(r===" "||r===" "){const c=a;let d=e[a+1];for(;d===" "||d===" ";)d=e[++a+1];d!==`
186
+ `)for(c=e[++a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="x"||c==="u"||c==="U"){const f={x:2,u:4,U:8}[c];s+=b3(e,a+1,f,t),a+=f}else{const f=e.substr(a-1,2);t(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),s+=f}}else if(r===" "||r===" "){const c=a;let d=e[a+1];for(;d===" "||d===" ";)d=e[++a+1];d!==`
187
187
  `&&!(d==="\r"&&e[a+2]===`
188
- `)&&(s+=a>c?e.slice(c,a+1):r)}else s+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function g3(e,t){let s="",a=e[t+1];for(;(a===" "||a===" "||a===`
188
+ `)&&(s+=a>c?e.slice(c,a+1):r)}else s+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function v3(e,t){let s="",a=e[t+1];for(;(a===" "||a===" "||a===`
189
189
  `||a==="\r")&&!(a==="\r"&&e[t+2]!==`
190
190
  `);)a===`
191
191
  `&&(s+=`
192
- `),t+=1,a=e[t+1];return s||(s=" "),{fold:s,offset:t}}const y3={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function v3(e,t,s,a){const r=e.substr(t,s),d=r.length===s&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(d)){const f=e.substr(t-2,s+2);return a(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),f}return String.fromCodePoint(d)}function YN(e,t,s,a){const{value:r,type:c,comment:d,range:f}=t.type==="block-scalar"?c3(e,t,a):f3(t,e.options.strict,a),p=s?e.directives.tagName(s.source,y=>a(s,"TAG_RESOLVE_FAILED",y)):null;let m;e.options.stringKeys&&e.atKey?m=e.schema[bs]:p?m=x3(e.schema,r,p,s,a):t.type==="scalar"?m=b3(e,r,t,a):m=e.schema[bs];let v;try{const y=m.resolve(r,x=>a(s??t,"TAG_RESOLVE_FAILED",x),e.options);v=ft(y)?y:new Ae(y)}catch(y){const x=y instanceof Error?y.message:String(y);a(s??t,"TAG_RESOLVE_FAILED",x),v=new Ae(r)}return v.range=f,v.source=r,c&&(v.type=c),p&&(v.tag=p),m.format&&(v.format=m.format),d&&(v.comment=d),v}function x3(e,t,s,a,r){if(s==="!")return e[bs];const c=[];for(const f of e.tags)if(!f.collection&&f.tag===s)if(f.default&&f.test)c.push(f);else return f;for(const f of c)if(f.test?.test(t))return f;const d=e.knownTags[s];return d&&!d.collection?(e.tags.push(Object.assign({},d,{default:!1,test:void 0})),d):(r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[bs])}function b3({atKey:e,directives:t,schema:s},a,r,c){const d=s.tags.find(f=>(f.default===!0||e&&f.default==="key")&&f.test?.test(a))||s[bs];if(s.compat){const f=s.compat.find(p=>p.default&&p.test?.test(a))??s[bs];if(d.tag!==f.tag){const p=t.tagString(d.tag),m=t.tagString(f.tag),v=`Value may be parsed as either ${p} or ${m}`;c(r,"TAG_RESOLVE_FAILED",v,!0)}}return d}function S3(e,t,s){if(t){s??(s=t.length);for(let a=s-1;a>=0;--a){let r=t[a];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++a];r?.type==="space";)e+=r.source.length,r=t[++a];break}}return e}const j3={composeNode:JN,composeEmptyNode:Wp};function JN(e,t,s,a){const r=e.atKey,{spaceBefore:c,comment:d,anchor:f,tag:p}=s;let m,v=!0;switch(t.type){case"alias":m=w3(e,t,a),(f||p)&&a(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":m=YN(e,t,p,a),f&&(m.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":m=l3(j3,e,t,s,a),f&&(m.anchor=f.source.substring(1));break;default:{const y=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;a(t,"UNEXPECTED_TOKEN",y),m=Wp(e,t.offset,void 0,null,s,a),v=!1}}return f&&m.anchor===""&&a(f,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ft(m)||typeof m.value!="string"||m.tag&&m.tag!=="tag:yaml.org,2002:str")&&a(p??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(m.spaceBefore=!0),d&&(t.type==="scalar"&&t.source===""?m.comment=d:m.commentBefore=d),e.options.keepSourceTokens&&v&&(m.srcToken=t),m}function Wp(e,t,s,a,{spaceBefore:r,comment:c,anchor:d,tag:f,end:p},m){const v={type:"scalar",offset:S3(t,s,a),indent:-1,source:""},y=YN(e,v,f,m);return d&&(y.anchor=d.source.substring(1),y.anchor===""&&m(d,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(y.spaceBefore=!0),c&&(y.comment=c,y.range[2]=p),y}function w3({options:e},{offset:t,source:s,end:a},r){const c=new Bp(s.substring(1));c.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&r(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=t+s.length,f=pl(a,d,e.strict,r);return c.range=[t,d,f.offset],f.comment&&(c.comment=f.comment),c}function N3(e,t,{offset:s,start:a,value:r,end:c},d){const f=Object.assign({_directives:t},e),p=new rd(void 0,f),m={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},v=Ur(a,{indicator:"doc-start",next:r??c?.[0],offset:s,onError:d,parentIndent:0,startOnNewline:!0});v.found&&(p.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!v.hasNewline&&d(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=r?JN(m,r,v,d):Wp(m,v.end,a,null,v,d);const y=p.contents.range[2],x=pl(c,y,!1,d);return x.comment&&(p.comment=x.comment),p.range=[s,y,x.offset],p}function Ho(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:s}=e;return[t,t+(typeof s=="string"?s.length:1)]}function qb(e){let t="",s=!1,a=!1;for(let r=0;r<e.length;++r){const c=e[r];switch(c[0]){case"#":t+=(t===""?"":a?`
192
+ `),t+=1,a=e[t+1];return s||(s=" "),{fold:s,offset:t}}const x3={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function b3(e,t,s,a){const r=e.substr(t,s),d=r.length===s&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(d)){const f=e.substr(t-2,s+2);return a(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),f}return String.fromCodePoint(d)}function YN(e,t,s,a){const{value:r,type:c,comment:d,range:f}=t.type==="block-scalar"?d3(e,t,a):m3(t,e.options.strict,a),p=s?e.directives.tagName(s.source,y=>a(s,"TAG_RESOLVE_FAILED",y)):null;let m;e.options.stringKeys&&e.atKey?m=e.schema[bs]:p?m=S3(e.schema,r,p,s,a):t.type==="scalar"?m=j3(e,r,t,a):m=e.schema[bs];let v;try{const y=m.resolve(r,x=>a(s??t,"TAG_RESOLVE_FAILED",x),e.options);v=ft(y)?y:new Re(y)}catch(y){const x=y instanceof Error?y.message:String(y);a(s??t,"TAG_RESOLVE_FAILED",x),v=new Re(r)}return v.range=f,v.source=r,c&&(v.type=c),p&&(v.tag=p),m.format&&(v.format=m.format),d&&(v.comment=d),v}function S3(e,t,s,a,r){if(s==="!")return e[bs];const c=[];for(const f of e.tags)if(!f.collection&&f.tag===s)if(f.default&&f.test)c.push(f);else return f;for(const f of c)if(f.test?.test(t))return f;const d=e.knownTags[s];return d&&!d.collection?(e.tags.push(Object.assign({},d,{default:!1,test:void 0})),d):(r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[bs])}function j3({atKey:e,directives:t,schema:s},a,r,c){const d=s.tags.find(f=>(f.default===!0||e&&f.default==="key")&&f.test?.test(a))||s[bs];if(s.compat){const f=s.compat.find(p=>p.default&&p.test?.test(a))??s[bs];if(d.tag!==f.tag){const p=t.tagString(d.tag),m=t.tagString(f.tag),v=`Value may be parsed as either ${p} or ${m}`;c(r,"TAG_RESOLVE_FAILED",v,!0)}}return d}function w3(e,t,s){if(t){s??(s=t.length);for(let a=s-1;a>=0;--a){let r=t[a];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++a];r?.type==="space";)e+=r.source.length,r=t[++a];break}}return e}const N3={composeNode:JN,composeEmptyNode:Wp};function JN(e,t,s,a){const r=e.atKey,{spaceBefore:c,comment:d,anchor:f,tag:p}=s;let m,v=!0;switch(t.type){case"alias":m=C3(e,t,a),(f||p)&&a(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":m=YN(e,t,p,a),f&&(m.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":m=u3(N3,e,t,s,a),f&&(m.anchor=f.source.substring(1));break;default:{const y=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;a(t,"UNEXPECTED_TOKEN",y),m=Wp(e,t.offset,void 0,null,s,a),v=!1}}return f&&m.anchor===""&&a(f,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ft(m)||typeof m.value!="string"||m.tag&&m.tag!=="tag:yaml.org,2002:str")&&a(p??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(m.spaceBefore=!0),d&&(t.type==="scalar"&&t.source===""?m.comment=d:m.commentBefore=d),e.options.keepSourceTokens&&v&&(m.srcToken=t),m}function Wp(e,t,s,a,{spaceBefore:r,comment:c,anchor:d,tag:f,end:p},m){const v={type:"scalar",offset:w3(t,s,a),indent:-1,source:""},y=YN(e,v,f,m);return d&&(y.anchor=d.source.substring(1),y.anchor===""&&m(d,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(y.spaceBefore=!0),c&&(y.comment=c,y.range[2]=p),y}function C3({options:e},{offset:t,source:s,end:a},r){const c=new Bp(s.substring(1));c.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&r(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=t+s.length,f=ml(a,d,e.strict,r);return c.range=[t,d,f.offset],f.comment&&(c.comment=f.comment),c}function k3(e,t,{offset:s,start:a,value:r,end:c},d){const f=Object.assign({_directives:t},e),p=new ad(void 0,f),m={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},v=Mr(a,{indicator:"doc-start",next:r??c?.[0],offset:s,onError:d,parentIndent:0,startOnNewline:!0});v.found&&(p.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!v.hasNewline&&d(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=r?JN(m,r,v,d):Wp(m,v.end,a,null,v,d);const y=p.contents.range[2],x=ml(c,y,!1,d);return x.comment&&(p.comment=x.comment),p.range=[s,y,x.offset],p}function qo(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:s}=e;return[t,t+(typeof s=="string"?s.length:1)]}function qb(e){let t="",s=!1,a=!1;for(let r=0;r<e.length;++r){const c=e[r];switch(c[0]){case"#":t+=(t===""?"":a?`
194
194
 
195
195
  `:`
196
- `)+(c.substring(1)||" "),s=!0,a=!1;break;case"%":e[r+1]?.[0]!=="#"&&(r+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:t,afterEmptyLine:a}}class C3{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,c)=>{const d=Ho(s);c?this.warnings.push(new i3(d,a,r)):this.errors.push(new Jc(d,a,r))},this.directives=new dn({version:t.version||"1.2"}),this.options=t}decorate(t,s){const{comment:a,afterEmptyLine:r}=qb(this.prelude);if(a){const c=t.contents;if(s)t.comment=t.comment?`${t.comment}
196
+ `)+(c.substring(1)||" "),s=!0,a=!1;break;case"%":e[r+1]?.[0]!=="#"&&(r+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:t,afterEmptyLine:a}}class _3{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,c)=>{const d=qo(s);c?this.warnings.push(new r3(d,a,r)):this.errors.push(new Yc(d,a,r))},this.directives=new dn({version:t.version||"1.2"}),this.options=t}decorate(t,s){const{comment:a,afterEmptyLine:r}=qb(this.prelude);if(a){const c=t.contents;if(s)t.comment=t.comment?`${t.comment}
197
197
  ${a}`:a;else if(r||t.directives.docStart||!c)t.commentBefore=a;else if(Tt(c)&&!c.flow&&c.items.length>0){let d=c.items[0];Dt(d)&&(d=d.key);const f=d.commentBefore;d.commentBefore=f?`${a}
198
198
  ${f}`:a}else{const d=c.commentBefore;c.commentBefore=d?`${a}
199
- ${d}`:a}}s?(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:qb(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,s=!1,a=-1){for(const r of t)yield*this.next(r);yield*this.end(s,a)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(s,a,r)=>{const c=Ho(t);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const s=N3(this.options,this.directives,t,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(s,!1),this.doc&&(yield this.doc),this.doc=s,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const s=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,a=new Jc(Ho(t),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(a):this.doc.errors.push(a);break}case"doc-end":{if(!this.doc){const a="Unexpected doc-end without preceding document";this.errors.push(new Jc(Ho(t),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=pl(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const a=this.doc.comment;this.doc.comment=a?`${a}
200
- ${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new Jc(Ho(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const a=Object.assign({_directives:this.directives},this.options),r=new rd(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,s,s],this.decorate(r,!1),yield r}}}const XN="\uFEFF",WN="",e1="",Bm="";function k3(e){switch(e){case XN:return"byte-order-mark";case WN:return"doc-mode";case e1:return"flow-error-end";case Bm:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
199
+ ${d}`:a}}s?(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:qb(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,s=!1,a=-1){for(const r of t)yield*this.next(r);yield*this.end(s,a)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(s,a,r)=>{const c=qo(t);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const s=k3(this.options,this.directives,t,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(s,!1),this.doc&&(yield this.doc),this.doc=s,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const s=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,a=new Yc(qo(t),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(a):this.doc.errors.push(a);break}case"doc-end":{if(!this.doc){const a="Unexpected doc-end without preceding document";this.errors.push(new Yc(qo(t),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=ml(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const a=this.doc.comment;this.doc.comment=a?`${a}
200
+ ${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new Yc(qo(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const a=Object.assign({_directives:this.directives},this.options),r=new ad(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,s,s],this.decorate(r,!1),yield r}}}const XN="\uFEFF",WN="",e1="",Bm="";function z3(e){switch(e){case XN:return"byte-order-mark";case WN:return"doc-mode";case e1:return"flow-error-end";case Bm:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
201
201
  `:case`\r
202
202
  `: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 ns(e){switch(e){case void 0:case" ":case`
203
- `:case"\r":case" ":return!0;default:return!1}}const Hb=new Set("0123456789ABCDEFabcdef"),_3=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xc=new Set(",[]{}"),z3=new Set(` ,[]{}
204
- \r `),Wh=e=>!e||z3.has(e);class E3{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,s=!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=!s;let a=this.next??"stream";for(;a&&(s||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let t=this.pos,s=this.buffer[t];for(;s===" "||s===" ";)s=this.buffer[++t];return!s||s==="#"||s===`
203
+ `:case"\r":case" ":return!0;default:return!1}}const Hb=new Set("0123456789ABCDEFabcdef"),E3=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Jc=new Set(",[]{}"),R3=new Set(` ,[]{}
204
+ \r `),Xh=e=>!e||R3.has(e);class A3{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,s=!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=!s;let a=this.next??"stream";for(;a&&(s||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let t=this.pos,s=this.buffer[t];for(;s===" "||s===" ";)s=this.buffer[++t];return!s||s==="#"||s===`
205
205
  `?!0:s==="\r"?this.buffer[t+1]===`
206
206
  `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let s=this.buffer[t];if(this.indentNext>0){let a=0;for(;s===" ";)s=this.buffer[++a+t];if(s==="\r"){const r=this.buffer[a+t+1];if(r===`
207
207
  `||!r&&!this.atEnd)return t+a+1}return s===`
208
208
  `||a>=this.indentNext||!s&&!this.atEnd?t+a:-1}if(s==="-"||s==="."){const a=this.buffer.substr(t,3);if((a==="---"||a==="...")&&ns(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(`
209
- `,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]===XN&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let s=t.length,a=t.indexOf("#");for(;a!==-1;){const c=t[a-1];if(c===" "||c===" "){s=a-1;break}else a=t.indexOf("#",a+1)}for(;;){const c=t[s-1];if(c===" "||c===" ")s-=1;else break}const r=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-s),yield*this.pushNewline(),"stream"}return yield WN,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 s=this.peek(3);if((s==="---"||s==="...")&&ns(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ns(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ns(s)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(t[s]){case"#":yield*this.pushCount(t.length-s);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(Wh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,s,a=-1;do t=yield*this.pushNewline(),t>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(t+s>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&r[0]!=="#"||a===0&&(r.startsWith("---")||r.startsWith("..."))&&ns(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield e1,yield*this.parseLineStart();let c=0;for(;r[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),r[c]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-c),"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(Wh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||ns(d)||d===",")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 s=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let c=0;for(;this.buffer[s-1-c]==="\\";)c+=1;if(c%2===0)break;s=this.buffer.indexOf('"',s+1)}const a=this.buffer.substring(0,s);let r=a.indexOf(`
209
+ `,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]===XN&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let s=t.length,a=t.indexOf("#");for(;a!==-1;){const c=t[a-1];if(c===" "||c===" "){s=a-1;break}else a=t.indexOf("#",a+1)}for(;;){const c=t[s-1];if(c===" "||c===" ")s-=1;else break}const r=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-s),yield*this.pushNewline(),"stream"}return yield WN,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 s=this.peek(3);if((s==="---"||s==="...")&&ns(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ns(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ns(s)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(t[s]){case"#":yield*this.pushCount(t.length-s);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(Xh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,s,a=-1;do t=yield*this.pushNewline(),t>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(t+s>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&r[0]!=="#"||a===0&&(r.startsWith("---")||r.startsWith("..."))&&ns(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield e1,yield*this.parseLineStart();let c=0;for(;r[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),r[c]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-c),"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(Xh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||ns(d)||d===",")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 s=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let c=0;for(;this.buffer[s-1-c]==="\\";)c+=1;if(c%2===0)break;s=this.buffer.indexOf('"',s+1)}const a=this.buffer.substring(0,s);let r=a.indexOf(`
210
210
  `,this.pos);if(r!==-1){for(;r!==-1;){const c=this.continueScalar(r+1);if(c===-1)break;r=a.indexOf(`
211
211
  `,c)}r!==-1&&(s=r-(a[r-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const s=this.buffer[++t];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*this.pushUntil(s=>ns(s)||s==="#")}*parseBlockScalar(){let t=this.pos-1,s=0,a;e:for(let c=this.pos;a=this.buffer[c];++c)switch(a){case" ":s+=1;break;case`
212
212
  `:t=c,s=0;break;case"\r":{const d=this.buffer[c+1];if(!d&&!this.atEnd)return this.setNext("block-scalar");if(d===`
213
213
  `)break}default:break e}if(!a&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=s:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const c=this.continueScalar(t+1);if(c===-1)break;t=this.buffer.indexOf(`
214
214
  `,c)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(a=this.buffer[r];a===" ";)a=this.buffer[++r];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
215
215
  `;)a=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let c=t-1,d=this.buffer[c];d==="\r"&&(d=this.buffer[--c]);const f=c;for(;d===" ";)d=this.buffer[--c];if(d===`
216
- `&&c>=this.pos&&c+1+s>f)t=c;else break}while(!0);return yield Bm,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,r;for(;r=this.buffer[++a];)if(r===":"){const c=this.buffer[a+1];if(ns(c)||t&&Xc.has(c))break;s=a}else if(ns(r)){let c=this.buffer[a+1];if(r==="\r"&&(c===`
216
+ `&&c>=this.pos&&c+1+s>f)t=c;else break}while(!0);return yield Bm,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,r;for(;r=this.buffer[++a];)if(r===":"){const c=this.buffer[a+1];if(ns(c)||t&&Jc.has(c))break;s=a}else if(ns(r)){let c=this.buffer[a+1];if(r==="\r"&&(c===`
217
217
  `?(a+=1,r=`
218
- `,c=this.buffer[a+1]):s=a),c==="#"||t&&Xc.has(c))break;if(r===`
219
- `){const d=this.continueScalar(a+1);if(d===-1)break;a=Math.max(a,d-2)}}else{if(t&&Xc.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Bm,yield*this.pushToIndex(s+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,s){const a=this.buffer.slice(this.pos,t);return a?(yield a,this.pos+=a.length,a.length):(s&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Wh))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(ns(s)||t&&Xc.has(s))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,s=this.buffer[t];for(;!ns(s)&&s!==">";)s=this.buffer[++t];return yield*this.pushToIndex(s===">"?t+1:t,!1)}else{let t=this.pos+1,s=this.buffer[t];for(;s;)if(_3.has(s))s=this.buffer[++t];else if(s==="%"&&Hb.has(this.buffer[t+1])&&Hb.has(this.buffer[t+2]))s=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
218
+ `,c=this.buffer[a+1]):s=a),c==="#"||t&&Jc.has(c))break;if(r===`
219
+ `){const d=this.continueScalar(a+1);if(d===-1)break;a=Math.max(a,d-2)}}else{if(t&&Jc.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Bm,yield*this.pushToIndex(s+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,s){const a=this.buffer.slice(this.pos,t);return a?(yield a,this.pos+=a.length,a.length):(s&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Xh))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(ns(s)||t&&Jc.has(s))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,s=this.buffer[t];for(;!ns(s)&&s!==">";)s=this.buffer[++t];return yield*this.pushToIndex(s===">"?t+1:t,!1)}else{let t=this.pos+1,s=this.buffer[t];for(;s;)if(E3.has(s))s=this.buffer[++t];else if(s==="%"&&Hb.has(this.buffer[t+1])&&Hb.has(this.buffer[t+2]))s=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
220
220
  `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
221
- `?yield*this.pushCount(2):0}*pushSpaces(t){let s=this.pos-1,a;do a=this.buffer[++s];while(a===" "||t&&a===" ");const r=s-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=s),r}*pushUntil(t){let s=this.pos,a=this.buffer[s];for(;!t(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class A3{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let s=0,a=this.lineStarts.length;for(;s<a;){const c=s+a>>1;this.lineStarts[c]<t?s=c+1:a=c}if(this.lineStarts[s]===t)return{line:s+1,col:1};if(s===0)return{line:0,col:t};const r=this.lineStarts[s-1];return{line:s,col:t-r+1}}}}function _i(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function Gb(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 t1(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 Wc(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 Sr(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 Fb(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!_i(t.start,"explicit-key-ind")&&!_i(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,t1(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 R3{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 E3,this.onNewLine=t}*parse(t,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(t,s))yield*this.next(a);s||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const s=k3(t);if(s)if(s==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=s,yield*this.step(),s){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 a=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:a,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 s=t??this.stack.pop();if(!s)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield s;else{const a=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in a?a.indent:0:s.type==="flow-collection"&&a.type==="document"&&(s.indent=0),s.type==="flow-collection"&&Fb(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const r=a.items[a.items.length-1];if(r.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=s;else{Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=a.items[a.items.length-1];r.value?a.items.push({start:[],value:s}):r.value=s;break}case"flow-collection":{const r=a.items[a.items.length-1];!r||r.value?a.items.push({start:[],key:s,sep:[]}):r.sep?r.value=s:Object.assign(r,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const r=s.items[s.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Gb(r.start)===-1&&(s.indent===0||r.start.every(c=>c.type!=="comment"||c.indent<s.indent))&&(a.type==="document"?a.end=r.start:a.items.push({start:r.start}),s.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":{Gb(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 s=this.startBlockValue(t);s?this.stack.push(s):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 s=Wc(this.peek(2)),a=Sr(s);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}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 s=this.source.indexOf(`
221
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let s=this.pos-1,a;do a=this.buffer[++s];while(a===" "||t&&a===" ");const r=s-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=s),r}*pushUntil(t){let s=this.pos,a=this.buffer[s];for(;!t(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class T3{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let s=0,a=this.lineStarts.length;for(;s<a;){const c=s+a>>1;this.lineStarts[c]<t?s=c+1:a=c}if(this.lineStarts[s]===t)return{line:s+1,col:1};if(s===0)return{line:0,col:t};const r=this.lineStarts[s-1];return{line:s,col:t-r+1}}}}function zi(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function Gb(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 t1(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 Xc(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 br(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 Fb(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!zi(t.start,"explicit-key-ind")&&!zi(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,t1(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 O3{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 A3,this.onNewLine=t}*parse(t,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(t,s))yield*this.next(a);s||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const s=z3(t);if(s)if(s==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=s,yield*this.step(),s){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 a=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:a,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 s=t??this.stack.pop();if(!s)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield s;else{const a=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in a?a.indent:0:s.type==="flow-collection"&&a.type==="document"&&(s.indent=0),s.type==="flow-collection"&&Fb(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const r=a.items[a.items.length-1];if(r.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=s;else{Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=a.items[a.items.length-1];r.value?a.items.push({start:[],value:s}):r.value=s;break}case"flow-collection":{const r=a.items[a.items.length-1];!r||r.value?a.items.push({start:[],key:s,sep:[]}):r.sep?r.value=s:Object.assign(r,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const r=s.items[s.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Gb(r.start)===-1&&(s.indent===0||r.start.every(c=>c.type!=="comment"||c.indent<s.indent))&&(a.type==="document"?a.end=r.start:a.items.push({start:r.start}),s.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":{Gb(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 s=this.startBlockValue(t);s?this.stack.push(s):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 s=Xc(this.peek(2)),a=br(s);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}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 s=this.source.indexOf(`
222
222
  `)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
223
- `,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const a=!this.onKeyLine&&this.indent===t.indent,r=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(r&&s.sep&&!s.value){const d=[];for(let f=0;f<s.sep.length;++f){const p=s.sep[f];switch(p.type){case"newline":d.push(f);break;case"space":break;case"comment":p.indent>t.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(c=s.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(c.push(this.sourceToken),t.items.push({start:c}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):r||s.value?(c.push(this.sourceToken),t.items.push({start:c,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(s.explicitKey)if(s.sep)if(s.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(_i(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(t1(s.key)&&!_i(s.sep,"newline")){const d=Sr(s.start),f=s.key,p=s.sep;p.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:f,sep:p}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(_i(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const d=Sr(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?t.items.push({start:c,key:null,sep:[this.sourceToken]}):_i(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);r||s.value?(t.items.push({start:c,key:d,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(d):(Object.assign(s,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(t);if(d){if(d.type==="block-seq"){if(!s.explicitKey&&s.sep&&!_i(s.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 a&&t.items.push({start:c});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=t.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;s.value||_i(s.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>t.indent){const a=this.startBlockValue(t);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const s=t.items[t.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while(a?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?t.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!s||s.value?t.items.push({start:[],key:r,sep:[]}):s.sep?this.stack.push(r):Object.assign(s,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const a=this.startBlockValue(t);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===t.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const r=Wc(a),c=Sr(r);Fb(t);const d=t.end.splice(1,t.end.length);d.push(this.sourceToken);const f={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:c,key:t,sep:d}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=f}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let s=this.source.indexOf(`
223
+ `,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const a=!this.onKeyLine&&this.indent===t.indent,r=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(r&&s.sep&&!s.value){const d=[];for(let f=0;f<s.sep.length;++f){const p=s.sep[f];switch(p.type){case"newline":d.push(f);break;case"space":break;case"comment":p.indent>t.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(c=s.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(c.push(this.sourceToken),t.items.push({start:c}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):r||s.value?(c.push(this.sourceToken),t.items.push({start:c,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(s.explicitKey)if(s.sep)if(s.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(zi(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(t1(s.key)&&!zi(s.sep,"newline")){const d=br(s.start),f=s.key,p=s.sep;p.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:f,sep:p}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(zi(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const d=br(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?t.items.push({start:c,key:null,sep:[this.sourceToken]}):zi(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);r||s.value?(t.items.push({start:c,key:d,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(d):(Object.assign(s,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(t);if(d){if(d.type==="block-seq"){if(!s.explicitKey&&s.sep&&!zi(s.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 a&&t.items.push({start:c});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=t.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;s.value||zi(s.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>t.indent){const a=this.startBlockValue(t);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const s=t.items[t.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while(a?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?t.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!s||s.value?t.items.push({start:[],key:r,sep:[]}):s.sep?this.stack.push(r):Object.assign(s,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const a=this.startBlockValue(t);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===t.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const r=Xc(a),c=br(r);Fb(t);const d=t.end.splice(1,t.end.length);d.push(this.sourceToken);const f={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:c,key:t,sep:d}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=f}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let s=this.source.indexOf(`
224
224
  `)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
225
- `,s)+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 s=Wc(t),a=Sr(s);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=Wc(t),a=Sr(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,s){return this.type!=="comment"||this.indent<=s?!1:t.every(a=>a.type==="newline"||a.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 T3(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new A3||null,prettyErrors:t}}function O3(e,t={}){const{lineCounter:s,prettyErrors:a}=T3(t),r=new R3(s?.addNewLine),c=new C3(t),d=Array.from(c.compose(r.parse(e)));if(a&&s)for(const f of d)f.errors.forEach(Ib(e,s)),f.warnings.forEach(Ib(e,s));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function D3({onApplied:e}){const[t,s]=N.useState(""),[a,r]=N.useState(!1),[c,d]=N.useState([]),[f,p]=N.useState([]),m=async()=>{if(!t.trim())return;r(!0),d([]),p([]);const v=O3(t),y=[],x=[];for(let b=0;b<v.length;b++){const w=v[b];if(w.errors.length>0){y.push(`Document ${b+1}: ${w.errors[0]?.message}`);continue}const S=w.toJSON();if(!(!S||typeof S!="object"))try{const C=await Bw(S);x.push(`Applied "${C.displayName||C.name}" (revision ${C.configRevision})`)}catch(C){y.push(`Document ${b+1}: ${C instanceof Error?C.message:String(C)}`)}}d(x),p(y),r(!1),x.length>0&&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
225
+ `,s)+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 s=Xc(t),a=br(s);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=Xc(t),a=br(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,s){return this.type!=="comment"||this.indent<=s?!1:t.every(a=>a.type==="newline"||a.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 D3(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new T3||null,prettyErrors:t}}function L3(e,t={}){const{lineCounter:s,prettyErrors:a}=D3(t),r=new O3(s?.addNewLine),c=new _3(t),d=Array.from(c.compose(r.parse(e)));if(a&&s)for(const f of d)f.errors.forEach(Ib(e,s)),f.warnings.forEach(Ib(e,s));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function M3({onApplied:e}){const[t,s]=N.useState(""),[a,r]=N.useState(!1),[c,d]=N.useState([]),[f,p]=N.useState([]),m=async()=>{if(!t.trim())return;r(!0),d([]),p([]);const v=L3(t),y=[],x=[];for(let b=0;b<v.length;b++){const w=v[b];if(w.errors.length>0){y.push(`Document ${b+1}: ${w.errors[0]?.message}`);continue}const S=w.toJSON();if(!(!S||typeof S!="object"))try{const C=await Bw(S);x.push(`Applied "${C.displayName||C.name}" (revision ${C.configRevision})`)}catch(C){y.push(`Document ${b+1}: ${C instanceof Error?C.message:String(C)}`)}}d(x),p(y),r(!1),x.length>0&&e()};return o.jsxs("section",{className:"mt-8",children:[o.jsx("div",{className:"page-section-divider"}),o.jsx("div",{className:"section-head mt-6",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),o.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),o.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",o.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",o.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),o.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
226
226
  kind: Project
227
227
  metadata:
228
228
  name: my-project
@@ -230,17 +230,17 @@ spec:
230
230
  canonicalDomain: example.com
231
231
  country: US
232
232
  language: en
233
- keywords: []`,value:t,onChange:v=>s(v.target.value)}),c.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,y)=>l.jsx("li",{className:"text-emerald-400 text-sm",children:v},y))}),f.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:f.map((v,y)=>l.jsx("li",{className:"text-rose-400 text-sm",children:v},y))}),l.jsx("div",{className:"mt-3",children:l.jsx(ce,{type:"button",disabled:!t.trim()||a,onClick:m,children:a?"Applying...":"Apply"})})]})}function L3(){const{dashboard:e,isLoading:t,refetch:s}=Ra();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(R=>l.jsx("div",{className:"skeleton-text-sm w-16"},R))}),[1,2,3].map(R=>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"})]},R))]})]});const a=e.projects,r=_a(),[c,d]=N.useState(!1),[f,p]=N.useState(""),[m,v]=N.useState(""),[y,x]=N.useState(""),[b,w]=N.useState("US"),[S,C]=N.useState("en"),[k,E]=N.useState(!1),[A,z]=N.useState(null),L=f.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),M=async()=>{if(!(!L||!y)){E(!0),z(null);try{const R=await cl(L,{displayName:m||f,canonicalDomain:y,country:b,language:S});s(),p(""),v(""),x(""),w("US"),C("en"),d(!1),r({to:"/projects/$projectId",params:{projectId:R.id}})}catch(R){z(R instanceof Error?R.message:"Failed to create project")}finally{E(!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:[a.length," project",a.length!==1?"s":""," tracked"]})]}),l.jsx("div",{className:"page-header-right",children:l.jsxs(ce,{type:"button",onClick:()=>d(R=>!R),children:[l.jsx(Mx,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?l.jsxs(De,{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:f,onChange:R=>p(R.target.value)}),L&&L!==f?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",L]}):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:m,onChange:R=>v(R.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:y,onChange:R=>x(R.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:b,onChange:R=>w(R.target.value.toUpperCase())})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),l.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:S,onChange:R=>C(R.target.value.toLowerCase())})]})]})]}),A?l.jsx("p",{className:"text-rose-400 text-sm mt-3",children:A}):null,l.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[l.jsx(ce,{type:"button",disabled:!L||!y||k,onClick:M,children:k?"Creating...":"Create project"}),l.jsx(ce,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,a.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:a.map(R=>{const T=R.recentRuns[0];return l.jsxs("tr",{className:"cursor-pointer",onClick:()=>r({to:"/projects/$projectId",params:{projectId:R.project.id}}),children:[l.jsxs("td",{children:[l.jsx(yt,{to:"/projects/$projectId",params:{projectId:R.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:P=>P.stopPropagation(),children:R.project.displayName||R.project.name}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:R.project.name})]}),l.jsx("td",{className:"text-zinc-400",children:R.project.canonicalDomain}),l.jsx("td",{children:l.jsx(nt,{tone:R.visibilitySummary.tone,children:R.visibilitySummary.value})}),l.jsx("td",{className:"text-zinc-500 text-sm",children:T?l.jsx(Iu,{status:T.status}):l.jsx("span",{className:"text-zinc-600",children:"No runs"})}),l.jsx("td",{className:"text-right text-zinc-500",children:R.project.country})]},R.project.id)})})]})}):c?null:l.jsxs(De,{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(ce,{type:"button",onClick:()=>d(!0),children:[l.jsx(Mx,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(D3,{onApplied:()=>{s()}})]})}function ja({text:e}){return l.jsxs("span",{className:"info-tooltip-wrapper",children:[l.jsxs("svg",{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"})]}),l.jsx("span",{className:"info-tooltip-bubble",role:"tooltip",children:e})]})}function n1({run:e}){const{openRun:t}=dl();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(Iu,{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(ce,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function wa({value:e,label:t,delta:s,tone:a,description:r,tooltip:c,isNumeric:d=!0}){const m=2*Math.PI*48,v=Number.parseInt(e,10),y=d&&!Number.isNaN(v)?Math.min(v/100,1):.5,x=m*(1-y);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-${a}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:x,transform:"rotate(-90 60 60)"})]}),l.jsx("div",{className:"gauge-center",children:l.jsx("span",{className:d?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),l.jsxs("p",{className:"gauge-label",children:[t,c&&l.jsx(ja,{text:c})]}),l.jsx("p",{className:"gauge-delta",children:s}),l.jsx("p",{className:"gauge-description",children:r})]})}function Zb({history:e,maxDots:t=12}){const s=e.slice(-t);if(s.length===0)return l.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const a={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},r=new Date(s[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),c=new Date(s[s.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:r}),l.jsx("div",{className:"flex items-center gap-[3px]",title:`${s.length} runs`,children:s.map((d,f)=>l.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${a[d.citationState]??"bg-zinc-700"} ${d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[d.citationState,new Date(d.createdAt).toLocaleDateString(),d.model?`model ${d.model}`:null,d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"model changed":null].filter(Boolean).join(" — ")},f))}),l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:c})]})}function M3(e){const t=new Map;for(const a of e)for(const r of a.runHistory){const c=t.get(r.createdAt);c?c.states.push(r.citationState):t.set(r.createdAt,{states:[r.citationState],runId:r.runId})}return[...t.entries()].sort(([a],[r])=>a.localeCompare(r)).map(([a,{states:r,runId:c}])=>({runId:c,createdAt:a,citationState:r.includes("cited")?"cited":r.includes("emerging")?"emerging":"not-cited"}))}function U3({evidence:e}){const{openEvidence:t}=dl(),[s,a]=N.useState(new Set),r=N.useMemo(()=>{const d=new Map;for(const f of e){const p=d.get(f.keyword)??[];d.set(f.keyword,[...p,f])}return[...d.entries()].map(([f,p])=>({phrase:f,items:p}))},[e]),c=d=>{a(f=>{const p=new Set(f);return p.has(d)?p.delete(d):p.add(d),p})};return l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{style:{width:"2rem"}}),l.jsx("th",{children:"Key Phrase"}),l.jsx("th",{children:"Status"}),l.jsx("th",{children:"Citation History"}),l.jsx("th",{children:"Change"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:r.map(({phrase:d,items:f})=>{const p=s.has(d),m=f.map(w=>w.citationState),v=m.includes("cited")?"cited":m.includes("emerging")?"emerging":m.includes("lost")?"lost":m.every(w=>w==="pending")?"pending":"not-cited",y=M3(f),x=f.filter(w=>w.citationState==="cited"||w.citationState==="emerging").length,b=(()=>{if(y.length===0)return"Awaiting first run";if(y.length===1)return"First observation";const w=y[y.length-1].citationState,S=y[y.length-2].citationState;if(S!=="cited"&&w==="cited")return"Newly cited";if(S==="cited"&&w!=="cited")return"Lost since last run";let C=0;for(let k=y.length-1;k>=0&&y[k].citationState===w;k--)C++;return w==="cited"?C<=1?"Cited in latest run":`Cited for ${C} runs`:C<=1?"Not cited in latest run":`Not cited across ${C} runs`})();return l.jsxs(N.Fragment,{children:[l.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(d),"aria-expanded":p,children:[l.jsx("td",{children:l.jsx(Uu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${p?"rotate-90":""}`})}),l.jsx("td",{className:"evidence-keyword-cell",children:l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-zinc-100",children:d}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(w=>l.jsx(nl,{provider:w.provider},w.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(km,{state:v}),l.jsxs("span",{className:"text-[11px] text-zinc-500",children:[x,"/",f.length]})]})}),l.jsx("td",{children:l.jsx(Zb,{history:y})}),l.jsx("td",{className:"evidence-change-cell",children:b}),l.jsx("td",{})]}),p&&f.map(w=>l.jsxs("tr",{className:"bg-zinc-900/30",children:[l.jsx("td",{}),l.jsx("td",{className:"evidence-keyword-cell pl-5",children:l.jsx(nl,{provider:w.provider})}),l.jsx("td",{children:l.jsx(km,{state:w.citationState})}),l.jsx("td",{children:l.jsx(Zb,{history:w.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:w.changeLabel}),l.jsx("td",{children:l.jsx(ce,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(w.id)},children:"View"})})]},w.id))]},d)})})]})})}function $3({competitors:e}){return e.length===0?l.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):l.jsx("div",{className:"competitor-table-wrap",children:l.jsxs("table",{className:"competitor-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Pressure"}),l.jsx("th",{children:"Citations"}),l.jsx("th",{children:"Key Phrases"})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),l.jsx("td",{children:l.jsx(nt,{tone:GE(t.pressureLabel),children:t.pressureLabel})}),l.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),l.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}const P3=["7d","30d","90d","all"],I3=["gap","cited","uncited"],s1={forum:"bg-amber-500",social:"bg-blue-500",news:"bg-zinc-400",reference:"bg-purple-500",blog:"bg-emerald-500",ecommerce:"bg-orange-500",video:"bg-red-500",academic:"bg-cyan-500",other:"bg-zinc-600"};function B3({projectName:e}){const[t,s]=N.useState("30d"),[a,r]=N.useState(null),[c,d]=N.useState(null),[f,p]=N.useState(null),[m,v]=N.useState(null),[y,x]=N.useState(!0);return N.useEffect(()=>{let b=!1;return x(!0),Promise.all([lN(e,t),cN(e,t),uN(e,t)]).then(([w,S,C])=>{b||(r(w),d(S),p(C),x(!1))}).catch(()=>{b||x(!1)}),()=>{b=!0}},[e,t]),y&&!a?l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):l.jsxs(l.Fragment,{children:[l.jsxs("section",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",l.jsx(ja,{text:"Citation rate over time across all runs within the selected window. Each data point represents the percentage of queries where your brand was cited by AI providers."})]})]}),l.jsx("div",{className:"flex gap-1",children:P3.map(b=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===b?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>s(b),children:b==="all"?"All":b},b))})]}),a&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-6",children:[l.jsx(wa,{value:`${Math.round(a.overall.citationRate*100)}`,label:"Citation Rate",delta:`${a.overall.cited} / ${a.overall.total}`,tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",description:`Trend: ${a.trend}`,isNumeric:!0}),l.jsxs("div",{className:"flex-1 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),l.jsx(nt,{tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",children:a.trend})]}),Object.keys(a.byProvider).length>0&&l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Cited / Total"})]})}),l.jsx("tbody",{children:Object.entries(a.byProvider).map(([b,w])=>l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-300",children:b}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(w.citationRate*100).toFixed(1),"%"]}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[w.cited," / ",w.total]})]},b))})]})]})]}),a.buckets.length>=1&&l.jsx(q3,{buckets:a.buckets})]})]}),l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsx("div",{className:"flex items-center justify-between mb-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",l.jsx(ja,{text:"Classification based on the most recent completed run. Cited: your brand appeared in the AI answer. Gap: a competitor was cited but you were not. Not Cited: neither mentioned. Consistency shows how often each keyword was cited across all runs in the selected window."})]})]})}),c&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex gap-1 mb-4",children:I3.map(b=>{const w=b==="cited"?c.cited.length:b==="gap"?c.gap.length:c.uncited.length,S=m===b;return l.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?b==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":b==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>v(S?null:b),children:[b==="gap"?"Gap":b==="cited"?"Cited":"Not Cited"," (",w,")"]},b)})}),l.jsx(H3,{gaps:c,filter:m})]})]}),l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",l.jsx(ja,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),f&&f.overall.length>0&&l.jsxs("div",{className:"space-y-4",children:[l.jsx(G3,{categories:f.overall}),l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),l.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),l.jsx("tbody",{children:f.overall.map(b=>l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[l.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${s1[b.category]??"bg-zinc-600"}`}),b.label]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:b.count}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(b.percentage*100).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:b.topDomains.slice(0,3).map(w=>w.domain).join(", ")})]},b.category))})]})]}),f&&f.overall.length===0&&l.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function q3({buckets:e}){const[t,s]=N.useState(null),a=600,r=140,c={top:24,right:10,bottom:20,left:40},d=a-c.left-c.right,f=r-c.top-c.bottom,p=1,m=e.map((y,x)=>{const b=c.left+(e.length>1?x/(e.length-1)*d:d/2),w=c.top+f-y.citationRate/p*f;return{x:b,y:w}}),v=m.map(y=>`${y.x},${y.y}`).join(" ");return l.jsx("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:l.jsxs("svg",{viewBox:`0 0 ${a} ${r}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>s(null),children:[l.jsxs("text",{x:c.left-4,y:c.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),l.jsx("text",{x:c.left-4,y:c.top+f+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),l.jsx("line",{x1:c.left,y1:c.top+f,x2:c.left+d,y2:c.top+f,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),l.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:v}),t!==null&&l.jsx("line",{x1:m[t].x,y1:c.top,x2:m[t].x,y2:c.top+f,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((y,x)=>{const{x:b,y:w}=m[x],S=t===x;return l.jsxs("g",{children:[l.jsx("circle",{cx:b,cy:w,r:"10",fill:"transparent",onMouseEnter:()=>s(x),style:{cursor:"pointer"}}),l.jsx("circle",{cx:b,cy:w,r:S?5:3,className:S?"fill-emerald-400":"fill-emerald-500"})]},x)}),t!==null&&(()=>{const y=e[t],{x,y:b}=m[t],w=`${(y.citationRate*100).toFixed(1)}%`,S=y.startDate.slice(5,10),C=56,k=30,E=Math.max(c.left,Math.min(x-C/2,a-c.right-C)),A=b-k-8;return l.jsxs("g",{children:[l.jsx("rect",{x:E,y:A,width:C,height:k,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),l.jsx("text",{x:E+C/2,y:A+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:w}),l.jsx("text",{x:E+C/2,y:A+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:S})]})})(),e.map((y,x)=>({b:y,i:x})).filter(({i:y})=>y===0||y===e.length-1||e.length<=7).map(({b:y,i:x})=>{const b=m[x].x;return l.jsx("text",{x:b,y:r-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:y.startDate.slice(5,10)},x)})]})})}function H3({gaps:e,filter:t}){const s=N.useMemo(()=>{const a=[...e.gap.map(r=>({...r,_sort:0})),...e.cited.map(r=>({...r,_sort:1})),...e.uncited.map(r=>({...r,_sort:2}))];return t?a.filter(r=>r.category===t):a.sort((r,c)=>r._sort-c._sort)},[e,t]);return s.length===0?l.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No keywords found",t?` with status "${t}"`:"","."]}):l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),l.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),l.jsx("th",{className:"text-left py-1 font-medium",children:"Providers Citing"}),l.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),l.jsx("tbody",{children:s.map(a=>{const r=a.category==="cited"?"positive":a.category==="gap"?"caution":"neutral";return l.jsxs("tr",{className:`border-t border-zinc-800/40 ${a.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[l.jsx("td",{className:"py-1.5 text-zinc-200",children:a.keyword}),l.jsx("td",{className:"py-1.5",children:l.jsx(nt,{tone:r,children:a.category==="gap"?"Gap":a.category==="cited"?"Cited":"Not Cited"})}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.providers.length>0?a.providers.join(", "):"—"}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.competitorsCiting.length>0?a.competitorsCiting.join(", "):"—"}),l.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:a.consistency.totalRuns>0?`${a.consistency.citedRuns}/${a.consistency.totalRuns} runs`:"—"})]},a.keywordId)})})]})}function G3({categories:e}){const t=e.reduce((s,a)=>s+a.count,0);return t===0?null:l.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(s=>{const a=s.count/t*100;return a<.5?null:l.jsx("div",{className:`${s1[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function em(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function F3(e){const t=Date.now()-new Date(e).getTime(),s=Math.floor(t/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function Z3({projectName:e}){const[t,s]=N.useState(null),[a,r]=N.useState(null),[c,d]=N.useState(!0),[f,p]=N.useState(!1),[m,v]=N.useState(!1),[y,x]=N.useState(null),[b,w]=N.useState(null),[S,C]=N.useState("sessions"),[k,E]=N.useState("desc");function A(P){d(!0),Tm(e).then(J=>{if(!P.current)return s(J),J.connected?Om(e):null}).then(J=>{P.current||(J&&r(J),d(!1))}).catch(J=>{P.current||(x(J instanceof Error?J.message:"Failed to load GA4 data"),d(!1))})}N.useEffect(()=>{const P={current:!1};return A(P),()=>{P.current=!0}},[e]);async function z(){p(!0),x(null),w(null);try{const P=await dN(e);w(`Synced ${P.rowCount.toLocaleString()} rows (${P.days} days)`);const J=await Om(e);r(J);const Q=await Tm(e);s(Q)}catch(P){x(P instanceof Error?P.message:"Sync failed")}finally{p(!1)}}async function L(){v(!0),x(null),w(null);try{await fN(e),s({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),r(null),w("GA4 disconnected")}catch(P){x(P instanceof Error?P.message:"Disconnect failed")}finally{v(!1)}}function M(P){S===P?E(J=>J==="desc"?"asc":"desc"):(C(P),E("desc"))}const R=N.useMemo(()=>a?.topPages?[...a.topPages].sort((P,J)=>{const Q=P[S],se=J[S];return typeof Q=="string"&&typeof se=="string"?k==="asc"?Q.localeCompare(se):se.localeCompare(Q):k==="asc"?Q-se:se-Q}):[],[a?.topPages,S,k]);if(c&&!t)return l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return l.jsxs(De,{className:"surface-card p-6",children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-2",children:"Google Analytics 4"}),l.jsx("p",{className:"text-sm text-zinc-400 mb-4",children:"Connect a GA4 property via the CLI to see traffic data for this project."}),l.jsx("div",{className:"bg-zinc-900/60 rounded-lg p-3 border border-zinc-800/60",children:l.jsxs("code",{className:"text-sm text-zinc-300",children:["canonry ga connect ",e," --key-file service-account.json --property-id 123456789"]})})]});const T=a&&a.totalSessions>0?Math.round(a.totalOrganicSessions/a.totalSessions*100):0;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}),b&&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:b}),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:t.propertyId}),t.clientEmail&&l.jsxs(l.Fragment,{children:[" · ",l.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ce,{variant:"outline",size:"sm",disabled:f,onClick:z,children:[l.jsx(Ux,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"Syncing…":"Sync"]}),l.jsxs(ce,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:m,onClick:L,children:[l.jsx(U2,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),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:"Traffic Overview"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",l.jsx(ja,{text:"Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across all synced dates. Organic sessions are Google organic search sessions specifically."})]})]}),a?l.jsxs("div",{className:"flex items-center gap-6",children:[l.jsx(wa,{value:em(a.totalSessions),label:"Total Sessions",delta:a.totalSessions.toLocaleString(),tone:"neutral",description:"All traffic sources",isNumeric:!1}),l.jsx(wa,{value:em(a.totalOrganicSessions),label:"Organic Sessions",delta:`${T}% of total`,tone:"positive",description:"Google organic search",isNumeric:!1}),l.jsx(wa,{value:em(a.totalUsers),label:"Total Users",delta:a.totalUsers.toLocaleString(),tone:"neutral",description:"Unique users",isNumeric:!1})]}):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(ce,{variant:"outline",size:"sm",disabled:f,onClick:z,children:[l.jsx(Ux,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),"Sync from GA4"]})]})]}),a&&a.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(ja,{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(eu,{label:"Landing Page",sortKey:"landingPage",current:S,dir:k,onSort:M,align:"left"}),l.jsx(eu,{label:"Sessions",sortKey:"sessions",current:S,dir:k,onSort:M,align:"right"}),l.jsx(eu,{label:"Organic",sortKey:"organicSessions",current:S,dir:k,onSort:M,align:"right"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),l.jsx(eu,{label:"Users",sortKey:"users",current:S,dir:k,onSort:M,align:"right"})]})}),l.jsx("tbody",{children:R.map(P=>l.jsx(K3,{page:P},P.landingPage))})]})})]})]}),l.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[l.jsx("span",{children:a?.lastSyncedAt?`Last synced ${F3(a.lastSyncedAt)}`:"Never synced"}),l.jsx("span",{children:a?`${a.topPages.length} pages shown`:""})]})]})}function eu({label:e,sortKey:t,current:s,dir:a,onSort:r,align:c}){const d=s===t;return l.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${c==="right"?"text-right":"text-left"}`,onClick:()=>r(t),children:[e,d&&l.jsx("span",{className:"ml-0.5",children:a==="asc"?"↑":"↓"})]})}function K3({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()})]})}function V3({projectName:e}){const[t,s]=N.useState(!1),[a,r]=N.useState([]),[c,d]=N.useState([]),[f,p]=N.useState([]),[m,v]=N.useState([]),[y,x]=N.useState([]),[b,w]=N.useState(null),[S,C]=N.useState(""),[k,E]=N.useState(""),[A,z]=N.useState("30"),[L,M]=N.useState(!1),[R,T]=N.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[P,J]=N.useState(""),[Q,se]=N.useState(!0),[pe,ke]=N.useState(!1),[je,B]=N.useState(!1),[G,oe]=N.useState(!1),[q,X]=N.useState(!1),[O,Z]=N.useState(!1),[ie,re]=N.useState(!1),[ue,he]=N.useState(!1),[de,Me]=N.useState(null),[ge,Ke]=N.useState(!1),[it,me]=N.useState(!1),[We,dt]=N.useState(!1),[sn,_t]=N.useState(!1),[an,Vt]=N.useState(null),[zt,bt]=N.useState(""),[mn,le]=N.useState(!1),[Ie,Be]=N.useState(!1),[ze,Ue]=N.useState("indexed"),[pt,rn]=N.useState([]),[Ss,Ks]=N.useState(null),[js,Vs]=N.useState(!1),[ls,_e]=N.useState(null),[Ht,Ve]=N.useState(null),ae=a.find($=>$.connectionType==="gsc"),Jn=f.length>0||m.length>0||y.length>0;async function yl($){if(!$){d([]),C("");return}oe(!0);try{const{sites:fe}=await Gw(e);d(fe),C($.propertyId??fe[0]?.siteUrl??"")}catch(fe){d([]),_e(fe instanceof Error?fe.message:"Failed to load Search Console properties")}finally{oe(!1)}}async function Qs(){Z(!0);try{const $=await Kw(e,{startDate:R.startDate||void 0,endDate:R.endDate||void 0,query:R.query||void 0,page:R.page||void 0,limit:parseInt(R.limit,10)||20});p($)}catch($){p([]),_e($ instanceof Error?$.message:"Failed to load GSC performance data")}finally{Z(!1)}}async function ws(){re(!0);try{const[$,fe]=await Promise.all([Qw(e,{url:P.trim()||void 0,limit:20}),Yw(e)]);v($),x(fe)}catch($){v([]),x([]),_e($ instanceof Error?$.message:"Failed to load GSC inspection history")}finally{re(!1)}}async function Gi(){Ke(!0);try{const[$,fe]=await Promise.all([Op(e),Jw(e).catch(()=>[])]);Me($),rn(fe)}catch($){Me(null),rn([]),_e($ instanceof Error?$.message:"Failed to load coverage data")}finally{Ke(!1)}}async function cs($){Vs(!0),_e(null);try{const fe=await Am(e,{urls:$}),{succeeded:at,failed:Qt,total:Lt}=fe.summary;Ve(Qt===0?`Indexing requested for ${at} URL${at!==1?"s":""}.`:`Indexing requested: ${at}/${Lt} succeeded, ${Qt} failed.`)}catch(fe){_e(fe instanceof Error?fe.message:"Failed to request indexing")}finally{Vs(!1)}}async function Oa(){Vs(!0),_e(null);try{const $=await Am(e,{urls:[],allUnindexed:!0}),{succeeded:fe,failed:at,total:Qt}=$.summary;Ve(at===0?`Indexing requested for ${fe} unindexed URL${fe!==1?"s":""}.`:`Indexing requested: ${fe}/${Qt} succeeded, ${at} failed.`)}catch($){_e($ instanceof Error?$.message:"Failed to request indexing")}finally{Vs(!1)}}async function us(){if(zt.trim()){le(!0),_e(null);try{await Zw(e,"gsc",zt.trim()),r($=>$.map(fe=>fe.connectionType==="gsc"?{...fe,sitemapUrl:zt.trim()}:fe)),Ve("Sitemap URL saved."),bt("")}catch($){_e($ instanceof Error?$.message:"Failed to save sitemap URL")}finally{le(!1)}}}async function vl(){dt(!0),_e(null);try{const $=await eN(e);Vt($.sitemaps),r(fe=>fe.map(at=>at.connectionType==="gsc"?{...at,sitemapUrl:$.primarySitemapUrl}:at)),Ve(`Discovered ${$.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${$.run.id}).`)}catch($){_e($ instanceof Error?$.message:"Failed to discover sitemaps")}finally{dt(!1)}}async function xl(){_t(!0),_e(null);try{const $=await Ww(e);Vt($.sitemaps),$.sitemaps.length===0&&Ve("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch($){_e($ instanceof Error?$.message:"Failed to list sitemaps")}finally{_t(!1)}}async function Da(){se(!0),_e(null);try{const[$,fe]=await Promise.all([Vu().catch(()=>null),Rp(e).catch(()=>[])]);s(!!$?.google?.configured),r(fe);const at=fe.find(Qt=>Qt.connectionType==="gsc");await Promise.all([yl(at),Qs(),ws(),Gi()])}finally{se(!1)}}N.useEffect(()=>{Da()},[e]);async function Fi(){if(!t){_e("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ke(!0),_e(null),Ve(null);try{const{authUrl:$}=await qw(e,"gsc");if(!$.startsWith("https://accounts.google.com/")){_e("Unexpected OAuth redirect URL. Please try again.");return}const fe=window.open($,"_blank","width=600,height=700");if(!fe){window.location.assign($);return}Ve("Finish the Google consent flow in the popup, then close it to refresh this project.");const at=window.setInterval(()=>{fe.closed&&(window.clearInterval(at),Ve(null),Da())},1e3)}catch($){_e($ instanceof Error?$.message:"Failed to start OAuth flow")}finally{ke(!1)}}async function ld(){_e(null),Ve(null);try{await Hw(e,"gsc"),r($=>$.filter(fe=>fe.connectionType!=="gsc")),d([]),C("")}catch($){_e($ instanceof Error?$.message:"Failed to disconnect")}}async function bl(){if(S){X(!0),_e(null);try{await Fw(e,"gsc",S),r($=>$.map(fe=>fe.connectionType==="gsc"?{...fe,propertyId:S}:fe)),Ve("GSC property updated.")}catch($){_e($ instanceof Error?$.message:"Failed to save GSC property")}finally{X(!1)}}}async function Sl(){B(!0),_e(null),Ve(null);try{await Tp(e,{days:parseInt(A,10)||void 0,full:L||void 0}),Ve("GSC sync queued. Refresh after the run completes to see imported data.")}catch($){_e($ instanceof Error?$.message:"Failed to trigger sync")}finally{B(!1)}}async function Zr(){if(k.trim()){he(!0),_e(null),Ve(null);try{const $=await Vw(e,k.trim());w($),E(""),await ws()}catch($){_e($ instanceof Error?$.message:"Failed to inspect URL")}finally{he(!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.jsx("div",{className:"flex items-center gap-2",children:ae&&l.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Qs()},children:O?"Refreshing…":"Refresh data"})})]}),ls&&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:[ls,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>_e(null),children:"×"})]}),Ht&&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:[Ht,l.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>Ve(null),children:"×"})]}),Q?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs(De,{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(nt,{tone:ae?"positive":t?"caution":"negative",children:ae?"Connected":t?"Ready to connect":"App credentials missing"})]}),ae?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:ae.domain}),l.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:ld,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:ae.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:ae.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:vs(ae.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:t?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),l.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?l.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:Fi,children:pe?"Opening…":"Connect Google Search Console"}):l.jsx(ce,{type:"button",variant:"outline",size:"sm",asChild:!0,children:l.jsx(yt,{to:"/settings",children:"Open Settings"})}),!t&&l.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),ae&&!ae.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(ce,{type:"button",size:"sm",disabled:We||!ae.propertyId,onClick:vl,children:We?"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:zt,onChange:$=>bt($.target.value),onKeyDown:$=>$.key==="Enter"&&void us()}),l.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:mn||!zt.trim(),onClick:us,children:mn?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ae||Jn)&&l.jsxs(l.Fragment,{children:[l.jsxs(De,{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:[de&&de.notIndexed.length>0&&l.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:js,onClick:()=>{Oa()},children:js?"Requesting…":`Request indexing (${de.notIndexed.length})`}),l.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:ge,onClick:()=>{Gi()},children:ge?"Loading…":"Refresh coverage"})]})]}),de&&de.summary.total>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const $=de.summary.indexed+de.summary.notIndexed,fe=$>0?de.summary.indexed/$:0,at=$>0?de.summary.notIndexed/$:0,Qt=54,Lt=2*Math.PI*Qt,Et=Lt*(1-fe),Nt=Lt*at,Cn=Lt*fe;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:Qt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),l.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Lt,strokeDashoffset:Et,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),de.summary.notIndexed>0&&l.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Nt} ${Lt-Nt}`,strokeDashoffset:-Cn,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:[(fe*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:de.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:de.summary.notIndexed.toLocaleString()}),l.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(de.reasonGroups??[]).length>0&&l.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(de.reasonGroups??[]).length," ",(de.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),de.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:de.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($=>{const fe=$==="indexed"?de.indexed.length:$==="notIndexed"?de.notIndexed.length:de.deindexed.length,at=$==="indexed"?"Indexed":$==="notIndexed"?"Not Indexed":"Deindexed";return l.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ze===$?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Ue($),Ks(null)},children:[at," (",fe,")"]},$)})}),l.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ze==="indexed"&&de.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:de.indexed.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.crawlTime?$.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:$.isMobileFriendly===!0?"Yes":$.isMobileFriendly===!1?"No":"—"})]},$.id))})]}),ze==="notIndexed"&&!Ss&&(de.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:(de.reasonGroups??[]).map($=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Ks($.reason),children:[l.jsx("td",{className:"text-zinc-200",children:$.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.count})]},$.reason))})]}),ze==="notIndexed"&&!Ss&&(de.reasonGroups??[]).length===0&&de.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:de.notIndexed.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"})]},$.id))})]}),ze==="notIndexed"&&Ss&&(()=>{const $=(de.reasonGroups??[]).find(fe=>fe.reason===Ss);return $?l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-2 mb-3",children:l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ks(null),children:"\\u2190 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:$.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[$.count," affected page",$.count!==1?"s":""]})]}),l.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:js,onClick:()=>{cs($.urls.map(fe=>fe.url))},children:js?"Requesting…":`Request indexing (${$.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:$.urls.map(fe=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:fe.url}),l.jsx("td",{className:"text-zinc-400",children:fe.crawlTime?fe.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:js,onClick:()=>{cs([fe.url])},title:"Request indexing",children:"Index"})})]},fe.id))})]})]}):null})(),ze==="deindexed"&&de.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:de.deindexed.map(($,fe)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.previousState}),l.jsx("td",{className:"text-zinc-400",children:$.currentState}),l.jsx("td",{className:"text-zinc-400",children:$.transitionDate.split("T")[0]})]},`${$.url}-${fe}`))})]}),(ze==="indexed"&&de.indexed.length===0||ze==="notIndexed"&&!Ss&&de.notIndexed.length===0||ze==="deindexed"&&de.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:ge?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),l.jsxs(De,{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(ce,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Qs()},children:O?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const $=new Map;for(const qe of f){const rt=$.get(qe.date);rt?(rt.clicks+=qe.clicks,rt.impressions+=qe.impressions):$.set(qe.date,{clicks:qe.clicks,impressions:qe.impressions})}const fe=[...$.entries()].sort(([qe],[rt])=>qe.localeCompare(rt));if(fe.length===0)return null;const at=Math.max(...fe.map(([,qe])=>qe.impressions),1),Qt=fe.reduce((qe,[,rt])=>qe+rt.clicks,0),Lt=fe.reduce((qe,[,rt])=>qe+rt.impressions,0),Et=Lt>0?(Qt/Lt*100).toFixed(1):"0.0",Nt=700,Cn=220,en={top:12,bottom:36,left:48,right:12},cd=Nt-en.left-en.right,Ys=Cn-en.top-en.bottom,Js=cd/fe.length,ds=Math.max(Math.min(Js*.35,24),4),La=Math.max(ds*.15,1),Xs=qe=>{if(qe<=0)return 1;const rt=Math.pow(10,Math.floor(Math.log10(qe))),Gt=qe/rt,on=Gt<=1.5?1.5:Gt<=3?3:Gt<=5?5:10;return Math.ceil(on*rt)},Xn=4,fs=Math.ceil(Xs(at)/Xn)*Xn,Ws=Array.from({length:Xn+1},(qe,rt)=>fs/Xn*rt),Mt=qe=>qe>=1e3?`${(qe/1e3).toFixed(qe>=1e4?0:1)}k`:String(qe);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:Qt.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:Lt.toLocaleString()})]})]}),l.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",l.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Et,"%"]})]})]}),l.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Nt} / ${Cn}`},children:l.jsxs("svg",{viewBox:`0 0 ${Nt} ${Cn}`,className:"h-full w-full",children:[Ws.map((qe,rt)=>{const Gt=en.top+Ys-qe/fs*Ys;return l.jsxs("g",{children:[l.jsx("line",{x1:en.left,y1:Gt,x2:Nt-en.right,y2:Gt,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),l.jsx("text",{x:en.left-6,y:Gt+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Mt(qe)})]},`t-${rt}`)}),fe.map(([qe,rt],Gt)=>{const on=en.left+Js*Gt+Js/2,Ma=rt.impressions/fs*Ys,Kr=rt.clicks/fs*Ys;return l.jsxs("g",{children:[l.jsx("title",{children:`${qe}
233
+ keywords: []`,value:t,onChange:v=>s(v.target.value)}),c.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,y)=>o.jsx("li",{className:"text-emerald-400 text-sm",children:v},y))}),f.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:f.map((v,y)=>o.jsx("li",{className:"text-rose-400 text-sm",children:v},y))}),o.jsx("div",{className:"mt-3",children:o.jsx(ce,{type:"button",disabled:!t.trim()||a,onClick:m,children:a?"Applying...":"Apply"})})]})}function U3(){const{dashboard:e,isLoading:t,refetch:s}=Ra();if(!e||t)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-28"}),o.jsx("div",{className:"skeleton-text-sm w-40"})]}),o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[o.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(A=>o.jsx("div",{className:"skeleton-text-sm w-16"},A))}),[1,2,3].map(A=>o.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsx("div",{className:"skeleton-text w-28"}),o.jsx("div",{className:"skeleton-text-sm w-16"})]}),o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),o.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),o.jsx("div",{className:"skeleton-text-sm w-8"})]},A))]})]});const a=e.projects,r=ka(),[c,d]=N.useState(!1),[f,p]=N.useState(""),[m,v]=N.useState(""),[y,x]=N.useState(""),[b,w]=N.useState("US"),[S,C]=N.useState("en"),[k,E]=N.useState(!1),[R,z]=N.useState(null),L=f.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),M=async()=>{if(!(!L||!y)){E(!0),z(null);try{const A=await ll(L,{displayName:m||f,canonicalDomain:y,country:b,language:S});s(),p(""),v(""),x(""),w("US"),C("en"),d(!1),r({to:"/projects/$projectId",params:{projectId:A.id}})}catch(A){z(A instanceof Error?A.message:"Failed to create project")}finally{E(!1)}}};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Projects"}),o.jsxs("p",{className:"page-subtitle",children:[a.length," project",a.length!==1?"s":""," tracked"]})]}),o.jsx("div",{className:"page-header-right",children:o.jsxs(ce,{type:"button",onClick:()=>d(A=>!A),children:[o.jsx(Mx,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?o.jsxs(De,{className:"surface-card mb-6",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),o.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),o.jsxs("div",{className:"compact-stack mt-4",children:[o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),o.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:f,onChange:A=>p(A.target.value)}),L&&L!==f?o.jsxs("p",{className:"supporting-copy",children:["Slug: ",L]}):null]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),o.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:m,onChange:A=>v(A.target.value)})]})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),o.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:y,onChange:A=>x(A.target.value)})]}),o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),o.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:b,onChange:A=>w(A.target.value.toUpperCase())})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),o.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:S,onChange:A=>C(A.target.value.toLowerCase())})]})]})]}),R?o.jsx("p",{className:"text-rose-400 text-sm mt-3",children:R}):null,o.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[o.jsx(ce,{type:"button",disabled:!L||!y||k,onClick:M,children:k?"Creating...":"Create project"}),o.jsx(ce,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,a.length>0?o.jsx("div",{className:"data-table-wrapper",children:o.jsxs("table",{className:"data-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Name"}),o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Visibility"}),o.jsx("th",{children:"Last run"}),o.jsx("th",{className:"text-right",children:"Country"})]})}),o.jsx("tbody",{children:a.map(A=>{const T=A.recentRuns[0];return o.jsxs("tr",{className:"cursor-pointer",onClick:()=>r({to:"/projects/$projectId",params:{projectId:A.project.id}}),children:[o.jsxs("td",{children:[o.jsx(yt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:P=>P.stopPropagation(),children:A.project.displayName||A.project.name}),o.jsx("p",{className:"text-[11px] text-zinc-500",children:A.project.name})]}),o.jsx("td",{className:"text-zinc-400",children:A.project.canonicalDomain}),o.jsx("td",{children:o.jsx(nt,{tone:A.visibilitySummary.tone,children:A.visibilitySummary.value})}),o.jsx("td",{className:"text-zinc-500 text-sm",children:T?o.jsx(Pu,{status:T.status}):o.jsx("span",{className:"text-zinc-600",children:"No runs"})}),o.jsx("td",{className:"text-right text-zinc-500",children:A.project.country})]},A.project.id)})})]})}):c?null:o.jsxs(De,{className:"surface-card empty-card",children:[o.jsx("h3",{children:"No projects yet"}),o.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),o.jsxs(ce,{type:"button",onClick:()=>d(!0),children:[o.jsx(Mx,{className:"size-4 mr-1.5"}),"Add project"]})]}),o.jsx(M3,{onApplied:()=>{s()}})]})}function Zs({text:e}){return o.jsxs("span",{className:"info-tooltip-wrapper",children:[o.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),o.jsx("span",{className:"info-tooltip-bubble",role:"tooltip",children:e})]})}function n1({run:e}){const{openRun:t}=ul();return o.jsxs("article",{className:"run-row",children:[o.jsxs("div",{className:"run-row-main",children:[o.jsxs("div",{className:"run-row-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:e.summary}),o.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),o.jsx(Pu,{status:e.status})]}),o.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),o.jsxs("dl",{className:"run-row-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Started"}),o.jsx("dd",{children:e.startedAt})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Duration"}),o.jsx("dd",{children:e.duration})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Trigger"}),o.jsx("dd",{children:e.triggerLabel})]})]}),o.jsx(ce,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function s1({value:e,label:t,delta:s,tone:a,description:r,tooltip:c,isNumeric:d=!0}){const m=2*Math.PI*48,v=Number.parseInt(e,10),y=d&&!Number.isNaN(v)?Math.min(v/100,1):.5,x=m*(1-y);return o.jsxs("div",{className:"score-gauge",children:[o.jsxs("div",{className:"gauge-ring-wrapper",children:[o.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[o.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),o.jsx("circle",{className:`gauge-fill gauge-fill-${a}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:x,transform:"rotate(-90 60 60)"})]}),o.jsx("div",{className:"gauge-center",children:o.jsx("span",{className:d?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),o.jsxs("p",{className:"gauge-label",children:[t,c&&o.jsx(Zs,{text:c})]}),o.jsx("p",{className:"gauge-delta",children:s}),o.jsx("p",{className:"gauge-description",children:r})]})}function Zb({history:e,maxDots:t=12}){const s=e.slice(-t);if(s.length===0)return o.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const a={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},r=new Date(s[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),c=new Date(s[s.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:r}),o.jsx("div",{className:"flex items-center gap-[3px]",title:`${s.length} runs`,children:s.map((d,f)=>o.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${a[d.citationState]??"bg-zinc-700"} ${d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[d.citationState,new Date(d.createdAt).toLocaleDateString(),d.model?`model ${d.model}`:null,d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"model changed":null].filter(Boolean).join(" — ")},f))}),o.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:c})]})}function $3(e){const t=new Map;for(const a of e)for(const r of a.runHistory){const c=t.get(r.createdAt);c?c.states.push(r.citationState):t.set(r.createdAt,{states:[r.citationState],runId:r.runId})}return[...t.entries()].sort(([a],[r])=>a.localeCompare(r)).map(([a,{states:r,runId:c}])=>({runId:c,createdAt:a,citationState:r.includes("cited")?"cited":r.includes("emerging")?"emerging":"not-cited"}))}function P3({evidence:e}){const{openEvidence:t}=ul(),[s,a]=N.useState(new Set),r=N.useMemo(()=>{const d=new Map;for(const f of e){const p=d.get(f.keyword)??[];d.set(f.keyword,[...p,f])}return[...d.entries()].map(([f,p])=>({phrase:f,items:p}))},[e]),c=d=>{a(f=>{const p=new Set(f);return p.has(d)?p.delete(d):p.add(d),p})};return o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{width:"2rem"}}),o.jsx("th",{children:"Key Phrase"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:"Citation History"}),o.jsx("th",{children:"Change"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:r.map(({phrase:d,items:f})=>{const p=s.has(d),m=f.map(w=>w.citationState),v=m.includes("cited")?"cited":m.includes("emerging")?"emerging":m.includes("lost")?"lost":m.every(w=>w==="pending")?"pending":"not-cited",y=$3(f),x=f.filter(w=>w.citationState==="cited"||w.citationState==="emerging").length,b=(()=>{if(y.length===0)return"Awaiting first run";if(y.length===1)return"First observation";const w=y[y.length-1].citationState,S=y[y.length-2].citationState;if(S!=="cited"&&w==="cited")return"Newly cited";if(S==="cited"&&w!=="cited")return"Lost since last run";let C=0;for(let k=y.length-1;k>=0&&y[k].citationState===w;k--)C++;return w==="cited"?C<=1?"Cited in latest run":`Cited for ${C} runs`:C<=1?"Not cited in latest run":`Not cited across ${C} runs`})();return o.jsxs(N.Fragment,{children:[o.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(d),"aria-expanded":p,children:[o.jsx("td",{children:o.jsx(Mu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${p?"rotate-90":""}`})}),o.jsx("td",{className:"evidence-keyword-cell",children:o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-zinc-100",children:d}),o.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(w=>o.jsx(tl,{provider:w.provider},w.id))})]})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(km,{state:v}),o.jsxs("span",{className:"text-[11px] text-zinc-500",children:[x,"/",f.length]})]})}),o.jsx("td",{children:o.jsx(Zb,{history:y})}),o.jsx("td",{className:"evidence-change-cell",children:b}),o.jsx("td",{})]}),p&&f.map(w=>o.jsxs("tr",{className:"bg-zinc-900/30",children:[o.jsx("td",{}),o.jsx("td",{className:"evidence-keyword-cell pl-5",children:o.jsx(tl,{provider:w.provider})}),o.jsx("td",{children:o.jsx(km,{state:w.citationState})}),o.jsx("td",{children:o.jsx(Zb,{history:w.runHistory})}),o.jsx("td",{className:"evidence-change-cell",children:w.changeLabel}),o.jsx("td",{children:o.jsx(ce,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(w.id)},children:"View"})})]},w.id))]},d)})})]})})}function I3({competitors:e}){return e.length===0?o.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):o.jsx("div",{className:"competitor-table-wrap",children:o.jsxs("table",{className:"competitor-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Pressure"}),o.jsx("th",{children:"Citations"}),o.jsx("th",{children:"Key Phrases"})]})}),o.jsx("tbody",{children:e.map(t=>o.jsxs("tr",{children:[o.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),o.jsx("td",{children:o.jsx(nt,{tone:FE(t.pressureLabel),children:t.pressureLabel})}),o.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),o.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}const B3=["7d","30d","90d","all"],q3=["gap","cited","uncited"],i1={forum:"bg-amber-500",social:"bg-blue-500",news:"bg-zinc-400",reference:"bg-purple-500",blog:"bg-emerald-500",ecommerce:"bg-orange-500",video:"bg-red-500",academic:"bg-cyan-500",other:"bg-zinc-600"};function H3({projectName:e}){const[t,s]=N.useState("30d"),[a,r]=N.useState(null),[c,d]=N.useState(null),[f,p]=N.useState(null),[m,v]=N.useState(null),[y,x]=N.useState(!0);return N.useEffect(()=>{let b=!1;return x(!0),Promise.all([lN(e,t),cN(e,t),uN(e,t)]).then(([w,S,C])=>{b||(r(w),d(S),p(C),x(!1))}).catch(()=>{b||x(!1)}),()=>{b=!0}},[e,t]),y&&!a?o.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):o.jsxs(o.Fragment,{children:[o.jsxs("section",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",o.jsx(Zs,{text:"Citation rate over time across all runs within the selected window. Each data point represents the percentage of queries where your brand was cited by AI providers."})]})]}),o.jsx("div",{className:"flex gap-1",children:B3.map(b=>o.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===b?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>s(b),children:b==="all"?"All":b},b))})]}),a&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsx(s1,{value:`${Math.round(a.overall.citationRate*100)}`,label:"Citation Rate",delta:`${a.overall.cited} / ${a.overall.total}`,tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",description:`Trend: ${a.trend}`,isNumeric:!0}),o.jsxs("div",{className:"flex-1 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),o.jsx(nt,{tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",children:a.trend})]}),Object.keys(a.byProvider).length>0&&o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Cited / Total"})]})}),o.jsx("tbody",{children:Object.entries(a.byProvider).map(([b,w])=>o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 text-zinc-300",children:b}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(w.citationRate*100).toFixed(1),"%"]}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[w.cited," / ",w.total]})]},b))})]})]})]}),a.buckets.length>=1&&o.jsx(G3,{buckets:a.buckets,keywordChanges:a.keywordChanges??[]})]})]}),o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsx("div",{className:"flex items-center justify-between mb-4",children:o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",o.jsx(Zs,{text:"Classification based on the most recent completed run. Cited: your brand appeared in the AI answer. Gap: a competitor was cited but you were not. Not Cited: neither mentioned. Consistency shows how often each keyword was cited across all runs in the selected window."})]})]})}),c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex gap-1 mb-4",children:q3.map(b=>{const w=b==="cited"?c.cited.length:b==="gap"?c.gap.length:c.uncited.length,S=m===b;return o.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?b==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":b==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>v(S?null:b),children:[b==="gap"?"Gap":b==="cited"?"Cited":"Not Cited"," (",w,")"]},b)})}),o.jsx(F3,{gaps:c,filter:m})]})]}),o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",o.jsx(Zs,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),f&&f.overall.length>0&&o.jsxs("div",{className:"space-y-4",children:[o.jsx(Z3,{categories:f.overall}),o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),o.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),o.jsx("tbody",{children:f.overall.map(b=>o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[o.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${i1[b.category]??"bg-zinc-600"}`}),b.label]}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:b.count}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(b.percentage*100).toFixed(1),"%"]}),o.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:b.topDomains.slice(0,3).map(w=>w.domain).join(", ")})]},b.category))})]})]}),f&&f.overall.length===0&&o.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function G3({buckets:e,keywordChanges:t}){const[s,a]=N.useState(null),r=600,c=140,d={top:30,right:10,bottom:20,left:40},f=r-d.left-d.right,p=c-d.top-d.bottom,m=1,v=e.map((b,w)=>{const S=d.left+(e.length>1?w/(e.length-1)*f:f/2),C=d.top+p-b.citationRate/m*p;return{x:S,y:C}}),y=N.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const b=new Date(e[0].startDate).getTime(),S=new Date(e[e.length-1].startDate).getTime()-b;return S<=0?[]:t.map(C=>{const E=(new Date(C.date).getTime()-b)/S;return E<0||E>1?null:{...C,x:d.left+E*f}}).filter(C=>C!==null)},[e,t,d.left,f]),x=v.map(b=>`${b.x},${b.y}`).join(" ");return o.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[o.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),o.jsxs("svg",{viewBox:`0 0 ${r} ${c}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>a(null),children:[o.jsxs("text",{x:d.left-4,y:d.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(m*100).toFixed(0),"%"]}),o.jsx("text",{x:d.left-4,y:d.top+p+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),o.jsx("line",{x1:d.left,y1:d.top+p,x2:d.left+f,y2:d.top+p,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),o.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:x}),y.map((b,w)=>o.jsxs("g",{children:[o.jsx("line",{x1:b.x,y1:d.top,x2:b.x,y2:d.top+p,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"4 2"}),o.jsx("text",{x:b.x,y:d.top-6,textAnchor:"middle",className:"fill-zinc-500",fontSize:"7",fontWeight:"500",children:b.label})]},`kw-change-${w}`)),s!==null&&o.jsx("line",{x1:v[s].x,y1:d.top,x2:v[s].x,y2:d.top+p,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((b,w)=>{const{x:S,y:C}=v[w],k=s===w;return o.jsxs("g",{children:[o.jsx("circle",{cx:S,cy:C,r:"10",fill:"transparent",onMouseEnter:()=>a(w),style:{cursor:"pointer"}}),o.jsx("circle",{cx:S,cy:C,r:k?5:3,className:k?"fill-emerald-400":"fill-emerald-500"})]},w)}),s!==null&&(()=>{const b=e[s],{x:w,y:S}=v[s],C=`${(b.citationRate*100).toFixed(1)}%`,k=b.keywordCount?`${b.keywordCount} kp`:"",E=56,R=30,z=Math.max(d.left,Math.min(w-E/2,r-d.right-E)),L=S-R-8;return o.jsxs("g",{children:[o.jsx("rect",{x:z,y:L,width:E,height:R,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),o.jsx("text",{x:z+E/2,y:L+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:C}),k&&o.jsx("text",{x:z+E/2,y:L+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:k})]})})(),e.map((b,w)=>({b,i:w})).filter(({i:b})=>b===0||b===e.length-1||e.length<=7).map(({b,i:w})=>{const S=v[w].x;return o.jsx("text",{x:S,y:c-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:b.startDate.slice(5,10)},w)})]})]})}function F3({gaps:e,filter:t}){const s=N.useMemo(()=>{const a=[...e.gap.map(r=>({...r,_sort:0})),...e.cited.map(r=>({...r,_sort:1})),...e.uncited.map(r=>({...r,_sort:2}))];return t?a.filter(r=>r.category===t):a.sort((r,c)=>r._sort-c._sort)},[e,t]);return s.length===0?o.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No keywords found",t?` with status "${t}"`:"","."]}):o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Providers Citing"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),o.jsx("tbody",{children:s.map(a=>{const r=a.category==="cited"?"positive":a.category==="gap"?"caution":"neutral";return o.jsxs("tr",{className:`border-t border-zinc-800/40 ${a.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[o.jsx("td",{className:"py-1.5 text-zinc-200",children:a.keyword}),o.jsx("td",{className:"py-1.5",children:o.jsx(nt,{tone:r,children:a.category==="gap"?"Gap":a.category==="cited"?"Cited":"Not Cited"})}),o.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.providers.length>0?a.providers.join(", "):"—"}),o.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.competitorsCiting.length>0?a.competitorsCiting.join(", "):"—"}),o.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:a.consistency.totalRuns>0?`${a.consistency.citedRuns}/${a.consistency.totalRuns} runs`:"—"})]},a.keywordId)})})]})}function Z3({categories:e}){const t=e.reduce((s,a)=>s+a.count,0);return t===0?null:o.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(s=>{const a=s.count/t*100;return a<.5?null:o.jsx("div",{className:`${i1[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function Wh(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function K3(e){const t=Date.now()-new Date(e).getTime(),s=Math.floor(t/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function V3({projectName:e}){const[t,s]=N.useState(null),[a,r]=N.useState(null),[c,d]=N.useState(!0),[f,p]=N.useState(!1),[m,v]=N.useState(!1),[y,x]=N.useState(null),[b,w]=N.useState(null),[S,C]=N.useState("sessions"),[k,E]=N.useState("desc");function R(P){d(!0),Tm(e).then(J=>{if(!P.current)return s(J),J.connected?Om(e):null}).then(J=>{P.current||(J&&r(J),d(!1))}).catch(J=>{P.current||(x(J instanceof Error?J.message:"Failed to load GA4 data"),d(!1))})}N.useEffect(()=>{const P={current:!1};return R(P),()=>{P.current=!0}},[e]);async function z(){p(!0),x(null),w(null);try{const P=await dN(e);w(`Synced ${P.rowCount.toLocaleString()} rows (${P.days} days)`);const J=await Om(e);r(J);const Q=await Tm(e);s(Q)}catch(P){x(P instanceof Error?P.message:"Sync failed")}finally{p(!1)}}async function L(){v(!0),x(null),w(null);try{await fN(e),s({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),r(null),w("GA4 disconnected")}catch(P){x(P instanceof Error?P.message:"Disconnect failed")}finally{v(!1)}}function M(P){S===P?E(J=>J==="desc"?"asc":"desc"):(C(P),E("desc"))}const A=N.useMemo(()=>a?.topPages?[...a.topPages].sort((P,J)=>{const Q=P[S],se=J[S];return typeof Q=="string"&&typeof se=="string"?k==="asc"?Q.localeCompare(se):se.localeCompare(Q):k==="asc"?Q-se:se-Q}):[],[a?.topPages,S,k]);if(c&&!t)return o.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return o.jsxs(De,{className:"surface-card p-6",children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-2",children:"Google Analytics 4"}),o.jsx("p",{className:"text-sm text-zinc-400 mb-4",children:"Connect a GA4 property via the CLI to see traffic data for this project."}),o.jsx("div",{className:"bg-zinc-900/60 rounded-lg p-3 border border-zinc-800/60",children:o.jsxs("code",{className:"text-sm text-zinc-300",children:["canonry ga connect ",e," --key-file service-account.json --property-id 123456789"]})})]});const T=a&&a.totalSessions>0?Math.round(a.totalOrganicSessions/a.totalSessions*100):0;return o.jsxs(o.Fragment,{children:[y&&o.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}),b&&o.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:b}),o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",o.jsx("span",{className:"text-zinc-300",children:t.propertyId}),t.clientEmail&&o.jsxs(o.Fragment,{children:[" · ",o.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(ce,{variant:"outline",size:"sm",disabled:f,onClick:z,children:[o.jsx(Ux,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"Syncing…":"Sync"]}),o.jsxs(ce,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:m,onClick:L,children:[o.jsx($2,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",o.jsx(Zs,{text:"Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across all synced dates. Organic sessions are Google organic search sessions specifically."})]})]}),a?o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsx(em,{value:Wh(a.totalSessions),label:"Total Sessions",subtitle:a.totalSessions.toLocaleString(),tone:"neutral"}),o.jsx(em,{value:Wh(a.totalOrganicSessions),label:"Organic Sessions",subtitle:`${T}% of total`,tone:"positive"}),o.jsx(em,{value:Wh(a.totalUsers),label:"Total Users",subtitle:a.totalUsers.toLocaleString(),tone:"neutral"})]}):o.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[o.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),o.jsxs(ce,{variant:"outline",size:"sm",disabled:f,onClick:z,children:[o.jsx(Ux,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),"Sync from GA4"]})]})]}),a&&a.topPages.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",o.jsx(Zs,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx(Wc,{label:"Landing Page",sortKey:"landingPage",current:S,dir:k,onSort:M,align:"left"}),o.jsx(Wc,{label:"Sessions",sortKey:"sessions",current:S,dir:k,onSort:M,align:"right"}),o.jsx(Wc,{label:"Organic",sortKey:"organicSessions",current:S,dir:k,onSort:M,align:"right"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),o.jsx(Wc,{label:"Users",sortKey:"users",current:S,dir:k,onSort:M,align:"right"})]})}),o.jsx("tbody",{children:A.map(P=>o.jsx(Y3,{page:P},P.landingPage))})]})})]})]}),o.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[o.jsx("span",{children:a?.lastSyncedAt?`Last synced ${K3(a.lastSyncedAt)}`:"Never synced"}),o.jsx("span",{children:a?`${a.topPages.length} pages shown`:""})]})]})}function Wc({label:e,sortKey:t,current:s,dir:a,onSort:r,align:c}){const d=s===t;return o.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${c==="right"?"text-right":"text-left"}`,onClick:()=>r(t),children:[e,d&&o.jsx("span",{className:"ml-0.5",children:a==="asc"?"↑":"↓"})]})}const Q3={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function em({value:e,label:t,subtitle:s,tone:a}){return o.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),o.jsx("p",{className:`text-2xl font-bold tabular-nums ${Q3[a]}`,children:e}),o.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:s})]})}function Y3({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),o.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function J3({projectName:e}){const[t,s]=N.useState(!1),[a,r]=N.useState([]),[c,d]=N.useState([]),[f,p]=N.useState([]),[m,v]=N.useState([]),[y,x]=N.useState([]),[b,w]=N.useState(null),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,z]=N.useState("30"),[L,M]=N.useState(!1),[A,T]=N.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[P,J]=N.useState(""),[Q,se]=N.useState(!0),[pe,ke]=N.useState(!1),[je,B]=N.useState(!1),[G,oe]=N.useState(!1),[q,X]=N.useState(!1),[O,Z]=N.useState(!1),[ie,re]=N.useState(!1),[ue,he]=N.useState(!1),[de,Me]=N.useState(null),[ge,Ke]=N.useState(!1),[it,me]=N.useState(!1),[We,dt]=N.useState(!1),[sn,kt]=N.useState(!1),[an,Vt]=N.useState(null),[_t,zt]=N.useState(""),[mn,le]=N.useState(!1),[Ie,Be]=N.useState(!1),[ze,Ue]=N.useState("indexed"),[pt,rn]=N.useState([]),[Ss,Vs]=N.useState(null),[js,Qs]=N.useState(!1),[ls,_e]=N.useState(null),[Ht,Ve]=N.useState(null),ae=a.find($=>$.connectionType==="gsc"),Jn=f.length>0||m.length>0||y.length>0;async function gl($){if(!$){d([]),C("");return}oe(!0);try{const{sites:fe}=await Gw(e);d(fe),C($.propertyId??fe[0]?.siteUrl??"")}catch(fe){d([]),_e(fe instanceof Error?fe.message:"Failed to load Search Console properties")}finally{oe(!1)}}async function Ys(){Z(!0);try{const $=await Kw(e,{startDate:A.startDate||void 0,endDate:A.endDate||void 0,query:A.query||void 0,page:A.page||void 0,limit:parseInt(A.limit,10)||20});p($)}catch($){p([]),_e($ instanceof Error?$.message:"Failed to load GSC performance data")}finally{Z(!1)}}async function ws(){re(!0);try{const[$,fe]=await Promise.all([Qw(e,{url:P.trim()||void 0,limit:20}),Yw(e)]);v($),x(fe)}catch($){v([]),x([]),_e($ instanceof Error?$.message:"Failed to load GSC inspection history")}finally{re(!1)}}async function Fi(){Ke(!0);try{const[$,fe]=await Promise.all([Op(e),Jw(e).catch(()=>[])]);Me($),rn(fe)}catch($){Me(null),rn([]),_e($ instanceof Error?$.message:"Failed to load coverage data")}finally{Ke(!1)}}async function cs($){Qs(!0),_e(null);try{const fe=await Rm(e,{urls:$}),{succeeded:at,failed:Qt,total:Lt}=fe.summary;Ve(Qt===0?`Indexing requested for ${at} URL${at!==1?"s":""}.`:`Indexing requested: ${at}/${Lt} succeeded, ${Qt} failed.`)}catch(fe){_e(fe instanceof Error?fe.message:"Failed to request indexing")}finally{Qs(!1)}}async function Ta(){Qs(!0),_e(null);try{const $=await Rm(e,{urls:[],allUnindexed:!0}),{succeeded:fe,failed:at,total:Qt}=$.summary;Ve(at===0?`Indexing requested for ${fe} unindexed URL${fe!==1?"s":""}.`:`Indexing requested: ${fe}/${Qt} succeeded, ${at} failed.`)}catch($){_e($ instanceof Error?$.message:"Failed to request indexing")}finally{Qs(!1)}}async function us(){if(_t.trim()){le(!0),_e(null);try{await Zw(e,"gsc",_t.trim()),r($=>$.map(fe=>fe.connectionType==="gsc"?{...fe,sitemapUrl:_t.trim()}:fe)),Ve("Sitemap URL saved."),zt("")}catch($){_e($ instanceof Error?$.message:"Failed to save sitemap URL")}finally{le(!1)}}}async function yl(){dt(!0),_e(null);try{const $=await eN(e);Vt($.sitemaps),r(fe=>fe.map(at=>at.connectionType==="gsc"?{...at,sitemapUrl:$.primarySitemapUrl}:at)),Ve(`Discovered ${$.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${$.run.id}).`)}catch($){_e($ instanceof Error?$.message:"Failed to discover sitemaps")}finally{dt(!1)}}async function vl(){kt(!0),_e(null);try{const $=await Ww(e);Vt($.sitemaps),$.sitemaps.length===0&&Ve("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch($){_e($ instanceof Error?$.message:"Failed to list sitemaps")}finally{kt(!1)}}async function Oa(){se(!0),_e(null);try{const[$,fe]=await Promise.all([Ku().catch(()=>null),Ap(e).catch(()=>[])]);s(!!$?.google?.configured),r(fe);const at=fe.find(Qt=>Qt.connectionType==="gsc");await Promise.all([gl(at),Ys(),ws(),Fi()])}finally{se(!1)}}N.useEffect(()=>{Oa()},[e]);async function Zi(){if(!t){_e("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ke(!0),_e(null),Ve(null);try{const{authUrl:$}=await qw(e,"gsc");if(!$.startsWith("https://accounts.google.com/")){_e("Unexpected OAuth redirect URL. Please try again.");return}const fe=window.open($,"_blank","width=600,height=700");if(!fe){window.location.assign($);return}Ve("Finish the Google consent flow in the popup, then close it to refresh this project.");const at=window.setInterval(()=>{fe.closed&&(window.clearInterval(at),Ve(null),Oa())},1e3)}catch($){_e($ instanceof Error?$.message:"Failed to start OAuth flow")}finally{ke(!1)}}async function od(){_e(null),Ve(null);try{await Hw(e,"gsc"),r($=>$.filter(fe=>fe.connectionType!=="gsc")),d([]),C("")}catch($){_e($ instanceof Error?$.message:"Failed to disconnect")}}async function xl(){if(S){X(!0),_e(null);try{await Fw(e,"gsc",S),r($=>$.map(fe=>fe.connectionType==="gsc"?{...fe,propertyId:S}:fe)),Ve("GSC property updated.")}catch($){_e($ instanceof Error?$.message:"Failed to save GSC property")}finally{X(!1)}}}async function bl(){B(!0),_e(null),Ve(null);try{await Tp(e,{days:parseInt(R,10)||void 0,full:L||void 0}),Ve("GSC sync queued. Refresh after the run completes to see imported data.")}catch($){_e($ instanceof Error?$.message:"Failed to trigger sync")}finally{B(!1)}}async function Fr(){if(k.trim()){he(!0),_e(null),Ve(null);try{const $=await Vw(e,k.trim());w($),E(""),await ws()}catch($){_e($ instanceof Error?$.message:"Failed to inspect URL")}finally{he(!1)}}}return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),o.jsx("h2",{children:"Google Search Console"})]}),o.jsx("div",{className:"flex items-center gap-2",children:ae&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Ys()},children:O?"Refreshing…":"Refresh data"})})]}),ls&&o.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:[ls,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>_e(null),children:"×"})]}),Ht&&o.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:[Ht,o.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>Ve(null),children:"×"})]}),Q?o.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsx(nt,{tone:ae?"positive":t?"caution":"negative",children:ae?"Connected":t?"Ready to connect":"App credentials missing"})]}),ae?o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:ae.domain}),o.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:od,children:"Disconnect"})]}),o.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",o.jsx("code",{children:ae.domain}),"."]})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ae.propertyId??"No property selected yet"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:vs(ae.updatedAt)})]})]})]}):o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[o.jsx("p",{className:"text-sm text-zinc-300",children:t?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:Zi,children:pe?"Opening…":"Connect Google Search Console"}):o.jsx(ce,{type:"button",variant:"outline",size:"sm",asChild:!0,children:o.jsx(yt,{to:"/settings",children:"Open Settings"})}),!t&&o.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),ae&&!ae.sitemapUrl&&o.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("span",{className:"mt-0.5 text-amber-400",children:o.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:o.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"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),o.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."}),o.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx(ce,{type:"button",size:"sm",disabled:We||!ae.propertyId,onClick:yl,children:We?"Discovering…":"Auto-discover from GSC"}),o.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.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:_t,onChange:$=>zt($.target.value),onKeyDown:$=>$.key==="Enter"&&void us()}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:mn||!_t.trim(),onClick:us,children:mn?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ae||Jn)&&o.jsxs(o.Fragment,{children:[o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),o.jsx("h3",{children:"Index coverage"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[de&&de.notIndexed.length>0&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:js,onClick:()=>{Ta()},children:js?"Requesting…":`Request indexing (${de.notIndexed.length})`}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:ge,onClick:()=>{Fi()},children:ge?"Loading…":"Refresh coverage"})]})]}),de&&de.summary.total>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const $=de.summary.indexed+de.summary.notIndexed,fe=$>0?de.summary.indexed/$:0,at=$>0?de.summary.notIndexed/$:0,Qt=54,Lt=2*Math.PI*Qt,Et=Lt*(1-fe),wt=Lt*at,Cn=Lt*fe;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative h-48 w-48",children:[o.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[o.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),o.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Lt,strokeDashoffset:Et,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),de.summary.notIndexed>0&&o.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${wt} ${Lt-wt}`,strokeDashoffset:-Cn,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[o.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(fe*100).toFixed(0),"%"]}),o.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),o.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.indexed.toLocaleString()}),o.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),o.jsx("div",{className:"h-8 w-px bg-zinc-800"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.notIndexed.toLocaleString()}),o.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(de.reasonGroups??[]).length>0&&o.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(de.reasonGroups??[]).length," ",(de.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),de.summary.deindexed>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-8 w-px bg-zinc-800"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.deindexed.toLocaleString()}),o.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),o.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map($=>{const fe=$==="indexed"?de.indexed.length:$==="notIndexed"?de.notIndexed.length:de.deindexed.length,at=$==="indexed"?"Indexed":$==="notIndexed"?"Not Indexed":"Deindexed";return o.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ze===$?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Ue($),Vs(null)},children:[at," (",fe,")"]},$)})}),o.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ze==="indexed"&&de.indexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Verdict"}),o.jsx("th",{className:"text-left",children:"Last Crawl"}),o.jsx("th",{className:"text-left",children:"Mobile"})]})}),o.jsx("tbody",{children:de.indexed.map($=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),o.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:$.crawlTime?$.crawlTime.split("T")[0]:"—"}),o.jsx("td",{className:"text-zinc-400",children:$.isMobileFriendly===!0?"Yes":$.isMobileFriendly===!1?"No":"—"})]},$.id))})]}),ze==="notIndexed"&&!Ss&&(de.reasonGroups??[]).length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"Reason"}),o.jsx("th",{className:"text-right",children:"Pages"})]})}),o.jsx("tbody",{children:(de.reasonGroups??[]).map($=>o.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Vs($.reason),children:[o.jsx("td",{className:"text-zinc-200",children:$.reason}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.count})]},$.reason))})]}),ze==="notIndexed"&&!Ss&&(de.reasonGroups??[]).length===0&&de.notIndexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Indexing State"}),o.jsx("th",{className:"text-left",children:"Coverage"})]})}),o.jsx("tbody",{children:de.notIndexed.map($=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),o.jsx("td",{className:"text-zinc-400",children:$.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"})]},$.id))})]}),ze==="notIndexed"&&Ss&&(()=>{const $=(de.reasonGroups??[]).find(fe=>fe.reason===Ss);return $?o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-2 mb-3",children:o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Vs(null),children:"\\u2190 Back to reasons"})}),o.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200",children:$.reason}),o.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[$.count," affected page",$.count!==1?"s":""]})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:js,onClick:()=>{cs($.urls.map(fe=>fe.url))},children:js?"Requesting…":`Request indexing (${$.count})`})]}),o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Last Crawl"}),o.jsx("th",{className:"w-8"})]})}),o.jsx("tbody",{children:$.urls.map(fe=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:fe.url}),o.jsx("td",{className:"text-zinc-400",children:fe.crawlTime?fe.crawlTime.split("T")[0]:"—"}),o.jsx("td",{children:o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:js,onClick:()=>{cs([fe.url])},title:"Request indexing",children:"Index"})})]},fe.id))})]})]}):null})(),ze==="deindexed"&&de.deindexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Previous"}),o.jsx("th",{className:"text-left",children:"Current"}),o.jsx("th",{className:"text-left",children:"Detected"})]})}),o.jsx("tbody",{children:de.deindexed.map(($,fe)=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),o.jsx("td",{className:"text-zinc-400",children:$.previousState}),o.jsx("td",{className:"text-zinc-400",children:$.currentState}),o.jsx("td",{className:"text-zinc-400",children:$.transitionDate.split("T")[0]})]},`${$.url}-${fe}`))})]}),(ze==="indexed"&&de.indexed.length===0||ze==="notIndexed"&&!Ss&&de.notIndexed.length===0||ze==="deindexed"&&de.deindexed.length===0)&&o.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ge?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),o.jsx("h3",{children:"Search performance"})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Ys()},children:O?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const $=new Map;for(const qe of f){const rt=$.get(qe.date);rt?(rt.clicks+=qe.clicks,rt.impressions+=qe.impressions):$.set(qe.date,{clicks:qe.clicks,impressions:qe.impressions})}const fe=[...$.entries()].sort(([qe],[rt])=>qe.localeCompare(rt));if(fe.length===0)return null;const at=Math.max(...fe.map(([,qe])=>qe.impressions),1),Qt=fe.reduce((qe,[,rt])=>qe+rt.clicks,0),Lt=fe.reduce((qe,[,rt])=>qe+rt.impressions,0),Et=Lt>0?(Qt/Lt*100).toFixed(1):"0.0",wt=700,Cn=220,en={top:12,bottom:36,left:48,right:12},ld=wt-en.left-en.right,Js=Cn-en.top-en.bottom,Xs=ld/fe.length,ds=Math.max(Math.min(Xs*.35,24),4),Da=Math.max(ds*.15,1),Ws=qe=>{if(qe<=0)return 1;const rt=Math.pow(10,Math.floor(Math.log10(qe))),Gt=qe/rt,on=Gt<=1.5?1.5:Gt<=3?3:Gt<=5?5:10;return Math.ceil(on*rt)},Xn=4,fs=Math.ceil(Ws(at)/Xn)*Xn,ei=Array.from({length:Xn+1},(qe,rt)=>fs/Xn*rt),Mt=qe=>qe>=1e3?`${(qe/1e3).toFixed(qe>=1e4?0:1)}k`:String(qe);return o.jsxs("div",{className:"mt-3",children:[o.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",o.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Qt.toLocaleString()})]})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",o.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Lt.toLocaleString()})]})]}),o.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",o.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Et,"%"]})]})]}),o.jsx("div",{className:"relative w-full",style:{aspectRatio:`${wt} / ${Cn}`},children:o.jsxs("svg",{viewBox:`0 0 ${wt} ${Cn}`,className:"h-full w-full",children:[ei.map((qe,rt)=>{const Gt=en.top+Js-qe/fs*Js;return o.jsxs("g",{children:[o.jsx("line",{x1:en.left,y1:Gt,x2:wt-en.right,y2:Gt,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),o.jsx("text",{x:en.left-6,y:Gt+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Mt(qe)})]},`t-${rt}`)}),fe.map(([qe,rt],Gt)=>{const on=en.left+Xs*Gt+Xs/2,La=rt.impressions/fs*Js,Zr=rt.clicks/fs*Js;return o.jsxs("g",{children:[o.jsx("title",{children:`${qe}
234
234
  Clicks: ${rt.clicks}
235
235
  Impressions: ${rt.impressions}
236
- CTR: ${rt.impressions>0?(rt.clicks/rt.impressions*100).toFixed(1):0}%`}),l.jsx("rect",{x:on-ds-La/2,y:en.top+Ys-Ma,width:ds,height:Math.max(Ma,1),rx:2,fill:"#3b82f6",opacity:.85}),l.jsx("rect",{x:on+La/2,y:en.top+Ys-Kr,width:ds,height:Math.max(Kr,1),rx:2,fill:"#10b981",opacity:.85})]},qe)}),(()=>{const qe=Math.min(fe.length,7);return Array.from({length:qe},(rt,Gt)=>{const on=fe.length===1?0:Math.round(Gt/(qe-1)*(fe.length-1)),Ma=en.left+Js*on+Js/2;return l.jsx("text",{x:Ma,y:Cn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:fe[on][0].slice(5)},`xl-${on}`)})})()]})})]})})(),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:R.startDate,onChange:$=>T(fe=>({...fe,startDate:$.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:R.endDate,onChange:$=>T(fe=>({...fe,endDate:$.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:R.query,onChange:$=>T(fe=>({...fe,query:$.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:R.page,onChange:$=>T(fe=>({...fe,page:$.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:R.limit,onChange:$=>T(fe=>({...fe,limit:$.target.value}))})]}),f.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"}),l.jsx("th",{className:"text-right",children:"Clicks"}),l.jsx("th",{className:"text-right",children:"Impressions"}),l.jsx("th",{className:"text-right",children:"CTR"}),l.jsx("th",{className:"text-right",children:"Position"})]})}),l.jsx("tbody",{children:f.map(($,fe)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:$.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:$.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:$.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:$.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[($.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.position.toFixed(1)})]},`${$.date}:${$.query}:${$.page}:${fe}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),l.jsxs(De,{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:k,onChange:$=>E($.target.value),onKeyDown:$=>$.key==="Enter"&&void Zr()}),l.jsx(ce,{type:"button",size:"sm",disabled:ue||!ae?.propertyId||!k.trim(),onClick:Zr,children:ue?"Inspecting…":"Inspect URL"})]}),b&&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:b.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:b.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:$x(b.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:vs(b.crawlTime)})]})]})]}),l.jsxs(De,{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(ce,{type:"button",variant:"outline",size:"sm",disabled:ie,onClick:()=>{ws()},children:ie?"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:P,onChange:$=>J($.target.value)}),l.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:ie,onClick:()=>{ws()},children:"Apply filter"})]}),m.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:m.map($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-300",children:$.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:$x($.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:vs($.inspectedAt)})]},$.id))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),l.jsxs(De,{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($=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),l.jsx("td",{className:"text-zinc-400",children:$.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:$.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:vs($.transitionDate)})]},`${$.url}:${$.transitionDate}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ae&&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:()=>Be($=>!$),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 ${Ie?"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"})]})}),Ie&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[l.jsxs(De,{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:S,disabled:G||c.length===0,onChange:$=>C($.target.value),children:c.length===0?l.jsx("option",{value:"",children:G?"Loading properties…":"No properties available"}):c.map($=>l.jsxs("option",{value:$.siteUrl,children:[$.siteUrl," · ",$.permissionLevel]},$.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:G,onClick:()=>{yl(ae)},children:G?"Refreshing…":"Refresh properties"}),l.jsx(ce,{type:"button",size:"sm",disabled:!S||q,onClick:bl,children:q?"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(De,{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:$=>z($.target.value)})]}),l.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[l.jsx("input",{type:"checkbox",checked:L,onChange:$=>M($.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(ce,{type:"button",size:"sm",disabled:je||!ae.propertyId,onClick:Sl,children:je?"Queueing…":"Queue sync"}),!ae.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),l.jsxs(De,{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:[ae.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:ae.sitemapUrl})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:sn||!ae.propertyId,onClick:()=>{xl()},children:sn?"Loading…":"Browse sitemaps from GSC"}),l.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:We||!ae.propertyId,onClick:vl,children:We?"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."}),an&&an.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 (",an.length,")"]}),an.map($=>{const fe=$.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:$.path}),$.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",$.lastSubmitted.split("T")[0]]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[fe&&l.jsxs("div",{className:"text-right",children:[l.jsxs("p",{className:"text-zinc-300",children:[fe.indexed," / ",fe.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:()=>bt($.path),children:"Use"})]})]},$.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:ae.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:zt,onChange:$=>bt($.target.value),onKeyDown:$=>$.key==="Enter"&&zt.trim()&&void us()}),l.jsx(ce,{type:"button",size:"sm",disabled:mn||!zt.trim(),onClick:us,children:mn?"Saving…":ae.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(ce,{type:"button",size:"sm",variant:"outline",disabled:it||!ae.propertyId,onClick:()=>{const fe=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ae.sitemapUrl||void 0;me(!0),Xw(e,{sitemapUrl:fe}).then(at=>{Ve(`Sitemap inspection queued (run ${at.id}). Refresh coverage after the run completes.`)}).catch(at=>{_e(at instanceof Error?at.message:"Failed to queue sitemap inspection")}).finally(()=>me(!1))},children:it?"Queueing…":"Inspect sitemap"})]}),!ae.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function Q3({project:e,onUpdateProject:t,onRefresh:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,v]=N.useState(e.displayName),[y,x]=N.useState(e.canonicalDomain),[b,w]=N.useState(e.country),[S,C]=N.useState(e.language),[k,E]=N.useState(e.ownedDomains??[]),[A,z]=N.useState(""),[L,M]=N.useState(null),[R,T]=N.useState(!1),[P,J]=N.useState(!1),[Q,se]=N.useState(""),[pe,ke]=N.useState(""),[je,B]=N.useState(""),[G,oe]=N.useState(""),[q,X]=N.useState("");N.useEffect(()=>{a||(v(e.displayName),x(e.canonicalDomain),w(e.country),C(e.language),E(e.ownedDomains??[]))},[e,a]);function O(){r(!1),p(null),v(e.displayName),x(e.canonicalDomain),w(e.country),C(e.language),E(e.ownedDomains??[]),z("")}function Z(){const me=A.trim();me&&(k.includes(me)||E([...k,me]),z(""))}function ie(me){E(k.filter(We=>We!==me))}async function re(){if(!(!m.trim()||!y.trim()||!b.trim()||!S.trim())){d(!0),p(null);try{await t(e.name,{displayName:m.trim(),canonicalDomain:y.trim(),ownedDomains:k,country:b.trim(),language:S.trim()}),r(!1)}catch(me){p(me instanceof Error?me.message:"Failed to save")}finally{d(!1)}}}async function ue(){const me=Q.trim(),We=pe.trim(),dt=je.trim(),sn=G.trim();if(!(!me||!We||!dt||!sn)){T(!0),M(null);try{const _t={label:me,city:We,region:dt,country:sn};q.trim()&&(_t.timezone=q.trim()),await _w(e.name,_t),s(),se(""),ke(""),B(""),oe(""),X(""),J(!1)}catch(_t){M(_t instanceof Error?_t.message:"Failed to add location")}finally{T(!1)}}}async function he(me){T(!0),M(null);try{await zw(e.name,me),s()}catch(We){M(We instanceof Error?We.message:"Failed to remove location")}finally{T(!1)}}async function de(me){T(!0),M(null);try{await Ew(e.name,me),s()}catch(We){M(We instanceof Error?We.message:"Failed to set default location")}finally{T(!1)}}const Me=m!==e.displayName||y!==e.canonicalDomain||b!==e.country||S!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ge="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",Ke="block text-xs font-medium text-zinc-400 mb-1",it=Q.trim()&&pe.trim()&&je.trim()&&G.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"})]}),!a&&l.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:"Edit settings"})]}),f&&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:[f,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>p(null),children:"×"})]}),a?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:Ke,children:"Display name"}),l.jsx("input",{className:ge,type:"text",value:m,onChange:me=>v(me.target.value),placeholder:"My Project"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ke,children:"Canonical domain"}),l.jsx("input",{className:ge,type:"text",value:y,onChange:me=>x(me.target.value),placeholder:"example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ke,children:"Country"}),l.jsx("input",{className:ge,type:"text",value:b,onChange:me=>w(me.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ke,children:"Language"}),l.jsx("input",{className:ge,type:"text",value:S,onChange:me=>C(me.target.value),placeholder:"en"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:Ke,children:"Owned domains"}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(me=>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:[me,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>ie(me),"aria-label":`Remove ${me}`,children:"×"})]},me))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${ge} flex-1`,type:"text",placeholder:"docs.example.com",value:A,onChange:me=>z(me.target.value),onKeyDown:me=>me.key==="Enter"&&(me.preventDefault(),Z())}),l.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:!A.trim(),onClick:Z,children:"Add"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[l.jsx(ce,{type:"button",disabled:c||!Me||!m.trim()||!y.trim(),onClick:re,children:c?"Saving...":"Save changes"}),l.jsx(ce,{type:"button",variant:"outline",disabled:c,onClick:O,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(me=>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:me},me))}):l.jsx("span",{className:"text-zinc-500",children:"\\u2014"})})]}),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:[L&&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:[L,l.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>M(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(me=>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 ${me.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:[me.label,me.label===e.defaultLocation?" ★":""]})}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.city}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.region}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.country}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:me.timezone??"—"}),l.jsx("td",{className:"py-1.5",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[me.label!==e.defaultLocation&&l.jsx("button",{type:"button",disabled:R,onClick:()=>de(me.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${me.label} as default location`,children:"Set default"}),l.jsx("button",{type:"button",disabled:R,onClick:()=>he(me.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${me.label}`,children:"Remove"})]})})]},me.label))})]}):l.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),P?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:ge,type:"text",value:Q,onChange:me=>se(me.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:ge,type:"text",value:pe,onChange:me=>ke(me.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:ge,type:"text",value:je,onChange:me=>B(me.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:ge,type:"text",value:G,onChange:me=>oe(me.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:ge,type:"text",value:q,onChange:me=>X(me.target.value),placeholder:"America/New_York"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsx(ce,{type:"button",size:"sm",disabled:R||!it,onClick:ue,children:R?"Adding...":"Add location"}),l.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:R,onClick:()=>{J(!1),M(null)},children:"Cancel"})]})]}):l.jsx(ce,{type:"button",size:"sm",variant:"outline",onClick:()=>J(!0),children:"+ Add location"})]})]})]})})})]})}const Y3=[{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"}],Kb=["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 J3({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState("daily"),[f,p]=N.useState(6),[m,v]=N.useState(""),[y,x]=N.useState("UTC"),[b,w]=N.useState(!1),[S,C]=N.useState(""),[k,E]=N.useState(!1),[A,z]=N.useState(!1),[L,M]=N.useState(null);N.useEffect(()=>{Dw(e).then(s).catch(()=>s(null))},[e]);const R=()=>{if(t&&t!=="loading"){const Q=B2(t.preset??null,t.cronExpr);d(Q.freq),p(Q.hour),v(Q.customCron);const se=Kb.includes(t.timezone);x(se?t.timezone:"Other"),w(!se),C(se?"":t.timezone)}else d("daily"),p(6),v(""),x("UTC"),w(!1),C("");M(null),r(!0)},T=async()=>{E(!0),M(null);try{const se={timezone:b?S.trim()||"UTC":y};c==="custom"?se.cron=m.trim():se.preset=I2(c,f);const pe=await zm(e,se);s(pe),r(!1)}catch(Q){M(Q instanceof Error?Q.message:"Failed to save schedule")}finally{E(!1)}},P=async()=>{if(!(!t||t==="loading")){E(!0),M(null);try{const Q={timezone:t.timezone,enabled:!t.enabled};t.preset?Q.preset=t.preset:Q.cron=t.cronExpr,s(await zm(e,Q))}catch(Q){M(Q instanceof Error?Q.message:"Failed to update schedule")}finally{E(!1)}}},J=async()=>{z(!0),M(null);try{await Lw(e),s(null),r(!1)}catch(Q){M(Q instanceof Error?Q.message:"Failed to remove schedule")}finally{z(!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"&&!a&&l.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:R,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&l.jsx(De,{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"&&!a&&t!==null&&l.jsxs(De,{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:q2(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(nt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),l.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:P,children:t.enabled?"Pause":"Resume"}),l.jsx(ce,{type:"button",variant:"ghost",size:"sm",disabled:A,onClick:J,children:A?"Removing...":"Remove"})]})]}),L&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:L})]}),a&&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:c,onChange:Q=>d(Q.target.value),children:Y3.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:f,disabled:c==="twice-daily"||c==="custom",onChange:Q=>p(parseInt(Q.target.value)),children:Array.from({length:24},(Q,se)=>l.jsx("option",{value:se,children:gm(se)},se))})]})]}),c==="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:m,onChange:Q=>v(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:b?"Other":y,onChange:Q=>{Q.target.value==="Other"?(w(!0),x("Other")):(w(!1),x(Q.target.value))},children:[Kb.map(Q=>l.jsx("option",{value:Q,children:Q},Q)),l.jsx("option",{value:"Other",children:"Other (enter manually)\\u2026"})]}),b&&l.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:S,onChange:Q=>C(Q.target.value)})]}),L&&l.jsx("p",{className:"text-rose-400 text-sm",children:L}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),M(null)},children:"Cancel"}),l.jsx(ce,{type:"button",size:"sm",disabled:k||c==="custom"&&!m.trim(),onClick:T,children:k?"Saving...":"Save schedule"})]})]})]})}const X3=[{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 W3({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState(""),[f,p]=N.useState(["citation.lost","citation.gained"]),[m,v]=N.useState(!1),[y,x]=N.useState(null),[b,w]=N.useState({});N.useEffect(()=>{Mw(e).then(s).catch(()=>s([]))},[e]);const S=A=>{p(z=>z.includes(A)?z.filter(L=>L!==A):[...z,A])},C=async()=>{if(!(!c.trim()||f.length===0)){v(!0),x(null);try{const A=await Uw(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[A]:[...z,A]),d(""),p(["citation.lost","citation.gained"]),r(!1)}catch(A){x(A instanceof Error?A.message:"Failed to add webhook")}finally{v(!1)}}},k=async A=>{try{await $w(e,A),s(z=>z==="loading"?z:z.filter(L=>L.id!==A))}catch(z){x(z instanceof Error?z.message:"Failed to remove webhook")}},E=async A=>{w(z=>({...z,[A]:{state:"testing"}}));try{const z=await Pw(e,A);w(L=>({...L,[A]:{state:z.ok?"ok":"fail",status:z.status}}))}catch{w(z=>({...z,[A]:{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(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!a),x(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&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:c,onChange:A=>d(A.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:X3.map(A=>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:f.includes(A.value),onChange:()=>S(A.value)}),l.jsx("span",{className:"text-sm text-zinc-300",children:A.label})]},A.value))})]}),y&&l.jsx("p",{className:"text-rose-400 text-sm",children:y}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),x(null)},children:"Cancel"}),l.jsx(ce,{type:"button",size:"sm",disabled:m||!c.trim()||f.length===0,onClick:C,children:m?"Adding...":"Add webhook"})]})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&l.jsx(De,{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:"URL"}),l.jsx("th",{children:"Events"}),l.jsx("th",{children:"Status"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:t.map(A=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-keyword-cell",children:l.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",children:A.url})}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:A.events.map(z=>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:z.replace("."," ")},z))})}),l.jsx("td",{children:l.jsx(nt,{tone:A.enabled?"positive":"neutral",children:A.enabled?"Active":"Paused"})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[b[A.id]&&(()=>{const z=b[A.id],L=z.state==="testing"?"Sending…":z.state==="ok"?`Delivered${z.status?` (${z.status})`:""}`:`Failed${z.status?` (${z.status})`:""}`;return l.jsx(nt,{tone:z.state==="ok"?"positive":z.state==="fail"?"negative":"neutral",children:L})})(),l.jsx(ce,{variant:"ghost",size:"sm",type:"button",disabled:b[A.id]?.state==="testing",onClick:()=>E(A.id),children:"Test"}),l.jsx(ce,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(A.id),children:"Remove"})]})})]},A.id))})]}),y&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}function Vb({eyebrow:e,title:t,status:s,tone:a,targetLabel:r,targetValue:c,coverageValue:d,note:f,updatedAt:p,active:m,onClick:v}){return l.jsxs("button",{type:"button",onClick:v,className:`surface-card w-full text-left transition-colors ${m?"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(nt,{tone:a,children:s})]}),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:r}),l.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:c})]}),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:d})]})]}),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:f}),l.jsx("span",{children:p?`Updated ${vs(p)}`:"No recent sync yet"})]})]})}function tm({label:e,value:t,tone:s}){const a=s==="positive"?"text-emerald-400":s==="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 ${a}`,children:t})]})}function e4({projectName:e}){const[t,s]=N.useState(null),[a,r]=N.useState([]),[c,d]=N.useState(null),[f,p]=N.useState([]),[m,v]=N.useState([]),[y,x]=N.useState(null),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[A,z]=N.useState(!0),[L,M]=N.useState(null),[R,T]=N.useState(null),[P,J]=N.useState("coverage");N.useEffect(()=>{Q()},[e]);async function Q(){z(!0),M(null);try{const q=await Dp(e);if(s(q),q.connected){const[X,O,Z]=await Promise.all([Lp(e).catch(()=>null),Mp(e).catch(()=>[]),rN(e).catch(()=>[])]);X&&d(X),p(O),v(Z)}}catch(q){M(q instanceof Error?q.message:"Failed to load Bing data")}finally{z(!1)}}async function se(){if(S.trim()){M(null);try{const q=await nN(e,S.trim());C(""),q.availableSites.length>0&&r(q.availableSites),await Q()}catch(q){M(q instanceof Error?q.message:"Failed to connect")}}}async function pe(){try{await sN(e),s(null),r([]),d(null),p([]),v([]),x(null),E(""),M(null)}catch(q){M(q instanceof Error?q.message:"Failed to disconnect")}}async function ke(){if(k)try{await aN(e,k),await Q()}catch(q){M(q instanceof Error?q.message:"Failed to set site")}}async function je(){if(b.trim())try{const q=await Up(e,b.trim());x(q),p(X=>[q,...X])}catch(q){M(q instanceof Error?q.message:"Inspection failed")}}async function B(q){try{await Rm(e,{urls:[q]}),M(null),T(`Submitted to Bing: ${q}`),setTimeout(()=>T(null),4e3)}catch(X){M(X instanceof Error?X.message:"Submission failed")}}async function G(){try{const q=await Rm(e,{allUnindexed:!0});M(null);const{succeeded:X,total:O}=q.summary;T(`Submitted ${X}/${O} URL${O!==1?"s":""} to Bing`),setTimeout(()=>T(null),4e3)}catch(q){M(q instanceof Error?q.message:"Batch submission failed")}}if(A)return l.jsx(De,{className:"surface-card",children:l.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!t?.connected)return l.jsxs(De,{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(nt,{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:S,onChange:q=>C(q.target.value),onKeyDown:q=>q.key==="Enter"&&se()}),l.jsx(ce,{size:"sm",disabled:!S.trim(),onClick:se,children:"Connect"})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",l.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),L&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:L})]});if(!t.siteUrl)return l.jsxs(De,{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(nt,{tone:"positive",children:"Connected"}),l.jsx(ce,{size:"sm",variant:"ghost",onClick:pe,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:t.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:t.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:t.updatedAt?vs(t.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:k,onChange:q=>E(q.target.value),children:[l.jsx("option",{value:"",children:"Select a site..."}),a.map(q=>l.jsxs("option",{value:q.url,children:[q.url,q.verified?" (verified)":""]},q.url))]}),l.jsx(ce,{size:"sm",disabled:!k,onClick:ke,children:"Set Site"})]}):l.jsx("div",{className:"mt-3",children:l.jsx(ce,{size:"sm",onClick:async()=>{const q=await iN(e);r(q.sites)},children:"Load Sites"})})]})]}),L&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:L})]});const oe=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return l.jsxs("div",{className:"space-y-3",children:[l.jsxs(De,{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(nt,{tone:"positive",children:"Connected"}),l.jsx(ce,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),L&&l.jsx("p",{className:"mb-3 text-xs text-rose-400",children:L}),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:t.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:t.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:t.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:t.updatedAt?vs(t.updatedAt):"—"})]})]})]})]}),l.jsxs(De,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),l.jsx("h3",{children:"Index monitoring"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${vs(c.lastInspectedAt)}`:"No inspection history yet"})]}),l.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:oe.map(q=>l.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${P===q.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>J(q.key),children:q.label},q.key))}),P==="coverage"&&c&&l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[l.jsx(tm,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),l.jsx(tm,{label:"Not indexed",value:c.summary.notIndexed,tone:"negative"}),l.jsx(tm,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.notIndexed.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[l.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[R&&l.jsx("span",{className:"text-xs text-emerald-400",children:R}),l.jsx(ce,{size:"sm",variant:"ghost",onClick:G,children:"Submit all to Bing"})]})]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),l.jsx("tbody",{children:c.notIndexed.map(q=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.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",onClick:()=>B(q.url),children:"Submit"})})]},q.id))})]})})]}),c.indexed.length>0&&l.jsxs("div",{children:[l.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.indexed.length,")"]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),l.jsx("tbody",{children:c.indexed.map(q=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.lastCrawledDate?vs(q.lastCrawledDate):"—"})]},q.id))})]})})]})]}),P==="coverage"&&!c&&l.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),P==="inspections"&&l.jsxs("div",{className:"mt-4 space-y-3",children:[l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:b,onChange:q=>w(q.target.value),onKeyDown:q=>q.key==="Enter"&&je()}),l.jsx(ce,{size:"sm",disabled:!b.trim(),onClick:je,children:"Inspect"})]}),y&&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:y.url}),l.jsxs("div",{className:"text-zinc-400",children:["In Index: ",l.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.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(q=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),l.jsx("td",{className:"py-1.5 px-3",children:l.jsx(nt,{tone:q.inIndex?"positive":"negative",children:q.inIndex?"Yes":"No"})}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.httpCode??"—"}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:vs(q.inspectedAt)})]},q.id))})]})})]}),P==="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:"Clicks"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Impr"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"CTR"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"Pos"})]})}),l.jsx("tbody",{children:m.map((q,X)=>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:q.query}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:q.clicks}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.impressions}),l.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(q.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.averagePosition.toFixed(1)})]},X))})]})})})]})]})}function t4({projectName:e}){const[t,s]=N.useState("google"),[a,r]=N.useState(!0),[c,d]=N.useState("idle"),[f,p]=N.useState(null),m=N.useRef(null),[v,y]=N.useState(!1),[x,b]=N.useState(null),[w,S]=N.useState(null),[C,k]=N.useState(!1),[E,A]=N.useState(null),[z,L]=N.useState(null);async function M(oe=!1){oe||r(!0),p(null);try{const[q,X,O]=await Promise.all([Vu().catch(()=>null),Rp(e).catch(()=>[]),Dp(e).catch(()=>null)]),Z=X.find(ue=>ue.connectionType==="gsc")??null;y(!!q?.google?.configured),k(!!q?.bing?.configured),b(Z),A(O);const[ie,re]=await Promise.all([Z?Op(e).catch(()=>null):Promise.resolve(null),O?.connected?Lp(e).catch(()=>null):Promise.resolve(null)]);S(ie),L(re)}catch(q){p(q instanceof Error?q.message:"Failed to load search console overview")}finally{r(!1)}}async function R(){if(c!=="idle")return;m.current?.abort();const oe=new AbortController;m.current=oe;const q=oe.signal;d("syncing"),p(null);const X=[];try{async function O(){if(!x)return;const ue=await Tp(e);if(!ue?.id)return;const he=2e3,Me=Date.now()+12e4;for(;Date.now()<Me;){if(q.aborted||(await new Promise(Ke=>setTimeout(Ke,he)),q.aborted))return;const ge=await Lr(ue.id).catch(()=>null);if(!ge)break;if(["completed","failed","cancelled"].includes(ge.status)){ge.status!=="completed"&&X.push(`Google sync ${ge.status}`);break}}}const Z=10;async function ie(){if(!E?.connected)return;const ue=await Mp(e).catch(()=>[]),he=[...new Set(ue.map(de=>de.url))];if(he.length!==0)for(let de=0;de<he.length;de+=Z){if(q.aborted)return;const Me=he.slice(de,de+Z),Ke=(await Promise.allSettled(Me.map(it=>Up(e,it)))).filter(it=>it.status==="rejected").length;Ke>0&&X.push(`${Ke} Bing inspection(s) failed`)}}const re=await Promise.allSettled([O(),ie()]);for(const ue of re)ue.status==="rejected"&&X.push(ue.reason instanceof Error?ue.reason.message:"Sync failed");if(q.aborted)return;d("reloading"),await M(!0),X.length>0&&p(`Partial refresh: ${X.join("; ")}`)}catch(O){q.aborted||p(O instanceof Error?O.message:"Refresh failed")}finally{q.aborted||d("idle")}}N.useEffect(()=>(M(),()=>{m.current?.abort()}),[e]);const T=x?"positive":v?"caution":"negative",P=x?"Connected":v?"Ready to connect":"Needs setup",J=w?`${w.summary.percentage}% indexed`:x?"Awaiting coverage":"No coverage data",Q=w?`${w.summary.notIndexed} not indexed${w.summary.deindexed>0?` · ${w.summary.deindexed} deindexed`:""}`:x?"Run sitemap inspection to populate coverage":v?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",se=w?.lastInspectedAt??x?.updatedAt??null,pe=E?.connected?"positive":C?"caution":"negative",ke=E?.connected?"Connected":C?"Ready to connect":"Needs setup",je=z?`${z.summary.percentage}% indexed`:E?.connected?"Awaiting coverage":"No coverage data",B=z?`${z.summary.notIndexed} not indexed`:E?.connected?"Inspect URLs to populate coverage":C?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",G=z?.lastInspectedAt??E?.updatedAt??null;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs(De,{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(ce,{type:"button",variant:"outline",size:"sm",disabled:a||c!=="idle",onClick:()=>{R()},children:a?"Loading…":c==="syncing"?"Querying Google & Bing…":c==="reloading"?"Reloading…":"Refresh overview"})]}),f&&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:f}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsx(Vb,{eyebrow:"Google",title:"Google Search Console",status:a?"Loading…":P,tone:a?"neutral":T,targetLabel:"Selected property",targetValue:x?.propertyId??"No property selected",coverageValue:a?"Loading…":J,note:a?"Loading overview…":Q,updatedAt:se,active:t==="google",onClick:()=>s("google")}),l.jsx(Vb,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:a?"Loading…":ke,tone:a?"neutral":pe,targetLabel:"Selected site",targetValue:E?.siteUrl??"No site selected",coverageValue:a?"Loading…":je,note:a?"Loading overview…":B,updatedAt:G,active:t==="bing",onClick:()=>s("bing")})]})]}),l.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([oe,q])=>l.jsx("button",{type:"button",role:"tab","aria-selected":t===oe,className:`project-subnav-link ${t===oe?"project-subnav-link-active":""}`,onClick:()=>s(oe),children:q},oe))}),t==="google"&&l.jsx(V3,{projectName:e}),t==="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(e4,{projectName:e})]})]})}function n4({insights:e}){const{openEvidence:t}=dl(),[s,a]=N.useState(null);return l.jsx("div",{className:"insight-list",children:e.map(r=>{const c=s===r.id,d=r.affectedPhrases.length>0;return l.jsxs("div",{children:[l.jsxs("div",{className:`insight-row insight-row-${r.tone} ${d?"cursor-pointer":""}`,onClick:d?()=>a(c?null:r.id):void 0,children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d&&l.jsx(Uu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),l.jsx(nt,{tone:r.tone,children:r.actionLabel}),l.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:r.title}),l.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:r.detail})]}),d&&l.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[r.affectedPhrases.length," phrase",r.affectedPhrases.length>1?"s":""]})]}),c&&l.jsx("div",{className:"divide-y divide-zinc-800/20",children:r.affectedPhrases.map(f=>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(km,{state:f.citationState}),l.jsx("span",{className:"text-sm text-zinc-200 truncate",children:f.keyword}),l.jsx("div",{className:"hidden sm:flex gap-1",children:f.provider&&l.jsx(nl,{provider:f.provider})})]}),l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:p=>{p.stopPropagation(),t(f.evidenceId)},children:"View →"})]},f.evidenceId))})]},r.id)})})}function od({tab:e}){const{projectId:t}=Lu({from:"/projects/$projectId"}),s=_a(),{dashboard:a,isLoading:r,refetch:c}=Ra();if(!a||r)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(le=>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"})]},le))}),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(le=>l.jsx("div",{className:"skeleton-text-sm w-full"},le))})]})]});const d=IL(a,t),[f,p]=N.useState(!1),[m,v]=N.useState(!1),[y,x]=N.useState(!1),[b,w]=N.useState(null),[S,C]=N.useState(!1),[k,E]=N.useState(""),[A,z]=N.useState(!1),[L,M]=N.useState(!1),[R,T]=N.useState(""),[P,J]=N.useState(!1),[Q,se]=N.useState(!1),[pe,ke]=N.useState(""),[je,B]=N.useState(!1),[G,oe]=N.useState(void 0),[q,X]=N.useState(!1),[O,Z]=N.useState(null),[ie,re]=N.useState(!1),ue=d?.visibilityEvidence??[],he=d?.project.name??"",de=N.useMemo(()=>new Set(ue.map(le=>le.location??"")),[ue]),Me=de.has(""),ge=N.useMemo(()=>[...de].filter(Boolean),[de]);N.useEffect(()=>{if(G===void 0||G===""||!he){Z(null),re(!1);return}re(!0),zp(he,G).then(le=>{Z(le),re(!1)}).catch(()=>{Z(null),re(!1)})},[G,he]);const Ke=N.useMemo(()=>{if(!O)return null;const le=new Map;for(const Ie of O){for(const[Be,ze]of Object.entries(Ie.providerRuns??{}))le.set(`${Ie.keyword}::${Be}`,ze.map(Ue=>({runId:Ue.runId,citationState:Ue.citationState,createdAt:Ue.createdAt})));(!Ie.providerRuns||Object.keys(Ie.providerRuns).length===0)&&le.set(`${Ie.keyword}::`,Ie.runs.map(Be=>({runId:Be.runId,citationState:Be.citationState,createdAt:Be.createdAt})))}return le},[O]),it=N.useMemo(()=>{const le=G!==void 0?ue.filter(Ie=>G===""?!Ie.location:Ie.location===G):ue;return Ke?le.map(Ie=>{const Be=Ke.get(`${Ie.keyword}::${Ie.provider}`)??Ke.get(`${Ie.keyword}::`);return Be?{...Ie,runHistory:Be}:Ie}):le},[ue,G,Ke]);if(!d)return l.jsx("div",{className:"page-container",children:l.jsxs(De,{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(ce,{asChild:!0,children:l.jsx(yt,{to:"/",children:"Return to overview"})})]})});async function me(){x(!0),w(null);try{await Ap(he),c()}catch(le){w(le instanceof Error?le.message:"Failed to trigger run")}finally{x(!1)}}async function We(){v(!0);try{await Aw(he),s({to:"/"}),c()}catch(le){console.error("Failed to delete project:",le)}finally{v(!1)}}async function dt(){const le=await Rw(he),Ie=typeof le=="string"?le:JSON.stringify(le,null,2),Be=new Blob([Ie],{type:"text/yaml"}),ze=URL.createObjectURL(Be),Ue=document.createElement("a");Ue.href=ze,Ue.download=`${he}.yaml`,Ue.click()}async function sn(){const le=k.split(`
237
- `).map(Ie=>Ie.trim()).filter(Boolean);if(le.length!==0){z(!0);try{await Cw(he,le),c(),E(""),C(!1)}finally{z(!1)}}}async function _t(){const le=R.trim();if(le){J(!0);try{const Be=(await _p(he)).map(Ue=>Ue.domain),ze=[...new Set([...Be,le])];await Ep(he,ze),c(),T(""),M(!1)}finally{J(!1)}}}async function an(){const le=pe.trim();if(le){B(!0);try{const Ie=d?.project.ownedDomains??[];await _m(he,[...Ie,le]),c(),ke(""),se(!1)}finally{B(!1)}}}async function Vt(le){B(!0);try{const Ie=d?.project.ownedDomains??[];await _m(he,Ie.filter(Be=>Be!==le)),c()}finally{B(!1)}}async function zt(le,Ie){await kw(le,Ie),c()}const bt=le=>!Number.isNaN(Number.parseInt(le,10)),mn=[{key:"overview",label:"Overview",href:`/projects/${d.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${d.project.id}/search-console`},{key:"analytics",label:"Analytics",href:`/projects/${d.project.id}/analytics`},{key:"traffic",label:"Traffic",href:`/projects/${d.project.id}/traffic`}];return l.jsxs("div",{className:"page-container",children:[f?l.jsxs(De,{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:d.project.displayName||d.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(ce,{type:"button",variant:"destructive",disabled:m,onClick:We,children:m?"Deleting...":"Yes, delete project"}),l.jsx(ce,{type:"button",variant:"outline",disabled:m,onClick:()=>p(!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:d.project.displayName||d.project.name}),l.jsxs("p",{className:"page-subtitle",children:[d.project.canonicalDomain,(d.project.ownedDomains??[]).length===0&&!Q&&l.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>se(!0),children:"+ add domain"})," "," · ",d.contextLabel]}),l.jsxs("div",{className:"tag-row",children:[l.jsx("span",{className:"tag",children:d.project.country}),l.jsx("span",{className:"tag",children:d.project.language.toUpperCase()}),d.project.tags.map(le=>l.jsx("span",{className:"tag",children:le},le))]}),((d.project.ownedDomains??[]).length>0||Q)&&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"}),(d.project.ownedDomains??[]).map(le=>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:[le,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:je,onClick:()=>Vt(le),"aria-label":`Remove ${le}`,children:"×"})]},le)),Q?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:pe,onChange:le=>ke(le.target.value),onKeyDown:le=>le.key==="Enter"&&an(),autoFocus:!0}),l.jsx(ce,{type:"button",size:"sm",disabled:!pe.trim()||je,onClick:an,children:je?"...":"Add"}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{se(!1),ke("")},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:()=>se(!0),children:"+ domain"})]})]}),l.jsxs("div",{className:"page-header-right",children:[l.jsx("p",{className:"text-sm text-zinc-500",children:d.dateRangeLabel}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ce,{type:"button",variant:"outline",size:"icon",onClick:dt,"aria-label":"Export project as YAML",children:l.jsx(h2,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(ce,{type:"button",variant:"outline",size:"icon",onClick:()=>p(!0),"aria-label":"Delete project",children:l.jsx(O2,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(ce,{type:"button",disabled:y,onClick:me,children:y?"Starting...":"Run now"})]})]})]}),b&&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:[b,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>w(null),children:"×"})]}),l.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:mn.map(le=>l.jsx(yt,{to:le.href,className:`project-subnav-link ${le.key===e?"project-subnav-link-active":""}`,"aria-current":le.key===e?"page":void 0,children:le.label},le.key))}),e==="overview"?l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"gauge-row",children:[l.jsx(wa,{value:d.visibilitySummary.value,label:d.visibilitySummary.label,delta:d.visibilitySummary.delta,tone:d.visibilitySummary.tone,description:d.visibilitySummary.description,tooltip:d.visibilitySummary.tooltip,isNumeric:bt(d.visibilitySummary.value)}),l.jsx(wa,{value:d.competitorPressure.value,label:d.competitorPressure.label,delta:d.competitorPressure.delta,tone:d.competitorPressure.tone,description:d.competitorPressure.description,tooltip:d.competitorPressure.tooltip,isNumeric:bt(d.competitorPressure.value)}),l.jsx(wa,{value:d.runStatus.value,label:d.runStatus.label,delta:d.runStatus.delta,tone:d.runStatus.tone,description:d.runStatus.description,tooltip:d.runStatus.tooltip,isNumeric:bt(d.runStatus.value)})]}),d.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(ja,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Model"}),l.jsx("th",{children:"Score"}),l.jsx("th",{children:"Cited key phrases"})]})}),l.jsx("tbody",{children:d.providerScores.map(le=>l.jsxs("tr",{children:[l.jsx("td",{children:l.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[l.jsx(nl,{provider:le.provider}),le.model&&l.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:le.model})]})}),l.jsx("td",{children:l.jsxs("span",{className:`font-semibold ${le.score>=70?"text-emerald-400":le.score>=40?"text-amber-400":"text-rose-400"}`,children:[le.score,"%"]})}),l.jsxs("td",{className:"text-zinc-500",children:[le.cited," of ",le.total]})]},`${le.provider}::${le.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(n4,{insights:d.insights})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),l.jsx("h2",{children:"Key phrase citation tracking"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[new Set(d.visibilityEvidence.map(le=>le.keyword)).size," key phrases tracked"]}),l.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>C(!S),children:S?"Cancel":"+ Add key phrases"})]})]}),S&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:k,onChange:le=>E(le.target.value)}),l.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[l.jsxs("p",{className:"text-xs text-zinc-500",children:[k.split(`
238
- `).filter(le=>le.trim()).length," key phrases"]}),l.jsx(ce,{type:"button",size:"sm",disabled:!k.trim()||A,onClick:sn,children:A?"Adding...":"Add key phrases"})]})]}),d.project.locations&&d.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 ${G===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":G===void 0,onClick:()=>{oe(void 0)},children:"All locations"}),d.project.locations.map(le=>de.has(le.label)&&l.jsx("button",{className:`filter-chip ${G===le.label?"filter-chip-active":""}`,type:"button","aria-pressed":G===le.label,onClick:()=>{oe(le.label),X(!1)},children:le.label},le.label)),Me&&l.jsx("button",{className:`filter-chip ${G===""?"filter-chip-active":""}`,type:"button","aria-pressed":G==="",onClick:()=>{oe(""),X(!1)},children:"No location"}),ge.length>1&&G===void 0&&l.jsx("button",{className:`filter-chip filter-chip-compare ${q?"filter-chip-active":""}`,type:"button","aria-pressed":q,onClick:()=>X(le=>!le),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(U3,{evidence:it})]}),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:[d.competitors.length," tracked"]}),l.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>M(!L),children:L?"Cancel":"+ Add competitor"})]})]}),L&&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:R,onChange:le=>T(le.target.value),onKeyDown:le=>le.key==="Enter"&&_t()}),l.jsx(ce,{type:"button",size:"sm",disabled:!R.trim()||P,onClick:_t,children:P?"Adding...":"Add"})]}),l.jsx($3,{competitors:d.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:d.recentRuns.map(le=>l.jsx(n1,{run:le},le.id))})]}),l.jsx(Q3,{project:{...d.project,displayName:d.project.displayName??d.project.name,defaultLocation:d.project.defaultLocation??null},onUpdateProject:zt,onRefresh:()=>{c()}}),l.jsx(J3,{projectName:d.project.name}),l.jsx(W3,{projectName:d.project.name})]}):e==="analytics"?l.jsx(B3,{projectName:d.project.name}):e==="traffic"?l.jsx(Z3,{projectName:d.project.name}):l.jsx(t4,{projectName:d.project.name})]})}const s4="modulepreload",i4=function(e,t){return new URL(e,t).href},Qb={},a4=function(t,s,a){let r=Promise.resolve();if(s&&s.length>0){let m=function(v){return Promise.all(v.map(y=>Promise.resolve(y).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};const d=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");r=m(s.map(v=>{if(v=i4(v,a),v in Qb)return;Qb[v]=!0;const y=v.endsWith(".css"),x=y?'[rel="stylesheet"]':"";if(a)for(let w=d.length-1;w>=0;w--){const S=d[w];if(S.href===v&&(!y||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${x}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":s4,y||(b.as="script"),b.crossOrigin="",b.href=v,p&&b.setAttribute("nonce",p),document.head.appendChild(b),y)return new Promise((w,S)=>{b.addEventListener("load",w),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return r.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};function r4(){const{dashboard:e,isLoading:t}=Ra();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(f=>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"})]},f))})]});const s=e.runs,[a,r]=N.useState("all"),c=a==="all"?s:s.filter(f=>f.status===a),d=()=>{a4(async()=>{const{triggerAllRuns:f}=await Promise.resolve().then(()=>OL);return{triggerAllRuns:f}},void 0,import.meta.url).then(({triggerAllRuns:f})=>f().catch(p=>{console.error("Failed to trigger all runs",p)}))};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(ce,{type:"button",variant:"outline",size:"sm",onClick:d,children:"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(f=>l.jsx("button",{className:`filter-chip ${a===f?"filter-chip-active":""}`,type:"button","aria-pressed":a===f,onClick:()=>r(f),children:f==="all"?"All runs":Pu(f)},f))}),l.jsx("div",{className:"run-list",children:c.length>0?c.map(f=>l.jsx(n1,{run:f},f.id)):l.jsxs(De,{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 o4({providerName:e,keyUrl:t,modelHint:s,onSaved:a}){const r=e.toLowerCase()==="local",[c,d]=N.useState(""),[f,p]=N.useState(""),[m,v]=N.useState(""),[y,x]=N.useState(""),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(!1),[A,z]=N.useState(null),[L,M]=N.useState(!1),R=r?f.trim().length>0:c.trim().length>0;async function T(){if(R){E(!0),z(null),M(!1);try{const J=je=>{const B=parseInt(je.trim(),10);return Number.isFinite(B)&&B>0?B:void 0},Q={},se=J(y);se!==void 0&&(Q.maxConcurrency=se);const pe=J(b);pe!==void 0&&(Q.maxRequestsPerMinute=pe);const ke=J(S);ke!==void 0&&(Q.maxRequestsPerDay=ke),await Tw(e.toLowerCase(),{...c.trim()?{apiKey:c.trim()}:{},...f.trim()?{baseUrl:f.trim()}:{},...m.trim()?{model:m.trim()}:{},...Object.keys(Q).length>0?{quota:Q}:{}}),d(""),p(""),v(""),x(""),w(""),C(""),M(!0),a()}catch(J){z(J instanceof Error?J.message:"Failed to update provider")}finally{E(!1)}}}const P=s??"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:[r&&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:f,onChange:J=>p(J.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",r?" (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:r?"Optional — most local servers don't need one":`Enter ${e} API key`,value:c,onChange:J=>d(J.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:P,value:m,onChange:J=>v(J.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:y,onChange:J=>x(J.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:b,onChange:J=>w(J.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),l.jsxs("div",{children:[l.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/day",value:S,onChange:J=>C(J.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),A&&l.jsx("p",{className:"text-xs text-rose-400",children:A}),L&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),l.jsx(ce,{type:"button",size:"sm",disabled:!R||k,onClick:T,children:k?"Saving...":"Save"})]})}function l4({onSaved:e}){const[t,s]=N.useState(""),[a,r]=N.useState(""),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,v]=N.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function x(){if(y){d(!0),p(null),v(!1);try{await Ow({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),v(!0),e()}catch(b){p(b instanceof Error?b.message:"Failed to update Google OAuth credentials")}finally{d(!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.jsx("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 \\u2197"})]}),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:b=>s(b.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:a,onChange:b=>r(b.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."]}),f&&l.jsx("p",{className:"text-xs text-rose-400",children:f}),m&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),l.jsx(ce,{type:"button",size:"sm",disabled:!y||c,onClick:x,children:c?"Saving...":"Save Google OAuth app"})]})}function c4(){const[e,t]=N.useState(null),[s,a]=N.useState(null),[r,c]=N.useState(!1),[d,f]=N.useState("localhost"),[p,m]=N.useState("9222"),[v,y]=N.useState(!1);return N.useEffect(()=>{Em().then(t).catch(x=>{const b=x instanceof Error?x.message:String(x);b.includes("501")||a(b)})},[]),l.jsxs(De,{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(nt,{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(x=>l.jsxs("span",{className:"mr-2",children:[x.name,": ",x.alive?"● alive":"○ idle"]},x.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.":s||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),l.jsx("div",{className:"mt-2",children:l.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>c(!r),children:r?"Cancel":e?.connected?"Update endpoint":"Configure"})}),r&&l.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async x=>{x.preventDefault(),y(!0);try{await tN(d,parseInt(p,10)||9222);const b=await Em().catch(()=>null);b&&t(b),c(!1)}catch(b){a(b instanceof Error?b.message:String(b))}finally{y(!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:d,onChange:x=>f(x.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:p,onChange:x=>m(x.target.value),"aria-label":"CDP port"})]}),l.jsx("div",{children:l.jsx(ce,{type:"submit",size:"sm",disabled:v,children:v?"Saving…":"Save endpoint"})})]})]})}const u4={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function d4(){const e=ul(),{dashboard:t}=Ra(),s=t?.settings??e?.dashboard?.settings,c=Yu(!e,e?.health).data??e?.health??u4,[d,f]=N.useState(null),[p,m]=N.useState(!1),[v,y]=N.useState(!1),[x,b]=N.useState(""),[w,S]=N.useState(!1),[C,k]=N.useState(null),[E,A]=N.useState(!1);return s?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:[s.providerStatuses.map(z=>l.jsxs(De,{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:z.displayName??z.name})]}),l.jsx(nt,{tone:z.state==="ready"?"positive":"caution",children:z.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:z.model})]}),z.quota&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Concurrency"}),l.jsx("dd",{children:z.quota.maxConcurrency})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Rate limit"}),l.jsxs("dd",{children:[z.quota.maxRequestsPerMinute,"/min · ",z.quota.maxRequestsPerDay,"/day"]})]})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:z.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>f(d===z.name?null:z.name),children:d===z.name?"Cancel":z.state==="ready"?z.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),d===z.name&&l.jsx(o4,{providerName:z.name,keyUrl:z.keyUrl,modelHint:z.modelHint,onSaved:()=>{f(null)}})]},z.name)),l.jsxs(De,{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(nt,{tone:s.google.state==="ready"?"positive":"caution",children:s.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:s.google.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":s.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),p&&l.jsx(l4,{onSaved:()=>{m(!1)}})]}),l.jsxs(De,{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(nt,{tone:s.bing.state==="ready"?"positive":"caution",children:s.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:s.bing.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!v),children:v?"Cancel":s.bing.state==="ready"?"Update API key":"Configure Bing"})}),v&&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:x,onChange:z=>b(z.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."]}),C&&l.jsx("p",{className:"text-xs text-rose-400",children:C}),E&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),l.jsx(ce,{type:"button",size:"sm",disabled:!x.trim()||w,onClick:async()=>{if(x.trim()){S(!0),k(null),A(!1);try{await oN(x.trim()),b(""),A(!0),y(!1)}catch(z){k(z instanceof Error?z.message:"Failed to update Bing API key")}finally{S(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),l.jsx(c4,{}),l.jsxs(De,{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:c.apiStatus.detail})]}),l.jsx(nt,{tone:ju(c.apiStatus),children:c.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:c.workerStatus.detail})]}),l.jsx(nt,{tone:ju(c.workerStatus),children:c.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),l.jsx("section",{className:"page-section",children:l.jsxs(De,{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:s.selfHostNotes.map(z=>l.jsx("li",{children:z},z))}),l.jsx("p",{className:"supporting-copy",children:s.bootstrapNote})]})})]}):null}const f4=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Key phrases",description:"Add key phrases to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function h4({current:e,labels:t}){return l.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((s,a)=>{const r=a<e,c=a===e;return l.jsxs("div",{className:`setup-step ${r?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[l.jsx("span",{className:"setup-step-number",children:r?"✓":a+1}),l.jsx("span",{className:"setup-step-label",children:s.label})]},s.label)})})}function m4(){const e=ul(),{dashboard:t,isLoading:s,refetch:a}=Ra(),r=t??e?.dashboard;if(!r||s)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(ae=>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"})]},ae))})]})]});const c=r.settings,p=Yu(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},m=SM(r.setup,p,c),v=_a(),[y,x]=N.useState(0),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[A,z]=N.useState("US"),[L,M]=N.useState("en"),[R,T]=N.useState(null),[P,J]=N.useState(null),[Q,se]=N.useState(null),[pe,ke]=N.useState(!1),[je,B]=N.useState(""),[G,oe]=N.useState(!1),[q,X]=N.useState(null),[O,Z]=N.useState(!1),ie=c.providerStatuses.filter(ae=>ae.state==="ready"),[re,ue]=N.useState(ie[0]?.name??""),[he,de]=N.useState(5),[Me,ge]=N.useState(!1),[Ke,it]=N.useState(null),[me,We]=N.useState(""),[dt,sn]=N.useState(!1),[_t,an]=N.useState(null),[Vt,zt]=N.useState(!1),[bt,mn]=N.useState(!1),[le,Ie]=N.useState(null),[Be,ze]=N.useState(!1),Ue=b.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),pt=je.split(`
236
+ CTR: ${rt.impressions>0?(rt.clicks/rt.impressions*100).toFixed(1):0}%`}),o.jsx("rect",{x:on-ds-Da/2,y:en.top+Js-La,width:ds,height:Math.max(La,1),rx:2,fill:"#3b82f6",opacity:.85}),o.jsx("rect",{x:on+Da/2,y:en.top+Js-Zr,width:ds,height:Math.max(Zr,1),rx:2,fill:"#10b981",opacity:.85})]},qe)}),(()=>{const qe=Math.min(fe.length,7);return Array.from({length:qe},(rt,Gt)=>{const on=fe.length===1?0:Math.round(Gt/(qe-1)*(fe.length-1)),La=en.left+Xs*on+Xs/2;return o.jsx("text",{x:La,y:Cn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:fe[on][0].slice(5)},`xl-${on}`)})})()]})})]})})(),o.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[o.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:A.startDate,onChange:$=>T(fe=>({...fe,startDate:$.target.value}))}),o.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:A.endDate,onChange:$=>T(fe=>({...fe,endDate:$.target.value}))}),o.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:A.query,onChange:$=>T(fe=>({...fe,query:$.target.value}))}),o.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:A.page,onChange:$=>T(fe=>({...fe,page:$.target.value}))}),o.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:A.limit,onChange:$=>T(fe=>({...fe,limit:$.target.value}))})]}),f.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"Date"}),o.jsx("th",{className:"text-left",children:"Query"}),o.jsx("th",{className:"text-left",children:"Page"}),o.jsx("th",{className:"text-right",children:"Clicks"}),o.jsx("th",{className:"text-right",children:"Impressions"}),o.jsx("th",{className:"text-right",children:"CTR"}),o.jsx("th",{className:"text-right",children:"Position"})]})}),o.jsx("tbody",{children:f.map(($,fe)=>o.jsxs("tr",{children:[o.jsx("td",{className:"text-zinc-400",children:$.date}),o.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:$.query}),o.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:$.page}),o.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:$.clicks.toLocaleString()}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.impressions.toLocaleString()}),o.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[($.ctr*100).toFixed(1),"%"]}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.position.toFixed(1)})]},`${$.date}:${$.query}:${$.page}:${fe}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),o.jsx("h3",{children:"Inspect a URL"})]})}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.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:k,onChange:$=>E($.target.value),onKeyDown:$=>$.key==="Enter"&&void Fr()}),o.jsx(ce,{type:"button",size:"sm",disabled:ue||!ae?.propertyId||!k.trim(),onClick:Fr,children:ue?"Inspecting…":"Inspect URL"})]}),b&&o.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.indexingState??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.verdict??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:$x(b.isMobileFriendly)})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:vs(b.crawlTime)})]})]})]}),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),o.jsx("h3",{children:"Inspection log"})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:ie,onClick:()=>{ws()},children:ie?"Loading…":"Refresh history"})]}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.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:P,onChange:$=>J($.target.value)}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:ie,onClick:()=>{ws()},children:"Apply filter"})]}),m.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Indexing"}),o.jsx("th",{className:"text-left",children:"Verdict"}),o.jsx("th",{className:"text-left",children:"Coverage"}),o.jsx("th",{className:"text-left",children:"Mobile"}),o.jsx("th",{className:"text-left",children:"Inspected"})]})}),o.jsx("tbody",{children:m.map($=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),o.jsx("td",{className:"text-zinc-300",children:$.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:$x($.isMobileFriendly)}),o.jsx("td",{className:"text-zinc-400",children:vs($.inspectedAt)})]},$.id))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),o.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Previous"}),o.jsx("th",{className:"text-left",children:"Current"}),o.jsx("th",{className:"text-left",children:"Changed at"})]})}),o.jsx("tbody",{children:y.map($=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),o.jsx("td",{className:"text-zinc-400",children:$.previousState??"Unknown"}),o.jsx("td",{className:"text-zinc-300",children:$.currentState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:vs($.transitionDate)})]},`${$.url}:${$.transitionDate}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ae&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:o.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>Be($=>!$),children:[o.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 ${Ie?"rotate-90":""}`,"aria-hidden":"true",children:o.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"})}),o.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),Ie&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),o.jsx("h3",{children:"Pick the Search Console property"})]})}),o.jsxs("div",{className:"mt-3 space-y-2",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),o.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:S,disabled:G||c.length===0,onChange:$=>C($.target.value),children:c.length===0?o.jsx("option",{value:"",children:G?"Loading properties…":"No properties available"}):c.map($=>o.jsxs("option",{value:$.siteUrl,children:[$.siteUrl," · ",$.permissionLevel]},$.siteUrl))}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:G,onClick:()=>{gl(ae)},children:G?"Refreshing…":"Refresh properties"}),o.jsx(ce,{type:"button",size:"sm",disabled:!S||q,onClick:xl,children:q?"Saving…":"Save property"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),o.jsx("h3",{children:"Import GSC performance data"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),o.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:R,onChange:$=>z($.target.value)})]}),o.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:[o.jsx("input",{type:"checkbox",checked:L,onChange:$=>M($.target.checked)}),"Replace existing imported rows for the requested range"]})]}),o.jsx(ce,{type:"button",size:"sm",disabled:je||!ae.propertyId,onClick:bl,children:je?"Queueing…":"Queue sync"}),!ae.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),o.jsx("h3",{children:"Sitemap configuration"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[ae.sitemapUrl&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:ae.sitemapUrl})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:sn||!ae.propertyId,onClick:()=>{vl()},children:sn?"Loading…":"Browse sitemaps from GSC"}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:We||!ae.propertyId,onClick:yl,children:We?"Discovering…":"Auto-discover and queue inspection"})]}),o.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."}),an&&an.length>0&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[o.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",an.length,")"]}),an.map($=>{const fe=$.contents?.[0];return o.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-zinc-200 break-all",children:$.path}),$.lastSubmitted&&o.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",$.lastSubmitted.split("T")[0]]})]}),o.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[fe&&o.jsxs("div",{className:"text-right",children:[o.jsxs("p",{className:"text-zinc-300",children:[fe.indexed," / ",fe.submitted]}),o.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>zt($.path),children:"Use"})]})]},$.path)})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.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:ae.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:_t,onChange:$=>zt($.target.value),onKeyDown:$=>$.key==="Enter"&&_t.trim()&&void us()}),o.jsx(ce,{type:"button",size:"sm",disabled:mn||!_t.trim(),onClick:us,children:mn?"Saving…":ae.sitemapUrl?"Update":"Save"})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.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}`}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:it||!ae.propertyId,onClick:()=>{const fe=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ae.sitemapUrl||void 0;me(!0),Xw(e,{sitemapUrl:fe}).then(at=>{Ve(`Sitemap inspection queued (run ${at.id}). Refresh coverage after the run completes.`)}).catch(at=>{_e(at instanceof Error?at.message:"Failed to queue sitemap inspection")}).finally(()=>me(!1))},children:it?"Queueing…":"Inspect sitemap"})]}),!ae.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function X3({project:e,onUpdateProject:t,onRefresh:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,v]=N.useState(e.displayName),[y,x]=N.useState(e.canonicalDomain),[b,w]=N.useState(e.country),[S,C]=N.useState(e.language),[k,E]=N.useState(e.ownedDomains??[]),[R,z]=N.useState(""),[L,M]=N.useState(null),[A,T]=N.useState(!1),[P,J]=N.useState(!1),[Q,se]=N.useState(""),[pe,ke]=N.useState(""),[je,B]=N.useState(""),[G,oe]=N.useState(""),[q,X]=N.useState("");N.useEffect(()=>{a||(v(e.displayName),x(e.canonicalDomain),w(e.country),C(e.language),E(e.ownedDomains??[]))},[e,a]);function O(){r(!1),p(null),v(e.displayName),x(e.canonicalDomain),w(e.country),C(e.language),E(e.ownedDomains??[]),z("")}function Z(){const me=R.trim();me&&(k.includes(me)||E([...k,me]),z(""))}function ie(me){E(k.filter(We=>We!==me))}async function re(){if(!(!m.trim()||!y.trim()||!b.trim()||!S.trim())){d(!0),p(null);try{await t(e.name,{displayName:m.trim(),canonicalDomain:y.trim(),ownedDomains:k,country:b.trim(),language:S.trim()}),r(!1)}catch(me){p(me instanceof Error?me.message:"Failed to save")}finally{d(!1)}}}async function ue(){const me=Q.trim(),We=pe.trim(),dt=je.trim(),sn=G.trim();if(!(!me||!We||!dt||!sn)){T(!0),M(null);try{const kt={label:me,city:We,region:dt,country:sn};q.trim()&&(kt.timezone=q.trim()),await _w(e.name,kt),s(),se(""),ke(""),B(""),oe(""),X(""),J(!1)}catch(kt){M(kt instanceof Error?kt.message:"Failed to add location")}finally{T(!1)}}}async function he(me){T(!0),M(null);try{await zw(e.name,me),s()}catch(We){M(We instanceof Error?We.message:"Failed to remove location")}finally{T(!1)}}async function de(me){T(!0),M(null);try{await Ew(e.name,me),s()}catch(We){M(We instanceof Error?We.message:"Failed to set default location")}finally{T(!1)}}const Me=m!==e.displayName||y!==e.canonicalDomain||b!==e.country||S!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ge="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",Ke="block text-xs font-medium text-zinc-400 mb-1",it=Q.trim()&&pe.trim()&&je.trim()&&G.trim();return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),o.jsx("h2",{children:"Project settings"})]}),!a&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:"Edit settings"})]}),f&&o.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:[f,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>p(null),children:"×"})]}),a?o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:Ke,children:"Display name"}),o.jsx("input",{className:ge,type:"text",value:m,onChange:me=>v(me.target.value),placeholder:"My Project"})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ke,children:"Canonical domain"}),o.jsx("input",{className:ge,type:"text",value:y,onChange:me=>x(me.target.value),placeholder:"example.com"})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ke,children:"Country"}),o.jsx("input",{className:ge,type:"text",value:b,onChange:me=>w(me.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ke,children:"Language"}),o.jsx("input",{className:ge,type:"text",value:S,onChange:me=>C(me.target.value),placeholder:"en"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ke,children:"Owned domains"}),o.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(me=>o.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:[me,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>ie(me),"aria-label":`Remove ${me}`,children:"×"})]},me))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{className:`${ge} flex-1`,type:"text",placeholder:"docs.example.com",value:R,onChange:me=>z(me.target.value),onKeyDown:me=>me.key==="Enter"&&(me.preventDefault(),Z())}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:!R.trim(),onClick:Z,children:"Add"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[o.jsx(ce,{type:"button",disabled:c||!Me||!m.trim()||!y.trim(),onClick:re,children:c?"Saving...":"Save changes"}),o.jsx(ce,{type:"button",variant:"outline",disabled:c,onClick:O,children:"Cancel"})]})]}):o.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:o.jsx("table",{className:"w-full text-sm",children:o.jsxs("tbody",{children:[o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),o.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?o.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(me=>o.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:me},me))}):o.jsx("span",{className:"text-zinc-500",children:"\\u2014"})})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),o.jsxs("tr",{children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),o.jsxs("td",{className:"px-4 py-2.5",children:[L&&o.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:[L,o.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>M(null),children:"×"})]}),(e.locations??[]).length>0?o.jsxs("table",{className:"w-full text-xs mb-2",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-zinc-600",children:[o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),o.jsx("th",{className:"pb-1"})]})}),o.jsx("tbody",{children:e.locations.map(me=>o.jsxs("tr",{className:"border-t border-zinc-800/30",children:[o.jsx("td",{className:"py-1.5 pr-3",children:o.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${me.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:[me.label,me.label===e.defaultLocation?" ★":""]})}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.city}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.region}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.country}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:me.timezone??"—"}),o.jsx("td",{className:"py-1.5",children:o.jsxs("div",{className:"flex items-center gap-1.5",children:[me.label!==e.defaultLocation&&o.jsx("button",{type:"button",disabled:A,onClick:()=>de(me.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${me.label} as default location`,children:"Set default"}),o.jsx("button",{type:"button",disabled:A,onClick:()=>he(me.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${me.label}`,children:"Remove"})]})})]},me.label))})]}):o.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),P?o.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[o.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),o.jsx("input",{className:ge,type:"text",value:Q,onChange:me=>se(me.target.value),placeholder:"nyc"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),o.jsx("input",{className:ge,type:"text",value:pe,onChange:me=>ke(me.target.value),placeholder:"New York"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),o.jsx("input",{className:ge,type:"text",value:je,onChange:me=>B(me.target.value),placeholder:"NY"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),o.jsx("input",{className:ge,type:"text",value:G,onChange:me=>oe(me.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),o.jsx("input",{className:ge,type:"text",value:q,onChange:me=>X(me.target.value),placeholder:"America/New_York"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[o.jsx(ce,{type:"button",size:"sm",disabled:A||!it,onClick:ue,children:A?"Adding...":"Add location"}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:A,onClick:()=>{J(!1),M(null)},children:"Cancel"})]})]}):o.jsx(ce,{type:"button",size:"sm",variant:"outline",onClick:()=>J(!0),children:"+ Add location"})]})]})]})})})]})}const W3=[{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"}],Kb=["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 e4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState("daily"),[f,p]=N.useState(6),[m,v]=N.useState(""),[y,x]=N.useState("UTC"),[b,w]=N.useState(!1),[S,C]=N.useState(""),[k,E]=N.useState(!1),[R,z]=N.useState(!1),[L,M]=N.useState(null);N.useEffect(()=>{Dw(e).then(s).catch(()=>s(null))},[e]);const A=()=>{if(t&&t!=="loading"){const Q=q2(t.preset??null,t.cronExpr);d(Q.freq),p(Q.hour),v(Q.customCron);const se=Kb.includes(t.timezone);x(se?t.timezone:"Other"),w(!se),C(se?"":t.timezone)}else d("daily"),p(6),v(""),x("UTC"),w(!1),C("");M(null),r(!0)},T=async()=>{E(!0),M(null);try{const se={timezone:b?S.trim()||"UTC":y};c==="custom"?se.cron=m.trim():se.preset=B2(c,f);const pe=await zm(e,se);s(pe),r(!1)}catch(Q){M(Q instanceof Error?Q.message:"Failed to save schedule")}finally{E(!1)}},P=async()=>{if(!(!t||t==="loading")){E(!0),M(null);try{const Q={timezone:t.timezone,enabled:!t.enabled};t.preset?Q.preset=t.preset:Q.cron=t.cronExpr,s(await zm(e,Q))}catch(Q){M(Q instanceof Error?Q.message:"Failed to update schedule")}finally{E(!1)}}},J=async()=>{z(!0),M(null);try{await Lw(e),s(null),r(!1)}catch(Q){M(Q instanceof Error?Q.message:"Failed to remove schedule")}finally{z(!1)}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!a&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:A,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&o.jsx(De,{className:"surface-card compact-card",children:o.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!a&&t!==null&&o.jsxs(De,{className:"surface-card compact-card",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200",children:H2(t.preset??null,t.cronExpr,t.timezone)}),o.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",o.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o.jsx(nt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:P,children:t.enabled?"Pause":"Resume"}),o.jsx(ce,{type:"button",variant:"ghost",size:"sm",disabled:R,onClick:J,children:R?"Removing...":"Remove"})]})]}),L&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:L})]}),a&&o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),o.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:c,onChange:Q=>d(Q.target.value),children:W3.map(Q=>o.jsx("option",{value:Q.value,children:Q.label},Q.value))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),o.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:f,disabled:c==="twice-daily"||c==="custom",onChange:Q=>p(parseInt(Q.target.value)),children:Array.from({length:24},(Q,se)=>o.jsx("option",{value:se,children:gm(se)},se))})]})]}),c==="custom"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),o.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:m,onChange:Q=>v(Q.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),o.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:b?"Other":y,onChange:Q=>{Q.target.value==="Other"?(w(!0),x("Other")):(w(!1),x(Q.target.value))},children:[Kb.map(Q=>o.jsx("option",{value:Q,children:Q},Q)),o.jsx("option",{value:"Other",children:"Other (enter manually)\\u2026"})]}),b&&o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:S,onChange:Q=>C(Q.target.value)})]}),L&&o.jsx("p",{className:"text-rose-400 text-sm",children:L}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),M(null)},children:"Cancel"}),o.jsx(ce,{type:"button",size:"sm",disabled:k||c==="custom"&&!m.trim(),onClick:T,children:k?"Saving...":"Save schedule"})]})]})]})}const t4=[{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 n4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState(""),[f,p]=N.useState(["citation.lost","citation.gained"]),[m,v]=N.useState(!1),[y,x]=N.useState(null),[b,w]=N.useState({});N.useEffect(()=>{Mw(e).then(s).catch(()=>s([]))},[e]);const S=R=>{p(z=>z.includes(R)?z.filter(L=>L!==R):[...z,R])},C=async()=>{if(!(!c.trim()||f.length===0)){v(!0),x(null);try{const R=await Uw(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[R]:[...z,R]),d(""),p(["citation.lost","citation.gained"]),r(!1)}catch(R){x(R instanceof Error?R.message:"Failed to add webhook")}finally{v(!1)}}},k=async R=>{try{await $w(e,R),s(z=>z==="loading"?z:z.filter(L=>L.id!==R))}catch(z){x(z instanceof Error?z.message:"Failed to remove webhook")}},E=async R=>{w(z=>({...z,[R]:{state:"testing"}}));try{const z=await Pw(e,R);w(L=>({...L,[R]:{state:z.ok?"ok":"fail",status:z.status}}))}catch{w(z=>({...z,[R]:{state:"fail"}}))}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!a),x(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&o.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),o.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:c,onChange:R=>d(R.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),o.jsx("div",{className:"flex flex-wrap gap-3",children:t4.map(R=>o.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[o.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:f.includes(R.value),onChange:()=>S(R.value)}),o.jsx("span",{className:"text-sm text-zinc-300",children:R.label})]},R.value))})]}),y&&o.jsx("p",{className:"text-rose-400 text-sm",children:y}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),x(null)},children:"Cancel"}),o.jsx(ce,{type:"button",size:"sm",disabled:m||!c.trim()||f.length===0,onClick:C,children:m?"Adding...":"Add webhook"})]})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&o.jsx(De,{className:"surface-card compact-card",children:o.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&&o.jsxs("div",{className:"evidence-table-wrap",children:[o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"URL"}),o.jsx("th",{children:"Events"}),o.jsx("th",{children:"Status"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:t.map(R=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-keyword-cell",children:o.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",children:R.url})}),o.jsx("td",{children:o.jsx("div",{className:"flex flex-wrap gap-1",children:R.events.map(z=>o.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:z.replace("."," ")},z))})}),o.jsx("td",{children:o.jsx(nt,{tone:R.enabled?"positive":"neutral",children:R.enabled?"Active":"Paused"})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[b[R.id]&&(()=>{const z=b[R.id],L=z.state==="testing"?"Sending…":z.state==="ok"?`Delivered${z.status?` (${z.status})`:""}`:`Failed${z.status?` (${z.status})`:""}`;return o.jsx(nt,{tone:z.state==="ok"?"positive":z.state==="fail"?"negative":"neutral",children:L})})(),o.jsx(ce,{variant:"ghost",size:"sm",type:"button",disabled:b[R.id]?.state==="testing",onClick:()=>E(R.id),children:"Test"}),o.jsx(ce,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(R.id),children:"Remove"})]})})]},R.id))})]}),y&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}function Vb({eyebrow:e,title:t,status:s,tone:a,targetLabel:r,targetValue:c,coverageValue:d,note:f,updatedAt:p,active:m,onClick:v}){return o.jsxs("button",{type:"button",onClick:v,className:`surface-card w-full text-left transition-colors ${m?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),o.jsx("h3",{children:t})]}),o.jsx(nt,{tone:a,children:s})]}),o.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:r}),o.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:c})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:d})]})]}),o.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:[o.jsx("span",{children:f}),o.jsx("span",{children:p?`Updated ${vs(p)}`:"No recent sync yet"})]})]})}function tm({label:e,value:t,tone:s}){const a=s==="positive"?"text-emerald-400":s==="negative"?"text-rose-400":"text-zinc-200";return o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),o.jsx("p",{className:`mt-2 text-2xl font-semibold ${a}`,children:t})]})}function s4({projectName:e}){const[t,s]=N.useState(null),[a,r]=N.useState([]),[c,d]=N.useState(null),[f,p]=N.useState([]),[m,v]=N.useState([]),[y,x]=N.useState(null),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,z]=N.useState(!0),[L,M]=N.useState(null),[A,T]=N.useState(null),[P,J]=N.useState("coverage");N.useEffect(()=>{Q()},[e]);async function Q(){z(!0),M(null);try{const q=await Dp(e);if(s(q),q.connected){const[X,O,Z]=await Promise.all([Lp(e).catch(()=>null),Mp(e).catch(()=>[]),rN(e).catch(()=>[])]);X&&d(X),p(O),v(Z)}}catch(q){M(q instanceof Error?q.message:"Failed to load Bing data")}finally{z(!1)}}async function se(){if(S.trim()){M(null);try{const q=await nN(e,S.trim());C(""),q.availableSites.length>0&&r(q.availableSites),await Q()}catch(q){M(q instanceof Error?q.message:"Failed to connect")}}}async function pe(){try{await sN(e),s(null),r([]),d(null),p([]),v([]),x(null),E(""),M(null)}catch(q){M(q instanceof Error?q.message:"Failed to disconnect")}}async function ke(){if(k)try{await aN(e,k),await Q()}catch(q){M(q instanceof Error?q.message:"Failed to set site")}}async function je(){if(b.trim())try{const q=await Up(e,b.trim());x(q),p(X=>[q,...X])}catch(q){M(q instanceof Error?q.message:"Inspection failed")}}async function B(q){try{await Am(e,{urls:[q]}),M(null),T(`Submitted to Bing: ${q}`),setTimeout(()=>T(null),4e3)}catch(X){M(X instanceof Error?X.message:"Submission failed")}}async function G(){try{const q=await Am(e,{allUnindexed:!0});M(null);const{succeeded:X,total:O}=q.summary;T(`Submitted ${X}/${O} URL${O!==1?"s":""} to Bing`),setTimeout(()=>T(null),4e3)}catch(q){M(q instanceof Error?q.message:"Batch submission failed")}}if(R)return o.jsx(De,{className:"surface-card",children:o.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!t?.connected)return o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsx(nt,{tone:"caution",children:"Not connected"})]}),o.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),o.jsxs("div",{className:"mt-3",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),o.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[o.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:S,onChange:q=>C(q.target.value),onKeyDown:q=>q.key==="Enter"&&se()}),o.jsx(ce,{size:"sm",disabled:!S.trim(),onClick:se,children:"Connect"})]}),o.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",o.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),L&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:L})]});if(!t.siteUrl)return o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(nt,{tone:"positive",children:"Connected"}),o.jsx(ce,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),o.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."})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.domain})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?vs(t.updatedAt):"—"})]})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.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:k,onChange:q=>E(q.target.value),children:[o.jsx("option",{value:"",children:"Select a site..."}),a.map(q=>o.jsxs("option",{value:q.url,children:[q.url,q.verified?" (verified)":""]},q.url))]}),o.jsx(ce,{size:"sm",disabled:!k,onClick:ke,children:"Set Site"})]}):o.jsx("div",{className:"mt-3",children:o.jsx(ce,{size:"sm",onClick:async()=>{const q=await iN(e);r(q.sites)},children:"Load Sites"})})]})]}),L&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:L})]});const oe=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return o.jsxs("div",{className:"space-y-3",children:[o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(nt,{tone:"positive",children:"Connected"}),o.jsx(ce,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),L&&o.jsx("p",{className:"mb-3 text-xs text-rose-400",children:L}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),o.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",o.jsx("code",{children:t.siteUrl}),"."]})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.siteUrl})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?vs(t.updatedAt):"—"})]})]})]})]}),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),o.jsx("h3",{children:"Index monitoring"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${vs(c.lastInspectedAt)}`:"No inspection history yet"})]}),o.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:oe.map(q=>o.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${P===q.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>J(q.key),children:q.label},q.key))}),P==="coverage"&&c&&o.jsxs("div",{className:"mt-4 space-y-4",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[o.jsx(tm,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),o.jsx(tm,{label:"Not indexed",value:c.summary.notIndexed,tone:"negative"}),o.jsx(tm,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.notIndexed.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[o.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[A&&o.jsx("span",{className:"text-xs text-emerald-400",children:A}),o.jsx(ce,{size:"sm",variant:"ghost",onClick:G,children:"Submit all to Bing"})]})]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),o.jsx("tbody",{children:c.notIndexed.map(q=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-right",children:o.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",onClick:()=>B(q.url),children:"Submit"})})]},q.id))})]})})]}),c.indexed.length>0&&o.jsxs("div",{children:[o.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.indexed.length,")"]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),o.jsx("tbody",{children:c.indexed.map(q=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.lastCrawledDate?vs(q.lastCrawledDate):"—"})]},q.id))})]})})]})]}),P==="coverage"&&!c&&o.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),P==="inspections"&&o.jsxs("div",{className:"mt-4 space-y-3",children:[o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:b,onChange:q=>w(q.target.value),onKeyDown:q=>q.key==="Enter"&&je()}),o.jsx(ce,{size:"sm",disabled:!b.trim(),onClick:je,children:"Inspect"})]}),y&&o.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[o.jsx("div",{className:"font-medium text-zinc-200",children:y.url}),o.jsxs("div",{className:"text-zinc-400",children:["In Index: ",o.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.lastCrawledDate??"—"]})]}),f.length>0&&o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),o.jsx("tbody",{children:f.map(q=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),o.jsx("td",{className:"py-1.5 px-3",children:o.jsx(nt,{tone:q.inIndex?"positive":"negative",children:q.inIndex?"Yes":"No"})}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:vs(q.inspectedAt)})]},q.id))})]})})]}),P==="performance"&&o.jsx("div",{className:"mt-4",children:m.length===0?o.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Clicks"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Impr"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"CTR"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"Pos"})]})}),o.jsx("tbody",{children:m.map((q,X)=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.query}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:q.clicks}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.impressions}),o.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(q.ctr*100).toFixed(1),"%"]}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.averagePosition.toFixed(1)})]},X))})]})})})]})]})}function i4({projectName:e}){const[t,s]=N.useState("google"),[a,r]=N.useState(!0),[c,d]=N.useState("idle"),[f,p]=N.useState(null),m=N.useRef(null),[v,y]=N.useState(!1),[x,b]=N.useState(null),[w,S]=N.useState(null),[C,k]=N.useState(!1),[E,R]=N.useState(null),[z,L]=N.useState(null);async function M(oe=!1){oe||r(!0),p(null);try{const[q,X,O]=await Promise.all([Ku().catch(()=>null),Ap(e).catch(()=>[]),Dp(e).catch(()=>null)]),Z=X.find(ue=>ue.connectionType==="gsc")??null;y(!!q?.google?.configured),k(!!q?.bing?.configured),b(Z),R(O);const[ie,re]=await Promise.all([Z?Op(e).catch(()=>null):Promise.resolve(null),O?.connected?Lp(e).catch(()=>null):Promise.resolve(null)]);S(ie),L(re)}catch(q){p(q instanceof Error?q.message:"Failed to load search console overview")}finally{r(!1)}}async function A(){if(c!=="idle")return;m.current?.abort();const oe=new AbortController;m.current=oe;const q=oe.signal;d("syncing"),p(null);const X=[];try{async function O(){if(!x)return;const ue=await Tp(e);if(!ue?.id)return;const he=2e3,Me=Date.now()+12e4;for(;Date.now()<Me;){if(q.aborted||(await new Promise(Ke=>setTimeout(Ke,he)),q.aborted))return;const ge=await Dr(ue.id).catch(()=>null);if(!ge)break;if(["completed","failed","cancelled"].includes(ge.status)){ge.status!=="completed"&&X.push(`Google sync ${ge.status}`);break}}}const Z=10;async function ie(){if(!E?.connected)return;const ue=await Mp(e).catch(()=>[]),he=[...new Set(ue.map(de=>de.url))];if(he.length!==0)for(let de=0;de<he.length;de+=Z){if(q.aborted)return;const Me=he.slice(de,de+Z),Ke=(await Promise.allSettled(Me.map(it=>Up(e,it)))).filter(it=>it.status==="rejected").length;Ke>0&&X.push(`${Ke} Bing inspection(s) failed`)}}const re=await Promise.allSettled([O(),ie()]);for(const ue of re)ue.status==="rejected"&&X.push(ue.reason instanceof Error?ue.reason.message:"Sync failed");if(q.aborted)return;d("reloading"),await M(!0),X.length>0&&p(`Partial refresh: ${X.join("; ")}`)}catch(O){q.aborted||p(O instanceof Error?O.message:"Refresh failed")}finally{q.aborted||d("idle")}}N.useEffect(()=>(M(),()=>{m.current?.abort()}),[e]);const T=x?"positive":v?"caution":"negative",P=x?"Connected":v?"Ready to connect":"Needs setup",J=w?`${w.summary.percentage}% indexed`:x?"Awaiting coverage":"No coverage data",Q=w?`${w.summary.notIndexed} not indexed${w.summary.deindexed>0?` · ${w.summary.deindexed} deindexed`:""}`:x?"Run sitemap inspection to populate coverage":v?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",se=w?.lastInspectedAt??x?.updatedAt??null,pe=E?.connected?"positive":C?"caution":"negative",ke=E?.connected?"Connected":C?"Ready to connect":"Needs setup",je=z?`${z.summary.percentage}% indexed`:E?.connected?"Awaiting coverage":"No coverage data",B=z?`${z.summary.notIndexed} not indexed`:E?.connected?"Inspect URLs to populate coverage":C?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",G=z?.lastInspectedAt??E?.updatedAt??null;return o.jsxs("div",{className:"space-y-6",children:[o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),o.jsx("h2",{children:"Search Engine Intelligence"}),o.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."})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:a||c!=="idle",onClick:()=>{A()},children:a?"Loading…":c==="syncing"?"Querying Google & Bing…":c==="reloading"?"Reloading…":"Refresh overview"})]}),f&&o.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:f}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsx(Vb,{eyebrow:"Google",title:"Google Search Console",status:a?"Loading…":P,tone:a?"neutral":T,targetLabel:"Selected property",targetValue:x?.propertyId??"No property selected",coverageValue:a?"Loading…":J,note:a?"Loading overview…":Q,updatedAt:se,active:t==="google",onClick:()=>s("google")}),o.jsx(Vb,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:a?"Loading…":ke,tone:a?"neutral":pe,targetLabel:"Selected site",targetValue:E?.siteUrl??"No site selected",coverageValue:a?"Loading…":je,note:a?"Loading overview…":B,updatedAt:G,active:t==="bing",onClick:()=>s("bing")})]})]}),o.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([oe,q])=>o.jsx("button",{type:"button",role:"tab","aria-selected":t===oe,className:`project-subnav-link ${t===oe?"project-subnav-link-active":""}`,onClick:()=>s(oe),children:q},oe))}),t==="google"&&o.jsx(J3,{projectName:e}),t==="bing"&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),o.jsx("h2",{children:"Bing Webmaster Tools"})]})}),o.jsx(s4,{projectName:e})]})]})}function a4({insights:e}){const{openEvidence:t}=ul(),[s,a]=N.useState(null);return o.jsx("div",{className:"insight-list",children:e.map(r=>{const c=s===r.id,d=r.affectedPhrases.length>0;return o.jsxs("div",{children:[o.jsxs("div",{className:`insight-row insight-row-${r.tone} ${d?"cursor-pointer":""}`,onClick:d?()=>a(c?null:r.id):void 0,children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d&&o.jsx(Mu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),o.jsx(nt,{tone:r.tone,children:r.actionLabel}),o.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:r.title}),o.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:r.detail})]}),d&&o.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[r.affectedPhrases.length," phrase",r.affectedPhrases.length>1?"s":""]})]}),c&&o.jsx("div",{className:"divide-y divide-zinc-800/20",children:r.affectedPhrases.map(f=>o.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(km,{state:f.citationState}),o.jsx("span",{className:"text-sm text-zinc-200 truncate",children:f.keyword}),o.jsx("div",{className:"hidden sm:flex gap-1",children:f.provider&&o.jsx(tl,{provider:f.provider})})]}),o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:p=>{p.stopPropagation(),t(f.evidenceId)},children:"View →"})]},f.evidenceId))})]},r.id)})})}function rd({tab:e}){const{projectId:t}=Du({from:"/projects/$projectId"}),s=ka(),{dashboard:a,isLoading:r,refetch:c}=Ra();if(!a||r)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-48"}),o.jsx("div",{className:"skeleton-text-sm w-32"})]}),o.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(le=>o.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[o.jsx("div",{className:"skeleton-circle size-20"}),o.jsx("div",{className:"skeleton-text w-16 mt-3"})]},le))}),o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-28"}),o.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(le=>o.jsx("div",{className:"skeleton-text-sm w-full"},le))})]})]});const d=BL(a,t),[f,p]=N.useState(!1),[m,v]=N.useState(!1),[y,x]=N.useState(!1),[b,w]=N.useState(null),[S,C]=N.useState(!1),[k,E]=N.useState(""),[R,z]=N.useState(!1),[L,M]=N.useState(!1),[A,T]=N.useState(""),[P,J]=N.useState(!1),[Q,se]=N.useState(!1),[pe,ke]=N.useState(""),[je,B]=N.useState(!1),[G,oe]=N.useState(void 0),[q,X]=N.useState(!1),[O,Z]=N.useState(null),[ie,re]=N.useState(!1),ue=d?.visibilityEvidence??[],he=d?.project.name??"",de=N.useMemo(()=>new Set(ue.map(le=>le.location??"")),[ue]),Me=de.has(""),ge=N.useMemo(()=>[...de].filter(Boolean),[de]);N.useEffect(()=>{if(G===void 0||G===""||!he){Z(null),re(!1);return}re(!0),zp(he,G).then(le=>{Z(le),re(!1)}).catch(()=>{Z(null),re(!1)})},[G,he]);const Ke=N.useMemo(()=>{if(!O)return null;const le=new Map;for(const Ie of O){for(const[Be,ze]of Object.entries(Ie.providerRuns??{}))le.set(`${Ie.keyword}::${Be}`,ze.map(Ue=>({runId:Ue.runId,citationState:Ue.citationState,createdAt:Ue.createdAt})));(!Ie.providerRuns||Object.keys(Ie.providerRuns).length===0)&&le.set(`${Ie.keyword}::`,Ie.runs.map(Be=>({runId:Be.runId,citationState:Be.citationState,createdAt:Be.createdAt})))}return le},[O]),it=N.useMemo(()=>{const le=G!==void 0?ue.filter(Ie=>G===""?!Ie.location:Ie.location===G):ue;return Ke?le.map(Ie=>{const Be=Ke.get(`${Ie.keyword}::${Ie.provider}`)??Ke.get(`${Ie.keyword}::`);return Be?{...Ie,runHistory:Be}:Ie}):le},[ue,G,Ke]);if(!d)return o.jsx("div",{className:"page-container",children:o.jsxs(De,{className:"surface-card empty-card",children:[o.jsx("h1",{children:"Project not found"}),o.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),o.jsx(ce,{asChild:!0,children:o.jsx(yt,{to:"/",children:"Return to overview"})})]})});async function me(){x(!0),w(null);try{await Rp(he),c()}catch(le){w(le instanceof Error?le.message:"Failed to trigger run")}finally{x(!1)}}async function We(){v(!0);try{await Rw(he),s({to:"/"}),c()}catch(le){console.error("Failed to delete project:",le)}finally{v(!1)}}async function dt(){const le=await Aw(he),Ie=typeof le=="string"?le:JSON.stringify(le,null,2),Be=new Blob([Ie],{type:"text/yaml"}),ze=URL.createObjectURL(Be),Ue=document.createElement("a");Ue.href=ze,Ue.download=`${he}.yaml`,Ue.click()}async function sn(){const le=k.split(`
237
+ `).map(Ie=>Ie.trim()).filter(Boolean);if(le.length!==0){z(!0);try{await Cw(he,le),c(),E(""),C(!1)}finally{z(!1)}}}async function kt(){const le=A.trim();if(le){J(!0);try{const Be=(await _p(he)).map(Ue=>Ue.domain),ze=[...new Set([...Be,le])];await Ep(he,ze),c(),T(""),M(!1)}finally{J(!1)}}}async function an(){const le=pe.trim();if(le){B(!0);try{const Ie=d?.project.ownedDomains??[];await _m(he,[...Ie,le]),c(),ke(""),se(!1)}finally{B(!1)}}}async function Vt(le){B(!0);try{const Ie=d?.project.ownedDomains??[];await _m(he,Ie.filter(Be=>Be!==le)),c()}finally{B(!1)}}async function _t(le,Ie){await kw(le,Ie),c()}const zt=le=>!Number.isNaN(Number.parseInt(le,10)),mn=[{key:"overview",label:"Overview",href:`/projects/${d.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${d.project.id}/search-console`},{key:"analytics",label:"Analytics",href:`/projects/${d.project.id}/analytics`},{key:"traffic",label:"Traffic",href:`/projects/${d.project.id}/traffic`}];return o.jsxs("div",{className:"page-container",children:[f?o.jsxs(De,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[o.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),o.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",o.jsx("strong",{className:"text-zinc-200",children:d.project.displayName||d.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(ce,{type:"button",variant:"destructive",disabled:m,onClick:We,children:m?"Deleting...":"Yes, delete project"}),o.jsx(ce,{type:"button",variant:"outline",disabled:m,onClick:()=>p(!1),children:"Cancel"})]})]}):null,o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:d.project.displayName||d.project.name}),o.jsxs("p",{className:"page-subtitle",children:[d.project.canonicalDomain,(d.project.ownedDomains??[]).length===0&&!Q&&o.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>se(!0),children:"+ add domain"})," "," · ",d.contextLabel]}),o.jsxs("div",{className:"tag-row",children:[o.jsx("span",{className:"tag",children:d.project.country}),o.jsx("span",{className:"tag",children:d.project.language.toUpperCase()}),d.project.tags.map(le=>o.jsx("span",{className:"tag",children:le},le))]}),((d.project.ownedDomains??[]).length>0||Q)&&o.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(d.project.ownedDomains??[]).map(le=>o.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:[le,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:je,onClick:()=>Vt(le),"aria-label":`Remove ${le}`,children:"×"})]},le)),Q?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.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:pe,onChange:le=>ke(le.target.value),onKeyDown:le=>le.key==="Enter"&&an(),autoFocus:!0}),o.jsx(ce,{type:"button",size:"sm",disabled:!pe.trim()||je,onClick:an,children:je?"...":"Add"}),o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{se(!1),ke("")},children:"Cancel"})]}):o.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:()=>se(!0),children:"+ domain"})]})]}),o.jsxs("div",{className:"page-header-right",children:[o.jsx("p",{className:"text-sm text-zinc-500",children:d.dateRangeLabel}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ce,{type:"button",variant:"outline",size:"icon",onClick:dt,"aria-label":"Export project as YAML",children:o.jsx(m2,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(ce,{type:"button",variant:"outline",size:"icon",onClick:()=>p(!0),"aria-label":"Delete project",children:o.jsx(D2,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(ce,{type:"button",disabled:y,onClick:me,children:y?"Starting...":"Run now"})]})]})]}),b&&o.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:[b,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>w(null),children:"×"})]}),o.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:mn.map(le=>o.jsx(yt,{to:le.href,className:`project-subnav-link ${le.key===e?"project-subnav-link-active":""}`,"aria-current":le.key===e?"page":void 0,children:le.label},le.key))}),e==="overview"?o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"gauge-row",children:[o.jsx(s1,{value:d.visibilitySummary.value,label:d.visibilitySummary.label,delta:d.visibilitySummary.delta,tone:d.visibilitySummary.tone,description:d.visibilitySummary.description,tooltip:d.visibilitySummary.tooltip,isNumeric:zt(d.visibilitySummary.value)}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Cited Keywords",o.jsx(Zs,{text:"How many of your tracked key phrases are being cited by at least one AI answer engine."})]}),o.jsxs("p",{className:"metric-card-big-value",children:[o.jsx("span",{className:"text-zinc-50",children:d.keywordCounts.cited}),o.jsxs("span",{className:"text-zinc-600",children:[" / ",d.keywordCounts.total]})]}),o.jsx("div",{className:"metric-card-bar",children:o.jsx("div",{className:"metric-card-bar-fill",style:{width:d.keywordCounts.total>0?`${d.keywordCounts.cited/d.keywordCounts.total*100}%`:"0%"}})}),o.jsxs("p",{className:"metric-card-sub",children:[d.keywordCounts.total-d.keywordCounts.cited," not yet cited"]})]}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",o.jsx(Zs,{text:"Keyword-level citation changes compared to the previous completed run."})]}),d.movementSummary.hasPreviousRun?o.jsxs("div",{className:"metric-card-movement",children:[o.jsxs("span",{className:d.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",d.movementSummary.gained," gained"]}),o.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),o.jsxs("span",{className:d.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",d.movementSummary.lost," lost"]})]}):o.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),o.jsx("p",{className:"metric-card-sub mt-auto",children:d.movementSummary.gained===0&&d.movementSummary.lost===0&&d.movementSummary.hasPreviousRun?"No changes since last run":d.movementSummary.gained>d.movementSummary.lost?"Visibility improving":d.movementSummary.lost>d.movementSummary.gained?"Visibility declining":""})]})]}),d.providerScores.length>1&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),o.jsxs("h2",{children:["Visibility by model ",o.jsx(Zs,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Model"}),o.jsx("th",{children:"Score"}),o.jsx("th",{children:"Cited key phrases"})]})}),o.jsx("tbody",{children:d.providerScores.map(le=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[o.jsx(tl,{provider:le.provider}),le.model&&o.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:le.model})]})}),o.jsx("td",{children:o.jsxs("span",{className:`font-semibold ${le.score>=70?"text-emerald-400":le.score>=40?"text-amber-400":"text-rose-400"}`,children:[le.score,"%"]})}),o.jsxs("td",{className:"text-zinc-500",children:[le.cited," of ",le.total]})]},`${le.provider}::${le.model??"unknown"}`))})]})})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),o.jsx("h2",{children:"Citation signals"})]})}),o.jsx(a4,{insights:d.insights})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),o.jsx("h2",{children:"Key phrase citation tracking"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("p",{className:"supporting-copy",children:[new Set(d.visibilityEvidence.map(le=>le.keyword)).size," key phrases tracked"]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>C(!S),children:S?"Cancel":"+ Add key phrases"})]})]}),S&&o.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[o.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:k,onChange:le=>E(le.target.value)}),o.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[o.jsxs("p",{className:"text-xs text-zinc-500",children:[k.split(`
238
+ `).filter(le=>le.trim()).length," key phrases"]}),o.jsx(ce,{type:"button",size:"sm",disabled:!k.trim()||R,onClick:sn,children:R?"Adding...":"Add key phrases"})]})]}),d.project.locations&&d.project.locations.length>0&&o.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[o.jsx("button",{className:`filter-chip ${G===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":G===void 0,onClick:()=>{oe(void 0)},children:"All locations"}),d.project.locations.map(le=>de.has(le.label)&&o.jsx("button",{className:`filter-chip ${G===le.label?"filter-chip-active":""}`,type:"button","aria-pressed":G===le.label,onClick:()=>{oe(le.label),X(!1)},children:le.label},le.label)),Me&&o.jsx("button",{className:`filter-chip ${G===""?"filter-chip-active":""}`,type:"button","aria-pressed":G==="",onClick:()=>{oe(""),X(!1)},children:"No location"}),ge.length>1&&G===void 0&&o.jsx("button",{className:`filter-chip filter-chip-compare ${q?"filter-chip-active":""}`,type:"button","aria-pressed":q,onClick:()=>X(le=>!le),title:"Side-by-side location comparison",children:"Compare"})]}),o.jsx(P3,{evidence:it})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),o.jsx("h2",{children:"Competitive landscape"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("p",{className:"supporting-copy",children:[d.competitors.length," tracked"]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>M(!L),children:L?"Cancel":"+ Add competitor"})]})]}),L&&o.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[o.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:A,onChange:le=>T(le.target.value),onKeyDown:le=>le.key==="Enter"&&kt()}),o.jsx(ce,{type:"button",size:"sm",disabled:!A.trim()||P,onClick:kt,children:P?"Adding...":"Add"})]}),o.jsx(I3,{competitors:d.competitors})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),o.jsx("h2",{children:"Recent execution history"})]})}),o.jsx("div",{className:"run-list",children:d.recentRuns.map(le=>o.jsx(n1,{run:le},le.id))})]}),o.jsx(X3,{project:{...d.project,displayName:d.project.displayName??d.project.name,defaultLocation:d.project.defaultLocation??null},onUpdateProject:_t,onRefresh:()=>{c()}}),o.jsx(e4,{projectName:d.project.name}),o.jsx(n4,{projectName:d.project.name})]}):e==="analytics"?o.jsx(H3,{projectName:d.project.name}):e==="traffic"?o.jsx(V3,{projectName:d.project.name}):o.jsx(i4,{projectName:d.project.name})]})}const r4="modulepreload",o4=function(e,t){return new URL(e,t).href},Qb={},l4=function(t,s,a){let r=Promise.resolve();if(s&&s.length>0){let m=function(v){return Promise.all(v.map(y=>Promise.resolve(y).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};const d=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");r=m(s.map(v=>{if(v=o4(v,a),v in Qb)return;Qb[v]=!0;const y=v.endsWith(".css"),x=y?'[rel="stylesheet"]':"";if(a)for(let w=d.length-1;w>=0;w--){const S=d[w];if(S.href===v&&(!y||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${x}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":r4,y||(b.as="script"),b.crossOrigin="",b.href=v,p&&b.setAttribute("nonce",p),document.head.appendChild(b),y)return new Promise((w,S)=>{b.addEventListener("load",w),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return r.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};function c4(){const{dashboard:e,isLoading:t}=Ra();if(!e||t)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-20"}),o.jsx("div",{className:"skeleton-text-sm w-72"})]}),o.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(f=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[o.jsxs("div",{className:"flex-1 space-y-1.5",children:[o.jsx("div",{className:"skeleton-text w-40"}),o.jsx("div",{className:"skeleton-text-sm w-56"})]}),o.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},f))})]});const s=e.runs,[a,r]=N.useState("all"),c=a==="all"?s:s.filter(f=>f.status===a),d=()=>{l4(async()=>{const{triggerAllRuns:f}=await Promise.resolve().then(()=>DL);return{triggerAllRuns:f}},void 0,import.meta.url).then(({triggerAllRuns:f})=>f().catch(p=>{console.error("Failed to trigger all runs",p)}))};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Runs"}),o.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:d,children:"Run all projects"})]}),o.jsxs("section",{children:[o.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(f=>o.jsx("button",{className:`filter-chip ${a===f?"filter-chip-active":""}`,type:"button","aria-pressed":a===f,onClick:()=>r(f),children:f==="all"?"All runs":$u(f)},f))}),o.jsx("div",{className:"run-list",children:c.length>0?c.map(f=>o.jsx(n1,{run:f},f.id)):o.jsxs(De,{className:"surface-card empty-card",children:[o.jsx("h2",{children:"No runs match this filter"}),o.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function u4({providerName:e,keyUrl:t,modelHint:s,onSaved:a}){const r=e.toLowerCase()==="local",[c,d]=N.useState(""),[f,p]=N.useState(""),[m,v]=N.useState(""),[y,x]=N.useState(""),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(!1),[R,z]=N.useState(null),[L,M]=N.useState(!1),A=r?f.trim().length>0:c.trim().length>0;async function T(){if(A){E(!0),z(null),M(!1);try{const J=je=>{const B=parseInt(je.trim(),10);return Number.isFinite(B)&&B>0?B:void 0},Q={},se=J(y);se!==void 0&&(Q.maxConcurrency=se);const pe=J(b);pe!==void 0&&(Q.maxRequestsPerMinute=pe);const ke=J(S);ke!==void 0&&(Q.maxRequestsPerDay=ke),await Tw(e.toLowerCase(),{...c.trim()?{apiKey:c.trim()}:{},...f.trim()?{baseUrl:f.trim()}:{},...m.trim()?{model:m.trim()}:{},...Object.keys(Q).length>0?{quota:Q}:{}}),d(""),p(""),v(""),x(""),w(""),C(""),M(!0),a()}catch(J){z(J instanceof Error?J.message:"Failed to update provider")}finally{E(!1)}}}const P=s??"Use default model";return o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[r&&o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),o.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:f,onChange:J=>p(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",r?" (optional)":""]}),t&&o.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 ","↗"]})]}),o.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:r?"Optional — most local servers don't need one":`Enter ${e} API key`,value:c,onChange:J=>d(J.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),o.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:P,value:m,onChange:J=>v(J.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),o.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[o.jsxs("div",{children:[o.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:y,onChange:J=>x(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),o.jsxs("div",{children:[o.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:b,onChange:J=>w(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),o.jsxs("div",{children:[o.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/day",value:S,onChange:J=>C(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),R&&o.jsx("p",{className:"text-xs text-rose-400",children:R}),L&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),o.jsx(ce,{type:"button",size:"sm",disabled:!A||k,onClick:T,children:k?"Saving...":"Save"})]})}function d4({onSaved:e}){const[t,s]=N.useState(""),[a,r]=N.useState(""),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,v]=N.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function x(){if(y){d(!0),p(null),v(!1);try{await Ow({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),v(!0),e()}catch(b){p(b instanceof Error?b.message:"Failed to update Google OAuth credentials")}finally{d(!1)}}}return o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),o.jsx("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 \\u2197"})]}),o.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:b=>s(b.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),o.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:a,onChange:b=>r(b.target.value)})]}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",o.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),f&&o.jsx("p",{className:"text-xs text-rose-400",children:f}),m&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),o.jsx(ce,{type:"button",size:"sm",disabled:!y||c,onClick:x,children:c?"Saving...":"Save Google OAuth app"})]})}function f4(){const[e,t]=N.useState(null),[s,a]=N.useState(null),[r,c]=N.useState(!1),[d,f]=N.useState("localhost"),[p,m]=N.useState("9222"),[v,y]=N.useState(!1);return N.useEffect(()=>{Em().then(t).catch(x=>{const b=x instanceof Error?x.message:String(x);b.includes("501")||a(b)})},[]),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),o.jsx("h2",{children:"ChatGPT (CDP)"})]}),o.jsx(nt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&o.jsxs("div",{children:[o.jsx("dt",{children:"Endpoint"}),o.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&o.jsxs("div",{children:[o.jsx("dt",{children:"Browser"}),o.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&o.jsxs("div",{children:[o.jsx("dt",{children:"Tabs"}),o.jsx("dd",{children:e.targets.map(x=>o.jsxs("span",{className:"mr-2",children:[x.name,": ",x.alive?"● alive":"○ idle"]},x.name))})]})]}),o.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.":s||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>c(!r),children:r?"Cancel":e?.connected?"Update endpoint":"Configure"})}),r&&o.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async x=>{x.preventDefault(),y(!0);try{await tN(d,parseInt(p,10)||9222);const b=await Em().catch(()=>null);b&&t(b),c(!1)}catch(b){a(b instanceof Error?b.message:String(b))}finally{y(!1)}},children:[o.jsxs("div",{className:"flex gap-2",children:[o.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:d,onChange:x=>f(x.target.value),"aria-label":"CDP host"}),o.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:p,onChange:x=>m(x.target.value),"aria-label":"CDP port"})]}),o.jsx("div",{children:o.jsx(ce,{type:"submit",size:"sm",disabled:v,children:v?"Saving…":"Save endpoint"})})]})]})}const h4={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function m4(){const e=cl(),{dashboard:t}=Ra(),s=t?.settings??e?.dashboard?.settings,c=Qu(!e,e?.health).data??e?.health??h4,[d,f]=N.useState(null),[p,m]=N.useState(!1),[v,y]=N.useState(!1),[x,b]=N.useState(""),[w,S]=N.useState(!1),[C,k]=N.useState(null),[E,R]=N.useState(!1);return s?o.jsxs("div",{className:"page-container",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Settings"}),o.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),o.jsxs("section",{className:"settings-grid",children:[s.providerStatuses.map(z=>o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),o.jsx("h2",{children:z.displayName??z.name})]}),o.jsx(nt,{tone:z.state==="ready"?"positive":"caution",children:z.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Model"}),o.jsx("dd",{className:"font-mono text-xs",children:z.model})]}),z.quota&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Concurrency"}),o.jsx("dd",{children:z.quota.maxConcurrency})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Rate limit"}),o.jsxs("dd",{children:[z.quota.maxRequestsPerMinute,"/min · ",z.quota.maxRequestsPerDay,"/day"]})]})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:z.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>f(d===z.name?null:z.name),children:d===z.name?"Cancel":z.state==="ready"?z.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),d===z.name&&o.jsx(u4,{providerName:z.name,keyUrl:z.keyUrl,modelHint:z.modelHint,onSaved:()=>{f(null)}})]},z.name)),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),o.jsx("h2",{children:"Search Console OAuth"})]}),o.jsx(nt,{tone:s.google.state==="ready"?"positive":"caution",children:s.google.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Auth model"}),o.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Storage"}),o.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.google.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":s.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),p&&o.jsx(d4,{onSaved:()=>{m(!1)}})]}),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),o.jsx("h2",{children:"Webmaster Tools"})]}),o.jsx(nt,{tone:s.bing.state==="ready"?"positive":"caution",children:s.bing.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Auth model"}),o.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Storage"}),o.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.bing.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!v),children:v?"Cancel":s.bing.state==="ready"?"Update API key":"Configure Bing"})}),v&&o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),o.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"})]}),o.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:x,onChange:z=>b(z.target.value)})]}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",o.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),C&&o.jsx("p",{className:"text-xs text-rose-400",children:C}),E&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),o.jsx(ce,{type:"button",size:"sm",disabled:!x.trim()||w,onClick:async()=>{if(x.trim()){S(!0),k(null),R(!1);try{await oN(x.trim()),b(""),R(!0),y(!1)}catch(z){k(z instanceof Error?z.message:"Failed to update Bing API key")}finally{S(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),o.jsx(f4,{}),o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),o.jsx("h2",{children:"API and worker"})]})}),o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"health-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:"API"}),o.jsx("p",{className:"supporting-copy",children:c.apiStatus.detail})]}),o.jsx(nt,{tone:Su(c.apiStatus),children:c.apiStatus.state==="ok"?"Healthy":"Attention"})]}),o.jsxs("div",{className:"health-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:"Worker"}),o.jsx("p",{className:"supporting-copy",children:c.workerStatus.detail})]}),o.jsx(nt,{tone:Su(c.workerStatus),children:c.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),o.jsx("section",{className:"page-section",children:o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),o.jsx("h2",{children:"Operational guidance"})]})}),o.jsx("ul",{className:"detail-list",children:s.selfHostNotes.map(z=>o.jsx("li",{children:z},z))}),o.jsx("p",{className:"supporting-copy",children:s.bootstrapNote})]})})]}):null}const p4=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Key phrases",description:"Add key phrases to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function g4({current:e,labels:t}){return o.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((s,a)=>{const r=a<e,c=a===e;return o.jsxs("div",{className:`setup-step ${r?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[o.jsx("span",{className:"setup-step-number",children:r?"✓":a+1}),o.jsx("span",{className:"setup-step-label",children:s.label})]},s.label)})})}function y4(){const e=cl(),{dashboard:t,isLoading:s,refetch:a}=Ra(),r=t??e?.dashboard;if(!r||s)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-24"}),o.jsx("div",{className:"skeleton-text-sm w-80"})]}),o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-32"}),o.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ae=>o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1 flex-1",children:[o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton-text-sm w-48"})]}),o.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ae))})]})]});const c=r.settings,p=Qu(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},m=wM(r.setup,p,c),v=ka(),[y,x]=N.useState(0),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,z]=N.useState("US"),[L,M]=N.useState("en"),[A,T]=N.useState(null),[P,J]=N.useState(null),[Q,se]=N.useState(null),[pe,ke]=N.useState(!1),[je,B]=N.useState(""),[G,oe]=N.useState(!1),[q,X]=N.useState(null),[O,Z]=N.useState(!1),ie=c.providerStatuses.filter(ae=>ae.state==="ready"),[re,ue]=N.useState(ie[0]?.name??""),[he,de]=N.useState(5),[Me,ge]=N.useState(!1),[Ke,it]=N.useState(null),[me,We]=N.useState(""),[dt,sn]=N.useState(!1),[kt,an]=N.useState(null),[Vt,_t]=N.useState(!1),[zt,mn]=N.useState(!1),[le,Ie]=N.useState(null),[Be,ze]=N.useState(!1),Ue=b.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),pt=je.split(`
239
239
  `).map(ae=>ae.trim()).filter(Boolean),rn=me.split(`
240
- `).map(ae=>ae.trim()).filter(Boolean),Ss=m.healthChecks.some(ae=>ae.id==="api"&&ae.state==="ready"),Ks=async()=>{if(!(!Ue||!k)){ke(!0),se(null);try{const ae=await cl(Ue,{displayName:S||b,canonicalDomain:k,country:A,language:L});T(Ue),J(ae.id),a(),x(2)}catch(ae){se(ae instanceof Error?ae.message:"Failed to create project")}finally{ke(!1)}}},js=async()=>{if(!R)return;const ae=pt;if(ae.length!==0){Z(!0),X(null);try{await Nw(R,ae),oe(!0),a(),x(3)}catch(Jn){X(Jn instanceof Error?Jn.message:"Failed to save key phrases")}finally{Z(!1)}}},Vs=async()=>{if(!(!R||!re)){ge(!0),it(null);try{const ae=await Iw(R,re,he);if(ae.keywords.length>0){const Jn=je?je.trimEnd()+`
240
+ `).map(ae=>ae.trim()).filter(Boolean),Ss=m.healthChecks.some(ae=>ae.id==="api"&&ae.state==="ready"),Vs=async()=>{if(!(!Ue||!k)){ke(!0),se(null);try{const ae=await ll(Ue,{displayName:S||b,canonicalDomain:k,country:R,language:L});T(Ue),J(ae.id),a(),x(2)}catch(ae){se(ae instanceof Error?ae.message:"Failed to create project")}finally{ke(!1)}}},js=async()=>{if(!A)return;const ae=pt;if(ae.length!==0){Z(!0),X(null);try{await Nw(A,ae),oe(!0),a(),x(3)}catch(Jn){X(Jn instanceof Error?Jn.message:"Failed to save key phrases")}finally{Z(!1)}}},Qs=async()=>{if(!(!A||!re)){ge(!0),it(null);try{const ae=await Iw(A,re,he);if(ae.keywords.length>0){const Jn=je?je.trimEnd()+`
241
241
  `+ae.keywords.join(`
242
242
  `):ae.keywords.join(`
243
- `);B(Jn)}}catch(ae){it(ae instanceof Error?ae.message:"Failed to generate key phrases")}finally{ge(!1)}}},ls=async()=>{if(!R)return;const ae=rn;if(ae.length!==0){zt(!0),an(null);try{await Ep(R,ae),sn(!0),a(),x(4)}catch(Jn){an(Jn instanceof Error?Jn.message:"Failed to save competitors")}finally{zt(!1)}}},_e=async()=>{if(R){ze(!0),Ie(null);try{await Ap(R),mn(!0),a()}catch(ae){Ie(ae instanceof Error?ae.message:"Failed to trigger run")}finally{ze(!1)}}},Ht=()=>x(ae=>Math.max(0,ae-1)),Ve=(()=>{switch(y){case 0:return l.jsxs(De,{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:m.healthChecks.map(ae=>l.jsxs("div",{className:"health-check-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:ae.label}),l.jsx("p",{className:"supporting-copy",children:ae.detail}),ae.id==="provider"&&ae.state!=="ready"&&l.jsx(yt,{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(nt,{tone:ae.state==="ready"?"positive":"caution",children:ae.state==="ready"?"Ready":"Attention"})]},ae.id))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(ce,{type:"button",disabled:!Ss,onClick:()=>x(1),children:"Continue"})]})]});case 1:return l.jsxs(De,{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"})]}),R?l.jsx(nt,{tone:"positive",children:"Created"}):null]}),R?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:R})," created successfully."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ce,{type:"button",onClick:()=>x(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:b,onChange:ae=>w(ae.target.value)}),Ue&&Ue!==b?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",Ue]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),l.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:S,onChange:ae=>C(ae.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:ae=>E(ae.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:A,onChange:ae=>z(ae.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:L,onChange:ae=>M(ae.target.value.toLowerCase())})]})]}),Q?l.jsx("p",{className:"text-rose-400 text-sm",children:Q}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ce,{type:"button",disabled:!Ue||!k||pe,onClick:Ks,children:pe?"Creating...":"Create project"})]})]})]});case 2:return l.jsxs(De,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),l.jsx("h2",{children:"Add key phrases"})]}),G?l.jsxs(nt,{tone:"positive",children:[pt.length," saved"]}):l.jsxs(nt,{tone:"neutral",children:[pt.length," key phrase",pt.length!==1?"s":""]})]}),l.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),G?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:pt.map(ae=>l.jsx("li",{children:ae},ae))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ce,{type:"button",onClick:()=>x(3),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[ie.length>0?l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsxs("div",{className:"setup-field flex-1",children:[l.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),l.jsx("select",{id:"gen-provider",className:"setup-input",value:re,onChange:ae=>ue(ae.target.value),children:ie.map(ae=>l.jsxs("option",{value:ae.name,children:[ae.displayName??ae.name,ae.model?` (${ae.model})`:""]},ae.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:he,onChange:ae=>de(Number(ae.target.value)),children:[3,5,10,15,20].map(ae=>l.jsx("option",{value:ae,children:ae},ae))})]}),l.jsx(ce,{type:"button",variant:"outline",disabled:Me||!re,onClick:Vs,children:Me?"Analyzing site...":"Generate"})]}),Ke?l.jsx("p",{className:"text-rose-400 text-sm",children:Ke}):null]}):null,l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),l.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
243
+ `);B(Jn)}}catch(ae){it(ae instanceof Error?ae.message:"Failed to generate key phrases")}finally{ge(!1)}}},ls=async()=>{if(!A)return;const ae=rn;if(ae.length!==0){_t(!0),an(null);try{await Ep(A,ae),sn(!0),a(),x(4)}catch(Jn){an(Jn instanceof Error?Jn.message:"Failed to save competitors")}finally{_t(!1)}}},_e=async()=>{if(A){ze(!0),Ie(null);try{await Rp(A),mn(!0),a()}catch(ae){Ie(ae instanceof Error?ae.message:"Failed to trigger run")}finally{ze(!1)}}},Ht=()=>x(ae=>Math.max(0,ae-1)),Ve=(()=>{switch(y){case 0:return o.jsxs(De,{className:"surface-card step-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),o.jsx("h2",{children:"System ready"})]})}),o.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),o.jsx("div",{className:"compact-stack",children:m.healthChecks.map(ae=>o.jsxs("div",{className:"health-check-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:ae.label}),o.jsx("p",{className:"supporting-copy",children:ae.detail}),ae.id==="provider"&&ae.state!=="ready"&&o.jsx(yt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),o.jsx(nt,{tone:ae.state==="ready"?"positive":"caution",children:ae.state==="ready"?"Ready":"Attention"})]},ae.id))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx("span",{}),o.jsx(ce,{type:"button",disabled:!Ss,onClick:()=>x(1),children:"Continue"})]})]});case 1:return o.jsxs(De,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),o.jsx("h2",{children:"Create project"})]}),A?o.jsx(nt,{tone:"positive",children:"Created"}):null]}),A?o.jsxs("div",{className:"compact-stack",children:[o.jsxs("p",{className:"text-zinc-300",children:["Project ",o.jsx("span",{className:"text-zinc-100 font-medium",children:A})," created successfully."]}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",onClick:()=>x(2),children:"Continue"})]})]}):o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),o.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:b,onChange:ae=>w(ae.target.value)}),Ue&&Ue!==b?o.jsxs("p",{className:"supporting-copy",children:["Slug: ",Ue]}):null]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),o.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:S,onChange:ae=>C(ae.target.value)})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),o.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:ae=>E(ae.target.value)})]}),o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),o.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:R,onChange:ae=>z(ae.target.value.toUpperCase())})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),o.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:L,onChange:ae=>M(ae.target.value.toLowerCase())})]})]}),Q?o.jsx("p",{className:"text-rose-400 text-sm",children:Q}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",disabled:!Ue||!k||pe,onClick:Vs,children:pe?"Creating...":"Create project"})]})]})]});case 2:return o.jsxs(De,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),o.jsx("h2",{children:"Add key phrases"})]}),G?o.jsxs(nt,{tone:"positive",children:[pt.length," saved"]}):o.jsxs(nt,{tone:"neutral",children:[pt.length," key phrase",pt.length!==1?"s":""]})]}),o.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),G?o.jsxs("div",{className:"compact-stack",children:[o.jsx("ul",{className:"detail-list",children:pt.map(ae=>o.jsx("li",{children:ae},ae))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",onClick:()=>x(3),children:"Continue"})]})]}):o.jsxs("div",{className:"compact-stack",children:[ie.length>0?o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[o.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",o.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsxs("div",{className:"setup-field flex-1",children:[o.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),o.jsx("select",{id:"gen-provider",className:"setup-input",value:re,onChange:ae=>ue(ae.target.value),children:ie.map(ae=>o.jsxs("option",{value:ae.name,children:[ae.displayName??ae.name,ae.model?` (${ae.model})`:""]},ae.name))})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),o.jsx("select",{id:"gen-count",className:"setup-input",value:he,onChange:ae=>de(Number(ae.target.value)),children:[3,5,10,15,20].map(ae=>o.jsx("option",{value:ae,children:ae},ae))})]}),o.jsx(ce,{type:"button",variant:"outline",disabled:Me||!re,onClick:Qs,children:Me?"Analyzing site...":"Generate"})]}),Ke?o.jsx("p",{className:"text-rose-400 text-sm",children:Ke}):null]}):null,o.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[o.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",o.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),o.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
244
244
  best invisalign downtown brooklyn
245
- pediatric dentist brooklyn heights`,value:je,onChange:ae=>B(ae.target.value)})]}),q?l.jsx("p",{className:"text-rose-400 text-sm",children:q}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ce,{type:"button",disabled:pt.length===0||O,onClick:js,children:O?"Saving...":`Save ${pt.length} key phrase${pt.length!==1?"s":""}`})]})]})]});case 3:return l.jsxs(De,{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"})]}),dt?l.jsx(nt,{tone:"positive",children:"Saved"}):null]}),l.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),dt?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:rn.map(ae=>l.jsx("li",{children:ae},ae))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ce,{type:"button",onClick:()=>x(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
246
- competitor2.com`,value:me,onChange:ae=>We(ae.target.value)})]}),_t?l.jsx("p",{className:"text-rose-400 text-sm",children:_t}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ce,{type:"button",variant:"outline",onClick:()=>x(4),children:"Skip"}),l.jsx(ce,{type:"button",disabled:rn.length===0||Vt,onClick:ls,children:Vt?"Saving...":`Save ${rn.length} competitor${rn.length!==1?"s":""}`})]})]})]})]});case 4:return l.jsxs(De,{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"})]}),bt?l.jsx(nt,{tone:"positive",children:"Queued"}):null]}),bt?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(ce,{type:"button",onClick:()=>v({to:P?`/projects/${P}`:"/"}),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:R}),"."]}),le?l.jsx("p",{className:"text-rose-400 text-sm",children:le}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),l.jsx(ce,{type:"button",disabled:Be,onClick:_e,children:Be?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Setup"}),l.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),l.jsx(h4,{current:y,labels:f4}),l.jsx("section",{className:"setup-wizard",children:Ve})]})}function p4(){return l.jsx("div",{className:"page-container",children:l.jsx("section",{className:"page-section",children:l.jsxs(De,{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(ce,{asChild:!0,children:l.jsx(yt,{to:"/",children:"Return to overview"})})]})})})}function g4(){return l.jsx(fM,{children:l.jsx(dM,{})})}const as=Bz()({component:g4,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),y4=Vn({getParentRoute:()=>as,path:"/",component:wM,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ri.projects.all);if(t&&t.length===0)throw Xm({to:"/setup"})}}),v4=Vn({getParentRoute:()=>as,path:"/projects",component:L3}),gl=Vn({getParentRoute:()=>as,path:"/projects/$projectId",component:()=>l.jsx(lp,{})}),x4=Vn({getParentRoute:()=>gl,path:"/",component:()=>l.jsx(od,{tab:"overview"})}),b4=Vn({getParentRoute:()=>gl,path:"/search-console",component:()=>l.jsx(od,{tab:"search-console"})}),S4=Vn({getParentRoute:()=>gl,path:"/analytics",component:()=>l.jsx(od,{tab:"analytics"})}),j4=Vn({getParentRoute:()=>gl,path:"/traffic",component:()=>l.jsx(od,{tab:"traffic"})}),w4=Vn({getParentRoute:()=>as,path:"/runs",component:r4}),N4=Vn({getParentRoute:()=>as,path:"/settings",component:d4,beforeLoad:({context:e})=>{}}),C4=Vn({getParentRoute:()=>as,path:"/setup",component:m4,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ri.projects.all);if(t&&t.length>0)throw Xm({to:"/"})}}),k4=Vn({getParentRoute:()=>as,path:"*",component:p4}),_4=as.addChildren([y4,v4,gl.addChildren([x4,b4,S4,j4]),w4,N4,C4,k4]);function z4(e,t){return Jz({routeTree:_4,basepath:Lm||"/",context:{queryClient:e},...t?.initialEntries})}const E4={negative:"border-rose-700/60 bg-rose-950/80 text-rose-200",caution:"border-amber-700/60 bg-amber-950/80 text-amber-200",positive:"border-emerald-700/60 bg-emerald-950/80 text-emerald-200",neutral:"border-zinc-700/60 bg-zinc-900/80 text-zinc-200"};function A4(){const e=N.useSyncExternalStore(i2,Dx,Dx),t=N.useCallback(s=>{LS(s)},[]);return e.length===0?null:l.jsx("div",{"aria-live":"polite","aria-label":"Notifications",className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm",children:e.map(s=>l.jsxs("div",{role:"alert",className:`flex items-start gap-2 rounded-lg border px-3 py-2.5 text-sm shadow-lg backdrop-blur-sm animate-in slide-in-from-bottom-2 ${E4[s.tone]}`,children:[l.jsx("p",{className:"flex-1 leading-snug",children:s.message}),l.jsx("button",{type:"button",onClick:()=>t(s.id),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:l.jsx($u,{className:"size-3.5"})})]},s.id))})}const i1=a2(),R4=z4(i1),a1=document.getElementById("root");if(!a1)throw new Error("Expected #root element for web app bootstrap.");wk.createRoot(a1).render(l.jsx(N.StrictMode,{children:l.jsxs(Vk,{client:i1,children:[l.jsx(e2,{router:R4}),l.jsx(A4,{})]})}));
245
+ pediatric dentist brooklyn heights`,value:je,onChange:ae=>B(ae.target.value)})]}),q?o.jsx("p",{className:"text-rose-400 text-sm",children:q}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",disabled:pt.length===0||O,onClick:js,children:O?"Saving...":`Save ${pt.length} key phrase${pt.length!==1?"s":""}`})]})]})]});case 3:return o.jsxs(De,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),o.jsx("h2",{children:"Add competitors"})]}),dt?o.jsx(nt,{tone:"positive",children:"Saved"}):null]}),o.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),dt?o.jsxs("div",{className:"compact-stack",children:[o.jsx("ul",{className:"detail-list",children:rn.map(ae=>o.jsx("li",{children:ae},ae))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",onClick:()=>x(4),children:"Continue"})]})]}):o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),o.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
246
+ competitor2.com`,value:me,onChange:ae=>We(ae.target.value)})]}),kt?o.jsx("p",{className:"text-rose-400 text-sm",children:kt}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:()=>x(4),children:"Skip"}),o.jsx(ce,{type:"button",disabled:rn.length===0||Vt,onClick:ls,children:Vt?"Saving...":`Save ${rn.length} competitor${rn.length!==1?"s":""}`})]})]})]})]});case 4:return o.jsxs(De,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),o.jsx("h2",{children:"Launch first run"})]}),zt?o.jsx(nt,{tone:"positive",children:"Queued"}):null]}),zt?o.jsxs("div",{className:"compact-stack",children:[o.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),o.jsxs("div",{className:"setup-nav",children:[o.jsx("span",{}),o.jsx(ce,{type:"button",onClick:()=>v({to:P?`/projects/${P}`:"/"}),children:"Open project"})]})]}):o.jsxs("div",{className:"compact-stack",children:[o.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",o.jsx("span",{className:"text-zinc-100 font-medium",children:A}),"."]}),le?o.jsx("p",{className:"text-rose-400 text-sm",children:le}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",disabled:Be,onClick:_e,children:Be?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return o.jsxs("div",{className:"page-container",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Setup"}),o.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),o.jsx(g4,{current:y,labels:p4}),o.jsx("section",{className:"setup-wizard",children:Ve})]})}function v4(){return o.jsx("div",{className:"page-container",children:o.jsx("section",{className:"page-section",children:o.jsxs(De,{className:"surface-card empty-card",children:[o.jsx("h1",{children:"Route not found"}),o.jsx("p",{children:"The current path does not map to a dashboard view."}),o.jsx(ce,{asChild:!0,children:o.jsx(yt,{to:"/",children:"Return to overview"})})]})})})}function x4(){return o.jsx(mM,{children:o.jsx(hM,{})})}const as=qz()({component:x4,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),b4=Vn({getParentRoute:()=>as,path:"/",component:CM,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ti.projects.all);if(t&&t.length===0)throw Xm({to:"/setup"})}}),S4=Vn({getParentRoute:()=>as,path:"/projects",component:U3}),pl=Vn({getParentRoute:()=>as,path:"/projects/$projectId",component:()=>o.jsx(lp,{})}),j4=Vn({getParentRoute:()=>pl,path:"/",component:()=>o.jsx(rd,{tab:"overview"})}),w4=Vn({getParentRoute:()=>pl,path:"/search-console",component:()=>o.jsx(rd,{tab:"search-console"})}),N4=Vn({getParentRoute:()=>pl,path:"/analytics",component:()=>o.jsx(rd,{tab:"analytics"})}),C4=Vn({getParentRoute:()=>pl,path:"/traffic",component:()=>o.jsx(rd,{tab:"traffic"})}),k4=Vn({getParentRoute:()=>as,path:"/runs",component:c4}),_4=Vn({getParentRoute:()=>as,path:"/settings",component:m4,beforeLoad:({context:e})=>{}}),z4=Vn({getParentRoute:()=>as,path:"/setup",component:y4,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ti.projects.all);if(t&&t.length>0)throw Xm({to:"/"})}}),E4=Vn({getParentRoute:()=>as,path:"*",component:v4}),R4=as.addChildren([b4,S4,pl.addChildren([j4,w4,N4,C4]),k4,_4,z4,E4]);function A4(e,t){return Xz({routeTree:R4,basepath:Lm||"/",context:{queryClient:e},...t?.initialEntries})}const T4={negative:"border-rose-700/60 bg-rose-950/80 text-rose-200",caution:"border-amber-700/60 bg-amber-950/80 text-amber-200",positive:"border-emerald-700/60 bg-emerald-950/80 text-emerald-200",neutral:"border-zinc-700/60 bg-zinc-900/80 text-zinc-200"};function O4(){const e=N.useSyncExternalStore(a2,Dx,Dx),t=N.useCallback(s=>{LS(s)},[]);return e.length===0?null:o.jsx("div",{"aria-live":"polite","aria-label":"Notifications",className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm",children:e.map(s=>o.jsxs("div",{role:"alert",className:`flex items-start gap-2 rounded-lg border px-3 py-2.5 text-sm shadow-lg backdrop-blur-sm animate-in slide-in-from-bottom-2 ${T4[s.tone]}`,children:[o.jsx("p",{className:"flex-1 leading-snug",children:s.message}),o.jsx("button",{type:"button",onClick:()=>t(s.id),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:o.jsx(Uu,{className:"size-3.5"})})]},s.id))})}const a1=r2(),D4=A4(a1),r1=document.getElementById("root");if(!r1)throw new Error("Expected #root element for web app bootstrap.");Nk.createRoot(r1).render(o.jsx(N.StrictMode,{children:o.jsxs(Qk,{client:a1,children:[o.jsx(t2,{router:D4}),o.jsx(O4,{})]})}));