@ainyc/canonry 1.15.0 → 1.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,246 @@
1
+ function pw(e,n){for(var s=0;s<n.length;s++){const l=n[s];if(typeof l!="string"&&!Array.isArray(l)){for(const o in l)if(o!=="default"&&!(o in e)){const u=Object.getOwnPropertyDescriptor(l,o);u&&Object.defineProperty(e,o,u.get?u:{enumerable:!0,get:()=>l[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function s(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(o){if(o.ep)return;o.ep=!0;const u=s(o);fetch(o.href,u)}})();function x0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ud={exports:{}},Zl={};var ey;function gw(){if(ey)return Zl;ey=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(l,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var m in o)m!=="key"&&(u[m]=o[m])}else u=o;return o=u.ref,{$$typeof:e,type:l,key:d,ref:o!==void 0?o:null,props:u}}return Zl.Fragment=n,Zl.jsx=s,Zl.jsxs=s,Zl}var ty;function yw(){return ty||(ty=1,Ud.exports=gw()),Ud.exports}var c=yw(),$d={exports:{}},ke={};var ny;function vw(){if(ny)return ke;ny=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),w=Symbol.iterator;function N(C){return C===null||typeof C!="object"?null:(C=w&&C[w]||C["@@iterator"],typeof C=="function"?C:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,k={};function A(C,G,ne){this.props=C,this.context=G,this.refs=k,this.updater=ne||z}A.prototype.isReactComponent={},A.prototype.setState=function(C,G){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,G,"setState")},A.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function E(){}E.prototype=A.prototype;function O(C,G,ne){this.props=C,this.context=G,this.refs=k,this.updater=ne||z}var D=O.prototype=new E;D.constructor=O,j(D,A.prototype),D.isPureReactComponent=!0;var L=Array.isArray;function H(){}var V={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function Q(C,G,ne){var F=ne.ref;return{$$typeof:e,type:C,key:G,ref:F!==void 0?F:null,props:ne}}function Se(C,G){return Q(C.type,G,C.props)}function ae(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function fe(C){var G={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(ne){return G[ne]})}var Ae=/\/+/g;function qe(C,G){return typeof C=="object"&&C!==null&&C.key!=null?fe(""+C.key):G.toString(36)}function Le(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(H,H):(C.status="pending",C.then(function(G){C.status==="pending"&&(C.status="fulfilled",C.value=G)},function(G){C.status==="pending"&&(C.status="rejected",C.reason=G)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function q(C,G,ne,F,de){var me=typeof C;(me==="undefined"||me==="boolean")&&(C=null);var we=!1;if(C===null)we=!0;else switch(me){case"bigint":case"string":case"number":we=!0;break;case"object":switch(C.$$typeof){case e:case n:we=!0;break;case b:return we=C._init,q(we(C._payload),G,ne,F,de)}}if(we)return de=de(C),we=F===""?"."+qe(C,0):F,L(de)?(ne="",we!=null&&(ne=we.replace(Ae,"$&/")+"/"),q(de,G,ne,"",function(Ze){return Ze})):de!=null&&(ae(de)&&(de=Se(de,ne+(de.key==null||C&&C.key===de.key?"":(""+de.key).replace(Ae,"$&/")+"/")+we)),G.push(de)),1;we=0;var $=F===""?".":F+":";if(L(C))for(var ie=0;ie<C.length;ie++)F=C[ie],me=$+qe(F,ie),we+=q(F,G,ne,me,de);else if(ie=N(C),typeof ie=="function")for(C=ie.call(C),ie=0;!(F=C.next()).done;)F=F.value,me=$+qe(F,ie++),we+=q(F,G,ne,me,de);else if(me==="object"){if(typeof C.then=="function")return q(Le(C),G,ne,F,de);throw G=String(C),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return we}function K(C,G,ne){if(C==null)return C;var F=[],de=0;return q(C,F,"","",function(me){return G.call(ne,me,de++)}),F}function se(C){if(C._status===-1){var G=C._result;G=G(),G.then(function(ne){(C._status===0||C._status===-1)&&(C._status=1,C._result=ne)},function(ne){(C._status===0||C._status===-1)&&(C._status=2,C._result=ne)}),C._status===-1&&(C._status=0,C._result=G)}if(C._status===1)return C._result.default;throw C._result}var he=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},te={map:K,forEach:function(C,G,ne){K(C,function(){G.apply(this,arguments)},ne)},count:function(C){var G=0;return K(C,function(){G++}),G},toArray:function(C){return K(C,function(G){return G})||[]},only:function(C){if(!ae(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return ke.Activity=v,ke.Children=te,ke.Component=A,ke.Fragment=s,ke.Profiler=o,ke.PureComponent=O,ke.StrictMode=l,ke.Suspense=g,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,ke.__COMPILER_RUNTIME={__proto__:null,c:function(C){return V.H.useMemoCache(C)}},ke.cache=function(C){return function(){return C.apply(null,arguments)}},ke.cacheSignal=function(){return null},ke.cloneElement=function(C,G,ne){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var F=j({},C.props),de=C.key;if(G!=null)for(me in G.key!==void 0&&(de=""+G.key),G)!R.call(G,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&G.ref===void 0||(F[me]=G[me]);var me=arguments.length-2;if(me===1)F.children=ne;else if(1<me){for(var we=Array(me),$=0;$<me;$++)we[$]=arguments[$+2];F.children=we}return Q(C.type,de,F)},ke.createContext=function(C){return C={$$typeof:d,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:u,_context:C},C},ke.createElement=function(C,G,ne){var F,de={},me=null;if(G!=null)for(F in G.key!==void 0&&(me=""+G.key),G)R.call(G,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(de[F]=G[F]);var we=arguments.length-2;if(we===1)de.children=ne;else if(1<we){for(var $=Array(we),ie=0;ie<we;ie++)$[ie]=arguments[ie+2];de.children=$}if(C&&C.defaultProps)for(F in we=C.defaultProps,we)de[F]===void 0&&(de[F]=we[F]);return Q(C,me,de)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(C){return{$$typeof:m,render:C}},ke.isValidElement=ae,ke.lazy=function(C){return{$$typeof:b,_payload:{_status:-1,_result:C},_init:se}},ke.memo=function(C,G){return{$$typeof:p,type:C,compare:G===void 0?null:G}},ke.startTransition=function(C){var G=V.T,ne={};V.T=ne;try{var F=C(),de=V.S;de!==null&&de(ne,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(H,he)}catch(me){he(me)}finally{G!==null&&ne.types!==null&&(G.types=ne.types),V.T=G}},ke.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},ke.use=function(C){return V.H.use(C)},ke.useActionState=function(C,G,ne){return V.H.useActionState(C,G,ne)},ke.useCallback=function(C,G){return V.H.useCallback(C,G)},ke.useContext=function(C){return V.H.useContext(C)},ke.useDebugValue=function(){},ke.useDeferredValue=function(C,G){return V.H.useDeferredValue(C,G)},ke.useEffect=function(C,G){return V.H.useEffect(C,G)},ke.useEffectEvent=function(C){return V.H.useEffectEvent(C)},ke.useId=function(){return V.H.useId()},ke.useImperativeHandle=function(C,G,ne){return V.H.useImperativeHandle(C,G,ne)},ke.useInsertionEffect=function(C,G){return V.H.useInsertionEffect(C,G)},ke.useLayoutEffect=function(C,G){return V.H.useLayoutEffect(C,G)},ke.useMemo=function(C,G){return V.H.useMemo(C,G)},ke.useOptimistic=function(C,G){return V.H.useOptimistic(C,G)},ke.useReducer=function(C,G,ne){return V.H.useReducer(C,G,ne)},ke.useRef=function(C){return V.H.useRef(C)},ke.useState=function(C){return V.H.useState(C)},ke.useSyncExternalStore=function(C,G,ne){return V.H.useSyncExternalStore(C,G,ne)},ke.useTransition=function(){return V.H.useTransition()},ke.version="19.2.4",ke}var iy;function zf(){return iy||(iy=1,$d.exports=vw()),$d.exports}var x=zf();const bw=x0(x),_f=pw({__proto__:null,default:bw},[x]);var Bd={exports:{}},Hl={},Id={exports:{}},qd={};var sy;function xw(){return sy||(sy=1,(function(e){function n(q,K){var se=q.length;q.push(K);e:for(;0<se;){var he=se-1>>>1,te=q[he];if(0<o(te,K))q[he]=K,q[se]=te,se=he;else break e}}function s(q){return q.length===0?null:q[0]}function l(q){if(q.length===0)return null;var K=q[0],se=q.pop();if(se!==K){q[0]=se;e:for(var he=0,te=q.length,C=te>>>1;he<C;){var G=2*(he+1)-1,ne=q[G],F=G+1,de=q[F];if(0>o(ne,se))F<te&&0>o(de,ne)?(q[he]=de,q[F]=se,he=F):(q[he]=ne,q[G]=se,he=G);else if(F<te&&0>o(de,se))q[he]=de,q[F]=se,he=F;else break e}}return K}function o(q,K){var se=q.sortIndex-K.sortIndex;return se!==0?se:q.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,m=d.now();e.unstable_now=function(){return d.now()-m}}var g=[],p=[],b=1,v=null,w=3,N=!1,z=!1,j=!1,k=!1,A=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function D(q){for(var K=s(p);K!==null;){if(K.callback===null)l(p);else if(K.startTime<=q)l(p),K.sortIndex=K.expirationTime,n(g,K);else break;K=s(p)}}function L(q){if(j=!1,D(q),!z)if(s(g)!==null)z=!0,H||(H=!0,fe());else{var K=s(p);K!==null&&Le(L,K.startTime-q)}}var H=!1,V=-1,R=5,Q=-1;function Se(){return k?!0:!(e.unstable_now()-Q<R)}function ae(){if(k=!1,H){var q=e.unstable_now();Q=q;var K=!0;try{e:{z=!1,j&&(j=!1,E(V),V=-1),N=!0;var se=w;try{t:{for(D(q),v=s(g);v!==null&&!(v.expirationTime>q&&Se());){var he=v.callback;if(typeof he=="function"){v.callback=null,w=v.priorityLevel;var te=he(v.expirationTime<=q);if(q=e.unstable_now(),typeof te=="function"){v.callback=te,D(q),K=!0;break t}v===s(g)&&l(g),D(q)}else l(g);v=s(g)}if(v!==null)K=!0;else{var C=s(p);C!==null&&Le(L,C.startTime-q),K=!1}}break e}finally{v=null,w=se,N=!1}K=void 0}}finally{K?fe():H=!1}}}var fe;if(typeof O=="function")fe=function(){O(ae)};else if(typeof MessageChannel<"u"){var Ae=new MessageChannel,qe=Ae.port2;Ae.port1.onmessage=ae,fe=function(){qe.postMessage(null)}}else fe=function(){A(ae,0)};function Le(q,K){V=A(function(){q(e.unstable_now())},K)}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"):R=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(q){switch(w){case 1:case 2:case 3:var K=3;break;default:K=w}var se=w;w=K;try{return q()}finally{w=se}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(q,K){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var se=w;w=q;try{return K()}finally{w=se}},e.unstable_scheduleCallback=function(q,K,se){var he=e.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?he+se:he):se=he,q){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=se+te,q={id:b++,callback:K,priorityLevel:q,startTime:se,expirationTime:te,sortIndex:-1},se>he?(q.sortIndex=se,n(p,q),s(g)===null&&q===s(p)&&(j?(E(V),V=-1):j=!0,Le(L,se-he))):(q.sortIndex=te,n(g,q),z||N||(z=!0,H||(H=!0,fe()))),q},e.unstable_shouldYield=Se,e.unstable_wrapCallback=function(q){var K=w;return function(){var se=w;w=K;try{return q.apply(this,arguments)}finally{w=se}}}})(qd)),qd}var ay;function Sw(){return ay||(ay=1,Id.exports=xw()),Id.exports}var Zd={exports:{}},Qt={};var ly;function ww(){if(ly)return Qt;ly=1;var e=zf();function n(g){var p="https://react.dev/errors/"+g;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var l={d:{f:s,r:function(){throw Error(n(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(g,p,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:g,containerInfo:p,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,p){if(g==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Qt.createPortal=function(g,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return u(g,p,null,b)},Qt.flushSync=function(g){var p=d.T,b=l.p;try{if(d.T=null,l.p=2,g)return g()}finally{d.T=p,l.p=b,l.d.f()}},Qt.preconnect=function(g,p){typeof g=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(g,p))},Qt.prefetchDNS=function(g){typeof g=="string"&&l.d.D(g)},Qt.preinit=function(g,p){if(typeof g=="string"&&p&&typeof p.as=="string"){var b=p.as,v=m(b,p.crossOrigin),w=typeof p.integrity=="string"?p.integrity:void 0,N=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;b==="style"?l.d.S(g,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:w,fetchPriority:N}):b==="script"&&l.d.X(g,{crossOrigin:v,integrity:w,fetchPriority:N,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Qt.preinitModule=function(g,p){if(typeof g=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var b=m(p.as,p.crossOrigin);l.d.M(g,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(g)},Qt.preload=function(g,p){if(typeof g=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var b=p.as,v=m(b,p.crossOrigin);l.d.L(g,b,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Qt.preloadModule=function(g,p){if(typeof g=="string")if(p){var b=m(p.as,p.crossOrigin);l.d.m(g,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(g)},Qt.requestFormReset=function(g){l.d.r(g)},Qt.unstable_batchedUpdates=function(g,p){return g(p)},Qt.useFormState=function(g,p,b){return d.H.useFormState(g,p,b)},Qt.useFormStatus=function(){return d.H.useHostTransitionStatus()},Qt.version="19.2.4",Qt}var ry;function S0(){if(ry)return Zd.exports;ry=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(n){console.error(n)}}return e(),Zd.exports=ww(),Zd.exports}var oy;function jw(){if(oy)return Hl;oy=1;var e=Sw(),n=zf(),s=S0();function l(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var i=t,a=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(a=i.return),t=i.return;while(t)}return i.tag===3?a:null}function d(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function m(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function g(t){if(u(t)!==t)throw Error(l(188))}function p(t){var i=t.alternate;if(!i){if(i=u(t),i===null)throw Error(l(188));return i!==t?null:t}for(var a=t,r=i;;){var f=a.return;if(f===null)break;var h=f.alternate;if(h===null){if(r=f.return,r!==null){a=r;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===a)return g(f),t;if(h===r)return g(f),i;h=h.sibling}throw Error(l(188))}if(a.return!==r.return)a=f,r=h;else{for(var y=!1,S=f.child;S;){if(S===a){y=!0,a=f,r=h;break}if(S===r){y=!0,r=f,a=h;break}S=S.sibling}if(!y){for(S=h.child;S;){if(S===a){y=!0,a=h,r=f;break}if(S===r){y=!0,r=h,a=f;break}S=S.sibling}if(!y)throw Error(l(189))}}if(a.alternate!==r)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?t:i}function b(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=b(t),i!==null)return i;t=t.sibling}return null}var v=Object.assign,w=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),O=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),Se=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function fe(t){return t===null||typeof t!="object"?null:(t=ae&&t[ae]||t["@@iterator"],typeof t=="function"?t:null)}var Ae=Symbol.for("react.client.reference");function qe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ae?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case j:return"Fragment";case A:return"Profiler";case k:return"StrictMode";case L:return"Suspense";case H:return"SuspenseList";case Q:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case z:return"Portal";case O:return t.displayName||"Context";case E:return(t._context.displayName||"Context")+".Consumer";case D:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case V:return i=t.displayName||null,i!==null?i:qe(t.type)||"Memo";case R:i=t._payload,t=t._init;try{return qe(t(i))}catch{}}return null}var Le=Array.isArray,q=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},he=[],te=-1;function C(t){return{current:t}}function G(t){0>te||(t.current=he[te],he[te]=null,te--)}function ne(t,i){te++,he[te]=t.current,t.current=i}var F=C(null),de=C(null),me=C(null),we=C(null);function $(t,i){switch(ne(me,i),ne(de,t),ne(F,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?jg(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=jg(i),t=Ng(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}G(F),ne(F,t)}function ie(){G(F),G(de),G(me)}function Ze(t){t.memoizedState!==null&&ne(we,t);var i=F.current,a=Ng(i,t.type);i!==a&&(ne(de,t),ne(F,a))}function le(t){de.current===t&&(G(F),G(de)),we.current===t&&(G(we),$l._currentValue=se)}var Ie,Mt;function ut(t){if(Ie===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);Ie=i&&i[1]||"",Mt=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Ie+t+Mt}var zt=!1;function Un(t,i){if(!t||zt)return"";zt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={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(Y){var Z=Y}Reflect.construct(t,[],W)}else{try{W.call()}catch(Y){Z=Y}t.call(W.prototype)}}else{try{throw Error()}catch(Y){Z=Y}(W=t())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(Y){if(Y&&Z&&typeof Y.stack=="string")return[Y.stack,Z.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=r.DetermineComponentFrameRoot(),y=h[0],S=h[1];if(y&&S){var _=y.split(`
4
+ `),I=S.split(`
5
+ `);for(f=r=0;r<_.length&&!_[r].includes("DetermineComponentFrameRoot");)r++;for(;f<I.length&&!I[f].includes("DetermineComponentFrameRoot");)f++;if(r===_.length||f===I.length)for(r=_.length-1,f=I.length-1;1<=r&&0<=f&&_[r]!==I[f];)f--;for(;1<=r&&0<=f;r--,f--)if(_[r]!==I[f]){if(r!==1||f!==1)do if(r--,f--,0>f||_[r]!==I[f]){var P=`
6
+ `+_[r].replace(" at new "," at ");return t.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",t.displayName)),P}while(1<=r&&0<=f);break}}}finally{zt=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?ut(a):""}function li(t,i){switch(t.tag){case 26:case 27:case 5:return ut(t.type);case 16:return ut("Lazy");case 13:return t.child!==i&&i!==null?ut("Suspense Fallback"):ut("Suspense");case 19:return ut("SuspenseList");case 0:case 15:return Un(t.type,!1);case 11:return Un(t.type.render,!1);case 1:return Un(t.type,!0);case 31:return ut("Activity");default:return""}}function Sn(t){try{var i="",a=null;do i+=li(t,a),a=t,t=t.return;while(t);return i}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var Yt=Object.prototype.hasOwnProperty,dt=e.unstable_scheduleCallback,It=e.unstable_cancelCallback,Pn=e.unstable_shouldYield,Qn=e.unstable_requestPaint,_t=e.unstable_now,re=e.unstable_getCurrentPriorityLevel,De=e.unstable_ImmediatePriority,Lt=e.unstable_UserBlockingPriority,Ct=e.unstable_NormalPriority,tn=e.unstable_LowPriority,oe=e.unstable_IdlePriority,un=e.log,lr=e.unstable_setDisableYieldValue,Xe=null,Vt=null;function yt(t){if(typeof un=="function"&&lr(t),Vt&&typeof Vt.setStrictMode=="function")try{Vt.setStrictMode(Xe,t)}catch{}}var Ee=Math.clz32?Math.clz32:Wa,Cc=Math.log,rr=Math.LN2;function Wa(t){return t>>>=0,t===0?32:31-(Cc(t)/rr|0)|0}var ri=256,ys=262144,oi=4194304;function Xn(t){var i=t&42;if(i!==0)return i;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Vs(t,i,a){var r=t.pendingLanes;if(r===0)return 0;var f=0,h=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var S=r&134217727;return S!==0?(r=S&~h,r!==0?f=Xn(r):(y&=S,y!==0?f=Xn(y):a||(a=S&~t,a!==0&&(f=Xn(a))))):(S=r&~h,S!==0?f=Xn(S):y!==0?f=Xn(y):a||(a=r&~t,a!==0&&(f=Xn(a)))),f===0?0:i!==0&&i!==f&&(i&h)===0&&(h=f&-f,a=i&-i,h>=a||h===32&&(a&4194048)!==0)?i:f}function Oi(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function Ec(t,i){switch(t){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 or(){var t=oi;return oi<<=1,(oi&62914560)===0&&(oi=4194304),t}function el(t){for(var i=[],a=0;31>a;a++)i.push(t);return i}function vs(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function cr(t,i,a,r,f,h){var y=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var S=t.entanglements,_=t.expirationTimes,I=t.hiddenUpdates;for(a=y&~a;0<a;){var P=31-Ee(a),W=1<<P;S[P]=0,_[P]=-1;var Z=I[P];if(Z!==null)for(I[P]=null,P=0;P<Z.length;P++){var Y=Z[P];Y!==null&&(Y.lane&=-536870913)}a&=~W}r!==0&&M(t,r,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(y&~i))}function M(t,i,a){t.pendingLanes|=i,t.suspendedLanes&=~i;var r=31-Ee(i);t.entangledLanes|=i,t.entanglements[r]=t.entanglements[r]|1073741824|a&261930}function ue(t,i){var a=t.entangledLanes|=i;for(t=t.entanglements;a;){var r=31-Ee(a),f=1<<r;f&i|t[r]&i&&(t[r]|=i),a&=~f}}function at(t,i){var a=i&-i;return a=(a&42)!==0?1:vt(a),(a&(t.suspendedLanes|i))!==0?0:a}function vt(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Xt(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Jn(){var t=K.p;return t!==0?t:(t=window.event,t===void 0?32:Vg(t.type))}function bs(t,i){var a=K.p;try{return K.p=t,i()}finally{K.p=a}}var dn=Math.random().toString(36).slice(2),Ve="__reactFiber$"+dn,Pt="__reactProps$"+dn,fn="__reactContainer$"+dn,ci="__reactEvents$"+dn,Ps="__reactListeners$"+dn,ur="__reactHandles$"+dn,dr="__reactResources$"+dn,Fn="__reactMarker$"+dn;function Di(t){delete t[Ve],delete t[Pt],delete t[ci],delete t[Ps],delete t[ur]}function Ri(t){var i=t[Ve];if(i)return i;for(var a=t.parentNode;a;){if(i=a[fn]||a[Ve]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(t=Tg(t);t!==null;){if(a=t[Ve])return a;t=Tg(t)}return i}t=a,a=t.parentNode}return null}function Mi(t){if(t=t[Ve]||t[fn]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function Te(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(l(33))}function He(t){var i=t[dr];return i||(i=t[dr]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Pe(t){t[Fn]=!0}var $n=new Set,xs={};function Wn(t,i){Qs(t,i),Qs(t+"Capture",i)}function Qs(t,i){for(xs[t]=i,t=0;t<i.length;t++)$n.add(i[t])}var lx=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]*$"),hh={},mh={};function rx(t){return Yt.call(mh,t)?!0:Yt.call(hh,t)?!1:lx.test(t)?mh[t]=!0:(hh[t]=!0,!1)}function fr(t,i,a){if(rx(i))if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var r=i.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+a)}}function hr(t,i,a){if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+a)}}function ui(t,i,a,r){if(r===null)t.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(i,a,""+r)}}function wn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ph(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ox(t,i,a){var r=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var f=r.get,h=r.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return f.call(this)},set:function(y){a=""+y,h.call(this,y)}}),Object.defineProperty(t,i,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(y){a=""+y},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function Ac(t){if(!t._valueTracker){var i=ph(t)?"checked":"value";t._valueTracker=ox(t,i,""+t[i])}}function gh(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var a=i.getValue(),r="";return t&&(r=ph(t)?t.checked?"true":"false":t.value),t=r,t!==a?(i.setValue(t),!0):!1}function mr(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var cx=/[\n"\\]/g;function jn(t){return t.replace(cx,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Tc(t,i,a,r,f,h,y,S){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),i!=null?y==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+wn(i)):t.value!==""+wn(i)&&(t.value=""+wn(i)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),i!=null?Oc(t,y,wn(i)):a!=null?Oc(t,y,wn(a)):r!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+wn(S):t.removeAttribute("name")}function yh(t,i,a,r,f,h,y,S){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),i!=null||a!=null){if(!(h!=="submit"&&h!=="reset"||i!=null)){Ac(t);return}a=a!=null?""+wn(a):"",i=i!=null?""+wn(i):a,S||i===t.value||(t.value=i),t.defaultValue=i}r=r??f,r=typeof r!="function"&&typeof r!="symbol"&&!!r,t.checked=S?t.checked:!!r,t.defaultChecked=!!r,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Ac(t)}function Oc(t,i,a){i==="number"&&mr(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Xs(t,i,a,r){if(t=t.options,i){i={};for(var f=0;f<a.length;f++)i["$"+a[f]]=!0;for(a=0;a<t.length;a++)f=i.hasOwnProperty("$"+t[a].value),t[a].selected!==f&&(t[a].selected=f),f&&r&&(t[a].defaultSelected=!0)}else{for(a=""+wn(a),i=null,f=0;f<t.length;f++){if(t[f].value===a){t[f].selected=!0,r&&(t[f].defaultSelected=!0);return}i!==null||t[f].disabled||(i=t[f])}i!==null&&(i.selected=!0)}}function vh(t,i,a){if(i!=null&&(i=""+wn(i),i!==t.value&&(t.value=i),a==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=a!=null?""+wn(a):""}function bh(t,i,a,r){if(i==null){if(r!=null){if(a!=null)throw Error(l(92));if(Le(r)){if(1<r.length)throw Error(l(93));r=r[0]}a=r}a==null&&(a=""),i=a}a=wn(i),t.defaultValue=a,r=t.textContent,r===a&&r!==""&&r!==null&&(t.value=r),Ac(t)}function Js(t,i){if(i){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=i;return}}t.textContent=i}var ux=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 xh(t,i,a){var r=i.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":r?t.setProperty(i,a):typeof a!="number"||a===0||ux.has(i)?i==="float"?t.cssFloat=a:t[i]=(""+a).trim():t[i]=a+"px"}function Sh(t,i,a){if(i!=null&&typeof i!="object")throw Error(l(62));if(t=t.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||i!=null&&i.hasOwnProperty(r)||(r.indexOf("--")===0?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="");for(var f in i)r=i[f],i.hasOwnProperty(f)&&a[f]!==r&&xh(t,f,r)}else for(var h in i)i.hasOwnProperty(h)&&xh(t,h,i[h])}function Dc(t){if(t.indexOf("-")===-1)return!1;switch(t){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 dx=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"]]),fx=/^[\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 pr(t){return fx.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function di(){}var Rc=null;function Mc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Fs=null,Ws=null;function wh(t){var i=Mi(t);if(i&&(t=i.stateNode)){var a=t[Pt]||null;e:switch(t=i.stateNode,i.type){case"input":if(Tc(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),i=a.name,a.type==="radio"&&i!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+jn(""+i)+'"][type="radio"]'),i=0;i<a.length;i++){var r=a[i];if(r!==t&&r.form===t.form){var f=r[Pt]||null;if(!f)throw Error(l(90));Tc(r,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<a.length;i++)r=a[i],r.form===t.form&&gh(r)}break e;case"textarea":vh(t,a.value,a.defaultValue);break e;case"select":i=a.value,i!=null&&Xs(t,!!a.multiple,i,!1)}}}var Lc=!1;function jh(t,i,a){if(Lc)return t(i,a);Lc=!0;try{var r=t(i);return r}finally{if(Lc=!1,(Fs!==null||Ws!==null)&&(no(),Fs&&(i=Fs,t=Ws,Ws=Fs=null,wh(i),t)))for(i=0;i<t.length;i++)wh(t[i])}}function tl(t,i){var a=t.stateNode;if(a===null)return null;var r=a[Pt]||null;if(r===null)return null;a=r[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":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(l(231,i,typeof a));return a}var fi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uc=!1;if(fi)try{var nl={};Object.defineProperty(nl,"passive",{get:function(){Uc=!0}}),window.addEventListener("test",nl,nl),window.removeEventListener("test",nl,nl)}catch{Uc=!1}var Li=null,$c=null,gr=null;function Nh(){if(gr)return gr;var t,i=$c,a=i.length,r,f="value"in Li?Li.value:Li.textContent,h=f.length;for(t=0;t<a&&i[t]===f[t];t++);var y=a-t;for(r=1;r<=y&&i[a-r]===f[h-r];r++);return gr=f.slice(t,1<r?1-r:void 0)}function yr(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function vr(){return!0}function kh(){return!1}function nn(t){function i(a,r,f,h,y){this._reactName=a,this._targetInst=f,this.type=r,this.nativeEvent=h,this.target=y,this.currentTarget=null;for(var S in t)t.hasOwnProperty(S)&&(a=t[S],this[S]=a?a(h):h[S]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?vr:kh,this.isPropagationStopped=kh,this}return v(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=vr)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=vr)},persist:function(){},isPersistent:vr}),i}var Ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},br=nn(Ss),il=v({},Ss,{view:0,detail:0}),hx=nn(il),Bc,Ic,sl,xr=v({},il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zc,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==sl&&(sl&&t.type==="mousemove"?(Bc=t.screenX-sl.screenX,Ic=t.screenY-sl.screenY):Ic=Bc=0,sl=t),Bc)},movementY:function(t){return"movementY"in t?t.movementY:Ic}}),zh=nn(xr),mx=v({},xr,{dataTransfer:0}),px=nn(mx),gx=v({},il,{relatedTarget:0}),qc=nn(gx),yx=v({},Ss,{animationName:0,elapsedTime:0,pseudoElement:0}),vx=nn(yx),bx=v({},Ss,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),xx=nn(bx),Sx=v({},Ss,{data:0}),_h=nn(Sx),wx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jx={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"},Nx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kx(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=Nx[t])?!!i[t]:!1}function Zc(){return kx}var zx=v({},il,{key:function(t){if(t.key){var i=wx[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=yr(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?jx[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zc,charCode:function(t){return t.type==="keypress"?yr(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?yr(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),_x=nn(zx),Cx=v({},xr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ch=nn(Cx),Ex=v({},il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zc}),Ax=nn(Ex),Tx=v({},Ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ox=nn(Tx),Dx=v({},xr,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Rx=nn(Dx),Mx=v({},Ss,{newState:0,oldState:0}),Lx=nn(Mx),Ux=[9,13,27,32],Hc=fi&&"CompositionEvent"in window,al=null;fi&&"documentMode"in document&&(al=document.documentMode);var $x=fi&&"TextEvent"in window&&!al,Eh=fi&&(!Hc||al&&8<al&&11>=al),Ah=" ",Th=!1;function Oh(t,i){switch(t){case"keyup":return Ux.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ea=!1;function Bx(t,i){switch(t){case"compositionend":return Dh(i);case"keypress":return i.which!==32?null:(Th=!0,Ah);case"textInput":return t=i.data,t===Ah&&Th?null:t;default:return null}}function Ix(t,i){if(ea)return t==="compositionend"||!Hc&&Oh(t,i)?(t=Nh(),gr=$c=Li=null,ea=!1,t):null;switch(t){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 Eh&&i.locale!=="ko"?null:i.data;default:return null}}var qx={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 Rh(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!qx[t.type]:i==="textarea"}function Mh(t,i,a,r){Fs?Ws?Ws.push(r):Ws=[r]:Fs=r,i=co(i,"onChange"),0<i.length&&(a=new br("onChange","change",null,a,r),t.push({event:a,listeners:i}))}var ll=null,rl=null;function Zx(t){yg(t,0)}function Sr(t){var i=Te(t);if(gh(i))return t}function Lh(t,i){if(t==="change")return i}var Uh=!1;if(fi){var Gc;if(fi){var Kc="oninput"in document;if(!Kc){var $h=document.createElement("div");$h.setAttribute("oninput","return;"),Kc=typeof $h.oninput=="function"}Gc=Kc}else Gc=!1;Uh=Gc&&(!document.documentMode||9<document.documentMode)}function Bh(){ll&&(ll.detachEvent("onpropertychange",Ih),rl=ll=null)}function Ih(t){if(t.propertyName==="value"&&Sr(rl)){var i=[];Mh(i,rl,t,Mc(t)),jh(Zx,i)}}function Hx(t,i,a){t==="focusin"?(Bh(),ll=i,rl=a,ll.attachEvent("onpropertychange",Ih)):t==="focusout"&&Bh()}function Gx(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Sr(rl)}function Kx(t,i){if(t==="click")return Sr(i)}function Yx(t,i){if(t==="input"||t==="change")return Sr(i)}function Vx(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var hn=typeof Object.is=="function"?Object.is:Vx;function ol(t,i){if(hn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var a=Object.keys(t),r=Object.keys(i);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var f=a[r];if(!Yt.call(i,f)||!hn(t[f],i[f]))return!1}return!0}function qh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Zh(t,i){var a=qh(t);t=0;for(var r;a;){if(a.nodeType===3){if(r=t+a.textContent.length,t<=i&&r>=i)return{node:a,offset:i-t};t=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=qh(a)}}function Hh(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Hh(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Gh(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=mr(t.document);i instanceof t.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)t=i.contentWindow;else break;i=mr(t.document)}return i}function Yc(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var Px=fi&&"documentMode"in document&&11>=document.documentMode,ta=null,Vc=null,cl=null,Pc=!1;function Kh(t,i,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Pc||ta==null||ta!==mr(r)||(r=ta,"selectionStart"in r&&Yc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),cl&&ol(cl,r)||(cl=r,r=co(Vc,"onSelect"),0<r.length&&(i=new br("onSelect","select",null,i,a),t.push({event:i,listeners:r}),i.target=ta)))}function ws(t,i){var a={};return a[t.toLowerCase()]=i.toLowerCase(),a["Webkit"+t]="webkit"+i,a["Moz"+t]="moz"+i,a}var na={animationend:ws("Animation","AnimationEnd"),animationiteration:ws("Animation","AnimationIteration"),animationstart:ws("Animation","AnimationStart"),transitionrun:ws("Transition","TransitionRun"),transitionstart:ws("Transition","TransitionStart"),transitioncancel:ws("Transition","TransitionCancel"),transitionend:ws("Transition","TransitionEnd")},Qc={},Yh={};fi&&(Yh=document.createElement("div").style,"AnimationEvent"in window||(delete na.animationend.animation,delete na.animationiteration.animation,delete na.animationstart.animation),"TransitionEvent"in window||delete na.transitionend.transition);function js(t){if(Qc[t])return Qc[t];if(!na[t])return t;var i=na[t],a;for(a in i)if(i.hasOwnProperty(a)&&a in Yh)return Qc[t]=i[a];return t}var Vh=js("animationend"),Ph=js("animationiteration"),Qh=js("animationstart"),Qx=js("transitionrun"),Xx=js("transitionstart"),Jx=js("transitioncancel"),Xh=js("transitionend"),Jh=new Map,Xc="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(" ");Xc.push("scrollEnd");function Bn(t,i){Jh.set(t,i),Wn(i,[t])}var wr=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Nn=[],ia=0,Jc=0;function jr(){for(var t=ia,i=Jc=ia=0;i<t;){var a=Nn[i];Nn[i++]=null;var r=Nn[i];Nn[i++]=null;var f=Nn[i];Nn[i++]=null;var h=Nn[i];if(Nn[i++]=null,r!==null&&f!==null){var y=r.pending;y===null?f.next=f:(f.next=y.next,y.next=f),r.pending=f}h!==0&&Fh(a,f,h)}}function Nr(t,i,a,r){Nn[ia++]=t,Nn[ia++]=i,Nn[ia++]=a,Nn[ia++]=r,Jc|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function Fc(t,i,a,r){return Nr(t,i,a,r),kr(t)}function Ns(t,i){return Nr(t,null,null,i),kr(t)}function Fh(t,i,a){t.lanes|=a;var r=t.alternate;r!==null&&(r.lanes|=a);for(var f=!1,h=t.return;h!==null;)h.childLanes|=a,r=h.alternate,r!==null&&(r.childLanes|=a),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&i!==null&&(f=31-Ee(a),t=h.hiddenUpdates,r=t[f],r===null?t[f]=[i]:r.push(i),i.lane=a|536870912),h):null}function kr(t){if(50<Tl)throw Tl=0,rd=null,Error(l(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var sa={};function Fx(t,i,a,r){this.tag=t,this.key=a,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(t,i,a,r){return new Fx(t,i,a,r)}function Wc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function hi(t,i){var a=t.alternate;return a===null?(a=mn(t.tag,i,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=i,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,i=t.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Wh(t,i){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,i=a.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function zr(t,i,a,r,f,h){var y=0;if(r=t,typeof t=="function")Wc(t)&&(y=1);else if(typeof t=="string")y=iw(t,a,F.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Q:return t=mn(31,a,i,f),t.elementType=Q,t.lanes=h,t;case j:return ks(a.children,f,h,i);case k:y=8,f|=24;break;case A:return t=mn(12,a,i,f|2),t.elementType=A,t.lanes=h,t;case L:return t=mn(13,a,i,f),t.elementType=L,t.lanes=h,t;case H:return t=mn(19,a,i,f),t.elementType=H,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case O:y=10;break e;case E:y=9;break e;case D:y=11;break e;case V:y=14;break e;case R:y=16,r=null;break e}y=29,a=Error(l(130,t===null?"null":typeof t,"")),r=null}return i=mn(y,a,i,f),i.elementType=t,i.type=r,i.lanes=h,i}function ks(t,i,a,r){return t=mn(7,t,r,i),t.lanes=a,t}function eu(t,i,a){return t=mn(6,t,null,i),t.lanes=a,t}function em(t){var i=mn(18,null,null,0);return i.stateNode=t,i}function tu(t,i,a){return i=mn(4,t.children!==null?t.children:[],t.key,i),i.lanes=a,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var tm=new WeakMap;function kn(t,i){if(typeof t=="object"&&t!==null){var a=tm.get(t);return a!==void 0?a:(i={value:t,source:i,stack:Sn(i)},tm.set(t,i),i)}return{value:t,source:i,stack:Sn(i)}}var aa=[],la=0,_r=null,ul=0,zn=[],_n=0,Ui=null,ei=1,ti="";function mi(t,i){aa[la++]=ul,aa[la++]=_r,_r=t,ul=i}function nm(t,i,a){zn[_n++]=ei,zn[_n++]=ti,zn[_n++]=Ui,Ui=t;var r=ei;t=ti;var f=32-Ee(r)-1;r&=~(1<<f),a+=1;var h=32-Ee(i)+f;if(30<h){var y=f-f%5;h=(r&(1<<y)-1).toString(32),r>>=y,f-=y,ei=1<<32-Ee(i)+f|a<<f|r,ti=h+t}else ei=1<<h|a<<f|r,ti=t}function nu(t){t.return!==null&&(mi(t,1),nm(t,1,0))}function iu(t){for(;t===_r;)_r=aa[--la],aa[la]=null,ul=aa[--la],aa[la]=null;for(;t===Ui;)Ui=zn[--_n],zn[_n]=null,ti=zn[--_n],zn[_n]=null,ei=zn[--_n],zn[_n]=null}function im(t,i){zn[_n++]=ei,zn[_n++]=ti,zn[_n++]=Ui,ei=i.id,ti=i.overflow,Ui=t}var qt=null,lt=null,Be=!1,$i=null,Cn=!1,su=Error(l(519));function Bi(t){var i=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw dl(kn(i,t)),su}function sm(t){var i=t.stateNode,a=t.type,r=t.memoizedProps;switch(i[Ve]=t,i[Pt]=r,a){case"dialog":Me("cancel",i),Me("close",i);break;case"iframe":case"object":case"embed":Me("load",i);break;case"video":case"audio":for(a=0;a<Dl.length;a++)Me(Dl[a],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),yh(i,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Me("invalid",i);break;case"textarea":Me("invalid",i),bh(i,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||i.textContent===""+a||r.suppressHydrationWarning===!0||Sg(i.textContent,a)?(r.popover!=null&&(Me("beforetoggle",i),Me("toggle",i)),r.onScroll!=null&&Me("scroll",i),r.onScrollEnd!=null&&Me("scrollend",i),r.onClick!=null&&(i.onclick=di),i=!0):i=!1,i||Bi(t,!0)}function am(t){for(qt=t.return;qt;)switch(qt.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:qt=qt.return}}function ra(t){if(t!==qt)return!1;if(!Be)return am(t),Be=!0,!1;var i=t.tag,a;if((a=i!==3&&i!==27)&&((a=i===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||wd(t.type,t.memoizedProps)),a=!a),a&&lt&&Bi(t),am(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));lt=Ag(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));lt=Ag(t)}else i===27?(i=lt,Wi(t.type)?(t=_d,_d=null,lt=t):lt=i):lt=qt?An(t.stateNode.nextSibling):null;return!0}function zs(){lt=qt=null,Be=!1}function au(){var t=$i;return t!==null&&(rn===null?rn=t:rn.push.apply(rn,t),$i=null),t}function dl(t){$i===null?$i=[t]:$i.push(t)}var lu=C(null),_s=null,pi=null;function Ii(t,i,a){ne(lu,i._currentValue),i._currentValue=a}function gi(t){t._currentValue=lu.current,G(lu)}function ru(t,i,a){for(;t!==null;){var r=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,r!==null&&(r.childLanes|=i)):r!==null&&(r.childLanes&i)!==i&&(r.childLanes|=i),t===a)break;t=t.return}}function ou(t,i,a,r){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var h=f.dependencies;if(h!==null){var y=f.child;h=h.firstContext;e:for(;h!==null;){var S=h;h=f;for(var _=0;_<i.length;_++)if(S.context===i[_]){h.lanes|=a,S=h.alternate,S!==null&&(S.lanes|=a),ru(h.return,a,t),r||(y=null);break e}h=S.next}}else if(f.tag===18){if(y=f.return,y===null)throw Error(l(341));y.lanes|=a,h=y.alternate,h!==null&&(h.lanes|=a),ru(y,a,t),y=null}else y=f.child;if(y!==null)y.return=f;else for(y=f;y!==null;){if(y===t){y=null;break}if(f=y.sibling,f!==null){f.return=y.return,y=f;break}y=y.return}f=y}}function oa(t,i,a,r){t=null;for(var f=i,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var y=f.alternate;if(y===null)throw Error(l(387));if(y=y.memoizedProps,y!==null){var S=f.type;hn(f.pendingProps.value,y.value)||(t!==null?t.push(S):t=[S])}}else if(f===we.current){if(y=f.alternate,y===null)throw Error(l(387));y.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push($l):t=[$l])}f=f.return}t!==null&&ou(i,t,a,r),i.flags|=262144}function Cr(t){for(t=t.firstContext;t!==null;){if(!hn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Cs(t){_s=t,pi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Zt(t){return lm(_s,t)}function Er(t,i){return _s===null&&Cs(t),lm(t,i)}function lm(t,i){var a=i._currentValue;if(i={context:i,memoizedValue:a,next:null},pi===null){if(t===null)throw Error(l(308));pi=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else pi=pi.next=i;return a}var Wx=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(a,r){t.push(r)}};this.abort=function(){i.aborted=!0,t.forEach(function(a){return a()})}},eS=e.unstable_scheduleCallback,tS=e.unstable_NormalPriority,Et={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cu(){return{controller:new Wx,data:new Map,refCount:0}}function fl(t){t.refCount--,t.refCount===0&&eS(tS,function(){t.controller.abort()})}var hl=null,uu=0,ca=0,ua=null;function nS(t,i){if(hl===null){var a=hl=[];uu=0,ca=hd(),ua={status:"pending",value:void 0,then:function(r){a.push(r)}}}return uu++,i.then(rm,rm),i}function rm(){if(--uu===0&&hl!==null){ua!==null&&(ua.status="fulfilled");var t=hl;hl=null,ca=0,ua=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function iS(t,i){var a=[],r={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return t.then(function(){r.status="fulfilled",r.value=i;for(var f=0;f<a.length;f++)(0,a[f])(i)},function(f){for(r.status="rejected",r.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),r}var om=q.S;q.S=function(t,i){Kp=_t(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&nS(t,i),om!==null&&om(t,i)};var Es=C(null);function du(){var t=Es.current;return t!==null?t:it.pooledCache}function Ar(t,i){i===null?ne(Es,Es.current):ne(Es,i.pool)}function cm(){var t=du();return t===null?null:{parent:Et._currentValue,pool:t}}var da=Error(l(460)),fu=Error(l(474)),Tr=Error(l(542)),Or={then:function(){}};function um(t){return t=t.status,t==="fulfilled"||t==="rejected"}function dm(t,i,a){switch(a=t[a],a===void 0?t.push(i):a!==i&&(i.then(di,di),i=a),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,hm(t),t;default:if(typeof i.status=="string")i.then(di,di);else{if(t=it,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=i,t.status="pending",t.then(function(r){if(i.status==="pending"){var f=i;f.status="fulfilled",f.value=r}},function(r){if(i.status==="pending"){var f=i;f.status="rejected",f.reason=r}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,hm(t),t}throw Ts=i,da}}function As(t){try{var i=t._init;return i(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ts=a,da):a}}var Ts=null;function fm(){if(Ts===null)throw Error(l(459));var t=Ts;return Ts=null,t}function hm(t){if(t===da||t===Tr)throw Error(l(483))}var fa=null,ml=0;function Dr(t){var i=ml;return ml+=1,fa===null&&(fa=[]),dm(fa,t,i)}function pl(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Rr(t,i){throw i.$$typeof===w?Error(l(525)):(t=Object.prototype.toString.call(i),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function mm(t){function i(U,T){if(t){var B=U.deletions;B===null?(U.deletions=[T],U.flags|=16):B.push(T)}}function a(U,T){if(!t)return null;for(;T!==null;)i(U,T),T=T.sibling;return null}function r(U){for(var T=new Map;U!==null;)U.key!==null?T.set(U.key,U):T.set(U.index,U),U=U.sibling;return T}function f(U,T){return U=hi(U,T),U.index=0,U.sibling=null,U}function h(U,T,B){return U.index=B,t?(B=U.alternate,B!==null?(B=B.index,B<T?(U.flags|=67108866,T):B):(U.flags|=67108866,T)):(U.flags|=1048576,T)}function y(U){return t&&U.alternate===null&&(U.flags|=67108866),U}function S(U,T,B,X){return T===null||T.tag!==6?(T=eu(B,U.mode,X),T.return=U,T):(T=f(T,B),T.return=U,T)}function _(U,T,B,X){var xe=B.type;return xe===j?P(U,T,B.props.children,X,B.key):T!==null&&(T.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===R&&As(xe)===T.type)?(T=f(T,B.props),pl(T,B),T.return=U,T):(T=zr(B.type,B.key,B.props,null,U.mode,X),pl(T,B),T.return=U,T)}function I(U,T,B,X){return T===null||T.tag!==4||T.stateNode.containerInfo!==B.containerInfo||T.stateNode.implementation!==B.implementation?(T=tu(B,U.mode,X),T.return=U,T):(T=f(T,B.children||[]),T.return=U,T)}function P(U,T,B,X,xe){return T===null||T.tag!==7?(T=ks(B,U.mode,X,xe),T.return=U,T):(T=f(T,B),T.return=U,T)}function W(U,T,B){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return T=eu(""+T,U.mode,B),T.return=U,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case N:return B=zr(T.type,T.key,T.props,null,U.mode,B),pl(B,T),B.return=U,B;case z:return T=tu(T,U.mode,B),T.return=U,T;case R:return T=As(T),W(U,T,B)}if(Le(T)||fe(T))return T=ks(T,U.mode,B,null),T.return=U,T;if(typeof T.then=="function")return W(U,Dr(T),B);if(T.$$typeof===O)return W(U,Er(U,T),B);Rr(U,T)}return null}function Z(U,T,B,X){var xe=T!==null?T.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return xe!==null?null:S(U,T,""+B,X);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case N:return B.key===xe?_(U,T,B,X):null;case z:return B.key===xe?I(U,T,B,X):null;case R:return B=As(B),Z(U,T,B,X)}if(Le(B)||fe(B))return xe!==null?null:P(U,T,B,X,null);if(typeof B.then=="function")return Z(U,T,Dr(B),X);if(B.$$typeof===O)return Z(U,T,Er(U,B),X);Rr(U,B)}return null}function Y(U,T,B,X,xe){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return U=U.get(B)||null,S(T,U,""+X,xe);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case N:return U=U.get(X.key===null?B:X.key)||null,_(T,U,X,xe);case z:return U=U.get(X.key===null?B:X.key)||null,I(T,U,X,xe);case R:return X=As(X),Y(U,T,B,X,xe)}if(Le(X)||fe(X))return U=U.get(B)||null,P(T,U,X,xe,null);if(typeof X.then=="function")return Y(U,T,B,Dr(X),xe);if(X.$$typeof===O)return Y(U,T,B,Er(T,X),xe);Rr(T,X)}return null}function pe(U,T,B,X){for(var xe=null,Ge=null,ve=T,Ce=T=0,$e=null;ve!==null&&Ce<B.length;Ce++){ve.index>Ce?($e=ve,ve=null):$e=ve.sibling;var Ke=Z(U,ve,B[Ce],X);if(Ke===null){ve===null&&(ve=$e);break}t&&ve&&Ke.alternate===null&&i(U,ve),T=h(Ke,T,Ce),Ge===null?xe=Ke:Ge.sibling=Ke,Ge=Ke,ve=$e}if(Ce===B.length)return a(U,ve),Be&&mi(U,Ce),xe;if(ve===null){for(;Ce<B.length;Ce++)ve=W(U,B[Ce],X),ve!==null&&(T=h(ve,T,Ce),Ge===null?xe=ve:Ge.sibling=ve,Ge=ve);return Be&&mi(U,Ce),xe}for(ve=r(ve);Ce<B.length;Ce++)$e=Y(ve,U,Ce,B[Ce],X),$e!==null&&(t&&$e.alternate!==null&&ve.delete($e.key===null?Ce:$e.key),T=h($e,T,Ce),Ge===null?xe=$e:Ge.sibling=$e,Ge=$e);return t&&ve.forEach(function(ss){return i(U,ss)}),Be&&mi(U,Ce),xe}function je(U,T,B,X){if(B==null)throw Error(l(151));for(var xe=null,Ge=null,ve=T,Ce=T=0,$e=null,Ke=B.next();ve!==null&&!Ke.done;Ce++,Ke=B.next()){ve.index>Ce?($e=ve,ve=null):$e=ve.sibling;var ss=Z(U,ve,Ke.value,X);if(ss===null){ve===null&&(ve=$e);break}t&&ve&&ss.alternate===null&&i(U,ve),T=h(ss,T,Ce),Ge===null?xe=ss:Ge.sibling=ss,Ge=ss,ve=$e}if(Ke.done)return a(U,ve),Be&&mi(U,Ce),xe;if(ve===null){for(;!Ke.done;Ce++,Ke=B.next())Ke=W(U,Ke.value,X),Ke!==null&&(T=h(Ke,T,Ce),Ge===null?xe=Ke:Ge.sibling=Ke,Ge=Ke);return Be&&mi(U,Ce),xe}for(ve=r(ve);!Ke.done;Ce++,Ke=B.next())Ke=Y(ve,U,Ce,Ke.value,X),Ke!==null&&(t&&Ke.alternate!==null&&ve.delete(Ke.key===null?Ce:Ke.key),T=h(Ke,T,Ce),Ge===null?xe=Ke:Ge.sibling=Ke,Ge=Ke);return t&&ve.forEach(function(mw){return i(U,mw)}),Be&&mi(U,Ce),xe}function nt(U,T,B,X){if(typeof B=="object"&&B!==null&&B.type===j&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case N:e:{for(var xe=B.key;T!==null;){if(T.key===xe){if(xe=B.type,xe===j){if(T.tag===7){a(U,T.sibling),X=f(T,B.props.children),X.return=U,U=X;break e}}else if(T.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===R&&As(xe)===T.type){a(U,T.sibling),X=f(T,B.props),pl(X,B),X.return=U,U=X;break e}a(U,T);break}else i(U,T);T=T.sibling}B.type===j?(X=ks(B.props.children,U.mode,X,B.key),X.return=U,U=X):(X=zr(B.type,B.key,B.props,null,U.mode,X),pl(X,B),X.return=U,U=X)}return y(U);case z:e:{for(xe=B.key;T!==null;){if(T.key===xe)if(T.tag===4&&T.stateNode.containerInfo===B.containerInfo&&T.stateNode.implementation===B.implementation){a(U,T.sibling),X=f(T,B.children||[]),X.return=U,U=X;break e}else{a(U,T);break}else i(U,T);T=T.sibling}X=tu(B,U.mode,X),X.return=U,U=X}return y(U);case R:return B=As(B),nt(U,T,B,X)}if(Le(B))return pe(U,T,B,X);if(fe(B)){if(xe=fe(B),typeof xe!="function")throw Error(l(150));return B=xe.call(B),je(U,T,B,X)}if(typeof B.then=="function")return nt(U,T,Dr(B),X);if(B.$$typeof===O)return nt(U,T,Er(U,B),X);Rr(U,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,T!==null&&T.tag===6?(a(U,T.sibling),X=f(T,B),X.return=U,U=X):(a(U,T),X=eu(B,U.mode,X),X.return=U,U=X),y(U)):a(U,T)}return function(U,T,B,X){try{ml=0;var xe=nt(U,T,B,X);return fa=null,xe}catch(ve){if(ve===da||ve===Tr)throw ve;var Ge=mn(29,ve,null,U.mode);return Ge.lanes=X,Ge.return=U,Ge}}}var Os=mm(!0),pm=mm(!1),qi=!1;function hu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mu(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Zi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Hi(t,i,a){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(Ye&2)!==0){var f=r.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),r.pending=i,i=kr(t),Fh(t,null,a),i}return Nr(t,r,i,a),kr(t)}function gl(t,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194048)!==0)){var r=i.lanes;r&=t.pendingLanes,a|=r,i.lanes=a,ue(t,a)}}function pu(t,i){var a=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var f=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var y={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?f=h=y:h=h.next=y,a=a.next}while(a!==null);h===null?f=h=i:h=h.next=i}else f=h=i;a={baseState:r.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:r.shared,callbacks:r.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=i:t.next=i,a.lastBaseUpdate=i}var gu=!1;function yl(){if(gu){var t=ua;if(t!==null)throw t}}function vl(t,i,a,r){gu=!1;var f=t.updateQueue;qi=!1;var h=f.firstBaseUpdate,y=f.lastBaseUpdate,S=f.shared.pending;if(S!==null){f.shared.pending=null;var _=S,I=_.next;_.next=null,y===null?h=I:y.next=I,y=_;var P=t.alternate;P!==null&&(P=P.updateQueue,S=P.lastBaseUpdate,S!==y&&(S===null?P.firstBaseUpdate=I:S.next=I,P.lastBaseUpdate=_))}if(h!==null){var W=f.baseState;y=0,P=I=_=null,S=h;do{var Z=S.lane&-536870913,Y=Z!==S.lane;if(Y?(Ue&Z)===Z:(r&Z)===Z){Z!==0&&Z===ca&&(gu=!0),P!==null&&(P=P.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var pe=t,je=S;Z=i;var nt=a;switch(je.tag){case 1:if(pe=je.payload,typeof pe=="function"){W=pe.call(nt,W,Z);break e}W=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=je.payload,Z=typeof pe=="function"?pe.call(nt,W,Z):pe,Z==null)break e;W=v({},W,Z);break e;case 2:qi=!0}}Z=S.callback,Z!==null&&(t.flags|=64,Y&&(t.flags|=8192),Y=f.callbacks,Y===null?f.callbacks=[Z]:Y.push(Z))}else Y={lane:Z,tag:S.tag,payload:S.payload,callback:S.callback,next:null},P===null?(I=P=Y,_=W):P=P.next=Y,y|=Z;if(S=S.next,S===null){if(S=f.shared.pending,S===null)break;Y=S,S=Y.next,Y.next=null,f.lastBaseUpdate=Y,f.shared.pending=null}}while(!0);P===null&&(_=W),f.baseState=_,f.firstBaseUpdate=I,f.lastBaseUpdate=P,h===null&&(f.shared.lanes=0),Pi|=y,t.lanes=y,t.memoizedState=W}}function gm(t,i){if(typeof t!="function")throw Error(l(191,t));t.call(i)}function ym(t,i){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)gm(a[t],i)}var ha=C(null),Mr=C(0);function vm(t,i){t=ki,ne(Mr,t),ne(ha,i),ki=t|i.baseLanes}function yu(){ne(Mr,ki),ne(ha,ha.current)}function vu(){ki=Mr.current,G(ha),G(Mr)}var pn=C(null),En=null;function Gi(t){var i=t.alternate;ne(St,St.current&1),ne(pn,t),En===null&&(i===null||ha.current!==null||i.memoizedState!==null)&&(En=t)}function bu(t){ne(St,St.current),ne(pn,t),En===null&&(En=t)}function bm(t){t.tag===22?(ne(St,St.current),ne(pn,t),En===null&&(En=t)):Ki()}function Ki(){ne(St,St.current),ne(pn,pn.current)}function gn(t){G(pn),En===t&&(En=null),G(St)}var St=C(0);function Lr(t){for(var i=t;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||kd(a)||zd(a)))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===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var yi=0,_e=null,et=null,At=null,Ur=!1,ma=!1,Ds=!1,$r=0,bl=0,pa=null,sS=0;function bt(){throw Error(l(321))}function xu(t,i){if(i===null)return!1;for(var a=0;a<i.length&&a<t.length;a++)if(!hn(t[a],i[a]))return!1;return!0}function Su(t,i,a,r,f,h){return yi=h,_e=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,q.H=t===null||t.memoizedState===null?np:Lu,Ds=!1,h=a(r,f),Ds=!1,ma&&(h=Sm(i,a,r,f)),xm(t),h}function xm(t){q.H=wl;var i=et!==null&&et.next!==null;if(yi=0,At=et=_e=null,Ur=!1,bl=0,pa=null,i)throw Error(l(300));t===null||Tt||(t=t.dependencies,t!==null&&Cr(t)&&(Tt=!0))}function Sm(t,i,a,r){_e=t;var f=0;do{if(ma&&(pa=null),bl=0,ma=!1,25<=f)throw Error(l(301));if(f+=1,At=et=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}q.H=ip,h=i(a,r)}while(ma);return h}function aS(){var t=q.H,i=t.useState()[0];return i=typeof i.then=="function"?xl(i):i,t=t.useState()[0],(et!==null?et.memoizedState:null)!==t&&(_e.flags|=1024),i}function wu(){var t=$r!==0;return $r=0,t}function ju(t,i,a){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~a}function Nu(t){if(Ur){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Ur=!1}yi=0,At=et=_e=null,ma=!1,bl=$r=0,pa=null}function Jt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?_e.memoizedState=At=t:At=At.next=t,At}function wt(){if(et===null){var t=_e.alternate;t=t!==null?t.memoizedState:null}else t=et.next;var i=At===null?_e.memoizedState:At.next;if(i!==null)At=i,et=t;else{if(t===null)throw _e.alternate===null?Error(l(467)):Error(l(310));et=t,t={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},At===null?_e.memoizedState=At=t:At=At.next=t}return At}function Br(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xl(t){var i=bl;return bl+=1,pa===null&&(pa=[]),t=dm(pa,t,i),i=_e,(At===null?i.memoizedState:At.next)===null&&(i=i.alternate,q.H=i===null||i.memoizedState===null?np:Lu),t}function Ir(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return xl(t);if(t.$$typeof===O)return Zt(t)}throw Error(l(438,String(t)))}function ku(t){var i=null,a=_e.updateQueue;if(a!==null&&(i=a.memoCache),i==null){var r=_e.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(i={data:r.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),a===null&&(a=Br(),_e.updateQueue=a),a.memoCache=i,a=i.data[i.index],a===void 0)for(a=i.data[i.index]=Array(t),r=0;r<t;r++)a[r]=Se;return i.index++,a}function vi(t,i){return typeof i=="function"?i(t):i}function qr(t){var i=wt();return zu(i,et,t)}function zu(t,i,a){var r=t.queue;if(r===null)throw Error(l(311));r.lastRenderedReducer=a;var f=t.baseQueue,h=r.pending;if(h!==null){if(f!==null){var y=f.next;f.next=h.next,h.next=y}i.baseQueue=f=h,r.pending=null}if(h=t.baseState,f===null)t.memoizedState=h;else{i=f.next;var S=y=null,_=null,I=i,P=!1;do{var W=I.lane&-536870913;if(W!==I.lane?(Ue&W)===W:(yi&W)===W){var Z=I.revertLane;if(Z===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),W===ca&&(P=!0);else if((yi&Z)===Z){I=I.next,Z===ca&&(P=!0);continue}else W={lane:0,revertLane:I.revertLane,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},_===null?(S=_=W,y=h):_=_.next=W,_e.lanes|=Z,Pi|=Z;W=I.action,Ds&&a(h,W),h=I.hasEagerState?I.eagerState:a(h,W)}else Z={lane:W,revertLane:I.revertLane,gesture:I.gesture,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},_===null?(S=_=Z,y=h):_=_.next=Z,_e.lanes|=W,Pi|=W;I=I.next}while(I!==null&&I!==i);if(_===null?y=h:_.next=S,!hn(h,t.memoizedState)&&(Tt=!0,P&&(a=ua,a!==null)))throw a;t.memoizedState=h,t.baseState=y,t.baseQueue=_,r.lastRenderedState=h}return f===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function _u(t){var i=wt(),a=i.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=t;var r=a.dispatch,f=a.pending,h=i.memoizedState;if(f!==null){a.pending=null;var y=f=f.next;do h=t(h,y.action),y=y.next;while(y!==f);hn(h,i.memoizedState)||(Tt=!0),i.memoizedState=h,i.baseQueue===null&&(i.baseState=h),a.lastRenderedState=h}return[h,r]}function wm(t,i,a){var r=_e,f=wt(),h=Be;if(h){if(a===void 0)throw Error(l(407));a=a()}else a=i();var y=!hn((et||f).memoizedState,a);if(y&&(f.memoizedState=a,Tt=!0),f=f.queue,Au(km.bind(null,r,f,t),[t]),f.getSnapshot!==i||y||At!==null&&At.memoizedState.tag&1){if(r.flags|=2048,ga(9,{destroy:void 0},Nm.bind(null,r,f,a,i),null),it===null)throw Error(l(349));h||(yi&127)!==0||jm(r,i,a)}return a}function jm(t,i,a){t.flags|=16384,t={getSnapshot:i,value:a},i=_e.updateQueue,i===null?(i=Br(),_e.updateQueue=i,i.stores=[t]):(a=i.stores,a===null?i.stores=[t]:a.push(t))}function Nm(t,i,a,r){i.value=a,i.getSnapshot=r,zm(i)&&_m(t)}function km(t,i,a){return a(function(){zm(i)&&_m(t)})}function zm(t){var i=t.getSnapshot;t=t.value;try{var a=i();return!hn(t,a)}catch{return!0}}function _m(t){var i=Ns(t,2);i!==null&&on(i,t,2)}function Cu(t){var i=Jt();if(typeof t=="function"){var a=t;if(t=a(),Ds){yt(!0);try{a()}finally{yt(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:t},i}function Cm(t,i,a,r){return t.baseState=a,zu(t,et,typeof r=="function"?r:vi)}function lS(t,i,a,r,f){if(Gr(t))throw Error(l(485));if(t=i.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){h.listeners.push(y)}};q.T!==null?a(!0):h.isTransition=!1,r(h),a=i.pending,a===null?(h.next=i.pending=h,Em(i,h)):(h.next=a.next,i.pending=a.next=h)}}function Em(t,i){var a=i.action,r=i.payload,f=t.state;if(i.isTransition){var h=q.T,y={};q.T=y;try{var S=a(f,r),_=q.S;_!==null&&_(y,S),Am(t,i,S)}catch(I){Eu(t,i,I)}finally{h!==null&&y.types!==null&&(h.types=y.types),q.T=h}}else try{h=a(f,r),Am(t,i,h)}catch(I){Eu(t,i,I)}}function Am(t,i,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Tm(t,i,r)},function(r){return Eu(t,i,r)}):Tm(t,i,a)}function Tm(t,i,a){i.status="fulfilled",i.value=a,Om(i),t.state=a,i=t.pending,i!==null&&(a=i.next,a===i?t.pending=null:(a=a.next,i.next=a,Em(t,a)))}function Eu(t,i,a){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do i.status="rejected",i.reason=a,Om(i),i=i.next;while(i!==r)}t.action=null}function Om(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function Dm(t,i){return i}function Rm(t,i){if(Be){var a=it.formState;if(a!==null){e:{var r=_e;if(Be){if(lt){t:{for(var f=lt,h=Cn;f.nodeType!==8;){if(!h){f=null;break t}if(f=An(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){lt=An(f.nextSibling),r=f.data==="F!";break e}}Bi(r)}r=!1}r&&(i=a[0])}}return a=Jt(),a.memoizedState=a.baseState=i,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dm,lastRenderedState:i},a.queue=r,a=Wm.bind(null,_e,r),r.dispatch=a,r=Cu(!1),h=Mu.bind(null,_e,!1,r.queue),r=Jt(),f={state:i,dispatch:null,action:t,pending:null},r.queue=f,a=lS.bind(null,_e,f,h,a),f.dispatch=a,r.memoizedState=t,[i,a,!1]}function Mm(t){var i=wt();return Lm(i,et,t)}function Lm(t,i,a){if(i=zu(t,i,Dm)[0],t=qr(vi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var r=xl(i)}catch(y){throw y===da?Tr:y}else r=i;i=wt();var f=i.queue,h=f.dispatch;return a!==i.memoizedState&&(_e.flags|=2048,ga(9,{destroy:void 0},rS.bind(null,f,a),null)),[r,h,t]}function rS(t,i){t.action=i}function Um(t){var i=wt(),a=et;if(a!==null)return Lm(i,a,t);wt(),i=i.memoizedState,a=wt();var r=a.queue.dispatch;return a.memoizedState=t,[i,r,!1]}function ga(t,i,a,r){return t={tag:t,create:a,deps:r,inst:i,next:null},i=_e.updateQueue,i===null&&(i=Br(),_e.updateQueue=i),a=i.lastEffect,a===null?i.lastEffect=t.next=t:(r=a.next,a.next=t,t.next=r,i.lastEffect=t),t}function $m(){return wt().memoizedState}function Zr(t,i,a,r){var f=Jt();_e.flags|=t,f.memoizedState=ga(1|i,{destroy:void 0},a,r===void 0?null:r)}function Hr(t,i,a,r){var f=wt();r=r===void 0?null:r;var h=f.memoizedState.inst;et!==null&&r!==null&&xu(r,et.memoizedState.deps)?f.memoizedState=ga(i,h,a,r):(_e.flags|=t,f.memoizedState=ga(1|i,h,a,r))}function Bm(t,i){Zr(8390656,8,t,i)}function Au(t,i){Hr(2048,8,t,i)}function oS(t){_e.flags|=4;var i=_e.updateQueue;if(i===null)i=Br(),_e.updateQueue=i,i.events=[t];else{var a=i.events;a===null?i.events=[t]:a.push(t)}}function Im(t){var i=wt().memoizedState;return oS({ref:i,nextImpl:t}),function(){if((Ye&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}function qm(t,i){return Hr(4,2,t,i)}function Zm(t,i){return Hr(4,4,t,i)}function Hm(t,i){if(typeof i=="function"){t=t();var a=i(t);return function(){typeof a=="function"?a():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function Gm(t,i,a){a=a!=null?a.concat([t]):null,Hr(4,4,Hm.bind(null,i,t),a)}function Tu(){}function Km(t,i){var a=wt();i=i===void 0?null:i;var r=a.memoizedState;return i!==null&&xu(i,r[1])?r[0]:(a.memoizedState=[t,i],t)}function Ym(t,i){var a=wt();i=i===void 0?null:i;var r=a.memoizedState;if(i!==null&&xu(i,r[1]))return r[0];if(r=t(),Ds){yt(!0);try{t()}finally{yt(!1)}}return a.memoizedState=[r,i],r}function Ou(t,i,a){return a===void 0||(yi&1073741824)!==0&&(Ue&261930)===0?t.memoizedState=i:(t.memoizedState=a,t=Vp(),_e.lanes|=t,Pi|=t,a)}function Vm(t,i,a,r){return hn(a,i)?a:ha.current!==null?(t=Ou(t,a,r),hn(t,i)||(Tt=!0),t):(yi&42)===0||(yi&1073741824)!==0&&(Ue&261930)===0?(Tt=!0,t.memoizedState=a):(t=Vp(),_e.lanes|=t,Pi|=t,i)}function Pm(t,i,a,r,f){var h=K.p;K.p=h!==0&&8>h?h:8;var y=q.T,S={};q.T=S,Mu(t,!1,i,a);try{var _=f(),I=q.S;if(I!==null&&I(S,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var P=iS(_,r);Sl(t,i,P,bn(t))}else Sl(t,i,r,bn(t))}catch(W){Sl(t,i,{then:function(){},status:"rejected",reason:W},bn())}finally{K.p=h,y!==null&&S.types!==null&&(y.types=S.types),q.T=y}}function cS(){}function Du(t,i,a,r){if(t.tag!==5)throw Error(l(476));var f=Qm(t).queue;Pm(t,f,i,se,a===null?cS:function(){return Xm(t),a(r)})}function Qm(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:se},next:null};var a={};return i.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:a},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function Xm(t){var i=Qm(t);i.next===null&&(i=t.alternate.memoizedState),Sl(t,i.next.queue,{},bn())}function Ru(){return Zt($l)}function Jm(){return wt().memoizedState}function Fm(){return wt().memoizedState}function uS(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var a=bn();t=Zi(a);var r=Hi(i,t,a);r!==null&&(on(r,i,a),gl(r,i,a)),i={cache:cu()},t.payload=i;return}i=i.return}}function dS(t,i,a){var r=bn();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Gr(t)?ep(i,a):(a=Fc(t,i,a,r),a!==null&&(on(a,t,r),tp(a,i,r)))}function Wm(t,i,a){var r=bn();Sl(t,i,a,r)}function Sl(t,i,a,r){var f={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Gr(t))ep(i,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=i.lastRenderedReducer,h!==null))try{var y=i.lastRenderedState,S=h(y,a);if(f.hasEagerState=!0,f.eagerState=S,hn(S,y))return Nr(t,i,f,0),it===null&&jr(),!1}catch{}if(a=Fc(t,i,f,r),a!==null)return on(a,t,r),tp(a,i,r),!0}return!1}function Mu(t,i,a,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Gr(t)){if(i)throw Error(l(479))}else i=Fc(t,a,r,2),i!==null&&on(i,t,2)}function Gr(t){var i=t.alternate;return t===_e||i!==null&&i===_e}function ep(t,i){ma=Ur=!0;var a=t.pending;a===null?i.next=i:(i.next=a.next,a.next=i),t.pending=i}function tp(t,i,a){if((a&4194048)!==0){var r=i.lanes;r&=t.pendingLanes,a|=r,i.lanes=a,ue(t,a)}}var wl={readContext:Zt,use:Ir,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt};wl.useEffectEvent=bt;var np={readContext:Zt,use:Ir,useCallback:function(t,i){return Jt().memoizedState=[t,i===void 0?null:i],t},useContext:Zt,useEffect:Bm,useImperativeHandle:function(t,i,a){a=a!=null?a.concat([t]):null,Zr(4194308,4,Hm.bind(null,i,t),a)},useLayoutEffect:function(t,i){return Zr(4194308,4,t,i)},useInsertionEffect:function(t,i){Zr(4,2,t,i)},useMemo:function(t,i){var a=Jt();i=i===void 0?null:i;var r=t();if(Ds){yt(!0);try{t()}finally{yt(!1)}}return a.memoizedState=[r,i],r},useReducer:function(t,i,a){var r=Jt();if(a!==void 0){var f=a(i);if(Ds){yt(!0);try{a(i)}finally{yt(!1)}}}else f=i;return r.memoizedState=r.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},r.queue=t,t=t.dispatch=dS.bind(null,_e,t),[r.memoizedState,t]},useRef:function(t){var i=Jt();return t={current:t},i.memoizedState=t},useState:function(t){t=Cu(t);var i=t.queue,a=Wm.bind(null,_e,i);return i.dispatch=a,[t.memoizedState,a]},useDebugValue:Tu,useDeferredValue:function(t,i){var a=Jt();return Ou(a,t,i)},useTransition:function(){var t=Cu(!1);return t=Pm.bind(null,_e,t.queue,!0,!1),Jt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,a){var r=_e,f=Jt();if(Be){if(a===void 0)throw Error(l(407));a=a()}else{if(a=i(),it===null)throw Error(l(349));(Ue&127)!==0||jm(r,i,a)}f.memoizedState=a;var h={value:a,getSnapshot:i};return f.queue=h,Bm(km.bind(null,r,h,t),[t]),r.flags|=2048,ga(9,{destroy:void 0},Nm.bind(null,r,h,a,i),null),a},useId:function(){var t=Jt(),i=it.identifierPrefix;if(Be){var a=ti,r=ei;a=(r&~(1<<32-Ee(r)-1)).toString(32)+a,i="_"+i+"R_"+a,a=$r++,0<a&&(i+="H"+a.toString(32)),i+="_"}else a=sS++,i="_"+i+"r_"+a.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Ru,useFormState:Rm,useActionState:Rm,useOptimistic:function(t){var i=Jt();i.memoizedState=i.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=a,i=Mu.bind(null,_e,!0,a),a.dispatch=i,[t,i]},useMemoCache:ku,useCacheRefresh:function(){return Jt().memoizedState=uS.bind(null,_e)},useEffectEvent:function(t){var i=Jt(),a={impl:t};return i.memoizedState=a,function(){if((Ye&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},Lu={readContext:Zt,use:Ir,useCallback:Km,useContext:Zt,useEffect:Au,useImperativeHandle:Gm,useInsertionEffect:qm,useLayoutEffect:Zm,useMemo:Ym,useReducer:qr,useRef:$m,useState:function(){return qr(vi)},useDebugValue:Tu,useDeferredValue:function(t,i){var a=wt();return Vm(a,et.memoizedState,t,i)},useTransition:function(){var t=qr(vi)[0],i=wt().memoizedState;return[typeof t=="boolean"?t:xl(t),i]},useSyncExternalStore:wm,useId:Jm,useHostTransitionStatus:Ru,useFormState:Mm,useActionState:Mm,useOptimistic:function(t,i){var a=wt();return Cm(a,et,t,i)},useMemoCache:ku,useCacheRefresh:Fm};Lu.useEffectEvent=Im;var ip={readContext:Zt,use:Ir,useCallback:Km,useContext:Zt,useEffect:Au,useImperativeHandle:Gm,useInsertionEffect:qm,useLayoutEffect:Zm,useMemo:Ym,useReducer:_u,useRef:$m,useState:function(){return _u(vi)},useDebugValue:Tu,useDeferredValue:function(t,i){var a=wt();return et===null?Ou(a,t,i):Vm(a,et.memoizedState,t,i)},useTransition:function(){var t=_u(vi)[0],i=wt().memoizedState;return[typeof t=="boolean"?t:xl(t),i]},useSyncExternalStore:wm,useId:Jm,useHostTransitionStatus:Ru,useFormState:Um,useActionState:Um,useOptimistic:function(t,i){var a=wt();return et!==null?Cm(a,et,t,i):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:ku,useCacheRefresh:Fm};ip.useEffectEvent=Im;function Uu(t,i,a,r){i=t.memoizedState,a=a(r,i),a=a==null?i:v({},i,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var $u={enqueueSetState:function(t,i,a){t=t._reactInternals;var r=bn(),f=Zi(r);f.payload=i,a!=null&&(f.callback=a),i=Hi(t,f,r),i!==null&&(on(i,t,r),gl(i,t,r))},enqueueReplaceState:function(t,i,a){t=t._reactInternals;var r=bn(),f=Zi(r);f.tag=1,f.payload=i,a!=null&&(f.callback=a),i=Hi(t,f,r),i!==null&&(on(i,t,r),gl(i,t,r))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var a=bn(),r=Zi(a);r.tag=2,i!=null&&(r.callback=i),i=Hi(t,r,a),i!==null&&(on(i,t,a),gl(i,t,a))}};function sp(t,i,a,r,f,h,y){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,h,y):i.prototype&&i.prototype.isPureReactComponent?!ol(a,r)||!ol(f,h):!0}function ap(t,i,a,r){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,r),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,r),i.state!==t&&$u.enqueueReplaceState(i,i.state,null)}function Rs(t,i){var a=i;if("ref"in i){a={};for(var r in i)r!=="ref"&&(a[r]=i[r])}if(t=t.defaultProps){a===i&&(a=v({},a));for(var f in t)a[f]===void 0&&(a[f]=t[f])}return a}function lp(t){wr(t)}function rp(t){console.error(t)}function op(t){wr(t)}function Kr(t,i){try{var a=t.onUncaughtError;a(i.value,{componentStack:i.stack})}catch(r){setTimeout(function(){throw r})}}function cp(t,i,a){try{var r=t.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Bu(t,i,a){return a=Zi(a),a.tag=3,a.payload={element:null},a.callback=function(){Kr(t,i)},a}function up(t){return t=Zi(t),t.tag=3,t}function dp(t,i,a,r){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var h=r.value;t.payload=function(){return f(h)},t.callback=function(){cp(i,a,r)}}var y=a.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(t.callback=function(){cp(i,a,r),typeof f!="function"&&(Qi===null?Qi=new Set([this]):Qi.add(this));var S=r.stack;this.componentDidCatch(r.value,{componentStack:S!==null?S:""})})}function fS(t,i,a,r,f){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(i=a.alternate,i!==null&&oa(i,a,f,!0),a=pn.current,a!==null){switch(a.tag){case 31:case 13:return En===null?io():a.alternate===null&&xt===0&&(xt=3),a.flags&=-257,a.flags|=65536,a.lanes=f,r===Or?a.flags|=16384:(i=a.updateQueue,i===null?a.updateQueue=new Set([r]):i.add(r),ud(t,r,f)),!1;case 22:return a.flags|=65536,r===Or?a.flags|=16384:(i=a.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=i):(a=i.retryQueue,a===null?i.retryQueue=new Set([r]):a.add(r)),ud(t,r,f)),!1}throw Error(l(435,a.tag))}return ud(t,r,f),io(),!1}if(Be)return i=pn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,r!==su&&(t=Error(l(422),{cause:r}),dl(kn(t,a)))):(r!==su&&(i=Error(l(423),{cause:r}),dl(kn(i,a))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,r=kn(r,a),f=Bu(t.stateNode,r,f),pu(t,f),xt!==4&&(xt=2)),!1;var h=Error(l(520),{cause:r});if(h=kn(h,a),Al===null?Al=[h]:Al.push(h),xt!==4&&(xt=2),i===null)return!0;r=kn(r,a),a=i;do{switch(a.tag){case 3:return a.flags|=65536,t=f&-f,a.lanes|=t,t=Bu(a.stateNode,r,t),pu(a,t),!1;case 1:if(i=a.type,h=a.stateNode,(a.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Qi===null||!Qi.has(h))))return a.flags|=65536,f&=-f,a.lanes|=f,f=up(f),dp(f,t,a,r),pu(a,f),!1}a=a.return}while(a!==null);return!1}var Iu=Error(l(461)),Tt=!1;function Ht(t,i,a,r){i.child=t===null?pm(i,null,a,r):Os(i,t.child,a,r)}function fp(t,i,a,r,f){a=a.render;var h=i.ref;if("ref"in r){var y={};for(var S in r)S!=="ref"&&(y[S]=r[S])}else y=r;return Cs(i),r=Su(t,i,a,y,h,f),S=wu(),t!==null&&!Tt?(ju(t,i,f),bi(t,i,f)):(Be&&S&&nu(i),i.flags|=1,Ht(t,i,r,f),i.child)}function hp(t,i,a,r,f){if(t===null){var h=a.type;return typeof h=="function"&&!Wc(h)&&h.defaultProps===void 0&&a.compare===null?(i.tag=15,i.type=h,mp(t,i,h,r,f)):(t=zr(a.type,null,r,i,i.mode,f),t.ref=i.ref,t.return=i,i.child=t)}if(h=t.child,!Pu(t,f)){var y=h.memoizedProps;if(a=a.compare,a=a!==null?a:ol,a(y,r)&&t.ref===i.ref)return bi(t,i,f)}return i.flags|=1,t=hi(h,r),t.ref=i.ref,t.return=i,i.child=t}function mp(t,i,a,r,f){if(t!==null){var h=t.memoizedProps;if(ol(h,r)&&t.ref===i.ref)if(Tt=!1,i.pendingProps=r=h,Pu(t,f))(t.flags&131072)!==0&&(Tt=!0);else return i.lanes=t.lanes,bi(t,i,f)}return qu(t,i,a,r,f)}function pp(t,i,a,r){var f=r.children,h=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((i.flags&128)!==0){if(h=h!==null?h.baseLanes|a:a,t!==null){for(r=i.child=t.child,f=0;r!==null;)f=f|r.lanes|r.childLanes,r=r.sibling;r=f&~h}else r=0,i.child=null;return gp(t,i,h,a,r)}if((a&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ar(i,h!==null?h.cachePool:null),h!==null?vm(i,h):yu(),bm(i);else return r=i.lanes=536870912,gp(t,i,h!==null?h.baseLanes|a:a,a,r)}else h!==null?(Ar(i,h.cachePool),vm(i,h),Ki(),i.memoizedState=null):(t!==null&&Ar(i,null),yu(),Ki());return Ht(t,i,f,a),i.child}function jl(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function gp(t,i,a,r,f){var h=du();return h=h===null?null:{parent:Et._currentValue,pool:h},i.memoizedState={baseLanes:a,cachePool:h},t!==null&&Ar(i,null),yu(),bm(i),t!==null&&oa(t,i,r,!0),i.childLanes=f,null}function Yr(t,i){return i=Pr({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function yp(t,i,a){return Os(i,t.child,null,a),t=Yr(i,i.pendingProps),t.flags|=2,gn(i),i.memoizedState=null,t}function hS(t,i,a){var r=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(Be){if(r.mode==="hidden")return t=Yr(i,r),i.lanes=536870912,jl(null,t);if(bu(i),(t=lt)?(t=Eg(t,Cn),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Ui!==null?{id:ei,overflow:ti}:null,retryLane:536870912,hydrationErrors:null},a=em(t),a.return=i,i.child=a,qt=i,lt=null)):t=null,t===null)throw Bi(i);return i.lanes=536870912,null}return Yr(i,r)}var h=t.memoizedState;if(h!==null){var y=h.dehydrated;if(bu(i),f)if(i.flags&256)i.flags&=-257,i=yp(t,i,a);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(l(558));else if(Tt||oa(t,i,a,!1),f=(a&t.childLanes)!==0,Tt||f){if(r=it,r!==null&&(y=at(r,a),y!==0&&y!==h.retryLane))throw h.retryLane=y,Ns(t,y),on(r,t,y),Iu;io(),i=yp(t,i,a)}else t=h.treeContext,lt=An(y.nextSibling),qt=i,Be=!0,$i=null,Cn=!1,t!==null&&im(i,t),i=Yr(i,r),i.flags|=4096;return i}return t=hi(t.child,{mode:r.mode,children:r.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Vr(t,i){var a=i.ref;if(a===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(t===null||t.ref!==a)&&(i.flags|=4194816)}}function qu(t,i,a,r,f){return Cs(i),a=Su(t,i,a,r,void 0,f),r=wu(),t!==null&&!Tt?(ju(t,i,f),bi(t,i,f)):(Be&&r&&nu(i),i.flags|=1,Ht(t,i,a,f),i.child)}function vp(t,i,a,r,f,h){return Cs(i),i.updateQueue=null,a=Sm(i,r,a,f),xm(t),r=wu(),t!==null&&!Tt?(ju(t,i,h),bi(t,i,h)):(Be&&r&&nu(i),i.flags|=1,Ht(t,i,a,h),i.child)}function bp(t,i,a,r,f){if(Cs(i),i.stateNode===null){var h=sa,y=a.contextType;typeof y=="object"&&y!==null&&(h=Zt(y)),h=new a(r,h),i.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=$u,i.stateNode=h,h._reactInternals=i,h=i.stateNode,h.props=r,h.state=i.memoizedState,h.refs={},hu(i),y=a.contextType,h.context=typeof y=="object"&&y!==null?Zt(y):sa,h.state=i.memoizedState,y=a.getDerivedStateFromProps,typeof y=="function"&&(Uu(i,a,y,r),h.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(y=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),y!==h.state&&$u.enqueueReplaceState(h,h.state,null),vl(i,r,h,f),yl(),h.state=i.memoizedState),typeof h.componentDidMount=="function"&&(i.flags|=4194308),r=!0}else if(t===null){h=i.stateNode;var S=i.memoizedProps,_=Rs(a,S);h.props=_;var I=h.context,P=a.contextType;y=sa,typeof P=="object"&&P!==null&&(y=Zt(P));var W=a.getDerivedStateFromProps;P=typeof W=="function"||typeof h.getSnapshotBeforeUpdate=="function",S=i.pendingProps!==S,P||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S||I!==y)&&ap(i,h,r,y),qi=!1;var Z=i.memoizedState;h.state=Z,vl(i,r,h,f),yl(),I=i.memoizedState,S||Z!==I||qi?(typeof W=="function"&&(Uu(i,a,W,r),I=i.memoizedState),(_=qi||sp(i,a,_,r,Z,I,y))?(P||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(i.flags|=4194308)):(typeof h.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=r,i.memoizedState=I),h.props=r,h.state=I,h.context=y,r=_):(typeof h.componentDidMount=="function"&&(i.flags|=4194308),r=!1)}else{h=i.stateNode,mu(t,i),y=i.memoizedProps,P=Rs(a,y),h.props=P,W=i.pendingProps,Z=h.context,I=a.contextType,_=sa,typeof I=="object"&&I!==null&&(_=Zt(I)),S=a.getDerivedStateFromProps,(I=typeof S=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==W||Z!==_)&&ap(i,h,r,_),qi=!1,Z=i.memoizedState,h.state=Z,vl(i,r,h,f),yl();var Y=i.memoizedState;y!==W||Z!==Y||qi||t!==null&&t.dependencies!==null&&Cr(t.dependencies)?(typeof S=="function"&&(Uu(i,a,S,r),Y=i.memoizedState),(P=qi||sp(i,a,P,r,Z,Y,_)||t!==null&&t.dependencies!==null&&Cr(t.dependencies))?(I||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(r,Y,_),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(r,Y,_)),typeof h.componentDidUpdate=="function"&&(i.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof h.componentDidUpdate!="function"||y===t.memoizedProps&&Z===t.memoizedState||(i.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&Z===t.memoizedState||(i.flags|=1024),i.memoizedProps=r,i.memoizedState=Y),h.props=r,h.state=Y,h.context=_,r=P):(typeof h.componentDidUpdate!="function"||y===t.memoizedProps&&Z===t.memoizedState||(i.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&Z===t.memoizedState||(i.flags|=1024),r=!1)}return h=r,Vr(t,i),r=(i.flags&128)!==0,h||r?(h=i.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:h.render(),i.flags|=1,t!==null&&r?(i.child=Os(i,t.child,null,f),i.child=Os(i,null,a,f)):Ht(t,i,a,f),i.memoizedState=h.state,t=i.child):t=bi(t,i,f),t}function xp(t,i,a,r){return zs(),i.flags|=256,Ht(t,i,a,r),i.child}var Zu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hu(t){return{baseLanes:t,cachePool:cm()}}function Gu(t,i,a){return t=t!==null?t.childLanes&~a:0,i&&(t|=vn),t}function Sp(t,i,a){var r=i.pendingProps,f=!1,h=(i.flags&128)!==0,y;if((y=h)||(y=t!==null&&t.memoizedState===null?!1:(St.current&2)!==0),y&&(f=!0,i.flags&=-129),y=(i.flags&32)!==0,i.flags&=-33,t===null){if(Be){if(f?Gi(i):Ki(),(t=lt)?(t=Eg(t,Cn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Ui!==null?{id:ei,overflow:ti}:null,retryLane:536870912,hydrationErrors:null},a=em(t),a.return=i,i.child=a,qt=i,lt=null)):t=null,t===null)throw Bi(i);return zd(t)?i.lanes=32:i.lanes=536870912,null}var S=r.children;return r=r.fallback,f?(Ki(),f=i.mode,S=Pr({mode:"hidden",children:S},f),r=ks(r,f,a,null),S.return=i,r.return=i,S.sibling=r,i.child=S,r=i.child,r.memoizedState=Hu(a),r.childLanes=Gu(t,y,a),i.memoizedState=Zu,jl(null,r)):(Gi(i),Ku(i,S))}var _=t.memoizedState;if(_!==null&&(S=_.dehydrated,S!==null)){if(h)i.flags&256?(Gi(i),i.flags&=-257,i=Yu(t,i,a)):i.memoizedState!==null?(Ki(),i.child=t.child,i.flags|=128,i=null):(Ki(),S=r.fallback,f=i.mode,r=Pr({mode:"visible",children:r.children},f),S=ks(S,f,a,null),S.flags|=2,r.return=i,S.return=i,r.sibling=S,i.child=r,Os(i,t.child,null,a),r=i.child,r.memoizedState=Hu(a),r.childLanes=Gu(t,y,a),i.memoizedState=Zu,i=jl(null,r));else if(Gi(i),zd(S)){if(y=S.nextSibling&&S.nextSibling.dataset,y)var I=y.dgst;y=I,r=Error(l(419)),r.stack="",r.digest=y,dl({value:r,source:null,stack:null}),i=Yu(t,i,a)}else if(Tt||oa(t,i,a,!1),y=(a&t.childLanes)!==0,Tt||y){if(y=it,y!==null&&(r=at(y,a),r!==0&&r!==_.retryLane))throw _.retryLane=r,Ns(t,r),on(y,t,r),Iu;kd(S)||io(),i=Yu(t,i,a)}else kd(S)?(i.flags|=192,i.child=t.child,i=null):(t=_.treeContext,lt=An(S.nextSibling),qt=i,Be=!0,$i=null,Cn=!1,t!==null&&im(i,t),i=Ku(i,r.children),i.flags|=4096);return i}return f?(Ki(),S=r.fallback,f=i.mode,_=t.child,I=_.sibling,r=hi(_,{mode:"hidden",children:r.children}),r.subtreeFlags=_.subtreeFlags&65011712,I!==null?S=hi(I,S):(S=ks(S,f,a,null),S.flags|=2),S.return=i,r.return=i,r.sibling=S,i.child=r,jl(null,r),r=i.child,S=t.child.memoizedState,S===null?S=Hu(a):(f=S.cachePool,f!==null?(_=Et._currentValue,f=f.parent!==_?{parent:_,pool:_}:f):f=cm(),S={baseLanes:S.baseLanes|a,cachePool:f}),r.memoizedState=S,r.childLanes=Gu(t,y,a),i.memoizedState=Zu,jl(t.child,r)):(Gi(i),a=t.child,t=a.sibling,a=hi(a,{mode:"visible",children:r.children}),a.return=i,a.sibling=null,t!==null&&(y=i.deletions,y===null?(i.deletions=[t],i.flags|=16):y.push(t)),i.child=a,i.memoizedState=null,a)}function Ku(t,i){return i=Pr({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Pr(t,i){return t=mn(22,t,null,i),t.lanes=0,t}function Yu(t,i,a){return Os(i,t.child,null,a),t=Ku(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function wp(t,i,a){t.lanes|=i;var r=t.alternate;r!==null&&(r.lanes|=i),ru(t.return,i,a)}function Vu(t,i,a,r,f,h){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:f,treeForkCount:h}:(y.isBackwards=i,y.rendering=null,y.renderingStartTime=0,y.last=r,y.tail=a,y.tailMode=f,y.treeForkCount=h)}function jp(t,i,a){var r=i.pendingProps,f=r.revealOrder,h=r.tail;r=r.children;var y=St.current,S=(y&2)!==0;if(S?(y=y&1|2,i.flags|=128):y&=1,ne(St,y),Ht(t,i,r,a),r=Be?ul:0,!S&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&wp(t,a,i);else if(t.tag===19)wp(t,a,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(a=i.child,f=null;a!==null;)t=a.alternate,t!==null&&Lr(t)===null&&(f=a),a=a.sibling;a=f,a===null?(f=i.child,i.child=null):(f=a.sibling,a.sibling=null),Vu(i,!1,f,a,h,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=i.child,i.child=null;f!==null;){if(t=f.alternate,t!==null&&Lr(t)===null){i.child=f;break}t=f.sibling,f.sibling=a,a=f,f=t}Vu(i,!0,a,null,h,r);break;case"together":Vu(i,!1,null,null,void 0,r);break;default:i.memoizedState=null}return i.child}function bi(t,i,a){if(t!==null&&(i.dependencies=t.dependencies),Pi|=i.lanes,(a&i.childLanes)===0)if(t!==null){if(oa(t,i,a,!1),(a&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(l(153));if(i.child!==null){for(t=i.child,a=hi(t,t.pendingProps),i.child=a,a.return=i;t.sibling!==null;)t=t.sibling,a=a.sibling=hi(t,t.pendingProps),a.return=i;a.sibling=null}return i.child}function Pu(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&Cr(t)))}function mS(t,i,a){switch(i.tag){case 3:$(i,i.stateNode.containerInfo),Ii(i,Et,t.memoizedState.cache),zs();break;case 27:case 5:Ze(i);break;case 4:$(i,i.stateNode.containerInfo);break;case 10:Ii(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,bu(i),null;break;case 13:var r=i.memoizedState;if(r!==null)return r.dehydrated!==null?(Gi(i),i.flags|=128,null):(a&i.child.childLanes)!==0?Sp(t,i,a):(Gi(i),t=bi(t,i,a),t!==null?t.sibling:null);Gi(i);break;case 19:var f=(t.flags&128)!==0;if(r=(a&i.childLanes)!==0,r||(oa(t,i,a,!1),r=(a&i.childLanes)!==0),f){if(r)return jp(t,i,a);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ne(St,St.current),r)break;return null;case 22:return i.lanes=0,pp(t,i,a,i.pendingProps);case 24:Ii(i,Et,t.memoizedState.cache)}return bi(t,i,a)}function Np(t,i,a){if(t!==null)if(t.memoizedProps!==i.pendingProps)Tt=!0;else{if(!Pu(t,a)&&(i.flags&128)===0)return Tt=!1,mS(t,i,a);Tt=(t.flags&131072)!==0}else Tt=!1,Be&&(i.flags&1048576)!==0&&nm(i,ul,i.index);switch(i.lanes=0,i.tag){case 16:e:{var r=i.pendingProps;if(t=As(i.elementType),i.type=t,typeof t=="function")Wc(t)?(r=Rs(t,r),i.tag=1,i=bp(null,i,t,r,a)):(i.tag=0,i=qu(null,i,t,r,a));else{if(t!=null){var f=t.$$typeof;if(f===D){i.tag=11,i=fp(null,i,t,r,a);break e}else if(f===V){i.tag=14,i=hp(null,i,t,r,a);break e}}throw i=qe(t)||t,Error(l(306,i,""))}}return i;case 0:return qu(t,i,i.type,i.pendingProps,a);case 1:return r=i.type,f=Rs(r,i.pendingProps),bp(t,i,r,f,a);case 3:e:{if($(i,i.stateNode.containerInfo),t===null)throw Error(l(387));r=i.pendingProps;var h=i.memoizedState;f=h.element,mu(t,i),vl(i,r,null,a);var y=i.memoizedState;if(r=y.cache,Ii(i,Et,r),r!==h.cache&&ou(i,[Et],a,!0),yl(),r=y.element,h.isDehydrated)if(h={element:r,isDehydrated:!1,cache:y.cache},i.updateQueue.baseState=h,i.memoizedState=h,i.flags&256){i=xp(t,i,r,a);break e}else if(r!==f){f=kn(Error(l(424)),i),dl(f),i=xp(t,i,r,a);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,lt=An(t.firstChild),qt=i,Be=!0,$i=null,Cn=!0,a=pm(i,null,r,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(zs(),r===f){i=bi(t,i,a);break e}Ht(t,i,r,a)}i=i.child}return i;case 26:return Vr(t,i),t===null?(a=Mg(i.type,null,i.pendingProps,null))?i.memoizedState=a:Be||(a=i.type,t=i.pendingProps,r=uo(me.current).createElement(a),r[Ve]=i,r[Pt]=t,Gt(r,a,t),Pe(r),i.stateNode=r):i.memoizedState=Mg(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return Ze(i),t===null&&Be&&(r=i.stateNode=Og(i.type,i.pendingProps,me.current),qt=i,Cn=!0,f=lt,Wi(i.type)?(_d=f,lt=An(r.firstChild)):lt=f),Ht(t,i,i.pendingProps.children,a),Vr(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&Be&&((f=r=lt)&&(r=GS(r,i.type,i.pendingProps,Cn),r!==null?(i.stateNode=r,qt=i,lt=An(r.firstChild),Cn=!1,f=!0):f=!1),f||Bi(i)),Ze(i),f=i.type,h=i.pendingProps,y=t!==null?t.memoizedProps:null,r=h.children,wd(f,h)?r=null:y!==null&&wd(f,y)&&(i.flags|=32),i.memoizedState!==null&&(f=Su(t,i,aS,null,null,a),$l._currentValue=f),Vr(t,i),Ht(t,i,r,a),i.child;case 6:return t===null&&Be&&((t=a=lt)&&(a=KS(a,i.pendingProps,Cn),a!==null?(i.stateNode=a,qt=i,lt=null,t=!0):t=!1),t||Bi(i)),null;case 13:return Sp(t,i,a);case 4:return $(i,i.stateNode.containerInfo),r=i.pendingProps,t===null?i.child=Os(i,null,r,a):Ht(t,i,r,a),i.child;case 11:return fp(t,i,i.type,i.pendingProps,a);case 7:return Ht(t,i,i.pendingProps,a),i.child;case 8:return Ht(t,i,i.pendingProps.children,a),i.child;case 12:return Ht(t,i,i.pendingProps.children,a),i.child;case 10:return r=i.pendingProps,Ii(i,i.type,r.value),Ht(t,i,r.children,a),i.child;case 9:return f=i.type._context,r=i.pendingProps.children,Cs(i),f=Zt(f),r=r(f),i.flags|=1,Ht(t,i,r,a),i.child;case 14:return hp(t,i,i.type,i.pendingProps,a);case 15:return mp(t,i,i.type,i.pendingProps,a);case 19:return jp(t,i,a);case 31:return hS(t,i,a);case 22:return pp(t,i,a,i.pendingProps);case 24:return Cs(i),r=Zt(Et),t===null?(f=du(),f===null&&(f=it,h=cu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=a),f=h),i.memoizedState={parent:r,cache:f},hu(i),Ii(i,Et,f)):((t.lanes&a)!==0&&(mu(t,i),vl(i,null,null,a),yl()),f=t.memoizedState,h=i.memoizedState,f.parent!==r?(f={parent:r,cache:r},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),Ii(i,Et,r)):(r=h.cache,Ii(i,Et,r),r!==f.cache&&ou(i,[Et],a,!0))),Ht(t,i,i.pendingProps.children,a),i.child;case 29:throw i.pendingProps}throw Error(l(156,i.tag))}function xi(t){t.flags|=4}function Qu(t,i,a,r,f){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(Jp())t.flags|=8192;else throw Ts=Or,fu}else t.flags&=-16777217}function kp(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Ig(i))if(Jp())t.flags|=8192;else throw Ts=Or,fu}function Qr(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?or():536870912,t.lanes|=i,xa|=i)}function Nl(t,i){if(!Be)switch(t.tailMode){case"hidden":i=t.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function rt(t){var i=t.alternate!==null&&t.alternate.child===t.child,a=0,r=0;if(i)for(var f=t.child;f!==null;)a|=f.lanes|f.childLanes,r|=f.subtreeFlags&65011712,r|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)a|=f.lanes|f.childLanes,r|=f.subtreeFlags,r|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=r,t.childLanes=a,i}function pS(t,i,a){var r=i.pendingProps;switch(iu(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(i),null;case 1:return rt(i),null;case 3:return a=i.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),gi(Et),ie(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(ra(i)?xi(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,au())),rt(i),null;case 26:var f=i.type,h=i.memoizedState;return t===null?(xi(i),h!==null?(rt(i),kp(i,h)):(rt(i),Qu(i,f,null,r,a))):h?h!==t.memoizedState?(xi(i),rt(i),kp(i,h)):(rt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==r&&xi(i),rt(i),Qu(i,f,t,r,a)),null;case 27:if(le(i),a=me.current,f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&xi(i);else{if(!r){if(i.stateNode===null)throw Error(l(166));return rt(i),null}t=F.current,ra(i)?sm(i):(t=Og(f,r,a),i.stateNode=t,xi(i))}return rt(i),null;case 5:if(le(i),f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&xi(i);else{if(!r){if(i.stateNode===null)throw Error(l(166));return rt(i),null}if(h=F.current,ra(i))sm(i);else{var y=uo(me.current);switch(h){case 1:h=y.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=y.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=y.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=y.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=y.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof r.is=="string"?y.createElement("select",{is:r.is}):y.createElement("select"),r.multiple?h.multiple=!0:r.size&&(h.size=r.size);break;default:h=typeof r.is=="string"?y.createElement(f,{is:r.is}):y.createElement(f)}}h[Ve]=i,h[Pt]=r;e:for(y=i.child;y!==null;){if(y.tag===5||y.tag===6)h.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===i)break e;for(;y.sibling===null;){if(y.return===null||y.return===i)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}i.stateNode=h;e:switch(Gt(h,f,r),f){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&xi(i)}}return rt(i),Qu(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,a),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==r&&xi(i);else{if(typeof r!="string"&&i.stateNode===null)throw Error(l(166));if(t=me.current,ra(i)){if(t=i.stateNode,a=i.memoizedProps,r=null,f=qt,f!==null)switch(f.tag){case 27:case 5:r=f.memoizedProps}t[Ve]=i,t=!!(t.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Sg(t.nodeValue,a)),t||Bi(i,!0)}else t=uo(t).createTextNode(r),t[Ve]=i,i.stateNode=t}return rt(i),null;case 31:if(a=i.memoizedState,t===null||t.memoizedState!==null){if(r=ra(i),a!==null){if(t===null){if(!r)throw Error(l(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[Ve]=i}else zs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;rt(i),t=!1}else a=au(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return i.flags&256?(gn(i),i):(gn(i),null);if((i.flags&128)!==0)throw Error(l(558))}return rt(i),null;case 13:if(r=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=ra(i),r!==null&&r.dehydrated!==null){if(t===null){if(!f)throw Error(l(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[Ve]=i}else zs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;rt(i),f=!1}else f=au(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(gn(i),i):(gn(i),null)}return gn(i),(i.flags&128)!==0?(i.lanes=a,i):(a=r!==null,t=t!==null&&t.memoizedState!==null,a&&(r=i.child,f=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(f=r.alternate.memoizedState.cachePool.pool),h=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==f&&(r.flags|=2048)),a!==t&&a&&(i.child.flags|=8192),Qr(i,i.updateQueue),rt(i),null);case 4:return ie(),t===null&&yd(i.stateNode.containerInfo),rt(i),null;case 10:return gi(i.type),rt(i),null;case 19:if(G(St),r=i.memoizedState,r===null)return rt(i),null;if(f=(i.flags&128)!==0,h=r.rendering,h===null)if(f)Nl(r,!1);else{if(xt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(h=Lr(t),h!==null){for(i.flags|=128,Nl(r,!1),t=h.updateQueue,i.updateQueue=t,Qr(i,t),i.subtreeFlags=0,t=a,a=i.child;a!==null;)Wh(a,t),a=a.sibling;return ne(St,St.current&1|2),Be&&mi(i,r.treeForkCount),i.child}t=t.sibling}r.tail!==null&&_t()>eo&&(i.flags|=128,f=!0,Nl(r,!1),i.lanes=4194304)}else{if(!f)if(t=Lr(h),t!==null){if(i.flags|=128,f=!0,t=t.updateQueue,i.updateQueue=t,Qr(i,t),Nl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!h.alternate&&!Be)return rt(i),null}else 2*_t()-r.renderingStartTime>eo&&a!==536870912&&(i.flags|=128,f=!0,Nl(r,!1),i.lanes=4194304);r.isBackwards?(h.sibling=i.child,i.child=h):(t=r.last,t!==null?t.sibling=h:i.child=h,r.last=h)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=_t(),t.sibling=null,a=St.current,ne(St,f?a&1|2:a&1),Be&&mi(i,r.treeForkCount),t):(rt(i),null);case 22:case 23:return gn(i),vu(),r=i.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(i.flags|=8192):r&&(i.flags|=8192),r?(a&536870912)!==0&&(i.flags&128)===0&&(rt(i),i.subtreeFlags&6&&(i.flags|=8192)):rt(i),a=i.updateQueue,a!==null&&Qr(i,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==a&&(i.flags|=2048),t!==null&&G(Es),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),gi(Et),rt(i),null;case 25:return null;case 30:return null}throw Error(l(156,i.tag))}function gS(t,i){switch(iu(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return gi(Et),ie(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return le(i),null;case 31:if(i.memoizedState!==null){if(gn(i),i.alternate===null)throw Error(l(340));zs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(gn(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(l(340));zs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return G(St),null;case 4:return ie(),null;case 10:return gi(i.type),null;case 22:case 23:return gn(i),vu(),t!==null&&G(Es),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return gi(Et),null;case 25:return null;default:return null}}function zp(t,i){switch(iu(i),i.tag){case 3:gi(Et),ie();break;case 26:case 27:case 5:le(i);break;case 4:ie();break;case 31:i.memoizedState!==null&&gn(i);break;case 13:gn(i);break;case 19:G(St);break;case 10:gi(i.type);break;case 22:case 23:gn(i),vu(),t!==null&&G(Es);break;case 24:gi(Et)}}function kl(t,i){try{var a=i.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var f=r.next;a=f;do{if((a.tag&t)===t){r=void 0;var h=a.create,y=a.inst;r=h(),y.destroy=r}a=a.next}while(a!==f)}}catch(S){Fe(i,i.return,S)}}function Yi(t,i,a){try{var r=i.updateQueue,f=r!==null?r.lastEffect:null;if(f!==null){var h=f.next;r=h;do{if((r.tag&t)===t){var y=r.inst,S=y.destroy;if(S!==void 0){y.destroy=void 0,f=i;var _=a,I=S;try{I()}catch(P){Fe(f,_,P)}}}r=r.next}while(r!==h)}}catch(P){Fe(i,i.return,P)}}function _p(t){var i=t.updateQueue;if(i!==null){var a=t.stateNode;try{ym(i,a)}catch(r){Fe(t,t.return,r)}}}function Cp(t,i,a){a.props=Rs(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(r){Fe(t,i,r)}}function zl(t,i){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof a=="function"?t.refCleanup=a(r):a.current=r}}catch(f){Fe(t,i,f)}}function ni(t,i){var a=t.ref,r=t.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(f){Fe(t,i,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){Fe(t,i,f)}else a.current=null}function Ep(t){var i=t.type,a=t.memoizedProps,r=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(f){Fe(t,t.return,f)}}function Xu(t,i,a){try{var r=t.stateNode;$S(r,t.type,a,i),r[Pt]=i}catch(f){Fe(t,t.return,f)}}function Ap(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Wi(t.type)||t.tag===4}function Ju(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ap(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Wi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Fu(t,i,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,i?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,i):(i=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,i.appendChild(t),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=di));else if(r!==4&&(r===27&&Wi(t.type)&&(a=t.stateNode,i=null),t=t.child,t!==null))for(Fu(t,i,a),t=t.sibling;t!==null;)Fu(t,i,a),t=t.sibling}function Xr(t,i,a){var r=t.tag;if(r===5||r===6)t=t.stateNode,i?a.insertBefore(t,i):a.appendChild(t);else if(r!==4&&(r===27&&Wi(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Xr(t,i,a),t=t.sibling;t!==null;)Xr(t,i,a),t=t.sibling}function Tp(t){var i=t.stateNode,a=t.memoizedProps;try{for(var r=t.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);Gt(i,r,a),i[Ve]=t,i[Pt]=a}catch(h){Fe(t,t.return,h)}}var Si=!1,Ot=!1,Wu=!1,Op=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function yS(t,i){if(t=t.containerInfo,xd=vo,t=Gh(t),Yc(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var f=r.anchorOffset,h=r.focusNode;r=r.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var y=0,S=-1,_=-1,I=0,P=0,W=t,Z=null;t:for(;;){for(var Y;W!==a||f!==0&&W.nodeType!==3||(S=y+f),W!==h||r!==0&&W.nodeType!==3||(_=y+r),W.nodeType===3&&(y+=W.nodeValue.length),(Y=W.firstChild)!==null;)Z=W,W=Y;for(;;){if(W===t)break t;if(Z===a&&++I===f&&(S=y),Z===h&&++P===r&&(_=y),(Y=W.nextSibling)!==null)break;W=Z,Z=W.parentNode}W=Y}a=S===-1||_===-1?null:{start:S,end:_}}else a=null}a=a||{start:0,end:0}}else a=null;for(Sd={focusedElem:t,selectionRange:a},vo=!1,Bt=i;Bt!==null;)if(i=Bt,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Bt=t;else for(;Bt!==null;){switch(i=Bt,h=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)f=t[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,a=i,f=h.memoizedProps,h=h.memoizedState,r=a.stateNode;try{var pe=Rs(a.type,f);t=r.getSnapshotBeforeUpdate(pe,h),r.__reactInternalSnapshotBeforeUpdate=t}catch(je){Fe(a,a.return,je)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,a=t.nodeType,a===9)Nd(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Nd(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=i.sibling,t!==null){t.return=i.return,Bt=t;break}Bt=i.return}}function Dp(t,i,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:ji(t,a),r&4&&kl(5,a);break;case 1:if(ji(t,a),r&4)if(t=a.stateNode,i===null)try{t.componentDidMount()}catch(y){Fe(a,a.return,y)}else{var f=Rs(a.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(f,i,t.__reactInternalSnapshotBeforeUpdate)}catch(y){Fe(a,a.return,y)}}r&64&&_p(a),r&512&&zl(a,a.return);break;case 3:if(ji(t,a),r&64&&(t=a.updateQueue,t!==null)){if(i=null,a.child!==null)switch(a.child.tag){case 27:case 5:i=a.child.stateNode;break;case 1:i=a.child.stateNode}try{ym(t,i)}catch(y){Fe(a,a.return,y)}}break;case 27:i===null&&r&4&&Tp(a);case 26:case 5:ji(t,a),i===null&&r&4&&Ep(a),r&512&&zl(a,a.return);break;case 12:ji(t,a);break;case 31:ji(t,a),r&4&&Lp(t,a);break;case 13:ji(t,a),r&4&&Up(t,a),r&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=zS.bind(null,a),YS(t,a))));break;case 22:if(r=a.memoizedState!==null||Si,!r){i=i!==null&&i.memoizedState!==null||Ot,f=Si;var h=Ot;Si=r,(Ot=i)&&!h?Ni(t,a,(a.subtreeFlags&8772)!==0):ji(t,a),Si=f,Ot=h}break;case 30:break;default:ji(t,a)}}function Rp(t){var i=t.alternate;i!==null&&(t.alternate=null,Rp(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Di(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ft=null,sn=!1;function wi(t,i,a){for(a=a.child;a!==null;)Mp(t,i,a),a=a.sibling}function Mp(t,i,a){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(Xe,a)}catch{}switch(a.tag){case 26:Ot||ni(a,i),wi(t,i,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ot||ni(a,i);var r=ft,f=sn;Wi(a.type)&&(ft=a.stateNode,sn=!1),wi(t,i,a),Ml(a.stateNode),ft=r,sn=f;break;case 5:Ot||ni(a,i);case 6:if(r=ft,f=sn,ft=null,wi(t,i,a),ft=r,sn=f,ft!==null)if(sn)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(a.stateNode)}catch(h){Fe(a,i,h)}else try{ft.removeChild(a.stateNode)}catch(h){Fe(a,i,h)}break;case 18:ft!==null&&(sn?(t=ft,_g(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Ca(t)):_g(ft,a.stateNode));break;case 4:r=ft,f=sn,ft=a.stateNode.containerInfo,sn=!0,wi(t,i,a),ft=r,sn=f;break;case 0:case 11:case 14:case 15:Yi(2,a,i),Ot||Yi(4,a,i),wi(t,i,a);break;case 1:Ot||(ni(a,i),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Cp(a,i,r)),wi(t,i,a);break;case 21:wi(t,i,a);break;case 22:Ot=(r=Ot)||a.memoizedState!==null,wi(t,i,a),Ot=r;break;default:wi(t,i,a)}}function Lp(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ca(t)}catch(a){Fe(i,i.return,a)}}}function Up(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ca(t)}catch(a){Fe(i,i.return,a)}}function vS(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Op),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Op),i;default:throw Error(l(435,t.tag))}}function Jr(t,i){var a=vS(t);i.forEach(function(r){if(!a.has(r)){a.add(r);var f=_S.bind(null,t,r);r.then(f,f)}})}function an(t,i){var a=i.deletions;if(a!==null)for(var r=0;r<a.length;r++){var f=a[r],h=t,y=i,S=y;e:for(;S!==null;){switch(S.tag){case 27:if(Wi(S.type)){ft=S.stateNode,sn=!1;break e}break;case 5:ft=S.stateNode,sn=!1;break e;case 3:case 4:ft=S.stateNode.containerInfo,sn=!0;break e}S=S.return}if(ft===null)throw Error(l(160));Mp(h,y,f),ft=null,sn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)$p(i,t),i=i.sibling}var In=null;function $p(t,i){var a=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:an(i,t),ln(t),r&4&&(Yi(3,t,t.return),kl(3,t),Yi(5,t,t.return));break;case 1:an(i,t),ln(t),r&512&&(Ot||a===null||ni(a,a.return)),r&64&&Si&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var f=In;if(an(i,t),ln(t),r&512&&(Ot||a===null||ni(a,a.return)),r&4){var h=a!==null?a.memoizedState:null;if(r=t.memoizedState,a===null)if(r===null)if(t.stateNode===null){e:{r=t.type,a=t.memoizedProps,f=f.ownerDocument||f;t:switch(r){case"title":h=f.getElementsByTagName("title")[0],(!h||h[Fn]||h[Ve]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(r),f.head.insertBefore(h,f.querySelector("head > title"))),Gt(h,r,a),h[Ve]=t,Pe(h),r=h;break e;case"link":var y=$g("link","href",f).get(r+(a.href||""));if(y){for(var S=0;S<y.length;S++)if(h=y[S],h.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&h.getAttribute("rel")===(a.rel==null?null:a.rel)&&h.getAttribute("title")===(a.title==null?null:a.title)&&h.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){y.splice(S,1);break t}}h=f.createElement(r),Gt(h,r,a),f.head.appendChild(h);break;case"meta":if(y=$g("meta","content",f).get(r+(a.content||""))){for(S=0;S<y.length;S++)if(h=y[S],h.getAttribute("content")===(a.content==null?null:""+a.content)&&h.getAttribute("name")===(a.name==null?null:a.name)&&h.getAttribute("property")===(a.property==null?null:a.property)&&h.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&h.getAttribute("charset")===(a.charSet==null?null:a.charSet)){y.splice(S,1);break t}}h=f.createElement(r),Gt(h,r,a),f.head.appendChild(h);break;default:throw Error(l(468,r))}h[Ve]=t,Pe(h),r=h}t.stateNode=r}else Bg(f,t.type,t.stateNode);else t.stateNode=Ug(f,r,t.memoizedProps);else h!==r?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,r===null?Bg(f,t.type,t.stateNode):Ug(f,r,t.memoizedProps)):r===null&&t.stateNode!==null&&Xu(t,t.memoizedProps,a.memoizedProps)}break;case 27:an(i,t),ln(t),r&512&&(Ot||a===null||ni(a,a.return)),a!==null&&r&4&&Xu(t,t.memoizedProps,a.memoizedProps);break;case 5:if(an(i,t),ln(t),r&512&&(Ot||a===null||ni(a,a.return)),t.flags&32){f=t.stateNode;try{Js(f,"")}catch(pe){Fe(t,t.return,pe)}}r&4&&t.stateNode!=null&&(f=t.memoizedProps,Xu(t,f,a!==null?a.memoizedProps:f)),r&1024&&(Wu=!0);break;case 6:if(an(i,t),ln(t),r&4){if(t.stateNode===null)throw Error(l(162));r=t.memoizedProps,a=t.stateNode;try{a.nodeValue=r}catch(pe){Fe(t,t.return,pe)}}break;case 3:if(mo=null,f=In,In=fo(i.containerInfo),an(i,t),In=f,ln(t),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Ca(i.containerInfo)}catch(pe){Fe(t,t.return,pe)}Wu&&(Wu=!1,Bp(t));break;case 4:r=In,In=fo(t.stateNode.containerInfo),an(i,t),ln(t),In=r;break;case 12:an(i,t),ln(t);break;case 31:an(i,t),ln(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Jr(t,r)));break;case 13:an(i,t),ln(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Wr=_t()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Jr(t,r)));break;case 22:f=t.memoizedState!==null;var _=a!==null&&a.memoizedState!==null,I=Si,P=Ot;if(Si=I||f,Ot=P||_,an(i,t),Ot=P,Si=I,ln(t),r&8192)e:for(i=t.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(a===null||_||Si||Ot||Ms(t)),a=null,i=t;;){if(i.tag===5||i.tag===26){if(a===null){_=a=i;try{if(h=_.stateNode,f)y=h.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{S=_.stateNode;var W=_.memoizedProps.style,Z=W!=null&&W.hasOwnProperty("display")?W.display:null;S.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(pe){Fe(_,_.return,pe)}}}else if(i.tag===6){if(a===null){_=i;try{_.stateNode.nodeValue=f?"":_.memoizedProps}catch(pe){Fe(_,_.return,pe)}}}else if(i.tag===18){if(a===null){_=i;try{var Y=_.stateNode;f?Cg(Y,!0):Cg(_.stateNode,!1)}catch(pe){Fe(_,_.return,pe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;a===i&&(a=null),i=i.return}a===i&&(a=null),i.sibling.return=i.return,i=i.sibling}r&4&&(r=t.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Jr(t,a))));break;case 19:an(i,t),ln(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Jr(t,r)));break;case 30:break;case 21:break;default:an(i,t),ln(t)}}function ln(t){var i=t.flags;if(i&2){try{for(var a,r=t.return;r!==null;){if(Ap(r)){a=r;break}r=r.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var f=a.stateNode,h=Ju(t);Xr(t,h,f);break;case 5:var y=a.stateNode;a.flags&32&&(Js(y,""),a.flags&=-33);var S=Ju(t);Xr(t,S,y);break;case 3:case 4:var _=a.stateNode.containerInfo,I=Ju(t);Fu(t,I,_);break;default:throw Error(l(161))}}catch(P){Fe(t,t.return,P)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Bp(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Bp(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function ji(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Dp(t,i.alternate,i),i=i.sibling}function Ms(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Yi(4,i,i.return),Ms(i);break;case 1:ni(i,i.return);var a=i.stateNode;typeof a.componentWillUnmount=="function"&&Cp(i,i.return,a),Ms(i);break;case 27:Ml(i.stateNode);case 26:case 5:ni(i,i.return),Ms(i);break;case 22:i.memoizedState===null&&Ms(i);break;case 30:Ms(i);break;default:Ms(i)}t=t.sibling}}function Ni(t,i,a){for(a=a&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var r=i.alternate,f=t,h=i,y=h.flags;switch(h.tag){case 0:case 11:case 15:Ni(f,h,a),kl(4,h);break;case 1:if(Ni(f,h,a),r=h,f=r.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(I){Fe(r,r.return,I)}if(r=h,f=r.updateQueue,f!==null){var S=r.stateNode;try{var _=f.shared.hiddenCallbacks;if(_!==null)for(f.shared.hiddenCallbacks=null,f=0;f<_.length;f++)gm(_[f],S)}catch(I){Fe(r,r.return,I)}}a&&y&64&&_p(h),zl(h,h.return);break;case 27:Tp(h);case 26:case 5:Ni(f,h,a),a&&r===null&&y&4&&Ep(h),zl(h,h.return);break;case 12:Ni(f,h,a);break;case 31:Ni(f,h,a),a&&y&4&&Lp(f,h);break;case 13:Ni(f,h,a),a&&y&4&&Up(f,h);break;case 22:h.memoizedState===null&&Ni(f,h,a),zl(h,h.return);break;case 30:break;default:Ni(f,h,a)}i=i.sibling}}function ed(t,i){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&fl(a))}function td(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&fl(t))}function qn(t,i,a,r){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ip(t,i,a,r),i=i.sibling}function Ip(t,i,a,r){var f=i.flags;switch(i.tag){case 0:case 11:case 15:qn(t,i,a,r),f&2048&&kl(9,i);break;case 1:qn(t,i,a,r);break;case 3:qn(t,i,a,r),f&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&fl(t)));break;case 12:if(f&2048){qn(t,i,a,r),t=i.stateNode;try{var h=i.memoizedProps,y=h.id,S=h.onPostCommit;typeof S=="function"&&S(y,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(_){Fe(i,i.return,_)}}else qn(t,i,a,r);break;case 31:qn(t,i,a,r);break;case 13:qn(t,i,a,r);break;case 23:break;case 22:h=i.stateNode,y=i.alternate,i.memoizedState!==null?h._visibility&2?qn(t,i,a,r):_l(t,i):h._visibility&2?qn(t,i,a,r):(h._visibility|=2,ya(t,i,a,r,(i.subtreeFlags&10256)!==0||!1)),f&2048&&ed(y,i);break;case 24:qn(t,i,a,r),f&2048&&td(i.alternate,i);break;default:qn(t,i,a,r)}}function ya(t,i,a,r,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var h=t,y=i,S=a,_=r,I=y.flags;switch(y.tag){case 0:case 11:case 15:ya(h,y,S,_,f),kl(8,y);break;case 23:break;case 22:var P=y.stateNode;y.memoizedState!==null?P._visibility&2?ya(h,y,S,_,f):_l(h,y):(P._visibility|=2,ya(h,y,S,_,f)),f&&I&2048&&ed(y.alternate,y);break;case 24:ya(h,y,S,_,f),f&&I&2048&&td(y.alternate,y);break;default:ya(h,y,S,_,f)}i=i.sibling}}function _l(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var a=t,r=i,f=r.flags;switch(r.tag){case 22:_l(a,r),f&2048&&ed(r.alternate,r);break;case 24:_l(a,r),f&2048&&td(r.alternate,r);break;default:_l(a,r)}i=i.sibling}}var Cl=8192;function va(t,i,a){if(t.subtreeFlags&Cl)for(t=t.child;t!==null;)qp(t,i,a),t=t.sibling}function qp(t,i,a){switch(t.tag){case 26:va(t,i,a),t.flags&Cl&&t.memoizedState!==null&&sw(a,In,t.memoizedState,t.memoizedProps);break;case 5:va(t,i,a);break;case 3:case 4:var r=In;In=fo(t.stateNode.containerInfo),va(t,i,a),In=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=Cl,Cl=16777216,va(t,i,a),Cl=r):va(t,i,a));break;default:va(t,i,a)}}function Zp(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function El(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var r=i[a];Bt=r,Gp(r,t)}Zp(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Hp(t),t=t.sibling}function Hp(t){switch(t.tag){case 0:case 11:case 15:El(t),t.flags&2048&&Yi(9,t,t.return);break;case 3:El(t);break;case 12:El(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Fr(t)):El(t);break;default:El(t)}}function Fr(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var r=i[a];Bt=r,Gp(r,t)}Zp(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Yi(8,i,i.return),Fr(i);break;case 22:a=i.stateNode,a._visibility&2&&(a._visibility&=-3,Fr(i));break;default:Fr(i)}t=t.sibling}}function Gp(t,i){for(;Bt!==null;){var a=Bt;switch(a.tag){case 0:case 11:case 15:Yi(8,a,i);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:fl(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,Bt=r;else e:for(a=t;Bt!==null;){r=Bt;var f=r.sibling,h=r.return;if(Rp(r),r===a){Bt=null;break e}if(f!==null){f.return=h,Bt=f;break e}Bt=h}}}var bS={getCacheForType:function(t){var i=Zt(Et),a=i.data.get(t);return a===void 0&&(a=t(),i.data.set(t,a)),a},cacheSignal:function(){return Zt(Et).controller.signal}},xS=typeof WeakMap=="function"?WeakMap:Map,Ye=0,it=null,Re=null,Ue=0,Je=0,yn=null,Vi=!1,ba=!1,nd=!1,ki=0,xt=0,Pi=0,Ls=0,id=0,vn=0,xa=0,Al=null,rn=null,sd=!1,Wr=0,Kp=0,eo=1/0,to=null,Qi=null,Ut=0,Xi=null,Sa=null,zi=0,ad=0,ld=null,Yp=null,Tl=0,rd=null;function bn(){return(Ye&2)!==0&&Ue!==0?Ue&-Ue:q.T!==null?hd():Jn()}function Vp(){if(vn===0)if((Ue&536870912)===0||Be){var t=ys;ys<<=1,(ys&3932160)===0&&(ys=262144),vn=t}else vn=536870912;return t=pn.current,t!==null&&(t.flags|=32),vn}function on(t,i,a){(t===it&&(Je===2||Je===9)||t.cancelPendingCommit!==null)&&(wa(t,0),Ji(t,Ue,vn,!1)),vs(t,a),((Ye&2)===0||t!==it)&&(t===it&&((Ye&2)===0&&(Ls|=a),xt===4&&Ji(t,Ue,vn,!1)),ii(t))}function Pp(t,i,a){if((Ye&6)!==0)throw Error(l(327));var r=!a&&(i&127)===0&&(i&t.expiredLanes)===0||Oi(t,i),f=r?jS(t,i):cd(t,i,!0),h=r;do{if(f===0){ba&&!r&&Ji(t,i,0,!1);break}else{if(a=t.current.alternate,h&&!SS(a)){f=cd(t,i,!1),h=!1;continue}if(f===2){if(h=i,t.errorRecoveryDisabledLanes&h)var y=0;else y=t.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){i=y;e:{var S=t;f=Al;var _=S.current.memoizedState.isDehydrated;if(_&&(wa(S,y).flags|=256),y=cd(S,y,!1),y!==2){if(nd&&!_){S.errorRecoveryDisabledLanes|=h,Ls|=h,f=4;break e}h=rn,rn=f,h!==null&&(rn===null?rn=h:rn.push.apply(rn,h))}f=y}if(h=!1,f!==2)continue}}if(f===1){wa(t,0),Ji(t,i,0,!0);break}e:{switch(r=t,h=f,h){case 0:case 1:throw Error(l(345));case 4:if((i&4194048)!==i)break;case 6:Ji(r,i,vn,!Vi);break e;case 2:rn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((i&62914560)===i&&(f=Wr+300-_t(),10<f)){if(Ji(r,i,vn,!Vi),Vs(r,0,!0)!==0)break e;zi=i,r.timeoutHandle=kg(Qp.bind(null,r,a,rn,to,sd,i,vn,Ls,xa,Vi,h,"Throttled",-0,0),f);break e}Qp(r,a,rn,to,sd,i,vn,Ls,xa,Vi,h,null,-0,0)}}break}while(!0);ii(t)}function Qp(t,i,a,r,f,h,y,S,_,I,P,W,Z,Y){if(t.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:di},qp(i,h,W);var pe=(h&62914560)===h?Wr-_t():(h&4194048)===h?Kp-_t():0;if(pe=aw(W,pe),pe!==null){zi=h,t.cancelPendingCommit=pe(ig.bind(null,t,i,h,a,r,f,y,S,_,P,W,null,Z,Y)),Ji(t,h,y,!I);return}}ig(t,i,h,a,r,f,y,S,_)}function SS(t){for(var i=t;;){var a=i.tag;if((a===0||a===11||a===15)&&i.flags&16384&&(a=i.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var f=a[r],h=f.getSnapshot;f=f.value;try{if(!hn(h(),f))return!1}catch{return!1}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ji(t,i,a,r){i&=~id,i&=~Ls,t.suspendedLanes|=i,t.pingedLanes&=~i,r&&(t.warmLanes|=i),r=t.expirationTimes;for(var f=i;0<f;){var h=31-Ee(f),y=1<<h;r[h]=-1,f&=~y}a!==0&&M(t,a,i)}function no(){return(Ye&6)===0?(Ol(0),!1):!0}function od(){if(Re!==null){if(Je===0)var t=Re.return;else t=Re,pi=_s=null,Nu(t),fa=null,ml=0,t=Re;for(;t!==null;)zp(t.alternate,t),t=t.return;Re=null}}function wa(t,i){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,qS(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),zi=0,od(),it=t,Re=a=hi(t.current,null),Ue=i,Je=0,yn=null,Vi=!1,ba=Oi(t,i),nd=!1,xa=vn=id=Ls=Pi=xt=0,rn=Al=null,sd=!1,(i&8)!==0&&(i|=i&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=i;0<r;){var f=31-Ee(r),h=1<<f;i|=t[f],r&=~h}return ki=i,jr(),a}function Xp(t,i){_e=null,q.H=wl,i===da||i===Tr?(i=fm(),Je=3):i===fu?(i=fm(),Je=4):Je=i===Iu?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,yn=i,Re===null&&(xt=1,Kr(t,kn(i,t.current)))}function Jp(){var t=pn.current;return t===null?!0:(Ue&4194048)===Ue?En===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?t===En:!1}function Fp(){var t=q.H;return q.H=wl,t===null?wl:t}function Wp(){var t=q.A;return q.A=bS,t}function io(){xt=4,Vi||(Ue&4194048)!==Ue&&pn.current!==null||(ba=!0),(Pi&134217727)===0&&(Ls&134217727)===0||it===null||Ji(it,Ue,vn,!1)}function cd(t,i,a){var r=Ye;Ye|=2;var f=Fp(),h=Wp();(it!==t||Ue!==i)&&(to=null,wa(t,i)),i=!1;var y=xt;e:do try{if(Je!==0&&Re!==null){var S=Re,_=yn;switch(Je){case 8:od(),y=6;break e;case 3:case 2:case 9:case 6:pn.current===null&&(i=!0);var I=Je;if(Je=0,yn=null,ja(t,S,_,I),a&&ba){y=0;break e}break;default:I=Je,Je=0,yn=null,ja(t,S,_,I)}}wS(),y=xt;break}catch(P){Xp(t,P)}while(!0);return i&&t.shellSuspendCounter++,pi=_s=null,Ye=r,q.H=f,q.A=h,Re===null&&(it=null,Ue=0,jr()),y}function wS(){for(;Re!==null;)eg(Re)}function jS(t,i){var a=Ye;Ye|=2;var r=Fp(),f=Wp();it!==t||Ue!==i?(to=null,eo=_t()+500,wa(t,i)):ba=Oi(t,i);e:do try{if(Je!==0&&Re!==null){i=Re;var h=yn;t:switch(Je){case 1:Je=0,yn=null,ja(t,i,h,1);break;case 2:case 9:if(um(h)){Je=0,yn=null,tg(i);break}i=function(){Je!==2&&Je!==9||it!==t||(Je=7),ii(t)},h.then(i,i);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:um(h)?(Je=0,yn=null,tg(i)):(Je=0,yn=null,ja(t,i,h,7));break;case 5:var y=null;switch(Re.tag){case 26:y=Re.memoizedState;case 5:case 27:var S=Re;if(y?Ig(y):S.stateNode.complete){Je=0,yn=null;var _=S.sibling;if(_!==null)Re=_;else{var I=S.return;I!==null?(Re=I,so(I)):Re=null}break t}}Je=0,yn=null,ja(t,i,h,5);break;case 6:Je=0,yn=null,ja(t,i,h,6);break;case 8:od(),xt=6;break e;default:throw Error(l(462))}}NS();break}catch(P){Xp(t,P)}while(!0);return pi=_s=null,q.H=r,q.A=f,Ye=a,Re!==null?0:(it=null,Ue=0,jr(),xt)}function NS(){for(;Re!==null&&!Pn();)eg(Re)}function eg(t){var i=Np(t.alternate,t,ki);t.memoizedProps=t.pendingProps,i===null?so(t):Re=i}function tg(t){var i=t,a=i.alternate;switch(i.tag){case 15:case 0:i=vp(a,i,i.pendingProps,i.type,void 0,Ue);break;case 11:i=vp(a,i,i.pendingProps,i.type.render,i.ref,Ue);break;case 5:Nu(i);default:zp(a,i),i=Re=Wh(i,ki),i=Np(a,i,ki)}t.memoizedProps=t.pendingProps,i===null?so(t):Re=i}function ja(t,i,a,r){pi=_s=null,Nu(i),fa=null,ml=0;var f=i.return;try{if(fS(t,f,i,a,Ue)){xt=1,Kr(t,kn(a,t.current)),Re=null;return}}catch(h){if(f!==null)throw Re=f,h;xt=1,Kr(t,kn(a,t.current)),Re=null;return}i.flags&32768?(Be||r===1?t=!0:ba||(Ue&536870912)!==0?t=!1:(Vi=t=!0,(r===2||r===9||r===3||r===6)&&(r=pn.current,r!==null&&r.tag===13&&(r.flags|=16384))),ng(i,t)):so(i)}function so(t){var i=t;do{if((i.flags&32768)!==0){ng(i,Vi);return}t=i.return;var a=pS(i.alternate,i,ki);if(a!==null){Re=a;return}if(i=i.sibling,i!==null){Re=i;return}Re=i=t}while(i!==null);xt===0&&(xt=5)}function ng(t,i){do{var a=gS(t.alternate,t);if(a!==null){a.flags&=32767,Re=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!i&&(t=t.sibling,t!==null)){Re=t;return}Re=t=a}while(t!==null);xt=6,Re=null}function ig(t,i,a,r,f,h,y,S,_){t.cancelPendingCommit=null;do ao();while(Ut!==0);if((Ye&6)!==0)throw Error(l(327));if(i!==null){if(i===t.current)throw Error(l(177));if(h=i.lanes|i.childLanes,h|=Jc,cr(t,a,h,y,S,_),t===it&&(Re=it=null,Ue=0),Sa=i,Xi=t,zi=a,ad=h,ld=f,Yp=r,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,CS(Ct,function(){return og(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||r){r=q.T,q.T=null,f=K.p,K.p=2,y=Ye,Ye|=4;try{yS(t,i,a)}finally{Ye=y,K.p=f,q.T=r}}Ut=1,sg(),ag(),lg()}}function sg(){if(Ut===1){Ut=0;var t=Xi,i=Sa,a=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||a){a=q.T,q.T=null;var r=K.p;K.p=2;var f=Ye;Ye|=4;try{$p(i,t);var h=Sd,y=Gh(t.containerInfo),S=h.focusedElem,_=h.selectionRange;if(y!==S&&S&&S.ownerDocument&&Hh(S.ownerDocument.documentElement,S)){if(_!==null&&Yc(S)){var I=_.start,P=_.end;if(P===void 0&&(P=I),"selectionStart"in S)S.selectionStart=I,S.selectionEnd=Math.min(P,S.value.length);else{var W=S.ownerDocument||document,Z=W&&W.defaultView||window;if(Z.getSelection){var Y=Z.getSelection(),pe=S.textContent.length,je=Math.min(_.start,pe),nt=_.end===void 0?je:Math.min(_.end,pe);!Y.extend&&je>nt&&(y=nt,nt=je,je=y);var U=Zh(S,je),T=Zh(S,nt);if(U&&T&&(Y.rangeCount!==1||Y.anchorNode!==U.node||Y.anchorOffset!==U.offset||Y.focusNode!==T.node||Y.focusOffset!==T.offset)){var B=W.createRange();B.setStart(U.node,U.offset),Y.removeAllRanges(),je>nt?(Y.addRange(B),Y.extend(T.node,T.offset)):(B.setEnd(T.node,T.offset),Y.addRange(B))}}}}for(W=[],Y=S;Y=Y.parentNode;)Y.nodeType===1&&W.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<W.length;S++){var X=W[S];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}vo=!!xd,Sd=xd=null}finally{Ye=f,K.p=r,q.T=a}}t.current=i,Ut=2}}function ag(){if(Ut===2){Ut=0;var t=Xi,i=Sa,a=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||a){a=q.T,q.T=null;var r=K.p;K.p=2;var f=Ye;Ye|=4;try{Dp(t,i.alternate,i)}finally{Ye=f,K.p=r,q.T=a}}Ut=3}}function lg(){if(Ut===4||Ut===3){Ut=0,Qn();var t=Xi,i=Sa,a=zi,r=Yp;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ut=5:(Ut=0,Sa=Xi=null,rg(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(Qi=null),Xt(a),i=i.stateNode,Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(Xe,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=q.T,f=K.p,K.p=2,q.T=null;try{for(var h=t.onRecoverableError,y=0;y<r.length;y++){var S=r[y];h(S.value,{componentStack:S.stack})}}finally{q.T=i,K.p=f}}(zi&3)!==0&&ao(),ii(t),f=t.pendingLanes,(a&261930)!==0&&(f&42)!==0?t===rd?Tl++:(Tl=0,rd=t):Tl=0,Ol(0)}}function rg(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,fl(i)))}function ao(){return sg(),ag(),lg(),og()}function og(){if(Ut!==5)return!1;var t=Xi,i=ad;ad=0;var a=Xt(zi),r=q.T,f=K.p;try{K.p=32>a?32:a,q.T=null,a=ld,ld=null;var h=Xi,y=zi;if(Ut=0,Sa=Xi=null,zi=0,(Ye&6)!==0)throw Error(l(331));var S=Ye;if(Ye|=4,Hp(h.current),Ip(h,h.current,y,a),Ye=S,Ol(0,!1),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(Xe,h)}catch{}return!0}finally{K.p=f,q.T=r,rg(t,i)}}function cg(t,i,a){i=kn(a,i),i=Bu(t.stateNode,i,2),t=Hi(t,i,2),t!==null&&(vs(t,2),ii(t))}function Fe(t,i,a){if(t.tag===3)cg(t,t,a);else for(;i!==null;){if(i.tag===3){cg(i,t,a);break}else if(i.tag===1){var r=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Qi===null||!Qi.has(r))){t=kn(a,t),a=up(2),r=Hi(i,a,2),r!==null&&(dp(a,r,i,t),vs(r,2),ii(r));break}}i=i.return}}function ud(t,i,a){var r=t.pingCache;if(r===null){r=t.pingCache=new xS;var f=new Set;r.set(i,f)}else f=r.get(i),f===void 0&&(f=new Set,r.set(i,f));f.has(a)||(nd=!0,f.add(a),t=kS.bind(null,t,i,a),i.then(t,t))}function kS(t,i,a){var r=t.pingCache;r!==null&&r.delete(i),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,it===t&&(Ue&a)===a&&(xt===4||xt===3&&(Ue&62914560)===Ue&&300>_t()-Wr?(Ye&2)===0&&wa(t,0):id|=a,xa===Ue&&(xa=0)),ii(t)}function ug(t,i){i===0&&(i=or()),t=Ns(t,i),t!==null&&(vs(t,i),ii(t))}function zS(t){var i=t.memoizedState,a=0;i!==null&&(a=i.retryLane),ug(t,a)}function _S(t,i){var a=0;switch(t.tag){case 31:case 13:var r=t.stateNode,f=t.memoizedState;f!==null&&(a=f.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(l(314))}r!==null&&r.delete(i),ug(t,a)}function CS(t,i){return dt(t,i)}var lo=null,Na=null,dd=!1,ro=!1,fd=!1,Fi=0;function ii(t){t!==Na&&t.next===null&&(Na===null?lo=Na=t:Na=Na.next=t),ro=!0,dd||(dd=!0,AS())}function Ol(t,i){if(!fd&&ro){fd=!0;do for(var a=!1,r=lo;r!==null;){if(t!==0){var f=r.pendingLanes;if(f===0)var h=0;else{var y=r.suspendedLanes,S=r.pingedLanes;h=(1<<31-Ee(42|t)+1)-1,h&=f&~(y&~S),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,mg(r,h))}else h=Ue,h=Vs(r,r===it?h:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(h&3)===0||Oi(r,h)||(a=!0,mg(r,h));r=r.next}while(a);fd=!1}}function ES(){dg()}function dg(){ro=dd=!1;var t=0;Fi!==0&&IS()&&(t=Fi);for(var i=_t(),a=null,r=lo;r!==null;){var f=r.next,h=fg(r,i);h===0?(r.next=null,a===null?lo=f:a.next=f,f===null&&(Na=a)):(a=r,(t!==0||(h&3)!==0)&&(ro=!0)),r=f}Ut!==0&&Ut!==5||Ol(t),Fi!==0&&(Fi=0)}function fg(t,i){for(var a=t.suspendedLanes,r=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var y=31-Ee(h),S=1<<y,_=f[y];_===-1?((S&a)===0||(S&r)!==0)&&(f[y]=Ec(S,i)):_<=i&&(t.expiredLanes|=S),h&=~S}if(i=it,a=Ue,a=Vs(t,t===i?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,a===0||t===i&&(Je===2||Je===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&It(r),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Oi(t,a)){if(i=a&-a,i===t.callbackPriority)return i;switch(r!==null&&It(r),Xt(a)){case 2:case 8:a=Lt;break;case 32:a=Ct;break;case 268435456:a=oe;break;default:a=Ct}return r=hg.bind(null,t),a=dt(a,r),t.callbackPriority=i,t.callbackNode=a,i}return r!==null&&r!==null&&It(r),t.callbackPriority=2,t.callbackNode=null,2}function hg(t,i){if(Ut!==0&&Ut!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(ao()&&t.callbackNode!==a)return null;var r=Ue;return r=Vs(t,t===it?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(Pp(t,r,i),fg(t,_t()),t.callbackNode!=null&&t.callbackNode===a?hg.bind(null,t):null)}function mg(t,i){if(ao())return null;Pp(t,i,!0)}function AS(){ZS(function(){(Ye&6)!==0?dt(De,ES):dg()})}function hd(){if(Fi===0){var t=ca;t===0&&(t=ri,ri<<=1,(ri&261888)===0&&(ri=256)),Fi=t}return Fi}function pg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:pr(""+t)}function gg(t,i){var a=i.ownerDocument.createElement("input");return a.name=i.name,a.value=i.value,t.id&&a.setAttribute("form",t.id),i.parentNode.insertBefore(a,i),t=new FormData(t),a.parentNode.removeChild(a),t}function TS(t,i,a,r,f){if(i==="submit"&&a&&a.stateNode===f){var h=pg((f[Pt]||null).action),y=r.submitter;y&&(i=(i=y[Pt]||null)?pg(i.formAction):y.getAttribute("formAction"),i!==null&&(h=i,y=null));var S=new br("action","action",null,r,f);t.push({event:S,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Fi!==0){var _=y?gg(f,y):new FormData(f);Du(a,{pending:!0,data:_,method:f.method,action:h},null,_)}}else typeof h=="function"&&(S.preventDefault(),_=y?gg(f,y):new FormData(f),Du(a,{pending:!0,data:_,method:f.method,action:h},h,_))},currentTarget:f}]})}}for(var md=0;md<Xc.length;md++){var pd=Xc[md],OS=pd.toLowerCase(),DS=pd[0].toUpperCase()+pd.slice(1);Bn(OS,"on"+DS)}Bn(Vh,"onAnimationEnd"),Bn(Ph,"onAnimationIteration"),Bn(Qh,"onAnimationStart"),Bn("dblclick","onDoubleClick"),Bn("focusin","onFocus"),Bn("focusout","onBlur"),Bn(Qx,"onTransitionRun"),Bn(Xx,"onTransitionStart"),Bn(Jx,"onTransitionCancel"),Bn(Xh,"onTransitionEnd"),Qs("onMouseEnter",["mouseout","mouseover"]),Qs("onMouseLeave",["mouseout","mouseover"]),Qs("onPointerEnter",["pointerout","pointerover"]),Qs("onPointerLeave",["pointerout","pointerover"]),Wn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dl="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(" "),RS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Dl));function yg(t,i){i=(i&4)!==0;for(var a=0;a<t.length;a++){var r=t[a],f=r.event;r=r.listeners;e:{var h=void 0;if(i)for(var y=r.length-1;0<=y;y--){var S=r[y],_=S.instance,I=S.currentTarget;if(S=S.listener,_!==h&&f.isPropagationStopped())break e;h=S,f.currentTarget=I;try{h(f)}catch(P){wr(P)}f.currentTarget=null,h=_}else for(y=0;y<r.length;y++){if(S=r[y],_=S.instance,I=S.currentTarget,S=S.listener,_!==h&&f.isPropagationStopped())break e;h=S,f.currentTarget=I;try{h(f)}catch(P){wr(P)}f.currentTarget=null,h=_}}}}function Me(t,i){var a=i[ci];a===void 0&&(a=i[ci]=new Set);var r=t+"__bubble";a.has(r)||(vg(i,t,2,!1),a.add(r))}function gd(t,i,a){var r=0;i&&(r|=4),vg(a,t,r,i)}var oo="_reactListening"+Math.random().toString(36).slice(2);function yd(t){if(!t[oo]){t[oo]=!0,$n.forEach(function(a){a!=="selectionchange"&&(RS.has(a)||gd(a,!1,t),gd(a,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[oo]||(i[oo]=!0,gd("selectionchange",!1,i))}}function vg(t,i,a,r){switch(Vg(i)){case 2:var f=ow;break;case 8:f=cw;break;default:f=Od}a=f.bind(null,i,a,t),f=void 0,!Uc||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),r?f!==void 0?t.addEventListener(i,a,{capture:!0,passive:f}):t.addEventListener(i,a,!0):f!==void 0?t.addEventListener(i,a,{passive:f}):t.addEventListener(i,a,!1)}function vd(t,i,a,r,f){var h=r;if((i&1)===0&&(i&2)===0&&r!==null)e:for(;;){if(r===null)return;var y=r.tag;if(y===3||y===4){var S=r.stateNode.containerInfo;if(S===f)break;if(y===4)for(y=r.return;y!==null;){var _=y.tag;if((_===3||_===4)&&y.stateNode.containerInfo===f)return;y=y.return}for(;S!==null;){if(y=Ri(S),y===null)return;if(_=y.tag,_===5||_===6||_===26||_===27){r=h=y;continue e}S=S.parentNode}}r=r.return}jh(function(){var I=h,P=Mc(a),W=[];e:{var Z=Jh.get(t);if(Z!==void 0){var Y=br,pe=t;switch(t){case"keypress":if(yr(a)===0)break e;case"keydown":case"keyup":Y=_x;break;case"focusin":pe="focus",Y=qc;break;case"focusout":pe="blur",Y=qc;break;case"beforeblur":case"afterblur":Y=qc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=zh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=px;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Ax;break;case Vh:case Ph:case Qh:Y=vx;break;case Xh:Y=Ox;break;case"scroll":case"scrollend":Y=hx;break;case"wheel":Y=Rx;break;case"copy":case"cut":case"paste":Y=xx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Ch;break;case"toggle":case"beforetoggle":Y=Lx}var je=(i&4)!==0,nt=!je&&(t==="scroll"||t==="scrollend"),U=je?Z!==null?Z+"Capture":null:Z;je=[];for(var T=I,B;T!==null;){var X=T;if(B=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||B===null||U===null||(X=tl(T,U),X!=null&&je.push(Rl(T,X,B))),nt)break;T=T.return}0<je.length&&(Z=new Y(Z,pe,null,a,P),W.push({event:Z,listeners:je}))}}if((i&7)===0){e:{if(Z=t==="mouseover"||t==="pointerover",Y=t==="mouseout"||t==="pointerout",Z&&a!==Rc&&(pe=a.relatedTarget||a.fromElement)&&(Ri(pe)||pe[fn]))break e;if((Y||Z)&&(Z=P.window===P?P:(Z=P.ownerDocument)?Z.defaultView||Z.parentWindow:window,Y?(pe=a.relatedTarget||a.toElement,Y=I,pe=pe?Ri(pe):null,pe!==null&&(nt=u(pe),je=pe.tag,pe!==nt||je!==5&&je!==27&&je!==6)&&(pe=null)):(Y=null,pe=I),Y!==pe)){if(je=zh,X="onMouseLeave",U="onMouseEnter",T="mouse",(t==="pointerout"||t==="pointerover")&&(je=Ch,X="onPointerLeave",U="onPointerEnter",T="pointer"),nt=Y==null?Z:Te(Y),B=pe==null?Z:Te(pe),Z=new je(X,T+"leave",Y,a,P),Z.target=nt,Z.relatedTarget=B,X=null,Ri(P)===I&&(je=new je(U,T+"enter",pe,a,P),je.target=B,je.relatedTarget=nt,X=je),nt=X,Y&&pe)t:{for(je=MS,U=Y,T=pe,B=0,X=U;X;X=je(X))B++;X=0;for(var xe=T;xe;xe=je(xe))X++;for(;0<B-X;)U=je(U),B--;for(;0<X-B;)T=je(T),X--;for(;B--;){if(U===T||T!==null&&U===T.alternate){je=U;break t}U=je(U),T=je(T)}je=null}else je=null;Y!==null&&bg(W,Z,Y,je,!1),pe!==null&&nt!==null&&bg(W,nt,pe,je,!0)}}e:{if(Z=I?Te(I):window,Y=Z.nodeName&&Z.nodeName.toLowerCase(),Y==="select"||Y==="input"&&Z.type==="file")var Ge=Lh;else if(Rh(Z))if(Uh)Ge=Yx;else{Ge=Gx;var ve=Hx}else Y=Z.nodeName,!Y||Y.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?I&&Dc(I.elementType)&&(Ge=Lh):Ge=Kx;if(Ge&&(Ge=Ge(t,I))){Mh(W,Ge,a,P);break e}ve&&ve(t,Z,I),t==="focusout"&&I&&Z.type==="number"&&I.memoizedProps.value!=null&&Oc(Z,"number",Z.value)}switch(ve=I?Te(I):window,t){case"focusin":(Rh(ve)||ve.contentEditable==="true")&&(ta=ve,Vc=I,cl=null);break;case"focusout":cl=Vc=ta=null;break;case"mousedown":Pc=!0;break;case"contextmenu":case"mouseup":case"dragend":Pc=!1,Kh(W,a,P);break;case"selectionchange":if(Px)break;case"keydown":case"keyup":Kh(W,a,P)}var Ce;if(Hc)e:{switch(t){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else ea?Oh(t,a)&&($e="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&($e="onCompositionStart");$e&&(Eh&&a.locale!=="ko"&&(ea||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&ea&&(Ce=Nh()):(Li=P,$c="value"in Li?Li.value:Li.textContent,ea=!0)),ve=co(I,$e),0<ve.length&&($e=new _h($e,t,null,a,P),W.push({event:$e,listeners:ve}),Ce?$e.data=Ce:(Ce=Dh(a),Ce!==null&&($e.data=Ce)))),(Ce=$x?Bx(t,a):Ix(t,a))&&($e=co(I,"onBeforeInput"),0<$e.length&&(ve=new _h("onBeforeInput","beforeinput",null,a,P),W.push({event:ve,listeners:$e}),ve.data=Ce)),TS(W,t,I,a,P)}yg(W,i)})}function Rl(t,i,a){return{instance:t,listener:i,currentTarget:a}}function co(t,i){for(var a=i+"Capture",r=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=tl(t,a),f!=null&&r.unshift(Rl(t,f,h)),f=tl(t,i),f!=null&&r.push(Rl(t,f,h))),t.tag===3)return r;t=t.return}return[]}function MS(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function bg(t,i,a,r,f){for(var h=i._reactName,y=[];a!==null&&a!==r;){var S=a,_=S.alternate,I=S.stateNode;if(S=S.tag,_!==null&&_===r)break;S!==5&&S!==26&&S!==27||I===null||(_=I,f?(I=tl(a,h),I!=null&&y.unshift(Rl(a,I,_))):f||(I=tl(a,h),I!=null&&y.push(Rl(a,I,_)))),a=a.return}y.length!==0&&t.push({event:i,listeners:y})}var LS=/\r\n?/g,US=/\u0000|\uFFFD/g;function xg(t){return(typeof t=="string"?t:""+t).replace(LS,`
9
+ `).replace(US,"")}function Sg(t,i){return i=xg(i),xg(t)===i}function tt(t,i,a,r,f,h){switch(a){case"children":typeof r=="string"?i==="body"||i==="textarea"&&r===""||Js(t,r):(typeof r=="number"||typeof r=="bigint")&&i!=="body"&&Js(t,""+r);break;case"className":hr(t,"class",r);break;case"tabIndex":hr(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":hr(t,a,r);break;case"style":Sh(t,r,h);break;case"data":if(i!=="object"){hr(t,"data",r);break}case"src":case"href":if(r===""&&(i!=="a"||a!=="href")){t.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=pr(""+r),t.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){t.setAttribute(a,"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 h=="function"&&(a==="formAction"?(i!=="input"&&tt(t,i,"name",f.name,f,null),tt(t,i,"formEncType",f.formEncType,f,null),tt(t,i,"formMethod",f.formMethod,f,null),tt(t,i,"formTarget",f.formTarget,f,null)):(tt(t,i,"encType",f.encType,f,null),tt(t,i,"method",f.method,f,null),tt(t,i,"target",f.target,f,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(a);break}r=pr(""+r),t.setAttribute(a,r);break;case"onClick":r!=null&&(t.onclick=di);break;case"onScroll":r!=null&&Me("scroll",t);break;case"onScrollEnd":r!=null&&Me("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(a=r.__html,a!=null){if(f.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"multiple":t.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":t.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){t.removeAttribute("xlink:href");break}a=pr(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,""+r):t.removeAttribute(a);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":r&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":r===!0?t.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(a,r):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(a,r):t.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(a):t.setAttribute(a,r);break;case"popover":Me("beforetoggle",t),Me("toggle",t),fr(t,"popover",r);break;case"xlinkActuate":ui(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":ui(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":ui(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":ui(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":ui(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":ui(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":ui(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":ui(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":ui(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":fr(t,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=dx.get(a)||a,fr(t,a,r))}}function bd(t,i,a,r,f,h){switch(a){case"style":Sh(t,r,h);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(a=r.__html,a!=null){if(f.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"children":typeof r=="string"?Js(t,r):(typeof r=="number"||typeof r=="bigint")&&Js(t,""+r);break;case"onScroll":r!=null&&Me("scroll",t);break;case"onScrollEnd":r!=null&&Me("scrollend",t);break;case"onClick":r!=null&&(t.onclick=di);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xs.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),i=a.slice(2,f?a.length-7:void 0),h=t[Pt]||null,h=h!=null?h[a]:null,typeof h=="function"&&t.removeEventListener(i,h,f),typeof r=="function")){typeof h!="function"&&h!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(i,r,f);break e}a in t?t[a]=r:r===!0?t.setAttribute(a,""):fr(t,a,r)}}}function Gt(t,i,a){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",t),Me("load",t);var r=!1,f=!1,h;for(h in a)if(a.hasOwnProperty(h)){var y=a[h];if(y!=null)switch(h){case"src":r=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,i));default:tt(t,i,h,y,a,null)}}f&&tt(t,i,"srcSet",a.srcSet,a,null),r&&tt(t,i,"src",a.src,a,null);return;case"input":Me("invalid",t);var S=h=y=f=null,_=null,I=null;for(r in a)if(a.hasOwnProperty(r)){var P=a[r];if(P!=null)switch(r){case"name":f=P;break;case"type":y=P;break;case"checked":_=P;break;case"defaultChecked":I=P;break;case"value":h=P;break;case"defaultValue":S=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(l(137,i));break;default:tt(t,i,r,P,a,null)}}yh(t,h,S,_,I,y,f,!1);return;case"select":Me("invalid",t),r=y=h=null;for(f in a)if(a.hasOwnProperty(f)&&(S=a[f],S!=null))switch(f){case"value":h=S;break;case"defaultValue":y=S;break;case"multiple":r=S;default:tt(t,i,f,S,a,null)}i=h,a=y,t.multiple=!!r,i!=null?Xs(t,!!r,i,!1):a!=null&&Xs(t,!!r,a,!0);return;case"textarea":Me("invalid",t),h=f=r=null;for(y in a)if(a.hasOwnProperty(y)&&(S=a[y],S!=null))switch(y){case"value":r=S;break;case"defaultValue":f=S;break;case"children":h=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(l(91));break;default:tt(t,i,y,S,a,null)}bh(t,r,f,h);return;case"option":for(_ in a)a.hasOwnProperty(_)&&(r=a[_],r!=null)&&(_==="selected"?t.selected=r&&typeof r!="function"&&typeof r!="symbol":tt(t,i,_,r,a,null));return;case"dialog":Me("beforetoggle",t),Me("toggle",t),Me("cancel",t),Me("close",t);break;case"iframe":case"object":Me("load",t);break;case"video":case"audio":for(r=0;r<Dl.length;r++)Me(Dl[r],t);break;case"image":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"embed":case"source":case"link":Me("error",t),Me("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(I in a)if(a.hasOwnProperty(I)&&(r=a[I],r!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,i));default:tt(t,i,I,r,a,null)}return;default:if(Dc(i)){for(P in a)a.hasOwnProperty(P)&&(r=a[P],r!==void 0&&bd(t,i,P,r,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(r=a[S],r!=null&&tt(t,i,S,r,a,null))}function $S(t,i,a,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,y=null,S=null,_=null,I=null,P=null;for(Y in a){var W=a[Y];if(a.hasOwnProperty(Y)&&W!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":_=W;default:r.hasOwnProperty(Y)||tt(t,i,Y,null,r,W)}}for(var Z in r){var Y=r[Z];if(W=a[Z],r.hasOwnProperty(Z)&&(Y!=null||W!=null))switch(Z){case"type":h=Y;break;case"name":f=Y;break;case"checked":I=Y;break;case"defaultChecked":P=Y;break;case"value":y=Y;break;case"defaultValue":S=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(l(137,i));break;default:Y!==W&&tt(t,i,Z,Y,r,W)}}Tc(t,y,S,_,I,P,h,f);return;case"select":Y=y=S=Z=null;for(h in a)if(_=a[h],a.hasOwnProperty(h)&&_!=null)switch(h){case"value":break;case"multiple":Y=_;default:r.hasOwnProperty(h)||tt(t,i,h,null,r,_)}for(f in r)if(h=r[f],_=a[f],r.hasOwnProperty(f)&&(h!=null||_!=null))switch(f){case"value":Z=h;break;case"defaultValue":S=h;break;case"multiple":y=h;default:h!==_&&tt(t,i,f,h,r,_)}i=S,a=y,r=Y,Z!=null?Xs(t,!!a,Z,!1):!!r!=!!a&&(i!=null?Xs(t,!!a,i,!0):Xs(t,!!a,a?[]:"",!1));return;case"textarea":Y=Z=null;for(S in a)if(f=a[S],a.hasOwnProperty(S)&&f!=null&&!r.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:tt(t,i,S,null,r,f)}for(y in r)if(f=r[y],h=a[y],r.hasOwnProperty(y)&&(f!=null||h!=null))switch(y){case"value":Z=f;break;case"defaultValue":Y=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(l(91));break;default:f!==h&&tt(t,i,y,f,r,h)}vh(t,Z,Y);return;case"option":for(var pe in a)Z=a[pe],a.hasOwnProperty(pe)&&Z!=null&&!r.hasOwnProperty(pe)&&(pe==="selected"?t.selected=!1:tt(t,i,pe,null,r,Z));for(_ in r)Z=r[_],Y=a[_],r.hasOwnProperty(_)&&Z!==Y&&(Z!=null||Y!=null)&&(_==="selected"?t.selected=Z&&typeof Z!="function"&&typeof Z!="symbol":tt(t,i,_,Z,r,Y));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var je in a)Z=a[je],a.hasOwnProperty(je)&&Z!=null&&!r.hasOwnProperty(je)&&tt(t,i,je,null,r,Z);for(I in r)if(Z=r[I],Y=a[I],r.hasOwnProperty(I)&&Z!==Y&&(Z!=null||Y!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(l(137,i));break;default:tt(t,i,I,Z,r,Y)}return;default:if(Dc(i)){for(var nt in a)Z=a[nt],a.hasOwnProperty(nt)&&Z!==void 0&&!r.hasOwnProperty(nt)&&bd(t,i,nt,void 0,r,Z);for(P in r)Z=r[P],Y=a[P],!r.hasOwnProperty(P)||Z===Y||Z===void 0&&Y===void 0||bd(t,i,P,Z,r,Y);return}}for(var U in a)Z=a[U],a.hasOwnProperty(U)&&Z!=null&&!r.hasOwnProperty(U)&&tt(t,i,U,null,r,Z);for(W in r)Z=r[W],Y=a[W],!r.hasOwnProperty(W)||Z===Y||Z==null&&Y==null||tt(t,i,W,Z,r,Y)}function wg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function BS(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var f=a[r],h=f.transferSize,y=f.initiatorType,S=f.duration;if(h&&S&&wg(y)){for(y=0,S=f.responseEnd,r+=1;r<a.length;r++){var _=a[r],I=_.startTime;if(I>S)break;var P=_.transferSize,W=_.initiatorType;P&&wg(W)&&(_=_.responseEnd,y+=P*(_<S?1:(S-I)/(_-I)))}if(--r,i+=8*(h+y)/(f.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var xd=null,Sd=null;function uo(t){return t.nodeType===9?t:t.ownerDocument}function jg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ng(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function wd(t,i){return t==="textarea"||t==="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 jd=null;function IS(){var t=window.event;return t&&t.type==="popstate"?t===jd?!1:(jd=t,!0):(jd=null,!1)}var kg=typeof setTimeout=="function"?setTimeout:void 0,qS=typeof clearTimeout=="function"?clearTimeout:void 0,zg=typeof Promise=="function"?Promise:void 0,ZS=typeof queueMicrotask=="function"?queueMicrotask:typeof zg<"u"?function(t){return zg.resolve(null).then(t).catch(HS)}:kg;function HS(t){setTimeout(function(){throw t})}function Wi(t){return t==="head"}function _g(t,i){var a=i,r=0;do{var f=a.nextSibling;if(t.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(r===0){t.removeChild(f),Ca(i);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")Ml(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Ml(a);for(var h=a.firstChild;h;){var y=h.nextSibling,S=h.nodeName;h[Fn]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=y}}else a==="body"&&Ml(t.ownerDocument.body);a=f}while(a);Ca(i)}function Cg(t,i){var a=t;t=0;do{var r=a.nextSibling;if(a.nodeType===1?i?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(i?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=r}while(a)}function Nd(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var a=i;switch(i=i.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Nd(a),Di(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function GS(t,i,a,r){for(;t.nodeType===1;){var f=a;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!r&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(r){if(!t[Fn])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=An(t.nextSibling),t===null)break}return null}function KS(t,i,a){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=An(t.nextSibling),t===null))return null;return t}function Eg(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=An(t.nextSibling),t===null))return null;return t}function kd(t){return t.data==="$?"||t.data==="$~"}function zd(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function YS(t,i){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||a.readyState!=="loading")i();else{var r=function(){i(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),t._reactRetry=r}}function An(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var _d=null;function Ag(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(i===0)return An(t.nextSibling);i--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||i++}t=t.nextSibling}return null}function Tg(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(i===0)return t;i--}else a!=="/$"&&a!=="/&"||i++}t=t.previousSibling}return null}function Og(t,i,a){switch(i=uo(a),t){case"html":if(t=i.documentElement,!t)throw Error(l(452));return t;case"head":if(t=i.head,!t)throw Error(l(453));return t;case"body":if(t=i.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Ml(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Di(t)}var Tn=new Map,Dg=new Set;function fo(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var _i=K.d;K.d={f:VS,r:PS,D:QS,C:XS,L:JS,m:FS,X:ew,S:WS,M:tw};function VS(){var t=_i.f(),i=no();return t||i}function PS(t){var i=Mi(t);i!==null&&i.tag===5&&i.type==="form"?Xm(i):_i.r(t)}var ka=typeof document>"u"?null:document;function Rg(t,i,a){var r=ka;if(r&&typeof i=="string"&&i){var f=jn(i);f='link[rel="'+t+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),Dg.has(f)||(Dg.add(f),t={rel:t,crossOrigin:a,href:i},r.querySelector(f)===null&&(i=r.createElement("link"),Gt(i,"link",t),Pe(i),r.head.appendChild(i)))}}function QS(t){_i.D(t),Rg("dns-prefetch",t,null)}function XS(t,i){_i.C(t,i),Rg("preconnect",t,i)}function JS(t,i,a){_i.L(t,i,a);var r=ka;if(r&&t&&i){var f='link[rel="preload"][as="'+jn(i)+'"]';i==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+jn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+jn(a.imageSizes)+'"]')):f+='[href="'+jn(t)+'"]';var h=f;switch(i){case"style":h=za(t);break;case"script":h=_a(t)}Tn.has(h)||(t=v({rel:"preload",href:i==="image"&&a&&a.imageSrcSet?void 0:t,as:i},a),Tn.set(h,t),r.querySelector(f)!==null||i==="style"&&r.querySelector(Ll(h))||i==="script"&&r.querySelector(Ul(h))||(i=r.createElement("link"),Gt(i,"link",t),Pe(i),r.head.appendChild(i)))}}function FS(t,i){_i.m(t,i);var a=ka;if(a&&t){var r=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+jn(r)+'"][href="'+jn(t)+'"]',h=f;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=_a(t)}if(!Tn.has(h)&&(t=v({rel:"modulepreload",href:t},i),Tn.set(h,t),a.querySelector(f)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ul(h)))return}r=a.createElement("link"),Gt(r,"link",t),Pe(r),a.head.appendChild(r)}}}function WS(t,i,a){_i.S(t,i,a);var r=ka;if(r&&t){var f=He(r).hoistableStyles,h=za(t);i=i||"default";var y=f.get(h);if(!y){var S={loading:0,preload:null};if(y=r.querySelector(Ll(h)))S.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":i},a),(a=Tn.get(h))&&Cd(t,a);var _=y=r.createElement("link");Pe(_),Gt(_,"link",t),_._p=new Promise(function(I,P){_.onload=I,_.onerror=P}),_.addEventListener("load",function(){S.loading|=1}),_.addEventListener("error",function(){S.loading|=2}),S.loading|=4,ho(y,i,r)}y={type:"stylesheet",instance:y,count:1,state:S},f.set(h,y)}}}function ew(t,i){_i.X(t,i);var a=ka;if(a&&t){var r=He(a).hoistableScripts,f=_a(t),h=r.get(f);h||(h=a.querySelector(Ul(f)),h||(t=v({src:t,async:!0},i),(i=Tn.get(f))&&Ed(t,i),h=a.createElement("script"),Pe(h),Gt(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},r.set(f,h))}}function tw(t,i){_i.M(t,i);var a=ka;if(a&&t){var r=He(a).hoistableScripts,f=_a(t),h=r.get(f);h||(h=a.querySelector(Ul(f)),h||(t=v({src:t,async:!0,type:"module"},i),(i=Tn.get(f))&&Ed(t,i),h=a.createElement("script"),Pe(h),Gt(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},r.set(f,h))}}function Mg(t,i,a,r){var f=(f=me.current)?fo(f):null;if(!f)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(i=za(a.href),a=He(f).hoistableStyles,r=a.get(i),r||(r={type:"style",instance:null,count:0,state:null},a.set(i,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=za(a.href);var h=He(f).hoistableStyles,y=h.get(t);if(y||(f=f.ownerDocument||f,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,y),(h=f.querySelector(Ll(t)))&&!h._p&&(y.instance=h,y.state.loading=5),Tn.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Tn.set(t,a),h||nw(f,t,a,y.state))),i&&r===null)throw Error(l(528,""));return y}if(i&&r!==null)throw Error(l(529,""));return null;case"script":return i=a.async,a=a.src,typeof a=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=_a(a),a=He(f).hoistableScripts,r=a.get(i),r||(r={type:"script",instance:null,count:0,state:null},a.set(i,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function za(t){return'href="'+jn(t)+'"'}function Ll(t){return'link[rel="stylesheet"]['+t+"]"}function Lg(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function nw(t,i,a,r){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?r.loading=1:(i=t.createElement("link"),r.preload=i,i.addEventListener("load",function(){return r.loading|=1}),i.addEventListener("error",function(){return r.loading|=2}),Gt(i,"link",a),Pe(i),t.head.appendChild(i))}function _a(t){return'[src="'+jn(t)+'"]'}function Ul(t){return"script[async]"+t}function Ug(t,i,a){if(i.count++,i.instance===null)switch(i.type){case"style":var r=t.querySelector('style[data-href~="'+jn(a.href)+'"]');if(r)return i.instance=r,Pe(r),r;var f=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),Pe(r),Gt(r,"style",f),ho(r,a.precedence,t),i.instance=r;case"stylesheet":f=za(a.href);var h=t.querySelector(Ll(f));if(h)return i.state.loading|=4,i.instance=h,Pe(h),h;r=Lg(a),(f=Tn.get(f))&&Cd(r,f),h=(t.ownerDocument||t).createElement("link"),Pe(h);var y=h;return y._p=new Promise(function(S,_){y.onload=S,y.onerror=_}),Gt(h,"link",r),i.state.loading|=4,ho(h,a.precedence,t),i.instance=h;case"script":return h=_a(a.src),(f=t.querySelector(Ul(h)))?(i.instance=f,Pe(f),f):(r=a,(f=Tn.get(h))&&(r=v({},a),Ed(r,f)),t=t.ownerDocument||t,f=t.createElement("script"),Pe(f),Gt(f,"link",r),t.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(l(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(r=i.instance,i.state.loading|=4,ho(r,a.precedence,t));return i.instance}function ho(t,i,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=r.length?r[r.length-1]:null,h=f,y=0;y<r.length;y++){var S=r[y];if(S.dataset.precedence===i)h=S;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(i=a.nodeType===9?a.head:a,i.insertBefore(t,i.firstChild))}function Cd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Ed(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var mo=null;function $g(t,i,a){if(mo===null){var r=new Map,f=mo=new Map;f.set(a,r)}else f=mo,r=f.get(a),r||(r=new Map,f.set(a,r));if(r.has(t))return r;for(r.set(t,null),a=a.getElementsByTagName(t),f=0;f<a.length;f++){var h=a[f];if(!(h[Fn]||h[Ve]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var y=h.getAttribute(i)||"";y=t+y;var S=r.get(y);S?S.push(h):r.set(y,[h])}}return r}function Bg(t,i,a){t=t.ownerDocument||t,t.head.insertBefore(a,i==="title"?t.querySelector("head > title"):null)}function iw(t,i,a){if(a===1||i.itemProp!=null)return!1;switch(t){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"?(t=i.disabled,typeof i.precedence=="string"&&t==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 Ig(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function sw(t,i,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=za(r.href),h=i.querySelector(Ll(f));if(h){i=h._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=po.bind(t),i.then(t,t)),a.state.loading|=4,a.instance=h,Pe(h);return}h=i.ownerDocument||i,r=Lg(r),(f=Tn.get(f))&&Cd(r,f),h=h.createElement("link"),Pe(h);var y=h;y._p=new Promise(function(S,_){y.onload=S,y.onerror=_}),Gt(h,"link",r),a.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,i),(i=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=po.bind(t),i.addEventListener("load",a),i.addEventListener("error",a))}}var Ad=0;function aw(t,i){return t.stylesheets&&t.count===0&&yo(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var r=setTimeout(function(){if(t.stylesheets&&yo(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+i);0<t.imgBytes&&Ad===0&&(Ad=62500*BS());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&yo(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>Ad?50:800)+i);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(f)}}:null}function po(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)yo(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var go=null;function yo(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,go=new Map,i.forEach(lw,t),go=null,po.call(t))}function lw(t,i){if(!(i.state.loading&4)){var a=go.get(t);if(a)var r=a.get(null);else{a=new Map,go.set(t,a);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var y=f[h];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(a.set(y.dataset.precedence,y),r=y)}r&&a.set(null,r)}f=i.instance,y=f.getAttribute("data-precedence"),h=a.get(y)||r,h===r&&a.set(null,f),a.set(y,f),this.count++,r=po.bind(this),f.addEventListener("load",r),f.addEventListener("error",r),h?h.parentNode.insertBefore(f,h.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),i.state.loading|=4}}var $l={$$typeof:O,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function rw(t,i,a,r,f,h,y,S,_){this.tag=1,this.containerInfo=t,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=el(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=el(0),this.hiddenUpdates=el(null),this.identifierPrefix=r,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function qg(t,i,a,r,f,h,y,S,_,I,P,W){return t=new rw(t,i,a,y,_,I,P,W,S),i=1,h===!0&&(i|=24),h=mn(3,null,null,i),t.current=h,h.stateNode=t,i=cu(),i.refCount++,t.pooledCache=i,i.refCount++,h.memoizedState={element:r,isDehydrated:a,cache:i},hu(h),t}function Zg(t){return t?(t=sa,t):sa}function Hg(t,i,a,r,f,h){f=Zg(f),r.context===null?r.context=f:r.pendingContext=f,r=Zi(i),r.payload={element:a},h=h===void 0?null:h,h!==null&&(r.callback=h),a=Hi(t,r,i),a!==null&&(on(a,t,i),gl(a,t,i))}function Gg(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<i?a:i}}function Td(t,i){Gg(t,i),(t=t.alternate)&&Gg(t,i)}function Kg(t){if(t.tag===13||t.tag===31){var i=Ns(t,67108864);i!==null&&on(i,t,67108864),Td(t,67108864)}}function Yg(t){if(t.tag===13||t.tag===31){var i=bn();i=vt(i);var a=Ns(t,i);a!==null&&on(a,t,i),Td(t,i)}}var vo=!0;function ow(t,i,a,r){var f=q.T;q.T=null;var h=K.p;try{K.p=2,Od(t,i,a,r)}finally{K.p=h,q.T=f}}function cw(t,i,a,r){var f=q.T;q.T=null;var h=K.p;try{K.p=8,Od(t,i,a,r)}finally{K.p=h,q.T=f}}function Od(t,i,a,r){if(vo){var f=Dd(r);if(f===null)vd(t,i,r,bo,a),Pg(t,r);else if(dw(f,t,i,a,r))r.stopPropagation();else if(Pg(t,r),i&4&&-1<uw.indexOf(t)){for(;f!==null;){var h=Mi(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var y=Xn(h.pendingLanes);if(y!==0){var S=h;for(S.pendingLanes|=2,S.entangledLanes|=2;y;){var _=1<<31-Ee(y);S.entanglements[1]|=_,y&=~_}ii(h),(Ye&6)===0&&(eo=_t()+500,Ol(0))}}break;case 31:case 13:S=Ns(h,2),S!==null&&on(S,h,2),no(),Td(h,2)}if(h=Dd(r),h===null&&vd(t,i,r,bo,a),h===f)break;f=h}f!==null&&r.stopPropagation()}else vd(t,i,r,null,a)}}function Dd(t){return t=Mc(t),Rd(t)}var bo=null;function Rd(t){if(bo=null,t=Ri(t),t!==null){var i=u(t);if(i===null)t=null;else{var a=i.tag;if(a===13){if(t=d(i),t!==null)return t;t=null}else if(a===31){if(t=m(i),t!==null)return t;t=null}else if(a===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return bo=t,null}function Vg(t){switch(t){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(re()){case De:return 2;case Lt:return 8;case Ct:case tn:return 32;case oe:return 268435456;default:return 32}default:return 32}}var Md=!1,es=null,ts=null,ns=null,Bl=new Map,Il=new Map,is=[],uw="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 Pg(t,i){switch(t){case"focusin":case"focusout":es=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":ns=null;break;case"pointerover":case"pointerout":Bl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Il.delete(i.pointerId)}}function ql(t,i,a,r,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:i,domEventName:a,eventSystemFlags:r,nativeEvent:h,targetContainers:[f]},i!==null&&(i=Mi(i),i!==null&&Kg(i)),t):(t.eventSystemFlags|=r,i=t.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),t)}function dw(t,i,a,r,f){switch(i){case"focusin":return es=ql(es,t,i,a,r,f),!0;case"dragenter":return ts=ql(ts,t,i,a,r,f),!0;case"mouseover":return ns=ql(ns,t,i,a,r,f),!0;case"pointerover":var h=f.pointerId;return Bl.set(h,ql(Bl.get(h)||null,t,i,a,r,f)),!0;case"gotpointercapture":return h=f.pointerId,Il.set(h,ql(Il.get(h)||null,t,i,a,r,f)),!0}return!1}function Qg(t){var i=Ri(t.target);if(i!==null){var a=u(i);if(a!==null){if(i=a.tag,i===13){if(i=d(a),i!==null){t.blockedOn=i,bs(t.priority,function(){Yg(a)});return}}else if(i===31){if(i=m(a),i!==null){t.blockedOn=i,bs(t.priority,function(){Yg(a)});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function xo(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var a=Dd(t.nativeEvent);if(a===null){a=t.nativeEvent;var r=new a.constructor(a.type,a);Rc=r,a.target.dispatchEvent(r),Rc=null}else return i=Mi(a),i!==null&&Kg(i),t.blockedOn=a,!1;i.shift()}return!0}function Xg(t,i,a){xo(t)&&a.delete(i)}function fw(){Md=!1,es!==null&&xo(es)&&(es=null),ts!==null&&xo(ts)&&(ts=null),ns!==null&&xo(ns)&&(ns=null),Bl.forEach(Xg),Il.forEach(Xg)}function So(t,i){t.blockedOn===i&&(t.blockedOn=null,Md||(Md=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fw)))}var wo=null;function Jg(t){wo!==t&&(wo=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wo===t&&(wo=null);for(var i=0;i<t.length;i+=3){var a=t[i],r=t[i+1],f=t[i+2];if(typeof r!="function"){if(Rd(r||a)===null)continue;break}var h=Mi(a);h!==null&&(t.splice(i,3),i-=3,Du(h,{pending:!0,data:f,method:a.method,action:r},r,f))}}))}function Ca(t){function i(_){return So(_,t)}es!==null&&So(es,t),ts!==null&&So(ts,t),ns!==null&&So(ns,t),Bl.forEach(i),Il.forEach(i);for(var a=0;a<is.length;a++){var r=is[a];r.blockedOn===t&&(r.blockedOn=null)}for(;0<is.length&&(a=is[0],a.blockedOn===null);)Qg(a),a.blockedOn===null&&is.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var f=a[r],h=a[r+1],y=f[Pt]||null;if(typeof h=="function")y||Jg(a);else if(y){var S=null;if(h&&h.hasAttribute("formAction")){if(f=h,y=h[Pt]||null)S=y.formAction;else if(Rd(f)!==null)continue}else S=y.action;typeof S=="function"?a[r+1]=S:(a.splice(r,3),r-=3),Jg(a)}}}function Fg(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(y){return f=y})},focusReset:"manual",scroll:"manual"})}function i(){f!==null&&(f(),f=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function Ld(t){this._internalRoot=t}jo.prototype.render=Ld.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(l(409));var a=i.current,r=bn();Hg(a,r,t,i,null,null)},jo.prototype.unmount=Ld.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;Hg(t.current,2,null,t,null,null),no(),i[fn]=null}};function jo(t){this._internalRoot=t}jo.prototype.unstable_scheduleHydration=function(t){if(t){var i=Jn();t={blockedOn:null,target:t,priority:i};for(var a=0;a<is.length&&i!==0&&i<is[a].priority;a++);is.splice(a,0,t),a===0&&Qg(t)}};var Wg=n.version;if(Wg!=="19.2.4")throw Error(l(527,Wg,"19.2.4"));K.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=p(i),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var hw={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var No=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!No.isDisabled&&No.supportsFiber)try{Xe=No.inject(hw),Vt=No}catch{}}return Hl.createRoot=function(t,i){if(!o(t))throw Error(l(299));var a=!1,r="",f=lp,h=rp,y=op;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(h=i.onCaughtError),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),i=qg(t,1,!1,null,null,a,r,null,f,h,y,Fg),t[fn]=i.current,yd(t),new Ld(i)},Hl.hydrateRoot=function(t,i,a){if(!o(t))throw Error(l(299));var r=!1,f="",h=lp,y=rp,S=op,_=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError),a.formState!==void 0&&(_=a.formState)),i=qg(t,1,!0,i,a??null,r,f,_,h,y,S,Fg),i.context=Zg(null),a=i.current,r=bn(),r=vt(r),f=Zi(r),f.callback=null,Hi(a,f,r),a=r,i.current.lanes=a,vs(i,a),ii(i),t[fn]=i.current,yd(t),new jo(i)},Hl.version="19.2.4",Hl}var cy;function Nw(){if(cy)return Bd.exports;cy=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(n){console.error(n)}}return e(),Bd.exports=jw(),Bd.exports}var kw=Nw();const Cf=Symbol.for("yaml.alias"),cf=Symbol.for("yaml.document"),us=Symbol.for("yaml.map"),w0=Symbol.for("yaml.pair"),ai=Symbol.for("yaml.scalar"),Pa=Symbol.for("yaml.seq"),Rn=Symbol.for("yaml.node.type"),Hs=e=>!!e&&typeof e=="object"&&e[Rn]===Cf,rc=e=>!!e&&typeof e=="object"&&e[Rn]===cf,nr=e=>!!e&&typeof e=="object"&&e[Rn]===us,kt=e=>!!e&&typeof e=="object"&&e[Rn]===w0,st=e=>!!e&&typeof e=="object"&&e[Rn]===ai,ir=e=>!!e&&typeof e=="object"&&e[Rn]===Pa;function jt(e){if(e&&typeof e=="object")switch(e[Rn]){case us:case Pa:return!0}return!1}function Nt(e){if(e&&typeof e=="object")switch(e[Rn]){case Cf:case us:case ai:case Pa:return!0}return!1}const j0=e=>(st(e)||jt(e))&&!!e.anchor,$s=Symbol("break visit"),zw=Symbol("skip children"),Pl=Symbol("remove node");function Qa(e,n){const s=_w(n);rc(e)?Ra(null,e.contents,s,Object.freeze([e]))===Pl&&(e.contents=null):Ra(null,e,s,Object.freeze([]))}Qa.BREAK=$s;Qa.SKIP=zw;Qa.REMOVE=Pl;function Ra(e,n,s,l){const o=Cw(e,n,s,l);if(Nt(o)||kt(o))return Ew(e,l,o),Ra(e,o,s,l);if(typeof o!="symbol"){if(jt(n)){l=Object.freeze(l.concat(n));for(let u=0;u<n.items.length;++u){const d=Ra(u,n.items[u],s,l);if(typeof d=="number")u=d-1;else{if(d===$s)return $s;d===Pl&&(n.items.splice(u,1),u-=1)}}}else if(kt(n)){l=Object.freeze(l.concat(n));const u=Ra("key",n.key,s,l);if(u===$s)return $s;u===Pl&&(n.key=null);const d=Ra("value",n.value,s,l);if(d===$s)return $s;d===Pl&&(n.value=null)}}return o}function _w(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 Cw(e,n,s,l){if(typeof s=="function")return s(e,n,l);if(nr(n))return s.Map?.(e,n,l);if(ir(n))return s.Seq?.(e,n,l);if(kt(n))return s.Pair?.(e,n,l);if(st(n))return s.Scalar?.(e,n,l);if(Hs(n))return s.Alias?.(e,n,l)}function Ew(e,n,s){const l=n[n.length-1];if(jt(l))l.items[e]=s;else if(kt(l))e==="key"?l.key=s:l.value=s;else if(rc(l))l.contents=s;else{const o=Hs(l)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const Aw={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Tw=e=>e.replace(/[!,[\]{}]/g,n=>Aw[n]);class Wt{constructor(n,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Wt.defaultYaml,n),this.tags=Object.assign({},Wt.defaultTags,s)}clone(){const n=new Wt(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Wt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Wt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Wt.defaultTags);break}return n}add(n,s){this.atNextDocument&&(this.yaml={explicit:Wt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Wt.defaultTags),this.atNextDocument=!1);const l=n.trim().split(/[ \t]+/),o=l.shift();switch(o){case"%TAG":{if(l.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),l.length<2))return!1;const[u,d]=l;return this.tags[u]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,l.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[u]=l;if(u==="1.1"||u==="1.2")return this.yaml.version=u,!0;{const d=/^\d+\.\d+$/.test(u);return s(6,`Unsupported YAML version ${u}`,d),!1}}default:return s(0,`Unknown directive ${o}`,!0),!1}}tagName(n,s){if(n==="!")return"!";if(n[0]!=="!")return s(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const d=n.slice(2,-1);return d==="!"||d==="!!"?(s(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&s("Verbatim tags must end with a >"),d)}const[,l,o]=n.match(/^(.*!)([^!]*)$/s);o||s(`The ${n} tag has no suffix`);const u=this.tags[l];if(u)try{return u+decodeURIComponent(o)}catch(d){return s(String(d)),null}return l==="!"?n:(s(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[s,l]of Object.entries(this.tags))if(n.startsWith(l))return s+Tw(n.substring(l.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],l=Object.entries(this.tags);let o;if(n&&l.length>0&&Nt(n.contents)){const u={};Qa(n.contents,(d,m)=>{Nt(m)&&m.tag&&(u[m.tag]=!0)}),o=Object.keys(u)}else o=[];for(const[u,d]of l)u==="!!"&&d==="tag:yaml.org,2002:"||(!n||o.some(m=>m.startsWith(d)))&&s.push(`%TAG ${u} ${d}`);return s.join(`
10
+ `)}}Wt.defaultYaml={explicit:!1,version:"1.2"};Wt.defaultTags={"!!":"tag:yaml.org,2002:"};function N0(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 k0(e){const n=new Set;return Qa(e,{Value(s,l){l.anchor&&n.add(l.anchor)}}),n}function z0(e,n){for(let s=1;;++s){const l=`${e}${s}`;if(!n.has(l))return l}}function Ow(e,n){const s=[],l=new Map;let o=null;return{onAnchor:u=>{s.push(u),o??(o=k0(e));const d=z0(n,o);return o.add(d),d},setAnchors:()=>{for(const u of s){const d=l.get(u);if(typeof d=="object"&&d.anchor&&(st(d.node)||jt(d.node)))d.node.anchor=d.anchor;else{const m=new Error("Failed to resolve repeated object (this should not happen)");throw m.source=u,m}}},sourceObjects:l}}function Ma(e,n,s,l){if(l&&typeof l=="object")if(Array.isArray(l))for(let o=0,u=l.length;o<u;++o){const d=l[o],m=Ma(e,l,String(o),d);m===void 0?delete l[o]:m!==d&&(l[o]=m)}else if(l instanceof Map)for(const o of Array.from(l.keys())){const u=l.get(o),d=Ma(e,l,o,u);d===void 0?l.delete(o):d!==u&&l.set(o,d)}else if(l instanceof Set)for(const o of Array.from(l)){const u=Ma(e,l,o,o);u===void 0?l.delete(o):u!==o&&(l.delete(o),l.add(u))}else for(const[o,u]of Object.entries(l)){const d=Ma(e,l,o,u);d===void 0?delete l[o]:d!==u&&(l[o]=d)}return e.call(n,s,l)}function Dn(e,n,s){if(Array.isArray(e))return e.map((l,o)=>Dn(l,String(o),s));if(e&&typeof e.toJSON=="function"){if(!s||!j0(e))return e.toJSON(n,s);const l={aliasCount:0,count:1,res:void 0};s.anchors.set(e,l),s.onCreate=u=>{l.res=u,delete s.onCreate};const o=e.toJSON(n,s);return s.onCreate&&s.onCreate(o),o}return typeof e=="bigint"&&!s?.keep?Number(e):e}class Ef{constructor(n){Object.defineProperty(this,Rn,{value:n})}clone(){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:s,maxAliasCount:l,onAnchor:o,reviver:u}={}){if(!rc(n))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:n,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof l=="number"?l:100},m=Dn(this,"",d);if(typeof o=="function")for(const{count:g,res:p}of d.anchors.values())o(p,g);return typeof u=="function"?Ma(u,{"":m},"",m):m}}class Af extends Ef{constructor(n){super(Cf),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,s){let l;s?.aliasResolveCache?l=s.aliasResolveCache:(l=[],Qa(n,{Node:(u,d)=>{(Hs(d)||j0(d))&&l.push(d)}}),s&&(s.aliasResolveCache=l));let o;for(const u of l){if(u===this)break;u.anchor===this.source&&(o=u)}return o}toJSON(n,s){if(!s)return{source:this.source};const{anchors:l,doc:o,maxAliasCount:u}=s,d=this.resolve(o,s);if(!d){const g=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(g)}let m=l.get(d);if(m||(Dn(d,null,s),m=l.get(d)),m?.res===void 0){const g="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(g)}if(u>=0&&(m.count+=1,m.aliasCount===0&&(m.aliasCount=Ho(o,d,l)),m.count*m.aliasCount>u)){const g="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(g)}return m.res}toString(n,s,l){const o=`*${this.source}`;if(n){if(N0(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){const u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(u)}if(n.implicitKey)return`${o} `}return o}}function Ho(e,n,s){if(Hs(n)){const l=n.resolve(e),o=s&&l&&s.get(l);return o?o.count*o.aliasCount:0}else if(jt(n)){let l=0;for(const o of n.items){const u=Ho(e,o,s);u>l&&(l=u)}return l}else if(kt(n)){const l=Ho(e,n.key,s),o=Ho(e,n.value,s);return Math.max(l,o)}return 1}const _0=e=>!e||typeof e!="function"&&typeof e!="object";class ze extends Ef{constructor(n){super(ai),this.value=n}toJSON(n,s){return s?.keep?this.value:Dn(this.value,n,s)}toString(){return String(this.value)}}ze.BLOCK_FOLDED="BLOCK_FOLDED";ze.BLOCK_LITERAL="BLOCK_LITERAL";ze.PLAIN="PLAIN";ze.QUOTE_DOUBLE="QUOTE_DOUBLE";ze.QUOTE_SINGLE="QUOTE_SINGLE";const Dw="tag:yaml.org,2002:";function Rw(e,n,s){if(n){const l=s.filter(u=>u.tag===n),o=l.find(u=>!u.format)??l[0];if(!o)throw new Error(`Tag ${n} not found`);return o}return s.find(l=>l.identify?.(e)&&!l.format)}function Xl(e,n,s){if(rc(e)&&(e=e.contents),Nt(e))return e;if(kt(e)){const v=s.schema[us].createNode?.(s.schema,null,s);return v.items.push(e),v}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:l,onAnchor:o,onTagObj:u,schema:d,sourceObjects:m}=s;let g;if(l&&e&&typeof e=="object"){if(g=m.get(e),g)return g.anchor??(g.anchor=o(e)),new Af(g.anchor);g={anchor:null,node:null},m.set(e,g)}n?.startsWith("!!")&&(n=Dw+n.slice(2));let p=Rw(e,n,d.tags);if(!p){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const v=new ze(e);return g&&(g.node=v),v}p=e instanceof Map?d[us]:Symbol.iterator in Object(e)?d[Pa]:d[us]}u&&(u(p),delete s.onTagObj);const b=p?.createNode?p.createNode(s.schema,e,s):typeof p?.nodeClass?.from=="function"?p.nodeClass.from(s.schema,e,s):new ze(e);return n?b.tag=n:p.default||(b.tag=p.tag),g&&(g.node=b),b}function Po(e,n,s){let l=s;for(let o=n.length-1;o>=0;--o){const u=n[o];if(typeof u=="number"&&Number.isInteger(u)&&u>=0){const d=[];d[u]=l,l=d}else l=new Map([[u,l]])}return Xl(l,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Yl=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class C0 extends Ef{constructor(n,s){super(n),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(n){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(s.schema=n),s.items=s.items.map(l=>Nt(l)||kt(l)?l.clone(n):l),this.range&&(s.range=this.range.slice()),s}addIn(n,s){if(Yl(n))this.add(s);else{const[l,...o]=n,u=this.get(l,!0);if(jt(u))u.addIn(o,s);else if(u===void 0&&this.schema)this.set(l,Po(this.schema,o,s));else throw new Error(`Expected YAML collection at ${l}. Remaining path: ${o}`)}}deleteIn(n){const[s,...l]=n;if(l.length===0)return this.delete(s);const o=this.get(s,!0);if(jt(o))return o.deleteIn(l);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${l}`)}getIn(n,s){const[l,...o]=n,u=this.get(l,!0);return o.length===0?!s&&st(u)?u.value:u:jt(u)?u.getIn(o,s):void 0}hasAllNullValues(n){return this.items.every(s=>{if(!kt(s))return!1;const l=s.value;return l==null||n&&st(l)&&l.value==null&&!l.commentBefore&&!l.comment&&!l.tag})}hasIn(n){const[s,...l]=n;if(l.length===0)return this.has(s);const o=this.get(s,!0);return jt(o)?o.hasIn(l):!1}setIn(n,s){const[l,...o]=n;if(o.length===0)this.set(l,s);else{const u=this.get(l,!0);if(jt(u))u.setIn(o,s);else if(u===void 0&&this.schema)this.set(l,Po(this.schema,o,s));else throw new Error(`Expected YAML collection at ${l}. Remaining path: ${o}`)}}}const Mw=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ei(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Bs=(e,n,s)=>e.endsWith(`
11
+ `)?Ei(s,n):s.includes(`
12
+ `)?`
13
+ `+Ei(s,n):(e.endsWith(" ")?"":" ")+s,E0="flow",uf="block",Go="quoted";function oc(e,n,s="flow",{indentAtStart:l,lineWidth:o=80,minContentWidth:u=20,onFold:d,onOverflow:m}={}){if(!o||o<0)return e;o<u&&(u=0);const g=Math.max(1+u,1+o-n.length);if(e.length<=g)return e;const p=[],b={};let v=o-n.length;typeof l=="number"&&(l>o-Math.max(2,u)?p.push(0):v=o-l);let w,N,z=!1,j=-1,k=-1,A=-1;s===uf&&(j=uy(e,j,n.length),j!==-1&&(v=j+g));for(let O;O=e[j+=1];){if(s===Go&&O==="\\"){switch(k=j,e[j+1]){case"x":j+=3;break;case"u":j+=5;break;case"U":j+=9;break;default:j+=1}A=j}if(O===`
14
+ `)s===uf&&(j=uy(e,j,n.length)),v=j+n.length+g,w=void 0;else{if(O===" "&&N&&N!==" "&&N!==`
15
+ `&&N!==" "){const D=e[j+1];D&&D!==" "&&D!==`
16
+ `&&D!==" "&&(w=j)}if(j>=v)if(w)p.push(w),v=w+g,w=void 0;else if(s===Go){for(;N===" "||N===" ";)N=O,O=e[j+=1],z=!0;const D=j>A+1?j-2:k-1;if(b[D])return e;p.push(D),b[D]=!0,v=D+g,w=void 0}else z=!0}N=O}if(z&&m&&m(),p.length===0)return e;d&&d();let E=e.slice(0,p[0]);for(let O=0;O<p.length;++O){const D=p[O],L=p[O+1]||e.length;D===0?E=`
17
+ ${n}${e.slice(0,L)}`:(s===Go&&b[D]&&(E+=`${e[D]}\\`),E+=`
18
+ ${n}${e.slice(D+1,L)}`)}return E}function uy(e,n,s){let l=n,o=n+1,u=e[o];for(;u===" "||u===" ";)if(n<o+s)u=e[++n];else{do u=e[++n];while(u&&u!==`
19
+ `);l=n,o=n+1,u=e[o]}return l}const cc=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),uc=e=>/^(%|---|\.\.\.)/m.test(e);function Lw(e,n,s){if(!n||n<0)return!1;const l=n-s,o=e.length;if(o<=l)return!1;for(let u=0,d=0;u<o;++u)if(e[u]===`
20
+ `){if(u-d>l)return!0;if(d=u+1,o-d<=l)return!1}return!0}function Ql(e,n){const s=JSON.stringify(e);if(n.options.doubleQuotedAsJSON)return s;const{implicitKey:l}=n,o=n.options.doubleQuotedMinMultiLineLength,u=n.indent||(uc(e)?" ":"");let d="",m=0;for(let g=0,p=s[g];p;p=s[++g])if(p===" "&&s[g+1]==="\\"&&s[g+2]==="n"&&(d+=s.slice(m,g)+"\\ ",g+=1,m=g,p="\\"),p==="\\")switch(s[g+1]){case"u":{d+=s.slice(m,g);const b=s.substr(g+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(g,6)}g+=5,m=g+1}break;case"n":if(l||s[g+2]==='"'||s.length<o)g+=1;else{for(d+=s.slice(m,g)+`
21
+
22
+ `;s[g+2]==="\\"&&s[g+3]==="n"&&s[g+4]!=='"';)d+=`
23
+ `,g+=2;d+=u,s[g+2]===" "&&(d+="\\"),g+=1,m=g+1}break;default:g+=1}return d=m?d+s.slice(m):s,l?d:oc(d,u,Go,cc(n,!1))}function df(e,n){if(n.options.singleQuote===!1||n.implicitKey&&e.includes(`
24
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Ql(e,n);const s=n.indent||(uc(e)?" ":""),l="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
25
+ ${s}`)+"'";return n.implicitKey?l:oc(l,s,E0,cc(n,!1))}function La(e,n){const{singleQuote:s}=n.options;let l;if(s===!1)l=Ql;else{const o=e.includes('"'),u=e.includes("'");o&&!u?l=df:u&&!o?l=Ql:l=s?df:Ql}return l(e,n)}let ff;try{ff=new RegExp(`(^|(?<!
26
+ ))
27
+ +(?!
28
+ |$)`,"g")}catch{ff=/\n+(?!\n|$)/g}function Ko({comment:e,type:n,value:s},l,o,u){const{blockQuote:d,commentString:m,lineWidth:g}=l.options;if(!d||/\n[\t ]+$/.test(s))return La(s,l);const p=l.indent||(l.forceBlockIndent||uc(s)?" ":""),b=d==="literal"?!0:d==="folded"||n===ze.BLOCK_FOLDED?!1:n===ze.BLOCK_LITERAL?!0:!Lw(s,g,p.length);if(!s)return b?`|
29
+ `:`>
30
+ `;let v,w;for(w=s.length;w>0;--w){const L=s[w-1];if(L!==`
31
+ `&&L!==" "&&L!==" ")break}let N=s.substring(w);const z=N.indexOf(`
32
+ `);z===-1?v="-":s===N||z!==N.length-1?(v="+",u&&u()):v="",N&&(s=s.slice(0,-N.length),N[N.length-1]===`
33
+ `&&(N=N.slice(0,-1)),N=N.replace(ff,`$&${p}`));let j=!1,k,A=-1;for(k=0;k<s.length;++k){const L=s[k];if(L===" ")j=!0;else if(L===`
34
+ `)A=k;else break}let E=s.substring(0,A<k?A+1:k);E&&(s=s.substring(E.length),E=E.replace(/\n+/g,`$&${p}`));let D=(j?p?"2":"1":"")+v;if(e&&(D+=" "+m(e.replace(/ ?[\r\n]+/g," ")),o&&o()),!b){const L=s.replace(/\n+/g,`
35
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let H=!1;const V=cc(l,!0);d!=="folded"&&n!==ze.BLOCK_FOLDED&&(V.onOverflow=()=>{H=!0});const R=oc(`${E}${L}${N}`,p,uf,V);if(!H)return`>${D}
36
+ ${p}${R}`}return s=s.replace(/\n+/g,`$&${p}`),`|${D}
37
+ ${p}${E}${s}${N}`}function Uw(e,n,s,l){const{type:o,value:u}=e,{actualString:d,implicitKey:m,indent:g,indentStep:p,inFlow:b}=n;if(m&&u.includes(`
38
+ `)||b&&/[[\]{},]/.test(u))return La(u,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(u))return m||b||!u.includes(`
39
+ `)?La(u,n):Ko(e,n,s,l);if(!m&&!b&&o!==ze.PLAIN&&u.includes(`
40
+ `))return Ko(e,n,s,l);if(uc(u)){if(g==="")return n.forceBlockIndent=!0,Ko(e,n,s,l);if(m&&g===p)return La(u,n)}const v=u.replace(/\n+/g,`$&
41
+ ${g}`);if(d){const w=j=>j.default&&j.tag!=="tag:yaml.org,2002:str"&&j.test?.test(v),{compat:N,tags:z}=n.doc.schema;if(z.some(w)||N?.some(w))return La(u,n)}return m?v:oc(v,g,E0,cc(n,!1))}function Tf(e,n,s,l){const{implicitKey:o,inFlow:u}=n,d=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:m}=e;m!==ze.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(m=ze.QUOTE_DOUBLE);const g=b=>{switch(b){case ze.BLOCK_FOLDED:case ze.BLOCK_LITERAL:return o||u?La(d.value,n):Ko(d,n,s,l);case ze.QUOTE_DOUBLE:return Ql(d.value,n);case ze.QUOTE_SINGLE:return df(d.value,n);case ze.PLAIN:return Uw(d,n,s,l);default:return null}};let p=g(m);if(p===null){const{defaultKeyType:b,defaultStringType:v}=n.options,w=o&&b||v;if(p=g(w),p===null)throw new Error(`Unsupported default string type ${w}`)}return p}function A0(e,n){const s=Object.assign({blockQuote:!0,commentString:Mw,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,n);let l;switch(s.collectionStyle){case"block":l=!1;break;case"flow":l=!0;break;default:l=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:l,options:s}}function $w(e,n){if(n.tag){const o=e.filter(u=>u.tag===n.tag);if(o.length>0)return o.find(u=>u.format===n.format)??o[0]}let s,l;if(st(n)){l=n.value;let o=e.filter(u=>u.identify?.(l));if(o.length>1){const u=o.filter(d=>d.test);u.length>0&&(o=u)}s=o.find(u=>u.format===n.format)??o.find(u=>!u.format)}else l=n,s=e.find(o=>o.nodeClass&&l instanceof o.nodeClass);if(!s){const o=l?.constructor?.name??(l===null?"null":typeof l);throw new Error(`Tag not resolved for ${o} value`)}return s}function Bw(e,n,{anchors:s,doc:l}){if(!l.directives)return"";const o=[],u=(st(e)||jt(e))&&e.anchor;u&&N0(u)&&(s.add(u),o.push(`&${u}`));const d=e.tag??(n.default?null:n.tag);return d&&o.push(l.directives.tagString(d)),o.join(" ")}function Ga(e,n,s,l){if(kt(e))return e.toString(n,s,l);if(Hs(e)){if(n.doc.directives)return e.toString(n);if(n.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");n.resolvedAliases?n.resolvedAliases.add(e):n.resolvedAliases=new Set([e]),e=e.resolve(n.doc)}let o;const u=Nt(e)?e:n.doc.createNode(e,{onTagObj:g=>o=g});o??(o=$w(n.doc.schema.tags,u));const d=Bw(u,o,n);d.length>0&&(n.indentAtStart=(n.indentAtStart??0)+d.length+1);const m=typeof o.stringify=="function"?o.stringify(u,n,s,l):st(u)?Tf(u,n,s,l):u.toString(n,s,l);return d?st(u)||m[0]==="{"||m[0]==="["?`${d} ${m}`:`${d}
42
+ ${n.indent}${m}`:m}function Iw({key:e,value:n},s,l,o){const{allNullValues:u,doc:d,indent:m,indentStep:g,options:{commentString:p,indentSeq:b,simpleKeys:v}}=s;let w=Nt(e)&&e.comment||null;if(v){if(w)throw new Error("With simple keys, key nodes cannot have comments");if(jt(e)||!Nt(e)&&typeof e=="object"){const V="With simple keys, collection cannot be used as a key value";throw new Error(V)}}let N=!v&&(!e||w&&n==null&&!s.inFlow||jt(e)||(st(e)?e.type===ze.BLOCK_FOLDED||e.type===ze.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!N&&(v||!u),indent:m+g});let z=!1,j=!1,k=Ga(e,s,()=>z=!0,()=>j=!0);if(!N&&!s.inFlow&&k.length>1024){if(v)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");N=!0}if(s.inFlow){if(u||n==null)return z&&l&&l(),k===""?"?":N?`? ${k}`:k}else if(u&&!v||n==null&&N)return k=`? ${k}`,w&&!z?k+=Bs(k,s.indent,p(w)):j&&o&&o(),k;z&&(w=null),N?(w&&(k+=Bs(k,s.indent,p(w))),k=`? ${k}
43
+ ${m}:`):(k=`${k}:`,w&&(k+=Bs(k,s.indent,p(w))));let A,E,O;Nt(n)?(A=!!n.spaceBefore,E=n.commentBefore,O=n.comment):(A=!1,E=null,O=null,n&&typeof n=="object"&&(n=d.createNode(n))),s.implicitKey=!1,!N&&!w&&st(n)&&(s.indentAtStart=k.length+1),j=!1,!b&&g.length>=2&&!s.inFlow&&!N&&ir(n)&&!n.flow&&!n.tag&&!n.anchor&&(s.indent=s.indent.substring(2));let D=!1;const L=Ga(n,s,()=>D=!0,()=>j=!0);let H=" ";if(w||A||E){if(H=A?`
44
+ `:"",E){const V=p(E);H+=`
45
+ ${Ei(V,s.indent)}`}L===""&&!s.inFlow?H===`
46
+ `&&O&&(H=`
47
+
48
+ `):H+=`
49
+ ${s.indent}`}else if(!N&&jt(n)){const V=L[0],R=L.indexOf(`
50
+ `),Q=R!==-1,Se=s.inFlow??n.flow??n.items.length===0;if(Q||!Se){let ae=!1;if(Q&&(V==="&"||V==="!")){let fe=L.indexOf(" ");V==="&"&&fe!==-1&&fe<R&&L[fe+1]==="!"&&(fe=L.indexOf(" ",fe+1)),(fe===-1||R<fe)&&(ae=!0)}ae||(H=`
51
+ ${s.indent}`)}}else(L===""||L[0]===`
52
+ `)&&(H="");return k+=H+L,s.inFlow?D&&l&&l():O&&!D?k+=Bs(k,s.indent,p(O)):j&&o&&o(),k}function qw(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const ko="<<",Ai={identify:e=>e===ko||typeof e=="symbol"&&e.description===ko,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ze(Symbol(ko)),{addToJSMap:T0}),stringify:()=>ko},Zw=(e,n)=>(Ai.identify(n)||st(n)&&(!n.type||n.type===ze.PLAIN)&&Ai.identify(n.value))&&e?.doc.schema.tags.some(s=>s.tag===Ai.tag&&s.default);function T0(e,n,s){if(s=e&&Hs(s)?s.resolve(e.doc):s,ir(s))for(const l of s.items)Hd(e,n,l);else if(Array.isArray(s))for(const l of s)Hd(e,n,l);else Hd(e,n,s)}function Hd(e,n,s){const l=e&&Hs(s)?s.resolve(e.doc):s;if(!nr(l))throw new Error("Merge sources must be maps or map aliases");const o=l.toJSON(null,e,Map);for(const[u,d]of o)n instanceof Map?n.has(u)||n.set(u,d):n instanceof Set?n.add(u):Object.prototype.hasOwnProperty.call(n,u)||Object.defineProperty(n,u,{value:d,writable:!0,enumerable:!0,configurable:!0});return n}function O0(e,n,{key:s,value:l}){if(Nt(s)&&s.addToJSMap)s.addToJSMap(e,n,l);else if(Zw(e,s))T0(e,n,l);else{const o=Dn(s,"",e);if(n instanceof Map)n.set(o,Dn(l,o,e));else if(n instanceof Set)n.add(o);else{const u=Hw(s,o,e),d=Dn(l,u,e);u in n?Object.defineProperty(n,u,{value:d,writable:!0,enumerable:!0,configurable:!0}):n[u]=d}}return n}function Hw(e,n,s){if(n===null)return"";if(typeof n!="object")return String(n);if(Nt(e)&&s?.doc){const l=A0(s.doc,{});l.anchors=new Set;for(const u of s.anchors.keys())l.anchors.add(u.anchor);l.inFlow=!0,l.inStringifyKey=!0;const o=e.toString(l);if(!s.mapKeyWarned){let u=JSON.stringify(o);u.length>40&&(u=u.substring(0,36)+'..."'),qw(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${u}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return o}return JSON.stringify(n)}function Of(e,n,s){const l=Xl(e,void 0,s),o=Xl(n,void 0,s);return new en(l,o)}class en{constructor(n,s=null){Object.defineProperty(this,Rn,{value:w0}),this.key=n,this.value=s}clone(n){let{key:s,value:l}=this;return Nt(s)&&(s=s.clone(n)),Nt(l)&&(l=l.clone(n)),new en(s,l)}toJSON(n,s){const l=s?.mapAsMap?new Map:{};return O0(s,l,this)}toString(n,s,l){return n?.doc?Iw(this,n,s,l):JSON.stringify(this)}}function D0(e,n,s){return(n.inFlow??e.flow?Kw:Gw)(e,n,s)}function Gw({comment:e,items:n},s,{blockItemPrefix:l,flowChars:o,itemIndent:u,onChompKeep:d,onComment:m}){const{indent:g,options:{commentString:p}}=s,b=Object.assign({},s,{indent:u,type:null});let v=!1;const w=[];for(let z=0;z<n.length;++z){const j=n[z];let k=null;if(Nt(j))!v&&j.spaceBefore&&w.push(""),Qo(s,w,j.commentBefore,v),j.comment&&(k=j.comment);else if(kt(j)){const E=Nt(j.key)?j.key:null;E&&(!v&&E.spaceBefore&&w.push(""),Qo(s,w,E.commentBefore,v))}v=!1;let A=Ga(j,b,()=>k=null,()=>v=!0);k&&(A+=Bs(A,u,p(k))),v&&k&&(v=!1),w.push(l+A)}let N;if(w.length===0)N=o.start+o.end;else{N=w[0];for(let z=1;z<w.length;++z){const j=w[z];N+=j?`
53
+ ${g}${j}`:`
54
+ `}}return e?(N+=`
55
+ `+Ei(p(e),g),m&&m()):v&&d&&d(),N}function Kw({items:e},n,{flowChars:s,itemIndent:l}){const{indent:o,indentStep:u,flowCollectionPadding:d,options:{commentString:m}}=n;l+=u;const g=Object.assign({},n,{indent:l,inFlow:!0,type:null});let p=!1,b=0;const v=[];for(let z=0;z<e.length;++z){const j=e[z];let k=null;if(Nt(j))j.spaceBefore&&v.push(""),Qo(n,v,j.commentBefore,!1),j.comment&&(k=j.comment);else if(kt(j)){const E=Nt(j.key)?j.key:null;E&&(E.spaceBefore&&v.push(""),Qo(n,v,E.commentBefore,!1),E.comment&&(p=!0));const O=Nt(j.value)?j.value:null;O?(O.comment&&(k=O.comment),O.commentBefore&&(p=!0)):j.value==null&&E?.comment&&(k=E.comment)}k&&(p=!0);let A=Ga(j,g,()=>k=null);z<e.length-1&&(A+=","),k&&(A+=Bs(A,l,m(k))),!p&&(v.length>b||A.includes(`
56
+ `))&&(p=!0),v.push(A),b=v.length}const{start:w,end:N}=s;if(v.length===0)return w+N;if(!p){const z=v.reduce((j,k)=>j+k.length+2,2);p=n.options.lineWidth>0&&z>n.options.lineWidth}if(p){let z=w;for(const j of v)z+=j?`
57
+ ${u}${o}${j}`:`
58
+ `;return`${z}
59
+ ${o}${N}`}else return`${w}${d}${v.join(" ")}${d}${N}`}function Qo({indent:e,options:{commentString:n}},s,l,o){if(l&&o&&(l=l.replace(/^\n+/,"")),l){const u=Ei(n(l),e);s.push(u.trimStart())}}function Is(e,n){const s=st(n)?n.value:n;for(const l of e)if(kt(l)&&(l.key===n||l.key===s||st(l.key)&&l.key.value===s))return l}class On extends C0{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(us,n),this.items=[]}static from(n,s,l){const{keepUndefined:o,replacer:u}=l,d=new this(n),m=(g,p)=>{if(typeof u=="function")p=u.call(s,g,p);else if(Array.isArray(u)&&!u.includes(g))return;(p!==void 0||o)&&d.items.push(Of(g,p,l))};if(s instanceof Map)for(const[g,p]of s)m(g,p);else if(s&&typeof s=="object")for(const g of Object.keys(s))m(g,s[g]);return typeof n.sortMapEntries=="function"&&d.items.sort(n.sortMapEntries),d}add(n,s){let l;kt(n)?l=n:!n||typeof n!="object"||!("key"in n)?l=new en(n,n?.value):l=new en(n.key,n.value);const o=Is(this.items,l.key),u=this.schema?.sortMapEntries;if(o){if(!s)throw new Error(`Key ${l.key} already set`);st(o.value)&&_0(l.value)?o.value.value=l.value:o.value=l.value}else if(u){const d=this.items.findIndex(m=>u(l,m)<0);d===-1?this.items.push(l):this.items.splice(d,0,l)}else this.items.push(l)}delete(n){const s=Is(this.items,n);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(n,s){const o=Is(this.items,n)?.value;return(!s&&st(o)?o.value:o)??void 0}has(n){return!!Is(this.items,n)}set(n,s){this.add(new en(n,s),!0)}toJSON(n,s,l){const o=l?new l:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(o);for(const u of this.items)O0(s,o,u);return o}toString(n,s,l){if(!n)return JSON.stringify(this);for(const o of this.items)if(!kt(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!n.allNullValues&&this.hasAllNullValues(!1)&&(n=Object.assign({},n,{allNullValues:!0})),D0(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:l,onComment:s})}}const Xa={collection:"map",default:!0,nodeClass:On,tag:"tag:yaml.org,2002:map",resolve(e,n){return nr(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,s)=>On.from(e,n,s)};class qs extends C0{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(Pa,n),this.items=[]}add(n){this.items.push(n)}delete(n){const s=zo(n);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(n,s){const l=zo(n);if(typeof l!="number")return;const o=this.items[l];return!s&&st(o)?o.value:o}has(n){const s=zo(n);return typeof s=="number"&&s<this.items.length}set(n,s){const l=zo(n);if(typeof l!="number")throw new Error(`Expected a valid index, not ${n}.`);const o=this.items[l];st(o)&&_0(s)?o.value=s:this.items[l]=s}toJSON(n,s){const l=[];s?.onCreate&&s.onCreate(l);let o=0;for(const u of this.items)l.push(Dn(u,String(o++),s));return l}toString(n,s,l){return n?D0(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:l,onComment:s}):JSON.stringify(this)}static from(n,s,l){const{replacer:o}=l,u=new this(n);if(s&&Symbol.iterator in Object(s)){let d=0;for(let m of s){if(typeof o=="function"){const g=s instanceof Set?m:String(d++);m=o.call(s,g,m)}u.items.push(Xl(m,void 0,l))}}return u}}function zo(e){let n=st(e)?e.value:e;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const Ja={collection:"seq",default:!0,nodeClass:qs,tag:"tag:yaml.org,2002:seq",resolve(e,n){return ir(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,s)=>qs.from(e,n,s)},dc={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,n,s,l){return n=Object.assign({actualString:!0},n),Tf(e,n,s,l)}},fc={identify:e=>e==null,createNode:()=>new ze(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ze(null),stringify:({source:e},n)=>typeof e=="string"&&fc.test.test(e)?e:n.options.nullStr},Df={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ze(e[0]==="t"||e[0]==="T"),stringify({source:e,value:n},s){if(e&&Df.test.test(e)){const l=e[0]==="t"||e[0]==="T";if(n===l)return e}return n?s.options.trueStr:s.options.falseStr}};function Gn({format:e,minFractionDigits:n,tag:s,value:l}){if(typeof l=="bigint")return String(l);const o=typeof l=="number"?l:Number(l);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let u=Object.is(l,-0)?"-0":JSON.stringify(l);if(!e&&n&&(!s||s==="tag:yaml.org,2002:float")&&/^\d/.test(u)){let d=u.indexOf(".");d<0&&(d=u.length,u+=".");let m=n-(u.length-d-1);for(;m-- >0;)u+="0"}return u}const R0={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:Gn},M0={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 n=Number(e.value);return isFinite(n)?n.toExponential():Gn(e)}},L0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const n=new ze(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(n.minFractionDigits=e.length-s-1),n},stringify:Gn},hc=e=>typeof e=="bigint"||Number.isInteger(e),Rf=(e,n,s,{intAsBigInt:l})=>l?BigInt(e):parseInt(e.substring(n),s);function U0(e,n,s){const{value:l}=e;return hc(l)&&l>=0?s+l.toString(n):Gn(e)}const $0={identify:e=>hc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,s)=>Rf(e,2,8,s),stringify:e=>U0(e,8,"0o")},B0={identify:hc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,s)=>Rf(e,0,10,s),stringify:Gn},I0={identify:e=>hc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,s)=>Rf(e,2,16,s),stringify:e=>U0(e,16,"0x")},Yw=[Xa,Ja,dc,fc,Df,$0,B0,I0,R0,M0,L0];function dy(e){return typeof e=="bigint"||Number.isInteger(e)}const _o=({value:e})=>JSON.stringify(e),Vw=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:_o},{identify:e=>e==null,createNode:()=>new ze(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:_o},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:_o},{identify:dy,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>dy(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:_o}],Pw={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Qw=[Xa,Ja].concat(Vw,Pw),Mf={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,n){if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),l=new Uint8Array(s.length);for(let o=0;o<s.length;++o)l[o]=s.charCodeAt(o);return l}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:n,value:s},l,o,u){if(!s)return"";const d=s;let m;if(typeof btoa=="function"){let g="";for(let p=0;p<d.length;++p)g+=String.fromCharCode(d[p]);m=btoa(g)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=ze.BLOCK_LITERAL),n!==ze.QUOTE_DOUBLE){const g=Math.max(l.options.lineWidth-l.indent.length,l.options.minContentWidth),p=Math.ceil(m.length/g),b=new Array(p);for(let v=0,w=0;v<p;++v,w+=g)b[v]=m.substr(w,g);m=b.join(n===ze.BLOCK_LITERAL?`
60
+ `:" ")}return Tf({comment:e,type:n,value:m},l,o,u)}};function q0(e,n){if(ir(e))for(let s=0;s<e.items.length;++s){let l=e.items[s];if(!kt(l)){if(nr(l)){l.items.length>1&&n("Each pair must have its own sequence indicator");const o=l.items[0]||new en(new ze(null));if(l.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${l.commentBefore}
61
+ ${o.key.commentBefore}`:l.commentBefore),l.comment){const u=o.value??o.key;u.comment=u.comment?`${l.comment}
62
+ ${u.comment}`:l.comment}l=o}e.items[s]=kt(l)?l:new en(l)}}else n("Expected a sequence for this tag");return e}function Z0(e,n,s){const{replacer:l}=s,o=new qs(e);o.tag="tag:yaml.org,2002:pairs";let u=0;if(n&&Symbol.iterator in Object(n))for(let d of n){typeof l=="function"&&(d=l.call(n,String(u++),d));let m,g;if(Array.isArray(d))if(d.length===2)m=d[0],g=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const p=Object.keys(d);if(p.length===1)m=p[0],g=d[m];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else m=d;o.items.push(Of(m,g,s))}return o}const Lf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:q0,createNode:Z0};class Ba extends qs{constructor(){super(),this.add=On.prototype.add.bind(this),this.delete=On.prototype.delete.bind(this),this.get=On.prototype.get.bind(this),this.has=On.prototype.has.bind(this),this.set=On.prototype.set.bind(this),this.tag=Ba.tag}toJSON(n,s){if(!s)return super.toJSON(n);const l=new Map;s?.onCreate&&s.onCreate(l);for(const o of this.items){let u,d;if(kt(o)?(u=Dn(o.key,"",s),d=Dn(o.value,u,s)):u=Dn(o,"",s),l.has(u))throw new Error("Ordered maps must not include duplicate keys");l.set(u,d)}return l}static from(n,s,l){const o=Z0(n,s,l),u=new this;return u.items=o.items,u}}Ba.tag="tag:yaml.org,2002:omap";const Uf={collection:"seq",identify:e=>e instanceof Map,nodeClass:Ba,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const s=q0(e,n),l=[];for(const{key:o}of s.items)st(o)&&(l.includes(o.value)?n(`Ordered maps must not include duplicate keys: ${o.value}`):l.push(o.value));return Object.assign(new Ba,s)},createNode:(e,n,s)=>Ba.from(e,n,s)};function H0({value:e,source:n},s){return n&&(e?G0:K0).test.test(n)?n:e?s.options.trueStr:s.options.falseStr}const G0={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 ze(!0),stringify:H0},K0={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 ze(!1),stringify:H0},Xw={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:Gn},Jw={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 n=Number(e.value);return isFinite(n)?n.toExponential():Gn(e)}},Fw={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const n=new ze(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){const l=e.substring(s+1).replace(/_/g,"");l[l.length-1]==="0"&&(n.minFractionDigits=l.length)}return n},stringify:Gn},sr=e=>typeof e=="bigint"||Number.isInteger(e);function mc(e,n,s,{intAsBigInt:l}){const o=e[0];if((o==="-"||o==="+")&&(n+=1),e=e.substring(n).replace(/_/g,""),l){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const d=BigInt(e);return o==="-"?BigInt(-1)*d:d}const u=parseInt(e,s);return o==="-"?-1*u:u}function $f(e,n,s){const{value:l}=e;if(sr(l)){const o=l.toString(n);return l<0?"-"+s+o.substr(1):s+o}return Gn(e)}const Ww={identify:sr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,s)=>mc(e,2,2,s),stringify:e=>$f(e,2,"0b")},ej={identify:sr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,s)=>mc(e,1,8,s),stringify:e=>$f(e,8,"0")},tj={identify:sr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,s)=>mc(e,0,10,s),stringify:Gn},nj={identify:sr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,s)=>mc(e,2,16,s),stringify:e=>$f(e,16,"0x")};class Ia extends On{constructor(n){super(n),this.tag=Ia.tag}add(n){let s;kt(n)?s=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?s=new en(n.key,null):s=new en(n,null),Is(this.items,s.key)||this.items.push(s)}get(n,s){const l=Is(this.items,n);return!s&&kt(l)?st(l.key)?l.key.value:l.key:l}set(n,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const l=Is(this.items,n);l&&!s?this.items.splice(this.items.indexOf(l),1):!l&&s&&this.items.push(new en(n))}toJSON(n,s){return super.toJSON(n,s,Set)}toString(n,s,l){if(!n)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},n,{allNullValues:!0}),s,l);throw new Error("Set items must all have null values")}static from(n,s,l){const{replacer:o}=l,u=new this(n);if(s&&Symbol.iterator in Object(s))for(let d of s)typeof o=="function"&&(d=o.call(s,d,d)),u.items.push(Of(d,null,l));return u}}Ia.tag="tag:yaml.org,2002:set";const Bf={collection:"map",identify:e=>e instanceof Set,nodeClass:Ia,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,n,s)=>Ia.from(e,n,s),resolve(e,n){if(nr(e)){if(e.hasAllNullValues(!0))return Object.assign(new Ia,e);n("Set items must all have null values")}else n("Expected a mapping for this tag");return e}};function If(e,n){const s=e[0],l=s==="-"||s==="+"?e.substring(1):e,o=d=>n?BigInt(d):Number(d),u=l.replace(/_/g,"").split(":").reduce((d,m)=>d*o(60)+o(m),o(0));return s==="-"?o(-1)*u:u}function Y0(e){let{value:n}=e,s=d=>d;if(typeof n=="bigint")s=d=>BigInt(d);else if(isNaN(n)||!isFinite(n))return Gn(e);let l="";n<0&&(l="-",n*=s(-1));const o=s(60),u=[n%o];return n<60?u.unshift(0):(n=(n-u[0])/o,u.unshift(n%o),n>=60&&(n=(n-u[0])/o,u.unshift(n))),l+u.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const V0={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,n,{intAsBigInt:s})=>If(e,s),stringify:Y0},P0={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=>If(e,!1),stringify:Y0},pc={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 n=e.match(pc.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,l,o,u,d,m]=n.map(Number),g=n[7]?Number((n[7]+"00").substr(1,3)):0;let p=Date.UTC(s,l-1,o,u||0,d||0,m||0,g);const b=n[8];if(b&&b!=="Z"){let v=If(b,!1);Math.abs(v)<30&&(v*=60),p-=6e4*v}return new Date(p)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},fy=[Xa,Ja,dc,fc,G0,K0,Ww,ej,tj,nj,Xw,Jw,Fw,Mf,Ai,Uf,Lf,Bf,V0,P0,pc],hy=new Map([["core",Yw],["failsafe",[Xa,Ja,dc]],["json",Qw],["yaml11",fy],["yaml-1.1",fy]]),my={binary:Mf,bool:Df,float:L0,floatExp:M0,floatNaN:R0,floatTime:P0,int:B0,intHex:I0,intOct:$0,intTime:V0,map:Xa,merge:Ai,null:fc,omap:Uf,pairs:Lf,seq:Ja,set:Bf,timestamp:pc},ij={"tag:yaml.org,2002:binary":Mf,"tag:yaml.org,2002:merge":Ai,"tag:yaml.org,2002:omap":Uf,"tag:yaml.org,2002:pairs":Lf,"tag:yaml.org,2002:set":Bf,"tag:yaml.org,2002:timestamp":pc};function Gd(e,n,s){const l=hy.get(n);if(l&&!e)return s&&!l.includes(Ai)?l.concat(Ai):l.slice();let o=l;if(!o)if(Array.isArray(e))o=[];else{const u=Array.from(hy.keys()).filter(d=>d!=="yaml11").map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown schema "${n}"; use one of ${u} or define customTags array`)}if(Array.isArray(e))for(const u of e)o=o.concat(u);else typeof e=="function"&&(o=e(o.slice()));return s&&(o=o.concat(Ai)),o.reduce((u,d)=>{const m=typeof d=="string"?my[d]:d;if(!m){const g=JSON.stringify(d),p=Object.keys(my).map(b=>JSON.stringify(b)).join(", ");throw new Error(`Unknown custom tag ${g}; use one of ${p}`)}return u.includes(m)||u.push(m),u},[])}const sj=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class qf{constructor({compat:n,customTags:s,merge:l,resolveKnownTags:o,schema:u,sortMapEntries:d,toStringDefaults:m}){this.compat=Array.isArray(n)?Gd(n,"compat"):n?Gd(null,n):null,this.name=typeof u=="string"&&u||"core",this.knownTags=o?ij:{},this.tags=Gd(s,this.name,l),this.toStringOptions=m??null,Object.defineProperty(this,us,{value:Xa}),Object.defineProperty(this,ai,{value:dc}),Object.defineProperty(this,Pa,{value:Ja}),this.sortMapEntries=typeof d=="function"?d:d===!0?sj:null}clone(){const n=Object.create(qf.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function aj(e,n){const s=[];let l=n.directives===!0;if(n.directives!==!1&&e.directives){const g=e.directives.toString(e);g?(s.push(g),l=!0):e.directives.docStart&&(l=!0)}l&&s.push("---");const o=A0(e,n),{commentString:u}=o.options;if(e.commentBefore){s.length!==1&&s.unshift("");const g=u(e.commentBefore);s.unshift(Ei(g,""))}let d=!1,m=null;if(e.contents){if(Nt(e.contents)){if(e.contents.spaceBefore&&l&&s.push(""),e.contents.commentBefore){const b=u(e.contents.commentBefore);s.push(Ei(b,""))}o.forceBlockIndent=!!e.comment,m=e.contents.comment}const g=m?void 0:()=>d=!0;let p=Ga(e.contents,o,()=>m=null,g);m&&(p+=Bs(p,"",u(m))),(p[0]==="|"||p[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${p}`:s.push(p)}else s.push(Ga(e.contents,o));if(e.directives?.docEnd)if(e.comment){const g=u(e.comment);g.includes(`
63
+ `)?(s.push("..."),s.push(Ei(g,""))):s.push(`... ${g}`)}else s.push("...");else{let g=e.comment;g&&d&&(g=g.replace(/^\n+/,"")),g&&((!d||m)&&s[s.length-1]!==""&&s.push(""),s.push(Ei(u(g),"")))}return s.join(`
64
+ `)+`
65
+ `}class gc{constructor(n,s,l){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Rn,{value:cf});let o=null;typeof s=="function"||Array.isArray(s)?o=s:l===void 0&&s&&(l=s,s=void 0);const u=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},l);this.options=u;let{version:d}=u;l?._directives?(this.directives=l._directives.atDocument(),this.directives.yaml.explicit&&(d=this.directives.yaml.version)):this.directives=new Wt({version:d}),this.setSchema(d,l),this.contents=n===void 0?null:this.createNode(n,o,l)}clone(){const n=Object.create(gc.prototype,{[Rn]:{value:cf}});return n.commentBefore=this.commentBefore,n.comment=this.comment,n.errors=this.errors.slice(),n.warnings=this.warnings.slice(),n.options=Object.assign({},this.options),this.directives&&(n.directives=this.directives.clone()),n.schema=this.schema.clone(),n.contents=Nt(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){Ea(this.contents)&&this.contents.add(n)}addIn(n,s){Ea(this.contents)&&this.contents.addIn(n,s)}createAlias(n,s){if(!n.anchor){const l=k0(this);n.anchor=!s||l.has(s)?z0(s||"a",l):s}return new Af(n.anchor)}createNode(n,s,l){let o;if(typeof s=="function")n=s.call({"":n},"",n),o=s;else if(Array.isArray(s)){const k=E=>typeof E=="number"||E instanceof String||E instanceof Number,A=s.filter(k).map(String);A.length>0&&(s=s.concat(A)),o=s}else l===void 0&&s&&(l=s,s=void 0);const{aliasDuplicateObjects:u,anchorPrefix:d,flow:m,keepUndefined:g,onTagObj:p,tag:b}=l??{},{onAnchor:v,setAnchors:w,sourceObjects:N}=Ow(this,d||"a"),z={aliasDuplicateObjects:u??!0,keepUndefined:g??!1,onAnchor:v,onTagObj:p,replacer:o,schema:this.schema,sourceObjects:N},j=Xl(n,b,z);return m&&jt(j)&&(j.flow=!0),w(),j}createPair(n,s,l={}){const o=this.createNode(n,null,l),u=this.createNode(s,null,l);return new en(o,u)}delete(n){return Ea(this.contents)?this.contents.delete(n):!1}deleteIn(n){return Yl(n)?this.contents==null?!1:(this.contents=null,!0):Ea(this.contents)?this.contents.deleteIn(n):!1}get(n,s){return jt(this.contents)?this.contents.get(n,s):void 0}getIn(n,s){return Yl(n)?!s&&st(this.contents)?this.contents.value:this.contents:jt(this.contents)?this.contents.getIn(n,s):void 0}has(n){return jt(this.contents)?this.contents.has(n):!1}hasIn(n){return Yl(n)?this.contents!==void 0:jt(this.contents)?this.contents.hasIn(n):!1}set(n,s){this.contents==null?this.contents=Po(this.schema,[n],s):Ea(this.contents)&&this.contents.set(n,s)}setIn(n,s){Yl(n)?this.contents=s:this.contents==null?this.contents=Po(this.schema,Array.from(n),s):Ea(this.contents)&&this.contents.setIn(n,s)}setSchema(n,s={}){typeof n=="number"&&(n=String(n));let l;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Wt({version:"1.1"}),l={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new Wt({version:n}),l={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,l=null;break;default:{const o=JSON.stringify(n);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(l)this.schema=new qf(Object.assign(l,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:s,mapAsMap:l,maxAliasCount:o,onAnchor:u,reviver:d}={}){const m={anchors:new Map,doc:this,keep:!n,mapAsMap:l===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},g=Dn(this.contents,s??"",m);if(typeof u=="function")for(const{count:p,res:b}of m.anchors.values())u(b,p);return typeof d=="function"?Ma(d,{"":g},"",g):g}toJSON(n,s){return this.toJS({json:!0,jsonArg:n,mapAsMap:!1,onAnchor:s})}toString(n={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in n&&(!Number.isInteger(n.indent)||Number(n.indent)<=0)){const s=JSON.stringify(n.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return aj(this,n)}}function Ea(e){if(jt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Q0 extends Error{constructor(n,s,l,o){super(),this.name=n,this.code=l,this.message=o,this.pos=s}}class Co extends Q0{constructor(n,s,l){super("YAMLParseError",n,s,l)}}class lj extends Q0{constructor(n,s,l){super("YAMLWarning",n,s,l)}}const py=(e,n)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(m=>n.linePos(m));const{line:l,col:o}=s.linePos[0];s.message+=` at line ${l}, column ${o}`;let u=o-1,d=e.substring(n.lineStarts[l-1],n.lineStarts[l]).replace(/[\n\r]+$/,"");if(u>=60&&d.length>80){const m=Math.min(u-39,d.length-79);d="…"+d.substring(m),u-=m-1}if(d.length>80&&(d=d.substring(0,79)+"…"),l>1&&/^ *$/.test(d.substring(0,u))){let m=e.substring(n.lineStarts[l-2],n.lineStarts[l-1]);m.length>80&&(m=m.substring(0,79)+`…
66
+ `),d=m+d}if(/[^ ]/.test(d)){let m=1;const g=s.linePos[1];g?.line===l&&g.col>o&&(m=Math.max(1,Math.min(g.col-o,80-u)));const p=" ".repeat(u)+"^".repeat(m);s.message+=`:
67
+
68
+ ${d}
69
+ ${p}
70
+ `}};function Ka(e,{flow:n,indicator:s,next:l,offset:o,onError:u,parentIndent:d,startOnNewline:m}){let g=!1,p=m,b=m,v="",w="",N=!1,z=!1,j=null,k=null,A=null,E=null,O=null,D=null,L=null;for(const R of e)switch(z&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&u(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),z=!1),j&&(p&&R.type!=="comment"&&R.type!=="newline"&&u(j,"TAB_AS_INDENT","Tabs are not allowed as indentation"),j=null),R.type){case"space":!n&&(s!=="doc-start"||l?.type!=="flow-collection")&&R.source.includes(" ")&&(j=R),b=!0;break;case"comment":{b||u(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const Q=R.source.substring(1)||" ";v?v+=w+Q:v=Q,w="",p=!1;break}case"newline":p?v?v+=R.source:(!D||s!=="seq-item-ind")&&(g=!0):w+=R.source,p=!0,N=!0,(k||A)&&(E=R),b=!0;break;case"anchor":k&&u(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&u(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),k=R,L??(L=R.offset),p=!1,b=!1,z=!0;break;case"tag":{A&&u(R,"MULTIPLE_TAGS","A node can have at most one tag"),A=R,L??(L=R.offset),p=!1,b=!1,z=!0;break}case s:(k||A)&&u(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),D&&u(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${n??"collection"}`),D=R,p=s==="seq-item-ind"||s==="explicit-key-ind",b=!1;break;case"comma":if(n){O&&u(R,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),O=R,p=!1,b=!1;break}default:u(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),p=!1,b=!1}const H=e[e.length-1],V=H?H.offset+H.source.length:o;return z&&l&&l.type!=="space"&&l.type!=="newline"&&l.type!=="comma"&&(l.type!=="scalar"||l.source!=="")&&u(l.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),j&&(p&&j.indent<=d||l?.type==="block-map"||l?.type==="block-seq")&&u(j,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:O,found:D,spaceBefore:g,comment:v,hasNewline:N,anchor:k,tag:A,newlineAfterProp:E,end:V,start:L??V}}function Jl(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
71
+ `))return!0;if(e.end){for(const n of e.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(const n of e.items){for(const s of n.start)if(s.type==="newline")return!0;if(n.sep){for(const s of n.sep)if(s.type==="newline")return!0}if(Jl(n.key)||Jl(n.value))return!0}return!1;default:return!0}}function hf(e,n,s){if(n?.type==="flow-collection"){const l=n.end[0];l.indent===e&&(l.source==="]"||l.source==="}")&&Jl(n)&&s(l,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function X0(e,n,s){const{uniqueKeys:l}=e.options;if(l===!1)return!1;const o=typeof l=="function"?l:(u,d)=>u===d||st(u)&&st(d)&&u.value===d.value;return n.some(u=>o(u.key,s))}const gy="All mapping items must start at the same column";function rj({composeNode:e,composeEmptyNode:n},s,l,o,u){const d=u?.nodeClass??On,m=new d(s.schema);s.atRoot&&(s.atRoot=!1);let g=l.offset,p=null;for(const b of l.items){const{start:v,key:w,sep:N,value:z}=b,j=Ka(v,{indicator:"explicit-key-ind",next:w??N?.[0],offset:g,onError:o,parentIndent:l.indent,startOnNewline:!0}),k=!j.found;if(k){if(w&&(w.type==="block-seq"?o(g,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in w&&w.indent!==l.indent&&o(g,"BAD_INDENT",gy)),!j.anchor&&!j.tag&&!N){p=j.end,j.comment&&(m.comment?m.comment+=`
72
+ `+j.comment:m.comment=j.comment);continue}(j.newlineAfterProp||Jl(w))&&o(w??v[v.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else j.found?.indent!==l.indent&&o(g,"BAD_INDENT",gy);s.atKey=!0;const A=j.end,E=w?e(s,w,j,o):n(s,A,v,null,j,o);s.schema.compat&&hf(l.indent,w,o),s.atKey=!1,X0(s,m.items,E)&&o(A,"DUPLICATE_KEY","Map keys must be unique");const O=Ka(N??[],{indicator:"map-value-ind",next:z,offset:E.range[2],onError:o,parentIndent:l.indent,startOnNewline:!w||w.type==="block-scalar"});if(g=O.end,O.found){k&&(z?.type==="block-map"&&!O.hasNewline&&o(g,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&j.start<O.found.offset-1024&&o(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const D=z?e(s,z,O,o):n(s,g,N,null,O,o);s.schema.compat&&hf(l.indent,z,o),g=D.range[2];const L=new en(E,D);s.options.keepSourceTokens&&(L.srcToken=b),m.items.push(L)}else{k&&o(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),O.comment&&(E.comment?E.comment+=`
73
+ `+O.comment:E.comment=O.comment);const D=new en(E);s.options.keepSourceTokens&&(D.srcToken=b),m.items.push(D)}}return p&&p<g&&o(p,"IMPOSSIBLE","Map comment with trailing content"),m.range=[l.offset,g,p??g],m}function oj({composeNode:e,composeEmptyNode:n},s,l,o,u){const d=u?.nodeClass??qs,m=new d(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let g=l.offset,p=null;for(const{start:b,value:v}of l.items){const w=Ka(b,{indicator:"seq-item-ind",next:v,offset:g,onError:o,parentIndent:l.indent,startOnNewline:!0});if(!w.found)if(w.anchor||w.tag||v)v?.type==="block-seq"?o(w.end,"BAD_INDENT","All sequence items must start at the same column"):o(g,"MISSING_CHAR","Sequence item without - indicator");else{p=w.end,w.comment&&(m.comment=w.comment);continue}const N=v?e(s,v,w,o):n(s,w.end,b,null,w,o);s.schema.compat&&hf(l.indent,v,o),g=N.range[2],m.items.push(N)}return m.range=[l.offset,g,p??g],m}function ar(e,n,s,l){let o="";if(e){let u=!1,d="";for(const m of e){const{source:g,type:p}=m;switch(p){case"space":u=!0;break;case"comment":{s&&!u&&l(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const b=g.substring(1)||" ";o?o+=d+b:o=b,d="";break}case"newline":o&&(d+=g),u=!0;break;default:l(m,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}n+=g.length}}return{comment:o,offset:n}}const Kd="Block collections are not allowed within flow collections",Yd=e=>e&&(e.type==="block-map"||e.type==="block-seq");function cj({composeNode:e,composeEmptyNode:n},s,l,o,u){const d=l.start.source==="{",m=d?"flow map":"flow sequence",g=u?.nodeClass??(d?On:qs),p=new g(s.schema);p.flow=!0;const b=s.atRoot;b&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let v=l.offset+l.start.source.length;for(let k=0;k<l.items.length;++k){const A=l.items[k],{start:E,key:O,sep:D,value:L}=A,H=Ka(E,{flow:m,indicator:"explicit-key-ind",next:O??D?.[0],offset:v,onError:o,parentIndent:l.indent,startOnNewline:!1});if(!H.found){if(!H.anchor&&!H.tag&&!D&&!L){k===0&&H.comma?o(H.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`):k<l.items.length-1&&o(H.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${m}`),H.comment&&(p.comment?p.comment+=`
74
+ `+H.comment:p.comment=H.comment),v=H.end;continue}!d&&s.options.strict&&Jl(O)&&o(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(k===0)H.comma&&o(H.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`);else if(H.comma||o(H.start,"MISSING_CHAR",`Missing , between ${m} items`),H.comment){let V="";e:for(const R of E)switch(R.type){case"comma":case"space":break;case"comment":V=R.source.substring(1);break e;default:break e}if(V){let R=p.items[p.items.length-1];kt(R)&&(R=R.value??R.key),R.comment?R.comment+=`
75
+ `+V:R.comment=V,H.comment=H.comment.substring(V.length+1)}}if(!d&&!D&&!H.found){const V=L?e(s,L,H,o):n(s,H.end,D,null,H,o);p.items.push(V),v=V.range[2],Yd(L)&&o(V.range,"BLOCK_IN_FLOW",Kd)}else{s.atKey=!0;const V=H.end,R=O?e(s,O,H,o):n(s,V,E,null,H,o);Yd(O)&&o(R.range,"BLOCK_IN_FLOW",Kd),s.atKey=!1;const Q=Ka(D??[],{flow:m,indicator:"map-value-ind",next:L,offset:R.range[2],onError:o,parentIndent:l.indent,startOnNewline:!1});if(Q.found){if(!d&&!H.found&&s.options.strict){if(D)for(const fe of D){if(fe===Q.found)break;if(fe.type==="newline"){o(fe,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}H.start<Q.found.offset-1024&&o(Q.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else L&&("source"in L&&L.source?.[0]===":"?o(L,"MISSING_CHAR",`Missing space after : in ${m}`):o(Q.start,"MISSING_CHAR",`Missing , or : between ${m} items`));const Se=L?e(s,L,Q,o):Q.found?n(s,Q.end,D,null,Q,o):null;Se?Yd(L)&&o(Se.range,"BLOCK_IN_FLOW",Kd):Q.comment&&(R.comment?R.comment+=`
76
+ `+Q.comment:R.comment=Q.comment);const ae=new en(R,Se);if(s.options.keepSourceTokens&&(ae.srcToken=A),d){const fe=p;X0(s,fe.items,R)&&o(V,"DUPLICATE_KEY","Map keys must be unique"),fe.items.push(ae)}else{const fe=new On(s.schema);fe.flow=!0,fe.items.push(ae);const Ae=(Se??R).range;fe.range=[R.range[0],Ae[1],Ae[2]],p.items.push(fe)}v=Se?Se.range[2]:Q.end}}const w=d?"}":"]",[N,...z]=l.end;let j=v;if(N?.source===w)j=N.offset+N.source.length;else{const k=m[0].toUpperCase()+m.substring(1),A=b?`${k} must end with a ${w}`:`${k} in block collection must be sufficiently indented and end with a ${w}`;o(v,b?"MISSING_CHAR":"BAD_INDENT",A),N&&N.source.length!==1&&z.unshift(N)}if(z.length>0){const k=ar(z,j,s.options.strict,o);k.comment&&(p.comment?p.comment+=`
77
+ `+k.comment:p.comment=k.comment),p.range=[l.offset,j,k.offset]}else p.range=[l.offset,j,j];return p}function Vd(e,n,s,l,o,u){const d=s.type==="block-map"?rj(e,n,s,l,u):s.type==="block-seq"?oj(e,n,s,l,u):cj(e,n,s,l,u),m=d.constructor;return o==="!"||o===m.tagName?(d.tag=m.tagName,d):(o&&(d.tag=o),d)}function uj(e,n,s,l,o){const u=l.tag,d=u?n.directives.tagName(u.source,w=>o(u,"TAG_RESOLVE_FAILED",w)):null;if(s.type==="block-seq"){const{anchor:w,newlineAfterProp:N}=l,z=w&&u?w.offset>u.offset?w:u:w??u;z&&(!N||N.offset<z.offset)&&o(z,"MISSING_CHAR","Missing newline after block sequence props")}const m=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!u||!d||d==="!"||d===On.tagName&&m==="map"||d===qs.tagName&&m==="seq")return Vd(e,n,s,o,d);let g=n.schema.tags.find(w=>w.tag===d&&w.collection===m);if(!g){const w=n.schema.knownTags[d];if(w?.collection===m)n.schema.tags.push(Object.assign({},w,{default:!1})),g=w;else return w?o(u,"BAD_COLLECTION_TYPE",`${w.tag} used for ${m} collection, but expects ${w.collection??"scalar"}`,!0):o(u,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),Vd(e,n,s,o,d)}const p=Vd(e,n,s,o,d,g),b=g.resolve?.(p,w=>o(u,"TAG_RESOLVE_FAILED",w),n.options)??p,v=Nt(b)?b:new ze(b);return v.range=p.range,v.tag=d,g?.format&&(v.format=g.format),v}function dj(e,n,s){const l=n.offset,o=fj(n,e.options.strict,s);if(!o)return{value:"",type:null,comment:"",range:[l,l,l]};const u=o.mode===">"?ze.BLOCK_FOLDED:ze.BLOCK_LITERAL,d=n.source?hj(n.source):[];let m=d.length;for(let j=d.length-1;j>=0;--j){const k=d[j][1];if(k===""||k==="\r")m=j;else break}if(m===0){const j=o.chomp==="+"&&d.length>0?`
78
+ `.repeat(Math.max(1,d.length-1)):"";let k=l+o.length;return n.source&&(k+=n.source.length),{value:j,type:u,comment:o.comment,range:[l,k,k]}}let g=n.indent+o.indent,p=n.offset+o.length,b=0;for(let j=0;j<m;++j){const[k,A]=d[j];if(A===""||A==="\r")o.indent===0&&k.length>g&&(g=k.length);else{k.length<g&&s(p+k.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(g=k.length),b=j,g===0&&!e.atRoot&&s(p,"BAD_INDENT","Block scalar values in collections must be indented");break}p+=k.length+A.length+1}for(let j=d.length-1;j>=m;--j)d[j][0].length>g&&(m=j+1);let v="",w="",N=!1;for(let j=0;j<b;++j)v+=d[j][0].slice(g)+`
79
+ `;for(let j=b;j<m;++j){let[k,A]=d[j];p+=k.length+A.length+1;const E=A[A.length-1]==="\r";if(E&&(A=A.slice(0,-1)),A&&k.length<g){const D=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;s(p-A.length-(E?2:1),"BAD_INDENT",D),k=""}u===ze.BLOCK_LITERAL?(v+=w+k.slice(g)+A,w=`
80
+ `):k.length>g||A[0]===" "?(w===" "?w=`
81
+ `:!N&&w===`
82
+ `&&(w=`
83
+
84
+ `),v+=w+k.slice(g)+A,w=`
85
+ `,N=!0):A===""?w===`
86
+ `?v+=`
87
+ `:w=`
88
+ `:(v+=w+A,w=" ",N=!1)}switch(o.chomp){case"-":break;case"+":for(let j=m;j<d.length;++j)v+=`
89
+ `+d[j][0].slice(g);v[v.length-1]!==`
90
+ `&&(v+=`
91
+ `);break;default:v+=`
92
+ `}const z=l+o.length+n.source.length;return{value:v,type:u,comment:o.comment,range:[l,z,z]}}function fj({offset:e,props:n},s,l){if(n[0].type!=="block-scalar-header")return l(n[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:o}=n[0],u=o[0];let d=0,m="",g=-1;for(let w=1;w<o.length;++w){const N=o[w];if(!m&&(N==="-"||N==="+"))m=N;else{const z=Number(N);!d&&z?d=z:g===-1&&(g=e+w)}}g!==-1&&l(g,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let p=!1,b="",v=o.length;for(let w=1;w<n.length;++w){const N=n[w];switch(N.type){case"space":p=!0;case"newline":v+=N.source.length;break;case"comment":s&&!p&&l(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),v+=N.source.length,b=N.source.substring(1);break;case"error":l(N,"UNEXPECTED_TOKEN",N.message),v+=N.source.length;break;default:{const z=`Unexpected token in block scalar header: ${N.type}`;l(N,"UNEXPECTED_TOKEN",z);const j=N.source;j&&typeof j=="string"&&(v+=j.length)}}}return{mode:u,indent:d,chomp:m,comment:b,length:v}}function hj(e){const n=e.split(/\n( *)/),s=n[0],l=s.match(/^( *)/),u=[l?.[1]?[l[1],s.slice(l[1].length)]:["",s]];for(let d=1;d<n.length;d+=2)u.push([n[d],n[d+1]]);return u}function mj(e,n,s){const{offset:l,type:o,source:u,end:d}=e;let m,g;const p=(w,N,z)=>s(l+w,N,z);switch(o){case"scalar":m=ze.PLAIN,g=pj(u,p);break;case"single-quoted-scalar":m=ze.QUOTE_SINGLE,g=gj(u,p);break;case"double-quoted-scalar":m=ze.QUOTE_DOUBLE,g=yj(u,p);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[l,l+u.length,l+u.length]}}const b=l+u.length,v=ar(d,b,n,s);return{value:g,type:m,comment:v.comment,range:[l,b,v.offset]}}function pj(e,n){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&&n(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),J0(e)}function gj(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),J0(e.slice(1,-1)).replace(/''/g,"'")}function J0(e){let n,s;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
93
+ `,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
94
+ `,"sy")}catch{n=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let l=n.exec(e);if(!l)return e;let o=l[1],u=" ",d=n.lastIndex;for(s.lastIndex=d;l=s.exec(e);)l[1]===""?u===`
95
+ `?o+=u:u=`
96
+ `:(o+=u+l[1],u=" "),d=s.lastIndex;const m=/[ \t]*(.*)/sy;return m.lastIndex=d,l=m.exec(e),o+u+(l?.[1]??"")}function yj(e,n){let s="";for(let l=1;l<e.length-1;++l){const o=e[l];if(!(o==="\r"&&e[l+1]===`
97
+ `))if(o===`
98
+ `){const{fold:u,offset:d}=vj(e,l);s+=u,l=d}else if(o==="\\"){let u=e[++l];const d=bj[u];if(d)s+=d;else if(u===`
99
+ `)for(u=e[l+1];u===" "||u===" ";)u=e[++l+1];else if(u==="\r"&&e[l+1]===`
100
+ `)for(u=e[++l+1];u===" "||u===" ";)u=e[++l+1];else if(u==="x"||u==="u"||u==="U"){const m={x:2,u:4,U:8}[u];s+=xj(e,l+1,m,n),l+=m}else{const m=e.substr(l-1,2);n(l-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),s+=m}}else if(o===" "||o===" "){const u=l;let d=e[l+1];for(;d===" "||d===" ";)d=e[++l+1];d!==`
101
+ `&&!(d==="\r"&&e[l+2]===`
102
+ `)&&(s+=l>u?e.slice(u,l+1):o)}else s+=o}return(e[e.length-1]!=='"'||e.length===1)&&n(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function vj(e,n){let s="",l=e[n+1];for(;(l===" "||l===" "||l===`
103
+ `||l==="\r")&&!(l==="\r"&&e[n+2]!==`
104
+ `);)l===`
105
+ `&&(s+=`
106
+ `),n+=1,l=e[n+1];return s||(s=" "),{fold:s,offset:n}}const bj={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
107
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function xj(e,n,s,l){const o=e.substr(n,s),d=o.length===s&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;if(isNaN(d)){const m=e.substr(n-2,s+2);return l(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),m}return String.fromCodePoint(d)}function F0(e,n,s,l){const{value:o,type:u,comment:d,range:m}=n.type==="block-scalar"?dj(e,n,l):mj(n,e.options.strict,l),g=s?e.directives.tagName(s.source,v=>l(s,"TAG_RESOLVE_FAILED",v)):null;let p;e.options.stringKeys&&e.atKey?p=e.schema[ai]:g?p=Sj(e.schema,o,g,s,l):n.type==="scalar"?p=wj(e,o,n,l):p=e.schema[ai];let b;try{const v=p.resolve(o,w=>l(s??n,"TAG_RESOLVE_FAILED",w),e.options);b=st(v)?v:new ze(v)}catch(v){const w=v instanceof Error?v.message:String(v);l(s??n,"TAG_RESOLVE_FAILED",w),b=new ze(o)}return b.range=m,b.source=o,u&&(b.type=u),g&&(b.tag=g),p.format&&(b.format=p.format),d&&(b.comment=d),b}function Sj(e,n,s,l,o){if(s==="!")return e[ai];const u=[];for(const m of e.tags)if(!m.collection&&m.tag===s)if(m.default&&m.test)u.push(m);else return m;for(const m of u)if(m.test?.test(n))return m;const d=e.knownTags[s];return d&&!d.collection?(e.tags.push(Object.assign({},d,{default:!1,test:void 0})),d):(o(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[ai])}function wj({atKey:e,directives:n,schema:s},l,o,u){const d=s.tags.find(m=>(m.default===!0||e&&m.default==="key")&&m.test?.test(l))||s[ai];if(s.compat){const m=s.compat.find(g=>g.default&&g.test?.test(l))??s[ai];if(d.tag!==m.tag){const g=n.tagString(d.tag),p=n.tagString(m.tag),b=`Value may be parsed as either ${g} or ${p}`;u(o,"TAG_RESOLVE_FAILED",b,!0)}}return d}function jj(e,n,s){if(n){s??(s=n.length);for(let l=s-1;l>=0;--l){let o=n[l];switch(o.type){case"space":case"comment":case"newline":e-=o.source.length;continue}for(o=n[++l];o?.type==="space";)e+=o.source.length,o=n[++l];break}}return e}const Nj={composeNode:W0,composeEmptyNode:Zf};function W0(e,n,s,l){const o=e.atKey,{spaceBefore:u,comment:d,anchor:m,tag:g}=s;let p,b=!0;switch(n.type){case"alias":p=kj(e,n,l),(m||g)&&l(n,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":p=F0(e,n,g,l),m&&(p.anchor=m.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":p=uj(Nj,e,n,s,l),m&&(p.anchor=m.source.substring(1));break;default:{const v=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;l(n,"UNEXPECTED_TOKEN",v),p=Zf(e,n.offset,void 0,null,s,l),b=!1}}return m&&p.anchor===""&&l(m,"BAD_ALIAS","Anchor cannot be an empty string"),o&&e.options.stringKeys&&(!st(p)||typeof p.value!="string"||p.tag&&p.tag!=="tag:yaml.org,2002:str")&&l(g??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),u&&(p.spaceBefore=!0),d&&(n.type==="scalar"&&n.source===""?p.comment=d:p.commentBefore=d),e.options.keepSourceTokens&&b&&(p.srcToken=n),p}function Zf(e,n,s,l,{spaceBefore:o,comment:u,anchor:d,tag:m,end:g},p){const b={type:"scalar",offset:jj(n,s,l),indent:-1,source:""},v=F0(e,b,m,p);return d&&(v.anchor=d.source.substring(1),v.anchor===""&&p(d,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(v.spaceBefore=!0),u&&(v.comment=u,v.range[2]=g),v}function kj({options:e},{offset:n,source:s,end:l},o){const u=new Af(s.substring(1));u.source===""&&o(n,"BAD_ALIAS","Alias cannot be an empty string"),u.source.endsWith(":")&&o(n+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=n+s.length,m=ar(l,d,e.strict,o);return u.range=[n,d,m.offset],m.comment&&(u.comment=m.comment),u}function zj(e,n,{offset:s,start:l,value:o,end:u},d){const m=Object.assign({_directives:n},e),g=new gc(void 0,m),p={atKey:!1,atRoot:!0,directives:g.directives,options:g.options,schema:g.schema},b=Ka(l,{indicator:"doc-start",next:o??u?.[0],offset:s,onError:d,parentIndent:0,startOnNewline:!0});b.found&&(g.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!b.hasNewline&&d(b.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),g.contents=o?W0(p,o,b,d):Zf(p,b.end,l,null,b,d);const v=g.contents.range[2],w=ar(u,v,!1,d);return w.comment&&(g.comment=w.comment),g.range=[s,v,w.offset],g}function Gl(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:n,source:s}=e;return[n,n+(typeof s=="string"?s.length:1)]}function yy(e){let n="",s=!1,l=!1;for(let o=0;o<e.length;++o){const u=e[o];switch(u[0]){case"#":n+=(n===""?"":l?`
108
+
109
+ `:`
110
+ `)+(u.substring(1)||" "),s=!0,l=!1;break;case"%":e[o+1]?.[0]!=="#"&&(o+=1),s=!1;break;default:s||(l=!0),s=!1}}return{comment:n,afterEmptyLine:l}}class _j{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,l,o,u)=>{const d=Gl(s);u?this.warnings.push(new lj(d,l,o)):this.errors.push(new Co(d,l,o))},this.directives=new Wt({version:n.version||"1.2"}),this.options=n}decorate(n,s){const{comment:l,afterEmptyLine:o}=yy(this.prelude);if(l){const u=n.contents;if(s)n.comment=n.comment?`${n.comment}
111
+ ${l}`:l;else if(o||n.directives.docStart||!u)n.commentBefore=l;else if(jt(u)&&!u.flow&&u.items.length>0){let d=u.items[0];kt(d)&&(d=d.key);const m=d.commentBefore;d.commentBefore=m?`${l}
112
+ ${m}`:l}else{const d=u.commentBefore;u.commentBefore=d?`${l}
113
+ ${d}`:l}}s?(Array.prototype.push.apply(n.errors,this.errors),Array.prototype.push.apply(n.warnings,this.warnings)):(n.errors=this.errors,n.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:yy(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,s=!1,l=-1){for(const o of n)yield*this.next(o);yield*this.end(s,l)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(s,l,o)=>{const u=Gl(n);u[0]+=s,this.onError(u,"BAD_DIRECTIVE",l,o)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const s=zj(this.options,this.directives,n,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(n,"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(n.source);break;case"error":{const s=n.source?`${n.message}: ${JSON.stringify(n.source)}`:n.message,l=new Co(Gl(n),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(l):this.doc.errors.push(l);break}case"doc-end":{if(!this.doc){const l="Unexpected doc-end without preceding document";this.errors.push(new Co(Gl(n),"UNEXPECTED_TOKEN",l));break}this.doc.directives.docEnd=!0;const s=ar(n.end,n.offset+n.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const l=this.doc.comment;this.doc.comment=l?`${l}
114
+ ${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new Co(Gl(n),"UNEXPECTED_TOKEN",`Unsupported token ${n.type}`))}}*end(n=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(n){const l=Object.assign({_directives:this.directives},this.options),o=new gc(void 0,l);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,s,s],this.decorate(o,!1),yield o}}}const ev="\uFEFF",tv="",nv="",mf="";function Cj(e){switch(e){case ev:return"byte-order-mark";case tv:return"doc-mode";case nv:return"flow-error-end";case mf:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
115
+ `:case`\r
116
+ `: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 Zn(e){switch(e){case void 0:case" ":case`
117
+ `:case"\r":case" ":return!0;default:return!1}}const vy=new Set("0123456789ABCDEFabcdef"),Ej=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Eo=new Set(",[]{}"),Aj=new Set(` ,[]{}
118
+ \r `),Pd=e=>!e||Aj.has(e);class Tj{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(n,s=!1){if(n){if(typeof n!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+n:n,this.lineEndPos=null}this.atEnd=!s;let l=this.next??"stream";for(;l&&(s||this.hasChars(1));)l=yield*this.parseNext(l)}atLineEnd(){let n=this.pos,s=this.buffer[n];for(;s===" "||s===" ";)s=this.buffer[++n];return!s||s==="#"||s===`
119
+ `?!0:s==="\r"?this.buffer[n+1]===`
120
+ `:!1}charAt(n){return this.buffer[this.pos+n]}continueScalar(n){let s=this.buffer[n];if(this.indentNext>0){let l=0;for(;s===" ";)s=this.buffer[++l+n];if(s==="\r"){const o=this.buffer[l+n+1];if(o===`
121
+ `||!o&&!this.atEnd)return n+l+1}return s===`
122
+ `||l>=this.indentNext||!s&&!this.atEnd?n+l:-1}if(s==="-"||s==="."){const l=this.buffer.substr(n,3);if((l==="---"||l==="...")&&Zn(this.buffer[n+3]))return-1}return n}getLine(){let n=this.lineEndPos;return(typeof n!="number"||n!==-1&&n<this.pos)&&(n=this.buffer.indexOf(`
123
+ `,this.pos),this.lineEndPos=n),n===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[n-1]==="\r"&&(n-=1),this.buffer.substring(this.pos,n))}hasChars(n){return this.pos+n<=this.buffer.length}setNext(n){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=n,null}peek(n){return this.buffer.substr(this.pos,n)}*parseNext(n){switch(n){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 n=this.getLine();if(n===null)return this.setNext("stream");if(n[0]===ev&&(yield*this.pushCount(1),n=n.substring(1)),n[0]==="%"){let s=n.length,l=n.indexOf("#");for(;l!==-1;){const u=n[l-1];if(u===" "||u===" "){s=l-1;break}else l=n.indexOf("#",l+1)}for(;;){const u=n[s-1];if(u===" "||u===" ")s-=1;else break}const o=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(n.length-o),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(n.length-s),yield*this.pushNewline(),"stream"}return yield tv,yield*this.parseLineStart()}*parseLineStart(){const n=this.charAt(0);if(!n&&!this.atEnd)return this.setNext("line-start");if(n==="-"||n==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const s=this.peek(3);if((s==="---"||s==="...")&&Zn(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&&!Zn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[n,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((n==="-"||n==="?"||n===":")&&Zn(s)){const l=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=l,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const n=this.getLine();if(n===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(n[s]){case"#":yield*this.pushCount(n.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(Pd),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(n.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,s,l=-1;do n=yield*this.pushNewline(),n>0?(s=yield*this.pushSpaces(!1),this.indentValue=l=s):s=0,s+=yield*this.pushSpaces(!0);while(n+s>0);const o=this.getLine();if(o===null)return this.setNext("flow");if((l!==-1&&l<this.indentNext&&o[0]!=="#"||l===0&&(o.startsWith("---")||o.startsWith("..."))&&Zn(o[3]))&&!(l===this.indentNext-1&&this.flowLevel===1&&(o[0]==="]"||o[0]==="}")))return this.flowLevel=0,yield nv,yield*this.parseLineStart();let u=0;for(;o[u]===",";)u+=yield*this.pushCount(1),u+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(u+=yield*this.pushIndicators(),o[u]){case void 0:return"flow";case"#":return yield*this.pushCount(o.length-u),"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(Pd),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||Zn(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 n=this.charAt(0);let s=this.buffer.indexOf(n,this.pos+1);if(n==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let u=0;for(;this.buffer[s-1-u]==="\\";)u+=1;if(u%2===0)break;s=this.buffer.indexOf('"',s+1)}const l=this.buffer.substring(0,s);let o=l.indexOf(`
124
+ `,this.pos);if(o!==-1){for(;o!==-1;){const u=this.continueScalar(o+1);if(u===-1)break;o=l.indexOf(`
125
+ `,u)}o!==-1&&(s=o-(l[o-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let n=this.pos;for(;;){const s=this.buffer[++n];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=>Zn(s)||s==="#")}*parseBlockScalar(){let n=this.pos-1,s=0,l;e:for(let u=this.pos;l=this.buffer[u];++u)switch(l){case" ":s+=1;break;case`
126
+ `:n=u,s=0;break;case"\r":{const d=this.buffer[u+1];if(!d&&!this.atEnd)return this.setNext("block-scalar");if(d===`
127
+ `)break}default:break e}if(!l&&!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 u=this.continueScalar(n+1);if(u===-1)break;n=this.buffer.indexOf(`
128
+ `,u)}while(n!==-1);if(n===-1){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let o=n+1;for(l=this.buffer[o];l===" ";)l=this.buffer[++o];if(l===" "){for(;l===" "||l===" "||l==="\r"||l===`
129
+ `;)l=this.buffer[++o];n=o-1}else if(!this.blockScalarKeep)do{let u=n-1,d=this.buffer[u];d==="\r"&&(d=this.buffer[--u]);const m=u;for(;d===" ";)d=this.buffer[--u];if(d===`
130
+ `&&u>=this.pos&&u+1+s>m)n=u;else break}while(!0);return yield mf,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let s=this.pos-1,l=this.pos-1,o;for(;o=this.buffer[++l];)if(o===":"){const u=this.buffer[l+1];if(Zn(u)||n&&Eo.has(u))break;s=l}else if(Zn(o)){let u=this.buffer[l+1];if(o==="\r"&&(u===`
131
+ `?(l+=1,o=`
132
+ `,u=this.buffer[l+1]):s=l),u==="#"||n&&Eo.has(u))break;if(o===`
133
+ `){const d=this.continueScalar(l+1);if(d===-1)break;l=Math.max(l,d-2)}}else{if(n&&Eo.has(o))break;s=l}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield mf,yield*this.pushToIndex(s+1,!0),n?"flow":"doc")}*pushCount(n){return n>0?(yield this.buffer.substr(this.pos,n),this.pos+=n,n):0}*pushToIndex(n,s){const l=this.buffer.slice(this.pos,n);return l?(yield l,this.pos+=l.length,l.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(Pd))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const n=this.flowLevel>0,s=this.charAt(1);if(Zn(s)||n&&Eo.has(s))return n?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 n=this.pos+2,s=this.buffer[n];for(;!Zn(s)&&s!==">";)s=this.buffer[++n];return yield*this.pushToIndex(s===">"?n+1:n,!1)}else{let n=this.pos+1,s=this.buffer[n];for(;s;)if(Ej.has(s))s=this.buffer[++n];else if(s==="%"&&vy.has(this.buffer[n+1])&&vy.has(this.buffer[n+2]))s=this.buffer[n+=3];else break;return yield*this.pushToIndex(n,!1)}}*pushNewline(){const n=this.buffer[this.pos];return n===`
134
+ `?yield*this.pushCount(1):n==="\r"&&this.charAt(1)===`
135
+ `?yield*this.pushCount(2):0}*pushSpaces(n){let s=this.pos-1,l;do l=this.buffer[++s];while(l===" "||n&&l===" ");const o=s-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=s),o}*pushUntil(n){let s=this.pos,l=this.buffer[s];for(;!n(l);)l=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class Oj{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let s=0,l=this.lineStarts.length;for(;s<l;){const u=s+l>>1;this.lineStarts[u]<n?s=u+1:l=u}if(this.lineStarts[s]===n)return{line:s+1,col:1};if(s===0)return{line:0,col:n};const o=this.lineStarts[s-1];return{line:s,col:n-o+1}}}}function os(e,n){for(let s=0;s<e.length;++s)if(e[s].type===n)return!0;return!1}function by(e){for(let n=0;n<e.length;++n)switch(e[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function iv(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 Ao(e){switch(e.type){case"document":return e.start;case"block-map":{const n=e.items[e.items.length-1];return n.sep??n.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Aa(e){if(e.length===0)return[];let n=e.length;e:for(;--n>=0;)switch(e[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++n]?.type==="space";);return e.splice(n,e.length)}function xy(e){if(e.start.type==="flow-seq-start")for(const n of e.items)n.sep&&!n.value&&!os(n.start,"explicit-key-ind")&&!os(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,iv(n.value)?n.value.end?Array.prototype.push.apply(n.value.end,n.sep):n.value.end=n.sep:Array.prototype.push.apply(n.start,n.sep),delete n.sep)}class Dj{constructor(n){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Tj,this.onNewLine=n}*parse(n,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const l of this.lexer.lex(n,s))yield*this.next(l);s||(yield*this.end())}*next(n){if(this.source=n,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=n.length;return}const s=Cj(n);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+n.length);break;case"space":this.atNewLine&&n[0]===" "&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const l=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:l,source:n}),this.offset+=n.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 n=this.peek(1);if(this.type==="doc-end"&&n?.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(!n)return yield*this.stream();switch(n.type){case"document":return yield*this.document(n);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(n);case"block-scalar":return yield*this.blockScalar(n);case"block-map":return yield*this.blockMap(n);case"block-seq":return yield*this.blockSequence(n);case"flow-collection":return yield*this.flowCollection(n);case"doc-end":return yield*this.documentEnd(n)}yield*this.pop()}peek(n){return this.stack[this.stack.length-n]}*pop(n){const s=n??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 l=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in l?l.indent:0:s.type==="flow-collection"&&l.type==="document"&&(s.indent=0),s.type==="flow-collection"&&xy(s),l.type){case"document":l.value=s;break;case"block-scalar":l.props.push(s);break;case"block-map":{const o=l.items[l.items.length-1];if(o.value){l.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=s;else{Object.assign(o,{key:s,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{const o=l.items[l.items.length-1];o.value?l.items.push({start:[],value:s}):o.value=s;break}case"flow-collection":{const o=l.items[l.items.length-1];!o||o.value?l.items.push({start:[],key:s,sep:[]}):o.sep?o.value=s:Object.assign(o,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((l.type==="document"||l.type==="block-map"||l.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const o=s.items[s.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&by(o.start)===-1&&(s.indent===0||o.start.every(u=>u.type!=="comment"||u.indent<s.indent))&&(l.type==="document"?l.end=o.start:l.items.push({start:o.start}),s.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const n={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&n.start.push(this.sourceToken),this.stack.push(n);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(n){if(n.value)return yield*this.lineEnd(n);switch(this.type){case"doc-start":{by(n.start)!==-1?(yield*this.pop(),yield*this.step()):n.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":n.start.push(this.sourceToken);return}const s=this.startBlockValue(n);s?this.stack.push(s):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(n){if(this.type==="map-value-ind"){const s=Ao(this.peek(2)),l=Aa(s);let o;n.end?(o=n.end,o.push(this.sourceToken),delete n.end):o=[this.sourceToken];const u={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:l,key:n,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(n)}*blockScalar(n){switch(this.type){case"space":case"comment":case"newline":n.props.push(this.sourceToken);return;case"scalar":if(n.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let s=this.source.indexOf(`
136
+ `)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
137
+ `,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(n){const s=n.items[n.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const l="end"in s.value?s.value.end:void 0;(Array.isArray(l)?l[l.length-1]:void 0)?.type==="comment"?l?.push(this.sourceToken):n.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)n.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,n.indent)){const o=n.items[n.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,s.start),o.push(this.sourceToken),n.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=n.indent){const l=!this.onKeyLine&&this.indent===n.indent,o=l&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let u=[];if(o&&s.sep&&!s.value){const d=[];for(let m=0;m<s.sep.length;++m){const g=s.sep[m];switch(g.type){case"newline":d.push(m);break;case"space":break;case"comment":g.indent>n.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(u=s.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":o||s.value?(u.push(this.sourceToken),n.items.push({start:u}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):o||s.value?(u.push(this.sourceToken),n.items.push({start:u,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)n.items.push({start:[],key:null,sep:[this.sourceToken]});else if(os(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]});else if(iv(s.key)&&!os(s.sep,"newline")){const d=Aa(s.start),m=s.key,g=s.sep;g.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:m,sep:g}]})}else u.length>0?s.sep=s.sep.concat(u,this.sourceToken):s.sep.push(this.sourceToken);else if(os(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const d=Aa(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||o?n.items.push({start:u,key:null,sep:[this.sourceToken]}):os(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);o||s.value?(n.items.push({start:u,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(n);if(d){if(d.type==="block-seq"){if(!s.explicitKey&&s.sep&&!os(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 l&&n.items.push({start:u});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(n){const s=n.items[n.items.length-1];switch(this.type){case"newline":if(s.value){const l="end"in s.value?s.value.end:void 0;(Array.isArray(l)?l[l.length-1]:void 0)?.type==="comment"?l?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)n.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,n.indent)){const o=n.items[n.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,s.start),o.push(this.sourceToken),n.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=n.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==n.indent)break;s.value||os(s.start,"seq-item-ind")?n.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>n.indent){const l=this.startBlockValue(n);if(l){this.stack.push(l);return}}yield*this.pop(),yield*this.step()}*flowCollection(n){const s=n.items[n.items.length-1];if(this.type==="flow-error-end"){let l;do yield*this.pop(),l=this.peek(1);while(l?.type==="flow-collection")}else if(n.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?n.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?n.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?n.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);!s||s.value?n.items.push({start:[],key:o,sep:[]}):s.sep?this.stack.push(o):Object.assign(s,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":n.end.push(this.sourceToken);return}const l=this.startBlockValue(n);l?this.stack.push(l):(yield*this.pop(),yield*this.step())}else{const l=this.peek(2);if(l.type==="block-map"&&(this.type==="map-value-ind"&&l.indent===n.indent||this.type==="newline"&&!l.items[l.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&l.type!=="flow-collection"){const o=Ao(l),u=Aa(o);xy(n);const d=n.end.splice(1,n.end.length);d.push(this.sourceToken);const m={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:u,key:n,sep:d}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=m}else yield*this.lineEnd(n)}}flowScalar(n){if(this.onNewLine){let s=this.source.indexOf(`
138
+ `)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
139
+ `,s)+1}return{type:n,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(n){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=Ao(n),l=Aa(s);return l.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=Ao(n),l=Aa(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,s){return this.type!=="comment"||this.indent<=s?!1:n.every(l=>l.type==="newline"||l.type==="space")}*documentEnd(n){this.type!=="doc-mode"&&(n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(n){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:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Rj(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new Oj||null,prettyErrors:n}}function Mj(e,n={}){const{lineCounter:s,prettyErrors:l}=Rj(n),o=new Dj(s?.addNewLine),u=new _j(n),d=Array.from(u.compose(o.parse(e)));if(l&&s)for(const m of d)m.errors.forEach(py(e,s)),m.warnings.forEach(py(e,s));return d.length>0?d:Object.assign([],{empty:!0},u.streamInfo())}function ds(e,n,{checkForDefaultPrevented:s=!0}={}){return function(o){if(e?.(o),s===!1||!o.defaultPrevented)return n?.(o)}}function Sy(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Hf(...e){return n=>{let s=!1;const l=e.map(o=>{const u=Sy(o,n);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let o=0;o<l.length;o++){const u=l[o];typeof u=="function"?u():Sy(e[o],null)}}}}function Gs(...e){return x.useCallback(Hf(...e),e)}function Lj(e,n){const s=x.createContext(n),l=u=>{const{children:d,...m}=u,g=x.useMemo(()=>m,Object.values(m));return c.jsx(s.Provider,{value:g,children:d})};l.displayName=e+"Provider";function o(u){const d=x.useContext(s);if(d)return d;if(n!==void 0)return n;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[l,o]}function Uj(e,n=[]){let s=[];function l(u,d){const m=x.createContext(d),g=s.length;s=[...s,d];const p=v=>{const{scope:w,children:N,...z}=v,j=w?.[e]?.[g]||m,k=x.useMemo(()=>z,Object.values(z));return c.jsx(j.Provider,{value:k,children:N})};p.displayName=u+"Provider";function b(v,w){const N=w?.[e]?.[g]||m,z=x.useContext(N);if(z)return z;if(d!==void 0)return d;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[p,b]}const o=()=>{const u=s.map(d=>x.createContext(d));return function(m){const g=m?.[e]||u;return x.useMemo(()=>({[`__scope${e}`]:{...m,[e]:g}}),[m,g])}};return o.scopeName=e,[l,$j(o,...n)]}function $j(...e){const n=e[0];if(e.length===1)return n;const s=()=>{const l=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const d=l.reduce((m,{useScope:g,scopeName:p})=>{const v=g(u)[`__scope${p}`];return{...m,...v}},{});return x.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return s.scopeName=n.scopeName,s}var Fl=globalThis?.document?x.useLayoutEffect:()=>{},Bj=_f[" useId ".trim().toString()]||(()=>{}),Ij=0;function Qd(e){const[n,s]=x.useState(Bj());return Fl(()=>{s(l=>l??String(Ij++))},[e]),e||(n?`radix-${n}`:"")}var qj=_f[" useInsertionEffect ".trim().toString()]||Fl;function Zj({prop:e,defaultProp:n,onChange:s=()=>{},caller:l}){const[o,u,d]=Hj({defaultProp:n,onChange:s}),m=e!==void 0,g=m?e:o;{const b=x.useRef(e!==void 0);x.useEffect(()=>{const v=b.current;v!==m&&console.warn(`${l} is changing from ${v?"controlled":"uncontrolled"} to ${m?"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=m},[m,l])}const p=x.useCallback(b=>{if(m){const v=Gj(b)?b(e):b;v!==e&&d.current?.(v)}else u(b)},[m,e,u,d]);return[g,p]}function Hj({defaultProp:e,onChange:n}){const[s,l]=x.useState(e),o=x.useRef(s),u=x.useRef(n);return qj(()=>{u.current=n},[n]),x.useEffect(()=>{o.current!==s&&(u.current?.(s),o.current=s)},[s,o]),[s,l,u]}function Gj(e){return typeof e=="function"}var sv=S0();const Kj=x0(sv);function av(e){const n=Yj(e),s=x.forwardRef((l,o)=>{const{children:u,...d}=l,m=x.Children.toArray(u),g=m.find(Pj);if(g){const p=g.props.children,b=m.map(v=>v===g?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:v);return c.jsx(n,{...d,ref:o,children:x.isValidElement(p)?x.cloneElement(p,void 0,b):null})}return c.jsx(n,{...d,ref:o,children:u})});return s.displayName=`${e}.Slot`,s}function Yj(e){const n=x.forwardRef((s,l)=>{const{children:o,...u}=s;if(x.isValidElement(o)){const d=Xj(o),m=Qj(u,o.props);return o.type!==x.Fragment&&(m.ref=l?Hf(l,d):d),x.cloneElement(o,m)}return x.Children.count(o)>1?x.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Vj=Symbol("radix.slottable");function Pj(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vj}function Qj(e,n){const s={...n};for(const l in n){const o=e[l],u=n[l];/^on[A-Z]/.test(l)?o&&u?s[l]=(...m)=>{const g=u(...m);return o(...m),g}:o&&(s[l]=o):l==="style"?s[l]={...o,...u}:l==="className"&&(s[l]=[o,u].filter(Boolean).join(" "))}return{...e,...s}}function Xj(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=n&&"isReactWarning"in n&&n.isReactWarning;return s?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=n&&"isReactWarning"in n&&n.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Jj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ti=Jj.reduce((e,n)=>{const s=av(`Primitive.${n}`),l=x.forwardRef((o,u)=>{const{asChild:d,...m}=o,g=d?s:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(g,{...m,ref:u})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{});function Fj(e,n){e&&sv.flushSync(()=>e.dispatchEvent(n))}function Wl(e){const n=x.useRef(e);return x.useEffect(()=>{n.current=e}),x.useMemo(()=>(...s)=>n.current?.(...s),[])}function Wj(e,n=globalThis?.document){const s=Wl(e);x.useEffect(()=>{const l=o=>{o.key==="Escape"&&s(o)};return n.addEventListener("keydown",l,{capture:!0}),()=>n.removeEventListener("keydown",l,{capture:!0})},[s,n])}var eN="DismissableLayer",pf="dismissableLayer.update",tN="dismissableLayer.pointerDownOutside",nN="dismissableLayer.focusOutside",wy,lv=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rv=x.forwardRef((e,n)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:l,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:d,onDismiss:m,...g}=e,p=x.useContext(lv),[b,v]=x.useState(null),w=b?.ownerDocument??globalThis?.document,[,N]=x.useState({}),z=Gs(n,V=>v(V)),j=Array.from(p.layers),[k]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),A=j.indexOf(k),E=b?j.indexOf(b):-1,O=p.layersWithOutsidePointerEventsDisabled.size>0,D=E>=A,L=aN(V=>{const R=V.target,Q=[...p.branches].some(Se=>Se.contains(R));!D||Q||(o?.(V),d?.(V),V.defaultPrevented||m?.())},w),H=lN(V=>{const R=V.target;[...p.branches].some(Se=>Se.contains(R))||(u?.(V),d?.(V),V.defaultPrevented||m?.())},w);return Wj(V=>{E===p.layers.size-1&&(l?.(V),!V.defaultPrevented&&m&&(V.preventDefault(),m()))},w),x.useEffect(()=>{if(b)return s&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(wy=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(b)),p.layers.add(b),jy(),()=>{s&&p.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=wy)}},[b,w,s,p]),x.useEffect(()=>()=>{b&&(p.layers.delete(b),p.layersWithOutsidePointerEventsDisabled.delete(b),jy())},[b,p]),x.useEffect(()=>{const V=()=>N({});return document.addEventListener(pf,V),()=>document.removeEventListener(pf,V)},[]),c.jsx(Ti.div,{...g,ref:z,style:{pointerEvents:O?D?"auto":"none":void 0,...e.style},onFocusCapture:ds(e.onFocusCapture,H.onFocusCapture),onBlurCapture:ds(e.onBlurCapture,H.onBlurCapture),onPointerDownCapture:ds(e.onPointerDownCapture,L.onPointerDownCapture)})});rv.displayName=eN;var iN="DismissableLayerBranch",sN=x.forwardRef((e,n)=>{const s=x.useContext(lv),l=x.useRef(null),o=Gs(n,l);return x.useEffect(()=>{const u=l.current;if(u)return s.branches.add(u),()=>{s.branches.delete(u)}},[s.branches]),c.jsx(Ti.div,{...e,ref:o})});sN.displayName=iN;function aN(e,n=globalThis?.document){const s=Wl(e),l=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const u=m=>{if(m.target&&!l.current){let g=function(){ov(tN,s,p,{discrete:!0})};const p={originalEvent:m};m.pointerType==="touch"?(n.removeEventListener("click",o.current),o.current=g,n.addEventListener("click",o.current,{once:!0})):g()}else n.removeEventListener("click",o.current);l.current=!1},d=window.setTimeout(()=>{n.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),n.removeEventListener("pointerdown",u),n.removeEventListener("click",o.current)}},[n,s]),{onPointerDownCapture:()=>l.current=!0}}function lN(e,n=globalThis?.document){const s=Wl(e),l=x.useRef(!1);return x.useEffect(()=>{const o=u=>{u.target&&!l.current&&ov(nN,s,{originalEvent:u},{discrete:!1})};return n.addEventListener("focusin",o),()=>n.removeEventListener("focusin",o)},[n,s]),{onFocusCapture:()=>l.current=!0,onBlurCapture:()=>l.current=!1}}function jy(){const e=new CustomEvent(pf);document.dispatchEvent(e)}function ov(e,n,s,{discrete:l}){const o=s.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});n&&o.addEventListener(e,n,{once:!0}),l?Fj(o,u):o.dispatchEvent(u)}var Xd="focusScope.autoFocusOnMount",Jd="focusScope.autoFocusOnUnmount",Ny={bubbles:!1,cancelable:!0},rN="FocusScope",cv=x.forwardRef((e,n)=>{const{loop:s=!1,trapped:l=!1,onMountAutoFocus:o,onUnmountAutoFocus:u,...d}=e,[m,g]=x.useState(null),p=Wl(o),b=Wl(u),v=x.useRef(null),w=Gs(n,j=>g(j)),N=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(l){let j=function(O){if(N.paused||!m)return;const D=O.target;m.contains(D)?v.current=D:rs(v.current,{select:!0})},k=function(O){if(N.paused||!m)return;const D=O.relatedTarget;D!==null&&(m.contains(D)||rs(v.current,{select:!0}))},A=function(O){if(document.activeElement===document.body)for(const L of O)L.removedNodes.length>0&&rs(m)};document.addEventListener("focusin",j),document.addEventListener("focusout",k);const E=new MutationObserver(A);return m&&E.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",k),E.disconnect()}}},[l,m,N.paused]),x.useEffect(()=>{if(m){zy.add(N);const j=document.activeElement;if(!m.contains(j)){const A=new CustomEvent(Xd,Ny);m.addEventListener(Xd,p),m.dispatchEvent(A),A.defaultPrevented||(oN(hN(uv(m)),{select:!0}),document.activeElement===j&&rs(m))}return()=>{m.removeEventListener(Xd,p),setTimeout(()=>{const A=new CustomEvent(Jd,Ny);m.addEventListener(Jd,b),m.dispatchEvent(A),A.defaultPrevented||rs(j??document.body,{select:!0}),m.removeEventListener(Jd,b),zy.remove(N)},0)}}},[m,p,b,N]);const z=x.useCallback(j=>{if(!s&&!l||N.paused)return;const k=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,A=document.activeElement;if(k&&A){const E=j.currentTarget,[O,D]=cN(E);O&&D?!j.shiftKey&&A===D?(j.preventDefault(),s&&rs(O,{select:!0})):j.shiftKey&&A===O&&(j.preventDefault(),s&&rs(D,{select:!0})):A===E&&j.preventDefault()}},[s,l,N.paused]);return c.jsx(Ti.div,{tabIndex:-1,...d,ref:w,onKeyDown:z})});cv.displayName=rN;function oN(e,{select:n=!1}={}){const s=document.activeElement;for(const l of e)if(rs(l,{select:n}),document.activeElement!==s)return}function cN(e){const n=uv(e),s=ky(n,e),l=ky(n.reverse(),e);return[s,l]}function uv(e){const n=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const o=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||o?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)n.push(s.currentNode);return n}function ky(e,n){for(const s of e)if(!uN(s,{upTo:n}))return s}function uN(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function dN(e){return e instanceof HTMLInputElement&&"select"in e}function rs(e,{select:n=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&dN(e)&&n&&e.select()}}var zy=fN();function fN(){let e=[];return{add(n){const s=e[0];n!==s&&s?.pause(),e=_y(e,n),e.unshift(n)},remove(n){e=_y(e,n),e[0]?.resume()}}}function _y(e,n){const s=[...e],l=s.indexOf(n);return l!==-1&&s.splice(l,1),s}function hN(e){return e.filter(n=>n.tagName!=="A")}var mN="Portal",dv=x.forwardRef((e,n)=>{const{container:s,...l}=e,[o,u]=x.useState(!1);Fl(()=>u(!0),[]);const d=s||o&&globalThis?.document?.body;return d?Kj.createPortal(c.jsx(Ti.div,{...l,ref:n}),d):null});dv.displayName=mN;function pN(e,n){return x.useReducer((s,l)=>n[s][l]??s,e)}var yc=e=>{const{present:n,children:s}=e,l=gN(n),o=typeof s=="function"?s({present:l.isPresent}):x.Children.only(s),u=Gs(l.ref,yN(o));return typeof s=="function"||l.isPresent?x.cloneElement(o,{ref:u}):null};yc.displayName="Presence";function gN(e){const[n,s]=x.useState(),l=x.useRef(null),o=x.useRef(e),u=x.useRef("none"),d=e?"mounted":"unmounted",[m,g]=pN(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const p=To(l.current);u.current=m==="mounted"?p:"none"},[m]),Fl(()=>{const p=l.current,b=o.current;if(b!==e){const w=u.current,N=To(p);e?g("MOUNT"):N==="none"||p?.display==="none"?g("UNMOUNT"):g(b&&w!==N?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,g]),Fl(()=>{if(n){let p;const b=n.ownerDocument.defaultView??window,v=N=>{const j=To(l.current).includes(CSS.escape(N.animationName));if(N.target===n&&j&&(g("ANIMATION_END"),!o.current)){const k=n.style.animationFillMode;n.style.animationFillMode="forwards",p=b.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=k)})}},w=N=>{N.target===n&&(u.current=To(l.current))};return n.addEventListener("animationstart",w),n.addEventListener("animationcancel",v),n.addEventListener("animationend",v),()=>{b.clearTimeout(p),n.removeEventListener("animationstart",w),n.removeEventListener("animationcancel",v),n.removeEventListener("animationend",v)}}else g("ANIMATION_END")},[n,g]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:x.useCallback(p=>{l.current=p?getComputedStyle(p):null,s(p)},[])}}function To(e){return e?.animationName||"none"}function yN(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=n&&"isReactWarning"in n&&n.isReactWarning;return s?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=n&&"isReactWarning"in n&&n.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Fd=0;function vN(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cy()),document.body.insertAdjacentElement("beforeend",e[1]??Cy()),Fd++,()=>{Fd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Fd--}},[])}function Cy(){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 si=function(){return si=Object.assign||function(n){for(var s,l=1,o=arguments.length;l<o;l++){s=arguments[l];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(n[u]=s[u])}return n},si.apply(this,arguments)};function fv(e,n){var s={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&n.indexOf(l)<0&&(s[l]=e[l]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,l=Object.getOwnPropertySymbols(e);o<l.length;o++)n.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(s[l[o]]=e[l[o]]);return s}function bN(e,n,s){if(s||arguments.length===2)for(var l=0,o=n.length,u;l<o;l++)(u||!(l in n))&&(u||(u=Array.prototype.slice.call(n,0,l)),u[l]=n[l]);return e.concat(u||Array.prototype.slice.call(n))}var Yo="right-scroll-bar-position",Vo="width-before-scroll-bar",xN="with-scroll-bars-hidden",SN="--removed-body-scroll-bar-size";function Wd(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function wN(e,n){var s=x.useState(function(){return{value:e,callback:n,facade:{get current(){return s.value},set current(l){var o=s.value;o!==l&&(s.value=l,s.callback(l,o))}}}})[0];return s.callback=n,s.facade}var jN=typeof window<"u"?x.useLayoutEffect:x.useEffect,Ey=new WeakMap;function NN(e,n){var s=wN(null,function(l){return e.forEach(function(o){return Wd(o,l)})});return jN(function(){var l=Ey.get(s);if(l){var o=new Set(l),u=new Set(e),d=s.current;o.forEach(function(m){u.has(m)||Wd(m,null)}),u.forEach(function(m){o.has(m)||Wd(m,d)})}Ey.set(s,e)},[e]),s}function kN(e){return e}function zN(e,n){n===void 0&&(n=kN);var s=[],l=!1,o={read:function(){if(l)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(u){var d=n(u,l);return s.push(d),function(){s=s.filter(function(m){return m!==d})}},assignSyncMedium:function(u){for(l=!0;s.length;){var d=s;s=[],d.forEach(u)}s={push:function(m){return u(m)},filter:function(){return s}}},assignMedium:function(u){l=!0;var d=[];if(s.length){var m=s;s=[],m.forEach(u),d=s}var g=function(){var b=d;d=[],b.forEach(u)},p=function(){return Promise.resolve().then(g)};p(),s={push:function(b){d.push(b),p()},filter:function(b){return d=d.filter(b),s}}}};return o}function _N(e){e===void 0&&(e={});var n=zN(null);return n.options=si({async:!0,ssr:!1},e),n}var hv=function(e){var n=e.sideCar,s=fv(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=n.read();if(!l)throw new Error("Sidecar medium not found");return x.createElement(l,si({},s))};hv.isSideCarExport=!0;function CN(e,n){return e.useMedium(n),hv}var mv=_N(),ef=function(){},vc=x.forwardRef(function(e,n){var s=x.useRef(null),l=x.useState({onScrollCapture:ef,onWheelCapture:ef,onTouchMoveCapture:ef}),o=l[0],u=l[1],d=e.forwardProps,m=e.children,g=e.className,p=e.removeScrollBar,b=e.enabled,v=e.shards,w=e.sideCar,N=e.noRelative,z=e.noIsolation,j=e.inert,k=e.allowPinchZoom,A=e.as,E=A===void 0?"div":A,O=e.gapMode,D=fv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=w,H=NN([s,n]),V=si(si({},D),o);return x.createElement(x.Fragment,null,b&&x.createElement(L,{sideCar:mv,removeScrollBar:p,shards:v,noRelative:N,noIsolation:z,inert:j,setCallbacks:u,allowPinchZoom:!!k,lockRef:s,gapMode:O}),d?x.cloneElement(x.Children.only(m),si(si({},V),{ref:H})):x.createElement(E,si({},V,{className:g,ref:H}),m))});vc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vc.classNames={fullWidth:Vo,zeroRight:Yo};var EN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AN(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=EN();return n&&e.setAttribute("nonce",n),e}function TN(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function ON(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var DN=function(){var e=0,n=null;return{add:function(s){e==0&&(n=AN())&&(TN(n,s),ON(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},RN=function(){var e=DN();return function(n,s){x.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&s])}},pv=function(){var e=RN(),n=function(s){var l=s.styles,o=s.dynamic;return e(l,o),null};return n},MN={left:0,top:0,right:0,gap:0},tf=function(e){return parseInt(e||"",10)||0},LN=function(e){var n=window.getComputedStyle(document.body),s=n[e==="padding"?"paddingLeft":"marginLeft"],l=n[e==="padding"?"paddingTop":"marginTop"],o=n[e==="padding"?"paddingRight":"marginRight"];return[tf(s),tf(l),tf(o)]},UN=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return MN;var n=LN(e),s=document.documentElement.clientWidth,l=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,l-s+n[2]-n[0])}},$N=pv(),qa="data-scroll-locked",BN=function(e,n,s,l){var o=e.left,u=e.top,d=e.right,m=e.gap;return s===void 0&&(s="margin"),`
140
+ .`.concat(xN,` {
141
+ overflow: hidden `).concat(l,`;
142
+ padding-right: `).concat(m,"px ").concat(l,`;
143
+ }
144
+ body[`).concat(qa,`] {
145
+ overflow: hidden `).concat(l,`;
146
+ overscroll-behavior: contain;
147
+ `).concat([n&&"position: relative ".concat(l,";"),s==="margin"&&`
148
+ padding-left: `.concat(o,`px;
149
+ padding-top: `).concat(u,`px;
150
+ padding-right: `).concat(d,`px;
151
+ margin-left:0;
152
+ margin-top:0;
153
+ margin-right: `).concat(m,"px ").concat(l,`;
154
+ `),s==="padding"&&"padding-right: ".concat(m,"px ").concat(l,";")].filter(Boolean).join(""),`
155
+ }
156
+
157
+ .`).concat(Yo,` {
158
+ right: `).concat(m,"px ").concat(l,`;
159
+ }
160
+
161
+ .`).concat(Vo,` {
162
+ margin-right: `).concat(m,"px ").concat(l,`;
163
+ }
164
+
165
+ .`).concat(Yo," .").concat(Yo,` {
166
+ right: 0 `).concat(l,`;
167
+ }
168
+
169
+ .`).concat(Vo," .").concat(Vo,` {
170
+ margin-right: 0 `).concat(l,`;
171
+ }
172
+
173
+ body[`).concat(qa,`] {
174
+ `).concat(SN,": ").concat(m,`px;
175
+ }
176
+ `)},Ay=function(){var e=parseInt(document.body.getAttribute(qa)||"0",10);return isFinite(e)?e:0},IN=function(){x.useEffect(function(){return document.body.setAttribute(qa,(Ay()+1).toString()),function(){var e=Ay()-1;e<=0?document.body.removeAttribute(qa):document.body.setAttribute(qa,e.toString())}},[])},qN=function(e){var n=e.noRelative,s=e.noImportant,l=e.gapMode,o=l===void 0?"margin":l;IN();var u=x.useMemo(function(){return UN(o)},[o]);return x.createElement($N,{styles:BN(u,!n,o,s?"":"!important")})},gf=!1;if(typeof window<"u")try{var Oo=Object.defineProperty({},"passive",{get:function(){return gf=!0,!0}});window.addEventListener("test",Oo,Oo),window.removeEventListener("test",Oo,Oo)}catch{gf=!1}var Ta=gf?{passive:!1}:!1,ZN=function(e){return e.tagName==="TEXTAREA"},gv=function(e,n){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[n]!=="hidden"&&!(s.overflowY===s.overflowX&&!ZN(e)&&s[n]==="visible")},HN=function(e){return gv(e,"overflowY")},GN=function(e){return gv(e,"overflowX")},Ty=function(e,n){var s=n.ownerDocument,l=n;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var o=yv(e,l);if(o){var u=vv(e,l),d=u[1],m=u[2];if(d>m)return!0}l=l.parentNode}while(l&&l!==s.body);return!1},KN=function(e){var n=e.scrollTop,s=e.scrollHeight,l=e.clientHeight;return[n,s,l]},YN=function(e){var n=e.scrollLeft,s=e.scrollWidth,l=e.clientWidth;return[n,s,l]},yv=function(e,n){return e==="v"?HN(n):GN(n)},vv=function(e,n){return e==="v"?KN(n):YN(n)},VN=function(e,n){return e==="h"&&n==="rtl"?-1:1},PN=function(e,n,s,l,o){var u=VN(e,window.getComputedStyle(n).direction),d=u*l,m=s.target,g=n.contains(m),p=!1,b=d>0,v=0,w=0;do{if(!m)break;var N=vv(e,m),z=N[0],j=N[1],k=N[2],A=j-k-u*z;(z||A)&&yv(e,m)&&(v+=A,w+=z);var E=m.parentNode;m=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!g&&m!==document.body||g&&(n.contains(m)||n===m));return(b&&Math.abs(v)<1||!b&&Math.abs(w)<1)&&(p=!0),p},Do=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Oy=function(e){return[e.deltaX,e.deltaY]},Dy=function(e){return e&&"current"in e?e.current:e},QN=function(e,n){return e[0]===n[0]&&e[1]===n[1]},XN=function(e){return`
177
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
178
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
179
+ `)},JN=0,Oa=[];function FN(e){var n=x.useRef([]),s=x.useRef([0,0]),l=x.useRef(),o=x.useState(JN++)[0],u=x.useState(pv)[0],d=x.useRef(e);x.useEffect(function(){d.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var j=bN([e.lockRef.current],(e.shards||[]).map(Dy),!0).filter(Boolean);return j.forEach(function(k){return k.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),j.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var m=x.useCallback(function(j,k){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!d.current.allowPinchZoom;var A=Do(j),E=s.current,O="deltaX"in j?j.deltaX:E[0]-A[0],D="deltaY"in j?j.deltaY:E[1]-A[1],L,H=j.target,V=Math.abs(O)>Math.abs(D)?"h":"v";if("touches"in j&&V==="h"&&H.type==="range")return!1;var R=window.getSelection(),Q=R&&R.anchorNode,Se=Q?Q===H||Q.contains(H):!1;if(Se)return!1;var ae=Ty(V,H);if(!ae)return!0;if(ae?L=V:(L=V==="v"?"h":"v",ae=Ty(V,H)),!ae)return!1;if(!l.current&&"changedTouches"in j&&(O||D)&&(l.current=L),!L)return!0;var fe=l.current||L;return PN(fe,k,j,fe==="h"?O:D)},[]),g=x.useCallback(function(j){var k=j;if(!(!Oa.length||Oa[Oa.length-1]!==u)){var A="deltaY"in k?Oy(k):Do(k),E=n.current.filter(function(L){return L.name===k.type&&(L.target===k.target||k.target===L.shadowParent)&&QN(L.delta,A)})[0];if(E&&E.should){k.cancelable&&k.preventDefault();return}if(!E){var O=(d.current.shards||[]).map(Dy).filter(Boolean).filter(function(L){return L.contains(k.target)}),D=O.length>0?m(k,O[0]):!d.current.noIsolation;D&&k.cancelable&&k.preventDefault()}}},[]),p=x.useCallback(function(j,k,A,E){var O={name:j,delta:k,target:A,should:E,shadowParent:WN(A)};n.current.push(O),setTimeout(function(){n.current=n.current.filter(function(D){return D!==O})},1)},[]),b=x.useCallback(function(j){s.current=Do(j),l.current=void 0},[]),v=x.useCallback(function(j){p(j.type,Oy(j),j.target,m(j,e.lockRef.current))},[]),w=x.useCallback(function(j){p(j.type,Do(j),j.target,m(j,e.lockRef.current))},[]);x.useEffect(function(){return Oa.push(u),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:w}),document.addEventListener("wheel",g,Ta),document.addEventListener("touchmove",g,Ta),document.addEventListener("touchstart",b,Ta),function(){Oa=Oa.filter(function(j){return j!==u}),document.removeEventListener("wheel",g,Ta),document.removeEventListener("touchmove",g,Ta),document.removeEventListener("touchstart",b,Ta)}},[]);var N=e.removeScrollBar,z=e.inert;return x.createElement(x.Fragment,null,z?x.createElement(u,{styles:XN(o)}):null,N?x.createElement(qN,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function WN(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const e1=CN(mv,FN);var bv=x.forwardRef(function(e,n){return x.createElement(vc,si({},e,{ref:n,sideCar:e1}))});bv.classNames=vc.classNames;var t1=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Da=new WeakMap,Ro=new WeakMap,Mo={},nf=0,xv=function(e){return e&&(e.host||xv(e.parentNode))},n1=function(e,n){return n.map(function(s){if(e.contains(s))return s;var l=xv(s);return l&&e.contains(l)?l:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},i1=function(e,n,s,l){var o=n1(n,Array.isArray(e)?e:[e]);Mo[s]||(Mo[s]=new WeakMap);var u=Mo[s],d=[],m=new Set,g=new Set(o),p=function(v){!v||m.has(v)||(m.add(v),p(v.parentNode))};o.forEach(p);var b=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(w){if(m.has(w))b(w);else try{var N=w.getAttribute(l),z=N!==null&&N!=="false",j=(Da.get(w)||0)+1,k=(u.get(w)||0)+1;Da.set(w,j),u.set(w,k),d.push(w),j===1&&z&&Ro.set(w,!0),k===1&&w.setAttribute(s,"true"),z||w.setAttribute(l,"true")}catch(A){console.error("aria-hidden: cannot operate on ",w,A)}})};return b(n),m.clear(),nf++,function(){d.forEach(function(v){var w=Da.get(v)-1,N=u.get(v)-1;Da.set(v,w),u.set(v,N),w||(Ro.has(v)||v.removeAttribute(l),Ro.delete(v)),N||v.removeAttribute(s)}),nf--,nf||(Da=new WeakMap,Da=new WeakMap,Ro=new WeakMap,Mo={})}},s1=function(e,n,s){s===void 0&&(s="data-aria-hidden");var l=Array.from(Array.isArray(e)?e:[e]),o=t1(e);return o?(l.push.apply(l,Array.from(o.querySelectorAll("[aria-live], script"))),i1(l,o,s,"aria-hidden")):function(){return null}},bc="Dialog",[Sv]=Uj(bc),[a1,Kn]=Sv(bc),wv=e=>{const{__scopeDialog:n,children:s,open:l,defaultOpen:o,onOpenChange:u,modal:d=!0}=e,m=x.useRef(null),g=x.useRef(null),[p,b]=Zj({prop:l,defaultProp:o??!1,onChange:u,caller:bc});return c.jsx(a1,{scope:n,triggerRef:m,contentRef:g,contentId:Qd(),titleId:Qd(),descriptionId:Qd(),open:p,onOpenChange:b,onOpenToggle:x.useCallback(()=>b(v=>!v),[b]),modal:d,children:s})};wv.displayName=bc;var jv="DialogTrigger",l1=x.forwardRef((e,n)=>{const{__scopeDialog:s,...l}=e,o=Kn(jv,s),u=Gs(n,o.triggerRef);return c.jsx(Ti.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Yf(o.open),...l,ref:u,onClick:ds(e.onClick,o.onOpenToggle)})});l1.displayName=jv;var Gf="DialogPortal",[r1,Nv]=Sv(Gf,{forceMount:void 0}),kv=e=>{const{__scopeDialog:n,forceMount:s,children:l,container:o}=e,u=Kn(Gf,n);return c.jsx(r1,{scope:n,forceMount:s,children:x.Children.map(l,d=>c.jsx(yc,{present:s||u.open,children:c.jsx(dv,{asChild:!0,container:o,children:d})}))})};kv.displayName=Gf;var Xo="DialogOverlay",zv=x.forwardRef((e,n)=>{const s=Nv(Xo,e.__scopeDialog),{forceMount:l=s.forceMount,...o}=e,u=Kn(Xo,e.__scopeDialog);return u.modal?c.jsx(yc,{present:l||u.open,children:c.jsx(c1,{...o,ref:n})}):null});zv.displayName=Xo;var o1=av("DialogOverlay.RemoveScroll"),c1=x.forwardRef((e,n)=>{const{__scopeDialog:s,...l}=e,o=Kn(Xo,s);return c.jsx(bv,{as:o1,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(Ti.div,{"data-state":Yf(o.open),...l,ref:n,style:{pointerEvents:"auto",...l.style}})})}),Zs="DialogContent",_v=x.forwardRef((e,n)=>{const s=Nv(Zs,e.__scopeDialog),{forceMount:l=s.forceMount,...o}=e,u=Kn(Zs,e.__scopeDialog);return c.jsx(yc,{present:l||u.open,children:u.modal?c.jsx(u1,{...o,ref:n}):c.jsx(d1,{...o,ref:n})})});_v.displayName=Zs;var u1=x.forwardRef((e,n)=>{const s=Kn(Zs,e.__scopeDialog),l=x.useRef(null),o=Gs(n,s.contentRef,l);return x.useEffect(()=>{const u=l.current;if(u)return s1(u)},[]),c.jsx(Cv,{...e,ref:o,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ds(e.onCloseAutoFocus,u=>{u.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:ds(e.onPointerDownOutside,u=>{const d=u.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0;(d.button===2||m)&&u.preventDefault()}),onFocusOutside:ds(e.onFocusOutside,u=>u.preventDefault())})}),d1=x.forwardRef((e,n)=>{const s=Kn(Zs,e.__scopeDialog),l=x.useRef(!1),o=x.useRef(!1);return c.jsx(Cv,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),u.defaultPrevented||(l.current||s.triggerRef.current?.focus(),u.preventDefault()),l.current=!1,o.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),u.defaultPrevented||(l.current=!0,u.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const d=u.target;s.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.current&&u.preventDefault()}})}),Cv=x.forwardRef((e,n)=>{const{__scopeDialog:s,trapFocus:l,onOpenAutoFocus:o,onCloseAutoFocus:u,...d}=e,m=Kn(Zs,s),g=x.useRef(null),p=Gs(n,g);return vN(),c.jsxs(c.Fragment,{children:[c.jsx(cv,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:o,onUnmountAutoFocus:u,children:c.jsx(rv,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Yf(m.open),...d,ref:p,onDismiss:()=>m.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(f1,{titleId:m.titleId}),c.jsx(m1,{contentRef:g,descriptionId:m.descriptionId})]})]})}),Kf="DialogTitle",Ev=x.forwardRef((e,n)=>{const{__scopeDialog:s,...l}=e,o=Kn(Kf,s);return c.jsx(Ti.h2,{id:o.titleId,...l,ref:n})});Ev.displayName=Kf;var Av="DialogDescription",Tv=x.forwardRef((e,n)=>{const{__scopeDialog:s,...l}=e,o=Kn(Av,s);return c.jsx(Ti.p,{id:o.descriptionId,...l,ref:n})});Tv.displayName=Av;var Ov="DialogClose",Dv=x.forwardRef((e,n)=>{const{__scopeDialog:s,...l}=e,o=Kn(Ov,s);return c.jsx(Ti.button,{type:"button",...l,ref:n,onClick:ds(e.onClick,()=>o.onOpenChange(!1))})});Dv.displayName=Ov;function Yf(e){return e?"open":"closed"}var Rv="DialogTitleWarning",[eO,Mv]=Lj(Rv,{contentName:Zs,titleName:Kf,docsSlug:"dialog"}),f1=({titleId:e})=>{const n=Mv(Rv),s=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
180
+
181
+ If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
182
+
183
+ For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},h1="DialogDescriptionWarning",m1=({contentRef:e,descriptionId:n})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mv(h1).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");n&&o&&(document.getElementById(n)||console.warn(l))},[l,e,n]),null},Lv=wv,Uv=kv,Vf=zv,Pf=_v,Qf=Ev,$v=Tv,Bv=Dv;const p1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),g1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,s,l)=>l?l.toUpperCase():s.toLowerCase()),Ry=e=>{const n=g1(e);return n.charAt(0).toUpperCase()+n.slice(1)},Iv=(...e)=>e.filter((n,s,l)=>!!n&&n.trim()!==""&&l.indexOf(n)===s).join(" ").trim(),y1=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var v1={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 b1=x.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:l,className:o="",children:u,iconNode:d,...m},g)=>x.createElement("svg",{ref:g,...v1,width:n,height:n,stroke:e,strokeWidth:l?Number(s)*24/Number(n):s,className:Iv("lucide",o),...!u&&!y1(m)&&{"aria-hidden":"true"},...m},[...d.map(([p,b])=>x.createElement(p,b)),...Array.isArray(u)?u:[u]]));const Yn=(e,n)=>{const s=x.forwardRef(({className:l,...o},u)=>x.createElement(b1,{ref:u,iconNode:n,className:Iv(`lucide-${p1(Ry(e))}`,`lucide-${e}`,l),...o}));return s.displayName=Ry(e),s};const x1=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xf=Yn("chevron-right",x1);const S1=[["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"}]],w1=Yn("download",S1);const j1=[["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"}]],N1=Yn("globe",j1);const k1=[["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"}]],z1=Yn("layout-dashboard",k1);const _1=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],C1=Yn("menu",_1);const E1=[["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"}]],A1=Yn("play",E1);const T1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],My=Yn("plus",T1);const O1=[["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"}]],D1=Yn("rocket",O1);const R1=[["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"}]],M1=Yn("settings",R1);const L1=[["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"}]],U1=Yn("trash-2",L1);const $1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Jf=Yn("x",$1);function J(e,n,s){function l(m,g){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:g,constr:d,traits:new Set},enumerable:!1}),m._zod.traits.has(e))return;m._zod.traits.add(e),n(m,g);const p=d.prototype,b=Object.keys(p);for(let v=0;v<b.length;v++){const w=b[v];w in m||(m[w]=p[w].bind(m))}}const o=s?.Parent??Object;class u extends o{}Object.defineProperty(u,"name",{value:e});function d(m){var g;const p=s?.Parent?new u:this;l(p,m),(g=p._zod).deferred??(g.deferred=[]);for(const b of p._zod.deferred)b();return p}return Object.defineProperty(d,"init",{value:l}),Object.defineProperty(d,Symbol.hasInstance,{value:m=>s?.Parent&&m instanceof s.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class Za extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class qv extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const Zv={};function fs(e){return Zv}function Hv(e){const n=Object.values(e).filter(l=>typeof l=="number");return Object.entries(e).filter(([l,o])=>n.indexOf(+l)===-1).map(([l,o])=>o)}function yf(e,n){return typeof n=="bigint"?n.toString():n}function Ff(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Wf(e){return e==null}function eh(e){const n=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(n,s)}function B1(e,n){const s=(e.toString().split(".")[1]||"").length,l=n.toString();let o=(l.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(l)){const g=l.match(/\d?e-(\d?)/);g?.[1]&&(o=Number.parseInt(g[1]))}const u=s>o?s:o,d=Number.parseInt(e.toFixed(u).replace(".","")),m=Number.parseInt(n.toFixed(u).replace(".",""));return d%m/10**u}const Ly=Symbol("evaluating");function We(e,n,s){let l;Object.defineProperty(e,n,{get(){if(l!==Ly)return l===void 0&&(l=Ly,l=s()),l},set(o){Object.defineProperty(e,n,{value:o})},configurable:!0})}function Ks(e,n,s){Object.defineProperty(e,n,{value:s,writable:!0,enumerable:!0,configurable:!0})}function ms(...e){const n={};for(const s of e){const l=Object.getOwnPropertyDescriptors(s);Object.assign(n,l)}return Object.defineProperties({},n)}function Uy(e){return JSON.stringify(e)}function I1(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Gv="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Jo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const q1=Ff(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ya(e){if(Jo(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const s=n.prototype;return!(Jo(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function Kv(e){return Ya(e)?{...e}:Array.isArray(e)?[...e]:e}const Z1=new Set(["string","number","symbol"]);function Va(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ps(e,n,s){const l=new e._zod.constr(n??e._zod.def);return(!n||s?.parent)&&(l._zod.parent=e),l}function be(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function H1(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const G1={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 K1(e,n){const s=e._zod.def,l=s.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=ms(e._zod.def,{get shape(){const d={};for(const m in n){if(!(m in s.shape))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(d[m]=s.shape[m])}return Ks(this,"shape",d),d},checks:[]});return ps(e,u)}function Y1(e,n){const s=e._zod.def,l=s.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=ms(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const m in n){if(!(m in s.shape))throw new Error(`Unrecognized key: "${m}"`);n[m]&&delete d[m]}return Ks(this,"shape",d),d},checks:[]});return ps(e,u)}function V1(e,n){if(!Ya(n))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0){const u=e._zod.def.shape;for(const d in n)if(Object.getOwnPropertyDescriptor(u,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=ms(e._zod.def,{get shape(){const u={...e._zod.def.shape,...n};return Ks(this,"shape",u),u}});return ps(e,o)}function P1(e,n){if(!Ya(n))throw new Error("Invalid input to safeExtend: expected a plain object");const s=ms(e._zod.def,{get shape(){const l={...e._zod.def.shape,...n};return Ks(this,"shape",l),l}});return ps(e,s)}function Q1(e,n){const s=ms(e._zod.def,{get shape(){const l={...e._zod.def.shape,...n._zod.def.shape};return Ks(this,"shape",l),l},get catchall(){return n._zod.def.catchall},checks:[]});return ps(e,s)}function X1(e,n,s){const o=n._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=ms(n._zod.def,{get shape(){const m=n._zod.def.shape,g={...m};if(s)for(const p in s){if(!(p in m))throw new Error(`Unrecognized key: "${p}"`);s[p]&&(g[p]=e?new e({type:"optional",innerType:m[p]}):m[p])}else for(const p in m)g[p]=e?new e({type:"optional",innerType:m[p]}):m[p];return Ks(this,"shape",g),g},checks:[]});return ps(n,d)}function J1(e,n,s){const l=ms(n._zod.def,{get shape(){const o=n._zod.def.shape,u={...o};if(s)for(const d in s){if(!(d in u))throw new Error(`Unrecognized key: "${d}"`);s[d]&&(u[d]=new e({type:"nonoptional",innerType:o[d]}))}else for(const d in o)u[d]=new e({type:"nonoptional",innerType:o[d]});return Ks(this,"shape",u),u}});return ps(n,l)}function Ua(e,n=0){if(e.aborted===!0)return!0;for(let s=n;s<e.issues.length;s++)if(e.issues[s]?.continue!==!0)return!0;return!1}function $a(e,n){return n.map(s=>{var l;return(l=s).path??(l.path=[]),s.path.unshift(e),s})}function Lo(e){return typeof e=="string"?e:e?.message}function hs(e,n,s){const l={...e,path:e.path??[]};if(!e.message){const o=Lo(e.inst?._zod.def?.error?.(e))??Lo(n?.error?.(e))??Lo(s.customError?.(e))??Lo(s.localeError?.(e))??"Invalid input";l.message=o}return delete l.inst,delete l.continue,n?.reportInput||delete l.input,l}function th(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function er(...e){const[n,s,l]=e;return typeof n=="string"?{message:n,code:"custom",input:s,inst:l}:{...n}}const Yv=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,yf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vv=J("$ZodError",Yv),Pv=J("$ZodError",Yv,{Parent:Error});function F1(e,n=s=>s.message){const s={},l=[];for(const o of e.issues)o.path.length>0?(s[o.path[0]]=s[o.path[0]]||[],s[o.path[0]].push(n(o))):l.push(n(o));return{formErrors:l,fieldErrors:s}}function W1(e,n=s=>s.message){const s={_errors:[]},l=o=>{for(const u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>l({issues:d}));else if(u.code==="invalid_key")l({issues:u.issues});else if(u.code==="invalid_element")l({issues:u.issues});else if(u.path.length===0)s._errors.push(n(u));else{let d=s,m=0;for(;m<u.path.length;){const g=u.path[m];m===u.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(n(u))):d[g]=d[g]||{_errors:[]},d=d[g],m++}}};return l(e),s}const nh=e=>(n,s,l,o)=>{const u=l?Object.assign(l,{async:!1}):{async:!1},d=n._zod.run({value:s,issues:[]},u);if(d instanceof Promise)throw new Za;if(d.issues.length){const m=new(o?.Err??e)(d.issues.map(g=>hs(g,u,fs())));throw Gv(m,o?.callee),m}return d.value},ih=e=>async(n,s,l,o)=>{const u=l?Object.assign(l,{async:!0}):{async:!0};let d=n._zod.run({value:s,issues:[]},u);if(d instanceof Promise&&(d=await d),d.issues.length){const m=new(o?.Err??e)(d.issues.map(g=>hs(g,u,fs())));throw Gv(m,o?.callee),m}return d.value},xc=e=>(n,s,l)=>{const o=l?{...l,async:!1}:{async:!1},u=n._zod.run({value:s,issues:[]},o);if(u instanceof Promise)throw new Za;return u.issues.length?{success:!1,error:new(e??Vv)(u.issues.map(d=>hs(d,o,fs())))}:{success:!0,data:u.value}},e2=xc(Pv),Sc=e=>async(n,s,l)=>{const o=l?Object.assign(l,{async:!0}):{async:!0};let u=n._zod.run({value:s,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(d=>hs(d,o,fs())))}:{success:!0,data:u.value}},t2=Sc(Pv),n2=e=>(n,s,l)=>{const o=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return nh(e)(n,s,o)},i2=e=>(n,s,l)=>nh(e)(n,s,l),s2=e=>async(n,s,l)=>{const o=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return ih(e)(n,s,o)},a2=e=>async(n,s,l)=>ih(e)(n,s,l),l2=e=>(n,s,l)=>{const o=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return xc(e)(n,s,o)},r2=e=>(n,s,l)=>xc(e)(n,s,l),o2=e=>async(n,s,l)=>{const o=l?Object.assign(l,{direction:"backward"}):{direction:"backward"};return Sc(e)(n,s,o)},c2=e=>async(n,s,l)=>Sc(e)(n,s,l),u2=/^[cC][^\s-]{8,}$/,d2=/^[0-9a-z]+$/,f2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,h2=/^[0-9a-vA-V]{20}$/,m2=/^[A-Za-z0-9]{27}$/,p2=/^[a-zA-Z0-9_-]{21}$/,g2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,y2=/^([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})$/,$y=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)$/,v2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,b2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function x2(){return new RegExp(b2,"u")}const S2=/^(?:(?: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])$/,w2=/^(([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}|:))$/,j2=/^((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])$/,N2=/^(([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])$/,k2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qv=/^[A-Za-z0-9_-]*$/,z2=/^\+[1-9]\d{6,14}$/,Xv="(?:(?:\\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])))",_2=new RegExp(`^${Xv}$`);function Jv(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function C2(e){return new RegExp(`^${Jv(e)}$`)}function E2(e){const n=Jv({precision:e.precision}),s=["Z"];e.local&&s.push(""),e.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const l=`${n}(?:${s.join("|")})`;return new RegExp(`^${Xv}T(?:${l})$`)}const A2=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},T2=/^-?\d+$/,Fv=/^-?\d+(?:\.\d+)?$/,O2=/^(?:true|false)$/i,D2=/^[^A-Z]*$/,R2=/^[^a-z]*$/,cn=J("$ZodCheck",(e,n)=>{var s;e._zod??(e._zod={}),e._zod.def=n,(s=e._zod).onattach??(s.onattach=[])}),Wv={number:"number",bigint:"bigint",object:"date"},eb=J("$ZodCheckLessThan",(e,n)=>{cn.init(e,n);const s=Wv[typeof n.value];e._zod.onattach.push(l=>{const o=l._zod.bag,u=(n.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<u&&(n.inclusive?o.maximum=n.value:o.exclusiveMaximum=n.value)}),e._zod.check=l=>{(n.inclusive?l.value<=n.value:l.value<n.value)||l.issues.push({origin:s,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:l.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),tb=J("$ZodCheckGreaterThan",(e,n)=>{cn.init(e,n);const s=Wv[typeof n.value];e._zod.onattach.push(l=>{const o=l._zod.bag,u=(n.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>u&&(n.inclusive?o.minimum=n.value:o.exclusiveMinimum=n.value)}),e._zod.check=l=>{(n.inclusive?l.value>=n.value:l.value>n.value)||l.issues.push({origin:s,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:l.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),M2=J("$ZodCheckMultipleOf",(e,n)=>{cn.init(e,n),e._zod.onattach.push(s=>{var l;(l=s._zod.bag).multipleOf??(l.multipleOf=n.value)}),e._zod.check=s=>{if(typeof s.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?s.value%n.value===BigInt(0):B1(s.value,n.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:n.value,input:s.value,inst:e,continue:!n.abort})}}),L2=J("$ZodCheckNumberFormat",(e,n)=>{cn.init(e,n),n.format=n.format||"float64";const s=n.format?.includes("int"),l=s?"int":"number",[o,u]=G1[n.format];e._zod.onattach.push(d=>{const m=d._zod.bag;m.format=n.format,m.minimum=o,m.maximum=u,s&&(m.pattern=T2)}),e._zod.check=d=>{const m=d.value;if(s){if(!Number.isInteger(m)){d.issues.push({expected:l,format:n.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?d.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!n.abort}):d.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!n.abort});return}}m<o&&d.issues.push({origin:"number",input:m,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!n.abort}),m>u&&d.issues.push({origin:"number",input:m,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!n.abort})}}),U2=J("$ZodCheckMaxLength",(e,n)=>{var s;cn.init(e,n),(s=e._zod.def).when??(s.when=l=>{const o=l.value;return!Wf(o)&&o.length!==void 0}),e._zod.onattach.push(l=>{const o=l._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<o&&(l._zod.bag.maximum=n.maximum)}),e._zod.check=l=>{const o=l.value;if(o.length<=n.maximum)return;const d=th(o);l.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),$2=J("$ZodCheckMinLength",(e,n)=>{var s;cn.init(e,n),(s=e._zod.def).when??(s.when=l=>{const o=l.value;return!Wf(o)&&o.length!==void 0}),e._zod.onattach.push(l=>{const o=l._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>o&&(l._zod.bag.minimum=n.minimum)}),e._zod.check=l=>{const o=l.value;if(o.length>=n.minimum)return;const d=th(o);l.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),B2=J("$ZodCheckLengthEquals",(e,n)=>{var s;cn.init(e,n),(s=e._zod.def).when??(s.when=l=>{const o=l.value;return!Wf(o)&&o.length!==void 0}),e._zod.onattach.push(l=>{const o=l._zod.bag;o.minimum=n.length,o.maximum=n.length,o.length=n.length}),e._zod.check=l=>{const o=l.value,u=o.length;if(u===n.length)return;const d=th(o),m=u>n.length;l.issues.push({origin:d,...m?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:l.value,inst:e,continue:!n.abort})}}),wc=J("$ZodCheckStringFormat",(e,n)=>{var s,l;cn.init(e,n),e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=n.format,n.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(n.pattern))}),n.pattern?(s=e._zod).check??(s.check=o=>{n.pattern.lastIndex=0,!n.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:n.format,input:o.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(l=e._zod).check??(l.check=()=>{})}),I2=J("$ZodCheckRegex",(e,n)=>{wc.init(e,n),e._zod.check=s=>{n.pattern.lastIndex=0,!n.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),q2=J("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=D2),wc.init(e,n)}),Z2=J("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=R2),wc.init(e,n)}),H2=J("$ZodCheckIncludes",(e,n)=>{cn.init(e,n);const s=Va(n.includes),l=new RegExp(typeof n.position=="number"?`^.{${n.position}}${s}`:s);n.pattern=l,e._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(l)}),e._zod.check=o=>{o.value.includes(n.includes,n.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:o.value,inst:e,continue:!n.abort})}}),G2=J("$ZodCheckStartsWith",(e,n)=>{cn.init(e,n);const s=new RegExp(`^${Va(n.prefix)}.*`);n.pattern??(n.pattern=s),e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(s)}),e._zod.check=l=>{l.value.startsWith(n.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:l.value,inst:e,continue:!n.abort})}}),K2=J("$ZodCheckEndsWith",(e,n)=>{cn.init(e,n);const s=new RegExp(`.*${Va(n.suffix)}$`);n.pattern??(n.pattern=s),e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(s)}),e._zod.check=l=>{l.value.endsWith(n.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:l.value,inst:e,continue:!n.abort})}}),Y2=J("$ZodCheckOverwrite",(e,n)=>{cn.init(e,n),e._zod.check=s=>{s.value=n.tx(s.value)}});class V2{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const l=n.split(`
184
+ `).filter(d=>d),o=Math.min(...l.map(d=>d.length-d.trimStart().length)),u=l.map(d=>d.slice(o)).map(d=>" ".repeat(this.indent*2)+d);for(const d of u)this.content.push(d)}compile(){const n=Function,s=this?.args,o=[...(this?.content??[""]).map(u=>` ${u}`)];return new n(...s,o.join(`
185
+ `))}}const P2={major:4,minor:3,patch:6},mt=J("$ZodType",(e,n)=>{var s;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=P2;const l=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&l.unshift(e);for(const o of l)for(const u of o._zod.onattach)u(e);if(l.length===0)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(d,m,g)=>{let p=Ua(d),b;for(const v of m){if(v._zod.def.when){if(!v._zod.def.when(d))continue}else if(p)continue;const w=d.issues.length,N=v._zod.check(d);if(N instanceof Promise&&g?.async===!1)throw new Za;if(b||N instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await N,d.issues.length!==w&&(p||(p=Ua(d,w)))});else{if(d.issues.length===w)continue;p||(p=Ua(d,w))}}return b?b.then(()=>d):d},u=(d,m,g)=>{if(Ua(d))return d.aborted=!0,d;const p=o(m,l,g);if(p instanceof Promise){if(g.async===!1)throw new Za;return p.then(b=>e._zod.parse(b,g))}return e._zod.parse(p,g)};e._zod.run=(d,m)=>{if(m.skipChecks)return e._zod.parse(d,m);if(m.direction==="backward"){const p=e._zod.parse({value:d.value,issues:[]},{...m,skipChecks:!0});return p instanceof Promise?p.then(b=>u(b,d,m)):u(p,d,m)}const g=e._zod.parse(d,m);if(g instanceof Promise){if(m.async===!1)throw new Za;return g.then(p=>o(p,l,m))}return o(g,l,m)}}We(e,"~standard",()=>({validate:o=>{try{const u=e2(e,o);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return t2(e,o).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),sh=J("$ZodString",(e,n)=>{mt.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??A2(e._zod.bag),e._zod.parse=(s,l)=>{if(n.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}}),ht=J("$ZodStringFormat",(e,n)=>{wc.init(e,n),sh.init(e,n)}),Q2=J("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=y2),ht.init(e,n)}),X2=J("$ZodUUID",(e,n)=>{if(n.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(l===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=$y(l))}else n.pattern??(n.pattern=$y());ht.init(e,n)}),J2=J("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=v2),ht.init(e,n)}),F2=J("$ZodURL",(e,n)=>{ht.init(e,n),e._zod.check=s=>{try{const l=s.value.trim(),o=new URL(l);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(o.hostname)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:s.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:s.value,inst:e,continue:!n.abort})),n.normalize?s.value=o.href:s.value=l;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!n.abort})}}}),W2=J("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=x2()),ht.init(e,n)}),ek=J("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=p2),ht.init(e,n)}),tk=J("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=u2),ht.init(e,n)}),nk=J("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=d2),ht.init(e,n)}),ik=J("$ZodULID",(e,n)=>{n.pattern??(n.pattern=f2),ht.init(e,n)}),sk=J("$ZodXID",(e,n)=>{n.pattern??(n.pattern=h2),ht.init(e,n)}),ak=J("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=m2),ht.init(e,n)}),lk=J("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=E2(n)),ht.init(e,n)}),rk=J("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=_2),ht.init(e,n)}),ok=J("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=C2(n)),ht.init(e,n)}),ck=J("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=g2),ht.init(e,n)}),uk=J("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=S2),ht.init(e,n),e._zod.bag.format="ipv4"}),dk=J("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=w2),ht.init(e,n),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:!n.abort})}}}),fk=J("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=j2),ht.init(e,n)}),hk=J("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=N2),ht.init(e,n),e._zod.check=s=>{const l=s.value.split("/");try{if(l.length!==2)throw new Error;const[o,u]=l;if(!u)throw new Error;const d=Number(u);if(`${d}`!==u)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${o}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:e,continue:!n.abort})}}});function nb(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const mk=J("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=k2),ht.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{nb(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!n.abort})}});function pk(e){if(!Qv.test(e))return!1;const n=e.replace(/[-_]/g,l=>l==="-"?"+":"/"),s=n.padEnd(Math.ceil(n.length/4)*4,"=");return nb(s)}const gk=J("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=Qv),ht.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{pk(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!n.abort})}}),yk=J("$ZodE164",(e,n)=>{n.pattern??(n.pattern=z2),ht.init(e,n)});function vk(e,n=null){try{const s=e.split(".");if(s.length!==3)return!1;const[l]=s;if(!l)return!1;const o=JSON.parse(atob(l));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||n&&(!("alg"in o)||o.alg!==n))}catch{return!1}}const bk=J("$ZodJWT",(e,n)=>{ht.init(e,n),e._zod.check=s=>{vk(s.value,n.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!n.abort})}}),ib=J("$ZodNumber",(e,n)=>{mt.init(e,n),e._zod.pattern=e._zod.bag.pattern??Fv,e._zod.parse=(s,l)=>{if(n.coerce)try{s.value=Number(s.value)}catch{}const o=s.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return s;const u=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...u?{received:u}:{}}),s}}),xk=J("$ZodNumberFormat",(e,n)=>{L2.init(e,n),ib.init(e,n)}),Sk=J("$ZodBoolean",(e,n)=>{mt.init(e,n),e._zod.pattern=O2,e._zod.parse=(s,l)=>{if(n.coerce)try{s.value=!!s.value}catch{}const o=s.value;return typeof o=="boolean"||s.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),s}}),wk=J("$ZodUnknown",(e,n)=>{mt.init(e,n),e._zod.parse=s=>s}),jk=J("$ZodNever",(e,n)=>{mt.init(e,n),e._zod.parse=(s,l)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function By(e,n,s){e.issues.length&&n.issues.push(...$a(s,e.issues)),n.value[s]=e.value}const Nk=J("$ZodArray",(e,n)=>{mt.init(e,n),e._zod.parse=(s,l)=>{const o=s.value;if(!Array.isArray(o))return s.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),s;s.value=Array(o.length);const u=[];for(let d=0;d<o.length;d++){const m=o[d],g=n.element._zod.run({value:m,issues:[]},l);g instanceof Promise?u.push(g.then(p=>By(p,s,d))):By(g,s,d)}return u.length?Promise.all(u).then(()=>s):s}});function Fo(e,n,s,l,o){if(e.issues.length){if(o&&!(s in l))return;n.issues.push(...$a(s,e.issues))}e.value===void 0?s in l&&(n.value[s]=void 0):n.value[s]=e.value}function sb(e){const n=Object.keys(e.shape);for(const l of n)if(!e.shape?.[l]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const s=H1(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(s)}}function ab(e,n,s,l,o,u){const d=[],m=o.keySet,g=o.catchall._zod,p=g.def.type,b=g.optout==="optional";for(const v in n){if(m.has(v))continue;if(p==="never"){d.push(v);continue}const w=g.run({value:n[v],issues:[]},l);w instanceof Promise?e.push(w.then(N=>Fo(N,s,v,n,b))):Fo(w,s,v,n,b)}return d.length&&s.issues.push({code:"unrecognized_keys",keys:d,input:n,inst:u}),e.length?Promise.all(e).then(()=>s):s}const kk=J("$ZodObject",(e,n)=>{if(mt.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const m=n.shape;Object.defineProperty(n,"shape",{get:()=>{const g={...m};return Object.defineProperty(n,"shape",{value:g}),g}})}const l=Ff(()=>sb(n));We(e._zod,"propValues",()=>{const m=n.shape,g={};for(const p in m){const b=m[p]._zod;if(b.values){g[p]??(g[p]=new Set);for(const v of b.values)g[p].add(v)}}return g});const o=Jo,u=n.catchall;let d;e._zod.parse=(m,g)=>{d??(d=l.value);const p=m.value;if(!o(p))return m.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),m;m.value={};const b=[],v=d.shape;for(const w of d.keys){const N=v[w],z=N._zod.optout==="optional",j=N._zod.run({value:p[w],issues:[]},g);j instanceof Promise?b.push(j.then(k=>Fo(k,m,w,p,z))):Fo(j,m,w,p,z)}return u?ab(b,p,m,g,l.value,e):b.length?Promise.all(b).then(()=>m):m}}),zk=J("$ZodObjectJIT",(e,n)=>{kk.init(e,n);const s=e._zod.parse,l=Ff(()=>sb(n)),o=w=>{const N=new V2(["shape","payload","ctx"]),z=l.value,j=O=>{const D=Uy(O);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};N.write("const input = payload.value;");const k=Object.create(null);let A=0;for(const O of z.keys)k[O]=`key_${A++}`;N.write("const newResult = {};");for(const O of z.keys){const D=k[O],L=Uy(O),V=w[O]?._zod?.optout==="optional";N.write(`const ${D} = ${j(O)};`),V?N.write(`
186
+ if (${D}.issues.length) {
187
+ if (${L} in input) {
188
+ payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
189
+ ...iss,
190
+ path: iss.path ? [${L}, ...iss.path] : [${L}]
191
+ })));
192
+ }
193
+ }
194
+
195
+ if (${D}.value === undefined) {
196
+ if (${L} in input) {
197
+ newResult[${L}] = undefined;
198
+ }
199
+ } else {
200
+ newResult[${L}] = ${D}.value;
201
+ }
202
+
203
+ `):N.write(`
204
+ if (${D}.issues.length) {
205
+ payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
206
+ ...iss,
207
+ path: iss.path ? [${L}, ...iss.path] : [${L}]
208
+ })));
209
+ }
210
+
211
+ if (${D}.value === undefined) {
212
+ if (${L} in input) {
213
+ newResult[${L}] = undefined;
214
+ }
215
+ } else {
216
+ newResult[${L}] = ${D}.value;
217
+ }
218
+
219
+ `)}N.write("payload.value = newResult;"),N.write("return payload;");const E=N.compile();return(O,D)=>E(w,O,D)};let u;const d=Jo,m=!Zv.jitless,p=m&&q1.value,b=n.catchall;let v;e._zod.parse=(w,N)=>{v??(v=l.value);const z=w.value;return d(z)?m&&p&&N?.async===!1&&N.jitless!==!0?(u||(u=o(n.shape)),w=u(w,N),b?ab([],z,w,N,v,e):w):s(w,N):(w.issues.push({expected:"object",code:"invalid_type",input:z,inst:e}),w)}});function Iy(e,n,s,l){for(const u of e)if(u.issues.length===0)return n.value=u.value,n;const o=e.filter(u=>!Ua(u));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:s,errors:e.map(u=>u.issues.map(d=>hs(d,l,fs())))}),n)}const _k=J("$ZodUnion",(e,n)=>{mt.init(e,n),We(e._zod,"optin",()=>n.options.some(o=>o._zod.optin==="optional")?"optional":void 0),We(e._zod,"optout",()=>n.options.some(o=>o._zod.optout==="optional")?"optional":void 0),We(e._zod,"values",()=>{if(n.options.every(o=>o._zod.values))return new Set(n.options.flatMap(o=>Array.from(o._zod.values)))}),We(e._zod,"pattern",()=>{if(n.options.every(o=>o._zod.pattern)){const o=n.options.map(u=>u._zod.pattern);return new RegExp(`^(${o.map(u=>eh(u.source)).join("|")})$`)}});const s=n.options.length===1,l=n.options[0]._zod.run;e._zod.parse=(o,u)=>{if(s)return l(o,u);let d=!1;const m=[];for(const g of n.options){const p=g._zod.run({value:o.value,issues:[]},u);if(p instanceof Promise)m.push(p),d=!0;else{if(p.issues.length===0)return p;m.push(p)}}return d?Promise.all(m).then(g=>Iy(g,o,e,u)):Iy(m,o,e,u)}}),Ck=J("$ZodIntersection",(e,n)=>{mt.init(e,n),e._zod.parse=(s,l)=>{const o=s.value,u=n.left._zod.run({value:o,issues:[]},l),d=n.right._zod.run({value:o,issues:[]},l);return u instanceof Promise||d instanceof Promise?Promise.all([u,d]).then(([g,p])=>qy(s,g,p)):qy(s,u,d)}});function vf(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Ya(e)&&Ya(n)){const s=Object.keys(n),l=Object.keys(e).filter(u=>s.indexOf(u)!==-1),o={...e,...n};for(const u of l){const d=vf(e[u],n[u]);if(!d.valid)return{valid:!1,mergeErrorPath:[u,...d.mergeErrorPath]};o[u]=d.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let l=0;l<e.length;l++){const o=e[l],u=n[l],d=vf(o,u);if(!d.valid)return{valid:!1,mergeErrorPath:[l,...d.mergeErrorPath]};s.push(d.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}function qy(e,n,s){const l=new Map;let o;for(const m of n.issues)if(m.code==="unrecognized_keys"){o??(o=m);for(const g of m.keys)l.has(g)||l.set(g,{}),l.get(g).l=!0}else e.issues.push(m);for(const m of s.issues)if(m.code==="unrecognized_keys")for(const g of m.keys)l.has(g)||l.set(g,{}),l.get(g).r=!0;else e.issues.push(m);const u=[...l].filter(([,m])=>m.l&&m.r).map(([m])=>m);if(u.length&&o&&e.issues.push({...o,keys:u}),Ua(e))return e;const d=vf(n.value,s.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const Ek=J("$ZodRecord",(e,n)=>{mt.init(e,n),e._zod.parse=(s,l)=>{const o=s.value;if(!Ya(o))return s.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),s;const u=[],d=n.keyType._zod.values;if(d){s.value={};const m=new Set;for(const p of d)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){m.add(typeof p=="number"?p.toString():p);const b=n.valueType._zod.run({value:o[p],issues:[]},l);b instanceof Promise?u.push(b.then(v=>{v.issues.length&&s.issues.push(...$a(p,v.issues)),s.value[p]=v.value})):(b.issues.length&&s.issues.push(...$a(p,b.issues)),s.value[p]=b.value)}let g;for(const p in o)m.has(p)||(g=g??[],g.push(p));g&&g.length>0&&s.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:g})}else{s.value={};for(const m of Reflect.ownKeys(o)){if(m==="__proto__")continue;let g=n.keyType._zod.run({value:m,issues:[]},l);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&Fv.test(m)&&g.issues.length){const v=n.keyType._zod.run({value:Number(m),issues:[]},l);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(g=v)}if(g.issues.length){n.mode==="loose"?s.value[m]=o[m]:s.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(v=>hs(v,l,fs())),input:m,path:[m],inst:e});continue}const b=n.valueType._zod.run({value:o[m],issues:[]},l);b instanceof Promise?u.push(b.then(v=>{v.issues.length&&s.issues.push(...$a(m,v.issues)),s.value[g.value]=v.value})):(b.issues.length&&s.issues.push(...$a(m,b.issues)),s.value[g.value]=b.value)}}return u.length?Promise.all(u).then(()=>s):s}}),Ak=J("$ZodEnum",(e,n)=>{mt.init(e,n);const s=Hv(n.entries),l=new Set(s);e._zod.values=l,e._zod.pattern=new RegExp(`^(${s.filter(o=>Z1.has(typeof o)).map(o=>typeof o=="string"?Va(o):o.toString()).join("|")})$`),e._zod.parse=(o,u)=>{const d=o.value;return l.has(d)||o.issues.push({code:"invalid_value",values:s,input:d,inst:e}),o}}),Tk=J("$ZodLiteral",(e,n)=>{if(mt.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");const s=new Set(n.values);e._zod.values=s,e._zod.pattern=new RegExp(`^(${n.values.map(l=>typeof l=="string"?Va(l):l?Va(l.toString()):String(l)).join("|")})$`),e._zod.parse=(l,o)=>{const u=l.value;return s.has(u)||l.issues.push({code:"invalid_value",values:n.values,input:u,inst:e}),l}}),Ok=J("$ZodTransform",(e,n)=>{mt.init(e,n),e._zod.parse=(s,l)=>{if(l.direction==="backward")throw new qv(e.constructor.name);const o=n.transform(s.value,s);if(l.async)return(o instanceof Promise?o:Promise.resolve(o)).then(d=>(s.value=d,s));if(o instanceof Promise)throw new Za;return s.value=o,s}});function Zy(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const lb=J("$ZodOptional",(e,n)=>{mt.init(e,n),e._zod.optin="optional",e._zod.optout="optional",We(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),We(e._zod,"pattern",()=>{const s=n.innerType._zod.pattern;return s?new RegExp(`^(${eh(s.source)})?$`):void 0}),e._zod.parse=(s,l)=>{if(n.innerType._zod.optin==="optional"){const o=n.innerType._zod.run(s,l);return o instanceof Promise?o.then(u=>Zy(u,s.value)):Zy(o,s.value)}return s.value===void 0?s:n.innerType._zod.run(s,l)}}),Dk=J("$ZodExactOptional",(e,n)=>{lb.init(e,n),We(e._zod,"values",()=>n.innerType._zod.values),We(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(s,l)=>n.innerType._zod.run(s,l)}),Rk=J("$ZodNullable",(e,n)=>{mt.init(e,n),We(e._zod,"optin",()=>n.innerType._zod.optin),We(e._zod,"optout",()=>n.innerType._zod.optout),We(e._zod,"pattern",()=>{const s=n.innerType._zod.pattern;return s?new RegExp(`^(${eh(s.source)}|null)$`):void 0}),We(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(s,l)=>s.value===null?s:n.innerType._zod.run(s,l)}),Mk=J("$ZodDefault",(e,n)=>{mt.init(e,n),e._zod.optin="optional",We(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(s,l)=>{if(l.direction==="backward")return n.innerType._zod.run(s,l);if(s.value===void 0)return s.value=n.defaultValue,s;const o=n.innerType._zod.run(s,l);return o instanceof Promise?o.then(u=>Hy(u,n)):Hy(o,n)}});function Hy(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const Lk=J("$ZodPrefault",(e,n)=>{mt.init(e,n),e._zod.optin="optional",We(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(s,l)=>(l.direction==="backward"||s.value===void 0&&(s.value=n.defaultValue),n.innerType._zod.run(s,l))}),Uk=J("$ZodNonOptional",(e,n)=>{mt.init(e,n),We(e._zod,"values",()=>{const s=n.innerType._zod.values;return s?new Set([...s].filter(l=>l!==void 0)):void 0}),e._zod.parse=(s,l)=>{const o=n.innerType._zod.run(s,l);return o instanceof Promise?o.then(u=>Gy(u,e)):Gy(o,e)}});function Gy(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const $k=J("$ZodCatch",(e,n)=>{mt.init(e,n),We(e._zod,"optin",()=>n.innerType._zod.optin),We(e._zod,"optout",()=>n.innerType._zod.optout),We(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(s,l)=>{if(l.direction==="backward")return n.innerType._zod.run(s,l);const o=n.innerType._zod.run(s,l);return o instanceof Promise?o.then(u=>(s.value=u.value,u.issues.length&&(s.value=n.catchValue({...s,error:{issues:u.issues.map(d=>hs(d,l,fs()))},input:s.value}),s.issues=[]),s)):(s.value=o.value,o.issues.length&&(s.value=n.catchValue({...s,error:{issues:o.issues.map(u=>hs(u,l,fs()))},input:s.value}),s.issues=[]),s)}}),Bk=J("$ZodPipe",(e,n)=>{mt.init(e,n),We(e._zod,"values",()=>n.in._zod.values),We(e._zod,"optin",()=>n.in._zod.optin),We(e._zod,"optout",()=>n.out._zod.optout),We(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(s,l)=>{if(l.direction==="backward"){const u=n.out._zod.run(s,l);return u instanceof Promise?u.then(d=>Uo(d,n.in,l)):Uo(u,n.in,l)}const o=n.in._zod.run(s,l);return o instanceof Promise?o.then(u=>Uo(u,n.out,l)):Uo(o,n.out,l)}});function Uo(e,n,s){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},s)}const Ik=J("$ZodReadonly",(e,n)=>{mt.init(e,n),We(e._zod,"propValues",()=>n.innerType._zod.propValues),We(e._zod,"values",()=>n.innerType._zod.values),We(e._zod,"optin",()=>n.innerType?._zod?.optin),We(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(s,l)=>{if(l.direction==="backward")return n.innerType._zod.run(s,l);const o=n.innerType._zod.run(s,l);return o instanceof Promise?o.then(Ky):Ky(o)}});function Ky(e){return e.value=Object.freeze(e.value),e}const qk=J("$ZodCustom",(e,n)=>{cn.init(e,n),mt.init(e,n),e._zod.parse=(s,l)=>s,e._zod.check=s=>{const l=s.value,o=n.fn(l);if(o instanceof Promise)return o.then(u=>Yy(u,s,l,e));Yy(o,s,l,e)}});function Yy(e,n,s,l){if(!e){const o={code:"custom",input:s,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(o.params=l._zod.def.params),n.issues.push(er(o))}}var Vy;class Zk{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...s){const l=s[0];return this._map.set(n,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const s=this._map.get(n);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(n),this}get(n){const s=n._zod.parent;if(s){const l={...this.get(s)??{}};delete l.id;const o={...l,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function Hk(){return new Zk}(Vy=globalThis).__zod_globalRegistry??(Vy.__zod_globalRegistry=Hk());const Vl=globalThis.__zod_globalRegistry;function Gk(e,n){return new e({type:"string",...be(n)})}function Kk(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...be(n)})}function Py(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...be(n)})}function Yk(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...be(n)})}function Vk(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...be(n)})}function Pk(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...be(n)})}function Qk(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...be(n)})}function Xk(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...be(n)})}function Jk(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...be(n)})}function Fk(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...be(n)})}function Wk(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...be(n)})}function ez(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...be(n)})}function tz(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...be(n)})}function nz(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...be(n)})}function iz(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...be(n)})}function sz(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...be(n)})}function az(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...be(n)})}function lz(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...be(n)})}function rz(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...be(n)})}function oz(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...be(n)})}function cz(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...be(n)})}function uz(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...be(n)})}function dz(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...be(n)})}function fz(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...be(n)})}function hz(e,n){return new e({type:"string",format:"date",check:"string_format",...be(n)})}function mz(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...be(n)})}function pz(e,n){return new e({type:"string",format:"duration",check:"string_format",...be(n)})}function gz(e,n){return new e({type:"number",checks:[],...be(n)})}function yz(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...be(n)})}function vz(e,n){return new e({type:"boolean",...be(n)})}function bz(e){return new e({type:"unknown"})}function xz(e,n){return new e({type:"never",...be(n)})}function Qy(e,n){return new eb({check:"less_than",...be(n),value:e,inclusive:!1})}function sf(e,n){return new eb({check:"less_than",...be(n),value:e,inclusive:!0})}function Xy(e,n){return new tb({check:"greater_than",...be(n),value:e,inclusive:!1})}function af(e,n){return new tb({check:"greater_than",...be(n),value:e,inclusive:!0})}function Jy(e,n){return new M2({check:"multiple_of",...be(n),value:e})}function rb(e,n){return new U2({check:"max_length",...be(n),maximum:e})}function Wo(e,n){return new $2({check:"min_length",...be(n),minimum:e})}function ob(e,n){return new B2({check:"length_equals",...be(n),length:e})}function Sz(e,n){return new I2({check:"string_format",format:"regex",...be(n),pattern:e})}function wz(e){return new q2({check:"string_format",format:"lowercase",...be(e)})}function jz(e){return new Z2({check:"string_format",format:"uppercase",...be(e)})}function Nz(e,n){return new H2({check:"string_format",format:"includes",...be(n),includes:e})}function kz(e,n){return new G2({check:"string_format",format:"starts_with",...be(n),prefix:e})}function zz(e,n){return new K2({check:"string_format",format:"ends_with",...be(n),suffix:e})}function Fa(e){return new Y2({check:"overwrite",tx:e})}function _z(e){return Fa(n=>n.normalize(e))}function Cz(){return Fa(e=>e.trim())}function Ez(){return Fa(e=>e.toLowerCase())}function Az(){return Fa(e=>e.toUpperCase())}function Tz(){return Fa(e=>I1(e))}function Oz(e,n,s){return new e({type:"array",element:n,...be(s)})}function Dz(e,n,s){return new e({type:"custom",check:"custom",fn:n,...be(s)})}function Rz(e){const n=Mz(s=>(s.addIssue=l=>{if(typeof l=="string")s.issues.push(er(l,s.value,n._zod.def));else{const o=l;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=s.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),s.issues.push(er(o))}},e(s.value,s)));return n}function Mz(e,n){const s=new cn({check:"custom",...be(n)});return s._zod.check=e,s}function cb(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Vl,target:n,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 Rt(e,n,s={path:[],schemaPath:[]}){var l;const o=e._zod.def,u=n.seen.get(e);if(u)return u.count++,s.schemaPath.includes(e)&&(u.cycle=s.path),u.schema;const d={schema:{},count:1,cycle:void 0,path:s.path};n.seen.set(e,d);const m=e._zod.toJSONSchema?.();if(m)d.schema=m;else{const b={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,d.schema,b);else{const w=d.schema,N=n.processors[o.type];if(!N)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);N(e,n,w,b)}const v=e._zod.parent;v&&(d.ref||(d.ref=v),Rt(v,n,b),n.seen.get(v).isParent=!0)}const g=n.metadataRegistry.get(e);return g&&Object.assign(d.schema,g),n.io==="input"&&Ft(e)&&(delete d.schema.examples,delete d.schema.default),n.io==="input"&&d.schema._prefault&&((l=d.schema).default??(l.default=d.schema._prefault)),delete d.schema._prefault,n.seen.get(e).schema}function ub(e,n){const s=e.seen.get(n);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=new Map;for(const d of e.seen.entries()){const m=e.metadataRegistry.get(d[0])?.id;if(m){const g=l.get(m);if(g&&g!==d[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(m,d[0])}}const o=d=>{const m=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(d[0])?.id,w=e.external.uri??(z=>z);if(v)return{ref:w(v)};const N=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=N,{defId:N,ref:`${w("__shared")}#/${m}/${N}`}}if(d[1]===s)return{ref:"#"};const p=`#/${m}/`,b=d[1].schema.id??`__schema${e.counter++}`;return{defId:b,ref:p+b}},u=d=>{if(d[1].schema.$ref)return;const m=d[1],{ref:g,defId:p}=o(d);m.def={...m.schema},p&&(m.defId=p);const b=m.schema;for(const v in b)delete b[v];b.$ref=g};if(e.cycles==="throw")for(const d of e.seen.entries()){const m=d[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/<root>
220
+
221
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const m=d[1];if(n===d[0]){u(d);continue}if(e.external){const p=e.external.registry.get(d[0])?.id;if(n!==d[0]&&p){u(d);continue}}if(e.metadataRegistry.get(d[0])?.id){u(d);continue}if(m.cycle){u(d);continue}if(m.count>1&&e.reused==="ref"){u(d);continue}}}function db(e,n){const s=e.seen.get(n);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=d=>{const m=e.seen.get(d);if(m.ref===null)return;const g=m.def??m.schema,p={...g},b=m.ref;if(m.ref=null,b){l(b);const w=e.seen.get(b),N=w.schema;if(N.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(N)):Object.assign(g,N),Object.assign(g,p),d._zod.parent===b)for(const j in g)j==="$ref"||j==="allOf"||j in p||delete g[j];if(N.$ref&&w.def)for(const j in g)j==="$ref"||j==="allOf"||j in w.def&&JSON.stringify(g[j])===JSON.stringify(w.def[j])&&delete g[j]}const v=d._zod.parent;if(v&&v!==b){l(v);const w=e.seen.get(v);if(w?.schema.$ref&&(g.$ref=w.schema.$ref,w.def))for(const N in g)N==="$ref"||N==="allOf"||N in w.def&&JSON.stringify(g[N])===JSON.stringify(w.def[N])&&delete g[N]}e.override({zodSchema:d,jsonSchema:g,path:m.path??[]})};for(const d of[...e.seen.entries()].reverse())l(d[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(n)?.id;if(!d)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(d)}Object.assign(o,s.def??s.schema);const u=e.external?.defs??{};for(const d of e.seen.entries()){const m=d[1];m.def&&m.defId&&(u[m.defId]=m.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?o.$defs=u:o.definitions=u);try{const d=JSON.parse(JSON.stringify(o));return Object.defineProperty(d,"~standard",{value:{...n["~standard"],jsonSchema:{input:ec(n,"input",e.processors),output:ec(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Ft(e,n){const s=n??{seen:new Set};if(s.seen.has(e))return!1;s.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return Ft(l.element,s);if(l.type==="set")return Ft(l.valueType,s);if(l.type==="lazy")return Ft(l.getter(),s);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return Ft(l.innerType,s);if(l.type==="intersection")return Ft(l.left,s)||Ft(l.right,s);if(l.type==="record"||l.type==="map")return Ft(l.keyType,s)||Ft(l.valueType,s);if(l.type==="pipe")return Ft(l.in,s)||Ft(l.out,s);if(l.type==="object"){for(const o in l.shape)if(Ft(l.shape[o],s))return!0;return!1}if(l.type==="union"){for(const o of l.options)if(Ft(o,s))return!0;return!1}if(l.type==="tuple"){for(const o of l.items)if(Ft(o,s))return!0;return!!(l.rest&&Ft(l.rest,s))}return!1}const Lz=(e,n={})=>s=>{const l=cb({...s,processors:n});return Rt(e,l),ub(l,e),db(l,e)},ec=(e,n,s={})=>l=>{const{libraryOptions:o,target:u}=l??{},d=cb({...o??{},target:u,io:n,processors:s});return Rt(e,d),ub(d,e),db(d,e)},Uz={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},$z=(e,n,s,l)=>{const o=s;o.type="string";const{minimum:u,maximum:d,format:m,patterns:g,contentEncoding:p}=e._zod.bag;if(typeof u=="number"&&(o.minLength=u),typeof d=="number"&&(o.maxLength=d),m&&(o.format=Uz[m]??m,o.format===""&&delete o.format,m==="time"&&delete o.format),p&&(o.contentEncoding=p),g&&g.size>0){const b=[...g];b.length===1?o.pattern=b[0].source:b.length>1&&(o.allOf=[...b.map(v=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},Bz=(e,n,s,l)=>{const o=s,{minimum:u,maximum:d,format:m,multipleOf:g,exclusiveMaximum:p,exclusiveMinimum:b}=e._zod.bag;typeof m=="string"&&m.includes("int")?o.type="integer":o.type="number",typeof b=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(o.minimum=b,o.exclusiveMinimum=!0):o.exclusiveMinimum=b),typeof u=="number"&&(o.minimum=u,typeof b=="number"&&n.target!=="draft-04"&&(b>=u?delete o.minimum:delete o.exclusiveMinimum)),typeof p=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(o.maximum=p,o.exclusiveMaximum=!0):o.exclusiveMaximum=p),typeof d=="number"&&(o.maximum=d,typeof p=="number"&&n.target!=="draft-04"&&(p<=d?delete o.maximum:delete o.exclusiveMaximum)),typeof g=="number"&&(o.multipleOf=g)},Iz=(e,n,s,l)=>{s.type="boolean"},qz=(e,n,s,l)=>{s.not={}},Zz=(e,n,s,l)=>{},Hz=(e,n,s,l)=>{const o=e._zod.def,u=Hv(o.entries);u.every(d=>typeof d=="number")&&(s.type="number"),u.every(d=>typeof d=="string")&&(s.type="string"),s.enum=u},Gz=(e,n,s,l)=>{const o=e._zod.def,u=[];for(const d of o.values)if(d===void 0){if(n.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(n.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(d))}else u.push(d);if(u.length!==0)if(u.length===1){const d=u[0];s.type=d===null?"null":typeof d,n.target==="draft-04"||n.target==="openapi-3.0"?s.enum=[d]:s.const=d}else u.every(d=>typeof d=="number")&&(s.type="number"),u.every(d=>typeof d=="string")&&(s.type="string"),u.every(d=>typeof d=="boolean")&&(s.type="boolean"),u.every(d=>d===null)&&(s.type="null"),s.enum=u},Kz=(e,n,s,l)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Yz=(e,n,s,l)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Vz=(e,n,s,l)=>{const o=s,u=e._zod.def,{minimum:d,maximum:m}=e._zod.bag;typeof d=="number"&&(o.minItems=d),typeof m=="number"&&(o.maxItems=m),o.type="array",o.items=Rt(u.element,n,{...l,path:[...l.path,"items"]})},Pz=(e,n,s,l)=>{const o=s,u=e._zod.def;o.type="object",o.properties={};const d=u.shape;for(const p in d)o.properties[p]=Rt(d[p],n,{...l,path:[...l.path,"properties",p]});const m=new Set(Object.keys(d)),g=new Set([...m].filter(p=>{const b=u.shape[p]._zod;return n.io==="input"?b.optin===void 0:b.optout===void 0}));g.size>0&&(o.required=Array.from(g)),u.catchall?._zod.def.type==="never"?o.additionalProperties=!1:u.catchall?u.catchall&&(o.additionalProperties=Rt(u.catchall,n,{...l,path:[...l.path,"additionalProperties"]})):n.io==="output"&&(o.additionalProperties=!1)},Qz=(e,n,s,l)=>{const o=e._zod.def,u=o.inclusive===!1,d=o.options.map((m,g)=>Rt(m,n,{...l,path:[...l.path,u?"oneOf":"anyOf",g]}));u?s.oneOf=d:s.anyOf=d},Xz=(e,n,s,l)=>{const o=e._zod.def,u=Rt(o.left,n,{...l,path:[...l.path,"allOf",0]}),d=Rt(o.right,n,{...l,path:[...l.path,"allOf",1]}),m=p=>"allOf"in p&&Object.keys(p).length===1,g=[...m(u)?u.allOf:[u],...m(d)?d.allOf:[d]];s.allOf=g},Jz=(e,n,s,l)=>{const o=s,u=e._zod.def;o.type="object";const d=u.keyType,g=d._zod.bag?.patterns;if(u.mode==="loose"&&g&&g.size>0){const b=Rt(u.valueType,n,{...l,path:[...l.path,"patternProperties","*"]});o.patternProperties={};for(const v of g)o.patternProperties[v.source]=b}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(o.propertyNames=Rt(u.keyType,n,{...l,path:[...l.path,"propertyNames"]})),o.additionalProperties=Rt(u.valueType,n,{...l,path:[...l.path,"additionalProperties"]});const p=d._zod.values;if(p){const b=[...p].filter(v=>typeof v=="string"||typeof v=="number");b.length>0&&(o.required=b)}},Fz=(e,n,s,l)=>{const o=e._zod.def,u=Rt(o.innerType,n,l),d=n.seen.get(e);n.target==="openapi-3.0"?(d.ref=o.innerType,s.nullable=!0):s.anyOf=[u,{type:"null"}]},Wz=(e,n,s,l)=>{const o=e._zod.def;Rt(o.innerType,n,l);const u=n.seen.get(e);u.ref=o.innerType},e_=(e,n,s,l)=>{const o=e._zod.def;Rt(o.innerType,n,l);const u=n.seen.get(e);u.ref=o.innerType,s.default=JSON.parse(JSON.stringify(o.defaultValue))},t_=(e,n,s,l)=>{const o=e._zod.def;Rt(o.innerType,n,l);const u=n.seen.get(e);u.ref=o.innerType,n.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},n_=(e,n,s,l)=>{const o=e._zod.def;Rt(o.innerType,n,l);const u=n.seen.get(e);u.ref=o.innerType;let d;try{d=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=d},i_=(e,n,s,l)=>{const o=e._zod.def,u=n.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Rt(u,n,l);const d=n.seen.get(e);d.ref=u},s_=(e,n,s,l)=>{const o=e._zod.def;Rt(o.innerType,n,l);const u=n.seen.get(e);u.ref=o.innerType,s.readOnly=!0},fb=(e,n,s,l)=>{const o=e._zod.def;Rt(o.innerType,n,l);const u=n.seen.get(e);u.ref=o.innerType},a_=J("ZodISODateTime",(e,n)=>{lk.init(e,n),gt.init(e,n)});function l_(e){return fz(a_,e)}const r_=J("ZodISODate",(e,n)=>{rk.init(e,n),gt.init(e,n)});function o_(e){return hz(r_,e)}const c_=J("ZodISOTime",(e,n)=>{ok.init(e,n),gt.init(e,n)});function u_(e){return mz(c_,e)}const d_=J("ZodISODuration",(e,n)=>{ck.init(e,n),gt.init(e,n)});function f_(e){return pz(d_,e)}const h_=(e,n)=>{Vv.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>W1(e,s)},flatten:{value:s=>F1(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,yf,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,yf,2)}},isEmpty:{get(){return e.issues.length===0}}})},Mn=J("ZodError",h_,{Parent:Error}),m_=nh(Mn),p_=ih(Mn),g_=xc(Mn),y_=Sc(Mn),v_=n2(Mn),b_=i2(Mn),x_=s2(Mn),S_=a2(Mn),w_=l2(Mn),j_=r2(Mn),N_=o2(Mn),k_=c2(Mn),pt=J("ZodType",(e,n)=>(mt.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:ec(e,"input"),output:ec(e,"output")}}),e.toJSONSchema=Lz(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...s)=>e.clone(ms(n,{checks:[...n.checks??[],...s.map(l=>typeof l=="function"?{_zod:{check:l,def:{check:"custom"},onattach:[]}}:l)]}),{parent:!0}),e.with=e.check,e.clone=(s,l)=>ps(e,s,l),e.brand=()=>e,e.register=((s,l)=>(s.add(e,l),e)),e.parse=(s,l)=>m_(e,s,l,{callee:e.parse}),e.safeParse=(s,l)=>g_(e,s,l),e.parseAsync=async(s,l)=>p_(e,s,l,{callee:e.parseAsync}),e.safeParseAsync=async(s,l)=>y_(e,s,l),e.spa=e.safeParseAsync,e.encode=(s,l)=>v_(e,s,l),e.decode=(s,l)=>b_(e,s,l),e.encodeAsync=async(s,l)=>x_(e,s,l),e.decodeAsync=async(s,l)=>S_(e,s,l),e.safeEncode=(s,l)=>w_(e,s,l),e.safeDecode=(s,l)=>j_(e,s,l),e.safeEncodeAsync=async(s,l)=>N_(e,s,l),e.safeDecodeAsync=async(s,l)=>k_(e,s,l),e.refine=(s,l)=>e.check(bC(s,l)),e.superRefine=s=>e.check(xC(s)),e.overwrite=s=>e.check(Fa(s)),e.optional=()=>e0(e),e.exactOptional=()=>lC(e),e.nullable=()=>t0(e),e.nullish=()=>e0(t0(e)),e.nonoptional=s=>fC(e,s),e.array=()=>ot(e),e.or=s=>F_([e,s]),e.and=s=>eC(e,s),e.transform=s=>n0(e,sC(s)),e.default=s=>cC(e,s),e.prefault=s=>dC(e,s),e.catch=s=>mC(e,s),e.pipe=s=>n0(e,s),e.readonly=()=>yC(e),e.describe=s=>{const l=e.clone();return Vl.add(l,{description:s}),l},Object.defineProperty(e,"description",{get(){return Vl.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Vl.get(e);const l=e.clone();return Vl.add(l,s[0]),l},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),hb=J("_ZodString",(e,n)=>{sh.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(l,o,u)=>$z(e,l,o);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...l)=>e.check(Sz(...l)),e.includes=(...l)=>e.check(Nz(...l)),e.startsWith=(...l)=>e.check(kz(...l)),e.endsWith=(...l)=>e.check(zz(...l)),e.min=(...l)=>e.check(Wo(...l)),e.max=(...l)=>e.check(rb(...l)),e.length=(...l)=>e.check(ob(...l)),e.nonempty=(...l)=>e.check(Wo(1,...l)),e.lowercase=l=>e.check(wz(l)),e.uppercase=l=>e.check(jz(l)),e.trim=()=>e.check(Cz()),e.normalize=(...l)=>e.check(_z(...l)),e.toLowerCase=()=>e.check(Ez()),e.toUpperCase=()=>e.check(Az()),e.slugify=()=>e.check(Tz())}),z_=J("ZodString",(e,n)=>{sh.init(e,n),hb.init(e,n),e.email=s=>e.check(Kk(__,s)),e.url=s=>e.check(Xk(C_,s)),e.jwt=s=>e.check(dz(H_,s)),e.emoji=s=>e.check(Jk(E_,s)),e.guid=s=>e.check(Py(Fy,s)),e.uuid=s=>e.check(Yk($o,s)),e.uuidv4=s=>e.check(Vk($o,s)),e.uuidv6=s=>e.check(Pk($o,s)),e.uuidv7=s=>e.check(Qk($o,s)),e.nanoid=s=>e.check(Fk(A_,s)),e.guid=s=>e.check(Py(Fy,s)),e.cuid=s=>e.check(Wk(T_,s)),e.cuid2=s=>e.check(ez(O_,s)),e.ulid=s=>e.check(tz(D_,s)),e.base64=s=>e.check(oz(I_,s)),e.base64url=s=>e.check(cz(q_,s)),e.xid=s=>e.check(nz(R_,s)),e.ksuid=s=>e.check(iz(M_,s)),e.ipv4=s=>e.check(sz(L_,s)),e.ipv6=s=>e.check(az(U_,s)),e.cidrv4=s=>e.check(lz($_,s)),e.cidrv6=s=>e.check(rz(B_,s)),e.e164=s=>e.check(uz(Z_,s)),e.datetime=s=>e.check(l_(s)),e.date=s=>e.check(o_(s)),e.time=s=>e.check(u_(s)),e.duration=s=>e.check(f_(s))});function ee(e){return Gk(z_,e)}const gt=J("ZodStringFormat",(e,n)=>{ht.init(e,n),hb.init(e,n)}),__=J("ZodEmail",(e,n)=>{J2.init(e,n),gt.init(e,n)}),Fy=J("ZodGUID",(e,n)=>{Q2.init(e,n),gt.init(e,n)}),$o=J("ZodUUID",(e,n)=>{X2.init(e,n),gt.init(e,n)}),C_=J("ZodURL",(e,n)=>{F2.init(e,n),gt.init(e,n)}),E_=J("ZodEmoji",(e,n)=>{W2.init(e,n),gt.init(e,n)}),A_=J("ZodNanoID",(e,n)=>{ek.init(e,n),gt.init(e,n)}),T_=J("ZodCUID",(e,n)=>{tk.init(e,n),gt.init(e,n)}),O_=J("ZodCUID2",(e,n)=>{nk.init(e,n),gt.init(e,n)}),D_=J("ZodULID",(e,n)=>{ik.init(e,n),gt.init(e,n)}),R_=J("ZodXID",(e,n)=>{sk.init(e,n),gt.init(e,n)}),M_=J("ZodKSUID",(e,n)=>{ak.init(e,n),gt.init(e,n)}),L_=J("ZodIPv4",(e,n)=>{uk.init(e,n),gt.init(e,n)}),U_=J("ZodIPv6",(e,n)=>{dk.init(e,n),gt.init(e,n)}),$_=J("ZodCIDRv4",(e,n)=>{fk.init(e,n),gt.init(e,n)}),B_=J("ZodCIDRv6",(e,n)=>{hk.init(e,n),gt.init(e,n)}),I_=J("ZodBase64",(e,n)=>{mk.init(e,n),gt.init(e,n)}),q_=J("ZodBase64URL",(e,n)=>{gk.init(e,n),gt.init(e,n)}),Z_=J("ZodE164",(e,n)=>{yk.init(e,n),gt.init(e,n)}),H_=J("ZodJWT",(e,n)=>{bk.init(e,n),gt.init(e,n)}),mb=J("ZodNumber",(e,n)=>{ib.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(l,o,u)=>Bz(e,l,o),e.gt=(l,o)=>e.check(Xy(l,o)),e.gte=(l,o)=>e.check(af(l,o)),e.min=(l,o)=>e.check(af(l,o)),e.lt=(l,o)=>e.check(Qy(l,o)),e.lte=(l,o)=>e.check(sf(l,o)),e.max=(l,o)=>e.check(sf(l,o)),e.int=l=>e.check(Wy(l)),e.safe=l=>e.check(Wy(l)),e.positive=l=>e.check(Xy(0,l)),e.nonnegative=l=>e.check(af(0,l)),e.negative=l=>e.check(Qy(0,l)),e.nonpositive=l=>e.check(sf(0,l)),e.multipleOf=(l,o)=>e.check(Jy(l,o)),e.step=(l,o)=>e.check(Jy(l,o)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function Kt(e){return gz(mb,e)}const G_=J("ZodNumberFormat",(e,n)=>{xk.init(e,n),mb.init(e,n)});function Wy(e){return yz(G_,e)}const K_=J("ZodBoolean",(e,n)=>{Sk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Iz(e,s,l)});function ah(e){return vz(K_,e)}const Y_=J("ZodUnknown",(e,n)=>{wk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Zz()});function bf(){return bz(Y_)}const V_=J("ZodNever",(e,n)=>{jk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>qz(e,s,l)});function P_(e){return xz(V_,e)}const Q_=J("ZodArray",(e,n)=>{Nk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Vz(e,s,l,o),e.element=n.element,e.min=(s,l)=>e.check(Wo(s,l)),e.nonempty=s=>e.check(Wo(1,s)),e.max=(s,l)=>e.check(rb(s,l)),e.length=(s,l)=>e.check(ob(s,l)),e.unwrap=()=>e.element});function ot(e,n){return Oz(Q_,e,n)}const X_=J("ZodObject",(e,n)=>{zk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Pz(e,s,l,o),We(e,"shape",()=>n.shape),e.keyof=()=>Vn(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:bf()}),e.loose=()=>e.clone({...e._zod.def,catchall:bf()}),e.strict=()=>e.clone({...e._zod.def,catchall:P_()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>V1(e,s),e.safeExtend=s=>P1(e,s),e.merge=s=>Q1(e,s),e.pick=s=>K1(e,s),e.omit=s=>Y1(e,s),e.partial=(...s)=>X1(pb,e,s[0]),e.required=(...s)=>J1(gb,e,s[0])});function ct(e,n){const s={type:"object",shape:e??{},...be(n)};return new X_(s)}const J_=J("ZodUnion",(e,n)=>{_k.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Qz(e,s,l,o),e.options=n.options});function F_(e,n){return new J_({type:"union",options:e,...be(n)})}const W_=J("ZodIntersection",(e,n)=>{Ck.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Xz(e,s,l,o)});function eC(e,n){return new W_({type:"intersection",left:e,right:n})}const tC=J("ZodRecord",(e,n)=>{Ek.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Jz(e,s,l,o),e.keyType=n.keyType,e.valueType=n.valueType});function lh(e,n,s){return new tC({type:"record",keyType:e,valueType:n,...be(s)})}const xf=J("ZodEnum",(e,n)=>{Ak.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(l,o,u)=>Hz(e,l,o),e.enum=n.entries,e.options=Object.values(n.entries);const s=new Set(Object.keys(n.entries));e.extract=(l,o)=>{const u={};for(const d of l)if(s.has(d))u[d]=n.entries[d];else throw new Error(`Key ${d} not found in enum`);return new xf({...n,checks:[],...be(o),entries:u})},e.exclude=(l,o)=>{const u={...n.entries};for(const d of l)if(s.has(d))delete u[d];else throw new Error(`Key ${d} not found in enum`);return new xf({...n,checks:[],...be(o),entries:u})}});function Vn(e,n){const s=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new xf({type:"enum",entries:s,...be(n)})}const nC=J("ZodLiteral",(e,n)=>{Tk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Gz(e,s,l),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function tc(e,n){return new nC({type:"literal",values:Array.isArray(e)?e:[e],...be(n)})}const iC=J("ZodTransform",(e,n)=>{Ok.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Yz(e,s),e._zod.parse=(s,l)=>{if(l.direction==="backward")throw new qv(e.constructor.name);s.addIssue=u=>{if(typeof u=="string")s.issues.push(er(u,s.value,n));else{const d=u;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=s.value),d.inst??(d.inst=e),s.issues.push(er(d))}};const o=n.transform(s.value,s);return o instanceof Promise?o.then(u=>(s.value=u,s)):(s.value=o,s)}});function sC(e){return new iC({type:"transform",transform:e})}const pb=J("ZodOptional",(e,n)=>{lb.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>fb(e,s,l,o),e.unwrap=()=>e._zod.def.innerType});function e0(e){return new pb({type:"optional",innerType:e})}const aC=J("ZodExactOptional",(e,n)=>{Dk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>fb(e,s,l,o),e.unwrap=()=>e._zod.def.innerType});function lC(e){return new aC({type:"optional",innerType:e})}const rC=J("ZodNullable",(e,n)=>{Rk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Fz(e,s,l,o),e.unwrap=()=>e._zod.def.innerType});function t0(e){return new rC({type:"nullable",innerType:e})}const oC=J("ZodDefault",(e,n)=>{Mk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>e_(e,s,l,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function cC(e,n){return new oC({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Kv(n)}})}const uC=J("ZodPrefault",(e,n)=>{Lk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>t_(e,s,l,o),e.unwrap=()=>e._zod.def.innerType});function dC(e,n){return new uC({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():Kv(n)}})}const gb=J("ZodNonOptional",(e,n)=>{Uk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Wz(e,s,l,o),e.unwrap=()=>e._zod.def.innerType});function fC(e,n){return new gb({type:"nonoptional",innerType:e,...be(n)})}const hC=J("ZodCatch",(e,n)=>{$k.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>n_(e,s,l,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function mC(e,n){return new hC({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const pC=J("ZodPipe",(e,n)=>{Bk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>i_(e,s,l,o),e.in=n.in,e.out=n.out});function n0(e,n){return new pC({type:"pipe",in:e,out:n})}const gC=J("ZodReadonly",(e,n)=>{Ik.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>s_(e,s,l,o),e.unwrap=()=>e._zod.def.innerType});function yC(e){return new gC({type:"readonly",innerType:e})}const vC=J("ZodCustom",(e,n)=>{qk.init(e,n),pt.init(e,n),e._zod.processJSONSchema=(s,l,o)=>Kz(e,s)});function bC(e,n={}){return Dz(vC,e,n)}function xC(e){return Rz(e)}ct({maxConcurrency:Kt().int().positive(),maxRequestsPerMinute:Kt().int().positive(),maxRequestsPerDay:Kt().int().positive()});const SC=["gemini","openai","claude","local"],jc=Vn(SC),yb=ct({label:ee().min(1),city:ee().min(1),region:ee().min(1),country:ee().length(2),timezone:ee().optional()}),vb=Vn(["citation.lost","citation.gained","run.completed","run.failed"]);ct({id:ee(),projectId:ee(),channel:tc("webhook"),url:ee().url(),events:ot(vb),enabled:ah().default(!0),webhookSecret:ee().optional(),createdAt:ee(),updatedAt:ee()});const wC=ct({name:ee().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:lh(ee(),ee()).optional().default({})}),jC=ct({preset:ee().optional(),cron:ee().optional(),timezone:ee().optional().default("UTC"),providers:ot(jc).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),NC=ct({channel:tc("webhook"),url:ee().url(),events:ot(vb).min(1)}),kC=ct({gsc:ct({propertyUrl:ee()}).optional(),syncSchedule:ct({preset:ee().optional(),cron:ee().optional()}).optional()}).optional(),zC=ct({displayName:ee().min(1),canonicalDomain:ee().min(1),ownedDomains:ot(ee().min(1)).optional().default([]),country:ee().length(2),language:ee().min(2),keywords:ot(ee().min(1)).optional().default([]),competitors:ot(ee().min(1)).optional().default([]),providers:ot(jc).optional().default([]),locations:ot(yb).optional().default([]),defaultLocation:ee().optional(),schedule:jC,notifications:ot(NC).optional().default([]),google:kC});ct({apiVersion:tc("canonry/v1"),kind:tc("Project"),metadata:wC,spec:zC});const _C=Vn(["gsc","ga4"]);ct({id:ee(),domain:ee(),connectionType:_C,propertyId:ee().nullable().optional(),sitemapUrl:ee().nullable().optional(),scopes:ot(ee()).default([]),createdAt:ee(),updatedAt:ee()});ct({date:ee(),query:ee(),page:ee(),country:ee().nullable().optional(),device:ee().nullable().optional(),clicks:Kt(),impressions:Kt(),ctr:Kt(),position:Kt()});const Sf=ct({id:ee(),url:ee(),indexingState:ee().nullable().optional(),verdict:ee().nullable().optional(),coverageState:ee().nullable().optional(),pageFetchState:ee().nullable().optional(),robotsTxtState:ee().nullable().optional(),crawlTime:ee().nullable().optional(),lastCrawlResult:ee().nullable().optional(),isMobileFriendly:ah().nullable().optional(),richResults:ot(ee()).default([]),inspectedAt:ee()});Vn(["stable","reindexed","deindexed","still-missing","new"]);const CC=ct({url:ee(),previousState:ee().nullable(),currentState:ee().nullable(),transitionDate:ee()}),EC=ct({reason:ee(),count:Kt(),urls:ot(Sf).default([])});ct({summary:ct({total:Kt(),indexed:Kt(),notIndexed:Kt(),deindexed:Kt(),percentage:Kt()}),lastInspectedAt:ee().nullable(),indexed:ot(Sf).default([]),notIndexed:ot(Sf).default([]),deindexed:ot(CC).default([]),reasonGroups:ot(EC).default([])});ct({date:ee(),indexed:Kt(),notIndexed:Kt(),reasonBreakdown:lh(ee(),Kt()).default({})});const AC=Vn(["cli","api","config-file"]);ct({id:ee(),name:ee(),displayName:ee().optional(),canonicalDomain:ee(),ownedDomains:ot(ee()).default([]),country:ee().length(2),language:ee().min(2),tags:ot(ee()).default([]),labels:lh(ee(),ee()).default({}),locations:ot(yb).default([]),defaultLocation:ee().nullable().optional(),configSource:AC.default("cli"),configRevision:Kt().int().positive().default(1),createdAt:ee().optional(),updatedAt:ee().optional()});function wf(e){let n=e.trim().toLowerCase();try{n.includes("://")&&(n=new URL(n).hostname.toLowerCase())}catch{}return n.replace(/^www\./,"")}function TC(e){const n=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,l=[];for(const o of n){const u=o.trim();if(!u)continue;const d=wf(u);s.has(d)||(s.add(d),l.push(u))}return l}const OC=Vn(["queued","running","completed","partial","failed"]),DC=Vn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),RC=Vn(["manual","scheduled","config-apply"]),MC=Vn(["cited","not-cited"]),LC=Vn(["new","cited","lost","emerging","not-cited"]);ct({id:ee(),projectId:ee(),kind:DC,status:OC,trigger:RC.default("manual"),location:ee().nullable().optional(),startedAt:ee().nullable().optional(),finishedAt:ee().nullable().optional(),error:ee().nullable().optional(),createdAt:ee()});const UC=ct({uri:ee(),title:ee()});ct({id:ee(),runId:ee(),keywordId:ee(),keyword:ee().optional(),provider:jc,citationState:MC,transition:LC.optional(),answerText:ee().nullable().optional(),citedDomains:ot(ee()).default([]),competitorOverlap:ot(ee()).default([]),groundingSources:ot(UC).default([]),searchQueries:ot(ee()).default([]),model:ee().nullable().optional(),location:ee().nullable().optional(),createdAt:ee()});ct({id:ee(),projectId:ee().nullable().optional(),actor:ee(),action:ee(),entityType:ee(),entityId:ee().nullable().optional(),diff:bf().optional(),createdAt:ee()});ct({id:ee(),projectId:ee(),cronExpr:ee(),preset:ee().nullable().optional(),timezone:ee().default("UTC"),enabled:ah().default(!0),providers:ot(jc).default([]),lastRunAt:ee().nullable().optional(),nextRunAt:ee().nullable().optional(),createdAt:ee(),updatedAt:ee()});function bb(e){var n,s,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(s=bb(e[n]))&&(l&&(l+=" "),l+=s)}else for(s in e)e[s]&&(l&&(l+=" "),l+=s);return l}function xb(){for(var e,n,s=0,l="",o=arguments.length;s<o;s++)(e=arguments[s])&&(n=bb(e))&&(l&&(l+=" "),l+=n);return l}const i0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,s0=xb,Sb=(e,n)=>s=>{var l;if(n?.variants==null)return s0(e,s?.class,s?.className);const{variants:o,defaultVariants:u}=n,d=Object.keys(o).map(p=>{const b=s?.[p],v=u?.[p];if(b===null)return null;const w=i0(b)||i0(v);return o[p][w]}),m=s&&Object.entries(s).reduce((p,b)=>{let[v,w]=b;return w===void 0||(p[v]=w),p},{}),g=n==null||(l=n.compoundVariants)===null||l===void 0?void 0:l.reduce((p,b)=>{let{class:v,className:w,...N}=b;return Object.entries(N).every(z=>{let[j,k]=z;return Array.isArray(k)?k.includes({...u,...m}[j]):{...u,...m}[j]===k})?[...p,v,w]:p},[]);return s0(e,d,g,s?.class,s?.className)},$C=(e,n)=>{const s=new Array(e.length+n.length);for(let l=0;l<e.length;l++)s[l]=e[l];for(let l=0;l<n.length;l++)s[e.length+l]=n[l];return s},BC=(e,n)=>({classGroupId:e,validator:n}),wb=(e=new Map,n=null,s)=>({nextPart:e,validators:n,classGroupId:s}),nc="-",a0=[],IC="arbitrary..",qC=e=>{const n=HC(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:l}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return ZC(d);const m=d.split(nc),g=m[0]===""&&m.length>1?1:0;return jb(m,g,n)},getConflictingClassGroupIds:(d,m)=>{if(m){const g=l[d],p=s[d];return g?p?$C(p,g):g:p||a0}return s[d]||a0}}},jb=(e,n,s)=>{if(e.length-n===0)return s.classGroupId;const o=e[n],u=s.nextPart.get(o);if(u){const p=jb(e,n+1,u);if(p)return p}const d=s.validators;if(d===null)return;const m=n===0?e.join(nc):e.slice(n).join(nc),g=d.length;for(let p=0;p<g;p++){const b=d[p];if(b.validator(m))return b.classGroupId}},ZC=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),s=n.indexOf(":"),l=n.slice(0,s);return l?IC+l:void 0})(),HC=e=>{const{theme:n,classGroups:s}=e;return GC(s,n)},GC=(e,n)=>{const s=wb();for(const l in e){const o=e[l];rh(o,s,l,n)}return s},rh=(e,n,s,l)=>{const o=e.length;for(let u=0;u<o;u++){const d=e[u];KC(d,n,s,l)}},KC=(e,n,s,l)=>{if(typeof e=="string"){YC(e,n,s);return}if(typeof e=="function"){VC(e,n,s,l);return}PC(e,n,s,l)},YC=(e,n,s)=>{const l=e===""?n:Nb(n,e);l.classGroupId=s},VC=(e,n,s,l)=>{if(QC(e)){rh(e(l),n,s,l);return}n.validators===null&&(n.validators=[]),n.validators.push(BC(s,e))},PC=(e,n,s,l)=>{const o=Object.entries(e),u=o.length;for(let d=0;d<u;d++){const[m,g]=o[d];rh(g,Nb(n,m),s,l)}},Nb=(e,n)=>{let s=e;const l=n.split(nc),o=l.length;for(let u=0;u<o;u++){const d=l[u];let m=s.nextPart.get(d);m||(m=wb(),s.nextPart.set(d,m)),s=m}return s},QC=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,XC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,s=Object.create(null),l=Object.create(null);const o=(u,d)=>{s[u]=d,n++,n>e&&(n=0,l=s,s=Object.create(null))};return{get(u){let d=s[u];if(d!==void 0)return d;if((d=l[u])!==void 0)return o(u,d),d},set(u,d){u in s?s[u]=d:o(u,d)}}},jf="!",l0=":",JC=[],r0=(e,n,s,l,o)=>({modifiers:e,hasImportantModifier:n,baseClassName:s,maybePostfixModifierPosition:l,isExternal:o}),FC=e=>{const{prefix:n,experimentalParseClassName:s}=e;let l=o=>{const u=[];let d=0,m=0,g=0,p;const b=o.length;for(let j=0;j<b;j++){const k=o[j];if(d===0&&m===0){if(k===l0){u.push(o.slice(g,j)),g=j+1;continue}if(k==="/"){p=j;continue}}k==="["?d++:k==="]"?d--:k==="("?m++:k===")"&&m--}const v=u.length===0?o:o.slice(g);let w=v,N=!1;v.endsWith(jf)?(w=v.slice(0,-1),N=!0):v.startsWith(jf)&&(w=v.slice(1),N=!0);const z=p&&p>g?p-g:void 0;return r0(u,N,w,z)};if(n){const o=n+l0,u=l;l=d=>d.startsWith(o)?u(d.slice(o.length)):r0(JC,!1,d,void 0,!0)}if(s){const o=l;l=u=>s({className:u,parseClassName:o})}return l},WC=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((s,l)=>{n.set(s,1e6+l)}),s=>{const l=[];let o=[];for(let u=0;u<s.length;u++){const d=s[u],m=d[0]==="[",g=n.has(d);m||g?(o.length>0&&(o.sort(),l.push(...o),o=[]),l.push(d)):o.push(d)}return o.length>0&&(o.sort(),l.push(...o)),l}},eE=e=>({cache:XC(e.cacheSize),parseClassName:FC(e),sortModifiers:WC(e),...qC(e)}),tE=/\s+/,nE=(e,n)=>{const{parseClassName:s,getClassGroupId:l,getConflictingClassGroupIds:o,sortModifiers:u}=n,d=[],m=e.trim().split(tE);let g="";for(let p=m.length-1;p>=0;p-=1){const b=m[p],{isExternal:v,modifiers:w,hasImportantModifier:N,baseClassName:z,maybePostfixModifierPosition:j}=s(b);if(v){g=b+(g.length>0?" "+g:g);continue}let k=!!j,A=l(k?z.substring(0,j):z);if(!A){if(!k){g=b+(g.length>0?" "+g:g);continue}if(A=l(z),!A){g=b+(g.length>0?" "+g:g);continue}k=!1}const E=w.length===0?"":w.length===1?w[0]:u(w).join(":"),O=N?E+jf:E,D=O+A;if(d.indexOf(D)>-1)continue;d.push(D);const L=o(A,k);for(let H=0;H<L.length;++H){const V=L[H];d.push(O+V)}g=b+(g.length>0?" "+g:g)}return g},iE=(...e)=>{let n=0,s,l,o="";for(;n<e.length;)(s=e[n++])&&(l=kb(s))&&(o&&(o+=" "),o+=l);return o},kb=e=>{if(typeof e=="string")return e;let n,s="";for(let l=0;l<e.length;l++)e[l]&&(n=kb(e[l]))&&(s&&(s+=" "),s+=n);return s},sE=(e,...n)=>{let s,l,o,u;const d=g=>{const p=n.reduce((b,v)=>v(b),e());return s=eE(p),l=s.cache.get,o=s.cache.set,u=m,m(g)},m=g=>{const p=l(g);if(p)return p;const b=nE(g,s);return o(g,b),b};return u=d,(...g)=>u(iE(...g))},aE=[],$t=e=>{const n=s=>s[e]||aE;return n.isThemeGetter=!0,n},zb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_b=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,rE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oE=/\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$/,cE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,as=e=>lE.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),ls=e=>!!e&&Number.isInteger(Number(e)),lf=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),Ci=e=>rE.test(e),Cb=()=>!0,fE=e=>oE.test(e)&&!cE.test(e),oh=()=>!1,hE=e=>uE.test(e),mE=e=>dE.test(e),pE=e=>!ge(e)&&!ye(e),gE=e=>gs(e,Tb,oh),ge=e=>zb.test(e),Us=e=>gs(e,Ob,fE),o0=e=>gs(e,NE,Oe),yE=e=>gs(e,Rb,Cb),vE=e=>gs(e,Db,oh),c0=e=>gs(e,Eb,oh),bE=e=>gs(e,Ab,mE),Bo=e=>gs(e,Mb,hE),ye=e=>_b.test(e),Kl=e=>Ys(e,Ob),xE=e=>Ys(e,Db),u0=e=>Ys(e,Eb),SE=e=>Ys(e,Tb),wE=e=>Ys(e,Ab),Io=e=>Ys(e,Mb,!0),jE=e=>Ys(e,Rb,!0),gs=(e,n,s)=>{const l=zb.exec(e);return l?l[1]?n(l[1]):s(l[2]):!1},Ys=(e,n,s=!1)=>{const l=_b.exec(e);return l?l[1]?n(l[1]):s:!1},Eb=e=>e==="position"||e==="percentage",Ab=e=>e==="image"||e==="url",Tb=e=>e==="length"||e==="size"||e==="bg-size",Ob=e=>e==="length",NE=e=>e==="number",Db=e=>e==="family-name",Rb=e=>e==="number"||e==="weight",Mb=e=>e==="shadow",kE=()=>{const e=$t("color"),n=$t("font"),s=$t("text"),l=$t("font-weight"),o=$t("tracking"),u=$t("leading"),d=$t("breakpoint"),m=$t("container"),g=$t("spacing"),p=$t("radius"),b=$t("shadow"),v=$t("inset-shadow"),w=$t("text-shadow"),N=$t("drop-shadow"),z=$t("blur"),j=$t("perspective"),k=$t("aspect"),A=$t("ease"),E=$t("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...D(),ye,ge],H=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],R=()=>[ye,ge,g],Q=()=>[as,"full","auto",...R()],Se=()=>[ls,"none","subgrid",ye,ge],ae=()=>["auto",{span:["full",ls,ye,ge]},ls,ye,ge],fe=()=>[ls,"auto",ye,ge],Ae=()=>["auto","min","max","fr",ye,ge],qe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Le=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...R()],K=()=>[as,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],se=()=>[as,"screen","full","dvw","lvw","svw","min","max","fit",...R()],he=()=>[as,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],te=()=>[e,ye,ge],C=()=>[...D(),u0,c0,{position:[ye,ge]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",SE,gE,{size:[ye,ge]}],F=()=>[lf,Kl,Us],de=()=>["","none","full",p,ye,ge],me=()=>["",Oe,Kl,Us],we=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Oe,lf,u0,c0],Ze=()=>["","none",z,ye,ge],le=()=>["none",Oe,ye,ge],Ie=()=>["none",Oe,ye,ge],Mt=()=>[Oe,ye,ge],ut=()=>[as,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ci],breakpoint:[Ci],color:[Cb],container:[Ci],"drop-shadow":[Ci],ease:["in","out","in-out"],font:[pE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ci],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ci],shadow:[Ci],spacing:["px",Oe],text:[Ci],"text-shadow":[Ci],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",as,ge,ye,k]}],container:["container"],columns:[{columns:[Oe,ge,ye,m]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{"inset-s":Q(),start:Q()}],end:[{"inset-e":Q(),end:Q()}],"inset-bs":[{"inset-bs":Q()}],"inset-be":[{"inset-be":Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[ls,"auto",ye,ge]}],basis:[{basis:[as,"full","auto",m,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,as,"auto","initial","none",ge]}],grow:[{grow:["",Oe,ye,ge]}],shrink:[{shrink:["",Oe,ye,ge]}],order:[{order:[ls,"first","last","none",ye,ge]}],"grid-cols":[{"grid-cols":Se()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":fe()}],"col-end":[{"col-end":fe()}],"grid-rows":[{"grid-rows":Se()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":fe()}],"row-end":[{"row-end":fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...qe(),"normal"]}],"justify-items":[{"justify-items":[...Le(),"normal"]}],"justify-self":[{"justify-self":["auto",...Le()]}],"align-content":[{content:["normal",...qe()]}],"align-items":[{items:[...Le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Le(),{baseline:["","last"]}]}],"place-content":[{"place-content":qe()}],"place-items":[{"place-items":[...Le(),"baseline"]}],"place-self":[{"place-self":["auto",...Le()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m: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":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...se()]}],"min-inline-size":[{"min-inline":["auto",...se()]}],"max-inline-size":[{"max-inline":["none",...se()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],w:[{w:[m,"screen",...K()]}],"min-w":[{"min-w":[m,"screen","none",...K()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[d]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",s,Kl,Us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,jE,yE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lf,ge]}],"font-family":[{font:[xE,vE,n]}],"font-features":[{"font-features":[ge]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ye,ge]}],"line-clamp":[{"line-clamp":[Oe,"none",ye,o0]}],leading:[{leading:[u,...R()]}],"list-image":[{"list-image":["none",ye,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:te()}],"text-color":[{text:te()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ye,Us]}],"text-decoration-color":[{decoration:te()}],"underline-offset":[{"underline-offset":[Oe,"auto",ye,ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,ge]}],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",ye,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:C()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ls,ye,ge],radial:["",ye,ge],conic:[ls,ye,ge]},wE,bE]}],"bg-color":[{bg:te()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:te()}],"gradient-via":[{via:te()}],"gradient-to":[{to:te()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:te()}],"border-color-x":[{"border-x":te()}],"border-color-y":[{"border-y":te()}],"border-color-s":[{"border-s":te()}],"border-color-e":[{"border-e":te()}],"border-color-bs":[{"border-bs":te()}],"border-color-be":[{"border-be":te()}],"border-color-t":[{"border-t":te()}],"border-color-r":[{"border-r":te()}],"border-color-b":[{"border-b":te()}],"border-color-l":[{"border-l":te()}],"divide-color":[{divide:te()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ye,ge]}],"outline-w":[{outline:["",Oe,Kl,Us]}],"outline-color":[{outline:te()}],shadow:[{shadow:["","none",b,Io,Bo]}],"shadow-color":[{shadow:te()}],"inset-shadow":[{"inset-shadow":["none",v,Io,Bo]}],"inset-shadow-color":[{"inset-shadow":te()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:te()}],"ring-offset-w":[{"ring-offset":[Oe,Us]}],"ring-offset-color":[{"ring-offset":te()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":te()}],"text-shadow":[{"text-shadow":["none",w,Io,Bo]}],"text-shadow-color":[{"text-shadow":te()}],opacity:[{opacity:[Oe,ye,ge]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":te()}],"mask-image-linear-to-color":[{"mask-linear-to":te()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":te()}],"mask-image-t-to-color":[{"mask-t-to":te()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":te()}],"mask-image-r-to-color":[{"mask-r-to":te()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":te()}],"mask-image-b-to-color":[{"mask-b-to":te()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":te()}],"mask-image-l-to-color":[{"mask-l-to":te()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":te()}],"mask-image-x-to-color":[{"mask-x-to":te()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":te()}],"mask-image-y-to-color":[{"mask-y-to":te()}],"mask-image-radial":[{"mask-radial":[ye,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":te()}],"mask-image-radial-to-color":[{"mask-radial-to":te()}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":te()}],"mask-image-conic-to-color":[{"mask-conic-to":te()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:C()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,ge]}],filter:[{filter:["","none",ye,ge]}],blur:[{blur:Ze()}],brightness:[{brightness:[Oe,ye,ge]}],contrast:[{contrast:[Oe,ye,ge]}],"drop-shadow":[{"drop-shadow":["","none",N,Io,Bo]}],"drop-shadow-color":[{"drop-shadow":te()}],grayscale:[{grayscale:["",Oe,ye,ge]}],"hue-rotate":[{"hue-rotate":[Oe,ye,ge]}],invert:[{invert:["",Oe,ye,ge]}],saturate:[{saturate:[Oe,ye,ge]}],sepia:[{sepia:["",Oe,ye,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,ge]}],"backdrop-blur":[{"backdrop-blur":Ze()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ye,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ye,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ye,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ye,ge]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ye,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ye,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ye,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ye,ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",ye,ge]}],ease:[{ease:["linear","initial",A,ye,ge]}],delay:[{delay:[Oe,ye,ge]}],animate:[{animate:["none",E,ye,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,ye,ge]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:Ie()}],"scale-x":[{"scale-x":Ie()}],"scale-y":[{"scale-y":Ie()}],"scale-z":[{"scale-z":Ie()}],"scale-3d":["scale-3d"],skew:[{skew:Mt()}],"skew-x":[{"skew-x":Mt()}],"skew-y":[{"skew-y":Mt()}],transform:[{transform:[ye,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ut()}],"translate-x":[{"translate-x":ut()}],"translate-y":[{"translate-y":ut()}],"translate-z":[{"translate-z":ut()}],"translate-none":["translate-none"],accent:[{accent:te()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:te()}],"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",ye,ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,ge]}],fill:[{fill:["none",...te()]}],"stroke-w":[{stroke:[Oe,Kl,Us,o0]}],stroke:[{stroke:["none",...te()]}],"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"]}},zE=sE(kE);function Ln(...e){return zE(xb(e))}const _E=Sb("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 Lb({className:e,variant:n,...s}){return c.jsx("div",{className:Ln(_E({variant:n}),e),...s})}var CE=Symbol.for("react.lazy"),ic=_f[" use ".trim().toString()];function EE(e){return typeof e=="object"&&e!==null&&"then"in e}function Ub(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===CE&&"_payload"in e&&EE(e._payload)}function AE(e){const n=OE(e),s=x.forwardRef((l,o)=>{let{children:u,...d}=l;Ub(u)&&typeof ic=="function"&&(u=ic(u._payload));const m=x.Children.toArray(u),g=m.find(RE);if(g){const p=g.props.children,b=m.map(v=>v===g?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:v);return c.jsx(n,{...d,ref:o,children:x.isValidElement(p)?x.cloneElement(p,void 0,b):null})}return c.jsx(n,{...d,ref:o,children:u})});return s.displayName=`${e}.Slot`,s}var TE=AE("Slot");function OE(e){const n=x.forwardRef((s,l)=>{let{children:o,...u}=s;if(Ub(o)&&typeof ic=="function"&&(o=ic(o._payload)),x.isValidElement(o)){const d=LE(o),m=ME(u,o.props);return o.type!==x.Fragment&&(m.ref=l?Hf(l,d):d),x.cloneElement(o,m)}return x.Children.count(o)>1?x.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var DE=Symbol("radix.slottable");function RE(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DE}function ME(e,n){const s={...n};for(const l in n){const o=e[l],u=n[l];/^on[A-Z]/.test(l)?o&&u?s[l]=(...m)=>{const g=u(...m);return o(...m),g}:o&&(s[l]=o):l==="style"?s[l]={...o,...u}:l==="className"&&(s[l]=[o,u].filter(Boolean).join(" "))}return{...e,...s}}function LE(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=n&&"isReactWarning"in n&&n.isReactWarning;return s?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=n&&"isReactWarning"in n&&n.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}const UE=Sb("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-9 px-4",sm:"h-8 px-3 text-xs",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),ce=x.forwardRef(({className:e,variant:n,size:s,asChild:l=!1,...o},u)=>{const d=l?TE:"button";return c.jsx(d,{ref:u,className:Ln(UE({variant:n,size:s,className:e})),...o})});ce.displayName="Button";const Qe=x.forwardRef(({className:e,...n},s)=>c.jsx("div",{ref:s,className:Ln("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)] backdrop-blur",e),...n}));Qe.displayName="Card";const $E=x.forwardRef(({className:e,...n},s)=>c.jsx("div",{ref:s,className:Ln("flex flex-col gap-1.5 p-5",e),...n}));$E.displayName="CardHeader";const BE=x.forwardRef(({className:e,...n},s)=>c.jsx("h3",{ref:s,className:Ln("font-medium tracking-tight text-zinc-50",e),...n}));BE.displayName="CardTitle";const IE=x.forwardRef(({className:e,...n},s)=>c.jsx("p",{ref:s,className:Ln("text-sm text-zinc-500",e),...n}));IE.displayName="CardDescription";const qE=x.forwardRef(({className:e,...n},s)=>c.jsx("div",{ref:s,className:Ln("p-5 pt-0",e),...n}));qE.displayName="CardContent";const ZE=Lv,HE=Uv,$b=x.forwardRef(({className:e,...n},s)=>c.jsx(Vf,{ref:s,className:Ln("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...n}));$b.displayName=Vf.displayName;const GE=400,KE=1200,YE=720,Bb=x.forwardRef(({className:e,children:n,...s},l)=>{const[o,u]=x.useState(YE),d=x.useRef(!1),m=x.useRef(0),g=x.useRef(0),p=x.useCallback(w=>{d.current=!0,m.current=w.clientX,g.current=o,w.target.setPointerCapture(w.pointerId),w.preventDefault()},[o]),b=x.useCallback(w=>{if(!d.current)return;const N=m.current-w.clientX,z=Math.min(KE,Math.max(GE,g.current+N));u(z)},[]),v=x.useCallback(()=>{d.current=!1},[]);return c.jsxs(HE,{children:[c.jsx($b,{}),c.jsxs(Pf,{ref:l,className:Ln("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${o}px, 100vw)`},...s,children:[c.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:p,onPointerMove:b,onPointerUp:v}),n,c.jsxs(Bv,{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:[c.jsx(Jf,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Bb.displayName=Pf.displayName;const VE=({className:e,...n})=>c.jsx("div",{className:Ln("flex flex-col gap-1.5 pr-10",e),...n}),Ib=x.forwardRef(({className:e,...n},s)=>c.jsx(Qf,{ref:s,className:Ln("text-lg font-medium text-zinc-50",e),...n}));Ib.displayName=Qf.displayName;const qb=x.forwardRef(({className:e,...n},s)=>c.jsx($v,{ref:s,className:Ln("text-sm text-zinc-500",e),...n}));qb.displayName=$v.displayName;function Hn(e){const n=new Date("2026-02-20");return e.map((s,l)=>({runId:`run_mock_${l+1}`,citationState:s,createdAt:new Date(n.getTime()+l*2*24*60*60*1e3).toISOString()}))}const Ha=[{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 Nc(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 sc=Nc({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"}),ch=Nc({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"}),uh=Nc({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"}),ac=Nc({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"}),PE=[ch,sc,uh,ac],QE=[{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:Hn(["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:Hn(["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:Hn(["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:Hn(["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:Hn(["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:Hn(["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:Hn(["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:Hn(["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:Hn(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}],XE=[{project:Ha[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:QE,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:[ch,sc]},{project:Ha[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:Hn(["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:[uh]},{project:Ha[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:Hn(["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:[ac]}],JE={portfolioOverview:{projects:[{project:Ha[0],visibilityScore:61,visibilityDelta:"-8 this week",lastRun:sc,insight:"Lost emergency-intent citations after competitors refreshed availability pages.",trend:[73,71,69,66,61],competitorPressureLabel:"High"},{project:Ha[1],visibilityScore:74,visibilityDelta:"+2 this week",lastRun:uh,insight:"Practice-area consolidation is stabilizing branded and informational prompts.",trend:[68,70,71,73,74],competitorPressureLabel:"Moderate"},{project:Ha[2],visibilityScore:58,visibilityDelta:"Run in progress",lastRun:ac,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:[ch,ac,sc],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:XE,runs:PE,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."},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."}},FE={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 WE(e={}){const n=structuredClone(JE),s=structuredClone(FE);if(e.emptyPortfolio&&(n.portfolioOverview.projects=[],n.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"}],n.portfolioOverview.recentRuns=[],n.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"&&(n.runs[0].status="partial",n.runs[0].duration="7m 24s",n.runs[0].statusDetail="Quota window closed mid-run; 14 of 18 prompts completed before the worker paused.",n.runs[0].summary="Partial visibility sweep after quota cap",n.portfolioOverview.recentRuns[0]=n.runs[0]),e.runScenario==="failed"&&(n.runs[0].status="failed",n.runs[0].duration="1m 43s",n.runs[0].statusDetail="Worker could not reach the provider after repeated retry exhaustion.",n.runs[0].summary="Provider retries exhausted before results were captured",n.portfolioOverview.recentRuns[0]=n.runs[0],n.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&&(n.settings.providerStatuses=n.settings.providerStatuses.map(l=>({...l,state:"needs-config",detail:"API key is missing, so answer-visibility sweeps are blocked."}))),e.visibilityDropProjectId){const l=n.projects.find(u=>u.project.id===e.visibilityDropProjectId),o=n.portfolioOverview.projects.find(u=>u.project.id===e.visibilityDropProjectId);l&&(l.visibilitySummary.value="49 / 100",l.visibilitySummary.delta="-12 in 48h",l.visibilitySummary.tone="negative",l.visibilitySummary.description="A sharper drop than normal; citations slipped across both local and service-intent prompts.",l.insights.unshift({id:`${l.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:l.visibilityEvidence.filter(u=>u.citationState==="lost").slice(0,5).map(u=>({keyword:u.keyword,evidenceId:u.id,provider:u.provider||void 0,citationState:u.citationState}))})),o&&(o.visibilityScore=49,o.visibilityDelta="-12 in 48h",o.insight="Sharp citation drop detected; grounding now prefers competitors on multiple high-intent prompts.")}return{dashboard:n,health:s}}function Zb(e,n){return e.projects.find(s=>s.project.id===n)}function eA(e,n){return e.runs.find(s=>s.id===n)}function tA(e,n){for(const s of e.projects){const l=s.visibilityEvidence.find(o=>o.id===n);if(l)return{project:s,evidence:l}}}const nA="/api/v1";function iA(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.apiKey?window.__CANONRY_CONFIG__.apiKey:""}async function Ne(e,n){const s=iA(),l=await fetch(`${nA}${e}`,{...n,headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{},...n?.headers}});if(!l.ok){const o=await l.text();let u=`API ${l.status}: ${l.statusText}`;if(o)try{const d=JSON.parse(o);typeof d.error=="string"?u=d.error:d.error?.message?u=d.error.message:d.message&&(u=d.message)}catch{u=o}throw new Error(u)}if(l.status!==204)return l.json()}function sA(){return Ne("/projects")}function Hb(e){return Ne(`/projects/${encodeURIComponent(e)}`)}function aA(){return Ne("/runs")}function tr(e){return Ne(`/runs/${encodeURIComponent(e)}`)}function lA(e){return Ne(`/projects/${encodeURIComponent(e)}/keywords`)}function Gb(e){return Ne(`/projects/${encodeURIComponent(e)}/competitors`)}function Kb(e,n){const s=new URLSearchParams;n!==void 0&&s.set("location",n);const l=s.toString();return Ne(`/projects/${encodeURIComponent(e)}/timeline${l?`?${l}`:""}`)}function kc(e,n){return Ne(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(n)})}function rA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:n})})}function oA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/keywords`,{method:"DELETE",body:JSON.stringify({keywords:n})})}function cA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:n})})}function Yb(e,n){return Ne(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:n})})}async function uA(e,n){const s=await Hb(e);return kc(e,{displayName:s.displayName,canonicalDomain:s.canonicalDomain,ownedDomains:n,country:s.country,language:s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:s.locations,defaultLocation:s.defaultLocation})}async function dA(e,n){const s=await Hb(e);return kc(e,{displayName:n.displayName??s.displayName,canonicalDomain:n.canonicalDomain??s.canonicalDomain,ownedDomains:n.ownedDomains??s.ownedDomains,country:n.country??s.country,language:n.language??s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:n.locations??s.locations,defaultLocation:n.defaultLocation!==void 0?n.defaultLocation:s.defaultLocation})}function Vb(e,n){const s={};return Ne(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function fA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(n)})}async function hA(e,n){await Ne(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(n)}`,{method:"DELETE"})}function mA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:n})})}async function pA(e){await Ne(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function gA(e){return Ne(`/projects/${encodeURIComponent(e)}/export`)}function Pb(){return Ne("/settings")}function yA(e,n){return Ne(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(n)})}function vA(e){return Ne("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function bA(e){try{return await Ne(`/projects/${encodeURIComponent(e)}/schedule`)}catch(n){if(n instanceof Error&&n.message.includes("404"))return null;throw n}}function d0(e,n){return Ne(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(n)})}async function xA(e){await Ne(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function SA(e){return Ne(`/projects/${encodeURIComponent(e)}/notifications`)}function wA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(n)})}async function jA(e,n){await Ne(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(n)}`,{method:"DELETE",body:"{}"})}function NA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(n)}/test`,{method:"POST",body:"{}"})}function kA(e,n,s){return Ne(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:n,count:s})})}function zA(e){return Ne("/apply",{method:"POST",body:JSON.stringify(e)})}function _A(e){return Ne("/runs",{method:"POST",body:JSON.stringify({})})}function CA(e){return Ne(`/projects/${encodeURIComponent(e)}/google/connections`)}function EA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:n})})}function AA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(n)}`,{method:"DELETE",body:"{}"})}function TA(e){return Ne(`/projects/${encodeURIComponent(e)}/google/properties`)}function OA(e,n,s){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(n)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function DA(e,n,s){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(n)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function RA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(n??{})})}function MA(e,n){const s=new URLSearchParams;n?.startDate&&s.set("startDate",n.startDate),n?.endDate&&s.set("endDate",n.endDate),n?.query&&s.set("query",n.query),n?.page&&s.set("page",n.page),n?.limit!==void 0&&s.set("limit",String(n.limit));const l=s.toString()?`?${s.toString()}`:"";return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/performance${l}`)}function LA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:n})})}function UA(e,n){const s=new URLSearchParams;n?.url&&s.set("url",n.url),s.set("limit",String(n.limit));const l=s.toString()?`?${s.toString()}`:"";return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${l}`)}function $A(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function BA(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function IA(e,n){const s=new URLSearchParams,l=s.toString()?`?${s.toString()}`:"";return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${l}`)}function qA(e,n){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(n??{})})}function ZA(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function HA(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function Qb(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 f0(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function GA(e,n){if(!e)return"Waiting";if(!n)return"Running";const s=new Date(n).getTime()-new Date(e).getTime();if(s<1e3)return"<1s";const l=Math.floor(s/1e3);if(l<60)return`${l}s`;const o=Math.floor(l/60),u=l%60;return`${o}m ${u}s`}function Xb(e){return e==="answer-visibility"?"Answer visibility sweep":e}function KA(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function dh(e,n){return{id:e.id,projectId:e.projectId,projectName:n,kind:e.kind,kindLabel:Xb(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?f0(e.startedAt):f0(e.createdAt),duration:GA(e.startedAt,e.finishedAt),statusDetail:e.error?Jb(e.error):YA(e),summary:VA(e),triggerLabel:KA(e.trigger)}}function Jb(e){try{const s=JSON.parse(e);if(typeof s=="object"&&s!==null){const l=s.message??s.error?.message??s[0]?.error?.message;if(typeof l=="string"&&l.length>0)return l.length>200?l.slice(0,200)+"…":l}}catch{}const n=e.match(/\[.*?\]\s*(.+)/);if(n){const s=n[1];return s.length>200?s.slice(0,200)+"…":s}return e.length>200?e.slice(0,200)+"…":e}function YA(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?Jb(e.error):"Run failed.";default:return""}}function VA(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 Fb(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const n=new Map;for(const u of e){const d=u.keyword??u.id;n.has(d)||n.set(d,!1),u.citationState==="cited"&&n.set(d,!0)}const s=n.size,l=[...n.values()].filter(Boolean).length;return{score:s>0?Math.round(l/s*100):0,citedCount:l,totalCount:s}}function PA(e){return e>=70?"positive":e>=40?"caution":"negative"}function QA(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function Wb(e,n){if(e.length===0||n.length===0)return{label:"None",count:0};const s=new Set(n);let l=0;for(const u of e)u.competitorOverlap.some(d=>s.has(d))&&l++;const o=l/e.length;return o>=.5?{label:"High",count:l}:o>=.2?{label:"Moderate",count:l}:{label:"Low",count:l}}function XA(e,n,s,l){const o=[];let u=0;const d=new Set;if(s){const m=new Map;for(const p of s.snapshots)if(p.keyword){const b=`${p.keyword}::${p.provider}`;m.set(b,p)}const g=[...new Set(s.snapshots.map(p=>p.provider))].sort();g.length===0&&g.push("gemini");for(const p of n){if(p.runs.length===0)continue;d.add(p.keyword);const v=p.runs.at(-1)?.transition??"not-cited",w=v==="lost"?"lost":v==="emerging"?"emerging":v==="cited"?"cited":"not-cited";for(const N of g){const z=m.get(`${p.keyword}::${N}`);if(!z&&g.length>1)continue;const j=z?.model??null,k=j?`${N}:${j}`:null,A=k?p.modelRuns?.[k]:void 0,E=p.providerRuns?.[N],O=(E?.length?E:null)??(A?.length?A:null),D=E?.length?"provider":A?.length?"model":"keyword",L=O?O.at(-1).transition:v,H=L==="lost"?"lost":L==="emerging"?"emerging":z?z.citationState==="cited"?"cited":"not-cited":w,V=Nf(O||p.runs),R=JA(p,N),Q=(O??p.runs).map(Ae=>({runId:Ae.runId,citationState:Ae.citationState,createdAt:Ae.createdAt,model:R.get(Ae.runId)??null})),Se=FA(Q),ae=D==="provider"&&Se.length<=1?"model":D,fe=WA(Q);o.push({id:`evidence_${e}_${u++}`,keyword:p.keyword,provider:z?.provider??N,model:z?.model??null,location:z?.location??null,citationState:H,changeLabel:eT(L,V),answerSnippet:z?.answerText??"",citedDomains:z?.citedDomains??[],evidenceUrls:[],competitorDomains:z?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:z?.groundingSources??[],summary:tT(H,p.keyword),runHistory:Q,historyScope:ae,modelsSeen:Se,modelTransitions:fe})}}}for(const m of l)d.has(m.keyword)||o.push({id:`evidence_${e}_${u++}`,keyword:m.keyword,provider:"",model:null,location:null,citationState:"pending",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${m.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return o}function JA(e,n){const s=new Map,l=`${n}:`;for(const[o,u]of Object.entries(e.modelRuns??{})){if(!o.startsWith(l))continue;const d=o.slice(l.length),m=d==="unknown"?null:d;for(const g of u)s.set(g.runId,m)}return s}function FA(e){const n=new Set;for(const s of e)s.model&&n.add(s.model);return[...n]}function WA(e){const n=[];let s=null;for(const l of e){const o=l.model??null;o!==s&&s!==null&&n.push({runId:l.runId,createdAt:l.createdAt,fromModel:s,toModel:o}),s=o}return n}function Nf(e){if(e.length===0)return 0;const n=e[e.length-1].citationState;let s=0;for(let l=e.length-1;l>=0&&e[l].citationState===n;l--)s++;return s}function eT(e,n){switch(e){case"new":return"First observation";case"cited":return n<=1?"Cited in latest run":`Cited for ${n} runs`;case"lost":return"Lost since last run";case"emerging":return"First citation";case"not-cited":return n<=1?"Not cited in latest run":`Not cited across ${n} runs`;default:return e}}function tT(e,n){switch(e){case"cited":return`Your domain is cited in AI answers for "${n}".`;case"lost":return`Citation was lost for "${n}". Competitors may have gained ground.`;case"emerging":return`Your domain is starting to appear in answers for "${n}".`;case"not-cited":return`No citation detected for "${n}".`;case"pending":return`"${n}" has been added but no visibility run has been triggered yet.`}}function h0(e,n){const s=new Set(n),l=new Map;for(const o of e)if(o.keyword)for(const u of o.competitorOverlap){if(!s.has(u))continue;const d=l.get(u)??new Set;d.add(o.keyword),l.set(u,d)}return l}const rf=3;function nT(e){const{evidence:n,timeline:s,latestSnapshots:l,previousSnapshots:o,trackedCompetitors:u}=e,d=[],m=[],g=new Set;for(const A of n)A.citationState==="lost"&&(g.has(A.keyword)||(g.add(A.keyword),m.push({keyword:A.keyword,evidenceId:A.id,provider:A.provider,citationState:"lost"})));m.length>0&&d.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${m.length} keyword${m.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:m});const p=h0(l,u),b=h0(o,u);for(const A of u){const E=p.get(A)??new Set,O=b.get(A)??new Set,D=[...E].filter(L=>!O.has(L));D.length>0&&d.push({id:`insight_comp_gained_${A}`,tone:"negative",title:`${A} appeared on ${D.length} keyword${D.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:D.map(L=>{const H=n.find(V=>V.keyword===L);return{keyword:L,evidenceId:H?.id??"",citationState:"cited"}})})}const v=new Map;for(const A of s){const E=A.runs.at(-1);E&&v.set(A.keyword,{transition:E.transition,citationState:E.citationState})}const w=[],N=[],z=new Set;for(const[A,{transition:E,citationState:O}]of v){if(!(E==="emerging"||E==="new"&&O==="cited"))continue;z.add(A);const L=n.find(H=>H.keyword===A&&(H.citationState==="emerging"||H.citationState==="cited"));w.push({keyword:A,evidenceId:L?.id??"",provider:L?.provider,citationState:"emerging"})}for(const A of n)A.citationState==="emerging"&&(z.has(A.keyword)||N.push({keyword:A.keyword,evidenceId:A.id,provider:A.provider,citationState:"emerging"}));if(N.length>0){const A=new Set(N.map(E=>E.keyword)).size;d.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${A} keyword${A>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:N})}w.length>0&&d.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${z.size} keyword${z.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:w});const j=new Set(n.map(A=>A.keyword)),k=[];for(const A of s){if(!j.has(A.keyword)||A.runs.length<rf||A.runs.at(-1)?.citationState!=="not-cited")continue;if(Nf(A.runs)>=rf){const D=n.find(L=>L.keyword===A.keyword);k.push({keyword:A.keyword,evidenceId:D?.id??"",citationState:"not-cited"})}}k.length>0&&d.push({id:"insight_persistent_gap",tone:"caution",title:`${k.length} keyword${k.length>1?"s":""} uncited for ${rf}+ runs`,detail:"These keywords have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:k});for(const A of u){const E=p.get(A)??new Set,D=[...b.get(A)??new Set].filter(L=>!E.has(L));D.length>0&&d.push({id:`insight_comp_lost_${A}`,tone:"neutral",title:`${A} dropped from ${D.length} keyword${D.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:D.map(L=>{const H=n.find(V=>V.keyword===L);return{keyword:L,evidenceId:H?.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 iT(e){const n=e[0];if(!n)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=n.status==="completed"?"Healthy":n.status==="running"?"Running":n.status==="queued"?"Queued":n.status==="partial"?"Partial":"Failed",l=n.status==="completed"?"positive":n.status==="failed"?"negative":n.status==="partial"?"caution":"neutral";return{label:"Run Status",value:s,delta:`${e.length} total runs`,tone:l,description:`Latest: ${Xb(n.kind)} — ${n.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function sT(e){const n=Qb(e.project),s=XA(n.name,e.timeline,e.latestRunDetail,e.keywords),l=e.latestRunDetail?.snapshots??[],o=Fb(l),u=Wb(l,e.competitors.map(v=>v.domain)),d=nT({evidence:s,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(v=>v.domain)}),m=[...e.runs].sort((v,w)=>w.createdAt.localeCompare(v.createdAt)),g=m.map(v=>dh(v,e.project.displayName||e.project.name)),p=new Map;for(const v of l){const w=v.provider||"gemini",N=v.model??null,z=`${w}::${N??"unknown"}`,j=p.get(z)??{provider:w,model:N,cited:0,total:0};j.total++,v.citationState==="cited"&&j.cited++,p.set(z,j)}const b=[...p.values()].sort((v,w)=>v.provider.localeCompare(w.provider)||(v.model??"").localeCompare(w.model??"")).map(({provider:v,model:w,cited:N,total:z})=>({provider:v,model:w,score:z>0?Math.round(N/z*100):0,cited:N,total:z}));return{project:n,dateRangeLabel:"All time",contextLabel:`${n.country} / ${n.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:l.length>0?`${o.score}`:"No data",delta:l.length>0?`${o.citedCount} of ${o.totalCount} key phrases visible`:"Run a sweep first",tone:l.length>0?PA(o.score):"neutral",description:l.length>0?`${o.citedCount} of ${o.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[]},providerScores:b,competitorPressure:{label:"Competitor Pressure",value:u.label,delta:u.count>0?`${u.count} overlapping citations`:"No overlap detected",tone:QA(u.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:iT(m),insights:d,visibilityEvidence:s,competitors:e.competitors.map((v,w)=>{const N=new Set;for(const E of l)(E.competitorOverlap.includes(v.domain)||E.citedDomains.includes(v.domain))&&E.keyword&&N.add(E.keyword);const z=[...N],j=new Set(l.map(E=>E.keyword).filter(Boolean)),k=j.size>0?z.length/j.size:0,A=k>=.5?"High":k>=.2?"Moderate":z.length>0?"Low":"None";return{id:v.id||`comp_${w}`,domain:v.domain,citationCount:z.length,totalKeywords:j.size,pressureLabel:A,citedKeywords:z,movement:"",notes:""}}),recentRuns:g.slice(0,5)}}function aT(e){const n=Qb(e.project),s=e.latestRunDetail?.snapshots??[],l=Fb(s),o=Wb(s,e.competitors.map(g=>g.domain)),d=[...e.runs].sort((g,p)=>p.createdAt.localeCompare(g.createdAt))[0],m=d?dh(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:n,visibilityScore:l.score,visibilityDelta:s.length>0?`${l.citedCount} of ${l.totalCount} key phrases`:"No data",lastRun:m,insight:s.length>0?`${l.citedCount} of ${l.totalCount} key phrases visible across ${new Set(s.map(g=>g.provider)).size} provider${new Set(s.map(g=>g.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:o.label}}function lT(e,n){const s=[],l=[],o=[];for(const d of e){l.push(sT(d)),o.push(aT(d));const m=[...d.runs].sort((g,p)=>p.createdAt.localeCompare(g.createdAt));for(const g of m)s.push(dh(g,d.project.displayName||d.project.name))}s.sort((d,m)=>m.createdAt.localeCompare(d.createdAt));const u=e.length>0;return{portfolioOverview:{projects:o,attentionItems:u?rT(l):[{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"}),...u?{}:{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:l,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:u,ctaLabel:u?"Trigger run":"Create a project first",summary:u?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(n?.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:n?.google?.configured?"ready":"needs-config",detail:n?.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."},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 rT(e){const n=[];for(const s of e){const l=s.visibilityEvidence.filter(u=>u.citationState==="lost");l.length>0&&n.push({id:`attention_${s.project.id}_lost`,tone:"negative",title:`${s.project.displayName||s.project.name} lost citations`,detail:`${l.length} key phrase${l.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${s.project.id}`});const o=s.recentRuns.filter(u=>u.status==="running"||u.status==="queued");o.length>0&&n.push({id:`attention_${s.project.id}_active`,tone:"neutral",title:`${s.project.displayName||s.project.name} has active runs`,detail:`${o.length} run${o.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return n.length===0&&n.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),n}const m0=[{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"}],oT=WE(),p0=e=>({label:e,state:"checking",detail:"Checking service health"}),cT={apiStatus:p0("API"),workerStatus:p0("Worker")};async function uT(e,n){try{const s=await fetch(e);if(!s.ok)return{label:n,state:"error",detail:`HTTP ${s.status}`};const l=await s.json(),o=typeof l.version=="string"?l.version:"unknown",u=typeof l.databaseUrlConfigured=="boolean"?l.databaseUrlConfigured:void 0,d=typeof l.lastHeartbeatAt=="string"?l.lastHeartbeatAt:void 0,m=[o,u===!1?"database not configured":"database configured",d?`heartbeat ${d}`:void 0].filter(Boolean).join(" · ");return{label:n,state:"ok",detail:m,version:o,databaseConfigured:u,lastHeartbeatAt:d}}catch(s){return{label:n,state:"error",detail:s instanceof Error?s.message:"unreachable"}}}function cs(e){if(!e)return"/";const n=e.split("?")[0]??"/";return n===""?"/":n.length>1&&n.endsWith("/")?n.slice(0,-1):n}function dT(e,n){const s=cs(e);if(s==="/")return{kind:"overview",path:"/"};if(s==="/runs")return{kind:"runs",path:"/runs"};if(s==="/settings")return{kind:"settings",path:"/settings"};if(s==="/setup")return{kind:"setup",path:"/setup"};if(s==="/projects")return{kind:"projects",path:"/projects"};if(s.startsWith("/projects/")){const l=s.split("/").filter(Boolean);if(l.length<2||l.length>3)return{kind:"not-found",path:s};const[,o,u]=l,d=u===void 0?"overview":u==="search-console"?"search-console":null;return d?Zb(n,o)?{kind:"project",path:s,projectId:o,tab:d}:{kind:"not-found",path:s}:{kind:"not-found",path:s}}return{kind:"not-found",path:s}}function fT(e){return e?cs(e):typeof window<"u"?cs(window.location.pathname):"/"}function lc(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function ex(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"queued":case"running":return"neutral"}}function hT(e){switch(e){case"cited":return"positive";case"emerging":return"caution";case"not-cited":return"caution";case"lost":return"negative";case"pending":return"neutral"}}function mT(e){const n=e.match(/^(\[.*?\])\s*(.+)/);if(n){const s=n[1],l=n[2],o=l.indexOf("{");if(o>=0){const u=l.slice(0,o).trim(),d=l.slice(o);try{const m=JSON.parse(d);return`${s} ${u}
222
+
223
+ ${JSON.stringify(m,null,2)}`}catch{}}return`${s}
224
+ ${l}`}try{const s=JSON.parse(e);return JSON.stringify(s,null,2)}catch{return e}}function zc(e){return e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function pT(e,n,s){return e.map(l=>{if(l.id==="api")return{...l,tone:lc(n.apiStatus),detail:n.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:n.apiStatus.detail};if(l.id==="worker")return{...l,tone:lc(n.workerStatus),detail:n.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:n.workerStatus.detail};const o=s.providerStatuses.filter(g=>g.state==="ready").length,u=s.providerStatuses.length,d=o>0,m=s.providerStatuses.filter(g=>g.state==="ready").map(g=>sx[g.name]??g.name).join(" · ");return{...l,label:"Providers",tone:d?"positive":"caution",detail:`${o} of ${u} configured`,meta:m||"None configured"}})}function gT(e,n){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(!n.providerStatuses.some(s=>s.state==="ready"))return"Launch is blocked until at least one provider is configured."}function yT(e,n,s){const l=gT(n,s),o=structuredClone(e);return o.healthChecks=o.healthChecks.map(u=>{if(u.id==="api")return{...u,detail:n.apiStatus.detail,state:n.apiStatus.state==="ok"?"ready":"attention"};if(u.id==="worker")return{...u,detail:n.workerStatus.detail,state:n.workerStatus.state==="ok"?"ready":"attention"};const d=s.providerStatuses.some(m=>m.state==="ready");return{...u,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),o.launchState.enabled=l===void 0,o.launchState.blockedReason=l,o.launchState.summary=l??"Queue a visibility sweep first, then follow with a site audit to explain movement.",o}function xn(e,n){return s=>{s.preventDefault(),s.stopPropagation(),e(n)}}function qo(e,n){return n==="projects"?e.kind==="projects"||e.kind==="project":n==="project"?e.kind==="project":e.kind===n}function g0({compact:e=!1,navigate:n}){return c.jsxs("a",{className:`brand-lockup ${e?"brand-lockup-compact":""}`,href:"/","aria-label":"Canonry home",onClick:xn(n,"/"),children:[c.jsx("img",{className:"brand-icon",src:"/favicon.svg",alt:"","aria-hidden":"true"}),c.jsxs("span",{className:"brand-copy",children:[c.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:c.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function vT({points:e,tone:n}){const s=x.useId();if(e.length===0)return null;const l=42,o=132,u=5,d=Math.min(...e),g=Math.max(...e)-d||1,p=o-u*2,b=l-u*2,v=e.map((w,N)=>{const z=u+N/Math.max(e.length-1,1)*p,j=u+(1-(w-d)/g)*b;return`${z},${j}`}).join(" ");return c.jsxs("svg",{className:`sparkline sparkline-${n}`,viewBox:`0 0 ${o} ${l}`,"aria-hidden":"true",children:[c.jsx("defs",{children:c.jsx("clipPath",{id:s,children:c.jsx("rect",{x:u,y:u,width:p,height:b,rx:"8"})})}),c.jsx("line",{className:"sparkline-guide",x1:u,x2:o-u,y1:l-u,y2:l-u}),c.jsx("polyline",{clipPath:`url(#${s})`,points:v,vectorEffect:"non-scaling-stroke"})]})}function tx({text:e}){return c.jsxs("span",{className:"info-tooltip-wrapper",children:[c.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[c.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),c.jsx("span",{className:"info-tooltip-bubble",role:"tooltip",children:e})]})}function of({value:e,label:n,delta:s,tone:l,description:o,tooltip:u,isNumeric:d=!0}){const p=2*Math.PI*48,b=Number.parseInt(e,10),v=d&&!Number.isNaN(b)?Math.min(b/100,1):.5,w=p*(1-v);return c.jsxs("div",{className:"score-gauge",children:[c.jsxs("div",{className:"gauge-ring-wrapper",children:[c.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[c.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),c.jsx("circle",{className:`gauge-fill gauge-fill-${l}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:p,strokeDashoffset:w,transform:"rotate(-90 60 60)"})]}),c.jsx("div",{className:"gauge-center",children:c.jsx("span",{className:d?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),c.jsxs("p",{className:"gauge-label",children:[n,u&&c.jsx(tx,{text:u})]}),c.jsx("p",{className:"gauge-delta",children:s}),c.jsx("p",{className:"gauge-description",children:o})]})}function Dt({tone:e,children:n}){const s=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return c.jsx(Lb,{variant:s,children:n})}function _c({status:e}){return c.jsx(Dt,{tone:ex(e),children:zc(e)})}function nx({state:e}){return c.jsx(Dt,{tone:hT(e),children:zc(e)})}function ix({run:e,onOpen:n}){return c.jsxs("article",{className:"run-row",children:[c.jsxs("div",{className:"run-row-main",children:[c.jsxs("div",{className:"run-row-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:e.summary}),c.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),c.jsx(_c,{status:e.status})]}),c.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),c.jsxs("dl",{className:"run-row-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Started"}),c.jsx("dd",{children:e.startedAt})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Duration"}),c.jsx("dd",{children:e.duration})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Trigger"}),c.jsx("dd",{children:e.triggerLabel})]})]}),c.jsx(ce,{variant:"outline",size:"sm",type:"button",onClick:()=>n(e.id),children:"View run"})]})}function fh({provider:e}){const n={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 c.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${n[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function bT({insights:e,onOpenEvidence:n}){const[s,l]=x.useState(null);return c.jsx("div",{className:"insight-list",children:e.map(o=>{const u=s===o.id,d=o.affectedPhrases.length>0;return c.jsxs("div",{children:[c.jsxs("div",{className:`insight-row insight-row-${o.tone} ${d?"cursor-pointer":""}`,onClick:d?()=>l(u?null:o.id):void 0,children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d&&c.jsx(Xf,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${u?"rotate-90":""}`}),c.jsx(Dt,{tone:o.tone,children:o.actionLabel}),c.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:o.title}),c.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:o.detail})]}),d&&c.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[o.affectedPhrases.length," phrase",o.affectedPhrases.length>1?"s":""]})]}),u&&c.jsx("div",{className:"divide-y divide-zinc-800/20",children:o.affectedPhrases.map(m=>c.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(nx,{state:m.citationState}),c.jsx("span",{className:"text-sm text-zinc-200 truncate",children:m.keyword}),c.jsx("div",{className:"hidden sm:flex gap-1",children:m.provider&&c.jsx(fh,{provider:m.provider})})]}),c.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:g=>{g.stopPropagation(),n(m.evidenceId)},children:"View →"})]},m.evidenceId))})]},o.id)})})}function xT({history:e,maxDots:n=12}){const s=e.slice(-n);if(s.length===0)return c.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const l={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},o=new Date(s[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),u=new Date(s[s.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:o}),c.jsx("div",{className:"flex items-center gap-[3px]",title:`${s.length} runs`,children:s.map((d,m)=>c.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${l[d.citationState]??"bg-zinc-700"} ${d.model&&m>0&&s[m-1]?.model&&s[m-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&&m>0&&s[m-1]?.model&&s[m-1].model!==d.model?"model changed":null].filter(Boolean).join(" — ")},m))}),c.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:u})]})}function ST(e){const n=new Map;for(const l of e)for(const o of l.runHistory){const u=n.get(o.createdAt);u?u.states.push(o.citationState):n.set(o.createdAt,{states:[o.citationState],runId:o.runId})}return[...n.entries()].sort(([l],[o])=>l.localeCompare(o)).map(([l,{states:o,runId:u}])=>({runId:u,createdAt:l,citationState:o.includes("cited")?"cited":o.includes("emerging")?"emerging":"not-cited"}))}function wT({phrase:e,items:n,onOpenEvidence:s,showLocationLabels:l=!0,compareLocations:o=!1,timelineLoading:u=!1,onDeleteKeyword:d}){const m=n.map(z=>z.citationState),g=m.includes("cited")?"cited":m.includes("emerging")?"emerging":m.includes("lost")?"lost":m.every(z=>z==="pending")?"pending":"not-cited",p=ST(n),b=n.filter(z=>z.citationState==="cited"||z.citationState==="emerging").length,v=(()=>{if(p.length<4)return"flat";const z=p.slice(-3),j=p.slice(-6,-3);if(j.length===0)return"flat";const k=z.filter(E=>E.citationState==="cited"||E.citationState==="emerging").length,A=j.filter(E=>E.citationState==="cited"||E.citationState==="emerging").length;return k>A?"up":k<A?"down":"flat"})(),w=(()=>{if(p.length===0)return"Awaiting first run";if(p.length===1)return"First observation";const z=p[p.length-1].citationState,j=p[p.length-2].citationState,k=z==="cited"||z==="emerging",A=j==="cited"||j==="emerging";if(!A&&k)return"Newly cited";if(A&&!k)return"Lost citation";let E=0;for(let O=p.length-1;O>=0;O--){const D=p[O].citationState;if((D==="cited"||D==="emerging")===k)E++;else break}return k?E<=1?"Cited in latest run":`Cited ${E} runs in a row`:E<=1?"Missed in latest run":`Missed for ${E} runs`})(),N=v==="up"?"↑":v==="down"?"↓":"→";return c.jsxs("div",{className:`evidence-phrase-card evidence-phrase-card--${g}`,children:[c.jsxs("div",{className:"evidence-card-header",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"evidence-card-keyword",children:e}),c.jsxs("div",{className:"evidence-card-status-row",children:[c.jsx(nx,{state:g}),c.jsxs("span",{className:`evidence-card-trend evidence-card-trend--${v}`,children:[c.jsx("span",{"aria-hidden":"true",children:N}),c.jsx("span",{children:w})]})]})]}),d&&c.jsx("button",{type:"button",className:"ml-2 shrink-0 text-zinc-600 hover:text-rose-400 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-rose-500",onClick:d,title:`Remove "${e}"`,"aria-label":`Remove key phrase "${e}"`,children:"×"})]}),c.jsxs("div",{className:`evidence-card-timeline-row${u?" opacity-40 pointer-events-none":""}`,children:[u?c.jsx("span",{className:"text-[10px] text-zinc-500 italic animate-pulse",children:"Loading…"}):c.jsx(xT,{history:p,maxDots:14}),c.jsxs("span",{className:"evidence-card-ratio",children:[b,"/",n.length," provider",n.length!==1?"s":""]})]}),o?(()=>{const z=Array.from(n.reduce((j,k)=>{const A=k.location??"",E=j.get(A)??[];return j.set(A,[...E,k]),j},new Map)).map(([j,k])=>({loc:j||"No location",locItems:k}));return c.jsx("div",{className:"evidence-card-location-compare",children:z.map(({loc:j,locItems:k})=>{const A=k.filter(E=>E.citationState==="cited"||E.citationState==="emerging").length;return c.jsxs("div",{className:"evidence-card-location-row",children:[c.jsx("span",{className:"evidence-card-location-label",children:j}),c.jsxs("div",{className:"evidence-card-location-providers",children:[k.filter(E=>E.citationState!=="pending").map(E=>c.jsxs("button",{type:"button",className:`evidence-provider-btn evidence-provider-btn--${E.citationState} evidence-provider-btn--compact`,onClick:()=>s(E.id),title:`View ${E.provider} evidence for "${e}" in ${j}`,children:[c.jsx("span",{className:"capitalize",children:E.provider}),c.jsx("span",{"aria-hidden":"true",className:"font-bold",children:E.citationState==="cited"||E.citationState==="emerging"?"✓":E.citationState==="lost"?"✗":"–"})]},E.id)),k.every(E=>E.citationState==="pending")&&c.jsx("span",{className:"text-xs text-zinc-500 italic",children:"Pending"})]}),c.jsxs("span",{className:"evidence-card-location-score",children:[A,"/",k.length]})]},j)})})})():c.jsxs("div",{className:"evidence-card-providers",children:[n.filter(z=>z.citationState!=="pending").map(z=>c.jsxs("button",{type:"button",className:`evidence-provider-btn evidence-provider-btn--${z.citationState}`,onClick:()=>s(z.id),title:`View ${z.provider} evidence for "${e}"`,children:[c.jsx("span",{className:"capitalize",children:z.provider}),z.location&&l&&c.jsx("span",{className:"text-[9px] opacity-60",children:z.location}),c.jsx("span",{"aria-hidden":"true",className:"font-bold",children:z.citationState==="cited"||z.citationState==="emerging"?"✓":z.citationState==="lost"?"✗":"–"}),c.jsx("span",{className:"opacity-50 text-[10px]",children:"View →"})]},z.id)),n.every(z=>z.citationState==="pending")&&c.jsx("span",{className:"text-xs text-zinc-500 italic py-1",children:"Awaiting first run"})]})]})}function jT({evidence:e,onOpenEvidence:n,showLocationLabels:s=!0,compareLocations:l=!1,timelineLoading:o=!1,onDeleteKeyword:u}){const d=x.useMemo(()=>{const m=new Map;for(const g of e){const p=m.get(g.keyword)??[];m.set(g.keyword,[...p,g])}return[...m.entries()].map(([g,p])=>({phrase:g,items:p}))},[e]);return d.length===0?c.jsx("p",{className:"supporting-copy",children:"No key phrases tracked yet."}):c.jsx("div",{className:"evidence-card-grid",children:d.map(({phrase:m,items:g})=>c.jsx(wT,{phrase:m,items:g,onOpenEvidence:n,showLocationLabels:s,compareLocations:l,timelineLoading:o,onDeleteKeyword:u?()=>u(m):void 0},m))})}function NT(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function kT({competitors:e}){return e.length===0?c.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):c.jsx("div",{className:"competitor-table-wrap",children:c.jsxs("table",{className:"competitor-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Domain"}),c.jsx("th",{children:"Pressure"}),c.jsx("th",{children:"Citations"}),c.jsx("th",{children:"Key Phrases"})]})}),c.jsx("tbody",{children:e.map(n=>c.jsxs("tr",{children:[c.jsx("td",{className:"font-medium text-zinc-100",children:n.domain}),c.jsx("td",{children:c.jsx(Dt,{tone:NT(n.pressureLabel),children:n.pressureLabel})}),c.jsx("td",{className:"text-zinc-300 tabular-nums",children:n.totalKeywords>0?`${n.citationCount} / ${n.totalKeywords}`:"—"}),c.jsx("td",{className:"text-zinc-500 text-xs",children:n.citedKeywords.length>0?n.citedKeywords.join(", "):"Not cited"})]},n.id))})]})})}function zT({project:e,onNavigate:n}){const s=`/projects/${e.project.id}`;return c.jsxs("a",{className:"project-row cursor-pointer",href:s,onClick:xn(n,s),children:[c.jsxs("div",{className:"project-row-primary",children:[c.jsxs("div",{children:[c.jsx("p",{className:"project-name",children:e.project.name}),c.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),c.jsx("p",{className:"project-insight",children:e.insight})]}),c.jsx("div",{className:"project-row-stat",children:c.jsxs("div",{className:"metric-inline-block",children:[c.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),c.jsx("p",{className:"metric-inline-value",children:e.visibilityScore}),c.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),c.jsx("div",{className:"project-row-stat",children:c.jsxs("div",{className:"metric-inline-block",children:[c.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),c.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),c.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",zc(e.lastRun.status)]})]})}),c.jsx("div",{className:"project-row-chart",children:c.jsx(vT,{points:e.trend,tone:ex(e.lastRun.status)})}),c.jsx("span",{className:"project-row-link",children:c.jsx(Xf,{className:"h-4 w-4 text-zinc-500"})})]})}function _T({model:e,systemHealth:n,onNavigate:s,onOpenRun:l}){return c.jsxs("div",{className:"page-container",children:[c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Portfolio"}),c.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),c.jsx("div",{className:"page-header-right",children:c.jsx("p",{className:"text-[11px] text-zinc-600",children:e.lastUpdatedAt})})]}),e.projects.length>0?c.jsx("div",{className:"project-list project-list-scrollable",children:e.projects.map(o=>c.jsx(zT,{project:o,onNavigate:s},o.project.id))}):c.jsxs(Qe,{className:"surface-card empty-card",children:[c.jsx("h3",{children:e.emptyState?.title??"No projects yet"}),c.jsx("p",{className:"supporting-copy",children:e.emptyState?.detail}),c.jsx(ce,{size:"sm",asChild:!0,children:c.jsx("a",{href:e.emptyState?.ctaHref??"/setup",onClick:xn(s,e.emptyState?.ctaHref??"/setup"),children:e.emptyState?.ctaLabel??"Launch setup"})})]}),c.jsxs("div",{className:"overview-secondary-grid",children:[e.attentionItems.length>0&&c.jsxs("section",{className:"overview-secondary-section",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),c.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),c.jsx("div",{className:"attention-list attention-list-scrollable",children:e.attentionItems.map(o=>c.jsxs("a",{className:`attention-item attention-item-${o.tone}`,href:o.href,onClick:xn(s,o.href),children:[c.jsxs("div",{children:[c.jsx("p",{className:"attention-title",children:o.title}),c.jsx("p",{className:"attention-detail",children:o.detail})]}),c.jsx("span",{className:"attention-action",children:o.actionLabel})]},o.id))})]}),c.jsxs("section",{className:"overview-secondary-section",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),c.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),c.jsx("div",{className:"compact-stack compact-stack-scrollable",children:e.recentRuns.length>0?e.recentRuns.map(o=>c.jsxs("button",{className:"compact-run",type:"button",onClick:()=>l(o.id),children:[c.jsxs("div",{children:[c.jsx("p",{className:"compact-run-title",children:o.projectName}),c.jsx("p",{className:"compact-run-detail",children:o.summary})]}),c.jsx(_c,{status:o.status})]},o.id)):c.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),c.jsxs("section",{className:"page-section",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),c.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),c.jsx("div",{className:"health-grid",children:n.map(o=>c.jsxs(Qe,{className:"surface-card compact-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:o.label}),c.jsx("h3",{children:o.detail})]}),c.jsx(Dt,{tone:o.tone,children:o.label})]}),c.jsx("p",{className:"supporting-copy",children:o.meta})]},o.id))})]})]})}function CT({projects:e,onNavigate:n,onProjectCreated:s}){const[l,o]=x.useState(!1),[u,d]=x.useState(""),[m,g]=x.useState(""),[p,b]=x.useState(""),[v,w]=x.useState("US"),[N,z]=x.useState("en"),[j,k]=x.useState(!1),[A,E]=x.useState(null),O=u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),D=async()=>{if(!(!O||!p)){k(!0),E(null);try{const L=await kc(O,{displayName:m||u,canonicalDomain:p,country:v,language:N});s(),d(""),g(""),b(""),w("US"),z("en"),o(!1),n(`/projects/${L.id}`)}catch(L){E(L instanceof Error?L.message:"Failed to create project")}finally{k(!1)}}};return c.jsxs("div",{className:"page-container",children:[c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Projects"}),c.jsxs("p",{className:"page-subtitle",children:[e.length," project",e.length!==1?"s":""," tracked"]})]}),c.jsx("div",{className:"page-header-right",children:c.jsxs(ce,{type:"button",onClick:()=>o(L=>!L),children:[c.jsx(My,{className:"size-4 mr-1.5"}),"Add project"]})})]}),l?c.jsxs(Qe,{className:"surface-card mb-6",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),c.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),c.jsxs("div",{className:"compact-stack mt-4",children:[c.jsxs("div",{className:"setup-field-row",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),c.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:u,onChange:L=>d(L.target.value)}),O&&O!==u?c.jsxs("p",{className:"supporting-copy",children:["Slug: ",O]}):null]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),c.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:m,onChange:L=>g(L.target.value)})]})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),c.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:p,onChange:L=>b(L.target.value)})]}),c.jsxs("div",{className:"setup-field-row",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),c.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:L=>w(L.target.value.toUpperCase())})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),c.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:N,onChange:L=>z(L.target.value.toLowerCase())})]})]})]}),A?c.jsx("p",{className:"text-rose-400 text-sm mt-3",children:A}):null,c.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[c.jsx(ce,{type:"button",disabled:!O||!p||j,onClick:D,children:j?"Creating...":"Create project"}),c.jsx(ce,{type:"button",variant:"ghost",onClick:()=>o(!1),children:"Cancel"})]})]}):null,e.length>0?c.jsx("div",{className:"data-table-wrapper",children:c.jsxs("table",{className:"data-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Name"}),c.jsx("th",{children:"Domain"}),c.jsx("th",{children:"Visibility"}),c.jsx("th",{children:"Last run"}),c.jsx("th",{className:"text-right",children:"Country"})]})}),c.jsx("tbody",{children:e.map(L=>{const H=`/projects/${L.project.id}`,V=L.recentRuns[0];return c.jsxs("tr",{className:"cursor-pointer",onClick:()=>n(H),children:[c.jsxs("td",{children:[c.jsx("a",{className:"text-zinc-100 font-medium hover:underline",href:H,onClick:xn(n,H),children:L.project.displayName||L.project.name}),c.jsx("p",{className:"text-[11px] text-zinc-500",children:L.project.name})]}),c.jsx("td",{className:"text-zinc-400",children:L.project.canonicalDomain}),c.jsx("td",{children:c.jsx(Dt,{tone:L.visibilitySummary.tone,children:L.visibilitySummary.value})}),c.jsx("td",{className:"text-zinc-500 text-sm",children:V?c.jsx(_c,{status:V.status}):c.jsx("span",{className:"text-zinc-600",children:"No runs"})}),c.jsx("td",{className:"text-right text-zinc-500",children:L.project.country})]},L.project.id)})})]})}):l?null:c.jsxs(Qe,{className:"surface-card empty-card",children:[c.jsx("h3",{children:"No projects yet"}),c.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),c.jsxs(ce,{type:"button",onClick:()=>o(!0),children:[c.jsx(My,{className:"size-4 mr-1.5"}),"Add project"]})]}),c.jsx(ET,{onApplied:s})]})}function ET({onApplied:e}){const[n,s]=x.useState(""),[l,o]=x.useState(!1),[u,d]=x.useState([]),[m,g]=x.useState([]),p=async()=>{if(!n.trim())return;o(!0),d([]),g([]);const b=Mj(n),v=[],w=[];for(let N=0;N<b.length;N++){const z=b[N];if(z.errors.length>0){v.push(`Document ${N+1}: ${z.errors[0]?.message}`);continue}const j=z.toJSON();if(!(!j||typeof j!="object"))try{const k=await zA(j);w.push(`Applied "${k.displayName||k.name}" (revision ${k.configRevision})`)}catch(k){v.push(`Document ${N+1}: ${k instanceof Error?k.message:String(k)}`)}}d(w),g(v),o(!1),w.length>0&&e()};return c.jsxs("section",{className:"mt-8",children:[c.jsx("div",{className:"page-section-divider"}),c.jsx("div",{className:"section-head mt-6",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),c.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),c.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",c.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",c.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),c.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
225
+ kind: Project
226
+ metadata:
227
+ name: my-project
228
+ spec:
229
+ canonicalDomain: example.com
230
+ country: US
231
+ language: en
232
+ keywords: []`,value:n,onChange:b=>s(b.target.value)}),u.length>0&&c.jsx("ul",{className:"mt-2 space-y-1",children:u.map((b,v)=>c.jsx("li",{className:"text-emerald-400 text-sm",children:b},v))}),m.length>0&&c.jsx("ul",{className:"mt-2 space-y-1",children:m.map((b,v)=>c.jsx("li",{className:"text-rose-400 text-sm",children:b},v))}),c.jsx("div",{className:"mt-3",children:c.jsx(ce,{type:"button",disabled:!n.trim()||l,onClick:p,children:l?"Applying...":"Apply"})})]})}function AT({model:e,tab:n,onOpenEvidence:s,onOpenRun:l,onTriggerRun:o,onDeleteProject:u,onAddKeywords:d,onDeleteKeywords:m,onAddCompetitors:g,onUpdateOwnedDomains:p,onUpdateProject:b,onNavigate:v}){const[w,N]=x.useState(!1),[z,j]=x.useState(!1),[k,A]=x.useState(!1),[E,O]=x.useState(null),[D,L]=x.useState(!1),[H,V]=x.useState(""),[R,Q]=x.useState(!1),[Se,ae]=x.useState(null),[fe,Ae]=x.useState(!1),[qe,Le]=x.useState(""),[q,K]=x.useState(!1),[se,he]=x.useState(!1),[te,C]=x.useState(""),[G,ne]=x.useState(!1),[F,de]=x.useState(void 0),[me,we]=x.useState(!1),[$,ie]=x.useState(null),[Ze,le]=x.useState(!1),Ie=x.useMemo(()=>new Set(e.visibilityEvidence.map(re=>re.location??"")),[e.visibilityEvidence]),Mt=Ie.has(""),ut=x.useMemo(()=>[...Ie].filter(Boolean),[Ie]);x.useEffect(()=>{if(F===void 0||F===""){ie(null),le(!1);return}le(!0),Kb(e.project.name,F).then(re=>{ie(re),le(!1)}).catch(()=>{ie(null),le(!1)})},[F,e.project.name]);const zt=x.useMemo(()=>{if(!$)return null;const re=new Map;for(const De of $){for(const[Lt,Ct]of Object.entries(De.providerRuns??{}))re.set(`${De.keyword}::${Lt}`,Ct.map(tn=>({runId:tn.runId,citationState:tn.citationState,createdAt:tn.createdAt})));(!De.providerRuns||Object.keys(De.providerRuns).length===0)&&re.set(`${De.keyword}::`,De.runs.map(Lt=>({runId:Lt.runId,citationState:Lt.citationState,createdAt:Lt.createdAt})))}return re},[$]),Un=x.useMemo(()=>{const re=F!==void 0?e.visibilityEvidence.filter(De=>F===""?!De.location:De.location===F):e.visibilityEvidence;return zt?re.map(De=>{const Lt=zt.get(`${De.keyword}::${De.provider}`)??zt.get(`${De.keyword}::`);return Lt?{...De,runHistory:Lt}:De}):re},[e.visibilityEvidence,F,zt]);async function li(){const re=await gA(e.project.name),De=typeof re=="string"?re:JSON.stringify(re,null,2),Lt=new Blob([De],{type:"text/yaml"}),Ct=URL.createObjectURL(Lt),tn=document.createElement("a");tn.href=Ct,tn.download=`${e.project.name}.yaml`,tn.click(),URL.revokeObjectURL(Ct)}async function Sn(re){ae(re);try{await m(e.project.name,[re])}finally{ae(null)}}async function Yt(){const re=H.split(`
233
+ `).map(De=>De.trim()).filter(Boolean);if(re.length!==0){Q(!0);try{await d(e.project.name,re),V(""),L(!1)}finally{Q(!1)}}}async function dt(){const re=qe.trim();if(re){K(!0);try{await g(e.project.name,[re]),Le(""),Ae(!1)}finally{K(!1)}}}async function It(){const re=te.trim();if(re){ne(!0);try{const De=e.project.ownedDomains??[];await p(e.project.name,[...De,re]),C(""),he(!1)}finally{ne(!1)}}}async function Pn(re){ne(!0);try{const De=e.project.ownedDomains??[];await p(e.project.name,De.filter(Lt=>Lt!==re))}finally{ne(!1)}}const Qn=re=>!Number.isNaN(Number.parseInt(re,10)),_t=[{key:"overview",label:"Overview",href:`/projects/${e.project.id}`},{key:"search-console",label:"Search Console",href:`/projects/${e.project.id}/search-console`}];return c.jsxs("div",{className:"page-container",children:[w?c.jsxs(Qe,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[c.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),c.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",c.jsx("strong",{className:"text-zinc-200",children:e.project.displayName||e.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(ce,{type:"button",variant:"destructive",disabled:z,onClick:async()=>{j(!0),u(e.project.name)},children:z?"Deleting...":"Yes, delete project"}),c.jsx(ce,{type:"button",variant:"outline",disabled:z,onClick:()=>N(!1),children:"Cancel"})]})]}):null,c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:e.project.displayName||e.project.name}),c.jsxs("p",{className:"page-subtitle",children:[e.project.canonicalDomain,(e.project.ownedDomains??[]).length===0&&!se&&c.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>he(!0),children:"+ add domain"})," "," · ",e.contextLabel]}),c.jsxs("div",{className:"tag-row",children:[c.jsx("span",{className:"tag",children:e.project.country}),c.jsx("span",{className:"tag",children:e.project.language.toUpperCase()}),e.project.tags.map(re=>c.jsx("span",{className:"tag",children:re},re))]}),((e.project.ownedDomains??[]).length>0||se)&&c.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[c.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(e.project.ownedDomains??[]).map(re=>c.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:[re,c.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:G,onClick:()=>Pn(re),"aria-label":`Remove ${re}`,children:"×"})]},re)),se?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.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:te,onChange:re=>C(re.target.value),onKeyDown:re=>re.key==="Enter"&&It(),autoFocus:!0}),c.jsx(ce,{type:"button",size:"sm",disabled:!te.trim()||G,onClick:It,children:G?"...":"Add"}),c.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{he(!1),C("")},children:"Cancel"})]}):c.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:()=>he(!0),children:"+ domain"})]})]}),c.jsxs("div",{className:"page-header-right",children:[c.jsx("p",{className:"text-sm text-zinc-500",children:e.dateRangeLabel}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ce,{type:"button",variant:"outline",size:"icon",onClick:li,"aria-label":"Export project as YAML",children:c.jsx(w1,{className:"h-4 w-4 text-zinc-400"})}),c.jsx(ce,{type:"button",variant:"outline",size:"icon",onClick:()=>N(!0),"aria-label":"Delete project",children:c.jsx(U1,{className:"h-4 w-4 text-zinc-400"})}),c.jsx(ce,{type:"button",disabled:k,onClick:async()=>{A(!0),O(null);try{await o(e.project.name)}catch(re){O(re instanceof Error?re.message:"Failed to trigger run")}finally{A(!1)}},children:k?"Starting...":"Run now"})]})]})]}),E&&c.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:[E,c.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>O(null),children:"×"})]}),c.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:_t.map(re=>c.jsx("a",{className:`project-subnav-link ${re.key===n?"project-subnav-link-active":""}`,href:re.href,"aria-current":re.key===n?"page":void 0,onClick:xn(v,re.href),children:re.label},re.key))}),n==="overview"?c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"gauge-row",children:[c.jsx(of,{value:e.visibilitySummary.value,label:e.visibilitySummary.label,delta:e.visibilitySummary.delta,tone:e.visibilitySummary.tone,description:e.visibilitySummary.description,tooltip:e.visibilitySummary.tooltip,isNumeric:Qn(e.visibilitySummary.value)}),c.jsx(of,{value:e.competitorPressure.value,label:e.competitorPressure.label,delta:e.competitorPressure.delta,tone:e.competitorPressure.tone,description:e.competitorPressure.description,tooltip:e.competitorPressure.tooltip,isNumeric:Qn(e.competitorPressure.value)}),c.jsx(of,{value:e.runStatus.value,label:e.runStatus.label,delta:e.runStatus.delta,tone:e.runStatus.tone,description:e.runStatus.description,tooltip:e.runStatus.tooltip,isNumeric:Qn(e.runStatus.value)})]}),e.providerScores.length>1&&c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),c.jsxs("h2",{children:["Visibility by model ",c.jsx(tx,{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."})]})]})}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:e.providerScores.map(re=>c.jsxs(Qe,{className:"surface-card compact-card",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(fh,{provider:re.provider}),c.jsxs("span",{className:`text-lg font-semibold ${re.score>=70?"text-emerald-400":re.score>=40?"text-amber-400":"text-rose-400"}`,children:[re.score,"%"]})]}),re.model&&c.jsx("p",{className:"mt-0.5 text-[11px] font-mono text-zinc-500 truncate",children:re.model}),c.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[re.cited," of ",re.total," key phrases cited"]})]},`${re.provider}::${re.model??"unknown"}`))})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),c.jsx("h2",{children:"Citation signals"})]})}),c.jsx(bT,{insights:e.insights,onOpenEvidence:s})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),c.jsx("h2",{children:"Key phrase citation tracking"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("p",{className:"supporting-copy",children:[new Set(e.visibilityEvidence.map(re=>re.keyword)).size," key phrases tracked"]}),c.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>L(!D),children:D?"Cancel":"+ Add key phrases"})]})]}),D&&c.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[c.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:H,onChange:re=>V(re.target.value)}),c.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[c.jsxs("p",{className:"text-xs text-zinc-500",children:[H.split(`
234
+ `).filter(re=>re.trim()).length," key phrases"]}),c.jsx(ce,{type:"button",size:"sm",disabled:!H.trim()||R,onClick:Yt,children:R?"Adding...":"Add key phrases"})]})]}),e.project.locations&&e.project.locations.length>0&&c.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[c.jsx("button",{className:`filter-chip ${F===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":F===void 0,onClick:()=>{de(void 0)},children:"All locations"}),e.project.locations.map(re=>Ie.has(re.label)&&c.jsx("button",{className:`filter-chip ${F===re.label?"filter-chip-active":""}`,type:"button","aria-pressed":F===re.label,onClick:()=>{de(re.label),we(!1)},children:re.label},re.label)),Mt&&c.jsx("button",{className:`filter-chip ${F===""?"filter-chip-active":""}`,type:"button","aria-pressed":F==="",onClick:()=>{de(""),we(!1)},children:"No location"}),ut.length>1&&F===void 0&&c.jsx("button",{className:`filter-chip filter-chip-compare ${me?"filter-chip-active":""}`,type:"button","aria-pressed":me,onClick:()=>we(re=>!re),title:"Side-by-side location comparison",children:"Compare"})]}),c.jsx(jT,{evidence:Un,onOpenEvidence:s,showLocationLabels:F===void 0,compareLocations:F===void 0&&me,timelineLoading:Ze,onDeleteKeyword:Se?void 0:Sn})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),c.jsx("h2",{children:"Competitive landscape"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("p",{className:"supporting-copy",children:[e.competitors.length," tracked"]}),c.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>Ae(!fe),children:fe?"Cancel":"+ Add competitor"})]})]}),fe&&c.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[c.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:qe,onChange:re=>Le(re.target.value),onKeyDown:re=>re.key==="Enter"&&dt()}),c.jsx(ce,{type:"button",size:"sm",disabled:!qe.trim()||q,onClick:dt,children:q?"Adding...":"Add"})]}),c.jsx(kT,{competitors:e.competitors})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),c.jsx("h2",{children:"Recent execution history"})]})}),c.jsx("div",{className:"run-list",children:e.recentRuns.map(re=>c.jsx(ix,{run:re,onOpen:l},re.id))})]}),c.jsx(OT,{project:{...e.project,displayName:e.project.displayName??e.project.name,defaultLocation:e.project.defaultLocation??null},onUpdateProject:b}),c.jsx(UT,{projectName:e.project.name}),c.jsx(BT,{projectName:e.project.name})]}):c.jsx(TT,{projectName:e.project.name,onOpenSettings:()=>v("/settings")})]})}function Zo(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function y0(e){return e===null?"Unknown":e?"Pass":"Fail"}function TT({projectName:e,onOpenSettings:n}){const[s,l]=x.useState(!1),[o,u]=x.useState([]),[d,m]=x.useState([]),[g,p]=x.useState([]),[b,v]=x.useState([]),[w,N]=x.useState([]),[z,j]=x.useState(null),[k,A]=x.useState(""),[E,O]=x.useState(""),[D,L]=x.useState("30"),[H,V]=x.useState(!1),[R,Q]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[Se,ae]=x.useState(""),[fe,Ae]=x.useState(!0),[qe,Le]=x.useState(!1),[q,K]=x.useState(!1),[se,he]=x.useState(!1),[te,C]=x.useState(!1),[G,ne]=x.useState(!1),[F,de]=x.useState(!1),[me,we]=x.useState(!1),[$,ie]=x.useState(null),[Ze,le]=x.useState(!1),[Ie,Mt]=x.useState(!1),[ut,zt]=x.useState(!1),[Un,li]=x.useState(!1),[Sn,Yt]=x.useState(null),[dt,It]=x.useState(""),[Pn,Qn]=x.useState(!1),[_t,re]=x.useState(!1),[De,Lt]=x.useState("indexed"),[Ct,tn]=x.useState([]),[oe,un]=x.useState(null),[lr,Xe]=x.useState(null),[Vt,yt]=x.useState(null),Ee=o.find(M=>M.connectionType==="gsc"),Cc=g.length>0||b.length>0||w.length>0;async function rr(M){if(!M){m([]),A("");return}he(!0);try{const{sites:ue}=await TA(e);m(ue),A(M.propertyId??ue[0]?.siteUrl??"")}catch(ue){m([]),Xe(ue instanceof Error?ue.message:"Failed to load Search Console properties")}finally{he(!1)}}async function Wa(){ne(!0);try{const M=await MA(e,{startDate:R.startDate||void 0,endDate:R.endDate||void 0,query:R.query||void 0,page:R.page||void 0,limit:parseInt(R.limit,10)||20});p(M)}catch(M){p([]),Xe(M instanceof Error?M.message:"Failed to load GSC performance data")}finally{ne(!1)}}async function ri(){de(!0);try{const[M,ue]=await Promise.all([UA(e,{url:Se.trim()||void 0,limit:20}),$A(e)]);v(M),N(ue)}catch(M){v([]),N([]),Xe(M instanceof Error?M.message:"Failed to load GSC inspection history")}finally{de(!1)}}async function ys(){le(!0);try{const[M,ue]=await Promise.all([BA(e),IA(e).catch(()=>[])]);ie(M),tn(ue)}catch{ie(null),tn([])}finally{le(!1)}}async function oi(){if(dt.trim()){Qn(!0),Xe(null);try{await DA(e,"gsc",dt.trim()),u(M=>M.map(ue=>ue.connectionType==="gsc"?{...ue,sitemapUrl:dt.trim()}:ue)),yt("Sitemap URL saved."),It("")}catch(M){Xe(M instanceof Error?M.message:"Failed to save sitemap URL")}finally{Qn(!1)}}}async function Xn(){zt(!0),Xe(null);try{const M=await HA(e);Yt(M.sitemaps),u(ue=>ue.map(at=>at.connectionType==="gsc"?{...at,sitemapUrl:M.primarySitemapUrl}:at)),yt(`Discovered ${M.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${M.run.id}).`)}catch(M){Xe(M instanceof Error?M.message:"Failed to discover sitemaps")}finally{zt(!1)}}async function Vs(){li(!0),Xe(null);try{const M=await ZA(e);Yt(M.sitemaps),M.sitemaps.length===0&&yt("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(M){Xe(M instanceof Error?M.message:"Failed to list sitemaps")}finally{li(!1)}}async function Oi(){Ae(!0),Xe(null);try{const[M,ue]=await Promise.all([Pb().catch(()=>null),CA(e).catch(()=>[])]);l(!!M?.google?.configured),u(ue);const at=ue.find(vt=>vt.connectionType==="gsc");await Promise.all([rr(at),Wa(),ri(),ys()])}finally{Ae(!1)}}x.useEffect(()=>{Oi()},[e]);async function Ec(){if(!s){Xe("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}Le(!0),Xe(null),yt(null);try{const{authUrl:M}=await EA(e,"gsc"),ue=window.open(M,"_blank","width=600,height=700");if(!ue){window.location.assign(M);return}yt("Finish the Google consent flow in the popup, then close it to refresh this project.");const at=window.setInterval(()=>{ue.closed&&(window.clearInterval(at),yt(null),Oi())},1e3)}catch(M){Xe(M instanceof Error?M.message:"Failed to start OAuth flow")}finally{Le(!1)}}async function or(){Xe(null),yt(null);try{await AA(e,"gsc"),u(M=>M.filter(ue=>ue.connectionType!=="gsc")),m([]),A("")}catch(M){Xe(M instanceof Error?M.message:"Failed to disconnect")}}async function el(){if(k){C(!0),Xe(null);try{await OA(e,"gsc",k),u(M=>M.map(ue=>ue.connectionType==="gsc"?{...ue,propertyId:k}:ue)),yt("GSC property updated.")}catch(M){Xe(M instanceof Error?M.message:"Failed to save GSC property")}finally{C(!1)}}}async function vs(){K(!0),Xe(null),yt(null);try{await RA(e,{days:parseInt(D,10)||void 0,full:H||void 0}),yt("GSC sync queued. Refresh after the run completes to see imported data.")}catch(M){Xe(M instanceof Error?M.message:"Failed to trigger sync")}finally{K(!1)}}async function cr(){if(E.trim()){we(!0),Xe(null),yt(null);try{const M=await LA(e,E.trim());j(M),O(""),await ri()}catch(M){Xe(M instanceof Error?M.message:"Failed to inspect URL")}finally{we(!1)}}}return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),c.jsx("h2",{children:"Google Search Console"})]}),c.jsx("div",{className:"flex items-center gap-2",children:Ee&&c.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:G,onClick:()=>{Wa()},children:G?"Refreshing…":"Refresh data"})})]}),lr&&c.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:[lr,c.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Xe(null),children:"×"})]}),Vt&&c.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:[Vt,c.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>yt(null),children:"×"})]}),fe?c.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):c.jsxs("div",{className:"space-y-3",children:[c.jsxs(Qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),c.jsx("h3",{children:"Domain authorization"})]}),c.jsx(Dt,{tone:Ee?"positive":s?"caution":"negative",children:Ee?"Connected":s?"Ready to connect":"App credentials missing"})]}),Ee?c.jsxs("div",{className:"mt-3 space-y-3",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),c.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),c.jsx("span",{className:"text-xs text-zinc-500",children:Ee.domain}),c.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:or,children:"Disconnect"})]}),c.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",c.jsx("code",{children:Ee.domain}),"."]})]}),c.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Ee.propertyId??"No property selected yet"})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Zo(Ee.updatedAt)})]})]})]}):c.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[c.jsx("p",{className:"text-sm text-zinc-300",children:s?"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."}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[s?c.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:qe,onClick:Ec,children:qe?"Opening…":"Connect Google Search Console"}):c.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:!n,onClick:n,children:"Open Settings"}),!s&&c.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),Ee&&!Ee.sitemapUrl&&c.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("span",{className:"mt-0.5 text-amber-400",children:c.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:c.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"})})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),c.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."}),c.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.jsx(ce,{type:"button",size:"sm",disabled:ut||!Ee.propertyId,onClick:Xn,children:ut?"Discovering…":"Auto-discover from GSC"}),c.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.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:dt,onChange:M=>It(M.target.value),onKeyDown:M=>M.key==="Enter"&&void oi()}),c.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:Pn||!dt.trim(),onClick:oi,children:Pn?"Saving…":"Save sitemap URL"})]})]})]})]})}),(Ee||Cc)&&c.jsxs(c.Fragment,{children:[c.jsxs(Qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),c.jsx("h3",{children:"Index coverage"})]}),c.jsx("div",{className:"flex items-center gap-2",children:c.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:Ze,onClick:()=>{ys()},children:Ze?"Loading…":"Refresh coverage"})})]}),$&&$.summary.total>0?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"mt-3 flex flex-col gap-4 lg:flex-row lg:items-start",children:[c.jsx("div",{className:"shrink-0 flex flex-col items-center",children:(()=>{const M=$.summary.indexed+$.summary.notIndexed,ue=M>0?$.summary.indexed/M:0,at=54,vt=2*Math.PI*at,Xt=vt*(1-ue);return c.jsxs("div",{className:"relative h-36 w-36",children:[c.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[c.jsx("circle",{cx:"64",cy:"64",r:at,fill:"none",stroke:"rgba(255,255,255,0.06)",strokeWidth:"12"}),c.jsx("circle",{cx:"64",cy:"64",r:at,fill:"none",stroke:"#10b981",strokeWidth:"12",strokeDasharray:vt,strokeDashoffset:Xt,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}})]}),c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c.jsxs("span",{className:"text-xl font-bold tabular-nums text-zinc-100",children:[(ue*100).toFixed(0),"%"]}),c.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]})})()}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-stretch overflow-hidden rounded-lg border border-zinc-800/60",children:[$.summary.indexed>0&&c.jsxs("div",{className:"flex items-center gap-2 bg-emerald-950/40 border-r border-zinc-800/60 px-4 py-3",style:{flexBasis:`${$.summary.indexed/$.summary.total*100}%`},children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500 shrink-0"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-emerald-400/70",children:"Indexed"}),c.jsx("p",{className:"text-lg font-semibold tabular-nums text-emerald-400",children:$.summary.indexed.toLocaleString()})]})]}),$.summary.notIndexed>0&&c.jsxs("div",{className:"flex items-center gap-2 bg-zinc-900/40 px-4 py-3",style:{flexBasis:`${$.summary.notIndexed/$.summary.total*100}%`},children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500 shrink-0"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Not indexed"}),c.jsxs("p",{className:"text-lg font-semibold tabular-nums text-zinc-300",children:[$.summary.notIndexed.toLocaleString(),($.reasonGroups??[]).length>0&&c.jsxs("span",{className:"ml-1 text-xs font-normal text-zinc-500",children:["· ",($.reasonGroups??[]).length," ",($.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]})]}),$.summary.deindexed>0&&c.jsxs("p",{className:"mt-1.5 text-xs text-rose-400",children:[$.summary.deindexed," page",$.summary.deindexed!==1?"s":""," recently lost indexing"]})]})]}),c.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(M=>{const ue=M==="indexed"?$.indexed.length:M==="notIndexed"?$.notIndexed.length:$.deindexed.length,at=M==="indexed"?"Indexed":M==="notIndexed"?"Not Indexed":"Deindexed";return c.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${De===M?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Lt(M),un(null)},children:[at," (",ue,")"]},M)})}),c.jsxs("div",{className:"mt-3 overflow-x-auto",children:[De==="indexed"&&$.indexed.length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Verdict"}),c.jsx("th",{className:"text-left",children:"Last Crawl"}),c.jsx("th",{className:"text-left",children:"Mobile"})]})}),c.jsx("tbody",{children:$.indexed.map(M=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:M.url}),c.jsx("td",{className:"text-zinc-400",children:M.verdict??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:M.crawlTime?M.crawlTime.split("T")[0]:"—"}),c.jsx("td",{className:"text-zinc-400",children:M.isMobileFriendly===!0?"Yes":M.isMobileFriendly===!1?"No":"—"})]},M.id))})]}),De==="notIndexed"&&!oe&&($.reasonGroups??[]).length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"Reason"}),c.jsx("th",{className:"text-right",children:"Pages"})]})}),c.jsx("tbody",{children:($.reasonGroups??[]).map(M=>c.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>un(M.reason),children:[c.jsx("td",{className:"text-zinc-200",children:M.reason}),c.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:M.count})]},M.reason))})]}),De==="notIndexed"&&!oe&&($.reasonGroups??[]).length===0&&$.notIndexed.length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Indexing State"}),c.jsx("th",{className:"text-left",children:"Coverage"})]})}),c.jsx("tbody",{children:$.notIndexed.map(M=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:M.url}),c.jsx("td",{className:"text-zinc-400",children:M.indexingState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:M.coverageState??"Unknown"})]},M.id))})]}),De==="notIndexed"&&oe&&(()=>{const M=($.reasonGroups??[]).find(ue=>ue.reason===oe);return M?c.jsxs("div",{children:[c.jsx("div",{className:"flex items-center gap-2 mb-3",children:c.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>un(null),children:"← Back to reasons"})}),c.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-sm font-medium text-zinc-200",children:M.reason}),c.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[M.count," affected page",M.count!==1?"s":""]})]}),Ct.length>1&&(()=>{const ue=Ct.map(vt=>({date:vt.date,count:vt.reasonBreakdown[oe]??0})).filter((vt,Xt,Jn)=>Xt===0||Xt===Jn.length-1||Jn[Xt].count>0),at=Math.max(...ue.map(vt=>vt.count),1);return ue.length<2?null:c.jsxs("div",{className:"mb-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500 mb-1",children:"Affected pages over time"}),c.jsx("div",{className:"h-20 w-full",children:c.jsx("svg",{viewBox:`0 0 ${ue.length*12+2} 80`,className:"h-full w-full",preserveAspectRatio:"none",children:ue.map((vt,Xt)=>{const Jn=vt.count/at*68;return c.jsxs("g",{children:[c.jsx("title",{children:`${vt.date}: ${vt.count} pages`}),c.jsx("rect",{x:Xt*12+2,y:68-Jn,width:10,height:Jn,rx:1,fill:"#f59e0b"})]},vt.date)})})})]})})(),c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Last Crawl"})]})}),c.jsx("tbody",{children:M.urls.map(ue=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:ue.url}),c.jsx("td",{className:"text-zinc-400",children:ue.crawlTime?ue.crawlTime.split("T")[0]:"—"})]},ue.id))})]})]}):null})(),De==="deindexed"&&$.deindexed.length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Previous"}),c.jsx("th",{className:"text-left",children:"Current"}),c.jsx("th",{className:"text-left",children:"Detected"})]})}),c.jsx("tbody",{children:$.deindexed.map((M,ue)=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:M.url}),c.jsx("td",{className:"text-zinc-400",children:M.previousState}),c.jsx("td",{className:"text-zinc-400",children:M.currentState}),c.jsx("td",{className:"text-zinc-400",children:M.transitionDate.split("T")[0]})]},`${M.url}-${ue}`))})]}),(De==="indexed"&&$.indexed.length===0||De==="notIndexed"&&!oe&&$.notIndexed.length===0||De==="deindexed"&&$.deindexed.length===0)&&c.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:Ze?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),c.jsxs(Qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),c.jsx("h3",{children:"Search performance"})]}),c.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:G,onClick:()=>{Wa()},children:G?"Loading…":"Apply filters"})]}),g.length>0&&(()=>{const M=new Map;for(const Te of g){const He=M.get(Te.date);He?(He.clicks+=Te.clicks,He.impressions+=Te.impressions):M.set(Te.date,{clicks:Te.clicks,impressions:Te.impressions})}const ue=[...M.entries()].sort(([Te],[He])=>Te.localeCompare(He));if(ue.length===0)return null;const at=Math.max(...ue.map(([,Te])=>Te.impressions),1),vt=ue.reduce((Te,[,He])=>Te+He.clicks,0),Xt=ue.reduce((Te,[,He])=>Te+He.impressions,0),Jn=Xt>0?(vt/Xt*100).toFixed(1):"0.0",bs=700,dn=220,Ve={top:12,bottom:36,left:48,right:12},Pt=bs-Ve.left-Ve.right,fn=dn-Ve.top-Ve.bottom,ci=Pt/ue.length,Ps=Math.max(Math.min(ci*.35,24),4),ur=Math.max(Ps*.15,1),dr=Te=>{if(Te<=0)return 1;const He=Math.pow(10,Math.floor(Math.log10(Te))),Pe=Te/He,$n=Pe<=1.5?1.5:Pe<=3?3:Pe<=5?5:10;return Math.ceil($n*He)},Fn=4,Di=Math.ceil(dr(at)/Fn)*Fn,Ri=Array.from({length:Fn+1},(Te,He)=>Di/Fn*He),Mi=Te=>Te>=1e3?`${(Te/1e3).toFixed(Te>=1e4?0:1)}k`:String(Te);return c.jsxs("div",{className:"mt-3",children:[c.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),c.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",c.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:vt.toLocaleString()})]})]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),c.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",c.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Xt.toLocaleString()})]})]}),c.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",c.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Jn,"%"]})]})]}),c.jsx("div",{className:"relative w-full",style:{aspectRatio:`${bs} / ${dn}`},children:c.jsxs("svg",{viewBox:`0 0 ${bs} ${dn}`,className:"h-full w-full",children:[Ri.map((Te,He)=>{const Pe=Ve.top+fn-Te/Di*fn;return c.jsxs("g",{children:[c.jsx("line",{x1:Ve.left,y1:Pe,x2:bs-Ve.right,y2:Pe,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),c.jsx("text",{x:Ve.left-6,y:Pe+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Mi(Te)})]},`t-${He}`)}),ue.map(([Te,He],Pe)=>{const $n=Ve.left+ci*Pe+ci/2,xs=He.impressions/Di*fn,Wn=He.clicks/Di*fn;return c.jsxs("g",{children:[c.jsx("title",{children:`${Te}
235
+ Clicks: ${He.clicks}
236
+ Impressions: ${He.impressions}
237
+ CTR: ${He.impressions>0?(He.clicks/He.impressions*100).toFixed(1):0}%`}),c.jsx("rect",{x:$n-Ps-ur/2,y:Ve.top+fn-xs,width:Ps,height:Math.max(xs,1),rx:2,fill:"#3b82f6",opacity:.85}),c.jsx("rect",{x:$n+ur/2,y:Ve.top+fn-Wn,width:Ps,height:Math.max(Wn,1),rx:2,fill:"#10b981",opacity:.85})]},Te)}),(()=>{const Te=Math.min(ue.length,7);return Array.from({length:Te},(He,Pe)=>{const $n=ue.length===1?0:Math.round(Pe/(Te-1)*(ue.length-1)),xs=Ve.left+ci*$n+ci/2;return c.jsx("text",{x:xs,y:dn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:ue[$n][0].slice(5)},`xl-${$n}`)})})()]})})]})})(),c.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[c.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:R.startDate,onChange:M=>Q(ue=>({...ue,startDate:M.target.value}))}),c.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:R.endDate,onChange:M=>Q(ue=>({...ue,endDate:M.target.value}))}),c.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:R.query,onChange:M=>Q(ue=>({...ue,query:M.target.value}))}),c.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:R.page,onChange:M=>Q(ue=>({...ue,page:M.target.value}))}),c.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:R.limit,onChange:M=>Q(ue=>({...ue,limit:M.target.value}))})]}),g.length>0?c.jsx("div",{className:"mt-3 overflow-x-auto",children:c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"Date"}),c.jsx("th",{className:"text-left",children:"Query"}),c.jsx("th",{className:"text-left",children:"Page"}),c.jsx("th",{className:"text-right",children:"Clicks"}),c.jsx("th",{className:"text-right",children:"Impressions"}),c.jsx("th",{className:"text-right",children:"CTR"}),c.jsx("th",{className:"text-right",children:"Position"})]})}),c.jsx("tbody",{children:g.map((M,ue)=>c.jsxs("tr",{children:[c.jsx("td",{className:"text-zinc-400",children:M.date}),c.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:M.query}),c.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:M.page}),c.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:M.clicks.toLocaleString()}),c.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:M.impressions.toLocaleString()}),c.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(M.ctr*100).toFixed(1),"%"]}),c.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:M.position.toFixed(1)})]},`${M.date}:${M.query}:${M.page}:${ue}`))})]})}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),c.jsxs(Qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),c.jsx("h3",{children:"Inspect a URL"})]})}),c.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[c.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:E,onChange:M=>O(M.target.value),onKeyDown:M=>M.key==="Enter"&&void cr()}),c.jsx(ce,{type:"button",size:"sm",disabled:me||!Ee?.propertyId||!E.trim(),onClick:cr,children:me?"Inspecting…":"Inspect URL"})]}),z&&c.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:z.indexingState??"Unknown"})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:z.verdict??"Unknown"})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:y0(z.isMobileFriendly)})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Zo(z.crawlTime)})]})]})]}),c.jsxs(Qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),c.jsx("h3",{children:"Inspection log"})]}),c.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:F,onClick:()=>{ri()},children:F?"Loading…":"Refresh history"})]}),c.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[c.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:Se,onChange:M=>ae(M.target.value)}),c.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:F,onClick:()=>{ri()},children:"Apply filter"})]}),b.length>0?c.jsx("div",{className:"mt-3 overflow-x-auto",children:c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Indexing"}),c.jsx("th",{className:"text-left",children:"Verdict"}),c.jsx("th",{className:"text-left",children:"Coverage"}),c.jsx("th",{className:"text-left",children:"Mobile"}),c.jsx("th",{className:"text-left",children:"Inspected"})]})}),c.jsx("tbody",{children:b.map(M=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:M.url}),c.jsx("td",{className:"text-zinc-300",children:M.indexingState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:M.verdict??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:M.coverageState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:y0(M.isMobileFriendly)}),c.jsx("td",{className:"text-zinc-400",children:Zo(M.inspectedAt)})]},M.id))})]})}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),c.jsxs(Qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),c.jsx("h3",{children:"Recent indexing losses"})]})}),w.length>0?c.jsx("div",{className:"mt-3 overflow-x-auto",children:c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Previous"}),c.jsx("th",{className:"text-left",children:"Current"}),c.jsx("th",{className:"text-left",children:"Changed at"})]})}),c.jsx("tbody",{children:w.map(M=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:M.url}),c.jsx("td",{className:"text-zinc-400",children:M.previousState??"Unknown"}),c.jsx("td",{className:"text-zinc-300",children:M.currentState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:Zo(M.transitionDate)})]},`${M.url}:${M.transitionDate}`))})]})}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),Ee&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>re(M=>!M),children:[c.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 ${_t?"rotate-90":""}`,"aria-hidden":"true",children:c.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"})}),c.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),_t&&c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[c.jsxs(Qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),c.jsx("h3",{children:"Pick the Search Console property"})]})}),c.jsxs("div",{className:"mt-3 space-y-2",children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),c.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:k,disabled:se||d.length===0,onChange:M=>A(M.target.value),children:d.length===0?c.jsx("option",{value:"",children:se?"Loading properties…":"No properties available"}):d.map(M=>c.jsxs("option",{value:M.siteUrl,children:[M.siteUrl," · ",M.permissionLevel]},M.siteUrl))}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:se,onClick:()=>{rr(Ee)},children:se?"Refreshing…":"Refresh properties"}),c.jsx(ce,{type:"button",size:"sm",disabled:!k||te,onClick:el,children:te?"Saving…":"Save property"})]}),c.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),c.jsxs(Qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),c.jsx("h3",{children:"Import GSC performance data"})]})}),c.jsxs("div",{className:"mt-3 space-y-3",children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),c.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:D,onChange:M=>L(M.target.value)})]}),c.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:[c.jsx("input",{type:"checkbox",checked:H,onChange:M=>V(M.target.checked)}),"Replace existing imported rows for the requested range"]})]}),c.jsx(ce,{type:"button",size:"sm",disabled:q||!Ee.propertyId,onClick:vs,children:q?"Queueing…":"Queue sync"}),!Ee.propertyId&&c.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),c.jsxs(Qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),c.jsx("h3",{children:"Sitemap configuration"})]})}),c.jsxs("div",{className:"mt-3 space-y-3",children:[Ee.sitemapUrl&&c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:Ee.sitemapUrl})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:Un||!Ee.propertyId,onClick:()=>{Vs()},children:Un?"Loading…":"Browse sitemaps from GSC"}),c.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:ut||!Ee.propertyId,onClick:Xn,children:ut?"Discovering…":"Auto-discover and queue inspection"})]}),c.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."}),Sn&&Sn.length>0&&c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[c.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Sn.length,")"]}),Sn.map(M=>{const ue=M.contents?.[0];return c.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-zinc-200 break-all",children:M.path}),M.lastSubmitted&&c.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",M.lastSubmitted.split("T")[0]]})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[ue&&c.jsxs("div",{className:"text-right",children:[c.jsxs("p",{className:"text-zinc-300",children:[ue.indexed," / ",ue.submitted]}),c.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),c.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>It(M.path),children:"Use"})]})]},M.path)})]}),c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.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:Ee.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:dt,onChange:M=>It(M.target.value),onKeyDown:M=>M.key==="Enter"&&dt.trim()&&void oi()}),c.jsx(ce,{type:"button",size:"sm",disabled:Pn||!dt.trim(),onClick:oi,children:Pn?"Saving…":Ee.sitemapUrl?"Update":"Save"})]}),c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.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}`}),c.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:Ie||!Ee.propertyId,onClick:()=>{const ue=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||Ee.sitemapUrl||void 0;Mt(!0),qA(e,{sitemapUrl:ue}).then(at=>{yt(`Sitemap inspection queued (run ${at.id}). Refresh coverage after the run completes.`)}).catch(at=>{Xe(at instanceof Error?at.message:"Failed to queue sitemap inspection")}).finally(()=>Mt(!1))},children:Ie?"Queueing…":"Inspect sitemap"})]}),!Ee.propertyId&&c.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function OT({project:e,onUpdateProject:n}){const[s,l]=x.useState(!1),[o,u]=x.useState(!1),[d,m]=x.useState(null),[g,p]=x.useState(e.displayName),[b,v]=x.useState(e.canonicalDomain),[w,N]=x.useState(e.country),[z,j]=x.useState(e.language),[k,A]=x.useState(e.ownedDomains??[]),[E,O]=x.useState(""),[D,L]=x.useState(null),[H,V]=x.useState(!1),[R,Q]=x.useState(!1),[Se,ae]=x.useState(""),[fe,Ae]=x.useState(""),[qe,Le]=x.useState(""),[q,K]=x.useState(""),[se,he]=x.useState("");x.useEffect(()=>{s||(p(e.displayName),v(e.canonicalDomain),N(e.country),j(e.language),A(e.ownedDomains??[]))},[e,s]);function te(){l(!1),m(null),p(e.displayName),v(e.canonicalDomain),N(e.country),j(e.language),A(e.ownedDomains??[]),O("")}function C(){const le=E.trim();le&&(k.includes(le)||A([...k,le]),O(""))}function G(le){A(k.filter(Ie=>Ie!==le))}async function ne(){if(!(!g.trim()||!b.trim()||!w.trim()||!z.trim())){u(!0),m(null);try{await n(e.name,{displayName:g.trim(),canonicalDomain:b.trim(),ownedDomains:k,country:w.trim(),language:z.trim()}),l(!1)}catch(le){m(le instanceof Error?le.message:"Failed to save")}finally{u(!1)}}}async function F(){const le=Se.trim(),Ie=fe.trim(),Mt=qe.trim(),ut=q.trim();if(!(!le||!Ie||!Mt||!ut)){V(!0),L(null);try{const zt={label:le,city:Ie,region:Mt,country:ut};se.trim()&&(zt.timezone=se.trim()),await fA(e.name,zt),await n(e.name,{}),ae(""),Ae(""),Le(""),K(""),he(""),Q(!1)}catch(zt){L(zt instanceof Error?zt.message:"Failed to add location")}finally{V(!1)}}}async function de(le){V(!0),L(null);try{await hA(e.name,le),await n(e.name,{})}catch(Ie){L(Ie instanceof Error?Ie.message:"Failed to remove location")}finally{V(!1)}}async function me(le){V(!0),L(null);try{await mA(e.name,le),await n(e.name,{})}catch(Ie){L(Ie instanceof Error?Ie.message:"Failed to set default location")}finally{V(!1)}}const we=g!==e.displayName||b!==e.canonicalDomain||w!==e.country||z!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),$="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",ie="block text-xs font-medium text-zinc-400 mb-1",Ze=Se.trim()&&fe.trim()&&qe.trim()&&q.trim();return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),c.jsx("h2",{children:"Project settings"})]}),!s&&c.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>l(!0),children:"Edit settings"})]}),d&&c.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:[d,c.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>m(null),children:"×"})]}),s?c.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:ie,children:"Display name"}),c.jsx("input",{className:$,type:"text",value:g,onChange:le=>p(le.target.value),placeholder:"My Project"})]}),c.jsxs("div",{children:[c.jsx("label",{className:ie,children:"Canonical domain"}),c.jsx("input",{className:$,type:"text",value:b,onChange:le=>v(le.target.value),placeholder:"example.com"})]}),c.jsxs("div",{children:[c.jsx("label",{className:ie,children:"Country"}),c.jsx("input",{className:$,type:"text",value:w,onChange:le=>N(le.target.value),placeholder:"US",maxLength:2})]}),c.jsxs("div",{children:[c.jsx("label",{className:ie,children:"Language"}),c.jsx("input",{className:$,type:"text",value:z,onChange:le=>j(le.target.value),placeholder:"en"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:ie,children:"Owned domains"}),c.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(le=>c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[le,c.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>G(le),"aria-label":`Remove ${le}`,children:"×"})]},le))}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{className:`${$} flex-1`,type:"text",placeholder:"docs.example.com",value:E,onChange:le=>O(le.target.value),onKeyDown:le=>le.key==="Enter"&&(le.preventDefault(),C())}),c.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:!E.trim(),onClick:C,children:"Add"})]})]}),c.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[c.jsx(ce,{type:"button",disabled:o||!we||!g.trim()||!b.trim(),onClick:ne,children:o?"Saving...":"Save changes"}),c.jsx(ce,{type:"button",variant:"outline",disabled:o,onClick:te,children:"Cancel"})]})]}):c.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:c.jsx("table",{className:"w-full text-sm",children:c.jsxs("tbody",{children:[c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),c.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?c.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(le=>c.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:le},le))}):c.jsx("span",{className:"text-zinc-500",children:"—"})})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),c.jsxs("tr",{children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),c.jsxs("td",{className:"px-4 py-2.5",children:[D&&c.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:[D,c.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>L(null),children:"×"})]}),(e.locations??[]).length>0?c.jsxs("table",{className:"w-full text-xs mb-2",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-zinc-600",children:[c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),c.jsx("th",{className:"pb-1"})]})}),c.jsx("tbody",{children:e.locations.map(le=>c.jsxs("tr",{className:"border-t border-zinc-800/30",children:[c.jsx("td",{className:"py-1.5 pr-3",children:c.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${le.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:[le.label,le.label===e.defaultLocation?" ★":""]})}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:le.city}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:le.region}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:le.country}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:le.timezone??"—"}),c.jsx("td",{className:"py-1.5",children:c.jsxs("div",{className:"flex items-center gap-1.5",children:[le.label!==e.defaultLocation&&c.jsx("button",{type:"button",disabled:H,onClick:()=>me(le.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${le.label} as default location`,children:"Set default"}),c.jsx("button",{type:"button",disabled:H,onClick:()=>de(le.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${le.label}`,children:"Remove"})]})})]},le.label))})]}):c.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),R?c.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[c.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),c.jsx("input",{className:$,type:"text",value:Se,onChange:le=>ae(le.target.value),placeholder:"nyc"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),c.jsx("input",{className:$,type:"text",value:fe,onChange:le=>Ae(le.target.value),placeholder:"New York"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),c.jsx("input",{className:$,type:"text",value:qe,onChange:le=>Le(le.target.value),placeholder:"NY"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),c.jsx("input",{className:$,type:"text",value:q,onChange:le=>K(le.target.value),placeholder:"US",maxLength:2})]}),c.jsxs("div",{className:"col-span-2",children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),c.jsx("input",{className:$,type:"text",value:se,onChange:le=>he(le.target.value),placeholder:"America/New_York"})]})]}),c.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[c.jsx(ce,{type:"button",size:"sm",disabled:H||!Ze,onClick:F,children:H?"Adding...":"Add location"}),c.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:H,onClick:()=>{Q(!1),L(null)},children:"Cancel"})]})]}):c.jsx(ce,{type:"button",size:"sm",variant:"outline",onClick:()=>Q(!0),children:"+ Add location"})]})]})]})})})]})}const DT=[{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"}],v0=["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 kf(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function RT(e,n){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${n}`:`daily@${n}`}function MT(e,n){if(!e)return{freq:"custom",hour:6,customCron:n};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 l=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return l?{freq:l[1],hour:l[2]?parseInt(l[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:n}}function LT(e,n,s){const l=s==="UTC"?"UTC":s.split("/").pop()?.replace(/_/g," ")??s;if(!e)return`Custom: ${n} · ${l}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${l}`;const o=e.match(/^daily(?:@(\d+))?$/);if(o){const d=o[1]?parseInt(o[1]):6;return`Every day at ${kf(d)} · ${l}`}const u=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(u){const d={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},m=u[2]?parseInt(u[2]):6;return`Every ${d[u[1]]} at ${kf(m)} · ${l}`}return`${e} · ${l}`}function UT({projectName:e}){const[n,s]=x.useState("loading"),[l,o]=x.useState(!1),[u,d]=x.useState("daily"),[m,g]=x.useState(6),[p,b]=x.useState(""),[v,w]=x.useState("UTC"),[N,z]=x.useState(!1),[j,k]=x.useState(""),[A,E]=x.useState(!1),[O,D]=x.useState(!1),[L,H]=x.useState(null);x.useEffect(()=>{bA(e).then(s).catch(()=>s(null))},[e]);const V=()=>{if(n&&n!=="loading"){const ae=MT(n.preset??null,n.cronExpr);d(ae.freq),g(ae.hour),b(ae.customCron);const fe=v0.includes(n.timezone);w(fe?n.timezone:"Other"),z(!fe),k(fe?"":n.timezone)}else d("daily"),g(6),b(""),w("UTC"),z(!1),k("");H(null),o(!0)},R=async()=>{E(!0),H(null);try{const fe={timezone:N?j.trim()||"UTC":v};u==="custom"?fe.cron=p.trim():fe.preset=RT(u,m);const Ae=await d0(e,fe);s(Ae),o(!1)}catch(ae){H(ae instanceof Error?ae.message:"Failed to save schedule")}finally{E(!1)}},Q=async()=>{if(!(!n||n==="loading")){E(!0),H(null);try{const ae={timezone:n.timezone,enabled:!n.enabled};n.preset?ae.preset=n.preset:ae.cron=n.cronExpr,s(await d0(e,ae))}catch(ae){H(ae instanceof Error?ae.message:"Failed to update schedule")}finally{E(!1)}}},Se=async()=>{D(!0),H(null);try{await xA(e),s(null),o(!1)}catch(ae){H(ae instanceof Error?ae.message:"Failed to remove schedule")}finally{D(!1)}};return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),c.jsx("h2",{children:"Scheduled runs"})]}),n!=="loading"&&!l&&c.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:V,children:n?"Edit schedule":"+ Set schedule"})]}),n==="loading"&&c.jsx("p",{className:"supporting-copy",children:"Loading..."}),n!=="loading"&&!l&&n===null&&c.jsx(Qe,{className:"surface-card compact-card",children:c.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),n!=="loading"&&!l&&n!==null&&c.jsxs(Qe,{className:"surface-card compact-card",children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"text-sm font-medium text-zinc-200",children:LT(n.preset??null,n.cronExpr,n.timezone)}),c.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",c.jsx("span",{className:"font-mono",children:n.cronExpr})]}),n.nextRunAt&&c.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(n.nextRunAt).toLocaleString()]}),n.lastRunAt&&c.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(n.lastRunAt).toLocaleString()]})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx(Dt,{tone:n.enabled?"positive":"neutral",children:n.enabled?"Active":"Paused"}),c.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:A,onClick:Q,children:n.enabled?"Pause":"Resume"}),c.jsx(ce,{type:"button",variant:"ghost",size:"sm",disabled:O,onClick:Se,children:O?"Removing...":"Remove"})]})]}),L&&c.jsx("p",{className:"text-rose-400 text-sm mt-2",children:L})]}),l&&c.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),c.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:u,onChange:ae=>d(ae.target.value),children:DT.map(ae=>c.jsx("option",{value:ae.value,children:ae.label},ae.value))})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),c.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:m,disabled:u==="twice-daily"||u==="custom",onChange:ae=>g(parseInt(ae.target.value)),children:Array.from({length:24},(ae,fe)=>c.jsx("option",{value:fe,children:kf(fe)},fe))})]})]}),u==="custom"&&c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),c.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:p,onChange:ae=>b(ae.target.value)})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),c.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:N?"Other":v,onChange:ae=>{ae.target.value==="Other"?(z(!0),w("Other")):(z(!1),w(ae.target.value))},children:[v0.map(ae=>c.jsx("option",{value:ae,children:ae},ae)),c.jsx("option",{value:"Other",children:"Other (enter manually)…"})]}),N&&c.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:j,onChange:ae=>k(ae.target.value)})]}),L&&c.jsx("p",{className:"text-rose-400 text-sm",children:L}),c.jsxs("div",{className:"flex gap-2 justify-end",children:[c.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{o(!1),H(null)},children:"Cancel"}),c.jsx(ce,{type:"button",size:"sm",disabled:A||u==="custom"&&!p.trim(),onClick:R,children:A?"Saving...":"Save schedule"})]})]})]})}const $T=[{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 BT({projectName:e}){const[n,s]=x.useState("loading"),[l,o]=x.useState(!1),[u,d]=x.useState(""),[m,g]=x.useState(["citation.lost","citation.gained"]),[p,b]=x.useState(!1),[v,w]=x.useState(null),[N,z]=x.useState({});x.useEffect(()=>{SA(e).then(s).catch(()=>s([]))},[e]);const j=O=>{g(D=>D.includes(O)?D.filter(L=>L!==O):[...D,O])},k=async()=>{if(!(!u.trim()||m.length===0)){b(!0),w(null);try{const O=await wA(e,{channel:"webhook",url:u.trim(),events:m});s(D=>D==="loading"?[O]:[...D,O]),d(""),g(["citation.lost","citation.gained"]),o(!1)}catch(O){w(O instanceof Error?O.message:"Failed to add webhook")}finally{b(!1)}}},A=async O=>{try{await jA(e,O),s(D=>D==="loading"?D:D.filter(L=>L.id!==O))}catch(D){w(D instanceof Error?D.message:"Failed to remove webhook")}},E=async O=>{z(D=>({...D,[O]:{state:"testing"}}));try{const D=await NA(e,O);z(L=>({...L,[O]:{state:D.ok?"ok":"fail",status:D.status}}))}catch{z(D=>({...D,[O]:{state:"fail"}}))}};return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),c.jsx("h2",{children:"Notifications"})]}),n!=="loading"&&c.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{o(!l),w(null)},children:l?"Cancel":"+ Add webhook"})]}),l&&c.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),c.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:u,onChange:O=>d(O.target.value)})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),c.jsx("div",{className:"flex flex-wrap gap-3",children:$T.map(O=>c.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:m.includes(O.value),onChange:()=>j(O.value)}),c.jsx("span",{className:"text-sm text-zinc-300",children:O.label})]},O.value))})]}),v&&c.jsx("p",{className:"text-rose-400 text-sm",children:v}),c.jsxs("div",{className:"flex gap-2 justify-end",children:[c.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{o(!1),w(null)},children:"Cancel"}),c.jsx(ce,{type:"button",size:"sm",disabled:p||!u.trim()||m.length===0,onClick:k,children:p?"Adding...":"Add webhook"})]})]}),n==="loading"&&c.jsx("p",{className:"supporting-copy",children:"Loading..."}),n!=="loading"&&n.length===0&&!l&&c.jsx(Qe,{className:"surface-card compact-card",children:c.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),n!=="loading"&&n.length>0&&c.jsxs("div",{className:"evidence-table-wrap",children:[c.jsxs("table",{className:"evidence-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"URL"}),c.jsx("th",{children:"Events"}),c.jsx("th",{children:"Status"}),c.jsx("th",{})]})}),c.jsx("tbody",{children:n.map(O=>c.jsxs("tr",{children:[c.jsx("td",{className:"evidence-keyword-cell",children:c.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",children:O.url})}),c.jsx("td",{children:c.jsx("div",{className:"flex flex-wrap gap-1",children:O.events.map(D=>c.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:D.replace("."," ")},D))})}),c.jsx("td",{children:c.jsx(Dt,{tone:O.enabled?"positive":"neutral",children:O.enabled?"Active":"Paused"})}),c.jsx("td",{children:c.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[N[O.id]&&(()=>{const D=N[O.id],L=D.state==="testing"?"Sending…":D.state==="ok"?`Delivered${D.status?` (${D.status})`:""}`:`Failed${D.status?` (${D.status})`:""}`;return c.jsx(Dt,{tone:D.state==="ok"?"positive":D.state==="fail"?"negative":"neutral",children:L})})(),c.jsx(ce,{variant:"ghost",size:"sm",type:"button",disabled:N[O.id]?.state==="testing",onClick:()=>E(O.id),children:"Test"}),c.jsx(ce,{variant:"ghost",size:"sm",type:"button",onClick:()=>A(O.id),children:"Remove"})]})})]},O.id))})]}),v&&c.jsx("p",{className:"text-rose-400 text-sm mt-2",children:v})]})]})}function IT({runs:e,onOpenRun:n,onTriggerAll:s}){const[l,o]=x.useState("all"),u=l==="all"?e:e.filter(d=>d.status===l);return c.jsxs("div",{className:"page-container",children:[c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Runs"}),c.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),s&&c.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:s,children:"Run all projects"})]}),c.jsxs("section",{children:[c.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed"].map(d=>c.jsx("button",{className:`filter-chip ${l===d?"filter-chip-active":""}`,type:"button","aria-pressed":l===d,onClick:()=>o(d),children:d==="all"?"All runs":zc(d)},d))}),c.jsx("div",{className:"run-list",children:u.length>0?u.map(d=>c.jsx(ix,{run:d,onOpen:n},d.id)):c.jsxs(Qe,{className:"surface-card empty-card",children:[c.jsx("h2",{children:"No runs match this filter"}),c.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}const qT={openai:"https://platform.openai.com/api-keys",claude:"https://platform.claude.com/settings/keys"},sx={gemini:"Gemini",openai:"OpenAI",claude:"Claude",local:"Local"},ZT={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 HT({providerName:e,onSaved:n}){const s=e.toLowerCase()==="local",[l,o]=x.useState(""),[u,d]=x.useState(""),[m,g]=x.useState(""),[p,b]=x.useState(""),[v,w]=x.useState(""),[N,z]=x.useState(""),[j,k]=x.useState(!1),[A,E]=x.useState(null),[O,D]=x.useState(!1),L=s?u.trim().length>0:l.trim().length>0;async function H(){if(L){k(!0),E(null),D(!1);try{const Q={};p.trim()&&(Q.maxConcurrency=parseInt(p.trim(),10)),v.trim()&&(Q.maxRequestsPerMinute=parseInt(v.trim(),10)),N.trim()&&(Q.maxRequestsPerDay=parseInt(N.trim(),10)),await yA(e.toLowerCase(),{...l.trim()?{apiKey:l.trim()}:{},...u.trim()?{baseUrl:u.trim()}:{},...m.trim()?{model:m.trim()}:{},...Object.keys(Q).length>0?{quota:Q}:{}}),o(""),d(""),g(""),b(""),w(""),z(""),D(!0),n()}catch(Q){E(Q instanceof Error?Q.message:"Failed to update provider")}finally{k(!1)}}}const V=qT[e.toLowerCase()],R=ZT[e.toLowerCase()]??"Use default model";return c.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[s&&c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),c.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:u,onChange:Q=>d(Q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",s?" (optional)":""]}),V&&c.jsx("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Get API key ↗"})]}),c.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:l,onChange:Q=>o(Q.target.value)})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),c.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:R,value:m,onChange:Q=>g(Q.target.value)})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),c.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[c.jsxs("div",{children:[c.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:p,onChange:Q=>b(Q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),c.jsxs("div",{children:[c.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:v,onChange:Q=>w(Q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),c.jsxs("div",{children:[c.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:N,onChange:Q=>z(Q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),A&&c.jsx("p",{className:"text-xs text-rose-400",children:A}),O&&c.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),c.jsx(ce,{type:"button",size:"sm",disabled:!L||j,onClick:H,children:j?"Saving...":"Save"})]})}function GT({onSaved:e}){const[n,s]=x.useState(""),[l,o]=x.useState(""),[u,d]=x.useState(!1),[m,g]=x.useState(null),[p,b]=x.useState(!1),v=n.trim().length>0&&l.trim().length>0;async function w(){if(v){d(!0),g(null),b(!1);try{await vA({clientId:n.trim(),clientSecret:l.trim()}),s(""),o(""),b(!0),e()}catch(N){g(N instanceof Error?N.message:"Failed to update Google OAuth credentials")}finally{d(!1)}}}return c.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),c.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 ↗"})]}),c.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:n,onChange:N=>s(N.target.value)})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),c.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:l,onChange:N=>o(N.target.value)})]}),c.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",c.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),m&&c.jsx("p",{className:"text-xs text-rose-400",children:m}),p&&c.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),c.jsx(ce,{type:"button",size:"sm",disabled:!v||u,onClick:w,children:u?"Saving...":"Save Google OAuth app"})]})}function KT({settings:e,healthSnapshot:n,onSettingsChanged:s}){const[l,o]=x.useState(null),[u,d]=x.useState(!1);return c.jsxs("div",{className:"page-container",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Settings"}),c.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth setup, and service health."})]})}),c.jsxs("section",{className:"settings-grid",children:[e.providerStatuses.map(m=>c.jsxs(Qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),c.jsx("h2",{children:m.name})]}),c.jsx(Dt,{tone:m.state==="ready"?"positive":"caution",children:m.state==="ready"?"Ready":"Needs config"})]}),c.jsxs("dl",{className:"definition-list mt-3",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Model"}),c.jsx("dd",{className:"font-mono text-xs",children:m.model})]}),m.quota&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Concurrency"}),c.jsx("dd",{children:m.quota.maxConcurrency})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Rate limit"}),c.jsxs("dd",{children:[m.quota.maxRequestsPerMinute,"/min · ",m.quota.maxRequestsPerDay,"/day"]})]})]})]}),c.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:m.detail}),c.jsx("div",{className:"mt-2",children:c.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>o(l===m.name?null:m.name),children:l===m.name?"Cancel":m.state==="ready"?m.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),l===m.name&&c.jsx(HT,{providerName:m.name,onSaved:()=>{o(null),s?.()}})]},m.name)),c.jsxs(Qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),c.jsx("h2",{children:"Search Console OAuth"})]}),c.jsx(Dt,{tone:e.google.state==="ready"?"positive":"caution",children:e.google.state==="ready"?"Ready":"Needs config"})]}),c.jsxs("dl",{className:"definition-list mt-3",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Auth model"}),c.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Storage"}),c.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),c.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:e.google.detail}),c.jsx("div",{className:"mt-2",children:c.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>d(!u),children:u?"Cancel":e.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),u&&c.jsx(GT,{onSaved:()=>{d(!1),s?.()}})]}),c.jsxs(Qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),c.jsx("h2",{children:"API and worker"})]})}),c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"health-row",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:"API"}),c.jsx("p",{className:"supporting-copy",children:n.apiStatus.detail})]}),c.jsx(Dt,{tone:lc(n.apiStatus),children:n.apiStatus.state==="ok"?"Healthy":"Attention"})]}),c.jsxs("div",{className:"health-row",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:"Worker"}),c.jsx("p",{className:"supporting-copy",children:n.workerStatus.detail})]}),c.jsx(Dt,{tone:lc(n.workerStatus),children:n.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),c.jsx("section",{className:"page-section",children:c.jsxs(Qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),c.jsx("h2",{children:"Operational guidance"})]})}),c.jsx("ul",{className:"detail-list",children:e.selfHostNotes.map(m=>c.jsx("li",{children:m},m))}),c.jsx("p",{className:"supporting-copy",children:e.bootstrapNote})]})})]})}const YT=[{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 VT({current:e,labels:n}){return c.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:n.map((s,l)=>{const o=l<e,u=l===e;return c.jsxs("div",{className:`setup-step ${o?"setup-step-done":""} ${u?"setup-step-active":""}`,role:"listitem","aria-current":u?"step":void 0,children:[c.jsx("span",{className:"setup-step-number",children:o?"✓":l+1}),c.jsx("span",{className:"setup-step-label",children:s.label})]},s.label)})})}function PT({model:e,settings:n,onProjectCreated:s,onNavigate:l}){const[o,u]=x.useState(0),[d,m]=x.useState(""),[g,p]=x.useState(""),[b,v]=x.useState(""),[w,N]=x.useState("US"),[z,j]=x.useState("en"),[k,A]=x.useState(null),[E,O]=x.useState(null),[D,L]=x.useState(null),[H,V]=x.useState(!1),[R,Q]=x.useState(""),[Se,ae]=x.useState(!1),[fe,Ae]=x.useState(null),[qe,Le]=x.useState(!1),q=n.providerStatuses.filter(oe=>oe.state==="ready"),[K,se]=x.useState(q[0]?.name??""),[he,te]=x.useState(5),[C,G]=x.useState(!1),[ne,F]=x.useState(null),[de,me]=x.useState(""),[we,$]=x.useState(!1),[ie,Ze]=x.useState(null),[le,Ie]=x.useState(!1),[Mt,ut]=x.useState(!1),[zt,Un]=x.useState(null),[li,Sn]=x.useState(!1),Yt=d.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),dt=R.split(`
238
+ `).map(oe=>oe.trim()).filter(Boolean),It=de.split(`
239
+ `).map(oe=>oe.trim()).filter(Boolean),Pn=e.healthChecks.some(oe=>oe.id==="api"&&oe.state==="ready"),Qn=async()=>{if(!(!Yt||!b)){V(!0),L(null);try{const oe=await kc(Yt,{displayName:g||d,canonicalDomain:b,country:w,language:z});A(Yt),O(oe.id),s(),u(2)}catch(oe){L(oe instanceof Error?oe.message:"Failed to create project")}finally{V(!1)}}},_t=async()=>{if(!k)return;const oe=dt;if(oe.length!==0){Le(!0),Ae(null);try{await rA(k,oe),ae(!0),s(),u(3)}catch(un){Ae(un instanceof Error?un.message:"Failed to save key phrases")}finally{Le(!1)}}},re=async()=>{if(!(!k||!K)){G(!0),F(null);try{const oe=await kA(k,K,he);if(oe.keywords.length>0){const un=R?R.trimEnd()+`
240
+ `+oe.keywords.join(`
241
+ `):oe.keywords.join(`
242
+ `);Q(un)}}catch(oe){F(oe instanceof Error?oe.message:"Failed to generate key phrases")}finally{G(!1)}}},De=async()=>{if(!k)return;const oe=It;if(oe.length!==0){Ie(!0),Ze(null);try{await Yb(k,oe),$(!0),s(),u(4)}catch(un){Ze(un instanceof Error?un.message:"Failed to save competitors")}finally{Ie(!1)}}},Lt=async()=>{if(k){Sn(!0),Un(null);try{await Vb(k),ut(!0),s()}catch(oe){Un(oe instanceof Error?oe.message:"Failed to trigger run")}finally{Sn(!1)}}},Ct=()=>u(oe=>Math.max(0,oe-1)),tn=(()=>{switch(o){case 0:return c.jsxs(Qe,{className:"surface-card step-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),c.jsx("h2",{children:"System ready"})]})}),c.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),c.jsx("div",{className:"compact-stack",children:e.healthChecks.map(oe=>c.jsxs("div",{className:"health-check-row",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:oe.label}),c.jsx("p",{className:"supporting-copy",children:oe.detail}),oe.id==="provider"&&oe.state!=="ready"&&c.jsx("button",{type:"button",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer bg-transparent border-none p-0",onClick:()=>l("/settings"),children:"Configure providers"})]}),c.jsx(Dt,{tone:oe.state==="ready"?"positive":"caution",children:oe.state==="ready"?"Ready":"Attention"})]},oe.id))}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(ce,{type:"button",disabled:!Pn,onClick:()=>u(1),children:"Continue"})]})]});case 1:return c.jsxs(Qe,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),c.jsx("h2",{children:"Create project"})]}),k?c.jsx(Dt,{tone:"positive",children:"Created"}):null]}),k?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"text-zinc-300",children:["Project ",c.jsx("span",{className:"text-zinc-100 font-medium",children:k})," created successfully."]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),c.jsx(ce,{type:"button",onClick:()=>u(2),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),c.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:d,onChange:oe=>m(oe.target.value)}),Yt&&Yt!==d?c.jsxs("p",{className:"supporting-copy",children:["Slug: ",Yt]}):null]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),c.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:g,onChange:oe=>p(oe.target.value)})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),c.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:b,onChange:oe=>v(oe.target.value)})]}),c.jsxs("div",{className:"setup-field-row",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),c.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:w,onChange:oe=>N(oe.target.value.toUpperCase())})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),c.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:z,onChange:oe=>j(oe.target.value.toLowerCase())})]})]}),D?c.jsx("p",{className:"text-rose-400 text-sm",children:D}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),c.jsx(ce,{type:"button",disabled:!Yt||!b||H,onClick:Qn,children:H?"Creating...":"Create project"})]})]})]});case 2:return c.jsxs(Qe,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),c.jsx("h2",{children:"Add key phrases"})]}),Se?c.jsxs(Dt,{tone:"positive",children:[dt.length," saved"]}):c.jsxs(Dt,{tone:"neutral",children:[dt.length," key phrase",dt.length!==1?"s":""]})]}),c.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),Se?c.jsxs("div",{className:"compact-stack",children:[c.jsx("ul",{className:"detail-list",children:dt.map(oe=>c.jsx("li",{children:oe},oe))}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),c.jsx(ce,{type:"button",onClick:()=>u(3),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[q.length>0?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[c.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",c.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsxs("div",{className:"setup-field flex-1",children:[c.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),c.jsx("select",{id:"gen-provider",className:"setup-input",value:K,onChange:oe=>se(oe.target.value),children:q.map(oe=>c.jsxs("option",{value:oe.name,children:[sx[oe.name]??oe.name,oe.model?` (${oe.model})`:""]},oe.name))})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),c.jsx("select",{id:"gen-count",className:"setup-input",value:he,onChange:oe=>te(Number(oe.target.value)),children:[3,5,10,15,20].map(oe=>c.jsx("option",{value:oe,children:oe},oe))})]}),c.jsx(ce,{type:"button",variant:"outline",disabled:C||!K,onClick:re,children:C?"Analyzing site...":"Generate"})]}),ne?c.jsx("p",{className:"text-rose-400 text-sm",children:ne}):null]}):null,c.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[c.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",c.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),c.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
243
+ best invisalign downtown brooklyn
244
+ pediatric dentist brooklyn heights`,value:R,onChange:oe=>Q(oe.target.value)})]}),fe?c.jsx("p",{className:"text-rose-400 text-sm",children:fe}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),c.jsx(ce,{type:"button",disabled:dt.length===0||qe,onClick:_t,children:qe?"Saving...":`Save ${dt.length} key phrase${dt.length!==1?"s":""}`})]})]})]});case 3:return c.jsxs(Qe,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),c.jsx("h2",{children:"Add competitors"})]}),we?c.jsx(Dt,{tone:"positive",children:"Saved"}):null]}),c.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),we?c.jsxs("div",{className:"compact-stack",children:[c.jsx("ul",{className:"detail-list",children:It.map(oe=>c.jsx("li",{children:oe},oe))}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),c.jsx(ce,{type:"button",onClick:()=>u(4),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),c.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
245
+ competitor2.com`,value:de,onChange:oe=>me(oe.target.value)})]}),ie?c.jsx("p",{className:"text-rose-400 text-sm",children:ie}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:()=>u(4),children:"Skip"}),c.jsx(ce,{type:"button",disabled:It.length===0||le,onClick:De,children:le?"Saving...":`Save ${It.length} competitor${It.length!==1?"s":""}`})]})]})]})]});case 4:return c.jsxs(Qe,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),c.jsx("h2",{children:"Launch first run"})]}),Mt?c.jsx(Dt,{tone:"positive",children:"Queued"}):null]}),Mt?c.jsxs("div",{className:"compact-stack",children:[c.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(ce,{type:"button",onClick:()=>l(E?`/projects/${E}`:"/"),children:"Open project"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",c.jsx("span",{className:"text-zinc-100 font-medium",children:k}),"."]}),zt?c.jsx("p",{className:"text-rose-400 text-sm",children:zt}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(ce,{type:"button",variant:"outline",onClick:Ct,children:"Back"}),c.jsx(ce,{type:"button",disabled:li,onClick:Lt,children:li?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return c.jsxs("div",{className:"page-container",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Setup"}),c.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),c.jsx(VT,{current:o,labels:YT}),c.jsx("section",{className:"setup-wizard",children:tn})]})}function QT({onNavigate:e}){return c.jsx("div",{className:"page-container",children:c.jsx("section",{className:"page-section",children:c.jsxs(Qe,{className:"surface-card empty-card",children:[c.jsx("h1",{children:"Route not found"}),c.jsx("p",{children:"The current path does not map to a dashboard view."}),c.jsx(ce,{asChild:!0,children:c.jsx("a",{href:"/",onClick:xn(e,"/"),children:"Return to overview"})})]})})})}function XT({title:e,subtitle:n,children:s,open:l,onClose:o}){return c.jsx(ZE,{open:l,onOpenChange:u=>u?void 0:o(),children:c.jsxs(Bb,{children:[c.jsxs(VE,{className:"drawer-head",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:n}),c.jsx(Ib,{id:"drawer-title",children:e}),c.jsx(qb,{className:"sr-only",children:n})]}),c.jsx("div",{className:"drawer-body",children:s})]})})}function b0(e,n){const s=n.filter(d=>d.trim().length>1),l=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 l.map((d,m)=>d.type==="bold"?c.jsx("strong",{className:"text-zinc-200 font-semibold",children:d.value},`b-${m}`):d.value).filter(Boolean);const o=s.map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),u=new RegExp(`(${o.join("|")})`,"gi");return l.flatMap((d,m)=>d.value.split(u).map((p,b)=>p?b%2===1?d.type==="bold"?c.jsx("mark",{className:"answer-highlight",children:c.jsx("strong",{className:"text-zinc-200 font-semibold",children:p})},`hl-${m}-${b}`):c.jsx("mark",{className:"answer-highlight",children:p},`hl-${m}-${b}`):d.type==="bold"?c.jsx("strong",{className:"text-zinc-200 font-semibold",children:p},`b-${m}-${b}`):p:null)).filter(Boolean)}function JT({evidence:e,project:n,onClose:s}){const[l,o]=x.useState(!1),[u,d]=x.useState(-1),[m,g]=x.useState(null),[p,b]=x.useState(!1),[v,w]=x.useState({}),N=TC(n.project),z=new Set(N.map(wf)),j=e.runHistory,k=j.length>1,A=u>=0&&m!==null,E=A?m:{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},O=E.citationState==="cited"||E.citationState==="emerging",L=E.citedDomains.findIndex(K=>z.has(K.toLowerCase().replace(/^www\./,"")))+1,H=E.citedDomains.length,V=n.project.displayName||n.project.name,R=[...N.map(wf),V,V.split(" ").slice(0,2).join(" ")].filter(K=>K.trim().length>2),Q=O?"cited":E.citationState==="lost"?"lost":E.citationState==="pending"?"pending":"not-cited",Se=x.useRef(0),ae=x.useCallback(async K=>{const se=++Se.current;if(K===-1||K===j.length-1){d(-1),g(null),o(!1);return}d(K),o(!1);const he=j[K],te=`${he.runId}::${e.keyword}::${e.provider}`;if(v[te]){g(v[te]);return}b(!0);try{const C=await tr(he.runId);if(se!==Se.current)return;const G=C.snapshots.find(F=>F.keyword===e.keyword&&F.provider===e.provider)??C.snapshots.find(F=>F.keyword===e.keyword),ne=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:he.citationState,summary:""}:{citationState:he.citationState,provider:e.provider,model:he.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:he.citationState,summary:"Snapshot data not available for this run."};w(F=>({...F,[te]:ne})),g(ne)}catch{if(se!==Se.current)return;g({citationState:he.citationState,provider:e.provider,model:he.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:he.citationState,summary:"Failed to load historical run data."})}finally{se===Se.current&&b(!1)}},[j,e.keyword,e.provider,v]),Ae=(A||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,qe=!A&&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(" · "):"",Le=O&&L>0?{label:"Citation confirmed",title:`Cited #${L} of ${H} domain${H!==1?"s":""}`,meta:Ae}:O?{label:"Citation confirmed",title:"Cited in this answer",meta:Ae}:E.citationState==="lost"?{label:"Citation lost",title:H>0?`${H} domain${H!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:Ae}:E.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:H>0?`${H} domain${H!==1?"s":""} cited instead`:"No domains cited for this query",meta:Ae},q=()=>{if(!E.answerSnippet)return null;const K=E.answerSnippet.split(`
246
+ `),se=[];let he=[],te=0;const C=()=>{if(he.length===0)return;const G=he.join(" ").trim();G&&se.push(c.jsx("p",{className:se.length>0?"mt-2.5":"",children:b0(G,R)},te++)),he=[]};for(const G of K){const ne=G.trim();if(/^[-–—]{3,}$/.test(ne)){C(),se.push(c.jsx("hr",{className:"border-zinc-800/60 my-3"},te++));continue}const F=ne.match(/^(#{1,3})\s+(.+)$/);if(F){C();const de=F[1].length,me=F[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||F[2],we=de===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":de===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";se.push(c.jsx("p",{className:we,children:b0(me,R)},te++));continue}if(ne===""){C();continue}he.push(ne)}return C(),se};return c.jsx(Lv,{open:!0,onOpenChange:K=>{K||s()},children:c.jsxs(Uv,{children:[c.jsx(Vf,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),c.jsxs(Pf,{className:"evidence-modal","aria-describedby":void 0,children:[c.jsxs("div",{className:"evidence-modal-header",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("p",{className:"eyebrow eyebrow-soft",children:[n.project.name," · ",E.provider||"All providers"]}),c.jsx(Qf,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),c.jsxs(Bv,{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:[c.jsx(Jf,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]}),k&&c.jsxs("div",{className:"evidence-modal-timeline",children:[c.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),c.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:j.map((K,se)=>{const he=u===-1&&se===j.length-1||u===se,te=K.citationState==="cited"?"bg-emerald-400":K.citationState==="emerging"?"bg-amber-400":K.citationState==="lost"?"bg-rose-400":"bg-zinc-600",G=new Date(K.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),ne=!!(K.model&&se>0&&j[se-1]?.model&&j[se-1].model!==K.model);return c.jsxs("button",{type:"button",className:`evidence-run-dot ${he?"evidence-run-dot--selected":""}`,onClick:()=>ae(se===j.length-1?-1:se),"aria-label":[`Run ${G}: ${K.citationState}`,K.model?`model ${K.model}`:null,ne?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":he,children:[c.jsx("span",{className:`size-2 rounded-full ${te} ${ne?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),c.jsx("span",{className:"text-[10px] text-zinc-500",children:G})]},se)})}),u>=0&&u<j.length&&c.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(j[u].createdAt).toLocaleString()," — ",c.jsx("span",{className:"capitalize",children:j[u].citationState}),c.jsx("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>ae(-1),children:"← Back to latest"})]}),!A&&(e.modelTransitions?.length??0)>0&&c.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(K=>c.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:`${K.fromModel??"unknown"} -> ${K.toModel??"unknown"} on ${new Date(K.createdAt).toLocaleDateString()}`},`${K.runId}:${K.toModel??"unknown"}`))})]}),c.jsxs("div",{className:"evidence-modal-body",children:[p&&c.jsx("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:"Loading historical run data…"}),!p&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"evidence-modal-main",children:[c.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${Q}`,children:[c.jsx("p",{className:`evidence-position-label evidence-position-label--${Q}`,children:Le.label}),c.jsx("p",{className:`evidence-position-title evidence-position-title--${Q}`,children:Le.title}),c.jsx("p",{className:"evidence-position-meta",children:Le.meta}),qe&&c.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:qe})]}),E.answerSnippet&&c.jsxs("div",{children:[c.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),c.jsx("div",{className:`answer-snippet-block ${l?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:q()}),E.answerSnippet.length>280&&c.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>o(!l),children:l?"↑ Collapse":"↓ Show full answer"})]}),!E.answerSnippet&&!p&&c.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"}),!A&&e.relatedTechnicalSignals.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"drawer-section-label",children:O?"Why you're cited":"What to fix"}),c.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((K,se)=>c.jsxs("div",{className:"action-item",children:[c.jsx("svg",{className:`action-item-icon ${O?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:O?c.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),c.jsx("span",{className:"action-item-text",children:K})]},se))})]}),E.summary&&c.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),c.jsxs("div",{className:"evidence-modal-sidebar",children:[E.citedDomains.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"drawer-section-label",children:"Who was cited — in order"}),c.jsxs("div",{className:"citation-leaderboard",children:[E.citedDomains.map((K,se)=>{const he=K.toLowerCase().replace(/^www\./,""),te=z.has(he),C=!te&&E.competitorDomains.some(ne=>ne.toLowerCase().replace(/^www\./,"")===he),G=te?"you":C?"competitor":"other";return c.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${G}`,children:[c.jsxs("span",{className:"citation-leaderboard-rank",children:["#",se+1]}),c.jsx("span",{className:"citation-leaderboard-domain",children:K}),te&&c.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),C&&c.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},K)}),!O&&c.jsxs("div",{className:"citation-leaderboard-item citation-leaderboard-item--not-cited border-dashed",children:[c.jsx("span",{className:"citation-leaderboard-rank text-zinc-600",children:"—"}),c.jsx("span",{className:"citation-leaderboard-domain text-zinc-600",children:n.project.canonicalDomain}),c.jsx("span",{className:"citation-leaderboard-tag text-zinc-600",children:"Not cited"})]})]})]}),E.groundingSources.length>0&&c.jsxs("div",{children:[c.jsxs("p",{className:"drawer-section-label",children:["Grounding sources (",E.groundingSources.length,")"]}),c.jsx("ul",{className:"grid gap-0.5",children:E.groundingSources.map((K,se)=>c.jsx("li",{className:"truncate text-sm",children:c.jsx("a",{href:K.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:K.title||K.uri})},se))})]}),E.evidenceUrls.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),c.jsx("ul",{className:"grid gap-1",children:E.evidenceUrls.map(K=>c.jsx("li",{className:"truncate text-sm",children:c.jsx("a",{href:K,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:K})},K))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.evidenceUrls.length===0&&c.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No citation data ",A?"for this run":"yet"]})]})]})]})]})]})})}async function FT(){try{const[e,n,s]=await Promise.all([sA(),aA(),Pb().catch(()=>null)]),l=await Promise.all(e.map(async o=>{const u=n.filter(w=>w.projectId===o.id),d=u.filter(w=>(w.status==="completed"||w.status==="partial")&&w.kind==="answer-visibility").sort((w,N)=>N.createdAt.localeCompare(w.createdAt)),[m,g,p,b,v]=await Promise.all([lA(o.name).catch(()=>[]),Gb(o.name).catch(()=>[]),Kb(o.name).catch(()=>[]),d[0]?tr(d[0].id).catch(()=>null):Promise.resolve(null),d[1]?tr(d[1].id).catch(()=>null):Promise.resolve(null)]);return{project:o,runs:u,keywords:m,competitors:g,timeline:p,latestRunDetail:b,previousRunDetail:v}}));return lT(l,s)}catch{return null}}function WT({initialPathname:e,initialDashboard:n,initialHealthSnapshot:s,enableLiveStatus:l=!0}){const[o,u]=x.useState(n??null),[d,m]=x.useState(!n),[g,p]=x.useState(n?!0:null),[b,v]=x.useState(()=>fT(e)),[w,N]=x.useState(!1),[z,j]=x.useState(null),[k,A]=x.useState(null),[E,O]=x.useState(!1),[D,L]=x.useState(s??cT),H=x.useCallback(async()=>{const $=await FT();$?(u($),p(!0)):p(!1),m(!1)},[]);x.useEffect(()=>{n||H()},[n,H]);const V=o?.runs.some($=>$.status==="running"||$.status==="queued")??!1;if(x.useEffect(()=>{if(!V)return;const $=setInterval(()=>{H()},3e3);return()=>clearInterval($)},[V,H]),x.useEffect(()=>{if(typeof window>"u")return;const $=()=>{v(cs(window.location.pathname))};return window.addEventListener("popstate",$),()=>{window.removeEventListener("popstate",$)}},[]),x.useEffect(()=>{N(!1),j(null)},[b]),x.useEffect(()=>{if(d||!o)return;const $=o.projects.length>0;if(b==="/setup"&&$)typeof window<"u"&&cs(window.location.pathname)!=="/"&&window.history.replaceState({},"","/"),v("/");else if(b==="/"&&!$){const ie="/setup";typeof window<"u"&&cs(window.location.pathname)!==ie&&window.history.replaceState({},"",ie),v(ie)}},[d,o,b]),x.useEffect(()=>{if(typeof window>"u"||z===null)return;const $=ie=>{ie.key==="Escape"&&j(null)};return window.addEventListener("keydown",$),()=>{window.removeEventListener("keydown",$)}},[z]),x.useEffect(()=>{if(!l||typeof window>"u")return;let $=!0;const ie=async()=>{const le=await uT("/health","API"),Ie=le.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:le.state,detail:"Depends on API"};$&&L({apiStatus:le,workerStatus:Ie})};ie();const Ze=window.setInterval(()=>{ie()},15e3);return()=>{$=!1,window.clearInterval(Ze)}},[l]),!d&&!o&&g===!1)return c.jsx("div",{className:"app-shell",children:c.jsx("div",{className:"main-area",style:{gridColumn:"1 / -1"},children:c.jsx("main",{id:"content",className:"page-shell",children:c.jsxs("div",{className:"page-container",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Cannot connect to API"}),c.jsxs("p",{className:"page-subtitle",children:["The dashboard could not reach the Canonry API. Make sure ",c.jsx("code",{children:"canonry serve"})," is running and try refreshing the page."]})]})}),c.jsx(ce,{type:"button",onClick:()=>{m(!0),H()},children:"Retry connection"})]})})})});const R=o??oT.dashboard,Q=dT(b,R),Se=Q.kind==="project"?Zb(R,Q.projectId):void 0,ae=$=>{const ie=cs($);if(typeof window>"u"){v(ie);return}cs(window.location.pathname)!==ie&&window.history.pushState({},"",ie),v(ie)},fe=$=>{if(!$)return;j({kind:"run",runId:$}),A(null),O(!0);const ie=$;tr($).then(Ze=>{j(le=>(le?.kind==="run"&&le.runId===ie&&A(Ze),le))}).catch(()=>{j(Ze=>(Ze?.kind==="run"&&Ze.runId===ie&&A(null),Ze))}).finally(()=>O(!1))},Ae=()=>{_A().catch($=>{console.error("Failed to trigger all runs",$)}).finally(()=>{H()})};x.useEffect(()=>{if(z?.kind!=="run"||!k||k.status!=="running"&&k.status!=="queued")return;const $=setInterval(()=>{tr(z.runId).then(ie=>{A(ie),ie.status!=="running"&&ie.status!=="queued"&&H()}).catch(()=>{})},3e3);return()=>clearInterval($)},[z,k?.status,k?.snapshots.length,H]);const qe=$=>{j({kind:"evidence",evidenceId:$})},Le=async $=>{await Vb($),H()},q=async $=>{try{await pA($),ae("/"),H()}catch(ie){console.error("Failed to delete project:",ie)}},K=async($,ie)=>{await cA($,ie),await H()},se=async($,ie)=>{await oA($,ie),await H()},he=async($,ie)=>{const le=(await Gb($)).map(Mt=>Mt.domain),Ie=[...new Set([...le,...ie])];await Yb($,Ie),await H()},te=async($,ie)=>{await uA($,ie),await H()},C=async($,ie)=>{await dA($,ie),await H()},G=pT(R.portfolioOverview.systemHealth,D,R.settings),ne=yT(R.setup,D,R.settings),F=z?.kind==="run"?eA(R,z.runId):void 0,de=z?.kind==="evidence"?tA(R,z.evidenceId):void 0,me=[{label:"Overview",href:"/",icon:z1,active:qo(Q,"overview")},{label:"Projects",href:"/projects",icon:N1,active:qo(Q,"projects")},{label:"Runs",href:"/runs",icon:A1,active:qo(Q,"runs")},{label:"Settings",href:"/settings",icon:M1,active:qo(Q,"settings")}],we=Q.kind==="overview"?"Portfolio":Q.kind==="projects"?"Projects":Q.kind==="project"&&Se?Se.project.name:Q.kind==="runs"?"Runs":Q.kind==="settings"?"Settings":Q.kind==="setup"?"Setup":"Not found";return c.jsxs("div",{className:"app-shell",children:[c.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),c.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[c.jsx("div",{className:"sidebar-brand",children:c.jsx(g0,{navigate:ae})}),c.jsxs("nav",{className:"sidebar-nav",children:[me.map($=>c.jsxs("a",{className:`sidebar-link ${$.active?"sidebar-link-active":""}`,href:$.href,"aria-current":$.active?"page":void 0,onClick:xn(ae,$.href),children:[c.jsx($.icon,{className:"sidebar-icon"}),c.jsx("span",{children:$.label})]},$.label)),R.projects.length>0?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"sidebar-section-title",children:"Projects"}),R.projects.map($=>{const ie=Q.kind==="project"&&Se?.project.id===$.project.id,Ze=$.visibilitySummary.tone;return c.jsxs("a",{className:`sidebar-project ${ie?"sidebar-project-active":""}`,href:`/projects/${$.project.id}`,onClick:xn(ae,`/projects/${$.project.id}`),children:[c.jsx("span",{className:`sidebar-dot sidebar-dot-${Ze}`}),c.jsx("span",{children:$.project.name})]},$.project.id)})]}):null,R.projects.length===0?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"sidebar-section-title",children:"Resources"}),c.jsxs("a",{className:"sidebar-link",href:"/setup","aria-current":Q.kind==="setup"?"page":void 0,onClick:xn(ae,"/setup"),children:[c.jsx(D1,{className:"sidebar-icon"}),c.jsx("span",{children:"Setup"})]})]}):null]}),c.jsx("div",{className:"sidebar-footer",children:m0.map($=>c.jsx("a",{className:"sidebar-footer-link",href:$.href,target:"_blank",rel:"noreferrer",children:$.label},$.href))})]}),c.jsxs("div",{className:"main-area",children:[c.jsxs("header",{className:"topbar",children:[c.jsxs("div",{className:"topbar-left",children:[c.jsx("div",{className:"topbar-brand-mobile",children:c.jsx(g0,{compact:!0,navigate:ae})}),c.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[c.jsx("a",{href:"/",onClick:xn(ae,"/"),children:"Home"}),c.jsx(Xf,{className:"breadcrumb-sep size-3"}),c.jsx("span",{className:"breadcrumb-current",children:we})]})]}),c.jsxs("div",{className:"topbar-actions",children:[c.jsxs("div",{className:"health-pill-row",children:[c.jsxs("span",{className:`health-pill health-pill-${D.apiStatus.state}`,children:["API ",D.apiStatus.state==="ok"?"ok":D.apiStatus.state]}),c.jsxs("span",{className:`health-pill health-pill-${D.workerStatus.state}`,children:["Worker ",D.workerStatus.state==="ok"?"ok":D.workerStatus.state]})]}),c.jsxs(ce,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":w,"aria-controls":"mobile-nav",onClick:()=>N($=>!$),children:[c.jsx(C1,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),c.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${w?"mobile-nav-open":""}`,children:[c.jsxs(ce,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>N(!1),children:[c.jsx(Jf,{className:"size-5"}),c.jsx("span",{className:"sr-only",children:"Close navigation"})]}),me.map($=>c.jsx("a",{className:`mobile-nav-link ${$.active?"mobile-nav-link-active":""}`,href:$.href,"aria-current":$.active?"page":void 0,onClick:xn(ae,$.href),children:$.label},$.label)),R.projects.length>0?c.jsxs("div",{className:"mobile-nav-section",children:[c.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),R.projects.map($=>c.jsx("a",{className:"mobile-nav-link",href:`/projects/${$.project.id}`,onClick:xn(ae,`/projects/${$.project.id}`),children:$.project.name},$.project.id))]}):null]}),c.jsx("main",{id:"content",className:"page-shell",children:d?c.jsx("div",{className:"page-container",children:c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Loading"}),c.jsx("p",{className:"page-subtitle",children:"Connecting to API and loading dashboard data..."})]})})}):c.jsxs(c.Fragment,{children:[Q.kind==="overview"?c.jsx(_T,{model:R.portfolioOverview,systemHealth:G,onNavigate:ae,onOpenRun:fe}):null,Q.kind==="projects"?c.jsx(CT,{projects:R.projects,onNavigate:ae,onProjectCreated:H}):null,Q.kind==="project"&&Se?c.jsx(AT,{model:Se,tab:Q.tab,onOpenEvidence:qe,onOpenRun:fe,onTriggerRun:Le,onDeleteProject:q,onAddKeywords:K,onDeleteKeywords:se,onAddCompetitors:he,onUpdateOwnedDomains:te,onUpdateProject:C,onNavigate:ae}):null,Q.kind==="runs"?c.jsx(IT,{runs:R.runs,onOpenRun:fe,onTriggerAll:Ae}):null,Q.kind==="settings"?c.jsx(KT,{settings:R.settings,healthSnapshot:D,onSettingsChanged:H}):null,Q.kind==="setup"?c.jsx(PT,{model:ne,settings:R.settings,onProjectCreated:H,onNavigate:ae}):null,Q.kind==="not-found"?c.jsx(QT,{onNavigate:ae}):null]})}),c.jsxs("footer",{className:"footer",children:[c.jsx("p",{className:"supporting-copy",children:"Technical readiness and answer visibility stay separate."}),c.jsx("div",{className:"footer-links",children:m0.map($=>c.jsx("a",{href:$.href,target:"_blank",rel:"noreferrer",children:$.label},$.href))})]})]}),F?c.jsxs(XT,{open:F!==void 0,title:F.summary,subtitle:`${F.projectName} · ${F.kindLabel}`,onClose:()=>j(null),children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[c.jsx(_c,{status:F.status}),c.jsx("span",{className:"text-zinc-400",children:F.startedAt}),c.jsx("span",{className:"text-zinc-500",children:F.duration}),c.jsx("span",{className:"text-zinc-600",children:F.triggerLabel})]}),F.status==="failed"&&F.statusDetail&&c.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:F.statusDetail}),c.jsxs("div",{className:"mt-4",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),E?c.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):k&&k.snapshots.length>0?c.jsxs("div",{className:"space-y-2",children:[k.snapshots.map($=>c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[c.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:$.keyword??"Unknown key phrase"}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(fh,{provider:$.provider}),c.jsx(Lb,{variant:$.citationState==="cited"?"success":"neutral",children:$.citationState})]})]}),$.model&&c.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:$.model}),$.citedDomains.length>0&&c.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[c.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",$.citedDomains.join(", ")]}),$.competitorOverlap.length>0&&c.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",$.competitorOverlap.join(", ")]}),$.groundingSources&&$.groundingSources.length>0&&c.jsxs("details",{className:"mt-2",children:[c.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[$.groundingSources.length," grounding source",$.groundingSources.length!==1?"s":""]}),c.jsx("ul",{className:"mt-1 space-y-0.5",children:$.groundingSources.map((ie,Ze)=>c.jsx("li",{className:"text-xs text-zinc-500 truncate",children:c.jsx("a",{href:ie.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:ie.title||ie.uri})},Ze))})]}),$.answerText&&c.jsxs("details",{className:"mt-1",children:[c.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),c.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:$.answerText})]})]},$.id)),k.status==="running"&&c.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[c.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):k&&k.status==="running"?c.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[c.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):k&&k.status==="queued"?c.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[c.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):k&&k.error?c.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[c.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),c.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:mT(k.error)})]}):c.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,de?c.jsx(JT,{evidence:de.evidence,project:de.project,onClose:()=>j(null)}):null]})}const ax=document.getElementById("root");if(!ax)throw new Error("Expected #root element for web app bootstrap.");kw.createRoot(ax).render(c.jsx(x.StrictMode,{children:c.jsx(WT,{})}));