@ainyc/canonry 1.25.2 → 1.26.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.
- package/assets/assets/index-CE8TwvzO.js +246 -0
- package/assets/assets/{index-D1_RT3XF.css → index-D786SQZN.css} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-G5TMCVS4.js → chunk-L6TL4UQI.js} +294 -28
- package/dist/cli.js +89 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/assets/assets/index-Bah_bmb-.js +0 -246
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
function Nk(e,t){for(var s=0;s<t.length;s++){const a=t[s];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(a,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>a[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const c of o)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(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();function sS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jh={exports:{}},Lo={};var Vv;function Ck(){if(Vv)return Lo;Vv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(a,o,c){var d=null;if(c!==void 0&&(d=""+c),o.key!==void 0&&(d=""+o.key),"key"in o){c={};for(var f in o)f!=="key"&&(c[f]=o[f])}else c=o;return o=c.ref,{$$typeof:e,type:a,key:d,ref:o!==void 0?o:null,props:c}}return Lo.Fragment=t,Lo.jsx=s,Lo.jsxs=s,Lo}var Qv;function kk(){return Qv||(Qv=1,jh.exports=Ck()),jh.exports}var r=kk(),wh={exports:{}},Ee={};var Yv;function zk(){if(Yv)return Ee;Yv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=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 N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(O,F,ie){this.props=O,this.context=F,this.refs=C,this.updater=ie||N}k.prototype.isReactComponent={},k.prototype.setState=function(O,F){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,F,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function E(){}E.prototype=k.prototype;function R(O,F,ie){this.props=O,this.context=F,this.refs=C,this.updater=ie||N}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,F,ie){var re=ie.ref;return{$$typeof:e,type:O,key:F,ref:re!==void 0?re:null,props:ie}}function X(O,F){return P(O.type,F,O.props)}function Q(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function se(O){var F={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ie){return F[ie]})}var pe=/\/+/g;function ke(O,F){return typeof O=="object"&&O!==null&&O.key!=null?se(""+O.key):F.toString(36)}function Se(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(F){O.status==="pending"&&(O.status="fulfilled",O.value=F)},function(F){O.status==="pending"&&(O.status="rejected",O.reason=F)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function B(O,F,ie,re,ue){var de=typeof O;(de==="undefined"||de==="boolean")&&(O=null);var fe=!1;if(O===null)fe=!0;else switch(de){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(O.$$typeof){case e:case t:fe=!0;break;case v:return fe=O._init,B(fe(O._payload),F,ie,re,ue)}}if(fe)return ue=ue(O),fe=re===""?"."+ke(O,0):re,L(ue)?(ie="",fe!=null&&(ie=fe.replace(pe,"$&/")+"/"),B(ue,F,ie,"",function(Ke){return Ke})):ue!=null&&(Q(ue)&&(ue=X(ue,ie+(ue.key==null||O&&O.key===ue.key?"":(""+ue.key).replace(pe,"$&/")+"/")+fe)),F.push(ue)),1;fe=0;var Ae=re===""?".":re+":";if(L(O))for(var ye=0;ye<O.length;ye++)re=O[ye],de=Ae+ke(re,ye),fe+=B(re,F,ie,de,ue);else if(ye=b(O),typeof ye=="function")for(O=ye.call(O),ye=0;!(re=O.next()).done;)re=re.value,de=Ae+ke(re,ye++),fe+=B(re,F,ie,de,ue);else if(de==="object"){if(typeof O.then=="function")return B(Se(O),F,ie,re,ue);throw F=String(O),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return fe}function q(O,F,ie){if(O==null)return O;var re=[],ue=0;return B(O,re,"","",function(de){return F.call(ie,de,ue++)}),re}function ce(O){if(O._status===-1){var F=O._result;F=F(),F.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=F)}if(O._status===1)return O._result.default;throw O._result}var H=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=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(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},J={map:q,forEach:function(O,F,ie){q(O,function(){F.apply(this,arguments)},ie)},count:function(O){var F=0;return q(O,function(){F++}),F},toArray:function(O){return q(O,function(F){return F})||[]},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=J,Ee.Component=k,Ee.Fragment=s,Ee.Profiler=o,Ee.PureComponent=R,Ee.StrictMode=a,Ee.Suspense=m,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,F,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(F!=null)for(de in F.key!==void 0&&(ue=""+F.key),F)!T.call(F,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&F.ref===void 0||(re[de]=F[de]);var de=arguments.length-2;if(de===1)re.children=ie;else if(1<de){for(var fe=Array(de),Ae=0;Ae<de;Ae++)fe[Ae]=arguments[Ae+2];re.children=fe}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,F,ie){var re,ue={},de=null;if(F!=null)for(re in F.key!==void 0&&(de=""+F.key),F)T.call(F,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ue[re]=F[re]);var fe=arguments.length-2;if(fe===1)ue.children=ie;else if(1<fe){for(var Ae=Array(fe),ye=0;ye<fe;ye++)Ae[ye]=arguments[ye+2];ue.children=Ae}if(O&&O.defaultProps)for(re in fe=O.defaultProps,fe)ue[re]===void 0&&(ue[re]=fe[re]);return P(O,de,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:ce}},Ee.memo=function(O,F){return{$$typeof:p,type:O,compare:F===void 0?null:F}},Ee.startTransition=function(O){var F=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,H)}catch(de){H(de)}finally{F!==null&&ie.types!==null&&(F.types=ie.types),A.T=F}},Ee.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Ee.use=function(O){return A.H.use(O)},Ee.useActionState=function(O,F,ie){return A.H.useActionState(O,F,ie)},Ee.useCallback=function(O,F){return A.H.useCallback(O,F)},Ee.useContext=function(O){return A.H.useContext(O)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(O,F){return A.H.useDeferredValue(O,F)},Ee.useEffect=function(O,F){return A.H.useEffect(O,F)},Ee.useEffectEvent=function(O){return A.H.useEffectEvent(O)},Ee.useId=function(){return A.H.useId()},Ee.useImperativeHandle=function(O,F,ie){return A.H.useImperativeHandle(O,F,ie)},Ee.useInsertionEffect=function(O,F){return A.H.useInsertionEffect(O,F)},Ee.useLayoutEffect=function(O,F){return A.H.useLayoutEffect(O,F)},Ee.useMemo=function(O,F){return A.H.useMemo(O,F)},Ee.useOptimistic=function(O,F){return A.H.useOptimistic(O,F)},Ee.useReducer=function(O,F,ie){return A.H.useReducer(O,F,ie)},Ee.useRef=function(O){return A.H.useRef(O)},Ee.useState=function(O){return A.H.useState(O)},Ee.useSyncExternalStore=function(O,F,ie){return A.H.useSyncExternalStore(O,F,ie)},Ee.useTransition=function(){return A.H.useTransition()},Ee.version="19.2.4",Ee}var Jv;function ol(){return Jv||(Jv=1,wh.exports=zk()),wh.exports}var w=ol();const as=sS(w),Jm=Nk({__proto__:null,default:as},[w]);var Nh={exports:{}},Mo={},Ch={exports:{}},kh={};var Xv;function _k(){return Xv||(Xv=1,(function(e){function t(B,q){var ce=B.length;B.push(q);e:for(;0<ce;){var H=ce-1>>>1,J=B[H];if(0<o(J,q))B[H]=q,B[ce]=J,ce=H;else break e}}function s(B){return B.length===0?null:B[0]}function a(B){if(B.length===0)return null;var q=B[0],ce=B.pop();if(ce!==q){B[0]=ce;e:for(var H=0,J=B.length,O=J>>>1;H<O;){var F=2*(H+1)-1,ie=B[F],re=F+1,ue=B[re];if(0>o(ie,ce))re<J&&0>o(ue,ie)?(B[H]=ue,B[re]=ce,H=re):(B[H]=ie,B[F]=ce,H=F);else if(re<J&&0>o(ue,ce))B[H]=ue,B[re]=ce,H=re;else break e}}return q}function o(B,q){var ce=B.sortIndex-q.sortIndex;return ce!==0?ce:B.id-q.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 m=[],p=[],v=1,y=null,x=3,b=!1,N=!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 q=s(p);q!==null;){if(q.callback===null)a(p);else if(q.startTime<=B)a(p),q.sortIndex=q.expirationTime,t(m,q);else break;q=s(p)}}function L(B){if(S=!1,z(B),!N)if(s(m)!==null)N=!0,M||(M=!0,se());else{var q=s(p);q!==null&&Se(L,q.startTime-B)}}var M=!1,A=-1,T=5,P=-1;function X(){return C?!0:!(e.unstable_now()-P<T)}function Q(){if(C=!1,M){var B=e.unstable_now();P=B;var q=!0;try{e:{N=!1,S&&(S=!1,E(A),A=-1),b=!0;var ce=x;try{t:{for(z(B),y=s(m);y!==null&&!(y.expirationTime>B&&X());){var H=y.callback;if(typeof H=="function"){y.callback=null,x=y.priorityLevel;var J=H(y.expirationTime<=B);if(B=e.unstable_now(),typeof J=="function"){y.callback=J,z(B),q=!0;break t}y===s(m)&&a(m),z(B)}else a(m);y=s(m)}if(y!==null)q=!0;else{var O=s(p);O!==null&&Se(L,O.startTime-B),q=!1}}break e}finally{y=null,x=ce,b=!1}q=void 0}}finally{q?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 Se(B,q){A=k(function(){B(e.unstable_now())},q)}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 q=3;break;default:q=x}var ce=x;x=q;try{return B()}finally{x=ce}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ce=x;x=B;try{return q()}finally{x=ce}},e.unstable_scheduleCallback=function(B,q,ce){var H=e.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?H+ce:H):ce=H,B){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=ce+J,B={id:v++,callback:q,priorityLevel:B,startTime:ce,expirationTime:J,sortIndex:-1},ce>H?(B.sortIndex=ce,t(p,B),s(m)===null&&B===s(p)&&(S?(E(A),A=-1):S=!0,Se(L,ce-H))):(B.sortIndex=J,t(m,B),N||b||(N=!0,M||(M=!0,se()))),B},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(B){var q=x;return function(){var ce=x;x=q;try{return B.apply(this,arguments)}finally{x=ce}}}})(kh)),kh}var Wv;function Ek(){return Wv||(Wv=1,Ch.exports=_k()),Ch.exports}var zh={exports:{}},nn={};var ex;function Rk(){if(ex)return nn;ex=1;var e=ol();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+p+" 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},o=Symbol.for("react.portal");function c(m,p,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:m,containerInfo:p,implementation:v}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,nn.createPortal=function(m,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(m,p,null,v)},nn.flushSync=function(m){var p=d.T,v=a.p;try{if(d.T=null,a.p=2,m)return m()}finally{d.T=p,a.p=v,a.d.f()}},nn.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},nn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},nn.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var v=p.as,y=f(v,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:b}):v==="script"&&a.d.X(m,{crossOrigin:y,integrity:x,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},nn.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=f(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},nn.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,y=f(v,p.crossOrigin);a.d.L(m,v,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},nn.preloadModule=function(m,p){if(typeof m=="string")if(p){var v=f(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},nn.requestFormReset=function(m){a.d.r(m)},nn.unstable_batchedUpdates=function(m,p){return m(p)},nn.useFormState=function(m,p,v){return d.H.useFormState(m,p,v)},nn.useFormStatus=function(){return d.H.useHostTransitionStatus()},nn.version="19.2.4",nn}var tx;function iS(){if(tx)return zh.exports;tx=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(),zh.exports=Rk(),zh.exports}var nx;function Ak(){if(nx)return Mo;nx=1;var e=Ek(),t=ol(),s=iS();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 o(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 m(n){if(c(n)!==n)throw Error(a(188))}function p(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 m(h),n;if(g===u)return m(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"),N=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"),X=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 N: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 Se=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},H=[],J=-1;function O(n){return{current:n}}function F(n){0>J||(n.current=H[J],H[J]=null,J--)}function ie(n,i){J++,H[J]=n.current,n.current=i}var re=O(null),ue=O(null),de=O(null),fe=O(null);function Ae(n,i){switch(ie(de,i),ie(ue,n),ie(re,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?yv(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=yv(i),n=vv(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}F(re),ie(re,n)}function ye(){F(re),F(ue),F(de)}function Ke(n){n.memoizedState!==null&&ie(fe,n);var i=re.current,l=vv(i,n.type);i!==l&&(ie(ue,n),ie(re,l))}function We(n){ue.current===n&&(F(re),F(ue)),fe.current===n&&(F(fe),Ao._currentValue=ce)}var me,et;function dt(n){if(me===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);me=i&&i[1]||"",et=-1<l.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+me+n+et}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
|
+
`),K=_.split(`
|
|
5
|
+
`);for(h=u=0;u<D.length&&!D[u].includes("DetermineComponentFrameRoot");)u++;for(;h<K.length&&!K[h].includes("DetermineComponentFrameRoot");)h++;if(u===D.length||h===K.length)for(u=D.length-1,h=K.length-1;1<=u&&0<=h&&D[u]!==K[h];)h--;for(;1<=u&&0<=h;u--,h--)if(D[u]!==K[h]){if(u!==1||h!==1)do if(u--,h--,0>h||D[u]!==K[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=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
|
+
Error generating stack: `+u.message+`
|
|
8
|
+
`+u.stack}}var zt=Object.prototype.hasOwnProperty,_t=e.unstable_scheduleCallback,mn=e.unstable_cancelCallback,le=e.unstable_shouldYield,Be=e.unstable_requestPaint,qe=e.unstable_now,_e=e.unstable_getCurrentPriorityLevel,Ue=e.unstable_ImmediatePriority,pt=e.unstable_UserBlockingPriority,rn=e.unstable_NormalPriority,js=e.unstable_LowPriority,Vs=e.unstable_IdlePriority,ws=e.log,Qs=e.unstable_setDisableYieldValue,cs=null,ze=null;function Ht(n){if(typeof ws=="function"&&Qs(n),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(cs,n)}catch{}}var Qe=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,Ns=262144,Fi=4194304;function us(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=us(u):(j&=_,j!==0?h=us(j):l||(l=_&~n,l!==0&&(h=us(l))))):(_=u&~g,_!==0?h=us(_):j!==0?h=us(j):l||(l=u&~n,l!==0&&(h=us(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 ds(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 Ki(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function fd(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,K=n.hiddenUpdates;for(l=j&~l;0<l;){var W=31-Qe(l),ne=1<<W;_[W]=0,D[W]=-1;var V=K[W];if(V!==null)for(K[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-Qe(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-Qe(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 he(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function at(){var n=q.p;return n!==0?n:(n=window.event,n===void 0?32:Bv(n.type))}function Qt(n,i){var l=q.p;try{return q.p=n,i()}finally{q.p=l}}var Lt=Math.random().toString(36).slice(2),Et="__reactFiber$"+Lt,wt="__reactProps$"+Lt,Cn="__reactContainer$"+Lt,tn="__reactEvents$"+Lt,hd="__reactListeners$"+Lt,Js="__reactHandles$"+Lt,Xs="__reactResources$"+Lt,fs="__reactMarker$"+Lt;function Da(n){delete n[Et],delete n[wt],delete n[tn],delete n[hd],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=Cv(n);n!==null;){if(l=n[Et])return l;n=Cv(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 hs(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[fs]=!0}var He=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++)He.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]*$"),Kr={},lg={};function g1(n){return zt.call(lg,n)?!0:zt.call(Kr,n)?!1:La.test(n)?lg[n]=!0:(Kr[n]=!0,!1)}function Sl(n,i,l){if(g1(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 Cs(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 cg(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function y1(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 md(n){if(!n._valueTracker){var i=cg(n)?"checked":"value";n._valueTracker=y1(n,i,""+n[i])}}function ug(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),u="";return n&&(u=cg(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 v1=/[\n"\\]/g;function Dn(n){return n.replace(v1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function pd(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?gd(n,j,On(i)):l!=null?gd(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 dg(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)){md(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),md(n)}function gd(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 fg(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 hg(n,i,l,u){if(i==null){if(u!=null){if(l!=null)throw Error(a(92));if(Se(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),md(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 x1=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 mg(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||x1.has(i)?i==="float"?n.cssFloat=l:n[i]=(""+l).trim():n[i]=l+"px"}function pg(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&&mg(n,h,u)}else for(var g in i)i.hasOwnProperty(g)&&mg(n,g,i[g])}function yd(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 b1=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"]]),S1=/^[\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 S1.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ks(){}var vd=null;function xd(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 gg(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(pd(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));pd(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&&ug(u)}break e;case"textarea":fg(n,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Ma(n,!!l.multiple,i,!1)}}}var bd=!1;function yg(n,i,l){if(bd)return n(i,l);bd=!0;try{var u=n(i);return u}finally{if(bd=!1,($a!==null||Pa!==null)&&(dc(),$a&&(i=$a,n=Pa,Pa=$a=null,gg(i),n)))for(i=0;i<n.length;i++)gg(n[i])}}function Zr(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 zs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sd=!1;if(zs)try{var Vr={};Object.defineProperty(Vr,"passive",{get:function(){Sd=!0}}),window.addEventListener("test",Vr,Vr),window.removeEventListener("test",Vr,Vr)}catch{Sd=!1}var ti=null,jd=null,Cl=null;function vg(){if(Cl)return Cl;var n,i=jd,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 zl(){return!0}function xg(){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)?zl:xg,this.isPropagationStopped=xg,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=zl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.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},_l=pn(Zi),Qr=y({},Zi,{view:0,detail:0}),j1=pn(Qr),wd,Nd,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:kd,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"?(wd=n.screenX-Yr.screenX,Nd=n.screenY-Yr.screenY):Nd=wd=0,Yr=n),wd)},movementY:function(n){return"movementY"in n?n.movementY:Nd}}),bg=pn(El),w1=y({},El,{dataTransfer:0}),N1=pn(w1),C1=y({},Qr,{relatedTarget:0}),Cd=pn(C1),k1=y({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),z1=pn(k1),_1=y({},Zi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),E1=pn(_1),R1=y({},Zi,{data:0}),Sg=pn(R1),A1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},T1={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"},O1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D1(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=O1[n])?!!i[n]:!1}function kd(){return D1}var L1=y({},Qr,{key:function(n){if(n.key){var i=A1[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"?T1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kd,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}}),M1=pn(L1),U1=y({},El,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jg=pn(U1),$1=y({},Qr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kd}),P1=pn($1),I1=y({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),B1=pn(I1),q1=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}),H1=pn(q1),G1=y({},Zi,{newState:0,oldState:0}),F1=pn(G1),K1=[9,13,27,32],zd=zs&&"CompositionEvent"in window,Jr=null;zs&&"documentMode"in document&&(Jr=document.documentMode);var Z1=zs&&"TextEvent"in window&&!Jr,wg=zs&&(!zd||Jr&&8<Jr&&11>=Jr),Ng=" ",Cg=!1;function kg(n,i){switch(n){case"keyup":return K1.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ia=!1;function V1(n,i){switch(n){case"compositionend":return zg(i);case"keypress":return i.which!==32?null:(Cg=!0,Ng);case"textInput":return n=i.data,n===Ng&&Cg?null:n;default:return null}}function Q1(n,i){if(Ia)return n==="compositionend"||!zd&&kg(n,i)?(n=vg(),Cl=jd=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 wg&&i.locale!=="ko"?null:i.data;default:return null}}var Y1={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 _g(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!Y1[n.type]:i==="textarea"}function Eg(n,i,l,u){$a?Pa?Pa.push(u):Pa=[u]:$a=u,i=vc(i,"onChange"),0<i.length&&(l=new _l("onChange","change",null,l,u),n.push({event:l,listeners:i}))}var Xr=null,Wr=null;function J1(n){dv(n,0)}function Rl(n){var i=hs(n);if(ug(i))return n}function Rg(n,i){if(n==="change")return i}var Ag=!1;if(zs){var _d;if(zs){var Ed="oninput"in document;if(!Ed){var Tg=document.createElement("div");Tg.setAttribute("oninput","return;"),Ed=typeof Tg.oninput=="function"}_d=Ed}else _d=!1;Ag=_d&&(!document.documentMode||9<document.documentMode)}function Og(){Xr&&(Xr.detachEvent("onpropertychange",Dg),Wr=Xr=null)}function Dg(n){if(n.propertyName==="value"&&Rl(Wr)){var i=[];Eg(i,Wr,n,xd(n)),yg(J1,i)}}function X1(n,i,l){n==="focusin"?(Og(),Xr=i,Wr=l,Xr.attachEvent("onpropertychange",Dg)):n==="focusout"&&Og()}function W1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Rl(Wr)}function eC(n,i){if(n==="click")return Rl(i)}function tC(n,i){if(n==="input"||n==="change")return Rl(i)}function nC(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var kn=typeof Object.is=="function"?Object.is:nC;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(!zt.call(i,h)||!kn(n[h],i[h]))return!1}return!0}function Lg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Mg(n,i){var l=Lg(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=Lg(l)}}function Ug(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Ug(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function $g(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 Rd(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 sC=zs&&"documentMode"in document&&11>=document.documentMode,Ba=null,Ad=null,to=null,Td=!1;function Pg(n,i,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Td||Ba==null||Ba!==wl(u)||(u=Ba,"selectionStart"in u&&Rd(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(Ad,"onSelect"),0<u.length&&(i=new _l("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")},Od={},Ig={};zs&&(Ig=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(Od[n])return Od[n];if(!qa[n])return n;var i=qa[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in Ig)return Od[n]=i[l];return n}var Bg=Qi("animationend"),qg=Qi("animationiteration"),Hg=Qi("animationstart"),iC=Qi("transitionrun"),aC=Qi("transitionstart"),rC=Qi("transitioncancel"),Gg=Qi("transitionend"),Fg=new Map,Dd="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(" ");Dd.push("scrollEnd");function Wn(n,i){Fg.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,Ld=0;function Tl(){for(var n=Ha,i=Ld=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&&Kg(l,h,g)}}function Ol(n,i,l,u){Ln[Ha++]=n,Ln[Ha++]=i,Ln[Ha++]=l,Ln[Ha++]=u,Ld|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Md(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 Kg(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-Qe(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,Kf=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 oC(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 zn(n,i,l,u){return new oC(n,i,l,u)}function Ud(n){return n=n.prototype,!(!n||!n.isReactComponent)}function _s(n,i){var l=n.alternate;return l===null?(l=zn(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 Zg(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")Ud(n)&&(j=1);else if(typeof n=="string")j=fk(n,l,re.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case P:return n=zn(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=zn(12,l,i,h|2),n.elementType=k,n.lanes=g,n;case L:return n=zn(13,l,i,h),n.elementType=L,n.lanes=g,n;case M:return n=zn(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=zn(j,l,i,h),i.elementType=n,i.type=u,i.lanes=g,i}function Ji(n,i,l,u){return n=zn(7,n,u,i),n.lanes=l,n}function $d(n,i,l){return n=zn(6,n,null,i),n.lanes=l,n}function Vg(n){var i=zn(18,null,null,0);return i.stateNode=n,i}function Pd(n,i,l){return i=zn(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Qg=new WeakMap;function Mn(n,i){if(typeof n=="object"&&n!==null){var l=Qg.get(n);return l!==void 0?l:(i={value:n,source:i,stack:Vt(i)},Qg.set(n,i),i)}return{value:n,source:i,stack:Vt(i)}}var Fa=[],Ka=0,Ml=null,no=0,Un=[],$n=0,ni=null,ms=1,ps="";function Es(n,i){Fa[Ka++]=no,Fa[Ka++]=Ml,Ml=n,no=i}function Yg(n,i,l){Un[$n++]=ms,Un[$n++]=ps,Un[$n++]=ni,ni=n;var u=ms;n=ps;var h=32-Qe(u)-1;u&=~(1<<h),l+=1;var g=32-Qe(i)+h;if(30<g){var j=h-h%5;g=(u&(1<<j)-1).toString(32),u>>=j,h-=j,ms=1<<32-Qe(i)+h|l<<h|u,ps=g+n}else ms=1<<g|l<<h|u,ps=n}function Id(n){n.return!==null&&(Es(n,1),Yg(n,1,0))}function Bd(n){for(;n===Ml;)Ml=Fa[--Ka],Fa[Ka]=null,no=Fa[--Ka],Fa[Ka]=null;for(;n===ni;)ni=Un[--$n],Un[$n]=null,ps=Un[--$n],Un[$n]=null,ms=Un[--$n],Un[$n]=null}function Jg(n,i){Un[$n++]=ms,Un[$n++]=ps,Un[$n++]=ni,ms=i.id,ps=i.overflow,ni=n}var Yt=null,ht=null,Ze=!1,si=null,Pn=!1,qd=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)),qd}function Xg(n){var i=n.stateNode,l=n.type,u=n.memoizedProps;switch(i[Et]=n,i[wt]=u,l){case"dialog":Ie("cancel",i),Ie("close",i);break;case"iframe":case"object":case"embed":Ie("load",i);break;case"video":case"audio":for(l=0;l<ko.length;l++)Ie(ko[l],i);break;case"source":Ie("error",i);break;case"img":case"image":case"link":Ie("error",i),Ie("load",i);break;case"details":Ie("toggle",i);break;case"input":Ie("invalid",i),dg(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ie("invalid",i);break;case"textarea":Ie("invalid",i),hg(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||pv(i.textContent,l)?(u.popover!=null&&(Ie("beforetoggle",i),Ie("toggle",i)),u.onScroll!=null&&Ie("scroll",i),u.onScrollEnd!=null&&Ie("scrollend",i),u.onClick!=null&&(i.onclick=ks),i=!0):i=!1,i||ii(n,!0)}function Wg(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 Za(n){if(n!==Yt)return!1;if(!Ze)return Wg(n),Ze=!0,!1;var i=n.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||oh(n.type,n.memoizedProps)),l=!l),l&&ht&&ii(n),Wg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=Nv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=Nv(n)}else i===27?(i=ht,vi(n.type)?(n=fh,fh=null,ht=n):ht=i):ht=Yt?Bn(n.stateNode.nextSibling):null;return!0}function Xi(){ht=Yt=null,Ze=!1}function Hd(){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 Gd=O(null),Wi=null,Rs=null;function ai(n,i,l){ie(Gd,i._currentValue),i._currentValue=l}function As(n){n._currentValue=Gd.current,F(Gd)}function Fd(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 Kd(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),Fd(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),Fd(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===fe.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&&Kd(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,Rs=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Jt(n){return ey(Wi,n)}function $l(n,i){return Wi===null&&ea(n),ey(n,i)}function ey(n,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Rs===null){if(n===null)throw Error(a(308));Rs=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Rs=Rs.next=i;return l}var lC=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()})}},cC=e.unstable_scheduleCallback,uC=e.unstable_NormalPriority,Ut={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zd(){return{controller:new lC,data:new Map,refCount:0}}function io(n){n.refCount--,n.refCount===0&&cC(uC,function(){n.controller.abort()})}var ao=null,Vd=0,Qa=0,Ya=null;function dC(n,i){if(ao===null){var l=ao=[];Vd=0,Qa=Xf(),Ya={status:"pending",value:void 0,then:function(u){l.push(u)}}}return Vd++,i.then(ty,ty),i}function ty(){if(--Vd===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 fC(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 ny=B.S;B.S=function(n,i){P0=qe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&dC(n,i),ny!==null&&ny(n,i)};var ta=O(null);function Qd(){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 sy(){var n=Qd();return n===null?null:{parent:Ut._currentValue,pool:n}}var Ja=Error(a(460)),Yd=Error(a(474)),Il=Error(a(542)),Bl={then:function(){}};function iy(n){return n=n.status,n==="fulfilled"||n==="rejected"}function ay(n,i,l){switch(l=n[l],l===void 0?n.push(i):l!==i&&(i.then(ks,ks),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,oy(n),n;default:if(typeof i.status=="string")i.then(ks,ks);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,oy(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 ry(){if(sa===null)throw Error(a(459));var n=sa;return sa=null,n}function oy(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=[]),ay(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 ly(n){function i(I,U){if(n){var G=I.deletions;G===null?(I.deletions=[U],I.flags|=16):G.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,G){return I.index=G,n?(G=I.alternate,G!==null?(G=G.index,G<U?(I.flags|=67108866,U):G):(I.flags|=67108866,U)):(I.flags|=1048576,U)}function j(I){return n&&I.alternate===null&&(I.flags|=67108866),I}function _(I,U,G,ee){return U===null||U.tag!==6?(U=$d(G,I.mode,ee),U.return=I,U):(U=h(U,G),U.return=I,U)}function D(I,U,G,ee){var Ne=G.type;return Ne===S?W(I,U,G.props.children,ee,G.key):U!==null&&(U.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===T&&na(Ne)===U.type)?(U=h(U,G.props),oo(U,G),U.return=I,U):(U=Ll(G.type,G.key,G.props,null,I.mode,ee),oo(U,G),U.return=I,U)}function K(I,U,G,ee){return U===null||U.tag!==4||U.stateNode.containerInfo!==G.containerInfo||U.stateNode.implementation!==G.implementation?(U=Pd(G,I.mode,ee),U.return=I,U):(U=h(U,G.children||[]),U.return=I,U)}function W(I,U,G,ee,Ne){return U===null||U.tag!==7?(U=Ji(G,I.mode,ee,Ne),U.return=I,U):(U=h(U,G),U.return=I,U)}function ne(I,U,G){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=$d(""+U,I.mode,G),U.return=I,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case b:return G=Ll(U.type,U.key,U.props,null,I.mode,G),oo(G,U),G.return=I,G;case N:return U=Pd(U,I.mode,G),U.return=I,U;case T:return U=na(U),ne(I,U,G)}if(Se(U)||se(U))return U=Ji(U,I.mode,G,null),U.return=I,U;if(typeof U.then=="function")return ne(I,ql(U),G);if(U.$$typeof===R)return ne(I,$l(I,U),G);Hl(I,U)}return null}function V(I,U,G,ee){var Ne=U!==null?U.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return Ne!==null?null:_(I,U,""+G,ee);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return G.key===Ne?D(I,U,G,ee):null;case N:return G.key===Ne?K(I,U,G,ee):null;case T:return G=na(G),V(I,U,G,ee)}if(Se(G)||se(G))return Ne!==null?null:W(I,U,G,ee,null);if(typeof G.then=="function")return V(I,U,ql(G),ee);if(G.$$typeof===R)return V(I,U,$l(I,G),ee);Hl(I,G)}return null}function Y(I,U,G,ee,Ne){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return I=I.get(G)||null,_(U,I,""+ee,Ne);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return I=I.get(ee.key===null?G:ee.key)||null,D(U,I,ee,Ne);case N:return I=I.get(ee.key===null?G:ee.key)||null,K(U,I,ee,Ne);case T:return ee=na(ee),Y(I,U,G,ee,Ne)}if(Se(ee)||se(ee))return I=I.get(G)||null,W(U,I,ee,Ne,null);if(typeof ee.then=="function")return Y(I,U,G,ql(ee),Ne);if(ee.$$typeof===R)return Y(I,U,G,$l(U,ee),Ne);Hl(U,ee)}return null}function ve(I,U,G,ee){for(var Ne=null,Ye=null,je=U,Oe=U=0,Fe=null;je!==null&&Oe<G.length;Oe++){je.index>Oe?(Fe=je,je=null):Fe=je.sibling;var Je=V(I,je,G[Oe],ee);if(Je===null){je===null&&(je=Fe);break}n&&je&&Je.alternate===null&&i(I,je),U=g(Je,U,Oe),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je,je=Fe}if(Oe===G.length)return l(I,je),Ze&&Es(I,Oe),Ne;if(je===null){for(;Oe<G.length;Oe++)je=ne(I,G[Oe],ee),je!==null&&(U=g(je,U,Oe),Ye===null?Ne=je:Ye.sibling=je,Ye=je);return Ze&&Es(I,Oe),Ne}for(je=u(je);Oe<G.length;Oe++)Fe=Y(je,I,Oe,G[Oe],ee),Fe!==null&&(n&&Fe.alternate!==null&&je.delete(Fe.key===null?Oe:Fe.key),U=g(Fe,U,Oe),Ye===null?Ne=Fe:Ye.sibling=Fe,Ye=Fe);return n&&je.forEach(function(wi){return i(I,wi)}),Ze&&Es(I,Oe),Ne}function Ce(I,U,G,ee){if(G==null)throw Error(a(151));for(var Ne=null,Ye=null,je=U,Oe=U=0,Fe=null,Je=G.next();je!==null&&!Je.done;Oe++,Je=G.next()){je.index>Oe?(Fe=je,je=null):Fe=je.sibling;var wi=V(I,je,Je.value,ee);if(wi===null){je===null&&(je=Fe);break}n&&je&&wi.alternate===null&&i(I,je),U=g(wi,U,Oe),Ye===null?Ne=wi:Ye.sibling=wi,Ye=wi,je=Fe}if(Je.done)return l(I,je),Ze&&Es(I,Oe),Ne;if(je===null){for(;!Je.done;Oe++,Je=G.next())Je=ne(I,Je.value,ee),Je!==null&&(U=g(Je,U,Oe),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je);return Ze&&Es(I,Oe),Ne}for(je=u(je);!Je.done;Oe++,Je=G.next())Je=Y(je,I,Oe,Je.value,ee),Je!==null&&(n&&Je.alternate!==null&&je.delete(Je.key===null?Oe:Je.key),U=g(Je,U,Oe),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je);return n&&je.forEach(function(wk){return i(I,wk)}),Ze&&Es(I,Oe),Ne}function ct(I,U,G,ee){if(typeof G=="object"&&G!==null&&G.type===S&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case b:e:{for(var Ne=G.key;U!==null;){if(U.key===Ne){if(Ne=G.type,Ne===S){if(U.tag===7){l(I,U.sibling),ee=h(U,G.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,G.props),oo(ee,G),ee.return=I,I=ee;break e}l(I,U);break}else i(I,U);U=U.sibling}G.type===S?(ee=Ji(G.props.children,I.mode,ee,G.key),ee.return=I,I=ee):(ee=Ll(G.type,G.key,G.props,null,I.mode,ee),oo(ee,G),ee.return=I,I=ee)}return j(I);case N:e:{for(Ne=G.key;U!==null;){if(U.key===Ne)if(U.tag===4&&U.stateNode.containerInfo===G.containerInfo&&U.stateNode.implementation===G.implementation){l(I,U.sibling),ee=h(U,G.children||[]),ee.return=I,I=ee;break e}else{l(I,U);break}else i(I,U);U=U.sibling}ee=Pd(G,I.mode,ee),ee.return=I,I=ee}return j(I);case T:return G=na(G),ct(I,U,G,ee)}if(Se(G))return ve(I,U,G,ee);if(se(G)){if(Ne=se(G),typeof Ne!="function")throw Error(a(150));return G=Ne.call(G),Ce(I,U,G,ee)}if(typeof G.then=="function")return ct(I,U,ql(G),ee);if(G.$$typeof===R)return ct(I,U,$l(I,G),ee);Hl(I,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,U!==null&&U.tag===6?(l(I,U.sibling),ee=h(U,G),ee.return=I,I=ee):(l(I,U),ee=$d(G,I.mode,ee),ee.return=I,I=ee),j(I)):l(I,U)}return function(I,U,G,ee){try{ro=0;var Ne=ct(I,U,G,ee);return Xa=null,Ne}catch(je){if(je===Ja||je===Il)throw je;var Ye=zn(29,je,null,I.mode);return Ye.lanes=ee,Ye.return=I,Ye}}}var ia=ly(!0),cy=ly(!1),ri=!1;function Jd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xd(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),Kg(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 Wd(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 ef=!1;function co(){if(ef){var n=Ya;if(n!==null)throw n}}function uo(n,i,l,u){ef=!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=_,K=D.next;D.next=null,j===null?g=K:j.next=K,j=D;var W=n.alternate;W!==null&&(W=W.updateQueue,_=W.lastBaseUpdate,_!==j&&(_===null?W.firstBaseUpdate=K:_.next=K,W.lastBaseUpdate=D))}if(g!==null){var ne=h.baseState;j=0,W=K=D=null,_=g;do{var V=_.lane&-536870913,Y=V!==_.lane;if(Y?(Ge&V)===V:(u&V)===V){V!==0&&V===Qa&&(ef=!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?(K=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=K,h.lastBaseUpdate=W,g===null&&(h.shared.lanes=0),hi|=j,n.lanes=j,n.memoizedState=ne}}function uy(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function dy(n,i){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)uy(l[n],i)}var Wa=O(null),Gl=O(0);function fy(n,i){n=Is,ie(Gl,n),ie(Wa,i),Is=n|i.baseLanes}function tf(){ie(Gl,Is),ie(Wa,Wa.current)}function nf(){Is=Gl.current,F(Wa),F(Gl)}var _n=O(null),In=null;function ci(n){var i=n.alternate;ie(Rt,Rt.current&1),ie(_n,n),In===null&&(i===null||Wa.current!==null||i.memoizedState!==null)&&(In=n)}function sf(n){ie(Rt,Rt.current),ie(_n,n),In===null&&(In=n)}function hy(n){n.tag===22?(ie(Rt,Rt.current),ie(_n,n),In===null&&(In=n)):ui()}function ui(){ie(Rt,Rt.current),ie(_n,_n.current)}function En(n){F(_n),In===n&&(In=null),F(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||uh(l)||dh(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 Ts=0,Te=null,ot=null,$t=null,Kl=!1,er=!1,aa=!1,Zl=0,fo=0,tr=null,hC=0;function Nt(){throw Error(a(321))}function af(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 rf(n,i,l,u,h,g){return Ts=g,Te=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,B.H=n===null||n.memoizedState===null?Yy:Sf,aa=!1,g=l(u,h),aa=!1,er&&(g=py(i,l,u,h)),my(n),g}function my(n){B.H=po;var i=ot!==null&&ot.next!==null;if(Ts=0,$t=ot=Te=null,Kl=!1,fo=0,tr=null,i)throw Error(a(300));n===null||Pt||(n=n.dependencies,n!==null&&Ul(n)&&(Pt=!0))}function py(n,i,l,u){Te=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=Jy,g=i(l,u)}while(er);return g}function mC(){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&&(Te.flags|=1024),i}function of(){var n=Zl!==0;return Zl=0,n}function lf(n,i,l){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~l}function cf(n){if(Kl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Kl=!1}Ts=0,$t=ot=Te=null,er=!1,fo=Zl=0,tr=null}function ln(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Te.memoizedState=$t=n:$t=$t.next=n,$t}function At(){if(ot===null){var n=Te.alternate;n=n!==null?n.memoizedState:null}else n=ot.next;var i=$t===null?Te.memoizedState:$t.next;if(i!==null)$t=i,ot=n;else{if(n===null)throw Te.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?Te.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=ay(tr,n,i),i=Te,($t===null?i.memoizedState:$t.next)===null&&(i=i.alternate,B.H=i===null||i.memoizedState===null?Yy:Sf),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 uf(n){var i=null,l=Te.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var u=Te.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(),Te.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]=X;return i.index++,l}function Os(n,i){return typeof i=="function"?i(n):i}function Yl(n){var i=At();return df(i,ot,n)}function df(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,K=i,W=!1;do{var ne=K.lane&-536870913;if(ne!==K.lane?(Ge&ne)===ne:(Ts&ne)===ne){var V=K.revertLane;if(V===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ne===Qa&&(W=!0);else if((Ts&V)===V){K=K.next,V===Qa&&(W=!0);continue}else ne={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(_=D=ne,j=g):D=D.next=ne,Te.lanes|=V,hi|=V;ne=K.action,aa&&l(g,ne),g=K.hasEagerState?K.eagerState:l(g,ne)}else V={lane:ne,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(_=D=V,j=g):D=D.next=V,Te.lanes|=ne,hi|=ne;K=K.next}while(K!==null&&K!==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 ff(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 gy(n,i,l){var u=Te,h=At(),g=Ze;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,pf(xy.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},vy.bind(null,u,h,l,i),null),ut===null)throw Error(a(349));g||(Ts&127)!==0||yy(u,i,l)}return l}function yy(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=Te.updateQueue,i===null?(i=Vl(),Te.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function vy(n,i,l,u){i.value=l,i.getSnapshot=u,by(i)&&Sy(n)}function xy(n,i,l){return l(function(){by(i)&&Sy(n)})}function by(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!kn(n,l)}catch{return!0}}function Sy(n){var i=Yi(n,2);i!==null&&bn(i,n,2)}function hf(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:Os,lastRenderedState:n},i}function jy(n,i,l,u){return n.baseState=l,df(n,ot,typeof u=="function"?u:Os)}function pC(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,wy(i,g)):(g.next=l.next,i.pending=l.next=g)}}function wy(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,_),Ny(n,i,_)}catch(K){mf(n,i,K)}finally{g!==null&&j.types!==null&&(g.types=j.types),B.T=g}}else try{g=l(h,u),Ny(n,i,g)}catch(K){mf(n,i,K)}}function Ny(n,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){Cy(n,i,u)},function(u){return mf(n,i,u)}):Cy(n,i,l)}function Cy(n,i,l){i.status="fulfilled",i.value=l,ky(i),n.state=l,i=n.pending,i!==null&&(l=i.next,l===i?n.pending=null:(l=l.next,i.next=l,wy(n,l)))}function mf(n,i,l){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=l,ky(i),i=i.next;while(i!==u)}n.action=null}function ky(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function zy(n,i){return i}function _y(n,i){if(Ze){var l=ut.formState;if(l!==null){e:{var u=Te;if(Ze){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:zy,lastRenderedState:i},l.queue=u,l=Zy.bind(null,Te,u),u.dispatch=l,u=hf(!1),g=bf.bind(null,Te,!1,u.queue),u=ln(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,l=pC.bind(null,Te,h,g,l),h.dispatch=l,u.memoizedState=n,[i,l,!1]}function Ey(n){var i=At();return Ry(i,ot,n)}function Ry(n,i,l){if(i=df(n,i,zy)[0],n=Yl(Os)[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&&(Te.flags|=2048,nr(9,{destroy:void 0},gC.bind(null,h,l),null)),[u,g,n]}function gC(n,i){n.action=i}function Ay(n){var i=At(),l=ot;if(l!==null)return Ry(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=Te.updateQueue,i===null&&(i=Vl(),Te.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 Ty(){return At().memoizedState}function Jl(n,i,l,u){var h=ln();Te.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&&af(u,ot.memoizedState.deps)?h.memoizedState=nr(i,g,l,u):(Te.flags|=n,h.memoizedState=nr(1|i,g,l,u))}function Oy(n,i){Jl(8390656,8,n,i)}function pf(n,i){Xl(2048,8,n,i)}function yC(n){Te.flags|=4;var i=Te.updateQueue;if(i===null)i=Vl(),Te.updateQueue=i,i.events=[n];else{var l=i.events;l===null?i.events=[n]:l.push(n)}}function Dy(n){var i=At().memoizedState;return yC({ref:i,nextImpl:n}),function(){if((Xe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Ly(n,i){return Xl(4,2,n,i)}function My(n,i){return Xl(4,4,n,i)}function Uy(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 $y(n,i,l){l=l!=null?l.concat([n]):null,Xl(4,4,Uy.bind(null,i,n),l)}function gf(){}function Py(n,i){var l=At();i=i===void 0?null:i;var u=l.memoizedState;return i!==null&&af(i,u[1])?u[0]:(l.memoizedState=[n,i],n)}function Iy(n,i){var l=At();i=i===void 0?null:i;var u=l.memoizedState;if(i!==null&&af(i,u[1]))return u[0];if(u=n(),aa){Ht(!0);try{n()}finally{Ht(!1)}}return l.memoizedState=[u,i],u}function yf(n,i,l){return l===void 0||(Ts&1073741824)!==0&&(Ge&261930)===0?n.memoizedState=i:(n.memoizedState=l,n=B0(),Te.lanes|=n,hi|=n,l)}function By(n,i,l,u){return kn(l,i)?l:Wa.current!==null?(n=yf(n,l,u),kn(n,i)||(Pt=!0),n):(Ts&42)===0||(Ts&1073741824)!==0&&(Ge&261930)===0?(Pt=!0,n.memoizedState=l):(n=B0(),Te.lanes|=n,hi|=n,i)}function qy(n,i,l,u,h){var g=q.p;q.p=g!==0&&8>g?g:8;var j=B.T,_={};B.T=_,bf(n,!1,i,l);try{var D=h(),K=B.S;if(K!==null&&K(_,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var W=fC(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{q.p=g,j!==null&&_.types!==null&&(j.types=_.types),B.T=j}}function vC(){}function vf(n,i,l,u){if(n.tag!==5)throw Error(a(476));var h=Hy(n).queue;qy(n,h,i,ce,l===null?vC:function(){return Gy(n),l(u)})}function Hy(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:ce},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:l},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function Gy(n){var i=Hy(n);i.next===null&&(i=n.alternate.memoizedState),mo(n,i.next.queue,{},Tn())}function xf(){return Jt(Ao)}function Fy(){return At().memoizedState}function Ky(){return At().memoizedState}function xC(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:Zd()},n.payload=i;return}i=i.return}}function bC(n,i,l){var u=Tn();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Wl(n)?Vy(i,l):(l=Md(n,i,l,u),l!==null&&(bn(l,n,u),Qy(l,i,u)))}function Zy(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))Vy(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=Md(n,i,h,u),l!==null)return bn(l,n,u),Qy(l,i,u),!0}return!1}function bf(n,i,l,u){if(u={lane:2,revertLane:Xf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Wl(n)){if(i)throw Error(a(479))}else i=Md(n,l,u,2),i!==null&&bn(i,n,2)}function Wl(n){var i=n.alternate;return n===Te||i!==null&&i===Te}function Vy(n,i){er=Kl=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function Qy(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 Yy={readContext:Jt,use:Ql,useCallback:function(n,i){return ln().memoizedState=[n,i===void 0?null:i],n},useContext:Jt,useEffect:Oy,useImperativeHandle:function(n,i,l){l=l!=null?l.concat([n]):null,Jl(4194308,4,Uy.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=bC.bind(null,Te,n),[u.memoizedState,n]},useRef:function(n){var i=ln();return n={current:n},i.memoizedState=n},useState:function(n){n=hf(n);var i=n.queue,l=Zy.bind(null,Te,i);return i.dispatch=l,[n.memoizedState,l]},useDebugValue:gf,useDeferredValue:function(n,i){var l=ln();return yf(l,n,i)},useTransition:function(){var n=hf(!1);return n=qy.bind(null,Te,n.queue,!0,!1),ln().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,l){var u=Te,h=ln();if(Ze){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),ut===null)throw Error(a(349));(Ge&127)!==0||yy(u,i,l)}h.memoizedState=l;var g={value:l,getSnapshot:i};return h.queue=g,Oy(xy.bind(null,u,g,n),[n]),u.flags|=2048,nr(9,{destroy:void 0},vy.bind(null,u,g,l,i),null),l},useId:function(){var n=ln(),i=ut.identifierPrefix;if(Ze){var l=ps,u=ms;l=(u&~(1<<32-Qe(u)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Zl++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=hC++,i="_"+i+"r_"+l.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:xf,useFormState:_y,useActionState:_y,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=bf.bind(null,Te,!0,l),l.dispatch=i,[n,i]},useMemoCache:uf,useCacheRefresh:function(){return ln().memoizedState=xC.bind(null,Te)},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)}}},Sf={readContext:Jt,use:Ql,useCallback:Py,useContext:Jt,useEffect:pf,useImperativeHandle:$y,useInsertionEffect:Ly,useLayoutEffect:My,useMemo:Iy,useReducer:Yl,useRef:Ty,useState:function(){return Yl(Os)},useDebugValue:gf,useDeferredValue:function(n,i){var l=At();return By(l,ot.memoizedState,n,i)},useTransition:function(){var n=Yl(Os)[0],i=At().memoizedState;return[typeof n=="boolean"?n:ho(n),i]},useSyncExternalStore:gy,useId:Fy,useHostTransitionStatus:xf,useFormState:Ey,useActionState:Ey,useOptimistic:function(n,i){var l=At();return jy(l,ot,n,i)},useMemoCache:uf,useCacheRefresh:Ky};Sf.useEffectEvent=Dy;var Jy={readContext:Jt,use:Ql,useCallback:Py,useContext:Jt,useEffect:pf,useImperativeHandle:$y,useInsertionEffect:Ly,useLayoutEffect:My,useMemo:Iy,useReducer:ff,useRef:Ty,useState:function(){return ff(Os)},useDebugValue:gf,useDeferredValue:function(n,i){var l=At();return ot===null?yf(l,n,i):By(l,ot.memoizedState,n,i)},useTransition:function(){var n=ff(Os)[0],i=At().memoizedState;return[typeof n=="boolean"?n:ho(n),i]},useSyncExternalStore:gy,useId:Fy,useHostTransitionStatus:xf,useFormState:Ay,useActionState:Ay,useOptimistic:function(n,i){var l=At();return ot!==null?jy(l,ot,n,i):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:uf,useCacheRefresh:Ky};Jy.useEffectEvent=Dy;function jf(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 wf={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 Xy(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 Wy(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&&wf.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 e0(n){Al(n)}function t0(n){console.error(n)}function n0(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 s0(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 Nf(n,i,l){return l=oi(l),l.tag=3,l.payload={element:null},l.callback=function(){ec(n,i)},l}function i0(n){return n=oi(n),n.tag=3,n}function a0(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(){s0(i,l,u)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){s0(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 SC(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=_n.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),Qf(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)),Qf(n,u,h)),!1}throw Error(a(435,l.tag))}return Qf(n,u,h),fc(),!1}if(Ze)return i=_n.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,u!==qd&&(n=Error(a(422),{cause:u}),so(Mn(n,l)))):(u!==qd&&(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=Nf(n.stateNode,u,h),Wd(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=Nf(l.stateNode,u,n),Wd(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=i0(h),a0(h,n,l,u),Wd(l,h),!1}l=l.return}while(l!==null);return!1}var Cf=Error(a(461)),Pt=!1;function Xt(n,i,l,u){i.child=n===null?cy(i,null,l,u):ia(i,n.child,l,u)}function r0(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=rf(n,i,l,j,g,h),_=of(),n!==null&&!Pt?(lf(n,i,h),Ds(n,i,h)):(Ze&&_&&Id(i),i.flags|=1,Xt(n,i,u,h),i.child)}function o0(n,i,l,u,h){if(n===null){var g=l.type;return typeof g=="function"&&!Ud(g)&&g.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=g,l0(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,!Of(n,h)){var j=g.memoizedProps;if(l=l.compare,l=l!==null?l:eo,l(j,u)&&n.ref===i.ref)return Ds(n,i,h)}return i.flags|=1,n=_s(g,u),n.ref=i.ref,n.return=i,i.child=n}function l0(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,Of(n,h))(n.flags&131072)!==0&&(Pt=!0);else return i.lanes=n.lanes,Ds(n,i,h)}return kf(n,i,l,u,h)}function c0(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 u0(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?fy(i,g):tf(),hy(i);else return u=i.lanes=536870912,u0(n,i,g!==null?g.baseLanes|l:l,l,u)}else g!==null?(Pl(i,g.cachePool),fy(i,g),ui(),i.memoizedState=null):(n!==null&&Pl(i,null),tf(),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 u0(n,i,l,u,h){var g=Qd();return g=g===null?null:{parent:Ut._currentValue,pool:g},i.memoizedState={baseLanes:l,cachePool:g},n!==null&&Pl(i,null),tf(),hy(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 d0(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 jC(n,i,l){var u=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Ze){if(u.mode==="hidden")return n=tc(i,u),i.lanes=536870912,go(null,n);if(sf(i),(n=ht)?(n=wv(n,Pn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ni!==null?{id:ms,overflow:ps}:null,retryLane:536870912,hydrationErrors:null},l=Vg(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(sf(i),h)if(i.flags&256)i.flags&=-257,i=d0(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),Cf;fc(),i=d0(n,i,l)}else n=g.treeContext,ht=Bn(j.nextSibling),Yt=i,Ze=!0,si=null,Pn=!1,n!==null&&Jg(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 kf(n,i,l,u,h){return ea(i),l=rf(n,i,l,u,void 0,h),u=of(),n!==null&&!Pt?(lf(n,i,h),Ds(n,i,h)):(Ze&&u&&Id(i),i.flags|=1,Xt(n,i,l,h),i.child)}function f0(n,i,l,u,h,g){return ea(i),i.updateQueue=null,l=py(i,u,l,h),my(n),u=of(),n!==null&&!Pt?(lf(n,i,g),Ds(n,i,g)):(Ze&&u&&Id(i),i.flags|=1,Xt(n,i,l,g),i.child)}function h0(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=wf,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=u,g.state=i.memoizedState,g.refs={},Jd(i),j=l.contextType,g.context=typeof j=="object"&&j!==null?Jt(j):Ga,g.state=i.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(jf(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&&wf.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 K=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"||(_||K!==j)&&Wy(i,g,u,j),ri=!1;var V=i.memoizedState;g.state=V,uo(i,u,g,h),co(),K=i.memoizedState,_||V!==K||ri?(typeof ne=="function"&&(jf(i,l,ne,u),K=i.memoizedState),(D=ri||Xy(i,l,D,u,V,K,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=K),g.props=u,g.state=K,g.context=j,u=D):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{g=i.stateNode,Xd(n,i),j=i.memoizedProps,W=ra(l,j),g.props=W,ne=i.pendingProps,V=g.context,K=l.contextType,D=Ga,typeof K=="object"&&K!==null&&(D=Jt(K)),_=l.getDerivedStateFromProps,(K=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(j!==ne||V!==D)&&Wy(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"&&(jf(i,l,_,u),Y=i.memoizedState),(W=ri||Xy(i,l,W,u,V,Y,D)||n!==null&&n.dependencies!==null&&Ul(n.dependencies))?(K||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=Ds(n,i,h),n}function m0(n,i,l,u){return Xi(),i.flags|=256,Xt(n,i,l,u),i.child}var zf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _f(n){return{baseLanes:n,cachePool:sy()}}function Ef(n,i,l){return n=n!==null?n.childLanes&~l:0,i&&(n|=An),n}function p0(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(Ze){if(h?ci(i):ui(),(n=ht)?(n=wv(n,Pn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ni!==null?{id:ms,overflow:ps}:null,retryLane:536870912,hydrationErrors:null},l=Vg(n),l.return=i,i.child=l,Yt=i,ht=null)):n=null,n===null)throw ii(i);return dh(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=_f(l),u.childLanes=Ef(n,j,l),i.memoizedState=zf,go(null,u)):(ci(i),Rf(i,_))}var D=n.memoizedState;if(D!==null&&(_=D.dehydrated,_!==null)){if(g)i.flags&256?(ci(i),i.flags&=-257,i=Af(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=_f(l),u.childLanes=Ef(n,j,l),i.memoizedState=zf,i=go(null,u));else if(ci(i),dh(_)){if(j=_.nextSibling&&_.nextSibling.dataset,j)var K=j.dgst;j=K,u=Error(a(419)),u.stack="",u.digest=j,so({value:u,source:null,stack:null}),i=Af(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),Cf;uh(_)||fc(),i=Af(n,i,l)}else uh(_)?(i.flags|=192,i.child=n.child,i=null):(n=D.treeContext,ht=Bn(_.nextSibling),Yt=i,Ze=!0,si=null,Pn=!1,n!==null&&Jg(i,n),i=Rf(i,u.children),i.flags|=4096);return i}return h?(ui(),_=u.fallback,h=i.mode,D=n.child,K=D.sibling,u=_s(D,{mode:"hidden",children:u.children}),u.subtreeFlags=D.subtreeFlags&65011712,K!==null?_=_s(K,_):(_=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?_=_f(l):(h=_.cachePool,h!==null?(D=Ut._currentValue,h=h.parent!==D?{parent:D,pool:D}:h):h=sy(),_={baseLanes:_.baseLanes|l,cachePool:h}),u.memoizedState=_,u.childLanes=Ef(n,j,l),i.memoizedState=zf,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 Rf(n,i){return i=sc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function sc(n,i){return n=zn(22,n,null,i),n.lanes=0,n}function Af(n,i,l){return ia(i,n.child,null,l),n=Rf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function g0(n,i,l){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i),Fd(n.return,i,l)}function Tf(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 y0(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=Ze?no:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&g0(n,l,i);else if(n.tag===19)g0(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),Tf(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}Tf(i,!0,l,null,g,u);break;case"together":Tf(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Ds(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 Of(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Ul(n)))}function wC(n,i,l){switch(i.tag){case 3:Ae(i,i.stateNode.containerInfo),ai(i,Ut,n.memoizedState.cache),Xi();break;case 27:case 5:Ke(i);break;case 4:Ae(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,sf(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?p0(n,i,l):(ci(i),n=Ds(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 y0(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,c0(n,i,l,i.pendingProps);case 24:ai(i,Ut,n.memoizedState.cache)}return Ds(n,i,l)}function v0(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps)Pt=!0;else{if(!Of(n,l)&&(i.flags&128)===0)return Pt=!1,wC(n,i,l);Pt=(n.flags&131072)!==0}else Pt=!1,Ze&&(i.flags&1048576)!==0&&Yg(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")Ud(n)?(u=ra(n,u),i.tag=1,i=h0(null,i,n,u,l)):(i.tag=0,i=kf(null,i,n,u,l));else{if(n!=null){var h=n.$$typeof;if(h===z){i.tag=11,i=r0(null,i,n,u,l);break e}else if(h===A){i.tag=14,i=o0(null,i,n,u,l);break e}}throw i=ke(n)||n,Error(a(306,i,""))}}return i;case 0:return kf(n,i,i.type,i.pendingProps,l);case 1:return u=i.type,h=ra(u,i.pendingProps),h0(n,i,u,h,l);case 3:e:{if(Ae(i,i.stateNode.containerInfo),n===null)throw Error(a(387));u=i.pendingProps;var g=i.memoizedState;h=g.element,Xd(n,i),uo(i,u,null,l);var j=i.memoizedState;if(u=j.cache,ai(i,Ut,u),u!==g.cache&&Kd(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=m0(n,i,u,l);break e}else if(u!==h){h=Mn(Error(a(424)),i),so(h),i=m0(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,Ze=!0,si=null,Pn=!0,l=cy(i,null,u,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Xi(),u===h){i=Ds(n,i,l);break e}Xt(n,i,u,l)}i=i.child}return i;case 26:return nc(n,i),n===null?(l=Ev(i.type,null,i.pendingProps,null))?i.memoizedState=l:Ze||(l=i.type,n=i.pendingProps,u=xc(de.current).createElement(l),u[Et]=i,u[wt]=n,Wt(u,l,n),Mt(u),i.stateNode=u):i.memoizedState=Ev(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ke(i),n===null&&Ze&&(u=i.stateNode=kv(i.type,i.pendingProps,de.current),Yt=i,Pn=!0,h=ht,vi(i.type)?(fh=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&&Ze&&((h=u=ht)&&(u=WC(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,oh(h,g)?u=null:j!==null&&oh(h,j)&&(i.flags|=32),i.memoizedState!==null&&(h=rf(n,i,mC,null,null,l),Ao._currentValue=h),nc(n,i),Xt(n,i,u,l),i.child;case 6:return n===null&&Ze&&((n=l=ht)&&(l=ek(l,i.pendingProps,Pn),l!==null?(i.stateNode=l,Yt=i,ht=null,n=!0):n=!1),n||ii(i)),null;case 13:return p0(n,i,l);case 4:return Ae(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 r0(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 o0(n,i,i.type,i.pendingProps,l);case 15:return l0(n,i,i.type,i.pendingProps,l);case 19:return y0(n,i,l);case 31:return jC(n,i,l);case 22:return c0(n,i,l,i.pendingProps);case 24:return ea(i),u=Jt(Ut),n===null?(h=Qd(),h===null&&(h=ut,g=Zd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=l),h=g),i.memoizedState={parent:u,cache:h},Jd(i),ai(i,Ut,h)):((n.lanes&l)!==0&&(Xd(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&&Kd(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 Ls(n){n.flags|=4}function Df(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(F0())n.flags|=8192;else throw sa=Bl,Yd}else n.flags&=-16777217}function x0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Dv(i))if(F0())n.flags|=8192;else throw sa=Bl,Yd}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(!Ze)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 NC(n,i,l){var u=i.pendingProps;switch(Bd(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),As(Ut),ye(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(Za(i)?Ls(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Hd())),mt(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?(Ls(i),g!==null?(mt(i),x0(i,g)):(mt(i),Df(i,h,null,u,l))):g?g!==n.memoizedState?(Ls(i),mt(i),x0(i,g)):(mt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&Ls(i),mt(i),Df(i,h,n,u,l)),null;case 27:if(We(i),l=de.current,h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ls(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return mt(i),null}n=re.current,Za(i)?Xg(i):(n=kv(h,u,l),i.stateNode=n,Ls(i))}return mt(i),null;case 5:if(We(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ls(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return mt(i),null}if(g=re.current,Za(i))Xg(i);else{var j=xc(de.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&&Ls(i)}}return mt(i),Df(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,l),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==u&&Ls(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(a(166));if(n=de.current,Za(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||pv(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=Za(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=Hd(),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=Za(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=Hd(),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 ye(),n===null&&nh(i.stateNode.containerInfo),mt(i),null;case 10:return As(i.type),mt(i),null;case 19:if(F(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;)Zg(l,n),l=l.sibling;return ie(Rt,Rt.current&1|2),Ze&&Es(i,u.treeForkCount),i.child}n=n.sibling}u.tail!==null&&qe()>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&&!Ze)return mt(i),null}else 2*qe()-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=qe(),n.sibling=null,l=Rt.current,ie(Rt,h?l&1|2:l&1),Ze&&Es(i,u.treeForkCount),n):(mt(i),null);case 22:case 23:return En(i),nf(),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&&F(ta),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),As(Ut),mt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function CC(n,i){switch(Bd(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return As(Ut),ye(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return We(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 F(Rt),null;case 4:return ye(),null;case 10:return As(i.type),null;case 22:case 23:return En(i),nf(),n!==null&&F(ta),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 b0(n,i){switch(Bd(i),i.tag){case 3:As(Ut),ye();break;case 26:case 27:case 5:We(i);break;case 4:ye();break;case 31:i.memoizedState!==null&&En(i);break;case 13:En(i);break;case 19:F(Rt);break;case 10:As(i.type);break;case 22:case 23:En(i),nf(),n!==null&&F(ta);break;case 24:As(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(_){nt(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,K=_;try{K()}catch(W){nt(h,D,W)}}}u=u.next}while(u!==g)}}catch(W){nt(i,i.return,W)}}function S0(n){var i=n.updateQueue;if(i!==null){var l=n.stateNode;try{dy(i,l)}catch(u){nt(n,n.return,u)}}}function j0(n,i,l){l.props=ra(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(u){nt(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){nt(n,i,h)}}function gs(n,i){var l=n.ref,u=n.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(h){nt(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){nt(n,i,h)}else l.current=null}function w0(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){nt(n,n.return,h)}}function Lf(n,i,l){try{var u=n.stateNode;ZC(u,n.type,l,i),u[wt]=i}catch(h){nt(n,n.return,h)}}function N0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&vi(n.type)||n.tag===4}function Mf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||N0(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 Uf(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=ks));else if(u!==4&&(u===27&&vi(n.type)&&(l=n.stateNode,i=null),n=n.child,n!==null))for(Uf(n,i,l),n=n.sibling;n!==null;)Uf(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 C0(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){nt(n,n.return,g)}}var Ms=!1,It=!1,$f=!1,k0=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function kC(n,i){if(n=n.containerInfo,ah=kc,n=$g(n),Rd(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,K=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&&++K===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(rh={focusedElem:n,selectionRange:l},kc=!1,Zt=i;Zt!==null;)if(i=Zt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Zt=n;else for(;Zt!==null;){switch(i=Zt,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){nt(l,l.return,Ce)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,l=n.nodeType,l===9)ch(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ch(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,Zt=n;break}Zt=i.return}}function z0(n,i,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:$s(n,l),u&4&&vo(5,l);break;case 1:if($s(n,l),u&4)if(n=l.stateNode,i===null)try{n.componentDidMount()}catch(j){nt(l,l.return,j)}else{var h=ra(l.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(j){nt(l,l.return,j)}}u&64&&S0(l),u&512&&xo(l,l.return);break;case 3:if($s(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{dy(n,i)}catch(j){nt(l,l.return,j)}}break;case 27:i===null&&u&4&&C0(l);case 26:case 5:$s(n,l),i===null&&u&4&&w0(l),u&512&&xo(l,l.return);break;case 12:$s(n,l);break;case 31:$s(n,l),u&4&&R0(n,l);break;case 13:$s(n,l),u&4&&A0(n,l),u&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=LC.bind(null,l),tk(n,l))));break;case 22:if(u=l.memoizedState!==null||Ms,!u){i=i!==null&&i.memoizedState!==null||It,h=Ms;var g=It;Ms=u,(It=i)&&!g?Ps(n,l,(l.subtreeFlags&8772)!==0):$s(n,l),Ms=h,It=g}break;case 30:break;default:$s(n,l)}}function _0(n){var i=n.alternate;i!==null&&(n.alternate=null,_0(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 Us(n,i,l){for(l=l.child;l!==null;)E0(n,i,l),l=l.sibling}function E0(n,i,l){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(cs,l)}catch{}switch(l.tag){case 26:It||gs(l,i),Us(n,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:It||gs(l,i);var u=gt,h=gn;vi(l.type)&&(gt=l.stateNode,gn=!1),Us(n,i,l),_o(l.stateNode),gt=u,gn=h;break;case 5:It||gs(l,i);case 6:if(u=gt,h=gn,gt=null,Us(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){nt(l,i,g)}else try{gt.removeChild(l.stateNode)}catch(g){nt(l,i,g)}break;case 18:gt!==null&&(gn?(n=gt,Sv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),mr(n)):Sv(gt,l.stateNode));break;case 4:u=gt,h=gn,gt=l.stateNode.containerInfo,gn=!0,Us(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),Us(n,i,l);break;case 1:It||(gs(l,i),u=l.stateNode,typeof u.componentWillUnmount=="function"&&j0(l,i,u)),Us(n,i,l);break;case 21:Us(n,i,l);break;case 22:It=(u=It)||l.memoizedState!==null,Us(n,i,l),It=u;break;default:Us(n,i,l)}}function R0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{mr(n)}catch(l){nt(i,i.return,l)}}}function A0(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){nt(i,i.return,l)}}function zC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new k0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new k0),i;default:throw Error(a(435,n.tag))}}function rc(n,i){var l=zC(n);i.forEach(function(u){if(!l.has(u)){l.add(u);var h=MC.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));E0(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;)T0(i,n),i=i.sibling}var es=null;function T0(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||gs(l,l.return)),u&64&&Ms&&(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||gs(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[fs]||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=Tv("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=Tv("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 Ov(h,n.type,n.stateNode);else n.stateNode=Av(h,u,n.memoizedProps);else g!==u?(g===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):g.count--,u===null?Ov(h,n.type,n.stateNode):Av(h,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Lf(n,n.memoizedProps,l.memoizedProps)}break;case 27:yn(i,n),vn(n),u&512&&(It||l===null||gs(l,l.return)),l!==null&&u&4&&Lf(n,n.memoizedProps,l.memoizedProps);break;case 5:if(yn(i,n),vn(n),u&512&&(It||l===null||gs(l,l.return)),n.flags&32){h=n.stateNode;try{Ua(h,"")}catch(ve){nt(n,n.return,ve)}}u&4&&n.stateNode!=null&&(h=n.memoizedProps,Lf(n,h,l!==null?l.memoizedProps:h)),u&1024&&($f=!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){nt(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){nt(n,n.return,ve)}$f&&($f=!1,O0(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=qe()),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,K=Ms,W=It;if(Ms=K||h,It=W||D,yn(i,n),It=W,Ms=K,vn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(l===null||D||Ms||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){nt(D,D.return,ve)}}}else if(i.tag===6){if(l===null){D=i;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(ve){nt(D,D.return,ve)}}}else if(i.tag===18){if(l===null){D=i;try{var Y=D.stateNode;h?jv(Y,!0):jv(D.stateNode,!1)}catch(ve){nt(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(N0(u)){l=u;break}u=u.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var h=l.stateNode,g=Mf(n);ac(n,g,h);break;case 5:var j=l.stateNode;l.flags&32&&(Ua(j,""),l.flags&=-33);var _=Mf(n);ac(n,_,j);break;case 3:case 4:var D=l.stateNode.containerInfo,K=Mf(n);Uf(n,K,D);break;default:throw Error(a(161))}}catch(W){nt(n,n.return,W)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function O0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;O0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function $s(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)z0(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:gs(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&j0(i,i.return,l),oa(i);break;case 27:_o(i.stateNode);case 26:case 5:gs(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 Ps(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:Ps(h,g,l),vo(4,g);break;case 1:if(Ps(h,g,l),u=g,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(K){nt(u,u.return,K)}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++)uy(D[h],_)}catch(K){nt(u,u.return,K)}}l&&j&64&&S0(g),xo(g,g.return);break;case 27:C0(g);case 26:case 5:Ps(h,g,l),l&&u===null&&j&4&&w0(g),xo(g,g.return);break;case 12:Ps(h,g,l);break;case 31:Ps(h,g,l),l&&j&4&&R0(h,g);break;case 13:Ps(h,g,l),l&&j&4&&A0(h,g);break;case 22:g.memoizedState===null&&Ps(h,g,l),xo(g,g.return);break;case 30:break;default:Ps(h,g,l)}i=i.sibling}}function Pf(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 If(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;)D0(n,i,l,u),i=i.sibling}function D0(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){nt(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&&Pf(j,i);break;case 24:ts(n,i,l,u),h&2048&&If(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,K=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&&K&2048&&Pf(j.alternate,j);break;case 24:sr(g,j,_,D,h),h&&K&2048&&If(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&&Pf(u.alternate,u);break;case 24:bo(l,u),h&2048&&If(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;)L0(n,i,l),n=n.sibling}function L0(n,i,l){switch(n.tag){case 26:ir(n,i,l),n.flags&So&&n.memoizedState!==null&&hk(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 M0(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];Zt=u,$0(u,n)}M0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)U0(n),n=n.sibling}function U0(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];Zt=u,$0(u,n)}M0(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 $0(n,i){for(;Zt!==null;){var l=Zt;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,Zt=u;else e:for(l=n;Zt!==null;){u=Zt;var h=u.sibling,g=u.return;if(_0(u),u===l){Zt=null;break e}if(h!==null){h.return=g,Zt=h;break e}Zt=g}}}var _C={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}},EC=typeof WeakMap=="function"?WeakMap:Map,Xe=0,ut=null,Pe=null,Ge=0,tt=0,Rn=null,fi=!1,ar=!1,Bf=!1,Is=0,Ct=0,hi=0,la=0,qf=0,An=0,rr=0,wo=null,xn=null,Hf=!1,lc=0,P0=0,cc=1/0,uc=null,mi=null,Ft=0,pi=null,or=null,Bs=0,Gf=0,Ff=null,I0=null,No=0,Kf=null;function Tn(){return(Xe&2)!==0&&Ge!==0?Ge&-Ge:B.T!==null?Xf():at()}function B0(){if(An===0)if((Ge&536870912)===0||Ze){var n=Ns;Ns<<=1,(Ns&3932160)===0&&(Ns=262144),An=n}else An=536870912;return n=_n.current,n!==null&&(n.flags|=32),An}function bn(n,i,l){(n===ut&&(tt===2||tt===9)||n.cancelPendingCommit!==null)&&(lr(n,0),gi(n,Ge,An,!1)),Ki(n,l),((Xe&2)===0||n!==ut)&&(n===ut&&((Xe&2)===0&&(la|=l),Ct===4&&gi(n,Ge,An,!1)),ys(n))}function q0(n,i,l){if((Xe&6)!==0)throw Error(a(327));var u=!l&&(i&127)===0&&(i&n.expiredLanes)===0||ds(n,i),h=u?TC(n,i):Vf(n,i,!0),g=u;do{if(h===0){ar&&!u&&gi(n,i,0,!1);break}else{if(l=n.current.alternate,g&&!RC(l)){h=Vf(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=Vf(_,j,!1),j!==2){if(Bf&&!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-qe(),10<h)){if(gi(u,i,An,!fi),Ta(u,0,!0)!==0)break e;Bs=i,u.timeoutHandle=xv(H0.bind(null,u,l,xn,uc,Hf,i,An,la,rr,fi,g,"Throttled",-0,0),h);break e}H0(u,l,xn,uc,Hf,i,An,la,rr,fi,g,null,-0,0)}}break}while(!0);ys(n)}function H0(n,i,l,u,h,g,j,_,D,K,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:ks},L0(i,g,ne);var ve=(g&62914560)===g?lc-qe():(g&4194048)===g?P0-qe():0;if(ve=mk(ne,ve),ve!==null){Bs=g,n.cancelPendingCommit=ve(J0.bind(null,n,i,g,l,u,h,j,_,D,W,ne,null,V,Y)),gi(n,g,j,!K);return}}J0(n,i,g,l,u,h,j,_,D)}function RC(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&=~qf,i&=~la,n.suspendedLanes|=i,n.pingedLanes&=~i,u&&(n.warmLanes|=i),u=n.expirationTimes;for(var h=i;0<h;){var g=31-Qe(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 Zf(){if(Pe!==null){if(tt===0)var n=Pe.return;else n=Pe,Rs=Wi=null,cf(n),Xa=null,ro=0,n=Pe;for(;n!==null;)b0(n.alternate,n),n=n.return;Pe=null}}function lr(n,i){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,YC(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Bs=0,Zf(),ut=n,Pe=l=_s(n.current,null),Ge=i,tt=0,Rn=null,fi=!1,ar=ds(n,i),Bf=!1,rr=An=qf=la=hi=Ct=0,xn=wo=null,Hf=!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-Qe(u),g=1<<h;i|=n[h],u&=~g}return Is=i,Tl(),l}function G0(n,i){Te=null,B.H=po,i===Ja||i===Il?(i=ry(),tt=3):i===Yd?(i=ry(),tt=4):tt=i===Cf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Rn=i,Pe===null&&(Ct=1,ec(n,Mn(i,n.current)))}function F0(){var n=_n.current;return n===null?!0:(Ge&4194048)===Ge?In===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?n===In:!1}function K0(){var n=B.H;return B.H=po,n===null?po:n}function Z0(){var n=B.A;return B.A=_C,n}function fc(){Ct=4,fi||(Ge&4194048)!==Ge&&_n.current!==null||(ar=!0),(hi&134217727)===0&&(la&134217727)===0||ut===null||gi(ut,Ge,An,!1)}function Vf(n,i,l){var u=Xe;Xe|=2;var h=K0(),g=Z0();(ut!==n||Ge!==i)&&(uc=null,lr(n,i)),i=!1;var j=Ct;e:do try{if(tt!==0&&Pe!==null){var _=Pe,D=Rn;switch(tt){case 8:Zf(),j=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(i=!0);var K=tt;if(tt=0,Rn=null,cr(n,_,D,K),l&&ar){j=0;break e}break;default:K=tt,tt=0,Rn=null,cr(n,_,D,K)}}AC(),j=Ct;break}catch(W){G0(n,W)}while(!0);return i&&n.shellSuspendCounter++,Rs=Wi=null,Xe=u,B.H=h,B.A=g,Pe===null&&(ut=null,Ge=0,Tl()),j}function AC(){for(;Pe!==null;)V0(Pe)}function TC(n,i){var l=Xe;Xe|=2;var u=K0(),h=Z0();ut!==n||Ge!==i?(uc=null,cc=qe()+500,lr(n,i)):ar=ds(n,i);e:do try{if(tt!==0&&Pe!==null){i=Pe;var g=Rn;t:switch(tt){case 1:tt=0,Rn=null,cr(n,i,g,1);break;case 2:case 9:if(iy(g)){tt=0,Rn=null,Q0(i);break}i=function(){tt!==2&&tt!==9||ut!==n||(tt=7),ys(n)},g.then(i,i);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:iy(g)?(tt=0,Rn=null,Q0(i)):(tt=0,Rn=null,cr(n,i,g,7));break;case 5:var j=null;switch(Pe.tag){case 26:j=Pe.memoizedState;case 5:case 27:var _=Pe;if(j?Dv(j):_.stateNode.complete){tt=0,Rn=null;var D=_.sibling;if(D!==null)Pe=D;else{var K=_.return;K!==null?(Pe=K,hc(K)):Pe=null}break t}}tt=0,Rn=null,cr(n,i,g,5);break;case 6:tt=0,Rn=null,cr(n,i,g,6);break;case 8:Zf(),Ct=6;break e;default:throw Error(a(462))}}OC();break}catch(W){G0(n,W)}while(!0);return Rs=Wi=null,B.H=u,B.A=h,Xe=l,Pe!==null?0:(ut=null,Ge=0,Tl(),Ct)}function OC(){for(;Pe!==null&&!le();)V0(Pe)}function V0(n){var i=v0(n.alternate,n,Is);n.memoizedProps=n.pendingProps,i===null?hc(n):Pe=i}function Q0(n){var i=n,l=i.alternate;switch(i.tag){case 15:case 0:i=f0(l,i,i.pendingProps,i.type,void 0,Ge);break;case 11:i=f0(l,i,i.pendingProps,i.type.render,i.ref,Ge);break;case 5:cf(i);default:b0(l,i),i=Pe=Zg(i,Is),i=v0(l,i,Is)}n.memoizedProps=n.pendingProps,i===null?hc(n):Pe=i}function cr(n,i,l,u){Rs=Wi=null,cf(i),Xa=null,ro=0;var h=i.return;try{if(SC(n,h,i,l,Ge)){Ct=1,ec(n,Mn(l,n.current)),Pe=null;return}}catch(g){if(h!==null)throw Pe=h,g;Ct=1,ec(n,Mn(l,n.current)),Pe=null;return}i.flags&32768?(Ze||u===1?n=!0:ar||(Ge&536870912)!==0?n=!1:(fi=n=!0,(u===2||u===9||u===3||u===6)&&(u=_n.current,u!==null&&u.tag===13&&(u.flags|=16384))),Y0(i,n)):hc(i)}function hc(n){var i=n;do{if((i.flags&32768)!==0){Y0(i,fi);return}n=i.return;var l=NC(i.alternate,i,Is);if(l!==null){Pe=l;return}if(i=i.sibling,i!==null){Pe=i;return}Pe=i=n}while(i!==null);Ct===0&&(Ct=5)}function Y0(n,i){do{var l=CC(n.alternate,n);if(l!==null){l.flags&=32767,Pe=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(n=n.sibling,n!==null)){Pe=n;return}Pe=n=l}while(n!==null);Ct=6,Pe=null}function J0(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|=Ld,fd(n,l,g,j,_,D),n===ut&&(Pe=ut=null,Ge=0),or=i,pi=n,Bs=l,Gf=g,Ff=h,I0=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,UC(rn,function(){return nv(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=B.T,B.T=null,h=q.p,q.p=2,j=Xe,Xe|=4;try{kC(n,i,l)}finally{Xe=j,q.p=h,B.T=u}}Ft=1,X0(),W0(),ev()}}function X0(){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=q.p;q.p=2;var h=Xe;Xe|=4;try{T0(i,n);var g=rh,j=$g(n.containerInfo),_=g.focusedElem,D=g.selectionRange;if(j!==_&&_&&_.ownerDocument&&Ug(_.ownerDocument.documentElement,_)){if(D!==null&&Rd(_)){var K=D.start,W=D.end;if(W===void 0&&(W=K),"selectionStart"in _)_.selectionStart=K,_.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=Mg(_,Ce),U=Mg(_,ct);if(I&&U&&(Y.rangeCount!==1||Y.anchorNode!==I.node||Y.anchorOffset!==I.offset||Y.focusNode!==U.node||Y.focusOffset!==U.offset)){var G=ne.createRange();G.setStart(I.node,I.offset),Y.removeAllRanges(),Ce>ct?(Y.addRange(G),Y.extend(U.node,U.offset)):(G.setEnd(U.node,U.offset),Y.addRange(G))}}}}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=!!ah,rh=ah=null}finally{Xe=h,q.p=u,B.T=l}}n.current=i,Ft=2}}function W0(){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=q.p;q.p=2;var h=Xe;Xe|=4;try{z0(n,i.alternate,i)}finally{Xe=h,q.p=u,B.T=l}}Ft=3}}function ev(){if(Ft===4||Ft===3){Ft=0,Be();var n=pi,i=or,l=Bs,u=I0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ft=5:(Ft=0,or=pi=null,tv(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(mi=null),he(l),i=i.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(cs,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=B.T,h=q.p,q.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,q.p=h}}(Bs&3)!==0&&mc(),ys(n),h=n.pendingLanes,(l&261930)!==0&&(h&42)!==0?n===Kf?No++:(No=0,Kf=n):No=0,Co(0)}}function tv(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,io(i)))}function mc(){return X0(),W0(),ev(),nv()}function nv(){if(Ft!==5)return!1;var n=pi,i=Gf;Gf=0;var l=he(Bs),u=B.T,h=q.p;try{q.p=32>l?32:l,B.T=null,l=Ff,Ff=null;var g=pi,j=Bs;if(Ft=0,or=pi=null,Bs=0,(Xe&6)!==0)throw Error(a(331));var _=Xe;if(Xe|=4,U0(g.current),D0(g,g.current,j,l),Xe=_,Co(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(cs,g)}catch{}return!0}finally{q.p=h,B.T=u,tv(n,i)}}function sv(n,i,l){i=Mn(l,i),i=Nf(n.stateNode,i,2),n=li(n,i,2),n!==null&&(Ki(n,2),ys(n))}function nt(n,i,l){if(n.tag===3)sv(n,n,l);else for(;i!==null;){if(i.tag===3){sv(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=i0(2),u=li(i,l,2),u!==null&&(a0(l,u,i,n),Ki(u,2),ys(u));break}}i=i.return}}function Qf(n,i,l){var u=n.pingCache;if(u===null){u=n.pingCache=new EC;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)||(Bf=!0,h.add(l),n=DC.bind(null,n,i,l),i.then(n,n))}function DC(n,i,l){var u=n.pingCache;u!==null&&u.delete(i),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,ut===n&&(Ge&l)===l&&(Ct===4||Ct===3&&(Ge&62914560)===Ge&&300>qe()-lc?(Xe&2)===0&&lr(n,0):qf|=l,rr===Ge&&(rr=0)),ys(n)}function iv(n,i){i===0&&(i=vl()),n=Yi(n,i),n!==null&&(Ki(n,i),ys(n))}function LC(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),iv(n,l)}function MC(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),iv(n,l)}function UC(n,i){return _t(n,i)}var pc=null,ur=null,Yf=!1,gc=!1,Jf=!1,yi=0;function ys(n){n!==ur&&n.next===null&&(ur===null?pc=ur=n:ur=ur.next=n),gc=!0,Yf||(Yf=!0,PC())}function Co(n,i){if(!Jf&&gc){Jf=!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-Qe(42|n)+1)-1,g&=h&~(j&~_),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,lv(u,g))}else g=Ge,g=Ta(u,u===ut?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||ds(u,g)||(l=!0,lv(u,g));u=u.next}while(l);Jf=!1}}function $C(){av()}function av(){gc=Yf=!1;var n=0;yi!==0&&QC()&&(n=yi);for(var i=qe(),l=null,u=pc;u!==null;){var h=u.next,g=rv(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 rv(n,i){for(var l=n.suspendedLanes,u=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var j=31-Qe(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=Ge,l=Ta(n,n===i?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,l===0||n===i&&(tt===2||tt===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&mn(u),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||ds(n,l)){if(i=l&-l,i===n.callbackPriority)return i;switch(u!==null&&mn(u),he(l)){case 2:case 8:l=pt;break;case 32:l=rn;break;case 268435456:l=Vs;break;default:l=rn}return u=ov.bind(null,n),l=_t(l,u),n.callbackPriority=i,n.callbackNode=l,i}return u!==null&&u!==null&&mn(u),n.callbackPriority=2,n.callbackNode=null,2}function ov(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=Ge;return u=Ta(n,n===ut?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(q0(n,u,i),rv(n,qe()),n.callbackNode!=null&&n.callbackNode===l?ov.bind(null,n):null)}function lv(n,i){if(mc())return null;q0(n,i,!0)}function PC(){JC(function(){(Xe&6)!==0?_t(Ue,$C):av()})}function Xf(){if(yi===0){var n=Qa;n===0&&(n=Ys,Ys<<=1,(Ys&261888)===0&&(Ys=256)),yi=n}return yi}function cv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Nl(""+n)}function uv(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 IC(n,i,l,u,h){if(i==="submit"&&l&&l.stateNode===h){var g=cv((h[wt]||null).action),j=u.submitter;j&&(i=(i=j[wt]||null)?cv(i.formAction):j.getAttribute("formAction"),i!==null&&(g=i,j=null));var _=new _l("action","action",null,u,h);n.push({event:_,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(yi!==0){var D=j?uv(h,j):new FormData(h);vf(l,{pending:!0,data:D,method:h.method,action:g},null,D)}}else typeof g=="function"&&(_.preventDefault(),D=j?uv(h,j):new FormData(h),vf(l,{pending:!0,data:D,method:h.method,action:g},g,D))},currentTarget:h}]})}}for(var Wf=0;Wf<Dd.length;Wf++){var eh=Dd[Wf],BC=eh.toLowerCase(),qC=eh[0].toUpperCase()+eh.slice(1);Wn(BC,"on"+qC)}Wn(Bg,"onAnimationEnd"),Wn(qg,"onAnimationIteration"),Wn(Hg,"onAnimationStart"),Wn("dblclick","onDoubleClick"),Wn("focusin","onFocus"),Wn("focusout","onBlur"),Wn(iC,"onTransitionRun"),Wn(aC,"onTransitionStart"),Wn(rC,"onTransitionCancel"),Wn(Gg,"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(" "),HC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ko));function dv(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,K=_.currentTarget;if(_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=K;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,K=_.currentTarget,_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=K;try{g(h)}catch(W){Al(W)}h.currentTarget=null,g=D}}}}function Ie(n,i){var l=i[tn];l===void 0&&(l=i[tn]=new Set);var u=n+"__bubble";l.has(u)||(fv(i,n,2,!1),l.add(u))}function th(n,i,l){var u=0;i&&(u|=4),fv(l,n,u,i)}var yc="_reactListening"+Math.random().toString(36).slice(2);function nh(n){if(!n[yc]){n[yc]=!0,He.forEach(function(l){l!=="selectionchange"&&(HC.has(l)||th(l,!1,n),th(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[yc]||(i[yc]=!0,th("selectionchange",!1,i))}}function fv(n,i,l,u){switch(Bv(i)){case 2:var h=yk;break;case 8:h=vk;break;default:h=yh}l=h.bind(null,i,l,n),h=void 0,!Sd||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 sh(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}yg(function(){var K=g,W=xd(l),ne=[];e:{var V=Fg.get(n);if(V!==void 0){var Y=_l,ve=n;switch(n){case"keypress":if(kl(l)===0)break e;case"keydown":case"keyup":Y=M1;break;case"focusin":ve="focus",Y=Cd;break;case"focusout":ve="blur",Y=Cd;break;case"beforeblur":case"afterblur":Y=Cd;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=bg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=N1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=P1;break;case Bg:case qg:case Hg:Y=z1;break;case Gg:Y=B1;break;case"scroll":case"scrollend":Y=j1;break;case"wheel":Y=H1;break;case"copy":case"cut":case"paste":Y=E1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=jg;break;case"toggle":case"beforetoggle":Y=F1}var Ce=(i&4)!==0,ct=!Ce&&(n==="scroll"||n==="scrollend"),I=Ce?V!==null?V+"Capture":null:V;Ce=[];for(var U=K,G;U!==null;){var ee=U;if(G=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||G===null||I===null||(ee=Zr(U,I),ee!=null&&Ce.push(zo(U,ee,G))),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!==vd&&(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=K,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=K),Y!==ve)){if(Ce=bg,ee="onMouseLeave",I="onMouseEnter",U="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=jg,ee="onPointerLeave",I="onPointerEnter",U="pointer"),ct=Y==null?V:hs(Y),G=ve==null?V:hs(ve),V=new Ce(ee,U+"leave",Y,l,W),V.target=ct,V.relatedTarget=G,ee=null,Ws(W)===K&&(Ce=new Ce(I,U+"enter",ve,l,W),Ce.target=G,Ce.relatedTarget=ct,ee=Ce),ct=ee,Y&&ve)t:{for(Ce=GC,I=Y,U=ve,G=0,ee=I;ee;ee=Ce(ee))G++;ee=0;for(var Ne=U;Ne;Ne=Ce(Ne))ee++;for(;0<G-ee;)I=Ce(I),G--;for(;0<ee-G;)U=Ce(U),ee--;for(;G--;){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&&hv(ne,V,Y,Ce,!1),ve!==null&&ct!==null&&hv(ne,ct,ve,Ce,!0)}}e:{if(V=K?hs(K):window,Y=V.nodeName&&V.nodeName.toLowerCase(),Y==="select"||Y==="input"&&V.type==="file")var Ye=Rg;else if(_g(V))if(Ag)Ye=tC;else{Ye=W1;var je=X1}else Y=V.nodeName,!Y||Y.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?K&&yd(K.elementType)&&(Ye=Rg):Ye=eC;if(Ye&&(Ye=Ye(n,K))){Eg(ne,Ye,l,W);break e}je&&je(n,V,K),n==="focusout"&&K&&V.type==="number"&&K.memoizedProps.value!=null&&gd(V,"number",V.value)}switch(je=K?hs(K):window,n){case"focusin":(_g(je)||je.contentEditable==="true")&&(Ba=je,Ad=K,to=null);break;case"focusout":to=Ad=Ba=null;break;case"mousedown":Td=!0;break;case"contextmenu":case"mouseup":case"dragend":Td=!1,Pg(ne,l,W);break;case"selectionchange":if(sC)break;case"keydown":case"keyup":Pg(ne,l,W)}var Oe;if(zd)e:{switch(n){case"compositionstart":var Fe="onCompositionStart";break e;case"compositionend":Fe="onCompositionEnd";break e;case"compositionupdate":Fe="onCompositionUpdate";break e}Fe=void 0}else Ia?kg(n,l)&&(Fe="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(Fe="onCompositionStart");Fe&&(wg&&l.locale!=="ko"&&(Ia||Fe!=="onCompositionStart"?Fe==="onCompositionEnd"&&Ia&&(Oe=vg()):(ti=W,jd="value"in ti?ti.value:ti.textContent,Ia=!0)),je=vc(K,Fe),0<je.length&&(Fe=new Sg(Fe,n,null,l,W),ne.push({event:Fe,listeners:je}),Oe?Fe.data=Oe:(Oe=zg(l),Oe!==null&&(Fe.data=Oe)))),(Oe=Z1?V1(n,l):Q1(n,l))&&(Fe=vc(K,"onBeforeInput"),0<Fe.length&&(je=new Sg("onBeforeInput","beforeinput",null,l,W),ne.push({event:je,listeners:Fe}),je.data=Oe)),IC(ne,n,K,l,W)}dv(ne,i)})}function zo(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=Zr(n,l),h!=null&&u.unshift(zo(n,h,g)),h=Zr(n,i),h!=null&&u.push(zo(n,h,g))),n.tag===3)return u;n=n.return}return[]}function GC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function hv(n,i,l,u,h){for(var g=i._reactName,j=[];l!==null&&l!==u;){var _=l,D=_.alternate,K=_.stateNode;if(_=_.tag,D!==null&&D===u)break;_!==5&&_!==26&&_!==27||K===null||(D=K,h?(K=Zr(l,g),K!=null&&j.unshift(zo(l,K,D))):h||(K=Zr(l,g),K!=null&&j.push(zo(l,K,D)))),l=l.return}j.length!==0&&n.push({event:i,listeners:j})}var FC=/\r\n?/g,KC=/\u0000|\uFFFD/g;function mv(n){return(typeof n=="string"?n:""+n).replace(FC,`
|
|
9
|
+
`).replace(KC,"")}function pv(n,i){return i=mv(i),mv(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":pg(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"&<(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=ks);break;case"onScroll":u!=null&&Ie("scroll",n);break;case"onScrollEnd":u!=null&&Ie("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":Ie("beforetoggle",n),Ie("toggle",n),Sl(n,"popover",u);break;case"xlinkActuate":Cs(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Cs(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Cs(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Cs(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Cs(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Cs(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Cs(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Cs(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Cs(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=b1.get(l)||l,Sl(n,l,u))}}function ih(n,i,l,u,h,g){switch(l){case"style":pg(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&&Ie("scroll",n);break;case"onScrollEnd":u!=null&&Ie("scrollend",n);break;case"onClick":u!=null&&(n.onclick=ks);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":Ie("error",n),Ie("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&<(n,i,"srcSet",l.srcSet,l,null),u&<(n,i,"src",l.src,l,null);return;case"input":Ie("invalid",n);var _=g=j=h=null,D=null,K=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":K=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)}}dg(n,g,_,D,K,j,h,!1);return;case"select":Ie("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":Ie("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)}hg(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":Ie("beforetoggle",n),Ie("toggle",n),Ie("cancel",n),Ie("close",n);break;case"iframe":case"object":Ie("load",n);break;case"video":case"audio":for(u=0;u<ko.length;u++)Ie(ko[u],n);break;case"image":Ie("error",n),Ie("load",n);break;case"details":Ie("toggle",n);break;case"embed":case"source":case"link":Ie("error",n),Ie("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(K in l)if(l.hasOwnProperty(K)&&(u=l[K],u!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(n,i,K,u,l,null)}return;default:if(yd(i)){for(W in l)l.hasOwnProperty(W)&&(u=l[W],u!==void 0&&ih(n,i,W,u,l,void 0));return}}for(_ in l)l.hasOwnProperty(_)&&(u=l[_],u!=null&<(n,i,_,u,l,null))}function ZC(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,K=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":K=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&<(n,i,V,Y,u,ne)}}pd(n,j,_,D,K,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&<(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&<(n,i,j,h,u,g)}fg(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)&<(n,i,Ce,null,u,V);for(K in u)if(V=u[K],Y=l[K],u.hasOwnProperty(K)&&V!==Y&&(V!=null||Y!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(a(137,i));break;default:lt(n,i,K,V,u,Y)}return;default:if(yd(i)){for(var ct in l)V=l[ct],l.hasOwnProperty(ct)&&V!==void 0&&!u.hasOwnProperty(ct)&&ih(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||ih(n,i,W,V,u,Y);return}}for(var I in l)V=l[I],l.hasOwnProperty(I)&&V!=null&&!u.hasOwnProperty(I)&<(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 gv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function VC(){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&&_&&gv(j)){for(j=0,_=h.responseEnd,u+=1;u<l.length;u++){var D=l[u],K=D.startTime;if(K>_)break;var W=D.transferSize,ne=D.initiatorType;W&&gv(ne)&&(D=D.responseEnd,j+=W*(D<_?1:(_-K)/(D-K)))}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 ah=null,rh=null;function xc(n){return n.nodeType===9?n:n.ownerDocument}function yv(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 vv(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 oh(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 lh=null;function QC(){var n=window.event;return n&&n.type==="popstate"?n===lh?!1:(lh=n,!0):(lh=null,!1)}var xv=typeof setTimeout=="function"?setTimeout:void 0,YC=typeof clearTimeout=="function"?clearTimeout:void 0,bv=typeof Promise=="function"?Promise:void 0,JC=typeof queueMicrotask=="function"?queueMicrotask:typeof bv<"u"?function(n){return bv.resolve(null).then(n).catch(XC)}:xv;function XC(n){setTimeout(function(){throw n})}function vi(n){return n==="head"}function Sv(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")_o(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,_o(l);for(var g=l.firstChild;g;){var j=g.nextSibling,_=g.nodeName;g[fs]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&g.rel.toLowerCase()==="stylesheet"||l.removeChild(g),g=j}}else l==="body"&&_o(n.ownerDocument.body);l=h}while(l);mr(i)}function jv(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 ch(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":ch(l),Da(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function WC(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[fs])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 ek(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 wv(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 uh(n){return n.data==="$?"||n.data==="$~"}function dh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function tk(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 fh=null;function Nv(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 Cv(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 kv(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 _o(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Da(n)}var qn=new Map,zv=new Set;function bc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var qs=q.d;q.d={f:nk,r:sk,D:ik,C:ak,L:rk,m:ok,X:ck,S:lk,M:uk};function nk(){var n=qs.f(),i=dc();return n||i}function sk(n){var i=Xn(n);i!==null&&i.tag===5&&i.type==="form"?Gy(i):qs.r(n)}var dr=typeof document>"u"?null:document;function _v(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+'"]'),zv.has(h)||(zv.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 ik(n){qs.D(n),_v("dns-prefetch",n,null)}function ak(n,i){qs.C(n,i),_v("preconnect",n,i)}function rk(n,i,l){qs.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 ok(n,i){qs.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 lk(n,i,l){qs.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))&&hh(n,l);var D=j=u.createElement("link");Mt(D),Wt(D,"link",n),D._p=new Promise(function(K,W){D.onload=K,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 ck(n,i){qs.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))&&mh(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 uk(n,i){qs.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))&&mh(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 Ev(n,i,l,u){var h=(h=de.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||dk(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 Rv(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function dk(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 Av(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=Rv(l),(h=qn.get(h))&&hh(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),mh(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 hh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function mh(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 Tv(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[fs]||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 Ov(n,i,l){n=n.ownerDocument||n,n.head.insertBefore(l,i==="title"?n.querySelector("head > title"):null)}function fk(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 Dv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function hk(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=Rv(u),(h=qn.get(h))&&hh(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 ph=0;function mk(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&&ph===0&&(ph=62500*VC());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>ph?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(pk,n),Nc=null,wc.call(n))}function pk(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:ce,_currentValue2:ce,_threadCount:0};function gk(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 Lv(n,i,l,u,h,g,j,_,D,K,W,ne){return n=new gk(n,i,l,j,D,K,W,ne,_),i=1,g===!0&&(i|=24),g=zn(3,null,null,i),n.current=g,g.stateNode=n,i=Zd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:u,isDehydrated:l,cache:i},Jd(g),n}function Mv(n){return n?(n=Ga,n):Ga}function Uv(n,i,l,u,h,g){h=Mv(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 $v(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function gh(n,i){$v(n,i),(n=n.alternate)&&$v(n,i)}function Pv(n){if(n.tag===13||n.tag===31){var i=Yi(n,67108864);i!==null&&bn(i,n,67108864),gh(n,67108864)}}function Iv(n){if(n.tag===13||n.tag===31){var i=Tn();i=$(i);var l=Yi(n,i);l!==null&&bn(l,n,i),gh(n,i)}}var kc=!0;function yk(n,i,l,u){var h=B.T;B.T=null;var g=q.p;try{q.p=2,yh(n,i,l,u)}finally{q.p=g,B.T=h}}function vk(n,i,l,u){var h=B.T;B.T=null;var g=q.p;try{q.p=8,yh(n,i,l,u)}finally{q.p=g,B.T=h}}function yh(n,i,l,u){if(kc){var h=vh(u);if(h===null)sh(n,i,u,zc,l),qv(n,u);else if(bk(h,n,i,l,u))u.stopPropagation();else if(qv(n,u),i&4&&-1<xk.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=us(g.pendingLanes);if(j!==0){var _=g;for(_.pendingLanes|=2,_.entangledLanes|=2;j;){var D=1<<31-Qe(j);_.entanglements[1]|=D,j&=~D}ys(g),(Xe&6)===0&&(cc=qe()+500,Co(0))}}break;case 31:case 13:_=Yi(g,2),_!==null&&bn(_,g,2),dc(),gh(g,2)}if(g=vh(u),g===null&&sh(n,i,u,zc,l),g===h)break;h=g}h!==null&&u.stopPropagation()}else sh(n,i,u,null,l)}}function vh(n){return n=xd(n),xh(n)}var zc=null;function xh(n){if(zc=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 zc=n,null}function Bv(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(_e()){case Ue:return 2;case pt:return 8;case rn:case js:return 32;case Vs:return 268435456;default:return 32}default:return 32}}var bh=!1,xi=null,bi=null,Si=null,To=new Map,Oo=new Map,ji=[],xk="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 qv(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&&Pv(i)),n):(n.eventSystemFlags|=u,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function bk(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 Hv(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(){Iv(l)});return}}else if(i===31){if(i=f(l),i!==null){n.blockedOn=i,Qt(n.priority,function(){Iv(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 _c(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=vh(n.nativeEvent);if(l===null){l=n.nativeEvent;var u=new l.constructor(l.type,l);vd=u,l.target.dispatchEvent(u),vd=null}else return i=Xn(l),i!==null&&Pv(i),n.blockedOn=l,!1;i.shift()}return!0}function Gv(n,i,l){_c(n)&&l.delete(i)}function Sk(){bh=!1,xi!==null&&_c(xi)&&(xi=null),bi!==null&&_c(bi)&&(bi=null),Si!==null&&_c(Si)&&(Si=null),To.forEach(Gv),Oo.forEach(Gv)}function Ec(n,i){n.blockedOn===i&&(n.blockedOn=null,bh||(bh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Sk)))}var Rc=null;function Fv(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(xh(u||l)===null)continue;break}var g=Xn(l);g!==null&&(n.splice(i,3),i-=3,vf(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);)Hv(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||Fv(l);else if(j){var _=null;if(g&&g.hasAttribute("formAction")){if(h=g,j=g[wt]||null)_=j.formAction;else if(xh(h)!==null)continue}else _=j.action;typeof _=="function"?l[u+1]=_:(l.splice(u,3),u-=3),Fv(l)}}}function Kv(){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 Sh(n){this._internalRoot=n}Ac.prototype.render=Sh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,u=Tn();Uv(l,u,n,i,null,null)},Ac.prototype.unmount=Sh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Uv(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&&Hv(n)}};var Zv=t.version;if(Zv!=="19.2.4")throw Error(a(527,Zv,"19.2.4"));q.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=p(i),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var jk={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{cs=Tc.inject(jk),ze=Tc}catch{}}return Mo.createRoot=function(n,i){if(!o(n))throw Error(a(299));var l=!1,u="",h=e0,g=t0,j=n0;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=Lv(n,1,!1,null,null,l,u,null,h,g,j,Kv),n[Cn]=i.current,nh(n),new Sh(i)},Mo.hydrateRoot=function(n,i,l){if(!o(n))throw Error(a(299));var u=!1,h="",g=e0,j=t0,_=n0,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=Lv(n,1,!0,i,l??null,u,h,D,g,j,_,Kv),i.context=Mv(null),l=i.current,u=Tn(),u=$(u),h=oi(u),h.callback=null,li(l,h,u),l=u,i.current.lanes=l,Ki(i,l),ys(i),n[Cn]=i.current,nh(n),new Ac(i)},Mo.version="19.2.4",Mo}var sx;function Tk(){if(sx)return Nh.exports;sx=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(),Nh.exports=Ak(),Nh.exports}var Ok=Tk(),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(){}},Dk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Lk=class{#t=Dk;#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 Lk;function Mk(e){setTimeout(e,0)}var wa=typeof window>"u"||"Deno"in globalThis;function un(){}function Uk(e,t){return typeof e=="function"?e(t):e}function om(e){return typeof e=="number"&&e>=0&&e!==1/0}function aS(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 ix(e,t){const{type:s="all",exact:a,fetchStatus:o,predicate:c,queryKey:d,stale:f}=e;if(d){if(a){if(t.queryHash!==Xm(d,t.options))return!1}else if(!Jo(t.queryKey,d))return!1}if(s!=="all"){const m=t.isActive();if(s==="active"&&!m||s==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||o&&o!==t.state.fetchStatus||c&&!c(t))}function ax(e,t){const{exact:s,status:a,predicate:o,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||o&&!o(t))}function Xm(e,t){return(t?.queryKeyHashFn||Yo)(e)}function Yo(e){return JSON.stringify(e,(t,s)=>lm(s)?Object.keys(s).sort().reduce((a,o)=>(a[o]=s[o],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 $k=Object.prototype.hasOwnProperty;function Wm(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=rx(e)&&rx(t);if(!a&&!(lm(e)&&lm(t)))return t;const c=(a?e:Object.keys(e)).length,d=a?t:Object.keys(t),f=d.length,m=a?new Array(f):{};let p=0;for(let v=0;v<f;v++){const y=a?v:d[v],x=e[y],b=t[y];if(x===b){m[y]=x,(a?v<c:$k.call(e,y))&&p++;continue}if(x===null||b===null||typeof x!="object"||typeof b!="object"){m[y]=b;continue}const N=Wm(x,b,s+1);m[y]=N,N===x&&p++}return c===f&&p===c?e:m}function du(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 rx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lm(e){if(!ox(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!ox(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ox(e){return Object.prototype.toString.call(e)==="[object Object]"}function Pk(e){return new Promise(t=>{ha.setTimeout(t,e)})}function cm(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Wm(e,t):t}function Ik(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function Bk(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var ep=Symbol();function rS(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ep?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function oS(e,t){return typeof e=="function"?e(...t):!!e}function qk(e,t,s){let a=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),a||(a=!0,o.aborted?s():o.addEventListener("abort",s,{once:!0})),o)}),e}var Hk=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"}},tp=new Hk;function um(){let e,t;const s=new Promise((o,c)=>{e=o,t=c});s.status="pending",s.catch(()=>{});function a(o){Object.assign(s,o),delete s.resolve,delete s.reject}return s.resolve=o=>{a({status:"fulfilled",value:o}),e(o)},s.reject=o=>{a({status:"rejected",reason:o}),t(o)},s}var Gk=Mk;function Fk(){let e=[],t=0,s=f=>{f()},a=f=>{f()},o=Gk;const c=f=>{t?e.push(f):o(()=>{s(f)})},d=()=>{const f=e;e=[],f.length&&o(()=>{a(()=>{f.forEach(m=>{s(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||d()}return m},batchCalls:f=>(...m)=>{c(()=>{f(...m)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{o=f}}}var Bt=Fk(),Kk=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}},fu=new Kk;function Zk(e){return Math.min(1e3*2**e,3e4)}function lS(e){return(e??"online")==="online"?fu.isOnline():!0}var dm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function cS(e){let t=!1,s=0,a;const o=um(),c=()=>o.status!=="pending",d=S=>{if(!c()){const C=new dm(S);x(C),e.onCancel?.(C)}},f=()=>{t=!0},m=()=>{t=!1},p=()=>tp.isFocused()&&(e.networkMode==="always"||fu.isOnline())&&e.canRun(),v=()=>lS(e.networkMode)&&e.canRun(),y=S=>{c()||(a?.(),o.resolve(S))},x=S=>{c()||(a?.(),o.reject(S))},b=()=>new Promise(S=>{a=C=>{(c()||p())&&S(C)},e.onPause?.()}).then(()=>{a=void 0,c()||e.onContinue?.()}),N=()=>{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??Zk,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),Pk(z).then(()=>p()?void 0:b()).then(()=>{t?x(k):N()})})};return{promise:o,status:()=>o.status,cancel:d,continue:()=>(a?.(),o),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?N():b().then(N),o)}}var uS=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),om(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)}},Vk=class extends uS{#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=cx(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=cx(this.options);t.data!==void 0&&(this.setState(lx(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=cm(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===ep||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:!aS(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(m=>m.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)})},o=()=>{const f=rS(this.options,t),p=(()=>{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,p,this):f(p)},d=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};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=cS({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:f=>{f instanceof dm&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(f,m)=>{this.#a({type:"failed",failureCount:f,error:m})},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 dm){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,...dS(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...lx(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 o=e.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,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 dS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function lx(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function cx(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 np=class extends Ur{constructor(e,t){super(),this.options=t,this.#t=e,this.#a=null,this.#o=um(),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),ux(this.#e,this.options)?this.#p():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fm(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fm(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&&!du(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&dx(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 o=this.#y();a&&(this.#e!==s||Hn(this.options.enabled,this.#e)!==Hn(t.enabled,this.#e)||o!==this.#l)&&this.#v(o)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(t,e);return Yk(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||!om(e))return;const s=aS(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||!om(this.#l)||this.#l===0)&&(this.#u=ha.setInterval(()=>{(this.options.refetchIntervalInBackground||tp.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,o=this.#i,c=this.#s,d=this.#r,m=e!==s?e.state:this.#n,{state:p}=e;let v={...p},y=!1,x;if(t._optimisticResults){const T=this.hasListeners(),P=!T&&ux(e,t),X=T&&dx(e,s,t,a);(P||X)&&(v={...v,...dS(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:b,errorUpdatedAt:N,status:S}=v;x=v.data;let C=!1;if(t.placeholderData!==void 0&&x===void 0&&S==="pending"){let T;o?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(T=o.data,C=!0):T=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,T!==void 0&&(S="success",x=cm(o?.data,T,t),y=!0)}if(t.select&&x!==void 0&&!C)if(o&&x===c?.data&&t.select===this.#m)x=this.#d;else try{this.#m=t.select,x=t.select(x),x=cm(o?.data,x,t),this.#d=x,this.#a=null}catch(T){this.#a=T}this.#a&&(b=this.#a,x=this.#d,N=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:N,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>m.dataUpdateCount||v.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:R&&!L,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:R&&L,isStale:sp(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,X=pe=>{P?pe.reject(A.error):T&&pe.resolve(A.data)},Q=()=>{const pe=this.#o=A.promise=um();X(pe)},se=this.#o;switch(se.status){case"pending":e.queryHash===s.queryHash&&X(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),du(t,e))return;this.#i=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!this.#h.size)return!0;const c=new Set(o??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 Qk(e,t){return Hn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ux(e,t){return Qk(e,t)||e.state.data!==void 0&&fm(e,t,t.refetchOnMount)}function fm(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&&sp(e,t)}return!1}function dx(e,t,s,a){return(e!==t||Hn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&sp(e,s)}function sp(e,t){return Hn(t.enabled,e)!==!1&&e.isStaleByTime(Oi(t.staleTime,e))}function Yk(e,t){return!du(e.getCurrentResult(),t)}function fx(e){return{onFetch:(t,s)=>{const a=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},m=0;const p=async()=>{let v=!1;const y=N=>{qk(N,()=>t.signal,()=>v=!0)},x=rS(t.options,t.fetchOptions),b=async(N,S,C)=>{if(v)return Promise.reject();if(S==null&&N.pages.length)return Promise.resolve(N);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?Bk:Ik;return{pages:L(N.pages,R,z),pageParams:L(N.pageParams,S,z)}};if(o&&c.length){const N=o==="backward",S=N?Jk:hx,C={pages:c,pageParams:d},k=S(a,C);f=await b(C,k,N)}else{const N=e??c.length;do{const S=m===0?d[0]??a.initialPageParam:hx(a,f);if(m>0&&S==null)break;f=await b(f,S),m++}while(m<N)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=p}}}function hx(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 Jk(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var Xk=class extends uS{#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||Wk(),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=cS({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",o=!this.#i.canStart();try{if(a)t();else{this.#s({type:"pending",variables:e,isPaused:o}),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:o})}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 Wk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fS=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 Xk({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(o=>o.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=>ax(t,s))}findAll(e={}){return this.getAll().filter(t=>ax(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 mx(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function ez(e,t,s){const a=e.slice(0);return a[t]=s,a}var tz=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 o=a.map(v=>v.observer),c=o.map(v=>v.getCurrentResult()),d=s.length!==o.length,f=o.some((v,y)=>v!==s[y]),m=d||f,p=m?!0:c.some((v,y)=>{const x=this.#e[y];return!x||!du(v,x)});!m&&!p||(m&&(this.#d=a,this.#s=o),this.#e=c,this.hasListeners()&&(m&&(mx(s,o).forEach(v=>{v.destroy()}),mx(o,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)),o=s.map(c=>c.defaultedQueryOptions.queryHash);return[a,c=>this.#c(c??a,t,o),()=>this.#f(a,s)]}#f(e,t){return t.map((s,a)=>{const o=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?o:s.observer.trackResult(o,c=>{t.forEach(d=>{d.observer.trackProp(c)})})})}#c(e,t,s){if(t){const a=this.#m,o=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((c,d)=>c!==a[d]));return(!this.#r||this.#e!==this.#a||o||t!==this.#o)&&(this.#o=t,this.#a=this.#e,s!==void 0&&(this.#m=s),this.#r=Wm(this.#r,t(e))),this.#r}return e}#u(e){const t=new Map;this.#s.forEach(a=>{const o=a.options.queryHash;if(!o)return;const c=t.get(o);c?c.push(a):t.set(o,[a])});const s=[];return e.forEach(a=>{const o=this.#t.defaultQueryOptions(a),d=t.get(o.queryHash)?.shift()??new np(this.#t,o);s.push({defaultedQueryOptions:o,observer:d})}),s}#l(e,t){const s=this.#s.indexOf(e);s!==-1&&(this.#e=ez(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)})})}}},nz=class extends Ur{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const a=t.queryKey,o=t.queryHash??Xm(a,t);let c=this.get(o);return c||(c=new Vk({client:e,queryKey:a,queryHash:o,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=>ix(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>ix(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()})})}},sz=class{#t;#e;#n;#i;#s;#r;#o;#a;constructor(e={}){this.#t=e.queryCache||new nz,this.#e=e.mutationCache||new fS,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=tp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=fu.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=Uk(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(o=>o.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(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,s);return s.throwOnError||(c=c.catch(un)),o.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=fx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(un).catch(un)}ensureInfiniteQueryData(e){return e.behavior=fx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return fu.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=Xm(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===ep&&(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()}},hS=w.createContext(void 0),mS=e=>{const t=w.useContext(hS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},iz=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),r.jsx(hS.Provider,{value:e,children:t})),pS=w.createContext(!1),gS=()=>w.useContext(pS);pS.Provider;function az(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var rz=w.createContext(az()),yS=()=>w.useContext(rz),vS=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?oS(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},xS=e=>{w.useEffect(()=>{e.clearReset()},[e])},bS=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(o&&e.data===void 0||oS(s,[e.error,a])),SS=e=>{if(e.suspense){const s=o=>o==="static"?o:Math.max(o??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...o)=>s(a(...o)):s(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},oz=(e,t)=>e.isLoading&&e.isFetching&&!t,hm=(e,t)=>e?.suspense&&t.isPending,mm=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function lz({queries:e,...t},s){const a=mS(),o=gS(),c=yS(),d=w.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=o?"isRestoring":"optimistic",C}),[e,a,o]);d.forEach(S=>{SS(S);const C=a.getQueryCache().get(S.queryHash);vS(S,c,C)}),xS(c);const[f]=w.useState(()=>new tz(a,d,t)),[m,p,v]=f.getOptimisticResult(d,t.combine),y=!o&&t.subscribed!==!1;w.useSyncExternalStore(w.useCallback(S=>y?f.subscribe(Bt.batchCalls(S)):un,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),w.useEffect(()=>{f.setQueries(d,t)},[d,t,f]);const b=m.some((S,C)=>hm(d[C],S))?m.flatMap((S,C)=>{const k=d[C];if(k&&hm(k,S)){const E=new np(a,k);return mm(k,E,c)}return[]}):[];if(b.length>0)throw Promise.all(b);const N=m.find((S,C)=>{const k=d[C];return k&&bS({result:S,errorResetBoundary:c,throwOnError:k.throwOnError,query:a.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(N?.error)throw N.error;return p(v())}function cz(e,t,s){const a=gS(),o=yS(),c=mS(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=c.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",SS(d),vS(d,o,f),xS(o);const m=!c.getQueryCache().get(d.queryHash),[p]=w.useState(()=>new t(c,d)),v=p.getOptimisticResult(d),y=!a&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(x=>{const b=y?p.subscribe(Bt.batchCalls(x)):un;return p.updateResult(),b},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),w.useEffect(()=>{p.setOptions(d)},[d,p]),hm(d,v))throw mm(d,p,o);if(bS({result:v,errorResetBoundary:o,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw v.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,v),d.experimental_prefetchInRender&&!wa&&oz(v,a)&&(m?mm(d,p,o):f?.promise)?.catch(un).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?v:p.trackResult(v)}function Fo(e,t){return cz(e,np)}var Dc=typeof window<"u"?w.useLayoutEffect:w.useEffect;function _h(e){const t=w.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function uz(e,t,s={},a={}){w.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([c])=>{t(c)},s);return o.observe(e.current),()=>{o.disconnect()}},[t,s,a.disabled,e])}function dz(e){const t=w.useRef(null);return w.useImperativeHandle(e,()=>t.current,[]),t}var fz=!1;function Xo(e){return e[e.length-1]}function hz(e){return typeof e=="function"}function Ei(e,t){return hz(e)?e(t):e}var mz=Object.prototype.hasOwnProperty,px=Object.prototype.propertyIsEnumerable,pz=()=>Object.create(null),ca=(e,t)=>ma(e,t,pz);function ma(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const o=t,c=vx(e)&&vx(o);if(!c&&!(hu(e)&&hu(o)))return o;const d=c?e:gx(e);if(!d)return o;const f=c?o:gx(o);if(!f)return o;const m=d.length,p=f.length,v=c?new Array(p):s();let y=0;for(let x=0;x<p;x++){const b=c?x:f[x],N=e[b],S=o[b];if(N===S){v[b]=N,(c?x<m:mz.call(e,b))&&y++;continue}if(N===null||S===null||typeof N!="object"||typeof S!="object"){v[b]=S;continue}const C=ma(N,S,s,a+1);v[b]=C,C===N&&y++}return m===p&&y===m?e:v}function gx(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!px.call(e,o))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return t;const a=t;for(const o of s){if(!px.call(e,o))return!1;a.push(o)}return a}function hu(e){if(!yx(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!yx(s)||!s.hasOwnProperty("isPrototypeOf"))}function yx(e){return Object.prototype.toString.call(e)==="[object Object]"}function vx(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,o=e.length;a<o;a++)if(!xa(e[a],t[a],s))return!1;return!0}if(hu(e)&&hu(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 o=0;if(!a)o=Object.keys(e).length;else for(const d in e)e[d]!==void 0&&o++;let c=0;for(const d in t)if((!a||t[d]!==void 0)&&(c++,c>o||!xa(e[d],t[d],s)))return!1;return o===c}return!1}function Ar(e){let t,s;const a=new Promise((o,c)=>{t=o,s=c});return a.status="pending",a.resolve=o=>{a.status="resolved",a.value=o,t(o),e?.(o)},a.reject=o=>{a.status="rejected",s(o)},a}function Wo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function gz(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function xx(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 gz(t)}var yz=["http:","https:","mailto:","tel:"];function mu(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="",o;for(;(o=t.exec(e))!==null;)a+=xx(e.slice(s,o.index))+o[0],s=t.lastIndex;a=a+xx(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function vz(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function pu(e){const t=new Map;let s,a;const o=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 o(d),d.value},set(c,d){if(t.size>=e&&s){const m=s;t.delete(m.key),m.next&&(s=m.next,m.next.prev=void 0),m===a&&(a=void 0)}const f=t.get(c);if(f)f.value=d,o(f);else{const m={key:c,value:d,prev:a};a&&(a.next=m),a=m,s||(s=m),t.set(c,m)}},clear(){t.clear(),s=void 0,a=void 0}}}var xz="Invariant failed";function $i(e,t){if(!e)throw new Error(xz)}var pa=4,jS=5;function bz(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 ip(e,t,s=new Uint16Array(6)){const a=e.indexOf("/",t),o=a===-1?e.length:a,c=e.substring(t,o);if(!c||!c.includes("$"))return s[0]=0,s[1]=t,s[2]=t,s[3]=o,s[4]=o,s[5]=o,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]=o,s[4]=o,s[5]=o,s;const d=bz(c);if(d){const[f,m]=d,p=c.charCodeAt(f+1);if(p===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const v=f+3,y=m;if(v<y)return s[0]=3,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+m+1,s[5]=o,s}}else if(p===36){const v=f+1,y=f+2;return y===m?(s[0]=2,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+m+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+y,s[3]=t+m,s[4]=t+m+1,s[5]=o,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=o,s[4]=o,s[5]=o,s}function Ou(e,t,s,a,o,c,d){d?.(s);let f=a;{const m=s.fullPath??s.from,p=m.length,v=s.options?.caseSensitive??e,y=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<p;){const b=ip(m,f,t);let N;const S=f,C=b[5];switch(f=C+1,c++,b[0]){case 0:{const k=m.substring(b[2],b[3]);if(v){const E=o.static?.get(k);if(E)N=E;else{o.static??=new Map;const R=ga(s.fullPath??s.from);R.parent=o,R.depth=c,N=R,o.static.set(k,R)}}else{const E=k.toLowerCase(),R=o.staticInsensitive?.get(E);if(R)N=R;else{o.staticInsensitive??=new Map;const z=ga(s.fullPath??s.from);z.parent=o,z.depth=c,N=z,o.staticInsensitive.set(E,z)}}break}case 1:{const k=m.substring(S,b[1]),E=m.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&&o.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===z&&A.suffix===L);if(M)N=M;else{const A=Rh(1,s.fullPath??s.from,R,z,L);N=A,A.depth=c,A.parent=o,o.dynamic??=[],o.dynamic.push(A)}break}case 3:{const k=m.substring(S,b[1]),E=m.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&&o.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===R&&A.prefix===z&&A.suffix===L);if(M)N=M;else{const A=Rh(3,s.fullPath??s.from,R,z,L);N=A,A.parent=o,A.depth=c,o.optional??=[],o.optional.push(A)}break}case 2:{const k=m.substring(S,b[1]),E=m.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=Rh(2,s.fullPath??s.from,R,z,L);N=M,M.parent=o,M.depth=c,o.wildcard??=[],o.wildcard.push(M)}}o=N}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=jS,b.parent=o,c++,b.depth=c,o.pathless??=[],o.pathless.push(b),o=b}const x=(s.path||!s.children)&&!s.isRoot;if(x&&m.endsWith("/")){const b=ga(s.fullPath??s.from);b.kind=pa,b.parent=o,c++,b.depth=c,o.index=b,o=b}o.parse=s.options?.params?.parse??null,o.skipOnParamError=y,o.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,x&&!o.route&&(o.route=s,o.fullPath=s.fullPath??s.from)}if(s.children)for(const m of s.children)Ou(e,t,m,f,o,c,d)}function Eh(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 zi(e){if(e.pathless)for(const t of e.pathless)zi(t);if(e.static)for(const t of e.static.values())zi(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())zi(t);if(e.dynamic?.length){e.dynamic.sort(Eh);for(const t of e.dynamic)zi(t)}if(e.optional?.length){e.optional.sort(Eh);for(const t of e.optional)zi(t)}if(e.wildcard?.length){e.wildcard.sort(Eh);for(const t of e.wildcard)zi(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 Rh(e,t,s,a,o){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:o}}function Sz(e,t){const s=ga("/"),a=new Uint16Array(6);for(const o of e)Ou(!1,a,o,1,s,0);zi(s),t.masksTree=s,t.flatCache=pu(1e3)}function jz(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const a=ap(e,t.masksTree);return t.flatCache.set(e,a),a}function wz(e,t,s,a,o){e||="/",a||="/";const c=t?`case\0${e}`:e;let d=o.singleCache.get(c);return d||(d=ga("/"),Ou(t,new Uint16Array(6),{from:e},1,d,0),o.singleCache.set(c,d)),ap(a,d,s)}function Nz(e,t,s=!1){const a=s?e:`nofuzz\0${e}`,o=t.matchCache.get(a);if(o!==void 0)return o;e||="/";let c;try{c=ap(e,t.segmentTree,s)}catch(d){if(d instanceof URIError)c=null;else throw d}return c&&(c.branch=zz(c.route)),t.matchCache.set(a,c),c}function Cz(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function kz(e,t=!1,s){const a=ga(e.fullPath),o=new Uint16Array(6),c={},d={};let f=0;return Ou(t,o,e,1,a,0,m=>{if(s?.(m,f),$i(!(m.id in c),`Duplicate routes found with id: ${String(m.id)}`),c[m.id]=m,f!==0&&m.path){const p=Cz(m.fullPath);(!d[p]||m.fullPath.endsWith("/"))&&(d[p]=m)}f++}),zi(a),{processedTree:{segmentTree:a,singleCache:pu(1e3),matchCache:pu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:d}}function ap(e,t,s=!1){const a=e.split("/"),o=Ez(e,a,t,s);if(!o)return null;const[c]=wS(e,a,o);return{route:o.node.route,rawParams:c,parsedParams:o.parsedParams}}function wS(e,t,s){const a=_z(s.node);let o=null;const c=Object.create(null);let d=s.extract?.part??0,f=s.extract?.node??0,m=s.extract?.path??0,p=s.extract?.segment??0;for(;f<a.length;d++,f++,m++,p++){const v=a[f];if(v.kind===pa)break;if(v.kind===jS){p--,d--,m--;continue}const y=t[d],x=m;if(y&&(m+=y.length),v.kind===1){o??=s.node.fullPath.split("/");const b=o[p],N=v.prefix?.length??0;if(b.charCodeAt(N)===123){const S=v.suffix?.length??0,C=b.substring(N+2,b.length-S-1),k=y.substring(N,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--,m=x-1;continue}o??=s.node.fullPath.split("/");const b=o[p],N=v.prefix?.length??0,S=v.suffix?.length??0,C=b.substring(N+3,b.length-S-1),k=v.suffix||v.prefix?y.substring(N,y.length-S):y;k&&(c[C]=decodeURIComponent(k))}else if(v.kind===2){const b=v,N=e.substring(x+(b.prefix?.length??0),e.length-(b.suffix?.length??0)),S=decodeURIComponent(N);c["*"]=S,c._splat=S;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:d,node:f,path:m,segment:p}]}function zz(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function _z(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ez(e,t,s,a){if(e==="/"&&s.index)return{node:s.index,skipped:0};const o=!Xo(t),c=o&&e!=="/",d=t.length-(o?1:0),f=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let m=null,p=null,v=null;for(;f.length;){const y=f.pop(),{node:x,index:b,skipped:N,depth:S,statics:C,dynamics:k,optionals:E}=y;let{extract:R,rawParams:z,parsedParams:L}=y;if(x.skipOnParamError){if(!Ah(e,t,y))continue;z=y.rawParams,R=y.extract,L=y.parsedParams}a&&x.route&&x.kind!==pa&&$o(p,y)&&(p=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:N,depth:S+1,statics:C,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L};let X=!0;if(x.index.skipOnParamError&&(Ah(e,t,P)||(X=!1)),X){if(C===d&&!k&&!E&&!N)return P;$o(v,P)&&(v=P)}}if(x.wildcard&&$o(m,y))for(const P of x.wildcard){const{prefix:X,suffix:Q}=P;if(X&&(M||!(P.caseSensitive?A:T??=A.toLowerCase()).startsWith(X)))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:N,depth:S,statics:C,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L};if(!(P.skipOnParamError&&!Ah(e,t,se))){m=se;break}}if(x.optional){const P=N|1<<S,X=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:X,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 Se=se.caseSensitive?A:T??=A.toLowerCase();if(pe&&!Se.startsWith(pe)||ke&&!Se.endsWith(ke))continue}f.push({node:se,index:b+1,skipped:N,depth:X,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 X=x.dynamic[P],{prefix:Q,suffix:se}=X;if(Q||se){const pe=X.caseSensitive?A:T??=A.toLowerCase();if(Q&&!pe.startsWith(Q)||se&&!pe.endsWith(se))continue}f.push({node:X,index:b+1,skipped:N,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:N,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:N,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 X=x.pathless.length-1;X>=0;X--){const Q=x.pathless[X];f.push({node:Q,index:b,skipped:N,depth:P,statics:C,dynamics:k,optionals:E,extract:R,rawParams:z,parsedParams:L})}}}if(v&&m)return $o(m,v)?v:m;if(v)return v;if(m)return m;if(a&&p){let y=p.index;for(let b=0;b<p.index;b++)y+=t[b].length;const x=y===e.length?"/":e.slice(y);return p.rawParams??=Object.create(null),p.rawParams["**"]=decodeURIComponent(x),p}return null}function Ah(e,t,s){try{const[a,o]=wS(e,t,s);s.rawParams=a,s.extract=o;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 tu(e){return rp(e.filter(t=>t!==void 0).join("/"))}function rp(e){return e.replace(/\/{2,}/g,"/")}function NS(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 CS(e){return Di(NS(e))}function gu(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Rz(e,t,s){return gu(e,s)===gu(t,s)}function Az({base:e,to:t,trailingSlash:s="never",cache:a}){const o=t.startsWith("/"),c=!o&&t===".";let d;if(a){d=o?t:c?e:e+"\0"+t;const y=a.get(d);if(y)return y}let f;if(c)f=e.split("/");else if(o)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 N=y[x];N===""?x?x===b-1&&f.push(N):f=[N]:N===".."?f.pop():N==="."||f.push(N)}}f.length>1&&(Xo(f)===""?s==="never"&&f.pop():s==="always"&&f.push(""));let m,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const x=f[y];if(!x)continue;m=ip(x,0,m);const b=m[0];if(b===0){p+=x;continue}const N=m[5],S=x.substring(0,m[1]),C=x.substring(m[4],N),k=x.substring(m[2],m[3]);b===1?p+=S||C?`${S}{$${k}}${C}`:`$${k}`:b===2?p+=S||C?`${S}{$}${C}`:"$":p+=`${S}{-$${k}}${C}`}p=rp(p);const v=p||"/";return d&&a&&a.set(d,v),v}function Tz(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),s=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(s,"g");return o=>o.replace(a,c=>t.get(c)??c)}function Th(e,t,s){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(o=>Sx(o,s)).join("/"):Sx(a,s)}function bx({path:e,params:t,decoder:s,...a}){let o=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:o};const d=e.length;let f=0,m,p="";for(;f<d;){const v=f;m=ip(e,v,m);const y=m[5];if(f=y+1,v===y)continue;const x=m[0];if(x===0){p+="/"+e.substring(v,y);continue}if(x===2){const b=t._splat;c._splat=b,c["*"]=b;const N=e.substring(v,m[1]),S=e.substring(m[4],y);if(!b){o=!0,(N||S)&&(p+="/"+N+S);continue}const C=Th("_splat",t,s);p+="/"+N+C+S;continue}if(x===1){const b=e.substring(m[2],m[3]);!o&&!(b in t)&&(o=!0),c[b]=t[b];const N=e.substring(v,m[1]),S=e.substring(m[4],y),C=Th(b,t,s)??"undefined";p+="/"+N+C+S;continue}if(x===3){const b=e.substring(m[2],m[3]),N=t[b];if(N==null)continue;c[b]=N;const S=e.substring(v,m[1]),C=e.substring(m[4],y),k=Th(b,t,s)??"";p+="/"+S+k+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:o}}function Sx(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function fn(e){return!!e?.isNotFound}function Oz(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var pm="tsr-scroll-restoration-v1_3",Dz=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function Lz(){const e=Oz();if(!e)return null;const t=e.getItem(pm);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=Ei(a,s)||s;try{e.setItem(pm,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Lc=Lz(),Mz=e=>e.state.__TSR_key||e.href;function Uz(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 yu=!1;function $z({storageKey:e,key:t,behavior:s,shouldScrollRestoration:a,scrollToTopSelectors:o,location:c}){let d;try{d=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,m=d[f];yu=!0;e:{if(a&&m&&Object.keys(m).length>0){for(const y in m){const x=m[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 p=(c??window.location).hash.split("#",2)[1];if(p){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const x=document.getElementById(p);x&&x.scrollIntoView(y)}break e}const v={top:0,left:0,behavior:s};if(window.scrollTo(v),o)for(const y of o){if(y==="window")continue;const x=typeof y=="function"?y():document.querySelector(y);x&&x.scrollTo(v)}}yu=!1}function Pz(e,t){if(!Lc||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Lc))return;e.isScrollRestorationSetup=!0,yu=!1;const s=e.options.getScrollRestorationKey||Mz;window.history.scrollRestoration="manual";const a=o=>{if(yu||!e.isScrollRestoring)return;let c="";if(o.target===document||o.target===window)c="window";else{const f=o.target.getAttribute("data-scroll-restoration-id");f?c=`[data-scroll-restoration-id="${f}"]`:c=Uz(o.target)}const d=s(e.state.location);Lc.set(f=>{const m=f[d]||={},p=m[c]||={};if(c==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(c){const v=document.querySelector(c);v&&(p.scrollX=v.scrollLeft||0,p.scrollY=v.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",Dz(a,100),!0),e.subscribe("onRendered",o=>{const c=s(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||($z({storageKey:pm,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 Iz(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 Bz(e,t=String){const s=new URLSearchParams;for(const a in e){const o=e[a];o!==void 0&&s.set(a,t(o))}return s.toString()}function Oh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function qz(e){const t=new URLSearchParams(e),s=Object.create(null);for(const[a,o]of t.entries()){const c=s[a];c==null?s[a]=Oh(o):Array.isArray(c)?c.push(Oh(o)):s[a]=[c,Oh(o)]}return s}var Hz=Fz(JSON.parse),Gz=Kz(JSON.stringify,JSON.parse);function Fz(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=qz(t);for(const a in s){const o=s[a];if(typeof o=="string")try{s[a]=e(o)}catch{}}return s}}function Kz(e,t){const s=typeof t=="function";function a(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(s&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const c=Bz(o,a);return c?`?${c}`:""}}var ba="__root__";function op(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 Zz(e){return{input:({url:t})=>{for(const s of e)t=gm(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=kS(e[s],t);return t}}}function Vz(e){const t=CS(e.basepath),s=`/${t}`,a=`${s}/`,o=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===o?d.pathname="/":f.startsWith(c)&&(d.pathname=d.pathname.slice(s.length)),d},output:({url:d})=>(d.pathname=tu(["/",t,d.pathname]),d)}}function gm(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 kS(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 zS({update:e,notify:t,unwatched:s}){return{link:a,unlink:o,propagate:c,checkDirty:d,shallowPropagate:f};function a(p,v,y){const x=v.depsTail;if(x!==void 0&&x.dep===p)return;const b=x!==void 0?x.nextDep:v.deps;if(b!==void 0&&b.dep===p){b.version=y,v.depsTail=b;return}const N=p.subsTail;if(N!==void 0&&N.version===y&&N.sub===v)return;const S=v.depsTail=p.subsTail={version:y,dep:p,sub:v,prevDep:x,nextDep:b,prevSub:N,nextSub:void 0};b!==void 0&&(b.prevDep=S),x!==void 0?x.nextDep=S:v.deps=S,N!==void 0?N.nextSub=S:p.subs=S}function o(p,v=p.sub){const y=p.dep,x=p.prevDep,b=p.nextDep,N=p.nextSub,S=p.prevSub;return b!==void 0?b.prevDep=x:v.depsTail=x,x!==void 0?x.nextDep=b:v.deps=b,N!==void 0?N.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=N:(y.subs=N)===void 0&&s(y),b}function c(p){let v=p.nextSub,y;e:do{const x=p.sub;let b=x.flags;if(b&60?b&12?b&4?!(b&48)&&m(p,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 N=x.subs;if(N!==void 0){const S=(p=N).nextSub;S!==void 0&&(y={value:v,prev:y},v=S);continue}}if((p=v)!==void 0){v=p.nextSub;continue}for(;y!==void 0;)if(p=y.value,y=y.prev,p!==void 0){v=p.nextSub;continue e}break}while(!0)}function d(p,v){let y,x=0,b=!1;e:do{const N=p.dep,S=N.flags;if(v.flags&16)b=!0;else if((S&17)===17){if(e(N)){const C=N.subs;C.nextSub!==void 0&&f(C),b=!0}}else if((S&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(y={value:p,prev:y}),p=N.deps,v=N,++x;continue}if(!b){const C=p.nextDep;if(C!==void 0){p=C;continue}}for(;x--;){const C=v.subs,k=C.nextSub!==void 0;if(k?(p=y.value,y=y.prev):p=C,b){if(e(v)){k&&f(C),v=p.sub;continue}b=!1}else v.flags&=-33;v=p.sub;const E=p.nextDep;if(E!==void 0){p=E;continue e}}return b}while(!0)}function f(p){do{const v=p.sub,y=v.flags;(y&48)===32&&(v.flags=y|16,(y&6)===2&&t(v))}while((p=p.nextSub)!==void 0)}function m(p,v){let y=v.depsTail;for(;y!==void 0;){if(y===p)return!0;y=y.prevDep}return!1}}let lp=0,ua=0,Ko=0;const Gs=[],{link:QM,unlink:_S,propagate:YM,checkDirty:Qz,shallowPropagate:JM}=zS({update(e){return e.depsTail!==void 0?Wz(e):e_(e)},notify(e){let t=Ko,s=t;do if(Gs[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=Gs[s];Gs[s++]=Gs[t],Gs[t]=a}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Du(e)):s_.call(e)}});function Yz(){return lp}function Jz(){++lp}function Xz(){--lp||n_()}function Wz(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Du(e)}}function e_(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function t_(e){const t=e.flags;if(t&16||t&32&&Qz(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Du(e)}}else e.flags=2}function n_(){try{for(;ua<Ko;){const e=Gs[ua];Gs[ua++]=void 0,t_(e)}}finally{for(;ua<Ko;){const e=Gs[ua];Gs[ua++]=void 0,e.flags|=10}ua=0,Ko=0}}function s_(){this.depsTail=void 0,this.flags=0,Du(this);const e=this.subs;e!==void 0&&_S(e)}function Du(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=_S(s,e)}function cp(e,t,s){const a=typeof e=="object",o=a?e:void 0;return{next:(a?e.next:e)?.bind(o),error:(a?e.error:t)?.bind(o),complete:(a?e.complete:s)?.bind(o)}}const ym=[];let nu=0;const{link:jx,unlink:i_,propagate:a_,checkDirty:ES,shallowPropagate:wx}=zS({update(e){return e._update()},notify(e){ym[vm++]=e,e.flags&=~vt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=vt.Mutable|vt.Dirty,vu(e))}});let Mc=0,vm=0,vs;function vu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=i_(s,e)}function RS(){if(!(Yz()>0)){for(;Mc<vm;){const e=ym[Mc];ym[Mc++]=void 0,e.notify()}Mc=0,vm=0}}function AS(e,t){const s=typeof e=="function",a=e,o={_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 vs!==void 0&&jx(o,vs,nu),o._snapshot},subscribe(c){const d=cp(c),f={current:!1},m=r_(()=>{o.get(),f.current?d.next?.(o._snapshot):f.current=!0});return{unsubscribe:()=>{m.stop()}}},_update(c){const d=vs,f=Object.is;if(s)vs=o,++nu,o.depsTail=void 0;else if(c===void 0)return!1;s&&(o.flags=vt.Mutable|vt.RecursedCheck);try{const m=o._snapshot,p=typeof c=="function"?c(m):c===void 0&&s?a(m):c;return m===void 0||!f(m,p)?(o._snapshot=p,!0):!1}finally{vs=d,s&&(o.flags&=~vt.RecursedCheck),vu(o)}}};return s?(o.flags=vt.Mutable|vt.Dirty,o.get=function(){const c=o.flags;if(c&vt.Dirty||c&vt.Pending&&ES(o.deps,o)){if(o._update()){const d=o.subs;d!==void 0&&wx(d)}}else c&vt.Pending&&(o.flags=c&~vt.Pending);return vs!==void 0&&jx(o,vs,nu),o._snapshot}):o.set=function(c){if(o._update(c)){const d=o.subs;d!==void 0&&(a_(d),wx(d),RS())}},o}function r_(e){const t=()=>{const a=vs;vs=s,++nu,s.depsTail=void 0,s.flags=vt.Watching|vt.RecursedCheck;try{return e()}finally{vs=a,s.flags&=~vt.RecursedCheck,vu(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&&ES(this.deps,this)?t():this.flags=vt.Watching},stop(){this.flags=vt.None,this.depsTail=void 0,vu(this)}};return t(),s}class o_{constructor(t){this.atom=AS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(cp(t))}}class l_{constructor(t){this.atom=AS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(cp(t))}}function c_(e){return typeof e=="function"?new l_(e):new o_(e)}function u_(e){try{Jz(),e()}finally{Xz(),RS()}}function Zo(e){let t;return u_(()=>{t=e()}),t}var xm=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Lu=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),Sa=(e,t,s=!0)=>{const a={...e.router.options.context??{}},o=s?t:t-1;for(let c=0;c<=o;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},Nx=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,a=e.matches.findIndex(d=>d.routeId===e.router.routeTree.id),o=a>=0?a:0;let c=s?e.matches.findIndex(d=>d.routeId===s):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=o);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:o},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},TS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},Cx=(e,t,s)=>{const a=Sa(e,s);e.updateMatch(t,o=>({...o,context:a}))},Po=(e,t,s,a)=>{const{id:o,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(o),s);try{d.options.onError?.(s)}catch(f){s=f,Ri(e,e.router.getMatch(o),s)}e.updateMatch(o,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)},OS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const o=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Lu(e,t)&&(s.options.loader||s.options.beforeLoad||LS(s))&&typeof o=="number"&&o!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{xm(e)},o);a._nonReactive.pendingTimeout=c}},d_=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;OS(e,t,s,a);const o=()=>{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(o):o()},f_=(e,t,s,a)=>{const o=e.router.getMatch(t);let c=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Ar(()=>{c?.resolve(),c=void 0});const{paramsError:d,searchError:f}=o;d&&Po(e,s,d,"PARSE_PARAMS"),f&&Po(e,s,f,"VALIDATE_SEARCH"),OS(e,t,a,o);const m=new AbortController;let p=!1;const v=()=>{p||(p=!0,e.updateMatch(t,z=>({...z,isFetching:"beforeLoad",fetchCount:z.fetchCount+1,abortController:m})))},y=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,z=>({...z,isFetching:!1}))};if(!a.options.beforeLoad){Zo(()=>{v(),y()});return}o._nonReactive.beforeLoadPromise=Ar();const x={...Sa(e,s,!1),...o.__routeContext},{search:b,params:N,cause:S}=o,C=Lu(e,t),k={search:b,abortController:m,params:N,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){Zo(()=>{v(),y()});return}(Sn(z)||fn(z))&&(v(),Po(e,s,z,"BEFORE_LOAD")),Zo(()=>{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)},h_=(e,t)=>{const{id:s,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a],c=()=>f(),d=()=>f_(e,s,t,o),f=()=>{if(TS(e,s))return;const m=d_(e,s,o);return Wo(m)?m.then(d):d()};return c()},m_=(e,t,s)=>{const a=e.router.getMatch(t);if(!a||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([s.options.head?.(o),s.options.scripts?.(o),s.options.headers?.(o)]).then(([c,d,f])=>({meta:c?.meta,links:c?.links,headScripts:c?.scripts,headers:f,scripts:d,styles:c?.styles}))},DS=(e,t,s,a,o)=>{const c=t[a-1],{params:d,loaderDeps:f,abortController:m,cause:p}=e.router.getMatch(s),v=Sa(e,a),y=Lu(e,s);return{params:d,deps:f,preload:!!y,parentMatchPromise:c,abortController:m,context:v,location:e.location,navigate:x=>e.router.navigate({...x,_fromLocation:e.location}),cause:y?"preload":p,route:o,...e.router.options.additionalContext}},kx=async(e,t,s,a,o)=>{try{const c=e.router.getMatch(s);try{(!(fz??e.router.isServer)||c.ssr===!0)&&el(o);const d=o.options.loader,f=typeof d=="function"?d:d?.handler,m=f?.(DS(e,t,s,a,o)),p=!!f&&Wo(m);if((p||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(s,y=>({...y,isFetching:"loader"})),f){const y=p?await m:m;Ri(e,e.router.getMatch(s),y),y!==void 0&&e.updateMatch(s,x=>({...x,loaderData:y}))}o._lazyPromise&&await o._lazyPromise;const v=c._nonReactive.minPendingPromise;v&&await v,o._componentsPromise&&await o._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,p=>({...p,status:p.status==="pending"?"success":p.status,isFetching:!1,context:Sa(e,a)}));return}const m=c._nonReactive.minPendingPromise;m&&await m,fn(d)&&await o.options.notFoundComponent?.preload?.(),Ri(e,e.router.getMatch(s),d);try{o.options.onError?.(d)}catch(p){f=p,Ri(e,e.router.getMatch(s),p)}!Sn(f)&&!fn(f)&&await el(o,["errorComponent"]),e.updateMatch(s,p=>({...p,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)}},p_=async(e,t,s)=>{async function a(b,N,S,C,k){const E=Date.now()-N.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(DS(e,t,o,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 kx(e,t,o,s,k);const P=e.router.getMatch(o);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 kx(e,t,o,s,k):Cx(e,o,s))}const{id:o,routeId:c}=e.matches[s];let d=!1,f=!1;const m=e.router.looseRoutesById[c],p=m.options.loader,v=((typeof p=="function"?void 0:p?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(TS(e,o)){if(!e.router.getMatch(o))return e.matches[s];Cx(e,o,s)}else{const b=e.router.getMatch(o),N=e.router.state.matches[s]?.routeId===c?e.router.state.matches[s].id:e.router.state.matches.find(C=>C.routeId===c)?.id,S=Lu(e,o);if(b._nonReactive.loaderPromise){if(b.status==="success"&&!e.sync&&!b.preload&&v)return b;await b._nonReactive.loaderPromise;const C=e.router.getMatch(o),k=C._nonReactive.error||C.error;k&&Ri(e,C,k),C.status==="pending"&&await a(S,b,N,C,m)}else{const C=S&&!e.router.state.matches.some(E=>E.id===o),k=e.router.getMatch(o);k._nonReactive.loaderPromise=Ar(),C!==k.preload&&e.updateMatch(o,E=>({...E,preload:C})),await a(S,b,N,k,m)}}const y=e.router.getMatch(o);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(o,b=>({...b,isFetching:x,invalid:!1})),e.router.getMatch(o)):y};async function zx(e){const t=e,s=[];t.router.state.matches.some(x=>x._forcePending)&&xm(t);let a;for(let x=0;x<t.matches.length;x++){try{const b=h_(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 o=t.firstBadMatchIndex??t.matches.length,c=a&&!t.preload?Nx(t,a):void 0,d=a&&t.preload?0:c!==void 0?Math.min(c+1,o):o;let f,m;for(let x=0;x<d;x++)s.push(p_(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 N=b.reason;if(Sn(N))throw N;fn(N)?f??=N:m??=N}if(m!==void 0)throw m}const p=f??(a&&!t.preload?a:void 0);let v=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!p&&a&&t.preload)return t.matches;if(p){const x=Nx(t,p);$i(x!==void 0);const b=t.matches[x],N=t.router.looseRoutesById[b.routeId],S=t.router.options?.defaultNotFoundComponent;!N.options.notFoundComponent&&S&&(N.options.notFoundComponent=S),p.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:p},isFetching:!1})),v=x,await el(N,["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:N}=t.matches[x],S=t.router.looseRoutesById[N];try{const C=m_(t,b,S);if(C){const k=await C;t.updateMatch(b,E=>({...E,...k}))}}catch(C){console.error(`Error executing head for route ${N}:`,C)}}const y=xm(t);if(Wo(y)&&await y,p)throw p;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function _x(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=su){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:o,...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=_x(e,su);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():_x(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function LS(e){for(const t of su)if(e.options[t]?.preload)return!0;return!1}var su=["component","errorComponent","pendingComponent","notFoundComponent"],Li="__TSR_index",Ex="popstate",Rx="beforeunload";function g_(e){let t=e.getLocation();const s=new Set,a=d=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:d}))},o=d=>{e.notifyOnIndexChange??!0?a(d):t=e.getLocation()},c=async({task:d,navigateOpts:f,...m})=>{if(f?.ignoreBlocker??!1){d();return}const p=e.getBlockers?.()??[],v=m.type==="PUSH"||m.type==="REPLACE";if(typeof document<"u"&&p.length&&v)for(const y of p){const x=xu(m.path,m.state);if(await y.blockerFn({currentLocation:t,nextLocation:x,action:m.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,m)=>{const p=t.state[Li];f=Ax(p+1,f),c({task:()=>{e.pushState(d,f),a({type:"PUSH"})},navigateOpts:m,type:"PUSH",path:d,state:f})},replace:(d,f,m)=>{const p=t.state[Li];f=Ax(p,f),c({task:()=>{e.replaceState(d,f),a({type:"REPLACE"})},navigateOpts:m,type:"REPLACE",path:d,state:f})},go:(d,f)=>{c({task:()=>{e.go(d),o({type:"GO",index:d})},navigateOpts:f,type:"GO"})},back:d=>{c({task:()=>{e.back(d?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:d,type:"BACK"})},forward:d=>{c({task:()=>{e.forward(d?.ignoreBlocker??!1),o({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 m=e.getBlockers?.()??[];e.setBlockers?.(m.filter(p=>p!==d))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function Ax(e,t){t||(t={});const s=up();return{...t,key:s,__TSR_key:s,[Li]:e}}function y_(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,a=t.history.replaceState;let o=[];const c=()=>o,d=T=>o=T,f=(T=>T),m=(()=>xu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const T=up();t.history.replaceState({[Li]:0,key:T,__TSR_key:T},"")}let p=m(),v,y=!1,x=!1,b=!1,N=!1;const S=()=>p;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,X)=>{const Q=f(P);k||(v=p),p=xu(P,X),C={href:Q,state:X,isPush:C?.isPush||T==="push"},k||(k=Promise.resolve().then(()=>E()))},z=T=>{p=m(),A.notify({type:T})},L=async()=>{if(x){x=!1;return}const T=m(),P=T.state[Li]-p.state[Li],X=P===1,Q=P===-1,se=!X&&!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 Se=c();if(typeof document<"u"&&Se.length){for(const B of Se)if(await B.blockerFn({currentLocation:p,nextLocation:T,action:pe})){x=!0,t.history.go(1),A.notify(ke);return}}}p=m(),A.notify(ke)},M=T=>{if(N){N=!1;return}let P=!1;const X=c();if(typeof document<"u"&&X.length)for(const Q of X){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=g_({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),N=!0,t.history.back()),forward:T=>{T&&(b=!0),N=!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(Rx,M,{capture:!0}),t.removeEventListener(Ex,L)},onBlocked:()=>{v&&p!==v&&(p=v)},getBlockers:c,setBlockers:d,notifyOnIndexChange:!1});return t.addEventListener(Rx,M,{capture:!0}),t.addEventListener(Ex,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 v_(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function xu(e,t){const s=v_(e),a=s.indexOf("#"),o=s.indexOf("?"),c=up();return{href:s,pathname:s.substring(0,a>0?o>0?Math.min(a,o):a:o>0?o:s.length),hash:a>-1?s.substring(a):"",search:o>-1?s.slice(o,a===-1?void 0:a):"",state:t||{[Li]:0,key:c,__TSR_key:c}}}function up(){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 x_(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var b_=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??"/",o=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=Tz(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=y_()),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 p;this.resolvePathCache=pu(1e3),p=this.buildRouteTree(),this.setRoutes(p)}!this.__store&&this.latestLocation&&(this.__store=c_(j_(this.latestLocation)),Pz(this));let d=!1;const f=this.options.basepath??"/",m=this.options.rewrite;if(o||a!==f||c!==m){this.basepath=f;const p=[],v=CS(f);v&&v!=="/"&&p.push(Vz({basepath:f})),m&&p.push(m),this.rewrite=p.length===0?void 0:p.length===1?p[0]:Zz(p),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&this.__store.setState(p=>({...p,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=kz(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&Sz(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:m,hash:p,href:v,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const C=this.options.parseSearch(m),k=this.options.stringifySearch(C);return{href:f+k+p,publicHref:v,pathname:Uo(f).path,external:!1,searchStr:k,search:ca(s?.search,C),hash:Uo(p.slice(1)).path,state:ma(s?.state,y)}}const x=new URL(v,this.origin),b=gm(this.rewrite,x),N=this.options.parseSearch(b.search),S=this.options.stringifySearch(N);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,N),hash:Uo(b.hash.slice(1)).path,state:ma(s?.state,y)}},o=a(t),{__tempLocation:c,__tempKey:d}=o.state;if(c&&(!d||d===this.tempLocationKey)){const f=a(c);return f.state.key=o.state.key,f.state.__TSR_key=o.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:o}}return o},this.resolvePathWithBase=(t,s)=>Az({base:t,to:rp(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=>w_({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=(o={})=>{const c=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(c);o.from;const f=o.unsafeRelative==="path"?c.pathname:o.from??d.fullPath,m=this.resolvePathWithBase(f,"."),p=d.search,v=Object.assign(Object.create(null),d.params),y=o.to?this.resolvePathWithBase(m,`${o.to}`):this.resolvePathWithBase(m,"."),x=o.params===!1||o.params===null?Object.create(null):(o.params??!0)===!0?v:Object.assign(v,Ei(o.params,v)),b=this.getMatchedRoutes(y);let N=b.matchedRoutes;if((!b.foundRoute||b.foundRoute.path!=="/"&&b.routeParams["**"])&&this.options.notFoundRoute&&(N=[...N,this.options.notFoundRoute]),Object.keys(x).length>0)for(const P of N){const X=P.options.params?.stringify??P.options.stringifyParams;if(X)try{Object.assign(x,X(x))}catch{}}const S=t.leaveParams?y:Uo(bx({path:y,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=p;if(t._includeValidateSearch&&this.options.search?.strict){const P={};N.forEach(X=>{if(X.options.validateSearch)try{Object.assign(P,iu(X.options.validateSearch,{...P,...C}))}catch{}}),C=P}C=N_({search:C,dest:o,destRoutes:N,_includeValidateSearch:t._includeValidateSearch}),C=ca(p,C);const k=this.options.stringifySearch(C),E=o.hash===!0?c.hash:o.hash?Ei(o.hash,c.hash):void 0,R=E?`#${E}`:"";let z=o.state===!0?c.state:o.state?Ei(o.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),X=kS(this.rewrite,P);M=P.href.replace(P.origin,""),X.origin!==this.origin?(A=X.href,T=!0):A=X.pathname+X.search+X.hash}else M=vz(L),A=M;return{publicHref:A,href:M,pathname:S,search:C,searchStr:k,state:z,hash:E??"",external:T,unmaskOnReload:o.unmaskOnReload}},a=(o={},c)=>{const d=s(o);let f=c?s(c):void 0;if(!f){const m=Object.create(null);if(this.options.routeMasks){const p=jz(d.pathname,this.processedTree);if(p){Object.assign(m,p.rawParams);const{from:v,params:y,...x}=p.route,b=y===!1||y===null?Object.create(null):(y??!0)===!0?m:Object.assign(m,Ei(y,m));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 o=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(p=>{a.state[p]=this.latestLocation.state[p]});const m=xa(a.state,this.latestLocation.state);return f.forEach(p=>{delete a.state[p]}),m},c=Di(this.latestLocation.href)===Di(a.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Ar(()=>{d?.resolve(),d=void 0}),c&&o())this.load();else{let{maskedLocation:f,hashScrollIntoView:m,...p}=a;f&&(p={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](p.publicHref,p.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:o,ignoreBlocker:c,href:d,...f}={})=>{if(d){const v=this.history.location.state.__TSR_index,y=xu(d,{__TSR_index:t?v:v+1}),x=new URL(y.pathname,this.origin);f.to=gm(this.rewrite,x).pathname,f.search=this.options.parseSearch(y.search),f.hash=y.hash.slice(1)}const m=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=m;const p=this.commitLocation({...m,viewTransition:o,replace:t,resetScroll:s,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:t,reloadDocument:s,href:a,publicHref:o,...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 m=this.buildLocation({to:t,...c});a=a??m.publicHref,o=o??m.publicHref}const f=!d&&o?o:a;if(mu(f,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const m=this.history.getBlockers?.()??[];for(const p of m)if(p?.blockerFn&&await p.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(o=>o.id===a.id))}))},this.load=async t=>{let s,a,o;const c=this.state.resolvedLocation??this.state.location;for(o=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const m=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ja({resolvedLocation:p,location:m})}),this.emit({type:"onBeforeLoad",...ja({resolvedLocation:p,location:m})}),await zx({router:this,sync:t?.sync,forceStaleReload:c.href===m.href,matches:this.state.pendingMatches,location:m,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],y=[],x=[],b=[];Zo(()=>{this.__store.setState(N=>{const S=N.matches,C=N.pendingMatches||N.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)),{...N,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...N.cachedMatches,...v.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[x,"onEnter"],[b,"onStay"]].forEach(([N,S])=>{N.forEach(C=>{this.looseRoutesById[C.routeId].options[S]?.(C)})})})})}})}catch(m){Sn(m)?(s=m,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):fn(m)&&(a=m),this.__store.setState(p=>({...p,statusCode:s?s.status:a?404:p.matches.some(v=>v.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==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 o=this.latestLocation,c=this.state.resolvedLocation,d=typeof s.types=="function"?s.types(ja({resolvedLocation:c,location:o})):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(o=>o.id===t)?"pendingMatches":this.state.matches.some(o=>o.id===t)?"matches":this.state.cachedMatches.some(o=>o.id===t)?"cachedMatches":"";a&&(a==="cachedMatches"?this.__store.setState(o=>({...o,cachedMatches:x_(o.cachedMatches.map(c=>c.id===t?s(c):c))})):this.__store.setState(o=>({...o,[a]:o[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),o=this.getParsedLocationHref(a);t.options.href=o,t.headers.set("Location",o)}else if(s)try{const a=new URL(s);if(this.origin&&a.origin===this.origin){const o=a.pathname+a.search+a.hash;t.options.href=o,t.headers.set("Location",o)}}catch{}if(t.options.href&&!t.options._builtLocation&&mu(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(o=>!s(o))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=s=>{const a=this.looseRoutesById[s.routeId];if(!a.options.loader)return!0;const o=(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>=o};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 o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),c=new Set([...o,...this.state.cachedMatches.map(d=>d.id)]);Zo(()=>{a.forEach(d=>{c.has(d.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,d]}))})});try{return a=await zx({router:this,matches:a,location:s,preload:!0,updateMatch:(d,f)=>{o.has(d)?a=a.map(m=>m.id===d?f(m):m):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},o=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=wz(o.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,o.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??Gz,parseSearch:e.parseSearch??Hz,protocolAllowlist:e.protocolAllowlist??yz}),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:o,parsedParams:c}=s;let{matchedRoutes:d}=s,f=!1;(a?a.path!=="/"&&o["**"]:Di(e.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:f=!0);const m=f?k_(this.options.notFoundMode,d):void 0,p=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=p[y-1];let N,S,C;{const pe=b?.search??e.search,ke=b?._strictSearch??void 0;try{const Se=iu(x.options.validateSearch,{...pe})??void 0;N={...pe,...Se},S={...ke,...Se},C=void 0}catch(Se){let B=Se;if(Se instanceof bu||(B=new bu(Se.message,{cause:Se})),t?.throwOnError)throw B;N=pe,S={},C=B}}const k=x.options.loaderDeps?.({search:N})??"",E=k?JSON.stringify(k):"",{interpolatedPath:R,usedParams:z}=bx({path:x.fullPath,params:o,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{Tx(x,z,c,T)}catch(pe){if(fn(pe)||Sn(pe)?P=pe:P=new S_(pe.message,{cause:pe}),t?.throwOnError)throw P}Object.assign(o,T);const X=A?"stay":"enter";let Q;if(M)Q={...M,cause:X,params:A?.params??o,_strictParams:T,search:ca(A?A.search:M.search,N),_strictSearch:S};else{const pe=x.options.loader||x.options.beforeLoad||x.lazyFn||LS(x)?"pending":"success";Q={id:L,ssr:x.options.ssr,index:y,routeId:x.id,params:A?.params??o,_strictParams:T,pathname:R,updatedAt:Date.now(),search:A?ca(A.search,N):N,_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:X,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=m===x.id),Q.searchError=C;const se=this.getParentContext(b);Q.context={...se,...Q.__routeContext,...Q.__beforeLoadContext},p[y]=Q}for(let y=0;y<p.length;y++){const x=p[y],b=this.looseRoutesById[x.routeId],N=this.getMatch(x.id),S=v.get(x.routeId);if(x.params=S?ca(S.params,o):o,!N){const C=p[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:p,routeId:b.id};x.__routeContext=b.options.context(E)??void 0}x.context={...k,...x.__routeContext,...x.__beforeLoadContext}}}return p}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:s,parsedParams:a}=this.getMatchedRoutes(e.pathname),o=Xo(t),c={...e.search};for(const p of t)try{Object.assign(c,iu(p.options.validateSearch,c))}catch{}const d=Xo(this.state.matches),f=d&&d.routeId===o.id&&e.pathname===this.state.location.pathname;let m;if(f)m=d.params;else{const p=Object.assign(Object.create(null),s);for(const v of t)try{Tx(v,s,a??{},p)}catch{}m=p}return{matchedRoutes:t,fullPath:o.fullPath,search:c,params:m}}},bu=class extends Error{},S_=class extends Error{};function j_(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 bu("Async validation not supported");if(s.issues)throw new bu(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 w_({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),o=Di(e);let c,d;const f=Nz(o,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 N_({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return C_(s)(e,t,a??!1)}function C_(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const c=({search:d,next:f})=>{let m=d;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(m=o.options.preSearchFilters.reduce((v,y)=>y(v),d));const p=f(m);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((v,y)=>y(v),p):p};t.middlewares.push(c)}if(o.options.validateSearch){const c=({search:d,next:f})=>{const m=f(d);if(!t._includeValidateSearch)return m;try{return{...m,...iu(o.options.validateSearch,m)??void 0}}catch{return m}};t.middlewares.push(c)}}const s=({search:o})=>{const c=t.dest;return c.search?c.search===!0?o:Ei(c.search,o):{}};t.middlewares.push(s);const a=(o,c,d)=>{if(o>=d.length)return c;const f=d[o];return f({search:c,next:p=>a(o+1,p,d)})};return function(c,d,f){return t.dest=d,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function k_(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 Tx(e,t,s,a){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const c in t)c in s&&(a[c]=s[c]);else{const c=o(a);Object.assign(a,c)}}var z_="Error preloading route! ☝️",MS=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 o=a?ba:s?.path;o&&o!=="/"&&(o=NS(o));const c=s?.id||o;let d=a?ba:tu([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);o==="__root__"&&(o="/"),d!=="__root__"&&(d=tu(["/",d]));const f=d==="__root__"?"/":tu([this.parentRoute.fullPath,o]);this._path=o,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=>op({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.")}},__=class extends MS{constructor(e){super(e)}};function dp(e){const t=e.errorComponent??fp;return r.jsx(E_,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?w.createElement(t,{error:s,reset:a}):e.children})}var E_=class extends w.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 fp({error:e}){const[t,s]=w.useState(!1);return r.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[r.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),r.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"})]}),r.jsx("div",{style:{height:".25rem"}}),t?r.jsx("div",{children:r.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?r.jsx("code",{children:e.message}):null})}):null]})}function R_({children:e,fallback:t=null}){return US()?r.jsx(as.Fragment,{children:e}):r.jsx(as.Fragment,{children:t})}function US(){return as.useSyncExternalStore(A_,()=>!0,()=>!1)}function A_(){return()=>{}}var $S=w.createContext(null);function Zn(e){const t=w.useContext($S);return e?.warn,t}var Dh={exports:{}},Lh={},Mh={exports:{}},Uh={};var Ox;function T_(){if(Ox)return Uh;Ox=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,o=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(y,x){var b=x(),N=a({inst:{value:b,getSnapshot:x}}),S=N[0].inst,C=N[1];return c(function(){S.value=b,S.getSnapshot=x,m(S)&&C({inst:S})},[y,b,x]),o(function(){return m(S)&&C({inst:S}),y(function(){m(S)&&C({inst:S})})},[y]),d(b),b}function m(y){var x=y.getSnapshot;y=y.value;try{var b=x();return!s(y,b)}catch{return!0}}function p(y,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Uh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Uh}var Dx;function O_(){return Dx||(Dx=1,Mh.exports=T_()),Mh.exports}var Lx;function D_(){if(Lx)return Lh;Lx=1;var e=ol(),t=O_();function s(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var a=typeof Object.is=="function"?Object.is:s,o=t.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,m=e.useDebugValue;return Lh.useSyncExternalStoreWithSelector=function(p,v,y,x,b){var N=c(null);if(N.current===null){var S={hasValue:!1,value:null};N.current=S}else S=N.current;N=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=o(p,N[0],N[1]);return d(function(){S.hasValue=!0,S.value=C},[C]),m(C),C},Lh}var Mx;function L_(){return Mx||(Mx=1,Dh.exports=D_()),Dh.exports}var M_=L_();function U_(e,t){return e===t}function $_(e,t,s=U_){const a=w.useCallback(d=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(d);return f},[e]),o=w.useCallback(()=>e?.get(),[e]);return M_.useSyncExternalStoreWithSelector(a,o,o,t,s)}function jn(e){const t=Zn({warn:e?.router===void 0}),s=e?.router||t,a=w.useRef(void 0);return $_(s.__store,o=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const c=ma(a.current,e.select(o));return a.current=c,c}return e.select(o)}return o})}var Mu=w.createContext(void 0),P_=w.createContext(void 0);function Bi(e){const t=w.useContext(e.from?P_:Mu);return jn({select:s=>{const a=s.matches.find(o=>e.from?e.from===o.routeId:o.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 hp(e){return Bi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function mp(e){const{select:t,...s}=e;return Bi({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Uu(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 $u(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=Zn();return w.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function pp(e){return Bi({...e,select:t=>e.select?e.select(t.context):t.context})}var gp=iS();const I_=sS(gp);function B_(e,t){const s=Zn(),a=dz(t),{activeProps:o,inactiveProps:c,activeOptions:d,to:f,preload:m,preloadDelay:p,hashScrollIntoView:v,replace:y,startTransition:x,resetScroll:b,viewTransition:N,children:S,target:C,disabled:k,style:E,className:R,onClick:z,onBlur:L,onFocus:M,onMouseEnter:A,onMouseLeave:T,onTouchStart:P,ignoreBlocker:X,params:Q,search:se,hash:pe,state:ke,mask:Se,reloadDocument:B,unsafeRelative:q,from:ce,_fromLocation:H,...J}=e,O=US(),F=jn({select:_e=>{const Ue=_e.matches[_e.matches.length-1];return{search:Ue?.search,hash:_e.location.hash,path:Ue?.pathname}},structuralSharing:!0}),ie=e.from,re=w.useMemo(()=>({...e,from:ie}),[s,F,ie,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ue=w.useMemo(()=>s.buildLocation({...re}),[s,re]),de=ue.maskedLocation?ue.maskedLocation.publicHref:ue.publicHref,fe=ue.maskedLocation?ue.maskedLocation.external:ue.external,Ae=w.useMemo(()=>Z_(de,fe,s.history,k),[k,fe,de,s.history]),ye=w.useMemo(()=>{if(Ae?.external)return mu(Ae.href,s.protocolAllowlist)?void 0:Ae.href;if(!V_(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),mu(f,s.protocolAllowlist)?void 0:f}catch{}},[f,Ae,s.protocolAllowlist]),Ke=jn({select:_e=>{if(ye)return!1;if(d?.exact){if(!Rz(_e.location.pathname,ue.pathname,s.basepath))return!1}else{const Ue=gu(_e.location.pathname,s.basepath),pt=gu(ue.pathname,s.basepath);if(!(Ue.startsWith(pt)&&(Ue.length===pt.length||Ue[pt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!xa(_e.location.search,ue.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?O&&_e.location.hash===ue.hash:!0}}),We=Ke?Ei(o,{})??q_:$h,me=Ke?$h:Ei(c,{})??$h,et=[R,We.className,me.className].filter(Boolean).join(" "),dt=(E||We.style||me.style)&&{...E,...We.style,...me.style},[sn,kt]=w.useState(!1),an=w.useRef(!1),Vt=e.reloadDocument||ye?!1:m??s.options.defaultPreload,zt=p??s.options.defaultPreloadDelay??0,_t=w.useCallback(()=>{s.preloadRoute({...re,_builtLocation:ue}).catch(_e=>{console.warn(_e),console.warn(z_)})},[s,re,ue]);uz(a,w.useCallback(_e=>{_e?.isIntersecting&&_t()},[_t]),K_,{disabled:!!k||Vt!=="viewport"}),w.useEffect(()=>{an.current||!k&&Vt==="render"&&(_t(),an.current=!0)},[k,_t,Vt]);const mn=_e=>{const Ue=_e.currentTarget.getAttribute("target"),pt=C!==void 0?C:Ue;if(!k&&!Q_(_e)&&!_e.defaultPrevented&&(!pt||pt==="_self")&&_e.button===0){_e.preventDefault(),gp.flushSync(()=>{kt(!0)});const rn=s.subscribe("onResolved",()=>{rn(),kt(!1)});s.navigate({...re,replace:y,resetScroll:b,hashScrollIntoView:v,startTransition:x,viewTransition:N,ignoreBlocker:X})}};if(ye)return{...J,ref:a,href:ye,...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=_e=>{if(k||Vt!=="intent")return;if(!zt){_t();return}const Ue=_e.currentTarget;if(Io.has(Ue))return;const pt=setTimeout(()=>{Io.delete(Ue),_t()},zt);Io.set(Ue,pt)},Be=_e=>{k||Vt!=="intent"||_t()},qe=_e=>{if(k||!Vt||!zt)return;const Ue=_e.currentTarget,pt=Io.get(Ue);pt&&(clearTimeout(pt),Io.delete(Ue))};return{...J,...We,...me,href:Ae?.href,ref:a,onClick:pr([z,mn]),onBlur:pr([L,qe]),onFocus:pr([M,le]),onMouseEnter:pr([A,le]),onMouseLeave:pr([T,qe]),onTouchStart:pr([P,Be]),disabled:!!k,target:C,...dt&&{style:dt},...et&&{className:et},...k&&H_,...Ke&&G_,...O&&sn&&F_}}var $h={},q_={className:"active"},H_={role:"link","aria-disabled":!0},G_={"data-status":"active","aria-current":"page"},F_={"data-transitioning":"transitioning"},Io=new WeakMap,K_={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 V_(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var yt=w.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:o,...c}=B_(a,t),d=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!s){const{disabled:f,...m}=c;return w.createElement("a",m,d)}return w.createElement(s,c,d)});function Q_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Y_=class extends MS{constructor(e){super(e),this.useMatch=t=>Bi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>pp({...t,from:this.id}),this.useSearch=t=>$u({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Uu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>mp({...t,from:this.id}),this.useLoaderData=t=>hp({...t,from:this.id}),this.useNavigate=()=>ka({from:this.fullPath}),this.Link=as.forwardRef((t,s)=>r.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Vn(e){return new Y_(e)}function J_(){return e=>W_(e)}var X_=class extends __{constructor(e){super(e),this.useMatch=t=>Bi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>pp({...t,from:this.id}),this.useSearch=t=>$u({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Uu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>mp({...t,from:this.id}),this.useLoaderData=t=>hp({...t,from:this.id}),this.useNavigate=()=>ka({from:this.fullPath}),this.Link=as.forwardRef((t,s)=>r.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function W_(e){return new X_(e)}function Ux(e){return typeof e=="object"?new $x(e,{silent:!0}).createRoute(e):new $x(e,{silent:!0}).createRoute}var $x=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=Vn(s);return a.isRoot=!1,a},this.silent=t?.silent}},Px=class{constructor(e){this.useMatch=t=>Bi({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>pp({...t,from:this.options.id}),this.useSearch=t=>$u({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Uu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>mp({...t,from:this.options.id}),this.useLoaderData=t=>hp({...t,from:this.options.id}),this.useNavigate=()=>ka({from:Zn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Ix(e){return typeof e=="object"?new Px(e):t=>new Px({id:e,...t})}function e2(e){const t=jn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return r.jsx(dp,{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 t2(){return r.jsx("p",{children:"Not Found"})}function Sr(e){return r.jsx(r.Fragment,{children:e.children})}function PS(e,t,s){return t.options.notFoundComponent?r.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?r.jsx(e.options.defaultNotFoundComponent,{...s}):r.jsx(t2,{})}function n2(){return Zn().isScrollRestoring,null}var IS=w.memo(function({matchId:t}){const s=Zn(),a=jn({select:N=>{const S=N.matches.findIndex(k=>k.id===t),C=N.matches[S];return $i(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:N.loadedAt,parentRouteId:N.matches[S-1]?.routeId}},structuralSharing:!0}),o=s.routesById[a.routeId],c=o.options.pendingComponent??s.options.defaultPendingComponent,d=c?r.jsx(c,{}):null,f=o.options.errorComponent??s.options.defaultErrorComponent,m=o.options.onCatch??s.options.defaultOnCatch,p=o.isRoot?o.options.notFoundComponent??s.options.notFoundRoute?.options.component:o.options.notFoundComponent,v=a.ssr===!1||a.ssr==="data-only",y=(!o.isRoot||o.options.wrapInSuspense||v)&&(o.options.wrapInSuspense??c??(o.options.errorComponent?.preload||v))?w.Suspense:Sr,x=f?dp:Sr,b=p?e2:Sr;return r.jsxs(o.isRoot?o.options.shellComponent??Sr:Sr,{children:[r.jsx(Mu.Provider,{value:t,children:r.jsx(y,{fallback:d,children:r.jsx(x,{getResetKey:()=>a.resetKey,errorComponent:f||fp,onCatch:(N,S)=>{if(fn(N))throw N;m?.(N,S)},children:r.jsx(b,{fallback:N=>{if(!p||N.routeId&&N.routeId!==a.routeId||!N.routeId&&!o.isRoot)throw N;return w.createElement(p,N)},children:v||a._displayPending?r.jsx(R_,{fallback:d,children:r.jsx(Bx,{matchId:t})}):r.jsx(Bx,{matchId:t})})})})}),a.parentRouteId===ba&&s.options.scrollRestoration?r.jsxs(r.Fragment,{children:[r.jsx(s2,{}),r.jsx(n2,{})]}):null]})});function s2(){const e=Zn(),t=w.useRef(void 0);return r.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 Bx=w.memo(function({matchId:t}){const s=Zn(),{match:a,key:o,routeId:c}=jn({select:m=>{const p=m.matches.find(x=>x.id===t),v=p.routeId,y=(s.routesById[v].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:v,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:p.id,status:p.status,error:p.error,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),d=s.routesById[c],f=w.useMemo(()=>{const m=d.options.component??s.options.defaultComponent;return m?r.jsx(m,{},o):r.jsx(yp,{})},[o,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 m=d.options.pendingMinMs??s.options.defaultPendingMinMs;if(m){const p=s.getMatch(a.id);if(p&&!p._nonReactive.minPendingPromise){const v=Ar();p._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),p._nonReactive.minPendingPromise=void 0},m)}}throw s.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return $i(fn(a.error)),PS(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}),yp=w.memo(function(){const t=Zn(),s=w.useContext(Mu),a=jn({select:p=>p.matches.find(v=>v.id===s)?.routeId}),o=t.routesById[a],c=jn({select:p=>{const v=p.matches.find(y=>y.id===s);return $i(v),v.globalNotFound}}),d=jn({select:p=>{const v=p.matches;return v[v.findIndex(y=>y.id===s)+1]?.id}}),f=t.options.defaultPendingComponent?r.jsx(t.options.defaultPendingComponent,{}):null;if(c)return PS(t,o,void 0);if(!d)return null;const m=r.jsx(IS,{matchId:d});return a===ba?r.jsx(w.Suspense,{fallback:f,children:m}):m});function i2(){const e=Zn(),t=w.useRef({router:e,mounted:!1}),[s,a]=w.useState(!1),{hasPendingMatches:o,isLoading:c}=jn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(x=>x.status==="pending")}),structuralSharing:!0}),d=_h(c),f=c||s||o,m=_h(f),p=c||o,v=_h(p);return e.startTransition=y=>{a(!0),w.startTransition(()=>{y(),a(!1)})},w.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&&!p&&e.emit({type:"onBeforeRouteMount",...ja(e.state)})},[p,v,e]),Dc(()=>{if(m&&!f){const y=ja(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(x=>({...x,status:"idle",resolvedLocation:x.location})),y.hrefChanged&&Iz(e)}},[f,m,e]),null}function a2(){const e=Zn(),t=e.routesById[ba].options.pendingComponent??e.options.defaultPendingComponent,s=t?r.jsx(t,{}):null,a=r.jsxs(typeof document<"u"&&e.ssr?Sr:w.Suspense,{fallback:s,children:[r.jsx(i2,{}),r.jsx(r2,{})]});return e.options.InnerWrap?r.jsx(e.options.InnerWrap,{children:a}):a}function r2(){const e=Zn(),t=jn({select:o=>o.matches[0]?.id}),s=jn({select:o=>o.loadedAt}),a=t?r.jsx(IS,{matchId:t}):null;return r.jsx(Mu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:r.jsx(dp,{getResetKey:()=>s,errorComponent:fp,onCatch:void 0,children:a})})}var o2=e=>new l2(e),l2=class extends b_{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Ux,globalThis.createLazyFileRoute=Ix):typeof window<"u"&&(window.createFileRoute=Ux,window.createLazyFileRoute=Ix);function c2({router:e,children:t,...s}){Object.keys(s).length>0&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const a=r.jsx($S.Provider,{value:e,children:t});return e.options.Wrap?r.jsx(e.options.Wrap,{children:a}):a}function u2({router:e,...t}){return r.jsx(c2,{router:e,...t,children:r.jsx(a2,{})})}function d2(e){return jn({select:t=>t.location})}class Su extends Error{code;statusCode;constructor(t,s,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=s}}function f2(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const h2=f2();function m2(){return""}function bm(){return!!m2()}async function ge(e,t){const s=await fetch(`${h2}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{"Content-Type":"application/json",...t?.headers}});if(!s.ok){const a=await s.text();let o=`API ${s.status}: ${s.statusText}`,c;if(a)try{const d=JSON.parse(a);typeof d.error=="string"?o=d.error:d.error?.message?(o=d.error.message,c=d.error.code):d.message&&(o=d.message)}catch{o=a}throw new Su(o,s.status,c)}if(s.status!==204)return s.json()}function BS(){return ge("/projects")}function vp(e){return ge(`/projects/${encodeURIComponent(e)}`)}function qS(){return ge("/runs")}function Tr(e){return ge(`/runs/${encodeURIComponent(e)}`)}function HS(e){return ge(`/projects/${encodeURIComponent(e)}/keywords`)}function xp(e){return ge(`/projects/${encodeURIComponent(e)}/competitors`)}function bp(e,t){const s=new URLSearchParams;t!==void 0&&s.set("location",t);const a=s.toString();return ge(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function ll(e,t){return ge(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function GS(e,t){return ge(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function FS(e,t){return ge(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function Sp(e,t){return ge(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function Sm(e,t){const s=await vp(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 KS(e,t){const s=await vp(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 jp(e,t){const s={};return ge(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function ZS(e,t){return ge(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function VS(e,t){await ge(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function QS(e,t){return ge(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function YS(e){await ge(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function JS(e){return ge(`/projects/${encodeURIComponent(e)}/export`)}function Pu(){return ge("/settings")}function XS(){return ge("/session")}function WS(e){return ge("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function ej(e){return ge("/session",{method:"POST",body:JSON.stringify({password:e})})}function tj(e,t){return ge(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function nj(e){return ge("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function sj(e){try{return await ge(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function jm(e,t){return ge(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function ij(e){await ge(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function aj(e){return ge(`/projects/${encodeURIComponent(e)}/notifications`)}function rj(e,t){return ge(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function oj(e,t){await ge(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function lj(e,t){return ge(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function cj(e,t,s){return ge(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function uj(e){return ge("/apply",{method:"POST",body:JSON.stringify(e)})}function p2(e){return ge("/runs",{method:"POST",body:JSON.stringify(e??{})})}function wp(e){return ge(`/projects/${encodeURIComponent(e)}/google/connections`)}function dj(e,t){return ge(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function fj(e,t){return ge(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function hj(e){return ge(`/projects/${encodeURIComponent(e)}/google/properties`)}function mj(e,t,s){return ge(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function pj(e,t,s){return ge(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function Np(e,t){return ge(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function gj(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 ge(`/projects/${encodeURIComponent(e)}/google/gsc/performance${a}`)}function yj(e,t){return ge(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function vj(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 ge(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${a}`)}function xj(e){return ge(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Iu(e){return ge(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function bj(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return ge(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function Sj(e,t){return ge(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function jj(e){return ge(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function wj(e){return ge(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function wm(){return ge("/cdp/status")}function Nj(e,t){return ge("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function Nm(e,t){return ge(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function Cp(e){return ge(`/projects/${encodeURIComponent(e)}/bing/status`)}function Cj(e,t){return ge(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function kj(e){return ge(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function zj(e){return ge(`/projects/${encodeURIComponent(e)}/bing/sites`)}function _j(e,t){return ge(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Bu(e){return ge(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function kp(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return ge(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function zp(e,t){return ge(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function Cm(e,t){return ge(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function Ej(e){return ge(`/projects/${encodeURIComponent(e)}/bing/performance`)}function Rj(e){return ge("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function Aj(e,t){const s=t?`?window=${t}`:"";return ge(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function Tj(e,t){const s=t?`?window=${t}`:"";return ge(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function Oj(e,t){const s=t?`?window=${t}`:"";return ge(`/projects/${encodeURIComponent(e)}/analytics/sources${s}`)}function km(e){return ge(`/projects/${encodeURIComponent(e)}/ga/status`)}function zm(e,t){return ge(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function _p(e,t){return ge(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function Dj(e,t){return ge(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function Lj(e){return ge(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}async function Mj(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(),o=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=[o,c===!1?"database not configured":"database configured",d?`heartbeat ${d}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:o,databaseConfigured:c,lastHeartbeatAt:d}}catch(s){return{label:t,state:"error",detail:s instanceof Error?s.message:"unreachable"}}}const g2=Object.freeze(Object.defineProperty({__proto__:null,ApiError:Su,addLocation:ZS,addNotification:rj,appendKeywords:FS,applyProjectConfig:uj,bingConnect:Cj,bingDisconnect:kj,bingRequestIndexing:Cm,bingSetSite:_j,configureCdp:Nj,connectGa:Dj,createProject:ll,deleteProject:YS,disconnectGa:Lj,fetchAllRuns:qS,fetchAnalyticsGaps:Tj,fetchAnalyticsMetrics:Aj,fetchAnalyticsSources:Oj,fetchBingCoverage:Bu,fetchBingInspections:kp,fetchBingPerformance:Ej,fetchBingSites:zj,fetchBingStatus:Cp,fetchCdpStatus:wm,fetchCompetitors:xp,fetchExport:JS,fetchGaStatus:km,fetchGaTraffic:zm,fetchGoogleConnections:wp,fetchGoogleProperties:hj,fetchGscCoverage:Iu,fetchGscCoverageHistory:bj,fetchGscDeindexed:xj,fetchGscInspections:vj,fetchGscPerformance:gj,fetchGscSitemaps:jj,fetchKeywords:HS,fetchProject:vp,fetchProjects:BS,fetchRunDetail:Tr,fetchSchedule:sj,fetchServiceStatus:Mj,fetchSession:XS,fetchSettings:Pu,fetchTimeline:bp,generateKeywords:cj,googleConnect:dj,googleDisconnect:fj,hasExplicitBrowserApiKey:bm,inspectBingUrl:zp,inspectGscUrl:yj,listNotifications:aj,loginWithPassword:ej,removeLocation:VS,removeNotification:oj,removeSchedule:ij,requestIndexing:Nm,saveGoogleProperty:mj,saveSchedule:jm,saveSitemapUrl:pj,sendTestNotification:lj,setCompetitors:Sp,setDefaultLocation:QS,setKeywords:GS,setupDashboardPassword:WS,triggerAllRuns:p2,triggerDiscoverSitemaps:wj,triggerGaSync:_p,triggerGscSync:Np,triggerInspectSitemap:Sj,triggerRun:jp,updateBingApiKey:Rj,updateGoogleAuthConfig:nj,updateOwnedDomains:Sm,updateProject:KS,updateProviderConfig:tj},Symbol.toStringTag,{value:"Module"}));let Ai=[],y2=0;const _m=new Set;function Uj(){const e=[...Ai];for(const t of _m)t(e)}function v2(e,t="negative",s=6e3){const a=String(++y2),o={id:a,message:e,tone:t,expiresAt:Date.now()+s};return Ai=[...Ai,o],Uj(),setTimeout(()=>{$j(a)},s),a}function $j(e){const t=Ai.length;Ai=Ai.filter(s=>s.id!==e),Ai.length!==t&&Uj()}function x2(e){return _m.add(e),()=>{_m.delete(e)}}function qx(){return Ai}function b2(){return new sz({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new fS({onError:e=>{v2(e instanceof Error?e.message:"An unexpected error occurred","negative")}})})}const S2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),Hx=e=>{const t=j2(e);return t.charAt(0).toUpperCase()+t.slice(1)},Pj=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),w2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var N2={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 C2=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:o="",children:c,iconNode:d,...f},m)=>w.createElement("svg",{ref:m,...N2,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:Pj("lucide",o),...!c&&!w2(f)&&{"aria-hidden":"true"},...f},[...d.map(([p,v])=>w.createElement(p,v)),...Array.isArray(c)?c:[c]]));const en=(e,t)=>{const s=w.forwardRef(({className:a,...o},c)=>w.createElement(C2,{ref:c,iconNode:t,className:Pj(`lucide-${S2(Hx(e))}`,`lucide-${e}`,a),...o}));return s.displayName=Hx(e),s};const k2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qu=en("chevron-right",k2);const z2=[["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"}]],_2=en("download",z2);const E2=[["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"}]],R2=en("github",E2);const A2=[["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"}]],T2=en("globe",A2);const O2=[["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"}]],D2=en("layout-dashboard",O2);const L2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],M2=en("menu",L2);const U2=[["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"}]],$2=en("play",U2);const P2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Gx=en("plus",P2);const I2=[["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"}]],Fx=en("refresh-cw",I2);const B2=[["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"}]],q2=en("rocket",B2);const H2=[["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"}]],G2=en("rotate-ccw",H2);const F2=[["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"}]],K2=en("settings",F2);const Z2=[["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"}]],V2=en("trash-2",Z2);const Q2=[["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"}]],Y2=en("triangle-alert",Q2);const J2=[["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"}]],X2=en("unplug",J2);const W2=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],eE=en("upload",W2);const tE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hu=en("x",tE);function nE(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const s=t[1],a=t[2],o=a.indexOf("{");if(o>=0){const c=a.slice(0,o).trim(),d=a.slice(o);try{const f=JSON.parse(d);return`${s} ${c}
|
|
10
|
+
|
|
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 Gu(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function is(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Kx(e){return e===null?"Unknown":e?"Pass":"Fail"}function Em(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function sE(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function iE(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 aE(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 o=e.match(/^daily(?:@(\d+))?$/);if(o){const d=o[1]?parseInt(o[1]):6;return`Every day at ${Em(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 ${Em(f)} · ${a}`}return`${e} · ${a}`}function Zx(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ep(...e){return t=>{let s=!1;const a=e.map(o=>{const c=Zx(o,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let o=0;o<a.length;o++){const c=a[o];typeof c=="function"?c():Zx(e[o],null)}}}}function za(...e){return w.useCallback(Ep(...e),e)}var rE=Symbol.for("react.lazy"),ju=Jm[" use ".trim().toString()];function oE(e){return typeof e=="object"&&e!==null&&"then"in e}function Ij(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===rE&&"_payload"in e&&oE(e._payload)}function lE(e){const t=uE(e),s=w.forwardRef((a,o)=>{let{children:c,...d}=a;Ij(c)&&typeof ju=="function"&&(c=ju(c._payload));const f=w.Children.toArray(c),m=f.find(fE);if(m){const p=m.props.children,v=f.map(y=>y===m?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:y);return r.jsx(t,{...d,ref:o,children:w.isValidElement(p)?w.cloneElement(p,void 0,v):null})}return r.jsx(t,{...d,ref:o,children:c})});return s.displayName=`${e}.Slot`,s}var cE=lE("Slot");function uE(e){const t=w.forwardRef((s,a)=>{let{children:o,...c}=s;if(Ij(o)&&typeof ju=="function"&&(o=ju(o._payload)),w.isValidElement(o)){const d=mE(o),f=hE(c,o.props);return o.type!==w.Fragment&&(f.ref=a?Ep(a,d):d),w.cloneElement(o,f)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dE=Symbol("radix.slottable");function fE(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dE}function hE(e,t){const s={...t};for(const a in t){const o=e[a],c=t[a];/^on[A-Z]/.test(a)?o&&c?s[a]=(...f)=>{const m=c(...f);return o(...f),m}:o&&(s[a]=o):a==="style"?s[a]={...o,...c}:a==="className"&&(s[a]=[o,c].filter(Boolean).join(" "))}return{...e,...s}}function mE(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 Bj(e){var t,s,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=Bj(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function qj(){for(var e,t,s=0,a="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=Bj(e))&&(a&&(a+=" "),a+=t);return a}const Vx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Qx=qj,Hj=(e,t)=>s=>{var a;if(t?.variants==null)return Qx(e,s?.class,s?.className);const{variants:o,defaultVariants:c}=t,d=Object.keys(o).map(p=>{const v=s?.[p],y=c?.[p];if(v===null)return null;const x=Vx(v)||Vx(y);return o[p][x]}),f=s&&Object.entries(s).reduce((p,v)=>{let[y,x]=v;return x===void 0||(p[y]=x),p},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((p,v)=>{let{class:y,className:x,...b}=v;return Object.entries(b).every(N=>{let[S,C]=N;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...p,y,x]:p},[]);return Qx(e,d,m,s?.class,s?.className)},pE=(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},gE=(e,t)=>({classGroupId:e,validator:t}),Gj=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),wu="-",Yx=[],yE="arbitrary..",vE=e=>{const t=bE(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return xE(d);const f=d.split(wu),m=f[0]===""&&f.length>1?1:0;return Fj(f,m,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const m=a[d],p=s[d];return m?p?pE(p,m):m:p||Yx}return s[d]||Yx}}},Fj=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const o=e[t],c=s.nextPart.get(o);if(c){const p=Fj(e,t+1,c);if(p)return p}const d=s.validators;if(d===null)return;const f=t===0?e.join(wu):e.slice(t).join(wu),m=d.length;for(let p=0;p<m;p++){const v=d[p];if(v.validator(f))return v.classGroupId}},xE=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?yE+a:void 0})(),bE=e=>{const{theme:t,classGroups:s}=e;return SE(s,t)},SE=(e,t)=>{const s=Gj();for(const a in e){const o=e[a];Rp(o,s,a,t)}return s},Rp=(e,t,s,a)=>{const o=e.length;for(let c=0;c<o;c++){const d=e[c];jE(d,t,s,a)}},jE=(e,t,s,a)=>{if(typeof e=="string"){wE(e,t,s);return}if(typeof e=="function"){NE(e,t,s,a);return}CE(e,t,s,a)},wE=(e,t,s)=>{const a=e===""?t:Kj(t,e);a.classGroupId=s},NE=(e,t,s,a)=>{if(kE(e)){Rp(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(gE(s,e))},CE=(e,t,s,a)=>{const o=Object.entries(e),c=o.length;for(let d=0;d<c;d++){const[f,m]=o[d];Rp(m,Kj(t,f),s,a)}},Kj=(e,t)=>{let s=e;const a=t.split(wu),o=a.length;for(let c=0;c<o;c++){const d=a[c];let f=s.nextPart.get(d);f||(f=Gj(),s.nextPart.set(d,f)),s=f}return s},kE=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,zE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),a=Object.create(null);const o=(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 o(c,d),d},set(c,d){c in s?s[c]=d:o(c,d)}}},Rm="!",Jx=":",_E=[],Xx=(e,t,s,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:o}),EE=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=o=>{const c=[];let d=0,f=0,m=0,p;const v=o.length;for(let S=0;S<v;S++){const C=o[S];if(d===0&&f===0){if(C===Jx){c.push(o.slice(m,S)),m=S+1;continue}if(C==="/"){p=S;continue}}C==="["?d++:C==="]"?d--:C==="("?f++:C===")"&&f--}const y=c.length===0?o:o.slice(m);let x=y,b=!1;y.endsWith(Rm)?(x=y.slice(0,-1),b=!0):y.startsWith(Rm)&&(x=y.slice(1),b=!0);const N=p&&p>m?p-m:void 0;return Xx(c,b,x,N)};if(t){const o=t+Jx,c=a;a=d=>d.startsWith(o)?c(d.slice(o.length)):Xx(_E,!1,d,void 0,!0)}if(s){const o=a;a=c=>s({className:c,parseClassName:o})}return a},RE=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,a)=>{t.set(s,1e6+a)}),s=>{const a=[];let o=[];for(let c=0;c<s.length;c++){const d=s[c],f=d[0]==="[",m=t.has(d);f||m?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(d)):o.push(d)}return o.length>0&&(o.sort(),a.push(...o)),a}},AE=e=>({cache:zE(e.cacheSize),parseClassName:EE(e),sortModifiers:RE(e),...vE(e)}),TE=/\s+/,OE=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:c}=t,d=[],f=e.trim().split(TE);let m="";for(let p=f.length-1;p>=0;p-=1){const v=f[p],{isExternal:y,modifiers:x,hasImportantModifier:b,baseClassName:N,maybePostfixModifierPosition:S}=s(v);if(y){m=v+(m.length>0?" "+m:m);continue}let C=!!S,k=a(C?N.substring(0,S):N);if(!k){if(!C){m=v+(m.length>0?" "+m:m);continue}if(k=a(N),!k){m=v+(m.length>0?" "+m:m);continue}C=!1}const E=x.length===0?"":x.length===1?x[0]:c(x).join(":"),R=b?E+Rm:E,z=R+k;if(d.indexOf(z)>-1)continue;d.push(z);const L=o(k,C);for(let M=0;M<L.length;++M){const A=L[M];d.push(R+A)}m=v+(m.length>0?" "+m:m)}return m},DE=(...e)=>{let t=0,s,a,o="";for(;t<e.length;)(s=e[t++])&&(a=Zj(s))&&(o&&(o+=" "),o+=a);return o},Zj=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=Zj(e[a]))&&(s&&(s+=" "),s+=t);return s},LE=(e,...t)=>{let s,a,o,c;const d=m=>{const p=t.reduce((v,y)=>y(v),e());return s=AE(p),a=s.cache.get,o=s.cache.set,c=f,f(m)},f=m=>{const p=a(m);if(p)return p;const v=OE(m,s);return o(m,v),v};return c=d,(...m)=>c(DE(...m))},ME=[],Kt=e=>{const t=s=>s[e]||ME;return t.isThemeGetter=!0,t},Vj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,UE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,$E=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PE=/\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$/,IE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,BE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ni=e=>UE.test(e),Le=e=>!!e&&!Number.isNaN(Number(e)),Ci=e=>!!e&&Number.isInteger(Number(e)),Ph=e=>e.endsWith("%")&&Le(e.slice(0,-1)),Hs=e=>$E.test(e),Yj=()=>!0,HE=e=>PE.test(e)&&!IE.test(e),Ap=()=>!1,GE=e=>BE.test(e),FE=e=>qE.test(e),KE=e=>!xe(e)&&!be(e),ZE=e=>qi(e,Wj,Ap),xe=e=>Vj.test(e),da=e=>qi(e,ew,HE),Wx=e=>qi(e,tR,Le),VE=e=>qi(e,nw,Yj),QE=e=>qi(e,tw,Ap),eb=e=>qi(e,Jj,Ap),YE=e=>qi(e,Xj,FE),Uc=e=>qi(e,sw,GE),be=e=>Qj.test(e),Bo=e=>_a(e,ew),JE=e=>_a(e,tw),tb=e=>_a(e,Jj),XE=e=>_a(e,Wj),WE=e=>_a(e,Xj),$c=e=>_a(e,sw,!0),eR=e=>_a(e,nw,!0),qi=(e,t,s)=>{const a=Vj.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},_a=(e,t,s=!1)=>{const a=Qj.exec(e);return a?a[1]?t(a[1]):s:!1},Jj=e=>e==="position"||e==="percentage",Xj=e=>e==="image"||e==="url",Wj=e=>e==="length"||e==="size"||e==="bg-size",ew=e=>e==="length",tR=e=>e==="number",tw=e=>e==="family-name",nw=e=>e==="number"||e==="weight",sw=e=>e==="shadow",nR=()=>{const e=Kt("color"),t=Kt("font"),s=Kt("text"),a=Kt("font-weight"),o=Kt("tracking"),c=Kt("leading"),d=Kt("breakpoint"),f=Kt("container"),m=Kt("spacing"),p=Kt("radius"),v=Kt("shadow"),y=Kt("inset-shadow"),x=Kt("text-shadow"),b=Kt("drop-shadow"),N=Kt("blur"),S=Kt("perspective"),C=Kt("aspect"),k=Kt("ease"),E=Kt("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,m],P=()=>[Ni,"full","auto",...T()],X=()=>[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"],Se=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...T()],q=()=>[Ni,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],ce=()=>[Ni,"screen","full","dvw","lvw","svw","min","max","fit",...T()],H=()=>[Ni,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],J=()=>[e,be,xe],O=()=>[...z(),tb,eb,{position:[be,xe]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",XE,ZE,{size:[be,xe]}],re=()=>[Ph,Bo,da],ue=()=>["","none","full",p,be,xe],de=()=>["",Le,Bo,da],fe=()=>["solid","dashed","dotted","double"],Ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[Le,Ph,tb,eb],Ke=()=>["","none",N,be,xe],We=()=>["none",Le,be,xe],me=()=>["none",Le,be,xe],et=()=>[Le,be,xe],dt=()=>[Ni,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hs],breakpoint:[Hs],color:[Yj],container:[Hs],"drop-shadow":[Hs],ease:["in","out","in-out"],font:[KE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hs],shadow:[Hs],spacing:["px",Le],text:[Hs],"text-shadow":[Hs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ni,xe,be,C]}],container:["container"],columns:[{columns:[Le,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:[Le,Ni,"auto","initial","none",xe]}],grow:[{grow:["",Le,be,xe]}],shrink:[{shrink:["",Le,be,xe]}],order:[{order:[Ci,"first","last","none",be,xe]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":X()}],"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":[...Se(),"normal"]}],"justify-self":[{"justify-self":["auto",...Se()]}],"align-content":[{content:["normal",...ke()]}],"align-items":[{items:[...Se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Se(),{baseline:["","last"]}]}],"place-content":[{"place-content":ke()}],"place-items":[{"place-items":[...Se(),"baseline"]}],"place-self":[{"place-self":["auto",...Se()]}],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:q()}],"inline-size":[{inline:["auto",...ce()]}],"min-inline-size":[{"min-inline":["auto",...ce()]}],"max-inline-size":[{"max-inline":["none",...ce()]}],"block-size":[{block:["auto",...H()]}],"min-block-size":[{"min-block":["auto",...H()]}],"max-block-size":[{"max-block":["none",...H()]}],w:[{w:[f,"screen",...q()]}],"min-w":[{"min-w":[f,"screen","none",...q()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",s,Bo,da]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,eR,VE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ph,xe]}],"font-family":[{font:[JE,QE,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:[o,be,xe]}],"line-clamp":[{"line-clamp":[Le,"none",be,Wx]}],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:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Le,"from-font","auto",be,da]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[Le,"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:F()}],"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]},WE,YE]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],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:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-bs":[{"border-bs":J()}],"border-color-be":[{"border-be":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Le,be,xe]}],"outline-w":[{outline:["",Le,Bo,da]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","none",v,$c,Uc]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",y,$c,Uc]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[Le,da]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",x,$c,Uc]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[Le,be,xe]}],"mix-blend":[{"mix-blend":[...Ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ae()}],"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":[Le]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":J()}],"mask-image-linear-to-color":[{"mask-linear-to":J()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":J()}],"mask-image-t-to-color":[{"mask-t-to":J()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":J()}],"mask-image-r-to-color":[{"mask-r-to":J()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":J()}],"mask-image-b-to-color":[{"mask-b-to":J()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":J()}],"mask-image-l-to-color":[{"mask-l-to":J()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":J()}],"mask-image-x-to-color":[{"mask-x-to":J()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"mask-image-radial":[{"mask-radial":[be,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":J()}],"mask-image-radial-to-color":[{"mask-radial-to":J()}],"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":[Le]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":J()}],"mask-image-conic-to-color":[{"mask-conic-to":J()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:F()}],"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:[Le,be,xe]}],contrast:[{contrast:[Le,be,xe]}],"drop-shadow":[{"drop-shadow":["","none",b,$c,Uc]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",Le,be,xe]}],"hue-rotate":[{"hue-rotate":[Le,be,xe]}],invert:[{invert:["",Le,be,xe]}],saturate:[{saturate:[Le,be,xe]}],sepia:[{sepia:["",Le,be,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",be,xe]}],"backdrop-blur":[{"backdrop-blur":Ke()}],"backdrop-brightness":[{"backdrop-brightness":[Le,be,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Le,be,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Le,be,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Le,be,xe]}],"backdrop-invert":[{"backdrop-invert":["",Le,be,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Le,be,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Le,be,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Le,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:[Le,"initial",be,xe]}],ease:[{ease:["linear","initial",k,be,xe]}],delay:[{delay:[Le,be,xe]}],animate:[{animate:["none",E,be,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,xe]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:We()}],"rotate-x":[{"rotate-x":We()}],"rotate-y":[{"rotate-y":We()}],"rotate-z":[{"rotate-z":We()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:et()}],"skew-x":[{"skew-x":et()}],"skew-y":[{"skew-y":et()}],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:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"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",...J()]}],"stroke-w":[{stroke:[Le,Bo,da,Wx]}],stroke:[{stroke:["none",...J()]}],"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"]}},sR=LE(nR);function Qn(...e){return sR(qj(e))}const iR=Hj("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"}}),oe=w.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,...o},c)=>{const d=a?cE:"button";return r.jsx(d,{ref:c,className:Qn(iR({variant:t,size:s,className:e})),...o})});oe.displayName="Button";const aR=Hj("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 iw({className:e,variant:t,...s}){return r.jsx("div",{className:Qn(aR({variant:t}),e),...s})}function nb({compact:e=!1}){return r.jsxs(yt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[r.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),r.jsxs("span",{className:"brand-copy",children:[r.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:r.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 r.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 Nu(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function aw(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 rR(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 oR(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function st({tone:e,children:t}){const s=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return r.jsx(iw,{variant:s,children:t})}function Fu({status:e}){return r.jsx(st,{tone:aw(e),children:Gu(e)})}function Mi(e,t,{checkForDefaultPrevented:s=!0}={}){return function(o){if(e?.(o),s===!1||!o.defaultPrevented)return t?.(o)}}function lR(e,t){const s=w.createContext(t),a=c=>{const{children:d,...f}=c,m=w.useMemo(()=>f,Object.values(f));return r.jsx(s.Provider,{value:m,children:d})};a.displayName=e+"Provider";function o(c){const d=w.useContext(s);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[a,o]}function cR(e,t=[]){let s=[];function a(c,d){const f=w.createContext(d),m=s.length;s=[...s,d];const p=y=>{const{scope:x,children:b,...N}=y,S=x?.[e]?.[m]||f,C=w.useMemo(()=>N,Object.values(N));return r.jsx(S.Provider,{value:C,children:b})};p.displayName=c+"Provider";function v(y,x){const b=x?.[e]?.[m]||f,N=w.useContext(b);if(N)return N;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[p,v]}const o=()=>{const c=s.map(d=>w.createContext(d));return function(f){const m=f?.[e]||c;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return o.scopeName=e,[a,uR(o,...t)]}function uR(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const a=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(c){const d=a.reduce((f,{useScope:m,scopeName:p})=>{const y=m(c)[`__scope${p}`];return{...f,...y}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}var nl=globalThis?.document?w.useLayoutEffect:()=>{},dR=Jm[" useId ".trim().toString()]||(()=>{}),fR=0;function Ih(e){const[t,s]=w.useState(dR());return nl(()=>{s(a=>a??String(fR++))},[e]),e||(t?`radix-${t}`:"")}var hR=Jm[" useInsertionEffect ".trim().toString()]||nl;function mR({prop:e,defaultProp:t,onChange:s=()=>{},caller:a}){const[o,c,d]=pR({defaultProp:t,onChange:s}),f=e!==void 0,m=f?e:o;{const v=w.useRef(e!==void 0);w.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 p=w.useCallback(v=>{if(f){const y=gR(v)?v(e):v;y!==e&&d.current?.(y)}else c(v)},[f,e,c,d]);return[m,p]}function pR({defaultProp:e,onChange:t}){const[s,a]=w.useState(e),o=w.useRef(s),c=w.useRef(t);return hR(()=>{c.current=t},[t]),w.useEffect(()=>{o.current!==s&&(c.current?.(s),o.current=s)},[s,o]),[s,a,c]}function gR(e){return typeof e=="function"}function rw(e){const t=yR(e),s=w.forwardRef((a,o)=>{const{children:c,...d}=a,f=w.Children.toArray(c),m=f.find(xR);if(m){const p=m.props.children,v=f.map(y=>y===m?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:y);return r.jsx(t,{...d,ref:o,children:w.isValidElement(p)?w.cloneElement(p,void 0,v):null})}return r.jsx(t,{...d,ref:o,children:c})});return s.displayName=`${e}.Slot`,s}function yR(e){const t=w.forwardRef((s,a)=>{const{children:o,...c}=s;if(w.isValidElement(o)){const d=SR(o),f=bR(c,o.props);return o.type!==w.Fragment&&(f.ref=a?Ep(a,d):d),w.cloneElement(o,f)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vR=Symbol("radix.slottable");function xR(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vR}function bR(e,t){const s={...t};for(const a in t){const o=e[a],c=t[a];/^on[A-Z]/.test(a)?o&&c?s[a]=(...f)=>{const m=c(...f);return o(...f),m}:o&&(s[a]=o):a==="style"?s[a]={...o,...c}:a==="className"&&(s[a]=[o,c].filter(Boolean).join(" "))}return{...e,...s}}function SR(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 jR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zs=jR.reduce((e,t)=>{const s=rw(`Primitive.${t}`),a=w.forwardRef((o,c)=>{const{asChild:d,...f}=o,m=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(m,{...f,ref:c})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function wR(e,t){e&&gp.flushSync(()=>e.dispatchEvent(t))}function sl(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...s)=>t.current?.(...s),[])}function NR(e,t=globalThis?.document){const s=sl(e);w.useEffect(()=>{const a=o=>{o.key==="Escape"&&s(o)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[s,t])}var CR="DismissableLayer",Am="dismissableLayer.update",kR="dismissableLayer.pointerDownOutside",zR="dismissableLayer.focusOutside",sb,ow=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lw=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...m}=e,p=w.useContext(ow),[v,y]=w.useState(null),x=v?.ownerDocument??globalThis?.document,[,b]=w.useState({}),N=za(t,A=>y(A)),S=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),E=v?S.indexOf(v):-1,R=p.layersWithOutsidePointerEventsDisabled.size>0,z=E>=k,L=RR(A=>{const T=A.target,P=[...p.branches].some(X=>X.contains(T));!z||P||(o?.(A),d?.(A),A.defaultPrevented||f?.())},x),M=AR(A=>{const T=A.target;[...p.branches].some(X=>X.contains(T))||(c?.(A),d?.(A),A.defaultPrevented||f?.())},x);return NR(A=>{E===p.layers.size-1&&(a?.(A),!A.defaultPrevented&&f&&(A.preventDefault(),f()))},x),w.useEffect(()=>{if(v)return s&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(sb=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),ib(),()=>{s&&p.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=sb)}},[v,x,s,p]),w.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),ib())},[v,p]),w.useEffect(()=>{const A=()=>b({});return document.addEventListener(Am,A),()=>document.removeEventListener(Am,A)},[]),r.jsx(Zs.div,{...m,ref:N,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)})});lw.displayName=CR;var _R="DismissableLayerBranch",ER=w.forwardRef((e,t)=>{const s=w.useContext(ow),a=w.useRef(null),o=za(t,a);return w.useEffect(()=>{const c=a.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),r.jsx(Zs.div,{...e,ref:o})});ER.displayName=_R;function RR(e,t=globalThis?.document){const s=sl(e),a=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let m=function(){cw(kR,s,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=m,t.addEventListener("click",o.current,{once:!0})):m()}else t.removeEventListener("click",o.current);a.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",c),t.removeEventListener("click",o.current)}},[t,s]),{onPointerDownCapture:()=>a.current=!0}}function AR(e,t=globalThis?.document){const s=sl(e),a=w.useRef(!1);return w.useEffect(()=>{const o=c=>{c.target&&!a.current&&cw(zR,s,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,s]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function ib(){const e=new CustomEvent(Am);document.dispatchEvent(e)}function cw(e,t,s,{discrete:a}){const o=s.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&o.addEventListener(e,t,{once:!0}),a?wR(o,c):o.dispatchEvent(c)}var Bh="focusScope.autoFocusOnMount",qh="focusScope.autoFocusOnUnmount",ab={bubbles:!1,cancelable:!0},TR="FocusScope",uw=w.forwardRef((e,t)=>{const{loop:s=!1,trapped:a=!1,onMountAutoFocus:o,onUnmountAutoFocus:c,...d}=e,[f,m]=w.useState(null),p=sl(o),v=sl(c),y=w.useRef(null),x=za(t,S=>m(S)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.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]),w.useEffect(()=>{if(f){ob.add(b);const S=document.activeElement;if(!f.contains(S)){const k=new CustomEvent(Bh,ab);f.addEventListener(Bh,p),f.dispatchEvent(k),k.defaultPrevented||(OR($R(dw(f)),{select:!0}),document.activeElement===S&&ki(f))}return()=>{f.removeEventListener(Bh,p),setTimeout(()=>{const k=new CustomEvent(qh,ab);f.addEventListener(qh,v),f.dispatchEvent(k),k.defaultPrevented||ki(S??document.body,{select:!0}),f.removeEventListener(qh,v),ob.remove(b)},0)}}},[f,p,v,b]);const N=w.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]=DR(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 r.jsx(Zs.div,{tabIndex:-1,...d,ref:x,onKeyDown:N})});uw.displayName=TR;function OR(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(ki(a,{select:t}),document.activeElement!==s)return}function DR(e){const t=dw(e),s=rb(t,e),a=rb(t.reverse(),e);return[s,a]}function dw(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const o=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||o?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function rb(e,t){for(const s of e)if(!LR(s,{upTo:t}))return s}function LR(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 MR(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&&MR(e)&&t&&e.select()}}var ob=UR();function UR(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=lb(e,t),e.unshift(t)},remove(t){e=lb(e,t),e[0]?.resume()}}}function lb(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function $R(e){return e.filter(t=>t.tagName!=="A")}var PR="Portal",fw=w.forwardRef((e,t)=>{const{container:s,...a}=e,[o,c]=w.useState(!1);nl(()=>c(!0),[]);const d=s||o&&globalThis?.document?.body;return d?I_.createPortal(r.jsx(Zs.div,{...a,ref:t}),d):null});fw.displayName=PR;function IR(e,t){return w.useReducer((s,a)=>t[s][a]??s,e)}var Ku=e=>{const{present:t,children:s}=e,a=BR(t),o=typeof s=="function"?s({present:a.isPresent}):w.Children.only(s),c=za(a.ref,qR(o));return typeof s=="function"||a.isPresent?w.cloneElement(o,{ref:c}):null};Ku.displayName="Presence";function BR(e){const[t,s]=w.useState(),a=w.useRef(null),o=w.useRef(e),c=w.useRef("none"),d=e?"mounted":"unmounted",[f,m]=IR(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const p=Pc(a.current);c.current=f==="mounted"?p:"none"},[f]),nl(()=>{const p=a.current,v=o.current;if(v!==e){const x=c.current,b=Pc(p);e?m("MOUNT"):b==="none"||p?.display==="none"?m("UNMOUNT"):m(v&&x!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,m]),nl(()=>{if(t){let p;const v=t.ownerDocument.defaultView??window,y=b=>{const S=Pc(a.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(m("ANIMATION_END"),!o.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",p=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(p),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:w.useCallback(p=>{a.current=p?getComputedStyle(p):null,s(p)},[])}}function Pc(e){return e?.animationName||"none"}function qR(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 Hh=0;function HR(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cb()),document.body.insertAdjacentElement("beforeend",e[1]??cb()),Hh++,()=>{Hh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hh--}},[])}function cb(){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,o=arguments.length;a<o;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 hw(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 o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(s[a[o]]=e[a[o]]);return s}function GR(e,t,s){if(s||arguments.length===2)for(var a=0,o=t.length,c;a<o;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",FR="with-scroll-bars-hidden",KR="--removed-body-scroll-bar-size";function Gh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ZR(e,t){var s=w.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(a){var o=s.value;o!==a&&(s.value=a,s.callback(a,o))}}}})[0];return s.callback=t,s.facade}var VR=typeof window<"u"?w.useLayoutEffect:w.useEffect,ub=new WeakMap;function QR(e,t){var s=ZR(null,function(a){return e.forEach(function(o){return Gh(o,a)})});return VR(function(){var a=ub.get(s);if(a){var o=new Set(a),c=new Set(e),d=s.current;o.forEach(function(f){c.has(f)||Gh(f,null)}),c.forEach(function(f){o.has(f)||Gh(f,d)})}ub.set(s,e)},[e]),s}function YR(e){return e}function JR(e,t){t===void 0&&(t=YR);var s=[],a=!1,o={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 m=function(){var v=d;d=[],v.forEach(c)},p=function(){return Promise.resolve().then(m)};p(),s={push:function(v){d.push(v),p()},filter:function(v){return d=d.filter(v),s}}}};return o}function XR(e){e===void 0&&(e={});var t=JR(null);return t.options=xs({async:!0,ssr:!1},e),t}var mw=function(e){var t=e.sideCar,s=hw(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 w.createElement(a,xs({},s))};mw.isSideCarExport=!0;function WR(e,t){return e.useMedium(t),mw}var pw=XR(),Fh=function(){},Zu=w.forwardRef(function(e,t){var s=w.useRef(null),a=w.useState({onScrollCapture:Fh,onWheelCapture:Fh,onTouchMoveCapture:Fh}),o=a[0],c=a[1],d=e.forwardProps,f=e.children,m=e.className,p=e.removeScrollBar,v=e.enabled,y=e.shards,x=e.sideCar,b=e.noRelative,N=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,R=e.gapMode,z=hw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=x,M=QR([s,t]),A=xs(xs({},z),o);return w.createElement(w.Fragment,null,v&&w.createElement(L,{sideCar:pw,removeScrollBar:p,shards:y,noRelative:b,noIsolation:N,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:s,gapMode:R}),d?w.cloneElement(w.Children.only(f),xs(xs({},A),{ref:M})):w.createElement(E,xs({},A,{className:m,ref:M}),f))});Zu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zu.classNames={fullWidth:ru,zeroRight:au};var eA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function tA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=eA();return t&&e.setAttribute("nonce",t),e}function nA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var iA=function(){var e=0,t=null;return{add:function(s){e==0&&(t=tA())&&(nA(t,s),sA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},aA=function(){var e=iA();return function(t,s){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},gw=function(){var e=aA(),t=function(s){var a=s.styles,o=s.dynamic;return e(a,o),null};return t},rA={left:0,top:0,right:0,gap:0},Kh=function(e){return parseInt(e||"",10)||0},oA=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Kh(s),Kh(a),Kh(o)]},lA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rA;var t=oA(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])}},cA=gw(),zr="data-scroll-locked",uA=function(e,t,s,a){var o=e.left,c=e.top,d=e.right,f=e.gap;return s===void 0&&(s="margin"),`
|
|
13
|
+
.`.concat(FR,` {
|
|
14
|
+
overflow: hidden `).concat(a,`;
|
|
15
|
+
padding-right: `).concat(f,"px ").concat(a,`;
|
|
16
|
+
}
|
|
17
|
+
body[`).concat(zr,`] {
|
|
18
|
+
overflow: hidden `).concat(a,`;
|
|
19
|
+
overscroll-behavior: contain;
|
|
20
|
+
`).concat([t&&"position: relative ".concat(a,";"),s==="margin"&&`
|
|
21
|
+
padding-left: `.concat(o,`px;
|
|
22
|
+
padding-top: `).concat(c,`px;
|
|
23
|
+
padding-right: `).concat(d,`px;
|
|
24
|
+
margin-left:0;
|
|
25
|
+
margin-top:0;
|
|
26
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
27
|
+
`),s==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.`).concat(au,` {
|
|
31
|
+
right: `).concat(f,"px ").concat(a,`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.`).concat(ru,` {
|
|
35
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.`).concat(au," .").concat(au,` {
|
|
39
|
+
right: 0 `).concat(a,`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.`).concat(ru," .").concat(ru,` {
|
|
43
|
+
margin-right: 0 `).concat(a,`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
body[`).concat(zr,`] {
|
|
47
|
+
`).concat(KR,": ").concat(f,`px;
|
|
48
|
+
}
|
|
49
|
+
`)},db=function(){var e=parseInt(document.body.getAttribute(zr)||"0",10);return isFinite(e)?e:0},dA=function(){w.useEffect(function(){return document.body.setAttribute(zr,(db()+1).toString()),function(){var e=db()-1;e<=0?document.body.removeAttribute(zr):document.body.setAttribute(zr,e.toString())}},[])},fA=function(e){var t=e.noRelative,s=e.noImportant,a=e.gapMode,o=a===void 0?"margin":a;dA();var c=w.useMemo(function(){return lA(o)},[o]);return w.createElement(cA,{styles:uA(c,!t,o,s?"":"!important")})},Tm=!1;if(typeof window<"u")try{var Ic=Object.defineProperty({},"passive",{get:function(){return Tm=!0,!0}});window.addEventListener("test",Ic,Ic),window.removeEventListener("test",Ic,Ic)}catch{Tm=!1}var gr=Tm?{passive:!1}:!1,hA=function(e){return e.tagName==="TEXTAREA"},yw=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!hA(e)&&s[t]==="visible")},mA=function(e){return yw(e,"overflowY")},pA=function(e){return yw(e,"overflowX")},fb=function(e,t){var s=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var o=vw(e,a);if(o){var c=xw(e,a),d=c[1],f=c[2];if(d>f)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},gA=function(e){var t=e.scrollTop,s=e.scrollHeight,a=e.clientHeight;return[t,s,a]},yA=function(e){var t=e.scrollLeft,s=e.scrollWidth,a=e.clientWidth;return[t,s,a]},vw=function(e,t){return e==="v"?mA(t):pA(t)},xw=function(e,t){return e==="v"?gA(t):yA(t)},vA=function(e,t){return e==="h"&&t==="rtl"?-1:1},xA=function(e,t,s,a,o){var c=vA(e,window.getComputedStyle(t).direction),d=c*a,f=s.target,m=t.contains(f),p=!1,v=d>0,y=0,x=0;do{if(!f)break;var b=xw(e,f),N=b[0],S=b[1],C=b[2],k=S-C-c*N;(N||k)&&vw(e,f)&&(y+=k,x+=N);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(v&&Math.abs(y)<1||!v&&Math.abs(x)<1)&&(p=!0),p},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hb=function(e){return[e.deltaX,e.deltaY]},mb=function(e){return e&&"current"in e?e.current:e},bA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},SA=function(e){return`
|
|
50
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
51
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
52
|
+
`)},jA=0,yr=[];function wA(e){var t=w.useRef([]),s=w.useRef([0,0]),a=w.useRef(),o=w.useState(jA++)[0],c=w.useState(gw)[0],d=w.useRef(e);w.useEffect(function(){d.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var S=GR([e.lockRef.current],(e.shards||[]).map(mb),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var f=w.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,X=P?P===M||P.contains(M):!1;if(X)return!1;var Q=fb(A,M);if(!Q)return!0;if(Q?L=A:(L=A==="v"?"h":"v",Q=fb(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 xA(se,C,S,se==="h"?R:z)},[]),m=w.useCallback(function(S){var C=S;if(!(!yr.length||yr[yr.length-1]!==c)){var k="deltaY"in C?hb(C):Bc(C),E=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&bA(L.delta,k)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(d.current.shards||[]).map(mb).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()}}},[]),p=w.useCallback(function(S,C,k,E){var R={name:S,delta:C,target:k,should:E,shadowParent:NA(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(z){return z!==R})},1)},[]),v=w.useCallback(function(S){s.current=Bc(S),a.current=void 0},[]),y=w.useCallback(function(S){p(S.type,hb(S),S.target,f(S,e.lockRef.current))},[]),x=w.useCallback(function(S){p(S.type,Bc(S),S.target,f(S,e.lockRef.current))},[]);w.useEffect(function(){return yr.push(c),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:x}),document.addEventListener("wheel",m,gr),document.addEventListener("touchmove",m,gr),document.addEventListener("touchstart",v,gr),function(){yr=yr.filter(function(S){return S!==c}),document.removeEventListener("wheel",m,gr),document.removeEventListener("touchmove",m,gr),document.removeEventListener("touchstart",v,gr)}},[]);var b=e.removeScrollBar,N=e.inert;return w.createElement(w.Fragment,null,N?w.createElement(c,{styles:SA(o)}):null,b?w.createElement(fA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function NA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const CA=WR(pw,wA);var bw=w.forwardRef(function(e,t){return w.createElement(Zu,xs({},e,{ref:t,sideCar:CA}))});bw.classNames=Zu.classNames;var kA=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={},Zh=0,Sw=function(e){return e&&(e.host||Sw(e.parentNode))},zA=function(e,t){return t.map(function(s){if(e.contains(s))return s;var a=Sw(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})},_A=function(e,t,s,a){var o=zA(t,Array.isArray(e)?e:[e]);Hc[s]||(Hc[s]=new WeakMap);var c=Hc[s],d=[],f=new Set,m=new Set(o),p=function(y){!y||f.has(y)||(f.add(y),p(y.parentNode))};o.forEach(p);var v=function(y){!y||m.has(y)||Array.prototype.forEach.call(y.children,function(x){if(f.has(x))v(x);else try{var b=x.getAttribute(a),N=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&&N&&qc.set(x,!0),C===1&&x.setAttribute(s,"true"),N||x.setAttribute(a,"true")}catch(k){console.error("aria-hidden: cannot operate on ",x,k)}})};return v(t),f.clear(),Zh++,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)}),Zh--,Zh||(vr=new WeakMap,vr=new WeakMap,qc=new WeakMap,Hc={})}},EA=function(e,t,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),o=kA(e);return o?(a.push.apply(a,Array.from(o.querySelectorAll("[aria-live], script"))),_A(a,o,s,"aria-hidden")):function(){return null}},Vu="Dialog",[jw]=cR(Vu),[RA,os]=jw(Vu),ww=e=>{const{__scopeDialog:t,children:s,open:a,defaultOpen:o,onOpenChange:c,modal:d=!0}=e,f=w.useRef(null),m=w.useRef(null),[p,v]=mR({prop:a,defaultProp:o??!1,onChange:c,caller:Vu});return r.jsx(RA,{scope:t,triggerRef:f,contentRef:m,contentId:Ih(),titleId:Ih(),descriptionId:Ih(),open:p,onOpenChange:v,onOpenToggle:w.useCallback(()=>v(y=>!y),[v]),modal:d,children:s})};ww.displayName=Vu;var Nw="DialogTrigger",AA=w.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,o=os(Nw,s),c=za(t,o.triggerRef);return r.jsx(Zs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Dp(o.open),...a,ref:c,onClick:Mi(e.onClick,o.onOpenToggle)})});AA.displayName=Nw;var Tp="DialogPortal",[TA,Cw]=jw(Tp,{forceMount:void 0}),kw=e=>{const{__scopeDialog:t,forceMount:s,children:a,container:o}=e,c=os(Tp,t);return r.jsx(TA,{scope:t,forceMount:s,children:w.Children.map(a,d=>r.jsx(Ku,{present:s||c.open,children:r.jsx(fw,{asChild:!0,container:o,children:d})}))})};kw.displayName=Tp;var Cu="DialogOverlay",zw=w.forwardRef((e,t)=>{const s=Cw(Cu,e.__scopeDialog),{forceMount:a=s.forceMount,...o}=e,c=os(Cu,e.__scopeDialog);return c.modal?r.jsx(Ku,{present:a||c.open,children:r.jsx(DA,{...o,ref:t})}):null});zw.displayName=Cu;var OA=rw("DialogOverlay.RemoveScroll"),DA=w.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,o=os(Cu,s);return r.jsx(bw,{as:OA,allowPinchZoom:!0,shards:[o.contentRef],children:r.jsx(Zs.div,{"data-state":Dp(o.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Na="DialogContent",_w=w.forwardRef((e,t)=>{const s=Cw(Na,e.__scopeDialog),{forceMount:a=s.forceMount,...o}=e,c=os(Na,e.__scopeDialog);return r.jsx(Ku,{present:a||c.open,children:c.modal?r.jsx(LA,{...o,ref:t}):r.jsx(MA,{...o,ref:t})})});_w.displayName=Na;var LA=w.forwardRef((e,t)=>{const s=os(Na,e.__scopeDialog),a=w.useRef(null),o=za(t,s.contentRef,a);return w.useEffect(()=>{const c=a.current;if(c)return EA(c)},[]),r.jsx(Ew,{...e,ref:o,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())})}),MA=w.forwardRef((e,t)=>{const s=os(Na,e.__scopeDialog),a=w.useRef(!1),o=w.useRef(!1);return r.jsx(Ew,{...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,o.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(a.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const d=c.target;s.triggerRef.current?.contains(d)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})}),Ew=w.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:c,...d}=e,f=os(Na,s),m=w.useRef(null),p=za(t,m);return HR(),r.jsxs(r.Fragment,{children:[r.jsx(uw,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:c,children:r.jsx(lw,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Dp(f.open),...d,ref:p,onDismiss:()=>f.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(UA,{titleId:f.titleId}),r.jsx(PA,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Op="DialogTitle",Rw=w.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,o=os(Op,s);return r.jsx(Zs.h2,{id:o.titleId,...a,ref:t})});Rw.displayName=Op;var Aw="DialogDescription",Tw=w.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,o=os(Aw,s);return r.jsx(Zs.p,{id:o.descriptionId,...a,ref:t})});Tw.displayName=Aw;var Ow="DialogClose",Dw=w.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,o=os(Ow,s);return r.jsx(Zs.button,{type:"button",...a,ref:t,onClick:Mi(e.onClick,()=>o.onOpenChange(!1))})});Dw.displayName=Ow;function Dp(e){return e?"open":"closed"}var Lw="DialogTitleWarning",[XM,Mw]=lR(Lw,{contentName:Na,titleName:Op,docsSlug:"dialog"}),UA=({titleId:e})=>{const t=Mw(Lw),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
53
|
+
|
|
54
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
55
|
+
|
|
56
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},$A="DialogDescriptionWarning",PA=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mw($A).contentName}}.`;return w.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Uw=ww,$w=kw,Lp=zw,Mp=_w,Up=Rw,Pw=Tw,Iw=Dw;const IA=Uw,BA=$w,Bw=w.forwardRef(({className:e,...t},s)=>r.jsx(Lp,{ref:s,className:Qn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));Bw.displayName=Lp.displayName;const qA=400,HA=1200,GA=720,qw=w.forwardRef(({className:e,children:t,...s},a)=>{const[o,c]=w.useState(GA),d=w.useRef(!1),f=w.useRef(0),m=w.useRef(0),p=w.useCallback(x=>{d.current=!0,f.current=x.clientX,m.current=o,x.target.setPointerCapture(x.pointerId),x.preventDefault()},[o]),v=w.useCallback(x=>{if(!d.current)return;const b=f.current-x.clientX,N=Math.min(HA,Math.max(qA,m.current+b));c(N)},[]),y=w.useCallback(()=>{d.current=!1},[]);return r.jsxs(BA,{children:[r.jsx(Bw,{}),r.jsxs(Mp,{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(${o}px, 100vw)`},...s,children:[r.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:p,onPointerMove:v,onPointerUp:y}),t,r.jsxs(Iw,{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:[r.jsx(Hu,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});qw.displayName=Mp.displayName;const FA=({className:e,...t})=>r.jsx("div",{className:Qn("flex flex-col gap-1.5 pr-10",e),...t}),Hw=w.forwardRef(({className:e,...t},s)=>r.jsx(Up,{ref:s,className:Qn("text-lg font-medium text-zinc-50",e),...t}));Hw.displayName=Up.displayName;const Gw=w.forwardRef(({className:e,...t},s)=>r.jsx(Pw,{ref:s,className:Qn("text-sm text-zinc-500",e),...t}));Gw.displayName=Pw.displayName;function KA({title:e,subtitle:t,children:s,open:a,onClose:o}){return r.jsx(IA,{open:a,onOpenChange:c=>c?void 0:o(),children:r.jsxs(qw,{children:[r.jsxs(FA,{className:"drawer-head",children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),r.jsx(Hw,{id:"drawer-title",children:e}),r.jsx(Gw,{className:"sr-only",children:t})]}),r.jsx("div",{className:"drawer-body",children:s})]})})}function te(e,t,s){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const p=d.prototype,v=Object.keys(p);for(let y=0;y<v.length;y++){const x=v[y];x in f||(f[x]=p[x].bind(f))}}const o=s?.Parent??Object;class c extends o{}Object.defineProperty(c,"name",{value:e});function d(f){var m;const p=s?.Parent?new c:this;a(p,f),(m=p._zod).deferred??(m.deferred=[]);for(const v of p._zod.deferred)v();return p}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 _r extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Fw extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Kw={};function Pi(e){return Kw}function Zw(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,o])=>t.indexOf(+a)===-1).map(([a,o])=>o)}function Om(e,t){return typeof t=="bigint"?t.toString():t}function $p(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Pp(e){return e==null}function Ip(e){const t=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(t,s)}function ZA(e,t){const s=(e.toString().split(".")[1]||"").length,a=t.toString();let o=(a.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m?.[1]&&(o=Number.parseInt(m[1]))}const c=s>o?s:o,d=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return d%f/10**c}const pb=Symbol("evaluating");function it(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==pb)return a===void 0&&(a=pb,a=s()),a},set(o){Object.defineProperty(e,t,{value:o})},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 gb(e){return JSON.stringify(e)}function VA(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Vw="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ku(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const QA=$p(()=>{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(ku(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(ku(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function Qw(e){return Or(e)?{...e}:Array.isArray(e)?[...e]:e}const YA=new Set(["string","number","symbol"]);function Dr(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 JA(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const XA={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 WA(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 eT(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 tT(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 o=Hi(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Ea(this,"shape",c),c}});return Gi(e,o)}function nT(e,t){if(!Or(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 sT(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 iT(e,t,s){const o=t._zod.def.checks;if(o&&o.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,m={...f};if(s)for(const p in s){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);s[p]&&(m[p]=e?new e({type:"optional",innerType:f[p]}):f[p])}else for(const p in f)m[p]=e?new e({type:"optional",innerType:f[p]}):f[p];return Ea(this,"shape",m),m},checks:[]});return Gi(t,d)}function aT(e,t,s){const a=Hi(t._zod.def,{get shape(){const o=t._zod.def.shape,c={...o};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:o[d]}))}else for(const d in o)c[d]=new e({type:"nonoptional",innerType:o[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 o=Gc(e.inst?._zod.def?.error?.(e))??Gc(t?.error?.(e))??Gc(s.customError?.(e))??Gc(s.localeError?.(e))??"Invalid input";a.message=o}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Bp(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 Yw=(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,Om,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Jw=te("$ZodError",Yw),Xw=te("$ZodError",Yw,{Parent:Error});function rT(e,t=s=>s.message){const s={},a=[];for(const o of e.issues)o.path.length>0?(s[o.path[0]]=s[o.path[0]]||[],s[o.path[0]].push(t(o))):a.push(t(o));return{formErrors:a,fieldErrors:s}}function oT(e,t=s=>s.message){const s={_errors:[]},a=o=>{for(const c of o.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 m=c.path[f];f===c.path.length-1?(d[m]=d[m]||{_errors:[]},d[m]._errors.push(t(c))):d[m]=d[m]||{_errors:[]},d=d[m],f++}}};return a(e),s}const qp=e=>(t,s,a,o)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise)throw new _r;if(d.issues.length){const f=new(o?.Err??e)(d.issues.map(m=>Ii(m,c,Pi())));throw Vw(f,o?.callee),f}return d.value},Hp=e=>async(t,s,a,o)=>{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(o?.Err??e)(d.issues.map(m=>Ii(m,c,Pi())));throw Vw(f,o?.callee),f}return d.value},Qu=e=>(t,s,a)=>{const o=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw new _r;return c.issues.length?{success:!1,error:new(e??Jw)(c.issues.map(d=>Ii(d,o,Pi())))}:{success:!0,data:c.value}},lT=Qu(Xw),Yu=e=>async(t,s,a)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:s,issues:[]},o);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Ii(d,o,Pi())))}:{success:!0,data:c.value}},cT=Yu(Xw),uT=e=>(t,s,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return qp(e)(t,s,o)},dT=e=>(t,s,a)=>qp(e)(t,s,a),fT=e=>async(t,s,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Hp(e)(t,s,o)},hT=e=>async(t,s,a)=>Hp(e)(t,s,a),mT=e=>(t,s,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Qu(e)(t,s,o)},pT=e=>(t,s,a)=>Qu(e)(t,s,a),gT=e=>async(t,s,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Yu(e)(t,s,o)},yT=e=>async(t,s,a)=>Yu(e)(t,s,a),vT=/^[cC][^\s-]{8,}$/,xT=/^[0-9a-z]+$/,bT=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ST=/^[0-9a-vA-V]{20}$/,jT=/^[A-Za-z0-9]{27}$/,wT=/^[a-zA-Z0-9_-]{21}$/,NT=/^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})$/,yb=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)$/,kT=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _T(){return new RegExp(zT,"u")}const ET=/^(?:(?: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])$/,RT=/^(([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}|:))$/,AT=/^((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])$/,TT=/^(([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])$/,OT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ww=/^[A-Za-z0-9_-]*$/,DT=/^\+[1-9]\d{6,14}$/,eN="(?:(?:\\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])))",LT=new RegExp(`^${eN}$`);function tN(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 MT(e){return new RegExp(`^${tN(e)}$`)}function UT(e){const t=tN({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(`^${eN}T(?:${a})$`)}const $T=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},PT=/^-?\d+$/,nN=/^-?\d+(?:\.\d+)?$/,IT=/^(?:true|false)$/i,BT=/^[^A-Z]*$/,qT=/^[^a-z]*$/,Nn=te("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),sN={number:"number",bigint:"bigint",object:"date"},iN=te("$ZodCheckLessThan",(e,t)=>{Nn.init(e,t);const s=sN[typeof t.value];e._zod.onattach.push(a=>{const o=a._zod.bag,c=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(t.inclusive?o.maximum=t.value:o.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})}}),aN=te("$ZodCheckGreaterThan",(e,t)=>{Nn.init(e,t);const s=sN[typeof t.value];e._zod.onattach.push(a=>{const o=a._zod.bag,c=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?o.minimum=t.value:o.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})}}),HT=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):ZA(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})}}),GT=te("$ZodCheckNumberFormat",(e,t)=>{Nn.init(e,t),t.format=t.format||"float64";const s=t.format?.includes("int"),a=s?"int":"number",[o,c]=XA[t.format];e._zod.onattach.push(d=>{const f=d._zod.bag;f.format=t.format,f.minimum=o,f.maximum=c,s&&(f.pattern=PT)}),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<o&&d.issues.push({origin:"number",input:f,code:"too_small",minimum:o,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})}}),FT=te("$ZodCheckMaxLength",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const o=a.value;return!Pp(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const o=a.value;if(o.length<=t.maximum)return;const d=Bp(o);a.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),KT=te("$ZodCheckMinLength",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const o=a.value;return!Pp(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const o=a.value;if(o.length>=t.minimum)return;const d=Bp(o);a.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ZT=te("$ZodCheckLengthEquals",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const o=a.value;return!Pp(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=a=>{const o=a.value,c=o.length;if(c===t.length)return;const d=Bp(o),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})}}),Ju=te("$ZodCheckStringFormat",(e,t)=>{var s,a;Nn.init(e,t),e._zod.onattach.push(o=>{const c=o._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=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),VT=te("$ZodCheckRegex",(e,t)=>{Ju.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})}}),QT=te("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=BT),Ju.init(e,t)}),YT=te("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=qT),Ju.init(e,t)}),JT=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(o=>{const c=o._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(a)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),XT=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 o=a._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),WT=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 o=a._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),eO=te("$ZodCheckOverwrite",(e,t)=>{Nn.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class tO{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
|
+
`).filter(d=>d),o=Math.min(...a.map(d=>d.length-d.trimStart().length)),c=a.map(d=>d.slice(o)).map(d=>" ".repeat(this.indent*2)+d);for(const d of c)this.content.push(d)}compile(){const t=Function,s=this?.args,o=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...s,o.join(`
|
|
58
|
+
`))}}const nO={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=nO;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const c of o._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 o=(d,f,m)=>{let p=jr(d),v;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(d))continue}else if(p)continue;const x=d.issues.length,b=y._zod.check(d);if(b instanceof Promise&&m?.async===!1)throw new _r;if(v||b instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await b,d.issues.length!==x&&(p||(p=jr(d,x)))});else{if(d.issues.length===x)continue;p||(p=jr(d,x))}}return v?v.then(()=>d):d},c=(d,f,m)=>{if(jr(d))return d.aborted=!0,d;const p=o(f,a,m);if(p instanceof Promise){if(m.async===!1)throw new _r;return p.then(v=>e._zod.parse(v,m))}return e._zod.parse(p,m)};e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){const p=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(v=>c(v,d,f)):c(p,d,f)}const m=e._zod.parse(d,f);if(m instanceof Promise){if(f.async===!1)throw new _r;return m.then(p=>o(p,a,f))}return o(m,a,f)}}it(e,"~standard",()=>({validate:o=>{try{const c=lT(e,o);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return cT(e,o).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),Gp=te("$ZodString",(e,t)=>{bt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$T(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)=>{Ju.init(e,t),Gp.init(e,t)}),sO=te("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=CT),xt.init(e,t)}),iO=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=yb(a))}else t.pattern??(t.pattern=yb());xt.init(e,t)}),aO=te("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=kT),xt.init(e,t)}),rO=te("$ZodURL",(e,t)=>{xt.init(e,t),e._zod.check=s=>{try{const a=s.value.trim(),o=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.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(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:s.value=a;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!t.abort})}}}),oO=te("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=_T()),xt.init(e,t)}),lO=te("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=wT),xt.init(e,t)}),cO=te("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=vT),xt.init(e,t)}),uO=te("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=xT),xt.init(e,t)}),dO=te("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bT),xt.init(e,t)}),fO=te("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ST),xt.init(e,t)}),hO=te("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=jT),xt.init(e,t)}),mO=te("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=UT(t)),xt.init(e,t)}),pO=te("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=LT),xt.init(e,t)}),gO=te("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=MT(t)),xt.init(e,t)}),yO=te("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=NT),xt.init(e,t)}),vO=te("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ET),xt.init(e,t),e._zod.bag.format="ipv4"}),xO=te("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=RT),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})}}}),bO=te("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=AT),xt.init(e,t)}),SO=te("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=TT),xt.init(e,t),e._zod.check=s=>{const a=s.value.split("/");try{if(a.length!==2)throw new Error;const[o,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://[${o}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:e,continue:!t.abort})}}});function rN(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const jO=te("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=OT),xt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{rN(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}});function wO(e){if(!Ww.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return rN(s)}const NO=te("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ww),xt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{wO(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=DT),xt.init(e,t)});function kO(e,t=null){try{const s=e.split(".");if(s.length!==3)return!1;const[a]=s;if(!a)return!1;const o=JSON.parse(atob(a));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const zO=te("$ZodJWT",(e,t)=>{xt.init(e,t),e._zod.check=s=>{kO(s.value,t.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!t.abort})}}),oN=te("$ZodNumber",(e,t)=>{bt.init(e,t),e._zod.pattern=e._zod.bag.pattern??nN,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=Number(s.value)}catch{}const o=s.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return s;const c=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...c?{received:c}:{}}),s}}),_O=te("$ZodNumberFormat",(e,t)=>{GT.init(e,t),oN.init(e,t)}),EO=te("$ZodBoolean",(e,t)=>{bt.init(e,t),e._zod.pattern=IT,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=!!s.value}catch{}const o=s.value;return typeof o=="boolean"||s.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),s}}),RO=te("$ZodUnknown",(e,t)=>{bt.init(e,t),e._zod.parse=s=>s}),AO=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 vb(e,t,s){e.issues.length&&t.issues.push(...wr(s,e.issues)),t.value[s]=e.value}const TO=te("$ZodArray",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const o=s.value;if(!Array.isArray(o))return s.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),s;s.value=Array(o.length);const c=[];for(let d=0;d<o.length;d++){const f=o[d],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?c.push(m.then(p=>vb(p,s,d))):vb(m,s,d)}return c.length?Promise.all(c).then(()=>s):s}});function zu(e,t,s,a,o){if(e.issues.length){if(o&&!(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 lN(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=JA(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function cN(e,t,s,a,o,c){const d=[],f=o.keySet,m=o.catchall._zod,p=m.def.type,v=m.optout==="optional";for(const y in t){if(f.has(y))continue;if(p==="never"){d.push(y);continue}const x=m.run({value:t[y],issues:[]},a);x instanceof Promise?e.push(x.then(b=>zu(b,s,y,t,v))):zu(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 OO=te("$ZodObject",(e,t)=>{if(bt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const a=$p(()=>lN(t));it(e._zod,"propValues",()=>{const f=t.shape,m={};for(const p in f){const v=f[p]._zod;if(v.values){m[p]??(m[p]=new Set);for(const y of v.values)m[p].add(y)}}return m});const o=ku,c=t.catchall;let d;e._zod.parse=(f,m)=>{d??(d=a.value);const p=f.value;if(!o(p))return f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f;f.value={};const v=[],y=d.shape;for(const x of d.keys){const b=y[x],N=b._zod.optout==="optional",S=b._zod.run({value:p[x],issues:[]},m);S instanceof Promise?v.push(S.then(C=>zu(C,f,x,p,N))):zu(S,f,x,p,N)}return c?cN(v,p,f,m,a.value,e):v.length?Promise.all(v).then(()=>f):f}}),DO=te("$ZodObjectJIT",(e,t)=>{OO.init(e,t);const s=e._zod.parse,a=$p(()=>lN(t)),o=x=>{const b=new tO(["shape","payload","ctx"]),N=a.value,S=R=>{const z=gb(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 N.keys)C[R]=`key_${k++}`;b.write("const newResult = {};");for(const R of N.keys){const z=C[R],L=gb(R),A=x[R]?._zod?.optout==="optional";b.write(`const ${z} = ${S(R)};`),A?b.write(`
|
|
59
|
+
if (${z}.issues.length) {
|
|
60
|
+
if (${L} in input) {
|
|
61
|
+
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
62
|
+
...iss,
|
|
63
|
+
path: iss.path ? [${L}, ...iss.path] : [${L}]
|
|
64
|
+
})));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (${z}.value === undefined) {
|
|
69
|
+
if (${L} in input) {
|
|
70
|
+
newResult[${L}] = undefined;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
newResult[${L}] = ${z}.value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
`):b.write(`
|
|
77
|
+
if (${z}.issues.length) {
|
|
78
|
+
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
79
|
+
...iss,
|
|
80
|
+
path: iss.path ? [${L}, ...iss.path] : [${L}]
|
|
81
|
+
})));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (${z}.value === undefined) {
|
|
85
|
+
if (${L} in input) {
|
|
86
|
+
newResult[${L}] = undefined;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
newResult[${L}] = ${z}.value;
|
|
90
|
+
}
|
|
91
|
+
|
|
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=ku,f=!Kw.jitless,p=f&&QA.value,v=t.catchall;let y;e._zod.parse=(x,b)=>{y??(y=a.value);const N=x.value;return d(N)?f&&p&&b?.async===!1&&b.jitless!==!0?(c||(c=o(t.shape)),x=c(x,b),v?cN([],N,x,b,y,e):x):s(x,b):(x.issues.push({expected:"object",code:"invalid_type",input:N,inst:e}),x)}});function xb(e,t,s,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const o=e.filter(c=>!jr(c));return o.length===1?(t.value=o[0].value,o[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 LO=te("$ZodUnion",(e,t)=>{bt.init(e,t),it(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),it(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),it(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),it(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${o.map(c=>Ip(c.source)).join("|")})$`)}});const s=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(o,c)=>{if(s)return a(o,c);let d=!1;const f=[];for(const m of t.options){const p=m._zod.run({value:o.value,issues:[]},c);if(p instanceof Promise)f.push(p),d=!0;else{if(p.issues.length===0)return p;f.push(p)}}return d?Promise.all(f).then(m=>xb(m,o,e,c)):xb(f,o,e,c)}}),MO=te("$ZodIntersection",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const o=s.value,c=t.left._zod.run({value:o,issues:[]},a),d=t.right._zod.run({value:o,issues:[]},a);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([m,p])=>bb(s,m,p)):bb(s,c,d)}});function Dm(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),o={...e,...t};for(const c of a){const d=Dm(e[c],t[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};o[c]=d.data}return{valid:!0,data:o}}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 o=e[a],c=t[a],d=Dm(o,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 bb(e,t,s){const a=new Map;let o;for(const f of t.issues)if(f.code==="unrecognized_keys"){o??(o=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of s.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const c=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&o&&e.issues.push({...o,keys:c}),jr(e))return e;const d=Dm(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 UO=te("$ZodRecord",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const o=s.value;if(!Or(o))return s.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),s;const c=[],d=t.keyType._zod.values;if(d){s.value={};const f=new Set;for(const p of d)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){f.add(typeof p=="number"?p.toString():p);const v=t.valueType._zod.run({value:o[p],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...wr(p,y.issues)),s.value[p]=y.value})):(v.issues.length&&s.issues.push(...wr(p,v.issues)),s.value[p]=v.value)}let m;for(const p in o)f.has(p)||(m=m??[],m.push(p));m&&m.length>0&&s.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:m})}else{s.value={};for(const f of Reflect.ownKeys(o)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&nN.test(f)&&m.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&&(m=y)}if(m.issues.length){t.mode==="loose"?s.value[f]=o[f]:s.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>Ii(y,a,Pi())),input:f,path:[f],inst:e});continue}const v=t.valueType._zod.run({value:o[f],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...wr(f,y.issues)),s.value[m.value]=y.value})):(v.issues.length&&s.issues.push(...wr(f,v.issues)),s.value[m.value]=v.value)}}return c.length?Promise.all(c).then(()=>s):s}}),$O=te("$ZodEnum",(e,t)=>{bt.init(e,t);const s=Zw(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(o=>YA.has(typeof o)).map(o=>typeof o=="string"?Dr(o):o.toString()).join("|")})$`),e._zod.parse=(o,c)=>{const d=o.value;return a.has(d)||o.issues.push({code:"invalid_value",values:s,input:d,inst:e}),o}}),PO=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"?Dr(a):a?Dr(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,o)=>{const c=a.value;return s.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),IO=te("$ZodTransform",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Fw(e.constructor.name);const o=t.transform(s.value,s);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(d=>(s.value=d,s));if(o instanceof Promise)throw new _r;return s.value=o,s}});function Sb(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const uN=te("$ZodOptional",(e,t)=>{bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",it(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),it(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${Ip(s.source)})?$`):void 0}),e._zod.parse=(s,a)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(s,a);return o instanceof Promise?o.then(c=>Sb(c,s.value)):Sb(o,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),BO=te("$ZodExactOptional",(e,t)=>{uN.init(e,t),it(e._zod,"values",()=>t.innerType._zod.values),it(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(s,a)=>t.innerType._zod.run(s,a)}),qO=te("$ZodNullable",(e,t)=>{bt.init(e,t),it(e._zod,"optin",()=>t.innerType._zod.optin),it(e._zod,"optout",()=>t.innerType._zod.optout),it(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${Ip(s.source)}|null)$`):void 0}),it(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)}),HO=te("$ZodDefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",it(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 o=t.innerType._zod.run(s,a);return o instanceof Promise?o.then(c=>jb(c,t)):jb(o,t)}});function jb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const GO=te("$ZodPrefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",it(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))}),FO=te("$ZodNonOptional",(e,t)=>{bt.init(e,t),it(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 o=t.innerType._zod.run(s,a);return o instanceof Promise?o.then(c=>wb(c,e)):wb(o,e)}});function wb(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 KO=te("$ZodCatch",(e,t)=>{bt.init(e,t),it(e._zod,"optin",()=>t.innerType._zod.optin),it(e._zod,"optout",()=>t.innerType._zod.optout),it(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const o=t.innerType._zod.run(s,a);return o instanceof Promise?o.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=o.value,o.issues.length&&(s.value=t.catchValue({...s,error:{issues:o.issues.map(c=>Ii(c,a,Pi()))},input:s.value}),s.issues=[]),s)}}),ZO=te("$ZodPipe",(e,t)=>{bt.init(e,t),it(e._zod,"values",()=>t.in._zod.values),it(e._zod,"optin",()=>t.in._zod.optin),it(e._zod,"optout",()=>t.out._zod.optout),it(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(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 o=t.in._zod.run(s,a);return o instanceof Promise?o.then(c=>Fc(c,t.out,a)):Fc(o,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 VO=te("$ZodReadonly",(e,t)=>{bt.init(e,t),it(e._zod,"propValues",()=>t.innerType._zod.propValues),it(e._zod,"values",()=>t.innerType._zod.values),it(e._zod,"optin",()=>t.innerType?._zod?.optin),it(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const o=t.innerType._zod.run(s,a);return o instanceof Promise?o.then(Nb):Nb(o)}});function Nb(e){return e.value=Object.freeze(e.value),e}const QO=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,o=t.fn(a);if(o instanceof Promise)return o.then(c=>Cb(c,s,a,e));Cb(o,s,a,e)}});function Cb(e,t,s,a){if(!e){const o={code:"custom",input:s,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(o.params=a._zod.def.params),t.issues.push(il(o))}}var kb;class YO{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 o={...a,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function JO(){return new YO}(kb=globalThis).__zod_globalRegistry??(kb.__zod_globalRegistry=JO());const Ho=globalThis.__zod_globalRegistry;function XO(e,t){return new e({type:"string",...we(t)})}function WO(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...we(t)})}function zb(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...we(t)})}function e5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...we(t)})}function t5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...we(t)})}function n5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...we(t)})}function s5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...we(t)})}function i5(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...we(t)})}function a5(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...we(t)})}function r5(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...we(t)})}function o5(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...we(t)})}function l5(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...we(t)})}function c5(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...we(t)})}function u5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...we(t)})}function d5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...we(t)})}function f5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...we(t)})}function h5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...we(t)})}function m5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...we(t)})}function p5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...we(t)})}function g5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...we(t)})}function y5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...we(t)})}function v5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...we(t)})}function x5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...we(t)})}function b5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...we(t)})}function S5(e,t){return new e({type:"string",format:"date",check:"string_format",...we(t)})}function j5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...we(t)})}function w5(e,t){return new e({type:"string",format:"duration",check:"string_format",...we(t)})}function N5(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 k5(e,t){return new e({type:"boolean",...we(t)})}function z5(e){return new e({type:"unknown"})}function _5(e,t){return new e({type:"never",...we(t)})}function _b(e,t){return new iN({check:"less_than",...we(t),value:e,inclusive:!1})}function Vh(e,t){return new iN({check:"less_than",...we(t),value:e,inclusive:!0})}function Eb(e,t){return new aN({check:"greater_than",...we(t),value:e,inclusive:!1})}function Qh(e,t){return new aN({check:"greater_than",...we(t),value:e,inclusive:!0})}function Rb(e,t){return new HT({check:"multiple_of",...we(t),value:e})}function dN(e,t){return new FT({check:"max_length",...we(t),maximum:e})}function _u(e,t){return new KT({check:"min_length",...we(t),minimum:e})}function fN(e,t){return new ZT({check:"length_equals",...we(t),length:e})}function E5(e,t){return new VT({check:"string_format",format:"regex",...we(t),pattern:e})}function R5(e){return new QT({check:"string_format",format:"lowercase",...we(e)})}function A5(e){return new YT({check:"string_format",format:"uppercase",...we(e)})}function T5(e,t){return new JT({check:"string_format",format:"includes",...we(t),includes:e})}function O5(e,t){return new XT({check:"string_format",format:"starts_with",...we(t),prefix:e})}function D5(e,t){return new WT({check:"string_format",format:"ends_with",...we(t),suffix:e})}function $r(e){return new eO({check:"overwrite",tx:e})}function L5(e){return $r(t=>t.normalize(e))}function M5(){return $r(e=>e.trim())}function U5(){return $r(e=>e.toLowerCase())}function $5(){return $r(e=>e.toUpperCase())}function P5(){return $r(e=>VA(e))}function I5(e,t,s){return new e({type:"array",element:t,...we(s)})}function B5(e,t,s){return new e({type:"custom",check:"custom",fn:t,...we(s)})}function q5(e){const t=H5(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(il(a,s.value,t._zod.def));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=s.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),s.issues.push(il(o))}},e(s.value,s)));return t}function H5(e,t){const s=new Nn({check:"custom",...we(t)});return s._zod.check=e,s}function hN(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 o=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[o.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.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 m=t.metadataRegistry.get(e);return m&&Object.assign(d.schema,m),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 mN(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 m=a.get(f);if(m&&m!==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 o=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??(N=>N);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 p=`#/${f}/`,v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:p+v}},c=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:m,defId:p}=o(d);f.def={...f.schema},p&&(f.defId=p);const v=f.schema;for(const y in v)delete v[y];v.$ref=m};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
|
+
|
|
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 p=e.external.registry.get(d[0])?.id;if(t!==d[0]&&p){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 pN(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 m=f.def??f.schema,p={...m},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")?(m.allOf=m.allOf??[],m.allOf.push(b)):Object.assign(m,b),Object.assign(m,p),d._zod.parent===v)for(const S in m)S==="$ref"||S==="allOf"||S in p||delete m[S];if(b.$ref&&x.def)for(const S in m)S==="$ref"||S==="allOf"||S in x.def&&JSON.stringify(m[S])===JSON.stringify(x.def[S])&&delete m[S]}const y=d._zod.parent;if(y&&y!==v){a(y);const x=e.seen.get(y);if(x?.schema.$ref&&(m.$ref=x.schema.$ref,x.def))for(const b in m)b==="$ref"||b==="allOf"||b in x.def&&JSON.stringify(m[b])===JSON.stringify(x.def[b])&&delete m[b]}e.override({zodSchema:d,jsonSchema:m,path:f.path??[]})};for(const d of[...e.seen.entries()].reverse())a(d[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$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");o.$id=e.external.uri(d)}Object.assign(o,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"?o.$defs=c:o.definitions=c);try{const d=JSON.parse(JSON.stringify(o));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input:Eu(t,"input",e.processors),output:Eu(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 o in a.shape)if(cn(a.shape[o],s))return!0;return!1}if(a.type==="union"){for(const o of a.options)if(cn(o,s))return!0;return!1}if(a.type==="tuple"){for(const o of a.items)if(cn(o,s))return!0;return!!(a.rest&&cn(a.rest,s))}return!1}const G5=(e,t={})=>s=>{const a=hN({...s,processors:t});return qt(e,a),mN(a,e),pN(a,e)},Eu=(e,t,s={})=>a=>{const{libraryOptions:o,target:c}=a??{},d=hN({...o??{},target:c,io:t,processors:s});return qt(e,d),mN(d,e),pN(d,e)},F5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},K5=(e,t,s,a)=>{const o=s;o.type="string";const{minimum:c,maximum:d,format:f,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(o.minLength=c),typeof d=="number"&&(o.maxLength=d),f&&(o.format=F5[f]??f,o.format===""&&delete o.format,f==="time"&&delete o.format),p&&(o.contentEncoding=p),m&&m.size>0){const v=[...m];v.length===1?o.pattern=v[0].source:v.length>1&&(o.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},Z5=(e,t,s,a)=>{const o=s,{minimum:c,maximum:d,format:f,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?o.type="integer":o.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=v,o.exclusiveMinimum=!0):o.exclusiveMinimum=v),typeof c=="number"&&(o.minimum=c,typeof v=="number"&&t.target!=="draft-04"&&(v>=c?delete o.minimum:delete o.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=p,o.exclusiveMaximum=!0):o.exclusiveMaximum=p),typeof d=="number"&&(o.maximum=d,typeof p=="number"&&t.target!=="draft-04"&&(p<=d?delete o.maximum:delete o.exclusiveMaximum)),typeof m=="number"&&(o.multipleOf=m)},V5=(e,t,s,a)=>{s.type="boolean"},Q5=(e,t,s,a)=>{s.not={}},Y5=(e,t,s,a)=>{},J5=(e,t,s,a)=>{const o=e._zod.def,c=Zw(o.entries);c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),s.enum=c},X5=(e,t,s,a)=>{const o=e._zod.def,c=[];for(const d of o.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},W5=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},eD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},tD=(e,t,s,a)=>{const o=s,c=e._zod.def,{minimum:d,maximum:f}=e._zod.bag;typeof d=="number"&&(o.minItems=d),typeof f=="number"&&(o.maxItems=f),o.type="array",o.items=qt(c.element,t,{...a,path:[...a.path,"items"]})},nD=(e,t,s,a)=>{const o=s,c=e._zod.def;o.type="object",o.properties={};const d=c.shape;for(const p in d)o.properties[p]=qt(d[p],t,{...a,path:[...a.path,"properties",p]});const f=new Set(Object.keys(d)),m=new Set([...f].filter(p=>{const v=c.shape[p]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));m.size>0&&(o.required=Array.from(m)),c.catchall?._zod.def.type==="never"?o.additionalProperties=!1:c.catchall?c.catchall&&(o.additionalProperties=qt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},sD=(e,t,s,a)=>{const o=e._zod.def,c=o.inclusive===!1,d=o.options.map((f,m)=>qt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",m]}));c?s.oneOf=d:s.anyOf=d},iD=(e,t,s,a)=>{const o=e._zod.def,c=qt(o.left,t,{...a,path:[...a.path,"allOf",0]}),d=qt(o.right,t,{...a,path:[...a.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,m=[...f(c)?c.allOf:[c],...f(d)?d.allOf:[d]];s.allOf=m},aD=(e,t,s,a)=>{const o=s,c=e._zod.def;o.type="object";const d=c.keyType,m=d._zod.bag?.patterns;if(c.mode==="loose"&&m&&m.size>0){const v=qt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});o.patternProperties={};for(const y of m)o.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=qt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),o.additionalProperties=qt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const p=d._zod.values;if(p){const v=[...p].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(o.required=v)}},rD=(e,t,s,a)=>{const o=e._zod.def,c=qt(o.innerType,t,a),d=t.seen.get(e);t.target==="openapi-3.0"?(d.ref=o.innerType,s.nullable=!0):s.anyOf=[c,{type:"null"}]},oD=(e,t,s,a)=>{const o=e._zod.def;qt(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType},lD=(e,t,s,a)=>{const o=e._zod.def;qt(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType,s.default=JSON.parse(JSON.stringify(o.defaultValue))},cD=(e,t,s,a)=>{const o=e._zod.def;qt(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType,t.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},uD=(e,t,s,a)=>{const o=e._zod.def;qt(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType;let d;try{d=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=d},dD=(e,t,s,a)=>{const o=e._zod.def,c=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;qt(c,t,a);const d=t.seen.get(e);d.ref=c},fD=(e,t,s,a)=>{const o=e._zod.def;qt(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType,s.readOnly=!0},gN=(e,t,s,a)=>{const o=e._zod.def;qt(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType},hD=te("ZodISODateTime",(e,t)=>{mO.init(e,t),jt.init(e,t)});function mD(e){return b5(hD,e)}const pD=te("ZodISODate",(e,t)=>{pO.init(e,t),jt.init(e,t)});function gD(e){return S5(pD,e)}const yD=te("ZodISOTime",(e,t)=>{gO.init(e,t),jt.init(e,t)});function vD(e){return j5(yD,e)}const xD=te("ZodISODuration",(e,t)=>{yO.init(e,t),jt.init(e,t)});function bD(e){return w5(xD,e)}const SD=(e,t)=>{Jw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>oT(e,s)},flatten:{value:s=>rT(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,Om,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,Om,2)}},isEmpty:{get(){return e.issues.length===0}}})},Yn=te("ZodError",SD,{Parent:Error}),jD=qp(Yn),wD=Hp(Yn),ND=Qu(Yn),CD=Yu(Yn),kD=uT(Yn),zD=dT(Yn),_D=fT(Yn),ED=hT(Yn),RD=mT(Yn),AD=pT(Yn),TD=gT(Yn),OD=yT(Yn),St=te("ZodType",(e,t)=>(bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Eu(e,"input"),output:Eu(e,"output")}}),e.toJSONSchema=G5(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)=>jD(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>ND(e,s,a),e.parseAsync=async(s,a)=>wD(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>CD(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>kD(e,s,a),e.decode=(s,a)=>zD(e,s,a),e.encodeAsync=async(s,a)=>_D(e,s,a),e.decodeAsync=async(s,a)=>ED(e,s,a),e.safeEncode=(s,a)=>RD(e,s,a),e.safeDecode=(s,a)=>AD(e,s,a),e.safeEncodeAsync=async(s,a)=>TD(e,s,a),e.safeDecodeAsync=async(s,a)=>OD(e,s,a),e.refine=(s,a)=>e.check(zL(s,a)),e.superRefine=s=>e.check(_L(s)),e.overwrite=s=>e.check($r(s)),e.optional=()=>Ob(e),e.exactOptional=()=>mL(e),e.nullable=()=>Db(e),e.nullish=()=>Ob(Db(e)),e.nonoptional=s=>bL(e,s),e.array=()=>Ve(e),e.or=s=>rL([e,s]),e.and=s=>lL(e,s),e.transform=s=>Lb(e,fL(s)),e.default=s=>yL(e,s),e.prefault=s=>xL(e,s),e.catch=s=>jL(e,s),e.pipe=s=>Lb(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)),yN=te("_ZodString",(e,t)=>{Gp.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,o,c)=>K5(e,a,o);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(E5(...a)),e.includes=(...a)=>e.check(T5(...a)),e.startsWith=(...a)=>e.check(O5(...a)),e.endsWith=(...a)=>e.check(D5(...a)),e.min=(...a)=>e.check(_u(...a)),e.max=(...a)=>e.check(dN(...a)),e.length=(...a)=>e.check(fN(...a)),e.nonempty=(...a)=>e.check(_u(1,...a)),e.lowercase=a=>e.check(R5(a)),e.uppercase=a=>e.check(A5(a)),e.trim=()=>e.check(M5()),e.normalize=(...a)=>e.check(L5(...a)),e.toLowerCase=()=>e.check(U5()),e.toUpperCase=()=>e.check($5()),e.slugify=()=>e.check(P5())}),DD=te("ZodString",(e,t)=>{Gp.init(e,t),yN.init(e,t),e.email=s=>e.check(WO(LD,s)),e.url=s=>e.check(i5(MD,s)),e.jwt=s=>e.check(x5(JD,s)),e.emoji=s=>e.check(a5(UD,s)),e.guid=s=>e.check(zb(Ab,s)),e.uuid=s=>e.check(e5(Kc,s)),e.uuidv4=s=>e.check(t5(Kc,s)),e.uuidv6=s=>e.check(n5(Kc,s)),e.uuidv7=s=>e.check(s5(Kc,s)),e.nanoid=s=>e.check(r5($D,s)),e.guid=s=>e.check(zb(Ab,s)),e.cuid=s=>e.check(o5(PD,s)),e.cuid2=s=>e.check(l5(ID,s)),e.ulid=s=>e.check(c5(BD,s)),e.base64=s=>e.check(g5(VD,s)),e.base64url=s=>e.check(y5(QD,s)),e.xid=s=>e.check(u5(qD,s)),e.ksuid=s=>e.check(d5(HD,s)),e.ipv4=s=>e.check(f5(GD,s)),e.ipv6=s=>e.check(h5(FD,s)),e.cidrv4=s=>e.check(m5(KD,s)),e.cidrv6=s=>e.check(p5(ZD,s)),e.e164=s=>e.check(v5(YD,s)),e.datetime=s=>e.check(mD(s)),e.date=s=>e.check(gD(s)),e.time=s=>e.check(vD(s)),e.duration=s=>e.check(bD(s))});function Z(e){return XO(DD,e)}const jt=te("ZodStringFormat",(e,t)=>{xt.init(e,t),yN.init(e,t)}),LD=te("ZodEmail",(e,t)=>{aO.init(e,t),jt.init(e,t)}),Ab=te("ZodGUID",(e,t)=>{sO.init(e,t),jt.init(e,t)}),Kc=te("ZodUUID",(e,t)=>{iO.init(e,t),jt.init(e,t)}),MD=te("ZodURL",(e,t)=>{rO.init(e,t),jt.init(e,t)}),UD=te("ZodEmoji",(e,t)=>{oO.init(e,t),jt.init(e,t)}),$D=te("ZodNanoID",(e,t)=>{lO.init(e,t),jt.init(e,t)}),PD=te("ZodCUID",(e,t)=>{cO.init(e,t),jt.init(e,t)}),ID=te("ZodCUID2",(e,t)=>{uO.init(e,t),jt.init(e,t)}),BD=te("ZodULID",(e,t)=>{dO.init(e,t),jt.init(e,t)}),qD=te("ZodXID",(e,t)=>{fO.init(e,t),jt.init(e,t)}),HD=te("ZodKSUID",(e,t)=>{hO.init(e,t),jt.init(e,t)}),GD=te("ZodIPv4",(e,t)=>{vO.init(e,t),jt.init(e,t)}),FD=te("ZodIPv6",(e,t)=>{xO.init(e,t),jt.init(e,t)}),KD=te("ZodCIDRv4",(e,t)=>{bO.init(e,t),jt.init(e,t)}),ZD=te("ZodCIDRv6",(e,t)=>{SO.init(e,t),jt.init(e,t)}),VD=te("ZodBase64",(e,t)=>{jO.init(e,t),jt.init(e,t)}),QD=te("ZodBase64URL",(e,t)=>{NO.init(e,t),jt.init(e,t)}),YD=te("ZodE164",(e,t)=>{CO.init(e,t),jt.init(e,t)}),JD=te("ZodJWT",(e,t)=>{zO.init(e,t),jt.init(e,t)}),vN=te("ZodNumber",(e,t)=>{oN.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,o,c)=>Z5(e,a,o),e.gt=(a,o)=>e.check(Eb(a,o)),e.gte=(a,o)=>e.check(Qh(a,o)),e.min=(a,o)=>e.check(Qh(a,o)),e.lt=(a,o)=>e.check(_b(a,o)),e.lte=(a,o)=>e.check(Vh(a,o)),e.max=(a,o)=>e.check(Vh(a,o)),e.int=a=>e.check(Tb(a)),e.safe=a=>e.check(Tb(a)),e.positive=a=>e.check(Eb(0,a)),e.nonnegative=a=>e.check(Qh(0,a)),e.negative=a=>e.check(_b(0,a)),e.nonpositive=a=>e.check(Vh(0,a)),e.multipleOf=(a,o)=>e.check(Rb(a,o)),e.step=(a,o)=>e.check(Rb(a,o)),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 $e(e){return N5(vN,e)}const XD=te("ZodNumberFormat",(e,t)=>{_O.init(e,t),vN.init(e,t)});function Tb(e){return C5(XD,e)}const WD=te("ZodBoolean",(e,t)=>{EO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>V5(e,s,a)});function Pr(e){return k5(WD,e)}const eL=te("ZodUnknown",(e,t)=>{RO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>Y5()});function Lm(){return z5(eL)}const tL=te("ZodNever",(e,t)=>{AO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>Q5(e,s,a)});function nL(e){return _5(tL,e)}const sL=te("ZodArray",(e,t)=>{TO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>tD(e,s,a,o),e.element=t.element,e.min=(s,a)=>e.check(_u(s,a)),e.nonempty=s=>e.check(_u(1,s)),e.max=(s,a)=>e.check(dN(s,a)),e.length=(s,a)=>e.check(fN(s,a)),e.unwrap=()=>e.element});function Ve(e,t){return I5(sL,e,t)}const iL=te("ZodObject",(e,t)=>{DO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>nD(e,s,a,o),it(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:Lm()}),e.loose=()=>e.clone({...e._zod.def,catchall:Lm()}),e.strict=()=>e.clone({...e._zod.def,catchall:nL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>tT(e,s),e.safeExtend=s=>nT(e,s),e.merge=s=>sT(e,s),e.pick=s=>WA(e,s),e.omit=s=>eT(e,s),e.partial=(...s)=>iT(xN,e,s[0]),e.required=(...s)=>aT(bN,e,s[0])});function Me(e,t){const s={type:"object",shape:e??{},...we(t)};return new iL(s)}const aL=te("ZodUnion",(e,t)=>{LO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>sD(e,s,a,o),e.options=t.options});function rL(e,t){return new aL({type:"union",options:e,...we(t)})}const oL=te("ZodIntersection",(e,t)=>{MO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>iD(e,s,a,o)});function lL(e,t){return new oL({type:"intersection",left:e,right:t})}const cL=te("ZodRecord",(e,t)=>{UO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>aD(e,s,a,o),e.keyType=t.keyType,e.valueType=t.valueType});function Xu(e,t,s){return new cL({type:"record",keyType:e,valueType:t,...we(s)})}const Mm=te("ZodEnum",(e,t)=>{$O.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,o,c)=>J5(e,a,o),e.enum=t.entries,e.options=Object.values(t.entries);const s=new Set(Object.keys(t.entries));e.extract=(a,o)=>{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 Mm({...t,checks:[],...we(o),entries:c})},e.exclude=(a,o)=>{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 Mm({...t,checks:[],...we(o),entries:c})}});function wn(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Mm({type:"enum",entries:s,...we(t)})}const uL=te("ZodLiteral",(e,t)=>{PO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>X5(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 Ru(e,t){return new uL({type:"literal",values:Array.isArray(e)?e:[e],...we(t)})}const dL=te("ZodTransform",(e,t)=>{IO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>eD(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Fw(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 o=t.transform(s.value,s);return o instanceof Promise?o.then(c=>(s.value=c,s)):(s.value=o,s)}});function fL(e){return new dL({type:"transform",transform:e})}const xN=te("ZodOptional",(e,t)=>{uN.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>gN(e,s,a,o),e.unwrap=()=>e._zod.def.innerType});function Ob(e){return new xN({type:"optional",innerType:e})}const hL=te("ZodExactOptional",(e,t)=>{BO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>gN(e,s,a,o),e.unwrap=()=>e._zod.def.innerType});function mL(e){return new hL({type:"optional",innerType:e})}const pL=te("ZodNullable",(e,t)=>{qO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>rD(e,s,a,o),e.unwrap=()=>e._zod.def.innerType});function Db(e){return new pL({type:"nullable",innerType:e})}const gL=te("ZodDefault",(e,t)=>{HO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>lD(e,s,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yL(e,t){return new gL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Qw(t)}})}const vL=te("ZodPrefault",(e,t)=>{GO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>cD(e,s,a,o),e.unwrap=()=>e._zod.def.innerType});function xL(e,t){return new vL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Qw(t)}})}const bN=te("ZodNonOptional",(e,t)=>{FO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>oD(e,s,a,o),e.unwrap=()=>e._zod.def.innerType});function bL(e,t){return new bN({type:"nonoptional",innerType:e,...we(t)})}const SL=te("ZodCatch",(e,t)=>{KO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>uD(e,s,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jL(e,t){return new SL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const wL=te("ZodPipe",(e,t)=>{ZO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>dD(e,s,a,o),e.in=t.in,e.out=t.out});function Lb(e,t){return new wL({type:"pipe",in:e,out:t})}const NL=te("ZodReadonly",(e,t)=>{VO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>fD(e,s,a,o),e.unwrap=()=>e._zod.def.innerType});function CL(e){return new NL({type:"readonly",innerType:e})}const kL=te("ZodCustom",(e,t)=>{QO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,o)=>W5(e,s)});function zL(e,t={}){return B5(kL,e,t)}function _L(e){return q5(e)}Me({maxConcurrency:$e().int().positive(),maxRequestsPerMinute:$e().int().positive(),maxRequestsPerDay:$e().int().positive()});const Ir=Z().min(1);Z().min(1);const Fp=Me({label:Z().min(1),city:Z().min(1),region:Z().min(1),country:Z().length(2),timezone:Z().optional()}),SN=wn(["citation.lost","citation.gained","run.completed","run.failed"]);Me({id:Z(),projectId:Z(),channel:Ru("webhook"),url:Z().url(),urlDisplay:Z(),urlHost:Z(),events:Ve(SN),enabled:Pr().default(!0),webhookSecret:Z().optional(),createdAt:Z(),updatedAt:Z()});const jN=wn(["cli","api","config-file"]);function EL(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 RL(e,t){return t?e.some(s=>s.label===t):!0}Me({displayName:Z().min(1),canonicalDomain:Z().min(1),ownedDomains:Ve(Z().min(1)).optional(),country:Z().length(2),language:Z().min(2),tags:Ve(Z()).optional(),labels:Xu(Z(),Z()).optional(),providers:Ve(Ir).optional(),locations:Ve(Fp).optional(),defaultLocation:Z().nullable().optional(),configSource:jN.optional()});Me({id:Z(),name:Z(),displayName:Z().optional(),canonicalDomain:Z(),ownedDomains:Ve(Z()).default([]),country:Z().length(2),language:Z().min(2),tags:Ve(Z()).default([]),labels:Xu(Z(),Z()).default({}),locations:Ve(Fp).default([]),defaultLocation:Z().nullable().optional(),configSource:jN.default("cli"),configRevision:$e().int().positive().default(1),createdAt:Z().optional(),updatedAt:Z().optional()});function Um(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function AL(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,a=[];for(const o of t){const c=o.trim();if(!c)continue;const d=Um(c);s.has(d)||(s.add(d),a.push(c))}return a}const TL=Me({name:Z().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:Xu(Z(),Z()).optional().default({})}),OL=Me({preset:Z().optional(),cron:Z().optional(),timezone:Z().optional().default("UTC"),providers:Ve(Ir).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),DL=Me({channel:Ru("webhook"),url:Z().url(),events:Ve(SN).min(1)}),LL=Me({gsc:Me({propertyUrl:Z()}).optional(),syncSchedule:Me({preset:Z().optional(),cron:Z().optional()}).optional()}).optional(),ML=Me({displayName:Z().min(1),canonicalDomain:Z().min(1),ownedDomains:Ve(Z().min(1)).optional().default([]),country:Z().length(2),language:Z().min(2),keywords:Ve(Z().min(1)).optional().default([]),competitors:Ve(Z().min(1)).optional().default([]),providers:Ve(Ir).optional().default([]),locations:Ve(Fp).optional().default([]),defaultLocation:Z().optional(),schedule:OL,notifications:Ve(DL).optional().default([]),google:LL}).superRefine((e,t)=>{const s=EL(e.locations);s.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${s.join(", ")}`,path:["locations"]}),RL(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Me({apiVersion:Ru("canonry/v1"),kind:Ru("Project"),metadata:TL,spec:ML});const UL=wn(["gsc","ga4"]);Me({id:Z(),domain:Z(),connectionType:UL,propertyId:Z().nullable().optional(),sitemapUrl:Z().nullable().optional(),scopes:Ve(Z()).default([]),createdAt:Z(),updatedAt:Z()});Me({date:Z(),query:Z(),page:Z(),country:Z().nullable().optional(),device:Z().nullable().optional(),clicks:$e(),impressions:$e(),ctr:$e(),position:$e()});const $m=Me({id:Z(),url:Z(),indexingState:Z().nullable().optional(),verdict:Z().nullable().optional(),coverageState:Z().nullable().optional(),pageFetchState:Z().nullable().optional(),robotsTxtState:Z().nullable().optional(),crawlTime:Z().nullable().optional(),lastCrawlResult:Z().nullable().optional(),isMobileFriendly:Pr().nullable().optional(),richResults:Ve(Z()).default([]),inspectedAt:Z()});wn(["stable","reindexed","deindexed","still-missing","new"]);const $L=Me({url:Z(),previousState:Z().nullable(),currentState:Z().nullable(),transitionDate:Z()}),PL=Me({reason:Z(),count:$e(),urls:Ve($m).default([])});Me({summary:Me({total:$e(),indexed:$e(),notIndexed:$e(),deindexed:$e(),percentage:$e()}),lastInspectedAt:Z().nullable(),indexed:Ve($m).default([]),notIndexed:Ve($m).default([]),deindexed:Ve($L).default([]),reasonGroups:Ve(PL).default([])});Me({url:Z(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:Z()});Me({url:Z(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:Z(),status:wn(["success","error"]),error:Z().optional()});Me({date:Z(),indexed:$e(),notIndexed:$e(),reasonBreakdown:Xu(Z(),$e()).default({})});Me({id:Z(),domain:Z(),siteUrl:Z().nullable().optional(),createdAt:Z(),updatedAt:Z()});const Yh=Me({id:Z(),url:Z(),httpCode:$e().nullable().optional(),inIndex:Pr().nullable().optional(),lastCrawledDate:Z().nullable().optional(),inIndexDate:Z().nullable().optional(),inspectedAt:Z(),documentSize:$e().nullable().optional(),anchorCount:$e().nullable().optional(),discoveryDate:Z().nullable().optional()});Me({summary:Me({total:$e(),indexed:$e(),notIndexed:$e(),unknown:$e().optional(),percentage:$e()}),lastInspectedAt:Z().nullable(),indexed:Ve(Yh).default([]),notIndexed:Ve(Yh).default([]),unknown:Ve(Yh).default([]).optional()});Me({query:Z(),impressions:$e(),clicks:$e(),ctr:$e(),averagePosition:$e()});Me({url:Z(),status:wn(["success","error"]),submittedAt:Z(),error:Z().optional()});const IL=wn(["queued","running","completed","partial","failed","cancelled"]),BL=wn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),qL=wn(["manual","scheduled","config-apply"]),HL=wn(["cited","not-cited"]),GL=wn(["new","cited","lost","emerging","not-cited"]);Me({id:Z(),projectId:Z(),kind:BL,status:IL,trigger:qL.default("manual"),location:Z().nullable().optional(),startedAt:Z().nullable().optional(),finishedAt:Z().nullable().optional(),error:Z().nullable().optional(),createdAt:Z()});const FL=Me({uri:Z(),title:Z()});Me({id:Z(),runId:Z(),keywordId:Z(),keyword:Z().optional(),provider:Ir,citationState:HL,transition:GL.optional(),answerText:Z().nullable().optional(),citedDomains:Ve(Z()).default([]),competitorOverlap:Ve(Z()).default([]),groundingSources:Ve(FL).default([]),searchQueries:Ve(Z()).default([]),model:Z().nullable().optional(),location:Z().nullable().optional(),createdAt:Z()});Me({id:Z(),projectId:Z().nullable().optional(),actor:Z(),action:Z(),entityType:Z(),entityId:Z().nullable().optional(),diff:Lm().optional(),createdAt:Z()});Me({id:Z(),projectId:Z(),cronExpr:Z(),preset:Z().nullable().optional(),timezone:Z().default("UTC"),enabled:Pr().default(!0),providers:Ve(Ir).default([]),lastRunAt:Z().nullable().optional(),nextRunAt:Z().nullable().optional(),createdAt:Z(),updatedAt:Z()});Me({preset:Z().optional(),cron:Z().optional(),timezone:Z().optional().default("UTC"),enabled:Pr().optional().default(!0),providers:Ve(Ir).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});Me({id:Z(),projectId:Z(),propertyId:Z(),clientEmail:Z(),connected:Pr(),createdAt:Z(),updatedAt:Z()});Me({date:Z(),landingPage:Z(),sessions:$e(),organicSessions:$e(),users:$e()});Me({totalSessions:$e(),totalOrganicSessions:$e(),totalUsers:$e(),topPages:Ve(Me({landingPage:Z(),sessions:$e(),organicSessions:$e(),users:$e()})),lastSyncedAt:Z().nullable()});function Pm({state:e}){return r.jsx(st,{tone:rR(e),children:Gu(e)})}function Mb(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"?as.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},d.value):d.value).filter(Boolean);const o=s.map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${o.join("|")})`,"gi");return a.flatMap((d,f)=>d.value.split(c).map((p,v)=>p?v%2===1?d.type==="bold"?as.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},as.createElement("strong",{className:"text-zinc-200 font-semibold"},p)):as.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},p):d.type==="bold"?as.createElement("strong",{key:`b-${f}-${v}`,className:"text-zinc-200 font-semibold"},p):p:null)).filter(Boolean)}function KL({evidence:e,project:t,onClose:s}){const[a,o]=w.useState(!1),[c,d]=w.useState(-1),[f,m]=w.useState(null),[p,v]=w.useState(!1),[y,x]=w.useState({}),b=AL(t.project),N=new Set(b.map(Um)),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(q=>N.has(q.toLowerCase().replace(/^www\./,"")))+1,M=E.citedDomains.length,A=t.project.displayName||t.project.name,T=[...b.map(Um),A,A.split(" ").slice(0,2).join(" ")].filter(q=>q.trim().length>2),P=R?"cited":E.citationState==="lost"?"lost":E.citationState==="pending"?"pending":"not-cited",X=w.useRef(0),Q=w.useCallback(async q=>{const ce=++X.current;if(q===-1||q===S.length-1){d(-1),m(null),o(!1);return}d(q),o(!1);const H=S[q],J=`${H.runId}::${e.keyword}::${e.provider}`;if(y[J]){m(y[J]);return}v(!0);try{const O=await Tr(H.runId);if(ce!==X.current)return;const F=O.snapshots.find(re=>re.keyword===e.keyword&&re.provider===e.provider)??O.snapshots.find(re=>re.keyword===e.keyword),ie=F?{citationState:F.citationState,provider:F.provider,model:F.model??null,answerSnippet:F.answerText??"",citedDomains:F.citedDomains,competitorDomains:F.competitorOverlap,groundingSources:F.groundingSources,evidenceUrls:[],changeLabel:H.citationState,summary:""}:{citationState:H.citationState,provider:e.provider,model:H.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:H.citationState,summary:"Snapshot data not available for this run."};x(re=>({...re,[J]:ie})),m(ie)}catch{if(ce!==X.current)return;m({citationState:H.citationState,provider:e.provider,model:H.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:H.citationState,summary:"Failed to load historical run data."})}finally{ce===X.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(" · "):"",Se=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 q=E.answerSnippet.split(`
|
|
95
|
+
`),ce=[];let H=[],J=0;const O=()=>{if(H.length===0)return;const F=H.join(" ").trim();F&&ce.push(r.jsx("p",{className:ce.length>0?"mt-2.5":"",children:Mb(F,T)},J++)),H=[]};for(const F of q){const ie=F.trim();if(/^[-\u2013\u2014]{3,}$/.test(ie)){O(),ce.push(r.jsx("hr",{className:"border-zinc-800/60 my-3"},J++));continue}const re=ie.match(/^(#{1,3})\s+(.+)$/);if(re){O();const ue=re[1].length,de=re[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||re[2],fe=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";ce.push(r.jsx("p",{className:fe,children:Mb(de,T)},J++));continue}if(ie===""){O();continue}H.push(ie)}return O(),ce};return r.jsx(Uw,{open:!0,onOpenChange:q=>{q||s()},children:r.jsxs($w,{children:[r.jsx(Lp,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),r.jsxs(Mp,{className:"evidence-modal","aria-describedby":void 0,children:[r.jsxs("div",{className:"evidence-modal-header",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," \\u00b7 ",E.provider||"All providers"]}),r.jsx(Up,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),r.jsxs(Iw,{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:[r.jsx(Hu,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]}),C&&r.jsxs("div",{className:"evidence-modal-timeline",children:[r.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),r.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:S.map((q,ce)=>{const H=c===-1&&ce===S.length-1||c===ce,J=q.citationState==="cited"?"bg-emerald-400":q.citationState==="emerging"?"bg-amber-400":q.citationState==="lost"?"bg-rose-400":"bg-zinc-600",F=new Date(q.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),ie=!!(q.model&&ce>0&&S[ce-1]?.model&&S[ce-1].model!==q.model);return r.jsxs("button",{type:"button",className:`evidence-run-dot ${H?"evidence-run-dot--selected":""}`,onClick:()=>Q(ce===S.length-1?-1:ce),"aria-label":[`Run ${F}: ${q.citationState}`,q.model?`model ${q.model}`:null,ie?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":H,children:[r.jsx("span",{className:`size-2 rounded-full ${J} ${ie?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),r.jsx("span",{className:"text-[10px] text-zinc-500",children:F})]},ce)})}),c>=0&&c<S.length&&r.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(S[c].createdAt).toLocaleString()," \\u2014 ",r.jsx("span",{className:"capitalize",children:S[c].citationState}),r.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&&r.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(q=>r.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${q.fromModel??"unknown"} -> ${q.toModel??"unknown"} on ${new Date(q.createdAt).toLocaleDateString()}`},`${q.runId}:${q.toModel??"unknown"}`))})]}),r.jsxs("div",{className:"evidence-modal-body",children:[p&&r.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"}),!p&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"evidence-modal-main",children:[r.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${P}`,children:[r.jsx("p",{className:`evidence-position-label evidence-position-label--${P}`,children:Se.label}),r.jsx("p",{className:`evidence-position-title evidence-position-title--${P}`,children:Se.title}),r.jsx("p",{className:"evidence-position-meta",children:Se.meta}),ke&&r.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:ke})]}),E.answerSnippet&&r.jsxs("div",{children:[r.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),r.jsx("div",{className:`answer-snippet-block ${a?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:B()}),E.answerSnippet.length>280&&r.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>o(!a),children:a?"↑ Collapse":"↓ Show full answer"})]}),!E.answerSnippet&&!p&&r.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&&r.jsxs("div",{children:[r.jsx("p",{className:"drawer-section-label",children:R?"Why you're cited":"What to fix"}),r.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((q,ce)=>r.jsxs("div",{className:"action-item",children:[r.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?r.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),r.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),r.jsx("span",{className:"action-item-text",children:q})]},ce))})]}),E.summary&&r.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),r.jsxs("div",{className:"evidence-modal-sidebar",children:[E.citedDomains.length>0&&r.jsxs("div",{children:[r.jsx("p",{className:"drawer-section-label",children:"Who was cited \\u2014 in order"}),r.jsxs("div",{className:"citation-leaderboard",children:[E.citedDomains.map((q,ce)=>{const H=q.toLowerCase().replace(/^www\./,""),J=N.has(H),O=!J&&E.competitorDomains.some(ie=>ie.toLowerCase().replace(/^www\./,"")===H),F=J?"you":O?"competitor":"other";return r.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${F}`,children:[r.jsxs("span",{className:"citation-leaderboard-rank",children:["#",ce+1]}),r.jsx("span",{className:"citation-leaderboard-domain",children:q}),J&&r.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),O&&r.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},q)}),!R&&r.jsxs("div",{className:"citation-leaderboard-item citation-leaderboard-item--not-cited border-dashed",children:[r.jsx("span",{className:"citation-leaderboard-rank text-zinc-600",children:"—"}),r.jsx("span",{className:"citation-leaderboard-domain text-zinc-600",children:t.project.canonicalDomain}),r.jsx("span",{className:"citation-leaderboard-tag text-zinc-600",children:"Not cited"})]})]})]}),E.groundingSources.length>0&&r.jsxs("div",{children:[r.jsxs("p",{className:"drawer-section-label",children:["Grounding sources (",E.groundingSources.length,")"]}),r.jsx("ul",{className:"grid gap-0.5",children:E.groundingSources.map((q,ce)=>r.jsx("li",{className:"truncate text-sm",children:r.jsx("a",{href:q.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:q.title||q.uri})},ce))})]}),E.evidenceUrls.length>0&&r.jsxs("div",{children:[r.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),r.jsx("ul",{className:"grid gap-1",children:E.evidenceUrls.map(q=>r.jsx("li",{className:"truncate text-sm",children:r.jsx("a",{href:q,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:q})},q))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.evidenceUrls.length===0&&r.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 Jh=[{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 Wu(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 ZL=Wu({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"}),VL=Wu({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"}),QL=Wu({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"}),YL=Wu({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"}),JL=[{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"])}];Jh[0],Jh[1],ss(["cited","cited","cited","cited","cited"]),Jh[2],2/7,ss(["not-cited","not-cited","not-cited","cited"]);function XL(e,t){return e.projects.find(s=>s.project.id===t)}function WL(e,t){return e.runs.find(s=>s.id===t)}function e4(e,t){for(const s of e.projects){const a=s.visibilityEvidence.find(o=>o.id===t);if(a)return{project:s,evidence:a}}}function wN(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 Ub(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function t4(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 o=Math.floor(a/60),c=a%60;return`${o}m ${c}s`}function NN(e){return e==="answer-visibility"?"Answer visibility sweep":e}function n4(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function Kp(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:NN(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Ub(e.startedAt):Ub(e.createdAt),duration:t4(e.startedAt,e.finishedAt),statusDetail:e.error?CN(e.error):s4(e),summary:i4(e),triggerLabel:n4(e.trigger)}}function CN(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 s4(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?CN(e.error):"Run failed.";default:return""}}function i4(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 kN(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 a4(e){return e>=70?"positive":e>=40?"caution":"negative"}function r4(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function o4(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function l4(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const c of e){const d=c.keywordId,f=t.get(d)??{cited:!1,competitorOverlap:new Set};c.citationState==="cited"&&(f.cited=!0);for(const m of c.competitorOverlap)f.competitorOverlap.add(m);t.set(d,f)}const s=t.size,a=[...t.values()].filter(c=>!c.cited&&c.competitorOverlap.size>0).length,o=a===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${a}`,delta:`${a} of ${s} key phrases at risk`,tone:o4(a,s),description:a>0?`${a} tracked ${o} currently cite competitors without citing your domain.`:"No competitive key phrase gaps detected in the latest visibility run.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[],progress:s>0?a/s:0}}function c4(e,t){return e&&e.summary.total>0?{provider:"Google",...e.summary}:t&&t.summary.total>0?{provider:"Bing",...t.summary,deindexed:0}:e?{provider:"Google",...e.summary}:t?{provider:"Bing",...t.summary,deindexed:0}:null}function u4(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function d4(e,t){const s=c4(e,t);if(!s||s.total===0)return{label:"Index Coverage",value:"No data",delta:"Connect GSC or Bing",tone:"neutral",description:"Connect Google Search Console or Bing Webmaster Tools and inspect your sitemap to populate coverage.",tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]};const a=s.notIndexed===1?"URL is":"URLs are",o=s.deindexed===1?"URL":"URLs";return{label:"Index Coverage",value:`${Math.round(s.percentage)}`,delta:`${s.provider} · ${s.indexed} of ${s.total} indexed`,tone:u4(s),description:s.provider==="Google"&&s.deindexed>0?`${s.deindexed} deindexed ${o} detected in the latest Google Search Console inspection.`:`${s.notIndexed} ${a} not indexed in ${s.provider==="Google"?"Google Search Console":"Bing Webmaster Tools"}.`,tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]}}function zN(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 o=a/e.length;return o>=.5?{label:"High",count:a}:o>=.2?{label:"Moderate",count:a}:{label:"Low",count:a}}function f4(e,t,s,a){const o=[];let c=0;const d=new Set;if(s){const f=new Map;for(const x of s.snapshots)if(x.keyword){const b=`${x.keyword}::${x.provider}`;f.set(b,x)}const m=new Set(s.snapshots.map(x=>x.provider)),p=new Set(t.flatMap(x=>Object.keys(x.providerRuns??{}))),v=[...new Set([...m,...p])].sort(),y=v.length>0?v:["gemini"];for(const x of t){if(x.runs.length===0)continue;d.add(x.keyword);const N=x.runs.at(-1)?.transition??"not-cited";for(const S of y){const C=f.get(`${x.keyword}::${S}`),k=(x.providerRuns?.[S]?.length??0)>0;if(!C&&!k)continue;const E=C?.model??null,R=E?`${S}:${E}`:null,z=R?x.modelRuns?.[R]:void 0,L=x.providerRuns?.[S],M=(L?.length?L:null)??(z?.length?z:null),A=L?.length?"provider":z?.length?"model":"keyword",T=M?M.at(-1).transition:N,P=M?.at(-1)?.citationState,X=C?T==="lost"?"lost":T==="emerging"?"emerging":C.citationState==="cited"?"cited":"not-cited":P==="cited"?"cited":"not-cited",Q=Im(M||x.runs),se=h4(x,S),pe=(M??x.runs).map(q=>({runId:q.runId,citationState:q.citationState,createdAt:q.createdAt,model:se.get(q.runId)??null})),ke=m4(pe),Se=A==="provider"&&ke.length<=1?"model":A,B=p4(pe);o.push({id:`evidence_${e}_${c++}`,keyword:x.keyword,provider:C?.provider??S,model:C?.model??null,location:C?.location??null,citationState:X,changeLabel:g4(T,Q),answerSnippet:C?.answerText??"",citedDomains:C?.citedDomains??[],evidenceUrls:[],competitorDomains:C?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:C?.groundingSources??[],summary:y4(X,x.keyword),runHistory:pe,historyScope:Se,modelsSeen:ke,modelTransitions:B})}}}for(const f of a)d.has(f.keyword)||o.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 o}function h4(e,t){const s=new Map,a=`${t}:`;for(const[o,c]of Object.entries(e.modelRuns??{})){if(!o.startsWith(a))continue;const d=o.slice(a.length),f=d==="unknown"?null:d;for(const m of c)s.set(m.runId,f)}return s}function m4(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function p4(e){const t=[];let s=null;for(const a of e){const o=a.model??null;o!==s&&s!==null&&t.push({runId:a.runId,createdAt:a.createdAt,fromModel:s,toModel:o}),s=o}return t}function Im(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 g4(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 y4(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 $b(e,t){const s=new Set(t),a=new Map;for(const o of e)if(o.keyword)for(const c of o.competitorOverlap){if(!s.has(c))continue;const d=a.get(c)??new Set;d.add(o.keyword),a.set(c,d)}return a}const Xh=3;function v4(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:o,trackedCompetitors:c}=e,d=[],f=[],m=new Set;for(const k of t)k.citationState==="lost"&&(m.has(k.keyword)||(m.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} key phrase${f.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:f});const p=$b(a,c),v=$b(o,c);for(const k of c){const E=p.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} key phrase${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=[],N=new Set;for(const[k,{transition:E,citationState:R}]of y){if(!(E==="emerging"||E==="new"&&R==="cited"))continue;N.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"&&(N.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} key phrase${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 ${N.size} key phrase${N.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<Xh||k.runs.at(-1)?.citationState!=="not-cited")continue;if(Im(k.runs)>=Xh){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} key phrase${C.length>1?"s":""} uncited for ${Xh}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:C});for(const k of c){const E=p.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} key phrase${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 x4(e,t){if(t.length===0){const m=new Set(e.filter(p=>p.citationState==="cited").map(p=>p.keyword)).size;return{gained:m,lost:0,tone:m>0?"positive":"neutral",hasPreviousRun:!1}}const s=m=>{const p=new Set;for(const v of m)v.citationState==="cited"&&v.keyword&&p.add(v.keyword);return p},a=s(e),o=s(t);let c=0,d=0;for(const m of a)o.has(m)||c++;for(const m of o)a.has(m)||d++;const f=d>c?"negative":c>d?"positive":"neutral";return{gained:c,lost:d,tone:f,hasPreviousRun:!0}}function b4(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: ${NN(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 S4(e){const t=wN(e.project),s=f4(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],o=kN(a),c=l4(a),d=d4(e.gscCoverage,e.bingCoverage),f=zN(a,e.competitors.map(b=>b.domain)),m=v4({evidence:s,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(b=>b.domain)}),p=[...e.runs].sort((b,N)=>N.createdAt.localeCompare(b.createdAt)),v=p.map(b=>Kp(b,e.project.displayName||e.project.name)),y=new Map;for(const b of a){const N=b.provider||"gemini",S=b.model??null,C=`${N}::${S??"unknown"}`,k=y.get(C)??{provider:N,model:S,cited:0,total:0};k.total++,b.citationState==="cited"&&k.cited++,y.set(C,k)}const x=[...y.values()].sort((b,N)=>b.provider.localeCompare(N.provider)||(b.model??"").localeCompare(N.model??"")).map(({provider:b,model:N,cited:S,total:C})=>({provider:b,model:N,score:C>0?Math.round(S/C*100):0,cited:S,total:C}));return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:a.length>0?`${o.score}`:"No data",delta:a.length>0?`${o.citedCount} of ${o.totalCount} key phrases visible`:"Run a sweep first",tone:a.length>0?a4(o.score):"neutral",description:a.length>0?`${o.citedCount} of ${o.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:o.citedCount,total:o.totalCount},gapKeyPhrases:c,indexCoverage:d,providerScores:x,competitorPressure:{label:"Competitor Pressure",value:f.label,delta:f.count>0?`${f.count} overlapping citations`:"No overlap detected",tone:r4(f.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:b4(p),movementSummary:x4(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:s,competitors:e.competitors.map((b,N)=>{const S=new Set;for(const z of a)(z.competitorOverlap.includes(b.domain)||z.citedDomains.includes(b.domain))&&z.keyword&&S.add(z.keyword);const C=[...S],k=new Set(a.map(z=>z.keyword).filter(Boolean)),E=k.size>0?C.length/k.size:0,R=E>=.5?"High":E>=.2?"Moderate":C.length>0?"Low":"None";return{id:b.id||`comp_${N}`,domain:b.domain,citationCount:C.length,totalKeywords:k.size,pressureLabel:R,citedKeywords:C,movement:"",notes:""}}),recentRuns:v.slice(0,5)}}function j4(e){const t=wN(e.project),s=e.latestRunDetail?.snapshots??[],a=kN(s),o=zN(s,e.competitors.map(m=>m.domain)),d=[...e.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt))[0],f=d?Kp(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(m=>m.provider)).size} provider${new Set(s.map(m=>m.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:o.label}}function w4(e,t){const s=[],a=[],o=[];for(const d of e){a.push(S4(d)),o.push(j4(d));const f=[...d.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt));for(const m of f)s.push(Kp(m,d.project.displayName||d.project.name))}s.sort((d,f)=>f.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:o,attentionItems:c?N4(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 N4(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 o=s.recentRuns.filter(c=>c.status==="running"||c.status==="queued");o.length>0&&t.push({id:`attention_${s.project.id}_active`,tone:"neutral",title:`${s.project.displayName||s.project.name} has active runs`,detail:`${o.length} run${o.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"]},_N=w.createContext(null);_N.Provider;function cl(){return w.useContext(_N)}function Ra(e){const s=cl()?.dashboard??null,a=Fo({queryKey:Ti.projects.all,queryFn:BS,enabled:!s}),o=Fo({queryKey:Ti.runs.all,queryFn:qS,enabled:!s,refetchInterval:N=>N.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),c=Fo({queryKey:Ti.settings,queryFn:()=>Pu().catch(()=>null),enabled:!s}),d=a.data??[],f=o.data??[],m=lz({queries:d.map(N=>{const S=f.filter(k=>k.projectId===N.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(N.id,C[0]?.id),queryFn:async()=>{const[k,E,R,z,L,M,A]=await Promise.all([HS(N.name).catch(()=>[]),xp(N.name).catch(()=>[]),bp(N.name).catch(()=>[]),C[0]?Tr(C[0].id).catch(()=>null):Promise.resolve(null),C[1]?Tr(C[1].id).catch(()=>null):Promise.resolve(null),Iu(N.name).catch(()=>null),Bu(N.name).catch(()=>null)]);return{project:N,runs:S,keywords:k,competitors:E,timeline:R,latestRunDetail:z,previousRunDetail:L,gscCoverage:M,bingCoverage:A}},enabled:!s&&a.isSuccess&&o.isSuccess}})}),p=m.every(N=>N.isSuccess),v=w.useMemo(()=>{if(s)return s;if(!a.data||!o.data||d.length>0&&!p)return null;const N=m.map(S=>S.data).filter(S=>S!=null);return w4(N,c.data??null)},[s,a.data,o.data,c.data,p,m,d.length]),y=!s&&(a.isError||o.isError),x=!s&&!v&&!y,b=w.useCallback(async()=>{await Promise.all([a.refetch(),o.refetch(),c.refetch()])},[a.refetch,o.refetch,c.refetch]);return{dashboard:v,isLoading:x,isError:y,refetch:b}}function C4(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Pb=C4(),Bm=Pb==="/"?"":Pb.replace(/\/$/,"");async function k4(){const e=Bm?`${Bm}/health`:"/health",t=await Mj(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 ed(e,t){return Fo({queryKey:Ti.health,queryFn:k4,enabled:e,refetchInterval:15e3,initialData:t})}function z4(e){return Fo({queryKey:Ti.runs.detail(e??""),queryFn:()=>Tr(e),enabled:!!e,refetchInterval:t=>{const s=t.state.data?.status;return s==="running"||s==="queued"?3e3:!1}})}function ul(){const e=ka(),t=$u({strict:!1}),s=jn({select:m=>m.location.pathname}),a=t.runId??null,o=t.evidenceId??null;return{runId:a,evidenceId:o,openRun:m=>e({to:s,from:rs.to,search:p=>({...p,runId:m,evidenceId:void 0})}),openEvidence:m=>e({to:s,from:rs.to,search:p=>({...p,evidenceId:m,runId:void 0})}),closeDrawer:()=>e({to:s,from:rs.to,search:m=>({...m,runId:void 0,evidenceId:void 0})})}}const Ib=[{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"}],Bb=e=>({label:e,state:"checking",detail:"Checking service health"}),_4={apiStatus:Bb("API"),workerStatus:Bb("Worker")};function E4(){const e=cl(),{dashboard:t,isLoading:s,refetch:a}=Ra(),d=ed(!e,e?.health).data??e?.health??_4,f=d2(),{runId:m,evidenceId:p,closeDrawer:v}=ul(),[y,x]=w.useState(!1),b=z4(m),N=b.data??null,S=b.isLoading;w.useEffect(()=>{N&&N.status!=="running"&&N.status!=="queued"&&a()},[N?.status,a]),w.useEffect(()=>{x(!1)},[f.pathname]),w.useEffect(()=>{if(typeof window>"u"||!m&&!p)return;const z=L=>{L.key==="Escape"&&v()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[m,p,v]);const C=t??e?.dashboard??null,k=m&&C?WL(C,m):void 0,E=p&&C?e4(C,p):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 r.jsxs("div",{className:"app-shell",children:[r.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),r.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[r.jsx("div",{className:"sidebar-brand",children:r.jsx(nb,{})}),r.jsxs("nav",{className:"sidebar-nav",children:[r.jsxs(yt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[r.jsx(D2,{className:"sidebar-icon"}),r.jsx("span",{children:"Overview"})]}),r.jsxs(yt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[r.jsx(T2,{className:"sidebar-icon"}),r.jsx("span",{children:"Projects"})]}),r.jsxs(yt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[r.jsx($2,{className:"sidebar-icon"}),r.jsx("span",{children:"Runs"})]}),r.jsxs(yt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[r.jsx(K2,{className:"sidebar-icon"}),r.jsx("span",{children:"Settings"})]}),s?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(z=>r.jsxs("div",{className:"sidebar-skeleton-item",children:[r.jsx("span",{className:"skeleton-circle size-2"}),r.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+z*15}%`}})]},z))]}):C&&C.projects.length>0?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"sidebar-section-title",children:"Projects"}),C.projects.map(z=>{const L=z.visibilitySummary.tone;return r.jsxs(yt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[r.jsx("span",{className:`sidebar-dot sidebar-dot-${L}`}),r.jsx("span",{children:z.project.name})]},z.project.id)})]}):s?null:r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"sidebar-section-title",children:"Resources"}),r.jsxs(yt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[r.jsx(q2,{className:"sidebar-icon"}),r.jsx("span",{children:"Setup"})]})]})]}),r.jsx("div",{className:"sidebar-footer",children:Ib.map(z=>r.jsx("a",{className:"sidebar-footer-link",href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]}),r.jsxs("div",{className:"main-area",children:[r.jsxs("header",{className:"topbar",children:[r.jsxs("div",{className:"topbar-left",children:[r.jsx("div",{className:"topbar-brand-mobile",children:r.jsx(nb,{compact:!0})}),r.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[r.jsx(yt,{to:"/",children:"Home"}),r.jsx(qu,{className:"breadcrumb-sep size-3"}),r.jsx("span",{className:"breadcrumb-current",children:R})]})]}),r.jsxs("div",{className:"topbar-actions",children:[r.jsxs("div",{className:"health-pill-row",children:[r.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),r.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),r.jsxs(oe,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>x(z=>!z),children:[r.jsx(M2,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),r.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${y?"mobile-nav-open":""}`,children:[r.jsxs(oe,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>x(!1),children:[r.jsx(Hu,{className:"size-5"}),r.jsx("span",{className:"sr-only",children:"Close navigation"})]}),r.jsx(yt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),r.jsx(yt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),r.jsx(yt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),r.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?r.jsxs("div",{className:"mobile-nav-section",children:[r.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),C.projects.map(z=>r.jsx(yt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"mobile-nav-link",children:z.project.name},z.project.id))]}):null]}),r.jsx("main",{id:"content",className:"page-shell",children:s&&!e?r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-40"}),r.jsx("div",{className:"skeleton-text-sm w-72"})]}),r.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(z=>r.jsxs("div",{className:"page-skeleton-card",children:[r.jsx("div",{className:"skeleton-text w-24"}),r.jsx("div",{className:"skeleton-text w-full"}),r.jsx("div",{className:"skeleton-text-sm w-3/4"})]},z))}),r.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(z=>r.jsxs("div",{className:"page-skeleton-card",children:[r.jsx("div",{className:"skeleton-text w-20"}),r.jsx("div",{className:"space-y-2",children:[1,2,3].map(L=>r.jsx("div",{className:"skeleton-text-sm w-full"},L))})]},z))})]}):r.jsx(yp,{})}),r.jsxs("footer",{className:"footer",children:[r.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noreferrer",className:"footer-brand",children:[r.jsx(R2,{className:"size-3.5"}),r.jsx("span",{children:"Canonry"})]}),r.jsx("div",{className:"footer-links",children:Ib.map(z=>r.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),k?r.jsxs(KA,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:v,children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[r.jsx(Fu,{status:k.status}),r.jsx("span",{className:"text-zinc-400",children:k.startedAt}),r.jsx("span",{className:"text-zinc-500",children:k.duration}),r.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&r.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),r.jsxs("div",{className:"mt-4",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?r.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):N&&N.snapshots.length>0?r.jsxs("div",{className:"space-y-2",children:[N.snapshots.map(z=>r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[r.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:z.keyword??"Unknown key phrase"}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(tl,{provider:z.provider}),r.jsx(iw,{variant:z.citationState==="cited"?"success":"neutral",children:z.citationState})]})]}),z.model&&r.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:z.model}),z.citedDomains.length>0&&r.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[r.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",z.citedDomains.join(", ")]}),z.competitorOverlap.length>0&&r.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",z.competitorOverlap.join(", ")]}),z.groundingSources&&z.groundingSources.length>0&&r.jsxs("details",{className:"mt-2",children:[r.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":""]}),r.jsx("ul",{className:"mt-1 space-y-0.5",children:z.groundingSources.map((L,M)=>r.jsx("li",{className:"text-xs text-zinc-500 truncate",children:r.jsx("a",{href:L.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:L.title||L.uri})},M))})]}),z.answerText&&r.jsxs("details",{className:"mt-1",children:[r.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),r.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:z.answerText})]})]},z.id)),N.status==="running"&&r.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[r.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):N&&N.status==="running"?r.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[r.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):N&&N.status==="queued"?r.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[r.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):N&&N.error?r.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[r.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),r.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:nE(N.error)})]}):r.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?r.jsx(KL,{evidence:E.evidence,project:E.project,onClose:v}):null]})}class R4 extends w.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?r.jsx("div",{className:"page-container",children:r.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[r.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:r.jsx(Y2,{className:"size-6 text-rose-400"})}),r.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),r.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),r.jsxs("div",{className:"flex gap-3 mt-2",children:[r.jsxs(oe,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[r.jsx(G2,{className:"size-3.5 mr-1.5"}),"Try again"]}),r.jsx(oe,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const De=w.forwardRef(({className:e,...t},s)=>r.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 qm=w.forwardRef(({className:e,...t},s)=>r.jsx("div",{ref:s,className:Qn("flex flex-col gap-1.5 p-5",e),...t}));qm.displayName="CardHeader";const Hm=w.forwardRef(({className:e,...t},s)=>r.jsx("h3",{ref:s,className:Qn("font-medium tracking-tight text-zinc-50",e),...t}));Hm.displayName="CardTitle";const Gm=w.forwardRef(({className:e,...t},s)=>r.jsx("p",{ref:s,className:Qn("text-sm text-zinc-500",e),...t}));Gm.displayName="CardDescription";const ou=w.forwardRef(({className:e,...t},s)=>r.jsx("div",{ref:s,className:Qn("p-5 pt-0",e),...t}));ou.displayName="CardContent";function A4({points:e,tone:t}){const s=w.useId();if(e.length===0)return null;const a=42,o=132,c=5,d=Math.min(...e),m=Math.max(...e)-d||1,p=o-c*2,v=a-c*2,y=e.map((x,b)=>{const N=c+b/Math.max(e.length-1,1)*p,S=c+(1-(x-d)/m)*v;return`${N},${S}`}).join(" ");return r.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${o} ${a}`,"aria-hidden":"true",children:[r.jsx("defs",{children:r.jsx("clipPath",{id:s,children:r.jsx("rect",{x:c,y:c,width:p,height:v,rx:"8"})})}),r.jsx("line",{className:"sparkline-guide",x1:c,x2:o-c,y1:a-c,y2:a-c}),r.jsx("polyline",{clipPath:`url(#${s})`,points:y,vectorEffect:"non-scaling-stroke"})]})}function T4(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function O4(e,t,s){return e.map(a=>{if(a.id==="api")return{...a,tone:Nu(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:Nu(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const o=s.providerStatuses.filter(m=>m.state==="ready").length,c=s.providerStatuses.length,d=o>0,f=s.providerStatuses.filter(m=>m.state==="ready").map(m=>T4(m)).join(" · ");return{...a,label:"Providers",tone:d?"positive":"caution",detail:`${o} of ${c} configured`,meta:f||"None configured"}})}function D4(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 L4(e,t,s){const a=D4(t,s),o=structuredClone(e);return o.healthChecks=o.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"}}),o.launchState.enabled=a===void 0,o.launchState.blockedReason=a,o.launchState.summary=a??"Queue a visibility sweep first, then follow with a site audit to explain movement.",o}function M4({project:e}){return r.jsxs(yt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[r.jsxs("div",{className:"project-row-primary",children:[r.jsxs("div",{children:[r.jsx("p",{className:"project-name",children:e.project.name}),r.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),r.jsx("p",{className:"project-insight",children:e.insight})]}),r.jsx("div",{className:"project-row-stat",children:r.jsxs("div",{className:"metric-inline-block",children:[r.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),r.jsx("p",{className:"metric-inline-value",children:e.visibilityScore}),r.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),r.jsx("div",{className:"project-row-stat",children:r.jsxs("div",{className:"metric-inline-block",children:[r.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),r.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),r.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Gu(e.lastRun.status)]})]})}),r.jsx("div",{className:"project-row-chart",children:r.jsx(A4,{points:e.trend,tone:aw(e.lastRun.status)})}),r.jsx("span",{className:"project-row-link",children:r.jsx(qu,{className:"h-4 w-4 text-zinc-500"})})]})}function U4(){const e=cl(),{dashboard:t,isLoading:s}=Ra(),a=t??e?.dashboard;if(!a||s)return r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-32"}),r.jsx("div",{className:"skeleton-text-sm w-64"})]}),r.jsx("div",{className:"space-y-3",children:[1,2,3].map(v=>r.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx("div",{className:"skeleton-text w-36"}),r.jsx("div",{className:"skeleton-text-sm w-48"})]}),r.jsx("div",{className:"skeleton-text w-16"}),r.jsx("div",{className:"skeleton-text w-16"}),r.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},v))})]});const o=a.portfolioOverview,f=ed(!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=O4(o.systemHealth,f,a.settings),{openRun:p}=ul();return r.jsxs("div",{className:"page-container",children:[r.jsxs("div",{className:"page-header",children:[r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:"Portfolio"}),r.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),r.jsx("div",{className:"page-header-right",children:r.jsx("p",{className:"text-[11px] text-zinc-600",children:o.lastUpdatedAt})})]}),o.projects.length>0?r.jsx("div",{className:"project-list project-list-scrollable",children:o.projects.map(v=>r.jsx(M4,{project:v},v.project.id))}):r.jsxs(De,{className:"surface-card empty-card",children:[r.jsx("h3",{children:o.emptyState?.title??"No projects yet"}),r.jsx("p",{className:"supporting-copy",children:o.emptyState?.detail}),r.jsx(oe,{size:"sm",asChild:!0,children:r.jsx(yt,{to:o.emptyState?.ctaHref==="/setup"||!o.emptyState?.ctaHref?"/setup":"/",children:o.emptyState?.ctaLabel??"Launch setup"})})]}),r.jsxs("div",{className:"overview-secondary-grid",children:[o.attentionItems.length>0&&r.jsxs("section",{className:"overview-secondary-section",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),r.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),r.jsx("div",{className:"attention-list attention-list-scrollable",children:o.attentionItems.map(v=>r.jsxs(yt,{to:v.href,className:`attention-item attention-item-${v.tone}`,children:[r.jsxs("div",{children:[r.jsx("p",{className:"attention-title",children:v.title}),r.jsx("p",{className:"attention-detail",children:v.detail})]}),r.jsx("span",{className:"attention-action",children:v.actionLabel})]},v.id))})]}),r.jsxs("section",{className:"overview-secondary-section",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),r.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),r.jsx("div",{className:"compact-stack compact-stack-scrollable",children:o.recentRuns.length>0?o.recentRuns.map(v=>r.jsxs("button",{className:"compact-run",type:"button",onClick:()=>p(v.id),children:[r.jsxs("div",{children:[r.jsx("p",{className:"compact-run-title",children:v.projectName}),r.jsx("p",{className:"compact-run-detail",children:v.summary})]}),r.jsx(Fu,{status:v.status})]},v.id)):r.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),r.jsxs("section",{className:"page-section",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),r.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),r.jsx("div",{className:"health-grid",children:m.map(v=>r.jsxs(De,{className:"surface-card compact-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:v.label}),r.jsx("h3",{children:v.detail})]}),r.jsx(st,{tone:v.tone,children:v.label})]}),r.jsx("p",{className:"supporting-copy",children:v.meta})]},v.id))})]})]})}const Zp=Symbol.for("yaml.alias"),Fm=Symbol.for("yaml.document"),Ui=Symbol.for("yaml.map"),EN=Symbol.for("yaml.pair"),Ss=Symbol.for("yaml.scalar"),Br=Symbol.for("yaml.seq"),Kn=Symbol.for("yaml.node.type"),Aa=e=>!!e&&typeof e=="object"&&e[Kn]===Zp,td=e=>!!e&&typeof e=="object"&&e[Kn]===Fm,dl=e=>!!e&&typeof e=="object"&&e[Kn]===Ui,Dt=e=>!!e&&typeof e=="object"&&e[Kn]===EN,ft=e=>!!e&&typeof e=="object"&&e[Kn]===Ss,fl=e=>!!e&&typeof e=="object"&&e[Kn]===Br;function Tt(e){if(e&&typeof e=="object")switch(e[Kn]){case Ui:case Br:return!0}return!1}function Ot(e){if(e&&typeof e=="object")switch(e[Kn]){case Zp:case Ui:case Ss:case Br:return!0}return!1}const RN=e=>(ft(e)||Tt(e))&&!!e.anchor,fa=Symbol("break visit"),$4=Symbol("skip children"),Vo=Symbol("remove node");function qr(e,t){const s=P4(t);td(e)?Nr(null,e.contents,s,Object.freeze([e]))===Vo&&(e.contents=null):Nr(null,e,s,Object.freeze([]))}qr.BREAK=fa;qr.SKIP=$4;qr.REMOVE=Vo;function Nr(e,t,s,a){const o=I4(e,t,s,a);if(Ot(o)||Dt(o))return B4(e,a,o),Nr(e,o,s,a);if(typeof o!="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 o}function P4(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 I4(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 B4(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(td(a))a.contents=s;else{const o=Aa(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const q4={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},H4=e=>e.replace(/[!,[\]{}]/g,t=>q4[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]+/),o=a.shift();switch(o){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 ${o}`,!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,o]=t.match(/^(.*!)([^!]*)$/s);o||s(`The ${t} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(o)}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+H4(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 o;if(t&&a.length>0&&Ot(t.contents)){const c={};qr(t.contents,(d,f)=>{Ot(f)&&f.tag&&(c[f.tag]=!0)}),o=Object.keys(c)}else o=[];for(const[c,d]of a)c==="!!"&&d==="tag:yaml.org,2002:"||(!t||o.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 AN(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 TN(e){const t=new Set;return qr(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function ON(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function G4(e,t){const s=[],a=new Map;let o=null;return{onAnchor:c=>{s.push(c),o??(o=TN(e));const d=ON(t,o);return o.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 o=0,c=a.length;o<c;++o){const d=a[o],f=Cr(e,a,String(o),d);f===void 0?delete a[o]:f!==d&&(a[o]=f)}else if(a instanceof Map)for(const o of Array.from(a.keys())){const c=a.get(o),d=Cr(e,a,o,c);d===void 0?a.delete(o):d!==c&&a.set(o,d)}else if(a instanceof Set)for(const o of Array.from(a)){const c=Cr(e,a,o,o);c===void 0?a.delete(o):c!==o&&(a.delete(o),a.add(c))}else for(const[o,c]of Object.entries(a)){const d=Cr(e,a,o,c);d===void 0?delete a[o]:d!==c&&(a[o]=d)}return e.call(t,s,a)}function Fn(e,t,s){if(Array.isArray(e))return e.map((a,o)=>Fn(a,String(o),s));if(e&&typeof e.toJSON=="function"){if(!s||!RN(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 o=e.toJSON(t,s);return s.onCreate&&s.onCreate(o),o}return typeof e=="bigint"&&!s?.keep?Number(e):e}class Vp{constructor(t){Object.defineProperty(this,Kn,{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:o,reviver:c}={}){if(!td(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 o=="function")for(const{count:m,res:p}of d.anchors.values())o(p,m);return typeof c=="function"?Cr(c,{"":f},"",f):f}}class Qp extends Vp{constructor(t){super(Zp),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)||RN(d))&&a.push(d)}}),s&&(s.aliasResolveCache=a));let o;for(const c of a){if(c===this)break;c.anchor===this.source&&(o=c)}return o}toJSON(t,s){if(!s)return{source:this.source};const{anchors:a,doc:o,maxAliasCount:c}=s,d=this.resolve(o,s);if(!d){const m=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(m)}let f=a.get(d);if(f||(Fn(d,null,s),f=a.get(d)),f?.res===void 0){const m="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(m)}if(c>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=lu(o,d,a)),f.count*f.aliasCount>c)){const m="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(m)}return f.res}toString(t,s,a){const o=`*${this.source}`;if(t){if(AN(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`${o} `}return o}}function lu(e,t,s){if(Aa(t)){const a=t.resolve(e),o=s&&a&&s.get(a);return o?o.count*o.aliasCount:0}else if(Tt(t)){let a=0;for(const o of t.items){const c=lu(e,o,s);c>a&&(a=c)}return a}else if(Dt(t)){const a=lu(e,t.key,s),o=lu(e,t.value,s);return Math.max(a,o)}return 1}const DN=e=>!e||typeof e!="function"&&typeof e!="object";class Re extends Vp{constructor(t){super(Ss),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 F4="tag:yaml.org,2002:";function K4(e,t,s){if(t){const a=s.filter(c=>c.tag===t),o=a.find(c=>!c.format)??a[0];if(!o)throw new Error(`Tag ${t} not found`);return o}return s.find(a=>a.identify?.(e)&&!a.format)}function al(e,t,s){if(td(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:o,onTagObj:c,schema:d,sourceObjects:f}=s;let m;if(a&&e&&typeof e=="object"){if(m=f.get(e),m)return m.anchor??(m.anchor=o(e)),new Qp(m.anchor);m={anchor:null,node:null},f.set(e,m)}t?.startsWith("!!")&&(t=F4+t.slice(2));let p=K4(e,t,d.tags);if(!p){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Re(e);return m&&(m.node=y),y}p=e instanceof Map?d[Ui]:Symbol.iterator in Object(e)?d[Br]:d[Ui]}c&&(c(p),delete s.onTagObj);const v=p?.createNode?p.createNode(s.schema,e,s):typeof p?.nodeClass?.from=="function"?p.nodeClass.from(s.schema,e,s):new Re(e);return t?v.tag=t:p.default||(v.tag=p.tag),m&&(m.node=v),v}function Au(e,t,s){let a=s;for(let o=t.length-1;o>=0;--o){const c=t[o];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 LN extends Vp{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,...o]=t,c=this.get(a,!0);if(Tt(c))c.addIn(o,s);else if(c===void 0&&this.schema)this.set(a,Au(this.schema,o,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}deleteIn(t){const[s,...a]=t;if(a.length===0)return this.delete(s);const o=this.get(s,!0);if(Tt(o))return o.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(t,s){const[a,...o]=t,c=this.get(a,!0);return o.length===0?!s&&ft(c)?c.value:c:Tt(c)?c.getIn(o,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 o=this.get(s,!0);return Tt(o)?o.hasIn(a):!1}setIn(t,s){const[a,...o]=t;if(o.length===0)this.set(a,s);else{const c=this.get(a,!0);if(Tt(c))c.setIn(o,s);else if(c===void 0&&this.schema)this.set(a,Au(this.schema,o,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}}const Z4=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Fs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ya=(e,t,s)=>e.endsWith(`
|
|
97
|
+
`)?Fs(s,t):s.includes(`
|
|
98
|
+
`)?`
|
|
99
|
+
`+Fs(s,t):(e.endsWith(" ")?"":" ")+s,MN="flow",Km="block",cu="quoted";function nd(e,t,s="flow",{indentAtStart:a,lineWidth:o=80,minContentWidth:c=20,onFold:d,onOverflow:f}={}){if(!o||o<0)return e;o<c&&(c=0);const m=Math.max(1+c,1+o-t.length);if(e.length<=m)return e;const p=[],v={};let y=o-t.length;typeof a=="number"&&(a>o-Math.max(2,c)?p.push(0):y=o-a);let x,b,N=!1,S=-1,C=-1,k=-1;s===Km&&(S=qb(e,S,t.length),S!==-1&&(y=S+m));for(let R;R=e[S+=1];){if(s===cu&&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===Km&&(S=qb(e,S,t.length)),y=S+t.length+m,x=void 0;else{if(R===" "&&b&&b!==" "&&b!==`
|
|
101
|
+
`&&b!==" "){const z=e[S+1];z&&z!==" "&&z!==`
|
|
102
|
+
`&&z!==" "&&(x=S)}if(S>=y)if(x)p.push(x),y=x+m,x=void 0;else if(s===cu){for(;b===" "||b===" ";)b=R,R=e[S+=1],N=!0;const z=S>k+1?S-2:C-1;if(v[z])return e;p.push(z),v[z]=!0,y=z+m,x=void 0}else N=!0}b=R}if(N&&f&&f(),p.length===0)return e;d&&d();let E=e.slice(0,p[0]);for(let R=0;R<p.length;++R){const z=p[R],L=p[R+1]||e.length;z===0?E=`
|
|
103
|
+
${t}${e.slice(0,L)}`:(s===cu&&v[z]&&(E+=`${e[z]}\\`),E+=`
|
|
104
|
+
${t}${e.slice(z+1,L)}`)}return E}function qb(e,t,s){let a=t,o=t+1,c=e[o];for(;c===" "||c===" ";)if(t<o+s)c=e[++t];else{do c=e[++t];while(c&&c!==`
|
|
105
|
+
`);a=t,o=t+1,c=e[o]}return a}const sd=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),id=e=>/^(%|---|\.\.\.)/m.test(e);function V4(e,t,s){if(!t||t<0)return!1;const a=t-s,o=e.length;if(o<=a)return!1;for(let c=0,d=0;c<o;++c)if(e[c]===`
|
|
106
|
+
`){if(c-d>a)return!0;if(d=c+1,o-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,o=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(id(e)?" ":"");let d="",f=0;for(let m=0,p=s[m];p;p=s[++m])if(p===" "&&s[m+1]==="\\"&&s[m+2]==="n"&&(d+=s.slice(f,m)+"\\ ",m+=1,f=m,p="\\"),p==="\\")switch(s[m+1]){case"u":{d+=s.slice(f,m);const v=s.substr(m+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(m,6)}m+=5,f=m+1}break;case"n":if(a||s[m+2]==='"'||s.length<o)m+=1;else{for(d+=s.slice(f,m)+`
|
|
107
|
+
|
|
108
|
+
`;s[m+2]==="\\"&&s[m+3]==="n"&&s[m+4]!=='"';)d+=`
|
|
109
|
+
`,m+=2;d+=c,s[m+2]===" "&&(d+="\\"),m+=1,f=m+1}break;default:m+=1}return d=f?d+s.slice(f):s,a?d:nd(d,c,cu,sd(t,!1))}function Zm(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||(id(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
111
|
+
${s}`)+"'";return t.implicitKey?a:nd(a,s,MN,sd(t,!1))}function kr(e,t){const{singleQuote:s}=t.options;let a;if(s===!1)a=Qo;else{const o=e.includes('"'),c=e.includes("'");o&&!c?a=Zm:c&&!o?a=Qo:a=s?Zm:Qo}return a(e,t)}let Vm;try{Vm=new RegExp(`(^|(?<!
|
|
112
|
+
))
|
|
113
|
+
+(?!
|
|
114
|
+
|$)`,"g")}catch{Vm=/\n+(?!\n|$)/g}function uu({comment:e,type:t,value:s},a,o,c){const{blockQuote:d,commentString:f,lineWidth:m}=a.options;if(!d||/\n[\t ]+$/.test(s))return kr(s,a);const p=a.indent||(a.forceBlockIndent||id(s)?" ":""),v=d==="literal"?!0:d==="folded"||t===Re.BLOCK_FOLDED?!1:t===Re.BLOCK_LITERAL?!0:!V4(s,m,p.length);if(!s)return v?`|
|
|
115
|
+
`:`>
|
|
116
|
+
`;let y,x;for(x=s.length;x>0;--x){const L=s[x-1];if(L!==`
|
|
117
|
+
`&&L!==" "&&L!==" ")break}let b=s.substring(x);const N=b.indexOf(`
|
|
118
|
+
`);N===-1?y="-":s===b||N!==b.length-1?(y="+",c&&c()):y="",b&&(s=s.slice(0,-b.length),b[b.length-1]===`
|
|
119
|
+
`&&(b=b.slice(0,-1)),b=b.replace(Vm,`$&${p}`));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
|
+
`)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,`$&${p}`));let z=(S?p?"2":"1":"")+y;if(e&&(z+=" "+f(e.replace(/ ?[\r\n]+/g," ")),o&&o()),!v){const L=s.replace(/\n+/g,`
|
|
121
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let M=!1;const A=sd(a,!0);d!=="folded"&&t!==Re.BLOCK_FOLDED&&(A.onOverflow=()=>{M=!0});const T=nd(`${E}${L}${b}`,p,Km,A);if(!M)return`>${z}
|
|
122
|
+
${p}${T}`}return s=s.replace(/\n+/g,`$&${p}`),`|${z}
|
|
123
|
+
${p}${E}${s}${b}`}function Q4(e,t,s,a){const{type:o,value:c}=e,{actualString:d,implicitKey:f,indent:m,indentStep:p,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):uu(e,t,s,a);if(!f&&!v&&o!==Re.PLAIN&&c.includes(`
|
|
126
|
+
`))return uu(e,t,s,a);if(id(c)){if(m==="")return t.forceBlockIndent=!0,uu(e,t,s,a);if(f&&m===p)return kr(c,t)}const y=c.replace(/\n+/g,`$&
|
|
127
|
+
${m}`);if(d){const x=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(y),{compat:b,tags:N}=t.doc.schema;if(N.some(x)||b?.some(x))return kr(c,t)}return f?y:nd(y,m,MN,sd(t,!1))}function Yp(e,t,s,a){const{implicitKey:o,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 m=v=>{switch(v){case Re.BLOCK_FOLDED:case Re.BLOCK_LITERAL:return o||c?kr(d.value,t):uu(d,t,s,a);case Re.QUOTE_DOUBLE:return Qo(d.value,t);case Re.QUOTE_SINGLE:return Zm(d.value,t);case Re.PLAIN:return Q4(d,t,s,a);default:return null}};let p=m(f);if(p===null){const{defaultKeyType:v,defaultStringType:y}=t.options,x=o&&v||y;if(p=m(x),p===null)throw new Error(`Unsupported default string type ${x}`)}return p}function UN(e,t){const s=Object.assign({blockQuote:!0,commentString:Z4,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 Y4(e,t){if(t.tag){const o=e.filter(c=>c.tag===t.tag);if(o.length>0)return o.find(c=>c.format===t.format)??o[0]}let s,a;if(ft(t)){a=t.value;let o=e.filter(c=>c.identify?.(a));if(o.length>1){const c=o.filter(d=>d.test);c.length>0&&(o=c)}s=o.find(c=>c.format===t.format)??o.find(c=>!c.format)}else a=t,s=e.find(o=>o.nodeClass&&a instanceof o.nodeClass);if(!s){const o=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${o} value`)}return s}function J4(e,t,{anchors:s,doc:a}){if(!a.directives)return"";const o=[],c=(ft(e)||Tt(e))&&e.anchor;c&&AN(c)&&(s.add(c),o.push(`&${c}`));const d=e.tag??(t.default?null:t.tag);return d&&o.push(a.directives.tagString(d)),o.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 o;const c=Ot(e)?e:t.doc.createNode(e,{onTagObj:m=>o=m});o??(o=Y4(t.doc.schema.tags,c));const d=J4(c,o,t);d.length>0&&(t.indentAtStart=(t.indentAtStart??0)+d.length+1);const f=typeof o.stringify=="function"?o.stringify(c,t,s,a):ft(c)?Yp(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 X4({key:e,value:t},s,a,o){const{allNullValues:c,doc:d,indent:f,indentStep:m,options:{commentString:p,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+m});let N=!1,S=!1,C=Lr(e,s,()=>N=!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 N&&a&&a(),C===""?"?":b?`? ${C}`:C}else if(c&&!y||t==null&&b)return C=`? ${C}`,x&&!N?C+=ya(C,s.indent,p(x)):S&&o&&o(),C;N&&(x=null),b?(x&&(C+=ya(C,s.indent,p(x))),C=`? ${C}
|
|
129
|
+
${f}:`):(C=`${C}:`,x&&(C+=ya(C,s.indent,p(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&&m.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=p(E);M+=`
|
|
131
|
+
${Fs(A,s.indent)}`}L===""&&!s.inFlow?M===`
|
|
132
|
+
`&&R&&(M=`
|
|
133
|
+
|
|
134
|
+
`):M+=`
|
|
135
|
+
${s.indent}`}else if(!b&&Tt(t)){const A=L[0],T=L.indexOf(`
|
|
136
|
+
`),P=T!==-1,X=s.inFlow??t.flow??t.items.length===0;if(P||!X){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
|
+
${s.indent}`)}}else(L===""||L[0]===`
|
|
138
|
+
`)&&(M="");return C+=M+L,s.inFlow?z&&a&&a():R&&!z?C+=ya(C,s.indent,p(R)):S&&o&&o(),C}function W4(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Zc="<<",Ks={identify:e=>e===Zc||typeof e=="symbol"&&e.description===Zc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Re(Symbol(Zc)),{addToJSMap:$N}),stringify:()=>Zc},e3=(e,t)=>(Ks.identify(t)||ft(t)&&(!t.type||t.type===Re.PLAIN)&&Ks.identify(t.value))&&e?.doc.schema.tags.some(s=>s.tag===Ks.tag&&s.default);function $N(e,t,s){if(s=e&&Aa(s)?s.resolve(e.doc):s,fl(s))for(const a of s.items)Wh(e,t,a);else if(Array.isArray(s))for(const a of s)Wh(e,t,a);else Wh(e,t,s)}function Wh(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 o=a.toJSON(null,e,Map);for(const[c,d]of o)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 PN(e,t,{key:s,value:a}){if(Ot(s)&&s.addToJSMap)s.addToJSMap(e,t,a);else if(e3(e,s))$N(e,t,a);else{const o=Fn(s,"",e);if(t instanceof Map)t.set(o,Fn(a,o,e));else if(t instanceof Set)t.add(o);else{const c=t3(s,o,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 t3(e,t,s){if(t===null)return"";if(typeof t!="object")return String(t);if(Ot(e)&&s?.doc){const a=UN(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 o=e.toString(a);if(!s.mapKeyWarned){let c=JSON.stringify(o);c.length>40&&(c=c.substring(0,36)+'..."'),W4(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 o}return JSON.stringify(t)}function Jp(e,t,s){const a=al(e,void 0,s),o=al(t,void 0,s);return new hn(a,o)}class hn{constructor(t,s=null){Object.defineProperty(this,Kn,{value:EN}),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 PN(s,a,this)}toString(t,s,a){return t?.doc?X4(this,t,s,a):JSON.stringify(this)}}function IN(e,t,s){return(t.inFlow??e.flow?s3:n3)(e,t,s)}function n3({comment:e,items:t},s,{blockItemPrefix:a,flowChars:o,itemIndent:c,onChompKeep:d,onComment:f}){const{indent:m,options:{commentString:p}}=s,v=Object.assign({},s,{indent:c,type:null});let y=!1;const x=[];for(let N=0;N<t.length;++N){const S=t[N];let C=null;if(Ot(S))!y&&S.spaceBefore&&x.push(""),Tu(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(""),Tu(s,x,E.commentBefore,y))}y=!1;let k=Lr(S,v,()=>C=null,()=>y=!0);C&&(k+=ya(k,c,p(C))),y&&C&&(y=!1),x.push(a+k)}let b;if(x.length===0)b=o.start+o.end;else{b=x[0];for(let N=1;N<x.length;++N){const S=x[N];b+=S?`
|
|
139
|
+
${m}${S}`:`
|
|
140
|
+
`}}return e?(b+=`
|
|
141
|
+
`+Fs(p(e),m),f&&f()):y&&d&&d(),b}function s3({items:e},t,{flowChars:s,itemIndent:a}){const{indent:o,indentStep:c,flowCollectionPadding:d,options:{commentString:f}}=t;a+=c;const m=Object.assign({},t,{indent:a,inFlow:!0,type:null});let p=!1,v=0;const y=[];for(let N=0;N<e.length;++N){const S=e[N];let C=null;if(Ot(S))S.spaceBefore&&y.push(""),Tu(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(""),Tu(t,y,E.commentBefore,!1),E.comment&&(p=!0));const R=Ot(S.value)?S.value:null;R?(R.comment&&(C=R.comment),R.commentBefore&&(p=!0)):S.value==null&&E?.comment&&(C=E.comment)}C&&(p=!0);let k=Lr(S,m,()=>C=null);N<e.length-1&&(k+=","),C&&(k+=ya(k,a,f(C))),!p&&(y.length>v||k.includes(`
|
|
142
|
+
`))&&(p=!0),y.push(k),v=y.length}const{start:x,end:b}=s;if(y.length===0)return x+b;if(!p){const N=y.reduce((S,C)=>S+C.length+2,2);p=t.options.lineWidth>0&&N>t.options.lineWidth}if(p){let N=x;for(const S of y)N+=S?`
|
|
143
|
+
${c}${o}${S}`:`
|
|
144
|
+
`;return`${N}
|
|
145
|
+
${o}${b}`}else return`${x}${d}${y.join(" ")}${d}${b}`}function Tu({indent:e,options:{commentString:t}},s,a,o){if(a&&o&&(a=a.replace(/^\n+/,"")),a){const c=Fs(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 LN{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ui,t),this.items=[]}static from(t,s,a){const{keepUndefined:o,replacer:c}=a,d=new this(t),f=(m,p)=>{if(typeof c=="function")p=c.call(s,m,p);else if(Array.isArray(c)&&!c.includes(m))return;(p!==void 0||o)&&d.items.push(Jp(m,p,a))};if(s instanceof Map)for(const[m,p]of s)f(m,p);else if(s&&typeof s=="object")for(const m of Object.keys(s))f(m,s[m]);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 o=va(this.items,a.key),c=this.schema?.sortMapEntries;if(o){if(!s)throw new Error(`Key ${a.key} already set`);ft(o.value)&&DN(a.value)?o.value.value=a.value:o.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 o=va(this.items,t)?.value;return(!s&&ft(o)?o.value:o)??void 0}has(t){return!!va(this.items,t)}set(t,s){this.add(new hn(t,s),!0)}toJSON(t,s,a){const o=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(o);for(const c of this.items)PN(s,o,c);return o}toString(t,s,a){if(!t)return JSON.stringify(this);for(const o of this.items)if(!Dt(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),IN(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 LN{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 o=this.items[a];return!s&&ft(o)?o.value:o}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 o=this.items[a];ft(o)&&DN(s)?o.value=s:this.items[a]=s}toJSON(t,s){const a=[];s?.onCreate&&s.onCreate(a);let o=0;for(const c of this.items)a.push(Fn(c,String(o++),s));return a}toString(t,s,a){return t?IN(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(t,s,a){const{replacer:o}=a,c=new this(t);if(s&&Symbol.iterator in Object(s)){let d=0;for(let f of s){if(typeof o=="function"){const m=s instanceof Set?f:String(d++);f=o.call(s,m,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)},ad={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),Yp(e,t,s,a)}},rd={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"&&rd.test.test(e)?e:t.options.nullStr},Xp={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&&Xp.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 ls({format:e,minFractionDigits:t,tag:s,value:a}){if(typeof a=="bigint")return String(a);const o=typeof a=="number"?a:Number(a);if(!isFinite(o))return isNaN(o)?".nan":o<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 BN={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:ls},qN={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():ls(e)}},HN={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:ls},od=e=>typeof e=="bigint"||Number.isInteger(e),Wp=(e,t,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),s);function GN(e,t,s){const{value:a}=e;return od(a)&&a>=0?s+a.toString(t):ls(e)}const FN={identify:e=>od(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Wp(e,2,8,s),stringify:e=>GN(e,8,"0o")},KN={identify:od,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Wp(e,0,10,s),stringify:ls},ZN={identify:e=>od(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Wp(e,2,16,s),stringify:e=>GN(e,16,"0x")},i3=[Hr,Gr,ad,rd,Xp,FN,KN,ZN,BN,qN,HN];function Hb(e){return typeof e=="bigint"||Number.isInteger(e)}const Qc=({value:e})=>JSON.stringify(e),a3=[{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:Hb,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})=>Hb(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}],r3={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},o3=[Hr,Gr].concat(a3,r3),eg={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 o=0;o<s.length;++o)a[o]=s.charCodeAt(o);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,o,c){if(!s)return"";const d=s;let f;if(typeof btoa=="function"){let m="";for(let p=0;p<d.length;++p)m+=String.fromCharCode(d[p]);f=btoa(m)}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 m=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),p=Math.ceil(f.length/m),v=new Array(p);for(let y=0,x=0;y<p;++y,x+=m)v[y]=f.substr(x,m);f=v.join(t===Re.BLOCK_LITERAL?`
|
|
146
|
+
`:" ")}return Yp({comment:e,type:t,value:f},a,o,c)}};function VN(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 o=a.items[0]||new hn(new Re(null));if(a.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${a.commentBefore}
|
|
147
|
+
${o.key.commentBefore}`:a.commentBefore),a.comment){const c=o.value??o.key;c.comment=c.comment?`${a.comment}
|
|
148
|
+
${c.comment}`:a.comment}a=o}e.items[s]=Dt(a)?a:new hn(a)}}else t("Expected a sequence for this tag");return e}function QN(e,t,s){const{replacer:a}=s,o=new Ca(e);o.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,m;if(Array.isArray(d))if(d.length===2)f=d[0],m=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const p=Object.keys(d);if(p.length===1)f=p[0],m=d[f];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else f=d;o.items.push(Jp(f,m,s))}return o}const tg={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:VN,createNode:QN};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 o of this.items){let c,d;if(Dt(o)?(c=Fn(o.key,"",s),d=Fn(o.value,c,s)):c=Fn(o,"",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 o=QN(t,s,a),c=new this;return c.items=o.items,c}}Er.tag="tag:yaml.org,2002:omap";const ng={collection:"seq",identify:e=>e instanceof Map,nodeClass:Er,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=VN(e,t),a=[];for(const{key:o}of s.items)ft(o)&&(a.includes(o.value)?t(`Ordered maps must not include duplicate keys: ${o.value}`):a.push(o.value));return Object.assign(new Er,s)},createNode:(e,t,s)=>Er.from(e,t,s)};function YN({value:e,source:t},s){return t&&(e?JN:XN).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const JN={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:YN},XN={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:YN},l3={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:ls},c3={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():ls(e)}},u3={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:ls},hl=e=>typeof e=="bigint"||Number.isInteger(e);function ld(e,t,s,{intAsBigInt:a}){const o=e[0];if((o==="-"||o==="+")&&(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 o==="-"?BigInt(-1)*d:d}const c=parseInt(e,s);return o==="-"?-1*c:c}function sg(e,t,s){const{value:a}=e;if(hl(a)){const o=a.toString(t);return a<0?"-"+s+o.substr(1):s+o}return ls(e)}const d3={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>ld(e,2,2,s),stringify:e=>sg(e,2,"0b")},f3={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>ld(e,1,8,s),stringify:e=>sg(e,8,"0")},h3={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>ld(e,0,10,s),stringify:ls},m3={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>ld(e,2,16,s),stringify:e=>sg(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:o}=a,c=new this(t);if(s&&Symbol.iterator in Object(s))for(let d of s)typeof o=="function"&&(d=o.call(s,d,d)),c.items.push(Jp(d,null,a));return c}}Rr.tag="tag:yaml.org,2002:set";const ig={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 ag(e,t){const s=e[0],a=s==="-"||s==="+"?e.substring(1):e,o=d=>t?BigInt(d):Number(d),c=a.replace(/_/g,"").split(":").reduce((d,f)=>d*o(60)+o(f),o(0));return s==="-"?o(-1)*c:c}function WN(e){let{value:t}=e,s=d=>d;if(typeof t=="bigint")s=d=>BigInt(d);else if(isNaN(t)||!isFinite(t))return ls(e);let a="";t<0&&(a="-",t*=s(-1));const o=s(60),c=[t%o];return t<60?c.unshift(0):(t=(t-c[0])/o,c.unshift(t%o),t>=60&&(t=(t-c[0])/o,c.unshift(t))),a+c.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const e1={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})=>ag(e,s),stringify:WN},t1={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=>ag(e,!1),stringify:WN},cd={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(cd.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,o,c,d,f]=t.map(Number),m=t[7]?Number((t[7]+"00").substr(1,3)):0;let p=Date.UTC(s,a-1,o,c||0,d||0,f||0,m);const v=t[8];if(v&&v!=="Z"){let y=ag(v,!1);Math.abs(y)<30&&(y*=60),p-=6e4*y}return new Date(p)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Gb=[Hr,Gr,ad,rd,JN,XN,d3,f3,h3,m3,l3,c3,u3,eg,Ks,ng,tg,ig,e1,t1,cd],Fb=new Map([["core",i3],["failsafe",[Hr,Gr,ad]],["json",o3],["yaml11",Gb],["yaml-1.1",Gb]]),Kb={binary:eg,bool:Xp,float:HN,floatExp:qN,floatNaN:BN,floatTime:t1,int:KN,intHex:ZN,intOct:FN,intTime:e1,map:Hr,merge:Ks,null:rd,omap:ng,pairs:tg,seq:Gr,set:ig,timestamp:cd},p3={"tag:yaml.org,2002:binary":eg,"tag:yaml.org,2002:merge":Ks,"tag:yaml.org,2002:omap":ng,"tag:yaml.org,2002:pairs":tg,"tag:yaml.org,2002:set":ig,"tag:yaml.org,2002:timestamp":cd};function em(e,t,s){const a=Fb.get(t);if(a&&!e)return s&&!a.includes(Ks)?a.concat(Ks):a.slice();let o=a;if(!o)if(Array.isArray(e))o=[];else{const c=Array.from(Fb.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)o=o.concat(c);else typeof e=="function"&&(o=e(o.slice()));return s&&(o=o.concat(Ks)),o.reduce((c,d)=>{const f=typeof d=="string"?Kb[d]:d;if(!f){const m=JSON.stringify(d),p=Object.keys(Kb).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${m}; use one of ${p}`)}return c.includes(f)||c.push(f),c},[])}const g3=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class rg{constructor({compat:t,customTags:s,merge:a,resolveKnownTags:o,schema:c,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(t)?em(t,"compat"):t?em(null,t):null,this.name=typeof c=="string"&&c||"core",this.knownTags=o?p3:{},this.tags=em(s,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,Ui,{value:Hr}),Object.defineProperty(this,Ss,{value:ad}),Object.defineProperty(this,Br,{value:Gr}),this.sortMapEntries=typeof d=="function"?d:d===!0?g3:null}clone(){const t=Object.create(rg.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function y3(e,t){const s=[];let a=t.directives===!0;if(t.directives!==!1&&e.directives){const m=e.directives.toString(e);m?(s.push(m),a=!0):e.directives.docStart&&(a=!0)}a&&s.push("---");const o=UN(e,t),{commentString:c}=o.options;if(e.commentBefore){s.length!==1&&s.unshift("");const m=c(e.commentBefore);s.unshift(Fs(m,""))}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(Fs(v,""))}o.forceBlockIndent=!!e.comment,f=e.contents.comment}const m=f?void 0:()=>d=!0;let p=Lr(e.contents,o,()=>f=null,m);f&&(p+=ya(p,"",c(f))),(p[0]==="|"||p[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${p}`:s.push(p)}else s.push(Lr(e.contents,o));if(e.directives?.docEnd)if(e.comment){const m=c(e.comment);m.includes(`
|
|
149
|
+
`)?(s.push("..."),s.push(Fs(m,""))):s.push(`... ${m}`)}else s.push("...");else{let m=e.comment;m&&d&&(m=m.replace(/^\n+/,"")),m&&((!d||f)&&s[s.length-1]!==""&&s.push(""),s.push(Fs(c(m),"")))}return s.join(`
|
|
150
|
+
`)+`
|
|
151
|
+
`}class ud{constructor(t,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Kn,{value:Fm});let o=null;typeof s=="function"||Array.isArray(s)?o=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,o,a)}clone(){const t=Object.create(ud.prototype,{[Kn]:{value:Fm}});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=TN(this);t.anchor=!s||a.has(s)?ON(s||"a",a):s}return new Qp(t.anchor)}createNode(t,s,a){let o;if(typeof s=="function")t=s.call({"":t},"",t),o=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)),o=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:f,keepUndefined:m,onTagObj:p,tag:v}=a??{},{onAnchor:y,setAnchors:x,sourceObjects:b}=G4(this,d||"a"),N={aliasDuplicateObjects:c??!0,keepUndefined:m??!1,onAnchor:y,onTagObj:p,replacer:o,schema:this.schema,sourceObjects:b},S=al(t,v,N);return f&&Tt(S)&&(S.flow=!0),x(),S}createPair(t,s,a={}){const o=this.createNode(t,null,a),c=this.createNode(s,null,a);return new hn(o,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=Au(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=Au(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 o=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new rg(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:o,onAnchor:c,reviver:d}={}){const f={anchors:new Map,doc:this,keep:!t,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},m=Fn(this.contents,s??"",f);if(typeof c=="function")for(const{count:p,res:v}of f.anchors.values())c(v,p);return typeof d=="function"?Cr(d,{"":m},"",m):m}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 y3(this,t)}}function xr(e){if(Tt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class n1 extends Error{constructor(t,s,a,o){super(),this.name=t,this.code=a,this.message=o,this.pos=s}}class Yc extends n1{constructor(t,s,a){super("YAMLParseError",t,s,a)}}class v3 extends n1{constructor(t,s,a){super("YAMLWarning",t,s,a)}}const Zb=(e,t)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(f=>t.linePos(f));const{line:a,col:o}=s.linePos[0];s.message+=` at line ${a}, column ${o}`;let c=o-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
|
+
`),d=f+d}if(/[^ ]/.test(d)){let f=1;const m=s.linePos[1];m?.line===a&&m.col>o&&(f=Math.max(1,Math.min(m.col-o,80-c)));const p=" ".repeat(c)+"^".repeat(f);s.message+=`:
|
|
153
|
+
|
|
154
|
+
${d}
|
|
155
|
+
${p}
|
|
156
|
+
`}};function Mr(e,{flow:t,indicator:s,next:a,offset:o,onError:c,parentIndent:d,startOnNewline:f}){let m=!1,p=f,v=f,y="",x="",b=!1,N=!1,S=null,C=null,k=null,E=null,R=null,z=null,L=null;for(const T of e)switch(N&&(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"),N=!1),S&&(p&&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="",p=!1;break}case"newline":p?y?y+=T.source:(!z||s!=="seq-item-ind")&&(m=!0):x+=T.source,p=!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),p=!1,v=!1,N=!0;break;case"tag":{k&&c(T,"MULTIPLE_TAGS","A node can have at most one tag"),k=T,L??(L=T.offset),p=!1,v=!1,N=!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,p=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,p=!1,v=!1;break}default:c(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),p=!1,v=!1}const M=e[e.length-1],A=M?M.offset+M.source.length:o;return N&&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&&(p&&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:m,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 Qm(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 s1(e,t,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const o=typeof a=="function"?a:(c,d)=>c===d||ft(c)&&ft(d)&&c.value===d.value;return t.some(c=>o(c.key,s))}const Vb="All mapping items must start at the same column";function x3({composeNode:e,composeEmptyNode:t},s,a,o,c){const d=c?.nodeClass??Gn,f=new d(s.schema);s.atRoot&&(s.atRoot=!1);let m=a.offset,p=null;for(const v of a.items){const{start:y,key:x,sep:b,value:N}=v,S=Mr(y,{indicator:"explicit-key-ind",next:x??b?.[0],offset:m,onError:o,parentIndent:a.indent,startOnNewline:!0}),C=!S.found;if(C){if(x&&(x.type==="block-seq"?o(m,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in x&&x.indent!==a.indent&&o(m,"BAD_INDENT",Vb)),!S.anchor&&!S.tag&&!b){p=S.end,S.comment&&(f.comment?f.comment+=`
|
|
158
|
+
`+S.comment:f.comment=S.comment);continue}(S.newlineAfterProp||rl(x))&&o(x??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==a.indent&&o(m,"BAD_INDENT",Vb);s.atKey=!0;const k=S.end,E=x?e(s,x,S,o):t(s,k,y,null,S,o);s.schema.compat&&Qm(a.indent,x,o),s.atKey=!1,s1(s,f.items,E)&&o(k,"DUPLICATE_KEY","Map keys must be unique");const R=Mr(b??[],{indicator:"map-value-ind",next:N,offset:E.range[2],onError:o,parentIndent:a.indent,startOnNewline:!x||x.type==="block-scalar"});if(m=R.end,R.found){C&&(N?.type==="block-map"&&!R.hasNewline&&o(m,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&S.start<R.found.offset-1024&&o(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=N?e(s,N,R,o):t(s,m,b,null,R,o);s.schema.compat&&Qm(a.indent,N,o),m=z.range[2];const L=new hn(E,z);s.options.keepSourceTokens&&(L.srcToken=v),f.items.push(L)}else{C&&o(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 p&&p<m&&o(p,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,m,p??m],f}function b3({composeNode:e,composeEmptyNode:t},s,a,o,c){const d=c?.nodeClass??Ca,f=new d(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let m=a.offset,p=null;for(const{start:v,value:y}of a.items){const x=Mr(v,{indicator:"seq-item-ind",next:y,offset:m,onError:o,parentIndent:a.indent,startOnNewline:!0});if(!x.found)if(x.anchor||x.tag||y)y?.type==="block-seq"?o(x.end,"BAD_INDENT","All sequence items must start at the same column"):o(m,"MISSING_CHAR","Sequence item without - indicator");else{p=x.end,x.comment&&(f.comment=x.comment);continue}const b=y?e(s,y,x,o):t(s,x.end,v,null,x,o);s.schema.compat&&Qm(a.indent,y,o),m=b.range[2],f.items.push(b)}return f.range=[a.offset,m,p??m],f}function ml(e,t,s,a){let o="";if(e){let c=!1,d="";for(const f of e){const{source:m,type:p}=f;switch(p){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=m.substring(1)||" ";o?o+=d+v:o=v,d="";break}case"newline":o&&(d+=m),c=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}t+=m.length}}return{comment:o,offset:t}}const tm="Block collections are not allowed within flow collections",nm=e=>e&&(e.type==="block-map"||e.type==="block-seq");function S3({composeNode:e,composeEmptyNode:t},s,a,o,c){const d=a.start.source==="{",f=d?"flow map":"flow sequence",m=c?.nodeClass??(d?Gn:Ca),p=new m(s.schema);p.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:o,parentIndent:a.indent,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!z&&!L){C===0&&M.comma?o(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):C<a.items.length-1&&o(M.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),M.comment&&(p.comment?p.comment+=`
|
|
160
|
+
`+M.comment:p.comment=M.comment),y=M.end;continue}!d&&s.options.strict&&rl(R)&&o(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)M.comma&&o(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(M.comma||o(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=p.items[p.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,o):t(s,M.end,z,null,M,o);p.items.push(A),y=A.range[2],nm(L)&&o(A.range,"BLOCK_IN_FLOW",tm)}else{s.atKey=!0;const A=M.end,T=R?e(s,R,M,o):t(s,A,E,null,M,o);nm(R)&&o(T.range,"BLOCK_IN_FLOW",tm),s.atKey=!1;const P=Mr(z??[],{flow:f,indicator:"map-value-ind",next:L,offset:T.range[2],onError:o,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"){o(se,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}M.start<P.found.offset-1024&&o(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]===":"?o(L,"MISSING_CHAR",`Missing space after : in ${f}`):o(P.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const X=L?e(s,L,P,o):P.found?t(s,P.end,z,null,P,o):null;X?nm(L)&&o(X.range,"BLOCK_IN_FLOW",tm):P.comment&&(T.comment?T.comment+=`
|
|
162
|
+
`+P.comment:T.comment=P.comment);const Q=new hn(T,X);if(s.options.keepSourceTokens&&(Q.srcToken=k),d){const se=p;s1(s,se.items,T)&&o(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=(X??T).range;se.range=[T.range[0],pe[1],pe[2]],p.items.push(se)}y=X?X.range[2]:P.end}}const x=d?"}":"]",[b,...N]=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}`;o(y,v?"MISSING_CHAR":"BAD_INDENT",k),b&&b.source.length!==1&&N.unshift(b)}if(N.length>0){const C=ml(N,S,s.options.strict,o);C.comment&&(p.comment?p.comment+=`
|
|
163
|
+
`+C.comment:p.comment=C.comment),p.range=[a.offset,S,C.offset]}else p.range=[a.offset,S,S];return p}function sm(e,t,s,a,o,c){const d=s.type==="block-map"?x3(e,t,s,a,c):s.type==="block-seq"?b3(e,t,s,a,c):S3(e,t,s,a,c),f=d.constructor;return o==="!"||o===f.tagName?(d.tag=f.tagName,d):(o&&(d.tag=o),d)}function j3(e,t,s,a,o){const c=a.tag,d=c?t.directives.tagName(c.source,x=>o(c,"TAG_RESOLVE_FAILED",x)):null;if(s.type==="block-seq"){const{anchor:x,newlineAfterProp:b}=a,N=x&&c?x.offset>c.offset?x:c:x??c;N&&(!b||b.offset<N.offset)&&o(N,"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 sm(e,t,s,o,d);let m=t.schema.tags.find(x=>x.tag===d&&x.collection===f);if(!m){const x=t.schema.knownTags[d];if(x?.collection===f)t.schema.tags.push(Object.assign({},x,{default:!1})),m=x;else return x?o(c,"BAD_COLLECTION_TYPE",`${x.tag} used for ${f} collection, but expects ${x.collection??"scalar"}`,!0):o(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),sm(e,t,s,o,d)}const p=sm(e,t,s,o,d,m),v=m.resolve?.(p,x=>o(c,"TAG_RESOLVE_FAILED",x),t.options)??p,y=Ot(v)?v:new Re(v);return y.range=p.range,y.tag=d,m?.format&&(y.format=m.format),y}function w3(e,t,s){const a=t.offset,o=N3(t,e.options.strict,s);if(!o)return{value:"",type:null,comment:"",range:[a,a,a]};const c=o.mode===">"?Re.BLOCK_FOLDED:Re.BLOCK_LITERAL,d=t.source?C3(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=o.chomp==="+"&&d.length>0?`
|
|
164
|
+
`.repeat(Math.max(1,d.length-1)):"";let C=a+o.length;return t.source&&(C+=t.source.length),{value:S,type:c,comment:o.comment,range:[a,C,C]}}let m=t.indent+o.indent,p=t.offset+o.length,v=0;for(let S=0;S<f;++S){const[C,k]=d[S];if(k===""||k==="\r")o.indent===0&&C.length>m&&(m=C.length);else{C.length<m&&s(p+C.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(m=C.length),v=S,m===0&&!e.atRoot&&s(p,"BAD_INDENT","Block scalar values in collections must be indented");break}p+=C.length+k.length+1}for(let S=d.length-1;S>=f;--S)d[S][0].length>m&&(f=S+1);let y="",x="",b=!1;for(let S=0;S<v;++S)y+=d[S][0].slice(m)+`
|
|
165
|
+
`;for(let S=v;S<f;++S){let[C,k]=d[S];p+=C.length+k.length+1;const E=k[k.length-1]==="\r";if(E&&(k=k.slice(0,-1)),k&&C.length<m){const z=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;s(p-k.length-(E?2:1),"BAD_INDENT",z),C=""}c===Re.BLOCK_LITERAL?(y+=x+C.slice(m)+k,x=`
|
|
166
|
+
`):C.length>m||k[0]===" "?(x===" "?x=`
|
|
167
|
+
`:!b&&x===`
|
|
168
|
+
`&&(x=`
|
|
169
|
+
|
|
170
|
+
`),y+=x+C.slice(m)+k,x=`
|
|
171
|
+
`,b=!0):k===""?x===`
|
|
172
|
+
`?y+=`
|
|
173
|
+
`:x=`
|
|
174
|
+
`:(y+=x+k,x=" ",b=!1)}switch(o.chomp){case"-":break;case"+":for(let S=f;S<d.length;++S)y+=`
|
|
175
|
+
`+d[S][0].slice(m);y[y.length-1]!==`
|
|
176
|
+
`&&(y+=`
|
|
177
|
+
`);break;default:y+=`
|
|
178
|
+
`}const N=a+o.length+t.source.length;return{value:y,type:c,comment:o.comment,range:[a,N,N]}}function N3({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:o}=t[0],c=o[0];let d=0,f="",m=-1;for(let x=1;x<o.length;++x){const b=o[x];if(!f&&(b==="-"||b==="+"))f=b;else{const N=Number(b);!d&&N?d=N:m===-1&&(m=e+x)}}m!==-1&&a(m,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let p=!1,v="",y=o.length;for(let x=1;x<t.length;++x){const b=t[x];switch(b.type){case"space":p=!0;case"newline":y+=b.source.length;break;case"comment":s&&!p&&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 N=`Unexpected token in block scalar header: ${b.type}`;a(b,"UNEXPECTED_TOKEN",N);const S=b.source;S&&typeof S=="string"&&(y+=S.length)}}}return{mode:c,indent:d,chomp:f,comment:v,length:y}}function C3(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 k3(e,t,s){const{offset:a,type:o,source:c,end:d}=e;let f,m;const p=(x,b,N)=>s(a+x,b,N);switch(o){case"scalar":f=Re.PLAIN,m=z3(c,p);break;case"single-quoted-scalar":f=Re.QUOTE_SINGLE,m=_3(c,p);break;case"double-quoted-scalar":f=Re.QUOTE_DOUBLE,m=E3(c,p);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{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:m,type:f,comment:y.comment,range:[a,v,y.offset]}}function z3(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}`),i1(e)}function _3(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),i1(e.slice(1,-1)).replace(/''/g,"'")}function i1(e){let t,s;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
179
|
+
`,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
180
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let a=t.exec(e);if(!a)return e;let o=a[1],c=" ",d=t.lastIndex;for(s.lastIndex=d;a=s.exec(e);)a[1]===""?c===`
|
|
181
|
+
`?o+=c:c=`
|
|
182
|
+
`:(o+=c+a[1],c=" "),d=s.lastIndex;const f=/[ \t]*(.*)/sy;return f.lastIndex=d,a=f.exec(e),o+c+(a?.[1]??"")}function E3(e,t){let s="";for(let a=1;a<e.length-1;++a){const o=e[a];if(!(o==="\r"&&e[a+1]===`
|
|
183
|
+
`))if(o===`
|
|
184
|
+
`){const{fold:c,offset:d}=R3(e,a);s+=c,a=d}else if(o==="\\"){let c=e[++a];const d=A3[c];if(d)s+=d;else if(c===`
|
|
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+=T3(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(o===" "||o===" "){const c=a;let d=e[a+1];for(;d===" "||d===" ";)d=e[++a+1];d!==`
|
|
187
|
+
`&&!(d==="\r"&&e[a+2]===`
|
|
188
|
+
`)&&(s+=a>c?e.slice(c,a+1):o)}else s+=o}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function R3(e,t){let s="",a=e[t+1];for(;(a===" "||a===" "||a===`
|
|
189
|
+
`||a==="\r")&&!(a==="\r"&&e[t+2]!==`
|
|
190
|
+
`);)a===`
|
|
191
|
+
`&&(s+=`
|
|
192
|
+
`),t+=1,a=e[t+1];return s||(s=" "),{fold:s,offset:t}}const A3={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
193
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function T3(e,t,s,a){const o=e.substr(t,s),d=o.length===s&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,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 a1(e,t,s,a){const{value:o,type:c,comment:d,range:f}=t.type==="block-scalar"?w3(e,t,a):k3(t,e.options.strict,a),m=s?e.directives.tagName(s.source,y=>a(s,"TAG_RESOLVE_FAILED",y)):null;let p;e.options.stringKeys&&e.atKey?p=e.schema[Ss]:m?p=O3(e.schema,o,m,s,a):t.type==="scalar"?p=D3(e,o,t,a):p=e.schema[Ss];let v;try{const y=p.resolve(o,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(o)}return v.range=f,v.source=o,c&&(v.type=c),m&&(v.tag=m),p.format&&(v.format=p.format),d&&(v.comment=d),v}function O3(e,t,s,a,o){if(s==="!")return e[Ss];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):(o(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[Ss])}function D3({atKey:e,directives:t,schema:s},a,o,c){const d=s.tags.find(f=>(f.default===!0||e&&f.default==="key")&&f.test?.test(a))||s[Ss];if(s.compat){const f=s.compat.find(m=>m.default&&m.test?.test(a))??s[Ss];if(d.tag!==f.tag){const m=t.tagString(d.tag),p=t.tagString(f.tag),v=`Value may be parsed as either ${m} or ${p}`;c(o,"TAG_RESOLVE_FAILED",v,!0)}}return d}function L3(e,t,s){if(t){s??(s=t.length);for(let a=s-1;a>=0;--a){let o=t[a];switch(o.type){case"space":case"comment":case"newline":e-=o.source.length;continue}for(o=t[++a];o?.type==="space";)e+=o.source.length,o=t[++a];break}}return e}const M3={composeNode:r1,composeEmptyNode:og};function r1(e,t,s,a){const o=e.atKey,{spaceBefore:c,comment:d,anchor:f,tag:m}=s;let p,v=!0;switch(t.type){case"alias":p=U3(e,t,a),(f||m)&&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":p=a1(e,t,m,a),f&&(p.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":p=j3(M3,e,t,s,a),f&&(p.anchor=f.source.substring(1));break;default:{const y=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;a(t,"UNEXPECTED_TOKEN",y),p=og(e,t.offset,void 0,null,s,a),v=!1}}return f&&p.anchor===""&&a(f,"BAD_ALIAS","Anchor cannot be an empty string"),o&&e.options.stringKeys&&(!ft(p)||typeof p.value!="string"||p.tag&&p.tag!=="tag:yaml.org,2002:str")&&a(m??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(p.spaceBefore=!0),d&&(t.type==="scalar"&&t.source===""?p.comment=d:p.commentBefore=d),e.options.keepSourceTokens&&v&&(p.srcToken=t),p}function og(e,t,s,a,{spaceBefore:o,comment:c,anchor:d,tag:f,end:m},p){const v={type:"scalar",offset:L3(t,s,a),indent:-1,source:""},y=a1(e,v,f,p);return d&&(y.anchor=d.source.substring(1),y.anchor===""&&p(d,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(y.spaceBefore=!0),c&&(y.comment=c,y.range[2]=m),y}function U3({options:e},{offset:t,source:s,end:a},o){const c=new Qp(s.substring(1));c.source===""&&o(t,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&o(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=t+s.length,f=ml(a,d,e.strict,o);return c.range=[t,d,f.offset],f.comment&&(c.comment=f.comment),c}function $3(e,t,{offset:s,start:a,value:o,end:c},d){const f=Object.assign({_directives:t},e),m=new ud(void 0,f),p={atKey:!1,atRoot:!0,directives:m.directives,options:m.options,schema:m.schema},v=Mr(a,{indicator:"doc-start",next:o??c?.[0],offset:s,onError:d,parentIndent:0,startOnNewline:!0});v.found&&(m.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!v.hasNewline&&d(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),m.contents=o?r1(p,o,v,d):og(p,v.end,a,null,v,d);const y=m.contents.range[2],x=ml(c,y,!1,d);return x.comment&&(m.comment=x.comment),m.range=[s,y,x.offset],m}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 o=0;o<e.length;++o){const c=e[o];switch(c[0]){case"#":t+=(t===""?"":a?`
|
|
194
|
+
|
|
195
|
+
`:`
|
|
196
|
+
`)+(c.substring(1)||" "),s=!0,a=!1;break;case"%":e[o+1]?.[0]!=="#"&&(o+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:t,afterEmptyLine:a}}class P3{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,o,c)=>{const d=qo(s);c?this.warnings.push(new v3(d,a,o)):this.errors.push(new Yc(d,a,o))},this.directives=new dn({version:t.version||"1.2"}),this.options=t}decorate(t,s){const{comment:a,afterEmptyLine:o}=Qb(this.prelude);if(a){const c=t.contents;if(s)t.comment=t.comment?`${t.comment}
|
|
197
|
+
${a}`:a;else if(o||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
|
+
${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 o of t)yield*this.next(o);yield*this.end(s,a)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(s,a,o)=>{const c=qo(t);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,o)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const s=$3(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),o=new ud(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,s,s],this.decorate(o,!1),yield o}}}const o1="\uFEFF",l1="",c1="",Ym="";function I3(e){switch(e){case o1:return"byte-order-mark";case l1:return"doc-mode";case c1:return"flow-error-end";case Ym:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
201
|
+
`:case`\r
|
|
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 Yb=new Set("0123456789ABCDEFabcdef"),B3=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Jc=new Set(",[]{}"),q3=new Set(` ,[]{}
|
|
204
|
+
\r `),im=e=>!e||q3.has(e);class H3{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
|
+
`?!0:s==="\r"?this.buffer[t+1]===`
|
|
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 o=this.buffer[a+t+1];if(o===`
|
|
207
|
+
`||!o&&!this.atEnd)return t+a+1}return s===`
|
|
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]===o1&&(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 o=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-o),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 l1,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(im),"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 o=this.getLine();if(o===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&o[0]!=="#"||a===0&&(o.startsWith("---")||o.startsWith("..."))&&ns(o[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(o[0]==="]"||o[0]==="}")))return this.flowLevel=0,yield c1,yield*this.parseLineStart();let c=0;for(;o[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),o[c]){case void 0:return"flow";case"#":return yield*this.pushCount(o.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(im),"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 o=a.indexOf(`
|
|
210
|
+
`,this.pos);if(o!==-1){for(;o!==-1;){const c=this.continueScalar(o+1);if(c===-1)break;o=a.indexOf(`
|
|
211
|
+
`,c)}o!==-1&&(s=o-(a[o-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
|
+
`: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
|
+
`)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
|
+
`,c)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let o=t+1;for(a=this.buffer[o];a===" ";)a=this.buffer[++o];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
|
|
215
|
+
`;)a=this.buffer[++o];t=o-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 Ym,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,o;for(;o=this.buffer[++a];)if(o===":"){const c=this.buffer[a+1];if(ns(c)||t&&Jc.has(c))break;s=a}else if(ns(o)){let c=this.buffer[a+1];if(o==="\r"&&(c===`
|
|
217
|
+
`?(a+=1,o=`
|
|
218
|
+
`,c=this.buffer[a+1]):s=a),c==="#"||t&&Jc.has(c))break;if(o===`
|
|
219
|
+
`){const d=this.continueScalar(a+1);if(d===-1)break;a=Math.max(a,d-2)}}else{if(t&&Jc.has(o))break;s=a}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield Ym,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(im))+(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(B3.has(s))s=this.buffer[++t];else if(s==="%"&&Yb.has(this.buffer[t+1])&&Yb.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
|
+
`?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 o=s-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=s),o}*pushUntil(t){let s=this.pos,a=this.buffer[s];for(;!t(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class G3{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 o=this.lineStarts[s-1];return{line:s,col:t-o+1}}}}function _i(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function Jb(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 u1(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 Xb(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,u1(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 F3{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 H3,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=I3(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"&&Xb(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const o=a.items[a.items.length-1];if(o.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=s;else{Object.assign(o,{key:s,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{const o=a.items[a.items.length-1];o.value?a.items.push({start:[],value:s}):o.value=s;break}case"flow-collection":{const o=a.items[a.items.length-1];!o||o.value?a.items.push({start:[],key:s,sep:[]}):o.sep?o.value=s:Object.assign(o,{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 o=s.items[s.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&Jb(o.start)===-1&&(s.indent===0||o.start.every(c=>c.type!=="comment"||c.indent<s.indent))&&(a.type==="document"?a.end=o.start:a.items.push({start:o.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":{Jb(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 o;t.end?(o=t.end,o.push(this.sourceToken),delete t.end):o=[this.sourceToken];const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}*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
|
+
`)+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 o=t.items[t.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,s.start),o.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,o=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(o&&s.sep&&!s.value){const d=[];for(let f=0;f<s.sep.length;++f){const m=s.sep[f];switch(m.type){case"newline":d.push(f);break;case"space":break;case"comment":m.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":o||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):o||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(u1(s.key)&&!_i(s.sep,"newline")){const d=br(s.start),f=s.key,m=s.sep;m.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:m}]})}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=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||o?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);o||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 o=t.items[t.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,s.start),o.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 o=this.flowScalar(this.type);!s||s.value?t.items.push({start:[],key:o,sep:[]}):s.sep?this.stack.push(o):Object.assign(s,{key:o,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 o=Xc(a),c=br(o);Xb(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
|
+
`)+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=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 K3(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new G3||null,prettyErrors:t}}function Z3(e,t={}){const{lineCounter:s,prettyErrors:a}=K3(t),o=new F3(s?.addNewLine),c=new P3(t),d=Array.from(c.compose(o.parse(e)));if(a&&s)for(const f of d)f.errors.forEach(Zb(e,s)),f.warnings.forEach(Zb(e,s));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function V3({onApplied:e}){const[t,s]=w.useState(""),[a,o]=w.useState(!1),[c,d]=w.useState([]),[f,m]=w.useState([]),p=async()=>{if(!t.trim())return;o(!0),d([]),m([]);const v=Z3(t),y=[],x=[];for(let b=0;b<v.length;b++){const N=v[b];if(N.errors.length>0){y.push(`Document ${b+1}: ${N.errors[0]?.message}`);continue}const S=N.toJSON();if(!(!S||typeof S!="object"))try{const C=await uj(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),m(y),o(!1),x.length>0&&e()};return r.jsxs("section",{className:"mt-8",children:[r.jsx("div",{className:"page-section-divider"}),r.jsx("div",{className:"section-head mt-6",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),r.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),r.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",r.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",r.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),r.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
|
|
226
|
+
kind: Project
|
|
227
|
+
metadata:
|
|
228
|
+
name: my-project
|
|
229
|
+
spec:
|
|
230
|
+
canonicalDomain: example.com
|
|
231
|
+
country: US
|
|
232
|
+
language: en
|
|
233
|
+
keywords: []`,value:t,onChange:v=>s(v.target.value)}),c.length>0&&r.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,y)=>r.jsx("li",{className:"text-emerald-400 text-sm",children:v},y))}),f.length>0&&r.jsx("ul",{className:"mt-2 space-y-1",children:f.map((v,y)=>r.jsx("li",{className:"text-rose-400 text-sm",children:v},y))}),r.jsx("div",{className:"mt-3",children:r.jsx(oe,{type:"button",disabled:!t.trim()||a,onClick:p,children:a?"Applying...":"Apply"})})]})}function Q3(){const{dashboard:e,isLoading:t,refetch:s}=Ra();if(!e||t)return r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-28"}),r.jsx("div",{className:"skeleton-text-sm w-40"})]}),r.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[r.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(A=>r.jsx("div",{className:"skeleton-text-sm w-16"},A))}),[1,2,3].map(A=>r.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[r.jsxs("div",{className:"flex-1 space-y-1",children:[r.jsx("div",{className:"skeleton-text w-28"}),r.jsx("div",{className:"skeleton-text-sm w-16"})]}),r.jsx("div",{className:"skeleton-text w-24"}),r.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),r.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),r.jsx("div",{className:"skeleton-text-sm w-8"})]},A))]})]});const a=e.projects,o=ka(),[c,d]=w.useState(!1),[f,m]=w.useState(""),[p,v]=w.useState(""),[y,x]=w.useState(""),[b,N]=w.useState("US"),[S,C]=w.useState("en"),[k,E]=w.useState(!1),[R,z]=w.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:p||f,canonicalDomain:y,country:b,language:S});s(),m(""),v(""),x(""),N("US"),C("en"),d(!1),o({to:"/projects/$projectId",params:{projectId:A.id}})}catch(A){z(A instanceof Error?A.message:"Failed to create project")}finally{E(!1)}}};return r.jsxs("div",{className:"page-container",children:[r.jsxs("div",{className:"page-header",children:[r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:"Projects"}),r.jsxs("p",{className:"page-subtitle",children:[a.length," project",a.length!==1?"s":""," tracked"]})]}),r.jsx("div",{className:"page-header-right",children:r.jsxs(oe,{type:"button",onClick:()=>d(A=>!A),children:[r.jsx(Gx,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?r.jsxs(De,{className:"surface-card mb-6",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),r.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),r.jsxs("div",{className:"compact-stack mt-4",children:[r.jsxs("div",{className:"setup-field-row",children:[r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),r.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:f,onChange:A=>m(A.target.value)}),L&&L!==f?r.jsxs("p",{className:"supporting-copy",children:["Slug: ",L]}):null]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),r.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:p,onChange:A=>v(A.target.value)})]})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),r.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:y,onChange:A=>x(A.target.value)})]}),r.jsxs("div",{className:"setup-field-row",children:[r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),r.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:b,onChange:A=>N(A.target.value.toUpperCase())})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),r.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:S,onChange:A=>C(A.target.value.toLowerCase())})]})]})]}),R?r.jsx("p",{className:"text-rose-400 text-sm mt-3",children:R}):null,r.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[r.jsx(oe,{type:"button",disabled:!L||!y||k,onClick:M,children:k?"Creating...":"Create project"}),r.jsx(oe,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,a.length>0?r.jsx("div",{className:"data-table-wrapper",children:r.jsxs("table",{className:"data-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Name"}),r.jsx("th",{children:"Domain"}),r.jsx("th",{children:"Visibility"}),r.jsx("th",{children:"Last run"}),r.jsx("th",{className:"text-right",children:"Country"})]})}),r.jsx("tbody",{children:a.map(A=>{const T=A.recentRuns[0];return r.jsxs("tr",{className:"cursor-pointer",onClick:()=>o({to:"/projects/$projectId",params:{projectId:A.project.id}}),children:[r.jsxs("td",{children:[r.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}),r.jsx("p",{className:"text-[11px] text-zinc-500",children:A.project.name})]}),r.jsx("td",{className:"text-zinc-400",children:A.project.canonicalDomain}),r.jsx("td",{children:r.jsx(st,{tone:A.visibilitySummary.tone,children:A.visibilitySummary.value})}),r.jsx("td",{className:"text-zinc-500 text-sm",children:T?r.jsx(Fu,{status:T.status}):r.jsx("span",{className:"text-zinc-600",children:"No runs"})}),r.jsx("td",{className:"text-right text-zinc-500",children:A.project.country})]},A.project.id)})})]})}):c?null:r.jsxs(De,{className:"surface-card empty-card",children:[r.jsx("h3",{children:"No projects yet"}),r.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),r.jsxs(oe,{type:"button",onClick:()=>d(!0),children:[r.jsx(Gx,{className:"size-4 mr-1.5"}),"Add project"]})]}),r.jsx(V3,{onApplied:()=>{s()}})]})}function bs({text:e}){return r.jsxs("span",{className:"info-tooltip-wrapper",children:[r.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),r.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),r.jsx("span",{className:"info-tooltip-bubble",role:"tooltip",children:e})]})}function d1({run:e}){const{openRun:t}=ul();return r.jsxs("article",{className:"run-row",children:[r.jsxs("div",{className:"run-row-main",children:[r.jsxs("div",{className:"run-row-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"run-row-title",children:e.summary}),r.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),r.jsx(Fu,{status:e.status})]}),r.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),r.jsxs("dl",{className:"run-row-meta",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Started"}),r.jsx("dd",{children:e.startedAt})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Duration"}),r.jsx("dd",{children:e.duration})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Trigger"}),r.jsx("dd",{children:e.triggerLabel})]})]}),r.jsx(oe,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function f1({value:e,label:t,delta:s,tone:a,description:o,tooltip:c,isNumeric:d=!0,progress:f}){const v=2*Math.PI*48,y=Number.parseInt(e,10),x=typeof f=="number"&&Number.isFinite(f)?Math.min(Math.max(f,0),1):d&&!Number.isNaN(y)?Math.min(y/100,1):.5,b=v*(1-x);return r.jsxs("div",{className:"score-gauge",children:[r.jsxs("div",{className:"gauge-ring-wrapper",children:[r.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[r.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),r.jsx("circle",{className:`gauge-fill gauge-fill-${a}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:v,strokeDashoffset:b,transform:"rotate(-90 60 60)"})]}),r.jsx("div",{className:"gauge-center",children:r.jsx("span",{className:d?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),r.jsxs("p",{className:"gauge-label",children:[t,c&&r.jsx(bs,{text:c})]}),r.jsx("p",{className:"gauge-delta",children:s}),r.jsx("p",{className:"gauge-description",children:o})]})}function Wb({history:e,maxDots:t=12}){const s=e.slice(-t);if(s.length===0)return r.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"},o=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 r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:o}),r.jsx("div",{className:"flex items-center gap-[3px]",title:`${s.length} runs`,children:s.map((d,f)=>r.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))}),r.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:c})]})}function Y3(e){const t=new Map;for(const a of e)for(const o of a.runHistory){const c=t.get(o.createdAt);c?c.states.push(o.citationState):t.set(o.createdAt,{states:[o.citationState],runId:o.runId})}return[...t.entries()].sort(([a],[o])=>a.localeCompare(o)).map(([a,{states:o,runId:c}])=>({runId:c,createdAt:a,citationState:o.includes("cited")?"cited":o.includes("emerging")?"emerging":"not-cited"}))}function J3({evidence:e}){const{openEvidence:t}=ul(),[s,a]=w.useState(new Set),o=w.useMemo(()=>{const d=new Map;for(const f of e){const m=d.get(f.keyword)??[];d.set(f.keyword,[...m,f])}return[...d.entries()].map(([f,m])=>({phrase:f,items:m}))},[e]),c=d=>{a(f=>{const m=new Set(f);return m.has(d)?m.delete(d):m.add(d),m})};return r.jsx("div",{className:"evidence-table-wrap",children:r.jsxs("table",{className:"evidence-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{style:{width:"2rem"}}),r.jsx("th",{children:"Key Phrase"}),r.jsx("th",{children:"Status"}),r.jsx("th",{children:"Citation History"}),r.jsx("th",{children:"Change"}),r.jsx("th",{})]})}),r.jsx("tbody",{children:o.map(({phrase:d,items:f})=>{const m=s.has(d),p=f.map(N=>N.citationState),v=p.includes("cited")?"cited":p.includes("emerging")?"emerging":p.includes("lost")?"lost":p.every(N=>N==="pending")?"pending":"not-cited",y=Y3(f),x=f.filter(N=>N.citationState==="cited"||N.citationState==="emerging").length,b=(()=>{if(y.length===0)return"Awaiting first run";if(y.length===1)return"First observation";const N=y[y.length-1].citationState,S=y[y.length-2].citationState;if(S!=="cited"&&N==="cited")return"Newly cited";if(S==="cited"&&N!=="cited")return"Lost since last run";let C=0;for(let k=y.length-1;k>=0&&y[k].citationState===N;k--)C++;return N==="cited"?C<=1?"Cited in latest run":`Cited for ${C} runs`:C<=1?"Not cited in latest run":`Not cited across ${C} runs`})();return r.jsxs(w.Fragment,{children:[r.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(d),"aria-expanded":m,children:[r.jsx("td",{children:r.jsx(qu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${m?"rotate-90":""}`})}),r.jsx("td",{className:"evidence-keyword-cell",children:r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-zinc-100",children:d}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(N=>r.jsx(tl,{provider:N.provider},N.id))})]})}),r.jsx("td",{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Pm,{state:v}),r.jsxs("span",{className:"text-[11px] text-zinc-500",children:[x,"/",f.length]})]})}),r.jsx("td",{children:r.jsx(Wb,{history:y})}),r.jsx("td",{className:"evidence-change-cell",children:b}),r.jsx("td",{})]}),m&&f.map(N=>r.jsxs("tr",{className:"bg-zinc-900/30",children:[r.jsx("td",{}),r.jsx("td",{className:"evidence-keyword-cell pl-5",children:r.jsx(tl,{provider:N.provider})}),r.jsx("td",{children:r.jsx(Pm,{state:N.citationState})}),r.jsx("td",{children:r.jsx(Wb,{history:N.runHistory})}),r.jsx("td",{className:"evidence-change-cell",children:N.changeLabel}),r.jsx("td",{children:r.jsx(oe,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(N.id)},children:"View"})})]},N.id))]},d)})})]})})}function X3({competitors:e}){return e.length===0?r.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):r.jsx("div",{className:"competitor-table-wrap",children:r.jsxs("table",{className:"competitor-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Domain"}),r.jsx("th",{children:"Pressure"}),r.jsx("th",{children:"Citations"}),r.jsx("th",{children:"Key Phrases"})]})}),r.jsx("tbody",{children:e.map(t=>r.jsxs("tr",{children:[r.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),r.jsx("td",{children:r.jsx(st,{tone:oR(t.pressureLabel),children:t.pressureLabel})}),r.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),r.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}const W3=["7d","30d","90d","all"],eM=["gap","cited","uncited"],h1={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 tM({projectName:e}){const[t,s]=w.useState("30d"),[a,o]=w.useState(null),[c,d]=w.useState(null),[f,m]=w.useState(null),[p,v]=w.useState(null),[y,x]=w.useState(!0);return w.useEffect(()=>{let b=!1;return x(!0),Promise.all([Aj(e,t),Tj(e,t),Oj(e,t)]).then(([N,S,C])=>{b||(o(N),d(S),m(C),x(!1))}).catch(()=>{b||x(!1)}),()=>{b=!0}},[e,t]),y&&!a?r.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):r.jsxs(r.Fragment,{children:[r.jsxs("section",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),r.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",r.jsx(bs,{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."})]})]}),r.jsx("div",{className:"flex gap-1",children:W3.map(b=>r.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&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-6",children:[r.jsx(f1,{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}),r.jsxs("div",{className:"flex-1 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),r.jsx(st,{tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",children:a.trend})]}),Object.keys(a.byProvider).length>0&&r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[r.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"Cited / Total"})]})}),r.jsx("tbody",{children:Object.entries(a.byProvider).map(([b,N])=>r.jsxs("tr",{className:"border-t border-zinc-800/40",children:[r.jsx("td",{className:"py-1.5 text-zinc-300",children:b}),r.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(N.citationRate*100).toFixed(1),"%"]}),r.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[N.cited," / ",N.total]})]},b))})]})]})]}),a.buckets.length>=1&&r.jsx(nM,{buckets:a.buckets,keywordChanges:a.keywordChanges??[]})]})]}),r.jsx("div",{className:"page-section-divider"}),r.jsxs("section",{children:[r.jsx("div",{className:"flex items-center justify-between mb-4",children:r.jsxs("div",{children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),r.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",r.jsx(bs,{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 key phrase was cited across all runs in the selected window."})]})]})}),c&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flex gap-1 mb-4",children:eM.map(b=>{const N=b==="cited"?c.cited.length:b==="gap"?c.gap.length:c.uncited.length,S=p===b;return r.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"," (",N,")"]},b)})}),r.jsx(sM,{gaps:c,filter:p})]})]}),r.jsx("div",{className:"page-section-divider"}),r.jsxs("section",{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),r.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",r.jsx(bs,{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&&r.jsxs("div",{className:"space-y-4",children:[r.jsx(iM,{categories:f.overall}),r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[r.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),r.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),r.jsx("tbody",{children:f.overall.map(b=>r.jsxs("tr",{className:"border-t border-zinc-800/40",children:[r.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[r.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${h1[b.category]??"bg-zinc-600"}`}),b.label]}),r.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:b.count}),r.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(b.percentage*100).toFixed(1),"%"]}),r.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:b.topDomains.slice(0,3).map(N=>N.domain).join(", ")})]},b.category))})]})]}),f&&f.overall.length===0&&r.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function nM({buckets:e,keywordChanges:t}){const[s,a]=w.useState(null),o=600,c=140,d={top:30,right:10,bottom:20,left:40},f=o-d.left-d.right,m=c-d.top-d.bottom,p=1,v=e.map((b,N)=>{const S=d.left+(e.length>1?N/(e.length-1)*f:f/2),C=d.top+m-b.citationRate/p*m;return{x:S,y:C}}),y=w.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 r.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[r.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),r.jsxs("svg",{viewBox:`0 0 ${o} ${c}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>a(null),children:[r.jsxs("text",{x:d.left-4,y:d.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),r.jsx("text",{x:d.left-4,y:d.top+m+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),r.jsx("line",{x1:d.left,y1:d.top+m,x2:d.left+f,y2:d.top+m,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),r.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:x}),y.map((b,N)=>r.jsxs("g",{children:[r.jsx("line",{x1:b.x,y1:d.top,x2:b.x,y2:d.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"4 2"}),r.jsx("text",{x:b.x,y:d.top-6,textAnchor:"middle",className:"fill-zinc-500",fontSize:"7",fontWeight:"500",children:b.label})]},`kw-change-${N}`)),s!==null&&r.jsx("line",{x1:v[s].x,y1:d.top,x2:v[s].x,y2:d.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((b,N)=>{const{x:S,y:C}=v[N],k=s===N;return r.jsxs("g",{children:[r.jsx("circle",{cx:S,cy:C,r:"10",fill:"transparent",onMouseEnter:()=>a(N),style:{cursor:"pointer"}}),r.jsx("circle",{cx:S,cy:C,r:k?5:3,className:k?"fill-emerald-400":"fill-emerald-500"})]},N)}),s!==null&&(()=>{const b=e[s],{x:N,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(N-E/2,o-d.right-E)),L=S-R-8;return r.jsxs("g",{children:[r.jsx("rect",{x:z,y:L,width:E,height:R,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),r.jsx("text",{x:z+E/2,y:L+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:C}),k&&r.jsx("text",{x:z+E/2,y:L+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:k})]})})(),e.map((b,N)=>({b,i:N})).filter(({i:b})=>b===0||b===e.length-1||e.length<=7).map(({b,i:N})=>{const S=v[N].x;return r.jsx("text",{x:S,y:c-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:b.startDate.slice(5,10)},N)})]})]})}function sM({gaps:e,filter:t}){const s=w.useMemo(()=>{const a=[...e.gap.map(o=>({...o,_sort:0})),...e.cited.map(o=>({...o,_sort:1})),...e.uncited.map(o=>({...o,_sort:2}))];return t?a.filter(o=>o.category===t):a.sort((o,c)=>o._sort-c._sort)},[e,t]);return s.length===0?r.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",t?` with status "${t}"`:"","."]}):r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[r.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),r.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),r.jsx("th",{className:"text-left py-1 font-medium",children:"Providers Citing"}),r.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),r.jsx("tbody",{children:s.map(a=>{const o=a.category==="cited"?"positive":a.category==="gap"?"caution":"neutral";return r.jsxs("tr",{className:`border-t border-zinc-800/40 ${a.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[r.jsx("td",{className:"py-1.5 text-zinc-200",children:a.keyword}),r.jsx("td",{className:"py-1.5",children:r.jsx(st,{tone:o,children:a.category==="gap"?"Gap":a.category==="cited"?"Cited":"Not Cited"})}),r.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.providers.length>0?a.providers.join(", "):"—"}),r.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.competitorsCiting.length>0?a.competitorsCiting.join(", "):"—"}),r.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 iM({categories:e}){const t=e.reduce((s,a)=>s+a.count,0);return t===0?null:r.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:r.jsx("div",{className:`${h1[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function am(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function aM(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 rM({projectName:e}){const[t,s]=w.useState(null),[a,o]=w.useState(null),[c,d]=w.useState(!0),[f,m]=w.useState(!1),[p,v]=w.useState(!1),[y,x]=w.useState(null),[b,N]=w.useState(null),[S,C]=w.useState("sessions"),[k,E]=w.useState("desc");function R(P){d(!0),km(e).then(X=>{if(!P.current)return s(X),X.connected?zm(e):null}).then(X=>{P.current||(X&&o(X),d(!1))}).catch(X=>{P.current||(x(X instanceof Error?X.message:"Failed to load GA4 data"),d(!1))})}w.useEffect(()=>{const P={current:!1};return R(P),()=>{P.current=!0}},[e]);async function z(){m(!0),x(null),N(null);try{const P=await _p(e);N(`Synced ${P.rowCount.toLocaleString()} rows (${P.days} days)`);const X=await zm(e);o(X);const Q=await km(e);s(Q)}catch(P){x(P instanceof Error?P.message:"Sync failed")}finally{m(!1)}}async function L(){v(!0),x(null),N(null);try{await Lj(e),s({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),o(null),N("GA4 disconnected")}catch(P){x(P instanceof Error?P.message:"Disconnect failed")}finally{v(!1)}}function M(P){S===P?E(X=>X==="desc"?"asc":"desc"):(C(P),E("desc"))}const A=w.useMemo(()=>a?.topPages?[...a.topPages].sort((P,X)=>{const Q=P[S],se=X[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 r.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return r.jsx(oM,{projectName:e,onConnected:()=>R({current:!1})});const T=a&&a.totalSessions>0?Math.round(a.totalOrganicSessions/a.totalSessions*100):0;return r.jsxs(r.Fragment,{children:[y&&r.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&&r.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}),r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),r.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",r.jsx("span",{className:"text-zinc-300",children:t.propertyId}),t.clientEmail&&r.jsxs(r.Fragment,{children:[" · ",r.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(oe,{variant:"outline",size:"sm",disabled:f,onClick:z,children:[r.jsx(Fx,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"Syncing…":"Sync"]}),r.jsxs(oe,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:L,children:[r.jsx(X2,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),r.jsxs("section",{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),r.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",r.jsx(bs,{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?r.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[r.jsx(rm,{value:am(a.totalSessions),label:"Total Sessions",subtitle:a.totalSessions.toLocaleString(),tone:"neutral"}),r.jsx(rm,{value:am(a.totalOrganicSessions),label:"Organic Sessions",subtitle:`${T}% of total`,tone:"positive"}),r.jsx(rm,{value:am(a.totalUsers),label:"Total Users",subtitle:a.totalUsers.toLocaleString(),tone:"neutral"})]}):r.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[r.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),r.jsxs(oe,{variant:"outline",size:"sm",disabled:f,onClick:z,children:[r.jsx(Fx,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),"Sync from GA4"]})]})]}),a&&a.topPages.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"page-section-divider"}),r.jsxs("section",{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),r.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",r.jsx(bs,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[r.jsx(Wc,{label:"Landing Page",sortKey:"landingPage",current:S,dir:k,onSort:M,align:"left"}),r.jsx(Wc,{label:"Sessions",sortKey:"sessions",current:S,dir:k,onSort:M,align:"right"}),r.jsx(Wc,{label:"Organic",sortKey:"organicSessions",current:S,dir:k,onSort:M,align:"right"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),r.jsx(Wc,{label:"Users",sortKey:"users",current:S,dir:k,onSort:M,align:"right"})]})}),r.jsx("tbody",{children:A.map(P=>r.jsx(cM,{page:P},P.landingPage))})]})})]})]}),r.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[r.jsx("span",{children:a?.lastSyncedAt?`Last synced ${aM(a.lastSyncedAt)}`:"Never synced"}),r.jsx("span",{children:a?`${a.topPages.length} pages shown`:""})]})]})}function oM({projectName:e,onConnected:t}){const[s,a]=w.useState(""),[o,c]=w.useState(null),[d,f]=w.useState(null),[m,p]=w.useState(!1),[v,y]=w.useState(null),x=w.useRef(null),b=w.useCallback(S=>{const C=S.target.files?.[0];if(!C)return;y(null),c(C.name);const k=new FileReader;k.onload=()=>{const E=k.result;try{const R=JSON.parse(E);if(!R.client_email||!R.private_key){y("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),f(null);return}f(E)}catch{y("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),f(null)}},k.onerror=()=>{y("Failed to read file."),f(null)},k.readAsText(C)},[]);async function N(){if(y(null),!s.trim()){y("Property ID is required.");return}if(!d){y("Please upload a service account key file.");return}p(!0);try{await Dj(e,{propertyId:s.trim(),keyJson:d});try{await _p(e)}catch{}t()}catch(S){y(S instanceof Error?S.message:"Failed to connect GA4")}finally{p(!1)}}return r.jsxs(De,{className:"surface-card p-6",children:[r.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),r.jsx("p",{className:"text-sm text-zinc-400 mb-5",children:"Connect a GA4 property to see traffic data for this project. You'll need a service account key file from Google Cloud Console."}),v&&r.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:v}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),r.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:s,onChange:S=>a(S.target.value),className:"w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-1 focus:ring-zinc-600"}),r.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Find this in GA4 → Admin → Property Settings. It's a numeric ID, not the Measurement ID (G-XXXXXX)."})]}),r.jsxs("div",{className:"mb-5",children:[r.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),r.jsx("input",{ref:x,type:"file",accept:".json,application/json",onChange:b,className:"hidden"}),r.jsxs("button",{type:"button",onClick:()=>x.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[r.jsx(eE,{className:"w-4 h-4 shrink-0"}),o?r.jsx("span",{className:"text-zinc-200 truncate",children:o}):r.jsx("span",{children:"Upload .json key file"})]}),r.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Download from Google Cloud Console → IAM & Admin → Service Accounts → Keys → Add Key → JSON. The service account must have ",r.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),r.jsx(oe,{variant:"default",size:"sm",disabled:m||!s.trim()||!d,onClick:N,children:m?"Connecting & syncing…":"Connect GA4"})]})}function Wc({label:e,sortKey:t,current:s,dir:a,onSort:o,align:c}){const d=s===t;return r.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${c==="right"?"text-right":"text-left"}`,onClick:()=>o(t),children:[e,d&&r.jsx("span",{className:"ml-0.5",children:a==="asc"?"↑":"↓"})]})}const lM={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function rm({value:e,label:t,subtitle:s,tone:a}){return r.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),r.jsx("p",{className:`text-2xl font-bold tabular-nums ${lM[a]}`,children:e}),r.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:s})]})}function cM({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return r.jsxs("tr",{className:"border-t border-zinc-800/40",children:[r.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),r.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),r.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),r.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),r.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function uM({projectName:e}){const[t,s]=w.useState(!1),[a,o]=w.useState([]),[c,d]=w.useState([]),[f,m]=w.useState([]),[p,v]=w.useState([]),[y,x]=w.useState([]),[b,N]=w.useState(null),[S,C]=w.useState(""),[k,E]=w.useState(""),[R,z]=w.useState("30"),[L,M]=w.useState(!1),[A,T]=w.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[P,X]=w.useState(""),[Q,se]=w.useState(!0),[pe,ke]=w.useState(!1),[Se,B]=w.useState(!1),[q,ce]=w.useState(!1),[H,J]=w.useState(!1),[O,F]=w.useState(!1),[ie,re]=w.useState(!1),[ue,de]=w.useState(!1),[fe,Ae]=w.useState(null),[ye,Ke]=w.useState(!1),[We,me]=w.useState(!1),[et,dt]=w.useState(!1),[sn,kt]=w.useState(!1),[an,Vt]=w.useState(null),[zt,_t]=w.useState(""),[mn,le]=w.useState(!1),[Be,qe]=w.useState(!1),[_e,Ue]=w.useState("indexed"),[pt,rn]=w.useState([]),[js,Vs]=w.useState(null),[ws,Qs]=w.useState(!1),[cs,ze]=w.useState(null),[Ht,Qe]=w.useState(null),ae=a.find($=>$.connectionType==="gsc"),Jn=f.length>0||p.length>0||y.length>0;async function gl($){if(!$){d([]),C("");return}ce(!0);try{const{sites:he}=await hj(e);d(he),C($.propertyId??he[0]?.siteUrl??"")}catch(he){d([]),ze(he instanceof Error?he.message:"Failed to load Search Console properties")}finally{ce(!1)}}async function Ys(){F(!0);try{const $=await gj(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});m($)}catch($){m([]),ze($ instanceof Error?$.message:"Failed to load GSC performance data")}finally{F(!1)}}async function Ns(){re(!0);try{const[$,he]=await Promise.all([vj(e,{url:P.trim()||void 0,limit:20}),xj(e)]);v($),x(he)}catch($){v([]),x([]),ze($ instanceof Error?$.message:"Failed to load GSC inspection history")}finally{re(!1)}}async function Fi(){Ke(!0);try{const[$,he]=await Promise.all([Iu(e),bj(e).catch(()=>[])]);Ae($),rn(he)}catch($){Ae(null),rn([]),ze($ instanceof Error?$.message:"Failed to load coverage data")}finally{Ke(!1)}}async function us($){Qs(!0),ze(null);try{const he=await Nm(e,{urls:$}),{succeeded:at,failed:Qt,total:Lt}=he.summary;Qe(Qt===0?`Indexing requested for ${at} URL${at!==1?"s":""}.`:`Indexing requested: ${at}/${Lt} succeeded, ${Qt} failed.`)}catch(he){ze(he instanceof Error?he.message:"Failed to request indexing")}finally{Qs(!1)}}async function Ta(){Qs(!0),ze(null);try{const $=await Nm(e,{urls:[],allUnindexed:!0}),{succeeded:he,failed:at,total:Qt}=$.summary;Qe(at===0?`Indexing requested for ${he} unindexed URL${he!==1?"s":""}.`:`Indexing requested: ${he}/${Qt} succeeded, ${at} failed.`)}catch($){ze($ instanceof Error?$.message:"Failed to request indexing")}finally{Qs(!1)}}async function ds(){if(zt.trim()){le(!0),ze(null);try{await pj(e,"gsc",zt.trim()),o($=>$.map(he=>he.connectionType==="gsc"?{...he,sitemapUrl:zt.trim()}:he)),Qe("Sitemap URL saved."),_t("")}catch($){ze($ instanceof Error?$.message:"Failed to save sitemap URL")}finally{le(!1)}}}async function yl(){dt(!0),ze(null);try{const $=await wj(e);Vt($.sitemaps),o(he=>he.map(at=>at.connectionType==="gsc"?{...at,sitemapUrl:$.primarySitemapUrl}:at)),Qe(`Discovered ${$.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${$.run.id}).`)}catch($){ze($ instanceof Error?$.message:"Failed to discover sitemaps")}finally{dt(!1)}}async function vl(){kt(!0),ze(null);try{const $=await jj(e);Vt($.sitemaps),$.sitemaps.length===0&&Qe("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch($){ze($ instanceof Error?$.message:"Failed to list sitemaps")}finally{kt(!1)}}async function Oa(){se(!0),ze(null);try{const[$,he]=await Promise.all([Pu().catch(()=>null),wp(e).catch(()=>[])]);s(!!$?.google?.configured),o(he);const at=he.find(Qt=>Qt.connectionType==="gsc");await Promise.all([gl(at),Ys(),Ns(),Fi()])}finally{se(!1)}}w.useEffect(()=>{Oa()},[e]);async function Ki(){if(!t){ze("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ke(!0),ze(null),Qe(null);try{const{authUrl:$}=await dj(e,"gsc");if(!$.startsWith("https://accounts.google.com/")){ze("Unexpected OAuth redirect URL. Please try again.");return}const he=window.open($,"_blank","width=600,height=700");if(!he){window.location.assign($);return}Qe("Finish the Google consent flow in the popup, then close it to refresh this project.");const at=window.setInterval(()=>{he.closed&&(window.clearInterval(at),Qe(null),Oa())},1e3)}catch($){ze($ instanceof Error?$.message:"Failed to start OAuth flow")}finally{ke(!1)}}async function fd(){ze(null),Qe(null);try{await fj(e,"gsc"),o($=>$.filter(he=>he.connectionType!=="gsc")),d([]),C("")}catch($){ze($ instanceof Error?$.message:"Failed to disconnect")}}async function xl(){if(S){J(!0),ze(null);try{await mj(e,"gsc",S),o($=>$.map(he=>he.connectionType==="gsc"?{...he,propertyId:S}:he)),Qe("GSC property updated.")}catch($){ze($ instanceof Error?$.message:"Failed to save GSC property")}finally{J(!1)}}}async function bl(){B(!0),ze(null),Qe(null);try{await Np(e,{days:parseInt(R,10)||void 0,full:L||void 0}),Qe("GSC sync queued. Refresh after the run completes to see imported data.")}catch($){ze($ instanceof Error?$.message:"Failed to trigger sync")}finally{B(!1)}}async function Fr(){if(k.trim()){de(!0),ze(null),Qe(null);try{const $=await yj(e,k.trim());N($),E(""),await Ns()}catch($){ze($ instanceof Error?$.message:"Failed to inspect URL")}finally{de(!1)}}}return r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),r.jsx("h2",{children:"Google Search Console"})]}),r.jsx("div",{className:"flex items-center gap-2",children:ae&&r.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Ys()},children:O?"Refreshing…":"Refresh data"})})]}),cs&&r.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:[cs,r.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>ze(null),children:"×"})]}),Ht&&r.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,r.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>Qe(null),children:"×"})]}),Q?r.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):r.jsxs("div",{className:"space-y-3",children:[r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),r.jsx("h3",{children:"Domain authorization"})]}),r.jsx(st,{tone:ae?"positive":t?"caution":"negative",children:ae?"Connected":t?"Ready to connect":"App credentials missing"})]}),ae?r.jsxs("div",{className:"mt-3 space-y-3",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),r.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),r.jsx("span",{className:"text-xs text-zinc-500",children:ae.domain}),r.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:fd,children:"Disconnect"})]}),r.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",r.jsx("code",{children:ae.domain}),"."]})]}),r.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ae.propertyId??"No property selected yet"})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:is(ae.updatedAt)})]})]})]}):r.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[r.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."}),r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?r.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:Ki,children:pe?"Opening…":"Connect Google Search Console"}):r.jsx(oe,{type:"button",variant:"outline",size:"sm",asChild:!0,children:r.jsx(yt,{to:"/settings",children:"Open Settings"})}),!t&&r.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),ae&&!ae.sitemapUrl&&r.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"mt-0.5 text-amber-400",children:r.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:r.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"})})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),r.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."}),r.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[r.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[r.jsx(oe,{type:"button",size:"sm",disabled:et||!ae.propertyId,onClick:yl,children:et?"Discovering…":"Auto-discover from GSC"}),r.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),r.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[r.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:$=>_t($.target.value),onKeyDown:$=>$.key==="Enter"&&void ds()}),r.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:mn||!zt.trim(),onClick:ds,children:mn?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ae||Jn)&&r.jsxs(r.Fragment,{children:[r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),r.jsx("h3",{children:"Index coverage"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[fe&&fe.notIndexed.length>0&&r.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:ws,onClick:()=>{Ta()},children:ws?"Requesting…":`Request indexing (${fe.notIndexed.length})`}),r.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:ye,onClick:()=>{Fi()},children:ye?"Loading…":"Refresh coverage"})]})]}),fe&&fe.summary.total>0?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const $=fe.summary.indexed+fe.summary.notIndexed,he=$>0?fe.summary.indexed/$:0,at=$>0?fe.summary.notIndexed/$:0,Qt=54,Lt=2*Math.PI*Qt,Et=Lt*(1-he),wt=Lt*at,Cn=Lt*he;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative h-48 w-48",children:[r.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[r.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),r.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"}}),fe.summary.notIndexed>0&&r.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"}})]}),r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[r.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(he*100).toFixed(0),"%"]}),r.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),r.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:fe.summary.indexed.toLocaleString()}),r.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),r.jsx("div",{className:"h-8 w-px bg-zinc-800"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:fe.summary.notIndexed.toLocaleString()}),r.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(fe.reasonGroups??[]).length>0&&r.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(fe.reasonGroups??[]).length," ",(fe.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),fe.summary.deindexed>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-8 w-px bg-zinc-800"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:fe.summary.deindexed.toLocaleString()}),r.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),r.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map($=>{const he=$==="indexed"?fe.indexed.length:$==="notIndexed"?fe.notIndexed.length:fe.deindexed.length,at=$==="indexed"?"Indexed":$==="notIndexed"?"Not Indexed":"Deindexed";return r.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${_e===$?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Ue($),Vs(null)},children:[at," (",he,")"]},$)})}),r.jsxs("div",{className:"mt-3 overflow-x-auto",children:[_e==="indexed"&&fe.indexed.length>0&&r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Verdict"}),r.jsx("th",{className:"text-left",children:"Last Crawl"}),r.jsx("th",{className:"text-left",children:"Mobile"})]})}),r.jsx("tbody",{children:fe.indexed.map($=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),r.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:$.crawlTime?$.crawlTime.split("T")[0]:"—"}),r.jsx("td",{className:"text-zinc-400",children:$.isMobileFriendly===!0?"Yes":$.isMobileFriendly===!1?"No":"—"})]},$.id))})]}),_e==="notIndexed"&&!js&&(fe.reasonGroups??[]).length>0&&r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"Reason"}),r.jsx("th",{className:"text-right",children:"Pages"})]})}),r.jsx("tbody",{children:(fe.reasonGroups??[]).map($=>r.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Vs($.reason),children:[r.jsx("td",{className:"text-zinc-200",children:$.reason}),r.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.count})]},$.reason))})]}),_e==="notIndexed"&&!js&&(fe.reasonGroups??[]).length===0&&fe.notIndexed.length>0&&r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Indexing State"}),r.jsx("th",{className:"text-left",children:"Coverage"})]})}),r.jsx("tbody",{children:fe.notIndexed.map($=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),r.jsx("td",{className:"text-zinc-400",children:$.indexingState??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"})]},$.id))})]}),_e==="notIndexed"&&js&&(()=>{const $=(fe.reasonGroups??[]).find(he=>he.reason===js);return $?r.jsxs("div",{children:[r.jsx("div",{className:"flex items-center gap-2 mb-3",children:r.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Vs(null),children:"\\u2190 Back to reasons"})}),r.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-zinc-200",children:$.reason}),r.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[$.count," affected page",$.count!==1?"s":""]})]}),r.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:ws,onClick:()=>{us($.urls.map(he=>he.url))},children:ws?"Requesting…":`Request indexing (${$.count})`})]}),r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Last Crawl"}),r.jsx("th",{className:"w-8"})]})}),r.jsx("tbody",{children:$.urls.map(he=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:he.url}),r.jsx("td",{className:"text-zinc-400",children:he.crawlTime?he.crawlTime.split("T")[0]:"—"}),r.jsx("td",{children:r.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:ws,onClick:()=>{us([he.url])},title:"Request indexing",children:"Index"})})]},he.id))})]})]}):null})(),_e==="deindexed"&&fe.deindexed.length>0&&r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Previous"}),r.jsx("th",{className:"text-left",children:"Current"}),r.jsx("th",{className:"text-left",children:"Detected"})]})}),r.jsx("tbody",{children:fe.deindexed.map(($,he)=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),r.jsx("td",{className:"text-zinc-400",children:$.previousState}),r.jsx("td",{className:"text-zinc-400",children:$.currentState}),r.jsx("td",{className:"text-zinc-400",children:$.transitionDate.split("T")[0]})]},`${$.url}-${he}`))})]}),(_e==="indexed"&&fe.indexed.length===0||_e==="notIndexed"&&!js&&fe.notIndexed.length===0||_e==="deindexed"&&fe.deindexed.length===0)&&r.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):r.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ye?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),r.jsx("h3",{children:"Search performance"})]}),r.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Ys()},children:O?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const $=new Map;for(const He of f){const rt=$.get(He.date);rt?(rt.clicks+=He.clicks,rt.impressions+=He.impressions):$.set(He.date,{clicks:He.clicks,impressions:He.impressions})}const he=[...$.entries()].sort(([He],[rt])=>He.localeCompare(rt));if(he.length===0)return null;const at=Math.max(...he.map(([,He])=>He.impressions),1),Qt=he.reduce((He,[,rt])=>He+rt.clicks,0),Lt=he.reduce((He,[,rt])=>He+rt.impressions,0),Et=Lt>0?(Qt/Lt*100).toFixed(1):"0.0",wt=700,Cn=220,tn={top:12,bottom:36,left:48,right:12},hd=wt-tn.left-tn.right,Js=Cn-tn.top-tn.bottom,Xs=hd/he.length,fs=Math.max(Math.min(Xs*.35,24),4),Da=Math.max(fs*.15,1),Ws=He=>{if(He<=0)return 1;const rt=Math.pow(10,Math.floor(Math.log10(He))),Gt=He/rt,on=Gt<=1.5?1.5:Gt<=3?3:Gt<=5?5:10;return Math.ceil(on*rt)},Xn=4,hs=Math.ceil(Ws(at)/Xn)*Xn,ei=Array.from({length:Xn+1},(He,rt)=>hs/Xn*rt),Mt=He=>He>=1e3?`${(He/1e3).toFixed(He>=1e4?0:1)}k`:String(He);return r.jsxs("div",{className:"mt-3",children:[r.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),r.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",r.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Qt.toLocaleString()})]})]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),r.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",r.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Lt.toLocaleString()})]})]}),r.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",r.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Et,"%"]})]})]}),r.jsx("div",{className:"relative w-full",style:{aspectRatio:`${wt} / ${Cn}`},children:r.jsxs("svg",{viewBox:`0 0 ${wt} ${Cn}`,className:"h-full w-full",children:[ei.map((He,rt)=>{const Gt=tn.top+Js-He/hs*Js;return r.jsxs("g",{children:[r.jsx("line",{x1:tn.left,y1:Gt,x2:wt-tn.right,y2:Gt,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),r.jsx("text",{x:tn.left-6,y:Gt+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Mt(He)})]},`t-${rt}`)}),he.map(([He,rt],Gt)=>{const on=tn.left+Xs*Gt+Xs/2,La=rt.impressions/hs*Js,Kr=rt.clicks/hs*Js;return r.jsxs("g",{children:[r.jsx("title",{children:`${He}
|
|
234
|
+
Clicks: ${rt.clicks}
|
|
235
|
+
Impressions: ${rt.impressions}
|
|
236
|
+
CTR: ${rt.impressions>0?(rt.clicks/rt.impressions*100).toFixed(1):0}%`}),r.jsx("rect",{x:on-fs-Da/2,y:tn.top+Js-La,width:fs,height:Math.max(La,1),rx:2,fill:"#3b82f6",opacity:.85}),r.jsx("rect",{x:on+Da/2,y:tn.top+Js-Kr,width:fs,height:Math.max(Kr,1),rx:2,fill:"#10b981",opacity:.85})]},He)}),(()=>{const He=Math.min(he.length,7);return Array.from({length:He},(rt,Gt)=>{const on=he.length===1?0:Math.round(Gt/(He-1)*(he.length-1)),La=tn.left+Xs*on+Xs/2;return r.jsx("text",{x:La,y:Cn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:he[on][0].slice(5)},`xl-${on}`)})})()]})})]})})(),r.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[r.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(he=>({...he,startDate:$.target.value}))}),r.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(he=>({...he,endDate:$.target.value}))}),r.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(he=>({...he,query:$.target.value}))}),r.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(he=>({...he,page:$.target.value}))}),r.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(he=>({...he,limit:$.target.value}))})]}),f.length>0?r.jsx("div",{className:"mt-3 overflow-x-auto",children:r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"Date"}),r.jsx("th",{className:"text-left",children:"Query"}),r.jsx("th",{className:"text-left",children:"Page"}),r.jsx("th",{className:"text-right",children:"Clicks"}),r.jsx("th",{className:"text-right",children:"Impressions"}),r.jsx("th",{className:"text-right",children:"CTR"}),r.jsx("th",{className:"text-right",children:"Position"})]})}),r.jsx("tbody",{children:f.map(($,he)=>r.jsxs("tr",{children:[r.jsx("td",{className:"text-zinc-400",children:$.date}),r.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:$.query}),r.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:$.page}),r.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:$.clicks.toLocaleString()}),r.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.impressions.toLocaleString()}),r.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[($.ctr*100).toFixed(1),"%"]}),r.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:$.position.toFixed(1)})]},`${$.date}:${$.query}:${$.page}:${he}`))})]})}):r.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),r.jsxs(De,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),r.jsx("h3",{children:"Inspect a URL"})]})}),r.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[r.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()}),r.jsx(oe,{type:"button",size:"sm",disabled:ue||!ae?.propertyId||!k.trim(),onClick:Fr,children:ue?"Inspecting…":"Inspect URL"})]}),b&&r.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.indexingState??"Unknown"})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.verdict??"Unknown"})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Kx(b.isMobileFriendly)})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:is(b.crawlTime)})]})]})]}),r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),r.jsx("h3",{children:"Inspection log"})]}),r.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:ie,onClick:()=>{Ns()},children:ie?"Loading…":"Refresh history"})]}),r.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[r.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:$=>X($.target.value)}),r.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:ie,onClick:()=>{Ns()},children:"Apply filter"})]}),p.length>0?r.jsx("div",{className:"mt-3 overflow-x-auto",children:r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Indexing"}),r.jsx("th",{className:"text-left",children:"Verdict"}),r.jsx("th",{className:"text-left",children:"Coverage"}),r.jsx("th",{className:"text-left",children:"Mobile"}),r.jsx("th",{className:"text-left",children:"Inspected"})]})}),r.jsx("tbody",{children:p.map($=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),r.jsx("td",{className:"text-zinc-300",children:$.indexingState??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:$.verdict??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:$.coverageState??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:Kx($.isMobileFriendly)}),r.jsx("td",{className:"text-zinc-400",children:is($.inspectedAt)})]},$.id))})]})}):r.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),r.jsxs(De,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),r.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?r.jsx("div",{className:"mt-3 overflow-x-auto",children:r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Previous"}),r.jsx("th",{className:"text-left",children:"Current"}),r.jsx("th",{className:"text-left",children:"Changed at"})]})}),r.jsx("tbody",{children:y.map($=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:$.url}),r.jsx("td",{className:"text-zinc-400",children:$.previousState??"Unknown"}),r.jsx("td",{className:"text-zinc-300",children:$.currentState??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:is($.transitionDate)})]},`${$.url}:${$.transitionDate}`))})]})}):r.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ae&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:r.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>qe($=>!$),children:[r.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 ${Be?"rotate-90":""}`,"aria-hidden":"true",children:r.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"})}),r.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),Be&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsxs(De,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),r.jsx("h3",{children:"Pick the Search Console property"})]})}),r.jsxs("div",{className:"mt-3 space-y-2",children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),r.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:q||c.length===0,onChange:$=>C($.target.value),children:c.length===0?r.jsx("option",{value:"",children:q?"Loading properties…":"No properties available"}):c.map($=>r.jsxs("option",{value:$.siteUrl,children:[$.siteUrl," · ",$.permissionLevel]},$.siteUrl))}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:q,onClick:()=>{gl(ae)},children:q?"Refreshing…":"Refresh properties"}),r.jsx(oe,{type:"button",size:"sm",disabled:!S||H,onClick:xl,children:H?"Saving…":"Save property"})]}),r.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),r.jsxs(De,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),r.jsx("h3",{children:"Import GSC performance data"})]})}),r.jsxs("div",{className:"mt-3 space-y-3",children:[r.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),r.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)})]}),r.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:[r.jsx("input",{type:"checkbox",checked:L,onChange:$=>M($.target.checked)}),"Replace existing imported rows for the requested range"]})]}),r.jsx(oe,{type:"button",size:"sm",disabled:Se||!ae.propertyId,onClick:bl,children:Se?"Queueing…":"Queue sync"}),!ae.propertyId&&r.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),r.jsxs(De,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),r.jsx("h3",{children:"Sitemap configuration"})]})}),r.jsxs("div",{className:"mt-3 space-y-3",children:[ae.sitemapUrl&&r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:ae.sitemapUrl})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:sn||!ae.propertyId,onClick:()=>{vl()},children:sn?"Loading…":"Browse sitemaps from GSC"}),r.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:et||!ae.propertyId,onClick:yl,children:et?"Discovering…":"Auto-discover and queue inspection"})]}),r.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&&r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[r.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",an.length,")"]}),an.map($=>{const he=$.contents?.[0];return r.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-zinc-200 break-all",children:$.path}),$.lastSubmitted&&r.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",$.lastSubmitted.split("T")[0]]})]}),r.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[he&&r.jsxs("div",{className:"text-right",children:[r.jsxs("p",{className:"text-zinc-300",children:[he.indexed," / ",he.submitted]}),r.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),r.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>_t($.path),children:"Use"})]})]},$.path)})]}),r.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[r.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:$=>_t($.target.value),onKeyDown:$=>$.key==="Enter"&&zt.trim()&&void ds()}),r.jsx(oe,{type:"button",size:"sm",disabled:mn||!zt.trim(),onClick:ds,children:mn?"Saving…":ae.sitemapUrl?"Update":"Save"})]}),r.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[r.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}`}),r.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:We||!ae.propertyId,onClick:()=>{const he=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ae.sitemapUrl||void 0;me(!0),Sj(e,{sitemapUrl:he}).then(at=>{Qe(`Sitemap inspection queued (run ${at.id}). Refresh coverage after the run completes.`)}).catch(at=>{ze(at instanceof Error?at.message:"Failed to queue sitemap inspection")}).finally(()=>me(!1))},children:We?"Queueing…":"Inspect sitemap"})]}),!ae.propertyId&&r.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function dM({project:e,onUpdateProject:t,onRefresh:s}){const[a,o]=w.useState(!1),[c,d]=w.useState(!1),[f,m]=w.useState(null),[p,v]=w.useState(e.displayName),[y,x]=w.useState(e.canonicalDomain),[b,N]=w.useState(e.country),[S,C]=w.useState(e.language),[k,E]=w.useState(e.ownedDomains??[]),[R,z]=w.useState(""),[L,M]=w.useState(null),[A,T]=w.useState(!1),[P,X]=w.useState(!1),[Q,se]=w.useState(""),[pe,ke]=w.useState(""),[Se,B]=w.useState(""),[q,ce]=w.useState(""),[H,J]=w.useState("");w.useEffect(()=>{a||(v(e.displayName),x(e.canonicalDomain),N(e.country),C(e.language),E(e.ownedDomains??[]))},[e,a]);function O(){o(!1),m(null),v(e.displayName),x(e.canonicalDomain),N(e.country),C(e.language),E(e.ownedDomains??[]),z("")}function F(){const me=R.trim();me&&(k.includes(me)||E([...k,me]),z(""))}function ie(me){E(k.filter(et=>et!==me))}async function re(){if(!(!p.trim()||!y.trim()||!b.trim()||!S.trim())){d(!0),m(null);try{await t(e.name,{displayName:p.trim(),canonicalDomain:y.trim(),ownedDomains:k,country:b.trim(),language:S.trim()}),o(!1)}catch(me){m(me instanceof Error?me.message:"Failed to save")}finally{d(!1)}}}async function ue(){const me=Q.trim(),et=pe.trim(),dt=Se.trim(),sn=q.trim();if(!(!me||!et||!dt||!sn)){T(!0),M(null);try{const kt={label:me,city:et,region:dt,country:sn};H.trim()&&(kt.timezone=H.trim()),await ZS(e.name,kt),s(),se(""),ke(""),B(""),ce(""),J(""),X(!1)}catch(kt){M(kt instanceof Error?kt.message:"Failed to add location")}finally{T(!1)}}}async function de(me){T(!0),M(null);try{await VS(e.name,me),s()}catch(et){M(et instanceof Error?et.message:"Failed to remove location")}finally{T(!1)}}async function fe(me){T(!0),M(null);try{await QS(e.name,me),s()}catch(et){M(et instanceof Error?et.message:"Failed to set default location")}finally{T(!1)}}const Ae=p!==e.displayName||y!==e.canonicalDomain||b!==e.country||S!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ye="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",We=Q.trim()&&pe.trim()&&Se.trim()&&q.trim();return r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),r.jsx("h2",{children:"Project settings"})]}),!a&&r.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>o(!0),children:"Edit settings"})]}),f&&r.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,r.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>m(null),children:"×"})]}),a?r.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:Ke,children:"Display name"}),r.jsx("input",{className:ye,type:"text",value:p,onChange:me=>v(me.target.value),placeholder:"My Project"})]}),r.jsxs("div",{children:[r.jsx("label",{className:Ke,children:"Canonical domain"}),r.jsx("input",{className:ye,type:"text",value:y,onChange:me=>x(me.target.value),placeholder:"example.com"})]}),r.jsxs("div",{children:[r.jsx("label",{className:Ke,children:"Country"}),r.jsx("input",{className:ye,type:"text",value:b,onChange:me=>N(me.target.value),placeholder:"US",maxLength:2})]}),r.jsxs("div",{children:[r.jsx("label",{className:Ke,children:"Language"}),r.jsx("input",{className:ye,type:"text",value:S,onChange:me=>C(me.target.value),placeholder:"en"})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:Ke,children:"Owned domains"}),r.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(me=>r.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,r.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))}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{className:`${ye} flex-1`,type:"text",placeholder:"docs.example.com",value:R,onChange:me=>z(me.target.value),onKeyDown:me=>me.key==="Enter"&&(me.preventDefault(),F())}),r.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:!R.trim(),onClick:F,children:"Add"})]})]}),r.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[r.jsx(oe,{type:"button",disabled:c||!Ae||!p.trim()||!y.trim(),onClick:re,children:c?"Saving...":"Save changes"}),r.jsx(oe,{type:"button",variant:"outline",disabled:c,onClick:O,children:"Cancel"})]})]}):r.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:r.jsx("table",{className:"w-full text-sm",children:r.jsxs("tbody",{children:[r.jsxs("tr",{className:"border-b border-zinc-800/40",children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),r.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),r.jsxs("tr",{className:"border-b border-zinc-800/40",children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),r.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),r.jsxs("tr",{className:"border-b border-zinc-800/40",children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),r.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?r.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(me=>r.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))}):r.jsx("span",{className:"text-zinc-500",children:"—"})})]}),r.jsxs("tr",{className:"border-b border-zinc-800/40",children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),r.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),r.jsxs("tr",{className:"border-b border-zinc-800/40",children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),r.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),r.jsxs("tr",{children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),r.jsxs("td",{className:"px-4 py-2.5",children:[L&&r.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,r.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>M(null),children:"×"})]}),(e.locations??[]).length>0?r.jsxs("table",{className:"w-full text-xs mb-2",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"text-zinc-600",children:[r.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),r.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),r.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),r.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),r.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),r.jsx("th",{className:"pb-1"})]})}),r.jsx("tbody",{children:e.locations.map(me=>r.jsxs("tr",{className:"border-t border-zinc-800/30",children:[r.jsx("td",{className:"py-1.5 pr-3",children:r.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?" ★":""]})}),r.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.city}),r.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.region}),r.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.country}),r.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:me.timezone??"—"}),r.jsx("td",{className:"py-1.5",children:r.jsxs("div",{className:"flex items-center gap-1.5",children:[me.label!==e.defaultLocation&&r.jsx("button",{type:"button",disabled:A,onClick:()=>fe(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"}),r.jsx("button",{type:"button",disabled:A,onClick:()=>de(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))})]}):r.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),P?r.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[r.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),r.jsx("input",{className:ye,type:"text",value:Q,onChange:me=>se(me.target.value),placeholder:"nyc"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),r.jsx("input",{className:ye,type:"text",value:pe,onChange:me=>ke(me.target.value),placeholder:"New York"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),r.jsx("input",{className:ye,type:"text",value:Se,onChange:me=>B(me.target.value),placeholder:"NY"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),r.jsx("input",{className:ye,type:"text",value:q,onChange:me=>ce(me.target.value),placeholder:"US",maxLength:2})]}),r.jsxs("div",{className:"col-span-2",children:[r.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),r.jsx("input",{className:ye,type:"text",value:H,onChange:me=>J(me.target.value),placeholder:"America/New_York"})]})]}),r.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[r.jsx(oe,{type:"button",size:"sm",disabled:A||!We,onClick:ue,children:A?"Adding...":"Add location"}),r.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:A,onClick:()=>{X(!1),M(null)},children:"Cancel"})]})]}):r.jsx(oe,{type:"button",size:"sm",variant:"outline",onClick:()=>X(!0),children:"+ Add location"})]})]})]})})})]})}const fM=[{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"}],eS=["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 hM({projectName:e}){const[t,s]=w.useState("loading"),[a,o]=w.useState(!1),[c,d]=w.useState("daily"),[f,m]=w.useState(6),[p,v]=w.useState(""),[y,x]=w.useState("UTC"),[b,N]=w.useState(!1),[S,C]=w.useState(""),[k,E]=w.useState(!1),[R,z]=w.useState(!1),[L,M]=w.useState(null);w.useEffect(()=>{sj(e).then(s).catch(()=>s(null))},[e]);const A=()=>{if(t&&t!=="loading"){const Q=iE(t.preset??null,t.cronExpr);d(Q.freq),m(Q.hour),v(Q.customCron);const se=eS.includes(t.timezone);x(se?t.timezone:"Other"),N(!se),C(se?"":t.timezone)}else d("daily"),m(6),v(""),x("UTC"),N(!1),C("");M(null),o(!0)},T=async()=>{E(!0),M(null);try{const se={timezone:b?S.trim()||"UTC":y};c==="custom"?se.cron=p.trim():se.preset=sE(c,f);const pe=await jm(e,se);s(pe),o(!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 jm(e,Q))}catch(Q){M(Q instanceof Error?Q.message:"Failed to update schedule")}finally{E(!1)}}},X=async()=>{z(!0),M(null);try{await ij(e),s(null),o(!1)}catch(Q){M(Q instanceof Error?Q.message:"Failed to remove schedule")}finally{z(!1)}};return r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),r.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!a&&r.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:A,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&r.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&r.jsx(De,{className:"surface-card compact-card",children:r.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!a&&t!==null&&r.jsxs(De,{className:"surface-card compact-card",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium text-zinc-200",children:aE(t.preset??null,t.cronExpr,t.timezone)}),r.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",r.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&r.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&r.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsx(st,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),r.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:P,children:t.enabled?"Pause":"Resume"}),r.jsx(oe,{type:"button",variant:"ghost",size:"sm",disabled:R,onClick:X,children:R?"Removing...":"Remove"})]})]}),L&&r.jsx("p",{className:"text-rose-400 text-sm mt-2",children:L})]}),a&&r.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),r.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:fM.map(Q=>r.jsx("option",{value:Q.value,children:Q.label},Q.value))})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),r.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=>m(parseInt(Q.target.value)),children:Array.from({length:24},(Q,se)=>r.jsx("option",{value:se,children:Em(se)},se))})]})]}),c==="custom"&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),r.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:p,onChange:Q=>v(Q.target.value)})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),r.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"?(N(!0),x("Other")):(N(!1),x(Q.target.value))},children:[eS.map(Q=>r.jsx("option",{value:Q,children:Q},Q)),r.jsx("option",{value:"Other",children:"Other (enter manually)\\u2026"})]}),b&&r.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&&r.jsx("p",{className:"text-rose-400 text-sm",children:L}),r.jsxs("div",{className:"flex gap-2 justify-end",children:[r.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{o(!1),M(null)},children:"Cancel"}),r.jsx(oe,{type:"button",size:"sm",disabled:k||c==="custom"&&!p.trim(),onClick:T,children:k?"Saving...":"Save schedule"})]})]})]})}const mM=[{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 pM({projectName:e}){const[t,s]=w.useState("loading"),[a,o]=w.useState(!1),[c,d]=w.useState(""),[f,m]=w.useState(["citation.lost","citation.gained"]),[p,v]=w.useState(!1),[y,x]=w.useState(null),[b,N]=w.useState({});w.useEffect(()=>{aj(e).then(s).catch(()=>s([]))},[e]);const S=R=>{m(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 rj(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[R]:[...z,R]),d(""),m(["citation.lost","citation.gained"]),o(!1)}catch(R){x(R instanceof Error?R.message:"Failed to add webhook")}finally{v(!1)}}},k=async R=>{try{await oj(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=>{N(z=>({...z,[R]:{state:"testing"}}));try{const z=await lj(e,R);N(L=>({...L,[R]:{state:z.ok?"ok":"fail",status:z.status}}))}catch{N(z=>({...z,[R]:{state:"fail"}}))}};return r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),r.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&r.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{o(!a),x(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&r.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),r.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)})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),r.jsx("div",{className:"flex flex-wrap gap-3",children:mM.map(R=>r.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[r.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:f.includes(R.value),onChange:()=>S(R.value)}),r.jsx("span",{className:"text-sm text-zinc-300",children:R.label})]},R.value))})]}),y&&r.jsx("p",{className:"text-rose-400 text-sm",children:y}),r.jsxs("div",{className:"flex gap-2 justify-end",children:[r.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{o(!1),x(null)},children:"Cancel"}),r.jsx(oe,{type:"button",size:"sm",disabled:p||!c.trim()||f.length===0,onClick:C,children:p?"Adding...":"Add webhook"})]})]}),t==="loading"&&r.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&r.jsx(De,{className:"surface-card compact-card",children:r.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&&r.jsxs("div",{className:"evidence-table-wrap",children:[r.jsxs("table",{className:"evidence-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Endpoint"}),r.jsx("th",{children:"Events"}),r.jsx("th",{children:"Status"}),r.jsx("th",{})]})}),r.jsx("tbody",{children:t.map(R=>r.jsxs("tr",{children:[r.jsx("td",{className:"evidence-keyword-cell",children:r.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:R.urlHost,children:R.urlDisplay??R.url})}),r.jsx("td",{children:r.jsx("div",{className:"flex flex-wrap gap-1",children:R.events.map(z=>r.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))})}),r.jsx("td",{children:r.jsx(st,{tone:R.enabled?"positive":"neutral",children:R.enabled?"Active":"Paused"})}),r.jsx("td",{children:r.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 r.jsx(st,{tone:z.state==="ok"?"positive":z.state==="fail"?"negative":"neutral",children:L})})(),r.jsx(oe,{variant:"ghost",size:"sm",type:"button",disabled:b[R.id]?.state==="testing",onClick:()=>E(R.id),children:"Test"}),r.jsx(oe,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(R.id),children:"Remove"})]})})]},R.id))})]}),y&&r.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}function tS({eyebrow:e,title:t,status:s,tone:a,targetLabel:o,targetValue:c,coverageValue:d,note:f,updatedAt:m,active:p,onClick:v}){return r.jsxs("button",{type:"button",onClick:v,className:`surface-card w-full text-left transition-colors ${p?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),r.jsx("h3",{children:t})]}),r.jsx(st,{tone:a,children:s})]}),r.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:o}),r.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:c})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:d})]})]}),r.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:[r.jsx("span",{children:f}),r.jsx("span",{children:m?`Updated ${is(m)}`:"No recent sync yet"})]})]})}function eu({label:e,value:t,tone:s}){const a=s==="positive"?"text-emerald-400":s==="negative"?"text-rose-400":"text-zinc-200";return r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),r.jsx("p",{className:`mt-2 text-2xl font-semibold ${a}`,children:t})]})}function gM({projectName:e}){const[t,s]=w.useState(null),[a,o]=w.useState([]),[c,d]=w.useState(null),[f,m]=w.useState([]),[p,v]=w.useState([]),[y,x]=w.useState(null),[b,N]=w.useState(""),[S,C]=w.useState(""),[k,E]=w.useState(""),[R,z]=w.useState(!0),[L,M]=w.useState(null),[A,T]=w.useState(null),[P,X]=w.useState("coverage");w.useEffect(()=>{Q()},[e]);async function Q(){z(!0),M(null);try{const H=await Cp(e);if(s(H),H.connected){const[J,O,F]=await Promise.all([Bu(e).catch(()=>null),kp(e).catch(()=>[]),Ej(e).catch(()=>[])]);J&&d(J),m(O),v(F)}}catch(H){M(H instanceof Error?H.message:"Failed to load Bing data")}finally{z(!1)}}async function se(){if(S.trim()){M(null);try{const H=await Cj(e,S.trim());C(""),H.availableSites.length>0&&o(H.availableSites),await Q()}catch(H){M(H instanceof Error?H.message:"Failed to connect")}}}async function pe(){try{await kj(e),s(null),o([]),d(null),m([]),v([]),x(null),E(""),M(null)}catch(H){M(H instanceof Error?H.message:"Failed to disconnect")}}async function ke(){if(k)try{await _j(e,k),await Q()}catch(H){M(H instanceof Error?H.message:"Failed to set site")}}async function Se(){if(b.trim())try{const H=await zp(e,b.trim());x(H),m(J=>[H,...J])}catch(H){M(H instanceof Error?H.message:"Inspection failed")}}async function B(H){try{await Cm(e,{urls:[H]}),M(null),T(`Submitted to Bing: ${H}`),setTimeout(()=>T(null),4e3)}catch(J){M(J instanceof Error?J.message:"Submission failed")}}async function q(){try{const H=await Cm(e,{allUnindexed:!0});M(null);const{succeeded:J,total:O}=H.summary;T(`Submitted ${J}/${O} URL${O!==1?"s":""} to Bing`),setTimeout(()=>T(null),4e3)}catch(H){M(H instanceof Error?H.message:"Batch submission failed")}}if(R)return r.jsx(De,{className:"surface-card",children:r.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!t?.connected)return r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),r.jsx("h3",{children:"Domain authorization"})]}),r.jsx(st,{tone:"caution",children:"Not connected"})]}),r.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),r.jsxs("div",{className:"mt-3",children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),r.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[r.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:H=>C(H.target.value),onKeyDown:H=>H.key==="Enter"&&se()}),r.jsx(oe,{size:"sm",disabled:!S.trim(),onClick:se,children:"Connect"})]}),r.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",r.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&&r.jsx("p",{className:"mt-3 text-xs text-rose-400",children:L})]});if(!t.siteUrl)return r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),r.jsx("h3",{children:"Domain authorization"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(st,{tone:"positive",children:"Connected"}),r.jsx(oe,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),r.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),r.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),r.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."})]}),r.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.domain})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?is(t.updatedAt):"—"})]})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?r.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[r.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:H=>E(H.target.value),children:[r.jsx("option",{value:"",children:"Select a site..."}),a.map(H=>r.jsxs("option",{value:H.url,children:[H.url,H.verified?" (verified)":""]},H.url))]}),r.jsx(oe,{size:"sm",disabled:!k,onClick:ke,children:"Set Site"})]}):r.jsx("div",{className:"mt-3",children:r.jsx(oe,{size:"sm",onClick:async()=>{const H=await zj(e);o(H.sites)},children:"Load Sites"})})]})]}),L&&r.jsx("p",{className:"mt-3 text-xs text-rose-400",children:L})]});const ce=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),r.jsx("h3",{children:"Domain authorization"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(st,{tone:"positive",children:"Connected"}),r.jsx(oe,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),L&&r.jsx("p",{className:"mb-3 text-xs text-rose-400",children:L}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),r.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),r.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),r.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",r.jsx("code",{children:t.siteUrl}),"."]})]}),r.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.siteUrl})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?is(t.updatedAt):"—"})]})]})]})]}),r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),r.jsx("h3",{children:"Index monitoring"})]}),r.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${is(c.lastInspectedAt)}`:"No inspection history yet"})]}),r.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:ce.map(H=>r.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${P===H.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>X(H.key),children:H.label},H.key))}),P==="coverage"&&c&&r.jsxs("div",{className:"mt-4 space-y-4",children:[r.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[r.jsx(eu,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),r.jsx(eu,{label:"Not in index",value:c.summary.notIndexed+(c.summary.unknown??0),tone:"negative"}),r.jsx(eu,{label:"Status unknown",value:c.summary.unknown??0,tone:"neutral"}),r.jsx(eu,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.notIndexed.length>0&&r.jsxs("div",{children:[r.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[r.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[A&&r.jsx("span",{className:"text-xs text-emerald-400",children:A}),r.jsx(oe,{size:"sm",variant:"ghost",onClick:q,children:"Submit all to Bing"})]})]}),r.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:r.jsxs("table",{className:"w-full text-xs",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-zinc-800",children:[r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),r.jsx("tbody",{children:c.notIndexed.map(H=>r.jsxs("tr",{className:"border-b border-zinc-800/50",children:[r.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:H.url}),r.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:H.httpCode??"—"}),r.jsx("td",{className:"py-1.5 px-3 text-right",children:r.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",onClick:()=>B(H.url),children:"Submit"})})]},H.id))})]})})]}),(c.unknown??[]).length>0&&r.jsxs("div",{children:[r.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[r.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(c.unknown??[]).length,")"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[A&&r.jsx("span",{className:"text-xs text-emerald-400",children:A}),r.jsx(oe,{size:"sm",variant:"ghost",onClick:q,children:"Submit all to Bing"})]})]}),r.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:r.jsxs("table",{className:"w-full text-xs",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-zinc-800",children:[r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),r.jsx("tbody",{children:(c.unknown??[]).map(H=>r.jsxs("tr",{className:"border-b border-zinc-800/50",children:[r.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:H.url}),r.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:H.lastCrawledDate?is(H.lastCrawledDate):"—"}),r.jsx("td",{className:"py-1.5 px-3 text-right",children:r.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",onClick:()=>B(H.url),children:"Submit"})})]},H.id))})]})})]}),c.indexed.length>0&&r.jsxs("div",{children:[r.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.indexed.length,")"]}),r.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:r.jsxs("table",{className:"w-full text-xs",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-zinc-800",children:[r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),r.jsx("tbody",{children:c.indexed.map(H=>r.jsxs("tr",{className:"border-b border-zinc-800/50",children:[r.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:H.url}),r.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:H.lastCrawledDate?is(H.lastCrawledDate):"—"})]},H.id))})]})})]})]}),P==="coverage"&&!c&&r.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),P==="inspections"&&r.jsxs("div",{className:"mt-4 space-y-3",children:[r.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[r.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:H=>N(H.target.value),onKeyDown:H=>H.key==="Enter"&&Se()}),r.jsx(oe,{size:"sm",disabled:!b.trim(),onClick:Se,children:"Inspect"})]}),y&&r.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[r.jsx("div",{className:"font-medium text-zinc-200",children:y.url}),r.jsxs("div",{className:"text-zinc-400",children:["In Index: ",r.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&&r.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:r.jsxs("table",{className:"w-full text-xs",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-zinc-800",children:[r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),r.jsx("tbody",{children:f.map(H=>r.jsxs("tr",{className:"border-b border-zinc-800/50",children:[r.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:H.url}),r.jsx("td",{className:"py-1.5 px-3",children:r.jsx(st,{tone:H.inIndex?"positive":"negative",children:H.inIndex?"Yes":"No"})}),r.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:H.httpCode??"—"}),r.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:is(H.inspectedAt)})]},H.id))})]})})]}),P==="performance"&&r.jsx("div",{className:"mt-4",children:p.length===0?r.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):r.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:r.jsxs("table",{className:"w-full text-xs",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-zinc-800",children:[r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Clicks"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Impr"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"CTR"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"Pos"})]})}),r.jsx("tbody",{children:p.map((H,J)=>r.jsxs("tr",{className:"border-b border-zinc-800/50",children:[r.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:H.query}),r.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:H.clicks}),r.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:H.impressions}),r.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(H.ctr*100).toFixed(1),"%"]}),r.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:H.averagePosition.toFixed(1)})]},J))})]})})})]})]})}function yM({projectName:e}){const[t,s]=w.useState("google"),[a,o]=w.useState(!0),[c,d]=w.useState("idle"),[f,m]=w.useState(null),p=w.useRef(null),[v,y]=w.useState(!1),[x,b]=w.useState(null),[N,S]=w.useState(null),[C,k]=w.useState(!1),[E,R]=w.useState(null),[z,L]=w.useState(null);async function M(H=!1){H||o(!0),m(null);try{const[J,O,F]=await Promise.all([Pu().catch(()=>null),wp(e).catch(()=>[]),Cp(e).catch(()=>null)]),ie=O.find(de=>de.connectionType==="gsc")??null;y(!!J?.google?.configured),k(!!J?.bing?.configured),b(ie),R(F);const[re,ue]=await Promise.all([ie?Iu(e).catch(()=>null):Promise.resolve(null),F?.connected?Bu(e).catch(()=>null):Promise.resolve(null)]);S(re),L(ue)}catch(J){m(J instanceof Error?J.message:"Failed to load search console overview")}finally{o(!1)}}async function A(){if(c!=="idle")return;p.current?.abort();const H=new AbortController;p.current=H;const J=H.signal;d("syncing"),m(null);const O=[];try{async function F(){if(!x)return;const de=await Np(e);if(!de?.id)return;const fe=2e3,ye=Date.now()+12e4;for(;Date.now()<ye;){if(J.aborted||(await new Promise(We=>setTimeout(We,fe)),J.aborted))return;const Ke=await Tr(de.id).catch(()=>null);if(!Ke)break;if(["completed","failed","cancelled"].includes(Ke.status)){Ke.status!=="completed"&&O.push(`Google sync ${Ke.status}`);break}}}const ie=10;async function re(){if(!E?.connected)return;const de=await kp(e).catch(()=>[]),fe=[...new Set(de.map(Ae=>Ae.url))];if(fe.length!==0)for(let Ae=0;Ae<fe.length;Ae+=ie){if(J.aborted)return;const ye=fe.slice(Ae,Ae+ie),We=(await Promise.allSettled(ye.map(me=>zp(e,me)))).filter(me=>me.status==="rejected").length;We>0&&O.push(`${We} Bing inspection(s) failed`)}}const ue=await Promise.allSettled([F(),re()]);for(const de of ue)de.status==="rejected"&&O.push(de.reason instanceof Error?de.reason.message:"Sync failed");if(J.aborted)return;d("reloading"),await M(!0),O.length>0&&m(`Partial refresh: ${O.join("; ")}`)}catch(F){J.aborted||m(F instanceof Error?F.message:"Refresh failed")}finally{J.aborted||d("idle")}}w.useEffect(()=>(M(),()=>{p.current?.abort()}),[e]);const T=x?"positive":v?"caution":"negative",P=x?"Connected":v?"Ready to connect":"Needs setup",X=N?`${N.summary.percentage}% indexed`:x?"Awaiting coverage":"No coverage data",Q=N?`${N.summary.notIndexed} not indexed${N.summary.deindexed>0?` · ${N.summary.deindexed} deindexed`:""}`:x?"Run sitemap inspection to populate coverage":v?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",se=N?.lastInspectedAt??x?.updatedAt??null,pe=E?.connected?"positive":C?"caution":"negative",ke=E?.connected?"Connected":C?"Ready to connect":"Needs setup",Se=z?`${z.summary.percentage}% indexed`:E?.connected?"Awaiting coverage":"No coverage data",B=z?z.summary.notIndexed+(z.summary.unknown??0):0,q=z?`${B} not in index`:E?.connected?"Inspect URLs to populate coverage":C?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",ce=z?.lastInspectedAt??E?.updatedAt??null;return r.jsxs("div",{className:"space-y-6",children:[r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),r.jsx("h2",{children:"Search Engine Intelligence"}),r.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."})]}),r.jsx(oe,{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&&r.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}),r.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[r.jsx(tS,{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…":X,note:a?"Loading overview…":Q,updatedAt:se,active:t==="google",onClick:()=>s("google")}),r.jsx(tS,{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…":Se,note:a?"Loading overview…":q,updatedAt:ce,active:t==="bing",onClick:()=>s("bing")})]})]}),r.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([H,J])=>r.jsx("button",{type:"button",role:"tab","aria-selected":t===H,className:`project-subnav-link ${t===H?"project-subnav-link-active":""}`,onClick:()=>s(H),children:J},H))}),t==="google"&&r.jsx(uM,{projectName:e}),t==="bing"&&r.jsxs("section",{className:"page-section-divider",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),r.jsx("h2",{children:"Bing Webmaster Tools"})]})}),r.jsx(gM,{projectName:e})]})]})}function vM({insights:e}){const{openEvidence:t}=ul(),[s,a]=w.useState(null);return r.jsx("div",{className:"insight-list",children:e.map(o=>{const c=s===o.id,d=o.affectedPhrases.length>0;return r.jsxs("div",{children:[r.jsxs("div",{className:`insight-row insight-row-${o.tone} ${d?"cursor-pointer":""}`,onClick:d?()=>a(c?null:o.id):void 0,children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d&&r.jsx(qu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),r.jsx(st,{tone:o.tone,children:o.actionLabel}),r.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:o.title}),r.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:o.detail})]}),d&&r.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[o.affectedPhrases.length," phrase",o.affectedPhrases.length>1?"s":""]})]}),c&&r.jsx("div",{className:"divide-y divide-zinc-800/20",children:o.affectedPhrases.map(f=>r.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(Pm,{state:f.citationState}),r.jsx("span",{className:"text-sm text-zinc-200 truncate",children:f.keyword}),r.jsx("div",{className:"hidden sm:flex gap-1",children:f.provider&&r.jsx(tl,{provider:f.provider})})]}),r.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:m=>{m.stopPropagation(),t(f.evidenceId)},children:"View →"})]},f.evidenceId))})]},o.id)})})}function dd({tab:e}){const{projectId:t}=Uu({from:"/projects/$projectId"}),s=ka(),{dashboard:a,isLoading:o,refetch:c}=Ra();if(!a||o)return r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-48"}),r.jsx("div",{className:"skeleton-text-sm w-32"})]}),r.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(le=>r.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[r.jsx("div",{className:"skeleton-circle size-20"}),r.jsx("div",{className:"skeleton-text w-16 mt-3"})]},le))}),r.jsxs("div",{className:"page-skeleton-card",children:[r.jsx("div",{className:"skeleton-text w-28"}),r.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(le=>r.jsx("div",{className:"skeleton-text-sm w-full"},le))})]})]});const d=XL(a,t),[f,m]=w.useState(!1),[p,v]=w.useState(!1),[y,x]=w.useState(!1),[b,N]=w.useState(null),[S,C]=w.useState(!1),[k,E]=w.useState(""),[R,z]=w.useState(!1),[L,M]=w.useState(!1),[A,T]=w.useState(""),[P,X]=w.useState(!1),[Q,se]=w.useState(!1),[pe,ke]=w.useState(""),[Se,B]=w.useState(!1),[q,ce]=w.useState(void 0),[H,J]=w.useState(!1),[O,F]=w.useState(null),[ie,re]=w.useState(!1),ue=d?.visibilityEvidence??[],de=d?.project.name??"",fe=w.useMemo(()=>new Set(ue.map(le=>le.location??"")),[ue]),Ae=fe.has(""),ye=w.useMemo(()=>[...fe].filter(Boolean),[fe]);w.useEffect(()=>{if(q===void 0||q===""||!de){F(null),re(!1);return}re(!0),bp(de,q).then(le=>{F(le),re(!1)}).catch(()=>{F(null),re(!1)})},[q,de]);const Ke=w.useMemo(()=>{if(!O)return null;const le=new Map;for(const Be of O){for(const[qe,_e]of Object.entries(Be.providerRuns??{}))le.set(`${Be.keyword}::${qe}`,_e.map(Ue=>({runId:Ue.runId,citationState:Ue.citationState,createdAt:Ue.createdAt})));(!Be.providerRuns||Object.keys(Be.providerRuns).length===0)&&le.set(`${Be.keyword}::`,Be.runs.map(qe=>({runId:qe.runId,citationState:qe.citationState,createdAt:qe.createdAt})))}return le},[O]),We=w.useMemo(()=>{const le=q!==void 0?ue.filter(Be=>q===""?!Be.location:Be.location===q):ue;return Ke?le.map(Be=>{const qe=Ke.get(`${Be.keyword}::${Be.provider}`)??Ke.get(`${Be.keyword}::`);return qe?{...Be,runHistory:qe}:Be}):le},[ue,q,Ke]);if(!d)return r.jsx("div",{className:"page-container",children:r.jsxs(De,{className:"surface-card empty-card",children:[r.jsx("h1",{children:"Project not found"}),r.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),r.jsx(oe,{asChild:!0,children:r.jsx(yt,{to:"/",children:"Return to overview"})})]})});async function me(){x(!0),N(null);try{await jp(de),c()}catch(le){N(le instanceof Error?le.message:"Failed to trigger run")}finally{x(!1)}}async function et(){v(!0);try{await YS(de),s({to:"/"}),c()}catch(le){console.error("Failed to delete project:",le)}finally{v(!1)}}async function dt(){const le=await JS(de),Be=typeof le=="string"?le:JSON.stringify(le,null,2),qe=new Blob([Be],{type:"text/yaml"}),_e=URL.createObjectURL(qe),Ue=document.createElement("a");Ue.href=_e,Ue.download=`${de}.yaml`,Ue.click()}async function sn(){const le=k.split(`
|
|
237
|
+
`).map(Be=>Be.trim()).filter(Boolean);if(le.length!==0){z(!0);try{await FS(de,le),c(),E(""),C(!1)}finally{z(!1)}}}async function kt(){const le=A.trim();if(le){X(!0);try{const qe=(await xp(de)).map(Ue=>Ue.domain),_e=[...new Set([...qe,le])];await Sp(de,_e),c(),T(""),M(!1)}finally{X(!1)}}}async function an(){const le=pe.trim();if(le){B(!0);try{const Be=d?.project.ownedDomains??[];await Sm(de,[...Be,le]),c(),ke(""),se(!1)}finally{B(!1)}}}async function Vt(le){B(!0);try{const Be=d?.project.ownedDomains??[];await Sm(de,Be.filter(qe=>qe!==le)),c()}finally{B(!1)}}async function zt(le,Be){await KS(le,Be),c()}const _t=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 r.jsxs("div",{className:"page-container",children:[f?r.jsxs(De,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[r.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),r.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",r.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."]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(oe,{type:"button",variant:"destructive",disabled:p,onClick:et,children:p?"Deleting...":"Yes, delete project"}),r.jsx(oe,{type:"button",variant:"outline",disabled:p,onClick:()=>m(!1),children:"Cancel"})]})]}):null,r.jsxs("div",{className:"page-header",children:[r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:d.project.displayName||d.project.name}),r.jsxs("p",{className:"page-subtitle",children:[d.project.canonicalDomain,(d.project.ownedDomains??[]).length===0&&!Q&&r.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]}),r.jsxs("div",{className:"tag-row",children:[r.jsx("span",{className:"tag",children:d.project.country}),r.jsx("span",{className:"tag",children:d.project.language.toUpperCase()}),d.project.tags.map(le=>r.jsx("span",{className:"tag",children:le},le))]}),((d.project.ownedDomains??[]).length>0||Q)&&r.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[r.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(d.project.ownedDomains??[]).map(le=>r.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,r.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:Se,onClick:()=>Vt(le),"aria-label":`Remove ${le}`,children:"×"})]},le)),Q?r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.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}),r.jsx(oe,{type:"button",size:"sm",disabled:!pe.trim()||Se,onClick:an,children:Se?"...":"Add"}),r.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{se(!1),ke("")},children:"Cancel"})]}):r.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"})]})]}),r.jsxs("div",{className:"page-header-right",children:[r.jsx("p",{className:"text-sm text-zinc-500",children:d.dateRangeLabel}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(oe,{type:"button",variant:"outline",size:"icon",onClick:dt,"aria-label":"Export project as YAML",children:r.jsx(_2,{className:"h-4 w-4 text-zinc-400"})}),r.jsx(oe,{type:"button",variant:"outline",size:"icon",onClick:()=>m(!0),"aria-label":"Delete project",children:r.jsx(V2,{className:"h-4 w-4 text-zinc-400"})}),r.jsx(oe,{type:"button",disabled:y,onClick:me,children:y?"Starting...":"Run now"})]})]})]}),b&&r.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,r.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>N(null),children:"×"})]}),r.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:mn.map(le=>r.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"?r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"gauge-row",children:[r.jsx(f1,{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:_t(d.visibilitySummary.value),progress:d.visibilitySummary.progress}),r.jsxs("div",{className:"metric-card",children:[r.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",r.jsx(bs,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),r.jsxs("p",{className:"metric-card-big-value",children:[r.jsx("span",{className:"text-zinc-50",children:d.gapKeyPhrases.value}),r.jsxs("span",{className:"text-zinc-600",children:[" / ",d.keywordCounts.total]})]}),r.jsx("div",{className:"metric-card-bar",children:r.jsx("div",{className:`metric-card-bar-fill progress-fill-${d.gapKeyPhrases.tone}`,style:{width:d.gapKeyPhrases.progress!==void 0?`${d.gapKeyPhrases.progress*100}%`:"0%"}})}),r.jsx("p",{className:"metric-card-detail",children:d.gapKeyPhrases.delta}),r.jsx("p",{className:"metric-card-sub",children:d.gapKeyPhrases.description})]}),r.jsxs("div",{className:"metric-card",children:[r.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",r.jsx(bs,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),r.jsxs("p",{className:"metric-card-big-value",children:[r.jsx("span",{className:"text-zinc-50",children:d.indexCoverage.value}),r.jsx("span",{className:"text-zinc-600",children:"%"})]}),r.jsx("div",{className:"metric-card-bar",children:r.jsx("div",{className:`metric-card-bar-fill progress-fill-${d.indexCoverage.tone}`,style:{width:`${Number.parseInt(d.indexCoverage.value,10)||0}%`}})}),r.jsx("p",{className:"metric-card-detail",children:d.indexCoverage.delta}),r.jsx("p",{className:"metric-card-sub",children:d.indexCoverage.description})]}),r.jsxs("div",{className:"metric-card",children:[r.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",r.jsx(bs,{text:"Keyword-level citation changes compared to the previous completed run."})]}),d.movementSummary.hasPreviousRun?r.jsxs("div",{className:"metric-card-movement",children:[r.jsxs("span",{className:d.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",d.movementSummary.gained," gained"]}),r.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),r.jsxs("span",{className:d.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",d.movementSummary.lost," lost"]})]}):r.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),r.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&&r.jsxs("section",{className:"page-section-divider",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),r.jsxs("h2",{children:["Visibility by model ",r.jsx(bs,{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."})]})]})}),r.jsx("div",{className:"evidence-table-wrap",children:r.jsxs("table",{className:"evidence-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Model"}),r.jsx("th",{children:"Score"}),r.jsx("th",{children:"Cited key phrases"})]})}),r.jsx("tbody",{children:d.providerScores.map(le=>r.jsxs("tr",{children:[r.jsx("td",{children:r.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[r.jsx(tl,{provider:le.provider}),le.model&&r.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:le.model})]})}),r.jsx("td",{children:r.jsxs("span",{className:`font-semibold ${le.score>=70?"text-emerald-400":le.score>=40?"text-amber-400":"text-rose-400"}`,children:[le.score,"%"]})}),r.jsxs("td",{className:"text-zinc-500",children:[le.cited," of ",le.total]})]},`${le.provider}::${le.model??"unknown"}`))})]})})]}),r.jsxs("section",{className:"page-section-divider",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),r.jsx("h2",{children:"Citation signals"})]})}),r.jsx(vM,{insights:d.insights})]}),r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),r.jsx("h2",{children:"Key phrase citation tracking"})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("p",{className:"supporting-copy",children:[new Set(d.visibilityEvidence.map(le=>le.keyword)).size," key phrases tracked"]}),r.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>C(!S),children:S?"Cancel":"+ Add key phrases"})]})]}),S&&r.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[r.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)}),r.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[r.jsxs("p",{className:"text-xs text-zinc-500",children:[k.split(`
|
|
238
|
+
`).filter(le=>le.trim()).length," key phrases"]}),r.jsx(oe,{type:"button",size:"sm",disabled:!k.trim()||R,onClick:sn,children:R?"Adding...":"Add key phrases"})]})]}),d.project.locations&&d.project.locations.length>0&&r.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[r.jsx("button",{className:`filter-chip ${q===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":q===void 0,onClick:()=>{ce(void 0)},children:"All locations"}),d.project.locations.map(le=>fe.has(le.label)&&r.jsx("button",{className:`filter-chip ${q===le.label?"filter-chip-active":""}`,type:"button","aria-pressed":q===le.label,onClick:()=>{ce(le.label),J(!1)},children:le.label},le.label)),Ae&&r.jsx("button",{className:`filter-chip ${q===""?"filter-chip-active":""}`,type:"button","aria-pressed":q==="",onClick:()=>{ce(""),J(!1)},children:"No location"}),ye.length>1&&q===void 0&&r.jsx("button",{className:`filter-chip filter-chip-compare ${H?"filter-chip-active":""}`,type:"button","aria-pressed":H,onClick:()=>J(le=>!le),title:"Side-by-side location comparison",children:"Compare"})]}),r.jsx(J3,{evidence:We})]}),r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),r.jsx("h2",{children:"Competitive landscape"})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("p",{className:"supporting-copy",children:[d.competitors.length," tracked"]}),r.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>M(!L),children:L?"Cancel":"+ Add competitor"})]})]}),L&&r.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[r.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()}),r.jsx(oe,{type:"button",size:"sm",disabled:!A.trim()||P,onClick:kt,children:P?"Adding...":"Add"})]}),r.jsx(X3,{competitors:d.competitors})]}),r.jsxs("section",{className:"page-section-divider",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),r.jsx("h2",{children:"Recent execution history"})]})}),r.jsx("div",{className:"run-list",children:d.recentRuns.map(le=>r.jsx(d1,{run:le},le.id))})]}),r.jsx(dM,{project:{...d.project,displayName:d.project.displayName??d.project.name,defaultLocation:d.project.defaultLocation??null},onUpdateProject:zt,onRefresh:()=>{c()}}),r.jsx(hM,{projectName:d.project.name}),r.jsx(pM,{projectName:d.project.name})]}):e==="analytics"?r.jsx(tM,{projectName:d.project.name}):e==="traffic"?r.jsx(rM,{projectName:d.project.name}):r.jsx(yM,{projectName:d.project.name})]})}const xM="modulepreload",bM=function(e,t){return new URL(e,t).href},nS={},SM=function(t,s,a){let o=Promise.resolve();if(s&&s.length>0){let p=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]"),m=f?.nonce||f?.getAttribute("nonce");o=p(s.map(v=>{if(v=bM(v,a),v in nS)return;nS[v]=!0;const y=v.endsWith(".css"),x=y?'[rel="stylesheet"]':"";if(a)for(let N=d.length-1;N>=0;N--){const S=d[N];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":xM,y||(b.as="script"),b.crossOrigin="",b.href=v,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((N,S)=>{b.addEventListener("load",N),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 o.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};function jM(){const{dashboard:e,isLoading:t}=Ra();if(!e||t)return r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-20"}),r.jsx("div",{className:"skeleton-text-sm w-72"})]}),r.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(f=>r.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[r.jsxs("div",{className:"flex-1 space-y-1.5",children:[r.jsx("div",{className:"skeleton-text w-40"}),r.jsx("div",{className:"skeleton-text-sm w-56"})]}),r.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},f))})]});const s=e.runs,[a,o]=w.useState("all"),c=a==="all"?s:s.filter(f=>f.status===a),d=()=>{SM(async()=>{const{triggerAllRuns:f}=await Promise.resolve().then(()=>g2);return{triggerAllRuns:f}},void 0,import.meta.url).then(({triggerAllRuns:f})=>f().catch(m=>{console.error("Failed to trigger all runs",m)}))};return r.jsxs("div",{className:"page-container",children:[r.jsxs("div",{className:"page-header",children:[r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:"Runs"}),r.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),r.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:d,children:"Run all projects"})]}),r.jsxs("section",{children:[r.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(f=>r.jsx("button",{className:`filter-chip ${a===f?"filter-chip-active":""}`,type:"button","aria-pressed":a===f,onClick:()=>o(f),children:f==="all"?"All runs":Gu(f)},f))}),r.jsx("div",{className:"run-list",children:c.length>0?c.map(f=>r.jsx(d1,{run:f},f.id)):r.jsxs(De,{className:"surface-card empty-card",children:[r.jsx("h2",{children:"No runs match this filter"}),r.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function wM({providerName:e,keyUrl:t,modelHint:s,onSaved:a}){const o=e.toLowerCase()==="local",[c,d]=w.useState(""),[f,m]=w.useState(""),[p,v]=w.useState(""),[y,x]=w.useState(""),[b,N]=w.useState(""),[S,C]=w.useState(""),[k,E]=w.useState(!1),[R,z]=w.useState(null),[L,M]=w.useState(!1),A=o?f.trim().length>0:c.trim().length>0;async function T(){if(A){E(!0),z(null),M(!1);try{const X=Se=>{const B=parseInt(Se.trim(),10);return Number.isFinite(B)&&B>0?B:void 0},Q={},se=X(y);se!==void 0&&(Q.maxConcurrency=se);const pe=X(b);pe!==void 0&&(Q.maxRequestsPerMinute=pe);const ke=X(S);ke!==void 0&&(Q.maxRequestsPerDay=ke),await tj(e.toLowerCase(),{...c.trim()?{apiKey:c.trim()}:{},...f.trim()?{baseUrl:f.trim()}:{},...p.trim()?{model:p.trim()}:{},...Object.keys(Q).length>0?{quota:Q}:{}}),d(""),m(""),v(""),x(""),N(""),C(""),M(!0),a()}catch(X){z(X instanceof Error?X.message:"Failed to update provider")}finally{E(!1)}}}const P=s??"Use default model";return r.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o&&r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),r.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:X=>m(X.target.value)}),r.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",o?" (optional)":""]}),t&&r.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 ","↗"]})]}),r.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:o?"Optional — most local servers don't need one":`Enter ${e} API key`,value:c,onChange:X=>d(X.target.value)})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),r.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:p,onChange:X=>v(X.target.value)})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),r.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[r.jsxs("div",{children:[r.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:X=>x(X.target.value)}),r.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),r.jsxs("div",{children:[r.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:X=>N(X.target.value)}),r.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),r.jsxs("div",{children:[r.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:X=>C(X.target.value)}),r.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),R&&r.jsx("p",{className:"text-xs text-rose-400",children:R}),L&&r.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),r.jsx(oe,{type:"button",size:"sm",disabled:!A||k,onClick:T,children:k?"Saving...":"Save"})]})}function NM({onSaved:e}){const[t,s]=w.useState(""),[a,o]=w.useState(""),[c,d]=w.useState(!1),[f,m]=w.useState(null),[p,v]=w.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function x(){if(y){d(!0),m(null),v(!1);try{await nj({clientId:t.trim(),clientSecret:a.trim()}),s(""),o(""),v(!0),e()}catch(b){m(b instanceof Error?b.message:"Failed to update Google OAuth credentials")}finally{d(!1)}}}return r.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),r.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"})]}),r.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)})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),r.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=>o(b.target.value)})]}),r.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",r.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),f&&r.jsx("p",{className:"text-xs text-rose-400",children:f}),p&&r.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),r.jsx(oe,{type:"button",size:"sm",disabled:!y||c,onClick:x,children:c?"Saving...":"Save Google OAuth app"})]})}function CM(){const[e,t]=w.useState(null),[s,a]=w.useState(null),[o,c]=w.useState(!1),[d,f]=w.useState("localhost"),[m,p]=w.useState("9222"),[v,y]=w.useState(!1);return w.useEffect(()=>{wm().then(t).catch(x=>{const b=x instanceof Error?x.message:String(x);b.includes("501")||a(b)})},[]),r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),r.jsx("h2",{children:"ChatGPT (CDP)"})]}),r.jsx(st,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),r.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&r.jsxs("div",{children:[r.jsx("dt",{children:"Endpoint"}),r.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&r.jsxs("div",{children:[r.jsx("dt",{children:"Browser"}),r.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&r.jsxs("div",{children:[r.jsx("dt",{children:"Tabs"}),r.jsx("dd",{children:e.targets.map(x=>r.jsxs("span",{className:"mr-2",children:[x.name,": ",x.alive?"● alive":"○ idle"]},x.name))})]})]}),r.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"}),r.jsx("div",{className:"mt-2",children:r.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>c(!o),children:o?"Cancel":e?.connected?"Update endpoint":"Configure"})}),o&&r.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async x=>{x.preventDefault(),y(!0);try{await Nj(d,parseInt(m,10)||9222);const b=await wm().catch(()=>null);b&&t(b),c(!1)}catch(b){a(b instanceof Error?b.message:String(b))}finally{y(!1)}},children:[r.jsxs("div",{className:"flex gap-2",children:[r.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"}),r.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:m,onChange:x=>p(x.target.value),"aria-label":"CDP port"})]}),r.jsx("div",{children:r.jsx(oe,{type:"submit",size:"sm",disabled:v,children:v?"Saving…":"Save endpoint"})})]})]})}const kM={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function zM(){const e=cl(),{dashboard:t}=Ra(),s=t?.settings??e?.dashboard?.settings,c=ed(!e,e?.health).data??e?.health??kM,[d,f]=w.useState(null),[m,p]=w.useState(!1),[v,y]=w.useState(!1),[x,b]=w.useState(""),[N,S]=w.useState(!1),[C,k]=w.useState(null),[E,R]=w.useState(!1);return s?r.jsxs("div",{className:"page-container",children:[r.jsx("div",{className:"page-header",children:r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:"Settings"}),r.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),r.jsxs("section",{className:"settings-grid",children:[s.providerStatuses.map(z=>r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),r.jsx("h2",{children:z.displayName??z.name})]}),r.jsx(st,{tone:z.state==="ready"?"positive":"caution",children:z.state==="ready"?"Ready":"Needs config"})]}),r.jsxs("dl",{className:"definition-list mt-3",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Model"}),r.jsx("dd",{className:"font-mono text-xs",children:z.model})]}),z.quota&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Concurrency"}),r.jsx("dd",{children:z.quota.maxConcurrency})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Rate limit"}),r.jsxs("dd",{children:[z.quota.maxRequestsPerMinute,"/min · ",z.quota.maxRequestsPerDay,"/day"]})]})]})]}),r.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:z.detail}),r.jsx("div",{className:"mt-2",children:r.jsx(oe,{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&&r.jsx(wM,{providerName:z.name,keyUrl:z.keyUrl,modelHint:z.modelHint,onSaved:()=>{f(null)}})]},z.name)),r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),r.jsx("h2",{children:"Search Console OAuth"})]}),r.jsx(st,{tone:s.google.state==="ready"?"positive":"caution",children:s.google.state==="ready"?"Ready":"Needs config"})]}),r.jsxs("dl",{className:"definition-list mt-3",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Auth model"}),r.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Storage"}),r.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),r.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.google.detail}),r.jsx("div",{className:"mt-2",children:r.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!m),children:m?"Cancel":s.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),m&&r.jsx(NM,{onSaved:()=>{p(!1)}})]}),r.jsxs(De,{className:"surface-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),r.jsx("h2",{children:"Webmaster Tools"})]}),r.jsx(st,{tone:s.bing.state==="ready"?"positive":"caution",children:s.bing.state==="ready"?"Ready":"Needs config"})]}),r.jsxs("dl",{className:"definition-list mt-3",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Auth model"}),r.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Storage"}),r.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),r.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.bing.detail}),r.jsx("div",{className:"mt-2",children:r.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!v),children:v?"Cancel":s.bing.state==="ready"?"Update API key":"Configure Bing"})}),v&&r.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),r.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"})]}),r.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)})]}),r.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",r.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),C&&r.jsx("p",{className:"text-xs text-rose-400",children:C}),E&&r.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),r.jsx(oe,{type:"button",size:"sm",disabled:!x.trim()||N,onClick:async()=>{if(x.trim()){S(!0),k(null),R(!1);try{await Rj(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:N?"Saving...":"Save Bing API key"})]})]}),r.jsx(CM,{}),r.jsxs(De,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),r.jsx("h2",{children:"API and worker"})]})}),r.jsxs("div",{className:"compact-stack",children:[r.jsxs("div",{className:"health-row",children:[r.jsxs("div",{children:[r.jsx("p",{className:"run-row-title",children:"API"}),r.jsx("p",{className:"supporting-copy",children:c.apiStatus.detail})]}),r.jsx(st,{tone:Nu(c.apiStatus),children:c.apiStatus.state==="ok"?"Healthy":"Attention"})]}),r.jsxs("div",{className:"health-row",children:[r.jsxs("div",{children:[r.jsx("p",{className:"run-row-title",children:"Worker"}),r.jsx("p",{className:"supporting-copy",children:c.workerStatus.detail})]}),r.jsx(st,{tone:Nu(c.workerStatus),children:c.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),r.jsx("section",{className:"page-section",children:r.jsxs(De,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),r.jsx("h2",{children:"Operational guidance"})]})}),r.jsx("ul",{className:"detail-list",children:s.selfHostNotes.map(z=>r.jsx("li",{children:z},z))}),r.jsx("p",{className:"supporting-copy",children:s.bootstrapNote})]})})]}):null}const _M=[{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 EM({current:e,labels:t}){return r.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((s,a)=>{const o=a<e,c=a===e;return r.jsxs("div",{className:`setup-step ${o?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[r.jsx("span",{className:"setup-step-number",children:o?"✓":a+1}),r.jsx("span",{className:"setup-step-label",children:s.label})]},s.label)})})}function RM(){const e=cl(),{dashboard:t,isLoading:s,refetch:a}=Ra(),o=t??e?.dashboard;if(!o||s)return r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-24"}),r.jsx("div",{className:"skeleton-text-sm w-80"})]}),r.jsxs("div",{className:"page-skeleton-card",children:[r.jsx("div",{className:"skeleton-text w-32"}),r.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ae=>r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1 flex-1",children:[r.jsx("div",{className:"skeleton-text w-24"}),r.jsx("div",{className:"skeleton-text-sm w-48"})]}),r.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ae))})]})]});const c=o.settings,m=ed(!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=L4(o.setup,m,c),v=ka(),[y,x]=w.useState(0),[b,N]=w.useState(""),[S,C]=w.useState(""),[k,E]=w.useState(""),[R,z]=w.useState("US"),[L,M]=w.useState("en"),[A,T]=w.useState(null),[P,X]=w.useState(null),[Q,se]=w.useState(null),[pe,ke]=w.useState(!1),[Se,B]=w.useState(""),[q,ce]=w.useState(!1),[H,J]=w.useState(null),[O,F]=w.useState(!1),ie=c.providerStatuses.filter(ae=>ae.state==="ready"),[re,ue]=w.useState(ie[0]?.name??""),[de,fe]=w.useState(5),[Ae,ye]=w.useState(!1),[Ke,We]=w.useState(null),[me,et]=w.useState(""),[dt,sn]=w.useState(!1),[kt,an]=w.useState(null),[Vt,zt]=w.useState(!1),[_t,mn]=w.useState(!1),[le,Be]=w.useState(null),[qe,_e]=w.useState(!1),Ue=b.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),pt=Se.split(`
|
|
239
|
+
`).map(ae=>ae.trim()).filter(Boolean),rn=me.split(`
|
|
240
|
+
`).map(ae=>ae.trim()).filter(Boolean),js=p.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),X(ae.id),a(),x(2)}catch(ae){se(ae instanceof Error?ae.message:"Failed to create project")}finally{ke(!1)}}},ws=async()=>{if(!A)return;const ae=pt;if(ae.length!==0){F(!0),J(null);try{await GS(A,ae),ce(!0),a(),x(3)}catch(Jn){J(Jn instanceof Error?Jn.message:"Failed to save key phrases")}finally{F(!1)}}},Qs=async()=>{if(!(!A||!re)){ye(!0),We(null);try{const ae=await cj(A,re,de);if(ae.keywords.length>0){const Jn=Se?Se.trimEnd()+`
|
|
241
|
+
`+ae.keywords.join(`
|
|
242
|
+
`):ae.keywords.join(`
|
|
243
|
+
`);B(Jn)}}catch(ae){We(ae instanceof Error?ae.message:"Failed to generate key phrases")}finally{ye(!1)}}},cs=async()=>{if(!A)return;const ae=rn;if(ae.length!==0){zt(!0),an(null);try{await Sp(A,ae),sn(!0),a(),x(4)}catch(Jn){an(Jn instanceof Error?Jn.message:"Failed to save competitors")}finally{zt(!1)}}},ze=async()=>{if(A){_e(!0),Be(null);try{await jp(A),mn(!0),a()}catch(ae){Be(ae instanceof Error?ae.message:"Failed to trigger run")}finally{_e(!1)}}},Ht=()=>x(ae=>Math.max(0,ae-1)),Qe=(()=>{switch(y){case 0:return r.jsxs(De,{className:"surface-card step-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),r.jsx("h2",{children:"System ready"})]})}),r.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),r.jsx("div",{className:"compact-stack",children:p.healthChecks.map(ae=>r.jsxs("div",{className:"health-check-row",children:[r.jsxs("div",{children:[r.jsx("p",{className:"run-row-title",children:ae.label}),r.jsx("p",{className:"supporting-copy",children:ae.detail}),ae.id==="provider"&&ae.state!=="ready"&&r.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"})]}),r.jsx(st,{tone:ae.state==="ready"?"positive":"caution",children:ae.state==="ready"?"Ready":"Attention"})]},ae.id))}),r.jsxs("div",{className:"setup-nav",children:[r.jsx("span",{}),r.jsx(oe,{type:"button",disabled:!js,onClick:()=>x(1),children:"Continue"})]})]});case 1:return r.jsxs(De,{className:"surface-card step-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),r.jsx("h2",{children:"Create project"})]}),A?r.jsx(st,{tone:"positive",children:"Created"}):null]}),A?r.jsxs("div",{className:"compact-stack",children:[r.jsxs("p",{className:"text-zinc-300",children:["Project ",r.jsx("span",{className:"text-zinc-100 font-medium",children:A})," created successfully."]}),r.jsxs("div",{className:"setup-nav",children:[r.jsx(oe,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),r.jsx(oe,{type:"button",onClick:()=>x(2),children:"Continue"})]})]}):r.jsxs("div",{className:"compact-stack",children:[r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),r.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:b,onChange:ae=>N(ae.target.value)}),Ue&&Ue!==b?r.jsxs("p",{className:"supporting-copy",children:["Slug: ",Ue]}):null]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),r.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:S,onChange:ae=>C(ae.target.value)})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),r.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:ae=>E(ae.target.value)})]}),r.jsxs("div",{className:"setup-field-row",children:[r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),r.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:R,onChange:ae=>z(ae.target.value.toUpperCase())})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),r.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:L,onChange:ae=>M(ae.target.value.toLowerCase())})]})]}),Q?r.jsx("p",{className:"text-rose-400 text-sm",children:Q}):null,r.jsxs("div",{className:"setup-nav",children:[r.jsx(oe,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),r.jsx(oe,{type:"button",disabled:!Ue||!k||pe,onClick:Vs,children:pe?"Creating...":"Create project"})]})]})]});case 2:return r.jsxs(De,{className:"surface-card step-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),r.jsx("h2",{children:"Add key phrases"})]}),q?r.jsxs(st,{tone:"positive",children:[pt.length," saved"]}):r.jsxs(st,{tone:"neutral",children:[pt.length," key phrase",pt.length!==1?"s":""]})]}),r.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),q?r.jsxs("div",{className:"compact-stack",children:[r.jsx("ul",{className:"detail-list",children:pt.map(ae=>r.jsx("li",{children:ae},ae))}),r.jsxs("div",{className:"setup-nav",children:[r.jsx(oe,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),r.jsx(oe,{type:"button",onClick:()=>x(3),children:"Continue"})]})]}):r.jsxs("div",{className:"compact-stack",children:[ie.length>0?r.jsxs("div",{className:"compact-stack",children:[r.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[r.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",r.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),r.jsxs("div",{className:"flex items-end gap-2",children:[r.jsxs("div",{className:"setup-field flex-1",children:[r.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),r.jsx("select",{id:"gen-provider",className:"setup-input",value:re,onChange:ae=>ue(ae.target.value),children:ie.map(ae=>r.jsxs("option",{value:ae.name,children:[ae.displayName??ae.name,ae.model?` (${ae.model})`:""]},ae.name))})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),r.jsx("select",{id:"gen-count",className:"setup-input",value:de,onChange:ae=>fe(Number(ae.target.value)),children:[3,5,10,15,20].map(ae=>r.jsx("option",{value:ae,children:ae},ae))})]}),r.jsx(oe,{type:"button",variant:"outline",disabled:Ae||!re,onClick:Qs,children:Ae?"Analyzing site...":"Generate"})]}),Ke?r.jsx("p",{className:"text-rose-400 text-sm",children:Ke}):null]}):null,r.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[r.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",r.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),r.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
244
|
+
best invisalign downtown brooklyn
|
|
245
|
+
pediatric dentist brooklyn heights`,value:Se,onChange:ae=>B(ae.target.value)})]}),H?r.jsx("p",{className:"text-rose-400 text-sm",children:H}):null,r.jsxs("div",{className:"setup-nav",children:[r.jsx(oe,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),r.jsx(oe,{type:"button",disabled:pt.length===0||O,onClick:ws,children:O?"Saving...":`Save ${pt.length} key phrase${pt.length!==1?"s":""}`})]})]})]});case 3:return r.jsxs(De,{className:"surface-card step-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),r.jsx("h2",{children:"Add competitors"})]}),dt?r.jsx(st,{tone:"positive",children:"Saved"}):null]}),r.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),dt?r.jsxs("div",{className:"compact-stack",children:[r.jsx("ul",{className:"detail-list",children:rn.map(ae=>r.jsx("li",{children:ae},ae))}),r.jsxs("div",{className:"setup-nav",children:[r.jsx(oe,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),r.jsx(oe,{type:"button",onClick:()=>x(4),children:"Continue"})]})]}):r.jsxs("div",{className:"compact-stack",children:[r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),r.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
246
|
+
competitor2.com`,value:me,onChange:ae=>et(ae.target.value)})]}),kt?r.jsx("p",{className:"text-rose-400 text-sm",children:kt}):null,r.jsxs("div",{className:"setup-nav",children:[r.jsx(oe,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(oe,{type:"button",variant:"outline",onClick:()=>x(4),children:"Skip"}),r.jsx(oe,{type:"button",disabled:rn.length===0||Vt,onClick:cs,children:Vt?"Saving...":`Save ${rn.length} competitor${rn.length!==1?"s":""}`})]})]})]})]});case 4:return r.jsxs(De,{className:"surface-card step-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),r.jsx("h2",{children:"Launch first run"})]}),_t?r.jsx(st,{tone:"positive",children:"Queued"}):null]}),_t?r.jsxs("div",{className:"compact-stack",children:[r.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),r.jsxs("div",{className:"setup-nav",children:[r.jsx("span",{}),r.jsx(oe,{type:"button",onClick:()=>v({to:P?`/projects/${P}`:"/"}),children:"Open project"})]})]}):r.jsxs("div",{className:"compact-stack",children:[r.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",r.jsx("span",{className:"text-zinc-100 font-medium",children:A}),"."]}),le?r.jsx("p",{className:"text-rose-400 text-sm",children:le}):null,r.jsxs("div",{className:"setup-nav",children:[r.jsx(oe,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),r.jsx(oe,{type:"button",disabled:qe,onClick:ze,children:qe?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return r.jsxs("div",{className:"page-container",children:[r.jsx("div",{className:"page-header",children:r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:"Setup"}),r.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),r.jsx(EM,{current:y,labels:_M}),r.jsx("section",{className:"setup-wizard",children:Qe})]})}function AM(){return r.jsx("div",{className:"page-container",children:r.jsx("section",{className:"page-section",children:r.jsxs(De,{className:"surface-card empty-card",children:[r.jsx("h1",{children:"Route not found"}),r.jsx("p",{children:"The current path does not map to a dashboard view."}),r.jsx(oe,{asChild:!0,children:r.jsx(yt,{to:"/",children:"Return to overview"})})]})})})}function TM(){return r.jsx(R4,{children:r.jsx(E4,{})})}const rs=J_()({component:TM,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),OM=Vn({getParentRoute:()=>rs,path:"/",component:U4,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ti.projects.all);if(t&&t.length===0)throw op({to:"/setup"})}}),DM=Vn({getParentRoute:()=>rs,path:"/projects",component:Q3}),pl=Vn({getParentRoute:()=>rs,path:"/projects/$projectId",component:()=>r.jsx(yp,{})}),LM=Vn({getParentRoute:()=>pl,path:"/",component:()=>r.jsx(dd,{tab:"overview"})}),MM=Vn({getParentRoute:()=>pl,path:"/search-console",component:()=>r.jsx(dd,{tab:"search-console"})}),UM=Vn({getParentRoute:()=>pl,path:"/analytics",component:()=>r.jsx(dd,{tab:"analytics"})}),$M=Vn({getParentRoute:()=>pl,path:"/traffic",component:()=>r.jsx(dd,{tab:"traffic"})}),PM=Vn({getParentRoute:()=>rs,path:"/runs",component:jM}),IM=Vn({getParentRoute:()=>rs,path:"/settings",component:zM,beforeLoad:({context:e})=>{}}),BM=Vn({getParentRoute:()=>rs,path:"/setup",component:RM,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ti.projects.all);if(t&&t.length>0)throw op({to:"/"})}}),qM=Vn({getParentRoute:()=>rs,path:"*",component:AM}),HM=rs.addChildren([OM,DM,pl.addChildren([LM,MM,UM,$M]),PM,IM,BM,qM]);function GM(e,t){return o2({routeTree:HM,basepath:Bm||"/",context:{queryClient:e},...t?.initialEntries})}const FM={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 KM(){const e=w.useSyncExternalStore(x2,qx,qx),t=w.useCallback(s=>{$j(s)},[]);return e.length===0?null:r.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=>r.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 ${FM[s.tone]}`,children:[r.jsx("p",{className:"flex-1 leading-snug",children:s.message}),r.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:r.jsx(Hu,{className:"size-3.5"})})]},s.id))})}const m1=b2(),ZM=GM(m1),p1=document.getElementById("root");if(!p1)throw new Error("Expected #root element for web app bootstrap.");function VM(){const[e,t]=w.useState(bm()?"ready":"checking"),[s,a]=w.useState(""),[o,c]=w.useState(""),[d,f]=w.useState(null),[m,p]=w.useState(!1);w.useEffect(()=>{if(bm())return;let x=!1;return XS().then(b=>{x||(b.authenticated?t("ready"):t(b.setupRequired?"setup":"login"))}).catch(b=>{x||(f(b instanceof Error?b.message:"Failed to reach the Canonry API"),t("login"))}),()=>{x=!0}},[]);const v=async x=>{if(x.preventDefault(),!s.trim()||s.trim().length<8){f("Password must be at least 8 characters");return}if(s!==o){f("Passwords do not match");return}p(!0),f(null);try{if(!(await WS(s.trim())).authenticated){f("Setup failed");return}a(""),c(""),t("ready")}catch(b){f(b instanceof Su||b instanceof Error?b.message:"Setup failed")}finally{p(!1)}},y=async x=>{if(x.preventDefault(),!!s.trim()){p(!0),f(null);try{if(!(await ej(s.trim())).authenticated){f("Incorrect password");return}a(""),t("ready")}catch(b){f(b instanceof Su||b instanceof Error?b.message:"Authentication failed")}finally{p(!1)}}};return e==="ready"?r.jsxs(iz,{client:m1,children:[r.jsx(u2,{router:ZM}),r.jsx(KM,{})]}):r.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:r.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:r.jsx(De,{className:"surface-card w-full",children:e==="checking"?r.jsx(ou,{className:"py-8",children:r.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?r.jsxs(r.Fragment,{children:[r.jsxs(qm,{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),r.jsx(Hm,{children:"Create a dashboard password"}),r.jsx(Gm,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),r.jsx(ou,{children:r.jsxs("form",{className:"space-y-4",onSubmit:v,children:[r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),r.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:s,onChange:x=>a(x.target.value),placeholder:"At least 8 characters"})]}),r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),r.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:o,onChange:x=>c(x.target.value),placeholder:"Re-enter password"})]}),d?r.jsx("p",{className:"text-sm text-rose-400",children:d}):null,r.jsx(oe,{type:"submit",disabled:m||!s.trim()||!o.trim(),children:m?"Setting up…":"Create password & open dashboard"})]})})]}):r.jsxs(r.Fragment,{children:[r.jsxs(qm,{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),r.jsx(Hm,{children:"Sign in to Canonry"}),r.jsx(Gm,{children:"Enter your dashboard password to continue."})]}),r.jsx(ou,{children:r.jsxs("form",{className:"space-y-4",onSubmit:y,children:[r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),r.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:s,onChange:x=>a(x.target.value),placeholder:"Dashboard password"})]}),d?r.jsx("p",{className:"text-sm text-rose-400",children:d}):null,r.jsx(oe,{type:"submit",disabled:m||!s.trim(),children:m?"Signing in…":"Open dashboard"})]})})]})})})})}Ok.createRoot(p1).render(r.jsx(w.StrictMode,{children:r.jsx(VM,{})}));
|