@ainyc/canonry 1.19.3 → 1.20.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-BAlQzE7t.js +246 -0
- package/assets/assets/index-D-2VeJdG.css +1 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-GX673NKZ.js → chunk-V7JJJDPL.js} +1712 -1122
- package/dist/cli.js +413 -2
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1 -1
- package/package.json +6 -5
- package/assets/assets/index-53IVPMPi.js +0 -246
- package/assets/assets/index-DdQKI2_i.css +0 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
function l_(e,t){for(var s=0;s<t.length;s++){const a=t[s];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in e)){const c=Object.getOwnPropertyDescriptor(a,r);c&&Object.defineProperty(e,r,c.get?c:{enumerable:!0,get:()=>a[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function s(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(r){if(r.ep)return;r.ep=!0;const c=s(r);fetch(r.href,c)}})();function Ix(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vh={exports:{}},Oo={};var Ov;function c_(){if(Ov)return Oo;Ov=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(a,r,c){var d=null;if(c!==void 0&&(d=""+c),r.key!==void 0&&(d=""+r.key),"key"in r){c={};for(var f in r)f!=="key"&&(c[f]=r[f])}else c=r;return r=c.ref,{$$typeof:e,type:a,key:d,ref:r!==void 0?r:null,props:c}}return Oo.Fragment=t,Oo.jsx=s,Oo.jsxs=s,Oo}var Av;function u_(){return Av||(Av=1,vh.exports=c_()),vh.exports}var l=u_(),bh={exports:{}},Ee={};var Tv;function d_(){if(Tv)return Ee;Tv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function x(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function _(L,G,se){this.props=L,this.context=G,this.refs=C,this.updater=se||j}_.prototype.isReactComponent={},_.prototype.setState=function(L,G){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,G,"setState")},_.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function E(){}E.prototype=_.prototype;function R(L,G,se){this.props=L,this.context=G,this.refs=C,this.updater=se||j}var z=R.prototype=new E;z.constructor=R,S(z,_.prototype),z.isPureReactComponent=!0;var U=Array.isArray;function O(){}var M={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function B(L,G,se){var re=se.ref;return{$$typeof:e,type:L,key:G,ref:re!==void 0?re:null,props:se}}function ie(L,G){return B(L.type,G,L.props)}function Q(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function ne(L){var G={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(se){return G[se]})}var me=/\/+/g;function ze(L,G){return typeof L=="object"&&L!==null&&L.key!=null?ne(""+L.key):G.toString(36)}function we(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(O,O):(L.status="pending",L.then(function(G){L.status==="pending"&&(L.status="fulfilled",L.value=G)},function(G){L.status==="pending"&&(L.status="rejected",L.reason=G)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function q(L,G,se,re,ce){var he=typeof L;(he==="undefined"||he==="boolean")&&(L=null);var de=!1;if(L===null)de=!0;else switch(he){case"bigint":case"string":case"number":de=!0;break;case"object":switch(L.$$typeof){case e:case t:de=!0;break;case b:return de=L._init,q(de(L._payload),G,se,re,ce)}}if(de)return ce=ce(L),de=re===""?"."+ze(L,0):re,U(ce)?(se="",de!=null&&(se=de.replace(me,"$&/")+"/"),q(ce,G,se,"",function(Je){return Je})):ce!=null&&(Q(ce)&&(ce=ie(ce,se+(ce.key==null||L&&L.key===ce.key?"":(""+ce.key).replace(me,"$&/")+"/")+de)),G.push(ce)),1;de=0;var Fe=re===""?".":re+":";if(U(L))for(var ge=0;ge<L.length;ge++)re=L[ge],he=Fe+ze(re,ge),de+=q(re,G,se,he,ce);else if(ge=x(L),typeof ge=="function")for(L=ge.call(L),ge=0;!(re=L.next()).done;)re=re.value,he=Fe+ze(re,ge++),de+=q(re,G,se,he,ce);else if(he==="object"){if(typeof L.then=="function")return q(we(L),G,se,re,ce);throw G=String(L),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return de}function T(L,G,se){if(L==null)return L;var re=[],ce=0;return q(L,re,"","",function(he){return G.call(se,he,ce++)}),re}function ae(L){if(L._status===-1){var G=L._result;G=G(),G.then(function(se){(L._status===0||L._status===-1)&&(L._status=1,L._result=se)},function(se){(L._status===0||L._status===-1)&&(L._status=2,L._result=se)}),L._status===-1&&(L._status=0,L._result=G)}if(L._status===1)return L._result.default;throw L._result}var pe=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},ee={map:T,forEach:function(L,G,se){T(L,function(){G.apply(this,arguments)},se)},count:function(L){var G=0;return T(L,function(){G++}),G},toArray:function(L){return T(L,function(G){return G})||[]},only:function(L){if(!Q(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Ee.Activity=y,Ee.Children=ee,Ee.Component=_,Ee.Fragment=s,Ee.Profiler=r,Ee.PureComponent=R,Ee.StrictMode=a,Ee.Suspense=p,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(L){return M.H.useMemoCache(L)}},Ee.cache=function(L){return function(){return L.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(L,G,se){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var re=S({},L.props),ce=L.key;if(G!=null)for(he in G.key!==void 0&&(ce=""+G.key),G)!A.call(G,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&G.ref===void 0||(re[he]=G[he]);var he=arguments.length-2;if(he===1)re.children=se;else if(1<he){for(var de=Array(he),Fe=0;Fe<he;Fe++)de[Fe]=arguments[Fe+2];re.children=de}return B(L.type,ce,re)},Ee.createContext=function(L){return L={$$typeof:d,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:c,_context:L},L},Ee.createElement=function(L,G,se){var re,ce={},he=null;if(G!=null)for(re in G.key!==void 0&&(he=""+G.key),G)A.call(G,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ce[re]=G[re]);var de=arguments.length-2;if(de===1)ce.children=se;else if(1<de){for(var Fe=Array(de),ge=0;ge<de;ge++)Fe[ge]=arguments[ge+2];ce.children=Fe}if(L&&L.defaultProps)for(re in de=L.defaultProps,de)ce[re]===void 0&&(ce[re]=de[re]);return B(L,he,ce)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(L){return{$$typeof:f,render:L}},Ee.isValidElement=Q,Ee.lazy=function(L){return{$$typeof:b,_payload:{_status:-1,_result:L},_init:ae}},Ee.memo=function(L,G){return{$$typeof:m,type:L,compare:G===void 0?null:G}},Ee.startTransition=function(L){var G=M.T,se={};M.T=se;try{var re=L(),ce=M.S;ce!==null&&ce(se,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(O,pe)}catch(he){pe(he)}finally{G!==null&&se.types!==null&&(G.types=se.types),M.T=G}},Ee.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ee.use=function(L){return M.H.use(L)},Ee.useActionState=function(L,G,se){return M.H.useActionState(L,G,se)},Ee.useCallback=function(L,G){return M.H.useCallback(L,G)},Ee.useContext=function(L){return M.H.useContext(L)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(L,G){return M.H.useDeferredValue(L,G)},Ee.useEffect=function(L,G){return M.H.useEffect(L,G)},Ee.useEffectEvent=function(L){return M.H.useEffectEvent(L)},Ee.useId=function(){return M.H.useId()},Ee.useImperativeHandle=function(L,G,se){return M.H.useImperativeHandle(L,G,se)},Ee.useInsertionEffect=function(L,G){return M.H.useInsertionEffect(L,G)},Ee.useLayoutEffect=function(L,G){return M.H.useLayoutEffect(L,G)},Ee.useMemo=function(L,G){return M.H.useMemo(L,G)},Ee.useOptimistic=function(L,G){return M.H.useOptimistic(L,G)},Ee.useReducer=function(L,G,se){return M.H.useReducer(L,G,se)},Ee.useRef=function(L){return M.H.useRef(L)},Ee.useState=function(L){return M.H.useState(L)},Ee.useSyncExternalStore=function(L,G,se){return M.H.useSyncExternalStore(L,G,se)},Ee.useTransition=function(){return M.H.useTransition()},Ee.version="19.2.4",Ee}var Dv;function al(){return Dv||(Dv=1,bh.exports=d_()),bh.exports}var N=al();const ns=Ix(N),Mm=l_({__proto__:null,default:ns},[N]);var xh={exports:{}},Ao={},Sh={exports:{}},wh={};var Lv;function f_(){return Lv||(Lv=1,(function(e){function t(q,T){var ae=q.length;q.push(T);e:for(;0<ae;){var pe=ae-1>>>1,ee=q[pe];if(0<r(ee,T))q[pe]=T,q[ae]=ee,ae=pe;else break e}}function s(q){return q.length===0?null:q[0]}function a(q){if(q.length===0)return null;var T=q[0],ae=q.pop();if(ae!==T){q[0]=ae;e:for(var pe=0,ee=q.length,L=ee>>>1;pe<L;){var G=2*(pe+1)-1,se=q[G],re=G+1,ce=q[re];if(0>r(se,ae))re<ee&&0>r(ce,se)?(q[pe]=ce,q[re]=ae,pe=re):(q[pe]=se,q[G]=ae,pe=G);else if(re<ee&&0>r(ce,ae))q[pe]=ce,q[re]=ae,pe=re;else break e}}return T}function r(q,T){var ae=q.sortIndex-T.sortIndex;return ae!==0?ae:q.id-T.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],m=[],b=1,y=null,v=3,x=!1,j=!1,S=!1,C=!1,_=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function z(q){for(var T=s(m);T!==null;){if(T.callback===null)a(m);else if(T.startTime<=q)a(m),T.sortIndex=T.expirationTime,t(p,T);else break;T=s(m)}}function U(q){if(S=!1,z(q),!j)if(s(p)!==null)j=!0,O||(O=!0,ne());else{var T=s(m);T!==null&&we(U,T.startTime-q)}}var O=!1,M=-1,A=5,B=-1;function ie(){return C?!0:!(e.unstable_now()-B<A)}function Q(){if(C=!1,O){var q=e.unstable_now();B=q;var T=!0;try{e:{j=!1,S&&(S=!1,E(M),M=-1),x=!0;var ae=v;try{t:{for(z(q),y=s(p);y!==null&&!(y.expirationTime>q&&ie());){var pe=y.callback;if(typeof pe=="function"){y.callback=null,v=y.priorityLevel;var ee=pe(y.expirationTime<=q);if(q=e.unstable_now(),typeof ee=="function"){y.callback=ee,z(q),T=!0;break t}y===s(p)&&a(p),z(q)}else a(p);y=s(p)}if(y!==null)T=!0;else{var L=s(m);L!==null&&we(U,L.startTime-q),T=!1}}break e}finally{y=null,v=ae,x=!1}T=void 0}}finally{T?ne():O=!1}}}var ne;if(typeof R=="function")ne=function(){R(Q)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,ze=me.port2;me.port1.onmessage=Q,ne=function(){ze.postMessage(null)}}else ne=function(){_(Q,0)};function we(q,T){M=_(function(){q(e.unstable_now())},T)}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(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(q){switch(v){case 1:case 2:case 3:var T=3;break;default:T=v}var ae=v;v=T;try{return q()}finally{v=ae}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(q,T){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var ae=v;v=q;try{return T()}finally{v=ae}},e.unstable_scheduleCallback=function(q,T,ae){var pe=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?pe+ae:pe):ae=pe,q){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=ae+ee,q={id:b++,callback:T,priorityLevel:q,startTime:ae,expirationTime:ee,sortIndex:-1},ae>pe?(q.sortIndex=ae,t(m,q),s(p)===null&&q===s(m)&&(S?(E(M),M=-1):S=!0,we(U,ae-pe))):(q.sortIndex=ee,t(p,q),j||x||(j=!0,O||(O=!0,ne()))),q},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(q){var T=v;return function(){var ae=v;v=T;try{return q.apply(this,arguments)}finally{v=ae}}}})(wh)),wh}var Mv;function h_(){return Mv||(Mv=1,Sh.exports=f_()),Sh.exports}var jh={exports:{}},tn={};var Uv;function m_(){if(Uv)return tn;Uv=1;var e=al();function t(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},r=Symbol.for("react.portal");function c(p,m,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:p,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,tn.createPortal=function(p,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return c(p,m,null,b)},tn.flushSync=function(p){var m=d.T,b=a.p;try{if(d.T=null,a.p=2,p)return p()}finally{d.T=m,a.p=b,a.d.f()}},tn.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(p,m))},tn.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},tn.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var b=m.as,y=f(b,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?a.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:x}):b==="script"&&a.d.X(p,{crossOrigin:y,integrity:v,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},tn.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=f(m.as,m.crossOrigin);a.d.M(p,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(p)},tn.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,y=f(b,m.crossOrigin);a.d.L(p,b,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},tn.preloadModule=function(p,m){if(typeof p=="string")if(m){var b=f(m.as,m.crossOrigin);a.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(p)},tn.requestFormReset=function(p){a.d.r(p)},tn.unstable_batchedUpdates=function(p,m){return p(m)},tn.useFormState=function(p,m,b){return d.H.useFormState(p,m,b)},tn.useFormStatus=function(){return d.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var Pv;function $x(){if(Pv)return jh.exports;Pv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),jh.exports=m_(),jh.exports}var Iv;function p_(){if(Iv)return Ao;Iv=1;var e=h_(),t=al(),s=$x();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,o=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(o=i.return),n=i.return;while(n)}return i.tag===3?o:null}function d(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function p(n){if(c(n)!==n)throw Error(a(188))}function m(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(a(188));return i!==n?null:n}for(var o=n,u=i;;){var h=o.return;if(h===null)break;var g=h.alternate;if(g===null){if(u=h.return,u!==null){o=u;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===o)return p(h),n;if(g===u)return p(h),i;g=g.sibling}throw Error(a(188))}if(o.return!==u.return)o=h,u=g;else{for(var w=!1,k=h.child;k;){if(k===o){w=!0,o=h,u=g;break}if(k===u){w=!0,u=h,o=g;break}k=k.sibling}if(!w){for(k=g.child;k;){if(k===o){w=!0,o=g,u=h;break}if(k===u){w=!0,u=g,o=h;break}k=k.sibling}if(!w)throw Error(a(189))}}if(o.alternate!==u)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?n:i}function b(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=b(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function ne(n){return n===null||typeof n!="object"?null:(n=Q&&n[Q]||n["@@iterator"],typeof n=="function"?n:null)}var me=Symbol.for("react.client.reference");function ze(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===me?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case _:return"Profiler";case C:return"StrictMode";case U:return"Suspense";case O:return"SuspenseList";case B:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case j: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 M:return i=n.displayName||null,i!==null?i:ze(n.type)||"Memo";case A:i=n._payload,n=n._init;try{return ze(n(i))}catch{}}return null}var we=Array.isArray,q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,T=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},pe=[],ee=-1;function L(n){return{current:n}}function G(n){0>ee||(n.current=pe[ee],pe[ee]=null,ee--)}function se(n,i){ee++,pe[ee]=n.current,n.current=i}var re=L(null),ce=L(null),he=L(null),de=L(null);function Fe(n,i){switch(se(he,i),se(ce,n),se(re,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?ev(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=ev(i),n=tv(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}G(re),se(re,n)}function ge(){G(re),G(ce),G(he)}function Je(n){n.memoizedState!==null&&se(de,n);var i=re.current,o=tv(i,n.type);i!==o&&(se(ce,n),se(re,o))}function mt(n){ce.current===n&&(G(re),G(ce)),de.current===n&&(G(de),ko._currentValue=ae)}var fe,Ye;function dt(n){if(fe===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);fe=i&&i[1]||"",Ye=-1<o.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+fe+n+Ye}var Wt=!1;function _t(n,i){if(!n||Wt)return"";Wt=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(K){var F=K}Reflect.construct(n,[],W)}else{try{W.call()}catch(K){F=K}n.call(W.prototype)}}else{try{throw Error()}catch(K){F=K}(W=n())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(K){if(K&&F&&typeof K.stack=="string")return[K.stack,F.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(),w=g[0],k=g[1];if(w&&k){var D=w.split(`
|
|
4
|
+
`),Z=k.split(`
|
|
5
|
+
`);for(h=u=0;u<D.length&&!D[u].includes("DetermineComponentFrameRoot");)u++;for(;h<Z.length&&!Z[h].includes("DetermineComponentFrameRoot");)h++;if(u===D.length||h===Z.length)for(u=D.length-1,h=Z.length-1;1<=u&&0<=h&&D[u]!==Z[h];)h--;for(;1<=u&&0<=h;u--,h--)if(D[u]!==Z[h]){if(u!==1||h!==1)do if(u--,h--,0>h||D[u]!==Z[h]){var Y=`
|
|
6
|
+
`+D[u].replace(" at new "," at ");return n.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",n.displayName)),Y}while(1<=u&&0<=h);break}}}finally{Wt=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?dt(o):""}function nn(n,i){switch(n.tag){case 26:case 27:case 5:return dt(n.type);case 16:return dt("Lazy");case 13:return n.child!==i&&i!==null?dt("Suspense Fallback"):dt("Suspense");case 19:return dt("SuspenseList");case 0:case 15:return _t(n.type,!1);case 11:return _t(n.type.render,!1);case 1:return _t(n.type,!0);case 31:return dt("Activity");default:return""}}function Kt(n){try{var i="",o=null;do i+=nn(n,o),o=n,n=n.return;while(n);return i}catch(u){return`
|
|
7
|
+
Error generating stack: `+u.message+`
|
|
8
|
+
`+u.stack}}var kt=Object.prototype.hasOwnProperty,wt=e.unstable_scheduleCallback,sn=e.unstable_cancelCallback,oe=e.unstable_shouldYield,Ue=e.unstable_requestPaint,Pe=e.unstable_now,ke=e.unstable_getCurrentPriorityLevel,Te=e.unstable_ImmediatePriority,zt=e.unstable_UserBlockingPriority,Qn=e.unstable_NormalPriority,bs=e.unstable_LowPriority,Fs=e.unstable_IdlePriority,xs=e.log,Gs=e.unstable_setDisableYieldValue,os=null,Ce=null;function wn(n){if(typeof xs=="function"&&Gs(n),Ce&&typeof Ce.setStrictMode=="function")try{Ce.setStrictMode(os,n)}catch{}}var te=Math.clz32?Math.clz32:hl,Ie=Math.log,od=Math.LN2;function hl(n){return n>>>=0,n===0?32:31-(Ie(n)/od|0)|0}var Ks=256,Ss=262144,qi=4194304;function ls(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 Ea(n,i,o){var u=n.pendingLanes;if(u===0)return 0;var h=0,g=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var k=u&134217727;return k!==0?(u=k&~g,u!==0?h=ls(u):(w&=k,w!==0?h=ls(w):o||(o=k&~n,o!==0&&(h=ls(o))))):(k=u&~g,k!==0?h=ls(k):w!==0?h=ls(w):o||(o=u&~n,o!==0&&(h=ls(o)))),h===0?0:i!==0&&i!==h&&(i&g)===0&&(g=h&-h,o=i&-i,g>=o||g===32&&(o&4194048)!==0)?i:h}function cs(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function ml(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 pl(){var n=qi;return qi<<=1,(qi&62914560)===0&&(qi=4194304),n}function Ra(n){for(var i=[],o=0;31>o;o++)i.push(n);return i}function Hi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function ld(n,i,o,u,h,g){var w=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var k=n.entanglements,D=n.expirationTimes,Z=n.hiddenUpdates;for(o=w&~o;0<o;){var Y=31-te(o),W=1<<Y;k[Y]=0,D[Y]=-1;var F=Z[Y];if(F!==null)for(Z[Y]=null,Y=0;Y<F.length;Y++){var K=F[Y];K!==null&&(K.lane&=-536870913)}o&=~W}u!==0&&gl(n,u,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(w&~i))}function gl(n,i,o){n.pendingLanes|=i,n.suspendedLanes&=~i;var u=31-te(i);n.entangledLanes|=i,n.entanglements[u]=n.entanglements[u]|1073741824|o&261930}function yl(n,i){var o=n.entangledLanes|=i;for(n=n.entanglements;o;){var u=31-te(o),h=1<<u;h&i|n[u]&i&&(n[u]|=i),o&=~h}}function Br(n,i){var o=i&-i;return o=(o&42)!==0?1:I(o),(o&(n.suspendedLanes|i))!==0?0:o}function I(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 ue(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function tt(){var n=T.p;return n!==0?n:(n=window.event,n===void 0?32:Nv(n.type))}function Vt(n,i){var o=T.p;try{return T.p=n,i()}finally{T.p=o}}var Lt=Math.random().toString(36).slice(2),Et="__reactFiber$"+Lt,jt="__reactProps$"+Lt,jn="__reactContainer$"+Lt,en="__reactEvents$"+Lt,cd="__reactListeners$"+Lt,Vs="__reactHandles$"+Lt,Qs="__reactResources$"+Lt,us="__reactMarker$"+Lt;function Oa(n){delete n[Et],delete n[jt],delete n[en],delete n[cd],delete n[Vs]}function Ys(n){var i=n[Et];if(i)return i;for(var o=n.parentNode;o;){if(i=o[jn]||o[Et]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(n=lv(n);n!==null;){if(o=n[Et])return o;n=lv(n)}return i}n=o,o=n.parentNode}return null}function Yn(n){if(n=n[Et]||n[jn]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function ds(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function Js(n){var i=n[Qs];return i||(i=n[Qs]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Mt(n){n[us]=!0}var $e=new Set,nt={};function Ht(n,i){an(n,i),an(n+"Capture",i)}function an(n,i){for(nt[n]=i,n=0;n<i.length;n++)$e.add(i[n])}var Aa=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]*$"),qr={},Fp={};function eN(n){return kt.call(Fp,n)?!0:kt.call(qr,n)?!1:Aa.test(n)?Fp[n]=!0:(qr[n]=!0,!1)}function vl(n,i,o){if(eN(i))if(o===null)n.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+o)}}function bl(n,i,o){if(o===null)n.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+o)}}function ws(n,i,o,u){if(u===null)n.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(i,o,""+u)}}function An(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Gp(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function tN(n,i,o){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,g=u.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return h.call(this)},set:function(w){o=""+w,g.call(this,w)}}),Object.defineProperty(n,i,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function ud(n){if(!n._valueTracker){var i=Gp(n)?"checked":"value";n._valueTracker=tN(n,i,""+n[i])}}function Kp(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var o=i.getValue(),u="";return n&&(u=Gp(n)?n.checked?"true":"false":n.value),n=u,n!==o?(i.setValue(n),!0):!1}function xl(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 nN=/[\n"\\]/g;function Tn(n){return n.replace(nN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function dd(n,i,o,u,h,g,w,k){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),i!=null?w==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+An(i)):n.value!==""+An(i)&&(n.value=""+An(i)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),i!=null?fd(n,w,An(i)):o!=null?fd(n,w,An(o)):u!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.name=""+An(k):n.removeAttribute("name")}function Vp(n,i,o,u,h,g,w,k){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||o!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){ud(n);return}o=o!=null?""+An(o):"",i=i!=null?""+An(i):o,k||i===n.value||(n.value=i),n.defaultValue=i}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=k?n.checked:!!u,n.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w),ud(n)}function fd(n,i,o){i==="number"&&xl(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Ta(n,i,o,u){if(n=n.options,i){i={};for(var h=0;h<o.length;h++)i["$"+o[h]]=!0;for(o=0;o<n.length;o++)h=i.hasOwnProperty("$"+n[o].value),n[o].selected!==h&&(n[o].selected=h),h&&u&&(n[o].defaultSelected=!0)}else{for(o=""+An(o),i=null,h=0;h<n.length;h++){if(n[h].value===o){n[h].selected=!0,u&&(n[h].defaultSelected=!0);return}i!==null||n[h].disabled||(i=n[h])}i!==null&&(i.selected=!0)}}function Qp(n,i,o){if(i!=null&&(i=""+An(i),i!==n.value&&(n.value=i),o==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=o!=null?""+An(o):""}function Yp(n,i,o,u){if(i==null){if(u!=null){if(o!=null)throw Error(a(92));if(we(u)){if(1<u.length)throw Error(a(93));u=u[0]}o=u}o==null&&(o=""),i=o}o=An(i),n.defaultValue=o,u=n.textContent,u===o&&u!==""&&u!==null&&(n.value=u),ud(n)}function Da(n,i){if(i){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=i;return}}n.textContent=i}var sN=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 Jp(n,i,o){var u=i.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":u?n.setProperty(i,o):typeof o!="number"||o===0||sN.has(i)?i==="float"?n.cssFloat=o:n[i]=(""+o).trim():n[i]=o+"px"}function Xp(n,i,o){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var h in i)u=i[h],i.hasOwnProperty(h)&&o[h]!==u&&Jp(n,h,u)}else for(var g in i)i.hasOwnProperty(g)&&Jp(n,g,i[g])}function hd(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var iN=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"]]),aN=/^[\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 Sl(n){return aN.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function js(){}var md=null;function pd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var La=null,Ma=null;function Wp(n){var i=Yn(n);if(i&&(n=i.stateNode)){var o=n[jt]||null;e:switch(n=i.stateNode,i.type){case"input":if(dd(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),i=o.name,o.type==="radio"&&i!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Tn(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var u=o[i];if(u!==n&&u.form===n.form){var h=u[jt]||null;if(!h)throw Error(a(90));dd(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<o.length;i++)u=o[i],u.form===n.form&&Kp(u)}break e;case"textarea":Qp(n,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Ta(n,!!o.multiple,i,!1)}}}var gd=!1;function eg(n,i,o){if(gd)return n(i,o);gd=!0;try{var u=n(i);return u}finally{if(gd=!1,(La!==null||Ma!==null)&&(lc(),La&&(i=La,n=Ma,Ma=La=null,Wp(i),n)))for(i=0;i<n.length;i++)Wp(n[i])}}function Hr(n,i){var o=n.stateNode;if(o===null)return null;var u=o[jt]||null;if(u===null)return null;o=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(a(231,i,typeof o));return o}var Ns=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yd=!1;if(Ns)try{var Zr={};Object.defineProperty(Zr,"passive",{get:function(){yd=!0}}),window.addEventListener("test",Zr,Zr),window.removeEventListener("test",Zr,Zr)}catch{yd=!1}var Xs=null,vd=null,wl=null;function tg(){if(wl)return wl;var n,i=vd,o=i.length,u,h="value"in Xs?Xs.value:Xs.textContent,g=h.length;for(n=0;n<o&&i[n]===h[n];n++);var w=o-n;for(u=1;u<=w&&i[o-u]===h[g-u];u++);return wl=h.slice(n,1<u?1-u:void 0)}function jl(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 Nl(){return!0}function ng(){return!1}function hn(n){function i(o,u,h,g,w){this._reactName=o,this._targetInst=h,this.type=u,this.nativeEvent=g,this.target=w,this.currentTarget=null;for(var k in n)n.hasOwnProperty(k)&&(o=n[k],this[k]=o?o(g):g[k]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Nl:ng,this.isPropagationStopped=ng,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Nl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Nl)},persist:function(){},isPersistent:Nl}),i}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cl=hn(Zi),Fr=y({},Zi,{view:0,detail:0}),rN=hn(Fr),bd,xd,Gr,_l=y({},Fr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wd,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!==Gr&&(Gr&&n.type==="mousemove"?(bd=n.screenX-Gr.screenX,xd=n.screenY-Gr.screenY):xd=bd=0,Gr=n),bd)},movementY:function(n){return"movementY"in n?n.movementY:xd}}),sg=hn(_l),oN=y({},_l,{dataTransfer:0}),lN=hn(oN),cN=y({},Fr,{relatedTarget:0}),Sd=hn(cN),uN=y({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),dN=hn(uN),fN=y({},Zi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),hN=hn(fN),mN=y({},Zi,{data:0}),ig=hn(mN),pN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gN={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"},yN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vN(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=yN[n])?!!i[n]:!1}function wd(){return vN}var bN=y({},Fr,{key:function(n){if(n.key){var i=pN[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=jl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?gN[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wd,charCode:function(n){return n.type==="keypress"?jl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?jl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),xN=hn(bN),SN=y({},_l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ag=hn(SN),wN=y({},Fr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wd}),jN=hn(wN),NN=y({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),CN=hn(NN),_N=y({},_l,{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}),kN=hn(_N),zN=y({},Zi,{newState:0,oldState:0}),EN=hn(zN),RN=[9,13,27,32],jd=Ns&&"CompositionEvent"in window,Kr=null;Ns&&"documentMode"in document&&(Kr=document.documentMode);var ON=Ns&&"TextEvent"in window&&!Kr,rg=Ns&&(!jd||Kr&&8<Kr&&11>=Kr),og=" ",lg=!1;function cg(n,i){switch(n){case"keyup":return RN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ug(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ua=!1;function AN(n,i){switch(n){case"compositionend":return ug(i);case"keypress":return i.which!==32?null:(lg=!0,og);case"textInput":return n=i.data,n===og&&lg?null:n;default:return null}}function TN(n,i){if(Ua)return n==="compositionend"||!jd&&cg(n,i)?(n=tg(),wl=vd=Xs=null,Ua=!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 rg&&i.locale!=="ko"?null:i.data;default:return null}}var DN={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 dg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!DN[n.type]:i==="textarea"}function fg(n,i,o,u){La?Ma?Ma.push(u):Ma=[u]:La=u,i=pc(i,"onChange"),0<i.length&&(o=new Cl("onChange","change",null,o,u),n.push({event:o,listeners:i}))}var Vr=null,Qr=null;function LN(n){V0(n,0)}function kl(n){var i=ds(n);if(Kp(i))return n}function hg(n,i){if(n==="change")return i}var mg=!1;if(Ns){var Nd;if(Ns){var Cd="oninput"in document;if(!Cd){var pg=document.createElement("div");pg.setAttribute("oninput","return;"),Cd=typeof pg.oninput=="function"}Nd=Cd}else Nd=!1;mg=Nd&&(!document.documentMode||9<document.documentMode)}function gg(){Vr&&(Vr.detachEvent("onpropertychange",yg),Qr=Vr=null)}function yg(n){if(n.propertyName==="value"&&kl(Qr)){var i=[];fg(i,Qr,n,pd(n)),eg(LN,i)}}function MN(n,i,o){n==="focusin"?(gg(),Vr=i,Qr=o,Vr.attachEvent("onpropertychange",yg)):n==="focusout"&&gg()}function UN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return kl(Qr)}function PN(n,i){if(n==="click")return kl(i)}function IN(n,i){if(n==="input"||n==="change")return kl(i)}function $N(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var Nn=typeof Object.is=="function"?Object.is:$N;function Yr(n,i){if(Nn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var o=Object.keys(n),u=Object.keys(i);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var h=o[u];if(!kt.call(i,h)||!Nn(n[h],i[h]))return!1}return!0}function vg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function bg(n,i){var o=vg(n);n=0;for(var u;o;){if(o.nodeType===3){if(u=n+o.textContent.length,n<=i&&u>=i)return{node:o,offset:i-n};n=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=vg(o)}}function xg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?xg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Sg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=xl(n.document);i instanceof n.HTMLIFrameElement;){try{var o=typeof i.contentWindow.location.href=="string"}catch{o=!1}if(o)n=i.contentWindow;else break;i=xl(n.document)}return i}function _d(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 BN=Ns&&"documentMode"in document&&11>=document.documentMode,Pa=null,kd=null,Jr=null,zd=!1;function wg(n,i,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;zd||Pa==null||Pa!==xl(u)||(u=Pa,"selectionStart"in u&&_d(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}),Jr&&Yr(Jr,u)||(Jr=u,u=pc(kd,"onSelect"),0<u.length&&(i=new Cl("onSelect","select",null,i,o),n.push({event:i,listeners:u}),i.target=Pa)))}function Fi(n,i){var o={};return o[n.toLowerCase()]=i.toLowerCase(),o["Webkit"+n]="webkit"+i,o["Moz"+n]="moz"+i,o}var Ia={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionrun:Fi("Transition","TransitionRun"),transitionstart:Fi("Transition","TransitionStart"),transitioncancel:Fi("Transition","TransitionCancel"),transitionend:Fi("Transition","TransitionEnd")},Ed={},jg={};Ns&&(jg=document.createElement("div").style,"AnimationEvent"in window||(delete Ia.animationend.animation,delete Ia.animationiteration.animation,delete Ia.animationstart.animation),"TransitionEvent"in window||delete Ia.transitionend.transition);function Gi(n){if(Ed[n])return Ed[n];if(!Ia[n])return n;var i=Ia[n],o;for(o in i)if(i.hasOwnProperty(o)&&o in jg)return Ed[n]=i[o];return n}var Ng=Gi("animationend"),Cg=Gi("animationiteration"),_g=Gi("animationstart"),qN=Gi("transitionrun"),HN=Gi("transitionstart"),ZN=Gi("transitioncancel"),kg=Gi("transitionend"),zg=new Map,Rd="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(" ");Rd.push("scrollEnd");function Jn(n,i){zg.set(n,i),Ht(i,[n])}var zl=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)},Dn=[],$a=0,Od=0;function El(){for(var n=$a,i=Od=$a=0;i<n;){var o=Dn[i];Dn[i++]=null;var u=Dn[i];Dn[i++]=null;var h=Dn[i];Dn[i++]=null;var g=Dn[i];if(Dn[i++]=null,u!==null&&h!==null){var w=u.pending;w===null?h.next=h:(h.next=w.next,w.next=h),u.pending=h}g!==0&&Eg(o,h,g)}}function Rl(n,i,o,u){Dn[$a++]=n,Dn[$a++]=i,Dn[$a++]=o,Dn[$a++]=u,Od|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Ad(n,i,o,u){return Rl(n,i,o,u),Ol(n)}function Ki(n,i){return Rl(n,null,null,i),Ol(n)}function Eg(n,i,o){n.lanes|=o;var u=n.alternate;u!==null&&(u.lanes|=o);for(var h=!1,g=n.return;g!==null;)g.childLanes|=o,u=g.alternate,u!==null&&(u.childLanes|=o),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(h=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,h&&i!==null&&(h=31-te(o),n=g.hiddenUpdates,u=n[h],u===null?n[h]=[i]:u.push(i),i.lane=o|536870912),g):null}function Ol(n){if(50<xo)throw xo=0,qf=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ba={};function FN(n,i,o,u){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Cn(n,i,o,u){return new FN(n,i,o,u)}function Td(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Cs(n,i){var o=n.alternate;return o===null?(o=Cn(n.tag,i,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=i,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,i=n.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function Rg(n,i){n.flags&=65011714;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,i=o.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Al(n,i,o,u,h,g){var w=0;if(u=n,typeof n=="function")Td(n)&&(w=1);else if(typeof n=="string")w=YC(n,o,re.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case B:return n=Cn(31,o,i,h),n.elementType=B,n.lanes=g,n;case S:return Vi(o.children,h,g,i);case C:w=8,h|=24;break;case _:return n=Cn(12,o,i,h|2),n.elementType=_,n.lanes=g,n;case U:return n=Cn(13,o,i,h),n.elementType=U,n.lanes=g,n;case O:return n=Cn(19,o,i,h),n.elementType=O,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:w=10;break e;case E:w=9;break e;case z:w=11;break e;case M:w=14;break e;case A:w=16,u=null;break e}w=29,o=Error(a(130,n===null?"null":typeof n,"")),u=null}return i=Cn(w,o,i,h),i.elementType=n,i.type=u,i.lanes=g,i}function Vi(n,i,o,u){return n=Cn(7,n,u,i),n.lanes=o,n}function Dd(n,i,o){return n=Cn(6,n,null,i),n.lanes=o,n}function Og(n){var i=Cn(18,null,null,0);return i.stateNode=n,i}function Ld(n,i,o){return i=Cn(4,n.children!==null?n.children:[],n.key,i),i.lanes=o,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Ag=new WeakMap;function Ln(n,i){if(typeof n=="object"&&n!==null){var o=Ag.get(n);return o!==void 0?o:(i={value:n,source:i,stack:Kt(i)},Ag.set(n,i),i)}return{value:n,source:i,stack:Kt(i)}}var qa=[],Ha=0,Tl=null,Xr=0,Mn=[],Un=0,Ws=null,fs=1,hs="";function _s(n,i){qa[Ha++]=Xr,qa[Ha++]=Tl,Tl=n,Xr=i}function Tg(n,i,o){Mn[Un++]=fs,Mn[Un++]=hs,Mn[Un++]=Ws,Ws=n;var u=fs;n=hs;var h=32-te(u)-1;u&=~(1<<h),o+=1;var g=32-te(i)+h;if(30<g){var w=h-h%5;g=(u&(1<<w)-1).toString(32),u>>=w,h-=w,fs=1<<32-te(i)+h|o<<h|u,hs=g+n}else fs=1<<g|o<<h|u,hs=n}function Md(n){n.return!==null&&(_s(n,1),Tg(n,1,0))}function Ud(n){for(;n===Tl;)Tl=qa[--Ha],qa[Ha]=null,Xr=qa[--Ha],qa[Ha]=null;for(;n===Ws;)Ws=Mn[--Un],Mn[Un]=null,hs=Mn[--Un],Mn[Un]=null,fs=Mn[--Un],Mn[Un]=null}function Dg(n,i){Mn[Un++]=fs,Mn[Un++]=hs,Mn[Un++]=Ws,fs=i.id,hs=i.overflow,Ws=n}var Qt=null,ft=null,Ze=!1,ei=null,Pn=!1,Pd=Error(a(519));function ti(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wr(Ln(i,n)),Pd}function Lg(n){var i=n.stateNode,o=n.type,u=n.memoizedProps;switch(i[Et]=n,i[jt]=u,o){case"dialog":Me("cancel",i),Me("close",i);break;case"iframe":case"object":case"embed":Me("load",i);break;case"video":case"audio":for(o=0;o<wo.length;o++)Me(wo[o],i);break;case"source":Me("error",i);break;case"img":case"image":case"link":Me("error",i),Me("load",i);break;case"details":Me("toggle",i);break;case"input":Me("invalid",i),Vp(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Me("invalid",i);break;case"textarea":Me("invalid",i),Yp(i,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||i.textContent===""+o||u.suppressHydrationWarning===!0||X0(i.textContent,o)?(u.popover!=null&&(Me("beforetoggle",i),Me("toggle",i)),u.onScroll!=null&&Me("scroll",i),u.onScrollEnd!=null&&Me("scrollend",i),u.onClick!=null&&(i.onclick=js),i=!0):i=!1,i||ti(n,!0)}function Mg(n){for(Qt=n.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:Qt=Qt.return}}function Za(n){if(n!==Qt)return!1;if(!Ze)return Mg(n),Ze=!0,!1;var i=n.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||sh(n.type,n.memoizedProps)),o=!o),o&&ft&&ti(n),Mg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ft=ov(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ft=ov(n)}else i===27?(i=ft,pi(n.type)?(n=lh,lh=null,ft=n):ft=i):ft=Qt?$n(n.stateNode.nextSibling):null;return!0}function Qi(){ft=Qt=null,Ze=!1}function Id(){var n=ei;return n!==null&&(yn===null?yn=n:yn.push.apply(yn,n),ei=null),n}function Wr(n){ei===null?ei=[n]:ei.push(n)}var $d=L(null),Yi=null,ks=null;function ni(n,i,o){se($d,i._currentValue),i._currentValue=o}function zs(n){n._currentValue=$d.current,G($d)}function Bd(n,i,o){for(;n!==null;){var u=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),n===o)break;n=n.return}}function qd(n,i,o,u){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var w=h.child;g=g.firstContext;e:for(;g!==null;){var k=g;g=h;for(var D=0;D<i.length;D++)if(k.context===i[D]){g.lanes|=o,k=g.alternate,k!==null&&(k.lanes|=o),Bd(g.return,o,n),u||(w=null);break e}g=k.next}}else if(h.tag===18){if(w=h.return,w===null)throw Error(a(341));w.lanes|=o,g=w.alternate,g!==null&&(g.lanes|=o),Bd(w,o,n),w=null}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===n){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}}function Fa(n,i,o,u){n=null;for(var h=i,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var w=h.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var k=h.type;Nn(h.pendingProps.value,w.value)||(n!==null?n.push(k):n=[k])}}else if(h===de.current){if(w=h.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(ko):n=[ko])}h=h.return}n!==null&&qd(i,n,o,u),i.flags|=262144}function Dl(n){for(n=n.firstContext;n!==null;){if(!Nn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ji(n){Yi=n,ks=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Yt(n){return Ug(Yi,n)}function Ll(n,i){return Yi===null&&Ji(n),Ug(n,i)}function Ug(n,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},ks===null){if(n===null)throw Error(a(308));ks=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else ks=ks.next=i;return o}var GN=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(o,u){n.push(u)}};this.abort=function(){i.aborted=!0,n.forEach(function(o){return o()})}},KN=e.unstable_scheduleCallback,VN=e.unstable_NormalPriority,Ut={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hd(){return{controller:new GN,data:new Map,refCount:0}}function eo(n){n.refCount--,n.refCount===0&&KN(VN,function(){n.controller.abort()})}var to=null,Zd=0,Ga=0,Ka=null;function QN(n,i){if(to===null){var o=to=[];Zd=0,Ga=Vf(),Ka={status:"pending",value:void 0,then:function(u){o.push(u)}}}return Zd++,i.then(Pg,Pg),i}function Pg(){if(--Zd===0&&to!==null){Ka!==null&&(Ka.status="fulfilled");var n=to;to=null,Ga=0,Ka=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function YN(n,i){var o=[],u={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return n.then(function(){u.status="fulfilled",u.value=i;for(var h=0;h<o.length;h++)(0,o[h])(i)},function(h){for(u.status="rejected",u.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),u}var Ig=q.S;q.S=function(n,i){w0=Pe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&QN(n,i),Ig!==null&&Ig(n,i)};var Xi=L(null);function Fd(){var n=Xi.current;return n!==null?n:rt.pooledCache}function Ml(n,i){i===null?se(Xi,Xi.current):se(Xi,i.pool)}function $g(){var n=Fd();return n===null?null:{parent:Ut._currentValue,pool:n}}var Va=Error(a(460)),Gd=Error(a(474)),Ul=Error(a(542)),Pl={then:function(){}};function Bg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function qg(n,i,o){switch(o=n[o],o===void 0?n.push(i):o!==i&&(i.then(js,js),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Zg(n),n;default:if(typeof i.status=="string")i.then(js,js);else{if(n=rt,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,Zg(n),n}throw ea=i,Va}}function Wi(n){try{var i=n._init;return i(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(ea=o,Va):o}}var ea=null;function Hg(){if(ea===null)throw Error(a(459));var n=ea;return ea=null,n}function Zg(n){if(n===Va||n===Ul)throw Error(a(483))}var Qa=null,no=0;function Il(n){var i=no;return no+=1,Qa===null&&(Qa=[]),qg(Qa,n,i)}function so(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function $l(n,i){throw i.$$typeof===v?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function Fg(n){function i($,P){if(n){var H=$.deletions;H===null?($.deletions=[P],$.flags|=16):H.push(P)}}function o($,P){if(!n)return null;for(;P!==null;)i($,P),P=P.sibling;return null}function u($){for(var P=new Map;$!==null;)$.key!==null?P.set($.key,$):P.set($.index,$),$=$.sibling;return P}function h($,P){return $=Cs($,P),$.index=0,$.sibling=null,$}function g($,P,H){return $.index=H,n?(H=$.alternate,H!==null?(H=H.index,H<P?($.flags|=67108866,P):H):($.flags|=67108866,P)):($.flags|=1048576,P)}function w($){return n&&$.alternate===null&&($.flags|=67108866),$}function k($,P,H,J){return P===null||P.tag!==6?(P=Dd(H,$.mode,J),P.return=$,P):(P=h(P,H),P.return=$,P)}function D($,P,H,J){var Ne=H.type;return Ne===S?Y($,P,H.props.children,J,H.key):P!==null&&(P.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&Wi(Ne)===P.type)?(P=h(P,H.props),so(P,H),P.return=$,P):(P=Al(H.type,H.key,H.props,null,$.mode,J),so(P,H),P.return=$,P)}function Z($,P,H,J){return P===null||P.tag!==4||P.stateNode.containerInfo!==H.containerInfo||P.stateNode.implementation!==H.implementation?(P=Ld(H,$.mode,J),P.return=$,P):(P=h(P,H.children||[]),P.return=$,P)}function Y($,P,H,J,Ne){return P===null||P.tag!==7?(P=Vi(H,$.mode,J,Ne),P.return=$,P):(P=h(P,H),P.return=$,P)}function W($,P,H){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=Dd(""+P,$.mode,H),P.return=$,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case x:return H=Al(P.type,P.key,P.props,null,$.mode,H),so(H,P),H.return=$,H;case j:return P=Ld(P,$.mode,H),P.return=$,P;case A:return P=Wi(P),W($,P,H)}if(we(P)||ne(P))return P=Vi(P,$.mode,H,null),P.return=$,P;if(typeof P.then=="function")return W($,Il(P),H);if(P.$$typeof===R)return W($,Ll($,P),H);$l($,P)}return null}function F($,P,H,J){var Ne=P!==null?P.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Ne!==null?null:k($,P,""+H,J);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case x:return H.key===Ne?D($,P,H,J):null;case j:return H.key===Ne?Z($,P,H,J):null;case A:return H=Wi(H),F($,P,H,J)}if(we(H)||ne(H))return Ne!==null?null:Y($,P,H,J,null);if(typeof H.then=="function")return F($,P,Il(H),J);if(H.$$typeof===R)return F($,P,Ll($,H),J);$l($,H)}return null}function K($,P,H,J,Ne){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return $=$.get(H)||null,k(P,$,""+J,Ne);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return $=$.get(J.key===null?H:J.key)||null,D(P,$,J,Ne);case j:return $=$.get(J.key===null?H:J.key)||null,Z(P,$,J,Ne);case A:return J=Wi(J),K($,P,H,J,Ne)}if(we(J)||ne(J))return $=$.get(H)||null,Y(P,$,J,Ne,null);if(typeof J.then=="function")return K($,P,H,Il(J),Ne);if(J.$$typeof===R)return K($,P,H,Ll(P,J),Ne);$l(P,J)}return null}function ye($,P,H,J){for(var Ne=null,Ke=null,Se=P,Ae=P=0,qe=null;Se!==null&&Ae<H.length;Ae++){Se.index>Ae?(qe=Se,Se=null):qe=Se.sibling;var Ve=F($,Se,H[Ae],J);if(Ve===null){Se===null&&(Se=qe);break}n&&Se&&Ve.alternate===null&&i($,Se),P=g(Ve,P,Ae),Ke===null?Ne=Ve:Ke.sibling=Ve,Ke=Ve,Se=qe}if(Ae===H.length)return o($,Se),Ze&&_s($,Ae),Ne;if(Se===null){for(;Ae<H.length;Ae++)Se=W($,H[Ae],J),Se!==null&&(P=g(Se,P,Ae),Ke===null?Ne=Se:Ke.sibling=Se,Ke=Se);return Ze&&_s($,Ae),Ne}for(Se=u(Se);Ae<H.length;Ae++)qe=K(Se,$,Ae,H[Ae],J),qe!==null&&(n&&qe.alternate!==null&&Se.delete(qe.key===null?Ae:qe.key),P=g(qe,P,Ae),Ke===null?Ne=qe:Ke.sibling=qe,Ke=qe);return n&&Se.forEach(function(xi){return i($,xi)}),Ze&&_s($,Ae),Ne}function _e($,P,H,J){if(H==null)throw Error(a(151));for(var Ne=null,Ke=null,Se=P,Ae=P=0,qe=null,Ve=H.next();Se!==null&&!Ve.done;Ae++,Ve=H.next()){Se.index>Ae?(qe=Se,Se=null):qe=Se.sibling;var xi=F($,Se,Ve.value,J);if(xi===null){Se===null&&(Se=qe);break}n&&Se&&xi.alternate===null&&i($,Se),P=g(xi,P,Ae),Ke===null?Ne=xi:Ke.sibling=xi,Ke=xi,Se=qe}if(Ve.done)return o($,Se),Ze&&_s($,Ae),Ne;if(Se===null){for(;!Ve.done;Ae++,Ve=H.next())Ve=W($,Ve.value,J),Ve!==null&&(P=g(Ve,P,Ae),Ke===null?Ne=Ve:Ke.sibling=Ve,Ke=Ve);return Ze&&_s($,Ae),Ne}for(Se=u(Se);!Ve.done;Ae++,Ve=H.next())Ve=K(Se,$,Ae,Ve.value,J),Ve!==null&&(n&&Ve.alternate!==null&&Se.delete(Ve.key===null?Ae:Ve.key),P=g(Ve,P,Ae),Ke===null?Ne=Ve:Ke.sibling=Ve,Ke=Ve);return n&&Se.forEach(function(o_){return i($,o_)}),Ze&&_s($,Ae),Ne}function at($,P,H,J){if(typeof H=="object"&&H!==null&&H.type===S&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case x:e:{for(var Ne=H.key;P!==null;){if(P.key===Ne){if(Ne=H.type,Ne===S){if(P.tag===7){o($,P.sibling),J=h(P,H.props.children),J.return=$,$=J;break e}}else if(P.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&Wi(Ne)===P.type){o($,P.sibling),J=h(P,H.props),so(J,H),J.return=$,$=J;break e}o($,P);break}else i($,P);P=P.sibling}H.type===S?(J=Vi(H.props.children,$.mode,J,H.key),J.return=$,$=J):(J=Al(H.type,H.key,H.props,null,$.mode,J),so(J,H),J.return=$,$=J)}return w($);case j:e:{for(Ne=H.key;P!==null;){if(P.key===Ne)if(P.tag===4&&P.stateNode.containerInfo===H.containerInfo&&P.stateNode.implementation===H.implementation){o($,P.sibling),J=h(P,H.children||[]),J.return=$,$=J;break e}else{o($,P);break}else i($,P);P=P.sibling}J=Ld(H,$.mode,J),J.return=$,$=J}return w($);case A:return H=Wi(H),at($,P,H,J)}if(we(H))return ye($,P,H,J);if(ne(H)){if(Ne=ne(H),typeof Ne!="function")throw Error(a(150));return H=Ne.call(H),_e($,P,H,J)}if(typeof H.then=="function")return at($,P,Il(H),J);if(H.$$typeof===R)return at($,P,Ll($,H),J);$l($,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,P!==null&&P.tag===6?(o($,P.sibling),J=h(P,H),J.return=$,$=J):(o($,P),J=Dd(H,$.mode,J),J.return=$,$=J),w($)):o($,P)}return function($,P,H,J){try{no=0;var Ne=at($,P,H,J);return Qa=null,Ne}catch(Se){if(Se===Va||Se===Ul)throw Se;var Ke=Cn(29,Se,null,$.mode);return Ke.lanes=J,Ke.return=$,Ke}}}var ta=Fg(!0),Gg=Fg(!1),si=!1;function Kd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vd(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ii(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function ai(n,i,o){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Qe&2)!==0){var h=u.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),u.pending=i,i=Ol(n),Eg(n,null,o),i}return Rl(n,u,i,o),Ol(n)}function io(n,i,o){if(i=i.updateQueue,i!==null&&(i=i.shared,(o&4194048)!==0)){var u=i.lanes;u&=n.pendingLanes,o|=u,i.lanes=o,yl(n,o)}}function Qd(n,i){var o=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var h=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var w={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?h=g=w:g=g.next=w,o=o.next}while(o!==null);g===null?h=g=i:g=g.next=i}else h=g=i;o={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=i:n.next=i,o.lastBaseUpdate=i}var Yd=!1;function ao(){if(Yd){var n=Ka;if(n!==null)throw n}}function ro(n,i,o,u){Yd=!1;var h=n.updateQueue;si=!1;var g=h.firstBaseUpdate,w=h.lastBaseUpdate,k=h.shared.pending;if(k!==null){h.shared.pending=null;var D=k,Z=D.next;D.next=null,w===null?g=Z:w.next=Z,w=D;var Y=n.alternate;Y!==null&&(Y=Y.updateQueue,k=Y.lastBaseUpdate,k!==w&&(k===null?Y.firstBaseUpdate=Z:k.next=Z,Y.lastBaseUpdate=D))}if(g!==null){var W=h.baseState;w=0,Y=Z=D=null,k=g;do{var F=k.lane&-536870913,K=F!==k.lane;if(K?(Be&F)===F:(u&F)===F){F!==0&&F===Ga&&(Yd=!0),Y!==null&&(Y=Y.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ye=n,_e=k;F=i;var at=o;switch(_e.tag){case 1:if(ye=_e.payload,typeof ye=="function"){W=ye.call(at,W,F);break e}W=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=_e.payload,F=typeof ye=="function"?ye.call(at,W,F):ye,F==null)break e;W=y({},W,F);break e;case 2:si=!0}}F=k.callback,F!==null&&(n.flags|=64,K&&(n.flags|=8192),K=h.callbacks,K===null?h.callbacks=[F]:K.push(F))}else K={lane:F,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Y===null?(Z=Y=K,D=W):Y=Y.next=K,w|=F;if(k=k.next,k===null){if(k=h.shared.pending,k===null)break;K=k,k=K.next,K.next=null,h.lastBaseUpdate=K,h.shared.pending=null}}while(!0);Y===null&&(D=W),h.baseState=D,h.firstBaseUpdate=Z,h.lastBaseUpdate=Y,g===null&&(h.shared.lanes=0),ui|=w,n.lanes=w,n.memoizedState=W}}function Kg(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function Vg(n,i){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)Kg(o[n],i)}var Ya=L(null),Bl=L(0);function Qg(n,i){n=Us,se(Bl,n),se(Ya,i),Us=n|i.baseLanes}function Jd(){se(Bl,Us),se(Ya,Ya.current)}function Xd(){Us=Bl.current,G(Ya),G(Bl)}var _n=L(null),In=null;function ri(n){var i=n.alternate;se(Rt,Rt.current&1),se(_n,n),In===null&&(i===null||Ya.current!==null||i.memoizedState!==null)&&(In=n)}function Wd(n){se(Rt,Rt.current),se(_n,n),In===null&&(In=n)}function Yg(n){n.tag===22?(se(Rt,Rt.current),se(_n,n),In===null&&(In=n)):oi()}function oi(){se(Rt,Rt.current),se(_n,_n.current)}function kn(n){G(_n),In===n&&(In=null),G(Rt)}var Rt=L(0);function ql(n){for(var i=n;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||rh(o)||oh(o)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Es=0,Oe=null,st=null,Pt=null,Hl=!1,Ja=!1,na=!1,Zl=0,oo=0,Xa=null,JN=0;function Nt(){throw Error(a(321))}function ef(n,i){if(i===null)return!1;for(var o=0;o<i.length&&o<n.length;o++)if(!Nn(n[o],i[o]))return!1;return!0}function tf(n,i,o,u,h,g){return Es=g,Oe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,q.H=n===null||n.memoizedState===null?Ty:yf,na=!1,g=o(u,h),na=!1,Ja&&(g=Xg(i,o,u,h)),Jg(n),g}function Jg(n){q.H=uo;var i=st!==null&&st.next!==null;if(Es=0,Pt=st=Oe=null,Hl=!1,oo=0,Xa=null,i)throw Error(a(300));n===null||It||(n=n.dependencies,n!==null&&Dl(n)&&(It=!0))}function Xg(n,i,o,u){Oe=n;var h=0;do{if(Ja&&(Xa=null),oo=0,Ja=!1,25<=h)throw Error(a(301));if(h+=1,Pt=st=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}q.H=Dy,g=i(o,u)}while(Ja);return g}function XN(){var n=q.H,i=n.useState()[0];return i=typeof i.then=="function"?lo(i):i,n=n.useState()[0],(st!==null?st.memoizedState:null)!==n&&(Oe.flags|=1024),i}function nf(){var n=Zl!==0;return Zl=0,n}function sf(n,i,o){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~o}function af(n){if(Hl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Hl=!1}Es=0,Pt=st=Oe=null,Ja=!1,oo=Zl=0,Xa=null}function rn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?Oe.memoizedState=Pt=n:Pt=Pt.next=n,Pt}function Ot(){if(st===null){var n=Oe.alternate;n=n!==null?n.memoizedState:null}else n=st.next;var i=Pt===null?Oe.memoizedState:Pt.next;if(i!==null)Pt=i,st=n;else{if(n===null)throw Oe.alternate===null?Error(a(467)):Error(a(310));st=n,n={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},Pt===null?Oe.memoizedState=Pt=n:Pt=Pt.next=n}return Pt}function Fl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lo(n){var i=oo;return oo+=1,Xa===null&&(Xa=[]),n=qg(Xa,n,i),i=Oe,(Pt===null?i.memoizedState:Pt.next)===null&&(i=i.alternate,q.H=i===null||i.memoizedState===null?Ty:yf),n}function Gl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return lo(n);if(n.$$typeof===R)return Yt(n)}throw Error(a(438,String(n)))}function rf(n){var i=null,o=Oe.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var u=Oe.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),o===null&&(o=Fl(),Oe.updateQueue=o),o.memoCache=i,o=i.data[i.index],o===void 0)for(o=i.data[i.index]=Array(n),u=0;u<n;u++)o[u]=ie;return i.index++,o}function Rs(n,i){return typeof i=="function"?i(n):i}function Kl(n){var i=Ot();return of(i,st,n)}function of(n,i,o){var u=n.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=o;var h=n.baseQueue,g=u.pending;if(g!==null){if(h!==null){var w=h.next;h.next=g.next,g.next=w}i.baseQueue=h=g,u.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var k=w=null,D=null,Z=i,Y=!1;do{var W=Z.lane&-536870913;if(W!==Z.lane?(Be&W)===W:(Es&W)===W){var F=Z.revertLane;if(F===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),W===Ga&&(Y=!0);else if((Es&F)===F){Z=Z.next,F===Ga&&(Y=!0);continue}else W={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},D===null?(k=D=W,w=g):D=D.next=W,Oe.lanes|=F,ui|=F;W=Z.action,na&&o(g,W),g=Z.hasEagerState?Z.eagerState:o(g,W)}else F={lane:W,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},D===null?(k=D=F,w=g):D=D.next=F,Oe.lanes|=W,ui|=W;Z=Z.next}while(Z!==null&&Z!==i);if(D===null?w=g:D.next=k,!Nn(g,n.memoizedState)&&(It=!0,Y&&(o=Ka,o!==null)))throw o;n.memoizedState=g,n.baseState=w,n.baseQueue=D,u.lastRenderedState=g}return h===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function lf(n){var i=Ot(),o=i.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=n;var u=o.dispatch,h=o.pending,g=i.memoizedState;if(h!==null){o.pending=null;var w=h=h.next;do g=n(g,w.action),w=w.next;while(w!==h);Nn(g,i.memoizedState)||(It=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),o.lastRenderedState=g}return[g,u]}function Wg(n,i,o){var u=Oe,h=Ot(),g=Ze;if(g){if(o===void 0)throw Error(a(407));o=o()}else o=i();var w=!Nn((st||h).memoizedState,o);if(w&&(h.memoizedState=o,It=!0),h=h.queue,df(ny.bind(null,u,h,n),[n]),h.getSnapshot!==i||w||Pt!==null&&Pt.memoizedState.tag&1){if(u.flags|=2048,Wa(9,{destroy:void 0},ty.bind(null,u,h,o,i),null),rt===null)throw Error(a(349));g||(Es&127)!==0||ey(u,i,o)}return o}function ey(n,i,o){n.flags|=16384,n={getSnapshot:i,value:o},i=Oe.updateQueue,i===null?(i=Fl(),Oe.updateQueue=i,i.stores=[n]):(o=i.stores,o===null?i.stores=[n]:o.push(n))}function ty(n,i,o,u){i.value=o,i.getSnapshot=u,sy(i)&&iy(n)}function ny(n,i,o){return o(function(){sy(i)&&iy(n)})}function sy(n){var i=n.getSnapshot;n=n.value;try{var o=i();return!Nn(n,o)}catch{return!0}}function iy(n){var i=Ki(n,2);i!==null&&vn(i,n,2)}function cf(n){var i=rn();if(typeof n=="function"){var o=n;if(n=o(),na){wn(!0);try{o()}finally{wn(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:n},i}function ay(n,i,o,u){return n.baseState=o,of(n,st,typeof u=="function"?u:Rs)}function WN(n,i,o,u,h){if(Yl(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(w){g.listeners.push(w)}};q.T!==null?o(!0):g.isTransition=!1,u(g),o=i.pending,o===null?(g.next=i.pending=g,ry(i,g)):(g.next=o.next,i.pending=o.next=g)}}function ry(n,i){var o=i.action,u=i.payload,h=n.state;if(i.isTransition){var g=q.T,w={};q.T=w;try{var k=o(h,u),D=q.S;D!==null&&D(w,k),oy(n,i,k)}catch(Z){uf(n,i,Z)}finally{g!==null&&w.types!==null&&(g.types=w.types),q.T=g}}else try{g=o(h,u),oy(n,i,g)}catch(Z){uf(n,i,Z)}}function oy(n,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){ly(n,i,u)},function(u){return uf(n,i,u)}):ly(n,i,o)}function ly(n,i,o){i.status="fulfilled",i.value=o,cy(i),n.state=o,i=n.pending,i!==null&&(o=i.next,o===i?n.pending=null:(o=o.next,i.next=o,ry(n,o)))}function uf(n,i,o){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=o,cy(i),i=i.next;while(i!==u)}n.action=null}function cy(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function uy(n,i){return i}function dy(n,i){if(Ze){var o=rt.formState;if(o!==null){e:{var u=Oe;if(Ze){if(ft){t:{for(var h=ft,g=Pn;h.nodeType!==8;){if(!g){h=null;break t}if(h=$n(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){ft=$n(h.nextSibling),u=h.data==="F!";break e}}ti(u)}u=!1}u&&(i=o[0])}}return o=rn(),o.memoizedState=o.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:uy,lastRenderedState:i},o.queue=u,o=Ry.bind(null,Oe,u),u.dispatch=o,u=cf(!1),g=gf.bind(null,Oe,!1,u.queue),u=rn(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,o=WN.bind(null,Oe,h,g,o),h.dispatch=o,u.memoizedState=n,[i,o,!1]}function fy(n){var i=Ot();return hy(i,st,n)}function hy(n,i,o){if(i=of(n,i,uy)[0],n=Kl(Rs)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=lo(i)}catch(w){throw w===Va?Ul:w}else u=i;i=Ot();var h=i.queue,g=h.dispatch;return o!==i.memoizedState&&(Oe.flags|=2048,Wa(9,{destroy:void 0},eC.bind(null,h,o),null)),[u,g,n]}function eC(n,i){n.action=i}function my(n){var i=Ot(),o=st;if(o!==null)return hy(i,o,n);Ot(),i=i.memoizedState,o=Ot();var u=o.queue.dispatch;return o.memoizedState=n,[i,u,!1]}function Wa(n,i,o,u){return n={tag:n,create:o,deps:u,inst:i,next:null},i=Oe.updateQueue,i===null&&(i=Fl(),Oe.updateQueue=i),o=i.lastEffect,o===null?i.lastEffect=n.next=n:(u=o.next,o.next=n,n.next=u,i.lastEffect=n),n}function py(){return Ot().memoizedState}function Vl(n,i,o,u){var h=rn();Oe.flags|=n,h.memoizedState=Wa(1|i,{destroy:void 0},o,u===void 0?null:u)}function Ql(n,i,o,u){var h=Ot();u=u===void 0?null:u;var g=h.memoizedState.inst;st!==null&&u!==null&&ef(u,st.memoizedState.deps)?h.memoizedState=Wa(i,g,o,u):(Oe.flags|=n,h.memoizedState=Wa(1|i,g,o,u))}function gy(n,i){Vl(8390656,8,n,i)}function df(n,i){Ql(2048,8,n,i)}function tC(n){Oe.flags|=4;var i=Oe.updateQueue;if(i===null)i=Fl(),Oe.updateQueue=i,i.events=[n];else{var o=i.events;o===null?i.events=[n]:o.push(n)}}function yy(n){var i=Ot().memoizedState;return tC({ref:i,nextImpl:n}),function(){if((Qe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function vy(n,i){return Ql(4,2,n,i)}function by(n,i){return Ql(4,4,n,i)}function xy(n,i){if(typeof i=="function"){n=n();var o=i(n);return function(){typeof o=="function"?o():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Sy(n,i,o){o=o!=null?o.concat([n]):null,Ql(4,4,xy.bind(null,i,n),o)}function ff(){}function wy(n,i){var o=Ot();i=i===void 0?null:i;var u=o.memoizedState;return i!==null&&ef(i,u[1])?u[0]:(o.memoizedState=[n,i],n)}function jy(n,i){var o=Ot();i=i===void 0?null:i;var u=o.memoizedState;if(i!==null&&ef(i,u[1]))return u[0];if(u=n(),na){wn(!0);try{n()}finally{wn(!1)}}return o.memoizedState=[u,i],u}function hf(n,i,o){return o===void 0||(Es&1073741824)!==0&&(Be&261930)===0?n.memoizedState=i:(n.memoizedState=o,n=N0(),Oe.lanes|=n,ui|=n,o)}function Ny(n,i,o,u){return Nn(o,i)?o:Ya.current!==null?(n=hf(n,o,u),Nn(n,i)||(It=!0),n):(Es&42)===0||(Es&1073741824)!==0&&(Be&261930)===0?(It=!0,n.memoizedState=o):(n=N0(),Oe.lanes|=n,ui|=n,i)}function Cy(n,i,o,u,h){var g=T.p;T.p=g!==0&&8>g?g:8;var w=q.T,k={};q.T=k,gf(n,!1,i,o);try{var D=h(),Z=q.S;if(Z!==null&&Z(k,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var Y=YN(D,u);co(n,i,Y,Rn(n))}else co(n,i,u,Rn(n))}catch(W){co(n,i,{then:function(){},status:"rejected",reason:W},Rn())}finally{T.p=g,w!==null&&k.types!==null&&(w.types=k.types),q.T=w}}function nC(){}function mf(n,i,o,u){if(n.tag!==5)throw Error(a(476));var h=_y(n).queue;Cy(n,h,i,ae,o===null?nC:function(){return ky(n),o(u)})}function _y(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:ae},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:o},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function ky(n){var i=_y(n);i.next===null&&(i=n.alternate.memoizedState),co(n,i.next.queue,{},Rn())}function pf(){return Yt(ko)}function zy(){return Ot().memoizedState}function Ey(){return Ot().memoizedState}function sC(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var o=Rn();n=ii(o);var u=ai(i,n,o);u!==null&&(vn(u,i,o),io(u,i,o)),i={cache:Hd()},n.payload=i;return}i=i.return}}function iC(n,i,o){var u=Rn();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Yl(n)?Oy(i,o):(o=Ad(n,i,o,u),o!==null&&(vn(o,n,u),Ay(o,i,u)))}function Ry(n,i,o){var u=Rn();co(n,i,o,u)}function co(n,i,o,u){var h={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Yl(n))Oy(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var w=i.lastRenderedState,k=g(w,o);if(h.hasEagerState=!0,h.eagerState=k,Nn(k,w))return Rl(n,i,h,0),rt===null&&El(),!1}catch{}if(o=Ad(n,i,h,u),o!==null)return vn(o,n,u),Ay(o,i,u),!0}return!1}function gf(n,i,o,u){if(u={lane:2,revertLane:Vf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Yl(n)){if(i)throw Error(a(479))}else i=Ad(n,o,u,2),i!==null&&vn(i,n,2)}function Yl(n){var i=n.alternate;return n===Oe||i!==null&&i===Oe}function Oy(n,i){Ja=Hl=!0;var o=n.pending;o===null?i.next=i:(i.next=o.next,o.next=i),n.pending=i}function Ay(n,i,o){if((o&4194048)!==0){var u=i.lanes;u&=n.pendingLanes,o|=u,i.lanes=o,yl(n,o)}}var uo={readContext:Yt,use:Gl,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};uo.useEffectEvent=Nt;var Ty={readContext:Yt,use:Gl,useCallback:function(n,i){return rn().memoizedState=[n,i===void 0?null:i],n},useContext:Yt,useEffect:gy,useImperativeHandle:function(n,i,o){o=o!=null?o.concat([n]):null,Vl(4194308,4,xy.bind(null,i,n),o)},useLayoutEffect:function(n,i){return Vl(4194308,4,n,i)},useInsertionEffect:function(n,i){Vl(4,2,n,i)},useMemo:function(n,i){var o=rn();i=i===void 0?null:i;var u=n();if(na){wn(!0);try{n()}finally{wn(!1)}}return o.memoizedState=[u,i],u},useReducer:function(n,i,o){var u=rn();if(o!==void 0){var h=o(i);if(na){wn(!0);try{o(i)}finally{wn(!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=iC.bind(null,Oe,n),[u.memoizedState,n]},useRef:function(n){var i=rn();return n={current:n},i.memoizedState=n},useState:function(n){n=cf(n);var i=n.queue,o=Ry.bind(null,Oe,i);return i.dispatch=o,[n.memoizedState,o]},useDebugValue:ff,useDeferredValue:function(n,i){var o=rn();return hf(o,n,i)},useTransition:function(){var n=cf(!1);return n=Cy.bind(null,Oe,n.queue,!0,!1),rn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,o){var u=Oe,h=rn();if(Ze){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),rt===null)throw Error(a(349));(Be&127)!==0||ey(u,i,o)}h.memoizedState=o;var g={value:o,getSnapshot:i};return h.queue=g,gy(ny.bind(null,u,g,n),[n]),u.flags|=2048,Wa(9,{destroy:void 0},ty.bind(null,u,g,o,i),null),o},useId:function(){var n=rn(),i=rt.identifierPrefix;if(Ze){var o=hs,u=fs;o=(u&~(1<<32-te(u)-1)).toString(32)+o,i="_"+i+"R_"+o,o=Zl++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=JN++,i="_"+i+"r_"+o.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:pf,useFormState:dy,useActionState:dy,useOptimistic:function(n){var i=rn();i.memoizedState=i.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=gf.bind(null,Oe,!0,o),o.dispatch=i,[n,i]},useMemoCache:rf,useCacheRefresh:function(){return rn().memoizedState=sC.bind(null,Oe)},useEffectEvent:function(n){var i=rn(),o={impl:n};return i.memoizedState=o,function(){if((Qe&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},yf={readContext:Yt,use:Gl,useCallback:wy,useContext:Yt,useEffect:df,useImperativeHandle:Sy,useInsertionEffect:vy,useLayoutEffect:by,useMemo:jy,useReducer:Kl,useRef:py,useState:function(){return Kl(Rs)},useDebugValue:ff,useDeferredValue:function(n,i){var o=Ot();return Ny(o,st.memoizedState,n,i)},useTransition:function(){var n=Kl(Rs)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:lo(n),i]},useSyncExternalStore:Wg,useId:zy,useHostTransitionStatus:pf,useFormState:fy,useActionState:fy,useOptimistic:function(n,i){var o=Ot();return ay(o,st,n,i)},useMemoCache:rf,useCacheRefresh:Ey};yf.useEffectEvent=yy;var Dy={readContext:Yt,use:Gl,useCallback:wy,useContext:Yt,useEffect:df,useImperativeHandle:Sy,useInsertionEffect:vy,useLayoutEffect:by,useMemo:jy,useReducer:lf,useRef:py,useState:function(){return lf(Rs)},useDebugValue:ff,useDeferredValue:function(n,i){var o=Ot();return st===null?hf(o,n,i):Ny(o,st.memoizedState,n,i)},useTransition:function(){var n=lf(Rs)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:lo(n),i]},useSyncExternalStore:Wg,useId:zy,useHostTransitionStatus:pf,useFormState:my,useActionState:my,useOptimistic:function(n,i){var o=Ot();return st!==null?ay(o,st,n,i):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:rf,useCacheRefresh:Ey};Dy.useEffectEvent=yy;function vf(n,i,o,u){i=n.memoizedState,o=o(u,i),o=o==null?i:y({},i,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var bf={enqueueSetState:function(n,i,o){n=n._reactInternals;var u=Rn(),h=ii(u);h.payload=i,o!=null&&(h.callback=o),i=ai(n,h,u),i!==null&&(vn(i,n,u),io(i,n,u))},enqueueReplaceState:function(n,i,o){n=n._reactInternals;var u=Rn(),h=ii(u);h.tag=1,h.payload=i,o!=null&&(h.callback=o),i=ai(n,h,u),i!==null&&(vn(i,n,u),io(i,n,u))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var o=Rn(),u=ii(o);u.tag=2,i!=null&&(u.callback=i),i=ai(n,u,o),i!==null&&(vn(i,n,o),io(i,n,o))}};function Ly(n,i,o,u,h,g,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,g,w):i.prototype&&i.prototype.isPureReactComponent?!Yr(o,u)||!Yr(h,g):!0}function My(n,i,o,u){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(o,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(o,u),i.state!==n&&bf.enqueueReplaceState(i,i.state,null)}function sa(n,i){var o=i;if("ref"in i){o={};for(var u in i)u!=="ref"&&(o[u]=i[u])}if(n=n.defaultProps){o===i&&(o=y({},o));for(var h in n)o[h]===void 0&&(o[h]=n[h])}return o}function Uy(n){zl(n)}function Py(n){console.error(n)}function Iy(n){zl(n)}function Jl(n,i){try{var o=n.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function $y(n,i,o){try{var u=n.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function xf(n,i,o){return o=ii(o),o.tag=3,o.payload={element:null},o.callback=function(){Jl(n,i)},o}function By(n){return n=ii(n),n.tag=3,n}function qy(n,i,o,u){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var g=u.value;n.payload=function(){return h(g)},n.callback=function(){$y(i,o,u)}}var w=o.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){$y(i,o,u),typeof h!="function"&&(di===null?di=new Set([this]):di.add(this));var k=u.stack;this.componentDidCatch(u.value,{componentStack:k!==null?k:""})})}function aC(n,i,o,u,h){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=o.alternate,i!==null&&Fa(i,o,h,!0),o=_n.current,o!==null){switch(o.tag){case 31:case 13:return In===null?cc():o.alternate===null&&Ct===0&&(Ct=3),o.flags&=-257,o.flags|=65536,o.lanes=h,u===Pl?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([u]):i.add(u),Ff(n,u,h)),!1;case 22:return o.flags|=65536,u===Pl?o.flags|=16384:(i=o.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=i):(o=i.retryQueue,o===null?i.retryQueue=new Set([u]):o.add(u)),Ff(n,u,h)),!1}throw Error(a(435,o.tag))}return Ff(n,u,h),cc(),!1}if(Ze)return i=_n.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,u!==Pd&&(n=Error(a(422),{cause:u}),Wr(Ln(n,o)))):(u!==Pd&&(i=Error(a(423),{cause:u}),Wr(Ln(i,o))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,u=Ln(u,o),h=xf(n.stateNode,u,h),Qd(n,h),Ct!==4&&(Ct=2)),!1;var g=Error(a(520),{cause:u});if(g=Ln(g,o),bo===null?bo=[g]:bo.push(g),Ct!==4&&(Ct=2),i===null)return!0;u=Ln(u,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,n=h&-h,o.lanes|=n,n=xf(o.stateNode,u,n),Qd(o,n),!1;case 1:if(i=o.type,g=o.stateNode,(o.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(di===null||!di.has(g))))return o.flags|=65536,h&=-h,o.lanes|=h,h=By(h),qy(h,n,o,u),Qd(o,h),!1}o=o.return}while(o!==null);return!1}var Sf=Error(a(461)),It=!1;function Jt(n,i,o,u){i.child=n===null?Gg(i,null,o,u):ta(i,n.child,o,u)}function Hy(n,i,o,u,h){o=o.render;var g=i.ref;if("ref"in u){var w={};for(var k in u)k!=="ref"&&(w[k]=u[k])}else w=u;return Ji(i),u=tf(n,i,o,w,g,h),k=nf(),n!==null&&!It?(sf(n,i,h),Os(n,i,h)):(Ze&&k&&Md(i),i.flags|=1,Jt(n,i,u,h),i.child)}function Zy(n,i,o,u,h){if(n===null){var g=o.type;return typeof g=="function"&&!Td(g)&&g.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=g,Fy(n,i,g,u,h)):(n=Al(o.type,null,u,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!Ef(n,h)){var w=g.memoizedProps;if(o=o.compare,o=o!==null?o:Yr,o(w,u)&&n.ref===i.ref)return Os(n,i,h)}return i.flags|=1,n=Cs(g,u),n.ref=i.ref,n.return=i,i.child=n}function Fy(n,i,o,u,h){if(n!==null){var g=n.memoizedProps;if(Yr(g,u)&&n.ref===i.ref)if(It=!1,i.pendingProps=u=g,Ef(n,h))(n.flags&131072)!==0&&(It=!0);else return i.lanes=n.lanes,Os(n,i,h)}return wf(n,i,o,u,h)}function Gy(n,i,o,u){var h=u.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|o:o,n!==null){for(u=i.child=n.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~g}else u=0,i.child=null;return Ky(n,i,g,o,u)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Ml(i,g!==null?g.cachePool:null),g!==null?Qg(i,g):Jd(),Yg(i);else return u=i.lanes=536870912,Ky(n,i,g!==null?g.baseLanes|o:o,o,u)}else g!==null?(Ml(i,g.cachePool),Qg(i,g),oi(),i.memoizedState=null):(n!==null&&Ml(i,null),Jd(),oi());return Jt(n,i,h,o),i.child}function fo(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Ky(n,i,o,u,h){var g=Fd();return g=g===null?null:{parent:Ut._currentValue,pool:g},i.memoizedState={baseLanes:o,cachePool:g},n!==null&&Ml(i,null),Jd(),Yg(i),n!==null&&Fa(n,i,u,!0),i.childLanes=h,null}function Xl(n,i){return i=ec({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function Vy(n,i,o){return ta(i,n.child,null,o),n=Xl(i,i.pendingProps),n.flags|=2,kn(i),i.memoizedState=null,n}function rC(n,i,o){var u=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Ze){if(u.mode==="hidden")return n=Xl(i,u),i.lanes=536870912,fo(null,n);if(Wd(i),(n=ft)?(n=rv(n,Pn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:Ws!==null?{id:fs,overflow:hs}:null,retryLane:536870912,hydrationErrors:null},o=Og(n),o.return=i,i.child=o,Qt=i,ft=null)):n=null,n===null)throw ti(i);return i.lanes=536870912,null}return Xl(i,u)}var g=n.memoizedState;if(g!==null){var w=g.dehydrated;if(Wd(i),h)if(i.flags&256)i.flags&=-257,i=Vy(n,i,o);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(It||Fa(n,i,o,!1),h=(o&n.childLanes)!==0,It||h){if(u=rt,u!==null&&(w=Br(u,o),w!==0&&w!==g.retryLane))throw g.retryLane=w,Ki(n,w),vn(u,n,w),Sf;cc(),i=Vy(n,i,o)}else n=g.treeContext,ft=$n(w.nextSibling),Qt=i,Ze=!0,ei=null,Pn=!1,n!==null&&Dg(i,n),i=Xl(i,u),i.flags|=4096;return i}return n=Cs(n.child,{mode:u.mode,children:u.children}),n.ref=i.ref,i.child=n,n.return=i,n}function Wl(n,i){var o=i.ref;if(o===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(n===null||n.ref!==o)&&(i.flags|=4194816)}}function wf(n,i,o,u,h){return Ji(i),o=tf(n,i,o,u,void 0,h),u=nf(),n!==null&&!It?(sf(n,i,h),Os(n,i,h)):(Ze&&u&&Md(i),i.flags|=1,Jt(n,i,o,h),i.child)}function Qy(n,i,o,u,h,g){return Ji(i),i.updateQueue=null,o=Xg(i,u,o,h),Jg(n),u=nf(),n!==null&&!It?(sf(n,i,g),Os(n,i,g)):(Ze&&u&&Md(i),i.flags|=1,Jt(n,i,o,g),i.child)}function Yy(n,i,o,u,h){if(Ji(i),i.stateNode===null){var g=Ba,w=o.contextType;typeof w=="object"&&w!==null&&(g=Yt(w)),g=new o(u,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=bf,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=u,g.state=i.memoizedState,g.refs={},Kd(i),w=o.contextType,g.context=typeof w=="object"&&w!==null?Yt(w):Ba,g.state=i.memoizedState,w=o.getDerivedStateFromProps,typeof w=="function"&&(vf(i,o,w,u),g.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(w=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),w!==g.state&&bf.enqueueReplaceState(g,g.state,null),ro(i,u,g,h),ao(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(n===null){g=i.stateNode;var k=i.memoizedProps,D=sa(o,k);g.props=D;var Z=g.context,Y=o.contextType;w=Ba,typeof Y=="object"&&Y!==null&&(w=Yt(Y));var W=o.getDerivedStateFromProps;Y=typeof W=="function"||typeof g.getSnapshotBeforeUpdate=="function",k=i.pendingProps!==k,Y||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(k||Z!==w)&&My(i,g,u,w),si=!1;var F=i.memoizedState;g.state=F,ro(i,u,g,h),ao(),Z=i.memoizedState,k||F!==Z||si?(typeof W=="function"&&(vf(i,o,W,u),Z=i.memoizedState),(D=si||Ly(i,o,D,u,F,Z,w))?(Y||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=Z),g.props=u,g.state=Z,g.context=w,u=D):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{g=i.stateNode,Vd(n,i),w=i.memoizedProps,Y=sa(o,w),g.props=Y,W=i.pendingProps,F=g.context,Z=o.contextType,D=Ba,typeof Z=="object"&&Z!==null&&(D=Yt(Z)),k=o.getDerivedStateFromProps,(Z=typeof k=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(w!==W||F!==D)&&My(i,g,u,D),si=!1,F=i.memoizedState,g.state=F,ro(i,u,g,h),ao();var K=i.memoizedState;w!==W||F!==K||si||n!==null&&n.dependencies!==null&&Dl(n.dependencies)?(typeof k=="function"&&(vf(i,o,k,u),K=i.memoizedState),(Y=si||Ly(i,o,Y,u,F,K,D)||n!==null&&n.dependencies!==null&&Dl(n.dependencies))?(Z||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,K,D),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,K,D)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||w===n.memoizedProps&&F===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&F===n.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=K),g.props=u,g.state=K,g.context=D,u=Y):(typeof g.componentDidUpdate!="function"||w===n.memoizedProps&&F===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&F===n.memoizedState||(i.flags|=1024),u=!1)}return g=u,Wl(n,i),u=(i.flags&128)!==0,g||u?(g=i.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&u?(i.child=ta(i,n.child,null,h),i.child=ta(i,null,o,h)):Jt(n,i,o,h),i.memoizedState=g.state,n=i.child):n=Os(n,i,h),n}function Jy(n,i,o,u){return Qi(),i.flags|=256,Jt(n,i,o,u),i.child}var jf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nf(n){return{baseLanes:n,cachePool:$g()}}function Cf(n,i,o){return n=n!==null?n.childLanes&~o:0,i&&(n|=En),n}function Xy(n,i,o){var u=i.pendingProps,h=!1,g=(i.flags&128)!==0,w;if((w=g)||(w=n!==null&&n.memoizedState===null?!1:(Rt.current&2)!==0),w&&(h=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,n===null){if(Ze){if(h?ri(i):oi(),(n=ft)?(n=rv(n,Pn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:Ws!==null?{id:fs,overflow:hs}:null,retryLane:536870912,hydrationErrors:null},o=Og(n),o.return=i,i.child=o,Qt=i,ft=null)):n=null,n===null)throw ti(i);return oh(n)?i.lanes=32:i.lanes=536870912,null}var k=u.children;return u=u.fallback,h?(oi(),h=i.mode,k=ec({mode:"hidden",children:k},h),u=Vi(u,h,o,null),k.return=i,u.return=i,k.sibling=u,i.child=k,u=i.child,u.memoizedState=Nf(o),u.childLanes=Cf(n,w,o),i.memoizedState=jf,fo(null,u)):(ri(i),_f(i,k))}var D=n.memoizedState;if(D!==null&&(k=D.dehydrated,k!==null)){if(g)i.flags&256?(ri(i),i.flags&=-257,i=kf(n,i,o)):i.memoizedState!==null?(oi(),i.child=n.child,i.flags|=128,i=null):(oi(),k=u.fallback,h=i.mode,u=ec({mode:"visible",children:u.children},h),k=Vi(k,h,o,null),k.flags|=2,u.return=i,k.return=i,u.sibling=k,i.child=u,ta(i,n.child,null,o),u=i.child,u.memoizedState=Nf(o),u.childLanes=Cf(n,w,o),i.memoizedState=jf,i=fo(null,u));else if(ri(i),oh(k)){if(w=k.nextSibling&&k.nextSibling.dataset,w)var Z=w.dgst;w=Z,u=Error(a(419)),u.stack="",u.digest=w,Wr({value:u,source:null,stack:null}),i=kf(n,i,o)}else if(It||Fa(n,i,o,!1),w=(o&n.childLanes)!==0,It||w){if(w=rt,w!==null&&(u=Br(w,o),u!==0&&u!==D.retryLane))throw D.retryLane=u,Ki(n,u),vn(w,n,u),Sf;rh(k)||cc(),i=kf(n,i,o)}else rh(k)?(i.flags|=192,i.child=n.child,i=null):(n=D.treeContext,ft=$n(k.nextSibling),Qt=i,Ze=!0,ei=null,Pn=!1,n!==null&&Dg(i,n),i=_f(i,u.children),i.flags|=4096);return i}return h?(oi(),k=u.fallback,h=i.mode,D=n.child,Z=D.sibling,u=Cs(D,{mode:"hidden",children:u.children}),u.subtreeFlags=D.subtreeFlags&65011712,Z!==null?k=Cs(Z,k):(k=Vi(k,h,o,null),k.flags|=2),k.return=i,u.return=i,u.sibling=k,i.child=u,fo(null,u),u=i.child,k=n.child.memoizedState,k===null?k=Nf(o):(h=k.cachePool,h!==null?(D=Ut._currentValue,h=h.parent!==D?{parent:D,pool:D}:h):h=$g(),k={baseLanes:k.baseLanes|o,cachePool:h}),u.memoizedState=k,u.childLanes=Cf(n,w,o),i.memoizedState=jf,fo(n.child,u)):(ri(i),o=n.child,n=o.sibling,o=Cs(o,{mode:"visible",children:u.children}),o.return=i,o.sibling=null,n!==null&&(w=i.deletions,w===null?(i.deletions=[n],i.flags|=16):w.push(n)),i.child=o,i.memoizedState=null,o)}function _f(n,i){return i=ec({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function ec(n,i){return n=Cn(22,n,null,i),n.lanes=0,n}function kf(n,i,o){return ta(i,n.child,null,o),n=_f(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function Wy(n,i,o){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i),Bd(n.return,i,o)}function zf(n,i,o,u,h,g){var w=n.memoizedState;w===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:h,treeForkCount:g}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=o,w.tailMode=h,w.treeForkCount=g)}function e0(n,i,o){var u=i.pendingProps,h=u.revealOrder,g=u.tail;u=u.children;var w=Rt.current,k=(w&2)!==0;if(k?(w=w&1|2,i.flags|=128):w&=1,se(Rt,w),Jt(n,i,u,o),u=Ze?Xr:0,!k&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Wy(n,o,i);else if(n.tag===19)Wy(n,o,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(o=i.child,h=null;o!==null;)n=o.alternate,n!==null&&ql(n)===null&&(h=o),o=o.sibling;o=h,o===null?(h=i.child,i.child=null):(h=o.sibling,o.sibling=null),zf(i,!1,h,o,g,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,h=i.child,i.child=null;h!==null;){if(n=h.alternate,n!==null&&ql(n)===null){i.child=h;break}n=h.sibling,h.sibling=o,o=h,h=n}zf(i,!0,o,null,g,u);break;case"together":zf(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Os(n,i,o){if(n!==null&&(i.dependencies=n.dependencies),ui|=i.lanes,(o&i.childLanes)===0)if(n!==null){if(Fa(n,i,o,!1),(o&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,o=Cs(n,n.pendingProps),i.child=o,o.return=i;n.sibling!==null;)n=n.sibling,o=o.sibling=Cs(n,n.pendingProps),o.return=i;o.sibling=null}return i.child}function Ef(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Dl(n)))}function oC(n,i,o){switch(i.tag){case 3:Fe(i,i.stateNode.containerInfo),ni(i,Ut,n.memoizedState.cache),Qi();break;case 27:case 5:Je(i);break;case 4:Fe(i,i.stateNode.containerInfo);break;case 10:ni(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Wd(i),null;break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(ri(i),i.flags|=128,null):(o&i.child.childLanes)!==0?Xy(n,i,o):(ri(i),n=Os(n,i,o),n!==null?n.sibling:null);ri(i);break;case 19:var h=(n.flags&128)!==0;if(u=(o&i.childLanes)!==0,u||(Fa(n,i,o,!1),u=(o&i.childLanes)!==0),h){if(u)return e0(n,i,o);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),se(Rt,Rt.current),u)break;return null;case 22:return i.lanes=0,Gy(n,i,o,i.pendingProps);case 24:ni(i,Ut,n.memoizedState.cache)}return Os(n,i,o)}function t0(n,i,o){if(n!==null)if(n.memoizedProps!==i.pendingProps)It=!0;else{if(!Ef(n,o)&&(i.flags&128)===0)return It=!1,oC(n,i,o);It=(n.flags&131072)!==0}else It=!1,Ze&&(i.flags&1048576)!==0&&Tg(i,Xr,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(n=Wi(i.elementType),i.type=n,typeof n=="function")Td(n)?(u=sa(n,u),i.tag=1,i=Yy(null,i,n,u,o)):(i.tag=0,i=wf(null,i,n,u,o));else{if(n!=null){var h=n.$$typeof;if(h===z){i.tag=11,i=Hy(null,i,n,u,o);break e}else if(h===M){i.tag=14,i=Zy(null,i,n,u,o);break e}}throw i=ze(n)||n,Error(a(306,i,""))}}return i;case 0:return wf(n,i,i.type,i.pendingProps,o);case 1:return u=i.type,h=sa(u,i.pendingProps),Yy(n,i,u,h,o);case 3:e:{if(Fe(i,i.stateNode.containerInfo),n===null)throw Error(a(387));u=i.pendingProps;var g=i.memoizedState;h=g.element,Vd(n,i),ro(i,u,null,o);var w=i.memoizedState;if(u=w.cache,ni(i,Ut,u),u!==g.cache&&qd(i,[Ut],o,!0),ao(),u=w.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=Jy(n,i,u,o);break e}else if(u!==h){h=Ln(Error(a(424)),i),Wr(h),i=Jy(n,i,u,o);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,ft=$n(n.firstChild),Qt=i,Ze=!0,ei=null,Pn=!0,o=Gg(i,null,u,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Qi(),u===h){i=Os(n,i,o);break e}Jt(n,i,u,o)}i=i.child}return i;case 26:return Wl(n,i),n===null?(o=fv(i.type,null,i.pendingProps,null))?i.memoizedState=o:Ze||(o=i.type,n=i.pendingProps,u=gc(he.current).createElement(o),u[Et]=i,u[jt]=n,Xt(u,o,n),Mt(u),i.stateNode=u):i.memoizedState=fv(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Je(i),n===null&&Ze&&(u=i.stateNode=cv(i.type,i.pendingProps,he.current),Qt=i,Pn=!0,h=ft,pi(i.type)?(lh=h,ft=$n(u.firstChild)):ft=h),Jt(n,i,i.pendingProps.children,o),Wl(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Ze&&((h=u=ft)&&(u=UC(u,i.type,i.pendingProps,Pn),u!==null?(i.stateNode=u,Qt=i,ft=$n(u.firstChild),Pn=!1,h=!0):h=!1),h||ti(i)),Je(i),h=i.type,g=i.pendingProps,w=n!==null?n.memoizedProps:null,u=g.children,sh(h,g)?u=null:w!==null&&sh(h,w)&&(i.flags|=32),i.memoizedState!==null&&(h=tf(n,i,XN,null,null,o),ko._currentValue=h),Wl(n,i),Jt(n,i,u,o),i.child;case 6:return n===null&&Ze&&((n=o=ft)&&(o=PC(o,i.pendingProps,Pn),o!==null?(i.stateNode=o,Qt=i,ft=null,n=!0):n=!1),n||ti(i)),null;case 13:return Xy(n,i,o);case 4:return Fe(i,i.stateNode.containerInfo),u=i.pendingProps,n===null?i.child=ta(i,null,u,o):Jt(n,i,u,o),i.child;case 11:return Hy(n,i,i.type,i.pendingProps,o);case 7:return Jt(n,i,i.pendingProps,o),i.child;case 8:return Jt(n,i,i.pendingProps.children,o),i.child;case 12:return Jt(n,i,i.pendingProps.children,o),i.child;case 10:return u=i.pendingProps,ni(i,i.type,u.value),Jt(n,i,u.children,o),i.child;case 9:return h=i.type._context,u=i.pendingProps.children,Ji(i),h=Yt(h),u=u(h),i.flags|=1,Jt(n,i,u,o),i.child;case 14:return Zy(n,i,i.type,i.pendingProps,o);case 15:return Fy(n,i,i.type,i.pendingProps,o);case 19:return e0(n,i,o);case 31:return rC(n,i,o);case 22:return Gy(n,i,o,i.pendingProps);case 24:return Ji(i),u=Yt(Ut),n===null?(h=Fd(),h===null&&(h=rt,g=Hd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=o),h=g),i.memoizedState={parent:u,cache:h},Kd(i),ni(i,Ut,h)):((n.lanes&o)!==0&&(Vd(n,i),ro(i,null,null,o),ao()),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),ni(i,Ut,u)):(u=g.cache,ni(i,Ut,u),u!==h.cache&&qd(i,[Ut],o,!0))),Jt(n,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function As(n){n.flags|=4}function Rf(n,i,o,u,h){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if(z0())n.flags|=8192;else throw ea=Pl,Gd}else n.flags&=-16777217}function n0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!yv(i))if(z0())n.flags|=8192;else throw ea=Pl,Gd}function tc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?pl():536870912,n.lanes|=i,sr|=i)}function ho(n,i){if(!Ze)switch(n.tailMode){case"hidden":i=n.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function ht(n){var i=n.alternate!==null&&n.alternate.child===n.child,o=0,u=0;if(i)for(var h=n.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=u,n.childLanes=o,i}function lC(n,i,o){var u=i.pendingProps;switch(Ud(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(i),null;case 1:return ht(i),null;case 3:return o=i.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),zs(Ut),ge(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(Za(i)?As(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Id())),ht(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?(As(i),g!==null?(ht(i),n0(i,g)):(ht(i),Rf(i,h,null,u,o))):g?g!==n.memoizedState?(As(i),ht(i),n0(i,g)):(ht(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&As(i),ht(i),Rf(i,h,n,u,o)),null;case 27:if(mt(i),o=he.current,h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&As(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return ht(i),null}n=re.current,Za(i)?Lg(i):(n=cv(h,u,o),i.stateNode=n,As(i))}return ht(i),null;case 5:if(mt(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&As(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return ht(i),null}if(g=re.current,Za(i))Lg(i);else{var w=gc(he.current);switch(g){case 1:g=w.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=w.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=w.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?w.createElement(h,{is:u.is}):w.createElement(h)}}g[Et]=i,g[jt]=u;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)g.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=g;e:switch(Xt(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&&As(i)}}return ht(i),Rf(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,o),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==u&&As(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(a(166));if(n=he.current,Za(i)){if(n=i.stateNode,o=i.memoizedProps,u=null,h=Qt,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}n[Et]=i,n=!!(n.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||X0(n.nodeValue,o)),n||ti(i,!0)}else n=gc(n).createTextNode(u),n[Et]=i,i.stateNode=n}return ht(i),null;case 31:if(o=i.memoizedState,n===null||n.memoizedState!==null){if(u=Za(i),o!==null){if(n===null){if(!u)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[Et]=i}else Qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ht(i),n=!1}else o=Id(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return i.flags&256?(kn(i),i):(kn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return ht(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 Qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ht(i),h=!1}else h=Id(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(kn(i),i):(kn(i),null)}return kn(i),(i.flags&128)!==0?(i.lanes=o,i):(o=u!==null,n=n!==null&&n.memoizedState!==null,o&&(u=i.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==h&&(u.flags|=2048)),o!==n&&o&&(i.child.flags|=8192),tc(i,i.updateQueue),ht(i),null);case 4:return ge(),n===null&&Xf(i.stateNode.containerInfo),ht(i),null;case 10:return zs(i.type),ht(i),null;case 19:if(G(Rt),u=i.memoizedState,u===null)return ht(i),null;if(h=(i.flags&128)!==0,g=u.rendering,g===null)if(h)ho(u,!1);else{if(Ct!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=ql(n),g!==null){for(i.flags|=128,ho(u,!1),n=g.updateQueue,i.updateQueue=n,tc(i,n),i.subtreeFlags=0,n=o,o=i.child;o!==null;)Rg(o,n),o=o.sibling;return se(Rt,Rt.current&1|2),Ze&&_s(i,u.treeForkCount),i.child}n=n.sibling}u.tail!==null&&Pe()>rc&&(i.flags|=128,h=!0,ho(u,!1),i.lanes=4194304)}else{if(!h)if(n=ql(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,tc(i,n),ho(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!Ze)return ht(i),null}else 2*Pe()-u.renderingStartTime>rc&&o!==536870912&&(i.flags|=128,h=!0,ho(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=Pe(),n.sibling=null,o=Rt.current,se(Rt,h?o&1|2:o&1),Ze&&_s(i,u.treeForkCount),n):(ht(i),null);case 22:case 23:return kn(i),Xd(),u=i.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(o&536870912)!==0&&(i.flags&128)===0&&(ht(i),i.subtreeFlags&6&&(i.flags|=8192)):ht(i),o=i.updateQueue,o!==null&&tc(i,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==o&&(i.flags|=2048),n!==null&&G(Xi),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),zs(Ut),ht(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function cC(n,i){switch(Ud(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return zs(Ut),ge(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return mt(i),null;case 31:if(i.memoizedState!==null){if(kn(i),i.alternate===null)throw Error(a(340));Qi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(kn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Qi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return G(Rt),null;case 4:return ge(),null;case 10:return zs(i.type),null;case 22:case 23:return kn(i),Xd(),n!==null&&G(Xi),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return zs(Ut),null;case 25:return null;default:return null}}function s0(n,i){switch(Ud(i),i.tag){case 3:zs(Ut),ge();break;case 26:case 27:case 5:mt(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&kn(i);break;case 13:kn(i);break;case 19:G(Rt);break;case 10:zs(i.type);break;case 22:case 23:kn(i),Xd(),n!==null&&G(Xi);break;case 24:zs(Ut)}}function mo(n,i){try{var o=i.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&n)===n){u=void 0;var g=o.create,w=o.inst;u=g(),w.destroy=u}o=o.next}while(o!==h)}}catch(k){We(i,i.return,k)}}function li(n,i,o){try{var u=i.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var g=h.next;u=g;do{if((u.tag&n)===n){var w=u.inst,k=w.destroy;if(k!==void 0){w.destroy=void 0,h=i;var D=o,Z=k;try{Z()}catch(Y){We(h,D,Y)}}}u=u.next}while(u!==g)}}catch(Y){We(i,i.return,Y)}}function i0(n){var i=n.updateQueue;if(i!==null){var o=n.stateNode;try{Vg(i,o)}catch(u){We(n,n.return,u)}}}function a0(n,i,o){o.props=sa(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(u){We(n,i,u)}}function po(n,i){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof o=="function"?n.refCleanup=o(u):o.current=u}}catch(h){We(n,i,h)}}function ms(n,i){var o=n.ref,u=n.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(h){We(n,i,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){We(n,i,h)}else o.current=null}function r0(n){var i=n.type,o=n.memoizedProps,u=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(h){We(n,n.return,h)}}function Of(n,i,o){try{var u=n.stateNode;OC(u,n.type,o,i),u[jt]=i}catch(h){We(n,n.return,h)}}function o0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&pi(n.type)||n.tag===4}function Af(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||o0(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&&pi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Tf(n,i,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,i):(i=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.appendChild(n),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=js));else if(u!==4&&(u===27&&pi(n.type)&&(o=n.stateNode,i=null),n=n.child,n!==null))for(Tf(n,i,o),n=n.sibling;n!==null;)Tf(n,i,o),n=n.sibling}function nc(n,i,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?o.insertBefore(n,i):o.appendChild(n);else if(u!==4&&(u===27&&pi(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(nc(n,i,o),n=n.sibling;n!==null;)nc(n,i,o),n=n.sibling}function l0(n){var i=n.stateNode,o=n.memoizedProps;try{for(var u=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);Xt(i,u,o),i[Et]=n,i[jt]=o}catch(g){We(n,n.return,g)}}var Ts=!1,$t=!1,Df=!1,c0=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function uC(n,i){if(n=n.containerInfo,th=jc,n=Sg(n),_d(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var h=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var w=0,k=-1,D=-1,Z=0,Y=0,W=n,F=null;t:for(;;){for(var K;W!==o||h!==0&&W.nodeType!==3||(k=w+h),W!==g||u!==0&&W.nodeType!==3||(D=w+u),W.nodeType===3&&(w+=W.nodeValue.length),(K=W.firstChild)!==null;)F=W,W=K;for(;;){if(W===n)break t;if(F===o&&++Z===h&&(k=w),F===g&&++Y===u&&(D=w),(K=W.nextSibling)!==null)break;W=F,F=W.parentNode}W=K}o=k===-1||D===-1?null:{start:k,end:D}}else o=null}o=o||{start:0,end:0}}else o=null;for(nh={focusedElem:n,selectionRange:o},jc=!1,Gt=i;Gt!==null;)if(i=Gt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Gt=n;else for(;Gt!==null;){switch(i=Gt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(o=0;o<n.length;o++)h=n[o],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,o=i,h=g.memoizedProps,g=g.memoizedState,u=o.stateNode;try{var ye=sa(o.type,h);n=u.getSnapshotBeforeUpdate(ye,g),u.__reactInternalSnapshotBeforeUpdate=n}catch(_e){We(o,o.return,_e)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,o=n.nodeType,o===9)ah(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ah(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Gt=n;break}Gt=i.return}}function u0(n,i,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:Ls(n,o),u&4&&mo(5,o);break;case 1:if(Ls(n,o),u&4)if(n=o.stateNode,i===null)try{n.componentDidMount()}catch(w){We(o,o.return,w)}else{var h=sa(o.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(w){We(o,o.return,w)}}u&64&&i0(o),u&512&&po(o,o.return);break;case 3:if(Ls(n,o),u&64&&(n=o.updateQueue,n!==null)){if(i=null,o.child!==null)switch(o.child.tag){case 27:case 5:i=o.child.stateNode;break;case 1:i=o.child.stateNode}try{Vg(n,i)}catch(w){We(o,o.return,w)}}break;case 27:i===null&&u&4&&l0(o);case 26:case 5:Ls(n,o),i===null&&u&4&&r0(o),u&512&&po(o,o.return);break;case 12:Ls(n,o);break;case 31:Ls(n,o),u&4&&h0(n,o);break;case 13:Ls(n,o),u&4&&m0(n,o),u&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=bC.bind(null,o),IC(n,o))));break;case 22:if(u=o.memoizedState!==null||Ts,!u){i=i!==null&&i.memoizedState!==null||$t,h=Ts;var g=$t;Ts=u,($t=i)&&!g?Ms(n,o,(o.subtreeFlags&8772)!==0):Ls(n,o),Ts=h,$t=g}break;case 30:break;default:Ls(n,o)}}function d0(n){var i=n.alternate;i!==null&&(n.alternate=null,d0(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Oa(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 pt=null,mn=!1;function Ds(n,i,o){for(o=o.child;o!==null;)f0(n,i,o),o=o.sibling}function f0(n,i,o){if(Ce&&typeof Ce.onCommitFiberUnmount=="function")try{Ce.onCommitFiberUnmount(os,o)}catch{}switch(o.tag){case 26:$t||ms(o,i),Ds(n,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:$t||ms(o,i);var u=pt,h=mn;pi(o.type)&&(pt=o.stateNode,mn=!1),Ds(n,i,o),No(o.stateNode),pt=u,mn=h;break;case 5:$t||ms(o,i);case 6:if(u=pt,h=mn,pt=null,Ds(n,i,o),pt=u,mn=h,pt!==null)if(mn)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(o.stateNode)}catch(g){We(o,i,g)}else try{pt.removeChild(o.stateNode)}catch(g){We(o,i,g)}break;case 18:pt!==null&&(mn?(n=pt,iv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),dr(n)):iv(pt,o.stateNode));break;case 4:u=pt,h=mn,pt=o.stateNode.containerInfo,mn=!0,Ds(n,i,o),pt=u,mn=h;break;case 0:case 11:case 14:case 15:li(2,o,i),$t||li(4,o,i),Ds(n,i,o);break;case 1:$t||(ms(o,i),u=o.stateNode,typeof u.componentWillUnmount=="function"&&a0(o,i,u)),Ds(n,i,o);break;case 21:Ds(n,i,o);break;case 22:$t=(u=$t)||o.memoizedState!==null,Ds(n,i,o),$t=u;break;default:Ds(n,i,o)}}function h0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{dr(n)}catch(o){We(i,i.return,o)}}}function m0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{dr(n)}catch(o){We(i,i.return,o)}}function dC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new c0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new c0),i;default:throw Error(a(435,n.tag))}}function sc(n,i){var o=dC(n);i.forEach(function(u){if(!o.has(u)){o.add(u);var h=xC.bind(null,n,u);u.then(h,h)}})}function pn(n,i){var o=i.deletions;if(o!==null)for(var u=0;u<o.length;u++){var h=o[u],g=n,w=i,k=w;e:for(;k!==null;){switch(k.tag){case 27:if(pi(k.type)){pt=k.stateNode,mn=!1;break e}break;case 5:pt=k.stateNode,mn=!1;break e;case 3:case 4:pt=k.stateNode.containerInfo,mn=!0;break e}k=k.return}if(pt===null)throw Error(a(160));f0(g,w,h),pt=null,mn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)p0(i,n),i=i.sibling}var Xn=null;function p0(n,i){var o=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:pn(i,n),gn(n),u&4&&(li(3,n,n.return),mo(3,n),li(5,n,n.return));break;case 1:pn(i,n),gn(n),u&512&&($t||o===null||ms(o,o.return)),u&64&&Ts&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var h=Xn;if(pn(i,n),gn(n),u&512&&($t||o===null||ms(o,o.return)),u&4){var g=o!==null?o.memoizedState:null;if(u=n.memoizedState,o===null)if(u===null)if(n.stateNode===null){e:{u=n.type,o=n.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":g=h.getElementsByTagName("title")[0],(!g||g[us]||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"))),Xt(g,u,o),g[Et]=n,Mt(g),u=g;break e;case"link":var w=pv("link","href",h).get(u+(o.href||""));if(w){for(var k=0;k<w.length;k++)if(g=w[k],g.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&g.getAttribute("rel")===(o.rel==null?null:o.rel)&&g.getAttribute("title")===(o.title==null?null:o.title)&&g.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){w.splice(k,1);break t}}g=h.createElement(u),Xt(g,u,o),h.head.appendChild(g);break;case"meta":if(w=pv("meta","content",h).get(u+(o.content||""))){for(k=0;k<w.length;k++)if(g=w[k],g.getAttribute("content")===(o.content==null?null:""+o.content)&&g.getAttribute("name")===(o.name==null?null:o.name)&&g.getAttribute("property")===(o.property==null?null:o.property)&&g.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&g.getAttribute("charset")===(o.charSet==null?null:o.charSet)){w.splice(k,1);break t}}g=h.createElement(u),Xt(g,u,o),h.head.appendChild(g);break;default:throw Error(a(468,u))}g[Et]=n,Mt(g),u=g}n.stateNode=u}else gv(h,n.type,n.stateNode);else n.stateNode=mv(h,u,n.memoizedProps);else g!==u?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,u===null?gv(h,n.type,n.stateNode):mv(h,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Of(n,n.memoizedProps,o.memoizedProps)}break;case 27:pn(i,n),gn(n),u&512&&($t||o===null||ms(o,o.return)),o!==null&&u&4&&Of(n,n.memoizedProps,o.memoizedProps);break;case 5:if(pn(i,n),gn(n),u&512&&($t||o===null||ms(o,o.return)),n.flags&32){h=n.stateNode;try{Da(h,"")}catch(ye){We(n,n.return,ye)}}u&4&&n.stateNode!=null&&(h=n.memoizedProps,Of(n,h,o!==null?o.memoizedProps:h)),u&1024&&(Df=!0);break;case 6:if(pn(i,n),gn(n),u&4){if(n.stateNode===null)throw Error(a(162));u=n.memoizedProps,o=n.stateNode;try{o.nodeValue=u}catch(ye){We(n,n.return,ye)}}break;case 3:if(bc=null,h=Xn,Xn=yc(i.containerInfo),pn(i,n),Xn=h,gn(n),u&4&&o!==null&&o.memoizedState.isDehydrated)try{dr(i.containerInfo)}catch(ye){We(n,n.return,ye)}Df&&(Df=!1,g0(n));break;case 4:u=Xn,Xn=yc(n.stateNode.containerInfo),pn(i,n),gn(n),Xn=u;break;case 12:pn(i,n),gn(n);break;case 31:pn(i,n),gn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,sc(n,u)));break;case 13:pn(i,n),gn(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(ac=Pe()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,sc(n,u)));break;case 22:h=n.memoizedState!==null;var D=o!==null&&o.memoizedState!==null,Z=Ts,Y=$t;if(Ts=Z||h,$t=Y||D,pn(i,n),$t=Y,Ts=Z,gn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(o===null||D||Ts||$t||ia(n)),o=null,i=n;;){if(i.tag===5||i.tag===26){if(o===null){D=o=i;try{if(g=D.stateNode,h)w=g.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{k=D.stateNode;var W=D.memoizedProps.style,F=W!=null&&W.hasOwnProperty("display")?W.display:null;k.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ye){We(D,D.return,ye)}}}else if(i.tag===6){if(o===null){D=i;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(ye){We(D,D.return,ye)}}}else if(i.tag===18){if(o===null){D=i;try{var K=D.stateNode;h?av(K,!0):av(D.stateNode,!1)}catch(ye){We(D,D.return,ye)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;o===i&&(o=null),i=i.return}o===i&&(o=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=n.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,sc(n,o))));break;case 19:pn(i,n),gn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,sc(n,u)));break;case 30:break;case 21:break;default:pn(i,n),gn(n)}}function gn(n){var i=n.flags;if(i&2){try{for(var o,u=n.return;u!==null;){if(o0(u)){o=u;break}u=u.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var h=o.stateNode,g=Af(n);nc(n,g,h);break;case 5:var w=o.stateNode;o.flags&32&&(Da(w,""),o.flags&=-33);var k=Af(n);nc(n,k,w);break;case 3:case 4:var D=o.stateNode.containerInfo,Z=Af(n);Tf(n,Z,D);break;default:throw Error(a(161))}}catch(Y){We(n,n.return,Y)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function g0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;g0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Ls(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)u0(n,i.alternate,i),i=i.sibling}function ia(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:li(4,i,i.return),ia(i);break;case 1:ms(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&a0(i,i.return,o),ia(i);break;case 27:No(i.stateNode);case 26:case 5:ms(i,i.return),ia(i);break;case 22:i.memoizedState===null&&ia(i);break;case 30:ia(i);break;default:ia(i)}n=n.sibling}}function Ms(n,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,h=n,g=i,w=g.flags;switch(g.tag){case 0:case 11:case 15:Ms(h,g,o),mo(4,g);break;case 1:if(Ms(h,g,o),u=g,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(Z){We(u,u.return,Z)}if(u=g,h=u.updateQueue,h!==null){var k=u.stateNode;try{var D=h.shared.hiddenCallbacks;if(D!==null)for(h.shared.hiddenCallbacks=null,h=0;h<D.length;h++)Kg(D[h],k)}catch(Z){We(u,u.return,Z)}}o&&w&64&&i0(g),po(g,g.return);break;case 27:l0(g);case 26:case 5:Ms(h,g,o),o&&u===null&&w&4&&r0(g),po(g,g.return);break;case 12:Ms(h,g,o);break;case 31:Ms(h,g,o),o&&w&4&&h0(h,g);break;case 13:Ms(h,g,o),o&&w&4&&m0(h,g);break;case 22:g.memoizedState===null&&Ms(h,g,o),po(g,g.return);break;case 30:break;default:Ms(h,g,o)}i=i.sibling}}function Lf(n,i){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&eo(o))}function Mf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&eo(n))}function Wn(n,i,o,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)y0(n,i,o,u),i=i.sibling}function y0(n,i,o,u){var h=i.flags;switch(i.tag){case 0:case 11:case 15:Wn(n,i,o,u),h&2048&&mo(9,i);break;case 1:Wn(n,i,o,u);break;case 3:Wn(n,i,o,u),h&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&eo(n)));break;case 12:if(h&2048){Wn(n,i,o,u),n=i.stateNode;try{var g=i.memoizedProps,w=g.id,k=g.onPostCommit;typeof k=="function"&&k(w,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(D){We(i,i.return,D)}}else Wn(n,i,o,u);break;case 31:Wn(n,i,o,u);break;case 13:Wn(n,i,o,u);break;case 23:break;case 22:g=i.stateNode,w=i.alternate,i.memoizedState!==null?g._visibility&2?Wn(n,i,o,u):go(n,i):g._visibility&2?Wn(n,i,o,u):(g._visibility|=2,er(n,i,o,u,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Lf(w,i);break;case 24:Wn(n,i,o,u),h&2048&&Mf(i.alternate,i);break;default:Wn(n,i,o,u)}}function er(n,i,o,u,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,w=i,k=o,D=u,Z=w.flags;switch(w.tag){case 0:case 11:case 15:er(g,w,k,D,h),mo(8,w);break;case 23:break;case 22:var Y=w.stateNode;w.memoizedState!==null?Y._visibility&2?er(g,w,k,D,h):go(g,w):(Y._visibility|=2,er(g,w,k,D,h)),h&&Z&2048&&Lf(w.alternate,w);break;case 24:er(g,w,k,D,h),h&&Z&2048&&Mf(w.alternate,w);break;default:er(g,w,k,D,h)}i=i.sibling}}function go(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var o=n,u=i,h=u.flags;switch(u.tag){case 22:go(o,u),h&2048&&Lf(u.alternate,u);break;case 24:go(o,u),h&2048&&Mf(u.alternate,u);break;default:go(o,u)}i=i.sibling}}var yo=8192;function tr(n,i,o){if(n.subtreeFlags&yo)for(n=n.child;n!==null;)v0(n,i,o),n=n.sibling}function v0(n,i,o){switch(n.tag){case 26:tr(n,i,o),n.flags&yo&&n.memoizedState!==null&&JC(o,Xn,n.memoizedState,n.memoizedProps);break;case 5:tr(n,i,o);break;case 3:case 4:var u=Xn;Xn=yc(n.stateNode.containerInfo),tr(n,i,o),Xn=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=yo,yo=16777216,tr(n,i,o),yo=u):tr(n,i,o));break;default:tr(n,i,o)}}function b0(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 vo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var u=i[o];Gt=u,S0(u,n)}b0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)x0(n),n=n.sibling}function x0(n){switch(n.tag){case 0:case 11:case 15:vo(n),n.flags&2048&&li(9,n,n.return);break;case 3:vo(n);break;case 12:vo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,ic(n)):vo(n);break;default:vo(n)}}function ic(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var u=i[o];Gt=u,S0(u,n)}b0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:li(8,i,i.return),ic(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,ic(i));break;default:ic(i)}n=n.sibling}}function S0(n,i){for(;Gt!==null;){var o=Gt;switch(o.tag){case 0:case 11:case 15:li(8,o,i);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:eo(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,Gt=u;else e:for(o=n;Gt!==null;){u=Gt;var h=u.sibling,g=u.return;if(d0(u),u===o){Gt=null;break e}if(h!==null){h.return=g,Gt=h;break e}Gt=g}}}var fC={getCacheForType:function(n){var i=Yt(Ut),o=i.data.get(n);return o===void 0&&(o=n(),i.data.set(n,o)),o},cacheSignal:function(){return Yt(Ut).controller.signal}},hC=typeof WeakMap=="function"?WeakMap:Map,Qe=0,rt=null,Le=null,Be=0,Xe=0,zn=null,ci=!1,nr=!1,Uf=!1,Us=0,Ct=0,ui=0,aa=0,Pf=0,En=0,sr=0,bo=null,yn=null,If=!1,ac=0,w0=0,rc=1/0,oc=null,di=null,Zt=0,fi=null,ir=null,Ps=0,$f=0,Bf=null,j0=null,xo=0,qf=null;function Rn(){return(Qe&2)!==0&&Be!==0?Be&-Be:q.T!==null?Vf():tt()}function N0(){if(En===0)if((Be&536870912)===0||Ze){var n=Ss;Ss<<=1,(Ss&3932160)===0&&(Ss=262144),En=n}else En=536870912;return n=_n.current,n!==null&&(n.flags|=32),En}function vn(n,i,o){(n===rt&&(Xe===2||Xe===9)||n.cancelPendingCommit!==null)&&(ar(n,0),hi(n,Be,En,!1)),Hi(n,o),((Qe&2)===0||n!==rt)&&(n===rt&&((Qe&2)===0&&(aa|=o),Ct===4&&hi(n,Be,En,!1)),ps(n))}function C0(n,i,o){if((Qe&6)!==0)throw Error(a(327));var u=!o&&(i&127)===0&&(i&n.expiredLanes)===0||cs(n,i),h=u?gC(n,i):Zf(n,i,!0),g=u;do{if(h===0){nr&&!u&&hi(n,i,0,!1);break}else{if(o=n.current.alternate,g&&!mC(o)){h=Zf(n,i,!1),g=!1;continue}if(h===2){if(g=i,n.errorRecoveryDisabledLanes&g)var w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var k=n;h=bo;var D=k.current.memoizedState.isDehydrated;if(D&&(ar(k,w).flags|=256),w=Zf(k,w,!1),w!==2){if(Uf&&!D){k.errorRecoveryDisabledLanes|=g,aa|=g,h=4;break e}g=yn,yn=h,g!==null&&(yn===null?yn=g:yn.push.apply(yn,g))}h=w}if(g=!1,h!==2)continue}}if(h===1){ar(n,0),hi(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:hi(u,i,En,!ci);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=ac+300-Pe(),10<h)){if(hi(u,i,En,!ci),Ea(u,0,!0)!==0)break e;Ps=i,u.timeoutHandle=nv(_0.bind(null,u,o,yn,oc,If,i,En,aa,sr,ci,g,"Throttled",-0,0),h);break e}_0(u,o,yn,oc,If,i,En,aa,sr,ci,g,null,-0,0)}}break}while(!0);ps(n)}function _0(n,i,o,u,h,g,w,k,D,Z,Y,W,F,K){if(n.timeoutHandle=-1,W=i.subtreeFlags,W&8192||(W&16785408)===16785408){W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:js},v0(i,g,W);var ye=(g&62914560)===g?ac-Pe():(g&4194048)===g?w0-Pe():0;if(ye=XC(W,ye),ye!==null){Ps=g,n.cancelPendingCommit=ye(D0.bind(null,n,i,g,o,u,h,w,k,D,Y,W,null,F,K)),hi(n,g,w,!Z);return}}D0(n,i,g,o,u,h,w,k,D)}function mC(n){for(var i=n;;){var o=i.tag;if((o===0||o===11||o===15)&&i.flags&16384&&(o=i.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var h=o[u],g=h.getSnapshot;h=h.value;try{if(!Nn(g(),h))return!1}catch{return!1}}if(o=i.child,i.subtreeFlags&16384&&o!==null)o.return=i,i=o;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function hi(n,i,o,u){i&=~Pf,i&=~aa,n.suspendedLanes|=i,n.pingedLanes&=~i,u&&(n.warmLanes|=i),u=n.expirationTimes;for(var h=i;0<h;){var g=31-te(h),w=1<<g;u[g]=-1,h&=~w}o!==0&&gl(n,o,i)}function lc(){return(Qe&6)===0?(So(0),!1):!0}function Hf(){if(Le!==null){if(Xe===0)var n=Le.return;else n=Le,ks=Yi=null,af(n),Qa=null,no=0,n=Le;for(;n!==null;)s0(n.alternate,n),n=n.return;Le=null}}function ar(n,i){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,DC(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),Ps=0,Hf(),rt=n,Le=o=Cs(n.current,null),Be=i,Xe=0,zn=null,ci=!1,nr=cs(n,i),Uf=!1,sr=En=Pf=aa=ui=Ct=0,yn=bo=null,If=!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-te(u),g=1<<h;i|=n[h],u&=~g}return Us=i,El(),o}function k0(n,i){Oe=null,q.H=uo,i===Va||i===Ul?(i=Hg(),Xe=3):i===Gd?(i=Hg(),Xe=4):Xe=i===Sf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,zn=i,Le===null&&(Ct=1,Jl(n,Ln(i,n.current)))}function z0(){var n=_n.current;return n===null?!0:(Be&4194048)===Be?In===null:(Be&62914560)===Be||(Be&536870912)!==0?n===In:!1}function E0(){var n=q.H;return q.H=uo,n===null?uo:n}function R0(){var n=q.A;return q.A=fC,n}function cc(){Ct=4,ci||(Be&4194048)!==Be&&_n.current!==null||(nr=!0),(ui&134217727)===0&&(aa&134217727)===0||rt===null||hi(rt,Be,En,!1)}function Zf(n,i,o){var u=Qe;Qe|=2;var h=E0(),g=R0();(rt!==n||Be!==i)&&(oc=null,ar(n,i)),i=!1;var w=Ct;e:do try{if(Xe!==0&&Le!==null){var k=Le,D=zn;switch(Xe){case 8:Hf(),w=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(i=!0);var Z=Xe;if(Xe=0,zn=null,rr(n,k,D,Z),o&&nr){w=0;break e}break;default:Z=Xe,Xe=0,zn=null,rr(n,k,D,Z)}}pC(),w=Ct;break}catch(Y){k0(n,Y)}while(!0);return i&&n.shellSuspendCounter++,ks=Yi=null,Qe=u,q.H=h,q.A=g,Le===null&&(rt=null,Be=0,El()),w}function pC(){for(;Le!==null;)O0(Le)}function gC(n,i){var o=Qe;Qe|=2;var u=E0(),h=R0();rt!==n||Be!==i?(oc=null,rc=Pe()+500,ar(n,i)):nr=cs(n,i);e:do try{if(Xe!==0&&Le!==null){i=Le;var g=zn;t:switch(Xe){case 1:Xe=0,zn=null,rr(n,i,g,1);break;case 2:case 9:if(Bg(g)){Xe=0,zn=null,A0(i);break}i=function(){Xe!==2&&Xe!==9||rt!==n||(Xe=7),ps(n)},g.then(i,i);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:Bg(g)?(Xe=0,zn=null,A0(i)):(Xe=0,zn=null,rr(n,i,g,7));break;case 5:var w=null;switch(Le.tag){case 26:w=Le.memoizedState;case 5:case 27:var k=Le;if(w?yv(w):k.stateNode.complete){Xe=0,zn=null;var D=k.sibling;if(D!==null)Le=D;else{var Z=k.return;Z!==null?(Le=Z,uc(Z)):Le=null}break t}}Xe=0,zn=null,rr(n,i,g,5);break;case 6:Xe=0,zn=null,rr(n,i,g,6);break;case 8:Hf(),Ct=6;break e;default:throw Error(a(462))}}yC();break}catch(Y){k0(n,Y)}while(!0);return ks=Yi=null,q.H=u,q.A=h,Qe=o,Le!==null?0:(rt=null,Be=0,El(),Ct)}function yC(){for(;Le!==null&&!oe();)O0(Le)}function O0(n){var i=t0(n.alternate,n,Us);n.memoizedProps=n.pendingProps,i===null?uc(n):Le=i}function A0(n){var i=n,o=i.alternate;switch(i.tag){case 15:case 0:i=Qy(o,i,i.pendingProps,i.type,void 0,Be);break;case 11:i=Qy(o,i,i.pendingProps,i.type.render,i.ref,Be);break;case 5:af(i);default:s0(o,i),i=Le=Rg(i,Us),i=t0(o,i,Us)}n.memoizedProps=n.pendingProps,i===null?uc(n):Le=i}function rr(n,i,o,u){ks=Yi=null,af(i),Qa=null,no=0;var h=i.return;try{if(aC(n,h,i,o,Be)){Ct=1,Jl(n,Ln(o,n.current)),Le=null;return}}catch(g){if(h!==null)throw Le=h,g;Ct=1,Jl(n,Ln(o,n.current)),Le=null;return}i.flags&32768?(Ze||u===1?n=!0:nr||(Be&536870912)!==0?n=!1:(ci=n=!0,(u===2||u===9||u===3||u===6)&&(u=_n.current,u!==null&&u.tag===13&&(u.flags|=16384))),T0(i,n)):uc(i)}function uc(n){var i=n;do{if((i.flags&32768)!==0){T0(i,ci);return}n=i.return;var o=lC(i.alternate,i,Us);if(o!==null){Le=o;return}if(i=i.sibling,i!==null){Le=i;return}Le=i=n}while(i!==null);Ct===0&&(Ct=5)}function T0(n,i){do{var o=cC(n.alternate,n);if(o!==null){o.flags&=32767,Le=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(n=n.sibling,n!==null)){Le=n;return}Le=n=o}while(n!==null);Ct=6,Le=null}function D0(n,i,o,u,h,g,w,k,D){n.cancelPendingCommit=null;do dc();while(Zt!==0);if((Qe&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Od,ld(n,o,g,w,k,D),n===rt&&(Le=rt=null,Be=0),ir=i,fi=n,Ps=o,$f=g,Bf=h,j0=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,SC(Qn,function(){return I0(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=q.T,q.T=null,h=T.p,T.p=2,w=Qe,Qe|=4;try{uC(n,i,o)}finally{Qe=w,T.p=h,q.T=u}}Zt=1,L0(),M0(),U0()}}function L0(){if(Zt===1){Zt=0;var n=fi,i=ir,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=q.T,q.T=null;var u=T.p;T.p=2;var h=Qe;Qe|=4;try{p0(i,n);var g=nh,w=Sg(n.containerInfo),k=g.focusedElem,D=g.selectionRange;if(w!==k&&k&&k.ownerDocument&&xg(k.ownerDocument.documentElement,k)){if(D!==null&&_d(k)){var Z=D.start,Y=D.end;if(Y===void 0&&(Y=Z),"selectionStart"in k)k.selectionStart=Z,k.selectionEnd=Math.min(Y,k.value.length);else{var W=k.ownerDocument||document,F=W&&W.defaultView||window;if(F.getSelection){var K=F.getSelection(),ye=k.textContent.length,_e=Math.min(D.start,ye),at=D.end===void 0?_e:Math.min(D.end,ye);!K.extend&&_e>at&&(w=at,at=_e,_e=w);var $=bg(k,_e),P=bg(k,at);if($&&P&&(K.rangeCount!==1||K.anchorNode!==$.node||K.anchorOffset!==$.offset||K.focusNode!==P.node||K.focusOffset!==P.offset)){var H=W.createRange();H.setStart($.node,$.offset),K.removeAllRanges(),_e>at?(K.addRange(H),K.extend(P.node,P.offset)):(H.setEnd(P.node,P.offset),K.addRange(H))}}}}for(W=[],K=k;K=K.parentNode;)K.nodeType===1&&W.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<W.length;k++){var J=W[k];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}jc=!!th,nh=th=null}finally{Qe=h,T.p=u,q.T=o}}n.current=i,Zt=2}}function M0(){if(Zt===2){Zt=0;var n=fi,i=ir,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=q.T,q.T=null;var u=T.p;T.p=2;var h=Qe;Qe|=4;try{u0(n,i.alternate,i)}finally{Qe=h,T.p=u,q.T=o}}Zt=3}}function U0(){if(Zt===4||Zt===3){Zt=0,Ue();var n=fi,i=ir,o=Ps,u=j0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Zt=5:(Zt=0,ir=fi=null,P0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(di=null),ue(o),i=i.stateNode,Ce&&typeof Ce.onCommitFiberRoot=="function")try{Ce.onCommitFiberRoot(os,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=q.T,h=T.p,T.p=2,q.T=null;try{for(var g=n.onRecoverableError,w=0;w<u.length;w++){var k=u[w];g(k.value,{componentStack:k.stack})}}finally{q.T=i,T.p=h}}(Ps&3)!==0&&dc(),ps(n),h=n.pendingLanes,(o&261930)!==0&&(h&42)!==0?n===qf?xo++:(xo=0,qf=n):xo=0,So(0)}}function P0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,eo(i)))}function dc(){return L0(),M0(),U0(),I0()}function I0(){if(Zt!==5)return!1;var n=fi,i=$f;$f=0;var o=ue(Ps),u=q.T,h=T.p;try{T.p=32>o?32:o,q.T=null,o=Bf,Bf=null;var g=fi,w=Ps;if(Zt=0,ir=fi=null,Ps=0,(Qe&6)!==0)throw Error(a(331));var k=Qe;if(Qe|=4,x0(g.current),y0(g,g.current,w,o),Qe=k,So(0,!1),Ce&&typeof Ce.onPostCommitFiberRoot=="function")try{Ce.onPostCommitFiberRoot(os,g)}catch{}return!0}finally{T.p=h,q.T=u,P0(n,i)}}function $0(n,i,o){i=Ln(o,i),i=xf(n.stateNode,i,2),n=ai(n,i,2),n!==null&&(Hi(n,2),ps(n))}function We(n,i,o){if(n.tag===3)$0(n,n,o);else for(;i!==null;){if(i.tag===3){$0(i,n,o);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(di===null||!di.has(u))){n=Ln(o,n),o=By(2),u=ai(i,o,2),u!==null&&(qy(o,u,i,n),Hi(u,2),ps(u));break}}i=i.return}}function Ff(n,i,o){var u=n.pingCache;if(u===null){u=n.pingCache=new hC;var h=new Set;u.set(i,h)}else h=u.get(i),h===void 0&&(h=new Set,u.set(i,h));h.has(o)||(Uf=!0,h.add(o),n=vC.bind(null,n,i,o),i.then(n,n))}function vC(n,i,o){var u=n.pingCache;u!==null&&u.delete(i),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,rt===n&&(Be&o)===o&&(Ct===4||Ct===3&&(Be&62914560)===Be&&300>Pe()-ac?(Qe&2)===0&&ar(n,0):Pf|=o,sr===Be&&(sr=0)),ps(n)}function B0(n,i){i===0&&(i=pl()),n=Ki(n,i),n!==null&&(Hi(n,i),ps(n))}function bC(n){var i=n.memoizedState,o=0;i!==null&&(o=i.retryLane),B0(n,o)}function xC(n,i){var o=0;switch(n.tag){case 31:case 13:var u=n.stateNode,h=n.memoizedState;h!==null&&(o=h.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(i),B0(n,o)}function SC(n,i){return wt(n,i)}var fc=null,or=null,Gf=!1,hc=!1,Kf=!1,mi=0;function ps(n){n!==or&&n.next===null&&(or===null?fc=or=n:or=or.next=n),hc=!0,Gf||(Gf=!0,jC())}function So(n,i){if(!Kf&&hc){Kf=!0;do for(var o=!1,u=fc;u!==null;){if(n!==0){var h=u.pendingLanes;if(h===0)var g=0;else{var w=u.suspendedLanes,k=u.pingedLanes;g=(1<<31-te(42|n)+1)-1,g&=h&~(w&~k),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,F0(u,g))}else g=Be,g=Ea(u,u===rt?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||cs(u,g)||(o=!0,F0(u,g));u=u.next}while(o);Kf=!1}}function wC(){q0()}function q0(){hc=Gf=!1;var n=0;mi!==0&&TC()&&(n=mi);for(var i=Pe(),o=null,u=fc;u!==null;){var h=u.next,g=H0(u,i);g===0?(u.next=null,o===null?fc=h:o.next=h,h===null&&(or=o)):(o=u,(n!==0||(g&3)!==0)&&(hc=!0)),u=h}Zt!==0&&Zt!==5||So(n),mi!==0&&(mi=0)}function H0(n,i){for(var o=n.suspendedLanes,u=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var w=31-te(g),k=1<<w,D=h[w];D===-1?((k&o)===0||(k&u)!==0)&&(h[w]=ml(k,i)):D<=i&&(n.expiredLanes|=k),g&=~k}if(i=rt,o=Be,o=Ea(n,n===i?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,o===0||n===i&&(Xe===2||Xe===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&sn(u),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||cs(n,o)){if(i=o&-o,i===n.callbackPriority)return i;switch(u!==null&&sn(u),ue(o)){case 2:case 8:o=zt;break;case 32:o=Qn;break;case 268435456:o=Fs;break;default:o=Qn}return u=Z0.bind(null,n),o=wt(o,u),n.callbackPriority=i,n.callbackNode=o,i}return u!==null&&u!==null&&sn(u),n.callbackPriority=2,n.callbackNode=null,2}function Z0(n,i){if(Zt!==0&&Zt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(dc()&&n.callbackNode!==o)return null;var u=Be;return u=Ea(n,n===rt?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(C0(n,u,i),H0(n,Pe()),n.callbackNode!=null&&n.callbackNode===o?Z0.bind(null,n):null)}function F0(n,i){if(dc())return null;C0(n,i,!0)}function jC(){LC(function(){(Qe&6)!==0?wt(Te,wC):q0()})}function Vf(){if(mi===0){var n=Ga;n===0&&(n=Ks,Ks<<=1,(Ks&261888)===0&&(Ks=256)),mi=n}return mi}function G0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Sl(""+n)}function K0(n,i){var o=i.ownerDocument.createElement("input");return o.name=i.name,o.value=i.value,n.id&&o.setAttribute("form",n.id),i.parentNode.insertBefore(o,i),n=new FormData(n),o.parentNode.removeChild(o),n}function NC(n,i,o,u,h){if(i==="submit"&&o&&o.stateNode===h){var g=G0((h[jt]||null).action),w=u.submitter;w&&(i=(i=w[jt]||null)?G0(i.formAction):w.getAttribute("formAction"),i!==null&&(g=i,w=null));var k=new Cl("action","action",null,u,h);n.push({event:k,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(mi!==0){var D=w?K0(h,w):new FormData(h);mf(o,{pending:!0,data:D,method:h.method,action:g},null,D)}}else typeof g=="function"&&(k.preventDefault(),D=w?K0(h,w):new FormData(h),mf(o,{pending:!0,data:D,method:h.method,action:g},g,D))},currentTarget:h}]})}}for(var Qf=0;Qf<Rd.length;Qf++){var Yf=Rd[Qf],CC=Yf.toLowerCase(),_C=Yf[0].toUpperCase()+Yf.slice(1);Jn(CC,"on"+_C)}Jn(Ng,"onAnimationEnd"),Jn(Cg,"onAnimationIteration"),Jn(_g,"onAnimationStart"),Jn("dblclick","onDoubleClick"),Jn("focusin","onFocus"),Jn("focusout","onBlur"),Jn(qN,"onTransitionRun"),Jn(HN,"onTransitionStart"),Jn(ZN,"onTransitionCancel"),Jn(kg,"onTransitionEnd"),an("onMouseEnter",["mouseout","mouseover"]),an("onMouseLeave",["mouseout","mouseover"]),an("onPointerEnter",["pointerout","pointerover"]),an("onPointerLeave",["pointerout","pointerover"]),Ht("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ht("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ht("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ht("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ht("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ht("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wo="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(" "),kC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wo));function V0(n,i){i=(i&4)!==0;for(var o=0;o<n.length;o++){var u=n[o],h=u.event;u=u.listeners;e:{var g=void 0;if(i)for(var w=u.length-1;0<=w;w--){var k=u[w],D=k.instance,Z=k.currentTarget;if(k=k.listener,D!==g&&h.isPropagationStopped())break e;g=k,h.currentTarget=Z;try{g(h)}catch(Y){zl(Y)}h.currentTarget=null,g=D}else for(w=0;w<u.length;w++){if(k=u[w],D=k.instance,Z=k.currentTarget,k=k.listener,D!==g&&h.isPropagationStopped())break e;g=k,h.currentTarget=Z;try{g(h)}catch(Y){zl(Y)}h.currentTarget=null,g=D}}}}function Me(n,i){var o=i[en];o===void 0&&(o=i[en]=new Set);var u=n+"__bubble";o.has(u)||(Q0(i,n,2,!1),o.add(u))}function Jf(n,i,o){var u=0;i&&(u|=4),Q0(o,n,u,i)}var mc="_reactListening"+Math.random().toString(36).slice(2);function Xf(n){if(!n[mc]){n[mc]=!0,$e.forEach(function(o){o!=="selectionchange"&&(kC.has(o)||Jf(o,!1,n),Jf(o,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[mc]||(i[mc]=!0,Jf("selectionchange",!1,i))}}function Q0(n,i,o,u){switch(Nv(i)){case 2:var h=t_;break;case 8:h=n_;break;default:h=hh}o=h.bind(null,i,o,n),h=void 0,!yd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),u?h!==void 0?n.addEventListener(i,o,{capture:!0,passive:h}):n.addEventListener(i,o,!0):h!==void 0?n.addEventListener(i,o,{passive:h}):n.addEventListener(i,o,!1)}function Wf(n,i,o,u,h){var g=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var k=u.stateNode.containerInfo;if(k===h)break;if(w===4)for(w=u.return;w!==null;){var D=w.tag;if((D===3||D===4)&&w.stateNode.containerInfo===h)return;w=w.return}for(;k!==null;){if(w=Ys(k),w===null)return;if(D=w.tag,D===5||D===6||D===26||D===27){u=g=w;continue e}k=k.parentNode}}u=u.return}eg(function(){var Z=g,Y=pd(o),W=[];e:{var F=zg.get(n);if(F!==void 0){var K=Cl,ye=n;switch(n){case"keypress":if(jl(o)===0)break e;case"keydown":case"keyup":K=xN;break;case"focusin":ye="focus",K=Sd;break;case"focusout":ye="blur",K=Sd;break;case"beforeblur":case"afterblur":K=Sd;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=sg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=lN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=jN;break;case Ng:case Cg:case _g:K=dN;break;case kg:K=CN;break;case"scroll":case"scrollend":K=rN;break;case"wheel":K=kN;break;case"copy":case"cut":case"paste":K=hN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=ag;break;case"toggle":case"beforetoggle":K=EN}var _e=(i&4)!==0,at=!_e&&(n==="scroll"||n==="scrollend"),$=_e?F!==null?F+"Capture":null:F;_e=[];for(var P=Z,H;P!==null;){var J=P;if(H=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||H===null||$===null||(J=Hr(P,$),J!=null&&_e.push(jo(P,J,H))),at)break;P=P.return}0<_e.length&&(F=new K(F,ye,null,o,Y),W.push({event:F,listeners:_e}))}}if((i&7)===0){e:{if(F=n==="mouseover"||n==="pointerover",K=n==="mouseout"||n==="pointerout",F&&o!==md&&(ye=o.relatedTarget||o.fromElement)&&(Ys(ye)||ye[jn]))break e;if((K||F)&&(F=Y.window===Y?Y:(F=Y.ownerDocument)?F.defaultView||F.parentWindow:window,K?(ye=o.relatedTarget||o.toElement,K=Z,ye=ye?Ys(ye):null,ye!==null&&(at=c(ye),_e=ye.tag,ye!==at||_e!==5&&_e!==27&&_e!==6)&&(ye=null)):(K=null,ye=Z),K!==ye)){if(_e=sg,J="onMouseLeave",$="onMouseEnter",P="mouse",(n==="pointerout"||n==="pointerover")&&(_e=ag,J="onPointerLeave",$="onPointerEnter",P="pointer"),at=K==null?F:ds(K),H=ye==null?F:ds(ye),F=new _e(J,P+"leave",K,o,Y),F.target=at,F.relatedTarget=H,J=null,Ys(Y)===Z&&(_e=new _e($,P+"enter",ye,o,Y),_e.target=H,_e.relatedTarget=at,J=_e),at=J,K&&ye)t:{for(_e=zC,$=K,P=ye,H=0,J=$;J;J=_e(J))H++;J=0;for(var Ne=P;Ne;Ne=_e(Ne))J++;for(;0<H-J;)$=_e($),H--;for(;0<J-H;)P=_e(P),J--;for(;H--;){if($===P||P!==null&&$===P.alternate){_e=$;break t}$=_e($),P=_e(P)}_e=null}else _e=null;K!==null&&Y0(W,F,K,_e,!1),ye!==null&&at!==null&&Y0(W,at,ye,_e,!0)}}e:{if(F=Z?ds(Z):window,K=F.nodeName&&F.nodeName.toLowerCase(),K==="select"||K==="input"&&F.type==="file")var Ke=hg;else if(dg(F))if(mg)Ke=IN;else{Ke=UN;var Se=MN}else K=F.nodeName,!K||K.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?Z&&hd(Z.elementType)&&(Ke=hg):Ke=PN;if(Ke&&(Ke=Ke(n,Z))){fg(W,Ke,o,Y);break e}Se&&Se(n,F,Z),n==="focusout"&&Z&&F.type==="number"&&Z.memoizedProps.value!=null&&fd(F,"number",F.value)}switch(Se=Z?ds(Z):window,n){case"focusin":(dg(Se)||Se.contentEditable==="true")&&(Pa=Se,kd=Z,Jr=null);break;case"focusout":Jr=kd=Pa=null;break;case"mousedown":zd=!0;break;case"contextmenu":case"mouseup":case"dragend":zd=!1,wg(W,o,Y);break;case"selectionchange":if(BN)break;case"keydown":case"keyup":wg(W,o,Y)}var Ae;if(jd)e:{switch(n){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Ua?cg(n,o)&&(qe="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(qe="onCompositionStart");qe&&(rg&&o.locale!=="ko"&&(Ua||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Ua&&(Ae=tg()):(Xs=Y,vd="value"in Xs?Xs.value:Xs.textContent,Ua=!0)),Se=pc(Z,qe),0<Se.length&&(qe=new ig(qe,n,null,o,Y),W.push({event:qe,listeners:Se}),Ae?qe.data=Ae:(Ae=ug(o),Ae!==null&&(qe.data=Ae)))),(Ae=ON?AN(n,o):TN(n,o))&&(qe=pc(Z,"onBeforeInput"),0<qe.length&&(Se=new ig("onBeforeInput","beforeinput",null,o,Y),W.push({event:Se,listeners:qe}),Se.data=Ae)),NC(W,n,Z,o,Y)}V0(W,i)})}function jo(n,i,o){return{instance:n,listener:i,currentTarget:o}}function pc(n,i){for(var o=i+"Capture",u=[];n!==null;){var h=n,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Hr(n,o),h!=null&&u.unshift(jo(n,h,g)),h=Hr(n,i),h!=null&&u.push(jo(n,h,g))),n.tag===3)return u;n=n.return}return[]}function zC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Y0(n,i,o,u,h){for(var g=i._reactName,w=[];o!==null&&o!==u;){var k=o,D=k.alternate,Z=k.stateNode;if(k=k.tag,D!==null&&D===u)break;k!==5&&k!==26&&k!==27||Z===null||(D=Z,h?(Z=Hr(o,g),Z!=null&&w.unshift(jo(o,Z,D))):h||(Z=Hr(o,g),Z!=null&&w.push(jo(o,Z,D)))),o=o.return}w.length!==0&&n.push({event:i,listeners:w})}var EC=/\r\n?/g,RC=/\u0000|\uFFFD/g;function J0(n){return(typeof n=="string"?n:""+n).replace(EC,`
|
|
9
|
+
`).replace(RC,"")}function X0(n,i){return i=J0(i),J0(n)===i}function it(n,i,o,u,h,g){switch(o){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||Da(n,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&Da(n,""+u);break;case"className":bl(n,"class",u);break;case"tabIndex":bl(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":bl(n,o,u);break;case"style":Xp(n,u,g);break;case"data":if(i!=="object"){bl(n,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||o!=="href")){n.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=Sl(""+u),n.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(o==="formAction"?(i!=="input"&&it(n,i,"name",h.name,h,null),it(n,i,"formEncType",h.formEncType,h,null),it(n,i,"formMethod",h.formMethod,h,null),it(n,i,"formTarget",h.formTarget,h,null)):(it(n,i,"encType",h.encType,h,null),it(n,i,"method",h.method,h,null),it(n,i,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=Sl(""+u),n.setAttribute(o,u);break;case"onClick":u!=null&&(n.onclick=js);break;case"onScroll":u!=null&&Me("scroll",n);break;case"onScrollEnd":u!=null&&Me("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=o}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}o=Sl(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""+u):n.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":u===!0?n.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,u):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(o,u):n.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(o):n.setAttribute(o,u);break;case"popover":Me("beforetoggle",n),Me("toggle",n),vl(n,"popover",u);break;case"xlinkActuate":ws(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":ws(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":ws(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":ws(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":ws(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":ws(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":ws(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":ws(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":ws(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":vl(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=iN.get(o)||o,vl(n,o,u))}}function eh(n,i,o,u,h,g){switch(o){case"style":Xp(n,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=o}}break;case"children":typeof u=="string"?Da(n,u):(typeof u=="number"||typeof u=="bigint")&&Da(n,""+u);break;case"onScroll":u!=null&&Me("scroll",n);break;case"onScrollEnd":u!=null&&Me("scrollend",n);break;case"onClick":u!=null&&(n.onclick=js);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!nt.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),i=o.slice(2,h?o.length-7:void 0),g=n[jt]||null,g=g!=null?g[o]:null,typeof g=="function"&&n.removeEventListener(i,g,h),typeof u=="function")){typeof g!="function"&&g!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(i,u,h);break e}o in n?n[o]=u:u===!0?n.setAttribute(o,""):vl(n,o,u)}}}function Xt(n,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",n),Me("load",n);var u=!1,h=!1,g;for(g in o)if(o.hasOwnProperty(g)){var w=o[g];if(w!=null)switch(g){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:it(n,i,g,w,o,null)}}h&&it(n,i,"srcSet",o.srcSet,o,null),u&&it(n,i,"src",o.src,o,null);return;case"input":Me("invalid",n);var k=g=w=h=null,D=null,Z=null;for(u in o)if(o.hasOwnProperty(u)){var Y=o[u];if(Y!=null)switch(u){case"name":h=Y;break;case"type":w=Y;break;case"checked":D=Y;break;case"defaultChecked":Z=Y;break;case"value":g=Y;break;case"defaultValue":k=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:it(n,i,u,Y,o,null)}}Vp(n,g,k,D,Z,w,h,!1);return;case"select":Me("invalid",n),u=w=g=null;for(h in o)if(o.hasOwnProperty(h)&&(k=o[h],k!=null))switch(h){case"value":g=k;break;case"defaultValue":w=k;break;case"multiple":u=k;default:it(n,i,h,k,o,null)}i=g,o=w,n.multiple=!!u,i!=null?Ta(n,!!u,i,!1):o!=null&&Ta(n,!!u,o,!0);return;case"textarea":Me("invalid",n),g=h=u=null;for(w in o)if(o.hasOwnProperty(w)&&(k=o[w],k!=null))switch(w){case"value":u=k;break;case"defaultValue":h=k;break;case"children":g=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(91));break;default:it(n,i,w,k,o,null)}Yp(n,u,h,g);return;case"option":for(D in o)o.hasOwnProperty(D)&&(u=o[D],u!=null)&&(D==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":it(n,i,D,u,o,null));return;case"dialog":Me("beforetoggle",n),Me("toggle",n),Me("cancel",n),Me("close",n);break;case"iframe":case"object":Me("load",n);break;case"video":case"audio":for(u=0;u<wo.length;u++)Me(wo[u],n);break;case"image":Me("error",n),Me("load",n);break;case"details":Me("toggle",n);break;case"embed":case"source":case"link":Me("error",n),Me("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(Z in o)if(o.hasOwnProperty(Z)&&(u=o[Z],u!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:it(n,i,Z,u,o,null)}return;default:if(hd(i)){for(Y in o)o.hasOwnProperty(Y)&&(u=o[Y],u!==void 0&&eh(n,i,Y,u,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(u=o[k],u!=null&&it(n,i,k,u,o,null))}function OC(n,i,o,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,w=null,k=null,D=null,Z=null,Y=null;for(K in o){var W=o[K];if(o.hasOwnProperty(K)&&W!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":D=W;default:u.hasOwnProperty(K)||it(n,i,K,null,u,W)}}for(var F in u){var K=u[F];if(W=o[F],u.hasOwnProperty(F)&&(K!=null||W!=null))switch(F){case"type":g=K;break;case"name":h=K;break;case"checked":Z=K;break;case"defaultChecked":Y=K;break;case"value":w=K;break;case"defaultValue":k=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(a(137,i));break;default:K!==W&&it(n,i,F,K,u,W)}}dd(n,w,k,D,Z,Y,g,h);return;case"select":K=w=k=F=null;for(g in o)if(D=o[g],o.hasOwnProperty(g)&&D!=null)switch(g){case"value":break;case"multiple":K=D;default:u.hasOwnProperty(g)||it(n,i,g,null,u,D)}for(h in u)if(g=u[h],D=o[h],u.hasOwnProperty(h)&&(g!=null||D!=null))switch(h){case"value":F=g;break;case"defaultValue":k=g;break;case"multiple":w=g;default:g!==D&&it(n,i,h,g,u,D)}i=k,o=w,u=K,F!=null?Ta(n,!!o,F,!1):!!u!=!!o&&(i!=null?Ta(n,!!o,i,!0):Ta(n,!!o,o?[]:"",!1));return;case"textarea":K=F=null;for(k in o)if(h=o[k],o.hasOwnProperty(k)&&h!=null&&!u.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:it(n,i,k,null,u,h)}for(w in u)if(h=u[w],g=o[w],u.hasOwnProperty(w)&&(h!=null||g!=null))switch(w){case"value":F=h;break;case"defaultValue":K=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==g&&it(n,i,w,h,u,g)}Qp(n,F,K);return;case"option":for(var ye in o)F=o[ye],o.hasOwnProperty(ye)&&F!=null&&!u.hasOwnProperty(ye)&&(ye==="selected"?n.selected=!1:it(n,i,ye,null,u,F));for(D in u)F=u[D],K=o[D],u.hasOwnProperty(D)&&F!==K&&(F!=null||K!=null)&&(D==="selected"?n.selected=F&&typeof F!="function"&&typeof F!="symbol":it(n,i,D,F,u,K));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 _e in o)F=o[_e],o.hasOwnProperty(_e)&&F!=null&&!u.hasOwnProperty(_e)&&it(n,i,_e,null,u,F);for(Z in u)if(F=u[Z],K=o[Z],u.hasOwnProperty(Z)&&F!==K&&(F!=null||K!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(a(137,i));break;default:it(n,i,Z,F,u,K)}return;default:if(hd(i)){for(var at in o)F=o[at],o.hasOwnProperty(at)&&F!==void 0&&!u.hasOwnProperty(at)&&eh(n,i,at,void 0,u,F);for(Y in u)F=u[Y],K=o[Y],!u.hasOwnProperty(Y)||F===K||F===void 0&&K===void 0||eh(n,i,Y,F,u,K);return}}for(var $ in o)F=o[$],o.hasOwnProperty($)&&F!=null&&!u.hasOwnProperty($)&&it(n,i,$,null,u,F);for(W in u)F=u[W],K=o[W],!u.hasOwnProperty(W)||F===K||F==null&&K==null||it(n,i,W,F,u,K)}function W0(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function AC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var h=o[u],g=h.transferSize,w=h.initiatorType,k=h.duration;if(g&&k&&W0(w)){for(w=0,k=h.responseEnd,u+=1;u<o.length;u++){var D=o[u],Z=D.startTime;if(Z>k)break;var Y=D.transferSize,W=D.initiatorType;Y&&W0(W)&&(D=D.responseEnd,w+=Y*(D<k?1:(k-Z)/(D-Z)))}if(--u,i+=8*(g+w)/(h.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var th=null,nh=null;function gc(n){return n.nodeType===9?n:n.ownerDocument}function ev(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 tv(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function sh(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ih=null;function TC(){var n=window.event;return n&&n.type==="popstate"?n===ih?!1:(ih=n,!0):(ih=null,!1)}var nv=typeof setTimeout=="function"?setTimeout:void 0,DC=typeof clearTimeout=="function"?clearTimeout:void 0,sv=typeof Promise=="function"?Promise:void 0,LC=typeof queueMicrotask=="function"?queueMicrotask:typeof sv<"u"?function(n){return sv.resolve(null).then(n).catch(MC)}:nv;function MC(n){setTimeout(function(){throw n})}function pi(n){return n==="head"}function iv(n,i){var o=i,u=0;do{var h=o.nextSibling;if(n.removeChild(o),h&&h.nodeType===8)if(o=h.data,o==="/$"||o==="/&"){if(u===0){n.removeChild(h),dr(i);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")No(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,No(o);for(var g=o.firstChild;g;){var w=g.nextSibling,k=g.nodeName;g[us]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=w}}else o==="body"&&No(n.ownerDocument.body);o=h}while(o);dr(i)}function av(n,i){var o=n;n=0;do{var u=o.nextSibling;if(o.nodeType===1?i?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(i?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=u}while(o)}function ah(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var o=i;switch(i=i.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":ah(o),Oa(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function UC(n,i,o,u){for(;n.nodeType===1;){var h=o;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[us])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=$n(n.nextSibling),n===null)break}return null}function PC(n,i,o){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=$n(n.nextSibling),n===null))return null;return n}function rv(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=$n(n.nextSibling),n===null))return null;return n}function rh(n){return n.data==="$?"||n.data==="$~"}function oh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function IC(n,i){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||o.readyState!=="loading")i();else{var u=function(){i(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function $n(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var lh=null;function ov(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(i===0)return $n(n.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}n=n.nextSibling}return null}function lv(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(i===0)return n;i--}else o!=="/$"&&o!=="/&"||i++}n=n.previousSibling}return null}function cv(n,i,o){switch(i=gc(o),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function No(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Oa(n)}var Bn=new Map,uv=new Set;function yc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Is=T.d;T.d={f:$C,r:BC,D:qC,C:HC,L:ZC,m:FC,X:KC,S:GC,M:VC};function $C(){var n=Is.f(),i=lc();return n||i}function BC(n){var i=Yn(n);i!==null&&i.tag===5&&i.type==="form"?ky(i):Is.r(n)}var lr=typeof document>"u"?null:document;function dv(n,i,o){var u=lr;if(u&&typeof i=="string"&&i){var h=Tn(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),uv.has(h)||(uv.add(h),n={rel:n,crossOrigin:o,href:i},u.querySelector(h)===null&&(i=u.createElement("link"),Xt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function qC(n){Is.D(n),dv("dns-prefetch",n,null)}function HC(n,i){Is.C(n,i),dv("preconnect",n,i)}function ZC(n,i,o){Is.L(n,i,o);var u=lr;if(u&&n&&i){var h='link[rel="preload"][as="'+Tn(i)+'"]';i==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+Tn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+Tn(o.imageSizes)+'"]')):h+='[href="'+Tn(n)+'"]';var g=h;switch(i){case"style":g=cr(n);break;case"script":g=ur(n)}Bn.has(g)||(n=y({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:n,as:i},o),Bn.set(g,n),u.querySelector(h)!==null||i==="style"&&u.querySelector(Co(g))||i==="script"&&u.querySelector(_o(g))||(i=u.createElement("link"),Xt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function FC(n,i){Is.m(n,i);var o=lr;if(o&&n){var u=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Tn(u)+'"][href="'+Tn(n)+'"]',g=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=ur(n)}if(!Bn.has(g)&&(n=y({rel:"modulepreload",href:n},i),Bn.set(g,n),o.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(_o(g)))return}u=o.createElement("link"),Xt(u,"link",n),Mt(u),o.head.appendChild(u)}}}function GC(n,i,o){Is.S(n,i,o);var u=lr;if(u&&n){var h=Js(u).hoistableStyles,g=cr(n);i=i||"default";var w=h.get(g);if(!w){var k={loading:0,preload:null};if(w=u.querySelector(Co(g)))k.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},o),(o=Bn.get(g))&&ch(n,o);var D=w=u.createElement("link");Mt(D),Xt(D,"link",n),D._p=new Promise(function(Z,Y){D.onload=Z,D.onerror=Y}),D.addEventListener("load",function(){k.loading|=1}),D.addEventListener("error",function(){k.loading|=2}),k.loading|=4,vc(w,i,u)}w={type:"stylesheet",instance:w,count:1,state:k},h.set(g,w)}}}function KC(n,i){Is.X(n,i);var o=lr;if(o&&n){var u=Js(o).hoistableScripts,h=ur(n),g=u.get(h);g||(g=o.querySelector(_o(h)),g||(n=y({src:n,async:!0},i),(i=Bn.get(h))&&uh(n,i),g=o.createElement("script"),Mt(g),Xt(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function VC(n,i){Is.M(n,i);var o=lr;if(o&&n){var u=Js(o).hoistableScripts,h=ur(n),g=u.get(h);g||(g=o.querySelector(_o(h)),g||(n=y({src:n,async:!0,type:"module"},i),(i=Bn.get(h))&&uh(n,i),g=o.createElement("script"),Mt(g),Xt(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function fv(n,i,o,u){var h=(h=he.current)?yc(h):null;if(!h)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(i=cr(o.href),o=Js(h).hoistableStyles,u=o.get(i),u||(u={type:"style",instance:null,count:0,state:null},o.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=cr(o.href);var g=Js(h).hoistableStyles,w=g.get(n);if(w||(h=h.ownerDocument||h,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,w),(g=h.querySelector(Co(n)))&&!g._p&&(w.instance=g,w.state.loading=5),Bn.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Bn.set(n,o),g||QC(h,n,o,w.state))),i&&u===null)throw Error(a(528,""));return w}if(i&&u!==null)throw Error(a(529,""));return null;case"script":return i=o.async,o=o.src,typeof o=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ur(o),o=Js(h).hoistableScripts,u=o.get(i),u||(u={type:"script",instance:null,count:0,state:null},o.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function cr(n){return'href="'+Tn(n)+'"'}function Co(n){return'link[rel="stylesheet"]['+n+"]"}function hv(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function QC(n,i,o,u){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=n.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),Xt(i,"link",o),Mt(i),n.head.appendChild(i))}function ur(n){return'[src="'+Tn(n)+'"]'}function _o(n){return"script[async]"+n}function mv(n,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var u=n.querySelector('style[data-href~="'+Tn(o.href)+'"]');if(u)return i.instance=u,Mt(u),u;var h=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),Mt(u),Xt(u,"style",h),vc(u,o.precedence,n),i.instance=u;case"stylesheet":h=cr(o.href);var g=n.querySelector(Co(h));if(g)return i.state.loading|=4,i.instance=g,Mt(g),g;u=hv(o),(h=Bn.get(h))&&ch(u,h),g=(n.ownerDocument||n).createElement("link"),Mt(g);var w=g;return w._p=new Promise(function(k,D){w.onload=k,w.onerror=D}),Xt(g,"link",u),i.state.loading|=4,vc(g,o.precedence,n),i.instance=g;case"script":return g=ur(o.src),(h=n.querySelector(_o(g)))?(i.instance=h,Mt(h),h):(u=o,(h=Bn.get(g))&&(u=y({},o),uh(u,h)),n=n.ownerDocument||n,h=n.createElement("script"),Mt(h),Xt(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,vc(u,o.precedence,n));return i.instance}function vc(n,i,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,g=h,w=0;w<u.length;w++){var k=u[w];if(k.dataset.precedence===i)g=k;else if(g!==h)break}g?g.parentNode.insertBefore(n,g.nextSibling):(i=o.nodeType===9?o.head:o,i.insertBefore(n,i.firstChild))}function ch(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function uh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var bc=null;function pv(n,i,o){if(bc===null){var u=new Map,h=bc=new Map;h.set(o,u)}else h=bc,u=h.get(o),u||(u=new Map,h.set(o,u));if(u.has(n))return u;for(u.set(n,null),o=o.getElementsByTagName(n),h=0;h<o.length;h++){var g=o[h];if(!(g[us]||g[Et]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var w=g.getAttribute(i)||"";w=n+w;var k=u.get(w);k?k.push(g):u.set(w,[g])}}return u}function gv(n,i,o){n=n.ownerDocument||n,n.head.insertBefore(o,i==="title"?n.querySelector("head > title"):null)}function YC(n,i,o){if(o===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(n=i.disabled,typeof i.precedence=="string"&&n==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function yv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function JC(n,i,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var h=cr(u.href),g=i.querySelector(Co(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=xc.bind(n),i.then(n,n)),o.state.loading|=4,o.instance=g,Mt(g);return}g=i.ownerDocument||i,u=hv(u),(h=Bn.get(h))&&ch(u,h),g=g.createElement("link"),Mt(g);var w=g;w._p=new Promise(function(k,D){w.onload=k,w.onerror=D}),Xt(g,"link",u),o.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,i),(i=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=xc.bind(n),i.addEventListener("load",o),i.addEventListener("error",o))}}var dh=0;function XC(n,i){return n.stylesheets&&n.count===0&&wc(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var u=setTimeout(function(){if(n.stylesheets&&wc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&dh===0&&(dh=62500*AC());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&wc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>dh?50:800)+i);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function xc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Sc=null;function wc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Sc=new Map,i.forEach(WC,n),Sc=null,xc.call(n))}function WC(n,i){if(!(i.state.loading&4)){var o=Sc.get(n);if(o)var u=o.get(null);else{o=new Map,Sc.set(n,o);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var w=h[g];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(o.set(w.dataset.precedence,w),u=w)}u&&o.set(null,u)}h=i.instance,w=h.getAttribute("data-precedence"),g=o.get(w)||u,g===u&&o.set(null,h),o.set(w,h),this.count++,u=xc.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 ko={$$typeof:R,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function e_(n,i,o,u,h,g,w,k,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=Ra(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ra(0),this.hiddenUpdates=Ra(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function vv(n,i,o,u,h,g,w,k,D,Z,Y,W){return n=new e_(n,i,o,w,D,Z,Y,W,k),i=1,g===!0&&(i|=24),g=Cn(3,null,null,i),n.current=g,g.stateNode=n,i=Hd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:u,isDehydrated:o,cache:i},Kd(g),n}function bv(n){return n?(n=Ba,n):Ba}function xv(n,i,o,u,h,g){h=bv(h),u.context===null?u.context=h:u.pendingContext=h,u=ii(i),u.payload={element:o},g=g===void 0?null:g,g!==null&&(u.callback=g),o=ai(n,u,i),o!==null&&(vn(o,n,i),io(o,n,i))}function Sv(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<i?o:i}}function fh(n,i){Sv(n,i),(n=n.alternate)&&Sv(n,i)}function wv(n){if(n.tag===13||n.tag===31){var i=Ki(n,67108864);i!==null&&vn(i,n,67108864),fh(n,67108864)}}function jv(n){if(n.tag===13||n.tag===31){var i=Rn();i=I(i);var o=Ki(n,i);o!==null&&vn(o,n,i),fh(n,i)}}var jc=!0;function t_(n,i,o,u){var h=q.T;q.T=null;var g=T.p;try{T.p=2,hh(n,i,o,u)}finally{T.p=g,q.T=h}}function n_(n,i,o,u){var h=q.T;q.T=null;var g=T.p;try{T.p=8,hh(n,i,o,u)}finally{T.p=g,q.T=h}}function hh(n,i,o,u){if(jc){var h=mh(u);if(h===null)Wf(n,i,u,Nc,o),Cv(n,u);else if(i_(h,n,i,o,u))u.stopPropagation();else if(Cv(n,u),i&4&&-1<s_.indexOf(n)){for(;h!==null;){var g=Yn(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var w=ls(g.pendingLanes);if(w!==0){var k=g;for(k.pendingLanes|=2,k.entangledLanes|=2;w;){var D=1<<31-te(w);k.entanglements[1]|=D,w&=~D}ps(g),(Qe&6)===0&&(rc=Pe()+500,So(0))}}break;case 31:case 13:k=Ki(g,2),k!==null&&vn(k,g,2),lc(),fh(g,2)}if(g=mh(u),g===null&&Wf(n,i,u,Nc,o),g===h)break;h=g}h!==null&&u.stopPropagation()}else Wf(n,i,u,null,o)}}function mh(n){return n=pd(n),ph(n)}var Nc=null;function ph(n){if(Nc=null,n=Ys(n),n!==null){var i=c(n);if(i===null)n=null;else{var o=i.tag;if(o===13){if(n=d(i),n!==null)return n;n=null}else if(o===31){if(n=f(i),n!==null)return n;n=null}else if(o===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return Nc=n,null}function Nv(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(ke()){case Te:return 2;case zt:return 8;case Qn:case bs:return 32;case Fs:return 268435456;default:return 32}default:return 32}}var gh=!1,gi=null,yi=null,vi=null,zo=new Map,Eo=new Map,bi=[],s_="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 Cv(n,i){switch(n){case"focusin":case"focusout":gi=null;break;case"dragenter":case"dragleave":yi=null;break;case"mouseover":case"mouseout":vi=null;break;case"pointerover":case"pointerout":zo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Eo.delete(i.pointerId)}}function Ro(n,i,o,u,h,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:o,eventSystemFlags:u,nativeEvent:g,targetContainers:[h]},i!==null&&(i=Yn(i),i!==null&&wv(i)),n):(n.eventSystemFlags|=u,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function i_(n,i,o,u,h){switch(i){case"focusin":return gi=Ro(gi,n,i,o,u,h),!0;case"dragenter":return yi=Ro(yi,n,i,o,u,h),!0;case"mouseover":return vi=Ro(vi,n,i,o,u,h),!0;case"pointerover":var g=h.pointerId;return zo.set(g,Ro(zo.get(g)||null,n,i,o,u,h)),!0;case"gotpointercapture":return g=h.pointerId,Eo.set(g,Ro(Eo.get(g)||null,n,i,o,u,h)),!0}return!1}function _v(n){var i=Ys(n.target);if(i!==null){var o=c(i);if(o!==null){if(i=o.tag,i===13){if(i=d(o),i!==null){n.blockedOn=i,Vt(n.priority,function(){jv(o)});return}}else if(i===31){if(i=f(o),i!==null){n.blockedOn=i,Vt(n.priority,function(){jv(o)});return}}else if(i===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Cc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var o=mh(n.nativeEvent);if(o===null){o=n.nativeEvent;var u=new o.constructor(o.type,o);md=u,o.target.dispatchEvent(u),md=null}else return i=Yn(o),i!==null&&wv(i),n.blockedOn=o,!1;i.shift()}return!0}function kv(n,i,o){Cc(n)&&o.delete(i)}function a_(){gh=!1,gi!==null&&Cc(gi)&&(gi=null),yi!==null&&Cc(yi)&&(yi=null),vi!==null&&Cc(vi)&&(vi=null),zo.forEach(kv),Eo.forEach(kv)}function _c(n,i){n.blockedOn===i&&(n.blockedOn=null,gh||(gh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,a_)))}var kc=null;function zv(n){kc!==n&&(kc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){kc===n&&(kc=null);for(var i=0;i<n.length;i+=3){var o=n[i],u=n[i+1],h=n[i+2];if(typeof u!="function"){if(ph(u||o)===null)continue;break}var g=Yn(o);g!==null&&(n.splice(i,3),i-=3,mf(g,{pending:!0,data:h,method:o.method,action:u},u,h))}}))}function dr(n){function i(D){return _c(D,n)}gi!==null&&_c(gi,n),yi!==null&&_c(yi,n),vi!==null&&_c(vi,n),zo.forEach(i),Eo.forEach(i);for(var o=0;o<bi.length;o++){var u=bi[o];u.blockedOn===n&&(u.blockedOn=null)}for(;0<bi.length&&(o=bi[0],o.blockedOn===null);)_v(o),o.blockedOn===null&&bi.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var h=o[u],g=o[u+1],w=h[jt]||null;if(typeof g=="function")w||zv(o);else if(w){var k=null;if(g&&g.hasAttribute("formAction")){if(h=g,w=g[jt]||null)k=w.formAction;else if(ph(h)!==null)continue}else k=w.action;typeof k=="function"?o[u+1]=k:(o.splice(u,3),u-=3),zv(o)}}}function Ev(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(w){return h=w})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function yh(n){this._internalRoot=n}zc.prototype.render=yh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,u=Rn();xv(o,u,n,i,null,null)},zc.prototype.unmount=yh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;xv(n.current,2,null,n,null,null),lc(),i[jn]=null}};function zc(n){this._internalRoot=n}zc.prototype.unstable_scheduleHydration=function(n){if(n){var i=tt();n={blockedOn:null,target:n,priority:i};for(var o=0;o<bi.length&&i!==0&&i<bi[o].priority;o++);bi.splice(o,0,n),o===0&&_v(n)}};var Rv=t.version;if(Rv!=="19.2.4")throw Error(a(527,Rv,"19.2.4"));T.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=m(i),n=n!==null?b(n):null,n=n===null?null:n.stateNode,n};var r_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ec=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ec.isDisabled&&Ec.supportsFiber)try{os=Ec.inject(r_),Ce=Ec}catch{}}return Ao.createRoot=function(n,i){if(!r(n))throw Error(a(299));var o=!1,u="",h=Uy,g=Py,w=Iy;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=vv(n,1,!1,null,null,o,u,null,h,g,w,Ev),n[jn]=i.current,Xf(n),new yh(i)},Ao.hydrateRoot=function(n,i,o){if(!r(n))throw Error(a(299));var u=!1,h="",g=Uy,w=Py,k=Iy,D=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(w=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.formState!==void 0&&(D=o.formState)),i=vv(n,1,!0,i,o??null,u,h,D,g,w,k,Ev),i.context=bv(null),o=i.current,u=Rn(),u=I(u),h=ii(u),h.callback=null,ai(o,h,u),o=u,i.current.lanes=o,Hi(i,o),ps(i),n[jn]=i.current,Xf(n),new zc(i)},Ao.version="19.2.4",Ao}var $v;function g_(){if($v)return xh.exports;$v=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),xh.exports=p_(),xh.exports}var y_=g_(),Lr=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(){}},v_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},b_=class{#t=v_;#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)}},ua=new b_;function x_(e){setTimeout(e,0)}var xa=typeof window>"u"||"Deno"in globalThis;function ln(){}function S_(e,t){return typeof e=="function"?e(t):e}function Wh(e){return typeof e=="number"&&e>=0&&e!==1/0}function Bx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ri(e,t){return typeof e=="function"?e(t):e}function qn(e,t){return typeof e=="function"?e(t):e}function Bv(e,t){const{type:s="all",exact:a,fetchStatus:r,predicate:c,queryKey:d,stale:f}=e;if(d){if(a){if(t.queryHash!==Um(d,t.options))return!1}else if(!Vo(t.queryKey,d))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||r&&r!==t.state.fetchStatus||c&&!c(t))}function qv(e,t){const{exact:s,status:a,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Ko(t.options.mutationKey)!==Ko(c))return!1}else if(!Vo(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||r&&!r(t))}function Um(e,t){return(t?.queryKeyHashFn||Ko)(e)}function Ko(e){return JSON.stringify(e,(t,s)=>em(s)?Object.keys(s).sort().reduce((a,r)=>(a[r]=s[r],a),{}):s)}function Vo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Vo(e[s],t[s])):!1}var w_=Object.prototype.hasOwnProperty;function Pm(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=Hv(e)&&Hv(t);if(!a&&!(em(e)&&em(t)))return t;const c=(a?e:Object.keys(e)).length,d=a?t:Object.keys(t),f=d.length,p=a?new Array(f):{};let m=0;for(let b=0;b<f;b++){const y=a?b:d[b],v=e[y],x=t[y];if(v===x){p[y]=v,(a?b<c:w_.call(e,y))&&m++;continue}if(v===null||x===null||typeof v!="object"||typeof x!="object"){p[y]=x;continue}const j=Pm(v,x,s+1);p[y]=j,j===v&&m++}return c===f&&m===c?e:p}function ru(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 Hv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function em(e){if(!Zv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Zv(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Zv(e){return Object.prototype.toString.call(e)==="[object Object]"}function j_(e){return new Promise(t=>{ua.setTimeout(t,e)})}function tm(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Pm(e,t):t}function N_(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function C_(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var Im=Symbol();function qx(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Im?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Hx(e,t){return typeof e=="function"?e(...t):!!e}function __(e,t,s){let a=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),a||(a=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),e}var k_=class extends Lr{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!xa&&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"}},$m=new k_;function nm(){let e,t;const s=new Promise((r,c)=>{e=r,t=c});s.status="pending",s.catch(()=>{});function a(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{a({status:"fulfilled",value:r}),e(r)},s.reject=r=>{a({status:"rejected",reason:r}),t(r)},s}var z_=x_;function E_(){let e=[],t=0,s=f=>{f()},a=f=>{f()},r=z_;const c=f=>{t?e.push(f):r(()=>{s(f)})},d=()=>{const f=e;e=[],f.length&&r(()=>{a(()=>{f.forEach(p=>{s(p)})})})};return{batch:f=>{let p;t++;try{p=f()}finally{t--,t||d()}return p},batchCalls:f=>(...p)=>{c(()=>{f(...p)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{r=f}}}var Bt=E_(),R_=class extends Lr{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!xa&&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}},ou=new R_;function O_(e){return Math.min(1e3*2**e,3e4)}function Zx(e){return(e??"online")==="online"?ou.isOnline():!0}var sm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Fx(e){let t=!1,s=0,a;const r=nm(),c=()=>r.status!=="pending",d=S=>{if(!c()){const C=new sm(S);v(C),e.onCancel?.(C)}},f=()=>{t=!0},p=()=>{t=!1},m=()=>$m.isFocused()&&(e.networkMode==="always"||ou.isOnline())&&e.canRun(),b=()=>Zx(e.networkMode)&&e.canRun(),y=S=>{c()||(a?.(),r.resolve(S))},v=S=>{c()||(a?.(),r.reject(S))},x=()=>new Promise(S=>{a=C=>{(c()||m())&&S(C)},e.onPause?.()}).then(()=>{a=void 0,c()||e.onContinue?.()}),j=()=>{if(c())return;let S;const C=s===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(_){S=Promise.reject(_)}Promise.resolve(S).then(y).catch(_=>{if(c())return;const E=e.retry??(xa?0:3),R=e.retryDelay??O_,z=typeof R=="function"?R(s,_):R,U=E===!0||typeof E=="number"&&s<E||typeof E=="function"&&E(s,_);if(t||!U){v(_);return}s++,e.onFail?.(s,_),j_(z).then(()=>m()?void 0:x()).then(()=>{t?v(_):j()})})};return{promise:r,status:()=>r.status,cancel:d,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:p,canStart:b,start:()=>(b()?j():x().then(j),r)}}var Gx=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wh(this.gcTime)&&(this.#t=ua.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xa?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ua.clearTimeout(this.#t),this.#t=void 0)}},A_=class extends Gx{#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=Gv(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=Gv(this.options);t.data!==void 0&&(this.setState(Fv(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=tm(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(ln).catch(ln):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>qn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Im||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ri(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:!Bx(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#o?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},r=()=>{const f=qx(this.options,t),m=(()=>{const b={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(b),b})();return this.#o=!1,this.options.persister?this.options.persister(f,m,this):f(m)},d=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:r};return a(f),f})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#a({type:"fetch",meta:d.fetchOptions?.meta}),this.#s=Fx({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:f=>{f instanceof sm&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(f,p)=>{this.#a({type:"failed",failureCount:f,error:p})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const f=await this.#s.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof sm){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,...Kx(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...Fv(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?a:void 0,a;case"error":const r=e.error;return{...s,error:r,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),Bt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Kx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zx(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Fv(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Gv(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 Bm=class extends Lr{constructor(e,t){super(),this.options=t,this.#t=e,this.#a=null,this.#o=nm(),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),Kv(this.#e,this.options)?this.#p():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return im(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return im(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),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 qn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),t._defaulted&&!ru(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&Vv(this.#e,s,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==s||qn(this.options.enabled,this.#e)!==qn(t.enabled,this.#e)||Ri(this.options.staleTime,this.#e)!==Ri(t.staleTime,this.#e))&&this.#g();const r=this.#y();a&&(this.#e!==s||qn(this.options.enabled,this.#e)!==qn(t.enabled,this.#e)||r!==this.#l)&&this.#v(r)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(t,e);return D_(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.#w();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ln)),t}#g(){this.#x();const e=Ri(this.options.staleTime,this.#e);if(xa||this.#i.isStale||!Wh(e))return;const s=Bx(this.#i.dataUpdatedAt,e)+1;this.#c=ua.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,!(xa||qn(this.options.enabled,this.#e)===!1||!Wh(this.#l)||this.#l===0)&&(this.#u=ua.setInterval(()=>{(this.options.refetchIntervalInBackground||$m.isFocused())&&this.#p()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(ua.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(ua.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const s=this.#e,a=this.options,r=this.#i,c=this.#s,d=this.#r,p=e!==s?e.state:this.#n,{state:m}=e;let b={...m},y=!1,v;if(t._optimisticResults){const A=this.hasListeners(),B=!A&&Kv(e,t),ie=A&&Vv(e,s,t,a);(B||ie)&&(b={...b,...Kx(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:x,errorUpdatedAt:j,status:S}=b;v=b.data;let C=!1;if(t.placeholderData!==void 0&&v===void 0&&S==="pending"){let A;r?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(A=r.data,C=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,A!==void 0&&(S="success",v=tm(r?.data,A,t),y=!0)}if(t.select&&v!==void 0&&!C)if(r&&v===c?.data&&t.select===this.#m)v=this.#d;else try{this.#m=t.select,v=t.select(v),v=tm(r?.data,v,t),this.#d=v,this.#a=null}catch(A){this.#a=A}this.#a&&(x=this.#a,v=this.#d,j=Date.now(),S="error");const _=b.fetchStatus==="fetching",E=S==="pending",R=S==="error",z=E&&_,U=v!==void 0,M={status:S,fetchStatus:b.fetchStatus,isPending:E,isSuccess:S==="success",isError:R,isInitialLoading:z,isLoading:z,data:v,dataUpdatedAt:b.dataUpdatedAt,error:x,errorUpdatedAt:j,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:b.dataUpdateCount>0||b.errorUpdateCount>0,isFetchedAfterMount:b.dataUpdateCount>p.dataUpdateCount||b.errorUpdateCount>p.errorUpdateCount,isFetching:_,isRefetching:_&&!E,isLoadingError:R&&!U,isPaused:b.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:R&&U,isStale:qm(e,t),refetch:this.refetch,promise:this.#o,isEnabled:qn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=M.data!==void 0,B=M.status==="error"&&!A,ie=me=>{B?me.reject(M.error):A&&me.resolve(M.data)},Q=()=>{const me=this.#o=M.promise=nm();ie(me)},ne=this.#o;switch(ne.status){case"pending":e.queryHash===s.queryHash&&ie(ne);break;case"fulfilled":(B||M.data!==ne.value)&&Q();break;case"rejected":(!B||M.error!==ne.reason)&&Q();break}}return M}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),ru(t,e))return;this.#i=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,r=typeof a=="function"?a():a;if(r==="all"||!r&&!this.#h.size)return!0;const c=new Set(r??this.#h);return this.options.throwOnError&&c.add("error"),Object.keys(this.#i).some(d=>{const f=d;return this.#i[f]!==e[f]&&c.has(f)})};this.#j({listeners:s()})}#w(){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.#b()}#j(e){Bt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function T_(e,t){return qn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Kv(e,t){return T_(e,t)||e.state.data!==void 0&&im(e,t,t.refetchOnMount)}function im(e,t,s){if(qn(t.enabled,e)!==!1&&Ri(t.staleTime,e)!=="static"){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&qm(e,t)}return!1}function Vv(e,t,s,a){return(e!==t||qn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&qm(e,s)}function qm(e,t){return qn(t.enabled,e)!==!1&&e.isStaleByTime(Ri(t.staleTime,e))}function D_(e,t){return!ru(e.getCurrentResult(),t)}function Qv(e){return{onFetch:(t,s)=>{const a=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},p=0;const m=async()=>{let b=!1;const y=j=>{__(j,()=>t.signal,()=>b=!0)},v=qx(t.options,t.fetchOptions),x=async(j,S,C)=>{if(b)return Promise.reject();if(S==null&&j.pages.length)return Promise.resolve(j);const E=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return y(O),O})(),R=await v(E),{maxPages:z}=t.options,U=C?C_:N_;return{pages:U(j.pages,R,z),pageParams:U(j.pageParams,S,z)}};if(r&&c.length){const j=r==="backward",S=j?L_:Yv,C={pages:c,pageParams:d},_=S(a,C);f=await x(C,_,j)}else{const j=e??c.length;do{const S=p===0?d[0]??a.initialPageParam:Yv(a,f);if(p>0&&S==null)break;f=await x(f,S),p++}while(p<j)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=m}}}function Yv(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 L_(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var M_=class extends Gx{#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||U_(),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=Fx({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",r=!this.#i.canStart();try{if(a)t();else{this.#s({type:"pending",variables:e,isPaused:r}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const d=await this.options.onMutate?.(e,s);d!==this.state.context&&this.#s({type:"pending",context:d,variables:e,isPaused:r})}const c=await this.#i.start();return await this.#n.config.onSuccess?.(c,e,this.state.context,this,s),await this.options.onSuccess?.(c,e,this.state.context,s),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(c,null,e,this.state.context,s),this.#s({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,e,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onError?.(c,e,this.state.context,s)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,s)}catch(d){Promise.reject(d)}throw this.#s({type:"error",error:c}),c}finally{this.#n.runNext(this)}}#s(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Bt.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function U_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vx=class extends Lr{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 M_({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=Rc(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=Rc(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=Rc(e);if(typeof t=="string"){const a=this.#e.get(t)?.find(r=>r.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Rc(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=>qv(t,s))}findAll(e={}){return this.getAll().filter(t=>qv(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(ln))))}};function Rc(e){return e.options.scope?.id}function Jv(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function P_(e,t,s){const a=e.slice(0);return a[t]=s,a}var I_=class extends Lr{#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(b=>b.observer.setOptions(b.defaultedQueryOptions));const r=a.map(b=>b.observer),c=r.map(b=>b.getCurrentResult()),d=s.length!==r.length,f=r.some((b,y)=>b!==s[y]),p=d||f,m=p?!0:c.some((b,y)=>{const v=this.#e[y];return!v||!ru(b,v)});!p&&!m||(p&&(this.#d=a,this.#s=r),this.#e=c,this.hasListeners()&&(p&&(Jv(s,r).forEach(b=>{b.destroy()}),Jv(r,s).forEach(b=>{b.subscribe(y=>{this.#l(b,y)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const s=this.#u(e),a=s.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),r=s.map(c=>c.defaultedQueryOptions.queryHash);return[a,c=>this.#c(c??a,t,r),()=>this.#f(a,s)]}#f(e,t){return t.map((s,a)=>{const r=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,c=>{t.forEach(d=>{d.observer.trackProp(c)})})})}#c(e,t,s){if(t){const a=this.#m,r=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((c,d)=>c!==a[d]));return(!this.#r||this.#e!==this.#a||r||t!==this.#o)&&(this.#o=t,this.#a=this.#e,s!==void 0&&(this.#m=s),this.#r=Pm(this.#r,t(e))),this.#r}return e}#u(e){const t=new Map;this.#s.forEach(a=>{const r=a.options.queryHash;if(!r)return;const c=t.get(r);c?c.push(a):t.set(r,[a])});const s=[];return e.forEach(a=>{const r=this.#t.defaultQueryOptions(a),d=t.get(r.queryHash)?.shift()??new Bm(this.#t,r);s.push({defaultedQueryOptions:r,observer:d})}),s}#l(e,t){const s=this.#s.indexOf(e);s!==-1&&(this.#e=P_(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)})})}}},$_=class extends Lr{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const a=t.queryKey,r=t.queryHash??Um(a,t);let c=this.get(r);return c||(c=new A_({client:e,queryKey:a,queryHash:r,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(a)}),this.add(c)),c}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Bt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>Bv(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>Bv(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()})})}},B_=class{#t;#e;#n;#i;#s;#r;#o;#a;constructor(e={}){this.#t=e.queryCache||new $_,this.#e=e.mutationCache||new Vx,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=$m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=ou.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(Ri(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=S_(t,c);if(d!==void 0)return this.#t.build(this,a).setData(d,{...s,manual:!0})}setQueriesData(e,t,s){return Bt.batch(()=>this.#t.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;Bt.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#t;return Bt.batch(()=>(s.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},a=Bt.batch(()=>this.#t.findAll(e).map(r=>r.cancel(s)));return Promise.all(a).then(ln).catch(ln)}invalidateQueries(e,t={}){return Bt.batch(()=>(this.#t.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},a=Bt.batch(()=>this.#t.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let c=r.fetch(void 0,s);return s.throwOnError||(c=c.catch(ln)),r.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(ln)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#t.build(this,t);return s.isStaleByTime(Ri(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ln).catch(ln)}fetchInfiniteQuery(e){return e.behavior=Qv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ln).catch(ln)}ensureInfiniteQueryData(e){return e.behavior=Qv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ou.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(Ko(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(a=>{Vo(e,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(e,t){this.#s.set(Ko(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(a=>{Vo(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=Um(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===Im&&(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()}},Qx=N.createContext(void 0),Yx=e=>{const t=N.useContext(Qx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},q_=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Qx.Provider,{value:e,children:t})),Jx=N.createContext(!1),Xx=()=>N.useContext(Jx);Jx.Provider;function H_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Z_=N.createContext(H_()),Wx=()=>N.useContext(Z_),eS=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?Hx(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},tS=e=>{N.useEffect(()=>{e.clearReset()},[e])},nS=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||Hx(s,[e.error,a])),sS=e=>{if(e.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...r)=>s(a(...r)):s(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},F_=(e,t)=>e.isLoading&&e.isFetching&&!t,am=(e,t)=>e?.suspense&&t.isPending,rm=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function G_({queries:e,...t},s){const a=Yx(),r=Xx(),c=Wx(),d=N.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=r?"isRestoring":"optimistic",C}),[e,a,r]);d.forEach(S=>{sS(S);const C=a.getQueryCache().get(S.queryHash);eS(S,c,C)}),tS(c);const[f]=N.useState(()=>new I_(a,d,t)),[p,m,b]=f.getOptimisticResult(d,t.combine),y=!r&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(S=>y?f.subscribe(Bt.batchCalls(S)):ln,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),N.useEffect(()=>{f.setQueries(d,t)},[d,t,f]);const x=p.some((S,C)=>am(d[C],S))?p.flatMap((S,C)=>{const _=d[C];if(_&&am(_,S)){const E=new Bm(a,_);return rm(_,E,c)}return[]}):[];if(x.length>0)throw Promise.all(x);const j=p.find((S,C)=>{const _=d[C];return _&&nS({result:S,errorResetBoundary:c,throwOnError:_.throwOnError,query:a.getQueryCache().get(_.queryHash),suspense:_.suspense})});if(j?.error)throw j.error;return m(b())}function K_(e,t,s){const a=Xx(),r=Wx(),c=Yx(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=c.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",sS(d),eS(d,r,f),tS(r);const p=!c.getQueryCache().get(d.queryHash),[m]=N.useState(()=>new t(c,d)),b=m.getOptimisticResult(d),y=!a&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(v=>{const x=y?m.subscribe(Bt.batchCalls(v)):ln;return m.updateResult(),x},[m,y]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),N.useEffect(()=>{m.setOptions(d)},[d,m]),am(d,b))throw rm(d,m,r);if(nS({result:b,errorResetBoundary:r,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw b.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,b),d.experimental_prefetchInRender&&!xa&&F_(b,a)&&(p?rm(d,m,r):f?.promise)?.catch(ln).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?b:m.trackResult(b)}function Bo(e,t){return K_(e,Bm)}var Oc=typeof window<"u"?N.useLayoutEffect:N.useEffect;function Nh(e){const t=N.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function V_(e,t,s={},a={}){N.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([c])=>{t(c)},s);return r.observe(e.current),()=>{r.disconnect()}},[t,s,a.disabled,e])}function Q_(e){const t=N.useRef(null);return N.useImperativeHandle(e,()=>t.current,[]),t}var Y_=!1;function Qo(e){return e[e.length-1]}function J_(e){return typeof e=="function"}function _i(e,t){return J_(e)?e(t):e}var X_=Object.prototype.hasOwnProperty,Xv=Object.prototype.propertyIsEnumerable,W_=()=>Object.create(null),ra=(e,t)=>da(e,t,W_);function da(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const r=t,c=tb(e)&&tb(r);if(!c&&!(lu(e)&&lu(r)))return r;const d=c?e:Wv(e);if(!d)return r;const f=c?r:Wv(r);if(!f)return r;const p=d.length,m=f.length,b=c?new Array(m):s();let y=0;for(let v=0;v<m;v++){const x=c?v:f[v],j=e[x],S=r[x];if(j===S){b[x]=j,(c?v<p:X_.call(e,x))&&y++;continue}if(j===null||S===null||typeof j!="object"||typeof S!="object"){b[x]=S;continue}const C=da(j,S,s,a+1);b[x]=C,C===j&&y++}return p===m&&y===p?e:b}function Wv(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!Xv.call(e,r))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return t;const a=t;for(const r of s){if(!Xv.call(e,r))return!1;a.push(r)}return a}function lu(e){if(!eb(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!eb(s)||!s.hasOwnProperty("isPrototypeOf"))}function eb(e){return Object.prototype.toString.call(e)==="[object Object]"}function tb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ga(e,t,s){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let a=0,r=e.length;a<r;a++)if(!ga(e[a],t[a],s))return!1;return!0}if(lu(e)&&lu(t)){const a=s?.ignoreUndefined??!0;if(s?.partial){for(const d in t)if((!a||t[d]!==void 0)&&!ga(e[d],t[d],s))return!1;return!0}let r=0;if(!a)r=Object.keys(e).length;else for(const d in e)e[d]!==void 0&&r++;let c=0;for(const d in t)if((!a||t[d]!==void 0)&&(c++,c>r||!ga(e[d],t[d],s)))return!1;return r===c}return!1}function Rr(e){let t,s;const a=new Promise((r,c)=>{t=r,s=c});return a.status="pending",a.resolve=r=>{a.status="resolved",a.value=r,t(r),e?.(r)},a.reject=r=>{a.status="rejected",s(r)},a}function Yo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function ek(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function nb(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 ek(t)}var tk=["http:","https:","mailto:","tel:"];function cu(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}function To(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let s=0,a="",r;for(;(r=t.exec(e))!==null;)a+=nb(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+nb(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function nk(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function uu(e){const t=new Map;let s,a;const r=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,a&&(a.next=c,c.prev=a)):(c.next.prev=void 0,s=c.next,c.next=void 0,a&&(c.prev=a,a.next=c)),a=c)};return{get(c){const d=t.get(c);if(d)return r(d),d.value},set(c,d){if(t.size>=e&&s){const p=s;t.delete(p.key),p.next&&(s=p.next,p.next.prev=void 0),p===a&&(a=void 0)}const f=t.get(c);if(f)f.value=d,r(f);else{const p={key:c,value:d,prev:a};a&&(a.next=p),a=p,s||(s=p),t.set(c,p)}},clear(){t.clear(),s=void 0,a=void 0}}}var sk="Invariant failed";function Li(e,t){if(!e)throw new Error(sk)}var fa=4,iS=5;function ik(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 Hm(e,t,s=new Uint16Array(6)){const a=e.indexOf("/",t),r=a===-1?e.length:a,c=e.substring(t,r);if(!c||!c.includes("$"))return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s;if(c==="$"){const f=e.length;return s[0]=2,s[1]=t,s[2]=t,s[3]=f,s[4]=f,s[5]=f,s}if(c.charCodeAt(0)===36)return s[0]=1,s[1]=t,s[2]=t+1,s[3]=r,s[4]=r,s[5]=r,s;const d=ik(c);if(d){const[f,p]=d,m=c.charCodeAt(f+1);if(m===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const b=f+3,y=p;if(b<y)return s[0]=3,s[1]=t+f,s[2]=t+b,s[3]=t+y,s[4]=t+p+1,s[5]=r,s}}else if(m===36){const b=f+1,y=f+2;return y===p?(s[0]=2,s[1]=t+f,s[2]=t+b,s[3]=t+y,s[4]=t+p+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+y,s[3]=t+p,s[4]=t+p+1,s[5]=r,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s}function Eu(e,t,s,a,r,c,d){d?.(s);let f=a;{const p=s.fullPath??s.from,m=p.length,b=s.options?.caseSensitive??e,y=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<m;){const x=Hm(p,f,t);let j;const S=f,C=x[5];switch(f=C+1,c++,x[0]){case 0:{const _=p.substring(x[2],x[3]);if(b){const E=r.static?.get(_);if(E)j=E;else{r.static??=new Map;const R=ha(s.fullPath??s.from);R.parent=r,R.depth=c,j=R,r.static.set(_,R)}}else{const E=_.toLowerCase(),R=r.staticInsensitive?.get(E);if(R)j=R;else{r.staticInsensitive??=new Map;const z=ha(s.fullPath??s.from);z.parent=r,z.depth=c,j=z,r.staticInsensitive.set(E,z)}}break}case 1:{const _=p.substring(S,x[1]),E=p.substring(x[4],C),R=b&&!!(_||E),z=_?R?_:_.toLowerCase():void 0,U=E?R?E:E.toLowerCase():void 0,O=!y&&r.dynamic?.find(M=>!M.skipOnParamError&&M.caseSensitive===R&&M.prefix===z&&M.suffix===U);if(O)j=O;else{const M=_h(1,s.fullPath??s.from,R,z,U);j=M,M.depth=c,M.parent=r,r.dynamic??=[],r.dynamic.push(M)}break}case 3:{const _=p.substring(S,x[1]),E=p.substring(x[4],C),R=b&&!!(_||E),z=_?R?_:_.toLowerCase():void 0,U=E?R?E:E.toLowerCase():void 0,O=!y&&r.optional?.find(M=>!M.skipOnParamError&&M.caseSensitive===R&&M.prefix===z&&M.suffix===U);if(O)j=O;else{const M=_h(3,s.fullPath??s.from,R,z,U);j=M,M.parent=r,M.depth=c,r.optional??=[],r.optional.push(M)}break}case 2:{const _=p.substring(S,x[1]),E=p.substring(x[4],C),R=b&&!!(_||E),z=_?R?_:_.toLowerCase():void 0,U=E?R?E:E.toLowerCase():void 0,O=_h(2,s.fullPath??s.from,R,z,U);j=O,O.parent=r,O.depth=c,r.wildcard??=[],r.wildcard.push(O)}}r=j}if(y&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const x=ha(s.fullPath??s.from);x.kind=iS,x.parent=r,c++,x.depth=c,r.pathless??=[],r.pathless.push(x),r=x}const v=(s.path||!s.children)&&!s.isRoot;if(v&&p.endsWith("/")){const x=ha(s.fullPath??s.from);x.kind=fa,x.parent=r,c++,x.depth=c,r.index=x,r=x}r.parse=s.options?.params?.parse??null,r.skipOnParamError=y,r.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,v&&!r.route&&(r.route=s,r.fullPath=s.fullPath??s.from)}if(s.children)for(const p of s.children)Eu(e,t,p,f,r,c,d)}function Ch(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ni(e){if(e.pathless)for(const t of e.pathless)Ni(t);if(e.static)for(const t of e.static.values())Ni(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ni(t);if(e.dynamic?.length){e.dynamic.sort(Ch);for(const t of e.dynamic)Ni(t)}if(e.optional?.length){e.optional.sort(Ch);for(const t of e.optional)Ni(t)}if(e.wildcard?.length){e.wildcard.sort(Ch);for(const t of e.wildcard)Ni(t)}}function ha(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 _h(e,t,s,a,r){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:s,prefix:a,suffix:r}}function ak(e,t){const s=ha("/"),a=new Uint16Array(6);for(const r of e)Eu(!1,a,r,1,s,0);Ni(s),t.masksTree=s,t.flatCache=uu(1e3)}function rk(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const a=Zm(e,t.masksTree);return t.flatCache.set(e,a),a}function ok(e,t,s,a,r){e||="/",a||="/";const c=t?`case\0${e}`:e;let d=r.singleCache.get(c);return d||(d=ha("/"),Eu(t,new Uint16Array(6),{from:e},1,d,0),r.singleCache.set(c,d)),Zm(a,d,s)}function lk(e,t,s=!1){const a=s?e:`nofuzz\0${e}`,r=t.matchCache.get(a);if(r!==void 0)return r;e||="/";let c;try{c=Zm(e,t.segmentTree,s)}catch(d){if(d instanceof URIError)c=null;else throw d}return c&&(c.branch=dk(c.route)),t.matchCache.set(a,c),c}function ck(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function uk(e,t=!1,s){const a=ha(e.fullPath),r=new Uint16Array(6),c={},d={};let f=0;return Eu(t,r,e,1,a,0,p=>{if(s?.(p,f),Li(!(p.id in c),`Duplicate routes found with id: ${String(p.id)}`),c[p.id]=p,f!==0&&p.path){const m=ck(p.fullPath);(!d[m]||p.fullPath.endsWith("/"))&&(d[m]=p)}f++}),Ni(a),{processedTree:{segmentTree:a,singleCache:uu(1e3),matchCache:uu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:d}}function Zm(e,t,s=!1){const a=e.split("/"),r=hk(e,a,t,s);if(!r)return null;const[c]=aS(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function aS(e,t,s){const a=fk(s.node);let r=null;const c=Object.create(null);let d=s.extract?.part??0,f=s.extract?.node??0,p=s.extract?.path??0,m=s.extract?.segment??0;for(;f<a.length;d++,f++,p++,m++){const b=a[f];if(b.kind===fa)break;if(b.kind===iS){m--,d--,p--;continue}const y=t[d],v=p;if(y&&(p+=y.length),b.kind===1){r??=s.node.fullPath.split("/");const x=r[m],j=b.prefix?.length??0;if(x.charCodeAt(j)===123){const S=b.suffix?.length??0,C=x.substring(j+2,x.length-S-1),_=y.substring(j,y.length-S);c[C]=decodeURIComponent(_)}else{const S=x.substring(1);c[S]=decodeURIComponent(y)}}else if(b.kind===3){if(s.skipped&1<<f){d--,p=v-1;continue}r??=s.node.fullPath.split("/");const x=r[m],j=b.prefix?.length??0,S=b.suffix?.length??0,C=x.substring(j+3,x.length-S-1),_=b.suffix||b.prefix?y.substring(j,y.length-S):y;_&&(c[C]=decodeURIComponent(_))}else if(b.kind===2){const x=b,j=e.substring(v+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),S=decodeURIComponent(j);c["*"]=S,c._splat=S;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:d,node:f,path:p,segment:m}]}function dk(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function fk(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function hk(e,t,s,a){if(e==="/"&&s.index)return{node:s.index,skipped:0};const r=!Qo(t),c=r&&e!=="/",d=t.length-(r?1:0),f=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let p=null,m=null,b=null;for(;f.length;){const y=f.pop(),{node:v,index:x,skipped:j,depth:S,statics:C,dynamics:_,optionals:E}=y;let{extract:R,rawParams:z,parsedParams:U}=y;if(v.skipOnParamError){if(!kh(e,t,y))continue;z=y.rawParams,R=y.extract,U=y.parsedParams}a&&v.route&&v.kind!==fa&&Do(m,y)&&(m=y);const O=x===d;if(O&&(v.route&&!c&&Do(b,y)&&(b=y),!v.optional&&!v.wildcard&&!v.index&&!v.pathless))continue;const M=O?void 0:t[x];let A;if(O&&v.index){const B={node:v.index,index:x,skipped:j,depth:S+1,statics:C,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U};let ie=!0;if(v.index.skipOnParamError&&(kh(e,t,B)||(ie=!1)),ie){if(C===d&&!_&&!E&&!j)return B;Do(b,B)&&(b=B)}}if(v.wildcard&&Do(p,y))for(const B of v.wildcard){const{prefix:ie,suffix:Q}=B;if(ie&&(O||!(B.caseSensitive?M:A??=M.toLowerCase()).startsWith(ie)))continue;if(Q){if(O)continue;const me=t.slice(x).join("/").slice(-Q.length);if((B.caseSensitive?me:me.toLowerCase())!==Q)continue}const ne={node:B,index:d,skipped:j,depth:S,statics:C,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U};if(!(B.skipOnParamError&&!kh(e,t,ne))){p=ne;break}}if(v.optional){const B=j|1<<S,ie=S+1;for(let Q=v.optional.length-1;Q>=0;Q--){const ne=v.optional[Q];f.push({node:ne,index:x,skipped:B,depth:ie,statics:C,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U})}if(!O)for(let Q=v.optional.length-1;Q>=0;Q--){const ne=v.optional[Q],{prefix:me,suffix:ze}=ne;if(me||ze){const we=ne.caseSensitive?M:A??=M.toLowerCase();if(me&&!we.startsWith(me)||ze&&!we.endsWith(ze))continue}f.push({node:ne,index:x+1,skipped:j,depth:ie,statics:C,dynamics:_,optionals:E+1,extract:R,rawParams:z,parsedParams:U})}}if(!O&&v.dynamic&&M)for(let B=v.dynamic.length-1;B>=0;B--){const ie=v.dynamic[B],{prefix:Q,suffix:ne}=ie;if(Q||ne){const me=ie.caseSensitive?M:A??=M.toLowerCase();if(Q&&!me.startsWith(Q)||ne&&!me.endsWith(ne))continue}f.push({node:ie,index:x+1,skipped:j,depth:S+1,statics:C,dynamics:_+1,optionals:E,extract:R,rawParams:z,parsedParams:U})}if(!O&&v.staticInsensitive){const B=v.staticInsensitive.get(A??=M.toLowerCase());B&&f.push({node:B,index:x+1,skipped:j,depth:S+1,statics:C+1,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U})}if(!O&&v.static){const B=v.static.get(M);B&&f.push({node:B,index:x+1,skipped:j,depth:S+1,statics:C+1,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U})}if(v.pathless){const B=S+1;for(let ie=v.pathless.length-1;ie>=0;ie--){const Q=v.pathless[ie];f.push({node:Q,index:x,skipped:j,depth:B,statics:C,dynamics:_,optionals:E,extract:R,rawParams:z,parsedParams:U})}}}if(b&&p)return Do(p,b)?b:p;if(b)return b;if(p)return p;if(a&&m){let y=m.index;for(let x=0;x<m.index;x++)y+=t[x].length;const v=y===e.length?"/":e.slice(y);return m.rawParams??=Object.create(null),m.rawParams["**"]=decodeURIComponent(v),m}return null}function kh(e,t,s){try{const[a,r]=aS(e,t,s);s.rawParams=a,s.extract=r;const c=s.node.parse(a);return s.parsedParams=Object.assign(Object.create(null),s.parsedParams,c),!0}catch{return null}}function Do(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===fa)>(e.node.kind===fa)||t.node.kind===fa==(e.node.kind===fa)&&t.depth>e.depth))):!0}function Yc(e){return Fm(e.filter(t=>t!==void 0).join("/"))}function Fm(e){return e.replace(/\/{2,}/g,"/")}function rS(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Oi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function oS(e){return Oi(rS(e))}function du(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function mk(e,t,s){return du(e,s)===du(t,s)}function pk({base:e,to:t,trailingSlash:s="never",cache:a}){const r=t.startsWith("/"),c=!r&&t===".";let d;if(a){d=r?t:c?e:e+"\0"+t;const y=a.get(d);if(y)return y}let f;if(c)f=e.split("/");else if(r)f=t.split("/");else{for(f=e.split("/");f.length>1&&Qo(f)==="";)f.pop();const y=t.split("/");for(let v=0,x=y.length;v<x;v++){const j=y[v];j===""?v?v===x-1&&f.push(j):f=[j]:j===".."?f.pop():j==="."||f.push(j)}}f.length>1&&(Qo(f)===""?s==="never"&&f.pop():s==="always"&&f.push(""));let p,m="";for(let y=0;y<f.length;y++){y>0&&(m+="/");const v=f[y];if(!v)continue;p=Hm(v,0,p);const x=p[0];if(x===0){m+=v;continue}const j=p[5],S=v.substring(0,p[1]),C=v.substring(p[4],j),_=v.substring(p[2],p[3]);x===1?m+=S||C?`${S}{$${_}}${C}`:`$${_}`:x===2?m+=S||C?`${S}{$}${C}`:"$":m+=`${S}{-$${_}}${C}`}m=Fm(m);const b=m||"/";return d&&a&&a.set(d,b),b}function gk(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),s=Array.from(t.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(s,"g");return r=>r.replace(a,c=>t.get(c)??c)}function zh(e,t,s){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(r=>ib(r,s)).join("/"):ib(a,s)}function sb({path:e,params:t,decoder:s,...a}){let r=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:r};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:r};const d=e.length;let f=0,p,m="";for(;f<d;){const b=f;p=Hm(e,b,p);const y=p[5];if(f=y+1,b===y)continue;const v=p[0];if(v===0){m+="/"+e.substring(b,y);continue}if(v===2){const x=t._splat;c._splat=x,c["*"]=x;const j=e.substring(b,p[1]),S=e.substring(p[4],y);if(!x){r=!0,(j||S)&&(m+="/"+j+S);continue}const C=zh("_splat",t,s);m+="/"+j+C+S;continue}if(v===1){const x=e.substring(p[2],p[3]);!r&&!(x in t)&&(r=!0),c[x]=t[x];const j=e.substring(b,p[1]),S=e.substring(p[4],y),C=zh(x,t,s)??"undefined";m+="/"+j+C+S;continue}if(v===3){const x=e.substring(p[2],p[3]),j=t[x];if(j==null)continue;c[x]=j;const S=e.substring(b,p[1]),C=e.substring(p[4],y),_=zh(x,t,s)??"";m+="/"+S+_+C;continue}}return e.endsWith("/")&&(m+="/"),{usedParams:c,interpolatedPath:m||"/",isMissingParams:r}}function ib(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function un(e){return!!e?.isNotFound}function yk(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var om="tsr-scroll-restoration-v1_3",vk=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function bk(){const e=yk();if(!e)return null;const t=e.getItem(om);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=_i(a,s)||s;try{e.setItem(om,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Ac=bk(),xk=e=>e.state.__TSR_key||e.href;function Sk(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 fu=!1;function wk({storageKey:e,key:t,behavior:s,shouldScrollRestoration:a,scrollToTopSelectors:r,location:c}){let d;try{d=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(m){console.error(m);return}const f=t||window.history.state?.__TSR_key,p=d[f];fu=!0;e:{if(a&&p&&Object.keys(p).length>0){for(const y in p){const v=p[y];if(y==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:s});else if(y){const x=document.querySelector(y);x&&(x.scrollLeft=v.scrollX,x.scrollTop=v.scrollY)}}break e}const m=(c??window.location).hash.split("#",2)[1];if(m){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const v=document.getElementById(m);v&&v.scrollIntoView(y)}break e}const b={top:0,left:0,behavior:s};if(window.scrollTo(b),r)for(const y of r){if(y==="window")continue;const v=typeof y=="function"?y():document.querySelector(y);v&&v.scrollTo(b)}}fu=!1}function jk(e,t){if(!Ac||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Ac))return;e.isScrollRestorationSetup=!0,fu=!1;const s=e.options.getScrollRestorationKey||xk;window.history.scrollRestoration="manual";const a=r=>{if(fu||!e.isScrollRestoring)return;let c="";if(r.target===document||r.target===window)c="window";else{const f=r.target.getAttribute("data-scroll-restoration-id");f?c=`[data-scroll-restoration-id="${f}"]`:c=Sk(r.target)}const d=s(e.state.location);Ac.set(f=>{const p=f[d]||={},m=p[c]||={};if(c==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(c){const b=document.querySelector(c);b&&(m.scrollX=b.scrollLeft||0,m.scrollY=b.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",vk(a,100),!0),e.subscribe("onRendered",r=>{const c=s(r.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(wk({storageKey:om,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Ac.set(d=>(d[c]||={},d)))})}function Nk(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 Ck(e,t=String){const s=new URLSearchParams;for(const a in e){const r=e[a];r!==void 0&&s.set(a,t(r))}return s.toString()}function Eh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function _k(e){const t=new URLSearchParams(e),s=Object.create(null);for(const[a,r]of t.entries()){const c=s[a];c==null?s[a]=Eh(r):Array.isArray(c)?c.push(Eh(r)):s[a]=[c,Eh(r)]}return s}var kk=Ek(JSON.parse),zk=Rk(JSON.stringify,JSON.parse);function Ek(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=_k(t);for(const a in s){const r=s[a];if(typeof r=="string")try{s[a]=e(r)}catch{}}return s}}function Rk(e,t){const s=typeof t=="function";function a(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(s&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const c=Ck(r,a);return c?`?${c}`:""}}var ya="__root__";function Gm(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 bn(e){return e instanceof Response&&!!e.options}function Ok(e){return{input:({url:t})=>{for(const s of e)t=lm(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=lS(e[s],t);return t}}}function Ak(e){const t=oS(e.basepath),s=`/${t}`,a=`${s}/`,r=e.caseSensitive?s:s.toLowerCase(),c=e.caseSensitive?a:a.toLowerCase();return{input:({url:d})=>{const f=e.caseSensitive?d.pathname:d.pathname.toLowerCase();return f===r?d.pathname="/":f.startsWith(c)&&(d.pathname=d.pathname.slice(s.length)),d},output:({url:d})=>(d.pathname=Yc(["/",t,d.pathname]),d)}}function lm(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 lS(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 yt=(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))(yt||{});function cS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:d,shallowPropagate:f};function a(m,b,y){const v=b.depsTail;if(v!==void 0&&v.dep===m)return;const x=v!==void 0?v.nextDep:b.deps;if(x!==void 0&&x.dep===m){x.version=y,b.depsTail=x;return}const j=m.subsTail;if(j!==void 0&&j.version===y&&j.sub===b)return;const S=b.depsTail=m.subsTail={version:y,dep:m,sub:b,prevDep:v,nextDep:x,prevSub:j,nextSub:void 0};x!==void 0&&(x.prevDep=S),v!==void 0?v.nextDep=S:b.deps=S,j!==void 0?j.nextSub=S:m.subs=S}function r(m,b=m.sub){const y=m.dep,v=m.prevDep,x=m.nextDep,j=m.nextSub,S=m.prevSub;return x!==void 0?x.prevDep=v:b.depsTail=v,v!==void 0?v.nextDep=x:b.deps=x,j!==void 0?j.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=j:(y.subs=j)===void 0&&s(y),x}function c(m){let b=m.nextSub,y;e:do{const v=m.sub;let x=v.flags;if(x&60?x&12?x&4?!(x&48)&&p(m,v)?(v.flags=x|40,x&=1):x=0:v.flags=x&-9|32:x=0:v.flags=x|32,x&2&&t(v),x&1){const j=v.subs;if(j!==void 0){const S=(m=j).nextSub;S!==void 0&&(y={value:b,prev:y},b=S);continue}}if((m=b)!==void 0){b=m.nextSub;continue}for(;y!==void 0;)if(m=y.value,y=y.prev,m!==void 0){b=m.nextSub;continue e}break}while(!0)}function d(m,b){let y,v=0,x=!1;e:do{const j=m.dep,S=j.flags;if(b.flags&16)x=!0;else if((S&17)===17){if(e(j)){const C=j.subs;C.nextSub!==void 0&&f(C),x=!0}}else if((S&33)===33){(m.nextSub!==void 0||m.prevSub!==void 0)&&(y={value:m,prev:y}),m=j.deps,b=j,++v;continue}if(!x){const C=m.nextDep;if(C!==void 0){m=C;continue}}for(;v--;){const C=b.subs,_=C.nextSub!==void 0;if(_?(m=y.value,y=y.prev):m=C,x){if(e(b)){_&&f(C),b=m.sub;continue}x=!1}else b.flags&=-33;b=m.sub;const E=m.nextDep;if(E!==void 0){m=E;continue e}}return x}while(!0)}function f(m){do{const b=m.sub,y=b.flags;(y&48)===32&&(b.flags=y|16,(y&6)===2&&t(b))}while((m=m.nextSub)!==void 0)}function p(m,b){let y=b.depsTail;for(;y!==void 0;){if(y===m)return!0;y=y.prevDep}return!1}}let Km=0,oa=0,qo=0;const Bs=[],{link:N3,unlink:uS,propagate:C3,checkDirty:Tk,shallowPropagate:_3}=cS({update(e){return e.depsTail!==void 0?Uk(e):Pk(e)},notify(e){let t=qo,s=t;do if(Bs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(qo=t;s<--t;){const a=Bs[s];Bs[s++]=Bs[t],Bs[t]=a}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Ru(e)):Bk.call(e)}});function Dk(){return Km}function Lk(){++Km}function Mk(){--Km||$k()}function Uk(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Ru(e)}}function Pk(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Ik(e){const t=e.flags;if(t&16||t&32&&Tk(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Ru(e)}}else e.flags=2}function $k(){try{for(;oa<qo;){const e=Bs[oa];Bs[oa++]=void 0,Ik(e)}}finally{for(;oa<qo;){const e=Bs[oa];Bs[oa++]=void 0,e.flags|=10}oa=0,qo=0}}function Bk(){this.depsTail=void 0,this.flags=0,Ru(this);const e=this.subs;e!==void 0&&uS(e)}function Ru(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=uS(s,e)}function Vm(e,t,s){const a=typeof e=="object",r=a?e:void 0;return{next:(a?e.next:e)?.bind(r),error:(a?e.error:t)?.bind(r),complete:(a?e.complete:s)?.bind(r)}}const cm=[];let Jc=0;const{link:ab,unlink:qk,propagate:Hk,checkDirty:dS,shallowPropagate:rb}=cS({update(e){return e._update()},notify(e){cm[um++]=e,e.flags&=~yt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=yt.Mutable|yt.Dirty,hu(e))}});let Tc=0,um=0,gs;function hu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=qk(s,e)}function fS(){if(!(Dk()>0)){for(;Tc<um;){const e=cm[Tc];cm[Tc++]=void 0,e.notify()}Tc=0,um=0}}function hS(e,t){const s=typeof e=="function",a=e,r={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?yt.None:yt.Mutable,get(){return gs!==void 0&&ab(r,gs,Jc),r._snapshot},subscribe(c){const d=Vm(c),f={current:!1},p=Zk(()=>{r.get(),f.current?d.next?.(r._snapshot):f.current=!0});return{unsubscribe:()=>{p.stop()}}},_update(c){const d=gs,f=Object.is;if(s)gs=r,++Jc,r.depsTail=void 0;else if(c===void 0)return!1;s&&(r.flags=yt.Mutable|yt.RecursedCheck);try{const p=r._snapshot,m=typeof c=="function"?c(p):c===void 0&&s?a(p):c;return p===void 0||!f(p,m)?(r._snapshot=m,!0):!1}finally{gs=d,s&&(r.flags&=~yt.RecursedCheck),hu(r)}}};return s?(r.flags=yt.Mutable|yt.Dirty,r.get=function(){const c=r.flags;if(c&yt.Dirty||c&yt.Pending&&dS(r.deps,r)){if(r._update()){const d=r.subs;d!==void 0&&rb(d)}}else c&yt.Pending&&(r.flags=c&~yt.Pending);return gs!==void 0&&ab(r,gs,Jc),r._snapshot}):r.set=function(c){if(r._update(c)){const d=r.subs;d!==void 0&&(Hk(d),rb(d),fS())}},r}function Zk(e){const t=()=>{const a=gs;gs=s,++Jc,s.depsTail=void 0,s.flags=yt.Watching|yt.RecursedCheck;try{return e()}finally{gs=a,s.flags&=~yt.RecursedCheck,hu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:yt.Watching|yt.RecursedCheck,notify(){const a=this.flags;a&yt.Dirty||a&yt.Pending&&dS(this.deps,this)?t():this.flags=yt.Watching},stop(){this.flags=yt.None,this.depsTail=void 0,hu(this)}};return t(),s}class Fk{constructor(t){this.atom=hS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Vm(t))}}class Gk{constructor(t){this.atom=hS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Vm(t))}}function Kk(e){return typeof e=="function"?new Gk(e):new Fk(e)}function Vk(e){try{Lk(),e()}finally{Mk(),fS()}}function Ho(e){let t;return Vk(()=>{t=e()}),t}var dm=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ou=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),va=(e,t,s=!0)=>{const a={...e.router.options.context??{}},r=s?t:t-1;for(let c=0;c<=r;c++){const d=e.matches[c];if(!d)continue;const f=e.router.getMatch(d.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},ob=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,a=e.matches.findIndex(d=>d.routeId===e.router.routeTree.id),r=a>=0?a:0;let c=s?e.matches.findIndex(d=>d.routeId===s):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=r);for(let d=c;d>=0;d--){const f=e.matches[d];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return d}return s?c:r},ki=(e,t,s)=>{if(!(!bn(s)&&!un(s)))throw bn(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:bn(s)?"redirected":a.status==="pending"?"success":a.status,context:va(e,t.index),isFetching:!1,error:s})),un(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),bn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},mS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},lb=(e,t,s)=>{const a=va(e,s);e.updateMatch(t,r=>({...r,context:a}))},Lo=(e,t,s,a)=>{const{id:r,routeId:c}=e.matches[t],d=e.router.looseRoutesById[c];if(s instanceof Promise)throw s;s.routerCode=a,e.firstBadMatchIndex??=t,ki(e,e.router.getMatch(r),s);try{d.options.onError?.(s)}catch(f){s=f,ki(e,e.router.getMatch(r),s)}e.updateMatch(r,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!bn(s)&&!un(s)&&(e.serialError??=s)},pS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ou(e,t)&&(s.options.loader||s.options.beforeLoad||yS(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{dm(e)},r);a._nonReactive.pendingTimeout=c}},Qk=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;pS(e,t,s,a);const r=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&ki(e,c,c.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(r):r()},Yk=(e,t,s,a)=>{const r=e.router.getMatch(t);let c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Rr(()=>{c?.resolve(),c=void 0});const{paramsError:d,searchError:f}=r;d&&Lo(e,s,d,"PARSE_PARAMS"),f&&Lo(e,s,f,"VALIDATE_SEARCH"),pS(e,t,a,r);const p=new AbortController;let m=!1;const b=()=>{m||(m=!0,e.updateMatch(t,z=>({...z,isFetching:"beforeLoad",fetchCount:z.fetchCount+1,abortController:p})))},y=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,z=>({...z,isFetching:!1}))};if(!a.options.beforeLoad){Ho(()=>{b(),y()});return}r._nonReactive.beforeLoadPromise=Rr();const v={...va(e,s,!1),...r.__routeContext},{search:x,params:j,cause:S}=r,C=Ou(e,t),_={search:x,abortController:p,params:j,preload:C,context:v,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){Ho(()=>{b(),y()});return}(bn(z)||un(z))&&(b(),Lo(e,s,z,"BEFORE_LOAD")),Ho(()=>{b(),e.updateMatch(t,U=>({...U,__beforeLoadContext:z})),y()})};let R;try{if(R=a.options.beforeLoad(_),Yo(R))return b(),R.catch(z=>{Lo(e,s,z,"BEFORE_LOAD")}).then(E)}catch(z){b(),Lo(e,s,z,"BEFORE_LOAD")}E(R)},Jk=(e,t)=>{const{id:s,routeId:a}=e.matches[t],r=e.router.looseRoutesById[a],c=()=>f(),d=()=>Yk(e,s,t,r),f=()=>{if(mS(e,s))return;const p=Qk(e,s,r);return Yo(p)?p.then(d):d()};return c()},Xk=(e,t,s)=>{const a=e.router.getMatch(t);if(!a||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([s.options.head?.(r),s.options.scripts?.(r),s.options.headers?.(r)]).then(([c,d,f])=>({meta:c?.meta,links:c?.links,headScripts:c?.scripts,headers:f,scripts:d,styles:c?.styles}))},gS=(e,t,s,a,r)=>{const c=t[a-1],{params:d,loaderDeps:f,abortController:p,cause:m}=e.router.getMatch(s),b=va(e,a),y=Ou(e,s);return{params:d,deps:f,preload:!!y,parentMatchPromise:c,abortController:p,context:b,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:y?"preload":m,route:r,...e.router.options.additionalContext}},cb=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!(Y_??e.router.isServer)||c.ssr===!0)&&Jo(r);const d=r.options.loader,f=typeof d=="function"?d:d?.handler,p=f?.(gS(e,t,s,a,r)),m=!!f&&Yo(p);if((m||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(s,y=>({...y,isFetching:"loader"})),f){const y=m?await p:p;ki(e,e.router.getMatch(s),y),y!==void 0&&e.updateMatch(s,v=>({...v,loaderData:y}))}r._lazyPromise&&await r._lazyPromise;const b=c._nonReactive.minPendingPromise;b&&await b,r._componentsPromise&&await r._componentsPromise,e.updateMatch(s,y=>({...y,error:void 0,context:va(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let f=d;if(f?.name==="AbortError"){if(c.abortController.signal.aborted){c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:va(e,a)}));return}const p=c._nonReactive.minPendingPromise;p&&await p,un(d)&&await r.options.notFoundComponent?.preload?.(),ki(e,e.router.getMatch(s),d);try{r.options.onError?.(d)}catch(m){f=m,ki(e,e.router.getMatch(s),m)}!bn(f)&&!un(f)&&await Jo(r,["errorComponent"]),e.updateMatch(s,m=>({...m,error:f,context:va(e,a),status:"error",isFetching:!1}))}}catch(c){const d=e.router.getMatch(s);d&&(d._nonReactive.loaderPromise=void 0),ki(e,d,c)}},Wk=async(e,t,s)=>{async function a(x,j,S,C,_){const E=Date.now()-j.updatedAt,R=x?_.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:_.options.staleTime??e.router.options.defaultStaleTime??0,z=_.options.shouldReload,U=typeof z=="function"?z(gS(e,t,r,s,_)):z,{status:O,invalid:M}=C,A=E>R&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);d=O==="success"&&(M||(U??A)),x&&_.options.preload===!1||(d&&!e.sync&&b?(f=!0,(async()=>{try{await cb(e,t,r,s,_);const B=e.router.getMatch(r);B._nonReactive.loaderPromise?.resolve(),B._nonReactive.loadPromise?.resolve(),B._nonReactive.loaderPromise=void 0,B._nonReactive.loadPromise=void 0}catch(B){bn(B)&&await e.router.navigate(B.options)}})()):O!=="success"||d?await cb(e,t,r,s,_):lb(e,r,s))}const{id:r,routeId:c}=e.matches[s];let d=!1,f=!1;const p=e.router.looseRoutesById[c],m=p.options.loader,b=((typeof m=="function"?void 0:m?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(mS(e,r)){if(!e.router.getMatch(r))return e.matches[s];lb(e,r,s)}else{const x=e.router.getMatch(r),j=e.router.state.matches[s]?.routeId===c?e.router.state.matches[s].id:e.router.state.matches.find(C=>C.routeId===c)?.id,S=Ou(e,r);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&b)return x;await x._nonReactive.loaderPromise;const C=e.router.getMatch(r),_=C._nonReactive.error||C.error;_&&ki(e,C,_),C.status==="pending"&&await a(S,x,j,C,p)}else{const C=S&&!e.router.state.matches.some(E=>E.id===r),_=e.router.getMatch(r);_._nonReactive.loaderPromise=Rr(),C!==_.preload&&e.updateMatch(r,E=>({...E,preload:C})),await a(S,x,j,_,p)}}const y=e.router.getMatch(r);f||(y._nonReactive.loaderPromise?.resolve(),y._nonReactive.loadPromise?.resolve(),y._nonReactive.loadPromise=void 0),clearTimeout(y._nonReactive.pendingTimeout),y._nonReactive.pendingTimeout=void 0,f||(y._nonReactive.loaderPromise=void 0),y._nonReactive.dehydrated=void 0;const v=f?y.isFetching:!1;return v!==y.isFetching||y.invalid!==!1?(e.updateMatch(r,x=>({...x,isFetching:v,invalid:!1})),e.router.getMatch(r)):y};async function ub(e){const t=e,s=[];t.router.state.matches.some(v=>v._forcePending)&&dm(t);let a;for(let v=0;v<t.matches.length;v++){try{const x=Jk(t,v);Yo(x)&&await x}catch(x){if(bn(x))throw x;if(un(x))a=x;else if(!t.preload)throw x;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,c=a&&!t.preload?ob(t,a):void 0,d=a&&t.preload?0:c!==void 0?Math.min(c+1,r):r;let f,p;for(let v=0;v<d;v++)s.push(Wk(t,s,v));try{await Promise.all(s)}catch{const v=await Promise.allSettled(s);for(const x of v){if(x.status!=="rejected")continue;const j=x.reason;if(bn(j))throw j;un(j)?f??=j:p??=j}if(p!==void 0)throw p}const m=f??(a&&!t.preload?a:void 0);let b=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!m&&a&&t.preload)return t.matches;if(m){const v=ob(t,m);Li(v!==void 0);const x=t.matches[v],j=t.router.looseRoutesById[x.routeId],S=t.router.options?.defaultNotFoundComponent;!j.options.notFoundComponent&&S&&(j.options.notFoundComponent=S),m.routeId=x.routeId;const C=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,_=>({..._,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:m},isFetching:!1})),b=v,await Jo(j,["notFoundComponent"])}else if(!t.preload){const v=t.matches[0];v.globalNotFound||t.router.getMatch(v.id)?.globalNotFound&&t.updateMatch(v.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const v=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Jo(v,["errorComponent"])}for(let v=0;v<=b;v++){const{id:x,routeId:j}=t.matches[v],S=t.router.looseRoutesById[j];try{const C=Xk(t,x,S);if(C){const _=await C;t.updateMatch(x,E=>({...E,..._}))}}catch(C){console.error(`Error executing head for route ${j}:`,C)}}const y=dm(t);if(Yo(y)&&await y,m)throw m;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function db(e,t){const s=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function Jo(e,t=Xc){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:r,...c}=a.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:t===Xc?(()=>{if(e._componentsPromise===void 0){const a=db(e,Xc);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():db(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function yS(e){for(const t of Xc)if(e.options[t]?.preload)return!0;return!1}var Xc=["component","errorComponent","pendingComponent","notFoundComponent"],Ai="__TSR_index",fb="popstate",hb="beforeunload";function ez(e){let t=e.getLocation();const s=new Set,a=d=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:d}))},r=d=>{e.notifyOnIndexChange??!0?a(d):t=e.getLocation()},c=async({task:d,navigateOpts:f,...p})=>{if(f?.ignoreBlocker??!1){d();return}const m=e.getBlockers?.()??[],b=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&m.length&&b)for(const y of m){const v=mu(p.path,p.state);if(await y.blockerFn({currentLocation:t,nextLocation:v,action:p.type})){e.onBlocked?.();return}}d()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:d=>(s.add(d),()=>{s.delete(d)}),push:(d,f,p)=>{const m=t.state[Ai];f=mb(m+1,f),c({task:()=>{e.pushState(d,f),a({type:"PUSH"})},navigateOpts:p,type:"PUSH",path:d,state:f})},replace:(d,f,p)=>{const m=t.state[Ai];f=mb(m,f),c({task:()=>{e.replaceState(d,f),a({type:"REPLACE"})},navigateOpts:p,type:"REPLACE",path:d,state:f})},go:(d,f)=>{c({task:()=>{e.go(d),r({type:"GO",index:d})},navigateOpts:f,type:"GO"})},back:d=>{c({task:()=>{e.back(d?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:d,type:"BACK"})},forward:d=>{c({task:()=>{e.forward(d?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:d,type:"FORWARD"})},canGoBack:()=>t.state[Ai]!==0,createHref:d=>e.createHref(d),block:d=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,d]),()=>{const p=e.getBlockers?.()??[];e.setBlockers?.(p.filter(m=>m!==d))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function mb(e,t){t||(t={});const s=Qm();return{...t,key:s,__TSR_key:s,[Ai]:e}}function tz(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,a=t.history.replaceState;let r=[];const c=()=>r,d=A=>r=A,f=(A=>A),p=(()=>mu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=Qm();t.history.replaceState({[Ai]:0,key:A,__TSR_key:A},"")}let m=p(),b,y=!1,v=!1,x=!1,j=!1;const S=()=>m;let C,_;const E=()=>{C&&(M._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),M._ignoreSubscribers=!1,C=void 0,_=void 0,b=void 0)},R=(A,B,ie)=>{const Q=f(B);_||(b=m),m=mu(B,ie),C={href:Q,state:ie,isPush:C?.isPush||A==="push"},_||(_=Promise.resolve().then(()=>E()))},z=A=>{m=p(),M.notify({type:A})},U=async()=>{if(v){v=!1;return}const A=p(),B=A.state[Ai]-m.state[Ai],ie=B===1,Q=B===-1,ne=!ie&&!Q||y;y=!1;const me=ne?"GO":Q?"BACK":"FORWARD",ze=ne?{type:"GO",index:B}:{type:Q?"BACK":"FORWARD"};if(x)x=!1;else{const we=c();if(typeof document<"u"&&we.length){for(const q of we)if(await q.blockerFn({currentLocation:m,nextLocation:A,action:me})){v=!0,t.history.go(1),M.notify(ze);return}}}m=p(),M.notify(ze)},O=A=>{if(j){j=!1;return}let B=!1;const ie=c();if(typeof document<"u"&&ie.length)for(const Q of ie){const ne=Q.enableBeforeUnload??!0;if(ne===!0){B=!0;break}if(typeof ne=="function"&&ne()===!0){B=!0;break}}if(B)return A.preventDefault(),A.returnValue=""},M=ez({getLocation:S,getLength:()=>t.history.length,pushState:(A,B)=>R("push",A,B),replaceState:(A,B)=>R("replace",A,B),back:A=>(A&&(x=!0),j=!0,t.history.back()),forward:A=>{A&&(x=!0),j=!0,t.history.forward()},go:A=>{y=!0,t.history.go(A)},createHref:A=>f(A),flush:E,destroy:()=>{t.history.pushState=s,t.history.replaceState=a,t.removeEventListener(hb,O,{capture:!0}),t.removeEventListener(fb,U)},onBlocked:()=>{b&&m!==b&&(m=b)},getBlockers:c,setBlockers:d,notifyOnIndexChange:!1});return t.addEventListener(hb,O,{capture:!0}),t.addEventListener(fb,U),t.history.pushState=function(...A){const B=s.apply(t.history,A);return M._ignoreSubscribers||z("PUSH"),B},t.history.replaceState=function(...A){const B=a.apply(t.history,A);return M._ignoreSubscribers||z("REPLACE"),B},M}function nz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function mu(e,t){const s=nz(e),a=s.indexOf("#"),r=s.indexOf("?"),c=Qm();return{href:s,pathname:s.substring(0,a>0?r>0?Math.min(a,r):a:r>0?r:s.length),hash:a>-1?s.substring(a):"",search:r>-1?s.slice(r,a===-1?void 0:a):"",state:t||{[Ai]:0,key:c,__TSR_key:c}}}function Qm(){return(Math.random()+1).toString(36).substring(7)}function ba(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 sz(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var iz=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{const s=this.options,a=this.basepath??s?.basepath??"/",r=this.basepath===void 0,c=s?.rewrite;if(this.options={...s,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=gk(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=tz()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let m;this.resolvePathCache=uu(1e3),m=this.buildRouteTree(),this.setRoutes(m)}!this.__store&&this.latestLocation&&(this.__store=Kk(rz(this.latestLocation)),jk(this));let d=!1;const f=this.options.basepath??"/",p=this.options.rewrite;if(r||a!==f||c!==p){this.basepath=f;const m=[],b=oS(f);b&&b!=="/"&&m.push(Ak({basepath:f})),p&&m.push(p),this.rewrite=m.length===0?void 0:m.length===1?m[0]:Ok(m),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&this.__store.setState(m=>({...m,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=uk(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&ak(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,s)=>{const a={eventType:t,fn:s};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const a=({pathname:f,search:p,hash:m,href:b,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const C=this.options.parseSearch(p),_=this.options.stringifySearch(C);return{href:f+_+m,publicHref:b,pathname:To(f).path,external:!1,searchStr:_,search:ra(s?.search,C),hash:To(m.slice(1)).path,state:da(s?.state,y)}}const v=new URL(b,this.origin),x=lm(this.rewrite,v),j=this.options.parseSearch(x.search),S=this.options.stringifySearch(j);return x.search=S,{href:x.href.replace(x.origin,""),publicHref:b,pathname:To(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:S,search:ra(s?.search,j),hash:To(x.hash.slice(1)).path,state:da(s?.state,y)}},r=a(t),{__tempLocation:c,__tempKey:d}=r.state;if(c&&(!d||d===this.tempLocationKey)){const f=a(c);return f.state.key=r.state.key,f.state.__TSR_key=r.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:r}}return r},this.resolvePathWithBase=(t,s)=>pk({base:t,to:Fm(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=>oz({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const s=this.getMatch(t);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=t=>{const s=(r={})=>{const c=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(c);r.from;const f=r.unsafeRelative==="path"?c.pathname:r.from??d.fullPath,p=this.resolvePathWithBase(f,"."),m=d.search,b=Object.assign(Object.create(null),d.params),y=r.to?this.resolvePathWithBase(p,`${r.to}`):this.resolvePathWithBase(p,"."),v=r.params===!1||r.params===null?Object.create(null):(r.params??!0)===!0?b:Object.assign(b,_i(r.params,b)),x=this.getMatchedRoutes(y);let j=x.matchedRoutes;if((!x.foundRoute||x.foundRoute.path!=="/"&&x.routeParams["**"])&&this.options.notFoundRoute&&(j=[...j,this.options.notFoundRoute]),Object.keys(v).length>0)for(const B of j){const ie=B.options.params?.stringify??B.options.stringifyParams;if(ie)try{Object.assign(v,ie(v))}catch{}}const S=t.leaveParams?y:To(sb({path:y,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=m;if(t._includeValidateSearch&&this.options.search?.strict){const B={};j.forEach(ie=>{if(ie.options.validateSearch)try{Object.assign(B,Wc(ie.options.validateSearch,{...B,...C}))}catch{}}),C=B}C=lz({search:C,dest:r,destRoutes:j,_includeValidateSearch:t._includeValidateSearch}),C=ra(m,C);const _=this.options.stringifySearch(C),E=r.hash===!0?c.hash:r.hash?_i(r.hash,c.hash):void 0,R=E?`#${E}`:"";let z=r.state===!0?c.state:r.state?_i(r.state,c.state):{};z=da(c.state,z);const U=`${S}${_}${R}`;let O,M,A=!1;if(this.rewrite){const B=new URL(U,this.origin),ie=lS(this.rewrite,B);O=B.href.replace(B.origin,""),ie.origin!==this.origin?(M=ie.href,A=!0):M=ie.pathname+ie.search+ie.hash}else O=nk(U),M=O;return{publicHref:M,href:O,pathname:S,search:C,searchStr:_,state:z,hash:E??"",external:A,unmaskOnReload:r.unmaskOnReload}},a=(r={},c)=>{const d=s(r);let f=c?s(c):void 0;if(!f){const p=Object.create(null);if(this.options.routeMasks){const m=rk(d.pathname,this.processedTree);if(m){Object.assign(p,m.rawParams);const{from:b,params:y,...v}=m.route,x=y===!1||y===null?Object.create(null):(y??!0)===!0?p:Object.assign(p,_i(y,p));c={from:t.from,...v,params:x},f=s(c)}}}return f&&(d.maskedLocation=f),d};return t.mask?a(t,{from:t.from,...t.mask}):a(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:s,...a})=>{const r=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(m=>{a.state[m]=this.latestLocation.state[m]});const p=ga(a.state,this.latestLocation.state);return f.forEach(m=>{delete a.state[m]}),p},c=Oi(this.latestLocation.href)===Oi(a.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Rr(()=>{d?.resolve(),d=void 0}),c&&r())this.load();else{let{maskedLocation:f,hashScrollIntoView:p,...m}=a;f&&(m={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:s})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:a,viewTransition:r,ignoreBlocker:c,href:d,...f}={})=>{if(d){const b=this.history.location.state.__TSR_index,y=mu(d,{__TSR_index:t?b:b+1}),v=new URL(y.pathname,this.origin);f.to=lm(this.rewrite,v).pathname,f.search=this.options.parseSearch(y.search),f.hash=y.hash.slice(1)}const p=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const m=this.commitLocation({...p,viewTransition:r,replace:t,resetScroll:s,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:t,reloadDocument:s,href:a,publicHref:r,...c})=>{let d=!1;if(a)try{new URL(`${a}`),d=!0}catch{}if(d&&!s&&(s=!0),s){if(t!==void 0||!a){const p=this.buildLocation({to:t,...c});a=a??p.publicHref,r=r??p.publicHref}const f=!d&&r?r:a;if(cu(f,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const m of p)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...c,href:a,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:s.cachedMatches.filter(a=>!t.some(r=>r.id===a.id))}))},this.load=async t=>{let s,a,r;const c=this.state.resolvedLocation??this.state.location;for(r=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const p=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ba({resolvedLocation:m,location:p})}),this.emit({type:"onBeforeLoad",...ba({resolvedLocation:m,location:p})}),await ub({router:this,sync:t?.sync,forceStaleReload:c.href===p.href,matches:this.state.pendingMatches,location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let b=[],y=[],v=[],x=[];Ho(()=>{this.__store.setState(j=>{const S=j.matches,C=j.pendingMatches||j.matches;return b=S.filter(_=>!C.some(E=>E.id===_.id)),y=S.filter(_=>!C.some(E=>E.routeId===_.routeId)),v=C.filter(_=>!S.some(E=>E.routeId===_.routeId)),x=C.filter(_=>S.some(E=>E.routeId===_.routeId)),{...j,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...j.cachedMatches,...b.filter(_=>_.status!=="error"&&_.status!=="notFound"&&_.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[v,"onEnter"],[x,"onStay"]].forEach(([j,S])=>{j.forEach(C=>{this.looseRoutesById[C.routeId].options[S]?.(C)})})})})}})}catch(p){bn(p)?(s=p,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):un(p)&&(a=p),this.__store.setState(m=>({...m,statusCode:s?s.status:a?404:m.matches.some(b=>b.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.__store.state.matches.some(f=>f.status==="error")&&(d=500),d!==void 0&&this.__store.setState(f=>({...f,statusCode:d}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,c=this.state.resolvedLocation,d=typeof s.types=="function"?s.types(ba({resolvedLocation:c,location:r})):s.types;if(d===!1){t();return}a={update:t,types:d}}else a=t;document.startViewTransition(a)}else t()},this.updateMatch=(t,s)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(r=>r.id===t)?"pendingMatches":this.state.matches.some(r=>r.id===t)?"matches":this.state.cachedMatches.some(r=>r.id===t)?"cachedMatches":"";a&&(a==="cachedMatches"?this.__store.setState(r=>({...r,cachedMatches:sz(r.cachedMatches.map(c=>c.id===t?s(c):c))})):this.__store.setState(r=>({...r,[a]:r[a]?.map(c=>c.id===t?s(c):c)})))})},this.getMatch=t=>{const s=a=>a.id===t;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=t=>{const s=a=>t?.filter?.(a)??!0?{...a,invalid:!0,...t?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(s),cachedMatches:a.cachedMatches.map(s),pendingMatches:a.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const s=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const a=t.options._builtLocation??this.buildLocation(t.options),r=this.getParsedLocationHref(a);t.options.href=r,t.headers.set("Location",r)}else if(s)try{const a=new URL(s);if(this.origin&&a.origin===this.origin){const r=a.pathname+a.search+a.hash;t.options.href=r,t.headers.set("Location",r)}}catch{}if(t.options.href&&!t.options._builtLocation&&cu(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const s=t?.filter;s!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(r=>!s(r))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=s=>{const a=this.looseRoutesById[s.routeId];if(!a.options.loader)return!0;const r=(s.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:t})},this.loadRouteChunk=Jo,this.preloadRoute=async t=>{const s=t._builtLocation??this.buildLocation(t);let a=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:t});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),c=new Set([...r,...this.state.cachedMatches.map(d=>d.id)]);Ho(()=>{a.forEach(d=>{c.has(d.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,d]}))})});try{return a=await ub({router:this,matches:a,location:s,preload:!0,updateMatch:(d,f)=>{r.has(d)?a=a.map(p=>p.id===d?f(p):p):this.updateMatch(d,f)}}),a}catch(d){if(bn(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:s});un(d)||console.error(d);return}},this.matchRoute=(t,s)=>{const a={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},r=this.buildLocation(a);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=ok(r.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!d||t.params&&!ga(d.rawParams,t.params,{partial:!0})?!1:s?.includeSearch??!0?ga(c.search,r.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??zk,parseSearch:e.parseSearch??kk,protocolAllowlist:e.protocolAllowlist??tk}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:s}){this.routesById=e,this.routesByPath=t,this.processedTree=s;const a=this.options.notFoundRoute;a&&(a.init({originalIndex:99999999999}),this.routesById[a.id]=a)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const s=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:r,parsedParams:c}=s;let{matchedRoutes:d}=s,f=!1;(a?a.path!=="/"&&r["**"]:Oi(e.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:f=!0);const p=f?uz(this.options.notFoundMode,d):void 0,m=new Array(d.length),b=new Map(this.state.matches.map(y=>[y.routeId,y]));for(let y=0;y<d.length;y++){const v=d[y],x=m[y-1];let j,S,C;{const me=x?.search??e.search,ze=x?._strictSearch??void 0;try{const we=Wc(v.options.validateSearch,{...me})??void 0;j={...me,...we},S={...ze,...we},C=void 0}catch(we){let q=we;if(we instanceof pu||(q=new pu(we.message,{cause:we})),t?.throwOnError)throw q;j=me,S={},C=q}}const _=v.options.loaderDeps?.({search:j})??"",E=_?JSON.stringify(_):"",{interpolatedPath:R,usedParams:z}=sb({path:v.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),U=v.id+R+E,O=this.getMatch(U),M=b.get(v.id),A=O?._strictParams??z;let B;if(!O)try{pb(v,z,c,A)}catch(me){if(un(me)||bn(me)?B=me:B=new az(me.message,{cause:me}),t?.throwOnError)throw B}Object.assign(r,A);const ie=M?"stay":"enter";let Q;if(O)Q={...O,cause:ie,params:M?.params??r,_strictParams:A,search:ra(M?M.search:O.search,j),_strictSearch:S};else{const me=v.options.loader||v.options.beforeLoad||v.lazyFn||yS(v)?"pending":"success";Q={id:U,ssr:v.options.ssr,index:y,routeId:v.id,params:M?.params??r,_strictParams:A,pathname:R,updatedAt:Date.now(),search:M?ra(M.search,j):j,_strictSearch:S,searchError:void 0,status:me,isFetching:!1,error:void 0,paramsError:B,__routeContext:void 0,_nonReactive:{loadPromise:Rr()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:ie,loaderDeps:M?da(M.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:v.options.staticData||{},fullPath:v.fullPath}}t?.preload||(Q.globalNotFound=p===v.id),Q.searchError=C;const ne=this.getParentContext(x);Q.context={...ne,...Q.__routeContext,...Q.__beforeLoadContext},m[y]=Q}for(let y=0;y<m.length;y++){const v=m[y],x=this.looseRoutesById[v.routeId],j=this.getMatch(v.id),S=b.get(v.routeId);if(v.params=S?ra(S.params,r):r,!j){const C=m[y-1],_=this.getParentContext(C);if(x.options.context){const E={deps:v.loaderDeps,params:v.params,context:_??{},location:e,navigate:R=>this.navigate({...R,_fromLocation:e}),buildLocation:this.buildLocation,cause:v.cause,abortController:v.abortController,preload:!!v.preload,matches:m,routeId:x.id};v.__routeContext=x.options.context(E)??void 0}v.context={..._,...v.__routeContext,...v.__beforeLoadContext}}}return m}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:s,parsedParams:a}=this.getMatchedRoutes(e.pathname),r=Qo(t),c={...e.search};for(const m of t)try{Object.assign(c,Wc(m.options.validateSearch,c))}catch{}const d=Qo(this.state.matches),f=d&&d.routeId===r.id&&e.pathname===this.state.location.pathname;let p;if(f)p=d.params;else{const m=Object.assign(Object.create(null),s);for(const b of t)try{pb(b,s,a??{},m)}catch{}p=m}return{matchedRoutes:t,fullPath:r.fullPath,search:c,params:p}}},pu=class extends Error{},az=class extends Error{};function rz(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Wc(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new pu("Async validation not supported");if(s.issues)throw new pu(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 oz({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),r=Oi(e);let c,d;const f=lk(r,s,!0);return f&&(c=f.route,Object.assign(a,f.rawParams),d=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:a,foundRoute:c,parsedParams:d}}function lz({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return cz(s)(e,t,a??!1)}function cz(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const c=({search:d,next:f})=>{let p=d;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(p=r.options.preSearchFilters.reduce((b,y)=>y(b),d));const m=f(p);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((b,y)=>y(b),m):m};t.middlewares.push(c)}if(r.options.validateSearch){const c=({search:d,next:f})=>{const p=f(d);if(!t._includeValidateSearch)return p;try{return{...p,...Wc(r.options.validateSearch,p)??void 0}}catch{return p}};t.middlewares.push(c)}}const s=({search:r})=>{const c=t.dest;return c.search?c.search===!0?r:_i(c.search,r):{}};t.middlewares.push(s);const a=(r,c,d)=>{if(r>=d.length)return c;const f=d[r];return f({search:c,next:m=>a(r+1,m,d)})};return function(c,d,f){return t.dest=d,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function uz(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 ya}function pb(e,t,s,a){const r=e.options.params?.parse??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const c in t)c in s&&(a[c]=s[c]);else{const c=r(a);Object.assign(a,c)}}var dz="Error preloading route! ☝️",vS=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=ya:this.parentRoute||Li(!1);let r=a?ya:s?.path;r&&r!=="/"&&(r=rS(r));const c=s?.id||r;let d=a?ya:Yc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);r==="__root__"&&(r="/"),d!=="__root__"&&(d=Yc(["/",d]));const f=d==="__root__"?"/":Yc([this.parentRoute.fullPath,r]);this._path=r,this._id=d,this._fullPath=f,this._to=Oi(f)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>Gm({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.")}},fz=class extends vS{constructor(e){super(e)}};function Ym(e){const t=e.errorComponent??Jm;return l.jsx(hz,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?N.createElement(t,{error:s,reset:a}):e.children})}var hz=class extends N.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function Jm({error:e}){const[t,s]=N.useState(!1);return l.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[l.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),l.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(a=>!a),children:t?"Hide Error":"Show Error"})]}),l.jsx("div",{style:{height:".25rem"}}),t?l.jsx("div",{children:l.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?l.jsx("code",{children:e.message}):null})}):null]})}function mz({children:e,fallback:t=null}){return bS()?l.jsx(ns.Fragment,{children:e}):l.jsx(ns.Fragment,{children:t})}function bS(){return ns.useSyncExternalStore(pz,()=>!0,()=>!1)}function pz(){return()=>{}}var xS=N.createContext(null);function Gn(e){const t=N.useContext(xS);return e?.warn,t}var Rh={exports:{}},Oh={},Ah={exports:{}},Th={};var gb;function gz(){if(gb)return Th;gb=1;var e=al();function t(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var s=typeof Object.is=="function"?Object.is:t,a=e.useState,r=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(y,v){var x=v(),j=a({inst:{value:x,getSnapshot:v}}),S=j[0].inst,C=j[1];return c(function(){S.value=x,S.getSnapshot=v,p(S)&&C({inst:S})},[y,x,v]),r(function(){return p(S)&&C({inst:S}),y(function(){p(S)&&C({inst:S})})},[y]),d(x),x}function p(y){var v=y.getSnapshot;y=y.value;try{var x=v();return!s(y,x)}catch{return!0}}function m(y,v){return v()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Th.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b,Th}var yb;function yz(){return yb||(yb=1,Ah.exports=gz()),Ah.exports}var vb;function vz(){if(vb)return Oh;vb=1;var e=al(),t=yz();function s(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}var a=typeof Object.is=="function"?Object.is:s,r=t.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,p=e.useDebugValue;return Oh.useSyncExternalStoreWithSelector=function(m,b,y,v,x){var j=c(null);if(j.current===null){var S={hasValue:!1,value:null};j.current=S}else S=j.current;j=f(function(){function _(O){if(!E){if(E=!0,R=O,O=v(O),x!==void 0&&S.hasValue){var M=S.value;if(x(M,O))return z=M}return z=O}if(M=z,a(R,O))return M;var A=v(O);return x!==void 0&&x(M,A)?(R=O,M):(R=O,z=A)}var E=!1,R,z,U=y===void 0?null:y;return[function(){return _(b())},U===null?void 0:function(){return _(U())}]},[b,y,v,x]);var C=r(m,j[0],j[1]);return d(function(){S.hasValue=!0,S.value=C},[C]),p(C),C},Oh}var bb;function bz(){return bb||(bb=1,Rh.exports=vz()),Rh.exports}var xz=bz();function Sz(e,t){return e===t}function wz(e,t,s=Sz){const a=N.useCallback(d=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(d);return f},[e]),r=N.useCallback(()=>e?.get(),[e]);return xz.useSyncExternalStoreWithSelector(a,r,r,t,s)}function xn(e){const t=Gn({warn:e?.router===void 0}),s=e?.router||t,a=N.useRef(void 0);return wz(s.__store,r=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const c=da(a.current,e.select(r));return a.current=c,c}return e.select(r)}return r})}var Au=N.createContext(void 0),jz=N.createContext(void 0);function Pi(e){const t=N.useContext(e.from?jz:Au);return xn({select:s=>{const a=s.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if(Li(!((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 Xm(e){return Pi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Wm(e){const{select:t,...s}=e;return Pi({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Tu(e){return Pi({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 Du(e){return Pi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ja(e){const t=Gn();return N.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function ep(e){return Pi({...e,select:t=>e.select?e.select(t.context):t.context})}var tp=$x();const Nz=Ix(tp);function Cz(e,t){const s=Gn(),a=Q_(t),{activeProps:r,inactiveProps:c,activeOptions:d,to:f,preload:p,preloadDelay:m,hashScrollIntoView:b,replace:y,startTransition:v,resetScroll:x,viewTransition:j,children:S,target:C,disabled:_,style:E,className:R,onClick:z,onBlur:U,onFocus:O,onMouseEnter:M,onMouseLeave:A,onTouchStart:B,ignoreBlocker:ie,params:Q,search:ne,hash:me,state:ze,mask:we,reloadDocument:q,unsafeRelative:T,from:ae,_fromLocation:pe,...ee}=e,L=bS(),G=xn({select:ke=>{const Te=ke.matches[ke.matches.length-1];return{search:Te?.search,hash:ke.location.hash,path:Te?.pathname}},structuralSharing:!0}),se=e.from,re=N.useMemo(()=>({...e,from:se}),[s,G,se,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=N.useMemo(()=>s.buildLocation({...re}),[s,re]),he=ce.maskedLocation?ce.maskedLocation.publicHref:ce.publicHref,de=ce.maskedLocation?ce.maskedLocation.external:ce.external,Fe=N.useMemo(()=>Oz(he,de,s.history,_),[_,de,he,s.history]),ge=N.useMemo(()=>{if(Fe?.external)return cu(Fe.href,s.protocolAllowlist)?void 0:Fe.href;if(!Az(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),cu(f,s.protocolAllowlist)?void 0:f}catch{}},[f,Fe,s.protocolAllowlist]),Je=xn({select:ke=>{if(ge)return!1;if(d?.exact){if(!mk(ke.location.pathname,ce.pathname,s.basepath))return!1}else{const Te=du(ke.location.pathname,s.basepath),zt=du(ce.pathname,s.basepath);if(!(Te.startsWith(zt)&&(Te.length===zt.length||Te[zt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!ga(ke.location.search,ce.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?L&&ke.location.hash===ce.hash:!0}}),mt=Je?_i(r,{})??_z:Dh,fe=Je?Dh:_i(c,{})??Dh,Ye=[R,mt.className,fe.className].filter(Boolean).join(" "),dt=(E||mt.style||fe.style)&&{...E,...mt.style,...fe.style},[Wt,_t]=N.useState(!1),nn=N.useRef(!1),Kt=e.reloadDocument||ge?!1:p??s.options.defaultPreload,kt=m??s.options.defaultPreloadDelay??0,wt=N.useCallback(()=>{s.preloadRoute({...re,_builtLocation:ce}).catch(ke=>{console.warn(ke),console.warn(dz)})},[s,re,ce]);V_(a,N.useCallback(ke=>{ke?.isIntersecting&&wt()},[wt]),Rz,{disabled:!!_||Kt!=="viewport"}),N.useEffect(()=>{nn.current||!_&&Kt==="render"&&(wt(),nn.current=!0)},[_,wt,Kt]);const sn=ke=>{const Te=ke.currentTarget.getAttribute("target"),zt=C!==void 0?C:Te;if(!_&&!Tz(ke)&&!ke.defaultPrevented&&(!zt||zt==="_self")&&ke.button===0){ke.preventDefault(),tp.flushSync(()=>{_t(!0)});const Qn=s.subscribe("onResolved",()=>{Qn(),_t(!1)});s.navigate({...re,replace:y,resetScroll:x,hashScrollIntoView:b,startTransition:v,viewTransition:j,ignoreBlocker:ie})}};if(ge)return{...ee,ref:a,href:ge,...S&&{children:S},...C&&{target:C},..._&&{disabled:_},...E&&{style:E},...R&&{className:R},...z&&{onClick:z},...U&&{onBlur:U},...O&&{onFocus:O},...M&&{onMouseEnter:M},...A&&{onMouseLeave:A},...B&&{onTouchStart:B}};const oe=ke=>{if(_||Kt!=="intent")return;if(!kt){wt();return}const Te=ke.currentTarget;if(Mo.has(Te))return;const zt=setTimeout(()=>{Mo.delete(Te),wt()},kt);Mo.set(Te,zt)},Ue=ke=>{_||Kt!=="intent"||wt()},Pe=ke=>{if(_||!Kt||!kt)return;const Te=ke.currentTarget,zt=Mo.get(Te);zt&&(clearTimeout(zt),Mo.delete(Te))};return{...ee,...mt,...fe,href:Fe?.href,ref:a,onClick:fr([z,sn]),onBlur:fr([U,Pe]),onFocus:fr([O,oe]),onMouseEnter:fr([M,oe]),onMouseLeave:fr([A,Pe]),onTouchStart:fr([B,Ue]),disabled:!!_,target:C,...dt&&{style:dt},...Ye&&{className:Ye},..._&&kz,...Je&&zz,...L&&Wt&&Ez}}var Dh={},_z={className:"active"},kz={role:"link","aria-disabled":!0},zz={"data-status":"active","aria-current":"page"},Ez={"data-transitioning":"transitioning"},Mo=new WeakMap,Rz={rootMargin:"100px"},fr=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function Oz(e,t,s,a){if(!a)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function Az(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var gt=N.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:r,...c}=Cz(a,t),d=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!s){const{disabled:f,...p}=c;return N.createElement("a",p,d)}return N.createElement(s,c,d)});function Tz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Dz=class extends vS{constructor(e){super(e),this.useMatch=t=>Pi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>ep({...t,from:this.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Tu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Wm({...t,from:this.id}),this.useLoaderData=t=>Xm({...t,from:this.id}),this.useNavigate=()=>ja({from:this.fullPath}),this.Link=ns.forwardRef((t,s)=>l.jsx(gt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function is(e){return new Dz(e)}function Lz(){return e=>Uz(e)}var Mz=class extends fz{constructor(e){super(e),this.useMatch=t=>Pi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>ep({...t,from:this.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Tu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Wm({...t,from:this.id}),this.useLoaderData=t=>Xm({...t,from:this.id}),this.useNavigate=()=>ja({from:this.fullPath}),this.Link=ns.forwardRef((t,s)=>l.jsx(gt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Uz(e){return new Mz(e)}function xb(e){return typeof e=="object"?new Sb(e,{silent:!0}).createRoute(e):new Sb(e,{silent:!0}).createRoute}var Sb=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=is(s);return a.isRoot=!1,a},this.silent=t?.silent}},wb=class{constructor(e){this.useMatch=t=>Pi({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>ep({...t,from:this.options.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Tu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>Wm({...t,from:this.options.id}),this.useLoaderData=t=>Xm({...t,from:this.options.id}),this.useNavigate=()=>ja({from:Gn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function jb(e){return typeof e=="object"?new wb(e):t=>new wb({id:e,...t})}function Pz(e){const t=xn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return l.jsx(Ym,{getResetKey:()=>t,onCatch:(s,a)=>{if(un(s))e.onCatch?.(s,a);else throw s},errorComponent:({error:s})=>{if(un(s))return e.fallback?.(s);throw s},children:e.children})}function Iz(){return l.jsx("p",{children:"Not Found"})}function vr(e){return l.jsx(l.Fragment,{children:e.children})}function SS(e,t,s){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...s}):l.jsx(Iz,{})}function $z(){return Gn().isScrollRestoring,null}var wS=N.memo(function({matchId:t}){const s=Gn(),a=xn({select:j=>{const S=j.matches.findIndex(_=>_.id===t),C=j.matches[S];return Li(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:j.loadedAt,parentRouteId:j.matches[S-1]?.routeId}},structuralSharing:!0}),r=s.routesById[a.routeId],c=r.options.pendingComponent??s.options.defaultPendingComponent,d=c?l.jsx(c,{}):null,f=r.options.errorComponent??s.options.defaultErrorComponent,p=r.options.onCatch??s.options.defaultOnCatch,m=r.isRoot?r.options.notFoundComponent??s.options.notFoundRoute?.options.component:r.options.notFoundComponent,b=a.ssr===!1||a.ssr==="data-only",y=(!r.isRoot||r.options.wrapInSuspense||b)&&(r.options.wrapInSuspense??c??(r.options.errorComponent?.preload||b))?N.Suspense:vr,v=f?Ym:vr,x=m?Pz:vr;return l.jsxs(r.isRoot?r.options.shellComponent??vr:vr,{children:[l.jsx(Au.Provider,{value:t,children:l.jsx(y,{fallback:d,children:l.jsx(v,{getResetKey:()=>a.resetKey,errorComponent:f||Jm,onCatch:(j,S)=>{if(un(j))throw j;p?.(j,S)},children:l.jsx(x,{fallback:j=>{if(!m||j.routeId&&j.routeId!==a.routeId||!j.routeId&&!r.isRoot)throw j;return N.createElement(m,j)},children:b||a._displayPending?l.jsx(mz,{fallback:d,children:l.jsx(Nb,{matchId:t})}):l.jsx(Nb,{matchId:t})})})})}),a.parentRouteId===ya&&s.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(Bz,{}),l.jsx($z,{})]}):null]})});function Bz(){const e=Gn(),t=N.useRef(void 0);return l.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ba(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Nb=N.memo(function({matchId:t}){const s=Gn(),{match:a,key:r,routeId:c}=xn({select:p=>{const m=p.matches.find(v=>v.id===t),b=m.routeId,y=(s.routesById[b].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:b,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:b,match:{id:m.id,status:m.status,error:m.error,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),d=s.routesById[c],f=N.useMemo(()=>{const p=d.options.component??s.options.defaultComponent;return p?l.jsx(p,{},r):l.jsx(np,{})},[r,d.options.component,s.options.defaultComponent]);if(a._displayPending)throw s.getMatch(a.id)?._nonReactive.displayPendingPromise;if(a._forcePending)throw s.getMatch(a.id)?._nonReactive.minPendingPromise;if(a.status==="pending"){const p=d.options.pendingMinMs??s.options.defaultPendingMinMs;if(p){const m=s.getMatch(a.id);if(m&&!m._nonReactive.minPendingPromise){const b=Rr();m._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),m._nonReactive.minPendingPromise=void 0},p)}}throw s.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return Li(un(a.error)),SS(s,d,a.error);if(a.status==="redirected")throw Li(bn(a.error)),s.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),np=N.memo(function(){const t=Gn(),s=N.useContext(Au),a=xn({select:m=>m.matches.find(b=>b.id===s)?.routeId}),r=t.routesById[a],c=xn({select:m=>{const b=m.matches.find(y=>y.id===s);return Li(b),b.globalNotFound}}),d=xn({select:m=>{const b=m.matches;return b[b.findIndex(y=>y.id===s)+1]?.id}}),f=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(c)return SS(t,r,void 0);if(!d)return null;const p=l.jsx(wS,{matchId:d});return a===ya?l.jsx(N.Suspense,{fallback:f,children:p}):p});function qz(){const e=Gn(),t=N.useRef({router:e,mounted:!1}),[s,a]=N.useState(!1),{hasPendingMatches:r,isLoading:c}=xn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),d=Nh(c),f=c||s||r,p=Nh(f),m=c||r,b=Nh(m);return e.startTransition=y=>{a(!0),N.startTransition(()=>{y(),a(!1)})},N.useEffect(()=>{const y=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Oi(e.latestLocation.publicHref)!==Oi(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{y()}},[e,e.history]),Oc(()=>{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(v){console.error(v)}})()},[e]),Oc(()=>{d&&!c&&e.emit({type:"onLoad",...ba(e.state)})},[d,e,c]),Oc(()=>{b&&!m&&e.emit({type:"onBeforeRouteMount",...ba(e.state)})},[m,b,e]),Oc(()=>{if(p&&!f){const y=ba(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(v=>({...v,status:"idle",resolvedLocation:v.location})),y.hrefChanged&&Nk(e)}},[f,p,e]),null}function Hz(){const e=Gn(),t=e.routesById[ya].options.pendingComponent??e.options.defaultPendingComponent,s=t?l.jsx(t,{}):null,a=l.jsxs(typeof document<"u"&&e.ssr?vr:N.Suspense,{fallback:s,children:[l.jsx(qz,{}),l.jsx(Zz,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:a}):a}function Zz(){const e=Gn(),t=xn({select:r=>r.matches[0]?.id}),s=xn({select:r=>r.loadedAt}),a=t?l.jsx(wS,{matchId:t}):null;return l.jsx(Au.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:l.jsx(Ym,{getResetKey:()=>s,errorComponent:Jm,onCatch:void 0,children:a})})}var Fz=e=>new Gz(e),Gz=class extends iz{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=xb,globalThis.createLazyFileRoute=jb):typeof window<"u"&&(window.createFileRoute=xb,window.createLazyFileRoute=jb);function Kz({router:e,children:t,...s}){Object.keys(s).length>0&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const a=l.jsx(xS.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:a}):a}function Vz({router:e,...t}){return l.jsx(Kz,{router:e,...t,children:l.jsx(Hz,{})})}function Qz(e){return xn({select:t=>t.location})}let zi=[],Yz=0;const fm=new Set;function jS(){const e=[...zi];for(const t of fm)t(e)}function Jz(e,t="negative",s=6e3){const a=String(++Yz),r={id:a,message:e,tone:t,expiresAt:Date.now()+s};return zi=[...zi,r],jS(),setTimeout(()=>{NS(a)},s),a}function NS(e){const t=zi.length;zi=zi.filter(s=>s.id!==e),zi.length!==t&&jS()}function Xz(e){return fm.add(e),()=>{fm.delete(e)}}function Cb(){return zi}function Wz(){return new B_({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new Vx({onError:e=>{Jz(e instanceof Error?e.message:"An unexpected error occurred","negative")}})})}const e2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),t2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),_b=e=>{const t=t2(e);return t.charAt(0).toUpperCase()+t.slice(1)},CS=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),n2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var s2={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 i2=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:r="",children:c,iconNode:d,...f},p)=>N.createElement("svg",{ref:p,...s2,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:CS("lucide",r),...!c&&!n2(f)&&{"aria-hidden":"true"},...f},[...d.map(([m,b])=>N.createElement(m,b)),...Array.isArray(c)?c:[c]]));const On=(e,t)=>{const s=N.forwardRef(({className:a,...r},c)=>N.createElement(i2,{ref:c,iconNode:t,className:CS(`lucide-${e2(_b(e))}`,`lucide-${e}`,a),...r}));return s.displayName=_b(e),s};const a2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Lu=On("chevron-right",a2);const r2=[["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"}]],o2=On("download",r2);const l2=[["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"}]],c2=On("globe",l2);const u2=[["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=On("layout-dashboard",u2);const f2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],h2=On("menu",f2);const m2=[["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"}]],p2=On("play",m2);const g2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],kb=On("plus",g2);const y2=[["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"}]],v2=On("rocket",y2);const b2=[["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"}]],x2=On("rotate-ccw",b2);const S2=[["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"}]],w2=On("settings",S2);const j2=[["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"}]],N2=On("trash-2",j2);const C2=[["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"}]],_2=On("triangle-alert",C2);const k2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Mu=On("x",k2);function z2(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const s=t[1],a=t[2],r=a.indexOf("{");if(r>=0){const c=a.slice(0,r).trim(),d=a.slice(r);try{const f=JSON.parse(d);return`${s} ${c}
|
|
10
|
+
|
|
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 Uu(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function br(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function zb(e){return e===null?"Unknown":e?"Pass":"Fail"}function hm(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function E2(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function R2(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 O2(e,t,s){const a=s==="UTC"?"UTC":s.split("/").pop()?.replace(/_/g," ")??s;if(!e)return`Custom: ${t} · ${a}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${a}`;const r=e.match(/^daily(?:@(\d+))?$/);if(r){const d=r[1]?parseInt(r[1]):6;return`Every day at ${hm(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 ${hm(f)} · ${a}`}return`${e} · ${a}`}function Eb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sp(...e){return t=>{let s=!1;const a=e.map(r=>{const c=Eb(r,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let r=0;r<a.length;r++){const c=a[r];typeof c=="function"?c():Eb(e[r],null)}}}}function Na(...e){return N.useCallback(sp(...e),e)}var A2=Symbol.for("react.lazy"),gu=Mm[" use ".trim().toString()];function T2(e){return typeof e=="object"&&e!==null&&"then"in e}function _S(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===A2&&"_payload"in e&&T2(e._payload)}function D2(e){const t=M2(e),s=N.forwardRef((a,r)=>{let{children:c,...d}=a;_S(c)&&typeof gu=="function"&&(c=gu(c._payload));const f=N.Children.toArray(c),p=f.find(P2);if(p){const m=p.props.children,b=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,b):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}var L2=D2("Slot");function M2(e){const t=N.forwardRef((s,a)=>{let{children:r,...c}=s;if(_S(r)&&typeof gu=="function"&&(r=gu(r._payload)),N.isValidElement(r)){const d=$2(r),f=I2(c,r.props);return r.type!==N.Fragment&&(f.ref=a?sp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var U2=Symbol("radix.slottable");function P2(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===U2}function I2(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const p=c(...f);return r(...f),p}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function $2(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 kS(e){var t,s,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=kS(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function zS(){for(var e,t,s=0,a="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=kS(e))&&(a&&(a+=" "),a+=t);return a}const Rb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ob=zS,ES=(e,t)=>s=>{var a;if(t?.variants==null)return Ob(e,s?.class,s?.className);const{variants:r,defaultVariants:c}=t,d=Object.keys(r).map(m=>{const b=s?.[m],y=c?.[m];if(b===null)return null;const v=Rb(b)||Rb(y);return r[m][v]}),f=s&&Object.entries(s).reduce((m,b)=>{let[y,v]=b;return v===void 0||(m[y]=v),m},{}),p=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((m,b)=>{let{class:y,className:v,...x}=b;return Object.entries(x).every(j=>{let[S,C]=j;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...m,y,v]:m},[]);return Ob(e,d,p,s?.class,s?.className)},B2=(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},q2=(e,t)=>({classGroupId:e,validator:t}),RS=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),yu="-",Ab=[],H2="arbitrary..",Z2=e=>{const t=G2(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return F2(d);const f=d.split(yu),p=f[0]===""&&f.length>1?1:0;return OS(f,p,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=a[d],m=s[d];return p?m?B2(m,p):p:m||Ab}return s[d]||Ab}}},OS=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],c=s.nextPart.get(r);if(c){const m=OS(e,t+1,c);if(m)return m}const d=s.validators;if(d===null)return;const f=t===0?e.join(yu):e.slice(t).join(yu),p=d.length;for(let m=0;m<p;m++){const b=d[m];if(b.validator(f))return b.classGroupId}},F2=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?H2+a:void 0})(),G2=e=>{const{theme:t,classGroups:s}=e;return K2(s,t)},K2=(e,t)=>{const s=RS();for(const a in e){const r=e[a];ip(r,s,a,t)}return s},ip=(e,t,s,a)=>{const r=e.length;for(let c=0;c<r;c++){const d=e[c];V2(d,t,s,a)}},V2=(e,t,s,a)=>{if(typeof e=="string"){Q2(e,t,s);return}if(typeof e=="function"){Y2(e,t,s,a);return}J2(e,t,s,a)},Q2=(e,t,s)=>{const a=e===""?t:AS(t,e);a.classGroupId=s},Y2=(e,t,s,a)=>{if(X2(e)){ip(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(q2(s,e))},J2=(e,t,s,a)=>{const r=Object.entries(e),c=r.length;for(let d=0;d<c;d++){const[f,p]=r[d];ip(p,AS(t,f),s,a)}},AS=(e,t)=>{let s=e;const a=t.split(yu),r=a.length;for(let c=0;c<r;c++){const d=a[c];let f=s.nextPart.get(d);f||(f=RS(),s.nextPart.set(d,f)),s=f}return s},X2=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,W2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),a=Object.create(null);const r=(c,d)=>{s[c]=d,t++,t>e&&(t=0,a=s,s=Object.create(null))};return{get(c){let d=s[c];if(d!==void 0)return d;if((d=a[c])!==void 0)return r(c,d),d},set(c,d){c in s?s[c]=d:r(c,d)}}},mm="!",Tb=":",eE=[],Db=(e,t,s,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:r}),tE=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=r=>{const c=[];let d=0,f=0,p=0,m;const b=r.length;for(let S=0;S<b;S++){const C=r[S];if(d===0&&f===0){if(C===Tb){c.push(r.slice(p,S)),p=S+1;continue}if(C==="/"){m=S;continue}}C==="["?d++:C==="]"?d--:C==="("?f++:C===")"&&f--}const y=c.length===0?r:r.slice(p);let v=y,x=!1;y.endsWith(mm)?(v=y.slice(0,-1),x=!0):y.startsWith(mm)&&(v=y.slice(1),x=!0);const j=m&&m>p?m-p:void 0;return Db(c,x,v,j)};if(t){const r=t+Tb,c=a;a=d=>d.startsWith(r)?c(d.slice(r.length)):Db(eE,!1,d,void 0,!0)}if(s){const r=a;a=c=>s({className:c,parseClassName:r})}return a},nE=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,a)=>{t.set(s,1e6+a)}),s=>{const a=[];let r=[];for(let c=0;c<s.length;c++){const d=s[c],f=d[0]==="[",p=t.has(d);f||p?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(d)):r.push(d)}return r.length>0&&(r.sort(),a.push(...r)),a}},sE=e=>({cache:W2(e.cacheSize),parseClassName:tE(e),sortModifiers:nE(e),...Z2(e)}),iE=/\s+/,aE=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:c}=t,d=[],f=e.trim().split(iE);let p="";for(let m=f.length-1;m>=0;m-=1){const b=f[m],{isExternal:y,modifiers:v,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:S}=s(b);if(y){p=b+(p.length>0?" "+p:p);continue}let C=!!S,_=a(C?j.substring(0,S):j);if(!_){if(!C){p=b+(p.length>0?" "+p:p);continue}if(_=a(j),!_){p=b+(p.length>0?" "+p:p);continue}C=!1}const E=v.length===0?"":v.length===1?v[0]:c(v).join(":"),R=x?E+mm:E,z=R+_;if(d.indexOf(z)>-1)continue;d.push(z);const U=r(_,C);for(let O=0;O<U.length;++O){const M=U[O];d.push(R+M)}p=b+(p.length>0?" "+p:p)}return p},rE=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=TS(s))&&(r&&(r+=" "),r+=a);return r},TS=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=TS(e[a]))&&(s&&(s+=" "),s+=t);return s},oE=(e,...t)=>{let s,a,r,c;const d=p=>{const m=t.reduce((b,y)=>y(b),e());return s=sE(m),a=s.cache.get,r=s.cache.set,c=f,f(p)},f=p=>{const m=a(p);if(m)return m;const b=aE(p,s);return r(p,b),b};return c=d,(...p)=>c(rE(...p))},lE=[],Ft=e=>{const t=s=>s[e]||lE;return t.isThemeGetter=!0,t},DS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,LS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,uE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dE=/\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$/,fE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Si=e=>cE.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),wi=e=>!!e&&Number.isInteger(Number(e)),Lh=e=>e.endsWith("%")&&De(e.slice(0,-1)),$s=e=>uE.test(e),MS=()=>!0,pE=e=>dE.test(e)&&!fE.test(e),ap=()=>!1,gE=e=>hE.test(e),yE=e=>mE.test(e),vE=e=>!ve(e)&&!be(e),bE=e=>Ii(e,IS,ap),ve=e=>DS.test(e),la=e=>Ii(e,$S,pE),Lb=e=>Ii(e,kE,De),xE=e=>Ii(e,qS,MS),SE=e=>Ii(e,BS,ap),Mb=e=>Ii(e,US,ap),wE=e=>Ii(e,PS,yE),Dc=e=>Ii(e,HS,gE),be=e=>LS.test(e),Uo=e=>Ca(e,$S),jE=e=>Ca(e,BS),Ub=e=>Ca(e,US),NE=e=>Ca(e,IS),CE=e=>Ca(e,PS),Lc=e=>Ca(e,HS,!0),_E=e=>Ca(e,qS,!0),Ii=(e,t,s)=>{const a=DS.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},Ca=(e,t,s=!1)=>{const a=LS.exec(e);return a?a[1]?t(a[1]):s:!1},US=e=>e==="position"||e==="percentage",PS=e=>e==="image"||e==="url",IS=e=>e==="length"||e==="size"||e==="bg-size",$S=e=>e==="length",kE=e=>e==="number",BS=e=>e==="family-name",qS=e=>e==="number"||e==="weight",HS=e=>e==="shadow",zE=()=>{const e=Ft("color"),t=Ft("font"),s=Ft("text"),a=Ft("font-weight"),r=Ft("tracking"),c=Ft("leading"),d=Ft("breakpoint"),f=Ft("container"),p=Ft("spacing"),m=Ft("radius"),b=Ft("shadow"),y=Ft("inset-shadow"),v=Ft("text-shadow"),x=Ft("drop-shadow"),j=Ft("blur"),S=Ft("perspective"),C=Ft("aspect"),_=Ft("ease"),E=Ft("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"],U=()=>[...z(),be,ve],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],A=()=>[be,ve,p],B=()=>[Si,"full","auto",...A()],ie=()=>[wi,"none","subgrid",be,ve],Q=()=>["auto",{span:["full",wi,be,ve]},wi,be,ve],ne=()=>[wi,"auto",be,ve],me=()=>["auto","min","max","fr",be,ve],ze=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],we=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...A()],T=()=>[Si,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],ae=()=>[Si,"screen","full","dvw","lvw","svw","min","max","fit",...A()],pe=()=>[Si,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],ee=()=>[e,be,ve],L=()=>[...z(),Ub,Mb,{position:[be,ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],se=()=>["auto","cover","contain",NE,bE,{size:[be,ve]}],re=()=>[Lh,Uo,la],ce=()=>["","none","full",m,be,ve],he=()=>["",De,Uo,la],de=()=>["solid","dashed","dotted","double"],Fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[De,Lh,Ub,Mb],Je=()=>["","none",j,be,ve],mt=()=>["none",De,be,ve],fe=()=>["none",De,be,ve],Ye=()=>[De,be,ve],dt=()=>[Si,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$s],breakpoint:[$s],color:[MS],container:[$s],"drop-shadow":[$s],ease:["in","out","in-out"],font:[vE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$s],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$s],shadow:[$s],spacing:["px",De],text:[$s],"text-shadow":[$s],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Si,ve,be,C]}],container:["container"],columns:[{columns:[De,ve,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:U()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[wi,"auto",be,ve]}],basis:[{basis:[Si,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Si,"auto","initial","none",ve]}],grow:[{grow:["",De,be,ve]}],shrink:[{shrink:["",De,be,ve]}],order:[{order:[wi,"first","last","none",be,ve]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":me()}],"auto-rows":[{"auto-rows":me()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...ze(),"normal"]}],"justify-items":[{"justify-items":[...we(),"normal"]}],"justify-self":[{"justify-self":["auto",...we()]}],"align-content":[{content:["normal",...ze()]}],"align-items":[{items:[...we(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...we(),{baseline:["","last"]}]}],"place-content":[{"place-content":ze()}],"place-items":[{"place-items":[...we(),"baseline"]}],"place-self":[{"place-self":["auto",...we()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],"inline-size":[{inline:["auto",...ae()]}],"min-inline-size":[{"min-inline":["auto",...ae()]}],"max-inline-size":[{"max-inline":["none",...ae()]}],"block-size":[{block:["auto",...pe()]}],"min-block-size":[{"min-block":["auto",...pe()]}],"max-block-size":[{"max-block":["none",...pe()]}],w:[{w:[f,"screen",...T()]}],"min-w":[{"min-w":[f,"screen","none",...T()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",s,Uo,la]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,_E,xE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lh,ve]}],"font-family":[{font:[jE,SE,t]}],"font-features":[{"font-features":[ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,be,ve]}],"line-clamp":[{"line-clamp":[De,"none",be,Lb]}],leading:[{leading:[c,...A()]}],"list-image":[{"list-image":["none",be,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ee()}],"text-color":[{text:ee()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",be,la]}],"text-decoration-color":[{decoration:ee()}],"underline-offset":[{"underline-offset":[De,"auto",be,ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,ve]}],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,ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:se()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wi,be,ve],radial:["",be,ve],conic:[wi,be,ve]},CE,wE]}],"bg-color":[{bg:ee()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:ee()}],"gradient-via":[{via:ee()}],"gradient-to":[{to:ee()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:ee()}],"border-color-x":[{"border-x":ee()}],"border-color-y":[{"border-y":ee()}],"border-color-s":[{"border-s":ee()}],"border-color-e":[{"border-e":ee()}],"border-color-bs":[{"border-bs":ee()}],"border-color-be":[{"border-be":ee()}],"border-color-t":[{"border-t":ee()}],"border-color-r":[{"border-r":ee()}],"border-color-b":[{"border-b":ee()}],"border-color-l":[{"border-l":ee()}],"divide-color":[{divide:ee()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,be,ve]}],"outline-w":[{outline:["",De,Uo,la]}],"outline-color":[{outline:ee()}],shadow:[{shadow:["","none",b,Lc,Dc]}],"shadow-color":[{shadow:ee()}],"inset-shadow":[{"inset-shadow":["none",y,Lc,Dc]}],"inset-shadow-color":[{"inset-shadow":ee()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ee()}],"ring-offset-w":[{"ring-offset":[De,la]}],"ring-offset-color":[{"ring-offset":ee()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":ee()}],"text-shadow":[{"text-shadow":["none",v,Lc,Dc]}],"text-shadow-color":[{"text-shadow":ee()}],opacity:[{opacity:[De,be,ve]}],"mix-blend":[{"mix-blend":[...Fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Fe()}],"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":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":ee()}],"mask-image-linear-to-color":[{"mask-linear-to":ee()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":ee()}],"mask-image-t-to-color":[{"mask-t-to":ee()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":ee()}],"mask-image-r-to-color":[{"mask-r-to":ee()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":ee()}],"mask-image-b-to-color":[{"mask-b-to":ee()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":ee()}],"mask-image-l-to-color":[{"mask-l-to":ee()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":ee()}],"mask-image-x-to-color":[{"mask-x-to":ee()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":ee()}],"mask-image-y-to-color":[{"mask-y-to":ee()}],"mask-image-radial":[{"mask-radial":[be,ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":ee()}],"mask-image-radial-to-color":[{"mask-radial-to":ee()}],"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":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":ee()}],"mask-image-conic-to-color":[{"mask-conic-to":ee()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ve]}],filter:[{filter:["","none",be,ve]}],blur:[{blur:Je()}],brightness:[{brightness:[De,be,ve]}],contrast:[{contrast:[De,be,ve]}],"drop-shadow":[{"drop-shadow":["","none",x,Lc,Dc]}],"drop-shadow-color":[{"drop-shadow":ee()}],grayscale:[{grayscale:["",De,be,ve]}],"hue-rotate":[{"hue-rotate":[De,be,ve]}],invert:[{invert:["",De,be,ve]}],saturate:[{saturate:[De,be,ve]}],sepia:[{sepia:["",De,be,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",be,ve]}],"backdrop-blur":[{"backdrop-blur":Je()}],"backdrop-brightness":[{"backdrop-brightness":[De,be,ve]}],"backdrop-contrast":[{"backdrop-contrast":[De,be,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,be,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,be,ve]}],"backdrop-invert":[{"backdrop-invert":["",De,be,ve]}],"backdrop-opacity":[{"backdrop-opacity":[De,be,ve]}],"backdrop-saturate":[{"backdrop-saturate":[De,be,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",De,be,ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",be,ve]}],ease:[{ease:["linear","initial",_,be,ve]}],delay:[{delay:[De,be,ve]}],animate:[{animate:["none",E,be,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,ve]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:mt()}],"rotate-x":[{"rotate-x":mt()}],"rotate-y":[{"rotate-y":mt()}],"rotate-z":[{"rotate-z":mt()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":["scale-3d"],skew:[{skew:Ye()}],"skew-x":[{"skew-x":Ye()}],"skew-y":[{"skew-y":Ye()}],transform:[{transform:[be,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"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:ee()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ee()}],"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,ve]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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,ve]}],fill:[{fill:["none",...ee()]}],"stroke-w":[{stroke:[De,Uo,la,Lb]}],stroke:[{stroke:["none",...ee()]}],"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"]}},EE=oE(zE);function Kn(...e){return EE(zS(e))}const RE=ES("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"}}),le=N.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,...r},c)=>{const d=a?L2:"button";return l.jsx(d,{ref:c,className:Kn(RE({variant:t,size:s,className:e})),...r})});le.displayName="Button";const OE=ES("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 ZS({className:e,variant:t,...s}){return l.jsx("div",{className:Kn(OE({variant:t}),e),...s})}function Pb({compact:e=!1}){return l.jsxs(gt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[l.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),l.jsxs("span",{className:"brand-copy",children:[l.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:l.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function Xo({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",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return l.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${t[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function vu(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function FS(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"queued":case"running":return"neutral";default:return"neutral"}}function AE(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 TE(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function ot({tone:e,children:t}){const s=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return l.jsx(ZS,{variant:s,children:t})}function Pu({status:e}){return l.jsx(ot,{tone:FS(e),children:Uu(e)})}function Ti(e,t,{checkForDefaultPrevented:s=!0}={}){return function(r){if(e?.(r),s===!1||!r.defaultPrevented)return t?.(r)}}function DE(e,t){const s=N.createContext(t),a=c=>{const{children:d,...f}=c,p=N.useMemo(()=>f,Object.values(f));return l.jsx(s.Provider,{value:p,children:d})};a.displayName=e+"Provider";function r(c){const d=N.useContext(s);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[a,r]}function LE(e,t=[]){let s=[];function a(c,d){const f=N.createContext(d),p=s.length;s=[...s,d];const m=y=>{const{scope:v,children:x,...j}=y,S=v?.[e]?.[p]||f,C=N.useMemo(()=>j,Object.values(j));return l.jsx(S.Provider,{value:C,children:x})};m.displayName=c+"Provider";function b(y,v){const x=v?.[e]?.[p]||f,j=N.useContext(x);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[m,b]}const r=()=>{const c=s.map(d=>N.createContext(d));return function(f){const p=f?.[e]||c;return N.useMemo(()=>({[`__scope${e}`]:{...f,[e]:p}}),[f,p])}};return r.scopeName=e,[a,ME(r,...t)]}function ME(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(c){const d=a.reduce((f,{useScope:p,scopeName:m})=>{const y=p(c)[`__scope${m}`];return{...f,...y}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}var Wo=globalThis?.document?N.useLayoutEffect:()=>{},UE=Mm[" useId ".trim().toString()]||(()=>{}),PE=0;function Mh(e){const[t,s]=N.useState(UE());return Wo(()=>{s(a=>a??String(PE++))},[e]),e||(t?`radix-${t}`:"")}var IE=Mm[" useInsertionEffect ".trim().toString()]||Wo;function $E({prop:e,defaultProp:t,onChange:s=()=>{},caller:a}){const[r,c,d]=BE({defaultProp:t,onChange:s}),f=e!==void 0,p=f?e:r;{const b=N.useRef(e!==void 0);N.useEffect(()=>{const y=b.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.`),b.current=f},[f,a])}const m=N.useCallback(b=>{if(f){const y=qE(b)?b(e):b;y!==e&&d.current?.(y)}else c(b)},[f,e,c,d]);return[p,m]}function BE({defaultProp:e,onChange:t}){const[s,a]=N.useState(e),r=N.useRef(s),c=N.useRef(t);return IE(()=>{c.current=t},[t]),N.useEffect(()=>{r.current!==s&&(c.current?.(s),r.current=s)},[s,r]),[s,a,c]}function qE(e){return typeof e=="function"}function GS(e){const t=HE(e),s=N.forwardRef((a,r)=>{const{children:c,...d}=a,f=N.Children.toArray(c),p=f.find(FE);if(p){const m=p.props.children,b=f.map(y=>y===p?N.Children.count(m)>1?N.Children.only(null):N.isValidElement(m)?m.props.children:null:y);return l.jsx(t,{...d,ref:r,children:N.isValidElement(m)?N.cloneElement(m,void 0,b):null})}return l.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}function HE(e){const t=N.forwardRef((s,a)=>{const{children:r,...c}=s;if(N.isValidElement(r)){const d=KE(r),f=GE(c,r.props);return r.type!==N.Fragment&&(f.ref=a?sp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZE=Symbol("radix.slottable");function FE(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZE}function GE(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const p=c(...f);return r(...f),p}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function KE(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 VE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zs=VE.reduce((e,t)=>{const s=GS(`Primitive.${t}`),a=N.forwardRef((r,c)=>{const{asChild:d,...f}=r,p=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(p,{...f,ref:c})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function QE(e,t){e&&tp.flushSync(()=>e.dispatchEvent(t))}function el(e){const t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...s)=>t.current?.(...s),[])}function YE(e,t=globalThis?.document){const s=el(e);N.useEffect(()=>{const a=r=>{r.key==="Escape"&&s(r)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[s,t])}var JE="DismissableLayer",pm="dismissableLayer.update",XE="dismissableLayer.pointerDownOutside",WE="dismissableLayer.focusOutside",Ib,KS=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),VS=N.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...p}=e,m=N.useContext(KS),[b,y]=N.useState(null),v=b?.ownerDocument??globalThis?.document,[,x]=N.useState({}),j=Na(t,M=>y(M)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),_=S.indexOf(C),E=b?S.indexOf(b):-1,R=m.layersWithOutsidePointerEventsDisabled.size>0,z=E>=_,U=nR(M=>{const A=M.target,B=[...m.branches].some(ie=>ie.contains(A));!z||B||(r?.(M),d?.(M),M.defaultPrevented||f?.())},v),O=sR(M=>{const A=M.target;[...m.branches].some(ie=>ie.contains(A))||(c?.(M),d?.(M),M.defaultPrevented||f?.())},v);return YE(M=>{E===m.layers.size-1&&(a?.(M),!M.defaultPrevented&&f&&(M.preventDefault(),f()))},v),N.useEffect(()=>{if(b)return s&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Ib=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(b)),m.layers.add(b),$b(),()=>{s&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Ib)}},[b,v,s,m]),N.useEffect(()=>()=>{b&&(m.layers.delete(b),m.layersWithOutsidePointerEventsDisabled.delete(b),$b())},[b,m]),N.useEffect(()=>{const M=()=>x({});return document.addEventListener(pm,M),()=>document.removeEventListener(pm,M)},[]),l.jsx(Zs.div,{...p,ref:j,style:{pointerEvents:R?z?"auto":"none":void 0,...e.style},onFocusCapture:Ti(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ti(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ti(e.onPointerDownCapture,U.onPointerDownCapture)})});VS.displayName=JE;var eR="DismissableLayerBranch",tR=N.forwardRef((e,t)=>{const s=N.useContext(KS),a=N.useRef(null),r=Na(t,a);return N.useEffect(()=>{const c=a.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),l.jsx(Zs.div,{...e,ref:r})});tR.displayName=eR;function nR(e,t=globalThis?.document){const s=el(e),a=N.useRef(!1),r=N.useRef(()=>{});return N.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let p=function(){QS(XE,s,m,{discrete:!0})};const m={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=p,t.addEventListener("click",r.current,{once:!0})):p()}else t.removeEventListener("click",r.current);a.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",c),t.removeEventListener("click",r.current)}},[t,s]),{onPointerDownCapture:()=>a.current=!0}}function sR(e,t=globalThis?.document){const s=el(e),a=N.useRef(!1);return N.useEffect(()=>{const r=c=>{c.target&&!a.current&&QS(WE,s,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,s]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function $b(){const e=new CustomEvent(pm);document.dispatchEvent(e)}function QS(e,t,s,{discrete:a}){const r=s.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&r.addEventListener(e,t,{once:!0}),a?QE(r,c):r.dispatchEvent(c)}var Uh="focusScope.autoFocusOnMount",Ph="focusScope.autoFocusOnUnmount",Bb={bubbles:!1,cancelable:!0},iR="FocusScope",YS=N.forwardRef((e,t)=>{const{loop:s=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:c,...d}=e,[f,p]=N.useState(null),m=el(r),b=el(c),y=N.useRef(null),v=Na(t,S=>p(S)),x=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(a){let S=function(R){if(x.paused||!f)return;const z=R.target;f.contains(z)?y.current=z:ji(y.current,{select:!0})},C=function(R){if(x.paused||!f)return;const z=R.relatedTarget;z!==null&&(f.contains(z)||ji(y.current,{select:!0}))},_=function(R){if(document.activeElement===document.body)for(const U of R)U.removedNodes.length>0&&ji(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const E=new MutationObserver(_);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),E.disconnect()}}},[a,f,x.paused]),N.useEffect(()=>{if(f){Hb.add(x);const S=document.activeElement;if(!f.contains(S)){const _=new CustomEvent(Uh,Bb);f.addEventListener(Uh,m),f.dispatchEvent(_),_.defaultPrevented||(aR(uR(JS(f)),{select:!0}),document.activeElement===S&&ji(f))}return()=>{f.removeEventListener(Uh,m),setTimeout(()=>{const _=new CustomEvent(Ph,Bb);f.addEventListener(Ph,b),f.dispatchEvent(_),_.defaultPrevented||ji(S??document.body,{select:!0}),f.removeEventListener(Ph,b),Hb.remove(x)},0)}}},[f,m,b,x]);const j=N.useCallback(S=>{if(!s&&!a||x.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,_=document.activeElement;if(C&&_){const E=S.currentTarget,[R,z]=rR(E);R&&z?!S.shiftKey&&_===z?(S.preventDefault(),s&&ji(R,{select:!0})):S.shiftKey&&_===R&&(S.preventDefault(),s&&ji(z,{select:!0})):_===E&&S.preventDefault()}},[s,a,x.paused]);return l.jsx(Zs.div,{tabIndex:-1,...d,ref:v,onKeyDown:j})});YS.displayName=iR;function aR(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(ji(a,{select:t}),document.activeElement!==s)return}function rR(e){const t=JS(e),s=qb(t,e),a=qb(t.reverse(),e);return[s,a]}function JS(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function qb(e,t){for(const s of e)if(!oR(s,{upTo:t}))return s}function oR(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 lR(e){return e instanceof HTMLInputElement&&"select"in e}function ji(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&lR(e)&&t&&e.select()}}var Hb=cR();function cR(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=Zb(e,t),e.unshift(t)},remove(t){e=Zb(e,t),e[0]?.resume()}}}function Zb(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function uR(e){return e.filter(t=>t.tagName!=="A")}var dR="Portal",XS=N.forwardRef((e,t)=>{const{container:s,...a}=e,[r,c]=N.useState(!1);Wo(()=>c(!0),[]);const d=s||r&&globalThis?.document?.body;return d?Nz.createPortal(l.jsx(Zs.div,{...a,ref:t}),d):null});XS.displayName=dR;function fR(e,t){return N.useReducer((s,a)=>t[s][a]??s,e)}var Iu=e=>{const{present:t,children:s}=e,a=hR(t),r=typeof s=="function"?s({present:a.isPresent}):N.Children.only(s),c=Na(a.ref,mR(r));return typeof s=="function"||a.isPresent?N.cloneElement(r,{ref:c}):null};Iu.displayName="Presence";function hR(e){const[t,s]=N.useState(),a=N.useRef(null),r=N.useRef(e),c=N.useRef("none"),d=e?"mounted":"unmounted",[f,p]=fR(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const m=Mc(a.current);c.current=f==="mounted"?m:"none"},[f]),Wo(()=>{const m=a.current,b=r.current;if(b!==e){const v=c.current,x=Mc(m);e?p("MOUNT"):x==="none"||m?.display==="none"?p("UNMOUNT"):p(b&&v!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,p]),Wo(()=>{if(t){let m;const b=t.ownerDocument.defaultView??window,y=x=>{const S=Mc(a.current).includes(CSS.escape(x.animationName));if(x.target===t&&S&&(p("ANIMATION_END"),!r.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=b.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=x=>{x.target===t&&(c.current=Mc(a.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{b.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:N.useCallback(m=>{a.current=m?getComputedStyle(m):null,s(m)},[])}}function Mc(e){return e?.animationName||"none"}function mR(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 Ih=0;function pR(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Fb()),document.body.insertAdjacentElement("beforeend",e[1]??Fb()),Ih++,()=>{Ih===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ih--}},[])}function Fb(){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 ys=function(){return ys=Object.assign||function(t){for(var s,a=1,r=arguments.length;a<r;a++){s=arguments[a];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(t[c]=s[c])}return t},ys.apply(this,arguments)};function WS(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s}function gR(e,t,s){if(s||arguments.length===2)for(var a=0,r=t.length,c;a<r;a++)(c||!(a in t))&&(c||(c=Array.prototype.slice.call(t,0,a)),c[a]=t[a]);return e.concat(c||Array.prototype.slice.call(t))}var eu="right-scroll-bar-position",tu="width-before-scroll-bar",yR="with-scroll-bars-hidden",vR="--removed-body-scroll-bar-size";function $h(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function bR(e,t){var s=N.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(a){var r=s.value;r!==a&&(s.value=a,s.callback(a,r))}}}})[0];return s.callback=t,s.facade}var xR=typeof window<"u"?N.useLayoutEffect:N.useEffect,Gb=new WeakMap;function SR(e,t){var s=bR(null,function(a){return e.forEach(function(r){return $h(r,a)})});return xR(function(){var a=Gb.get(s);if(a){var r=new Set(a),c=new Set(e),d=s.current;r.forEach(function(f){c.has(f)||$h(f,null)}),c.forEach(function(f){r.has(f)||$h(f,d)})}Gb.set(s,e)},[e]),s}function wR(e){return e}function jR(e,t){t===void 0&&(t=wR);var s=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var d=t(c,a);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(a=!0;s.length;){var d=s;s=[],d.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){a=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(c),d=s}var p=function(){var b=d;d=[],b.forEach(c)},m=function(){return Promise.resolve().then(p)};m(),s={push:function(b){d.push(b),m()},filter:function(b){return d=d.filter(b),s}}}};return r}function NR(e){e===void 0&&(e={});var t=jR(null);return t.options=ys({async:!0,ssr:!1},e),t}var ew=function(e){var t=e.sideCar,s=WS(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return N.createElement(a,ys({},s))};ew.isSideCarExport=!0;function CR(e,t){return e.useMedium(t),ew}var tw=NR(),Bh=function(){},$u=N.forwardRef(function(e,t){var s=N.useRef(null),a=N.useState({onScrollCapture:Bh,onWheelCapture:Bh,onTouchMoveCapture:Bh}),r=a[0],c=a[1],d=e.forwardProps,f=e.children,p=e.className,m=e.removeScrollBar,b=e.enabled,y=e.shards,v=e.sideCar,x=e.noRelative,j=e.noIsolation,S=e.inert,C=e.allowPinchZoom,_=e.as,E=_===void 0?"div":_,R=e.gapMode,z=WS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),U=v,O=SR([s,t]),M=ys(ys({},z),r);return N.createElement(N.Fragment,null,b&&N.createElement(U,{sideCar:tw,removeScrollBar:m,shards:y,noRelative:x,noIsolation:j,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:s,gapMode:R}),d?N.cloneElement(N.Children.only(f),ys(ys({},M),{ref:O})):N.createElement(E,ys({},M,{className:p,ref:O}),f))});$u.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$u.classNames={fullWidth:tu,zeroRight:eu};var _R=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function kR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_R();return t&&e.setAttribute("nonce",t),e}function zR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ER(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var RR=function(){var e=0,t=null;return{add:function(s){e==0&&(t=kR())&&(zR(t,s),ER(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},OR=function(){var e=RR();return function(t,s){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},nw=function(){var e=OR(),t=function(s){var a=s.styles,r=s.dynamic;return e(a,r),null};return t},AR={left:0,top:0,right:0,gap:0},qh=function(e){return parseInt(e||"",10)||0},TR=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[qh(s),qh(a),qh(r)]},DR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return AR;var t=TR(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])}},LR=nw(),Cr="data-scroll-locked",MR=function(e,t,s,a){var r=e.left,c=e.top,d=e.right,f=e.gap;return s===void 0&&(s="margin"),`
|
|
13
|
+
.`.concat(yR,` {
|
|
14
|
+
overflow: hidden `).concat(a,`;
|
|
15
|
+
padding-right: `).concat(f,"px ").concat(a,`;
|
|
16
|
+
}
|
|
17
|
+
body[`).concat(Cr,`] {
|
|
18
|
+
overflow: hidden `).concat(a,`;
|
|
19
|
+
overscroll-behavior: contain;
|
|
20
|
+
`).concat([t&&"position: relative ".concat(a,";"),s==="margin"&&`
|
|
21
|
+
padding-left: `.concat(r,`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(eu,` {
|
|
31
|
+
right: `).concat(f,"px ").concat(a,`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.`).concat(tu,` {
|
|
35
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.`).concat(eu," .").concat(eu,` {
|
|
39
|
+
right: 0 `).concat(a,`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.`).concat(tu," .").concat(tu,` {
|
|
43
|
+
margin-right: 0 `).concat(a,`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
body[`).concat(Cr,`] {
|
|
47
|
+
`).concat(vR,": ").concat(f,`px;
|
|
48
|
+
}
|
|
49
|
+
`)},Kb=function(){var e=parseInt(document.body.getAttribute(Cr)||"0",10);return isFinite(e)?e:0},UR=function(){N.useEffect(function(){return document.body.setAttribute(Cr,(Kb()+1).toString()),function(){var e=Kb()-1;e<=0?document.body.removeAttribute(Cr):document.body.setAttribute(Cr,e.toString())}},[])},PR=function(e){var t=e.noRelative,s=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;UR();var c=N.useMemo(function(){return DR(r)},[r]);return N.createElement(LR,{styles:MR(c,!t,r,s?"":"!important")})},gm=!1;if(typeof window<"u")try{var Uc=Object.defineProperty({},"passive",{get:function(){return gm=!0,!0}});window.addEventListener("test",Uc,Uc),window.removeEventListener("test",Uc,Uc)}catch{gm=!1}var hr=gm?{passive:!1}:!1,IR=function(e){return e.tagName==="TEXTAREA"},sw=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!IR(e)&&s[t]==="visible")},$R=function(e){return sw(e,"overflowY")},BR=function(e){return sw(e,"overflowX")},Vb=function(e,t){var s=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=iw(e,a);if(r){var c=aw(e,a),d=c[1],f=c[2];if(d>f)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},qR=function(e){var t=e.scrollTop,s=e.scrollHeight,a=e.clientHeight;return[t,s,a]},HR=function(e){var t=e.scrollLeft,s=e.scrollWidth,a=e.clientWidth;return[t,s,a]},iw=function(e,t){return e==="v"?$R(t):BR(t)},aw=function(e,t){return e==="v"?qR(t):HR(t)},ZR=function(e,t){return e==="h"&&t==="rtl"?-1:1},FR=function(e,t,s,a,r){var c=ZR(e,window.getComputedStyle(t).direction),d=c*a,f=s.target,p=t.contains(f),m=!1,b=d>0,y=0,v=0;do{if(!f)break;var x=aw(e,f),j=x[0],S=x[1],C=x[2],_=S-C-c*j;(j||_)&&iw(e,f)&&(y+=_,v+=j);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&f!==document.body||p&&(t.contains(f)||t===f));return(b&&Math.abs(y)<1||!b&&Math.abs(v)<1)&&(m=!0),m},Pc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qb=function(e){return[e.deltaX,e.deltaY]},Yb=function(e){return e&&"current"in e?e.current:e},GR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},KR=function(e){return`
|
|
50
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
51
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
52
|
+
`)},VR=0,mr=[];function QR(e){var t=N.useRef([]),s=N.useRef([0,0]),a=N.useRef(),r=N.useState(VR++)[0],c=N.useState(nw)[0],d=N.useRef(e);N.useEffect(function(){d.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var S=gR([e.lockRef.current],(e.shards||[]).map(Yb),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var f=N.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var _=Pc(S),E=s.current,R="deltaX"in S?S.deltaX:E[0]-_[0],z="deltaY"in S?S.deltaY:E[1]-_[1],U,O=S.target,M=Math.abs(R)>Math.abs(z)?"h":"v";if("touches"in S&&M==="h"&&O.type==="range")return!1;var A=window.getSelection(),B=A&&A.anchorNode,ie=B?B===O||B.contains(O):!1;if(ie)return!1;var Q=Vb(M,O);if(!Q)return!0;if(Q?U=M:(U=M==="v"?"h":"v",Q=Vb(M,O)),!Q)return!1;if(!a.current&&"changedTouches"in S&&(R||z)&&(a.current=U),!U)return!0;var ne=a.current||U;return FR(ne,C,S,ne==="h"?R:z)},[]),p=N.useCallback(function(S){var C=S;if(!(!mr.length||mr[mr.length-1]!==c)){var _="deltaY"in C?Qb(C):Pc(C),E=t.current.filter(function(U){return U.name===C.type&&(U.target===C.target||C.target===U.shadowParent)&&GR(U.delta,_)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(d.current.shards||[]).map(Yb).filter(Boolean).filter(function(U){return U.contains(C.target)}),z=R.length>0?f(C,R[0]):!d.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),m=N.useCallback(function(S,C,_,E){var R={name:S,delta:C,target:_,should:E,shadowParent:YR(_)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(z){return z!==R})},1)},[]),b=N.useCallback(function(S){s.current=Pc(S),a.current=void 0},[]),y=N.useCallback(function(S){m(S.type,Qb(S),S.target,f(S,e.lockRef.current))},[]),v=N.useCallback(function(S){m(S.type,Pc(S),S.target,f(S,e.lockRef.current))},[]);N.useEffect(function(){return mr.push(c),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:v}),document.addEventListener("wheel",p,hr),document.addEventListener("touchmove",p,hr),document.addEventListener("touchstart",b,hr),function(){mr=mr.filter(function(S){return S!==c}),document.removeEventListener("wheel",p,hr),document.removeEventListener("touchmove",p,hr),document.removeEventListener("touchstart",b,hr)}},[]);var x=e.removeScrollBar,j=e.inert;return N.createElement(N.Fragment,null,j?N.createElement(c,{styles:KR(r)}):null,x?N.createElement(PR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function YR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const JR=CR(tw,QR);var rw=N.forwardRef(function(e,t){return N.createElement($u,ys({},e,{ref:t,sideCar:JR}))});rw.classNames=$u.classNames;var XR=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pr=new WeakMap,Ic=new WeakMap,$c={},Hh=0,ow=function(e){return e&&(e.host||ow(e.parentNode))},WR=function(e,t){return t.map(function(s){if(e.contains(s))return s;var a=ow(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})},eO=function(e,t,s,a){var r=WR(t,Array.isArray(e)?e:[e]);$c[s]||($c[s]=new WeakMap);var c=$c[s],d=[],f=new Set,p=new Set(r),m=function(y){!y||f.has(y)||(f.add(y),m(y.parentNode))};r.forEach(m);var b=function(y){!y||p.has(y)||Array.prototype.forEach.call(y.children,function(v){if(f.has(v))b(v);else try{var x=v.getAttribute(a),j=x!==null&&x!=="false",S=(pr.get(v)||0)+1,C=(c.get(v)||0)+1;pr.set(v,S),c.set(v,C),d.push(v),S===1&&j&&Ic.set(v,!0),C===1&&v.setAttribute(s,"true"),j||v.setAttribute(a,"true")}catch(_){console.error("aria-hidden: cannot operate on ",v,_)}})};return b(t),f.clear(),Hh++,function(){d.forEach(function(y){var v=pr.get(y)-1,x=c.get(y)-1;pr.set(y,v),c.set(y,x),v||(Ic.has(y)||y.removeAttribute(a),Ic.delete(y)),x||y.removeAttribute(s)}),Hh--,Hh||(pr=new WeakMap,pr=new WeakMap,Ic=new WeakMap,$c={})}},tO=function(e,t,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=XR(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),eO(a,r,s,"aria-hidden")):function(){return null}},Bu="Dialog",[lw]=LE(Bu),[nO,as]=lw(Bu),cw=e=>{const{__scopeDialog:t,children:s,open:a,defaultOpen:r,onOpenChange:c,modal:d=!0}=e,f=N.useRef(null),p=N.useRef(null),[m,b]=$E({prop:a,defaultProp:r??!1,onChange:c,caller:Bu});return l.jsx(nO,{scope:t,triggerRef:f,contentRef:p,contentId:Mh(),titleId:Mh(),descriptionId:Mh(),open:m,onOpenChange:b,onOpenToggle:N.useCallback(()=>b(y=>!y),[b]),modal:d,children:s})};cw.displayName=Bu;var uw="DialogTrigger",sO=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(uw,s),c=Na(t,r.triggerRef);return l.jsx(Zs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":lp(r.open),...a,ref:c,onClick:Ti(e.onClick,r.onOpenToggle)})});sO.displayName=uw;var rp="DialogPortal",[iO,dw]=lw(rp,{forceMount:void 0}),fw=e=>{const{__scopeDialog:t,forceMount:s,children:a,container:r}=e,c=as(rp,t);return l.jsx(iO,{scope:t,forceMount:s,children:N.Children.map(a,d=>l.jsx(Iu,{present:s||c.open,children:l.jsx(XS,{asChild:!0,container:r,children:d})}))})};fw.displayName=rp;var bu="DialogOverlay",hw=N.forwardRef((e,t)=>{const s=dw(bu,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=as(bu,e.__scopeDialog);return c.modal?l.jsx(Iu,{present:a||c.open,children:l.jsx(rO,{...r,ref:t})}):null});hw.displayName=bu;var aO=GS("DialogOverlay.RemoveScroll"),rO=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(bu,s);return l.jsx(rw,{as:aO,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(Zs.div,{"data-state":lp(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Sa="DialogContent",mw=N.forwardRef((e,t)=>{const s=dw(Sa,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=as(Sa,e.__scopeDialog);return l.jsx(Iu,{present:a||c.open,children:c.modal?l.jsx(oO,{...r,ref:t}):l.jsx(lO,{...r,ref:t})})});mw.displayName=Sa;var oO=N.forwardRef((e,t)=>{const s=as(Sa,e.__scopeDialog),a=N.useRef(null),r=Na(t,s.contentRef,a);return N.useEffect(()=>{const c=a.current;if(c)return tO(c)},[]),l.jsx(pw,{...e,ref:r,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ti(e.onCloseAutoFocus,c=>{c.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Ti(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&c.preventDefault()}),onFocusOutside:Ti(e.onFocusOutside,c=>c.preventDefault())})}),lO=N.forwardRef((e,t)=>{const s=as(Sa,e.__scopeDialog),a=N.useRef(!1),r=N.useRef(!1);return l.jsx(pw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(a.current||s.triggerRef.current?.focus(),c.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(a.current=!0,c.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const d=c.target;s.triggerRef.current?.contains(d)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&r.current&&c.preventDefault()}})}),pw=N.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:c,...d}=e,f=as(Sa,s),p=N.useRef(null),m=Na(t,p);return pR(),l.jsxs(l.Fragment,{children:[l.jsx(YS,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:c,children:l.jsx(VS,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":lp(f.open),...d,ref:m,onDismiss:()=>f.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(cO,{titleId:f.titleId}),l.jsx(dO,{contentRef:p,descriptionId:f.descriptionId})]})]})}),op="DialogTitle",gw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(op,s);return l.jsx(Zs.h2,{id:r.titleId,...a,ref:t})});gw.displayName=op;var yw="DialogDescription",vw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(yw,s);return l.jsx(Zs.p,{id:r.descriptionId,...a,ref:t})});vw.displayName=yw;var bw="DialogClose",xw=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=as(bw,s);return l.jsx(Zs.button,{type:"button",...a,ref:t,onClick:Ti(e.onClick,()=>r.onOpenChange(!1))})});xw.displayName=bw;function lp(e){return e?"open":"closed"}var Sw="DialogTitleWarning",[k3,ww]=DE(Sw,{contentName:Sa,titleName:op,docsSlug:"dialog"}),cO=({titleId:e})=>{const t=ww(Sw),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 N.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},uO="DialogDescriptionWarning",dO=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ww(uO).contentName}}.`;return N.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},jw=cw,Nw=fw,cp=hw,up=mw,dp=gw,Cw=vw,_w=xw;const fO=jw,hO=Nw,kw=N.forwardRef(({className:e,...t},s)=>l.jsx(cp,{ref:s,className:Kn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));kw.displayName=cp.displayName;const mO=400,pO=1200,gO=720,zw=N.forwardRef(({className:e,children:t,...s},a)=>{const[r,c]=N.useState(gO),d=N.useRef(!1),f=N.useRef(0),p=N.useRef(0),m=N.useCallback(v=>{d.current=!0,f.current=v.clientX,p.current=r,v.target.setPointerCapture(v.pointerId),v.preventDefault()},[r]),b=N.useCallback(v=>{if(!d.current)return;const x=f.current-v.clientX,j=Math.min(pO,Math.max(mO,p.current+x));c(j)},[]),y=N.useCallback(()=>{d.current=!1},[]);return l.jsxs(hO,{children:[l.jsx(kw,{}),l.jsxs(up,{ref:a,className:Kn("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${r}px, 100vw)`},...s,children:[l.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:m,onPointerMove:b,onPointerUp:y}),t,l.jsxs(_w,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[l.jsx(Mu,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});zw.displayName=up.displayName;const yO=({className:e,...t})=>l.jsx("div",{className:Kn("flex flex-col gap-1.5 pr-10",e),...t}),Ew=N.forwardRef(({className:e,...t},s)=>l.jsx(dp,{ref:s,className:Kn("text-lg font-medium text-zinc-50",e),...t}));Ew.displayName=dp.displayName;const Rw=N.forwardRef(({className:e,...t},s)=>l.jsx(Cw,{ref:s,className:Kn("text-sm text-zinc-500",e),...t}));Rw.displayName=Cw.displayName;function vO({title:e,subtitle:t,children:s,open:a,onClose:r}){return l.jsx(fO,{open:a,onOpenChange:c=>c?void 0:r(),children:l.jsxs(zw,{children:[l.jsxs(yO,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(Ew,{id:"drawer-title",children:e}),l.jsx(Rw,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:s})]})})}function X(e,t,s){function a(f,p){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:p,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,p);const m=d.prototype,b=Object.keys(m);for(let y=0;y<b.length;y++){const v=b[y];v in f||(f[v]=m[v].bind(f))}}const r=s?.Parent??Object;class c extends r{}Object.defineProperty(c,"name",{value:e});function d(f){var p;const m=s?.Parent?new c:this;a(m,f),(p=m._zod).deferred??(p.deferred=[]);for(const b of m._zod.deferred)b();return m}return Object.defineProperty(d,"init",{value:a}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>s?.Parent&&f instanceof s.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class _r extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ow extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Aw={};function Mi(e){return Aw}function Tw(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,r])=>t.indexOf(+a)===-1).map(([a,r])=>r)}function ym(e,t){return typeof t=="bigint"?t.toString():t}function fp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function hp(e){return e==null}function mp(e){const t=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(t,s)}function bO(e,t){const s=(e.toString().split(".")[1]||"").length,a=t.toString();let r=(a.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(a)){const p=a.match(/\d?e-(\d?)/);p?.[1]&&(r=Number.parseInt(p[1]))}const c=s>r?s:r,d=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return d%f/10**c}const Jb=Symbol("evaluating");function et(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==Jb)return a===void 0&&(a=Jb,a=s()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function _a(e,t,s){Object.defineProperty(e,t,{value:s,writable:!0,enumerable:!0,configurable:!0})}function $i(...e){const t={};for(const s of e){const a=Object.getOwnPropertyDescriptors(s);Object.assign(t,a)}return Object.defineProperties({},t)}function Xb(e){return JSON.stringify(e)}function xO(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Dw="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function xu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const SO=fp(()=>{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(xu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(xu(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function Lw(e){return Or(e)?{...e}:Array.isArray(e)?[...e]:e}const wO=new Set(["string","number","symbol"]);function Ar(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bi(e,t,s){const a=new e._zod.constr(t??e._zod.def);return(!t||s?.parent)&&(a._zod.parent=e),a}function je(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 jO(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const NO={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 CO(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=$i(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 _a(this,"shape",d),d},checks:[]});return Bi(e,c)}function _O(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=$i(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 _a(this,"shape",d),d},checks:[]});return Bi(e,c)}function kO(e,t){if(!Or(t))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0){const c=e._zod.def.shape;for(const d in t)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=$i(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return _a(this,"shape",c),c}});return Bi(e,r)}function zO(e,t){if(!Or(t))throw new Error("Invalid input to safeExtend: expected a plain object");const s=$i(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return _a(this,"shape",a),a}});return Bi(e,s)}function EO(e,t){const s=$i(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return _a(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Bi(e,s)}function RO(e,t,s){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=$i(t._zod.def,{get shape(){const f=t._zod.def.shape,p={...f};if(s)for(const m in s){if(!(m in f))throw new Error(`Unrecognized key: "${m}"`);s[m]&&(p[m]=e?new e({type:"optional",innerType:f[m]}):f[m])}else for(const m in f)p[m]=e?new e({type:"optional",innerType:f[m]}):f[m];return _a(this,"shape",p),p},checks:[]});return Bi(t,d)}function OO(e,t,s){const a=$i(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(s)for(const d in s){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);s[d]&&(c[d]=new e({type:"nonoptional",innerType:r[d]}))}else for(const d in r)c[d]=new e({type:"nonoptional",innerType:r[d]});return _a(this,"shape",c),c}});return Bi(t,a)}function xr(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 Sr(e,t){return t.map(s=>{var a;return(a=s).path??(a.path=[]),s.path.unshift(e),s})}function Bc(e){return typeof e=="string"?e:e?.message}function Ui(e,t,s){const a={...e,path:e.path??[]};if(!e.message){const r=Bc(e.inst?._zod.def?.error?.(e))??Bc(t?.error?.(e))??Bc(s.customError?.(e))??Bc(s.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function pp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function tl(...e){const[t,s,a]=e;return typeof t=="string"?{message:t,code:"custom",input:s,inst:a}:{...t}}const Mw=(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,ym,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Uw=X("$ZodError",Mw),Pw=X("$ZodError",Mw,{Parent:Error});function AO(e,t=s=>s.message){const s={},a=[];for(const r of e.issues)r.path.length>0?(s[r.path[0]]=s[r.path[0]]||[],s[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:s}}function TO(e,t=s=>s.message){const s={_errors:[]},a=r=>{for(const c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>a({issues:d}));else if(c.code==="invalid_key")a({issues:c.issues});else if(c.code==="invalid_element")a({issues:c.issues});else if(c.path.length===0)s._errors.push(t(c));else{let d=s,f=0;for(;f<c.path.length;){const p=c.path[f];f===c.path.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(t(c))):d[p]=d[p]||{_errors:[]},d=d[p],f++}}};return a(e),s}const gp=e=>(t,s,a,r)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise)throw new _r;if(d.issues.length){const f=new(r?.Err??e)(d.issues.map(p=>Ui(p,c,Mi())));throw Dw(f,r?.callee),f}return d.value},yp=e=>async(t,s,a,r)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const f=new(r?.Err??e)(d.issues.map(p=>Ui(p,c,Mi())));throw Dw(f,r?.callee),f}return d.value},qu=e=>(t,s,a)=>{const r=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw new _r;return c.issues.length?{success:!1,error:new(e??Uw)(c.issues.map(d=>Ui(d,r,Mi())))}:{success:!0,data:c.value}},DO=qu(Pw),Hu=e=>async(t,s,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:s,issues:[]},r);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Ui(d,r,Mi())))}:{success:!0,data:c.value}},LO=Hu(Pw),MO=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return gp(e)(t,s,r)},UO=e=>(t,s,a)=>gp(e)(t,s,a),PO=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return yp(e)(t,s,r)},IO=e=>async(t,s,a)=>yp(e)(t,s,a),$O=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return qu(e)(t,s,r)},BO=e=>(t,s,a)=>qu(e)(t,s,a),qO=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Hu(e)(t,s,r)},HO=e=>async(t,s,a)=>Hu(e)(t,s,a),ZO=/^[cC][^\s-]{8,}$/,FO=/^[0-9a-z]+$/,GO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,KO=/^[0-9a-vA-V]{20}$/,VO=/^[A-Za-z0-9]{27}$/,QO=/^[a-zA-Z0-9_-]{21}$/,YO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,JO=/^([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})$/,Wb=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)$/,XO=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function eA(){return new RegExp(WO,"u")}const tA=/^(?:(?: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])$/,nA=/^(([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}|:))$/,sA=/^((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])$/,iA=/^(([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])$/,aA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Iw=/^[A-Za-z0-9_-]*$/,rA=/^\+[1-9]\d{6,14}$/,$w="(?:(?:\\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])))",oA=new RegExp(`^${$w}$`);function Bw(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 lA(e){return new RegExp(`^${Bw(e)}$`)}function cA(e){const t=Bw({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(`^${$w}T(?:${a})$`)}const uA=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},dA=/^-?\d+$/,qw=/^-?\d+(?:\.\d+)?$/,fA=/^(?:true|false)$/i,hA=/^[^A-Z]*$/,mA=/^[^a-z]*$/,Sn=X("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),Hw={number:"number",bigint:"bigint",object:"date"},Zw=X("$ZodCheckLessThan",(e,t)=>{Sn.init(e,t);const s=Hw[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:s,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fw=X("$ZodCheckGreaterThan",(e,t)=>{Sn.init(e,t);const s=Hw[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:s,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pA=X("$ZodCheckMultipleOf",(e,t)=>{Sn.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):bO(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})}}),gA=X("$ZodCheckNumberFormat",(e,t)=>{Sn.init(e,t),t.format=t.format||"float64";const s=t.format?.includes("int"),a=s?"int":"number",[r,c]=NO[t.format];e._zod.onattach.push(d=>{const f=d._zod.bag;f.format=t.format,f.minimum=r,f.maximum=c,s&&(f.pattern=dA)}),e._zod.check=d=>{const f=d.value;if(s){if(!Number.isInteger(f)){d.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?d.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):d.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}f<r&&d.issues.push({origin:"number",input:f,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),f>c&&d.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),yA=X("$ZodCheckMaxLength",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!hp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const r=a.value;if(r.length<=t.maximum)return;const d=pp(r);a.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),vA=X("$ZodCheckMinLength",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!hp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const r=a.value;if(r.length>=t.minimum)return;const d=pp(r);a.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bA=X("$ZodCheckLengthEquals",(e,t)=>{var s;Sn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!hp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=a=>{const r=a.value,c=r.length;if(c===t.length)return;const d=pp(r),f=c>t.length;a.issues.push({origin:d,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Zu=X("$ZodCheckStringFormat",(e,t)=>{var s,a;Sn.init(e,t),e._zod.onattach.push(r=>{const c=r._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(s=e._zod).check??(s.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),xA=X("$ZodCheckRegex",(e,t)=>{Zu.init(e,t),e._zod.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),SA=X("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=hA),Zu.init(e,t)}),wA=X("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=mA),Zu.init(e,t)}),jA=X("$ZodCheckIncludes",(e,t)=>{Sn.init(e,t);const s=Ar(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${s}`:s);t.pattern=a,e._zod.onattach.push(r=>{const c=r._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),NA=X("$ZodCheckStartsWith",(e,t)=>{Sn.init(e,t);const s=new RegExp(`^${Ar(t.prefix)}.*`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),CA=X("$ZodCheckEndsWith",(e,t)=>{Sn.init(e,t);const s=new RegExp(`.*${Ar(t.suffix)}$`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),_A=X("$ZodCheckOverwrite",(e,t)=>{Sn.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class kA{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),r=Math.min(...a.map(d=>d.length-d.trimStart().length)),c=a.map(d=>d.slice(r)).map(d=>" ".repeat(this.indent*2)+d);for(const d of c)this.content.push(d)}compile(){const t=Function,s=this?.args,r=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...s,r.join(`
|
|
58
|
+
`))}}const zA={major:4,minor:3,patch:6},bt=X("$ZodType",(e,t)=>{var s;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zA;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const r of a)for(const c of r._zod.onattach)c(e);if(a.length===0)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(d,f,p)=>{let m=xr(d),b;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(d))continue}else if(m)continue;const v=d.issues.length,x=y._zod.check(d);if(x instanceof Promise&&p?.async===!1)throw new _r;if(b||x instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await x,d.issues.length!==v&&(m||(m=xr(d,v)))});else{if(d.issues.length===v)continue;m||(m=xr(d,v))}}return b?b.then(()=>d):d},c=(d,f,p)=>{if(xr(d))return d.aborted=!0,d;const m=r(f,a,p);if(m instanceof Promise){if(p.async===!1)throw new _r;return m.then(b=>e._zod.parse(b,p))}return e._zod.parse(m,p)};e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){const m=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return m instanceof Promise?m.then(b=>c(b,d,f)):c(m,d,f)}const p=e._zod.parse(d,f);if(p instanceof Promise){if(f.async===!1)throw new _r;return p.then(m=>r(m,a,f))}return r(p,a,f)}}et(e,"~standard",()=>({validate:r=>{try{const c=DO(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return LO(e,r).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),vp=X("$ZodString",(e,t)=>{bt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??uA(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}}),vt=X("$ZodStringFormat",(e,t)=>{Zu.init(e,t),vp.init(e,t)}),EA=X("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=JO),vt.init(e,t)}),RA=X("$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=Wb(a))}else t.pattern??(t.pattern=Wb());vt.init(e,t)}),OA=X("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=XO),vt.init(e,t)}),AA=X("$ZodURL",(e,t)=>{vt.init(e,t),e._zod.check=s=>{try{const a=s.value.trim(),r=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:s.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:s.value,inst:e,continue:!t.abort})),t.normalize?s.value=r.href:s.value=a;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!t.abort})}}}),TA=X("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=eA()),vt.init(e,t)}),DA=X("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=QO),vt.init(e,t)}),LA=X("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ZO),vt.init(e,t)}),MA=X("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=FO),vt.init(e,t)}),UA=X("$ZodULID",(e,t)=>{t.pattern??(t.pattern=GO),vt.init(e,t)}),PA=X("$ZodXID",(e,t)=>{t.pattern??(t.pattern=KO),vt.init(e,t)}),IA=X("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=VO),vt.init(e,t)}),$A=X("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=cA(t)),vt.init(e,t)}),BA=X("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=oA),vt.init(e,t)}),qA=X("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=lA(t)),vt.init(e,t)}),HA=X("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=YO),vt.init(e,t)}),ZA=X("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tA),vt.init(e,t),e._zod.bag.format="ipv4"}),FA=X("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=nA),vt.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})}}}),GA=X("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=sA),vt.init(e,t)}),KA=X("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=iA),vt.init(e,t),e._zod.check=s=>{const a=s.value.split("/");try{if(a.length!==2)throw new Error;const[r,c]=a;if(!c)throw new Error;const d=Number(c);if(`${d}`!==c)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${r}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:e,continue:!t.abort})}}});function Gw(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const VA=X("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=aA),vt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{Gw(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}});function QA(e){if(!Iw.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return Gw(s)}const YA=X("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Iw),vt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{QA(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!t.abort})}}),JA=X("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rA),vt.init(e,t)});function XA(e,t=null){try{const s=e.split(".");if(s.length!==3)return!1;const[a]=s;if(!a)return!1;const r=JSON.parse(atob(a));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}const WA=X("$ZodJWT",(e,t)=>{vt.init(e,t),e._zod.check=s=>{XA(s.value,t.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!t.abort})}}),Kw=X("$ZodNumber",(e,t)=>{bt.init(e,t),e._zod.pattern=e._zod.bag.pattern??qw,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=Number(s.value)}catch{}const r=s.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return s;const c=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...c?{received:c}:{}}),s}}),eT=X("$ZodNumberFormat",(e,t)=>{gA.init(e,t),Kw.init(e,t)}),tT=X("$ZodBoolean",(e,t)=>{bt.init(e,t),e._zod.pattern=fA,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=!!s.value}catch{}const r=s.value;return typeof r=="boolean"||s.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),s}}),nT=X("$ZodUnknown",(e,t)=>{bt.init(e,t),e._zod.parse=s=>s}),sT=X("$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 ex(e,t,s){e.issues.length&&t.issues.push(...Sr(s,e.issues)),t.value[s]=e.value}const iT=X("$ZodArray",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Array.isArray(r))return s.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),s;s.value=Array(r.length);const c=[];for(let d=0;d<r.length;d++){const f=r[d],p=t.element._zod.run({value:f,issues:[]},a);p instanceof Promise?c.push(p.then(m=>ex(m,s,d))):ex(p,s,d)}return c.length?Promise.all(c).then(()=>s):s}});function Su(e,t,s,a,r){if(e.issues.length){if(r&&!(s in a))return;t.issues.push(...Sr(s,e.issues))}e.value===void 0?s in a&&(t.value[s]=void 0):t.value[s]=e.value}function Vw(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=jO(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Qw(e,t,s,a,r,c){const d=[],f=r.keySet,p=r.catchall._zod,m=p.def.type,b=p.optout==="optional";for(const y in t){if(f.has(y))continue;if(m==="never"){d.push(y);continue}const v=p.run({value:t[y],issues:[]},a);v instanceof Promise?e.push(v.then(x=>Su(x,s,y,t,b))):Su(v,s,y,t,b)}return d.length&&s.issues.push({code:"unrecognized_keys",keys:d,input:t,inst:c}),e.length?Promise.all(e).then(()=>s):s}const aT=X("$ZodObject",(e,t)=>{if(bt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const p={...f};return Object.defineProperty(t,"shape",{value:p}),p}})}const a=fp(()=>Vw(t));et(e._zod,"propValues",()=>{const f=t.shape,p={};for(const m in f){const b=f[m]._zod;if(b.values){p[m]??(p[m]=new Set);for(const y of b.values)p[m].add(y)}}return p});const r=xu,c=t.catchall;let d;e._zod.parse=(f,p)=>{d??(d=a.value);const m=f.value;if(!r(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f;f.value={};const b=[],y=d.shape;for(const v of d.keys){const x=y[v],j=x._zod.optout==="optional",S=x._zod.run({value:m[v],issues:[]},p);S instanceof Promise?b.push(S.then(C=>Su(C,f,v,m,j))):Su(S,f,v,m,j)}return c?Qw(b,m,f,p,a.value,e):b.length?Promise.all(b).then(()=>f):f}}),rT=X("$ZodObjectJIT",(e,t)=>{aT.init(e,t);const s=e._zod.parse,a=fp(()=>Vw(t)),r=v=>{const x=new kA(["shape","payload","ctx"]),j=a.value,S=R=>{const z=Xb(R);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};x.write("const input = payload.value;");const C=Object.create(null);let _=0;for(const R of j.keys)C[R]=`key_${_++}`;x.write("const newResult = {};");for(const R of j.keys){const z=C[R],U=Xb(R),M=v[R]?._zod?.optout==="optional";x.write(`const ${z} = ${S(R)};`),M?x.write(`
|
|
59
|
+
if (${z}.issues.length) {
|
|
60
|
+
if (${U} in input) {
|
|
61
|
+
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
62
|
+
...iss,
|
|
63
|
+
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
64
|
+
})));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (${z}.value === undefined) {
|
|
69
|
+
if (${U} in input) {
|
|
70
|
+
newResult[${U}] = undefined;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
newResult[${U}] = ${z}.value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
`):x.write(`
|
|
77
|
+
if (${z}.issues.length) {
|
|
78
|
+
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
79
|
+
...iss,
|
|
80
|
+
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
81
|
+
})));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (${z}.value === undefined) {
|
|
85
|
+
if (${U} in input) {
|
|
86
|
+
newResult[${U}] = undefined;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
newResult[${U}] = ${z}.value;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
`)}x.write("payload.value = newResult;"),x.write("return payload;");const E=x.compile();return(R,z)=>E(v,R,z)};let c;const d=xu,f=!Aw.jitless,m=f&&SO.value,b=t.catchall;let y;e._zod.parse=(v,x)=>{y??(y=a.value);const j=v.value;return d(j)?f&&m&&x?.async===!1&&x.jitless!==!0?(c||(c=r(t.shape)),v=c(v,x),b?Qw([],j,v,x,y,e):v):s(v,x):(v.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),v)}});function tx(e,t,s,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const r=e.filter(c=>!xr(c));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:s,errors:e.map(c=>c.issues.map(d=>Ui(d,a,Mi())))}),t)}const oT=X("$ZodUnion",(e,t)=>{bt.init(e,t),et(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),et(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),et(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),et(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${r.map(c=>mp(c.source)).join("|")})$`)}});const s=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,c)=>{if(s)return a(r,c);let d=!1;const f=[];for(const p of t.options){const m=p._zod.run({value:r.value,issues:[]},c);if(m instanceof Promise)f.push(m),d=!0;else{if(m.issues.length===0)return m;f.push(m)}}return d?Promise.all(f).then(p=>tx(p,r,e,c)):tx(f,r,e,c)}}),lT=X("$ZodIntersection",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value,c=t.left._zod.run({value:r,issues:[]},a),d=t.right._zod.run({value:r,issues:[]},a);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([p,m])=>nx(s,p,m)):nx(s,c,d)}});function vm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Or(e)&&Or(t)){const s=Object.keys(t),a=Object.keys(e).filter(c=>s.indexOf(c)!==-1),r={...e,...t};for(const c of a){const d=vm(e[c],t[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};r[c]=d.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let a=0;a<e.length;a++){const r=e[a],c=t[a],d=vm(r,c);if(!d.valid)return{valid:!1,mergeErrorPath:[a,...d.mergeErrorPath]};s.push(d.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}function nx(e,t,s){const a=new Map;let r;for(const f of t.issues)if(f.code==="unrecognized_keys"){r??(r=f);for(const p of f.keys)a.has(p)||a.set(p,{}),a.get(p).l=!0}else e.issues.push(f);for(const f of s.issues)if(f.code==="unrecognized_keys")for(const p of f.keys)a.has(p)||a.set(p,{}),a.get(p).r=!0;else e.issues.push(f);const c=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&r&&e.issues.push({...r,keys:c}),xr(e))return e;const d=vm(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 cT=X("$ZodRecord",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Or(r))return s.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),s;const c=[],d=t.keyType._zod.values;if(d){s.value={};const f=new Set;for(const m of d)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){f.add(typeof m=="number"?m.toString():m);const b=t.valueType._zod.run({value:r[m],issues:[]},a);b instanceof Promise?c.push(b.then(y=>{y.issues.length&&s.issues.push(...Sr(m,y.issues)),s.value[m]=y.value})):(b.issues.length&&s.issues.push(...Sr(m,b.issues)),s.value[m]=b.value)}let p;for(const m in r)f.has(m)||(p=p??[],p.push(m));p&&p.length>0&&s.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:p})}else{s.value={};for(const f of Reflect.ownKeys(r)){if(f==="__proto__")continue;let p=t.keyType._zod.run({value:f,issues:[]},a);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&qw.test(f)&&p.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(p=y)}if(p.issues.length){t.mode==="loose"?s.value[f]=r[f]:s.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(y=>Ui(y,a,Mi())),input:f,path:[f],inst:e});continue}const b=t.valueType._zod.run({value:r[f],issues:[]},a);b instanceof Promise?c.push(b.then(y=>{y.issues.length&&s.issues.push(...Sr(f,y.issues)),s.value[p.value]=y.value})):(b.issues.length&&s.issues.push(...Sr(f,b.issues)),s.value[p.value]=b.value)}}return c.length?Promise.all(c).then(()=>s):s}}),uT=X("$ZodEnum",(e,t)=>{bt.init(e,t);const s=Tw(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>wO.has(typeof r)).map(r=>typeof r=="string"?Ar(r):r.toString()).join("|")})$`),e._zod.parse=(r,c)=>{const d=r.value;return a.has(d)||r.issues.push({code:"invalid_value",values:s,input:d,inst:e}),r}}),dT=X("$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"?Ar(a):a?Ar(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,r)=>{const c=a.value;return s.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),fT=X("$ZodTransform",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Ow(e.constructor.name);const r=t.transform(s.value,s);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(d=>(s.value=d,s));if(r instanceof Promise)throw new _r;return s.value=r,s}});function sx(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Yw=X("$ZodOptional",(e,t)=>{bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),et(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${mp(s.source)})?$`):void 0}),e._zod.parse=(s,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>sx(c,s.value)):sx(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),hT=X("$ZodExactOptional",(e,t)=>{Yw.init(e,t),et(e._zod,"values",()=>t.innerType._zod.values),et(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(s,a)=>t.innerType._zod.run(s,a)}),mT=X("$ZodNullable",(e,t)=>{bt.init(e,t),et(e._zod,"optin",()=>t.innerType._zod.optin),et(e._zod,"optout",()=>t.innerType._zod.optout),et(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${mp(s.source)}|null)$`):void 0}),et(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)}),pT=X("$ZodDefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);if(s.value===void 0)return s.value=t.defaultValue,s;const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>ix(c,t)):ix(r,t)}});function ix(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const gT=X("$ZodPrefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",et(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))}),yT=X("$ZodNonOptional",(e,t)=>{bt.init(e,t),et(e._zod,"values",()=>{const s=t.innerType._zod.values;return s?new Set([...s].filter(a=>a!==void 0)):void 0}),e._zod.parse=(s,a)=>{const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>ax(c,e)):ax(r,e)}});function ax(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 vT=X("$ZodCatch",(e,t)=>{bt.init(e,t),et(e._zod,"optin",()=>t.innerType._zod.optin),et(e._zod,"optout",()=>t.innerType._zod.optout),et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>(s.value=c.value,c.issues.length&&(s.value=t.catchValue({...s,error:{issues:c.issues.map(d=>Ui(d,a,Mi()))},input:s.value}),s.issues=[]),s)):(s.value=r.value,r.issues.length&&(s.value=t.catchValue({...s,error:{issues:r.issues.map(c=>Ui(c,a,Mi()))},input:s.value}),s.issues=[]),s)}}),bT=X("$ZodPipe",(e,t)=>{bt.init(e,t),et(e._zod,"values",()=>t.in._zod.values),et(e._zod,"optin",()=>t.in._zod.optin),et(e._zod,"optout",()=>t.out._zod.optout),et(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(s,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(s,a);return c instanceof Promise?c.then(d=>qc(d,t.in,a)):qc(c,t.in,a)}const r=t.in._zod.run(s,a);return r instanceof Promise?r.then(c=>qc(c,t.out,a)):qc(r,t.out,a)}});function qc(e,t,s){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},s)}const xT=X("$ZodReadonly",(e,t)=>{bt.init(e,t),et(e._zod,"propValues",()=>t.innerType._zod.propValues),et(e._zod,"values",()=>t.innerType._zod.values),et(e._zod,"optin",()=>t.innerType?._zod?.optin),et(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(rx):rx(r)}});function rx(e){return e.value=Object.freeze(e.value),e}const ST=X("$ZodCustom",(e,t)=>{Sn.init(e,t),bt.init(e,t),e._zod.parse=(s,a)=>s,e._zod.check=s=>{const a=s.value,r=t.fn(a);if(r instanceof Promise)return r.then(c=>ox(c,s,a,e));ox(r,s,a,e)}});function ox(e,t,s,a){if(!e){const r={code:"custom",input:s,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(tl(r))}}var lx;class wT{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...s){const a=s[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const s=this._map.get(t);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(t),this}get(t){const s=t._zod.parent;if(s){const a={...this.get(s)??{}};delete a.id;const r={...a,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function jT(){return new wT}(lx=globalThis).__zod_globalRegistry??(lx.__zod_globalRegistry=jT());const Io=globalThis.__zod_globalRegistry;function NT(e,t){return new e({type:"string",...je(t)})}function CT(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...je(t)})}function cx(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...je(t)})}function _T(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...je(t)})}function kT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...je(t)})}function zT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...je(t)})}function ET(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...je(t)})}function RT(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...je(t)})}function OT(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...je(t)})}function AT(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...je(t)})}function TT(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...je(t)})}function DT(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...je(t)})}function LT(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...je(t)})}function MT(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...je(t)})}function UT(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...je(t)})}function PT(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...je(t)})}function IT(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...je(t)})}function $T(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...je(t)})}function BT(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...je(t)})}function qT(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...je(t)})}function HT(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...je(t)})}function ZT(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...je(t)})}function FT(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...je(t)})}function GT(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...je(t)})}function KT(e,t){return new e({type:"string",format:"date",check:"string_format",...je(t)})}function VT(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...je(t)})}function QT(e,t){return new e({type:"string",format:"duration",check:"string_format",...je(t)})}function YT(e,t){return new e({type:"number",checks:[],...je(t)})}function JT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...je(t)})}function XT(e,t){return new e({type:"boolean",...je(t)})}function WT(e){return new e({type:"unknown"})}function eD(e,t){return new e({type:"never",...je(t)})}function ux(e,t){return new Zw({check:"less_than",...je(t),value:e,inclusive:!1})}function Zh(e,t){return new Zw({check:"less_than",...je(t),value:e,inclusive:!0})}function dx(e,t){return new Fw({check:"greater_than",...je(t),value:e,inclusive:!1})}function Fh(e,t){return new Fw({check:"greater_than",...je(t),value:e,inclusive:!0})}function fx(e,t){return new pA({check:"multiple_of",...je(t),value:e})}function Jw(e,t){return new yA({check:"max_length",...je(t),maximum:e})}function wu(e,t){return new vA({check:"min_length",...je(t),minimum:e})}function Xw(e,t){return new bA({check:"length_equals",...je(t),length:e})}function tD(e,t){return new xA({check:"string_format",format:"regex",...je(t),pattern:e})}function nD(e){return new SA({check:"string_format",format:"lowercase",...je(e)})}function sD(e){return new wA({check:"string_format",format:"uppercase",...je(e)})}function iD(e,t){return new jA({check:"string_format",format:"includes",...je(t),includes:e})}function aD(e,t){return new NA({check:"string_format",format:"starts_with",...je(t),prefix:e})}function rD(e,t){return new CA({check:"string_format",format:"ends_with",...je(t),suffix:e})}function Mr(e){return new _A({check:"overwrite",tx:e})}function oD(e){return Mr(t=>t.normalize(e))}function lD(){return Mr(e=>e.trim())}function cD(){return Mr(e=>e.toLowerCase())}function uD(){return Mr(e=>e.toUpperCase())}function dD(){return Mr(e=>xO(e))}function fD(e,t,s){return new e({type:"array",element:t,...je(s)})}function hD(e,t,s){return new e({type:"custom",check:"custom",fn:t,...je(s)})}function mD(e){const t=pD(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(tl(a,s.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=s.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),s.issues.push(tl(r))}},e(s.value,s)));return t}function pD(e,t){const s=new Sn({check:"custom",...je(t)});return s._zod.check=e,s}function Ww(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??Io,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function qt(e,t,s={path:[],schemaPath:[]}){var a;const r=e._zod.def,c=t.seen.get(e);if(c)return c.count++,s.schemaPath.includes(e)&&(c.cycle=s.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:s.path};t.seen.set(e,d);const f=e._zod.toJSONSchema?.();if(f)d.schema=f;else{const b={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,d.schema,b);else{const v=d.schema,x=t.processors[r.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);x(e,t,v,b)}const y=e._zod.parent;y&&(d.ref||(d.ref=y),qt(y,t,b),t.seen.get(y).isParent=!0)}const p=t.metadataRegistry.get(e);return p&&Object.assign(d.schema,p),t.io==="input"&&on(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 ej(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const d of e.seen.entries()){const f=e.metadataRegistry.get(d[0])?.id;if(f){const p=a.get(f);if(p&&p!==d[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,d[0])}}const r=d=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(d[0])?.id,v=e.external.uri??(j=>j);if(y)return{ref:v(y)};const x=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=x,{defId:x,ref:`${v("__shared")}#/${f}/${x}`}}if(d[1]===s)return{ref:"#"};const m=`#/${f}/`,b=d[1].schema.id??`__schema${e.counter++}`;return{defId:b,ref:m+b}},c=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:p,defId:m}=r(d);f.def={...f.schema},m&&(f.defId=m);const b=f.schema;for(const y in b)delete b[y];b.$ref=p};if(e.cycles==="throw")for(const d of e.seen.entries()){const f=d[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
93
|
+
|
|
94
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const f=d[1];if(t===d[0]){c(d);continue}if(e.external){const m=e.external.registry.get(d[0])?.id;if(t!==d[0]&&m){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(f.cycle){c(d);continue}if(f.count>1&&e.reused==="ref"){c(d);continue}}}function tj(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=d=>{const f=e.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,m={...p},b=f.ref;if(f.ref=null,b){a(b);const v=e.seen.get(b),x=v.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Object.assign(p,x),Object.assign(p,m),d._zod.parent===b)for(const S in p)S==="$ref"||S==="allOf"||S in m||delete p[S];if(x.$ref&&v.def)for(const S in p)S==="$ref"||S==="allOf"||S in v.def&&JSON.stringify(p[S])===JSON.stringify(v.def[S])&&delete p[S]}const y=d._zod.parent;if(y&&y!==b){a(y);const v=e.seen.get(y);if(v?.schema.$ref&&(p.$ref=v.schema.$ref,v.def))for(const x in p)x==="$ref"||x==="allOf"||x in v.def&&JSON.stringify(p[x])===JSON.stringify(v.def[x])&&delete p[x]}e.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...e.seen.entries()].reverse())a(d[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(d)}Object.assign(r,s.def??s.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const f=d[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?r.$defs=c:r.definitions=c);try{const d=JSON.parse(JSON.stringify(r));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input:ju(t,"input",e.processors),output:ju(t,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function on(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 on(a.element,s);if(a.type==="set")return on(a.valueType,s);if(a.type==="lazy")return on(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 on(a.innerType,s);if(a.type==="intersection")return on(a.left,s)||on(a.right,s);if(a.type==="record"||a.type==="map")return on(a.keyType,s)||on(a.valueType,s);if(a.type==="pipe")return on(a.in,s)||on(a.out,s);if(a.type==="object"){for(const r in a.shape)if(on(a.shape[r],s))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(on(r,s))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(on(r,s))return!0;return!!(a.rest&&on(a.rest,s))}return!1}const gD=(e,t={})=>s=>{const a=Ww({...s,processors:t});return qt(e,a),ej(a,e),tj(a,e)},ju=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},d=Ww({...r??{},target:c,io:t,processors:s});return qt(e,d),ej(d,e),tj(d,e)},yD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vD=(e,t,s,a)=>{const r=s;r.type="string";const{minimum:c,maximum:d,format:f,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof c=="number"&&(r.minLength=c),typeof d=="number"&&(r.maxLength=d),f&&(r.format=yD[f]??f,r.format===""&&delete r.format,f==="time"&&delete r.format),m&&(r.contentEncoding=m),p&&p.size>0){const b=[...p];b.length===1?r.pattern=b[0].source:b.length>1&&(r.allOf=[...b.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},bD=(e,t,s,a)=>{const r=s,{minimum:c,maximum:d,format:f,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:b}=e._zod.bag;typeof f=="string"&&f.includes("int")?r.type="integer":r.type="number",typeof b=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=b,r.exclusiveMinimum=!0):r.exclusiveMinimum=b),typeof c=="number"&&(r.minimum=c,typeof b=="number"&&t.target!=="draft-04"&&(b>=c?delete r.minimum:delete r.exclusiveMinimum)),typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=m,r.exclusiveMaximum=!0):r.exclusiveMaximum=m),typeof d=="number"&&(r.maximum=d,typeof m=="number"&&t.target!=="draft-04"&&(m<=d?delete r.maximum:delete r.exclusiveMaximum)),typeof p=="number"&&(r.multipleOf=p)},xD=(e,t,s,a)=>{s.type="boolean"},SD=(e,t,s,a)=>{s.not={}},wD=(e,t,s,a)=>{},jD=(e,t,s,a)=>{const r=e._zod.def,c=Tw(r.entries);c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),s.enum=c},ND=(e,t,s,a)=>{const r=e._zod.def,c=[];for(const d of r.values)if(d===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(d))}else c.push(d);if(c.length!==0)if(c.length===1){const d=c[0];s.type=d===null?"null":typeof d,t.target==="draft-04"||t.target==="openapi-3.0"?s.enum=[d]:s.const=d}else c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),c.every(d=>typeof d=="boolean")&&(s.type="boolean"),c.every(d=>d===null)&&(s.type="null"),s.enum=c},CD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_D=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kD=(e,t,s,a)=>{const r=s,c=e._zod.def,{minimum:d,maximum:f}=e._zod.bag;typeof d=="number"&&(r.minItems=d),typeof f=="number"&&(r.maxItems=f),r.type="array",r.items=qt(c.element,t,{...a,path:[...a.path,"items"]})},zD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object",r.properties={};const d=c.shape;for(const m in d)r.properties[m]=qt(d[m],t,{...a,path:[...a.path,"properties",m]});const f=new Set(Object.keys(d)),p=new Set([...f].filter(m=>{const b=c.shape[m]._zod;return t.io==="input"?b.optin===void 0:b.optout===void 0}));p.size>0&&(r.required=Array.from(p)),c.catchall?._zod.def.type==="never"?r.additionalProperties=!1:c.catchall?c.catchall&&(r.additionalProperties=qt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},ED=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,d=r.options.map((f,p)=>qt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",p]}));c?s.oneOf=d:s.anyOf=d},RD=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.left,t,{...a,path:[...a.path,"allOf",0]}),d=qt(r.right,t,{...a,path:[...a.path,"allOf",1]}),f=m=>"allOf"in m&&Object.keys(m).length===1,p=[...f(c)?c.allOf:[c],...f(d)?d.allOf:[d]];s.allOf=p},OD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const d=c.keyType,p=d._zod.bag?.patterns;if(c.mode==="loose"&&p&&p.size>0){const b=qt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const y of p)r.patternProperties[y.source]=b}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=qt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=qt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const m=d._zod.values;if(m){const b=[...m].filter(y=>typeof y=="string"||typeof y=="number");b.length>0&&(r.required=b)}},AD=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.innerType,t,a),d=t.seen.get(e);t.target==="openapi-3.0"?(d.ref=r.innerType,s.nullable=!0):s.anyOf=[c,{type:"null"}]},TD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},DD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.default=JSON.parse(JSON.stringify(r.defaultValue))},LD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,t.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},MD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType;let d;try{d=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=d},UD=(e,t,s,a)=>{const r=e._zod.def,c=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;qt(c,t,a);const d=t.seen.get(e);d.ref=c},PD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.readOnly=!0},nj=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},ID=X("ZodISODateTime",(e,t)=>{$A.init(e,t),St.init(e,t)});function $D(e){return GT(ID,e)}const BD=X("ZodISODate",(e,t)=>{BA.init(e,t),St.init(e,t)});function qD(e){return KT(BD,e)}const HD=X("ZodISOTime",(e,t)=>{qA.init(e,t),St.init(e,t)});function ZD(e){return VT(HD,e)}const FD=X("ZodISODuration",(e,t)=>{HA.init(e,t),St.init(e,t)});function GD(e){return QT(FD,e)}const KD=(e,t)=>{Uw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>TO(e,s)},flatten:{value:s=>AO(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,ym,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,ym,2)}},isEmpty:{get(){return e.issues.length===0}}})},Vn=X("ZodError",KD,{Parent:Error}),VD=gp(Vn),QD=yp(Vn),YD=qu(Vn),JD=Hu(Vn),XD=MO(Vn),WD=UO(Vn),eL=PO(Vn),tL=IO(Vn),nL=$O(Vn),sL=BO(Vn),iL=qO(Vn),aL=HO(Vn),xt=X("ZodType",(e,t)=>(bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ju(e,"input"),output:ju(e,"output")}}),e.toJSONSchema=gD(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...s)=>e.clone($i(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)=>Bi(e,s,a),e.brand=()=>e,e.register=((s,a)=>(s.add(e,a),e)),e.parse=(s,a)=>VD(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>YD(e,s,a),e.parseAsync=async(s,a)=>QD(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>JD(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>XD(e,s,a),e.decode=(s,a)=>WD(e,s,a),e.encodeAsync=async(s,a)=>eL(e,s,a),e.decodeAsync=async(s,a)=>tL(e,s,a),e.safeEncode=(s,a)=>nL(e,s,a),e.safeDecode=(s,a)=>sL(e,s,a),e.safeEncodeAsync=async(s,a)=>iL(e,s,a),e.safeDecodeAsync=async(s,a)=>aL(e,s,a),e.refine=(s,a)=>e.check(WL(s,a)),e.superRefine=s=>e.check(eM(s)),e.overwrite=s=>e.check(Mr(s)),e.optional=()=>px(e),e.exactOptional=()=>$L(e),e.nullable=()=>gx(e),e.nullish=()=>px(gx(e)),e.nonoptional=s=>GL(e,s),e.array=()=>lt(e),e.or=s=>AL([e,s]),e.and=s=>DL(e,s),e.transform=s=>yx(e,PL(s)),e.default=s=>HL(e,s),e.prefault=s=>FL(e,s),e.catch=s=>VL(e,s),e.pipe=s=>yx(e,s),e.readonly=()=>JL(e),e.describe=s=>{const a=e.clone();return Io.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return Io.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Io.get(e);const a=e.clone();return Io.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),sj=X("_ZodString",(e,t)=>{vp.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>vD(e,a,r);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...a)=>e.check(tD(...a)),e.includes=(...a)=>e.check(iD(...a)),e.startsWith=(...a)=>e.check(aD(...a)),e.endsWith=(...a)=>e.check(rD(...a)),e.min=(...a)=>e.check(wu(...a)),e.max=(...a)=>e.check(Jw(...a)),e.length=(...a)=>e.check(Xw(...a)),e.nonempty=(...a)=>e.check(wu(1,...a)),e.lowercase=a=>e.check(nD(a)),e.uppercase=a=>e.check(sD(a)),e.trim=()=>e.check(lD()),e.normalize=(...a)=>e.check(oD(...a)),e.toLowerCase=()=>e.check(cD()),e.toUpperCase=()=>e.check(uD()),e.slugify=()=>e.check(dD())}),rL=X("ZodString",(e,t)=>{vp.init(e,t),sj.init(e,t),e.email=s=>e.check(CT(oL,s)),e.url=s=>e.check(RT(lL,s)),e.jwt=s=>e.check(FT(jL,s)),e.emoji=s=>e.check(OT(cL,s)),e.guid=s=>e.check(cx(hx,s)),e.uuid=s=>e.check(_T(Hc,s)),e.uuidv4=s=>e.check(kT(Hc,s)),e.uuidv6=s=>e.check(zT(Hc,s)),e.uuidv7=s=>e.check(ET(Hc,s)),e.nanoid=s=>e.check(AT(uL,s)),e.guid=s=>e.check(cx(hx,s)),e.cuid=s=>e.check(TT(dL,s)),e.cuid2=s=>e.check(DT(fL,s)),e.ulid=s=>e.check(LT(hL,s)),e.base64=s=>e.check(qT(xL,s)),e.base64url=s=>e.check(HT(SL,s)),e.xid=s=>e.check(MT(mL,s)),e.ksuid=s=>e.check(UT(pL,s)),e.ipv4=s=>e.check(PT(gL,s)),e.ipv6=s=>e.check(IT(yL,s)),e.cidrv4=s=>e.check($T(vL,s)),e.cidrv6=s=>e.check(BT(bL,s)),e.e164=s=>e.check(ZT(wL,s)),e.datetime=s=>e.check($D(s)),e.date=s=>e.check(qD(s)),e.time=s=>e.check(ZD(s)),e.duration=s=>e.check(GD(s))});function V(e){return NT(rL,e)}const St=X("ZodStringFormat",(e,t)=>{vt.init(e,t),sj.init(e,t)}),oL=X("ZodEmail",(e,t)=>{OA.init(e,t),St.init(e,t)}),hx=X("ZodGUID",(e,t)=>{EA.init(e,t),St.init(e,t)}),Hc=X("ZodUUID",(e,t)=>{RA.init(e,t),St.init(e,t)}),lL=X("ZodURL",(e,t)=>{AA.init(e,t),St.init(e,t)}),cL=X("ZodEmoji",(e,t)=>{TA.init(e,t),St.init(e,t)}),uL=X("ZodNanoID",(e,t)=>{DA.init(e,t),St.init(e,t)}),dL=X("ZodCUID",(e,t)=>{LA.init(e,t),St.init(e,t)}),fL=X("ZodCUID2",(e,t)=>{MA.init(e,t),St.init(e,t)}),hL=X("ZodULID",(e,t)=>{UA.init(e,t),St.init(e,t)}),mL=X("ZodXID",(e,t)=>{PA.init(e,t),St.init(e,t)}),pL=X("ZodKSUID",(e,t)=>{IA.init(e,t),St.init(e,t)}),gL=X("ZodIPv4",(e,t)=>{ZA.init(e,t),St.init(e,t)}),yL=X("ZodIPv6",(e,t)=>{FA.init(e,t),St.init(e,t)}),vL=X("ZodCIDRv4",(e,t)=>{GA.init(e,t),St.init(e,t)}),bL=X("ZodCIDRv6",(e,t)=>{KA.init(e,t),St.init(e,t)}),xL=X("ZodBase64",(e,t)=>{VA.init(e,t),St.init(e,t)}),SL=X("ZodBase64URL",(e,t)=>{YA.init(e,t),St.init(e,t)}),wL=X("ZodE164",(e,t)=>{JA.init(e,t),St.init(e,t)}),jL=X("ZodJWT",(e,t)=>{WA.init(e,t),St.init(e,t)}),ij=X("ZodNumber",(e,t)=>{Kw.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>bD(e,a,r),e.gt=(a,r)=>e.check(dx(a,r)),e.gte=(a,r)=>e.check(Fh(a,r)),e.min=(a,r)=>e.check(Fh(a,r)),e.lt=(a,r)=>e.check(ux(a,r)),e.lte=(a,r)=>e.check(Zh(a,r)),e.max=(a,r)=>e.check(Zh(a,r)),e.int=a=>e.check(mx(a)),e.safe=a=>e.check(mx(a)),e.positive=a=>e.check(dx(0,a)),e.nonnegative=a=>e.check(Fh(0,a)),e.negative=a=>e.check(ux(0,a)),e.nonpositive=a=>e.check(Zh(0,a)),e.multipleOf=(a,r)=>e.check(fx(a,r)),e.step=(a,r)=>e.check(fx(a,r)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function ct(e){return YT(ij,e)}const NL=X("ZodNumberFormat",(e,t)=>{eT.init(e,t),ij.init(e,t)});function mx(e){return JT(NL,e)}const CL=X("ZodBoolean",(e,t)=>{tT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>xD(e,s,a)});function Fu(e){return XT(CL,e)}const _L=X("ZodUnknown",(e,t)=>{nT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>wD()});function bm(){return WT(_L)}const kL=X("ZodNever",(e,t)=>{sT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>SD(e,s,a)});function zL(e){return eD(kL,e)}const EL=X("ZodArray",(e,t)=>{iT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>kD(e,s,a,r),e.element=t.element,e.min=(s,a)=>e.check(wu(s,a)),e.nonempty=s=>e.check(wu(1,s)),e.max=(s,a)=>e.check(Jw(s,a)),e.length=(s,a)=>e.check(Xw(s,a)),e.unwrap=()=>e.element});function lt(e,t){return fD(EL,e,t)}const RL=X("ZodObject",(e,t)=>{rT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>zD(e,s,a,r),et(e,"shape",()=>t.shape),e.keyof=()=>fn(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:bm()}),e.loose=()=>e.clone({...e._zod.def,catchall:bm()}),e.strict=()=>e.clone({...e._zod.def,catchall:zL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>kO(e,s),e.safeExtend=s=>zO(e,s),e.merge=s=>EO(e,s),e.pick=s=>CO(e,s),e.omit=s=>_O(e,s),e.partial=(...s)=>RO(aj,e,s[0]),e.required=(...s)=>OO(rj,e,s[0])});function Ge(e,t){const s={type:"object",shape:e??{},...je(t)};return new RL(s)}const OL=X("ZodUnion",(e,t)=>{oT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ED(e,s,a,r),e.options=t.options});function AL(e,t){return new OL({type:"union",options:e,...je(t)})}const TL=X("ZodIntersection",(e,t)=>{lT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>RD(e,s,a,r)});function DL(e,t){return new TL({type:"intersection",left:e,right:t})}const LL=X("ZodRecord",(e,t)=>{cT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>OD(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function bp(e,t,s){return new LL({type:"record",keyType:e,valueType:t,...je(s)})}const xm=X("ZodEnum",(e,t)=>{uT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>jD(e,a,r),e.enum=t.entries,e.options=Object.values(t.entries);const s=new Set(Object.keys(t.entries));e.extract=(a,r)=>{const c={};for(const d of a)if(s.has(d))c[d]=t.entries[d];else throw new Error(`Key ${d} not found in enum`);return new xm({...t,checks:[],...je(r),entries:c})},e.exclude=(a,r)=>{const c={...t.entries};for(const d of a)if(s.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new xm({...t,checks:[],...je(r),entries:c})}});function fn(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new xm({type:"enum",entries:s,...je(t)})}const ML=X("ZodLiteral",(e,t)=>{dT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ND(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 Nu(e,t){return new ML({type:"literal",values:Array.isArray(e)?e:[e],...je(t)})}const UL=X("ZodTransform",(e,t)=>{fT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>_D(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new Ow(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(tl(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(tl(d))}};const r=t.transform(s.value,s);return r instanceof Promise?r.then(c=>(s.value=c,s)):(s.value=r,s)}});function PL(e){return new UL({type:"transform",transform:e})}const aj=X("ZodOptional",(e,t)=>{Yw.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>nj(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function px(e){return new aj({type:"optional",innerType:e})}const IL=X("ZodExactOptional",(e,t)=>{hT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>nj(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function $L(e){return new IL({type:"optional",innerType:e})}const BL=X("ZodNullable",(e,t)=>{mT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>AD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function gx(e){return new BL({type:"nullable",innerType:e})}const qL=X("ZodDefault",(e,t)=>{pT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>DD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function HL(e,t){return new qL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Lw(t)}})}const ZL=X("ZodPrefault",(e,t)=>{gT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>LD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function FL(e,t){return new ZL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Lw(t)}})}const rj=X("ZodNonOptional",(e,t)=>{yT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>TD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function GL(e,t){return new rj({type:"nonoptional",innerType:e,...je(t)})}const KL=X("ZodCatch",(e,t)=>{vT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>MD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function VL(e,t){return new KL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const QL=X("ZodPipe",(e,t)=>{bT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>UD(e,s,a,r),e.in=t.in,e.out=t.out});function yx(e,t){return new QL({type:"pipe",in:e,out:t})}const YL=X("ZodReadonly",(e,t)=>{xT.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>PD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function JL(e){return new YL({type:"readonly",innerType:e})}const XL=X("ZodCustom",(e,t)=>{ST.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>CD(e,s)});function WL(e,t={}){return hD(XL,e,t)}function eM(e){return mD(e)}Ge({maxConcurrency:ct().int().positive(),maxRequestsPerMinute:ct().int().positive(),maxRequestsPerDay:ct().int().positive()});const tM=["gemini","openai","claude","local","cdp:chatgpt"],Gu=fn(tM),oj=Ge({label:V().min(1),city:V().min(1),region:V().min(1),country:V().length(2),timezone:V().optional()}),lj=fn(["citation.lost","citation.gained","run.completed","run.failed"]);Ge({id:V(),projectId:V(),channel:Nu("webhook"),url:V().url(),events:lt(lj),enabled:Fu().default(!0),webhookSecret:V().optional(),createdAt:V(),updatedAt:V()});const nM=Ge({name:V().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:bp(V(),V()).optional().default({})}),sM=Ge({preset:V().optional(),cron:V().optional(),timezone:V().optional().default("UTC"),providers:lt(Gu).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),iM=Ge({channel:Nu("webhook"),url:V().url(),events:lt(lj).min(1)}),aM=Ge({gsc:Ge({propertyUrl:V()}).optional(),syncSchedule:Ge({preset:V().optional(),cron:V().optional()}).optional()}).optional(),rM=Ge({displayName:V().min(1),canonicalDomain:V().min(1),ownedDomains:lt(V().min(1)).optional().default([]),country:V().length(2),language:V().min(2),keywords:lt(V().min(1)).optional().default([]),competitors:lt(V().min(1)).optional().default([]),providers:lt(Gu).optional().default([]),locations:lt(oj).optional().default([]),defaultLocation:V().optional(),schedule:sM,notifications:lt(iM).optional().default([]),google:aM});Ge({apiVersion:Nu("canonry/v1"),kind:Nu("Project"),metadata:nM,spec:rM});const oM=fn(["gsc","ga4"]);Ge({id:V(),domain:V(),connectionType:oM,propertyId:V().nullable().optional(),sitemapUrl:V().nullable().optional(),scopes:lt(V()).default([]),createdAt:V(),updatedAt:V()});Ge({date:V(),query:V(),page:V(),country:V().nullable().optional(),device:V().nullable().optional(),clicks:ct(),impressions:ct(),ctr:ct(),position:ct()});const Sm=Ge({id:V(),url:V(),indexingState:V().nullable().optional(),verdict:V().nullable().optional(),coverageState:V().nullable().optional(),pageFetchState:V().nullable().optional(),robotsTxtState:V().nullable().optional(),crawlTime:V().nullable().optional(),lastCrawlResult:V().nullable().optional(),isMobileFriendly:Fu().nullable().optional(),richResults:lt(V()).default([]),inspectedAt:V()});fn(["stable","reindexed","deindexed","still-missing","new"]);const lM=Ge({url:V(),previousState:V().nullable(),currentState:V().nullable(),transitionDate:V()}),cM=Ge({reason:V(),count:ct(),urls:lt(Sm).default([])});Ge({summary:Ge({total:ct(),indexed:ct(),notIndexed:ct(),deindexed:ct(),percentage:ct()}),lastInspectedAt:V().nullable(),indexed:lt(Sm).default([]),notIndexed:lt(Sm).default([]),deindexed:lt(lM).default([]),reasonGroups:lt(cM).default([])});Ge({url:V(),type:fn(["URL_UPDATED","URL_DELETED"]),notifiedAt:V()});Ge({url:V(),type:fn(["URL_UPDATED","URL_DELETED"]),notifiedAt:V(),status:fn(["success","error"]),error:V().optional()});Ge({date:V(),indexed:ct(),notIndexed:ct(),reasonBreakdown:bp(V(),ct()).default({})});Ge({id:V(),domain:V(),siteUrl:V().nullable().optional(),createdAt:V(),updatedAt:V()});const vx=Ge({id:V(),url:V(),httpCode:ct().nullable().optional(),inIndex:Fu().nullable().optional(),lastCrawledDate:V().nullable().optional(),inIndexDate:V().nullable().optional(),inspectedAt:V()});Ge({summary:Ge({total:ct(),indexed:ct(),notIndexed:ct(),percentage:ct()}),lastInspectedAt:V().nullable(),indexed:lt(vx).default([]),notIndexed:lt(vx).default([])});Ge({query:V(),impressions:ct(),clicks:ct(),ctr:ct(),averagePosition:ct()});Ge({url:V(),status:fn(["success","error"]),submittedAt:V(),error:V().optional()});const uM=fn(["cli","api","config-file"]);Ge({id:V(),name:V(),displayName:V().optional(),canonicalDomain:V(),ownedDomains:lt(V()).default([]),country:V().length(2),language:V().min(2),tags:lt(V()).default([]),labels:bp(V(),V()).default({}),locations:lt(oj).default([]),defaultLocation:V().nullable().optional(),configSource:uM.default("cli"),configRevision:ct().int().positive().default(1),createdAt:V().optional(),updatedAt:V().optional()});function wm(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function dM(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,a=[];for(const r of t){const c=r.trim();if(!c)continue;const d=wm(c);s.has(d)||(s.add(d),a.push(c))}return a}const fM=fn(["queued","running","completed","partial","failed"]),hM=fn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),mM=fn(["manual","scheduled","config-apply"]),pM=fn(["cited","not-cited"]),gM=fn(["new","cited","lost","emerging","not-cited"]);Ge({id:V(),projectId:V(),kind:hM,status:fM,trigger:mM.default("manual"),location:V().nullable().optional(),startedAt:V().nullable().optional(),finishedAt:V().nullable().optional(),error:V().nullable().optional(),createdAt:V()});const yM=Ge({uri:V(),title:V()});Ge({id:V(),runId:V(),keywordId:V(),keyword:V().optional(),provider:Gu,citationState:pM,transition:gM.optional(),answerText:V().nullable().optional(),citedDomains:lt(V()).default([]),competitorOverlap:lt(V()).default([]),groundingSources:lt(yM).default([]),searchQueries:lt(V()).default([]),model:V().nullable().optional(),location:V().nullable().optional(),createdAt:V()});Ge({id:V(),projectId:V().nullable().optional(),actor:V(),action:V(),entityType:V(),entityId:V().nullable().optional(),diff:bm().optional(),createdAt:V()});Ge({id:V(),projectId:V(),cronExpr:V(),preset:V().nullable().optional(),timezone:V().default("UTC"),enabled:Fu().default(!0),providers:lt(Gu).default([]),lastRunAt:V().nullable().optional(),nextRunAt:V().nullable().optional(),createdAt:V(),updatedAt:V()});function jm({state:e}){return l.jsx(ot,{tone:AE(e),children:Uu(e)})}function bx(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"?ns.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},d.value):d.value).filter(Boolean);const r=s.map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${r.join("|")})`,"gi");return a.flatMap((d,f)=>d.value.split(c).map((m,b)=>m?b%2===1?d.type==="bold"?ns.createElement("mark",{key:`hl-${f}-${b}`,className:"answer-highlight"},ns.createElement("strong",{className:"text-zinc-200 font-semibold"},m)):ns.createElement("mark",{key:`hl-${f}-${b}`,className:"answer-highlight"},m):d.type==="bold"?ns.createElement("strong",{key:`b-${f}-${b}`,className:"text-zinc-200 font-semibold"},m):m:null)).filter(Boolean)}class cj extends Error{code;statusCode;constructor(t,s,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=s}}function vM(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const bM=vM();function xM(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.apiKey?window.__CANONRY_CONFIG__.apiKey:""}async function xe(e,t){const s=xM(),a=await fetch(`${bM}${e}`,{...t,headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{},...t?.headers}});if(!a.ok){const r=await a.text();let c=`API ${a.status}: ${a.statusText}`,d;if(r)try{const f=JSON.parse(r);typeof f.error=="string"?c=f.error:f.error?.message?(c=f.error.message,d=f.error.code):f.message&&(c=f.message)}catch{c=r}throw new cj(c,a.status,d)}if(a.status!==204)return a.json()}function uj(){return xe("/projects")}function xp(e){return xe(`/projects/${encodeURIComponent(e)}`)}function dj(){return xe("/runs")}function nl(e){return xe(`/runs/${encodeURIComponent(e)}`)}function fj(e){return xe(`/projects/${encodeURIComponent(e)}/keywords`)}function Sp(e){return xe(`/projects/${encodeURIComponent(e)}/competitors`)}function wp(e,t){const s=new URLSearchParams;t!==void 0&&s.set("location",t);const a=s.toString();return xe(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function rl(e,t){return xe(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function hj(e,t){return xe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function mj(e,t){return xe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function jp(e,t){return xe(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function Nm(e,t){const s=await xp(e);return rl(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 pj(e,t){const s=await xp(e);return rl(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 Np(e,t){const s={};return xe(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function gj(e,t){return xe(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function yj(e,t){await xe(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function vj(e,t){return xe(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function bj(e){await xe(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function xj(e){return xe(`/projects/${encodeURIComponent(e)}/export`)}function Cp(){return xe("/settings")}function Sj(e,t){return xe(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function wj(e){return xe("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function jj(e){try{return await xe(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function Cm(e,t){return xe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function Nj(e){await xe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function Cj(e){return xe(`/projects/${encodeURIComponent(e)}/notifications`)}function _j(e,t){return xe(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function kj(e,t){await xe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function zj(e,t){return xe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function Ej(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function Rj(e){return xe("/apply",{method:"POST",body:JSON.stringify(e)})}function SM(e){return xe("/runs",{method:"POST",body:JSON.stringify(e??{})})}function Oj(e){return xe(`/projects/${encodeURIComponent(e)}/google/connections`)}function Aj(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function Tj(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Dj(e){return xe(`/projects/${encodeURIComponent(e)}/google/properties`)}function Lj(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function Mj(e,t,s){return xe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function Uj(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function Pj(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 xe(`/projects/${encodeURIComponent(e)}/google/gsc/performance${a}`)}function Ij(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function $j(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 xe(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${a}`)}function Bj(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function qj(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function Hj(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return xe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function Zj(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function Fj(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function Gj(e){return xe(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function _m(){return xe("/cdp/status")}function Kj(e,t){return xe("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function km(e,t){return xe(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function Vj(e){return xe(`/projects/${encodeURIComponent(e)}/bing/status`)}function Qj(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function Yj(e){return xe(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function Jj(e){return xe(`/projects/${encodeURIComponent(e)}/bing/sites`)}function Xj(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Wj(e){return xe(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function e1(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return xe(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function t1(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function zm(e,t){return xe(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function n1(e){return xe(`/projects/${encodeURIComponent(e)}/bing/performance`)}function s1(e){return xe("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function i1(e,t){const s=t?`?window=${t}`:"";return xe(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function a1(e,t){const s=t?`?window=${t}`:"";return xe(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function r1(e,t){const s=t?`?window=${t}`:"";return xe(`/projects/${encodeURIComponent(e)}/analytics/sources${s}`)}async function o1(e,t){try{const s=await fetch(e);if(!s.ok)return{label:t,state:"error",detail:`HTTP ${s.status}`};const a=await s.json(),r=typeof a.version=="string"?a.version:"unknown",c=typeof a.databaseUrlConfigured=="boolean"?a.databaseUrlConfigured:void 0,d=typeof a.lastHeartbeatAt=="string"?a.lastHeartbeatAt:void 0,f=[r,c===!1?"database not configured":"database configured",d?`heartbeat ${d}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:r,databaseConfigured:c,lastHeartbeatAt:d}}catch(s){return{label:t,state:"error",detail:s instanceof Error?s.message:"unreachable"}}}const wM=Object.freeze(Object.defineProperty({__proto__:null,ApiError:cj,addLocation:gj,addNotification:_j,appendKeywords:mj,applyProjectConfig:Rj,bingConnect:Qj,bingDisconnect:Yj,bingRequestIndexing:zm,bingSetSite:Xj,configureCdp:Kj,createProject:rl,deleteProject:bj,fetchAllRuns:dj,fetchAnalyticsGaps:a1,fetchAnalyticsMetrics:i1,fetchAnalyticsSources:r1,fetchBingCoverage:Wj,fetchBingInspections:e1,fetchBingPerformance:n1,fetchBingSites:Jj,fetchBingStatus:Vj,fetchCdpStatus:_m,fetchCompetitors:Sp,fetchExport:xj,fetchGoogleConnections:Oj,fetchGoogleProperties:Dj,fetchGscCoverage:qj,fetchGscCoverageHistory:Hj,fetchGscDeindexed:Bj,fetchGscInspections:$j,fetchGscPerformance:Pj,fetchGscSitemaps:Fj,fetchKeywords:fj,fetchProject:xp,fetchProjects:uj,fetchRunDetail:nl,fetchSchedule:jj,fetchServiceStatus:o1,fetchSettings:Cp,fetchTimeline:wp,generateKeywords:Ej,googleConnect:Aj,googleDisconnect:Tj,inspectBingUrl:t1,inspectGscUrl:Ij,listNotifications:Cj,removeLocation:yj,removeNotification:kj,removeSchedule:Nj,requestIndexing:km,saveGoogleProperty:Lj,saveSchedule:Cm,saveSitemapUrl:Mj,sendTestNotification:zj,setCompetitors:jp,setDefaultLocation:vj,setKeywords:hj,triggerAllRuns:SM,triggerDiscoverSitemaps:Gj,triggerGscSync:Uj,triggerInspectSitemap:Zj,triggerRun:Np,updateBingApiKey:s1,updateGoogleAuthConfig:wj,updateOwnedDomains:Nm,updateProject:pj,updateProviderConfig:Sj},Symbol.toStringTag,{value:"Module"}));function jM({evidence:e,project:t,onClose:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(-1),[f,p]=N.useState(null),[m,b]=N.useState(!1),[y,v]=N.useState({}),x=dM(t.project),j=new Set(x.map(wm)),S=e.runHistory,C=S.length>1,_=c>=0&&f!==null,E=_?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",U=E.citedDomains.findIndex(T=>j.has(T.toLowerCase().replace(/^www\./,"")))+1,O=E.citedDomains.length,M=t.project.displayName||t.project.name,A=[...x.map(wm),M,M.split(" ").slice(0,2).join(" ")].filter(T=>T.trim().length>2),B=R?"cited":E.citationState==="lost"?"lost":E.citationState==="pending"?"pending":"not-cited",ie=N.useRef(0),Q=N.useCallback(async T=>{const ae=++ie.current;if(T===-1||T===S.length-1){d(-1),p(null),r(!1);return}d(T),r(!1);const pe=S[T],ee=`${pe.runId}::${e.keyword}::${e.provider}`;if(y[ee]){p(y[ee]);return}b(!0);try{const L=await nl(pe.runId);if(ae!==ie.current)return;const G=L.snapshots.find(re=>re.keyword===e.keyword&&re.provider===e.provider)??L.snapshots.find(re=>re.keyword===e.keyword),se=G?{citationState:G.citationState,provider:G.provider,model:G.model??null,answerSnippet:G.answerText??"",citedDomains:G.citedDomains,competitorDomains:G.competitorOverlap,groundingSources:G.groundingSources,evidenceUrls:[],changeLabel:pe.citationState,summary:""}:{citationState:pe.citationState,provider:e.provider,model:pe.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:pe.citationState,summary:"Snapshot data not available for this run."};v(re=>({...re,[ee]:se})),p(se)}catch{if(ae!==ie.current)return;p({citationState:pe.citationState,provider:e.provider,model:pe.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:pe.citationState,summary:"Failed to load historical run data."})}finally{ae===ie.current&&b(!1)}},[S,e.keyword,e.provider,y]),me=(_||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,ze=!_&&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(" · "):"",we=R&&U>0?{label:"Citation confirmed",title:`Cited #${U} of ${O} domain${O!==1?"s":""}`,meta:me}:R?{label:"Citation confirmed",title:"Cited in this answer",meta:me}:E.citationState==="lost"?{label:"Citation lost",title:O>0?`${O} domain${O!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:me}:E.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:O>0?`${O} domain${O!==1?"s":""} cited instead`:"No domains cited for this query",meta:me},q=()=>{if(!E.answerSnippet)return null;const T=E.answerSnippet.split(`
|
|
95
|
+
`),ae=[];let pe=[],ee=0;const L=()=>{if(pe.length===0)return;const G=pe.join(" ").trim();G&&ae.push(l.jsx("p",{className:ae.length>0?"mt-2.5":"",children:bx(G,A)},ee++)),pe=[]};for(const G of T){const se=G.trim();if(/^[-\u2013\u2014]{3,}$/.test(se)){L(),ae.push(l.jsx("hr",{className:"border-zinc-800/60 my-3"},ee++));continue}const re=se.match(/^(#{1,3})\s+(.+)$/);if(re){L();const ce=re[1].length,he=re[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||re[2],de=ce===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":ce===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";ae.push(l.jsx("p",{className:de,children:bx(he,A)},ee++));continue}if(se===""){L();continue}pe.push(se)}return L(),ae};return l.jsx(jw,{open:!0,onOpenChange:T=>{T||s()},children:l.jsxs(Nw,{children:[l.jsx(cp,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),l.jsxs(up,{className:"evidence-modal","aria-describedby":void 0,children:[l.jsxs("div",{className:"evidence-modal-header",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," \\u00b7 ",E.provider||"All providers"]}),l.jsx(dp,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),l.jsxs(_w,{className:"inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-800 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 shrink-0",children:[l.jsx(Mu,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]}),C&&l.jsxs("div",{className:"evidence-modal-timeline",children:[l.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),l.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:S.map((T,ae)=>{const pe=c===-1&&ae===S.length-1||c===ae,ee=T.citationState==="cited"?"bg-emerald-400":T.citationState==="emerging"?"bg-amber-400":T.citationState==="lost"?"bg-rose-400":"bg-zinc-600",G=new Date(T.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),se=!!(T.model&&ae>0&&S[ae-1]?.model&&S[ae-1].model!==T.model);return l.jsxs("button",{type:"button",className:`evidence-run-dot ${pe?"evidence-run-dot--selected":""}`,onClick:()=>Q(ae===S.length-1?-1:ae),"aria-label":[`Run ${G}: ${T.citationState}`,T.model?`model ${T.model}`:null,se?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":pe,children:[l.jsx("span",{className:`size-2 rounded-full ${ee} ${se?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),l.jsx("span",{className:"text-[10px] text-zinc-500",children:G})]},ae)})}),c>=0&&c<S.length&&l.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(S[c].createdAt).toLocaleString()," \\u2014 ",l.jsx("span",{className:"capitalize",children:S[c].citationState}),l.jsx("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>Q(-1),children:"\\u2190 Back to latest"})]}),!_&&(e.modelTransitions?.length??0)>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(T=>l.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${T.fromModel??"unknown"} -> ${T.toModel??"unknown"} on ${new Date(T.createdAt).toLocaleDateString()}`},`${T.runId}:${T.toModel??"unknown"}`))})]}),l.jsxs("div",{className:"evidence-modal-body",children:[m&&l.jsx("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:"Loading historical run data\\u2026"}),!m&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"evidence-modal-main",children:[l.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${B}`,children:[l.jsx("p",{className:`evidence-position-label evidence-position-label--${B}`,children:we.label}),l.jsx("p",{className:`evidence-position-title evidence-position-title--${B}`,children:we.title}),l.jsx("p",{className:"evidence-position-meta",children:we.meta}),ze&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:ze})]}),E.answerSnippet&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),l.jsx("div",{className:`answer-snippet-block ${a?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:q()}),E.answerSnippet.length>280&&l.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>r(!a),children:a?"↑ Collapse":"↓ Show full answer"})]}),!E.answerSnippet&&!m&&l.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!_&&e.relatedTechnicalSignals.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:R?"Why you're cited":"What to fix"}),l.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((T,ae)=>l.jsxs("div",{className:"action-item",children:[l.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?l.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),l.jsx("span",{className:"action-item-text",children:T})]},ae))})]}),E.summary&&l.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),l.jsxs("div",{className:"evidence-modal-sidebar",children:[E.citedDomains.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"Who was cited \\u2014 in order"}),l.jsxs("div",{className:"citation-leaderboard",children:[E.citedDomains.map((T,ae)=>{const pe=T.toLowerCase().replace(/^www\./,""),ee=j.has(pe),L=!ee&&E.competitorDomains.some(se=>se.toLowerCase().replace(/^www\./,"")===pe),G=ee?"you":L?"competitor":"other";return l.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${G}`,children:[l.jsxs("span",{className:"citation-leaderboard-rank",children:["#",ae+1]}),l.jsx("span",{className:"citation-leaderboard-domain",children:T}),ee&&l.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),L&&l.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},T)}),!R&&l.jsxs("div",{className:"citation-leaderboard-item citation-leaderboard-item--not-cited border-dashed",children:[l.jsx("span",{className:"citation-leaderboard-rank text-zinc-600",children:"\\u2014"}),l.jsx("span",{className:"citation-leaderboard-domain text-zinc-600",children:t.project.canonicalDomain}),l.jsx("span",{className:"citation-leaderboard-tag text-zinc-600",children:"Not cited"})]})]})]}),E.groundingSources.length>0&&l.jsxs("div",{children:[l.jsxs("p",{className:"drawer-section-label",children:["Grounding sources (",E.groundingSources.length,")"]}),l.jsx("ul",{className:"grid gap-0.5",children:E.groundingSources.map((T,ae)=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:T.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:T.title||T.uri})},ae))})]}),E.evidenceUrls.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),l.jsx("ul",{className:"grid gap-1",children:E.evidenceUrls.map(T=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:T,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:T})},T))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.evidenceUrls.length===0&&l.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No citation data ",_?"for this run":"yet"]})]})]})]})]})]})})}function ts(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 kr=[{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 Ku(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 Cu=Ku({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"}),_p=Ku({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"}),kp=Ku({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"}),_u=Ku({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"}),NM=[_p,Cu,kp,_u],CM=[{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:ts(["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:ts(["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:ts(["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:ts(["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:ts(["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:ts(["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:ts(["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:ts(["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:ts(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}],_M=[{project:kr[0],dateRangeLabel:"Last 7 days",contextLabel:"US / English / Local-intent monitoring",visibilitySummary:{label:"Answer Visibility",value:"61 / 100",delta:"-8 this week",tone:"caution",description:"Lost citation share on emergency-intent prompts while Invisalign visibility improved.",trend:[73,71,69,66,61]},providerScores:[{provider:"gemini",model:"gemini-3-flash",score:55,cited:5,total:9},{provider:"openai",model:"gpt-5.4",score:67,cited:6,total:9},{provider:"claude",model:"claude-sonnet-4-6",score:44,cited:4,total:9}],competitorPressure:{label:"Competitor Pressure",value:"High",delta:"2 rivals moved up",tone:"negative",description:"Downtown Smiles and Harbor Dental now own the highest-intent local prompts.",trend:[54,58,61,65,69]},runStatus:{label:"Run Status",value:"Partial",delta:"1 queued follow-up",tone:"caution",description:"Latest visibility sweep completed; next sweep is queued.",trend:[76,74,72,68,67]},insights:[{id:"insight_citypoint_lost_citations",tone:"negative",title:"Lost citation on 1 key phrase",detail:"Emergency-intent prompts stopped grounding Citypoint after competitors refreshed.",actionLabel:"Lost",affectedPhrases:[{keyword:"emergency dentist brooklyn",evidenceId:"evidence_citypoint_emergency_gemini",provider:"gemini",citationState:"lost"}]},{id:"insight_citypoint_emerging",tone:"positive",title:"New citation on 1 key phrase",detail:"Case-study content is earning citations on Invisalign prompts.",actionLabel:"Emerging",affectedPhrases:[{keyword:"best invisalign dentist downtown brooklyn",evidenceId:"evidence_citypoint_invisalign_openai",provider:"openai",citationState:"emerging"}]},{id:"insight_citypoint_content_gap",tone:"caution",title:"1 key phrase not cited by any provider",detail:"No dedicated neighborhood page to support pediatric queries.",actionLabel:"Gap",affectedPhrases:[{keyword:"pediatric dentist brooklyn heights",evidenceId:"evidence_citypoint_children_claude",provider:"claude",citationState:"not-cited"}]}],visibilityEvidence:CM,competitors:[{id:"competitor_citypoint_downtown",domain:"downtownsmiles.com",citationCount:4,totalKeywords:8,pressureLabel:"High",citedKeywords:["emergency dentist","same-day dental","walk-in dentist","tooth pain"],movement:"Up on emergency and availability prompts",notes:"Recently added same-day booking proof and FAQ content."},{id:"competitor_citypoint_harbor",domain:"harbordental.com",citationCount:2,totalKeywords:8,pressureLabel:"Moderate",citedKeywords:["family dentist","emergency dentist"],movement:"Holding citations on family and emergency intents",notes:"Strong appointment and insurance content keeps answers grounded."},{id:"competitor_citypoint_clearline",domain:"clearlineortho.com",citationCount:1,totalKeywords:8,pressureLabel:"Low",citedKeywords:["invisalign near me"],movement:"Softening on Invisalign prompts",notes:"Case-study content is aging, opening room for Citypoint."}],recentRuns:[_p,Cu]},{project:kr[1],dateRangeLabel:"Last 14 days",contextLabel:"US / English / Service-area legal prompts",visibilitySummary:{label:"Answer Visibility",value:"74 / 100",delta:"+2 this week",tone:"positive",description:"Branded prompts are stable and informational queries are gradually improving.",trend:[68,70,71,73,74]},providerScores:[{provider:"gemini",model:"gemini-3-flash",score:75,cited:3,total:4},{provider:"openai",model:"gpt-5.4",score:50,cited:2,total:4}],competitorPressure:{label:"Competitor Pressure",value:"Moderate",delta:"Steady",tone:"neutral",description:"Competitors are stable; no new citation displacement was detected.",trend:[44,46,45,46,46]},runStatus:{label:"Run Status",value:"Healthy",delta:"No failures in 14 days",tone:"positive",description:"Latest visibility runs completed without issues.",trend:[88,89,90,90,91]},insights:[{id:"insight_harbor_cluster",tone:"positive",title:"Practice-area clustering is paying off",detail:"Merged legal service pages now ground broader informational prompts.",actionLabel:"Cited",affectedPhrases:[{keyword:"brooklyn personal injury lawyer",evidenceId:"evidence_harbor_personal_injury",provider:"gemini",citationState:"cited"}]},{id:"insight_harbor_local",tone:"neutral",title:"No significant changes",detail:"No new displacement on borough-specific injury prompts this week.",actionLabel:"Stable",affectedPhrases:[]}],visibilityEvidence:[{id:"evidence_harbor_personal_injury",keyword:"brooklyn personal injury lawyer",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Held for 5 runs",answerSnippet:"Harbor Legal Group remains cited for borough-specific personal injury queries due to clear practice-area and case-result content.",citedDomains:["harborlegal.com"],evidenceUrls:["https://harborlegal.com/personal-injury/brooklyn"],competitorDomains:["shorelineinjury.com"],groundingSources:[],relatedTechnicalSignals:["Practice-area schema intact","Case results link directly from service pages"],summary:"Grounding remains durable after the service-page consolidation.",runHistory:ts(["cited","cited","cited","cited","cited"])}],competitors:[{id:"competitor_harbor_shoreline",domain:"shorelineinjury.com",citationCount:2,totalKeywords:6,pressureLabel:"Moderate",citedKeywords:["personal injury lawyer","car accident attorney"],movement:"Stable",notes:"Strong case-result pages keep it in rotation."}],recentRuns:[kp]},{project:kr[2],dateRangeLabel:"Last 7 days",contextLabel:"US / English / Multi-location treatment prompts",visibilitySummary:{label:"Answer Visibility",value:"58 / 100",delta:"Run in progress",tone:"neutral",description:"The current run is measuring whether treatment-location pages improved citation breadth.",trend:[52,54,55,57,58]},providerScores:[{provider:"openai",model:"gpt-5.4",score:58,cited:4,total:7}],competitorPressure:{label:"Competitor Pressure",value:"Moderate",delta:"Watching 1 chain",tone:"caution",description:"Regional chain competitors are winning on broad treatment questions.",trend:[49,51,52,54,56]},runStatus:{label:"Run Status",value:"Running",delta:"9 prompts remaining",tone:"neutral",description:"Current answer-visibility sweep is still collecting provider responses.",trend:[63,64,65,67,68]},insights:[{id:"insight_northstar_location_depth",tone:"caution",title:"Location pages need stronger proof",detail:"Answers prefer competitors with physician-specific evidence.",actionLabel:"Gap",affectedPhrases:[{keyword:"knee replacement surgeon westchester",evidenceId:"evidence_northstar_knee",provider:"openai",citationState:"emerging"}]}],visibilityEvidence:[{id:"evidence_northstar_knee",keyword:"knee replacement surgeon westchester",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"Improving",answerSnippet:"Northstar Orthopedics is beginning to appear on location-sensitive treatment prompts when physician bios and treatment pages are tightly linked.",citedDomains:["northstarortho.com","regionaljointcare.com"],evidenceUrls:["https://northstarortho.com/locations/westchester/knee-replacement"],competitorDomains:["regionaljointcare.com"],groundingSources:[],relatedTechnicalSignals:["Physician bios now linked from treatment pages"],summary:"Template cleanup is helping, but proof depth still matters.",runHistory:ts(["not-cited","not-cited","not-cited","cited"])}],competitors:[{id:"competitor_northstar_regional",domain:"regionaljointcare.com",citationCount:5,totalKeywords:7,pressureLabel:"High",citedKeywords:["knee replacement","hip surgery","joint pain treatment","orthopedic surgeon","sports medicine"],movement:"Winning broad treatment prompts",notes:"Heavy physician proof and patient-story content."}],recentRuns:[_u]}],kM={portfolioOverview:{projects:[{project:kr[0],visibilityScore:61,visibilityDelta:"-8 this week",lastRun:Cu,insight:"Lost emergency-intent citations after competitors refreshed availability pages.",trend:[73,71,69,66,61],competitorPressureLabel:"High"},{project:kr[1],visibilityScore:74,visibilityDelta:"+2 this week",lastRun:kp,insight:"Practice-area consolidation is stabilizing branded and informational prompts.",trend:[68,70,71,73,74],competitorPressureLabel:"Moderate"},{project:kr[2],visibilityScore:58,visibilityDelta:"Run in progress",lastRun:_u,insight:"Location pages are improving, but local treatment proof still trails competitors.",trend:[52,54,55,57,58],competitorPressureLabel:"Moderate"}],attentionItems:[{id:"attention_citypoint",tone:"negative",title:"Citypoint Dental lost emergency-intent citations",detail:"Three high-intent prompts now cite competitors first.",actionLabel:"Open project",href:"/projects/project_citypoint"},{id:"attention_worker",tone:"neutral",title:"One follow-up run is queued",detail:"Citypoint has a queued visibility sweep waiting on provider quota.",actionLabel:"Open runs",href:"/runs"},{id:"attention_northstar",tone:"caution",title:"Northstar run still in progress",detail:"Nine prompts remain before the current treatment-location sweep finishes.",actionLabel:"View timeline",href:"/runs"}],recentRuns:[_p,_u,Cu],systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Healthy",meta:"phase-1 · database configured"},{id:"worker",label:"Worker",tone:"positive",detail:"Healthy",meta:"heartbeat moments ago"},{id:"providers",label:"Providers",tone:"positive",detail:"2 of 3 configured",meta:"Gemini · OpenAI"}],lastUpdatedAt:"Mar 9, 8:08 AM ET"},projects:_M,runs:NM,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"Primary control plane is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"worker",label:"Worker heartbeats received",detail:"Background execution loop is alive.",state:"ready",guidance:"Required before any answer-visibility run can start."},{id:"provider",label:"Provider configured",detail:"Gemini key and quota defaults are present.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:18,preview:["emergency dentist brooklyn","best invisalign dentist downtown brooklyn","pediatric dentist brooklyn heights"]},competitorDraft:{domains:["downtownsmiles.com","harbordental.com","clearlineortho.com"],notes:"Start with the domains that already displace the project on money prompts."},launchState:{enabled:!0,ctaLabel:"Launch first run",summary:"Queue a visibility sweep first, then follow with a site audit to explain movement."}},settings:{providerStatuses:[{name:"Gemini",model:"gemini-3-flash",state:"ready",detail:"API key detected and conservative quota defaults are active.",quota:{maxConcurrency:2,maxRequestsPerMinute:10,maxRequestsPerDay:1e3}},{name:"OpenAI",model:"gpt-5.4",state:"ready",detail:"API key configured.",quota:{maxConcurrency:2,maxRequestsPerMinute:10,maxRequestsPerDay:1e3}},{name:"Claude",model:"claude-sonnet-4-6",state:"needs-config",detail:"API key is missing."}],google:{state:"ready",detail:"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard."},bing:{state:"needs-config",detail:"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."}},zM={apiStatus:{label:"API",state:"ok",detail:"phase-1 · database configured",version:"phase-1",databaseConfigured:!0},workerStatus:{label:"Worker",state:"ok",detail:"phase-1 · database configured · heartbeat 2026-03-09T08:07:00.000Z",version:"phase-1",databaseConfigured:!0,lastHeartbeatAt:"2026-03-09T08:07:00.000Z"}};function Vu(e={}){const t=structuredClone(kM),s=structuredClone(zM);if(e.emptyPortfolio&&(t.portfolioOverview.projects=[],t.portfolioOverview.attentionItems=[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Start the guided setup flow to add a domain, import keywords, and launch the first run.",actionLabel:"Open setup",href:"/setup"}],t.portfolioOverview.recentRuns=[],t.portfolioOverview.emptyState={title:"No projects yet",detail:"Canonry becomes useful after one project, a small keyword set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}),e.runScenario==="partial"&&(t.runs[0].status="partial",t.runs[0].duration="7m 24s",t.runs[0].statusDetail="Quota window closed mid-run; 14 of 18 prompts completed before the worker paused.",t.runs[0].summary="Partial visibility sweep after quota cap",t.portfolioOverview.recentRuns[0]=t.runs[0]),e.runScenario==="failed"&&(t.runs[0].status="failed",t.runs[0].duration="1m 43s",t.runs[0].statusDetail="Worker could not reach the provider after repeated retry exhaustion.",t.runs[0].summary="Provider retries exhausted before results were captured",t.portfolioOverview.recentRuns[0]=t.runs[0],t.portfolioOverview.attentionItems.unshift({id:"attention_failed_run",tone:"negative",title:"One queued follow-up failed to start cleanly",detail:"Worker retries exhausted before the provider returned a response.",actionLabel:"Open runs",href:"/runs"})),e.degradedWorker&&(s.workerStatus={label:"Worker",state:"error",detail:"heartbeat stale · last seen 12m ago",version:"phase-1",databaseConfigured:!0,lastHeartbeatAt:"2026-03-09T07:55:00.000Z"}),e.providerNeedsConfig&&(t.settings.providerStatuses=t.settings.providerStatuses.map(a=>({...a,state:"needs-config",detail:"API key is missing, so answer-visibility sweeps are blocked."}))),e.visibilityDropProjectId){const a=t.projects.find(c=>c.project.id===e.visibilityDropProjectId),r=t.portfolioOverview.projects.find(c=>c.project.id===e.visibilityDropProjectId);a&&(a.visibilitySummary.value="49 / 100",a.visibilitySummary.delta="-12 in 48h",a.visibilitySummary.tone="negative",a.visibilitySummary.description="A sharper drop than normal; citations slipped across both local and service-intent prompts.",a.insights.unshift({id:`${a.project.id}_drop`,tone:"negative",title:"Sharp citation drop detected",detail:"Answers that previously cited the domain now ground competitors on both local and service-intent prompts.",actionLabel:"Lost",affectedPhrases:a.visibilityEvidence.filter(c=>c.citationState==="lost").slice(0,5).map(c=>({keyword:c.keyword,evidenceId:c.id,provider:c.provider||void 0,citationState:c.citationState}))})),r&&(r.visibilityScore=49,r.visibilityDelta="-12 in 48h",r.insight="Sharp citation drop detected; grounding now prefers competitors on multiple high-intent prompts.")}return{dashboard:t,health:s}}function EM(e,t){return e.projects.find(s=>s.project.id===t)}function RM(e,t){return e.runs.find(s=>s.id===t)}function OM(e,t){for(const s of e.projects){const a=s.visibilityEvidence.find(r=>r.id===t);if(a)return{project:s,evidence:a}}}function l1(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 xx(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function AM(e,t){if(!e)return"Waiting";if(!t)return"Running";const s=new Date(t).getTime()-new Date(e).getTime();if(s<1e3)return"<1s";const a=Math.floor(s/1e3);if(a<60)return`${a}s`;const r=Math.floor(a/60),c=a%60;return`${r}m ${c}s`}function c1(e){return e==="answer-visibility"?"Answer visibility sweep":e}function TM(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function zp(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:c1(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?xx(e.startedAt):xx(e.createdAt),duration:AM(e.startedAt,e.finishedAt),statusDetail:e.error?u1(e.error):DM(e),summary:LM(e),triggerLabel:TM(e.trigger)}}function u1(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 DM(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?u1(e.error):"Run failed.";default:return""}}function LM(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 d1(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 MM(e){return e>=70?"positive":e>=40?"caution":"negative"}function UM(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function f1(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const s=new Set(t);let a=0;for(const c of e)c.competitorOverlap.some(d=>s.has(d))&&a++;const r=a/e.length;return r>=.5?{label:"High",count:a}:r>=.2?{label:"Moderate",count:a}:{label:"Low",count:a}}function PM(e,t,s,a){const r=[];let c=0;const d=new Set;if(s){const f=new Map;for(const m of s.snapshots)if(m.keyword){const b=`${m.keyword}::${m.provider}`;f.set(b,m)}const p=[...new Set(s.snapshots.map(m=>m.provider))].sort();p.length===0&&p.push("gemini");for(const m of t){if(m.runs.length===0)continue;d.add(m.keyword);const y=m.runs.at(-1)?.transition??"not-cited",v=y==="lost"?"lost":y==="emerging"?"emerging":y==="cited"?"cited":"not-cited";for(const x of p){const j=f.get(`${m.keyword}::${x}`);if(!j&&p.length>1)continue;const S=j?.model??null,C=S?`${x}:${S}`:null,_=C?m.modelRuns?.[C]:void 0,E=m.providerRuns?.[x],R=(E?.length?E:null)??(_?.length?_:null),z=E?.length?"provider":_?.length?"model":"keyword",U=R?R.at(-1).transition:y,O=U==="lost"?"lost":U==="emerging"?"emerging":j?j.citationState==="cited"?"cited":"not-cited":v,M=Em(R||m.runs),A=IM(m,x),B=(R??m.runs).map(me=>({runId:me.runId,citationState:me.citationState,createdAt:me.createdAt,model:A.get(me.runId)??null})),ie=$M(B),Q=z==="provider"&&ie.length<=1?"model":z,ne=BM(B);r.push({id:`evidence_${e}_${c++}`,keyword:m.keyword,provider:j?.provider??x,model:j?.model??null,location:j?.location??null,citationState:O,changeLabel:qM(U,M),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:HM(O,m.keyword),runHistory:B,historyScope:Q,modelsSeen:ie,modelTransitions:ne})}}}for(const f of a)d.has(f.keyword)||r.push({id:`evidence_${e}_${c++}`,keyword:f.keyword,provider:"",model:null,location:null,citationState:"pending",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${f.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return r}function IM(e,t){const s=new Map,a=`${t}:`;for(const[r,c]of Object.entries(e.modelRuns??{})){if(!r.startsWith(a))continue;const d=r.slice(a.length),f=d==="unknown"?null:d;for(const p of c)s.set(p.runId,f)}return s}function $M(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function BM(e){const t=[];let s=null;for(const a of e){const r=a.model??null;r!==s&&s!==null&&t.push({runId:a.runId,createdAt:a.createdAt,fromModel:s,toModel:r}),s=r}return t}function Em(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 qM(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 HM(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 Sx(e,t){const s=new Set(t),a=new Map;for(const r of e)if(r.keyword)for(const c of r.competitorOverlap){if(!s.has(c))continue;const d=a.get(c)??new Set;d.add(r.keyword),a.set(c,d)}return a}const Gh=3;function ZM(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:r,trackedCompetitors:c}=e,d=[],f=[],p=new Set;for(const _ of t)_.citationState==="lost"&&(p.has(_.keyword)||(p.add(_.keyword),f.push({keyword:_.keyword,evidenceId:_.id,provider:_.provider,citationState:"lost"})));f.length>0&&d.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${f.length} keyword${f.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:f});const m=Sx(a,c),b=Sx(r,c);for(const _ of c){const E=m.get(_)??new Set,R=b.get(_)??new Set,z=[...E].filter(U=>!R.has(U));z.length>0&&d.push({id:`insight_comp_gained_${_}`,tone:"negative",title:`${_} appeared on ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:z.map(U=>{const O=t.find(M=>M.keyword===U);return{keyword:U,evidenceId:O?.id??"",citationState:"cited"}})})}const y=new Map;for(const _ of s){const E=_.runs.at(-1);E&&y.set(_.keyword,{transition:E.transition,citationState:E.citationState})}const v=[],x=[],j=new Set;for(const[_,{transition:E,citationState:R}]of y){if(!(E==="emerging"||E==="new"&&R==="cited"))continue;j.add(_);const U=t.find(O=>O.keyword===_&&(O.citationState==="emerging"||O.citationState==="cited"));v.push({keyword:_,evidenceId:U?.id??"",provider:U?.provider,citationState:"emerging"})}for(const _ of t)_.citationState==="emerging"&&(j.has(_.keyword)||x.push({keyword:_.keyword,evidenceId:_.id,provider:_.provider,citationState:"emerging"}));if(x.length>0){const _=new Set(x.map(E=>E.keyword)).size;d.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${_} keyword${_>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:x})}v.length>0&&d.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${j.size} keyword${j.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:v});const S=new Set(t.map(_=>_.keyword)),C=[];for(const _ of s){if(!S.has(_.keyword)||_.runs.length<Gh||_.runs.at(-1)?.citationState!=="not-cited")continue;if(Em(_.runs)>=Gh){const z=t.find(U=>U.keyword===_.keyword);C.push({keyword:_.keyword,evidenceId:z?.id??"",citationState:"not-cited"})}}C.length>0&&d.push({id:"insight_persistent_gap",tone:"caution",title:`${C.length} keyword${C.length>1?"s":""} uncited for ${Gh}+ runs`,detail:"These keywords have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:C});for(const _ of c){const E=m.get(_)??new Set,z=[...b.get(_)??new Set].filter(U=>!E.has(U));z.length>0&&d.push({id:`insight_comp_lost_${_}`,tone:"neutral",title:`${_} dropped from ${z.length} keyword${z.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:z.map(U=>{const O=t.find(M=>M.keyword===U);return{keyword:U,evidenceId:O?.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 FM(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: ${c1(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 GM(e){const t=l1(e.project),s=PM(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],r=d1(a),c=f1(a,e.competitors.map(y=>y.domain)),d=ZM({evidence:s,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(y=>y.domain)}),f=[...e.runs].sort((y,v)=>v.createdAt.localeCompare(y.createdAt)),p=f.map(y=>zp(y,e.project.displayName||e.project.name)),m=new Map;for(const y of a){const v=y.provider||"gemini",x=y.model??null,j=`${v}::${x??"unknown"}`,S=m.get(j)??{provider:v,model:x,cited:0,total:0};S.total++,y.citationState==="cited"&&S.cited++,m.set(j,S)}const b=[...m.values()].sort((y,v)=>y.provider.localeCompare(v.provider)||(y.model??"").localeCompare(v.model??"")).map(({provider:y,model:v,cited:x,total:j})=>({provider:y,model:v,score:j>0?Math.round(x/j*100):0,cited:x,total:j}));return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:a.length>0?`${r.score}`:"No data",delta:a.length>0?`${r.citedCount} of ${r.totalCount} key phrases visible`:"Run a sweep first",tone:a.length>0?MM(r.score):"neutral",description:a.length>0?`${r.citedCount} of ${r.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[]},providerScores:b,competitorPressure:{label:"Competitor Pressure",value:c.label,delta:c.count>0?`${c.count} overlapping citations`:"No overlap detected",tone:UM(c.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:FM(f),insights:d,visibilityEvidence:s,competitors:e.competitors.map((y,v)=>{const x=new Set;for(const E of a)(E.competitorOverlap.includes(y.domain)||E.citedDomains.includes(y.domain))&&E.keyword&&x.add(E.keyword);const j=[...x],S=new Set(a.map(E=>E.keyword).filter(Boolean)),C=S.size>0?j.length/S.size:0,_=C>=.5?"High":C>=.2?"Moderate":j.length>0?"Low":"None";return{id:y.id||`comp_${v}`,domain:y.domain,citationCount:j.length,totalKeywords:S.size,pressureLabel:_,citedKeywords:j,movement:"",notes:""}}),recentRuns:p.slice(0,5)}}function KM(e){const t=l1(e.project),s=e.latestRunDetail?.snapshots??[],a=d1(s),r=f1(s,e.competitors.map(p=>p.domain)),d=[...e.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt))[0],f=d?zp(d,e.project.displayName||e.project.name):{id:"none",projectId:e.project.id,projectName:e.project.displayName||e.project.name,kind:"answer-visibility",kindLabel:"No runs yet",status:"queued",trigger:"manual",createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""};return{project:t,visibilityScore:a.score,visibilityDelta:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases`:"No data",lastRun:f,insight:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible across ${new Set(s.map(p=>p.provider)).size} provider${new Set(s.map(p=>p.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:r.label}}function VM(e,t){const s=[],a=[],r=[];for(const d of e){a.push(GM(d)),r.push(KM(d));const f=[...d.runs].sort((p,m)=>m.createdAt.localeCompare(p.createdAt));for(const p of f)s.push(zp(p,d.project.displayName||d.project.name))}s.sort((d,f)=>f.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:r,attentionItems:c?QM(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,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 QM(e){const t=[];for(const s of e){const a=s.visibilityEvidence.filter(c=>c.citationState==="lost");a.length>0&&t.push({id:`attention_${s.project.id}_lost`,tone:"negative",title:`${s.project.displayName||s.project.name} lost citations`,detail:`${a.length} key phrase${a.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${s.project.id}`});const r=s.recentRuns.filter(c=>c.status==="running"||c.status==="queued");r.length>0&&t.push({id:`attention_${s.project.id}_active`,tone:"neutral",title:`${s.project.displayName||s.project.name} has active runs`,detail:`${r.length} run${r.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return t.length===0&&t.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),t}const Ei={projects:{all:["projects"],detail:e=>["projects",e],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"]},h1=N.createContext(null);h1.Provider;function ol(){return N.useContext(h1)}function ka(e){const s=ol()?.dashboard??null,a=Bo({queryKey:Ei.projects.all,queryFn:uj,enabled:!s}),r=Bo({queryKey:Ei.runs.all,queryFn:dj,enabled:!s,refetchInterval:j=>j.state.data?.some(_=>_.status==="running"||_.status==="queued")?3e3:!1}),c=Bo({queryKey:Ei.settings,queryFn:()=>Cp().catch(()=>null),enabled:!s}),d=a.data??[],f=r.data??[],p=G_({queries:d.map(j=>{const S=f.filter(_=>_.projectId===j.id),C=S.filter(_=>(_.status==="completed"||_.status==="partial")&&_.kind==="answer-visibility").sort((_,E)=>E.createdAt.localeCompare(_.createdAt));return{queryKey:Ei.projects.detail(j.id),queryFn:async()=>{const[_,E,R,z,U]=await Promise.all([fj(j.name).catch(()=>[]),Sp(j.name).catch(()=>[]),wp(j.name).catch(()=>[]),C[0]?nl(C[0].id).catch(()=>null):Promise.resolve(null),C[1]?nl(C[1].id).catch(()=>null):Promise.resolve(null)]);return{project:j,runs:S,keywords:_,competitors:E,timeline:R,latestRunDetail:z,previousRunDetail:U}},enabled:!s&&a.isSuccess&&r.isSuccess}})}),m=p.every(j=>j.isSuccess),b=N.useMemo(()=>{if(s)return s;if(!a.data||!r.data||d.length>0&&!m)return null;const j=p.map(S=>S.data).filter(S=>S!=null);return VM(j,c.data??null)},[s,a.data,r.data,c.data,m,p,d.length]),y=!s&&(a.isLoading||r.isLoading),v=!s&&(a.isError||r.isError),x=N.useCallback(async()=>{await Promise.all([a.refetch(),r.refetch(),c.refetch()])},[a.refetch,r.refetch,c.refetch]);return{dashboard:b,isLoading:y,isError:v,refetch:x}}async function YM(){const e=await o1("/health","API"),t=e.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:e.state,detail:"Depends on API"};return{apiStatus:e,workerStatus:t}}function Qu(e,t){return Bo({queryKey:Ei.health,queryFn:YM,enabled:e,refetchInterval:15e3,initialData:t})}function JM(e){return Bo({queryKey:Ei.runs.detail(e??""),queryFn:()=>nl(e),enabled:!!e,refetchInterval:t=>{const s=t.state.data?.status;return s==="running"||s==="queued"?3e3:!1}})}function ll(){const e=ja(),t=Du({strict:!1}),s=xn({select:p=>p.location.pathname}),a=t.runId??null,r=t.evidenceId??null;return{runId:a,evidenceId:r,openRun:p=>e({to:s,from:ss.to,search:m=>({...m,runId:p,evidenceId:void 0})}),openEvidence:p=>e({to:s,from:ss.to,search:m=>({...m,evidenceId:p,runId:void 0})}),closeDrawer:()=>e({to:s,from:ss.to,search:p=>({...p,runId:void 0,evidenceId:void 0})})}}const wx=[{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"}],XM=Vu(),jx=e=>({label:e,state:"checking",detail:"Checking service health"}),WM={apiStatus:jx("API"),workerStatus:jx("Worker")};function e5(){const e=ol(),{dashboard:t,isLoading:s,refetch:a}=ka(),d=Qu(!e,e?.health).data??e?.health??WM,f=Qz(),{runId:p,evidenceId:m,closeDrawer:b}=ll(),[y,v]=N.useState(!1),x=JM(p),j=x.data??null,S=x.isLoading;N.useEffect(()=>{j&&j.status!=="running"&&j.status!=="queued"&&a()},[j?.status,a]),N.useEffect(()=>{v(!1)},[f.pathname]),N.useEffect(()=>{if(typeof window>"u"||!p&&!m)return;const z=U=>{U.key==="Escape"&&b()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[p,m,b]);const C=t??e?.dashboard??XM.dashboard,_=p?RM(C,p):void 0,E=m?OM(C,m):void 0,R=(()=>{const z=f.pathname;if(z==="/")return"Portfolio";if(z==="/projects")return"Projects";if(z==="/runs")return"Runs";if(z==="/settings")return"Settings";if(z==="/setup")return"Setup";if(z.startsWith("/projects/")){const O=z.split("/").filter(Boolean)[1];if(O){const M=C.projects.find(A=>A.project.id===O);if(M)return M.project.name}return"Project"}return"Not found"})();return l.jsxs("div",{className:"app-shell",children:[l.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),l.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[l.jsx("div",{className:"sidebar-brand",children:l.jsx(Pb,{})}),l.jsxs("nav",{className:"sidebar-nav",children:[l.jsxs(gt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(d2,{className:"sidebar-icon"}),l.jsx("span",{children:"Overview"})]}),l.jsxs(gt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[l.jsx(c2,{className:"sidebar-icon"}),l.jsx("span",{children:"Projects"})]}),l.jsxs(gt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(p2,{className:"sidebar-icon"}),l.jsx("span",{children:"Runs"})]}),l.jsxs(gt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(w2,{className:"sidebar-icon"}),l.jsx("span",{children:"Settings"})]}),C.projects.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),C.projects.map(z=>{const U=z.visibilitySummary.tone;return l.jsxs(gt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[l.jsx("span",{className:`sidebar-dot sidebar-dot-${U}`}),l.jsx("span",{children:z.project.name})]},z.project.id)})]}):null,C.projects.length===0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Resources"}),l.jsxs(gt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(v2,{className:"sidebar-icon"}),l.jsx("span",{children:"Setup"})]})]}):null]}),l.jsx("div",{className:"sidebar-footer",children:wx.map(z=>l.jsx("a",{className:"sidebar-footer-link",href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]}),l.jsxs("div",{className:"main-area",children:[l.jsxs("header",{className:"topbar",children:[l.jsxs("div",{className:"topbar-left",children:[l.jsx("div",{className:"topbar-brand-mobile",children:l.jsx(Pb,{compact:!0})}),l.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[l.jsx(gt,{to:"/",children:"Home"}),l.jsx(Lu,{className:"breadcrumb-sep size-3"}),l.jsx("span",{className:"breadcrumb-current",children:R})]})]}),l.jsxs("div",{className:"topbar-actions",children:[l.jsxs("div",{className:"health-pill-row",children:[l.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),l.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),l.jsxs(le,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>v(z=>!z),children:[l.jsx(h2,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),l.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${y?"mobile-nav-open":""}`,children:[l.jsxs(le,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>v(!1),children:[l.jsx(Mu,{className:"size-5"}),l.jsx("span",{className:"sr-only",children:"Close navigation"})]}),l.jsx(gt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),l.jsx(gt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),l.jsx(gt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),l.jsx(gt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),C.projects.length>0?l.jsxs("div",{className:"mobile-nav-section",children:[l.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),C.projects.map(z=>l.jsx(gt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"mobile-nav-link",children:z.project.name},z.project.id))]}):null]}),l.jsx("main",{id:"content",className:"page-shell",children:s&&!e?l.jsx("div",{className:"page-container",children:l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Loading"}),l.jsx("p",{className:"page-subtitle",children:"Connecting to API and loading dashboard data..."})]})})}):l.jsx(np,{})}),l.jsxs("footer",{className:"footer",children:[l.jsx("p",{className:"supporting-copy",children:"Technical readiness and answer visibility stay separate."}),l.jsx("div",{className:"footer-links",children:wx.map(z=>l.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),_?l.jsxs(vO,{open:_!==void 0,title:_.summary,subtitle:`${_.projectName} · ${_.kindLabel}`,onClose:b,children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[l.jsx(Pu,{status:_.status}),l.jsx("span",{className:"text-zinc-400",children:_.startedAt}),l.jsx("span",{className:"text-zinc-500",children:_.duration}),l.jsx("span",{className:"text-zinc-600",children:_.triggerLabel})]}),_.status==="failed"&&_.statusDetail&&l.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:_.statusDetail}),l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):j&&j.snapshots.length>0?l.jsxs("div",{className:"space-y-2",children:[j.snapshots.map(z=>l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:z.keyword??"Unknown key phrase"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Xo,{provider:z.provider}),l.jsx(ZS,{variant:z.citationState==="cited"?"success":"neutral",children:z.citationState})]})]}),z.model&&l.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:z.model}),z.citedDomains.length>0&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[l.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",z.citedDomains.join(", ")]}),z.competitorOverlap.length>0&&l.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",z.competitorOverlap.join(", ")]}),z.groundingSources&&z.groundingSources.length>0&&l.jsxs("details",{className:"mt-2",children:[l.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[z.groundingSources.length," grounding source",z.groundingSources.length!==1?"s":""]}),l.jsx("ul",{className:"mt-1 space-y-0.5",children:z.groundingSources.map((U,O)=>l.jsx("li",{className:"text-xs text-zinc-500 truncate",children:l.jsx("a",{href:U.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:U.title||U.uri})},O))})]}),z.answerText&&l.jsxs("details",{className:"mt-1",children:[l.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:z.answerText})]})]},z.id)),j.status==="running"&&l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):j&&j.status==="running"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):j&&j.status==="queued"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):j&&j.error?l.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[l.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),l.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:z2(j.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?l.jsx(jM,{evidence:E.evidence,project:E.project,onClose:b}):null]})}class t5 extends N.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,s){console.error("[ErrorBoundary]",t,s.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?l.jsx("div",{className:"page-container",children:l.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[l.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:l.jsx(_2,{className:"size-6 text-rose-400"})}),l.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),l.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),l.jsxs("div",{className:"flex gap-3 mt-2",children:[l.jsxs(le,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[l.jsx(x2,{className:"size-3.5 mr-1.5"}),"Try again"]}),l.jsx(le,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const He=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Kn("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}));He.displayName="Card";const n5=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Kn("flex flex-col gap-1.5 p-5",e),...t}));n5.displayName="CardHeader";const s5=N.forwardRef(({className:e,...t},s)=>l.jsx("h3",{ref:s,className:Kn("font-medium tracking-tight text-zinc-50",e),...t}));s5.displayName="CardTitle";const i5=N.forwardRef(({className:e,...t},s)=>l.jsx("p",{ref:s,className:Kn("text-sm text-zinc-500",e),...t}));i5.displayName="CardDescription";const a5=N.forwardRef(({className:e,...t},s)=>l.jsx("div",{ref:s,className:Kn("p-5 pt-0",e),...t}));a5.displayName="CardContent";function r5({points:e,tone:t}){const s=N.useId();if(e.length===0)return null;const a=42,r=132,c=5,d=Math.min(...e),p=Math.max(...e)-d||1,m=r-c*2,b=a-c*2,y=e.map((v,x)=>{const j=c+x/Math.max(e.length-1,1)*m,S=c+(1-(v-d)/p)*b;return`${j},${S}`}).join(" ");return l.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${r} ${a}`,"aria-hidden":"true",children:[l.jsx("defs",{children:l.jsx("clipPath",{id:s,children:l.jsx("rect",{x:c,y:c,width:m,height:b,rx:"8"})})}),l.jsx("line",{className:"sparkline-guide",x1:c,x2:r-c,y1:a-c,y2:a-c}),l.jsx("polyline",{clipPath:`url(#${s})`,points:y,vectorEffect:"non-scaling-stroke"})]})}const o5={gemini:"Gemini",openai:"OpenAI",claude:"Claude",local:"Local"};function l5(e,t,s){return e.map(a=>{if(a.id==="api")return{...a,tone:vu(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:vu(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const r=s.providerStatuses.filter(p=>p.state==="ready").length,c=s.providerStatuses.length,d=r>0,f=s.providerStatuses.filter(p=>p.state==="ready").map(p=>o5[p.name]??p.name).join(" · ");return{...a,label:"Providers",tone:d?"positive":"caution",detail:`${r} of ${c} configured`,meta:f||"None configured"}})}function c5(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 u5(e,t,s){const a=c5(t,s),r=structuredClone(e);return r.healthChecks=r.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const d=s.providerStatuses.some(f=>f.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),r.launchState.enabled=a===void 0,r.launchState.blockedReason=a,r.launchState.summary=a??"Queue a visibility sweep first, then follow with a site audit to explain movement.",r}const d5=Vu();function f5({project:e}){return l.jsxs(gt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[l.jsxs("div",{className:"project-row-primary",children:[l.jsxs("div",{children:[l.jsx("p",{className:"project-name",children:e.project.name}),l.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),l.jsx("p",{className:"project-insight",children:e.insight})]}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),l.jsx("p",{className:"metric-inline-value",children:e.visibilityScore}),l.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),l.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),l.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Uu(e.lastRun.status)]})]})}),l.jsx("div",{className:"project-row-chart",children:l.jsx(r5,{points:e.trend,tone:FS(e.lastRun.status)})}),l.jsx("span",{className:"project-row-link",children:l.jsx(Lu,{className:"h-4 w-4 text-zinc-500"})})]})}function h5(){const e=ol(),{dashboard:t}=ka(),s=t??e?.dashboard??d5.dashboard,a=s.portfolioOverview,d=Qu(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},f=l5(a.systemHealth,d,s.settings),{openRun:p}=ll();return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Portfolio"}),l.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),l.jsx("div",{className:"page-header-right",children:l.jsx("p",{className:"text-[11px] text-zinc-600",children:a.lastUpdatedAt})})]}),a.projects.length>0?l.jsx("div",{className:"project-list project-list-scrollable",children:a.projects.map(m=>l.jsx(f5,{project:m},m.project.id))}):l.jsxs(He,{className:"surface-card empty-card",children:[l.jsx("h3",{children:a.emptyState?.title??"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:a.emptyState?.detail}),l.jsx(le,{size:"sm",asChild:!0,children:l.jsx(gt,{to:a.emptyState?.ctaHref==="/setup"||!a.emptyState?.ctaHref?"/setup":"/",children:a.emptyState?.ctaLabel??"Launch setup"})})]}),l.jsxs("div",{className:"overview-secondary-grid",children:[a.attentionItems.length>0&&l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),l.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),l.jsx("div",{className:"attention-list attention-list-scrollable",children:a.attentionItems.map(m=>l.jsxs(gt,{to:m.href,className:`attention-item attention-item-${m.tone}`,children:[l.jsxs("div",{children:[l.jsx("p",{className:"attention-title",children:m.title}),l.jsx("p",{className:"attention-detail",children:m.detail})]}),l.jsx("span",{className:"attention-action",children:m.actionLabel})]},m.id))})]}),l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),l.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),l.jsx("div",{className:"compact-stack compact-stack-scrollable",children:a.recentRuns.length>0?a.recentRuns.map(m=>l.jsxs("button",{className:"compact-run",type:"button",onClick:()=>p(m.id),children:[l.jsxs("div",{children:[l.jsx("p",{className:"compact-run-title",children:m.projectName}),l.jsx("p",{className:"compact-run-detail",children:m.summary})]}),l.jsx(Pu,{status:m.status})]},m.id)):l.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),l.jsxs("section",{className:"page-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),l.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),l.jsx("div",{className:"health-grid",children:f.map(m=>l.jsxs(He,{className:"surface-card compact-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:m.label}),l.jsx("h3",{children:m.detail})]}),l.jsx(ot,{tone:m.tone,children:m.label})]}),l.jsx("p",{className:"supporting-copy",children:m.meta})]},m.id))})]})]})}const Ep=Symbol.for("yaml.alias"),Rm=Symbol.for("yaml.document"),Di=Symbol.for("yaml.map"),m1=Symbol.for("yaml.pair"),vs=Symbol.for("yaml.scalar"),Ur=Symbol.for("yaml.seq"),Fn=Symbol.for("yaml.node.type"),za=e=>!!e&&typeof e=="object"&&e[Fn]===Ep,Yu=e=>!!e&&typeof e=="object"&&e[Fn]===Rm,cl=e=>!!e&&typeof e=="object"&&e[Fn]===Di,Dt=e=>!!e&&typeof e=="object"&&e[Fn]===m1,ut=e=>!!e&&typeof e=="object"&&e[Fn]===vs,ul=e=>!!e&&typeof e=="object"&&e[Fn]===Ur;function At(e){if(e&&typeof e=="object")switch(e[Fn]){case Di:case Ur:return!0}return!1}function Tt(e){if(e&&typeof e=="object")switch(e[Fn]){case Ep:case Di:case vs:case Ur:return!0}return!1}const p1=e=>(ut(e)||At(e))&&!!e.anchor,ca=Symbol("break visit"),m5=Symbol("skip children"),Zo=Symbol("remove node");function Pr(e,t){const s=p5(t);Yu(e)?wr(null,e.contents,s,Object.freeze([e]))===Zo&&(e.contents=null):wr(null,e,s,Object.freeze([]))}Pr.BREAK=ca;Pr.SKIP=m5;Pr.REMOVE=Zo;function wr(e,t,s,a){const r=g5(e,t,s,a);if(Tt(r)||Dt(r))return y5(e,a,r),wr(e,r,s,a);if(typeof r!="symbol"){if(At(t)){a=Object.freeze(a.concat(t));for(let c=0;c<t.items.length;++c){const d=wr(c,t.items[c],s,a);if(typeof d=="number")c=d-1;else{if(d===ca)return ca;d===Zo&&(t.items.splice(c,1),c-=1)}}}else if(Dt(t)){a=Object.freeze(a.concat(t));const c=wr("key",t.key,s,a);if(c===ca)return ca;c===Zo&&(t.key=null);const d=wr("value",t.value,s,a);if(d===ca)return ca;d===Zo&&(t.value=null)}}return r}function p5(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 g5(e,t,s,a){if(typeof s=="function")return s(e,t,a);if(cl(t))return s.Map?.(e,t,a);if(ul(t))return s.Seq?.(e,t,a);if(Dt(t))return s.Pair?.(e,t,a);if(ut(t))return s.Scalar?.(e,t,a);if(za(t))return s.Alias?.(e,t,a)}function y5(e,t,s){const a=t[t.length-1];if(At(a))a.items[e]=s;else if(Dt(a))e==="key"?a.key=s:a.value=s;else if(Yu(a))a.contents=s;else{const r=za(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const v5={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},b5=e=>e.replace(/[!,[\]{}]/g,t=>v5[t]);class cn{constructor(t,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},cn.defaultYaml,t),this.tags=Object.assign({},cn.defaultTags,s)}clone(){const t=new cn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new cn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:cn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},cn.defaultTags);break}return t}add(t,s){this.atNextDocument&&(this.yaml={explicit:cn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},cn.defaultTags),this.atNextDocument=!1);const a=t.trim().split(/[ \t]+/),r=a.shift();switch(r){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[c,d]=a;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=a;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,d),!1}}default:return s(0,`Unknown directive ${r}`,!0),!1}}tagName(t,s){if(t==="!")return"!";if(t[0]!=="!")return s(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const d=t.slice(2,-1);return d==="!"||d==="!!"?(s(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&s("Verbatim tags must end with a >"),d)}const[,a,r]=t.match(/^(.*!)([^!]*)$/s);r||s(`The ${t} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(r)}catch(d){return s(String(d)),null}return a==="!"?t:(s(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[s,a]of Object.entries(this.tags))if(t.startsWith(a))return s+b5(t.substring(a.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let r;if(t&&a.length>0&&Tt(t.contents)){const c={};Pr(t.contents,(d,f)=>{Tt(f)&&f.tag&&(c[f.tag]=!0)}),r=Object.keys(c)}else r=[];for(const[c,d]of a)c==="!!"&&d==="tag:yaml.org,2002:"||(!t||r.some(f=>f.startsWith(d)))&&s.push(`%TAG ${c} ${d}`);return s.join(`
|
|
96
|
+
`)}}cn.defaultYaml={explicit:!1,version:"1.2"};cn.defaultTags={"!!":"tag:yaml.org,2002:"};function g1(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 y1(e){const t=new Set;return Pr(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function v1(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function x5(e,t){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=y1(e));const d=v1(t,r);return r.add(d),d},setAnchors:()=>{for(const c of s){const d=a.get(c);if(typeof d=="object"&&d.anchor&&(ut(d.node)||At(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 jr(e,t,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,c=a.length;r<c;++r){const d=a[r],f=jr(e,a,String(r),d);f===void 0?delete a[r]:f!==d&&(a[r]=f)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const c=a.get(r),d=jr(e,a,r,c);d===void 0?a.delete(r):d!==c&&a.set(r,d)}else if(a instanceof Set)for(const r of Array.from(a)){const c=jr(e,a,r,r);c===void 0?a.delete(r):c!==r&&(a.delete(r),a.add(c))}else for(const[r,c]of Object.entries(a)){const d=jr(e,a,r,c);d===void 0?delete a[r]:d!==c&&(a[r]=d)}return e.call(t,s,a)}function Zn(e,t,s){if(Array.isArray(e))return e.map((a,r)=>Zn(a,String(r),s));if(e&&typeof e.toJSON=="function"){if(!s||!p1(e))return e.toJSON(t,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(e,a),s.onCreate=c=>{a.res=c,delete s.onCreate};const r=e.toJSON(t,s);return s.onCreate&&s.onCreate(r),r}return typeof e=="bigint"&&!s?.keep?Number(e):e}class Rp{constructor(t){Object.defineProperty(this,Fn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:s,maxAliasCount:a,onAnchor:r,reviver:c}={}){if(!Yu(t))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:t,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Zn(this,"",d);if(typeof r=="function")for(const{count:p,res:m}of d.anchors.values())r(m,p);return typeof c=="function"?jr(c,{"":f},"",f):f}}class Op extends Rp{constructor(t){super(Ep),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=[],Pr(t,{Node:(c,d)=>{(za(d)||p1(d))&&a.push(d)}}),s&&(s.aliasResolveCache=a));let r;for(const c of a){if(c===this)break;c.anchor===this.source&&(r=c)}return r}toJSON(t,s){if(!s)return{source:this.source};const{anchors:a,doc:r,maxAliasCount:c}=s,d=this.resolve(r,s);if(!d){const p=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(p)}let f=a.get(d);if(f||(Zn(d,null,s),f=a.get(d)),f?.res===void 0){const p="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(p)}if(c>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=nu(r,d,a)),f.count*f.aliasCount>c)){const p="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(p)}return f.res}toString(t,s,a){const r=`*${this.source}`;if(t){if(g1(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(t.implicitKey)return`${r} `}return r}}function nu(e,t,s){if(za(t)){const a=t.resolve(e),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(At(t)){let a=0;for(const r of t.items){const c=nu(e,r,s);c>a&&(a=c)}return a}else if(Dt(t)){const a=nu(e,t.key,s),r=nu(e,t.value,s);return Math.max(a,r)}return 1}const b1=e=>!e||typeof e!="function"&&typeof e!="object";class Re extends Rp{constructor(t){super(vs),this.value=t}toJSON(t,s){return s?.keep?this.value:Zn(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 S5="tag:yaml.org,2002:";function w5(e,t,s){if(t){const a=s.filter(c=>c.tag===t),r=a.find(c=>!c.format)??a[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return s.find(a=>a.identify?.(e)&&!a.format)}function sl(e,t,s){if(Yu(e)&&(e=e.contents),Tt(e))return e;if(Dt(e)){const y=s.schema[Di].createNode?.(s.schema,null,s);return y.items.push(e),y}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:r,onTagObj:c,schema:d,sourceObjects:f}=s;let p;if(a&&e&&typeof e=="object"){if(p=f.get(e),p)return p.anchor??(p.anchor=r(e)),new Op(p.anchor);p={anchor:null,node:null},f.set(e,p)}t?.startsWith("!!")&&(t=S5+t.slice(2));let m=w5(e,t,d.tags);if(!m){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Re(e);return p&&(p.node=y),y}m=e instanceof Map?d[Di]:Symbol.iterator in Object(e)?d[Ur]:d[Di]}c&&(c(m),delete s.onTagObj);const b=m?.createNode?m.createNode(s.schema,e,s):typeof m?.nodeClass?.from=="function"?m.nodeClass.from(s.schema,e,s):new Re(e);return t?b.tag=t:m.default||(b.tag=m.tag),p&&(p.node=b),b}function ku(e,t,s){let a=s;for(let r=t.length-1;r>=0;--r){const c=t[r];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const d=[];d[c]=a,a=d}else a=new Map([[c,a]])}return sl(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 $o=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class x1 extends Rp{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=>Tt(a)||Dt(a)?a.clone(t):a),this.range&&(s.range=this.range.slice()),s}addIn(t,s){if($o(t))this.add(s);else{const[a,...r]=t,c=this.get(a,!0);if(At(c))c.addIn(r,s);else if(c===void 0&&this.schema)this.set(a,ku(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}deleteIn(t){const[s,...a]=t;if(a.length===0)return this.delete(s);const r=this.get(s,!0);if(At(r))return r.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(t,s){const[a,...r]=t,c=this.get(a,!0);return r.length===0?!s&&ut(c)?c.value:c:At(c)?c.getIn(r,s):void 0}hasAllNullValues(t){return this.items.every(s=>{if(!Dt(s))return!1;const a=s.value;return a==null||t&&ut(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(t){const[s,...a]=t;if(a.length===0)return this.has(s);const r=this.get(s,!0);return At(r)?r.hasIn(a):!1}setIn(t,s){const[a,...r]=t;if(r.length===0)this.set(a,s);else{const c=this.get(a,!0);if(At(c))c.setIn(r,s);else if(c===void 0&&this.schema)this.set(a,ku(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const j5=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function qs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ma=(e,t,s)=>e.endsWith(`
|
|
97
|
+
`)?qs(s,t):s.includes(`
|
|
98
|
+
`)?`
|
|
99
|
+
`+qs(s,t):(e.endsWith(" ")?"":" ")+s,S1="flow",Om="block",su="quoted";function Ju(e,t,s="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:c=20,onFold:d,onOverflow:f}={}){if(!r||r<0)return e;r<c&&(c=0);const p=Math.max(1+c,1+r-t.length);if(e.length<=p)return e;const m=[],b={};let y=r-t.length;typeof a=="number"&&(a>r-Math.max(2,c)?m.push(0):y=r-a);let v,x,j=!1,S=-1,C=-1,_=-1;s===Om&&(S=Nx(e,S,t.length),S!==-1&&(y=S+p));for(let R;R=e[S+=1];){if(s===su&&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}_=S}if(R===`
|
|
100
|
+
`)s===Om&&(S=Nx(e,S,t.length)),y=S+t.length+p,v=void 0;else{if(R===" "&&x&&x!==" "&&x!==`
|
|
101
|
+
`&&x!==" "){const z=e[S+1];z&&z!==" "&&z!==`
|
|
102
|
+
`&&z!==" "&&(v=S)}if(S>=y)if(v)m.push(v),y=v+p,v=void 0;else if(s===su){for(;x===" "||x===" ";)x=R,R=e[S+=1],j=!0;const z=S>_+1?S-2:C-1;if(b[z])return e;m.push(z),b[z]=!0,y=z+p,v=void 0}else j=!0}x=R}if(j&&f&&f(),m.length===0)return e;d&&d();let E=e.slice(0,m[0]);for(let R=0;R<m.length;++R){const z=m[R],U=m[R+1]||e.length;z===0?E=`
|
|
103
|
+
${t}${e.slice(0,U)}`:(s===su&&b[z]&&(E+=`${e[z]}\\`),E+=`
|
|
104
|
+
${t}${e.slice(z+1,U)}`)}return E}function Nx(e,t,s){let a=t,r=t+1,c=e[r];for(;c===" "||c===" ";)if(t<r+s)c=e[++t];else{do c=e[++t];while(c&&c!==`
|
|
105
|
+
`);a=t,r=t+1,c=e[r]}return a}const Xu=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Wu=e=>/^(%|---|\.\.\.)/m.test(e);function N5(e,t,s){if(!t||t<0)return!1;const a=t-s,r=e.length;if(r<=a)return!1;for(let c=0,d=0;c<r;++c)if(e[c]===`
|
|
106
|
+
`){if(c-d>a)return!0;if(d=c+1,r-d<=a)return!1}return!0}function Fo(e,t){const s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=t,r=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(Wu(e)?" ":"");let d="",f=0;for(let p=0,m=s[p];m;m=s[++p])if(m===" "&&s[p+1]==="\\"&&s[p+2]==="n"&&(d+=s.slice(f,p)+"\\ ",p+=1,f=p,m="\\"),m==="\\")switch(s[p+1]){case"u":{d+=s.slice(f,p);const b=s.substr(p+2,4);switch(b){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:b.substr(0,2)==="00"?d+="\\x"+b.substr(2):d+=s.substr(p,6)}p+=5,f=p+1}break;case"n":if(a||s[p+2]==='"'||s.length<r)p+=1;else{for(d+=s.slice(f,p)+`
|
|
107
|
+
|
|
108
|
+
`;s[p+2]==="\\"&&s[p+3]==="n"&&s[p+4]!=='"';)d+=`
|
|
109
|
+
`,p+=2;d+=c,s[p+2]===" "&&(d+="\\"),p+=1,f=p+1}break;default:p+=1}return d=f?d+s.slice(f):s,a?d:Ju(d,c,su,Xu(t,!1))}function Am(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
110
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Fo(e,t);const s=t.indent||(Wu(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
111
|
+
${s}`)+"'";return t.implicitKey?a:Ju(a,s,S1,Xu(t,!1))}function Nr(e,t){const{singleQuote:s}=t.options;let a;if(s===!1)a=Fo;else{const r=e.includes('"'),c=e.includes("'");r&&!c?a=Am:c&&!r?a=Fo:a=s?Am:Fo}return a(e,t)}let Tm;try{Tm=new RegExp(`(^|(?<!
|
|
112
|
+
))
|
|
113
|
+
+(?!
|
|
114
|
+
|$)`,"g")}catch{Tm=/\n+(?!\n|$)/g}function iu({comment:e,type:t,value:s},a,r,c){const{blockQuote:d,commentString:f,lineWidth:p}=a.options;if(!d||/\n[\t ]+$/.test(s))return Nr(s,a);const m=a.indent||(a.forceBlockIndent||Wu(s)?" ":""),b=d==="literal"?!0:d==="folded"||t===Re.BLOCK_FOLDED?!1:t===Re.BLOCK_LITERAL?!0:!N5(s,p,m.length);if(!s)return b?`|
|
|
115
|
+
`:`>
|
|
116
|
+
`;let y,v;for(v=s.length;v>0;--v){const U=s[v-1];if(U!==`
|
|
117
|
+
`&&U!==" "&&U!==" ")break}let x=s.substring(v);const j=x.indexOf(`
|
|
118
|
+
`);j===-1?y="-":s===x||j!==x.length-1?(y="+",c&&c()):y="",x&&(s=s.slice(0,-x.length),x[x.length-1]===`
|
|
119
|
+
`&&(x=x.slice(0,-1)),x=x.replace(Tm,`$&${m}`));let S=!1,C,_=-1;for(C=0;C<s.length;++C){const U=s[C];if(U===" ")S=!0;else if(U===`
|
|
120
|
+
`)_=C;else break}let E=s.substring(0,_<C?_+1:C);E&&(s=s.substring(E.length),E=E.replace(/\n+/g,`$&${m}`));let z=(S?m?"2":"1":"")+y;if(e&&(z+=" "+f(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!b){const U=s.replace(/\n+/g,`
|
|
121
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);let O=!1;const M=Xu(a,!0);d!=="folded"&&t!==Re.BLOCK_FOLDED&&(M.onOverflow=()=>{O=!0});const A=Ju(`${E}${U}${x}`,m,Om,M);if(!O)return`>${z}
|
|
122
|
+
${m}${A}`}return s=s.replace(/\n+/g,`$&${m}`),`|${z}
|
|
123
|
+
${m}${E}${s}${x}`}function C5(e,t,s,a){const{type:r,value:c}=e,{actualString:d,implicitKey:f,indent:p,indentStep:m,inFlow:b}=t;if(f&&c.includes(`
|
|
124
|
+
`)||b&&/[[\]{},]/.test(c))return Nr(c,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return f||b||!c.includes(`
|
|
125
|
+
`)?Nr(c,t):iu(e,t,s,a);if(!f&&!b&&r!==Re.PLAIN&&c.includes(`
|
|
126
|
+
`))return iu(e,t,s,a);if(Wu(c)){if(p==="")return t.forceBlockIndent=!0,iu(e,t,s,a);if(f&&p===m)return Nr(c,t)}const y=c.replace(/\n+/g,`$&
|
|
127
|
+
${p}`);if(d){const v=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(y),{compat:x,tags:j}=t.doc.schema;if(j.some(v)||x?.some(v))return Nr(c,t)}return f?y:Ju(y,p,S1,Xu(t,!1))}function Ap(e,t,s,a){const{implicitKey:r,inFlow:c}=t,d=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:f}=e;f!==Re.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(f=Re.QUOTE_DOUBLE);const p=b=>{switch(b){case Re.BLOCK_FOLDED:case Re.BLOCK_LITERAL:return r||c?Nr(d.value,t):iu(d,t,s,a);case Re.QUOTE_DOUBLE:return Fo(d.value,t);case Re.QUOTE_SINGLE:return Am(d.value,t);case Re.PLAIN:return C5(d,t,s,a);default:return null}};let m=p(f);if(m===null){const{defaultKeyType:b,defaultStringType:y}=t.options,v=r&&b||y;if(m=p(v),m===null)throw new Error(`Unsupported default string type ${v}`)}return m}function w1(e,t){const s=Object.assign({blockQuote:!0,commentString:j5,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 _5(e,t){if(t.tag){const r=e.filter(c=>c.tag===t.tag);if(r.length>0)return r.find(c=>c.format===t.format)??r[0]}let s,a;if(ut(t)){a=t.value;let r=e.filter(c=>c.identify?.(a));if(r.length>1){const c=r.filter(d=>d.test);c.length>0&&(r=c)}s=r.find(c=>c.format===t.format)??r.find(c=>!c.format)}else a=t,s=e.find(r=>r.nodeClass&&a instanceof r.nodeClass);if(!s){const r=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${r} value`)}return s}function k5(e,t,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],c=(ut(e)||At(e))&&e.anchor;c&&g1(c)&&(s.add(c),r.push(`&${c}`));const d=e.tag??(t.default?null:t.tag);return d&&r.push(a.directives.tagString(d)),r.join(" ")}function Tr(e,t,s,a){if(Dt(e))return e.toString(t,s,a);if(za(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const c=Tt(e)?e:t.doc.createNode(e,{onTagObj:p=>r=p});r??(r=_5(t.doc.schema.tags,c));const d=k5(c,r,t);d.length>0&&(t.indentAtStart=(t.indentAtStart??0)+d.length+1);const f=typeof r.stringify=="function"?r.stringify(c,t,s,a):ut(c)?Ap(c,t,s,a):c.toString(t,s,a);return d?ut(c)||f[0]==="{"||f[0]==="["?`${d} ${f}`:`${d}
|
|
128
|
+
${t.indent}${f}`:f}function z5({key:e,value:t},s,a,r){const{allNullValues:c,doc:d,indent:f,indentStep:p,options:{commentString:m,indentSeq:b,simpleKeys:y}}=s;let v=Tt(e)&&e.comment||null;if(y){if(v)throw new Error("With simple keys, key nodes cannot have comments");if(At(e)||!Tt(e)&&typeof e=="object"){const M="With simple keys, collection cannot be used as a key value";throw new Error(M)}}let x=!y&&(!e||v&&t==null&&!s.inFlow||At(e)||(ut(e)?e.type===Re.BLOCK_FOLDED||e.type===Re.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!x&&(y||!c),indent:f+p});let j=!1,S=!1,C=Tr(e,s,()=>j=!0,()=>S=!0);if(!x&&!s.inFlow&&C.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");x=!0}if(s.inFlow){if(c||t==null)return j&&a&&a(),C===""?"?":x?`? ${C}`:C}else if(c&&!y||t==null&&x)return C=`? ${C}`,v&&!j?C+=ma(C,s.indent,m(v)):S&&r&&r(),C;j&&(v=null),x?(v&&(C+=ma(C,s.indent,m(v))),C=`? ${C}
|
|
129
|
+
${f}:`):(C=`${C}:`,v&&(C+=ma(C,s.indent,m(v))));let _,E,R;Tt(t)?(_=!!t.spaceBefore,E=t.commentBefore,R=t.comment):(_=!1,E=null,R=null,t&&typeof t=="object"&&(t=d.createNode(t))),s.implicitKey=!1,!x&&!v&&ut(t)&&(s.indentAtStart=C.length+1),S=!1,!b&&p.length>=2&&!s.inFlow&&!x&&ul(t)&&!t.flow&&!t.tag&&!t.anchor&&(s.indent=s.indent.substring(2));let z=!1;const U=Tr(t,s,()=>z=!0,()=>S=!0);let O=" ";if(v||_||E){if(O=_?`
|
|
130
|
+
`:"",E){const M=m(E);O+=`
|
|
131
|
+
${qs(M,s.indent)}`}U===""&&!s.inFlow?O===`
|
|
132
|
+
`&&R&&(O=`
|
|
133
|
+
|
|
134
|
+
`):O+=`
|
|
135
|
+
${s.indent}`}else if(!x&&At(t)){const M=U[0],A=U.indexOf(`
|
|
136
|
+
`),B=A!==-1,ie=s.inFlow??t.flow??t.items.length===0;if(B||!ie){let Q=!1;if(B&&(M==="&"||M==="!")){let ne=U.indexOf(" ");M==="&"&&ne!==-1&&ne<A&&U[ne+1]==="!"&&(ne=U.indexOf(" ",ne+1)),(ne===-1||A<ne)&&(Q=!0)}Q||(O=`
|
|
137
|
+
${s.indent}`)}}else(U===""||U[0]===`
|
|
138
|
+
`)&&(O="");return C+=O+U,s.inFlow?z&&a&&a():R&&!z?C+=ma(C,s.indent,m(R)):S&&r&&r(),C}function E5(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Zc="<<",Hs={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:j1}),stringify:()=>Zc},R5=(e,t)=>(Hs.identify(t)||ut(t)&&(!t.type||t.type===Re.PLAIN)&&Hs.identify(t.value))&&e?.doc.schema.tags.some(s=>s.tag===Hs.tag&&s.default);function j1(e,t,s){if(s=e&&za(s)?s.resolve(e.doc):s,ul(s))for(const a of s.items)Kh(e,t,a);else if(Array.isArray(s))for(const a of s)Kh(e,t,a);else Kh(e,t,s)}function Kh(e,t,s){const a=e&&za(s)?s.resolve(e.doc):s;if(!cl(a))throw new Error("Merge sources must be maps or map aliases");const r=a.toJSON(null,e,Map);for(const[c,d]of r)t instanceof Map?t.has(c)||t.set(c,d):t instanceof Set?t.add(c):Object.prototype.hasOwnProperty.call(t,c)||Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0});return t}function N1(e,t,{key:s,value:a}){if(Tt(s)&&s.addToJSMap)s.addToJSMap(e,t,a);else if(R5(e,s))j1(e,t,a);else{const r=Zn(s,"",e);if(t instanceof Map)t.set(r,Zn(a,r,e));else if(t instanceof Set)t.add(r);else{const c=O5(s,r,e),d=Zn(a,c,e);c in t?Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):t[c]=d}}return t}function O5(e,t,s){if(t===null)return"";if(typeof t!="object")return String(t);if(Tt(e)&&s?.doc){const a=w1(s.doc,{});a.anchors=new Set;for(const c of s.anchors.keys())a.anchors.add(c.anchor);a.inFlow=!0,a.inStringifyKey=!0;const r=e.toString(a);if(!s.mapKeyWarned){let c=JSON.stringify(r);c.length>40&&(c=c.substring(0,36)+'..."'),E5(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Tp(e,t,s){const a=sl(e,void 0,s),r=sl(t,void 0,s);return new dn(a,r)}class dn{constructor(t,s=null){Object.defineProperty(this,Fn,{value:m1}),this.key=t,this.value=s}clone(t){let{key:s,value:a}=this;return Tt(s)&&(s=s.clone(t)),Tt(a)&&(a=a.clone(t)),new dn(s,a)}toJSON(t,s){const a=s?.mapAsMap?new Map:{};return N1(s,a,this)}toString(t,s,a){return t?.doc?z5(this,t,s,a):JSON.stringify(this)}}function C1(e,t,s){return(t.inFlow??e.flow?T5:A5)(e,t,s)}function A5({comment:e,items:t},s,{blockItemPrefix:a,flowChars:r,itemIndent:c,onChompKeep:d,onComment:f}){const{indent:p,options:{commentString:m}}=s,b=Object.assign({},s,{indent:c,type:null});let y=!1;const v=[];for(let j=0;j<t.length;++j){const S=t[j];let C=null;if(Tt(S))!y&&S.spaceBefore&&v.push(""),zu(s,v,S.commentBefore,y),S.comment&&(C=S.comment);else if(Dt(S)){const E=Tt(S.key)?S.key:null;E&&(!y&&E.spaceBefore&&v.push(""),zu(s,v,E.commentBefore,y))}y=!1;let _=Tr(S,b,()=>C=null,()=>y=!0);C&&(_+=ma(_,c,m(C))),y&&C&&(y=!1),v.push(a+_)}let x;if(v.length===0)x=r.start+r.end;else{x=v[0];for(let j=1;j<v.length;++j){const S=v[j];x+=S?`
|
|
139
|
+
${p}${S}`:`
|
|
140
|
+
`}}return e?(x+=`
|
|
141
|
+
`+qs(m(e),p),f&&f()):y&&d&&d(),x}function T5({items:e},t,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:c,flowCollectionPadding:d,options:{commentString:f}}=t;a+=c;const p=Object.assign({},t,{indent:a,inFlow:!0,type:null});let m=!1,b=0;const y=[];for(let j=0;j<e.length;++j){const S=e[j];let C=null;if(Tt(S))S.spaceBefore&&y.push(""),zu(t,y,S.commentBefore,!1),S.comment&&(C=S.comment);else if(Dt(S)){const E=Tt(S.key)?S.key:null;E&&(E.spaceBefore&&y.push(""),zu(t,y,E.commentBefore,!1),E.comment&&(m=!0));const R=Tt(S.value)?S.value:null;R?(R.comment&&(C=R.comment),R.commentBefore&&(m=!0)):S.value==null&&E?.comment&&(C=E.comment)}C&&(m=!0);let _=Tr(S,p,()=>C=null);j<e.length-1&&(_+=","),C&&(_+=ma(_,a,f(C))),!m&&(y.length>b||_.includes(`
|
|
142
|
+
`))&&(m=!0),y.push(_),b=y.length}const{start:v,end:x}=s;if(y.length===0)return v+x;if(!m){const j=y.reduce((S,C)=>S+C.length+2,2);m=t.options.lineWidth>0&&j>t.options.lineWidth}if(m){let j=v;for(const S of y)j+=S?`
|
|
143
|
+
${c}${r}${S}`:`
|
|
144
|
+
`;return`${j}
|
|
145
|
+
${r}${x}`}else return`${v}${d}${y.join(" ")}${d}${x}`}function zu({indent:e,options:{commentString:t}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const c=qs(t(a),e);s.push(c.trimStart())}}function pa(e,t){const s=ut(t)?t.value:t;for(const a of e)if(Dt(a)&&(a.key===t||a.key===s||ut(a.key)&&a.key.value===s))return a}class Hn extends x1{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Di,t),this.items=[]}static from(t,s,a){const{keepUndefined:r,replacer:c}=a,d=new this(t),f=(p,m)=>{if(typeof c=="function")m=c.call(s,p,m);else if(Array.isArray(c)&&!c.includes(p))return;(m!==void 0||r)&&d.items.push(Tp(p,m,a))};if(s instanceof Map)for(const[p,m]of s)f(p,m);else if(s&&typeof s=="object")for(const p of Object.keys(s))f(p,s[p]);return typeof t.sortMapEntries=="function"&&d.items.sort(t.sortMapEntries),d}add(t,s){let a;Dt(t)?a=t:!t||typeof t!="object"||!("key"in t)?a=new dn(t,t?.value):a=new dn(t.key,t.value);const r=pa(this.items,a.key),c=this.schema?.sortMapEntries;if(r){if(!s)throw new Error(`Key ${a.key} already set`);ut(r.value)&&b1(a.value)?r.value.value=a.value:r.value=a.value}else if(c){const d=this.items.findIndex(f=>c(a,f)<0);d===-1?this.items.push(a):this.items.splice(d,0,a)}else this.items.push(a)}delete(t){const s=pa(this.items,t);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(t,s){const r=pa(this.items,t)?.value;return(!s&&ut(r)?r.value:r)??void 0}has(t){return!!pa(this.items,t)}set(t,s){this.add(new dn(t,s),!0)}toJSON(t,s,a){const r=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(r);for(const c of this.items)N1(s,r,c);return r}toString(t,s,a){if(!t)return JSON.stringify(this);for(const r of this.items)if(!Dt(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),C1(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:a,onComment:s})}}const Ir={collection:"map",default:!0,nodeClass:Hn,tag:"tag:yaml.org,2002:map",resolve(e,t){return cl(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,s)=>Hn.from(e,t,s)};class wa extends x1{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ur,t),this.items=[]}add(t){this.items.push(t)}delete(t){const s=Fc(t);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(t,s){const a=Fc(t);if(typeof a!="number")return;const r=this.items[a];return!s&&ut(r)?r.value:r}has(t){const s=Fc(t);return typeof s=="number"&&s<this.items.length}set(t,s){const a=Fc(t);if(typeof a!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[a];ut(r)&&b1(s)?r.value=s:this.items[a]=s}toJSON(t,s){const a=[];s?.onCreate&&s.onCreate(a);let r=0;for(const c of this.items)a.push(Zn(c,String(r++),s));return a}toString(t,s,a){return t?C1(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(t,s,a){const{replacer:r}=a,c=new this(t);if(s&&Symbol.iterator in Object(s)){let d=0;for(let f of s){if(typeof r=="function"){const p=s instanceof Set?f:String(d++);f=r.call(s,p,f)}c.items.push(sl(f,void 0,a))}}return c}}function Fc(e){let t=ut(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const $r={collection:"seq",default:!0,nodeClass:wa,tag:"tag:yaml.org,2002:seq",resolve(e,t){return ul(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,s)=>wa.from(e,t,s)},ed={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,s,a){return t=Object.assign({actualString:!0},t),Ap(e,t,s,a)}},td={identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Re(null),stringify:({source:e},t)=>typeof e=="string"&&td.test.test(e)?e:t.options.nullStr},Dp={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&&Dp.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 rs({format:e,minFractionDigits:t,tag:s,value:a}){if(typeof a=="bigint")return String(a);const r=typeof a=="number"?a:Number(a);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let c=Object.is(a,-0)?"-0":JSON.stringify(a);if(!e&&t&&(!s||s==="tag:yaml.org,2002:float")&&/^\d/.test(c)){let d=c.indexOf(".");d<0&&(d=c.length,c+=".");let f=t-(c.length-d-1);for(;f-- >0;)c+="0"}return c}const _1={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:rs},k1={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():rs(e)}},z1={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:rs},nd=e=>typeof e=="bigint"||Number.isInteger(e),Lp=(e,t,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),s);function E1(e,t,s){const{value:a}=e;return nd(a)&&a>=0?s+a.toString(t):rs(e)}const R1={identify:e=>nd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Lp(e,2,8,s),stringify:e=>E1(e,8,"0o")},O1={identify:nd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Lp(e,0,10,s),stringify:rs},A1={identify:e=>nd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Lp(e,2,16,s),stringify:e=>E1(e,16,"0x")},D5=[Ir,$r,ed,td,Dp,R1,O1,A1,_1,k1,z1];function Cx(e){return typeof e=="bigint"||Number.isInteger(e)}const Gc=({value:e})=>JSON.stringify(e),L5=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Gc},{identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Gc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Gc},{identify:Cx,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})=>Cx(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:Gc}],M5={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},U5=[Ir,$r].concat(L5,M5),Mp={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let r=0;r<s.length;++r)a[r]=s.charCodeAt(r);return a}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},a,r,c){if(!s)return"";const d=s;let f;if(typeof btoa=="function"){let p="";for(let m=0;m<d.length;++m)p+=String.fromCharCode(d[m]);f=btoa(p)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Re.BLOCK_LITERAL),t!==Re.QUOTE_DOUBLE){const p=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),m=Math.ceil(f.length/p),b=new Array(m);for(let y=0,v=0;y<m;++y,v+=p)b[y]=f.substr(v,p);f=b.join(t===Re.BLOCK_LITERAL?`
|
|
146
|
+
`:" ")}return Ap({comment:e,type:t,value:f},a,r,c)}};function T1(e,t){if(ul(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!Dt(a)){if(cl(a)){a.items.length>1&&t("Each pair must have its own sequence indicator");const r=a.items[0]||new dn(new Re(null));if(a.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${a.commentBefore}
|
|
147
|
+
${r.key.commentBefore}`:a.commentBefore),a.comment){const c=r.value??r.key;c.comment=c.comment?`${a.comment}
|
|
148
|
+
${c.comment}`:a.comment}a=r}e.items[s]=Dt(a)?a:new dn(a)}}else t("Expected a sequence for this tag");return e}function D1(e,t,s){const{replacer:a}=s,r=new wa(e);r.tag="tag:yaml.org,2002:pairs";let c=0;if(t&&Symbol.iterator in Object(t))for(let d of t){typeof a=="function"&&(d=a.call(t,String(c++),d));let f,p;if(Array.isArray(d))if(d.length===2)f=d[0],p=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const m=Object.keys(d);if(m.length===1)f=m[0],p=d[f];else throw new TypeError(`Expected tuple with one key, not ${m.length} keys`)}else f=d;r.items.push(Tp(f,p,s))}return r}const Up={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:T1,createNode:D1};class zr extends wa{constructor(){super(),this.add=Hn.prototype.add.bind(this),this.delete=Hn.prototype.delete.bind(this),this.get=Hn.prototype.get.bind(this),this.has=Hn.prototype.has.bind(this),this.set=Hn.prototype.set.bind(this),this.tag=zr.tag}toJSON(t,s){if(!s)return super.toJSON(t);const a=new Map;s?.onCreate&&s.onCreate(a);for(const r of this.items){let c,d;if(Dt(r)?(c=Zn(r.key,"",s),d=Zn(r.value,c,s)):c=Zn(r,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,d)}return a}static from(t,s,a){const r=D1(t,s,a),c=new this;return c.items=r.items,c}}zr.tag="tag:yaml.org,2002:omap";const Pp={collection:"seq",identify:e=>e instanceof Map,nodeClass:zr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=T1(e,t),a=[];for(const{key:r}of s.items)ut(r)&&(a.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):a.push(r.value));return Object.assign(new zr,s)},createNode:(e,t,s)=>zr.from(e,t,s)};function L1({value:e,source:t},s){return t&&(e?M1:U1).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const M1={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:L1},U1={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:L1},P5={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:rs},I5={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():rs(e)}},$5={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:rs},dl=e=>typeof e=="bigint"||Number.isInteger(e);function sd(e,t,s,{intAsBigInt:a}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),a){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const d=BigInt(e);return r==="-"?BigInt(-1)*d:d}const c=parseInt(e,s);return r==="-"?-1*c:c}function Ip(e,t,s){const{value:a}=e;if(dl(a)){const r=a.toString(t);return a<0?"-"+s+r.substr(1):s+r}return rs(e)}const B5={identify:dl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>sd(e,2,2,s),stringify:e=>Ip(e,2,"0b")},q5={identify:dl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>sd(e,1,8,s),stringify:e=>Ip(e,8,"0")},H5={identify:dl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>sd(e,0,10,s),stringify:rs},Z5={identify:dl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>sd(e,2,16,s),stringify:e=>Ip(e,16,"0x")};class Er extends Hn{constructor(t){super(t),this.tag=Er.tag}add(t){let s;Dt(t)?s=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?s=new dn(t.key,null):s=new dn(t,null),pa(this.items,s.key)||this.items.push(s)}get(t,s){const a=pa(this.items,t);return!s&&Dt(a)?ut(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=pa(this.items,t);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new dn(t))}toJSON(t,s){return super.toJSON(t,s,Set)}toString(t,s,a){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),s,a);throw new Error("Set items must all have null values")}static from(t,s,a){const{replacer:r}=a,c=new this(t);if(s&&Symbol.iterator in Object(s))for(let d of s)typeof r=="function"&&(d=r.call(s,d,d)),c.items.push(Tp(d,null,a));return c}}Er.tag="tag:yaml.org,2002:set";const $p={collection:"map",identify:e=>e instanceof Set,nodeClass:Er,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>Er.from(e,t,s),resolve(e,t){if(cl(e)){if(e.hasAllNullValues(!0))return Object.assign(new Er,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Bp(e,t){const s=e[0],a=s==="-"||s==="+"?e.substring(1):e,r=d=>t?BigInt(d):Number(d),c=a.replace(/_/g,"").split(":").reduce((d,f)=>d*r(60)+r(f),r(0));return s==="-"?r(-1)*c:c}function P1(e){let{value:t}=e,s=d=>d;if(typeof t=="bigint")s=d=>BigInt(d);else if(isNaN(t)||!isFinite(t))return rs(e);let a="";t<0&&(a="-",t*=s(-1));const r=s(60),c=[t%r];return t<60?c.unshift(0):(t=(t-c[0])/r,c.unshift(t%r),t>=60&&(t=(t-c[0])/r,c.unshift(t))),a+c.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const I1={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})=>Bp(e,s),stringify:P1},$1={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=>Bp(e,!1),stringify:P1},id={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(id.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,r,c,d,f]=t.map(Number),p=t[7]?Number((t[7]+"00").substr(1,3)):0;let m=Date.UTC(s,a-1,r,c||0,d||0,f||0,p);const b=t[8];if(b&&b!=="Z"){let y=Bp(b,!1);Math.abs(y)<30&&(y*=60),m-=6e4*y}return new Date(m)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},_x=[Ir,$r,ed,td,M1,U1,B5,q5,H5,Z5,P5,I5,$5,Mp,Hs,Pp,Up,$p,I1,$1,id],kx=new Map([["core",D5],["failsafe",[Ir,$r,ed]],["json",U5],["yaml11",_x],["yaml-1.1",_x]]),zx={binary:Mp,bool:Dp,float:z1,floatExp:k1,floatNaN:_1,floatTime:$1,int:O1,intHex:A1,intOct:R1,intTime:I1,map:Ir,merge:Hs,null:td,omap:Pp,pairs:Up,seq:$r,set:$p,timestamp:id},F5={"tag:yaml.org,2002:binary":Mp,"tag:yaml.org,2002:merge":Hs,"tag:yaml.org,2002:omap":Pp,"tag:yaml.org,2002:pairs":Up,"tag:yaml.org,2002:set":$p,"tag:yaml.org,2002:timestamp":id};function Vh(e,t,s){const a=kx.get(t);if(a&&!e)return s&&!a.includes(Hs)?a.concat(Hs):a.slice();let r=a;if(!r)if(Array.isArray(e))r=[];else{const c=Array.from(kx.keys()).filter(d=>d!=="yaml11").map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)r=r.concat(c);else typeof e=="function"&&(r=e(r.slice()));return s&&(r=r.concat(Hs)),r.reduce((c,d)=>{const f=typeof d=="string"?zx[d]:d;if(!f){const p=JSON.stringify(d),m=Object.keys(zx).map(b=>JSON.stringify(b)).join(", ");throw new Error(`Unknown custom tag ${p}; use one of ${m}`)}return c.includes(f)||c.push(f),c},[])}const G5=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class qp{constructor({compat:t,customTags:s,merge:a,resolveKnownTags:r,schema:c,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(t)?Vh(t,"compat"):t?Vh(null,t):null,this.name=typeof c=="string"&&c||"core",this.knownTags=r?F5:{},this.tags=Vh(s,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,Di,{value:Ir}),Object.defineProperty(this,vs,{value:ed}),Object.defineProperty(this,Ur,{value:$r}),this.sortMapEntries=typeof d=="function"?d:d===!0?G5:null}clone(){const t=Object.create(qp.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function K5(e,t){const s=[];let a=t.directives===!0;if(t.directives!==!1&&e.directives){const p=e.directives.toString(e);p?(s.push(p),a=!0):e.directives.docStart&&(a=!0)}a&&s.push("---");const r=w1(e,t),{commentString:c}=r.options;if(e.commentBefore){s.length!==1&&s.unshift("");const p=c(e.commentBefore);s.unshift(qs(p,""))}let d=!1,f=null;if(e.contents){if(Tt(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const b=c(e.contents.commentBefore);s.push(qs(b,""))}r.forceBlockIndent=!!e.comment,f=e.contents.comment}const p=f?void 0:()=>d=!0;let m=Tr(e.contents,r,()=>f=null,p);f&&(m+=ma(m,"",c(f))),(m[0]==="|"||m[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${m}`:s.push(m)}else s.push(Tr(e.contents,r));if(e.directives?.docEnd)if(e.comment){const p=c(e.comment);p.includes(`
|
|
149
|
+
`)?(s.push("..."),s.push(qs(p,""))):s.push(`... ${p}`)}else s.push("...");else{let p=e.comment;p&&d&&(p=p.replace(/^\n+/,"")),p&&((!d||f)&&s[s.length-1]!==""&&s.push(""),s.push(qs(c(p),"")))}return s.join(`
|
|
150
|
+
`)+`
|
|
151
|
+
`}class ad{constructor(t,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Fn,{value:Rm});let r=null;typeof s=="function"||Array.isArray(s)?r=s:a===void 0&&s&&(a=s,s=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=c;let{version:d}=c;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(d=this.directives.yaml.version)):this.directives=new cn({version:d}),this.setSchema(d,a),this.contents=t===void 0?null:this.createNode(t,r,a)}clone(){const t=Object.create(ad.prototype,{[Fn]:{value:Rm}});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=Tt(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){gr(this.contents)&&this.contents.add(t)}addIn(t,s){gr(this.contents)&&this.contents.addIn(t,s)}createAlias(t,s){if(!t.anchor){const a=y1(this);t.anchor=!s||a.has(s)?v1(s||"a",a):s}return new Op(t.anchor)}createNode(t,s,a){let r;if(typeof s=="function")t=s.call({"":t},"",t),r=s;else if(Array.isArray(s)){const C=E=>typeof E=="number"||E instanceof String||E instanceof Number,_=s.filter(C).map(String);_.length>0&&(s=s.concat(_)),r=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:f,keepUndefined:p,onTagObj:m,tag:b}=a??{},{onAnchor:y,setAnchors:v,sourceObjects:x}=x5(this,d||"a"),j={aliasDuplicateObjects:c??!0,keepUndefined:p??!1,onAnchor:y,onTagObj:m,replacer:r,schema:this.schema,sourceObjects:x},S=sl(t,b,j);return f&&At(S)&&(S.flow=!0),v(),S}createPair(t,s,a={}){const r=this.createNode(t,null,a),c=this.createNode(s,null,a);return new dn(r,c)}delete(t){return gr(this.contents)?this.contents.delete(t):!1}deleteIn(t){return $o(t)?this.contents==null?!1:(this.contents=null,!0):gr(this.contents)?this.contents.deleteIn(t):!1}get(t,s){return At(this.contents)?this.contents.get(t,s):void 0}getIn(t,s){return $o(t)?!s&&ut(this.contents)?this.contents.value:this.contents:At(this.contents)?this.contents.getIn(t,s):void 0}has(t){return At(this.contents)?this.contents.has(t):!1}hasIn(t){return $o(t)?this.contents!==void 0:At(this.contents)?this.contents.hasIn(t):!1}set(t,s){this.contents==null?this.contents=ku(this.schema,[t],s):gr(this.contents)&&this.contents.set(t,s)}setIn(t,s){$o(t)?this.contents=s:this.contents==null?this.contents=ku(this.schema,Array.from(t),s):gr(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 cn({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 cn({version:t}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new qp(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:s,mapAsMap:a,maxAliasCount:r,onAnchor:c,reviver:d}={}){const f={anchors:new Map,doc:this,keep:!t,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},p=Zn(this.contents,s??"",f);if(typeof c=="function")for(const{count:m,res:b}of f.anchors.values())c(b,m);return typeof d=="function"?jr(d,{"":p},"",p):p}toJSON(t,s){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:s})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const s=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return K5(this,t)}}function gr(e){if(At(e))return!0;throw new Error("Expected a YAML collection as document contents")}class B1 extends Error{constructor(t,s,a,r){super(),this.name=t,this.code=a,this.message=r,this.pos=s}}class Kc extends B1{constructor(t,s,a){super("YAMLParseError",t,s,a)}}class V5 extends B1{constructor(t,s,a){super("YAMLWarning",t,s,a)}}const Ex=(e,t)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(f=>t.linePos(f));const{line:a,col:r}=s.linePos[0];s.message+=` at line ${a}, column ${r}`;let c=r-1,d=e.substring(t.lineStarts[a-1],t.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&d.length>80){const f=Math.min(c-39,d.length-79);d="…"+d.substring(f),c-=f-1}if(d.length>80&&(d=d.substring(0,79)+"…"),a>1&&/^ *$/.test(d.substring(0,c))){let f=e.substring(t.lineStarts[a-2],t.lineStarts[a-1]);f.length>80&&(f=f.substring(0,79)+`…
|
|
152
|
+
`),d=f+d}if(/[^ ]/.test(d)){let f=1;const p=s.linePos[1];p?.line===a&&p.col>r&&(f=Math.max(1,Math.min(p.col-r,80-c)));const m=" ".repeat(c)+"^".repeat(f);s.message+=`:
|
|
153
|
+
|
|
154
|
+
${d}
|
|
155
|
+
${m}
|
|
156
|
+
`}};function Dr(e,{flow:t,indicator:s,next:a,offset:r,onError:c,parentIndent:d,startOnNewline:f}){let p=!1,m=f,b=f,y="",v="",x=!1,j=!1,S=null,C=null,_=null,E=null,R=null,z=null,U=null;for(const A of e)switch(j&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&c(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),j=!1),S&&(m&&A.type!=="comment"&&A.type!=="newline"&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),A.type){case"space":!t&&(s!=="doc-start"||a?.type!=="flow-collection")&&A.source.includes(" ")&&(S=A),b=!0;break;case"comment":{b||c(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const B=A.source.substring(1)||" ";y?y+=v+B:y=B,v="",m=!1;break}case"newline":m?y?y+=A.source:(!z||s!=="seq-item-ind")&&(p=!0):v+=A.source,m=!0,x=!0,(C||_)&&(E=A),b=!0;break;case"anchor":C&&c(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&c(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),C=A,U??(U=A.offset),m=!1,b=!1,j=!0;break;case"tag":{_&&c(A,"MULTIPLE_TAGS","A node can have at most one tag"),_=A,U??(U=A.offset),m=!1,b=!1,j=!0;break}case s:(C||_)&&c(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),z&&c(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${t??"collection"}`),z=A,m=s==="seq-item-ind"||s==="explicit-key-ind",b=!1;break;case"comma":if(t){R&&c(A,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),R=A,m=!1,b=!1;break}default:c(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),m=!1,b=!1}const O=e[e.length-1],M=O?O.offset+O.source.length:r;return j&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&c(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(m&&S.indent<=d||a?.type==="block-map"||a?.type==="block-seq")&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:R,found:z,spaceBefore:p,comment:y,hasNewline:x,anchor:C,tag:_,newlineAfterProp:E,end:M,start:U??M}}function il(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(il(t.key)||il(t.value))return!0}return!1;default:return!0}}function Dm(e,t,s){if(t?.type==="flow-collection"){const a=t.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&il(t)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function q1(e,t,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const r=typeof a=="function"?a:(c,d)=>c===d||ut(c)&&ut(d)&&c.value===d.value;return t.some(c=>r(c.key,s))}const Rx="All mapping items must start at the same column";function Q5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Hn,f=new d(s.schema);s.atRoot&&(s.atRoot=!1);let p=a.offset,m=null;for(const b of a.items){const{start:y,key:v,sep:x,value:j}=b,S=Dr(y,{indicator:"explicit-key-ind",next:v??x?.[0],offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0}),C=!S.found;if(C){if(v&&(v.type==="block-seq"?r(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==a.indent&&r(p,"BAD_INDENT",Rx)),!S.anchor&&!S.tag&&!x){m=S.end,S.comment&&(f.comment?f.comment+=`
|
|
158
|
+
`+S.comment:f.comment=S.comment);continue}(S.newlineAfterProp||il(v))&&r(v??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==a.indent&&r(p,"BAD_INDENT",Rx);s.atKey=!0;const _=S.end,E=v?e(s,v,S,r):t(s,_,y,null,S,r);s.schema.compat&&Dm(a.indent,v,r),s.atKey=!1,q1(s,f.items,E)&&r(_,"DUPLICATE_KEY","Map keys must be unique");const R=Dr(x??[],{indicator:"map-value-ind",next:j,offset:E.range[2],onError:r,parentIndent:a.indent,startOnNewline:!v||v.type==="block-scalar"});if(p=R.end,R.found){C&&(j?.type==="block-map"&&!R.hasNewline&&r(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&S.start<R.found.offset-1024&&r(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const z=j?e(s,j,R,r):t(s,p,x,null,R,r);s.schema.compat&&Dm(a.indent,j,r),p=z.range[2];const U=new dn(E,z);s.options.keepSourceTokens&&(U.srcToken=b),f.items.push(U)}else{C&&r(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),R.comment&&(E.comment?E.comment+=`
|
|
159
|
+
`+R.comment:E.comment=R.comment);const z=new dn(E);s.options.keepSourceTokens&&(z.srcToken=b),f.items.push(z)}}return m&&m<p&&r(m,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,p,m??p],f}function Y5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??wa,f=new d(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let p=a.offset,m=null;for(const{start:b,value:y}of a.items){const v=Dr(b,{indicator:"seq-item-ind",next:y,offset:p,onError:r,parentIndent:a.indent,startOnNewline:!0});if(!v.found)if(v.anchor||v.tag||y)y?.type==="block-seq"?r(v.end,"BAD_INDENT","All sequence items must start at the same column"):r(p,"MISSING_CHAR","Sequence item without - indicator");else{m=v.end,v.comment&&(f.comment=v.comment);continue}const x=y?e(s,y,v,r):t(s,v.end,b,null,v,r);s.schema.compat&&Dm(a.indent,y,r),p=x.range[2],f.items.push(x)}return f.range=[a.offset,p,m??p],f}function fl(e,t,s,a){let r="";if(e){let c=!1,d="";for(const f of e){const{source:p,type:m}=f;switch(m){case"space":c=!0;break;case"comment":{s&&!c&&a(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const b=p.substring(1)||" ";r?r+=d+b:r=b,d="";break}case"newline":r&&(d+=p),c=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${m} at node end`)}t+=p.length}}return{comment:r,offset:t}}const Qh="Block collections are not allowed within flow collections",Yh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function J5({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=a.start.source==="{",f=d?"flow map":"flow sequence",p=c?.nodeClass??(d?Hn:wa),m=new p(s.schema);m.flow=!0;const b=s.atRoot;b&&(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 _=a.items[C],{start:E,key:R,sep:z,value:U}=_,O=Dr(E,{flow:f,indicator:"explicit-key-ind",next:R??z?.[0],offset:y,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!z&&!U){C===0&&O.comma?r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):C<a.items.length-1&&r(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),O.comment&&(m.comment?m.comment+=`
|
|
160
|
+
`+O.comment:m.comment=O.comment),y=O.end;continue}!d&&s.options.strict&&il(R)&&r(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)O.comma&&r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(O.comma||r(O.start,"MISSING_CHAR",`Missing , between ${f} items`),O.comment){let M="";e:for(const A of E)switch(A.type){case"comma":case"space":break;case"comment":M=A.source.substring(1);break e;default:break e}if(M){let A=m.items[m.items.length-1];Dt(A)&&(A=A.value??A.key),A.comment?A.comment+=`
|
|
161
|
+
`+M:A.comment=M,O.comment=O.comment.substring(M.length+1)}}if(!d&&!z&&!O.found){const M=U?e(s,U,O,r):t(s,O.end,z,null,O,r);m.items.push(M),y=M.range[2],Yh(U)&&r(M.range,"BLOCK_IN_FLOW",Qh)}else{s.atKey=!0;const M=O.end,A=R?e(s,R,O,r):t(s,M,E,null,O,r);Yh(R)&&r(A.range,"BLOCK_IN_FLOW",Qh),s.atKey=!1;const B=Dr(z??[],{flow:f,indicator:"map-value-ind",next:U,offset:A.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(B.found){if(!d&&!O.found&&s.options.strict){if(z)for(const ne of z){if(ne===B.found)break;if(ne.type==="newline"){r(ne,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}O.start<B.found.offset-1024&&r(B.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else U&&("source"in U&&U.source?.[0]===":"?r(U,"MISSING_CHAR",`Missing space after : in ${f}`):r(B.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const ie=U?e(s,U,B,r):B.found?t(s,B.end,z,null,B,r):null;ie?Yh(U)&&r(ie.range,"BLOCK_IN_FLOW",Qh):B.comment&&(A.comment?A.comment+=`
|
|
162
|
+
`+B.comment:A.comment=B.comment);const Q=new dn(A,ie);if(s.options.keepSourceTokens&&(Q.srcToken=_),d){const ne=m;q1(s,ne.items,A)&&r(M,"DUPLICATE_KEY","Map keys must be unique"),ne.items.push(Q)}else{const ne=new Hn(s.schema);ne.flow=!0,ne.items.push(Q);const me=(ie??A).range;ne.range=[A.range[0],me[1],me[2]],m.items.push(ne)}y=ie?ie.range[2]:B.end}}const v=d?"}":"]",[x,...j]=a.end;let S=y;if(x?.source===v)S=x.offset+x.source.length;else{const C=f[0].toUpperCase()+f.substring(1),_=b?`${C} must end with a ${v}`:`${C} in block collection must be sufficiently indented and end with a ${v}`;r(y,b?"MISSING_CHAR":"BAD_INDENT",_),x&&x.source.length!==1&&j.unshift(x)}if(j.length>0){const C=fl(j,S,s.options.strict,r);C.comment&&(m.comment?m.comment+=`
|
|
163
|
+
`+C.comment:m.comment=C.comment),m.range=[a.offset,S,C.offset]}else m.range=[a.offset,S,S];return m}function Jh(e,t,s,a,r,c){const d=s.type==="block-map"?Q5(e,t,s,a,c):s.type==="block-seq"?Y5(e,t,s,a,c):J5(e,t,s,a,c),f=d.constructor;return r==="!"||r===f.tagName?(d.tag=f.tagName,d):(r&&(d.tag=r),d)}function X5(e,t,s,a,r){const c=a.tag,d=c?t.directives.tagName(c.source,v=>r(c,"TAG_RESOLVE_FAILED",v)):null;if(s.type==="block-seq"){const{anchor:v,newlineAfterProp:x}=a,j=v&&c?v.offset>c.offset?v:c:v??c;j&&(!x||x.offset<j.offset)&&r(j,"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===Hn.tagName&&f==="map"||d===wa.tagName&&f==="seq")return Jh(e,t,s,r,d);let p=t.schema.tags.find(v=>v.tag===d&&v.collection===f);if(!p){const v=t.schema.knownTags[d];if(v?.collection===f)t.schema.tags.push(Object.assign({},v,{default:!1})),p=v;else return v?r(c,"BAD_COLLECTION_TYPE",`${v.tag} used for ${f} collection, but expects ${v.collection??"scalar"}`,!0):r(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),Jh(e,t,s,r,d)}const m=Jh(e,t,s,r,d,p),b=p.resolve?.(m,v=>r(c,"TAG_RESOLVE_FAILED",v),t.options)??m,y=Tt(b)?b:new Re(b);return y.range=m.range,y.tag=d,p?.format&&(y.format=p.format),y}function W5(e,t,s){const a=t.offset,r=e4(t,e.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const c=r.mode===">"?Re.BLOCK_FOLDED:Re.BLOCK_LITERAL,d=t.source?t4(t.source):[];let f=d.length;for(let S=d.length-1;S>=0;--S){const C=d[S][1];if(C===""||C==="\r")f=S;else break}if(f===0){const S=r.chomp==="+"&&d.length>0?`
|
|
164
|
+
`.repeat(Math.max(1,d.length-1)):"";let C=a+r.length;return t.source&&(C+=t.source.length),{value:S,type:c,comment:r.comment,range:[a,C,C]}}let p=t.indent+r.indent,m=t.offset+r.length,b=0;for(let S=0;S<f;++S){const[C,_]=d[S];if(_===""||_==="\r")r.indent===0&&C.length>p&&(p=C.length);else{C.length<p&&s(m+C.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(p=C.length),b=S,p===0&&!e.atRoot&&s(m,"BAD_INDENT","Block scalar values in collections must be indented");break}m+=C.length+_.length+1}for(let S=d.length-1;S>=f;--S)d[S][0].length>p&&(f=S+1);let y="",v="",x=!1;for(let S=0;S<b;++S)y+=d[S][0].slice(p)+`
|
|
165
|
+
`;for(let S=b;S<f;++S){let[C,_]=d[S];m+=C.length+_.length+1;const E=_[_.length-1]==="\r";if(E&&(_=_.slice(0,-1)),_&&C.length<p){const z=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(m-_.length-(E?2:1),"BAD_INDENT",z),C=""}c===Re.BLOCK_LITERAL?(y+=v+C.slice(p)+_,v=`
|
|
166
|
+
`):C.length>p||_[0]===" "?(v===" "?v=`
|
|
167
|
+
`:!x&&v===`
|
|
168
|
+
`&&(v=`
|
|
169
|
+
|
|
170
|
+
`),y+=v+C.slice(p)+_,v=`
|
|
171
|
+
`,x=!0):_===""?v===`
|
|
172
|
+
`?y+=`
|
|
173
|
+
`:v=`
|
|
174
|
+
`:(y+=v+_,v=" ",x=!1)}switch(r.chomp){case"-":break;case"+":for(let S=f;S<d.length;++S)y+=`
|
|
175
|
+
`+d[S][0].slice(p);y[y.length-1]!==`
|
|
176
|
+
`&&(y+=`
|
|
177
|
+
`);break;default:y+=`
|
|
178
|
+
`}const j=a+r.length+t.source.length;return{value:y,type:c,comment:r.comment,range:[a,j,j]}}function e4({offset:e,props:t},s,a){if(t[0].type!=="block-scalar-header")return a(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],c=r[0];let d=0,f="",p=-1;for(let v=1;v<r.length;++v){const x=r[v];if(!f&&(x==="-"||x==="+"))f=x;else{const j=Number(x);!d&&j?d=j:p===-1&&(p=e+v)}}p!==-1&&a(p,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let m=!1,b="",y=r.length;for(let v=1;v<t.length;++v){const x=t[v];switch(x.type){case"space":m=!0;case"newline":y+=x.source.length;break;case"comment":s&&!m&&a(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),y+=x.source.length,b=x.source.substring(1);break;case"error":a(x,"UNEXPECTED_TOKEN",x.message),y+=x.source.length;break;default:{const j=`Unexpected token in block scalar header: ${x.type}`;a(x,"UNEXPECTED_TOKEN",j);const S=x.source;S&&typeof S=="string"&&(y+=S.length)}}}return{mode:c,indent:d,chomp:f,comment:b,length:y}}function t4(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 n4(e,t,s){const{offset:a,type:r,source:c,end:d}=e;let f,p;const m=(v,x,j)=>s(a+v,x,j);switch(r){case"scalar":f=Re.PLAIN,p=s4(c,m);break;case"single-quoted-scalar":f=Re.QUOTE_SINGLE,p=i4(c,m);break;case"double-quoted-scalar":f=Re.QUOTE_DOUBLE,p=a4(c,m);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const b=a+c.length,y=fl(d,b,t,s);return{value:p,type:f,comment:y.comment,range:[a,b,y.offset]}}function s4(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}`),H1(e)}function i4(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),H1(e.slice(1,-1)).replace(/''/g,"'")}function H1(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 r=a[1],c=" ",d=t.lastIndex;for(s.lastIndex=d;a=s.exec(e);)a[1]===""?c===`
|
|
181
|
+
`?r+=c:c=`
|
|
182
|
+
`:(r+=c+a[1],c=" "),d=s.lastIndex;const f=/[ \t]*(.*)/sy;return f.lastIndex=d,a=f.exec(e),r+c+(a?.[1]??"")}function a4(e,t){let s="";for(let a=1;a<e.length-1;++a){const r=e[a];if(!(r==="\r"&&e[a+1]===`
|
|
183
|
+
`))if(r===`
|
|
184
|
+
`){const{fold:c,offset:d}=r4(e,a);s+=c,a=d}else if(r==="\\"){let c=e[++a];const d=o4[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+=l4(e,a+1,f,t),a+=f}else{const f=e.substr(a-1,2);t(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),s+=f}}else if(r===" "||r===" "){const c=a;let d=e[a+1];for(;d===" "||d===" ";)d=e[++a+1];d!==`
|
|
187
|
+
`&&!(d==="\r"&&e[a+2]===`
|
|
188
|
+
`)&&(s+=a>c?e.slice(c,a+1):r)}else s+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function r4(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 o4={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
193
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function l4(e,t,s,a){const r=e.substr(t,s),d=r.length===s&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(d)){const f=e.substr(t-2,s+2);return a(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),f}return String.fromCodePoint(d)}function Z1(e,t,s,a){const{value:r,type:c,comment:d,range:f}=t.type==="block-scalar"?W5(e,t,a):n4(t,e.options.strict,a),p=s?e.directives.tagName(s.source,y=>a(s,"TAG_RESOLVE_FAILED",y)):null;let m;e.options.stringKeys&&e.atKey?m=e.schema[vs]:p?m=c4(e.schema,r,p,s,a):t.type==="scalar"?m=u4(e,r,t,a):m=e.schema[vs];let b;try{const y=m.resolve(r,v=>a(s??t,"TAG_RESOLVE_FAILED",v),e.options);b=ut(y)?y:new Re(y)}catch(y){const v=y instanceof Error?y.message:String(y);a(s??t,"TAG_RESOLVE_FAILED",v),b=new Re(r)}return b.range=f,b.source=r,c&&(b.type=c),p&&(b.tag=p),m.format&&(b.format=m.format),d&&(b.comment=d),b}function c4(e,t,s,a,r){if(s==="!")return e[vs];const c=[];for(const f of e.tags)if(!f.collection&&f.tag===s)if(f.default&&f.test)c.push(f);else return f;for(const f of c)if(f.test?.test(t))return f;const d=e.knownTags[s];return d&&!d.collection?(e.tags.push(Object.assign({},d,{default:!1,test:void 0})),d):(r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[vs])}function u4({atKey:e,directives:t,schema:s},a,r,c){const d=s.tags.find(f=>(f.default===!0||e&&f.default==="key")&&f.test?.test(a))||s[vs];if(s.compat){const f=s.compat.find(p=>p.default&&p.test?.test(a))??s[vs];if(d.tag!==f.tag){const p=t.tagString(d.tag),m=t.tagString(f.tag),b=`Value may be parsed as either ${p} or ${m}`;c(r,"TAG_RESOLVE_FAILED",b,!0)}}return d}function d4(e,t,s){if(t){s??(s=t.length);for(let a=s-1;a>=0;--a){let r=t[a];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++a];r?.type==="space";)e+=r.source.length,r=t[++a];break}}return e}const f4={composeNode:F1,composeEmptyNode:Hp};function F1(e,t,s,a){const r=e.atKey,{spaceBefore:c,comment:d,anchor:f,tag:p}=s;let m,b=!0;switch(t.type){case"alias":m=h4(e,t,a),(f||p)&&a(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":m=Z1(e,t,p,a),f&&(m.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":m=X5(f4,e,t,s,a),f&&(m.anchor=f.source.substring(1));break;default:{const y=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;a(t,"UNEXPECTED_TOKEN",y),m=Hp(e,t.offset,void 0,null,s,a),b=!1}}return f&&m.anchor===""&&a(f,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ut(m)||typeof m.value!="string"||m.tag&&m.tag!=="tag:yaml.org,2002:str")&&a(p??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(m.spaceBefore=!0),d&&(t.type==="scalar"&&t.source===""?m.comment=d:m.commentBefore=d),e.options.keepSourceTokens&&b&&(m.srcToken=t),m}function Hp(e,t,s,a,{spaceBefore:r,comment:c,anchor:d,tag:f,end:p},m){const b={type:"scalar",offset:d4(t,s,a),indent:-1,source:""},y=Z1(e,b,f,m);return d&&(y.anchor=d.source.substring(1),y.anchor===""&&m(d,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(y.spaceBefore=!0),c&&(y.comment=c,y.range[2]=p),y}function h4({options:e},{offset:t,source:s,end:a},r){const c=new Op(s.substring(1));c.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&r(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=t+s.length,f=fl(a,d,e.strict,r);return c.range=[t,d,f.offset],f.comment&&(c.comment=f.comment),c}function m4(e,t,{offset:s,start:a,value:r,end:c},d){const f=Object.assign({_directives:t},e),p=new ad(void 0,f),m={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},b=Dr(a,{indicator:"doc-start",next:r??c?.[0],offset:s,onError:d,parentIndent:0,startOnNewline:!0});b.found&&(p.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!b.hasNewline&&d(b.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=r?F1(m,r,b,d):Hp(m,b.end,a,null,b,d);const y=p.contents.range[2],v=fl(c,y,!1,d);return v.comment&&(p.comment=v.comment),p.range=[s,y,v.offset],p}function Po(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 Ox(e){let t="",s=!1,a=!1;for(let r=0;r<e.length;++r){const c=e[r];switch(c[0]){case"#":t+=(t===""?"":a?`
|
|
194
|
+
|
|
195
|
+
`:`
|
|
196
|
+
`)+(c.substring(1)||" "),s=!0,a=!1;break;case"%":e[r+1]?.[0]!=="#"&&(r+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:t,afterEmptyLine:a}}class p4{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,c)=>{const d=Po(s);c?this.warnings.push(new V5(d,a,r)):this.errors.push(new Kc(d,a,r))},this.directives=new cn({version:t.version||"1.2"}),this.options=t}decorate(t,s){const{comment:a,afterEmptyLine:r}=Ox(this.prelude);if(a){const c=t.contents;if(s)t.comment=t.comment?`${t.comment}
|
|
197
|
+
${a}`:a;else if(r||t.directives.docStart||!c)t.commentBefore=a;else if(At(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:Ox(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,s=!1,a=-1){for(const r of t)yield*this.next(r);yield*this.end(s,a)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(s,a,r)=>{const c=Po(t);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const s=m4(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 Kc(Po(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 Kc(Po(t),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=fl(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 Kc(Po(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const a=Object.assign({_directives:this.directives},this.options),r=new ad(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,s,s],this.decorate(r,!1),yield r}}}const G1="\uFEFF",K1="",V1="",Lm="";function g4(e){switch(e){case G1:return"byte-order-mark";case K1:return"doc-mode";case V1:return"flow-error-end";case Lm: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 es(e){switch(e){case void 0:case" ":case`
|
|
203
|
+
`:case"\r":case" ":return!0;default:return!1}}const Ax=new Set("0123456789ABCDEFabcdef"),y4=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Vc=new Set(",[]{}"),v4=new Set(` ,[]{}
|
|
204
|
+
\r `),Xh=e=>!e||v4.has(e);class b4{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 r=this.buffer[a+t+1];if(r===`
|
|
207
|
+
`||!r&&!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==="...")&&es(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]===G1&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let s=t.length,a=t.indexOf("#");for(;a!==-1;){const c=t[a-1];if(c===" "||c===" "){s=a-1;break}else a=t.indexOf("#",a+1)}for(;;){const c=t[s-1];if(c===" "||c===" ")s-=1;else break}const r=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-s),yield*this.pushNewline(),"stream"}return yield K1,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==="...")&&es(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&&!es(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===":")&&es(s)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(t[s]){case"#":yield*this.pushCount(t.length-s);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Xh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,s,a=-1;do t=yield*this.pushNewline(),t>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(t+s>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&r[0]!=="#"||a===0&&(r.startsWith("---")||r.startsWith("..."))&&es(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield V1,yield*this.parseLineStart();let c=0;for(;r[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),r[c]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-c),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Xh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||es(d)||d===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let s=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let c=0;for(;this.buffer[s-1-c]==="\\";)c+=1;if(c%2===0)break;s=this.buffer.indexOf('"',s+1)}const a=this.buffer.substring(0,s);let r=a.indexOf(`
|
|
210
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){const c=this.continueScalar(r+1);if(c===-1)break;r=a.indexOf(`
|
|
211
|
+
`,c)}r!==-1&&(s=r-(a[r-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const s=this.buffer[++t];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*this.pushUntil(s=>es(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 r=t+1;for(a=this.buffer[r];a===" ";)a=this.buffer[++r];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
|
|
215
|
+
`;)a=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let c=t-1,d=this.buffer[c];d==="\r"&&(d=this.buffer[--c]);const f=c;for(;d===" ";)d=this.buffer[--c];if(d===`
|
|
216
|
+
`&&c>=this.pos&&c+1+s>f)t=c;else break}while(!0);return yield Lm,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,r;for(;r=this.buffer[++a];)if(r===":"){const c=this.buffer[a+1];if(es(c)||t&&Vc.has(c))break;s=a}else if(es(r)){let c=this.buffer[a+1];if(r==="\r"&&(c===`
|
|
217
|
+
`?(a+=1,r=`
|
|
218
|
+
`,c=this.buffer[a+1]):s=a),c==="#"||t&&Vc.has(c))break;if(r===`
|
|
219
|
+
`){const d=this.continueScalar(a+1);if(d===-1)break;a=Math.max(a,d-2)}}else{if(t&&Vc.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Lm,yield*this.pushToIndex(s+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,s){const a=this.buffer.slice(this.pos,t);return a?(yield a,this.pos+=a.length,a.length):(s&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Xh))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(es(s)||t&&Vc.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(;!es(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(y4.has(s))s=this.buffer[++t];else if(s==="%"&&Ax.has(this.buffer[t+1])&&Ax.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 r=s-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=s),r}*pushUntil(t){let s=this.pos,a=this.buffer[s];for(;!t(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class x4{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let s=0,a=this.lineStarts.length;for(;s<a;){const c=s+a>>1;this.lineStarts[c]<t?s=c+1:a=c}if(this.lineStarts[s]===t)return{line:s+1,col:1};if(s===0)return{line:0,col:t};const r=this.lineStarts[s-1];return{line:s,col:t-r+1}}}}function Ci(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function Tx(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 Q1(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 Qc(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 yr(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 Dx(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Ci(t.start,"explicit-key-ind")&&!Ci(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Q1(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 S4{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 b4,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=g4(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"&&Dx(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const r=a.items[a.items.length-1];if(r.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=s;else{Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=a.items[a.items.length-1];r.value?a.items.push({start:[],value:s}):r.value=s;break}case"flow-collection":{const r=a.items[a.items.length-1];!r||r.value?a.items.push({start:[],key:s,sep:[]}):r.sep?r.value=s:Object.assign(r,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const r=s.items[s.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Tx(r.start)===-1&&(s.indent===0||r.start.every(c=>c.type!=="comment"||c.indent<s.indent))&&(a.type==="document"?a.end=r.start:a.items.push({start:r.start}),s.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Tx(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=Qc(this.peek(2)),a=yr(s);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let s=this.source.indexOf(`
|
|
222
|
+
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
223
|
+
`,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const a=!this.onKeyLine&&this.indent===t.indent,r=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(r&&s.sep&&!s.value){const d=[];for(let f=0;f<s.sep.length;++f){const p=s.sep[f];switch(p.type){case"newline":d.push(f);break;case"space":break;case"comment":p.indent>t.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(c=s.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(c.push(this.sourceToken),t.items.push({start:c}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):r||s.value?(c.push(this.sourceToken),t.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(s.explicitKey)if(s.sep)if(s.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ci(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(Q1(s.key)&&!Ci(s.sep,"newline")){const d=yr(s.start),f=s.key,p=s.sep;p.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:f,sep:p}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(Ci(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const d=yr(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?t.items.push({start:c,key:null,sep:[this.sourceToken]}):Ci(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);r||s.value?(t.items.push({start:c,key:d,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(d):(Object.assign(s,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(t);if(d){if(d.type==="block-seq"){if(!s.explicitKey&&s.sep&&!Ci(s.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&t.items.push({start:c});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=t.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;s.value||Ci(s.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>t.indent){const a=this.startBlockValue(t);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const s=t.items[t.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while(a?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?t.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!s||s.value?t.items.push({start:[],key:r,sep:[]}):s.sep?this.stack.push(r):Object.assign(s,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const a=this.startBlockValue(t);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===t.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const r=Qc(a),c=yr(r);Dx(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=Qc(t),a=yr(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=Qc(t),a=yr(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 w4(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new x4||null,prettyErrors:t}}function j4(e,t={}){const{lineCounter:s,prettyErrors:a}=w4(t),r=new S4(s?.addNewLine),c=new p4(t),d=Array.from(c.compose(r.parse(e)));if(a&&s)for(const f of d)f.errors.forEach(Ex(e,s)),f.warnings.forEach(Ex(e,s));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function N4({onApplied:e}){const[t,s]=N.useState(""),[a,r]=N.useState(!1),[c,d]=N.useState([]),[f,p]=N.useState([]),m=async()=>{if(!t.trim())return;r(!0),d([]),p([]);const b=j4(t),y=[],v=[];for(let x=0;x<b.length;x++){const j=b[x];if(j.errors.length>0){y.push(`Document ${x+1}: ${j.errors[0]?.message}`);continue}const S=j.toJSON();if(!(!S||typeof S!="object"))try{const C=await Rj(S);v.push(`Applied "${C.displayName||C.name}" (revision ${C.configRevision})`)}catch(C){y.push(`Document ${x+1}: ${C instanceof Error?C.message:String(C)}`)}}d(v),p(y),r(!1),v.length>0&&e()};return l.jsxs("section",{className:"mt-8",children:[l.jsx("div",{className:"page-section-divider"}),l.jsx("div",{className:"section-head mt-6",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),l.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),l.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",l.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",l.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),l.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
|
|
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:b=>s(b.target.value)}),c.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:c.map((b,y)=>l.jsx("li",{className:"text-emerald-400 text-sm",children:b},y))}),f.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:f.map((b,y)=>l.jsx("li",{className:"text-rose-400 text-sm",children:b},y))}),l.jsx("div",{className:"mt-3",children:l.jsx(le,{type:"button",disabled:!t.trim()||a,onClick:m,children:a?"Applying...":"Apply"})})]})}function C4(){const{dashboard:e,refetch:t}=ka(),s=e?.projects??[],a=ja(),[r,c]=N.useState(!1),[d,f]=N.useState(""),[p,m]=N.useState(""),[b,y]=N.useState(""),[v,x]=N.useState("US"),[j,S]=N.useState("en"),[C,_]=N.useState(!1),[E,R]=N.useState(null),z=d.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),U=async()=>{if(!(!z||!b)){_(!0),R(null);try{const O=await rl(z,{displayName:p||d,canonicalDomain:b,country:v,language:j});t(),f(""),m(""),y(""),x("US"),S("en"),c(!1),a({to:"/projects/$projectId",params:{projectId:O.id}})}catch(O){R(O instanceof Error?O.message:"Failed to create project")}finally{_(!1)}}};return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Projects"}),l.jsxs("p",{className:"page-subtitle",children:[s.length," project",s.length!==1?"s":""," tracked"]})]}),l.jsx("div",{className:"page-header-right",children:l.jsxs(le,{type:"button",onClick:()=>c(O=>!O),children:[l.jsx(kb,{className:"size-4 mr-1.5"}),"Add project"]})})]}),r?l.jsxs(He,{className:"surface-card mb-6",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),l.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),l.jsxs("div",{className:"compact-stack mt-4",children:[l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),l.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:d,onChange:O=>f(O.target.value)}),z&&z!==d?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",z]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),l.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:p,onChange:O=>m(O.target.value)})]})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),l.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:b,onChange:O=>y(O.target.value)})]}),l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),l.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:O=>x(O.target.value.toUpperCase())})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),l.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:j,onChange:O=>S(O.target.value.toLowerCase())})]})]})]}),E?l.jsx("p",{className:"text-rose-400 text-sm mt-3",children:E}):null,l.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[l.jsx(le,{type:"button",disabled:!z||!b||C,onClick:U,children:C?"Creating...":"Create project"}),l.jsx(le,{type:"button",variant:"ghost",onClick:()=>c(!1),children:"Cancel"})]})]}):null,s.length>0?l.jsx("div",{className:"data-table-wrapper",children:l.jsxs("table",{className:"data-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Name"}),l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Visibility"}),l.jsx("th",{children:"Last run"}),l.jsx("th",{className:"text-right",children:"Country"})]})}),l.jsx("tbody",{children:s.map(O=>{const M=O.recentRuns[0];return l.jsxs("tr",{className:"cursor-pointer",onClick:()=>a({to:"/projects/$projectId",params:{projectId:O.project.id}}),children:[l.jsxs("td",{children:[l.jsx(gt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:A=>A.stopPropagation(),children:O.project.displayName||O.project.name}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:O.project.name})]}),l.jsx("td",{className:"text-zinc-400",children:O.project.canonicalDomain}),l.jsx("td",{children:l.jsx(ot,{tone:O.visibilitySummary.tone,children:O.visibilitySummary.value})}),l.jsx("td",{className:"text-zinc-500 text-sm",children:M?l.jsx(Pu,{status:M.status}):l.jsx("span",{className:"text-zinc-600",children:"No runs"})}),l.jsx("td",{className:"text-right text-zinc-500",children:O.project.country})]},O.project.id)})})]})}):r?null:l.jsxs(He,{className:"surface-card empty-card",children:[l.jsx("h3",{children:"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),l.jsxs(le,{type:"button",onClick:()=>c(!0),children:[l.jsx(kb,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(N4,{onApplied:()=>{t()}})]})}function Go({text:e}){return l.jsxs("span",{className:"info-tooltip-wrapper",children:[l.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),l.jsx("span",{className:"info-tooltip-bubble",role:"tooltip",children:e})]})}function Y1({run:e}){const{openRun:t}=ll();return l.jsxs("article",{className:"run-row",children:[l.jsxs("div",{className:"run-row-main",children:[l.jsxs("div",{className:"run-row-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:e.summary}),l.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),l.jsx(Pu,{status:e.status})]}),l.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),l.jsxs("dl",{className:"run-row-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Started"}),l.jsx("dd",{children:e.startedAt})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Duration"}),l.jsx("dd",{children:e.duration})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Trigger"}),l.jsx("dd",{children:e.triggerLabel})]})]}),l.jsx(le,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function au({value:e,label:t,delta:s,tone:a,description:r,tooltip:c,isNumeric:d=!0}){const m=2*Math.PI*48,b=Number.parseInt(e,10),y=d&&!Number.isNaN(b)?Math.min(b/100,1):.5,v=m*(1-y);return l.jsxs("div",{className:"score-gauge",children:[l.jsxs("div",{className:"gauge-ring-wrapper",children:[l.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[l.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),l.jsx("circle",{className:`gauge-fill gauge-fill-${a}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:v,transform:"rotate(-90 60 60)"})]}),l.jsx("div",{className:"gauge-center",children:l.jsx("span",{className:d?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),l.jsxs("p",{className:"gauge-label",children:[t,c&&l.jsx(Go,{text:c})]}),l.jsx("p",{className:"gauge-delta",children:s}),l.jsx("p",{className:"gauge-description",children:r})]})}function Lx({history:e,maxDots:t=12}){const s=e.slice(-t);if(s.length===0)return l.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const a={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},r=new Date(s[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),c=new Date(s[s.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:r}),l.jsx("div",{className:"flex items-center gap-[3px]",title:`${s.length} runs`,children:s.map((d,f)=>l.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${a[d.citationState]??"bg-zinc-700"} ${d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[d.citationState,new Date(d.createdAt).toLocaleDateString(),d.model?`model ${d.model}`:null,d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"model changed":null].filter(Boolean).join(" — ")},f))}),l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:c})]})}function _4(e){const t=new Map;for(const a of e)for(const r of a.runHistory){const c=t.get(r.createdAt);c?c.states.push(r.citationState):t.set(r.createdAt,{states:[r.citationState],runId:r.runId})}return[...t.entries()].sort(([a],[r])=>a.localeCompare(r)).map(([a,{states:r,runId:c}])=>({runId:c,createdAt:a,citationState:r.includes("cited")?"cited":r.includes("emerging")?"emerging":"not-cited"}))}function k4({evidence:e}){const{openEvidence:t}=ll(),[s,a]=N.useState(new Set),r=N.useMemo(()=>{const d=new Map;for(const f of e){const p=d.get(f.keyword)??[];d.set(f.keyword,[...p,f])}return[...d.entries()].map(([f,p])=>({phrase:f,items:p}))},[e]),c=d=>{a(f=>{const p=new Set(f);return p.has(d)?p.delete(d):p.add(d),p})};return l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{style:{width:"2rem"}}),l.jsx("th",{children:"Key Phrase"}),l.jsx("th",{children:"Status"}),l.jsx("th",{children:"Citation History"}),l.jsx("th",{children:"Change"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:r.map(({phrase:d,items:f})=>{const p=s.has(d),m=f.map(j=>j.citationState),b=m.includes("cited")?"cited":m.includes("emerging")?"emerging":m.includes("lost")?"lost":m.every(j=>j==="pending")?"pending":"not-cited",y=_4(f),v=f.filter(j=>j.citationState==="cited"||j.citationState==="emerging").length,x=(()=>{if(y.length===0)return"Awaiting first run";if(y.length===1)return"First observation";const j=y[y.length-1].citationState,S=y[y.length-2].citationState;if(S!=="cited"&&j==="cited")return"Newly cited";if(S==="cited"&&j!=="cited")return"Lost since last run";let C=0;for(let _=y.length-1;_>=0&&y[_].citationState===j;_--)C++;return j==="cited"?C<=1?"Cited in latest run":`Cited for ${C} runs`:C<=1?"Not cited in latest run":`Not cited across ${C} runs`})();return l.jsxs(N.Fragment,{children:[l.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(d),"aria-expanded":p,children:[l.jsx("td",{children:l.jsx(Lu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${p?"rotate-90":""}`})}),l.jsx("td",{className:"evidence-keyword-cell",children:l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-zinc-100",children:d}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(j=>l.jsx(Xo,{provider:j.provider},j.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(jm,{state:b}),l.jsxs("span",{className:"text-[11px] text-zinc-500",children:[v,"/",f.length]})]})}),l.jsx("td",{children:l.jsx(Lx,{history:y})}),l.jsx("td",{className:"evidence-change-cell",children:x}),l.jsx("td",{})]}),p&&f.map(j=>l.jsxs("tr",{className:"bg-zinc-900/30",children:[l.jsx("td",{}),l.jsx("td",{className:"evidence-keyword-cell pl-5",children:l.jsx(Xo,{provider:j.provider})}),l.jsx("td",{children:l.jsx(jm,{state:j.citationState})}),l.jsx("td",{children:l.jsx(Lx,{history:j.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:j.changeLabel}),l.jsx("td",{children:l.jsx(le,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(j.id)},children:"View"})})]},j.id))]},d)})})]})})}function z4({competitors:e}){return e.length===0?l.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):l.jsx("div",{className:"competitor-table-wrap",children:l.jsxs("table",{className:"competitor-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Pressure"}),l.jsx("th",{children:"Citations"}),l.jsx("th",{children:"Key Phrases"})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),l.jsx("td",{children:l.jsx(ot,{tone:TE(t.pressureLabel),children:t.pressureLabel})}),l.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),l.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}const E4=["7d","30d","90d","all"],R4=["gap","cited","uncited"],J1={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 O4({projectName:e}){const[t,s]=N.useState("30d"),[a,r]=N.useState(null),[c,d]=N.useState(null),[f,p]=N.useState(null),[m,b]=N.useState(null),[y,v]=N.useState(!0);return N.useEffect(()=>{let x=!1;return v(!0),Promise.all([i1(e,t),a1(e,t),r1(e,t)]).then(([j,S,C])=>{x||(r(j),d(S),p(C),v(!1))}).catch(()=>{x||v(!1)}),()=>{x=!0}},[e,t]),y&&!a?l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):l.jsxs(l.Fragment,{children:[l.jsxs("section",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",l.jsx(Go,{text:"Citation rate over time across all runs within the selected window. Each data point represents the percentage of queries where your brand was cited by AI providers."})]})]}),l.jsx("div",{className:"flex gap-1",children:E4.map(x=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===x?"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(x),children:x==="all"?"All":x},x))})]}),a&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-6",children:[l.jsx(au,{value:`${Math.round(a.overall.citationRate*100)}`,label:"Citation Rate",delta:`${a.overall.cited} / ${a.overall.total}`,tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",description:`Trend: ${a.trend}`,isNumeric:!0}),l.jsxs("div",{className:"flex-1 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),l.jsx(ot,{tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",children:a.trend})]}),Object.keys(a.byProvider).length>0&&l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Cited / Total"})]})}),l.jsx("tbody",{children:Object.entries(a.byProvider).map(([x,j])=>l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-300",children:x}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(j.citationRate*100).toFixed(1),"%"]}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[j.cited," / ",j.total]})]},x))})]})]})]}),a.buckets.length>=1&&l.jsx(A4,{buckets:a.buckets})]})]}),l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsx("div",{className:"flex items-center justify-between mb-4",children:l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",l.jsx(Go,{text:"Classification based on the most recent completed run. Cited: your brand appeared in the AI answer. Gap: a competitor was cited but you were not. Not Cited: neither mentioned. Consistency shows how often each keyword was cited across all runs in the selected window."})]})]})}),c&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex gap-1 mb-4",children:R4.map(x=>{const j=x==="cited"?c.cited.length:x==="gap"?c.gap.length:c.uncited.length,S=m===x;return l.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?x==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":x==="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:()=>b(S?null:x),children:[x==="gap"?"Gap":x==="cited"?"Cited":"Not Cited"," (",j,")"]},x)})}),l.jsx(T4,{gaps:c,filter:m})]})]}),l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",l.jsx(Go,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),f&&f.overall.length>0&&l.jsxs("div",{className:"space-y-4",children:[l.jsx(D4,{categories:f.overall}),l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),l.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),l.jsx("tbody",{children:f.overall.map(x=>l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[l.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${J1[x.category]??"bg-zinc-600"}`}),x.label]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:x.count}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(x.percentage*100).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:x.topDomains.slice(0,3).map(j=>j.domain).join(", ")})]},x.category))})]})]}),f&&f.overall.length===0&&l.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function A4({buckets:e}){const[t,s]=N.useState(null),a=600,r=140,c={top:24,right:10,bottom:20,left:40},d=a-c.left-c.right,f=r-c.top-c.bottom,p=1,m=e.map((y,v)=>{const x=c.left+(e.length>1?v/(e.length-1)*d:d/2),j=c.top+f-y.citationRate/p*f;return{x,y:j}}),b=m.map(y=>`${y.x},${y.y}`).join(" ");return l.jsx("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:l.jsxs("svg",{viewBox:`0 0 ${a} ${r}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>s(null),children:[l.jsxs("text",{x:c.left-4,y:c.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),l.jsx("text",{x:c.left-4,y:c.top+f+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),l.jsx("line",{x1:c.left,y1:c.top+f,x2:c.left+d,y2:c.top+f,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),l.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:b}),t!==null&&l.jsx("line",{x1:m[t].x,y1:c.top,x2:m[t].x,y2:c.top+f,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((y,v)=>{const{x,y:j}=m[v],S=t===v;return l.jsxs("g",{children:[l.jsx("circle",{cx:x,cy:j,r:"10",fill:"transparent",onMouseEnter:()=>s(v),style:{cursor:"pointer"}}),l.jsx("circle",{cx:x,cy:j,r:S?5:3,className:S?"fill-emerald-400":"fill-emerald-500"})]},v)}),t!==null&&(()=>{const y=e[t],{x:v,y:x}=m[t],j=`${(y.citationRate*100).toFixed(1)}%`,S=y.startDate.slice(5,10),C=56,_=30,E=Math.max(c.left,Math.min(v-C/2,a-c.right-C)),R=x-_-8;return l.jsxs("g",{children:[l.jsx("rect",{x:E,y:R,width:C,height:_,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),l.jsx("text",{x:E+C/2,y:R+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:j}),l.jsx("text",{x:E+C/2,y:R+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:S})]})})(),e.map((y,v)=>({b:y,i:v})).filter(({i:y})=>y===0||y===e.length-1||e.length<=7).map(({b:y,i:v})=>{const x=m[v].x;return l.jsx("text",{x,y:r-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:y.startDate.slice(5,10)},v)})]})})}function T4({gaps:e,filter:t}){const s=N.useMemo(()=>{const a=[...e.gap.map(r=>({...r,_sort:0})),...e.cited.map(r=>({...r,_sort:1})),...e.uncited.map(r=>({...r,_sort:2}))];return t?a.filter(r=>r.category===t):a.sort((r,c)=>r._sort-c._sort)},[e,t]);return s.length===0?l.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No keywords found",t?` with status "${t}"`:"","."]}):l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),l.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),l.jsx("th",{className:"text-left py-1 font-medium",children:"Providers Citing"}),l.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),l.jsx("tbody",{children:s.map(a=>{const r=a.category==="cited"?"positive":a.category==="gap"?"caution":"neutral";return l.jsxs("tr",{className:`border-t border-zinc-800/40 ${a.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[l.jsx("td",{className:"py-1.5 text-zinc-200",children:a.keyword}),l.jsx("td",{className:"py-1.5",children:l.jsx(ot,{tone:r,children:a.category==="gap"?"Gap":a.category==="cited"?"Cited":"Not Cited"})}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.providers.length>0?a.providers.join(", "):"—"}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.competitorsCiting.length>0?a.competitorsCiting.join(", "):"—"}),l.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:a.consistency.totalRuns>0?`${a.consistency.citedRuns}/${a.consistency.totalRuns} runs`:"—"})]},a.keywordId)})})]})}function D4({categories:e}){const t=e.reduce((s,a)=>s+a.count,0);return t===0?null:l.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(s=>{const a=s.count/t*100;return a<.5?null:l.jsx("div",{className:`${J1[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function L4({projectName:e}){const[t,s]=N.useState(!1),[a,r]=N.useState([]),[c,d]=N.useState([]),[f,p]=N.useState([]),[m,b]=N.useState([]),[y,v]=N.useState([]),[x,j]=N.useState(null),[S,C]=N.useState(""),[_,E]=N.useState(""),[R,z]=N.useState("30"),[U,O]=N.useState(!1),[M,A]=N.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[B,ie]=N.useState(""),[Q,ne]=N.useState(!0),[me,ze]=N.useState(!1),[we,q]=N.useState(!1),[T,ae]=N.useState(!1),[pe,ee]=N.useState(!1),[L,G]=N.useState(!1),[se,re]=N.useState(!1),[ce,he]=N.useState(!1),[de,Fe]=N.useState(null),[ge,Je]=N.useState(!1),[mt,fe]=N.useState(!1),[Ye,dt]=N.useState(!1),[Wt,_t]=N.useState(!1),[nn,Kt]=N.useState(null),[kt,wt]=N.useState(""),[sn,oe]=N.useState(!1),[Ue,Pe]=N.useState(!1),[ke,Te]=N.useState("indexed"),[zt,Qn]=N.useState([]),[bs,Fs]=N.useState(null),[xs,Gs]=N.useState(!1),[os,Ce]=N.useState(null),[wn,te]=N.useState(null),Ie=a.find(I=>I.connectionType==="gsc"),od=f.length>0||m.length>0||y.length>0;async function hl(I){if(!I){d([]),C("");return}ae(!0);try{const{sites:ue}=await Dj(e);d(ue),C(I.propertyId??ue[0]?.siteUrl??"")}catch(ue){d([]),Ce(ue instanceof Error?ue.message:"Failed to load Search Console properties")}finally{ae(!1)}}async function Ks(){G(!0);try{const I=await Pj(e,{startDate:M.startDate||void 0,endDate:M.endDate||void 0,query:M.query||void 0,page:M.page||void 0,limit:parseInt(M.limit,10)||20});p(I)}catch(I){p([]),Ce(I instanceof Error?I.message:"Failed to load GSC performance data")}finally{G(!1)}}async function Ss(){re(!0);try{const[I,ue]=await Promise.all([$j(e,{url:B.trim()||void 0,limit:20}),Bj(e)]);b(I),v(ue)}catch(I){b([]),v([]),Ce(I instanceof Error?I.message:"Failed to load GSC inspection history")}finally{re(!1)}}async function qi(){Je(!0);try{const[I,ue]=await Promise.all([qj(e),Hj(e).catch(()=>[])]);Fe(I),Qn(ue)}catch(I){Fe(null),Qn([]),Ce(I instanceof Error?I.message:"Failed to load coverage data")}finally{Je(!1)}}async function ls(I){Gs(!0),Ce(null);try{const ue=await km(e,{urls:I}),{succeeded:tt,failed:Vt,total:Lt}=ue.summary;te(Vt===0?`Indexing requested for ${tt} URL${tt!==1?"s":""}.`:`Indexing requested: ${tt}/${Lt} succeeded, ${Vt} failed.`)}catch(ue){Ce(ue instanceof Error?ue.message:"Failed to request indexing")}finally{Gs(!1)}}async function Ea(){Gs(!0),Ce(null);try{const I=await km(e,{urls:[],allUnindexed:!0}),{succeeded:ue,failed:tt,total:Vt}=I.summary;te(tt===0?`Indexing requested for ${ue} unindexed URL${ue!==1?"s":""}.`:`Indexing requested: ${ue}/${Vt} succeeded, ${tt} failed.`)}catch(I){Ce(I instanceof Error?I.message:"Failed to request indexing")}finally{Gs(!1)}}async function cs(){if(kt.trim()){oe(!0),Ce(null);try{await Mj(e,"gsc",kt.trim()),r(I=>I.map(ue=>ue.connectionType==="gsc"?{...ue,sitemapUrl:kt.trim()}:ue)),te("Sitemap URL saved."),wt("")}catch(I){Ce(I instanceof Error?I.message:"Failed to save sitemap URL")}finally{oe(!1)}}}async function ml(){dt(!0),Ce(null);try{const I=await Gj(e);Kt(I.sitemaps),r(ue=>ue.map(tt=>tt.connectionType==="gsc"?{...tt,sitemapUrl:I.primarySitemapUrl}:tt)),te(`Discovered ${I.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${I.run.id}).`)}catch(I){Ce(I instanceof Error?I.message:"Failed to discover sitemaps")}finally{dt(!1)}}async function pl(){_t(!0),Ce(null);try{const I=await Fj(e);Kt(I.sitemaps),I.sitemaps.length===0&&te("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(I){Ce(I instanceof Error?I.message:"Failed to list sitemaps")}finally{_t(!1)}}async function Ra(){ne(!0),Ce(null);try{const[I,ue]=await Promise.all([Cp().catch(()=>null),Oj(e).catch(()=>[])]);s(!!I?.google?.configured),r(ue);const tt=ue.find(Vt=>Vt.connectionType==="gsc");await Promise.all([hl(tt),Ks(),Ss(),qi()])}finally{ne(!1)}}N.useEffect(()=>{Ra()},[e]);async function Hi(){if(!t){Ce("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ze(!0),Ce(null),te(null);try{const{authUrl:I}=await Aj(e,"gsc");if(!I.startsWith("https://accounts.google.com/")){Ce("Unexpected OAuth redirect URL. Please try again.");return}const ue=window.open(I,"_blank","width=600,height=700");if(!ue){window.location.assign(I);return}te("Finish the Google consent flow in the popup, then close it to refresh this project.");const tt=window.setInterval(()=>{ue.closed&&(window.clearInterval(tt),te(null),Ra())},1e3)}catch(I){Ce(I instanceof Error?I.message:"Failed to start OAuth flow")}finally{ze(!1)}}async function ld(){Ce(null),te(null);try{await Tj(e,"gsc"),r(I=>I.filter(ue=>ue.connectionType!=="gsc")),d([]),C("")}catch(I){Ce(I instanceof Error?I.message:"Failed to disconnect")}}async function gl(){if(S){ee(!0),Ce(null);try{await Lj(e,"gsc",S),r(I=>I.map(ue=>ue.connectionType==="gsc"?{...ue,propertyId:S}:ue)),te("GSC property updated.")}catch(I){Ce(I instanceof Error?I.message:"Failed to save GSC property")}finally{ee(!1)}}}async function yl(){q(!0),Ce(null),te(null);try{await Uj(e,{days:parseInt(R,10)||void 0,full:U||void 0}),te("GSC sync queued. Refresh after the run completes to see imported data.")}catch(I){Ce(I instanceof Error?I.message:"Failed to trigger sync")}finally{q(!1)}}async function Br(){if(_.trim()){he(!0),Ce(null),te(null);try{const I=await Ij(e,_.trim());j(I),E(""),await Ss()}catch(I){Ce(I instanceof Error?I.message:"Failed to inspect URL")}finally{he(!1)}}}return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),l.jsx("h2",{children:"Google Search Console"})]}),l.jsx("div",{className:"flex items-center gap-2",children:Ie&&l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:L,onClick:()=>{Ks()},children:L?"Refreshing…":"Refresh data"})})]}),os&&l.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[os,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Ce(null),children:"×"})]}),wn&&l.jsxs("div",{className:"mb-3 rounded-lg border border-emerald-800/40 bg-emerald-950/20 px-3 py-2 text-sm text-emerald-300",children:[wn,l.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>te(null),children:"×"})]}),Q?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs(He,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsx(ot,{tone:Ie?"positive":t?"caution":"negative",children:Ie?"Connected":t?"Ready to connect":"App credentials missing"})]}),Ie?l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),l.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),l.jsx("span",{className:"text-xs text-zinc-500",children:Ie.domain}),l.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:ld,children:"Disconnect"})]}),l.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",l.jsx("code",{children:Ie.domain}),"."]})]}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Ie.propertyId??"No property selected yet"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:br(Ie.updatedAt)})]})]})]}):l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[l.jsx("p",{className:"text-sm text-zinc-300",children:t?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),l.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:me,onClick:Hi,children:me?"Opening…":"Connect Google Search Console"}):l.jsx(le,{type:"button",variant:"outline",size:"sm",asChild:!0,children:l.jsx(gt,{to:"/settings",children:"Open Settings"})}),!t&&l.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),Ie&&!Ie.sitemapUrl&&l.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:"mt-0.5 text-amber-400",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5","aria-hidden":"true",children:l.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),l.jsx("p",{className:"mt-1 text-xs text-amber-400/70",children:"Canonry uses your sitemap to discover URLs for index coverage inspection. Auto-discover from GSC or enter it manually."}),l.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx(le,{type:"button",size:"sm",disabled:Ye||!Ie.propertyId,onClick:ml,children:Ye?"Discovering…":"Auto-discover from GSC"}),l.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-amber-800/40 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-500 focus:border-amber-600 focus:outline-none",type:"url",placeholder:"https://example.com/sitemap.xml",value:kt,onChange:I=>wt(I.target.value),onKeyDown:I=>I.key==="Enter"&&void cs()}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:sn||!kt.trim(),onClick:cs,children:sn?"Saving…":"Save sitemap URL"})]})]})]})]})}),(Ie||od)&&l.jsxs(l.Fragment,{children:[l.jsxs(He,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),l.jsx("h3",{children:"Index coverage"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[de&&de.notIndexed.length>0&&l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:xs,onClick:()=>{Ea()},children:xs?"Requesting…":`Request indexing (${de.notIndexed.length})`}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:ge,onClick:()=>{qi()},children:ge?"Loading…":"Refresh coverage"})]})]}),de&&de.summary.total>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const I=de.summary.indexed+de.summary.notIndexed,ue=I>0?de.summary.indexed/I:0,tt=I>0?de.summary.notIndexed/I:0,Vt=54,Lt=2*Math.PI*Vt,Et=Lt*(1-ue),jt=Lt*tt,jn=Lt*ue;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative h-48 w-48",children:[l.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[l.jsx("circle",{cx:"64",cy:"64",r:Vt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),l.jsx("circle",{cx:"64",cy:"64",r:Vt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Lt,strokeDashoffset:Et,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),de.summary.notIndexed>0&&l.jsx("circle",{cx:"64",cy:"64",r:Vt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${jt} ${Lt-jt}`,strokeDashoffset:-jn,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[l.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(ue*100).toFixed(0),"%"]}),l.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),l.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.indexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.notIndexed.toLocaleString()}),l.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(de.reasonGroups??[]).length>0&&l.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(de.reasonGroups??[]).length," ",(de.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),de.summary.deindexed>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.deindexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),l.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(I=>{const ue=I==="indexed"?de.indexed.length:I==="notIndexed"?de.notIndexed.length:de.deindexed.length,tt=I==="indexed"?"Indexed":I==="notIndexed"?"Not Indexed":"Deindexed";return l.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ke===I?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Te(I),Fs(null)},children:[tt," (",ue,")"]},I)})}),l.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ke==="indexed"&&de.indexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"text-left",children:"Mobile"})]})}),l.jsx("tbody",{children:de.indexed.map(I=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),l.jsx("td",{className:"text-zinc-400",children:I.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:I.crawlTime?I.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:I.isMobileFriendly===!0?"Yes":I.isMobileFriendly===!1?"No":"—"})]},I.id))})]}),ke==="notIndexed"&&!bs&&(de.reasonGroups??[]).length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Reason"}),l.jsx("th",{className:"text-right",children:"Pages"})]})}),l.jsx("tbody",{children:(de.reasonGroups??[]).map(I=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Fs(I.reason),children:[l.jsx("td",{className:"text-zinc-200",children:I.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.count})]},I.reason))})]}),ke==="notIndexed"&&!bs&&(de.reasonGroups??[]).length===0&&de.notIndexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing State"}),l.jsx("th",{className:"text-left",children:"Coverage"})]})}),l.jsx("tbody",{children:de.notIndexed.map(I=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),l.jsx("td",{className:"text-zinc-400",children:I.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:I.coverageState??"Unknown"})]},I.id))})]}),ke==="notIndexed"&&bs&&(()=>{const I=(de.reasonGroups??[]).find(ue=>ue.reason===bs);return I?l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-2 mb-3",children:l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Fs(null),children:"\\u2190 Back to reasons"})}),l.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:I.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[I.count," affected page",I.count!==1?"s":""]})]}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:xs,onClick:()=>{ls(I.urls.map(ue=>ue.url))},children:xs?"Requesting…":`Request indexing (${I.count})`})]}),l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"w-8"})]})}),l.jsx("tbody",{children:I.urls.map(ue=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:ue.url}),l.jsx("td",{className:"text-zinc-400",children:ue.crawlTime?ue.crawlTime.split("T")[0]:"—"}),l.jsx("td",{children:l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:xs,onClick:()=>{ls([ue.url])},title:"Request indexing",children:"Index"})})]},ue.id))})]})]}):null})(),ke==="deindexed"&&de.deindexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Detected"})]})}),l.jsx("tbody",{children:de.deindexed.map((I,ue)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),l.jsx("td",{className:"text-zinc-400",children:I.previousState}),l.jsx("td",{className:"text-zinc-400",children:I.currentState}),l.jsx("td",{className:"text-zinc-400",children:I.transitionDate.split("T")[0]})]},`${I.url}-${ue}`))})]}),(ke==="indexed"&&de.indexed.length===0||ke==="notIndexed"&&!bs&&de.notIndexed.length===0||ke==="deindexed"&&de.deindexed.length===0)&&l.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ge?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),l.jsxs(He,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),l.jsx("h3",{children:"Search performance"})]}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:L,onClick:()=>{Ks()},children:L?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const I=new Map;for(const $e of f){const nt=I.get($e.date);nt?(nt.clicks+=$e.clicks,nt.impressions+=$e.impressions):I.set($e.date,{clicks:$e.clicks,impressions:$e.impressions})}const ue=[...I.entries()].sort(([$e],[nt])=>$e.localeCompare(nt));if(ue.length===0)return null;const tt=Math.max(...ue.map(([,$e])=>$e.impressions),1),Vt=ue.reduce(($e,[,nt])=>$e+nt.clicks,0),Lt=ue.reduce(($e,[,nt])=>$e+nt.impressions,0),Et=Lt>0?(Vt/Lt*100).toFixed(1):"0.0",jt=700,jn=220,en={top:12,bottom:36,left:48,right:12},cd=jt-en.left-en.right,Vs=jn-en.top-en.bottom,Qs=cd/ue.length,us=Math.max(Math.min(Qs*.35,24),4),Oa=Math.max(us*.15,1),Ys=$e=>{if($e<=0)return 1;const nt=Math.pow(10,Math.floor(Math.log10($e))),Ht=$e/nt,an=Ht<=1.5?1.5:Ht<=3?3:Ht<=5?5:10;return Math.ceil(an*nt)},Yn=4,ds=Math.ceil(Ys(tt)/Yn)*Yn,Js=Array.from({length:Yn+1},($e,nt)=>ds/Yn*nt),Mt=$e=>$e>=1e3?`${($e/1e3).toFixed($e>=1e4?0:1)}k`:String($e);return l.jsxs("div",{className:"mt-3",children:[l.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",l.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Vt.toLocaleString()})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",l.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Lt.toLocaleString()})]})]}),l.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",l.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Et,"%"]})]})]}),l.jsx("div",{className:"relative w-full",style:{aspectRatio:`${jt} / ${jn}`},children:l.jsxs("svg",{viewBox:`0 0 ${jt} ${jn}`,className:"h-full w-full",children:[Js.map(($e,nt)=>{const Ht=en.top+Vs-$e/ds*Vs;return l.jsxs("g",{children:[l.jsx("line",{x1:en.left,y1:Ht,x2:jt-en.right,y2:Ht,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),l.jsx("text",{x:en.left-6,y:Ht+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Mt($e)})]},`t-${nt}`)}),ue.map(([$e,nt],Ht)=>{const an=en.left+Qs*Ht+Qs/2,Aa=nt.impressions/ds*Vs,qr=nt.clicks/ds*Vs;return l.jsxs("g",{children:[l.jsx("title",{children:`${$e}
|
|
234
|
+
Clicks: ${nt.clicks}
|
|
235
|
+
Impressions: ${nt.impressions}
|
|
236
|
+
CTR: ${nt.impressions>0?(nt.clicks/nt.impressions*100).toFixed(1):0}%`}),l.jsx("rect",{x:an-us-Oa/2,y:en.top+Vs-Aa,width:us,height:Math.max(Aa,1),rx:2,fill:"#3b82f6",opacity:.85}),l.jsx("rect",{x:an+Oa/2,y:en.top+Vs-qr,width:us,height:Math.max(qr,1),rx:2,fill:"#10b981",opacity:.85})]},$e)}),(()=>{const $e=Math.min(ue.length,7);return Array.from({length:$e},(nt,Ht)=>{const an=ue.length===1?0:Math.round(Ht/($e-1)*(ue.length-1)),Aa=en.left+Qs*an+Qs/2;return l.jsx("text",{x:Aa,y:jn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:ue[an][0].slice(5)},`xl-${an}`)})})()]})})]})})(),l.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:M.startDate,onChange:I=>A(ue=>({...ue,startDate:I.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:M.endDate,onChange:I=>A(ue=>({...ue,endDate:I.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:M.query,onChange:I=>A(ue=>({...ue,query:I.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:M.page,onChange:I=>A(ue=>({...ue,page:I.target.value}))}),l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:M.limit,onChange:I=>A(ue=>({...ue,limit:I.target.value}))})]}),f.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Date"}),l.jsx("th",{className:"text-left",children:"Query"}),l.jsx("th",{className:"text-left",children:"Page"}),l.jsx("th",{className:"text-right",children:"Clicks"}),l.jsx("th",{className:"text-right",children:"Impressions"}),l.jsx("th",{className:"text-right",children:"CTR"}),l.jsx("th",{className:"text-right",children:"Position"})]})}),l.jsx("tbody",{children:f.map((I,ue)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:I.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:I.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:I.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:I.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(I.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.position.toFixed(1)})]},`${I.date}:${I.query}:${I.page}:${ue}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),l.jsxs(He,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),l.jsx("h3",{children:"Inspect a URL"})]})}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:_,onChange:I=>E(I.target.value),onKeyDown:I=>I.key==="Enter"&&void Br()}),l.jsx(le,{type:"button",size:"sm",disabled:ce||!Ie?.propertyId||!_.trim(),onClick:Br,children:ce?"Inspecting…":"Inspect URL"})]}),x&&l.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:x.indexingState??"Unknown"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:x.verdict??"Unknown"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:zb(x.isMobileFriendly)})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:br(x.crawlTime)})]})]})]}),l.jsxs(He,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),l.jsx("h3",{children:"Inspection log"})]}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:se,onClick:()=>{Ss()},children:se?"Loading…":"Refresh history"})]}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter exact URL",value:B,onChange:I=>ie(I.target.value)}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:se,onClick:()=>{Ss()},children:"Apply filter"})]}),m.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Coverage"}),l.jsx("th",{className:"text-left",children:"Mobile"}),l.jsx("th",{className:"text-left",children:"Inspected"})]})}),l.jsx("tbody",{children:m.map(I=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),l.jsx("td",{className:"text-zinc-300",children:I.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:I.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:I.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:zb(I.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:br(I.inspectedAt)})]},I.id))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),l.jsxs(He,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),l.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Changed at"})]})}),l.jsx("tbody",{children:y.map(I=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),l.jsx("td",{className:"text-zinc-400",children:I.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:I.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:br(I.transitionDate)})]},`${I.url}:${I.transitionDate}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),Ie&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:l.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>Pe(I=>!I),children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`h-4 w-4 text-zinc-500 transition-transform ${Ue?"rotate-90":""}`,"aria-hidden":"true",children:l.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),l.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),Ue&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[l.jsxs(He,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),l.jsx("h3",{children:"Pick the Search Console property"})]})}),l.jsxs("div",{className:"mt-3 space-y-2",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),l.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:S,disabled:T||c.length===0,onChange:I=>C(I.target.value),children:c.length===0?l.jsx("option",{value:"",children:T?"Loading properties…":"No properties available"}):c.map(I=>l.jsxs("option",{value:I.siteUrl,children:[I.siteUrl," · ",I.permissionLevel]},I.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:T,onClick:()=>{hl(Ie)},children:T?"Refreshing…":"Refresh properties"}),l.jsx(le,{type:"button",size:"sm",disabled:!S||pe,onClick:gl,children:pe?"Saving…":"Save property"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),l.jsxs(He,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),l.jsx("h3",{children:"Import GSC performance data"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),l.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:R,onChange:I=>z(I.target.value)})]}),l.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[l.jsx("input",{type:"checkbox",checked:U,onChange:I=>O(I.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(le,{type:"button",size:"sm",disabled:we||!Ie.propertyId,onClick:yl,children:we?"Queueing…":"Queue sync"}),!Ie.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),l.jsxs(He,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),l.jsx("h3",{children:"Sitemap configuration"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[Ie.sitemapUrl&&l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:Ie.sitemapUrl})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:Wt||!Ie.propertyId,onClick:()=>{pl()},children:Wt?"Loading…":"Browse sitemaps from GSC"}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:Ye||!Ie.propertyId,onClick:ml,children:Ye?"Discovering…":"Auto-discover and queue inspection"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:"Browse lists available sitemaps without queueing a run. Auto-discover saves the primary sitemap and queues an inspection."}),nn&&nn.length>0&&l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[l.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",nn.length,")"]}),nn.map(I=>{const ue=I.contents?.[0];return l.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-200 break-all",children:I.path}),I.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",I.lastSubmitted.split("T")[0]]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[ue&&l.jsxs("div",{className:"text-right",children:[l.jsxs("p",{className:"text-zinc-300",children:[ue.indexed," / ",ue.submitted]}),l.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>wt(I.path),children:"Use"})]})]},I.path)})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:Ie.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:kt,onChange:I=>wt(I.target.value),onKeyDown:I=>I.key==="Enter"&&kt.trim()&&void cs()}),l.jsx(le,{type:"button",size:"sm",disabled:sn||!kt.trim(),onClick:cs,children:sn?"Saving…":Ie.sitemapUrl?"Update":"Save"})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"Sitemap URL for inspection (leave empty for saved default)",id:`gsc-sitemap-inspect-${e}`}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:mt||!Ie.propertyId,onClick:()=>{const ue=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||Ie.sitemapUrl||void 0;fe(!0),Zj(e,{sitemapUrl:ue}).then(tt=>{te(`Sitemap inspection queued (run ${tt.id}). Refresh coverage after the run completes.`)}).catch(tt=>{Ce(tt instanceof Error?tt.message:"Failed to queue sitemap inspection")}).finally(()=>fe(!1))},children:mt?"Queueing…":"Inspect sitemap"})]}),!Ie.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function M4({project:e,onUpdateProject:t,onRefresh:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,b]=N.useState(e.displayName),[y,v]=N.useState(e.canonicalDomain),[x,j]=N.useState(e.country),[S,C]=N.useState(e.language),[_,E]=N.useState(e.ownedDomains??[]),[R,z]=N.useState(""),[U,O]=N.useState(null),[M,A]=N.useState(!1),[B,ie]=N.useState(!1),[Q,ne]=N.useState(""),[me,ze]=N.useState(""),[we,q]=N.useState(""),[T,ae]=N.useState(""),[pe,ee]=N.useState("");N.useEffect(()=>{a||(b(e.displayName),v(e.canonicalDomain),j(e.country),C(e.language),E(e.ownedDomains??[]))},[e,a]);function L(){r(!1),p(null),b(e.displayName),v(e.canonicalDomain),j(e.country),C(e.language),E(e.ownedDomains??[]),z("")}function G(){const fe=R.trim();fe&&(_.includes(fe)||E([..._,fe]),z(""))}function se(fe){E(_.filter(Ye=>Ye!==fe))}async function re(){if(!(!m.trim()||!y.trim()||!x.trim()||!S.trim())){d(!0),p(null);try{await t(e.name,{displayName:m.trim(),canonicalDomain:y.trim(),ownedDomains:_,country:x.trim(),language:S.trim()}),r(!1)}catch(fe){p(fe instanceof Error?fe.message:"Failed to save")}finally{d(!1)}}}async function ce(){const fe=Q.trim(),Ye=me.trim(),dt=we.trim(),Wt=T.trim();if(!(!fe||!Ye||!dt||!Wt)){A(!0),O(null);try{const _t={label:fe,city:Ye,region:dt,country:Wt};pe.trim()&&(_t.timezone=pe.trim()),await gj(e.name,_t),s(),ne(""),ze(""),q(""),ae(""),ee(""),ie(!1)}catch(_t){O(_t instanceof Error?_t.message:"Failed to add location")}finally{A(!1)}}}async function he(fe){A(!0),O(null);try{await yj(e.name,fe),s()}catch(Ye){O(Ye instanceof Error?Ye.message:"Failed to remove location")}finally{A(!1)}}async function de(fe){A(!0),O(null);try{await vj(e.name,fe),s()}catch(Ye){O(Ye instanceof Error?Ye.message:"Failed to set default location")}finally{A(!1)}}const Fe=m!==e.displayName||y!==e.canonicalDomain||x!==e.country||S!==e.language||JSON.stringify(_)!==JSON.stringify(e.ownedDomains??[]),ge="w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",Je="block text-xs font-medium text-zinc-400 mb-1",mt=Q.trim()&&me.trim()&&we.trim()&&T.trim();return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),l.jsx("h2",{children:"Project settings"})]}),!a&&l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:"Edit settings"})]}),f&&l.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[f,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>p(null),children:"×"})]}),a?l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:Je,children:"Display name"}),l.jsx("input",{className:ge,type:"text",value:m,onChange:fe=>b(fe.target.value),placeholder:"My Project"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Je,children:"Canonical domain"}),l.jsx("input",{className:ge,type:"text",value:y,onChange:fe=>v(fe.target.value),placeholder:"example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{className:Je,children:"Country"}),l.jsx("input",{className:ge,type:"text",value:x,onChange:fe=>j(fe.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{children:[l.jsx("label",{className:Je,children:"Language"}),l.jsx("input",{className:ge,type:"text",value:S,onChange:fe=>C(fe.target.value),placeholder:"en"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:Je,children:"Owned domains"}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:_.map(fe=>l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[fe,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>se(fe),"aria-label":`Remove ${fe}`,children:"×"})]},fe))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${ge} flex-1`,type:"text",placeholder:"docs.example.com",value:R,onChange:fe=>z(fe.target.value),onKeyDown:fe=>fe.key==="Enter"&&(fe.preventDefault(),G())}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:!R.trim(),onClick:G,children:"Add"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[l.jsx(le,{type:"button",disabled:c||!Fe||!m.trim()||!y.trim(),onClick:re,children:c?"Saving...":"Save changes"}),l.jsx(le,{type:"button",variant:"outline",disabled:c,onClick:L,children:"Cancel"})]})]}):l.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:l.jsx("table",{className:"w-full text-sm",children:l.jsxs("tbody",{children:[l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),l.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?l.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(fe=>l.jsx("span",{className:"rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:fe},fe))}):l.jsx("span",{className:"text-zinc-500",children:"\\u2014"})})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),l.jsxs("tr",{children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),l.jsxs("td",{className:"px-4 py-2.5",children:[U&&l.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[U,l.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>O(null),children:"×"})]}),(e.locations??[]).length>0?l.jsxs("table",{className:"w-full text-xs mb-2",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-zinc-600",children:[l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),l.jsx("th",{className:"pb-1"})]})}),l.jsx("tbody",{children:e.locations.map(fe=>l.jsxs("tr",{className:"border-t border-zinc-800/30",children:[l.jsx("td",{className:"py-1.5 pr-3",children:l.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${fe.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:[fe.label,fe.label===e.defaultLocation?" ★":""]})}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:fe.city}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:fe.region}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:fe.country}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:fe.timezone??"—"}),l.jsx("td",{className:"py-1.5",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[fe.label!==e.defaultLocation&&l.jsx("button",{type:"button",disabled:M,onClick:()=>de(fe.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${fe.label} as default location`,children:"Set default"}),l.jsx("button",{type:"button",disabled:M,onClick:()=>he(fe.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${fe.label}`,children:"Remove"})]})})]},fe.label))})]}):l.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),B?l.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[l.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),l.jsx("input",{className:ge,type:"text",value:Q,onChange:fe=>ne(fe.target.value),placeholder:"nyc"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),l.jsx("input",{className:ge,type:"text",value:me,onChange:fe=>ze(fe.target.value),placeholder:"New York"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),l.jsx("input",{className:ge,type:"text",value:we,onChange:fe=>q(fe.target.value),placeholder:"NY"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),l.jsx("input",{className:ge,type:"text",value:T,onChange:fe=>ae(fe.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),l.jsx("input",{className:ge,type:"text",value:pe,onChange:fe=>ee(fe.target.value),placeholder:"America/New_York"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsx(le,{type:"button",size:"sm",disabled:M||!mt,onClick:ce,children:M?"Adding...":"Add location"}),l.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:M,onClick:()=>{ie(!1),O(null)},children:"Cancel"})]})]}):l.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:()=>ie(!0),children:"+ Add location"})]})]})]})})})]})}const U4=[{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"}],Mx=["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 P4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState("daily"),[f,p]=N.useState(6),[m,b]=N.useState(""),[y,v]=N.useState("UTC"),[x,j]=N.useState(!1),[S,C]=N.useState(""),[_,E]=N.useState(!1),[R,z]=N.useState(!1),[U,O]=N.useState(null);N.useEffect(()=>{jj(e).then(s).catch(()=>s(null))},[e]);const M=()=>{if(t&&t!=="loading"){const Q=R2(t.preset??null,t.cronExpr);d(Q.freq),p(Q.hour),b(Q.customCron);const ne=Mx.includes(t.timezone);v(ne?t.timezone:"Other"),j(!ne),C(ne?"":t.timezone)}else d("daily"),p(6),b(""),v("UTC"),j(!1),C("");O(null),r(!0)},A=async()=>{E(!0),O(null);try{const ne={timezone:x?S.trim()||"UTC":y};c==="custom"?ne.cron=m.trim():ne.preset=E2(c,f);const me=await Cm(e,ne);s(me),r(!1)}catch(Q){O(Q instanceof Error?Q.message:"Failed to save schedule")}finally{E(!1)}},B=async()=>{if(!(!t||t==="loading")){E(!0),O(null);try{const Q={timezone:t.timezone,enabled:!t.enabled};t.preset?Q.preset=t.preset:Q.cron=t.cronExpr,s(await Cm(e,Q))}catch(Q){O(Q instanceof Error?Q.message:"Failed to update schedule")}finally{E(!1)}}},ie=async()=>{z(!0),O(null);try{await Nj(e),s(null),r(!1)}catch(Q){O(Q instanceof Error?Q.message:"Failed to remove schedule")}finally{z(!1)}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!a&&l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:M,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&l.jsx(He,{className:"surface-card compact-card",children:l.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!a&&t!==null&&l.jsxs(He,{className:"surface-card compact-card",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:O2(t.preset??null,t.cronExpr,t.timezone)}),l.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",l.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx(ot,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),l.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:_,onClick:B,children:t.enabled?"Pause":"Resume"}),l.jsx(le,{type:"button",variant:"ghost",size:"sm",disabled:R,onClick:ie,children:R?"Removing...":"Remove"})]})]}),U&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:U})]}),a&&l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),l.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:c,onChange:Q=>d(Q.target.value),children:U4.map(Q=>l.jsx("option",{value:Q.value,children:Q.label},Q.value))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),l.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:f,disabled:c==="twice-daily"||c==="custom",onChange:Q=>p(parseInt(Q.target.value)),children:Array.from({length:24},(Q,ne)=>l.jsx("option",{value:ne,children:hm(ne)},ne))})]})]}),c==="custom"&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),l.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:m,onChange:Q=>b(Q.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),l.jsxs("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:x?"Other":y,onChange:Q=>{Q.target.value==="Other"?(j(!0),v("Other")):(j(!1),v(Q.target.value))},children:[Mx.map(Q=>l.jsx("option",{value:Q,children:Q},Q)),l.jsx("option",{value:"Other",children:"Other (enter manually)\\u2026"})]}),x&&l.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:S,onChange:Q=>C(Q.target.value)})]}),U&&l.jsx("p",{className:"text-rose-400 text-sm",children:U}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),O(null)},children:"Cancel"}),l.jsx(le,{type:"button",size:"sm",disabled:_||c==="custom"&&!m.trim(),onClick:A,children:_?"Saving...":"Save schedule"})]})]})]})}const I4=[{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 $4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState(""),[f,p]=N.useState(["citation.lost","citation.gained"]),[m,b]=N.useState(!1),[y,v]=N.useState(null),[x,j]=N.useState({});N.useEffect(()=>{Cj(e).then(s).catch(()=>s([]))},[e]);const S=R=>{p(z=>z.includes(R)?z.filter(U=>U!==R):[...z,R])},C=async()=>{if(!(!c.trim()||f.length===0)){b(!0),v(null);try{const R=await _j(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[R]:[...z,R]),d(""),p(["citation.lost","citation.gained"]),r(!1)}catch(R){v(R instanceof Error?R.message:"Failed to add webhook")}finally{b(!1)}}},_=async R=>{try{await kj(e,R),s(z=>z==="loading"?z:z.filter(U=>U.id!==R))}catch(z){v(z instanceof Error?z.message:"Failed to remove webhook")}},E=async R=>{j(z=>({...z,[R]:{state:"testing"}}));try{const z=await zj(e,R);j(U=>({...U,[R]:{state:z.ok?"ok":"fail",status:z.status}}))}catch{j(z=>({...z,[R]:{state:"fail"}}))}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!a),v(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),l.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:c,onChange:R=>d(R.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),l.jsx("div",{className:"flex flex-wrap gap-3",children:I4.map(R=>l.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[l.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:f.includes(R.value),onChange:()=>S(R.value)}),l.jsx("span",{className:"text-sm text-zinc-300",children:R.label})]},R.value))})]}),y&&l.jsx("p",{className:"text-rose-400 text-sm",children:y}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),v(null)},children:"Cancel"}),l.jsx(le,{type:"button",size:"sm",disabled:m||!c.trim()||f.length===0,onClick:C,children:m?"Adding...":"Add webhook"})]})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&l.jsx(He,{className:"surface-card compact-card",children:l.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),t!=="loading"&&t.length>0&&l.jsxs("div",{className:"evidence-table-wrap",children:[l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"URL"}),l.jsx("th",{children:"Events"}),l.jsx("th",{children:"Status"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:t.map(R=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-keyword-cell",children:l.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",children:R.url})}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:R.events.map(z=>l.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:z.replace("."," ")},z))})}),l.jsx("td",{children:l.jsx(ot,{tone:R.enabled?"positive":"neutral",children:R.enabled?"Active":"Paused"})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[x[R.id]&&(()=>{const z=x[R.id],U=z.state==="testing"?"Sending…":z.state==="ok"?`Delivered${z.status?` (${z.status})`:""}`:`Failed${z.status?` (${z.status})`:""}`;return l.jsx(ot,{tone:z.state==="ok"?"positive":z.state==="fail"?"negative":"neutral",children:U})})(),l.jsx(le,{variant:"ghost",size:"sm",type:"button",disabled:x[R.id]?.state==="testing",onClick:()=>E(R.id),children:"Test"}),l.jsx(le,{variant:"ghost",size:"sm",type:"button",onClick:()=>_(R.id),children:"Remove"})]})})]},R.id))})]}),y&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}const B4=Vu();function q4({projectName:e}){const[t,s]=N.useState(null),[a,r]=N.useState([]),[c,d]=N.useState(null),[f,p]=N.useState([]),[m,b]=N.useState([]),[y,v]=N.useState(null),[x,j]=N.useState(""),[S,C]=N.useState(""),[_,E]=N.useState(""),[R,z]=N.useState(!0),[U,O]=N.useState(null),[M,A]=N.useState("coverage");N.useEffect(()=>{B()},[e]);async function B(){z(!0),O(null);try{const T=await Vj(e);if(s(T),T.connected){const[ae,pe,ee]=await Promise.all([Wj(e).catch(()=>null),e1(e).catch(()=>[]),n1(e).catch(()=>[])]);ae&&d(ae),p(pe),b(ee)}}catch(T){O(T instanceof Error?T.message:"Failed to load Bing data")}finally{z(!1)}}async function ie(){if(S.trim()){O(null);try{const T=await Qj(e,S.trim());C(""),T.availableSites.length>0&&r(T.availableSites),await B()}catch(T){O(T instanceof Error?T.message:"Failed to connect")}}}async function Q(){try{await Yj(e),s(null),d(null),p([]),b([])}catch(T){O(T instanceof Error?T.message:"Failed to disconnect")}}async function ne(){if(_)try{await Xj(e,_),await B()}catch(T){O(T instanceof Error?T.message:"Failed to set site")}}async function me(){if(x.trim())try{const T=await t1(e,x.trim());v(T),p(ae=>[T,...ae])}catch(T){O(T instanceof Error?T.message:"Inspection failed")}}async function ze(T){try{await zm(e,{urls:[T]}),O(null)}catch(ae){O(ae instanceof Error?ae.message:"Submission failed")}}async function we(){try{await zm(e,{allUnindexed:!0}),O(null)}catch(T){O(T instanceof Error?T.message:"Batch submission failed")}}if(R)return l.jsx(He,{className:"p-4",children:l.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!t?.connected)return l.jsxs(He,{className:"p-4 space-y-3",children:[l.jsx("h3",{className:"text-sm font-semibold text-zinc-200",children:"Bing Webmaster Tools"}),l.jsx("p",{className:"text-xs text-zinc-400",children:"Connect Bing Webmaster Tools to monitor index coverage and submit URLs for the Bing search engine (used by OpenAI)."}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:S,onChange:T=>C(T.target.value),onKeyDown:T=>T.key==="Enter"&&ie()}),l.jsx(le,{size:"sm",disabled:!S.trim(),onClick:ie,children:"Connect"})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",l.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),U&&l.jsx("p",{className:"text-xs text-rose-400",children:U})]});if(!t.siteUrl)return l.jsxs(He,{className:"p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-semibold text-zinc-200",children:"Bing Webmaster Tools"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ot,{tone:"positive",children:"Connected"}),l.jsx(le,{size:"sm",variant:"ghost",onClick:Q,children:"Disconnect"})]})]}),l.jsx("p",{className:"text-xs text-zinc-400",children:"Select a site to monitor:"}),a.length>0?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("select",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:_,onChange:T=>E(T.target.value),children:[l.jsx("option",{value:"",children:"Select a site..."}),a.map(T=>l.jsxs("option",{value:T.url,children:[T.url,T.verified?" (verified)":""]},T.url))]}),l.jsx(le,{size:"sm",disabled:!_,onClick:ne,children:"Set Site"})]}):l.jsx("div",{children:l.jsx(le,{size:"sm",onClick:async()=>{const T=await Jj(e);r(T.sites)},children:"Load Sites"})}),U&&l.jsx("p",{className:"text-xs text-rose-400",children:U})]});const q=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return l.jsxs(He,{className:"p-4 space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-zinc-200",children:"Bing Webmaster Tools"}),l.jsx("p",{className:"text-xs text-zinc-500",children:t.siteUrl})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ot,{tone:"positive",children:"Connected"}),l.jsx(le,{size:"sm",variant:"ghost",onClick:Q,children:"Disconnect"})]})]}),U&&l.jsx("p",{className:"text-xs text-rose-400",children:U}),l.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:q.map(T=>l.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${M===T.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>A(T.key),children:T.label},T.key))}),M==="coverage"&&c&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-2xl font-semibold text-emerald-400",children:c.summary.indexed}),l.jsx("div",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-2xl font-semibold text-rose-400",children:c.summary.notIndexed}),l.jsx("div",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Not Indexed"})]}),l.jsxs("div",{className:"text-center",children:[l.jsxs("div",{className:"text-2xl font-semibold text-zinc-300",children:[c.summary.percentage,"%"]}),l.jsx("div",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Coverage"})]})]}),c.notIndexed.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),l.jsx(le,{size:"sm",variant:"ghost",onClick:we,children:"Submit all to Bing"})]}),l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium w-16",children:"HTTP"}),l.jsx("th",{className:"text-right py-1.5 text-zinc-500 font-medium w-20",children:"Action"})]})}),l.jsx("tbody",{children:c.notIndexed.map(T=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 truncate max-w-[300px]",children:T.url}),l.jsx("td",{className:"py-1.5 text-zinc-400",children:T.httpCode??"—"}),l.jsx("td",{className:"py-1.5 text-right",children:l.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",onClick:()=>ze(T.url),children:"Submit"})})]},T.id))})]})]}),c.indexed.length>0&&l.jsxs("div",{children:[l.jsxs("h4",{className:"text-xs font-medium text-zinc-400 mb-2",children:["Indexed (",c.indexed.length,")"]}),l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium w-28",children:"Last Crawled"})]})}),l.jsx("tbody",{children:c.indexed.map(T=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 truncate max-w-[300px]",children:T.url}),l.jsx("td",{className:"py-1.5 text-zinc-400",children:T.lastCrawledDate?br(T.lastCrawledDate):"—"})]},T.id))})]})]})]}),M==="coverage"&&!c&&l.jsx("p",{className:"text-xs text-zinc-500",children:"No coverage data. Inspect URLs to build coverage data."}),M==="inspections"&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:x,onChange:T=>j(T.target.value),onKeyDown:T=>T.key==="Enter"&&me()}),l.jsx(le,{size:"sm",disabled:!x.trim(),onClick:me,children:"Inspect"})]}),y&&l.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[l.jsx("div",{className:"text-zinc-200 font-medium",children:y.url}),l.jsxs("div",{className:"text-zinc-400",children:["In Index: ",l.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.lastCrawledDate??"—"]})]}),f.length>0&&l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium w-16",children:"Index"}),l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium w-14",children:"HTTP"}),l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium w-28",children:"Inspected"})]})}),l.jsx("tbody",{children:f.map(T=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 truncate max-w-[250px]",children:T.url}),l.jsx("td",{className:"py-1.5",children:l.jsx(ot,{tone:T.inIndex?"positive":"negative",children:T.inIndex?"Yes":"No"})}),l.jsx("td",{className:"py-1.5 text-zinc-400",children:T.httpCode??"—"}),l.jsx("td",{className:"py-1.5 text-zinc-400",children:br(T.inspectedAt)})]},T.id))})]})]}),M==="performance"&&l.jsx("div",{children:m.length===0?l.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 text-zinc-500 font-medium",children:"Query"}),l.jsx("th",{className:"text-right py-1.5 text-zinc-500 font-medium w-16",children:"Clicks"}),l.jsx("th",{className:"text-right py-1.5 text-zinc-500 font-medium w-16",children:"Impr"}),l.jsx("th",{className:"text-right py-1.5 text-zinc-500 font-medium w-14",children:"CTR"}),l.jsx("th",{className:"text-right py-1.5 text-zinc-500 font-medium w-14",children:"Pos"})]})}),l.jsx("tbody",{children:m.map((T,ae)=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 truncate max-w-[250px]",children:T.query}),l.jsx("td",{className:"py-1.5 text-zinc-200 text-right",children:T.clicks}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-right",children:T.impressions}),l.jsxs("td",{className:"py-1.5 text-zinc-400 text-right",children:[(T.ctr*100).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 text-zinc-400 text-right",children:T.averagePosition.toFixed(1)})]},ae))})]})})]})}function H4({insights:e}){const{openEvidence:t}=ll(),[s,a]=N.useState(null);return l.jsx("div",{className:"insight-list",children:e.map(r=>{const c=s===r.id,d=r.affectedPhrases.length>0;return l.jsxs("div",{children:[l.jsxs("div",{className:`insight-row insight-row-${r.tone} ${d?"cursor-pointer":""}`,onClick:d?()=>a(c?null:r.id):void 0,children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d&&l.jsx(Lu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),l.jsx(ot,{tone:r.tone,children:r.actionLabel}),l.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:r.title}),l.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:r.detail})]}),d&&l.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[r.affectedPhrases.length," phrase",r.affectedPhrases.length>1?"s":""]})]}),c&&l.jsx("div",{className:"divide-y divide-zinc-800/20",children:r.affectedPhrases.map(f=>l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(jm,{state:f.citationState}),l.jsx("span",{className:"text-sm text-zinc-200 truncate",children:f.keyword}),l.jsx("div",{className:"hidden sm:flex gap-1",children:f.provider&&l.jsx(Xo,{provider:f.provider})})]}),l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:p=>{p.stopPropagation(),t(f.evidenceId)},children:"View →"})]},f.evidenceId))})]},r.id)})})}function Zp({tab:e}){const{projectId:t}=Tu({from:"/projects/$projectId"}),s=ja(),{dashboard:a,refetch:r}=ka(),c=a??B4.dashboard,d=EM(c,t),[f,p]=N.useState(!1),[m,b]=N.useState(!1),[y,v]=N.useState(!1),[x,j]=N.useState(null),[S,C]=N.useState(!1),[_,E]=N.useState(""),[R,z]=N.useState(!1),[U,O]=N.useState(!1),[M,A]=N.useState(""),[B,ie]=N.useState(!1),[Q,ne]=N.useState(!1),[me,ze]=N.useState(""),[we,q]=N.useState(!1),[T,ae]=N.useState(void 0),[pe,ee]=N.useState(!1),[L,G]=N.useState(null),[se,re]=N.useState(!1),ce=d?.visibilityEvidence??[],he=d?.project.name??"",de=N.useMemo(()=>new Set(ce.map(oe=>oe.location??"")),[ce]),Fe=de.has(""),ge=N.useMemo(()=>[...de].filter(Boolean),[de]);N.useEffect(()=>{if(T===void 0||T===""||!he){G(null),re(!1);return}re(!0),wp(he,T).then(oe=>{G(oe),re(!1)}).catch(()=>{G(null),re(!1)})},[T,he]);const Je=N.useMemo(()=>{if(!L)return null;const oe=new Map;for(const Ue of L){for(const[Pe,ke]of Object.entries(Ue.providerRuns??{}))oe.set(`${Ue.keyword}::${Pe}`,ke.map(Te=>({runId:Te.runId,citationState:Te.citationState,createdAt:Te.createdAt})));(!Ue.providerRuns||Object.keys(Ue.providerRuns).length===0)&&oe.set(`${Ue.keyword}::`,Ue.runs.map(Pe=>({runId:Pe.runId,citationState:Pe.citationState,createdAt:Pe.createdAt})))}return oe},[L]),mt=N.useMemo(()=>{const oe=T!==void 0?ce.filter(Ue=>T===""?!Ue.location:Ue.location===T):ce;return Je?oe.map(Ue=>{const Pe=Je.get(`${Ue.keyword}::${Ue.provider}`)??Je.get(`${Ue.keyword}::`);return Pe?{...Ue,runHistory:Pe}:Ue}):oe},[ce,T,Je]);if(!d)return l.jsx("div",{className:"page-container",children:l.jsxs(He,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Project not found"}),l.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),l.jsx(le,{asChild:!0,children:l.jsx(gt,{to:"/",children:"Return to overview"})})]})});async function fe(){v(!0),j(null);try{await Np(he),r()}catch(oe){j(oe instanceof Error?oe.message:"Failed to trigger run")}finally{v(!1)}}async function Ye(){b(!0);try{await bj(he),s({to:"/"}),r()}catch(oe){console.error("Failed to delete project:",oe)}finally{b(!1)}}async function dt(){const oe=await xj(he),Ue=typeof oe=="string"?oe:JSON.stringify(oe,null,2),Pe=new Blob([Ue],{type:"text/yaml"}),ke=URL.createObjectURL(Pe),Te=document.createElement("a");Te.href=ke,Te.download=`${he}.yaml`,Te.click()}async function Wt(){const oe=_.split(`
|
|
237
|
+
`).map(Ue=>Ue.trim()).filter(Boolean);if(oe.length!==0){z(!0);try{await mj(he,oe),r(),E(""),C(!1)}finally{z(!1)}}}async function _t(){const oe=M.trim();if(oe){ie(!0);try{const Pe=(await Sp(he)).map(Te=>Te.domain),ke=[...new Set([...Pe,oe])];await jp(he,ke),r(),A(""),O(!1)}finally{ie(!1)}}}async function nn(){const oe=me.trim();if(oe){q(!0);try{const Ue=d?.project.ownedDomains??[];await Nm(he,[...Ue,oe]),r(),ze(""),ne(!1)}finally{q(!1)}}}async function Kt(oe){q(!0);try{const Ue=d?.project.ownedDomains??[];await Nm(he,Ue.filter(Pe=>Pe!==oe)),r()}finally{q(!1)}}async function kt(oe,Ue){await pj(oe,Ue),r()}const wt=oe=>!Number.isNaN(Number.parseInt(oe,10)),sn=[{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`}];return l.jsxs("div",{className:"page-container",children:[f?l.jsxs(He,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[l.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),l.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",l.jsx("strong",{className:"text-zinc-200",children:d.project.displayName||d.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(le,{type:"button",variant:"destructive",disabled:m,onClick:Ye,children:m?"Deleting...":"Yes, delete project"}),l.jsx(le,{type:"button",variant:"outline",disabled:m,onClick:()=>p(!1),children:"Cancel"})]})]}):null,l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:d.project.displayName||d.project.name}),l.jsxs("p",{className:"page-subtitle",children:[d.project.canonicalDomain,(d.project.ownedDomains??[]).length===0&&!Q&&l.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>ne(!0),children:"+ add domain"})," "," · ",d.contextLabel]}),l.jsxs("div",{className:"tag-row",children:[l.jsx("span",{className:"tag",children:d.project.country}),l.jsx("span",{className:"tag",children:d.project.language.toUpperCase()}),d.project.tags.map(oe=>l.jsx("span",{className:"tag",children:oe},oe))]}),((d.project.ownedDomains??[]).length>0||Q)&&l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(d.project.ownedDomains??[]).map(oe=>l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[oe,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:we,onClick:()=>Kt(oe),"aria-label":`Remove ${oe}`,children:"×"})]},oe)),Q?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:me,onChange:oe=>ze(oe.target.value),onKeyDown:oe=>oe.key==="Enter"&&nn(),autoFocus:!0}),l.jsx(le,{type:"button",size:"sm",disabled:!me.trim()||we,onClick:nn,children:we?"...":"Add"}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{ne(!1),ze("")},children:"Cancel"})]}):l.jsx("button",{type:"button",className:"rounded-full border border-dashed border-zinc-700 px-2 py-0.5 text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 hover:border-zinc-500 transition-colors",onClick:()=>ne(!0),children:"+ domain"})]})]}),l.jsxs("div",{className:"page-header-right",children:[l.jsx("p",{className:"text-sm text-zinc-500",children:d.dateRangeLabel}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(le,{type:"button",variant:"outline",size:"icon",onClick:dt,"aria-label":"Export project as YAML",children:l.jsx(o2,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(le,{type:"button",variant:"outline",size:"icon",onClick:()=>p(!0),"aria-label":"Delete project",children:l.jsx(N2,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(le,{type:"button",disabled:y,onClick:fe,children:y?"Starting...":"Run now"})]})]})]}),x&&l.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[x,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>j(null),children:"×"})]}),l.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:sn.map(oe=>l.jsx(gt,{to:oe.href,className:`project-subnav-link ${oe.key===e?"project-subnav-link-active":""}`,"aria-current":oe.key===e?"page":void 0,children:oe.label},oe.key))}),e==="overview"?l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"gauge-row",children:[l.jsx(au,{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:wt(d.visibilitySummary.value)}),l.jsx(au,{value:d.competitorPressure.value,label:d.competitorPressure.label,delta:d.competitorPressure.delta,tone:d.competitorPressure.tone,description:d.competitorPressure.description,tooltip:d.competitorPressure.tooltip,isNumeric:wt(d.competitorPressure.value)}),l.jsx(au,{value:d.runStatus.value,label:d.runStatus.label,delta:d.runStatus.delta,tone:d.runStatus.tone,description:d.runStatus.description,tooltip:d.runStatus.tooltip,isNumeric:wt(d.runStatus.value)})]}),d.providerScores.length>1&&l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),l.jsxs("h2",{children:["Visibility by model ",l.jsx(Go,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Model"}),l.jsx("th",{children:"Score"}),l.jsx("th",{children:"Cited key phrases"})]})}),l.jsx("tbody",{children:d.providerScores.map(oe=>l.jsxs("tr",{children:[l.jsx("td",{children:l.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[l.jsx(Xo,{provider:oe.provider}),oe.model&&l.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:oe.model})]})}),l.jsx("td",{children:l.jsxs("span",{className:`font-semibold ${oe.score>=70?"text-emerald-400":oe.score>=40?"text-amber-400":"text-rose-400"}`,children:[oe.score,"%"]})}),l.jsxs("td",{className:"text-zinc-500",children:[oe.cited," of ",oe.total]})]},`${oe.provider}::${oe.model??"unknown"}`))})]})})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),l.jsx("h2",{children:"Citation signals"})]})}),l.jsx(H4,{insights:d.insights})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),l.jsx("h2",{children:"Key phrase citation tracking"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[new Set(d.visibilityEvidence.map(oe=>oe.keyword)).size," key phrases tracked"]}),l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>C(!S),children:S?"Cancel":"+ Add key phrases"})]})]}),S&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:_,onChange:oe=>E(oe.target.value)}),l.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[l.jsxs("p",{className:"text-xs text-zinc-500",children:[_.split(`
|
|
238
|
+
`).filter(oe=>oe.trim()).length," key phrases"]}),l.jsx(le,{type:"button",size:"sm",disabled:!_.trim()||R,onClick:Wt,children:R?"Adding...":"Add key phrases"})]})]}),d.project.locations&&d.project.locations.length>0&&l.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[l.jsx("button",{className:`filter-chip ${T===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":T===void 0,onClick:()=>{ae(void 0)},children:"All locations"}),d.project.locations.map(oe=>de.has(oe.label)&&l.jsx("button",{className:`filter-chip ${T===oe.label?"filter-chip-active":""}`,type:"button","aria-pressed":T===oe.label,onClick:()=>{ae(oe.label),ee(!1)},children:oe.label},oe.label)),Fe&&l.jsx("button",{className:`filter-chip ${T===""?"filter-chip-active":""}`,type:"button","aria-pressed":T==="",onClick:()=>{ae(""),ee(!1)},children:"No location"}),ge.length>1&&T===void 0&&l.jsx("button",{className:`filter-chip filter-chip-compare ${pe?"filter-chip-active":""}`,type:"button","aria-pressed":pe,onClick:()=>ee(oe=>!oe),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(k4,{evidence:mt})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),l.jsx("h2",{children:"Competitive landscape"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[d.competitors.length," tracked"]}),l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>O(!U),children:U?"Cancel":"+ Add competitor"})]})]}),U&&l.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:M,onChange:oe=>A(oe.target.value),onKeyDown:oe=>oe.key==="Enter"&&_t()}),l.jsx(le,{type:"button",size:"sm",disabled:!M.trim()||B,onClick:_t,children:B?"Adding...":"Add"})]}),l.jsx(z4,{competitors:d.competitors})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),l.jsx("h2",{children:"Recent execution history"})]})}),l.jsx("div",{className:"run-list",children:d.recentRuns.map(oe=>l.jsx(Y1,{run:oe},oe.id))})]}),l.jsx(M4,{project:{...d.project,displayName:d.project.displayName??d.project.name,defaultLocation:d.project.defaultLocation??null},onUpdateProject:kt,onRefresh:()=>{r()}}),l.jsx(P4,{projectName:d.project.name}),l.jsx($4,{projectName:d.project.name})]}):e==="analytics"?l.jsx(O4,{projectName:d.project.name}):l.jsxs("div",{className:"space-y-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Search Engine Intelligence"}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs uppercase tracking-wide text-zinc-500 mb-2",children:"Google (Gemini)"}),l.jsx(L4,{projectName:d.project.name})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs uppercase tracking-wide text-zinc-500 mb-2",children:"Bing (OpenAI)"}),l.jsx(q4,{projectName:d.project.name})]})]})]})]})}const Z4="modulepreload",F4=function(e,t){return new URL(e,t).href},Ux={},G4=function(t,s,a){let r=Promise.resolve();if(s&&s.length>0){let m=function(b){return Promise.all(b.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const d=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");r=m(s.map(b=>{if(b=F4(b,a),b in Ux)return;Ux[b]=!0;const y=b.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(a)for(let j=d.length-1;j>=0;j--){const S=d[j];if(S.href===b&&(!y||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${v}`))return;const x=document.createElement("link");if(x.rel=y?"stylesheet":Z4,y||(x.as="script"),x.crossOrigin="",x.href=b,p&&x.setAttribute("nonce",p),document.head.appendChild(x),y)return new Promise((j,S)=>{x.addEventListener("load",j),x.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${b}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return r.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};function K4(){const{dashboard:e}=ka(),t=e?.runs??[],[s,a]=N.useState("all"),r=s==="all"?t:t.filter(d=>d.status===s),c=()=>{G4(async()=>{const{triggerAllRuns:d}=await Promise.resolve().then(()=>wM);return{triggerAllRuns:d}},void 0,import.meta.url).then(({triggerAllRuns:d})=>d().catch(f=>{console.error("Failed to trigger all runs",f)}))};return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Runs"}),l.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:c,children:"Run all projects"})]}),l.jsxs("section",{children:[l.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed"].map(d=>l.jsx("button",{className:`filter-chip ${s===d?"filter-chip-active":""}`,type:"button","aria-pressed":s===d,onClick:()=>a(d),children:d==="all"?"All runs":Uu(d)},d))}),l.jsx("div",{className:"run-list",children:r.length>0?r.map(d=>l.jsx(Y1,{run:d},d.id)):l.jsxs(He,{className:"surface-card empty-card",children:[l.jsx("h2",{children:"No runs match this filter"}),l.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}const V4={openai:"https://platform.openai.com/api-keys",claude:"https://platform.claude.com/settings/keys"},Q4={gemini:"Gemini",openai:"OpenAI",claude:"Claude",local:"Local"},Y4={gemini:"e.g. gemini-3-flash",openai:"e.g. gpt-5.4",claude:"e.g. claude-sonnet-4-6",local:"e.g. llama3, mistral"};function J4({providerName:e,onSaved:t}){const s=e.toLowerCase()==="local",[a,r]=N.useState(""),[c,d]=N.useState(""),[f,p]=N.useState(""),[m,b]=N.useState(""),[y,v]=N.useState(""),[x,j]=N.useState(""),[S,C]=N.useState(!1),[_,E]=N.useState(null),[R,z]=N.useState(!1),U=s?c.trim().length>0:a.trim().length>0;async function O(){if(U){C(!0),E(null),z(!1);try{const B=ze=>{const we=parseInt(ze.trim(),10);return Number.isFinite(we)&&we>0?we:void 0},ie={},Q=B(m);Q!==void 0&&(ie.maxConcurrency=Q);const ne=B(y);ne!==void 0&&(ie.maxRequestsPerMinute=ne);const me=B(x);me!==void 0&&(ie.maxRequestsPerDay=me),await Sj(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(ie).length>0?{quota:ie}:{}}),r(""),d(""),p(""),b(""),v(""),j(""),z(!0),t()}catch(B){E(B instanceof Error?B.message:"Failed to update provider")}finally{C(!1)}}}const M=V4[e.toLowerCase()],A=Y4[e.toLowerCase()]??"Use default model";return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[s&&l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),l.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:c,onChange:B=>d(B.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",s?" (optional)":""]}),M&&l.jsx("a",{href:M,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Get API key \\u2197"})]}),l.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:s?"Optional — most local servers don't need one":`Enter ${e} API key`,value:a,onChange:B=>r(B.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),l.jsx("input",{id:`model-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:A,value:f,onChange:B=>p(B.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),l.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[l.jsxs("div",{children:[l.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:m,onChange:B=>b(B.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),l.jsxs("div",{children:[l.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:y,onChange:B=>v(B.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),l.jsxs("div",{children:[l.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/day",value:x,onChange:B=>j(B.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),_&&l.jsx("p",{className:"text-xs text-rose-400",children:_}),R&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),l.jsx(le,{type:"button",size:"sm",disabled:!U||S,onClick:O,children:S?"Saving...":"Save"})]})}function X4({onSaved:e}){const[t,s]=N.useState(""),[a,r]=N.useState(""),[c,d]=N.useState(!1),[f,p]=N.useState(null),[m,b]=N.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function v(){if(y){d(!0),p(null),b(!1);try{await wj({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),b(!0),e()}catch(x){p(x instanceof Error?x.message:"Failed to update Google OAuth credentials")}finally{d(!1)}}}return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),l.jsx("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Google Cloud \\u2197"})]}),l.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:x=>s(x.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),l.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:a,onChange:x=>r(x.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),f&&l.jsx("p",{className:"text-xs text-rose-400",children:f}),m&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),l.jsx(le,{type:"button",size:"sm",disabled:!y||c,onClick:v,children:c?"Saving...":"Save Google OAuth app"})]})}function W4(){const[e,t]=N.useState(null),[s,a]=N.useState(null),[r,c]=N.useState(!1),[d,f]=N.useState("localhost"),[p,m]=N.useState("9222"),[b,y]=N.useState(!1);return N.useEffect(()=>{_m().then(t).catch(v=>{const x=v instanceof Error?v.message:String(v);x.includes("501")||a(x)})},[]),l.jsxs(He,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),l.jsx("h2",{children:"ChatGPT (CDP)"})]}),l.jsx(ot,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&l.jsxs("div",{children:[l.jsx("dt",{children:"Endpoint"}),l.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&l.jsxs("div",{children:[l.jsx("dt",{children:"Browser"}),l.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&l.jsxs("div",{children:[l.jsx("dt",{children:"Tabs"}),l.jsx("dd",{children:e.targets.map(v=>l.jsxs("span",{className:"mr-2",children:[v.name,": ",v.alive?"● alive":"○ idle"]},v.name))})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:e?.connected?"Connected to Chrome via CDP. Launch Chrome with --remote-debugging-port to use this provider.":s||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),l.jsx("div",{className:"mt-2",children:l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>c(!r),children:r?"Cancel":e?.connected?"Update endpoint":"Configure"})}),r&&l.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async v=>{v.preventDefault(),y(!0);try{await Kj(d,parseInt(p,10)||9222);const x=await _m().catch(()=>null);x&&t(x),c(!1)}catch(x){a(x instanceof Error?x.message:String(x))}finally{y(!1)}},children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:d,onChange:v=>f(v.target.value),"aria-label":"CDP host"}),l.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:p,onChange:v=>m(v.target.value),"aria-label":"CDP port"})]}),l.jsx("div",{children:l.jsx(le,{type:"submit",size:"sm",disabled:b,children:b?"Saving…":"Save endpoint"})})]})]})}const e3={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function t3(){const e=ol(),{dashboard:t}=ka(),s=t?.settings??e?.dashboard?.settings,c=Qu(!e,e?.health).data??e?.health??e3,[d,f]=N.useState(null),[p,m]=N.useState(!1),[b,y]=N.useState(!1),[v,x]=N.useState(""),[j,S]=N.useState(!1),[C,_]=N.useState(null),[E,R]=N.useState(!1);return s?l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Settings"}),l.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),l.jsxs("section",{className:"settings-grid",children:[s.providerStatuses.map(z=>l.jsxs(He,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),l.jsx("h2",{children:z.name})]}),l.jsx(ot,{tone:z.state==="ready"?"positive":"caution",children:z.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Model"}),l.jsx("dd",{className:"font-mono text-xs",children:z.model})]}),z.quota&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Concurrency"}),l.jsx("dd",{children:z.quota.maxConcurrency})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Rate limit"}),l.jsxs("dd",{children:[z.quota.maxRequestsPerMinute,"/min · ",z.quota.maxRequestsPerDay,"/day"]})]})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:z.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>f(d===z.name?null:z.name),children:d===z.name?"Cancel":z.state==="ready"?z.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),d===z.name&&l.jsx(J4,{providerName:z.name,onSaved:()=>{f(null)}})]},z.name)),l.jsxs(He,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),l.jsx("h2",{children:"Search Console OAuth"})]}),l.jsx(ot,{tone:s.google.state==="ready"?"positive":"caution",children:s.google.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Auth model"}),l.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Storage"}),l.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.google.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":s.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),p&&l.jsx(X4,{onSaved:()=>{m(!1)}})]}),l.jsxs(He,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),l.jsx("h2",{children:"Webmaster Tools"})]}),l.jsx(ot,{tone:s.bing.state==="ready"?"positive":"caution",children:s.bing.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Auth model"}),l.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Storage"}),l.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.bing.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!b),children:b?"Cancel":s.bing.state==="ready"?"Update API key":"Configure Bing"})}),b&&l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),l.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]}),l.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:v,onChange:z=>x(z.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),C&&l.jsx("p",{className:"text-xs text-rose-400",children:C}),E&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),l.jsx(le,{type:"button",size:"sm",disabled:!v.trim()||j,onClick:async()=>{if(v.trim()){S(!0),_(null),R(!1);try{await s1(v.trim()),x(""),R(!0),y(!1)}catch(z){_(z instanceof Error?z.message:"Failed to update Bing API key")}finally{S(!1)}}},children:j?"Saving...":"Save Bing API key"})]})]}),l.jsx(W4,{}),l.jsxs(He,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),l.jsx("h2",{children:"API and worker"})]})}),l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"health-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:"API"}),l.jsx("p",{className:"supporting-copy",children:c.apiStatus.detail})]}),l.jsx(ot,{tone:vu(c.apiStatus),children:c.apiStatus.state==="ok"?"Healthy":"Attention"})]}),l.jsxs("div",{className:"health-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:"Worker"}),l.jsx("p",{className:"supporting-copy",children:c.workerStatus.detail})]}),l.jsx(ot,{tone:vu(c.workerStatus),children:c.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),l.jsx("section",{className:"page-section",children:l.jsxs(He,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),l.jsx("h2",{children:"Operational guidance"})]})}),l.jsx("ul",{className:"detail-list",children:s.selfHostNotes.map(z=>l.jsx("li",{children:z},z))}),l.jsx("p",{className:"supporting-copy",children:s.bootstrapNote})]})})]}):null}const n3=Vu(),s3=[{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 i3({current:e,labels:t}){return l.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((s,a)=>{const r=a<e,c=a===e;return l.jsxs("div",{className:`setup-step ${r?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[l.jsx("span",{className:"setup-step-number",children:r?"✓":a+1}),l.jsx("span",{className:"setup-step-label",children:s.label})]},s.label)})})}function a3(){const e=ol(),{dashboard:t,refetch:s}=ka(),a=t??e?.dashboard??n3.dashboard,r=a.settings,f=Qu(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},p=u5(a.setup,f,r),m=ja(),[b,y]=N.useState(0),[v,x]=N.useState(""),[j,S]=N.useState(""),[C,_]=N.useState(""),[E,R]=N.useState("US"),[z,U]=N.useState("en"),[O,M]=N.useState(null),[A,B]=N.useState(null),[ie,Q]=N.useState(null),[ne,me]=N.useState(!1),[ze,we]=N.useState(""),[q,T]=N.useState(!1),[ae,pe]=N.useState(null),[ee,L]=N.useState(!1),G=r.providerStatuses.filter(te=>te.state==="ready"),[se,re]=N.useState(G[0]?.name??""),[ce,he]=N.useState(5),[de,Fe]=N.useState(!1),[ge,Je]=N.useState(null),[mt,fe]=N.useState(""),[Ye,dt]=N.useState(!1),[Wt,_t]=N.useState(null),[nn,Kt]=N.useState(!1),[kt,wt]=N.useState(!1),[sn,oe]=N.useState(null),[Ue,Pe]=N.useState(!1),ke=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Te=ze.split(`
|
|
239
|
+
`).map(te=>te.trim()).filter(Boolean),zt=mt.split(`
|
|
240
|
+
`).map(te=>te.trim()).filter(Boolean),Qn=p.healthChecks.some(te=>te.id==="api"&&te.state==="ready"),bs=async()=>{if(!(!ke||!C)){me(!0),Q(null);try{const te=await rl(ke,{displayName:j||v,canonicalDomain:C,country:E,language:z});M(ke),B(te.id),s(),y(2)}catch(te){Q(te instanceof Error?te.message:"Failed to create project")}finally{me(!1)}}},Fs=async()=>{if(!O)return;const te=Te;if(te.length!==0){L(!0),pe(null);try{await hj(O,te),T(!0),s(),y(3)}catch(Ie){pe(Ie instanceof Error?Ie.message:"Failed to save key phrases")}finally{L(!1)}}},xs=async()=>{if(!(!O||!se)){Fe(!0),Je(null);try{const te=await Ej(O,se,ce);if(te.keywords.length>0){const Ie=ze?ze.trimEnd()+`
|
|
241
|
+
`+te.keywords.join(`
|
|
242
|
+
`):te.keywords.join(`
|
|
243
|
+
`);we(Ie)}}catch(te){Je(te instanceof Error?te.message:"Failed to generate key phrases")}finally{Fe(!1)}}},Gs=async()=>{if(!O)return;const te=zt;if(te.length!==0){Kt(!0),_t(null);try{await jp(O,te),dt(!0),s(),y(4)}catch(Ie){_t(Ie instanceof Error?Ie.message:"Failed to save competitors")}finally{Kt(!1)}}},os=async()=>{if(O){Pe(!0),oe(null);try{await Np(O),wt(!0),s()}catch(te){oe(te instanceof Error?te.message:"Failed to trigger run")}finally{Pe(!1)}}},Ce=()=>y(te=>Math.max(0,te-1)),wn=(()=>{switch(b){case 0:return l.jsxs(He,{className:"surface-card step-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),l.jsx("h2",{children:"System ready"})]})}),l.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),l.jsx("div",{className:"compact-stack",children:p.healthChecks.map(te=>l.jsxs("div",{className:"health-check-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:te.label}),l.jsx("p",{className:"supporting-copy",children:te.detail}),te.id==="provider"&&te.state!=="ready"&&l.jsx(gt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),l.jsx(ot,{tone:te.state==="ready"?"positive":"caution",children:te.state==="ready"?"Ready":"Attention"})]},te.id))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(le,{type:"button",disabled:!Qn,onClick:()=>y(1),children:"Continue"})]})]});case 1:return l.jsxs(He,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),l.jsx("h2",{children:"Create project"})]}),O?l.jsx(ot,{tone:"positive",children:"Created"}):null]}),O?l.jsxs("div",{className:"compact-stack",children:[l.jsxs("p",{className:"text-zinc-300",children:["Project ",l.jsx("span",{className:"text-zinc-100 font-medium",children:O})," created successfully."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{type:"button",onClick:()=>y(2),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),l.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:te=>x(te.target.value)}),ke&&ke!==v?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",ke]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),l.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:j,onChange:te=>S(te.target.value)})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),l.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:C,onChange:te=>_(te.target.value)})]}),l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),l.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:E,onChange:te=>R(te.target.value.toUpperCase())})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),l.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:z,onChange:te=>U(te.target.value.toLowerCase())})]})]}),ie?l.jsx("p",{className:"text-rose-400 text-sm",children:ie}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{type:"button",disabled:!ke||!C||ne,onClick:bs,children:ne?"Creating...":"Create project"})]})]})]});case 2:return l.jsxs(He,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),l.jsx("h2",{children:"Add key phrases"})]}),q?l.jsxs(ot,{tone:"positive",children:[Te.length," saved"]}):l.jsxs(ot,{tone:"neutral",children:[Te.length," key phrase",Te.length!==1?"s":""]})]}),l.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),q?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:Te.map(te=>l.jsx("li",{children:te},te))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[G.length>0?l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsxs("div",{className:"setup-field flex-1",children:[l.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),l.jsx("select",{id:"gen-provider",className:"setup-input",value:se,onChange:te=>re(te.target.value),children:G.map(te=>l.jsxs("option",{value:te.name,children:[Q4[te.name]??te.name,te.model?` (${te.model})`:""]},te.name))})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),l.jsx("select",{id:"gen-count",className:"setup-input",value:ce,onChange:te=>he(Number(te.target.value)),children:[3,5,10,15,20].map(te=>l.jsx("option",{value:te,children:te},te))})]}),l.jsx(le,{type:"button",variant:"outline",disabled:de||!se,onClick:xs,children:de?"Analyzing site...":"Generate"})]}),ge?l.jsx("p",{className:"text-rose-400 text-sm",children:ge}):null]}):null,l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),l.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
244
|
+
best invisalign downtown brooklyn
|
|
245
|
+
pediatric dentist brooklyn heights`,value:ze,onChange:te=>we(te.target.value)})]}),ae?l.jsx("p",{className:"text-rose-400 text-sm",children:ae}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{type:"button",disabled:Te.length===0||ee,onClick:Fs,children:ee?"Saving...":`Save ${Te.length} key phrase${Te.length!==1?"s":""}`})]})]})]});case 3:return l.jsxs(He,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),l.jsx("h2",{children:"Add competitors"})]}),Ye?l.jsx(ot,{tone:"positive",children:"Saved"}):null]}),l.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),Ye?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:zt.map(te=>l.jsx("li",{children:te},te))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{type:"button",onClick:()=>y(4),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),l.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
246
|
+
competitor2.com`,value:mt,onChange:te=>fe(te.target.value)})]}),Wt?l.jsx("p",{className:"text-rose-400 text-sm",children:Wt}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(le,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),l.jsx(le,{type:"button",disabled:zt.length===0||nn,onClick:Gs,children:nn?"Saving...":`Save ${zt.length} competitor${zt.length!==1?"s":""}`})]})]})]})]});case 4:return l.jsxs(He,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),l.jsx("h2",{children:"Launch first run"})]}),kt?l.jsx(ot,{tone:"positive",children:"Queued"}):null]}),kt?l.jsxs("div",{className:"compact-stack",children:[l.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(le,{type:"button",onClick:()=>m({to:A?`/projects/${A}`:"/"}),children:"Open project"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",l.jsx("span",{className:"text-zinc-100 font-medium",children:O}),"."]}),sn?l.jsx("p",{className:"text-rose-400 text-sm",children:sn}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(le,{type:"button",variant:"outline",onClick:Ce,children:"Back"}),l.jsx(le,{type:"button",disabled:Ue,onClick:os,children:Ue?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Setup"}),l.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),l.jsx(i3,{current:b,labels:s3}),l.jsx("section",{className:"setup-wizard",children:wn})]})}function r3(){return l.jsx("div",{className:"page-container",children:l.jsx("section",{className:"page-section",children:l.jsxs(He,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Route not found"}),l.jsx("p",{children:"The current path does not map to a dashboard view."}),l.jsx(le,{asChild:!0,children:l.jsx(gt,{to:"/",children:"Return to overview"})})]})})})}function o3(){return l.jsx(t5,{children:l.jsx(e5,{})})}const ss=Lz()({component:o3,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),l3=is({getParentRoute:()=>ss,path:"/",component:h5,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ei.projects.all);if(t&&t.length===0)throw Gm({to:"/setup"})}}),c3=is({getParentRoute:()=>ss,path:"/projects",component:C4}),rd=is({getParentRoute:()=>ss,path:"/projects/$projectId",component:()=>l.jsx(np,{})}),u3=is({getParentRoute:()=>rd,path:"/",component:()=>l.jsx(Zp,{tab:"overview"})}),d3=is({getParentRoute:()=>rd,path:"/search-console",component:()=>l.jsx(Zp,{tab:"search-console"})}),f3=is({getParentRoute:()=>rd,path:"/analytics",component:()=>l.jsx(Zp,{tab:"analytics"})}),h3=is({getParentRoute:()=>ss,path:"/runs",component:K4}),m3=is({getParentRoute:()=>ss,path:"/settings",component:t3,beforeLoad:({context:e})=>{}}),p3=is({getParentRoute:()=>ss,path:"/setup",component:a3,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ei.projects.all);if(t&&t.length>0)throw Gm({to:"/"})}}),g3=is({getParentRoute:()=>ss,path:"*",component:r3}),y3=ss.addChildren([l3,c3,rd.addChildren([u3,d3,f3]),h3,m3,p3,g3]);function v3(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Px=v3(),b3=Px==="/"?"":Px.replace(/\/$/,"");function x3(e,t){return Fz({routeTree:y3,basepath:b3||"/",context:{queryClient:e},...t?.initialEntries})}const S3={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 w3(){const e=N.useSyncExternalStore(Xz,Cb,Cb),t=N.useCallback(s=>{NS(s)},[]);return e.length===0?null:l.jsx("div",{"aria-live":"polite","aria-label":"Notifications",className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm",children:e.map(s=>l.jsxs("div",{role:"alert",className:`flex items-start gap-2 rounded-lg border px-3 py-2.5 text-sm shadow-lg backdrop-blur-sm animate-in slide-in-from-bottom-2 ${S3[s.tone]}`,children:[l.jsx("p",{className:"flex-1 leading-snug",children:s.message}),l.jsx("button",{type:"button",onClick:()=>t(s.id),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:l.jsx(Mu,{className:"size-3.5"})})]},s.id))})}const X1=Wz(),j3=x3(X1),W1=document.getElementById("root");if(!W1)throw new Error("Expected #root element for web app bootstrap.");y_.createRoot(W1).render(l.jsx(N.StrictMode,{children:l.jsxs(q_,{client:X1,children:[l.jsx(Vz,{router:j3}),l.jsx(w3,{})]})}));
|