@feltdb/feltkit 0.3.22 → 0.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.d.ts +17 -3
- package/dist/app.js +10 -0
- package/dist/app.js.map +1 -1
- package/dist/appboundry/build.js +4 -0
- package/dist/appboundry/build.js.map +1 -1
- package/dist/authorize.d.ts +1 -1
- package/dist/cli/main.js +8 -152
- package/dist/cli/main.js.map +1 -1
- package/dist/client/index.d.ts +83 -4
- package/dist/client/index.js +154 -2
- package/dist/client/index.js.map +1 -1
- package/dist/dashboard/assets/index-BEjtLLYq.js +15 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +1 -0
- package/dist/docs.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js.map +1 -1
- package/dist/platform/approvals.d.ts +102 -0
- package/dist/platform/approvals.js +155 -0
- package/dist/platform/approvals.js.map +1 -0
- package/dist/platform/artifacts.d.ts +126 -0
- package/dist/platform/artifacts.js +251 -0
- package/dist/platform/artifacts.js.map +1 -0
- package/dist/platform/blobs.d.ts +25 -0
- package/dist/platform/blobs.js +78 -0
- package/dist/platform/blobs.js.map +1 -0
- package/dist/platform/diff.d.ts +23 -0
- package/dist/platform/diff.js +107 -0
- package/dist/platform/diff.js.map +1 -0
- package/dist/platform/exec.d.ts +182 -0
- package/dist/platform/exec.js +575 -0
- package/dist/platform/exec.js.map +1 -0
- package/dist/platform/operations.d.ts +30 -13
- package/dist/platform/operations.js +8 -17
- package/dist/platform/operations.js.map +1 -1
- package/dist/platform/permissions.d.ts +15 -0
- package/dist/platform/permissions.js +16 -0
- package/dist/platform/permissions.js.map +1 -0
- package/dist/platform/platform.d.ts +28 -0
- package/dist/platform/platform.js +84 -5
- package/dist/platform/platform.js.map +1 -1
- package/dist/platform/releases.d.ts +110 -0
- package/dist/platform/releases.js +344 -0
- package/dist/platform/releases.js.map +1 -0
- package/dist/platform/review.d.ts +10 -0
- package/dist/platform/review.js +109 -0
- package/dist/platform/review.js.map +1 -0
- package/dist/platform/server.js +7 -0
- package/dist/platform/server.js.map +1 -1
- package/dist/platform/source.d.ts +2 -0
- package/dist/platform/source.js +1 -1
- package/dist/platform/source.js.map +1 -1
- package/dist/platform/workspace-operations.d.ts +2 -0
- package/dist/platform/workspace-operations.js +590 -0
- package/dist/platform/workspace-operations.js.map +1 -0
- package/dist/platform/workspaces.d.ts +211 -0
- package/dist/platform/workspaces.js +435 -0
- package/dist/platform/workspaces.js.map +1 -0
- package/dist/react/index.d.ts +29 -1
- package/dist/react/index.js +50 -0
- package/dist/react/index.js.map +1 -1
- package/dist/runtime/activity.d.ts +1 -1
- package/dist/runtime/agent.d.ts +216 -2
- package/dist/runtime/agent.js +333 -7
- package/dist/runtime/agent.js.map +1 -1
- package/dist/runtime/approval-rules.d.ts +16 -0
- package/dist/runtime/approval-rules.js +37 -0
- package/dist/runtime/approval-rules.js.map +1 -0
- package/dist/runtime/authority.d.ts +18 -1
- package/dist/runtime/authority.js +26 -1
- package/dist/runtime/authority.js.map +1 -1
- package/dist/runtime/browser-inference.d.ts +52 -0
- package/dist/runtime/browser-inference.js +53 -0
- package/dist/runtime/browser-inference.js.map +1 -0
- package/dist/runtime/context.d.ts +110 -0
- package/dist/runtime/decisions.d.ts +23 -0
- package/dist/runtime/decisions.js +54 -0
- package/dist/runtime/decisions.js.map +1 -1
- package/dist/runtime/generation.d.ts +94 -0
- package/dist/runtime/generation.js +295 -0
- package/dist/runtime/generation.js.map +1 -0
- package/dist/runtime/runtime.d.ts +10 -2
- package/dist/runtime/runtime.js +125 -1
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/server/admin.d.ts +9 -1
- package/dist/server/admin.js +84 -2
- package/dist/server/admin.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +159 -8
- package/dist/server/index.js.map +1 -1
- package/dist/testing/index.d.ts +11 -0
- package/dist/testing/index.js +7 -3
- package/dist/testing/index.js.map +1 -1
- package/docs/AUTH.md +2 -2
- package/docs/GENERATION.md +136 -0
- package/docs/README.md +3 -2
- package/package.json +2 -4
- package/skills/.claude-plugin/marketplace.json +1 -1
- package/skills/.claude-plugin/plugin.json +1 -1
- package/dist/cli/compose.d.ts +0 -31
- package/dist/cli/compose.js +0 -274
- package/dist/cli/compose.js.map +0 -1
- package/dist/cli/create.d.ts +0 -219
- package/dist/cli/create.js +0 -1197
- package/dist/cli/create.js.map +0 -1
- package/dist/cli/domain.d.ts +0 -174
- package/dist/cli/domain.js +0 -1170
- package/dist/cli/domain.js.map +0 -1
- package/dist/cli/screens.d.ts +0 -25
- package/dist/cli/screens.js +0 -282
- package/dist/cli/screens.js.map +0 -1
- package/dist/cli/shell.d.ts +0 -7
- package/dist/cli/shell.js +0 -63
- package/dist/cli/shell.js.map +0 -1
- package/dist/composition/catalog.d.ts +0 -3
- package/dist/composition/catalog.js +0 -217
- package/dist/composition/catalog.js.map +0 -1
- package/dist/composition/contract.d.ts +0 -165
- package/dist/composition/contract.js +0 -12
- package/dist/composition/contract.js.map +0 -1
- package/dist/composition/execute.d.ts +0 -110
- package/dist/composition/execute.js +0 -350
- package/dist/composition/execute.js.map +0 -1
- package/dist/composition/generate.d.ts +0 -105
- package/dist/composition/generate.js +0 -274
- package/dist/composition/generate.js.map +0 -1
- package/dist/composition/plan.d.ts +0 -131
- package/dist/composition/plan.js +0 -558
- package/dist/composition/plan.js.map +0 -1
- package/dist/composition/profiles.d.ts +0 -20
- package/dist/composition/profiles.js +0 -81
- package/dist/composition/profiles.js.map +0 -1
- package/dist/composition/reconcile.d.ts +0 -153
- package/dist/composition/reconcile.js +0 -282
- package/dist/composition/reconcile.js.map +0 -1
- package/dist/composition/recover.d.ts +0 -89
- package/dist/composition/recover.js +0 -407
- package/dist/composition/recover.js.map +0 -1
- package/dist/composition/resolve.d.ts +0 -2
- package/dist/composition/resolve.js +0 -208
- package/dist/composition/resolve.js.map +0 -1
- package/dist/dashboard/assets/index-BrC1AtZ1.js +0 -15
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))r(f);new MutationObserver(f=>{for(const v of f)if(v.type==="childList")for(const b of v.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&r(b)}).observe(document,{childList:!0,subtree:!0});function d(f){const v={};return f.integrity&&(v.integrity=f.integrity),f.referrerPolicy&&(v.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?v.credentials="include":f.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function r(f){if(f.ep)return;f.ep=!0;const v=d(f);fetch(f.href,v)}})();var _r={exports:{}},gi={};var am;function Dg(){if(am)return gi;am=1;var n=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function d(r,f,v){var b=null;if(v!==void 0&&(b=""+v),f.key!==void 0&&(b=""+f.key),"key"in f){v={};for(var g in f)g!=="key"&&(v[g]=f[g])}else v=f;return f=v.ref,{$$typeof:n,type:r,key:b,ref:f!==void 0?f:null,props:v}}return gi.Fragment=u,gi.jsx=d,gi.jsxs=d,gi}var nm;function zg(){return nm||(nm=1,_r.exports=Dg()),_r.exports}var i=zg(),Nr={exports:{}},oe={};var im;function Rg(){if(im)return oe;im=1;var n=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),b=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),N=Symbol.iterator;function O(_){return _===null||typeof _!="object"?null:(_=N&&_[N]||_["@@iterator"],typeof _=="function"?_:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,U={};function D(_,$,K){this.props=_,this.context=$,this.refs=U,this.updater=K||L}D.prototype.isReactComponent={},D.prototype.setState=function(_,$){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,$,"setState")},D.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function Q(){}Q.prototype=D.prototype;function J(_,$,K){this.props=_,this.context=$,this.refs=U,this.updater=K||L}var Z=J.prototype=new Q;Z.constructor=J,w(Z,D.prototype),Z.isPureReactComponent=!0;var ne=Array.isArray;function ge(){}var W={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function ue(_,$,K){var F=K.ref;return{$$typeof:n,type:_,key:$,ref:F!==void 0?F:null,props:K}}function _e(_,$){return ue(_.type,$,_.props)}function Qe(_){return typeof _=="object"&&_!==null&&_.$$typeof===n}function Fe(_){var $={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(K){return $[K]})}var _t=/\/+/g;function pt(_,$){return typeof _=="object"&&_!==null&&_.key!=null?Fe(""+_.key):$.toString(36)}function st(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(ge,ge):(_.status="pending",_.then(function($){_.status==="pending"&&(_.status="fulfilled",_.value=$)},function($){_.status==="pending"&&(_.status="rejected",_.reason=$)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function M(_,$,K,F,re){var X=typeof _;(X==="undefined"||X==="boolean")&&(_=null);var te=!1;if(_===null)te=!0;else switch(X){case"bigint":case"string":case"number":te=!0;break;case"object":switch(_.$$typeof){case n:case u:te=!0;break;case S:return te=_._init,M(te(_._payload),$,K,F,re)}}if(te)return re=re(_),te=F===""?"."+pt(_,0):F,ne(re)?(K="",te!=null&&(K=te.replace(_t,"$&/")+"/"),M(re,$,K,"",function(ul){return ul})):re!=null&&(Qe(re)&&(re=_e(re,K+(re.key==null||_&&_.key===re.key?"":(""+re.key).replace(_t,"$&/")+"/")+te)),$.push(re)),1;te=0;var me=F===""?".":F+":";if(ne(_))for(var Ue=0;Ue<_.length;Ue++)F=_[Ue],X=me+pt(F,Ue),te+=M(F,$,K,X,re);else if(Ue=O(_),typeof Ue=="function")for(_=Ue.call(_),Ue=0;!(F=_.next()).done;)F=F.value,X=me+pt(F,Ue++),te+=M(F,$,K,X,re);else if(X==="object"){if(typeof _.then=="function")return M(st(_),$,K,F,re);throw $=String(_),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return te}function G(_,$,K){if(_==null)return _;var F=[],re=0;return M(_,F,"","",function(X){return $.call(K,X,re++)}),F}function P(_){if(_._status===-1){var $=_._result;$=$(),$.then(function(K){(_._status===0||_._status===-1)&&(_._status=1,_._result=K)},function(K){(_._status===0||_._status===-1)&&(_._status=2,_._result=K)}),_._status===-1&&(_._status=0,_._result=$)}if(_._status===1)return _._result.default;throw _._result}var je=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},De={map:G,forEach:function(_,$,K){G(_,function(){$.apply(this,arguments)},K)},count:function(_){var $=0;return G(_,function(){$++}),$},toArray:function(_){return G(_,function($){return $})||[]},only:function(_){if(!Qe(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return oe.Activity=p,oe.Children=De,oe.Component=D,oe.Fragment=d,oe.Profiler=f,oe.PureComponent=J,oe.StrictMode=r,oe.Suspense=m,oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,oe.__COMPILER_RUNTIME={__proto__:null,c:function(_){return W.H.useMemoCache(_)}},oe.cache=function(_){return function(){return _.apply(null,arguments)}},oe.cacheSignal=function(){return null},oe.cloneElement=function(_,$,K){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var F=w({},_.props),re=_.key;if($!=null)for(X in $.key!==void 0&&(re=""+$.key),$)!Y.call($,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&$.ref===void 0||(F[X]=$[X]);var X=arguments.length-2;if(X===1)F.children=K;else if(1<X){for(var te=Array(X),me=0;me<X;me++)te[me]=arguments[me+2];F.children=te}return ue(_.type,re,F)},oe.createContext=function(_){return _={$$typeof:b,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:v,_context:_},_},oe.createElement=function(_,$,K){var F,re={},X=null;if($!=null)for(F in $.key!==void 0&&(X=""+$.key),$)Y.call($,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(re[F]=$[F]);var te=arguments.length-2;if(te===1)re.children=K;else if(1<te){for(var me=Array(te),Ue=0;Ue<te;Ue++)me[Ue]=arguments[Ue+2];re.children=me}if(_&&_.defaultProps)for(F in te=_.defaultProps,te)re[F]===void 0&&(re[F]=te[F]);return ue(_,X,re)},oe.createRef=function(){return{current:null}},oe.forwardRef=function(_){return{$$typeof:g,render:_}},oe.isValidElement=Qe,oe.lazy=function(_){return{$$typeof:S,_payload:{_status:-1,_result:_},_init:P}},oe.memo=function(_,$){return{$$typeof:h,type:_,compare:$===void 0?null:$}},oe.startTransition=function(_){var $=W.T,K={};W.T=K;try{var F=_(),re=W.S;re!==null&&re(K,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(ge,je)}catch(X){je(X)}finally{$!==null&&K.types!==null&&($.types=K.types),W.T=$}},oe.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},oe.use=function(_){return W.H.use(_)},oe.useActionState=function(_,$,K){return W.H.useActionState(_,$,K)},oe.useCallback=function(_,$){return W.H.useCallback(_,$)},oe.useContext=function(_){return W.H.useContext(_)},oe.useDebugValue=function(){},oe.useDeferredValue=function(_,$){return W.H.useDeferredValue(_,$)},oe.useEffect=function(_,$){return W.H.useEffect(_,$)},oe.useEffectEvent=function(_){return W.H.useEffectEvent(_)},oe.useId=function(){return W.H.useId()},oe.useImperativeHandle=function(_,$,K){return W.H.useImperativeHandle(_,$,K)},oe.useInsertionEffect=function(_,$){return W.H.useInsertionEffect(_,$)},oe.useLayoutEffect=function(_,$){return W.H.useLayoutEffect(_,$)},oe.useMemo=function(_,$){return W.H.useMemo(_,$)},oe.useOptimistic=function(_,$){return W.H.useOptimistic(_,$)},oe.useReducer=function(_,$,K){return W.H.useReducer(_,$,K)},oe.useRef=function(_){return W.H.useRef(_)},oe.useState=function(_){return W.H.useState(_)},oe.useSyncExternalStore=function(_,$,K){return W.H.useSyncExternalStore(_,$,K)},oe.useTransition=function(){return W.H.useTransition()},oe.version="19.2.0",oe}var sm;function Yr(){return sm||(sm=1,Nr.exports=Rg()),Nr.exports}var A=Yr(),Tr={exports:{}},bi={},Ar={exports:{}},Er={};var cm;function wg(){return cm||(cm=1,(function(n){function u(M,G){var P=M.length;M.push(G);e:for(;0<P;){var je=P-1>>>1,De=M[je];if(0<f(De,G))M[je]=G,M[P]=De,P=je;else break e}}function d(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var G=M[0],P=M.pop();if(P!==G){M[0]=P;e:for(var je=0,De=M.length,_=De>>>1;je<_;){var $=2*(je+1)-1,K=M[$],F=$+1,re=M[F];if(0>f(K,P))F<De&&0>f(re,K)?(M[je]=re,M[F]=P,je=F):(M[je]=K,M[$]=P,je=$);else if(F<De&&0>f(re,P))M[je]=re,M[F]=P,je=F;else break e}}return G}function f(M,G){var P=M.sortIndex-G.sortIndex;return P!==0?P:M.id-G.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;n.unstable_now=function(){return v.now()}}else{var b=Date,g=b.now();n.unstable_now=function(){return b.now()-g}}var m=[],h=[],S=1,p=null,N=3,O=!1,L=!1,w=!1,U=!1,D=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function Z(M){for(var G=d(h);G!==null;){if(G.callback===null)r(h);else if(G.startTime<=M)r(h),G.sortIndex=G.expirationTime,u(m,G);else break;G=d(h)}}function ne(M){if(w=!1,Z(M),!L)if(d(m)!==null)L=!0,ge||(ge=!0,Fe());else{var G=d(h);G!==null&&st(ne,G.startTime-M)}}var ge=!1,W=-1,Y=5,ue=-1;function _e(){return U?!0:!(n.unstable_now()-ue<Y)}function Qe(){if(U=!1,ge){var M=n.unstable_now();ue=M;var G=!0;try{e:{L=!1,w&&(w=!1,Q(W),W=-1),O=!0;var P=N;try{t:{for(Z(M),p=d(m);p!==null&&!(p.expirationTime>M&&_e());){var je=p.callback;if(typeof je=="function"){p.callback=null,N=p.priorityLevel;var De=je(p.expirationTime<=M);if(M=n.unstable_now(),typeof De=="function"){p.callback=De,Z(M),G=!0;break t}p===d(m)&&r(m),Z(M)}else r(m);p=d(m)}if(p!==null)G=!0;else{var _=d(h);_!==null&&st(ne,_.startTime-M),G=!1}}break e}finally{p=null,N=P,O=!1}G=void 0}}finally{G?Fe():ge=!1}}}var Fe;if(typeof J=="function")Fe=function(){J(Qe)};else if(typeof MessageChannel<"u"){var _t=new MessageChannel,pt=_t.port2;_t.port1.onmessage=Qe,Fe=function(){pt.postMessage(null)}}else Fe=function(){D(Qe,0)};function st(M,G){W=D(function(){M(n.unstable_now())},G)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(M){M.callback=null},n.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<M?Math.floor(1e3/M):5},n.unstable_getCurrentPriorityLevel=function(){return N},n.unstable_next=function(M){switch(N){case 1:case 2:case 3:var G=3;break;default:G=N}var P=N;N=G;try{return M()}finally{N=P}},n.unstable_requestPaint=function(){U=!0},n.unstable_runWithPriority=function(M,G){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var P=N;N=M;try{return G()}finally{N=P}},n.unstable_scheduleCallback=function(M,G,P){var je=n.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?je+P:je):P=je,M){case 1:var De=-1;break;case 2:De=250;break;case 5:De=1073741823;break;case 4:De=1e4;break;default:De=5e3}return De=P+De,M={id:S++,callback:G,priorityLevel:M,startTime:P,expirationTime:De,sortIndex:-1},P>je?(M.sortIndex=P,u(h,M),d(m)===null&&M===d(h)&&(w?(Q(W),W=-1):w=!0,st(ne,P-je))):(M.sortIndex=De,u(m,M),L||O||(L=!0,ge||(ge=!0,Fe()))),M},n.unstable_shouldYield=_e,n.unstable_wrapCallback=function(M){var G=N;return function(){var P=N;N=G;try{return M.apply(this,arguments)}finally{N=P}}}})(Er)),Er}var um;function Mg(){return um||(um=1,Ar.exports=wg()),Ar.exports}var Cr={exports:{}},jt={};var rm;function Ug(){if(rm)return jt;rm=1;var n=Yr();function u(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)h+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var r={d:{f:d,r:function(){throw Error(u(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},f=Symbol.for("react.portal");function v(m,h,S){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:p==null?null:""+p,children:m,containerInfo:h,implementation:S}}var b=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,jt.createPortal=function(m,h){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(u(299));return v(m,h,null,S)},jt.flushSync=function(m){var h=b.T,S=r.p;try{if(b.T=null,r.p=2,m)return m()}finally{b.T=h,r.p=S,r.d.f()}},jt.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(m,h))},jt.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},jt.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var S=h.as,p=g(S,h.crossOrigin),N=typeof h.integrity=="string"?h.integrity:void 0,O=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;S==="style"?r.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:N,fetchPriority:O}):S==="script"&&r.d.X(m,{crossOrigin:p,integrity:N,fetchPriority:O,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},jt.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var S=g(h.as,h.crossOrigin);r.d.M(m,{crossOrigin:S,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(m)},jt.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var S=h.as,p=g(S,h.crossOrigin);r.d.L(m,S,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},jt.preloadModule=function(m,h){if(typeof m=="string")if(h){var S=g(h.as,h.crossOrigin);r.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:S,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(m)},jt.requestFormReset=function(m){r.d.r(m)},jt.unstable_batchedUpdates=function(m,h){return m(h)},jt.useFormState=function(m,h,S){return b.H.useFormState(m,h,S)},jt.useFormStatus=function(){return b.H.useHostTransitionStatus()},jt.version="19.2.0",jt}var om;function qg(){if(om)return Cr.exports;om=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(u){console.error(u)}}return n(),Cr.exports=Ug(),Cr.exports}var dm;function Bg(){if(dm)return bi;dm=1;var n=Mg(),u=Yr(),d=qg();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function v(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function b(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(v(e)!==e)throw Error(r(188))}function h(e){var t=e.alternate;if(!t){if(t=v(e),t===null)throw Error(r(188));return t!==e?null:e}for(var l=e,a=t;;){var s=l.return;if(s===null)break;var c=s.alternate;if(c===null){if(a=s.return,a!==null){l=a;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===l)return m(s),e;if(c===a)return m(s),t;c=c.sibling}throw Error(r(188))}if(l.return!==a.return)l=s,a=c;else{for(var o=!1,y=s.child;y;){if(y===l){o=!0,l=s,a=c;break}if(y===a){o=!0,a=s,l=c;break}y=y.sibling}if(!o){for(y=c.child;y;){if(y===l){o=!0,l=c,a=s;break}if(y===a){o=!0,a=c,l=s;break}y=y.sibling}if(!o)throw Error(r(189))}}if(l.alternate!==a)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,N=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),J=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),_e=Symbol.for("react.memo_cache_sentinel"),Qe=Symbol.iterator;function Fe(e){return e===null||typeof e!="object"?null:(e=Qe&&e[Qe]||e["@@iterator"],typeof e=="function"?e:null)}var _t=Symbol.for("react.client.reference");function pt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_t?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case D:return"Profiler";case U:return"StrictMode";case ne:return"Suspense";case ge:return"SuspenseList";case ue:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case L:return"Portal";case J:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case Z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W:return t=e.displayName||null,t!==null?t:pt(e.type)||"Memo";case Y:t=e._payload,e=e._init;try{return pt(e(t))}catch{}}return null}var st=Array.isArray,M=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},je=[],De=-1;function _(e){return{current:e}}function $(e){0>De||(e.current=je[De],je[De]=null,De--)}function K(e,t){De++,je[De]=e.current,e.current=t}var F=_(null),re=_(null),X=_(null),te=_(null);function me(e,t){switch(K(X,t),K(re,e),K(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Th(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Th(t),e=Ah(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(F),K(F,e)}function Ue(){$(F),$(re),$(X)}function ul(e){e.memoizedState!==null&&K(te,e);var t=F.current,l=Ah(t,e.type);t!==l&&(K(re,e),K(F,l))}function gl(e){re.current===e&&($(F),$(re)),te.current===e&&($(te),hi._currentValue=P)}var Ai,Ra;function ha(e){if(Ai===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Ai=t&&t[1]||"",Ra=-1<l.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Ai+e+Ra}var cc=!1;function uc(e,t){if(!e||cc)return"";cc=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(R){var z=R}Reflect.construct(e,[],H)}else{try{H.call()}catch(R){z=R}e.call(H.prototype)}}else{try{throw Error()}catch(R){z=R}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(R){if(R&&z&&typeof R.stack=="string")return[R.stack,z.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=a.DetermineComponentFrameRoot(),o=c[0],y=c[1];if(o&&y){var x=o.split(`
|
|
4
|
-
`),C=y.split(`
|
|
5
|
-
`);for(s=a=0;a<x.length&&!x[a].includes("DetermineComponentFrameRoot");)a++;for(;s<C.length&&!C[s].includes("DetermineComponentFrameRoot");)s++;if(a===x.length||s===C.length)for(a=x.length-1,s=C.length-1;1<=a&&0<=s&&x[a]!==C[s];)s--;for(;1<=a&&0<=s;a--,s--)if(x[a]!==C[s]){if(a!==1||s!==1)do if(a--,s--,0>s||x[a]!==C[s]){var q=`
|
|
6
|
-
`+x[a].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=a&&0<=s);break}}}finally{cc=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ha(l):""}function uv(e,t){switch(e.tag){case 26:case 27:case 5:return ha(e.type);case 16:return ha("Lazy");case 13:return e.child!==t&&t!==null?ha("Suspense Fallback"):ha("Suspense");case 19:return ha("SuspenseList");case 0:case 15:return uc(e.type,!1);case 11:return uc(e.type.render,!1);case 1:return uc(e.type,!0);case 31:return ha("Activity");default:return""}}function to(e){try{var t="",l=null;do t+=uv(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
|
|
7
|
-
Error generating stack: `+a.message+`
|
|
8
|
-
`+a.stack}}var rc=Object.prototype.hasOwnProperty,oc=n.unstable_scheduleCallback,dc=n.unstable_cancelCallback,rv=n.unstable_shouldYield,ov=n.unstable_requestPaint,Mt=n.unstable_now,dv=n.unstable_getCurrentPriorityLevel,lo=n.unstable_ImmediatePriority,ao=n.unstable_UserBlockingPriority,Ei=n.unstable_NormalPriority,fv=n.unstable_LowPriority,no=n.unstable_IdlePriority,hv=n.log,mv=n.unstable_setDisableYieldValue,Nn=null,Ut=null;function $l(e){if(typeof hv=="function"&&mv(e),Ut&&typeof Ut.setStrictMode=="function")try{Ut.setStrictMode(Nn,e)}catch{}}var qt=Math.clz32?Math.clz32:gv,vv=Math.log,yv=Math.LN2;function gv(e){return e>>>=0,e===0?32:31-(vv(e)/yv|0)|0}var Ci=256,Oi=262144,Di=4194304;function ma(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function zi(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,c=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var y=a&134217727;return y!==0?(a=y&~c,a!==0?s=ma(a):(o&=y,o!==0?s=ma(o):l||(l=y&~e,l!==0&&(s=ma(l))))):(y=a&~c,y!==0?s=ma(y):o!==0?s=ma(o):l||(l=a&~e,l!==0&&(s=ma(l)))),s===0?0:t!==0&&t!==s&&(t&c)===0&&(c=s&-s,l=t&-t,c>=l||c===32&&(l&4194048)!==0)?t:s}function Tn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function bv(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 io(){var e=Di;return Di<<=1,(Di&62914560)===0&&(Di=4194304),e}function fc(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function An(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pv(e,t,l,a,s,c){var o=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var y=e.entanglements,x=e.expirationTimes,C=e.hiddenUpdates;for(l=o&~l;0<l;){var q=31-qt(l),H=1<<q;y[q]=0,x[q]=-1;var z=C[q];if(z!==null)for(C[q]=null,q=0;q<z.length;q++){var R=z[q];R!==null&&(R.lane&=-536870913)}l&=~H}a!==0&&so(e,a,0),c!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=c&~(o&~t))}function so(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-qt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function co(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-qt(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function uo(e,t){var l=t&-t;return l=(l&42)!==0?1:hc(l),(l&(e.suspendedLanes|t))!==0?0:l}function hc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function mc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ro(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:Fh(e.type))}function oo(e,t){var l=G.p;try{return G.p=e,t()}finally{G.p=l}}var Hl=Math.random().toString(36).slice(2),ft="__reactFiber$"+Hl,Nt="__reactProps$"+Hl,wa="__reactContainer$"+Hl,vc="__reactEvents$"+Hl,jv="__reactListeners$"+Hl,xv="__reactHandles$"+Hl,fo="__reactResources$"+Hl,En="__reactMarker$"+Hl;function yc(e){delete e[ft],delete e[Nt],delete e[vc],delete e[jv],delete e[xv]}function Ma(e){var t=e[ft];if(t)return t;for(var l=e.parentNode;l;){if(t=l[wa]||l[ft]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=wh(e);e!==null;){if(l=e[ft])return l;e=wh(e)}return t}e=l,l=e.parentNode}return null}function Ua(e){if(e=e[ft]||e[wa]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Cn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function qa(e){var t=e[fo];return t||(t=e[fo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function rt(e){e[En]=!0}var ho=new Set,mo={};function va(e,t){Ba(e,t),Ba(e+"Capture",t)}function Ba(e,t){for(mo[e]=t,e=0;e<t.length;e++)ho.add(t[e])}var Sv=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]*$"),vo={},yo={};function kv(e){return rc.call(yo,e)?!0:rc.call(vo,e)?!1:Sv.test(e)?yo[e]=!0:(vo[e]=!0,!1)}function Ri(e,t,l){if(kv(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function wi(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function bl(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function Zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function go(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _v(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var s=a.get,c=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){l=""+o,c.call(this,o)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(o){l=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gc(e){if(!e._valueTracker){var t=go(e)?"checked":"value";e._valueTracker=_v(e,t,""+e[t])}}function bo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=go(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function Mi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Nv=/[\n"\\]/g;function Kt(e){return e.replace(Nv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function bc(e,t,l,a,s,c,o,y){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zt(t)):e.value!==""+Zt(t)&&(e.value=""+Zt(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?pc(e,o,Zt(t)):l!=null?pc(e,o,Zt(l)):a!=null&&e.removeAttribute("value"),s==null&&c!=null&&(e.defaultChecked=!!c),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+Zt(y):e.removeAttribute("name")}function po(e,t,l,a,s,c,o,y){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||l!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){gc(e);return}l=l!=null?""+Zt(l):"",t=t!=null?""+Zt(t):l,y||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=y?e.checked:!!a,e.defaultChecked=!!a,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),gc(e)}function pc(e,t,l){t==="number"&&Mi(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function $a(e,t,l,a){if(e=e.options,t){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=!0;for(l=0;l<e.length;l++)s=t.hasOwnProperty("$"+e[l].value),e[l].selected!==s&&(e[l].selected=s),s&&a&&(e[l].defaultSelected=!0)}else{for(l=""+Zt(l),t=null,s=0;s<e.length;s++){if(e[s].value===l){e[s].selected=!0,a&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function jo(e,t,l){if(t!=null&&(t=""+Zt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Zt(l):""}function xo(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(r(92));if(st(a)){if(1<a.length)throw Error(r(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=Zt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),gc(e)}function Ha(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Tv=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 So(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||Tv.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function ko(e,t,l){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var s in t)a=t[s],t.hasOwnProperty(s)&&l[s]!==a&&So(e,s,a)}else for(var c in t)t.hasOwnProperty(c)&&So(e,c,t[c])}function jc(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Av=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"]]),Ev=/^[\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 Ui(e){return Ev.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function pl(){}var xc=null;function Sc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var La=null,Ya=null;function _o(e){var t=Ua(e);if(t&&(e=t.stateNode)){var l=e[Nt]||null;e:switch(e=t.stateNode,t.type){case"input":if(bc(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Kt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var s=a[Nt]||null;if(!s)throw Error(r(90));bc(a,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&bo(a)}break e;case"textarea":jo(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&$a(e,!!l.multiple,t,!1)}}}var kc=!1;function No(e,t,l){if(kc)return e(t,l);kc=!0;try{var a=e(t);return a}finally{if(kc=!1,(La!==null||Ya!==null)&&(ks(),La&&(t=La,e=Ya,Ya=La=null,_o(t),e)))for(t=0;t<e.length;t++)_o(e[t])}}function On(e,t){var l=e.stateNode;if(l===null)return null;var a=l[Nt]||null;if(a===null)return null;l=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(r(231,t,typeof l));return l}var jl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_c=!1;if(jl)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){_c=!0}}),window.addEventListener("test",Dn,Dn),window.removeEventListener("test",Dn,Dn)}catch{_c=!1}var Ll=null,Nc=null,qi=null;function To(){if(qi)return qi;var e,t=Nc,l=t.length,a,s="value"in Ll?Ll.value:Ll.textContent,c=s.length;for(e=0;e<l&&t[e]===s[e];e++);var o=l-e;for(a=1;a<=o&&t[l-a]===s[c-a];a++);return qi=s.slice(e,1<a?1-a:void 0)}function Bi(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function $i(){return!0}function Ao(){return!1}function Tt(e){function t(l,a,s,c,o){this._reactName=l,this._targetInst=s,this.type=a,this.nativeEvent=c,this.target=o,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(l=e[y],this[y]=l?l(c):c[y]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?$i:Ao,this.isPropagationStopped=Ao,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=$i)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=$i)},persist:function(){},isPersistent:$i}),t}var ya={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hi=Tt(ya),zn=p({},ya,{view:0,detail:0}),Cv=Tt(zn),Tc,Ac,Rn,Li=p({},zn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Rn&&(Rn&&e.type==="mousemove"?(Tc=e.screenX-Rn.screenX,Ac=e.screenY-Rn.screenY):Ac=Tc=0,Rn=e),Tc)},movementY:function(e){return"movementY"in e?e.movementY:Ac}}),Eo=Tt(Li),Ov=p({},Li,{dataTransfer:0}),Dv=Tt(Ov),zv=p({},zn,{relatedTarget:0}),Ec=Tt(zv),Rv=p({},ya,{animationName:0,elapsedTime:0,pseudoElement:0}),wv=Tt(Rv),Mv=p({},ya,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Uv=Tt(Mv),qv=p({},ya,{data:0}),Co=Tt(qv),Bv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$v={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"},Hv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Lv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hv[e])?!!t[e]:!1}function Cc(){return Lv}var Yv=p({},zn,{key:function(e){if(e.key){var t=Bv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$v[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cc,charCode:function(e){return e.type==="keypress"?Bi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Gv=Tt(Yv),Vv=p({},Li,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Oo=Tt(Vv),Qv=p({},zn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cc}),Xv=Tt(Qv),Zv=p({},ya,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kv=Tt(Zv),Jv=p({},Li,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Fv=Tt(Jv),Iv=p({},ya,{newState:0,oldState:0}),Wv=Tt(Iv),Pv=[9,13,27,32],Oc=jl&&"CompositionEvent"in window,wn=null;jl&&"documentMode"in document&&(wn=document.documentMode);var ey=jl&&"TextEvent"in window&&!wn,Do=jl&&(!Oc||wn&&8<wn&&11>=wn),zo=" ",Ro=!1;function wo(e,t){switch(e){case"keyup":return Pv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ga=!1;function ty(e,t){switch(e){case"compositionend":return Mo(t);case"keypress":return t.which!==32?null:(Ro=!0,zo);case"textInput":return e=t.data,e===zo&&Ro?null:e;default:return null}}function ly(e,t){if(Ga)return e==="compositionend"||!Oc&&wo(e,t)?(e=To(),qi=Nc=Ll=null,Ga=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Do&&t.locale!=="ko"?null:t.data;default:return null}}var ay={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 Uo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ay[e.type]:t==="textarea"}function qo(e,t,l,a){La?Ya?Ya.push(a):Ya=[a]:La=a,t=Os(t,"onChange"),0<t.length&&(l=new Hi("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var Mn=null,Un=null;function ny(e){jh(e,0)}function Yi(e){var t=Cn(e);if(bo(t))return e}function Bo(e,t){if(e==="change")return t}var $o=!1;if(jl){var Dc;if(jl){var zc="oninput"in document;if(!zc){var Ho=document.createElement("div");Ho.setAttribute("oninput","return;"),zc=typeof Ho.oninput=="function"}Dc=zc}else Dc=!1;$o=Dc&&(!document.documentMode||9<document.documentMode)}function Lo(){Mn&&(Mn.detachEvent("onpropertychange",Yo),Un=Mn=null)}function Yo(e){if(e.propertyName==="value"&&Yi(Un)){var t=[];qo(t,Un,e,Sc(e)),No(ny,t)}}function iy(e,t,l){e==="focusin"?(Lo(),Mn=t,Un=l,Mn.attachEvent("onpropertychange",Yo)):e==="focusout"&&Lo()}function sy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yi(Un)}function cy(e,t){if(e==="click")return Yi(t)}function uy(e,t){if(e==="input"||e==="change")return Yi(t)}function ry(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bt=typeof Object.is=="function"?Object.is:ry;function qn(e,t){if(Bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var s=l[a];if(!rc.call(t,s)||!Bt(e[s],t[s]))return!1}return!0}function Go(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vo(e,t){var l=Go(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Go(l)}}function Qo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mi(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Mi(e.document)}return t}function Rc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var oy=jl&&"documentMode"in document&&11>=document.documentMode,Va=null,wc=null,Bn=null,Mc=!1;function Zo(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Mc||Va==null||Va!==Mi(a)||(a=Va,"selectionStart"in a&&Rc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Bn&&qn(Bn,a)||(Bn=a,a=Os(wc,"onSelect"),0<a.length&&(t=new Hi("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=Va)))}function ga(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Qa={animationend:ga("Animation","AnimationEnd"),animationiteration:ga("Animation","AnimationIteration"),animationstart:ga("Animation","AnimationStart"),transitionrun:ga("Transition","TransitionRun"),transitionstart:ga("Transition","TransitionStart"),transitioncancel:ga("Transition","TransitionCancel"),transitionend:ga("Transition","TransitionEnd")},Uc={},Ko={};jl&&(Ko=document.createElement("div").style,"AnimationEvent"in window||(delete Qa.animationend.animation,delete Qa.animationiteration.animation,delete Qa.animationstart.animation),"TransitionEvent"in window||delete Qa.transitionend.transition);function ba(e){if(Uc[e])return Uc[e];if(!Qa[e])return e;var t=Qa[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in Ko)return Uc[e]=t[l];return e}var Jo=ba("animationend"),Fo=ba("animationiteration"),Io=ba("animationstart"),dy=ba("transitionrun"),fy=ba("transitionstart"),hy=ba("transitioncancel"),Wo=ba("transitionend"),Po=new Map,qc="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(" ");qc.push("scrollEnd");function nl(e,t){Po.set(e,t),va(t,[e])}var Gi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Jt=[],Xa=0,Bc=0;function Vi(){for(var e=Xa,t=Bc=Xa=0;t<e;){var l=Jt[t];Jt[t++]=null;var a=Jt[t];Jt[t++]=null;var s=Jt[t];Jt[t++]=null;var c=Jt[t];if(Jt[t++]=null,a!==null&&s!==null){var o=a.pending;o===null?s.next=s:(s.next=o.next,o.next=s),a.pending=s}c!==0&&ed(l,s,c)}}function Qi(e,t,l,a){Jt[Xa++]=e,Jt[Xa++]=t,Jt[Xa++]=l,Jt[Xa++]=a,Bc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function $c(e,t,l,a){return Qi(e,t,l,a),Xi(e)}function pa(e,t){return Qi(e,null,null,t),Xi(e)}function ed(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var s=!1,c=e.return;c!==null;)c.childLanes|=l,a=c.alternate,a!==null&&(a.childLanes|=l),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(s=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,s&&t!==null&&(s=31-qt(l),e=c.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=l|536870912),c):null}function Xi(e){if(50<si)throw si=0,Ku=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Za={};function my(e,t,l,a){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(e,t,l,a){return new my(e,t,l,a)}function Hc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xl(e,t){var l=e.alternate;return l===null?(l=$t(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function td(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Zi(e,t,l,a,s,c){var o=0;if(a=e,typeof e=="function")Hc(e)&&(o=1);else if(typeof e=="string")o=pg(e,l,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ue:return e=$t(31,l,t,s),e.elementType=ue,e.lanes=c,e;case w:return ja(l.children,s,c,t);case U:o=8,s|=24;break;case D:return e=$t(12,l,t,s|2),e.elementType=D,e.lanes=c,e;case ne:return e=$t(13,l,t,s),e.elementType=ne,e.lanes=c,e;case ge:return e=$t(19,l,t,s),e.elementType=ge,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:o=10;break e;case Q:o=9;break e;case Z:o=11;break e;case W:o=14;break e;case Y:o=16,a=null;break e}o=29,l=Error(r(130,e===null?"null":typeof e,"")),a=null}return t=$t(o,l,t,s),t.elementType=e,t.type=a,t.lanes=c,t}function ja(e,t,l,a){return e=$t(7,e,a,t),e.lanes=l,e}function Lc(e,t,l){return e=$t(6,e,null,t),e.lanes=l,e}function ld(e){var t=$t(18,null,null,0);return t.stateNode=e,t}function Yc(e,t,l){return t=$t(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ad=new WeakMap;function Ft(e,t){if(typeof e=="object"&&e!==null){var l=ad.get(e);return l!==void 0?l:(t={value:e,source:t,stack:to(t)},ad.set(e,t),t)}return{value:e,source:t,stack:to(t)}}var Ka=[],Ja=0,Ki=null,$n=0,It=[],Wt=0,Yl=null,rl=1,ol="";function Sl(e,t){Ka[Ja++]=$n,Ka[Ja++]=Ki,Ki=e,$n=t}function nd(e,t,l){It[Wt++]=rl,It[Wt++]=ol,It[Wt++]=Yl,Yl=e;var a=rl;e=ol;var s=32-qt(a)-1;a&=~(1<<s),l+=1;var c=32-qt(t)+s;if(30<c){var o=s-s%5;c=(a&(1<<o)-1).toString(32),a>>=o,s-=o,rl=1<<32-qt(t)+s|l<<s|a,ol=c+e}else rl=1<<c|l<<s|a,ol=e}function Gc(e){e.return!==null&&(Sl(e,1),nd(e,1,0))}function Vc(e){for(;e===Ki;)Ki=Ka[--Ja],Ka[Ja]=null,$n=Ka[--Ja],Ka[Ja]=null;for(;e===Yl;)Yl=It[--Wt],It[Wt]=null,ol=It[--Wt],It[Wt]=null,rl=It[--Wt],It[Wt]=null}function id(e,t){It[Wt++]=rl,It[Wt++]=ol,It[Wt++]=Yl,rl=t.id,ol=t.overflow,Yl=e}var ht=null,Xe=null,ke=!1,Gl=null,Pt=!1,Qc=Error(r(519));function Vl(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hn(Ft(t,e)),Qc}function sd(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[ft]=e,t[Nt]=a,l){case"dialog":pe("cancel",t),pe("close",t);break;case"iframe":case"object":case"embed":pe("load",t);break;case"video":case"audio":for(l=0;l<ui.length;l++)pe(ui[l],t);break;case"source":pe("error",t);break;case"img":case"image":case"link":pe("error",t),pe("load",t);break;case"details":pe("toggle",t);break;case"input":pe("invalid",t),po(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":pe("invalid",t);break;case"textarea":pe("invalid",t),xo(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||_h(t.textContent,l)?(a.popover!=null&&(pe("beforetoggle",t),pe("toggle",t)),a.onScroll!=null&&pe("scroll",t),a.onScrollEnd!=null&&pe("scrollend",t),a.onClick!=null&&(t.onclick=pl),t=!0):t=!1,t||Vl(e,!0)}function cd(e){for(ht=e.return;ht;)switch(ht.tag){case 5:case 31:case 13:Pt=!1;return;case 27:case 3:Pt=!0;return;default:ht=ht.return}}function Fa(e){if(e!==ht)return!1;if(!ke)return cd(e),ke=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||rr(e.type,e.memoizedProps)),l=!l),l&&Xe&&Vl(e),cd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Xe=Rh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Xe=Rh(e)}else t===27?(t=Xe,na(e.type)?(e=mr,mr=null,Xe=e):Xe=t):Xe=ht?tl(e.stateNode.nextSibling):null;return!0}function xa(){Xe=ht=null,ke=!1}function Xc(){var e=Gl;return e!==null&&(Ot===null?Ot=e:Ot.push.apply(Ot,e),Gl=null),e}function Hn(e){Gl===null?Gl=[e]:Gl.push(e)}var Zc=_(null),Sa=null,kl=null;function Ql(e,t,l){K(Zc,t._currentValue),t._currentValue=l}function _l(e){e._currentValue=Zc.current,$(Zc)}function Kc(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function Jc(e,t,l,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var c=s.dependencies;if(c!==null){var o=s.child;c=c.firstContext;e:for(;c!==null;){var y=c;c=s;for(var x=0;x<t.length;x++)if(y.context===t[x]){c.lanes|=l,y=c.alternate,y!==null&&(y.lanes|=l),Kc(c.return,l,e),a||(o=null);break e}c=y.next}}else if(s.tag===18){if(o=s.return,o===null)throw Error(r(341));o.lanes|=l,c=o.alternate,c!==null&&(c.lanes|=l),Kc(o,l,e),o=null}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}}function Ia(e,t,l,a){e=null;for(var s=t,c=!1;s!==null;){if(!c){if((s.flags&524288)!==0)c=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var o=s.alternate;if(o===null)throw Error(r(387));if(o=o.memoizedProps,o!==null){var y=s.type;Bt(s.pendingProps.value,o.value)||(e!==null?e.push(y):e=[y])}}else if(s===te.current){if(o=s.alternate,o===null)throw Error(r(387));o.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(hi):e=[hi])}s=s.return}e!==null&&Jc(t,e,l,a),t.flags|=262144}function Ji(e){for(e=e.firstContext;e!==null;){if(!Bt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ka(e){Sa=e,kl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mt(e){return ud(Sa,e)}function Fi(e,t){return Sa===null&&ka(e),ud(e,t)}function ud(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},kl===null){if(e===null)throw Error(r(308));kl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else kl=kl.next=t;return l}var vy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},yy=n.unstable_scheduleCallback,gy=n.unstable_NormalPriority,lt={$$typeof:J,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fc(){return{controller:new vy,data:new Map,refCount:0}}function Ln(e){e.refCount--,e.refCount===0&&yy(gy,function(){e.controller.abort()})}var Yn=null,Ic=0,Wa=0,Pa=null;function by(e,t){if(Yn===null){var l=Yn=[];Ic=0,Wa=er(),Pa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return Ic++,t.then(rd,rd),t}function rd(){if(--Ic===0&&Yn!==null){Pa!==null&&(Pa.status="fulfilled");var e=Yn;Yn=null,Wa=0,Pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function py(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(s){l.push(s)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var s=0;s<l.length;s++)(0,l[s])(t)},function(s){for(a.status="rejected",a.reason=s,s=0;s<l.length;s++)(0,l[s])(void 0)}),a}var od=M.S;M.S=function(e,t){Kf=Mt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&by(e,t),od!==null&&od(e,t)};var _a=_(null);function Wc(){var e=_a.current;return e!==null?e:Ye.pooledCache}function Ii(e,t){t===null?K(_a,_a.current):K(_a,t.pool)}function dd(){var e=Wc();return e===null?null:{parent:lt._currentValue,pool:e}}var en=Error(r(460)),Pc=Error(r(474)),Wi=Error(r(542)),Pi={then:function(){}};function fd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function hd(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(pl,pl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vd(e),e;default:if(typeof t.status=="string")t.then(pl,pl);else{if(e=Ye,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=a}},function(a){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vd(e),e}throw Ta=t,en}}function Na(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ta=l,en):l}}var Ta=null;function md(){if(Ta===null)throw Error(r(459));var e=Ta;return Ta=null,e}function vd(e){if(e===en||e===Wi)throw Error(r(483))}var tn=null,Gn=0;function es(e){var t=Gn;return Gn+=1,tn===null&&(tn=[]),hd(tn,e,t)}function Vn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ts(e,t){throw t.$$typeof===N?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function yd(e){function t(T,k){if(e){var E=T.deletions;E===null?(T.deletions=[k],T.flags|=16):E.push(k)}}function l(T,k){if(!e)return null;for(;k!==null;)t(T,k),k=k.sibling;return null}function a(T){for(var k=new Map;T!==null;)T.key!==null?k.set(T.key,T):k.set(T.index,T),T=T.sibling;return k}function s(T,k){return T=xl(T,k),T.index=0,T.sibling=null,T}function c(T,k,E){return T.index=E,e?(E=T.alternate,E!==null?(E=E.index,E<k?(T.flags|=67108866,k):E):(T.flags|=67108866,k)):(T.flags|=1048576,k)}function o(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function y(T,k,E,B){return k===null||k.tag!==6?(k=Lc(E,T.mode,B),k.return=T,k):(k=s(k,E),k.return=T,k)}function x(T,k,E,B){var le=E.type;return le===w?q(T,k,E.props.children,B,E.key):k!==null&&(k.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Y&&Na(le)===k.type)?(k=s(k,E.props),Vn(k,E),k.return=T,k):(k=Zi(E.type,E.key,E.props,null,T.mode,B),Vn(k,E),k.return=T,k)}function C(T,k,E,B){return k===null||k.tag!==4||k.stateNode.containerInfo!==E.containerInfo||k.stateNode.implementation!==E.implementation?(k=Yc(E,T.mode,B),k.return=T,k):(k=s(k,E.children||[]),k.return=T,k)}function q(T,k,E,B,le){return k===null||k.tag!==7?(k=ja(E,T.mode,B,le),k.return=T,k):(k=s(k,E),k.return=T,k)}function H(T,k,E){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=Lc(""+k,T.mode,E),k.return=T,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case O:return E=Zi(k.type,k.key,k.props,null,T.mode,E),Vn(E,k),E.return=T,E;case L:return k=Yc(k,T.mode,E),k.return=T,k;case Y:return k=Na(k),H(T,k,E)}if(st(k)||Fe(k))return k=ja(k,T.mode,E,null),k.return=T,k;if(typeof k.then=="function")return H(T,es(k),E);if(k.$$typeof===J)return H(T,Fi(T,k),E);ts(T,k)}return null}function z(T,k,E,B){var le=k!==null?k.key:null;if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return le!==null?null:y(T,k,""+E,B);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case O:return E.key===le?x(T,k,E,B):null;case L:return E.key===le?C(T,k,E,B):null;case Y:return E=Na(E),z(T,k,E,B)}if(st(E)||Fe(E))return le!==null?null:q(T,k,E,B,null);if(typeof E.then=="function")return z(T,k,es(E),B);if(E.$$typeof===J)return z(T,k,Fi(T,E),B);ts(T,E)}return null}function R(T,k,E,B,le){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return T=T.get(E)||null,y(k,T,""+B,le);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case O:return T=T.get(B.key===null?E:B.key)||null,x(k,T,B,le);case L:return T=T.get(B.key===null?E:B.key)||null,C(k,T,B,le);case Y:return B=Na(B),R(T,k,E,B,le)}if(st(B)||Fe(B))return T=T.get(E)||null,q(k,T,B,le,null);if(typeof B.then=="function")return R(T,k,E,es(B),le);if(B.$$typeof===J)return R(T,k,E,Fi(k,B),le);ts(k,B)}return null}function I(T,k,E,B){for(var le=null,Te=null,ee=k,fe=k=0,Se=null;ee!==null&&fe<E.length;fe++){ee.index>fe?(Se=ee,ee=null):Se=ee.sibling;var Ae=z(T,ee,E[fe],B);if(Ae===null){ee===null&&(ee=Se);break}e&&ee&&Ae.alternate===null&&t(T,ee),k=c(Ae,k,fe),Te===null?le=Ae:Te.sibling=Ae,Te=Ae,ee=Se}if(fe===E.length)return l(T,ee),ke&&Sl(T,fe),le;if(ee===null){for(;fe<E.length;fe++)ee=H(T,E[fe],B),ee!==null&&(k=c(ee,k,fe),Te===null?le=ee:Te.sibling=ee,Te=ee);return ke&&Sl(T,fe),le}for(ee=a(ee);fe<E.length;fe++)Se=R(ee,T,fe,E[fe],B),Se!==null&&(e&&Se.alternate!==null&&ee.delete(Se.key===null?fe:Se.key),k=c(Se,k,fe),Te===null?le=Se:Te.sibling=Se,Te=Se);return e&&ee.forEach(function(ra){return t(T,ra)}),ke&&Sl(T,fe),le}function ie(T,k,E,B){if(E==null)throw Error(r(151));for(var le=null,Te=null,ee=k,fe=k=0,Se=null,Ae=E.next();ee!==null&&!Ae.done;fe++,Ae=E.next()){ee.index>fe?(Se=ee,ee=null):Se=ee.sibling;var ra=z(T,ee,Ae.value,B);if(ra===null){ee===null&&(ee=Se);break}e&&ee&&ra.alternate===null&&t(T,ee),k=c(ra,k,fe),Te===null?le=ra:Te.sibling=ra,Te=ra,ee=Se}if(Ae.done)return l(T,ee),ke&&Sl(T,fe),le;if(ee===null){for(;!Ae.done;fe++,Ae=E.next())Ae=H(T,Ae.value,B),Ae!==null&&(k=c(Ae,k,fe),Te===null?le=Ae:Te.sibling=Ae,Te=Ae);return ke&&Sl(T,fe),le}for(ee=a(ee);!Ae.done;fe++,Ae=E.next())Ae=R(ee,T,fe,Ae.value,B),Ae!==null&&(e&&Ae.alternate!==null&&ee.delete(Ae.key===null?fe:Ae.key),k=c(Ae,k,fe),Te===null?le=Ae:Te.sibling=Ae,Te=Ae);return e&&ee.forEach(function(Og){return t(T,Og)}),ke&&Sl(T,fe),le}function Le(T,k,E,B){if(typeof E=="object"&&E!==null&&E.type===w&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case O:e:{for(var le=E.key;k!==null;){if(k.key===le){if(le=E.type,le===w){if(k.tag===7){l(T,k.sibling),B=s(k,E.props.children),B.return=T,T=B;break e}}else if(k.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Y&&Na(le)===k.type){l(T,k.sibling),B=s(k,E.props),Vn(B,E),B.return=T,T=B;break e}l(T,k);break}else t(T,k);k=k.sibling}E.type===w?(B=ja(E.props.children,T.mode,B,E.key),B.return=T,T=B):(B=Zi(E.type,E.key,E.props,null,T.mode,B),Vn(B,E),B.return=T,T=B)}return o(T);case L:e:{for(le=E.key;k!==null;){if(k.key===le)if(k.tag===4&&k.stateNode.containerInfo===E.containerInfo&&k.stateNode.implementation===E.implementation){l(T,k.sibling),B=s(k,E.children||[]),B.return=T,T=B;break e}else{l(T,k);break}else t(T,k);k=k.sibling}B=Yc(E,T.mode,B),B.return=T,T=B}return o(T);case Y:return E=Na(E),Le(T,k,E,B)}if(st(E))return I(T,k,E,B);if(Fe(E)){if(le=Fe(E),typeof le!="function")throw Error(r(150));return E=le.call(E),ie(T,k,E,B)}if(typeof E.then=="function")return Le(T,k,es(E),B);if(E.$$typeof===J)return Le(T,k,Fi(T,E),B);ts(T,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,k!==null&&k.tag===6?(l(T,k.sibling),B=s(k,E),B.return=T,T=B):(l(T,k),B=Lc(E,T.mode,B),B.return=T,T=B),o(T)):l(T,k)}return function(T,k,E,B){try{Gn=0;var le=Le(T,k,E,B);return tn=null,le}catch(ee){if(ee===en||ee===Wi)throw ee;var Te=$t(29,ee,null,T.mode);return Te.lanes=B,Te.return=T,Te}}}var Aa=yd(!0),gd=yd(!1),Xl=!1;function eu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Zl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Kl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ze&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=Xi(e),ed(e,null,l),t}return Qi(e,a,t,l),Xi(e)}function Qn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,co(e,l)}}function lu(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var s=null,c=null;if(l=l.firstBaseUpdate,l!==null){do{var o={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};c===null?s=c=o:c=c.next=o,l=l.next}while(l!==null);c===null?s=c=t:c=c.next=t}else s=c=t;l={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var au=!1;function Xn(){if(au){var e=Pa;if(e!==null)throw e}}function Zn(e,t,l,a){au=!1;var s=e.updateQueue;Xl=!1;var c=s.firstBaseUpdate,o=s.lastBaseUpdate,y=s.shared.pending;if(y!==null){s.shared.pending=null;var x=y,C=x.next;x.next=null,o===null?c=C:o.next=C,o=x;var q=e.alternate;q!==null&&(q=q.updateQueue,y=q.lastBaseUpdate,y!==o&&(y===null?q.firstBaseUpdate=C:y.next=C,q.lastBaseUpdate=x))}if(c!==null){var H=s.baseState;o=0,q=C=x=null,y=c;do{var z=y.lane&-536870913,R=z!==y.lane;if(R?(xe&z)===z:(a&z)===z){z!==0&&z===Wa&&(au=!0),q!==null&&(q=q.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var I=e,ie=y;z=t;var Le=l;switch(ie.tag){case 1:if(I=ie.payload,typeof I=="function"){H=I.call(Le,H,z);break e}H=I;break e;case 3:I.flags=I.flags&-65537|128;case 0:if(I=ie.payload,z=typeof I=="function"?I.call(Le,H,z):I,z==null)break e;H=p({},H,z);break e;case 2:Xl=!0}}z=y.callback,z!==null&&(e.flags|=64,R&&(e.flags|=8192),R=s.callbacks,R===null?s.callbacks=[z]:R.push(z))}else R={lane:z,tag:y.tag,payload:y.payload,callback:y.callback,next:null},q===null?(C=q=R,x=H):q=q.next=R,o|=z;if(y=y.next,y===null){if(y=s.shared.pending,y===null)break;R=y,y=R.next,R.next=null,s.lastBaseUpdate=R,s.shared.pending=null}}while(!0);q===null&&(x=H),s.baseState=x,s.firstBaseUpdate=C,s.lastBaseUpdate=q,c===null&&(s.shared.lanes=0),Pl|=o,e.lanes=o,e.memoizedState=H}}function bd(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function pd(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)bd(l[e],t)}var ln=_(null),ls=_(0);function jd(e,t){e=Rl,K(ls,e),K(ln,t),Rl=e|t.baseLanes}function nu(){K(ls,Rl),K(ln,ln.current)}function iu(){Rl=ls.current,$(ln),$(ls)}var Ht=_(null),el=null;function Jl(e){var t=e.alternate;K(et,et.current&1),K(Ht,e),el===null&&(t===null||ln.current!==null||t.memoizedState!==null)&&(el=e)}function su(e){K(et,et.current),K(Ht,e),el===null&&(el=e)}function xd(e){e.tag===22?(K(et,et.current),K(Ht,e),el===null&&(el=e)):Fl()}function Fl(){K(et,et.current),K(Ht,Ht.current)}function Lt(e){$(Ht),el===e&&(el=null),$(et)}var et=_(0);function as(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||fr(l)||hr(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Nl=0,de=null,$e=null,at=null,ns=!1,an=!1,Ea=!1,is=0,Kn=0,nn=null,jy=0;function Ie(){throw Error(r(321))}function cu(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Bt(e[l],t[l]))return!1;return!0}function uu(e,t,l,a,s,c){return Nl=c,de=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?nf:ku,Ea=!1,c=l(a,s),Ea=!1,an&&(c=kd(t,l,a,s)),Sd(e),c}function Sd(e){M.H=In;var t=$e!==null&&$e.next!==null;if(Nl=0,at=$e=de=null,ns=!1,Kn=0,nn=null,t)throw Error(r(300));e===null||nt||(e=e.dependencies,e!==null&&Ji(e)&&(nt=!0))}function kd(e,t,l,a){de=e;var s=0;do{if(an&&(nn=null),Kn=0,an=!1,25<=s)throw Error(r(301));if(s+=1,at=$e=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}M.H=sf,c=t(l,a)}while(an);return c}function xy(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Jn(t):t,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(de.flags|=1024),t}function ru(){var e=is!==0;return is=0,e}function ou(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function du(e){if(ns){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ns=!1}Nl=0,at=$e=de=null,an=!1,Kn=is=0,nn=null}function St(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?de.memoizedState=at=e:at=at.next=e,at}function tt(){if($e===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=at===null?de.memoizedState:at.next;if(t!==null)at=t,$e=e;else{if(e===null)throw de.alternate===null?Error(r(467)):Error(r(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},at===null?de.memoizedState=at=e:at=at.next=e}return at}function ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jn(e){var t=Kn;return Kn+=1,nn===null&&(nn=[]),e=hd(nn,e,t),t=de,(at===null?t.memoizedState:at.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?nf:ku),e}function cs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Jn(e);if(e.$$typeof===J)return mt(e)}throw Error(r(438,String(e)))}function fu(e){var t=null,l=de.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=de.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=ss(),de.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=_e;return t.index++,l}function Tl(e,t){return typeof t=="function"?t(e):t}function us(e){var t=tt();return hu(t,$e,e)}function hu(e,t,l){var a=e.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=l;var s=e.baseQueue,c=a.pending;if(c!==null){if(s!==null){var o=s.next;s.next=c.next,c.next=o}t.baseQueue=s=c,a.pending=null}if(c=e.baseState,s===null)e.memoizedState=c;else{t=s.next;var y=o=null,x=null,C=t,q=!1;do{var H=C.lane&-536870913;if(H!==C.lane?(xe&H)===H:(Nl&H)===H){var z=C.revertLane;if(z===0)x!==null&&(x=x.next={lane:0,revertLane:0,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null}),H===Wa&&(q=!0);else if((Nl&z)===z){C=C.next,z===Wa&&(q=!0);continue}else H={lane:0,revertLane:C.revertLane,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},x===null?(y=x=H,o=c):x=x.next=H,de.lanes|=z,Pl|=z;H=C.action,Ea&&l(c,H),c=C.hasEagerState?C.eagerState:l(c,H)}else z={lane:H,revertLane:C.revertLane,gesture:C.gesture,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},x===null?(y=x=z,o=c):x=x.next=z,de.lanes|=H,Pl|=H;C=C.next}while(C!==null&&C!==t);if(x===null?o=c:x.next=y,!Bt(c,e.memoizedState)&&(nt=!0,q&&(l=Pa,l!==null)))throw l;e.memoizedState=c,e.baseState=o,e.baseQueue=x,a.lastRenderedState=c}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function mu(e){var t=tt(),l=t.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=e;var a=l.dispatch,s=l.pending,c=t.memoizedState;if(s!==null){l.pending=null;var o=s=s.next;do c=e(c,o.action),o=o.next;while(o!==s);Bt(c,t.memoizedState)||(nt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),l.lastRenderedState=c}return[c,a]}function _d(e,t,l){var a=de,s=tt(),c=ke;if(c){if(l===void 0)throw Error(r(407));l=l()}else l=t();var o=!Bt(($e||s).memoizedState,l);if(o&&(s.memoizedState=l,nt=!0),s=s.queue,gu(Ad.bind(null,a,s,e),[e]),s.getSnapshot!==t||o||at!==null&&at.memoizedState.tag&1){if(a.flags|=2048,sn(9,{destroy:void 0},Td.bind(null,a,s,l,t),null),Ye===null)throw Error(r(349));c||(Nl&127)!==0||Nd(a,t,l)}return l}function Nd(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=de.updateQueue,t===null?(t=ss(),de.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Td(e,t,l,a){t.value=l,t.getSnapshot=a,Ed(t)&&Cd(e)}function Ad(e,t,l){return l(function(){Ed(t)&&Cd(e)})}function Ed(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Bt(e,l)}catch{return!0}}function Cd(e){var t=pa(e,2);t!==null&&Dt(t,e,2)}function vu(e){var t=St();if(typeof e=="function"){var l=e;if(e=l(),Ea){$l(!0);try{l()}finally{$l(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tl,lastRenderedState:e},t}function Od(e,t,l,a){return e.baseState=l,hu(e,$e,typeof a=="function"?a:Tl)}function Sy(e,t,l,a,s){if(ds(e))throw Error(r(485));if(e=t.action,e!==null){var c={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){c.listeners.push(o)}};M.T!==null?l(!0):c.isTransition=!1,a(c),l=t.pending,l===null?(c.next=t.pending=c,Dd(t,c)):(c.next=l.next,t.pending=l.next=c)}}function Dd(e,t){var l=t.action,a=t.payload,s=e.state;if(t.isTransition){var c=M.T,o={};M.T=o;try{var y=l(s,a),x=M.S;x!==null&&x(o,y),zd(e,t,y)}catch(C){yu(e,t,C)}finally{c!==null&&o.types!==null&&(c.types=o.types),M.T=c}}else try{c=l(s,a),zd(e,t,c)}catch(C){yu(e,t,C)}}function zd(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Rd(e,t,a)},function(a){return yu(e,t,a)}):Rd(e,t,l)}function Rd(e,t,l){t.status="fulfilled",t.value=l,wd(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Dd(e,l)))}function yu(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,wd(t),t=t.next;while(t!==a)}e.action=null}function wd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Md(e,t){return t}function Ud(e,t){if(ke){var l=Ye.formState;if(l!==null){e:{var a=de;if(ke){if(Xe){t:{for(var s=Xe,c=Pt;s.nodeType!==8;){if(!c){s=null;break t}if(s=tl(s.nextSibling),s===null){s=null;break t}}c=s.data,s=c==="F!"||c==="F"?s:null}if(s){Xe=tl(s.nextSibling),a=s.data==="F!";break e}}Vl(a)}a=!1}a&&(t=l[0])}}return l=St(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Md,lastRenderedState:t},l.queue=a,l=tf.bind(null,de,a),a.dispatch=l,a=vu(!1),c=Su.bind(null,de,!1,a.queue),a=St(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,l=Sy.bind(null,de,s,c,l),s.dispatch=l,a.memoizedState=e,[t,l,!1]}function qd(e){var t=tt();return Bd(t,$e,e)}function Bd(e,t,l){if(t=hu(e,t,Md)[0],e=us(Tl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Jn(t)}catch(o){throw o===en?Wi:o}else a=t;t=tt();var s=t.queue,c=s.dispatch;return l!==t.memoizedState&&(de.flags|=2048,sn(9,{destroy:void 0},ky.bind(null,s,l),null)),[a,c,e]}function ky(e,t){e.action=t}function $d(e){var t=tt(),l=$e;if(l!==null)return Bd(t,l,e);tt(),t=t.memoizedState,l=tt();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function sn(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=de.updateQueue,t===null&&(t=ss(),de.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function Hd(){return tt().memoizedState}function rs(e,t,l,a){var s=St();de.flags|=e,s.memoizedState=sn(1|t,{destroy:void 0},l,a===void 0?null:a)}function os(e,t,l,a){var s=tt();a=a===void 0?null:a;var c=s.memoizedState.inst;$e!==null&&a!==null&&cu(a,$e.memoizedState.deps)?s.memoizedState=sn(t,c,l,a):(de.flags|=e,s.memoizedState=sn(1|t,c,l,a))}function Ld(e,t){rs(8390656,8,e,t)}function gu(e,t){os(2048,8,e,t)}function _y(e){de.flags|=4;var t=de.updateQueue;if(t===null)t=ss(),de.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Yd(e){var t=tt().memoizedState;return _y({ref:t,nextImpl:e}),function(){if((ze&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Gd(e,t){return os(4,2,e,t)}function Vd(e,t){return os(4,4,e,t)}function Qd(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Xd(e,t,l){l=l!=null?l.concat([e]):null,os(4,4,Qd.bind(null,t,e),l)}function bu(){}function Zd(e,t){var l=tt();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&cu(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function Kd(e,t){var l=tt();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&cu(t,a[1]))return a[0];if(a=e(),Ea){$l(!0);try{e()}finally{$l(!1)}}return l.memoizedState=[a,t],a}function pu(e,t,l){return l===void 0||(Nl&1073741824)!==0&&(xe&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Ff(),de.lanes|=e,Pl|=e,l)}function Jd(e,t,l,a){return Bt(l,t)?l:ln.current!==null?(e=pu(e,l,a),Bt(e,t)||(nt=!0),e):(Nl&42)===0||(Nl&1073741824)!==0&&(xe&261930)===0?(nt=!0,e.memoizedState=l):(e=Ff(),de.lanes|=e,Pl|=e,t)}function Fd(e,t,l,a,s){var c=G.p;G.p=c!==0&&8>c?c:8;var o=M.T,y={};M.T=y,Su(e,!1,t,l);try{var x=s(),C=M.S;if(C!==null&&C(y,x),x!==null&&typeof x=="object"&&typeof x.then=="function"){var q=py(x,a);Fn(e,t,q,Vt(e))}else Fn(e,t,a,Vt(e))}catch(H){Fn(e,t,{then:function(){},status:"rejected",reason:H},Vt())}finally{G.p=c,o!==null&&y.types!==null&&(o.types=y.types),M.T=o}}function Ny(){}function ju(e,t,l,a){if(e.tag!==5)throw Error(r(476));var s=Id(e).queue;Fd(e,s,t,P,l===null?Ny:function(){return Wd(e),l(a)})}function Id(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tl,lastRenderedState:P},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Wd(e){var t=Id(e);t.next===null&&(t=e.alternate.memoizedState),Fn(e,t.next.queue,{},Vt())}function xu(){return mt(hi)}function Pd(){return tt().memoizedState}function ef(){return tt().memoizedState}function Ty(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Vt();e=Zl(l);var a=Kl(t,e,l);a!==null&&(Dt(a,t,l),Qn(a,t,l)),t={cache:Fc()},e.payload=t;return}t=t.return}}function Ay(e,t,l){var a=Vt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ds(e)?lf(t,l):(l=$c(e,t,l,a),l!==null&&(Dt(l,e,a),af(l,t,a)))}function tf(e,t,l){var a=Vt();Fn(e,t,l,a)}function Fn(e,t,l,a){var s={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ds(e))lf(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var o=t.lastRenderedState,y=c(o,l);if(s.hasEagerState=!0,s.eagerState=y,Bt(y,o))return Qi(e,t,s,0),Ye===null&&Vi(),!1}catch{}if(l=$c(e,t,s,a),l!==null)return Dt(l,e,a),af(l,t,a),!0}return!1}function Su(e,t,l,a){if(a={lane:2,revertLane:er(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ds(e)){if(t)throw Error(r(479))}else t=$c(e,l,a,2),t!==null&&Dt(t,e,2)}function ds(e){var t=e.alternate;return e===de||t!==null&&t===de}function lf(e,t){an=ns=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function af(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,co(e,l)}}var In={readContext:mt,use:cs,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useLayoutEffect:Ie,useInsertionEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useSyncExternalStore:Ie,useId:Ie,useHostTransitionStatus:Ie,useFormState:Ie,useActionState:Ie,useOptimistic:Ie,useMemoCache:Ie,useCacheRefresh:Ie};In.useEffectEvent=Ie;var nf={readContext:mt,use:cs,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:Ld,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,rs(4194308,4,Qd.bind(null,t,e),l)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var l=St();t=t===void 0?null:t;var a=e();if(Ea){$l(!0);try{e()}finally{$l(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=St();if(l!==void 0){var s=l(t);if(Ea){$l(!0);try{l(t)}finally{$l(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=Ay.bind(null,de,e),[a.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:function(e){e=vu(e);var t=e.queue,l=tf.bind(null,de,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:bu,useDeferredValue:function(e,t){var l=St();return pu(l,e,t)},useTransition:function(){var e=vu(!1);return e=Fd.bind(null,de,e.queue,!0,!1),St().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=de,s=St();if(ke){if(l===void 0)throw Error(r(407));l=l()}else{if(l=t(),Ye===null)throw Error(r(349));(xe&127)!==0||Nd(a,t,l)}s.memoizedState=l;var c={value:l,getSnapshot:t};return s.queue=c,Ld(Ad.bind(null,a,c,e),[e]),a.flags|=2048,sn(9,{destroy:void 0},Td.bind(null,a,c,l,t),null),l},useId:function(){var e=St(),t=Ye.identifierPrefix;if(ke){var l=ol,a=rl;l=(a&~(1<<32-qt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=is++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=jy++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:xu,useFormState:Ud,useActionState:Ud,useOptimistic:function(e){var t=St();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Su.bind(null,de,!0,l),l.dispatch=t,[e,t]},useMemoCache:fu,useCacheRefresh:function(){return St().memoizedState=Ty.bind(null,de)},useEffectEvent:function(e){var t=St(),l={impl:e};return t.memoizedState=l,function(){if((ze&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},ku={readContext:mt,use:cs,useCallback:Zd,useContext:mt,useEffect:gu,useImperativeHandle:Xd,useInsertionEffect:Gd,useLayoutEffect:Vd,useMemo:Kd,useReducer:us,useRef:Hd,useState:function(){return us(Tl)},useDebugValue:bu,useDeferredValue:function(e,t){var l=tt();return Jd(l,$e.memoizedState,e,t)},useTransition:function(){var e=us(Tl)[0],t=tt().memoizedState;return[typeof e=="boolean"?e:Jn(e),t]},useSyncExternalStore:_d,useId:Pd,useHostTransitionStatus:xu,useFormState:qd,useActionState:qd,useOptimistic:function(e,t){var l=tt();return Od(l,$e,e,t)},useMemoCache:fu,useCacheRefresh:ef};ku.useEffectEvent=Yd;var sf={readContext:mt,use:cs,useCallback:Zd,useContext:mt,useEffect:gu,useImperativeHandle:Xd,useInsertionEffect:Gd,useLayoutEffect:Vd,useMemo:Kd,useReducer:mu,useRef:Hd,useState:function(){return mu(Tl)},useDebugValue:bu,useDeferredValue:function(e,t){var l=tt();return $e===null?pu(l,e,t):Jd(l,$e.memoizedState,e,t)},useTransition:function(){var e=mu(Tl)[0],t=tt().memoizedState;return[typeof e=="boolean"?e:Jn(e),t]},useSyncExternalStore:_d,useId:Pd,useHostTransitionStatus:xu,useFormState:$d,useActionState:$d,useOptimistic:function(e,t){var l=tt();return $e!==null?Od(l,$e,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:fu,useCacheRefresh:ef};sf.useEffectEvent=Yd;function _u(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:p({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Nu={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=Vt(),s=Zl(a);s.payload=t,l!=null&&(s.callback=l),t=Kl(e,s,a),t!==null&&(Dt(t,e,a),Qn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=Vt(),s=Zl(a);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Kl(e,s,a),t!==null&&(Dt(t,e,a),Qn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Vt(),a=Zl(l);a.tag=2,t!=null&&(a.callback=t),t=Kl(e,a,l),t!==null&&(Dt(t,e,l),Qn(t,e,l))}};function cf(e,t,l,a,s,c,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,c,o):t.prototype&&t.prototype.isPureReactComponent?!qn(l,a)||!qn(s,c):!0}function uf(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&Nu.enqueueReplaceState(t,t.state,null)}function Ca(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=p({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function rf(e){Gi(e)}function of(e){console.error(e)}function df(e){Gi(e)}function fs(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function ff(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Tu(e,t,l){return l=Zl(l),l.tag=3,l.payload={element:null},l.callback=function(){fs(e,t)},l}function hf(e){return e=Zl(e),e.tag=3,e}function mf(e,t,l,a){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var c=a.value;e.payload=function(){return s(c)},e.callback=function(){ff(t,l,a)}}var o=l.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){ff(t,l,a),typeof s!="function"&&(ea===null?ea=new Set([this]):ea.add(this));var y=a.stack;this.componentDidCatch(a.value,{componentStack:y!==null?y:""})})}function Ey(e,t,l,a,s){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&Ia(t,l,s,!0),l=Ht.current,l!==null){switch(l.tag){case 31:case 13:return el===null?_s():l.alternate===null&&We===0&&(We=3),l.flags&=-257,l.flags|=65536,l.lanes=s,a===Pi?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),Iu(e,a,s)),!1;case 22:return l.flags|=65536,a===Pi?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),Iu(e,a,s)),!1}throw Error(r(435,l.tag))}return Iu(e,a,s),_s(),!1}if(ke)return t=Ht.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==Qc&&(e=Error(r(422),{cause:a}),Hn(Ft(e,l)))):(a!==Qc&&(t=Error(r(423),{cause:a}),Hn(Ft(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Ft(a,l),s=Tu(e.stateNode,a,s),lu(e,s),We!==4&&(We=2)),!1;var c=Error(r(520),{cause:a});if(c=Ft(c,l),ii===null?ii=[c]:ii.push(c),We!==4&&(We=2),t===null)return!0;a=Ft(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=Tu(l.stateNode,a,e),lu(l,e),!1;case 1:if(t=l.type,c=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(ea===null||!ea.has(c))))return l.flags|=65536,s&=-s,l.lanes|=s,s=hf(s),mf(s,e,l,a),lu(l,s),!1}l=l.return}while(l!==null);return!1}var Au=Error(r(461)),nt=!1;function vt(e,t,l,a){t.child=e===null?gd(t,null,l,a):Aa(t,e.child,l,a)}function vf(e,t,l,a,s){l=l.render;var c=t.ref;if("ref"in a){var o={};for(var y in a)y!=="ref"&&(o[y]=a[y])}else o=a;return ka(t),a=uu(e,t,l,o,c,s),y=ru(),e!==null&&!nt?(ou(e,t,s),Al(e,t,s)):(ke&&y&&Gc(t),t.flags|=1,vt(e,t,a,s),t.child)}function yf(e,t,l,a,s){if(e===null){var c=l.type;return typeof c=="function"&&!Hc(c)&&c.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=c,gf(e,t,c,a,s)):(e=Zi(l.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Mu(e,s)){var o=c.memoizedProps;if(l=l.compare,l=l!==null?l:qn,l(o,a)&&e.ref===t.ref)return Al(e,t,s)}return t.flags|=1,e=xl(c,a),e.ref=t.ref,e.return=t,t.child=e}function gf(e,t,l,a,s){if(e!==null){var c=e.memoizedProps;if(qn(c,a)&&e.ref===t.ref)if(nt=!1,t.pendingProps=a=c,Mu(e,s))(e.flags&131072)!==0&&(nt=!0);else return t.lanes=e.lanes,Al(e,t,s)}return Eu(e,t,l,a,s)}function bf(e,t,l,a){var s=a.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|l:l,e!==null){for(a=t.child=e.child,s=0;a!==null;)s=s|a.lanes|a.childLanes,a=a.sibling;a=s&~c}else a=0,t.child=null;return pf(e,t,c,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ii(t,c!==null?c.cachePool:null),c!==null?jd(t,c):nu(),xd(t);else return a=t.lanes=536870912,pf(e,t,c!==null?c.baseLanes|l:l,l,a)}else c!==null?(Ii(t,c.cachePool),jd(t,c),Fl(),t.memoizedState=null):(e!==null&&Ii(t,null),nu(),Fl());return vt(e,t,s,l),t.child}function Wn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function pf(e,t,l,a,s){var c=Wc();return c=c===null?null:{parent:lt._currentValue,pool:c},t.memoizedState={baseLanes:l,cachePool:c},e!==null&&Ii(t,null),nu(),xd(t),e!==null&&Ia(e,t,a,!0),t.childLanes=s,null}function hs(e,t){return t=vs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function jf(e,t,l){return Aa(t,e.child,null,l),e=hs(t,t.pendingProps),e.flags|=2,Lt(t),t.memoizedState=null,e}function Cy(e,t,l){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ke){if(a.mode==="hidden")return e=hs(t,a),t.lanes=536870912,Wn(null,e);if(su(t),(e=Xe)?(e=zh(e,Pt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yl!==null?{id:rl,overflow:ol}:null,retryLane:536870912,hydrationErrors:null},l=ld(e),l.return=t,t.child=l,ht=t,Xe=null)):e=null,e===null)throw Vl(t);return t.lanes=536870912,null}return hs(t,a)}var c=e.memoizedState;if(c!==null){var o=c.dehydrated;if(su(t),s)if(t.flags&256)t.flags&=-257,t=jf(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(nt||Ia(e,t,l,!1),s=(l&e.childLanes)!==0,nt||s){if(a=Ye,a!==null&&(o=uo(a,l),o!==0&&o!==c.retryLane))throw c.retryLane=o,pa(e,o),Dt(a,e,o),Au;_s(),t=jf(e,t,l)}else e=c.treeContext,Xe=tl(o.nextSibling),ht=t,ke=!0,Gl=null,Pt=!1,e!==null&&id(t,e),t=hs(t,a),t.flags|=4096;return t}return e=xl(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ms(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Eu(e,t,l,a,s){return ka(t),l=uu(e,t,l,a,void 0,s),a=ru(),e!==null&&!nt?(ou(e,t,s),Al(e,t,s)):(ke&&a&&Gc(t),t.flags|=1,vt(e,t,l,s),t.child)}function xf(e,t,l,a,s,c){return ka(t),t.updateQueue=null,l=kd(t,a,l,s),Sd(e),a=ru(),e!==null&&!nt?(ou(e,t,c),Al(e,t,c)):(ke&&a&&Gc(t),t.flags|=1,vt(e,t,l,c),t.child)}function Sf(e,t,l,a,s){if(ka(t),t.stateNode===null){var c=Za,o=l.contextType;typeof o=="object"&&o!==null&&(c=mt(o)),c=new l(a,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Nu,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=a,c.state=t.memoizedState,c.refs={},eu(t),o=l.contextType,c.context=typeof o=="object"&&o!==null?mt(o):Za,c.state=t.memoizedState,o=l.getDerivedStateFromProps,typeof o=="function"&&(_u(t,l,o,a),c.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(o=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),o!==c.state&&Nu.enqueueReplaceState(c,c.state,null),Zn(t,a,c,s),Xn(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){c=t.stateNode;var y=t.memoizedProps,x=Ca(l,y);c.props=x;var C=c.context,q=l.contextType;o=Za,typeof q=="object"&&q!==null&&(o=mt(q));var H=l.getDerivedStateFromProps;q=typeof H=="function"||typeof c.getSnapshotBeforeUpdate=="function",y=t.pendingProps!==y,q||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(y||C!==o)&&uf(t,c,a,o),Xl=!1;var z=t.memoizedState;c.state=z,Zn(t,a,c,s),Xn(),C=t.memoizedState,y||z!==C||Xl?(typeof H=="function"&&(_u(t,l,H,a),C=t.memoizedState),(x=Xl||cf(t,l,x,a,z,C,o))?(q||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=C),c.props=a,c.state=C,c.context=o,a=x):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{c=t.stateNode,tu(e,t),o=t.memoizedProps,q=Ca(l,o),c.props=q,H=t.pendingProps,z=c.context,C=l.contextType,x=Za,typeof C=="object"&&C!==null&&(x=mt(C)),y=l.getDerivedStateFromProps,(C=typeof y=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(o!==H||z!==x)&&uf(t,c,a,x),Xl=!1,z=t.memoizedState,c.state=z,Zn(t,a,c,s),Xn();var R=t.memoizedState;o!==H||z!==R||Xl||e!==null&&e.dependencies!==null&&Ji(e.dependencies)?(typeof y=="function"&&(_u(t,l,y,a),R=t.memoizedState),(q=Xl||cf(t,l,q,a,z,R,x)||e!==null&&e.dependencies!==null&&Ji(e.dependencies))?(C||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(a,R,x),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(a,R,x)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=R),c.props=a,c.state=R,c.context=x,a=q):(typeof c.componentDidUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),a=!1)}return c=a,ms(e,t),a=(t.flags&128)!==0,c||a?(c=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&a?(t.child=Aa(t,e.child,null,s),t.child=Aa(t,null,l,s)):vt(e,t,l,s),t.memoizedState=c.state,e=t.child):e=Al(e,t,s),e}function kf(e,t,l,a){return xa(),t.flags|=256,vt(e,t,l,a),t.child}var Cu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ou(e){return{baseLanes:e,cachePool:dd()}}function Du(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Gt),e}function _f(e,t,l){var a=t.pendingProps,s=!1,c=(t.flags&128)!==0,o;if((o=c)||(o=e!==null&&e.memoizedState===null?!1:(et.current&2)!==0),o&&(s=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(s?Jl(t):Fl(),(e=Xe)?(e=zh(e,Pt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yl!==null?{id:rl,overflow:ol}:null,retryLane:536870912,hydrationErrors:null},l=ld(e),l.return=t,t.child=l,ht=t,Xe=null)):e=null,e===null)throw Vl(t);return hr(e)?t.lanes=32:t.lanes=536870912,null}var y=a.children;return a=a.fallback,s?(Fl(),s=t.mode,y=vs({mode:"hidden",children:y},s),a=ja(a,s,l,null),y.return=t,a.return=t,y.sibling=a,t.child=y,a=t.child,a.memoizedState=Ou(l),a.childLanes=Du(e,o,l),t.memoizedState=Cu,Wn(null,a)):(Jl(t),zu(t,y))}var x=e.memoizedState;if(x!==null&&(y=x.dehydrated,y!==null)){if(c)t.flags&256?(Jl(t),t.flags&=-257,t=Ru(e,t,l)):t.memoizedState!==null?(Fl(),t.child=e.child,t.flags|=128,t=null):(Fl(),y=a.fallback,s=t.mode,a=vs({mode:"visible",children:a.children},s),y=ja(y,s,l,null),y.flags|=2,a.return=t,y.return=t,a.sibling=y,t.child=a,Aa(t,e.child,null,l),a=t.child,a.memoizedState=Ou(l),a.childLanes=Du(e,o,l),t.memoizedState=Cu,t=Wn(null,a));else if(Jl(t),hr(y)){if(o=y.nextSibling&&y.nextSibling.dataset,o)var C=o.dgst;o=C,a=Error(r(419)),a.stack="",a.digest=o,Hn({value:a,source:null,stack:null}),t=Ru(e,t,l)}else if(nt||Ia(e,t,l,!1),o=(l&e.childLanes)!==0,nt||o){if(o=Ye,o!==null&&(a=uo(o,l),a!==0&&a!==x.retryLane))throw x.retryLane=a,pa(e,a),Dt(o,e,a),Au;fr(y)||_s(),t=Ru(e,t,l)}else fr(y)?(t.flags|=192,t.child=e.child,t=null):(e=x.treeContext,Xe=tl(y.nextSibling),ht=t,ke=!0,Gl=null,Pt=!1,e!==null&&id(t,e),t=zu(t,a.children),t.flags|=4096);return t}return s?(Fl(),y=a.fallback,s=t.mode,x=e.child,C=x.sibling,a=xl(x,{mode:"hidden",children:a.children}),a.subtreeFlags=x.subtreeFlags&65011712,C!==null?y=xl(C,y):(y=ja(y,s,l,null),y.flags|=2),y.return=t,a.return=t,a.sibling=y,t.child=a,Wn(null,a),a=t.child,y=e.child.memoizedState,y===null?y=Ou(l):(s=y.cachePool,s!==null?(x=lt._currentValue,s=s.parent!==x?{parent:x,pool:x}:s):s=dd(),y={baseLanes:y.baseLanes|l,cachePool:s}),a.memoizedState=y,a.childLanes=Du(e,o,l),t.memoizedState=Cu,Wn(e.child,a)):(Jl(t),l=e.child,e=l.sibling,l=xl(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=l,t.memoizedState=null,l)}function zu(e,t){return t=vs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function vs(e,t){return e=$t(22,e,null,t),e.lanes=0,e}function Ru(e,t,l){return Aa(t,e.child,null,l),e=zu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nf(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Kc(e.return,t,l)}function wu(e,t,l,a,s,c){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:s,treeForkCount:c}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=a,o.tail=l,o.tailMode=s,o.treeForkCount=c)}function Tf(e,t,l){var a=t.pendingProps,s=a.revealOrder,c=a.tail;a=a.children;var o=et.current,y=(o&2)!==0;if(y?(o=o&1|2,t.flags|=128):o&=1,K(et,o),vt(e,t,a,l),a=ke?$n:0,!y&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nf(e,l,t);else if(e.tag===19)Nf(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(l=t.child,s=null;l!==null;)e=l.alternate,e!==null&&as(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),wu(t,!1,s,l,c,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&as(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}wu(t,!0,l,null,c,a);break;case"together":wu(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Al(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Pl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Ia(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,l=xl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=xl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Mu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ji(e)))}function Oy(e,t,l){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),Ql(t,lt,e.memoizedState.cache),xa();break;case 27:case 5:ul(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:Ql(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,su(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Jl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?_f(e,t,l):(Jl(t),e=Al(e,t,l),e!==null?e.sibling:null);Jl(t);break;case 19:var s=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(Ia(e,t,l,!1),a=(l&t.childLanes)!==0),s){if(a)return Tf(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),K(et,et.current),a)break;return null;case 22:return t.lanes=0,bf(e,t,l,t.pendingProps);case 24:Ql(t,lt,e.memoizedState.cache)}return Al(e,t,l)}function Af(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)nt=!0;else{if(!Mu(e,l)&&(t.flags&128)===0)return nt=!1,Oy(e,t,l);nt=(e.flags&131072)!==0}else nt=!1,ke&&(t.flags&1048576)!==0&&nd(t,$n,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Na(t.elementType),t.type=e,typeof e=="function")Hc(e)?(a=Ca(e,a),t.tag=1,t=Sf(null,t,e,a,l)):(t.tag=0,t=Eu(null,t,e,a,l));else{if(e!=null){var s=e.$$typeof;if(s===Z){t.tag=11,t=vf(null,t,e,a,l);break e}else if(s===W){t.tag=14,t=yf(null,t,e,a,l);break e}}throw t=pt(e)||e,Error(r(306,t,""))}}return t;case 0:return Eu(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,s=Ca(a,t.pendingProps),Sf(e,t,a,s,l);case 3:e:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(r(387));a=t.pendingProps;var c=t.memoizedState;s=c.element,tu(e,t),Zn(t,a,null,l);var o=t.memoizedState;if(a=o.cache,Ql(t,lt,a),a!==c.cache&&Jc(t,[lt],l,!0),Xn(),a=o.element,c.isDehydrated)if(c={element:a,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=kf(e,t,a,l);break e}else if(a!==s){s=Ft(Error(r(424)),t),Hn(s),t=kf(e,t,a,l);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Xe=tl(e.firstChild),ht=t,ke=!0,Gl=null,Pt=!0,l=gd(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(xa(),a===s){t=Al(e,t,l);break e}vt(e,t,a,l)}t=t.child}return t;case 26:return ms(e,t),e===null?(l=Bh(t.type,null,t.pendingProps,null))?t.memoizedState=l:ke||(l=t.type,e=t.pendingProps,a=Ds(X.current).createElement(l),a[ft]=t,a[Nt]=e,yt(a,l,e),rt(a),t.stateNode=a):t.memoizedState=Bh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ul(t),e===null&&ke&&(a=t.stateNode=Mh(t.type,t.pendingProps,X.current),ht=t,Pt=!0,s=Xe,na(t.type)?(mr=s,Xe=tl(a.firstChild)):Xe=s),vt(e,t,t.pendingProps.children,l),ms(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((s=a=Xe)&&(a=sg(a,t.type,t.pendingProps,Pt),a!==null?(t.stateNode=a,ht=t,Xe=tl(a.firstChild),Pt=!1,s=!0):s=!1),s||Vl(t)),ul(t),s=t.type,c=t.pendingProps,o=e!==null?e.memoizedProps:null,a=c.children,rr(s,c)?a=null:o!==null&&rr(s,o)&&(t.flags|=32),t.memoizedState!==null&&(s=uu(e,t,xy,null,null,l),hi._currentValue=s),ms(e,t),vt(e,t,a,l),t.child;case 6:return e===null&&ke&&((e=l=Xe)&&(l=cg(l,t.pendingProps,Pt),l!==null?(t.stateNode=l,ht=t,Xe=null,e=!0):e=!1),e||Vl(t)),null;case 13:return _f(e,t,l);case 4:return me(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Aa(t,null,a,l):vt(e,t,a,l),t.child;case 11:return vf(e,t,t.type,t.pendingProps,l);case 7:return vt(e,t,t.pendingProps,l),t.child;case 8:return vt(e,t,t.pendingProps.children,l),t.child;case 12:return vt(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,Ql(t,t.type,a.value),vt(e,t,a.children,l),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,ka(t),s=mt(s),a=a(s),t.flags|=1,vt(e,t,a,l),t.child;case 14:return yf(e,t,t.type,t.pendingProps,l);case 15:return gf(e,t,t.type,t.pendingProps,l);case 19:return Tf(e,t,l);case 31:return Cy(e,t,l);case 22:return bf(e,t,l,t.pendingProps);case 24:return ka(t),a=mt(lt),e===null?(s=Wc(),s===null&&(s=Ye,c=Fc(),s.pooledCache=c,c.refCount++,c!==null&&(s.pooledCacheLanes|=l),s=c),t.memoizedState={parent:a,cache:s},eu(t),Ql(t,lt,s)):((e.lanes&l)!==0&&(tu(e,t),Zn(t,null,null,l),Xn()),s=e.memoizedState,c=t.memoizedState,s.parent!==a?(s={parent:a,cache:a},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Ql(t,lt,a)):(a=c.cache,Ql(t,lt,a),a!==s.cache&&Jc(t,[lt],l,!0))),vt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function El(e){e.flags|=4}function Uu(e,t,l,a,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(eh())e.flags|=8192;else throw Ta=Pi,Pc}else e.flags&=-16777217}function Ef(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Gh(t))if(eh())e.flags|=8192;else throw Ta=Pi,Pc}function ys(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?io():536870912,e.lanes|=t,on|=t)}function Pn(e,t){if(!ke)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags&65011712,a|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags,a|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function Dy(e,t,l){var a=t.pendingProps;switch(Vc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),_l(lt),Ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Fa(t)?El(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Xc())),Ze(t),null;case 26:var s=t.type,c=t.memoizedState;return e===null?(El(t),c!==null?(Ze(t),Ef(t,c)):(Ze(t),Uu(t,s,null,a,l))):c?c!==e.memoizedState?(El(t),Ze(t),Ef(t,c)):(Ze(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&El(t),Ze(t),Uu(t,s,e,a,l)),null;case 27:if(gl(t),l=X.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&El(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return Ze(t),null}e=F.current,Fa(t)?sd(t):(e=Mh(s,a,l),t.stateNode=e,El(t))}return Ze(t),null;case 5:if(gl(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&El(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return Ze(t),null}if(c=F.current,Fa(t))sd(t);else{var o=Ds(X.current);switch(c){case 1:c=o.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:c=o.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":c=o.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":c=o.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":c=o.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof a.is=="string"?o.createElement("select",{is:a.is}):o.createElement("select"),a.multiple?c.multiple=!0:a.size&&(c.size=a.size);break;default:c=typeof a.is=="string"?o.createElement(s,{is:a.is}):o.createElement(s)}}c[ft]=t,c[Nt]=a;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)c.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=c;e:switch(yt(c,s,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&El(t)}}return Ze(t),Uu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&El(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(r(166));if(e=X.current,Fa(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=ht,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[ft]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||_h(e.nodeValue,l)),e||Vl(t,!0)}else e=Ds(e).createTextNode(a),e[ft]=t,t.stateNode=e}return Ze(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=Fa(t),l!==null){if(e===null){if(!a)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[ft]=t}else xa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),e=!1}else l=Xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Lt(t),t):(Lt(t),null);if((t.flags&128)!==0)throw Error(r(558))}return Ze(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Fa(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));s[ft]=t}else xa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),s=!1}else s=Xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Lt(t),t):(Lt(t),null)}return Lt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),ys(t,t.updateQueue),Ze(t),null);case 4:return Ue(),e===null&&nr(t.stateNode.containerInfo),Ze(t),null;case 10:return _l(t.type),Ze(t),null;case 19:if($(et),a=t.memoizedState,a===null)return Ze(t),null;if(s=(t.flags&128)!==0,c=a.rendering,c===null)if(s)Pn(a,!1);else{if(We!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=as(e),c!==null){for(t.flags|=128,Pn(a,!1),e=c.updateQueue,t.updateQueue=e,ys(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)td(l,e),l=l.sibling;return K(et,et.current&1|2),ke&&Sl(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Mt()>xs&&(t.flags|=128,s=!0,Pn(a,!1),t.lanes=4194304)}else{if(!s)if(e=as(c),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,ys(t,e),Pn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!ke)return Ze(t),null}else 2*Mt()-a.renderingStartTime>xs&&l!==536870912&&(t.flags|=128,s=!0,Pn(a,!1),t.lanes=4194304);a.isBackwards?(c.sibling=t.child,t.child=c):(e=a.last,e!==null?e.sibling=c:t.child=c,a.last=c)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Mt(),e.sibling=null,l=et.current,K(et,s?l&1|2:l&1),ke&&Sl(t,a.treeForkCount),e):(Ze(t),null);case 22:case 23:return Lt(t),iu(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),l=t.updateQueue,l!==null&&ys(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&$(_a),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),_l(lt),Ze(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function zy(e,t){switch(Vc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _l(lt),Ue(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return gl(t),null;case 31:if(t.memoizedState!==null){if(Lt(t),t.alternate===null)throw Error(r(340));xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(et),null;case 4:return Ue(),null;case 10:return _l(t.type),null;case 22:case 23:return Lt(t),iu(),e!==null&&$(_a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _l(lt),null;case 25:return null;default:return null}}function Cf(e,t){switch(Vc(t),t.tag){case 3:_l(lt),Ue();break;case 26:case 27:case 5:gl(t);break;case 4:Ue();break;case 31:t.memoizedState!==null&&Lt(t);break;case 13:Lt(t);break;case 19:$(et);break;case 10:_l(t.type);break;case 22:case 23:Lt(t),iu(),e!==null&&$(_a);break;case 24:_l(lt)}}function ei(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var s=a.next;l=s;do{if((l.tag&e)===e){a=void 0;var c=l.create,o=l.inst;a=c(),o.destroy=a}l=l.next}while(l!==s)}}catch(y){Be(t,t.return,y)}}function Il(e,t,l){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var c=s.next;a=c;do{if((a.tag&e)===e){var o=a.inst,y=o.destroy;if(y!==void 0){o.destroy=void 0,s=t;var x=l,C=y;try{C()}catch(q){Be(s,x,q)}}}a=a.next}while(a!==c)}}catch(q){Be(t,t.return,q)}}function Of(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{pd(t,l)}catch(a){Be(e,e.return,a)}}}function Df(e,t,l){l.props=Ca(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Be(e,t,a)}}function ti(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(s){Be(e,t,s)}}function dl(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(s){Be(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(s){Be(e,t,s)}else l.current=null}function zf(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(s){Be(e,e.return,s)}}function qu(e,t,l){try{var a=e.stateNode;eg(a,e.type,l,t),a[Nt]=t}catch(s){Be(e,e.return,s)}}function Rf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&na(e.type)||e.tag===4}function Bu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&na(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $u(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=pl));else if(a!==4&&(a===27&&na(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for($u(e,t,l),e=e.sibling;e!==null;)$u(e,t,l),e=e.sibling}function gs(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&na(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(gs(e,t,l),e=e.sibling;e!==null;)gs(e,t,l),e=e.sibling}function wf(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);yt(t,a,l),t[ft]=e,t[Nt]=l}catch(c){Be(e,e.return,c)}}var Cl=!1,it=!1,Hu=!1,Mf=typeof WeakSet=="function"?WeakSet:Set,ot=null;function Ry(e,t){if(e=e.containerInfo,cr=Bs,e=Xo(e),Rc(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var s=a.anchorOffset,c=a.focusNode;a=a.focusOffset;try{l.nodeType,c.nodeType}catch{l=null;break e}var o=0,y=-1,x=-1,C=0,q=0,H=e,z=null;t:for(;;){for(var R;H!==l||s!==0&&H.nodeType!==3||(y=o+s),H!==c||a!==0&&H.nodeType!==3||(x=o+a),H.nodeType===3&&(o+=H.nodeValue.length),(R=H.firstChild)!==null;)z=H,H=R;for(;;){if(H===e)break t;if(z===l&&++C===s&&(y=o),z===c&&++q===a&&(x=o),(R=H.nextSibling)!==null)break;H=z,z=H.parentNode}H=R}l=y===-1||x===-1?null:{start:y,end:x}}else l=null}l=l||{start:0,end:0}}else l=null;for(ur={focusedElem:e,selectionRange:l},Bs=!1,ot=t;ot!==null;)if(t=ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ot=e;else for(;ot!==null;){switch(t=ot,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)s=e[l],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,l=t,s=c.memoizedProps,c=c.memoizedState,a=l.stateNode;try{var I=Ca(l.type,s);e=a.getSnapshotBeforeUpdate(I,c),a.__reactInternalSnapshotBeforeUpdate=e}catch(ie){Be(l,l.return,ie)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)dr(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":dr(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=t.sibling,e!==null){e.return=t.return,ot=e;break}ot=t.return}}function Uf(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:Dl(e,l),a&4&&ei(5,l);break;case 1:if(Dl(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(o){Be(l,l.return,o)}else{var s=Ca(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Be(l,l.return,o)}}a&64&&Of(l),a&512&&ti(l,l.return);break;case 3:if(Dl(e,l),a&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{pd(e,t)}catch(o){Be(l,l.return,o)}}break;case 27:t===null&&a&4&&wf(l);case 26:case 5:Dl(e,l),t===null&&a&4&&zf(l),a&512&&ti(l,l.return);break;case 12:Dl(e,l);break;case 31:Dl(e,l),a&4&&$f(e,l);break;case 13:Dl(e,l),a&4&&Hf(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Yy.bind(null,l),ug(e,l))));break;case 22:if(a=l.memoizedState!==null||Cl,!a){t=t!==null&&t.memoizedState!==null||it,s=Cl;var c=it;Cl=a,(it=t)&&!c?zl(e,l,(l.subtreeFlags&8772)!==0):Dl(e,l),Cl=s,it=c}break;case 30:break;default:Dl(e,l)}}function qf(e){var t=e.alternate;t!==null&&(e.alternate=null,qf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&yc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Je=null,At=!1;function Ol(e,t,l){for(l=l.child;l!==null;)Bf(e,t,l),l=l.sibling}function Bf(e,t,l){if(Ut&&typeof Ut.onCommitFiberUnmount=="function")try{Ut.onCommitFiberUnmount(Nn,l)}catch{}switch(l.tag){case 26:it||dl(l,t),Ol(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:it||dl(l,t);var a=Je,s=At;na(l.type)&&(Je=l.stateNode,At=!1),Ol(e,t,l),oi(l.stateNode),Je=a,At=s;break;case 5:it||dl(l,t);case 6:if(a=Je,s=At,Je=null,Ol(e,t,l),Je=a,At=s,Je!==null)if(At)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(l.stateNode)}catch(c){Be(l,t,c)}else try{Je.removeChild(l.stateNode)}catch(c){Be(l,t,c)}break;case 18:Je!==null&&(At?(e=Je,Oh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),bn(e)):Oh(Je,l.stateNode));break;case 4:a=Je,s=At,Je=l.stateNode.containerInfo,At=!0,Ol(e,t,l),Je=a,At=s;break;case 0:case 11:case 14:case 15:Il(2,l,t),it||Il(4,l,t),Ol(e,t,l);break;case 1:it||(dl(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Df(l,t,a)),Ol(e,t,l);break;case 21:Ol(e,t,l);break;case 22:it=(a=it)||l.memoizedState!==null,Ol(e,t,l),it=a;break;default:Ol(e,t,l)}}function $f(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{bn(e)}catch(l){Be(t,t.return,l)}}}function Hf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{bn(e)}catch(l){Be(t,t.return,l)}}function wy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Mf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Mf),t;default:throw Error(r(435,e.tag))}}function bs(e,t){var l=wy(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var s=Gy.bind(null,e,a);a.then(s,s)}})}function Et(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var s=l[a],c=e,o=t,y=o;e:for(;y!==null;){switch(y.tag){case 27:if(na(y.type)){Je=y.stateNode,At=!1;break e}break;case 5:Je=y.stateNode,At=!1;break e;case 3:case 4:Je=y.stateNode.containerInfo,At=!0;break e}y=y.return}if(Je===null)throw Error(r(160));Bf(c,o,s),Je=null,At=!1,c=s.alternate,c!==null&&(c.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Lf(t,e),t=t.sibling}var il=null;function Lf(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Et(t,e),Ct(e),a&4&&(Il(3,e,e.return),ei(3,e),Il(5,e,e.return));break;case 1:Et(t,e),Ct(e),a&512&&(it||l===null||dl(l,l.return)),a&64&&Cl&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var s=il;if(Et(t,e),Ct(e),a&512&&(it||l===null||dl(l,l.return)),a&4){var c=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,s=s.ownerDocument||s;t:switch(a){case"title":c=s.getElementsByTagName("title")[0],(!c||c[En]||c[ft]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=s.createElement(a),s.head.insertBefore(c,s.querySelector("head > title"))),yt(c,a,l),c[ft]=e,rt(c),a=c;break e;case"link":var o=Lh("link","href",s).get(a+(l.href||""));if(o){for(var y=0;y<o.length;y++)if(c=o[y],c.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&c.getAttribute("rel")===(l.rel==null?null:l.rel)&&c.getAttribute("title")===(l.title==null?null:l.title)&&c.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){o.splice(y,1);break t}}c=s.createElement(a),yt(c,a,l),s.head.appendChild(c);break;case"meta":if(o=Lh("meta","content",s).get(a+(l.content||""))){for(y=0;y<o.length;y++)if(c=o[y],c.getAttribute("content")===(l.content==null?null:""+l.content)&&c.getAttribute("name")===(l.name==null?null:l.name)&&c.getAttribute("property")===(l.property==null?null:l.property)&&c.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&c.getAttribute("charset")===(l.charSet==null?null:l.charSet)){o.splice(y,1);break t}}c=s.createElement(a),yt(c,a,l),s.head.appendChild(c);break;default:throw Error(r(468,a))}c[ft]=e,rt(c),a=c}e.stateNode=a}else Yh(s,e.type,e.stateNode);else e.stateNode=Hh(s,a,e.memoizedProps);else c!==a?(c===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):c.count--,a===null?Yh(s,e.type,e.stateNode):Hh(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&qu(e,e.memoizedProps,l.memoizedProps)}break;case 27:Et(t,e),Ct(e),a&512&&(it||l===null||dl(l,l.return)),l!==null&&a&4&&qu(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Et(t,e),Ct(e),a&512&&(it||l===null||dl(l,l.return)),e.flags&32){s=e.stateNode;try{Ha(s,"")}catch(I){Be(e,e.return,I)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,qu(e,s,l!==null?l.memoizedProps:s)),a&1024&&(Hu=!0);break;case 6:if(Et(t,e),Ct(e),a&4){if(e.stateNode===null)throw Error(r(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(I){Be(e,e.return,I)}}break;case 3:if(ws=null,s=il,il=zs(t.containerInfo),Et(t,e),il=s,Ct(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{bn(t.containerInfo)}catch(I){Be(e,e.return,I)}Hu&&(Hu=!1,Yf(e));break;case 4:a=il,il=zs(e.stateNode.containerInfo),Et(t,e),Ct(e),il=a;break;case 12:Et(t,e),Ct(e);break;case 31:Et(t,e),Ct(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,bs(e,a)));break;case 13:Et(t,e),Ct(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(js=Mt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,bs(e,a)));break;case 22:s=e.memoizedState!==null;var x=l!==null&&l.memoizedState!==null,C=Cl,q=it;if(Cl=C||s,it=q||x,Et(t,e),it=q,Cl=C,Ct(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||x||Cl||it||Oa(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){x=l=t;try{if(c=x.stateNode,s)o=c.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{y=x.stateNode;var H=x.memoizedProps.style,z=H!=null&&H.hasOwnProperty("display")?H.display:null;y.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(I){Be(x,x.return,I)}}}else if(t.tag===6){if(l===null){x=t;try{x.stateNode.nodeValue=s?"":x.memoizedProps}catch(I){Be(x,x.return,I)}}}else if(t.tag===18){if(l===null){x=t;try{var R=x.stateNode;s?Dh(R,!0):Dh(x.stateNode,!1)}catch(I){Be(x,x.return,I)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,bs(e,l))));break;case 19:Et(t,e),Ct(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,bs(e,a)));break;case 30:break;case 21:break;default:Et(t,e),Ct(e)}}function Ct(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(Rf(a)){l=a;break}a=a.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var s=l.stateNode,c=Bu(e);gs(e,c,s);break;case 5:var o=l.stateNode;l.flags&32&&(Ha(o,""),l.flags&=-33);var y=Bu(e);gs(e,y,o);break;case 3:case 4:var x=l.stateNode.containerInfo,C=Bu(e);$u(e,C,x);break;default:throw Error(r(161))}}catch(q){Be(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Yf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Yf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Dl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Uf(e,t.alternate,t),t=t.sibling}function Oa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Il(4,t,t.return),Oa(t);break;case 1:dl(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Df(t,t.return,l),Oa(t);break;case 27:oi(t.stateNode);case 26:case 5:dl(t,t.return),Oa(t);break;case 22:t.memoizedState===null&&Oa(t);break;case 30:Oa(t);break;default:Oa(t)}e=e.sibling}}function zl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,c=t,o=c.flags;switch(c.tag){case 0:case 11:case 15:zl(s,c,l),ei(4,c);break;case 1:if(zl(s,c,l),a=c,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(C){Be(a,a.return,C)}if(a=c,s=a.updateQueue,s!==null){var y=a.stateNode;try{var x=s.shared.hiddenCallbacks;if(x!==null)for(s.shared.hiddenCallbacks=null,s=0;s<x.length;s++)bd(x[s],y)}catch(C){Be(a,a.return,C)}}l&&o&64&&Of(c),ti(c,c.return);break;case 27:wf(c);case 26:case 5:zl(s,c,l),l&&a===null&&o&4&&zf(c),ti(c,c.return);break;case 12:zl(s,c,l);break;case 31:zl(s,c,l),l&&o&4&&$f(s,c);break;case 13:zl(s,c,l),l&&o&4&&Hf(s,c);break;case 22:c.memoizedState===null&&zl(s,c,l),ti(c,c.return);break;case 30:break;default:zl(s,c,l)}t=t.sibling}}function Lu(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Ln(l))}function Yu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ln(e))}function sl(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Gf(e,t,l,a),t=t.sibling}function Gf(e,t,l,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:sl(e,t,l,a),s&2048&&ei(9,t);break;case 1:sl(e,t,l,a);break;case 3:sl(e,t,l,a),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ln(e)));break;case 12:if(s&2048){sl(e,t,l,a),e=t.stateNode;try{var c=t.memoizedProps,o=c.id,y=c.onPostCommit;typeof y=="function"&&y(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(x){Be(t,t.return,x)}}else sl(e,t,l,a);break;case 31:sl(e,t,l,a);break;case 13:sl(e,t,l,a);break;case 23:break;case 22:c=t.stateNode,o=t.alternate,t.memoizedState!==null?c._visibility&2?sl(e,t,l,a):li(e,t):c._visibility&2?sl(e,t,l,a):(c._visibility|=2,cn(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Lu(o,t);break;case 24:sl(e,t,l,a),s&2048&&Yu(t.alternate,t);break;default:sl(e,t,l,a)}}function cn(e,t,l,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,o=t,y=l,x=a,C=o.flags;switch(o.tag){case 0:case 11:case 15:cn(c,o,y,x,s),ei(8,o);break;case 23:break;case 22:var q=o.stateNode;o.memoizedState!==null?q._visibility&2?cn(c,o,y,x,s):li(c,o):(q._visibility|=2,cn(c,o,y,x,s)),s&&C&2048&&Lu(o.alternate,o);break;case 24:cn(c,o,y,x,s),s&&C&2048&&Yu(o.alternate,o);break;default:cn(c,o,y,x,s)}t=t.sibling}}function li(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,s=a.flags;switch(a.tag){case 22:li(l,a),s&2048&&Lu(a.alternate,a);break;case 24:li(l,a),s&2048&&Yu(a.alternate,a);break;default:li(l,a)}t=t.sibling}}var ai=8192;function un(e,t,l){if(e.subtreeFlags&ai)for(e=e.child;e!==null;)Vf(e,t,l),e=e.sibling}function Vf(e,t,l){switch(e.tag){case 26:un(e,t,l),e.flags&ai&&e.memoizedState!==null&&jg(l,il,e.memoizedState,e.memoizedProps);break;case 5:un(e,t,l);break;case 3:case 4:var a=il;il=zs(e.stateNode.containerInfo),un(e,t,l),il=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ai,ai=16777216,un(e,t,l),ai=a):un(e,t,l));break;default:un(e,t,l)}}function Qf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ni(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];ot=a,Zf(a,e)}Qf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xf(e),e=e.sibling}function Xf(e){switch(e.tag){case 0:case 11:case 15:ni(e),e.flags&2048&&Il(9,e,e.return);break;case 3:ni(e);break;case 12:ni(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ps(e)):ni(e);break;default:ni(e)}}function ps(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];ot=a,Zf(a,e)}Qf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Il(8,t,t.return),ps(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,ps(t));break;default:ps(t)}e=e.sibling}}function Zf(e,t){for(;ot!==null;){var l=ot;switch(l.tag){case 0:case 11:case 15:Il(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ln(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,ot=a;else e:for(l=e;ot!==null;){a=ot;var s=a.sibling,c=a.return;if(qf(a),a===l){ot=null;break e}if(s!==null){s.return=c,ot=s;break e}ot=c}}}var My={getCacheForType:function(e){var t=mt(lt),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return mt(lt).controller.signal}},Uy=typeof WeakMap=="function"?WeakMap:Map,ze=0,Ye=null,be=null,xe=0,qe=0,Yt=null,Wl=!1,rn=!1,Gu=!1,Rl=0,We=0,Pl=0,Da=0,Vu=0,Gt=0,on=0,ii=null,Ot=null,Qu=!1,js=0,Kf=0,xs=1/0,Ss=null,ea=null,ct=0,ta=null,dn=null,wl=0,Xu=0,Zu=null,Jf=null,si=0,Ku=null;function Vt(){return(ze&2)!==0&&xe!==0?xe&-xe:M.T!==null?er():ro()}function Ff(){if(Gt===0)if((xe&536870912)===0||ke){var e=Oi;Oi<<=1,(Oi&3932160)===0&&(Oi=262144),Gt=e}else Gt=536870912;return e=Ht.current,e!==null&&(e.flags|=32),Gt}function Dt(e,t,l){(e===Ye&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(fn(e,0),la(e,xe,Gt,!1)),An(e,l),((ze&2)===0||e!==Ye)&&(e===Ye&&((ze&2)===0&&(Da|=l),We===4&&la(e,xe,Gt,!1)),fl(e))}function If(e,t,l){if((ze&6)!==0)throw Error(r(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Tn(e,t),s=a?$y(e,t):Fu(e,t,!0),c=a;do{if(s===0){rn&&!a&&la(e,t,0,!1);break}else{if(l=e.current.alternate,c&&!qy(l)){s=Fu(e,t,!1),c=!1;continue}if(s===2){if(c=t,e.errorRecoveryDisabledLanes&c)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var y=e;s=ii;var x=y.current.memoizedState.isDehydrated;if(x&&(fn(y,o).flags|=256),o=Fu(y,o,!1),o!==2){if(Gu&&!x){y.errorRecoveryDisabledLanes|=c,Da|=c,s=4;break e}c=Ot,Ot=s,c!==null&&(Ot===null?Ot=c:Ot.push.apply(Ot,c))}s=o}if(c=!1,s!==2)continue}}if(s===1){fn(e,0),la(e,t,0,!0);break}e:{switch(a=e,c=s,c){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:la(a,t,Gt,!Wl);break e;case 2:Ot=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(s=js+300-Mt(),10<s)){if(la(a,t,Gt,!Wl),zi(a,0,!0)!==0)break e;wl=t,a.timeoutHandle=Eh(Wf.bind(null,a,l,Ot,Ss,Qu,t,Gt,Da,on,Wl,c,"Throttled",-0,0),s);break e}Wf(a,l,Ot,Ss,Qu,t,Gt,Da,on,Wl,c,null,-0,0)}}break}while(!0);fl(e)}function Wf(e,t,l,a,s,c,o,y,x,C,q,H,z,R){if(e.timeoutHandle=-1,H=t.subtreeFlags,H&8192||(H&16785408)===16785408){H={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pl},Vf(t,c,H);var I=(c&62914560)===c?js-Mt():(c&4194048)===c?Kf-Mt():0;if(I=xg(H,I),I!==null){wl=c,e.cancelPendingCommit=I(sh.bind(null,e,t,c,l,a,s,o,y,x,q,H,null,z,R)),la(e,c,o,!C);return}}sh(e,t,c,l,a,s,o,y,x)}function qy(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var s=l[a],c=s.getSnapshot;s=s.value;try{if(!Bt(c(),s))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function la(e,t,l,a){t&=~Vu,t&=~Da,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var c=31-qt(s),o=1<<c;a[c]=-1,s&=~o}l!==0&&so(e,l,t)}function ks(){return(ze&6)===0?(ci(0),!1):!0}function Ju(){if(be!==null){if(qe===0)var e=be.return;else e=be,kl=Sa=null,du(e),tn=null,Gn=0,e=be;for(;e!==null;)Cf(e.alternate,e),e=e.return;be=null}}function fn(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,ag(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),wl=0,Ju(),Ye=e,be=l=xl(e.current,null),xe=t,qe=0,Yt=null,Wl=!1,rn=Tn(e,t),Gu=!1,on=Gt=Vu=Da=Pl=We=0,Ot=ii=null,Qu=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var s=31-qt(a),c=1<<s;t|=e[s],a&=~c}return Rl=t,Vi(),l}function Pf(e,t){de=null,M.H=In,t===en||t===Wi?(t=md(),qe=3):t===Pc?(t=md(),qe=4):qe=t===Au?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Yt=t,be===null&&(We=1,fs(e,Ft(t,e.current)))}function eh(){var e=Ht.current;return e===null?!0:(xe&4194048)===xe?el===null:(xe&62914560)===xe||(xe&536870912)!==0?e===el:!1}function th(){var e=M.H;return M.H=In,e===null?In:e}function lh(){var e=M.A;return M.A=My,e}function _s(){We=4,Wl||(xe&4194048)!==xe&&Ht.current!==null||(rn=!0),(Pl&134217727)===0&&(Da&134217727)===0||Ye===null||la(Ye,xe,Gt,!1)}function Fu(e,t,l){var a=ze;ze|=2;var s=th(),c=lh();(Ye!==e||xe!==t)&&(Ss=null,fn(e,t)),t=!1;var o=We;e:do try{if(qe!==0&&be!==null){var y=be,x=Yt;switch(qe){case 8:Ju(),o=6;break e;case 3:case 2:case 9:case 6:Ht.current===null&&(t=!0);var C=qe;if(qe=0,Yt=null,hn(e,y,x,C),l&&rn){o=0;break e}break;default:C=qe,qe=0,Yt=null,hn(e,y,x,C)}}By(),o=We;break}catch(q){Pf(e,q)}while(!0);return t&&e.shellSuspendCounter++,kl=Sa=null,ze=a,M.H=s,M.A=c,be===null&&(Ye=null,xe=0,Vi()),o}function By(){for(;be!==null;)ah(be)}function $y(e,t){var l=ze;ze|=2;var a=th(),s=lh();Ye!==e||xe!==t?(Ss=null,xs=Mt()+500,fn(e,t)):rn=Tn(e,t);e:do try{if(qe!==0&&be!==null){t=be;var c=Yt;t:switch(qe){case 1:qe=0,Yt=null,hn(e,t,c,1);break;case 2:case 9:if(fd(c)){qe=0,Yt=null,nh(t);break}t=function(){qe!==2&&qe!==9||Ye!==e||(qe=7),fl(e)},c.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:fd(c)?(qe=0,Yt=null,nh(t)):(qe=0,Yt=null,hn(e,t,c,7));break;case 5:var o=null;switch(be.tag){case 26:o=be.memoizedState;case 5:case 27:var y=be;if(o?Gh(o):y.stateNode.complete){qe=0,Yt=null;var x=y.sibling;if(x!==null)be=x;else{var C=y.return;C!==null?(be=C,Ns(C)):be=null}break t}}qe=0,Yt=null,hn(e,t,c,5);break;case 6:qe=0,Yt=null,hn(e,t,c,6);break;case 8:Ju(),We=6;break e;default:throw Error(r(462))}}Hy();break}catch(q){Pf(e,q)}while(!0);return kl=Sa=null,M.H=a,M.A=s,ze=l,be!==null?0:(Ye=null,xe=0,Vi(),We)}function Hy(){for(;be!==null&&!rv();)ah(be)}function ah(e){var t=Af(e.alternate,e,Rl);e.memoizedProps=e.pendingProps,t===null?Ns(e):be=t}function nh(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=xf(l,t,t.pendingProps,t.type,void 0,xe);break;case 11:t=xf(l,t,t.pendingProps,t.type.render,t.ref,xe);break;case 5:du(t);default:Cf(l,t),t=be=td(t,Rl),t=Af(l,t,Rl)}e.memoizedProps=e.pendingProps,t===null?Ns(e):be=t}function hn(e,t,l,a){kl=Sa=null,du(t),tn=null,Gn=0;var s=t.return;try{if(Ey(e,s,t,l,xe)){We=1,fs(e,Ft(l,e.current)),be=null;return}}catch(c){if(s!==null)throw be=s,c;We=1,fs(e,Ft(l,e.current)),be=null;return}t.flags&32768?(ke||a===1?e=!0:rn||(xe&536870912)!==0?e=!1:(Wl=e=!0,(a===2||a===9||a===3||a===6)&&(a=Ht.current,a!==null&&a.tag===13&&(a.flags|=16384))),ih(t,e)):Ns(t)}function Ns(e){var t=e;do{if((t.flags&32768)!==0){ih(t,Wl);return}e=t.return;var l=Dy(t.alternate,t,Rl);if(l!==null){be=l;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);We===0&&(We=5)}function ih(e,t){do{var l=zy(e.alternate,e);if(l!==null){l.flags&=32767,be=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){be=e;return}be=e=l}while(e!==null);We=6,be=null}function sh(e,t,l,a,s,c,o,y,x){e.cancelPendingCommit=null;do Ts();while(ct!==0);if((ze&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(c=t.lanes|t.childLanes,c|=Bc,pv(e,l,c,o,y,x),e===Ye&&(be=Ye=null,xe=0),dn=t,ta=e,wl=l,Xu=c,Zu=s,Jf=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Vy(Ei,function(){return dh(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=M.T,M.T=null,s=G.p,G.p=2,o=ze,ze|=4;try{Ry(e,t,l)}finally{ze=o,G.p=s,M.T=a}}ct=1,ch(),uh(),rh()}}function ch(){if(ct===1){ct=0;var e=ta,t=dn,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null;var a=G.p;G.p=2;var s=ze;ze|=4;try{Lf(t,e);var c=ur,o=Xo(e.containerInfo),y=c.focusedElem,x=c.selectionRange;if(o!==y&&y&&y.ownerDocument&&Qo(y.ownerDocument.documentElement,y)){if(x!==null&&Rc(y)){var C=x.start,q=x.end;if(q===void 0&&(q=C),"selectionStart"in y)y.selectionStart=C,y.selectionEnd=Math.min(q,y.value.length);else{var H=y.ownerDocument||document,z=H&&H.defaultView||window;if(z.getSelection){var R=z.getSelection(),I=y.textContent.length,ie=Math.min(x.start,I),Le=x.end===void 0?ie:Math.min(x.end,I);!R.extend&&ie>Le&&(o=Le,Le=ie,ie=o);var T=Vo(y,ie),k=Vo(y,Le);if(T&&k&&(R.rangeCount!==1||R.anchorNode!==T.node||R.anchorOffset!==T.offset||R.focusNode!==k.node||R.focusOffset!==k.offset)){var E=H.createRange();E.setStart(T.node,T.offset),R.removeAllRanges(),ie>Le?(R.addRange(E),R.extend(k.node,k.offset)):(E.setEnd(k.node,k.offset),R.addRange(E))}}}}for(H=[],R=y;R=R.parentNode;)R.nodeType===1&&H.push({element:R,left:R.scrollLeft,top:R.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<H.length;y++){var B=H[y];B.element.scrollLeft=B.left,B.element.scrollTop=B.top}}Bs=!!cr,ur=cr=null}finally{ze=s,G.p=a,M.T=l}}e.current=t,ct=2}}function uh(){if(ct===2){ct=0;var e=ta,t=dn,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=M.T,M.T=null;var a=G.p;G.p=2;var s=ze;ze|=4;try{Uf(e,t.alternate,t)}finally{ze=s,G.p=a,M.T=l}}ct=3}}function rh(){if(ct===4||ct===3){ct=0,ov();var e=ta,t=dn,l=wl,a=Jf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ct=5:(ct=0,dn=ta=null,oh(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(ea=null),mc(l),t=t.stateNode,Ut&&typeof Ut.onCommitFiberRoot=="function")try{Ut.onCommitFiberRoot(Nn,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=M.T,s=G.p,G.p=2,M.T=null;try{for(var c=e.onRecoverableError,o=0;o<a.length;o++){var y=a[o];c(y.value,{componentStack:y.stack})}}finally{M.T=t,G.p=s}}(wl&3)!==0&&Ts(),fl(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===Ku?si++:(si=0,Ku=e):si=0,ci(0)}}function oh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ln(t)))}function Ts(){return ch(),uh(),rh(),dh()}function dh(){if(ct!==5)return!1;var e=ta,t=Xu;Xu=0;var l=mc(wl),a=M.T,s=G.p;try{G.p=32>l?32:l,M.T=null,l=Zu,Zu=null;var c=ta,o=wl;if(ct=0,dn=ta=null,wl=0,(ze&6)!==0)throw Error(r(331));var y=ze;if(ze|=4,Xf(c.current),Gf(c,c.current,o,l),ze=y,ci(0,!1),Ut&&typeof Ut.onPostCommitFiberRoot=="function")try{Ut.onPostCommitFiberRoot(Nn,c)}catch{}return!0}finally{G.p=s,M.T=a,oh(e,t)}}function fh(e,t,l){t=Ft(l,t),t=Tu(e.stateNode,t,2),e=Kl(e,t,2),e!==null&&(An(e,2),fl(e))}function Be(e,t,l){if(e.tag===3)fh(e,e,l);else for(;t!==null;){if(t.tag===3){fh(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ea===null||!ea.has(a))){e=Ft(l,e),l=hf(2),a=Kl(t,l,2),a!==null&&(mf(l,a,t,e),An(a,2),fl(a));break}}t=t.return}}function Iu(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Uy;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(l)||(Gu=!0,s.add(l),e=Ly.bind(null,e,t,l),t.then(e,e))}function Ly(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ye===e&&(xe&l)===l&&(We===4||We===3&&(xe&62914560)===xe&&300>Mt()-js?(ze&2)===0&&fn(e,0):Vu|=l,on===xe&&(on=0)),fl(e)}function hh(e,t){t===0&&(t=io()),e=pa(e,t),e!==null&&(An(e,t),fl(e))}function Yy(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),hh(e,l)}function Gy(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(l=s.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}a!==null&&a.delete(t),hh(e,l)}function Vy(e,t){return oc(e,t)}var As=null,mn=null,Wu=!1,Es=!1,Pu=!1,aa=0;function fl(e){e!==mn&&e.next===null&&(mn===null?As=mn=e:mn=mn.next=e),Es=!0,Wu||(Wu=!0,Xy())}function ci(e,t){if(!Pu&&Es){Pu=!0;do for(var l=!1,a=As;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var c=0;else{var o=a.suspendedLanes,y=a.pingedLanes;c=(1<<31-qt(42|e)+1)-1,c&=s&~(o&~y),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,gh(a,c))}else c=xe,c=zi(a,a===Ye?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(c&3)===0||Tn(a,c)||(l=!0,gh(a,c));a=a.next}while(l);Pu=!1}}function Qy(){mh()}function mh(){Es=Wu=!1;var e=0;aa!==0&&lg()&&(e=aa);for(var t=Mt(),l=null,a=As;a!==null;){var s=a.next,c=vh(a,t);c===0?(a.next=null,l===null?As=s:l.next=s,s===null&&(mn=l)):(l=a,(e!==0||(c&3)!==0)&&(Es=!0)),a=s}ct!==0&&ct!==5||ci(e),aa!==0&&(aa=0)}function vh(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var o=31-qt(c),y=1<<o,x=s[o];x===-1?((y&l)===0||(y&a)!==0)&&(s[o]=bv(y,t)):x<=t&&(e.expiredLanes|=y),c&=~y}if(t=Ye,l=xe,l=zi(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&dc(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Tn(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&dc(a),mc(l)){case 2:case 8:l=ao;break;case 32:l=Ei;break;case 268435456:l=no;break;default:l=Ei}return a=yh.bind(null,e),l=oc(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&dc(a),e.callbackPriority=2,e.callbackNode=null,2}function yh(e,t){if(ct!==0&&ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Ts()&&e.callbackNode!==l)return null;var a=xe;return a=zi(e,e===Ye?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(If(e,a,t),vh(e,Mt()),e.callbackNode!=null&&e.callbackNode===l?yh.bind(null,e):null)}function gh(e,t){if(Ts())return null;If(e,t,!0)}function Xy(){ng(function(){(ze&6)!==0?oc(lo,Qy):mh()})}function er(){if(aa===0){var e=Wa;e===0&&(e=Ci,Ci<<=1,(Ci&261888)===0&&(Ci=256)),aa=e}return aa}function bh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ui(""+e)}function ph(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Zy(e,t,l,a,s){if(t==="submit"&&l&&l.stateNode===s){var c=bh((s[Nt]||null).action),o=a.submitter;o&&(t=(t=o[Nt]||null)?bh(t.formAction):o.getAttribute("formAction"),t!==null&&(c=t,o=null));var y=new Hi("action","action",null,a,s);e.push({event:y,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(aa!==0){var x=o?ph(s,o):new FormData(s);ju(l,{pending:!0,data:x,method:s.method,action:c},null,x)}}else typeof c=="function"&&(y.preventDefault(),x=o?ph(s,o):new FormData(s),ju(l,{pending:!0,data:x,method:s.method,action:c},c,x))},currentTarget:s}]})}}for(var tr=0;tr<qc.length;tr++){var lr=qc[tr],Ky=lr.toLowerCase(),Jy=lr[0].toUpperCase()+lr.slice(1);nl(Ky,"on"+Jy)}nl(Jo,"onAnimationEnd"),nl(Fo,"onAnimationIteration"),nl(Io,"onAnimationStart"),nl("dblclick","onDoubleClick"),nl("focusin","onFocus"),nl("focusout","onBlur"),nl(dy,"onTransitionRun"),nl(fy,"onTransitionStart"),nl(hy,"onTransitionCancel"),nl(Wo,"onTransitionEnd"),Ba("onMouseEnter",["mouseout","mouseover"]),Ba("onMouseLeave",["mouseout","mouseover"]),Ba("onPointerEnter",["pointerout","pointerover"]),Ba("onPointerLeave",["pointerout","pointerover"]),va("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),va("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),va("onBeforeInput",["compositionend","keypress","textInput","paste"]),va("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),va("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),va("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ui="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(" "),Fy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ui));function jh(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],s=a.event;a=a.listeners;e:{var c=void 0;if(t)for(var o=a.length-1;0<=o;o--){var y=a[o],x=y.instance,C=y.currentTarget;if(y=y.listener,x!==c&&s.isPropagationStopped())break e;c=y,s.currentTarget=C;try{c(s)}catch(q){Gi(q)}s.currentTarget=null,c=x}else for(o=0;o<a.length;o++){if(y=a[o],x=y.instance,C=y.currentTarget,y=y.listener,x!==c&&s.isPropagationStopped())break e;c=y,s.currentTarget=C;try{c(s)}catch(q){Gi(q)}s.currentTarget=null,c=x}}}}function pe(e,t){var l=t[vc];l===void 0&&(l=t[vc]=new Set);var a=e+"__bubble";l.has(a)||(xh(t,e,2,!1),l.add(a))}function ar(e,t,l){var a=0;t&&(a|=4),xh(l,e,a,t)}var Cs="_reactListening"+Math.random().toString(36).slice(2);function nr(e){if(!e[Cs]){e[Cs]=!0,ho.forEach(function(l){l!=="selectionchange"&&(Fy.has(l)||ar(l,!1,e),ar(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cs]||(t[Cs]=!0,ar("selectionchange",!1,t))}}function xh(e,t,l,a){switch(Fh(t)){case 2:var s=_g;break;case 8:s=Ng;break;default:s=pr}l=s.bind(null,t,l,e),s=void 0,!_c||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),a?s!==void 0?e.addEventListener(t,l,{capture:!0,passive:s}):e.addEventListener(t,l,!0):s!==void 0?e.addEventListener(t,l,{passive:s}):e.addEventListener(t,l,!1)}function ir(e,t,l,a,s){var c=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var o=a.tag;if(o===3||o===4){var y=a.stateNode.containerInfo;if(y===s)break;if(o===4)for(o=a.return;o!==null;){var x=o.tag;if((x===3||x===4)&&o.stateNode.containerInfo===s)return;o=o.return}for(;y!==null;){if(o=Ma(y),o===null)return;if(x=o.tag,x===5||x===6||x===26||x===27){a=c=o;continue e}y=y.parentNode}}a=a.return}No(function(){var C=c,q=Sc(l),H=[];e:{var z=Po.get(e);if(z!==void 0){var R=Hi,I=e;switch(e){case"keypress":if(Bi(l)===0)break e;case"keydown":case"keyup":R=Gv;break;case"focusin":I="focus",R=Ec;break;case"focusout":I="blur",R=Ec;break;case"beforeblur":case"afterblur":R=Ec;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":R=Eo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":R=Dv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":R=Xv;break;case Jo:case Fo:case Io:R=wv;break;case Wo:R=Kv;break;case"scroll":case"scrollend":R=Cv;break;case"wheel":R=Fv;break;case"copy":case"cut":case"paste":R=Uv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":R=Oo;break;case"toggle":case"beforetoggle":R=Wv}var ie=(t&4)!==0,Le=!ie&&(e==="scroll"||e==="scrollend"),T=ie?z!==null?z+"Capture":null:z;ie=[];for(var k=C,E;k!==null;){var B=k;if(E=B.stateNode,B=B.tag,B!==5&&B!==26&&B!==27||E===null||T===null||(B=On(k,T),B!=null&&ie.push(ri(k,B,E))),Le)break;k=k.return}0<ie.length&&(z=new R(z,I,null,l,q),H.push({event:z,listeners:ie}))}}if((t&7)===0){e:{if(z=e==="mouseover"||e==="pointerover",R=e==="mouseout"||e==="pointerout",z&&l!==xc&&(I=l.relatedTarget||l.fromElement)&&(Ma(I)||I[wa]))break e;if((R||z)&&(z=q.window===q?q:(z=q.ownerDocument)?z.defaultView||z.parentWindow:window,R?(I=l.relatedTarget||l.toElement,R=C,I=I?Ma(I):null,I!==null&&(Le=v(I),ie=I.tag,I!==Le||ie!==5&&ie!==27&&ie!==6)&&(I=null)):(R=null,I=C),R!==I)){if(ie=Eo,B="onMouseLeave",T="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(ie=Oo,B="onPointerLeave",T="onPointerEnter",k="pointer"),Le=R==null?z:Cn(R),E=I==null?z:Cn(I),z=new ie(B,k+"leave",R,l,q),z.target=Le,z.relatedTarget=E,B=null,Ma(q)===C&&(ie=new ie(T,k+"enter",I,l,q),ie.target=E,ie.relatedTarget=Le,B=ie),Le=B,R&&I)t:{for(ie=Iy,T=R,k=I,E=0,B=T;B;B=ie(B))E++;B=0;for(var le=k;le;le=ie(le))B++;for(;0<E-B;)T=ie(T),E--;for(;0<B-E;)k=ie(k),B--;for(;E--;){if(T===k||k!==null&&T===k.alternate){ie=T;break t}T=ie(T),k=ie(k)}ie=null}else ie=null;R!==null&&Sh(H,z,R,ie,!1),I!==null&&Le!==null&&Sh(H,Le,I,ie,!0)}}e:{if(z=C?Cn(C):window,R=z.nodeName&&z.nodeName.toLowerCase(),R==="select"||R==="input"&&z.type==="file")var Te=Bo;else if(Uo(z))if($o)Te=uy;else{Te=sy;var ee=iy}else R=z.nodeName,!R||R.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?C&&jc(C.elementType)&&(Te=Bo):Te=cy;if(Te&&(Te=Te(e,C))){qo(H,Te,l,q);break e}ee&&ee(e,z,C),e==="focusout"&&C&&z.type==="number"&&C.memoizedProps.value!=null&&pc(z,"number",z.value)}switch(ee=C?Cn(C):window,e){case"focusin":(Uo(ee)||ee.contentEditable==="true")&&(Va=ee,wc=C,Bn=null);break;case"focusout":Bn=wc=Va=null;break;case"mousedown":Mc=!0;break;case"contextmenu":case"mouseup":case"dragend":Mc=!1,Zo(H,l,q);break;case"selectionchange":if(oy)break;case"keydown":case"keyup":Zo(H,l,q)}var fe;if(Oc)e:{switch(e){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else Ga?wo(e,l)&&(Se="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Se="onCompositionStart");Se&&(Do&&l.locale!=="ko"&&(Ga||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&Ga&&(fe=To()):(Ll=q,Nc="value"in Ll?Ll.value:Ll.textContent,Ga=!0)),ee=Os(C,Se),0<ee.length&&(Se=new Co(Se,e,null,l,q),H.push({event:Se,listeners:ee}),fe?Se.data=fe:(fe=Mo(l),fe!==null&&(Se.data=fe)))),(fe=ey?ty(e,l):ly(e,l))&&(Se=Os(C,"onBeforeInput"),0<Se.length&&(ee=new Co("onBeforeInput","beforeinput",null,l,q),H.push({event:ee,listeners:Se}),ee.data=fe)),Zy(H,e,C,l,q)}jh(H,t)})}function ri(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Os(e,t){for(var l=t+"Capture",a=[];e!==null;){var s=e,c=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||c===null||(s=On(e,l),s!=null&&a.unshift(ri(e,s,c)),s=On(e,t),s!=null&&a.push(ri(e,s,c))),e.tag===3)return a;e=e.return}return[]}function Iy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Sh(e,t,l,a,s){for(var c=t._reactName,o=[];l!==null&&l!==a;){var y=l,x=y.alternate,C=y.stateNode;if(y=y.tag,x!==null&&x===a)break;y!==5&&y!==26&&y!==27||C===null||(x=C,s?(C=On(l,c),C!=null&&o.unshift(ri(l,C,x))):s||(C=On(l,c),C!=null&&o.push(ri(l,C,x)))),l=l.return}o.length!==0&&e.push({event:t,listeners:o})}var Wy=/\r\n?/g,Py=/\u0000|\uFFFD/g;function kh(e){return(typeof e=="string"?e:""+e).replace(Wy,`
|
|
9
|
-
`).replace(Py,"")}function _h(e,t){return t=kh(t),kh(e)===t}function He(e,t,l,a,s,c){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ha(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ha(e,""+a);break;case"className":wi(e,"class",a);break;case"tabIndex":wi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":wi(e,l,a);break;case"style":ko(e,a,c);break;case"data":if(t!=="object"){wi(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Ui(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(l==="formAction"?(t!=="input"&&He(e,t,"name",s.name,s,null),He(e,t,"formEncType",s.formEncType,s,null),He(e,t,"formMethod",s.formMethod,s,null),He(e,t,"formTarget",s.formTarget,s,null)):(He(e,t,"encType",s.encType,s,null),He(e,t,"method",s.method,s,null),He(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Ui(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=pl);break;case"onScroll":a!=null&&pe("scroll",e);break;case"onScrollEnd":a!=null&&pe("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=Ui(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":pe("beforetoggle",e),pe("toggle",e),Ri(e,"popover",a);break;case"xlinkActuate":bl(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":bl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":bl(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":bl(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":bl(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":bl(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":bl(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":bl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":bl(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Ri(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Av.get(l)||l,Ri(e,l,a))}}function sr(e,t,l,a,s,c){switch(l){case"style":ko(e,a,c);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"children":typeof a=="string"?Ha(e,a):(typeof a=="number"||typeof a=="bigint")&&Ha(e,""+a);break;case"onScroll":a!=null&&pe("scroll",e);break;case"onScrollEnd":a!=null&&pe("scrollend",e);break;case"onClick":a!=null&&(e.onclick=pl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!mo.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),t=l.slice(2,s?l.length-7:void 0),c=e[Nt]||null,c=c!=null?c[l]:null,typeof c=="function"&&e.removeEventListener(t,c,s),typeof a=="function")){typeof c!="function"&&c!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,s);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):Ri(e,l,a)}}}function yt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":pe("error",e),pe("load",e);var a=!1,s=!1,c;for(c in l)if(l.hasOwnProperty(c)){var o=l[c];if(o!=null)switch(c){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:He(e,t,c,o,l,null)}}s&&He(e,t,"srcSet",l.srcSet,l,null),a&&He(e,t,"src",l.src,l,null);return;case"input":pe("invalid",e);var y=c=o=s=null,x=null,C=null;for(a in l)if(l.hasOwnProperty(a)){var q=l[a];if(q!=null)switch(a){case"name":s=q;break;case"type":o=q;break;case"checked":x=q;break;case"defaultChecked":C=q;break;case"value":c=q;break;case"defaultValue":y=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(137,t));break;default:He(e,t,a,q,l,null)}}po(e,c,y,x,C,o,s,!1);return;case"select":pe("invalid",e),a=o=c=null;for(s in l)if(l.hasOwnProperty(s)&&(y=l[s],y!=null))switch(s){case"value":c=y;break;case"defaultValue":o=y;break;case"multiple":a=y;default:He(e,t,s,y,l,null)}t=c,l=o,e.multiple=!!a,t!=null?$a(e,!!a,t,!1):l!=null&&$a(e,!!a,l,!0);return;case"textarea":pe("invalid",e),c=s=a=null;for(o in l)if(l.hasOwnProperty(o)&&(y=l[o],y!=null))switch(o){case"value":a=y;break;case"defaultValue":s=y;break;case"children":c=y;break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:He(e,t,o,y,l,null)}xo(e,a,s,c);return;case"option":for(x in l)l.hasOwnProperty(x)&&(a=l[x],a!=null)&&(x==="selected"?e.selected=a&&typeof a!="function"&&typeof a!="symbol":He(e,t,x,a,l,null));return;case"dialog":pe("beforetoggle",e),pe("toggle",e),pe("cancel",e),pe("close",e);break;case"iframe":case"object":pe("load",e);break;case"video":case"audio":for(a=0;a<ui.length;a++)pe(ui[a],e);break;case"image":pe("error",e),pe("load",e);break;case"details":pe("toggle",e);break;case"embed":case"source":case"link":pe("error",e),pe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(C in l)if(l.hasOwnProperty(C)&&(a=l[C],a!=null))switch(C){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:He(e,t,C,a,l,null)}return;default:if(jc(t)){for(q in l)l.hasOwnProperty(q)&&(a=l[q],a!==void 0&&sr(e,t,q,a,l,void 0));return}}for(y in l)l.hasOwnProperty(y)&&(a=l[y],a!=null&&He(e,t,y,a,l,null))}function eg(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,c=null,o=null,y=null,x=null,C=null,q=null;for(R in l){var H=l[R];if(l.hasOwnProperty(R)&&H!=null)switch(R){case"checked":break;case"value":break;case"defaultValue":x=H;default:a.hasOwnProperty(R)||He(e,t,R,null,a,H)}}for(var z in a){var R=a[z];if(H=l[z],a.hasOwnProperty(z)&&(R!=null||H!=null))switch(z){case"type":c=R;break;case"name":s=R;break;case"checked":C=R;break;case"defaultChecked":q=R;break;case"value":o=R;break;case"defaultValue":y=R;break;case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(r(137,t));break;default:R!==H&&He(e,t,z,R,a,H)}}bc(e,o,y,x,C,q,c,s);return;case"select":R=o=y=z=null;for(c in l)if(x=l[c],l.hasOwnProperty(c)&&x!=null)switch(c){case"value":break;case"multiple":R=x;default:a.hasOwnProperty(c)||He(e,t,c,null,a,x)}for(s in a)if(c=a[s],x=l[s],a.hasOwnProperty(s)&&(c!=null||x!=null))switch(s){case"value":z=c;break;case"defaultValue":y=c;break;case"multiple":o=c;default:c!==x&&He(e,t,s,c,a,x)}t=y,l=o,a=R,z!=null?$a(e,!!l,z,!1):!!a!=!!l&&(t!=null?$a(e,!!l,t,!0):$a(e,!!l,l?[]:"",!1));return;case"textarea":R=z=null;for(y in l)if(s=l[y],l.hasOwnProperty(y)&&s!=null&&!a.hasOwnProperty(y))switch(y){case"value":break;case"children":break;default:He(e,t,y,null,a,s)}for(o in a)if(s=a[o],c=l[o],a.hasOwnProperty(o)&&(s!=null||c!=null))switch(o){case"value":z=s;break;case"defaultValue":R=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(r(91));break;default:s!==c&&He(e,t,o,s,a,c)}jo(e,z,R);return;case"option":for(var I in l)z=l[I],l.hasOwnProperty(I)&&z!=null&&!a.hasOwnProperty(I)&&(I==="selected"?e.selected=!1:He(e,t,I,null,a,z));for(x in a)z=a[x],R=l[x],a.hasOwnProperty(x)&&z!==R&&(z!=null||R!=null)&&(x==="selected"?e.selected=z&&typeof z!="function"&&typeof z!="symbol":He(e,t,x,z,a,R));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 ie in l)z=l[ie],l.hasOwnProperty(ie)&&z!=null&&!a.hasOwnProperty(ie)&&He(e,t,ie,null,a,z);for(C in a)if(z=a[C],R=l[C],a.hasOwnProperty(C)&&z!==R&&(z!=null||R!=null))switch(C){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(r(137,t));break;default:He(e,t,C,z,a,R)}return;default:if(jc(t)){for(var Le in l)z=l[Le],l.hasOwnProperty(Le)&&z!==void 0&&!a.hasOwnProperty(Le)&&sr(e,t,Le,void 0,a,z);for(q in a)z=a[q],R=l[q],!a.hasOwnProperty(q)||z===R||z===void 0&&R===void 0||sr(e,t,q,z,a,R);return}}for(var T in l)z=l[T],l.hasOwnProperty(T)&&z!=null&&!a.hasOwnProperty(T)&&He(e,t,T,null,a,z);for(H in a)z=a[H],R=l[H],!a.hasOwnProperty(H)||z===R||z==null&&R==null||He(e,t,H,z,a,R)}function Nh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var s=l[a],c=s.transferSize,o=s.initiatorType,y=s.duration;if(c&&y&&Nh(o)){for(o=0,y=s.responseEnd,a+=1;a<l.length;a++){var x=l[a],C=x.startTime;if(C>y)break;var q=x.transferSize,H=x.initiatorType;q&&Nh(H)&&(x=x.responseEnd,o+=q*(x<y?1:(y-C)/(x-C)))}if(--a,t+=8*(c+o)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var cr=null,ur=null;function Ds(e){return e.nodeType===9?e:e.ownerDocument}function Th(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ah(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function rr(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var or=null;function lg(){var e=window.event;return e&&e.type==="popstate"?e===or?!1:(or=e,!0):(or=null,!1)}var Eh=typeof setTimeout=="function"?setTimeout:void 0,ag=typeof clearTimeout=="function"?clearTimeout:void 0,Ch=typeof Promise=="function"?Promise:void 0,ng=typeof queueMicrotask=="function"?queueMicrotask:typeof Ch<"u"?function(e){return Ch.resolve(null).then(e).catch(ig)}:Eh;function ig(e){setTimeout(function(){throw e})}function na(e){return e==="head"}function Oh(e,t){var l=t,a=0;do{var s=l.nextSibling;if(e.removeChild(l),s&&s.nodeType===8)if(l=s.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(s),bn(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")oi(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,oi(l);for(var c=l.firstChild;c;){var o=c.nextSibling,y=c.nodeName;c[En]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&c.rel.toLowerCase()==="stylesheet"||l.removeChild(c),c=o}}else l==="body"&&oi(e.ownerDocument.body);l=s}while(l);bn(t)}function Dh(e,t){var l=e;e=0;do{var a=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function dr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":dr(l),yc(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function sg(e,t,l,a){for(;e.nodeType===1;){var s=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[En])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=tl(e.nextSibling),e===null)break}return null}function cg(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=tl(e.nextSibling),e===null))return null;return e}function zh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=tl(e.nextSibling),e===null))return null;return e}function fr(e){return e.data==="$?"||e.data==="$~"}function hr(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ug(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function tl(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var mr=null;function Rh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return tl(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function wh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Mh(e,t,l){switch(t=Ds(l),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function oi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);yc(e)}var ll=new Map,Uh=new Set;function zs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ml=G.d;G.d={f:rg,r:og,D:dg,C:fg,L:hg,m:mg,X:yg,S:vg,M:gg};function rg(){var e=Ml.f(),t=ks();return e||t}function og(e){var t=Ua(e);t!==null&&t.tag===5&&t.type==="form"?Wd(t):Ml.r(e)}var vn=typeof document>"u"?null:document;function qh(e,t,l){var a=vn;if(a&&typeof t=="string"&&t){var s=Kt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Uh.has(s)||(Uh.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),yt(t,"link",e),rt(t),a.head.appendChild(t)))}}function dg(e){Ml.D(e),qh("dns-prefetch",e,null)}function fg(e,t){Ml.C(e,t),qh("preconnect",e,t)}function hg(e,t,l){Ml.L(e,t,l);var a=vn;if(a&&e&&t){var s='link[rel="preload"][as="'+Kt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Kt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Kt(l.imageSizes)+'"]')):s+='[href="'+Kt(e)+'"]';var c=s;switch(t){case"style":c=yn(e);break;case"script":c=gn(e)}ll.has(c)||(e=p({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),ll.set(c,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(di(c))||t==="script"&&a.querySelector(fi(c))||(t=a.createElement("link"),yt(t,"link",e),rt(t),a.head.appendChild(t)))}}function mg(e,t){Ml.m(e,t);var l=vn;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Kt(a)+'"][href="'+Kt(e)+'"]',c=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=gn(e)}if(!ll.has(c)&&(e=p({rel:"modulepreload",href:e},t),ll.set(c,e),l.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(fi(c)))return}a=l.createElement("link"),yt(a,"link",e),rt(a),l.head.appendChild(a)}}}function vg(e,t,l){Ml.S(e,t,l);var a=vn;if(a&&e){var s=qa(a).hoistableStyles,c=yn(e);t=t||"default";var o=s.get(c);if(!o){var y={loading:0,preload:null};if(o=a.querySelector(di(c)))y.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":t},l),(l=ll.get(c))&&vr(e,l);var x=o=a.createElement("link");rt(x),yt(x,"link",e),x._p=new Promise(function(C,q){x.onload=C,x.onerror=q}),x.addEventListener("load",function(){y.loading|=1}),x.addEventListener("error",function(){y.loading|=2}),y.loading|=4,Rs(o,t,a)}o={type:"stylesheet",instance:o,count:1,state:y},s.set(c,o)}}}function yg(e,t){Ml.X(e,t);var l=vn;if(l&&e){var a=qa(l).hoistableScripts,s=gn(e),c=a.get(s);c||(c=l.querySelector(fi(s)),c||(e=p({src:e,async:!0},t),(t=ll.get(s))&&yr(e,t),c=l.createElement("script"),rt(c),yt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(s,c))}}function gg(e,t){Ml.M(e,t);var l=vn;if(l&&e){var a=qa(l).hoistableScripts,s=gn(e),c=a.get(s);c||(c=l.querySelector(fi(s)),c||(e=p({src:e,async:!0,type:"module"},t),(t=ll.get(s))&&yr(e,t),c=l.createElement("script"),rt(c),yt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(s,c))}}function Bh(e,t,l,a){var s=(s=X.current)?zs(s):null;if(!s)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=yn(l.href),l=qa(s).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=yn(l.href);var c=qa(s).hoistableStyles,o=c.get(e);if(o||(s=s.ownerDocument||s,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,o),(c=s.querySelector(di(e)))&&!c._p&&(o.instance=c,o.state.loading=5),ll.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ll.set(e,l),c||bg(s,e,l,o.state))),t&&a===null)throw Error(r(528,""));return o}if(t&&a!==null)throw Error(r(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=gn(l),l=qa(s).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function yn(e){return'href="'+Kt(e)+'"'}function di(e){return'link[rel="stylesheet"]['+e+"]"}function $h(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function bg(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),yt(t,"link",l),rt(t),e.head.appendChild(t))}function gn(e){return'[src="'+Kt(e)+'"]'}function fi(e){return"script[async]"+e}function Hh(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Kt(l.href)+'"]');if(a)return t.instance=a,rt(a),a;var s=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),rt(a),yt(a,"style",s),Rs(a,l.precedence,e),t.instance=a;case"stylesheet":s=yn(l.href);var c=e.querySelector(di(s));if(c)return t.state.loading|=4,t.instance=c,rt(c),c;a=$h(l),(s=ll.get(s))&&vr(a,s),c=(e.ownerDocument||e).createElement("link"),rt(c);var o=c;return o._p=new Promise(function(y,x){o.onload=y,o.onerror=x}),yt(c,"link",a),t.state.loading|=4,Rs(c,l.precedence,e),t.instance=c;case"script":return c=gn(l.src),(s=e.querySelector(fi(c)))?(t.instance=s,rt(s),s):(a=l,(s=ll.get(c))&&(a=p({},l),yr(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),rt(s),yt(s,"link",a),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Rs(a,l.precedence,e));return t.instance}function Rs(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,c=s,o=0;o<a.length;o++){var y=a[o];if(y.dataset.precedence===t)c=y;else if(c!==s)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function vr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function yr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ws=null;function Lh(e,t,l){if(ws===null){var a=new Map,s=ws=new Map;s.set(l,a)}else s=ws,a=s.get(l),a||(a=new Map,s.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),s=0;s<l.length;s++){var c=l[s];if(!(c[En]||c[ft]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var o=c.getAttribute(t)||"";o=e+o;var y=a.get(o);y?y.push(c):a.set(o,[c])}}return a}function Yh(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function pg(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Gh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function jg(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var s=yn(a.href),c=t.querySelector(di(s));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ms.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,rt(c);return}c=t.ownerDocument||t,a=$h(a),(s=ll.get(s))&&vr(a,s),c=c.createElement("link"),rt(c);var o=c;o._p=new Promise(function(y,x){o.onload=y,o.onerror=x}),yt(c,"link",a),l.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Ms.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var gr=0;function xg(e,t){return e.stylesheets&&e.count===0&&qs(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&qs(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&gr===0&&(gr=62500*tg());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&qs(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>gr?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function Ms(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Us=null;function qs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Us=new Map,t.forEach(Sg,e),Us=null,Ms.call(e))}function Sg(e,t){if(!(t.state.loading&4)){var l=Us.get(e);if(l)var a=l.get(null);else{l=new Map,Us.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<s.length;c++){var o=s[c];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(l.set(o.dataset.precedence,o),a=o)}a&&l.set(null,a)}s=t.instance,o=s.getAttribute("data-precedence"),c=l.get(o)||a,c===a&&l.set(null,s),l.set(o,s),this.count++,a=Ms.bind(this),s.addEventListener("load",a),s.addEventListener("error",a),c?c.parentNode.insertBefore(s,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var hi={$$typeof:J,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function kg(e,t,l,a,s,c,o,y,x){this.tag=1,this.containerInfo=e,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=fc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fc(0),this.hiddenUpdates=fc(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=c,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=x,this.incompleteTransitions=new Map}function Vh(e,t,l,a,s,c,o,y,x,C,q,H){return e=new kg(e,t,l,o,x,C,q,H,y),t=1,c===!0&&(t|=24),c=$t(3,null,null,t),e.current=c,c.stateNode=e,t=Fc(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:a,isDehydrated:l,cache:t},eu(c),e}function Qh(e){return e?(e=Za,e):Za}function Xh(e,t,l,a,s,c){s=Qh(s),a.context===null?a.context=s:a.pendingContext=s,a=Zl(t),a.payload={element:l},c=c===void 0?null:c,c!==null&&(a.callback=c),l=Kl(e,a,t),l!==null&&(Dt(l,e,t),Qn(l,e,t))}function Zh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function br(e,t){Zh(e,t),(e=e.alternate)&&Zh(e,t)}function Kh(e){if(e.tag===13||e.tag===31){var t=pa(e,67108864);t!==null&&Dt(t,e,67108864),br(e,67108864)}}function Jh(e){if(e.tag===13||e.tag===31){var t=Vt();t=hc(t);var l=pa(e,t);l!==null&&Dt(l,e,t),br(e,t)}}var Bs=!0;function _g(e,t,l,a){var s=M.T;M.T=null;var c=G.p;try{G.p=2,pr(e,t,l,a)}finally{G.p=c,M.T=s}}function Ng(e,t,l,a){var s=M.T;M.T=null;var c=G.p;try{G.p=8,pr(e,t,l,a)}finally{G.p=c,M.T=s}}function pr(e,t,l,a){if(Bs){var s=jr(a);if(s===null)ir(e,t,a,$s,l),Ih(e,a);else if(Ag(s,e,t,l,a))a.stopPropagation();else if(Ih(e,a),t&4&&-1<Tg.indexOf(e)){for(;s!==null;){var c=Ua(s);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var o=ma(c.pendingLanes);if(o!==0){var y=c;for(y.pendingLanes|=2,y.entangledLanes|=2;o;){var x=1<<31-qt(o);y.entanglements[1]|=x,o&=~x}fl(c),(ze&6)===0&&(xs=Mt()+500,ci(0))}}break;case 31:case 13:y=pa(c,2),y!==null&&Dt(y,c,2),ks(),br(c,2)}if(c=jr(a),c===null&&ir(e,t,a,$s,l),c===s)break;s=c}s!==null&&a.stopPropagation()}else ir(e,t,a,null,l)}}function jr(e){return e=Sc(e),xr(e)}var $s=null;function xr(e){if($s=null,e=Ma(e),e!==null){var t=v(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=b(t),e!==null)return e;e=null}else if(l===31){if(e=g(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return $s=e,null}function Fh(e){switch(e){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(dv()){case lo:return 2;case ao:return 8;case Ei:case fv:return 32;case no:return 268435456;default:return 32}default:return 32}}var Sr=!1,ia=null,sa=null,ca=null,mi=new Map,vi=new Map,ua=[],Tg="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 Ih(e,t){switch(e){case"focusin":case"focusout":ia=null;break;case"dragenter":case"dragleave":sa=null;break;case"mouseover":case"mouseout":ca=null;break;case"pointerover":case"pointerout":mi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vi.delete(t.pointerId)}}function yi(e,t,l,a,s,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:c,targetContainers:[s]},t!==null&&(t=Ua(t),t!==null&&Kh(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Ag(e,t,l,a,s){switch(t){case"focusin":return ia=yi(ia,e,t,l,a,s),!0;case"dragenter":return sa=yi(sa,e,t,l,a,s),!0;case"mouseover":return ca=yi(ca,e,t,l,a,s),!0;case"pointerover":var c=s.pointerId;return mi.set(c,yi(mi.get(c)||null,e,t,l,a,s)),!0;case"gotpointercapture":return c=s.pointerId,vi.set(c,yi(vi.get(c)||null,e,t,l,a,s)),!0}return!1}function Wh(e){var t=Ma(e.target);if(t!==null){var l=v(t);if(l!==null){if(t=l.tag,t===13){if(t=b(l),t!==null){e.blockedOn=t,oo(e.priority,function(){Jh(l)});return}}else if(t===31){if(t=g(l),t!==null){e.blockedOn=t,oo(e.priority,function(){Jh(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=jr(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);xc=a,l.target.dispatchEvent(a),xc=null}else return t=Ua(l),t!==null&&Kh(t),e.blockedOn=l,!1;t.shift()}return!0}function Ph(e,t,l){Hs(e)&&l.delete(t)}function Eg(){Sr=!1,ia!==null&&Hs(ia)&&(ia=null),sa!==null&&Hs(sa)&&(sa=null),ca!==null&&Hs(ca)&&(ca=null),mi.forEach(Ph),vi.forEach(Ph)}function Ls(e,t){e.blockedOn===t&&(e.blockedOn=null,Sr||(Sr=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Eg)))}var Ys=null;function em(e){Ys!==e&&(Ys=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ys===e&&(Ys=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],s=e[t+2];if(typeof a!="function"){if(xr(a||l)===null)continue;break}var c=Ua(l);c!==null&&(e.splice(t,3),t-=3,ju(c,{pending:!0,data:s,method:l.method,action:a},a,s))}}))}function bn(e){function t(x){return Ls(x,e)}ia!==null&&Ls(ia,e),sa!==null&&Ls(sa,e),ca!==null&&Ls(ca,e),mi.forEach(t),vi.forEach(t);for(var l=0;l<ua.length;l++){var a=ua[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<ua.length&&(l=ua[0],l.blockedOn===null);)Wh(l),l.blockedOn===null&&ua.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var s=l[a],c=l[a+1],o=s[Nt]||null;if(typeof c=="function")o||em(l);else if(o){var y=null;if(c&&c.hasAttribute("formAction")){if(s=c,o=c[Nt]||null)y=o.formAction;else if(xr(s)!==null)continue}else y=o.action;typeof y=="function"?l[a+1]=y:(l.splice(a,3),a-=3),em(l)}}}function tm(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(o){return s=o})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function kr(e){this._internalRoot=e}Gs.prototype.render=kr.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var l=t.current,a=Vt();Xh(l,a,e,t,null,null)},Gs.prototype.unmount=kr.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Xh(e.current,2,null,e,null,null),ks(),t[wa]=null}};function Gs(e){this._internalRoot=e}Gs.prototype.unstable_scheduleHydration=function(e){if(e){var t=ro();e={blockedOn:null,target:e,priority:t};for(var l=0;l<ua.length&&t!==0&&t<ua[l].priority;l++);ua.splice(l,0,e),l===0&&Wh(e)}};var lm=u.version;if(lm!=="19.2.0")throw Error(r(527,lm,"19.2.0"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=h(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var Cg={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vs.isDisabled&&Vs.supportsFiber)try{Nn=Vs.inject(Cg),Ut=Vs}catch{}}return bi.createRoot=function(e,t){if(!f(e))throw Error(r(299));var l=!1,a="",s=rf,c=of,o=df;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Vh(e,1,!1,null,null,l,a,null,s,c,o,tm),e[wa]=t.current,nr(e),new kr(t)},bi.hydrateRoot=function(e,t,l){if(!f(e))throw Error(r(299));var a=!1,s="",c=rf,o=of,y=df,x=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(c=l.onUncaughtError),l.onCaughtError!==void 0&&(o=l.onCaughtError),l.onRecoverableError!==void 0&&(y=l.onRecoverableError),l.formState!==void 0&&(x=l.formState)),t=Vh(e,1,!0,t,l??null,a,s,x,c,o,y,tm),t.context=Qh(null),l=t.current,a=Vt(),a=hc(a),s=Zl(a),s.callback=null,Kl(l,s,a),l=a,t.current.lanes=l,An(t,l),fl(t),e[wa]=t.current,nr(e),new Gs(t)},bi.version="19.2.0",bi}var fm;function $g(){if(fm)return Tr.exports;fm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(u){console.error(u)}}return n(),Tr.exports=Bg(),Tr.exports}var Hg=$g();const Ks="feltkit.admin-token";function Lg(){const n=/(?:^|[#&])token=([^&]+)/.exec(location.hash);if(n){try{sessionStorage.setItem(Ks,decodeURIComponent(n[1]))}catch{}return history.replaceState(null,"",`${location.pathname}#/overview`),decodeURIComponent(n[1])}try{return sessionStorage.getItem(Ks)}catch{return null}}function hm(n){try{n?sessionStorage.setItem(Ks,n):sessionStorage.removeItem(Ks)}catch{}}class mm extends Error{constructor(u,d,r){super(d),this.code=u,this.status=r}code;status}let Em=null;const Or=n=>Em=n;let Xs=null;const Dr=n=>Xs=n;function Cm(n){return Xs?n?{"x-feltkit-csrf":Xs.csrf,"x-feltkit-environment":Xs.environment}:{}:{"x-feltkit-admin":Em??""}}async function ae(n,u={}){const d=await fetch(`/_feltkit/api${n}`,{...u,credentials:"same-origin",headers:{...Cm(!!(u.method&&u.method!=="GET")),...u.body?{"Content-Type":"application/json"}:{},...u.headers??{}}});let r;try{r=await d.json()}catch{throw new mm("UNAVAILABLE",`The server answered ${d.status}.`,d.status)}if(!d.ok)throw new mm(r?.error?.code??"INTERNAL",r?.error?.message??`Request failed (${d.status})`,d.status);return r}function Yg(n,u){const d=new AbortController;return(async()=>{let r=500;for(;!d.signal.aborted;){try{const f=await fetch("/_feltkit/api/events",{credentials:"same-origin",headers:Cm(!1),signal:d.signal});if(!f.ok||!f.body)throw new Error(String(f.status));u(!0),r=500;const v=f.body.getReader(),b=new TextDecoder;let g="";for(;;){const{value:m,done:h}=await v.read();if(h)break;g+=b.decode(m,{stream:!0});let S;for(;(S=g.indexOf(`
|
|
10
|
-
|
|
11
|
-
`))>=0;){const p=g.slice(0,S);g=g.slice(S+2);const N=/^event: (.+)$/m.exec(p)?.[1],O=/^data: (.+)$/m.exec(p)?.[1];N&&O&&n(N,JSON.parse(O))}}}catch{}if(u(!1),d.signal.aborted)break;await new Promise(f=>setTimeout(f,r)),r=Math.min(r*2,8e3)}})(),()=>d.abort()}function ec(n){const u=!!n?.environment?.development,r=(n?.operator?.permissions??[]).some(f=>f==="*"||f==="feltkit.*"||f==="feltkit.operations.*"||f==="feltkit.operations.write");return{development:u,canAct:u||r,actor:n?.operator?.principal?.id??null}}const Mr=Object.freeze({positive:"●",progress:"◐",attention:"▲",critical:"✕",neutral:"○",unknown:"?"}),Gg=Object.freeze(["verified","verification_failed","not_verified","not_evaluated"]);function Om(n){const u=String(n).replace(/_/g," ");return u&&u[0].toUpperCase()+u.slice(1)}const ve="positive",ce="progress",zt="attention",we="critical",Re="neutral",oa="unknown",Vg={"compute.environment.actual_state":{running:ve,completed:ve,pending:ce,starting:ce,stopping:ce,degraded:zt,failed:we,denied:we,stopped:Re},"compute.health":{healthy:ve,unhealthy:we,unknown:oa},"compute.environment.readiness":{ready:ve,created:ce,starting:ce,degraded:zt,failed:we,unavailable:we},"compute.process.readiness":{ready:ve,starting:ce,unready:zt},"compute.process.state":{ready:ve,running:ve,pending:ce,starting:ce,stopping:ce,unready:zt,failed:we,lost:we,stopped:Re,exited:Re,destroyed:Re,expired:Re,unverified:oa,unreachable:oa},"compute.deployment.status":{active:ve,complete:ve,pending:ce,starting:ce,ready:ce,network_ready:ce,switching:ce,draining:ce,failed:we,rolled_back:we},"compute.version.status":{published:ve,publishing:ce,failed:we},"compute.rollout.status":{active:ve,applying:ce,failed:we,superseded:Re},"compute.job.status":{succeeded:ve,created:ce,accepted:ce,queued:ce,waiting_for_capacity:ce,reserved:ce,admitted:ce,preparing:ce,running:ce,failed:we,rejected:we,timed_out:we,cancelled:Re},"compute.computer.observed":{running:ve,starting:ce,reconciling:ce,stopping:ce,failed:we,lost:we,stopped:Re,destroyed:Re,expired:Re,unverified:oa,unreachable:oa},"compute.computer.status":{running:ve,pending:ce,provisioning:ce,resuming:ce,stopping:ce,destroying:ce,failed:we,lost:we,stopped:Re,destroyed:Re,expired:Re,unreachable:oa},"feltdb.health.ready_state":{healthy:ve,recovering:ce,degraded:zt,unavailable:we},"feltdb.authority.availability":{available:ve,recovering:ce,degraded:zt,closed:Re,unknown:oa},"feltdb.authority.lease_clock_healthy":{true:[ve,"Healthy"],false:[zt,"Degraded"]},"authboundry.decision.live":{allow:[ve,"Allow"],deny:[we,"Deny"]},"authboundry.decision.recorded":{allow:[ve,"Allow"],deny:[Re,"Deny"]},"authboundry.delegation.status":{active:ve,pending:ce,revoked:we,expired:Re},"authboundry.application.status":{active:ve,awaiting_contract:ce,disabled:Re},"authboundry.studio.attached":{true:[ve,"Attached"],false:[zt,"Not attached"]},"authboundry.studio.protection":{active:[ve,"Active"],inactive:[Re,"Inactive"],unreachable:[zt,"Upstream unreachable"]},"appport.job.status":{completed:ve,scheduled:ce,pending:ce,running:ce,retrying:ce,failed:we},"appport.notification.status":{delivered:ve,pending:ce,failed:we,read:Re,acknowledged:Re,expired:Re},"appport.api_key.revoked":{false:[ve,"Active"],true:[Re,"Revoked"]},"appport.webhook.disabled":{false:[ve,"Enabled"],true:[Re,"Disabled"]},"appport.schedule.enabled":{true:[ve,"Enabled"],false:[Re,"Disabled"]},"appport.configuration.secret.configured":{true:[ve,"Configured"]},"appboundry.lifecycle.phase":{ACTIVE:[ve,"Active"],DRAFT:[ce,"Draft"],VALIDATED:[ce,"Validated"],REGISTERED:[ce,"Registered"],CHANGE_PROPOSED:[zt,"Change proposed"],RETIRED:[Re,"Retired"]},"appboundry.provider.compatible":{true:[ve,"Compatible"],false:[zt,"Incompatible"]},"appboundry.execution.status":{succeeded:ve,running:ce,failed:we,timed_out:[we,"Timed out"],cancelled:Re},"appboundry.source.status":{connected:ve,stale:zt,failed:we,disconnected:Re},"appboundry.implementation.status":{verified:[ve,"Current"],stale:zt,revoked:we},"appboundry.provider.eligibility":{ELIGIBLE:[ve,"Eligible"],INELIGIBLE:[Re,"Ineligible"]},"appboundry.deployment.status":{running:ve,available:Re,stopped:Re},"appboundry.deployment.step":{complete:ve,failed:we,pending:[Re,"Not run"]},"appboundry.health.ready":{true:[ve,"Ready"],false:[we,"Not ready"]},"appboundry.health.check":{available:ve,degraded:zt,unavailable:we}},Qg={"feltdb.revision.integrity_verified":{true:"verified",false:"verification_failed"},"appboundry.implementation.verification":{verified:"verified",stale:"not_verified"},"appboundry.attestation.status":{verified:"verified",CONTRACT_MISMATCH:"verification_failed",IDENTITY_MISMATCH:"verification_failed"},"appboundry.conformance.status":{CONFORMING:"verified",NON_CONFORMING:"verification_failed"}},Xg={"compute.response.state":{live:"live",cached:"cached",stale:"stale"},"feltdb.snapshot.staleness":{current:"live",stale:"stale",unknown:"unknown"}},Gr=n=>Object.freeze(Object.fromEntries(Object.entries(n).map(([u,d])=>[u,Object.freeze({...d})]))),Zg=Gr(Vg);Gr(Qg);Gr(Xg);const Kg=(n,u)=>Object.prototype.hasOwnProperty.call(n,u);function Jg(n,u,d){const r=Zg[n];if(!r)throw new Error(`unknown field: ${n}`);const f=String(u),v=Kg(r,f)?r[f]:null,[b,g]=v===null?[oa,null]:Array.isArray(v)?v:[v,null],m=d&&d.label||g||(v===null?f:Om(f));return{field:n,value:f,tone:b,label:m,glyph:Mr[b],mapped:v!==null}}function Ur(n,u){const d=Fg(u);let r=Gg.includes(n)?n:"not_evaluated";return r==="verified"&&d.length===0&&(r="not_evaluated"),r==="verified"&&d.some(f=>f.status==="failed")&&(r="verification_failed"),{state:r,checks:d}}function Fg(n){return n?n.map(u=>typeof u=="string"?{label:u}:{label:String(u.label),...u.status?{status:u.status}:{}}):[]}const Ul=Object.freeze({company:Object.freeze({name:"Boundry",href:"https://boundry.company",tagline:"Infrastructure for applications and agents.",family:"Part of the Boundry family of products"}),products:Object.freeze([{id:"feltdb",name:"FeltDB",mark:"FD",category:"Durable state",href:"https://feltdb.com"},{id:"feltkit",name:"FeltKit",mark:"FK",category:"Developer platform",href:"https://getfeltkit.com"},{id:"appboundry",name:"AppBoundry",mark:"AB",category:"Application boundaries",href:"https://appboundry.com"},{id:"authboundry",name:"AuthBoundry",mark:"AU",category:"Authority and delegation",href:"https://authboundry.com"},{id:"appport",name:"AppPort",mark:"AP",category:"Application capabilities",href:"https://boundry.company/ecosystem/#appport"}].map(n=>Object.freeze(n)))});function qr(n){return Ul.products.find(u=>u.id===n)||null}const j=(n,u,d,r,f)=>({t:n,a:u||{},c:d===void 0?[]:[].concat(d),...r?{on:r}:{},...f==null?{}:{k:String(f)}}),Zs=n=>!!(n&&typeof n=="object"&&typeof n.t=="string"&&n.a&&Array.isArray(n.c)),he=(...n)=>n.filter(Boolean).join(" "),V=n=>n!=null&&n!=="",ye=n=>{const u={};for(const[d,r]of Object.entries(n||{}))(/^(data-|aria-)/.test(d)||d==="id"||d==="title")&&(u[d]=r);return u};function Ig(n){const u=new Date(n);return Number.isNaN(u.getTime())?String(n):`${u.toISOString().slice(0,19).replace("T"," ")} UTC`}const tc=(n,u)=>{const d=new Date(n);return Number.isNaN(d.getTime())?j("span",{class:u},String(n)):j("time",{class:u,datetime:d.toISOString()},Ig(n))};function Wg(n){const{field:u,value:d,detail:r,className:f,attrs:v}=n,b=u?Jg(u,d,{label:n.label}):null,g=b?b.tone:n.tone||"unknown",m=b?b.label:V(n.label)?n.label:Om(g),h=n.glyph||Mr[g]||Mr.unknown;return j("span",{class:he("stack-status",`stack-status--${g}`,f),"data-tone":g,...b?{"data-field":b.field,"data-value":b.value}:{},...ye(v)},[j("span",{class:"stack-status__glyph","aria-hidden":"true"},h),j("span",{class:"stack-status__label"},m),V(r)?j("span",{class:"stack-status__detail"},r):null])}const Pg={verified:"✓",verification_failed:"✕",not_verified:"!",not_evaluated:"–"};function Dm(n){const{state:u,checks:d}=Ur(n.state,n.checks),r=d.filter(v=>v.status==="failed");let f;if(u==="verified")f=d.length===1?`Verified · ${d[0].label}`:`Verified · ${d.length} checks`;else if(u==="verification_failed"){const v=r.length?r:d;f=v.length===1?`Verification failed · ${v[0].label}`:v.length?`Verification failed · ${v.length} checks`:"Verification failed"}else f=u==="not_verified"?"Not verified":"Not evaluated";return j("div",{class:he("stack-verification",`stack-verification--${u}`,n.className),"data-verification":u,...ye(n.attrs)},[j("span",{class:"stack-verification__glyph","aria-hidden":"true"},Pg[u]),j("span",{class:"stack-verification__label"},f),V(n.at)?[" · ",tc(n.at,"stack-verification__at")]:null,V(n.evidenceHref)?j("a",{class:"stack-verification__evidence",href:n.evidenceHref},"Evidence"):null,d.length>1?j("ul",{class:"stack-verification__checks"},d.map(v=>j("li",{class:"stack-verification__check",...v.status?{"data-check-status":v.status}:{}},v.status?`${v.label} — ${v.status}`:v.label))):null])}const vm={live:"Live",cached:"Cached",stale:"Stale",unknown:"Freshness unknown"},eb={live:"●",cached:"◷",stale:"▲",unknown:"?"};function tb(n){const u=vm[n.freshness]?n.freshness:"unknown",d=V(n.asOf)&&u!=="live";return j("span",{class:he("stack-freshness",`stack-freshness--${u}`,n.className),"data-freshness":u,...ye(n.attrs)},[j("span",{class:"stack-freshness__glyph","aria-hidden":"true"},eb[u]),j("span",{class:"stack-freshness__label"},[vm[u],d?[" · as of ",tc(n.asOf,"stack-freshness__as-of")]:null,V(n.source)?` · ${n.source}`:null])])}function lb(n){const u=n.status==="partial"?"partial":"unsupported",d=V(n.title)?n.title:u==="partial"?"Partly available":"Not available";return j("div",{class:he("stack-unavailable",`stack-unavailable--${u}`,n.className),role:"note","data-capability-status":u,...V(n.capability)?{"data-capability":n.capability}:{},...ye(n.attrs)},[j(n.headingLevel?lc(n.headingLevel):"p",{class:"stack-unavailable__title"},d),V(n.reason)?j("p",{class:"stack-unavailable__reason"},n.reason):null,n.children||null])}function Vr(n){const u=V(n.what)?n.what:"",d=n.long?`Still loading${u?` ${u}`:""}…`:`Loading${u?` ${u}`:""}…`;return j("div",{class:he("stack-loading",n.long?"stack-loading--long":null,n.className),role:"status","aria-live":"polite",...ye(n.attrs)},[j("span",{class:"stack-loading__indicator","aria-hidden":"true"}),j("span",{class:"stack-loading__label"},d)])}const lc=n=>`h${Math.min(6,Math.max(1,Number(n)||2))}`;function Qr(n){const u=n.variant==="no-match"?"no-match":"empty",d=V(n.title)?n.title:u==="no-match"?"Nothing matches":"Nothing here yet";return j("div",{class:he("stack-empty",`stack-empty--${u}`,n.className),...ye(n.attrs)},[j(lc(n.headingLevel),{class:"stack-empty__title"},d),V(n.body)?j("p",{class:"stack-empty__body"},n.body):null,n.action?j("div",{class:"stack-empty__action"},n.action):null])}function ac(n){const u=[V(n.code)?["Code ",j("code",{},n.code)]:null,V(n.requestId)?[V(n.code)?" · ":"","Request ",j("code",{},n.requestId)]:null].filter(Boolean);return j("div",{class:he("stack-error",n.className),role:"alert",...ye(n.attrs)},[j("p",{class:"stack-error__title"},V(n.title)?n.title:"Something went wrong"),V(n.message)?j("p",{class:"stack-error__message"},n.message):null,u.length?j("p",{class:"stack-error__meta"},u):null,n.onRetry||n.actions?j("div",{class:"stack-error__actions"},[n.onRetry?ml({label:n.retryLabel||"Retry",onClick:n.onRetry}):null,n.actions||null]):null])}function ab(n){return j("dl",{class:he("stack-meta",n.className),...ye(n.attrs)},(n.items||[]).map(u=>{const d=!V(u.value)&&u.value!==0&&u.value!==!1;return j("div",{class:"stack-meta__item",...ye(u.attrs)},[j("dt",{class:"stack-meta__label"},u.label),j("dd",{class:he("stack-meta__value",u.mono?"stack-meta__value--mono":null),...d?{"data-missing":"true"}:{}},d?"—":typeof u.value=="boolean"?String(u.value):u.value),V(u.hint)?j("dd",{class:"stack-meta__hint"},u.hint):null])}))}function nb(n){const u=Number(n.length)||12,d=V(n.id)?String(n.id):null,r=d&&d.length>u?`${d.slice(0,u)}…`:d,f=V(n.name)?j(n.href?"a":"span",{class:"stack-identity__name",...n.href?{href:n.href}:{}},n.name):null;return j("span",{class:he("stack-identity",n.className),...ye(n.attrs)},[V(n.kind)?j("span",{class:"stack-identity__kind"},n.kind):null,f,d?j("code",{class:"stack-identity__id",title:d},r===d?d:[j("span",{"aria-hidden":"true"},r),j("span",{class:"stack-visually-hidden"},d)]):null])}function ib(n){return j("header",{class:he("stack-page-header",n.className),...ye(n.attrs)},[V(n.eyebrow)?j("p",{class:"stack-page-header__eyebrow"},n.eyebrow):null,j("div",{class:"stack-page-header__title-row"},[j(lc(n.headingLevel||1),{class:"stack-page-header__title"},n.title),n.status?j("span",{class:"stack-page-header__status"},n.status):null,n.actions?j("div",{class:"stack-page-header__actions"},n.actions):null]),V(n.description)?j("p",{class:"stack-page-header__description"},n.description):null,n.meta?j("div",{class:"stack-page-header__meta"},n.meta):null])}const sb=["primary","secondary","danger","ghost"],cb=["sm","md","lg"];function ml(n){const u=sb.includes(n.variant)?n.variant:"secondary",d=cb.includes(n.size)?n.size:"md",r=!!(n.disabled||n.busy);return j("button",{class:he("stack-button",`stack-button--${u}`,`stack-button--${d}`,n.className),type:n.type==="submit"?"submit":"button",...r?{disabled:!0}:{},...n.busy?{"aria-busy":"true"}:{},...ye(n.attrs)},[n.busy?j("span",{class:"stack-button__busy","aria-hidden":"true"}):null,j("span",{class:"stack-button__label"},n.label)],n.onClick&&!r?{click:n.onClick}:void 0)}function ub(n){const u=(n.items||[]).filter(d=>d&&V(d.label));return j("nav",{class:he("stack-breadcrumbs",n.className),"aria-label":n.label||"Breadcrumb",...ye(n.attrs)},j("ol",{class:"stack-breadcrumbs__list"},u.map((d,r)=>{const f=r===u.length-1;return j("li",{class:"stack-breadcrumbs__item"},[r>0?j("span",{class:"stack-breadcrumbs__separator","aria-hidden":"true"},"/"):null,f||!V(d.href)?j("span",{class:"stack-breadcrumbs__current",...f?{"aria-current":"page"}:{}},d.label):j("a",{class:"stack-breadcrumbs__link",href:d.href},d.label)])})))}function rb(n){if(!["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(n.key))return;const d=n.currentTarget,r=Array.from(d.querySelectorAll('[role="tab"]:not([disabled])'));if(!r.length)return;const f=r.indexOf(d.ownerDocument.activeElement),v=d.getAttribute("aria-orientation")==="vertical",b=v?"ArrowDown":"ArrowRight",g=v?"ArrowUp":"ArrowLeft";let m;if(n.key==="Home")m=0;else if(n.key==="End")m=r.length-1;else if(n.key===b)m=f<0?0:(f+1)%r.length;else if(n.key===g)m=f<0?r.length-1:(f-1+r.length)%r.length;else return;n.preventDefault(),r[m].focus()}const ut=n=>String(n).replace(/[^A-Za-z0-9_-]/g,"-"),ob=n=>u=>{const d=u.currentTarget.ownerDocument.getElementById(n);d&&(u.preventDefault(),d.focus(),typeof d.scrollIntoView=="function"&&d.scrollIntoView())};function db(n){const u=ut(n.idPrefix||"stack-tabs"),d=n.tabs||[],r=d.some(f=>f.id===n.active&&!f.disabled)?n.active:null;return j("div",{class:he("stack-tabs",n.className),role:"tablist",...V(n.label)?{"aria-label":n.label}:{},...ye(n.attrs)},d.map((f,v)=>{const b=f.id===r,g=b||r===null&&v===0;return j("button",{class:he("stack-tabs__tab",b?"stack-tabs__tab--selected":null,f.className),type:"button",role:"tab",id:`${u}-tab-${ut(f.id)}`,"aria-selected":b?"true":"false",...V(n.panelId)?{"aria-controls":n.panelId}:{},tabindex:g?"0":"-1",...f.disabled?{disabled:!0,...V(f.reason)?{title:f.reason}:{}}:{},...ye(f.attrs)},[f.label,V(f.badge)?j("span",{class:"stack-tabs__badge"},f.badge):null],n.onSelect&&!f.disabled?{click:()=>n.onSelect(f.id)}:void 0)}),{keydown:rb})}function fb(n){const u=ut(n.idPrefix||"stack-tabs");return j("div",{class:he("stack-tabpanel",n.className),role:"tabpanel",id:n.id,...V(n.active)?{"aria-labelledby":`${u}-tab-${ut(n.active)}`}:{},tabindex:"0",...ye(n.attrs)},n.children||null)}const ym={ascending:"▲",descending:"▼"},hb=n=>u=>{u.target===u.currentTarget&&(u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),n()))};function mb(n){const u=n.columns||[],d=n.rows||[],r=V(n.label)?n.label:"Table";if(n.error)return ac({title:n.error.title||`${r} could not be read`,message:n.error.message,code:n.error.code,requestId:n.error.requestId,onRetry:n.error.onRetry,className:he("stack-table-state",n.className),attrs:n.attrs});if(n.loading&&!d.length)return Vr({what:n.loadingWhat||r.toLowerCase(),className:he("stack-table-state",n.className),attrs:n.attrs});if(!d.length){const g=!!n.noMatch;return Qr({variant:g?"no-match":"empty",title:g?n.noMatchTitle||"Nothing matches":n.emptyTitle||"Nothing here yet",body:g?n.noMatchBody:n.emptyBody,action:g?null:n.emptyAction,headingLevel:n.emptyHeadingLevel||3,className:he("stack-table-state",n.className),attrs:n.attrs})}const f=n.sort||{},v=j("thead",{},j("tr",{},u.map(g=>{const m=f.column===g.id&&ym[f.direction]?f.direction:null,h=g.sortable&&n.onSort?j("button",{class:"stack-table__sort",type:"button"},[g.header,j("span",{class:"stack-table__sort-indicator","aria-hidden":"true"},m?ym[m]:"↕")],{click:()=>n.onSort(g.id)}):g.header;return j("th",{class:he("stack-table__header",g.align==="end"?"stack-table__cell--end":null),scope:"col",...g.sortable&&n.onSort?{"aria-sort":m||"none"}:{}},h)}))),b=j("tbody",{},d.map(g=>{const m=typeof g.onSelect=="function";return j("tr",{class:he("stack-table__row",m?"stack-table__row--selectable":null,g.selected?"stack-table__row--selected":null,g.className),...m?{tabindex:"0"}:{},...g.selected?{"aria-current":"true"}:{},...ye(g.attrs)},u.map(h=>{const S=g.cells?g.cells[h.id]:void 0,p=S==null;return j("td",{class:he("stack-table__cell",h.align==="end"?"stack-table__cell--end":null),...p?{"data-missing":"true"}:{}},p?"—":S)}),m?{click:g.onSelect,keydown:hb(g.onSelect)}:void 0,g.key)}));return j("div",{class:he("stack-table",n.className),role:"region","aria-label":r,tabindex:"0",...n.loading?{"aria-busy":"true"}:{},...ye(n.attrs)},j("table",{class:"stack-table__table"},[j("caption",{class:n.captionVisible?"stack-table__caption":"stack-visually-hidden"},r),v,b]))}function vb(n,u,d){const r=`${u}-${ut(n.id)}`,f=V(n.value)?String(n.value):"",v=d?g=>d(n.id,g.target.value):null,b=n.type==="select"?j("select",{class:"stack-filter__control",id:r,name:n.id},(n.options||[]).map(g=>{const m=String(typeof g=="object"?g.value:g);return j("option",{value:m,...m===f?{selected:!0}:{}},typeof g=="object"?g.label:g)}),v?{change:v}:void 0):j("input",{class:"stack-filter__control",id:r,name:n.id,type:"search",value:f,...V(n.placeholder)?{placeholder:n.placeholder}:{}},[],v?{input:v}:void 0);return j("div",{class:"stack-filter__field"},[j("label",{class:"stack-filter__label",for:r},n.label),b])}function yb(n){const u=ut(n.idPrefix||"stack-filter"),d=Number(n.applied)||0;return j("form",{class:he("stack-filter",n.className),role:"search","aria-label":n.label||"Filters",...ye(n.attrs)},[j("div",{class:"stack-filter__controls"},[(n.filters||[]).map(r=>vb(r,u,n.onChange)),j("div",{class:"stack-filter__actions"},[n.live?null:ml({label:n.applyLabel||"Apply",type:"submit",variant:"secondary"}),d&&n.onClear?ml({label:n.clearLabel||"Clear",variant:"ghost",onClick:n.onClear}):null])]),j("p",{class:"stack-filter__result",role:"status","aria-live":"polite"},V(n.result)?n.result:"")],n.onSubmit||n.live?{submit:r=>{r.preventDefault(),n.onSubmit&&n.onSubmit()}}:void 0)}function gb(n){return j("nav",{class:he("stack-pagination",n.className),"aria-label":n.label||"Pagination",...ye(n.attrs)},[V(n.summary)?j("p",{class:"stack-pagination__summary"},n.summary):null,j("div",{class:"stack-pagination__actions"},[ml({label:n.previousLabel||"← Previous",variant:"ghost",disabled:!n.hasPrevious,onClick:n.onPrevious,attrs:{"data-page":"previous"}}),ml({label:n.nextLabel||"Next →",variant:"ghost",disabled:!n.hasNext,onClick:n.onNext,attrs:{"data-page":"next"}})])])}const zm=Object.freeze([{value:"system",label:"System theme"},{value:"light",label:"Light theme"},{value:"dark",label:"Dark theme"}]);function bb(n){const u=n.product||{},d=S=>n.onNavigate?{click:p=>{p.defaultPrevented||p.button!==0||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey||(p.preventDefault(),n.onNavigate(S))}}:void 0,r=ut(n.mainId||"stack-main"),f=[];for(const S of n.navigation||[]){const p=S.group||"";let N=f.find(O=>O.name===p);N||f.push(N={name:p,items:[]}),N.items.push(S)}for(const S of f)S.items.sort((p,N)=>(p.order??0)-(N.order??0));const v=S=>j("li",{class:"stack-shell__nav-entry"},j("a",{class:he("stack-shell__nav-item",S.className),href:S.href,...S.current?{"aria-current":"page"}:{},...ye(S.attrs)},S.label,d(S.href))),b=n.theme,g=`${r}-theme`,m=n.otherProducts||(V(u.id)&&qr(u.id)?Ul.products.filter(S=>S.id!==u.id).map(S=>({name:S.name,href:S.href})):[]),h=V(u.id)&&qr(u.id)&&n.family!==!1;return j("div",{class:he("stack-shell",n.className),...V(u.id)?{"data-stack-product":u.id}:{},...ye(n.attrs)},[j("a",{class:"stack-shell__skip",href:`#${r}`},n.skipLabel||"Skip to content",{click:ob(r)}),j("header",{class:"stack-shell__bar"},[j("a",{class:"stack-shell__product",href:u.homeHref||"#"},[V(u.mark)?j("span",{class:"stack-shell__mark","aria-hidden":"true"},u.mark):null,j("span",{class:"stack-shell__product-name"},u.name||"")],d(u.homeHref||"#")),n.context?j("div",{class:"stack-shell__context"},n.context):null,n.search?j("div",{class:"stack-shell__search"},n.search):null,j("div",{class:"stack-shell__end"},[b?j("div",{class:"stack-shell__prefs"},[j("label",{class:"stack-visually-hidden",for:g},"Theme"),j("select",{class:"stack-shell__theme",id:g,"data-stack-theme-control":""},zm.map(S=>j("option",{value:S.value,...S.value===(b.preference||"system")?{selected:!0}:{}},S.label)),b.onChange?{change:S=>b.onChange(S.target.value)}:void 0)]):null,n.account?j("div",{class:"stack-shell__account"},n.account):null,h?j("a",{class:"stack-shell__family",href:Ul.company.href},[nc({idPrefix:`${r}-family-mark`}),j("span",{},["A ",Ul.company.name," product"])]):null])]),j("div",{class:"stack-shell__body"},[j("nav",{class:"stack-shell__nav","aria-label":`${u.name||"Product"} navigation`},[f.map(S=>j("div",{class:"stack-shell__nav-group"},[V(S.name)?j("p",{class:"stack-shell__nav-heading"},S.name):null,j("ul",{class:"stack-shell__nav-list"},S.items.map(v))])),V(n.activityHref)?j("div",{class:"stack-shell__nav-group stack-shell__activity"},j("ul",{class:"stack-shell__nav-list"},v({label:n.activityLabel||"Activity",href:n.activityHref,current:n.activityCurrent}))):null,m.length||h?j("div",{class:"stack-shell__nav-group stack-shell__switcher"},[j("p",{class:"stack-shell__nav-heading"},n.otherProductsLabel||"Other Boundry products"),j("ul",{class:"stack-shell__nav-list"},[m.map(S=>j("li",{class:"stack-shell__nav-entry"},j("a",{class:"stack-shell__nav-item",href:S.href},S.name))),h?j("li",{class:"stack-shell__nav-entry"},j("a",{class:"stack-shell__nav-item stack-shell__nav-item--company",href:Ul.company.href},["About ",Ul.company.name])):null])]):null]),j("main",{class:"stack-shell__main",id:r,tabindex:"-1",...ye(n.mainAttrs)},n.children||null)])])}const pb=["pattern","min","max","step","minlength","maxlength","autocomplete","inputmode","list","spellcheck"],Xr=n=>ut(V(n.id)?n.id:`stack-field-${n.name||"field"}`);function Rm(n,u,d,r){return j("div",{class:he("stack-field",`stack-field--${r}`,n.error?"stack-field--invalid":null,n.className),...ye(n.attrs)},[j("label",{class:"stack-field__label",for:u},[n.label,n.required?j("span",{class:"stack-field__required","aria-hidden":"true"}," *"):null]),d,V(n.hint)?j("p",{class:"stack-field__hint",id:`${u}-hint`},n.hint):null,V(n.error)?j("p",{class:"stack-field__error",id:`${u}-error`},n.error):null])}const jb=(n,u)=>{const d=[V(n.hint)?`${u}-hint`:null,V(n.error)?`${u}-error`:null].filter(Boolean);return d.length?{"aria-describedby":d.join(" ")}:{}},Zr=(n,u)=>({...n.required?{required:!0}:{},...n.readOnly?{readonly:!0}:{},...n.disabled?{disabled:!0}:{},...V(n.error)?{"aria-invalid":"true"}:{},...jb(n,u)});function wm(n){const u=Xr(n),d=n.value!==void 0&&n.value!==null,r=d?String(n.value):null,f=n.onChange?{input:m=>n.onChange(m.target.value)}:void 0,v={};for(const m of pb)V(n[m])&&(v[m]=String(n[m]));const b={class:"stack-field__control",id:u,...V(n.name)?{name:n.name}:{},...V(n.placeholder)?{placeholder:n.placeholder}:{},...v,...Zr(n,u)},g=n.multiline?j("textarea",{...b,rows:String(Number(n.rows)||4)},d?r:[],f):j("input",{...b,type:n.type||"text",...d?{value:r}:{}},[],f);return Rm(n,u,g,n.multiline?"multiline":"text")}function xb(n){const u=Xr(n),d=V(n.value)?String(n.value):null,r=n.onChange?{change:v=>n.onChange(v.target.value)}:void 0,f=j("select",{class:"stack-field__control",id:u,...V(n.name)?{name:n.name}:{},...Zr(n,u)},(n.options||[]).map(v=>{const b=String(typeof v=="object"?v.value:v);return j("option",{value:b,...b===d?{selected:!0}:{},...typeof v=="object"&&v.disabled?{disabled:!0}:{}},typeof v=="object"?v.label:v)}),r);return Rm(n,u,f,"select")}function Sb(n){return j("form",{class:he("stack-form",n.layout==="inline"?"stack-form--inline":null,n.className),...V(n.label)?{"aria-label":n.label}:{},...V(n.id)?{id:ut(n.id)}:{},...n.busy?{"aria-busy":"true"}:{},...ye(n.attrs)},[j("div",{class:"stack-form__fields"},n.children||null),j("div",{class:"stack-form__actions"},[ml({label:n.submitLabel||"Save",type:"submit",variant:n.submitVariant||"primary",busy:n.busy}),n.actions||null])],{submit:u=>{u.preventDefault(),n.onSubmit&&n.onSubmit(u)}})}function Mm(n){const u=ut(n.id||"stack-dialog"),d=[V(n.description)?`${u}-description`:null,...n.describedBy||[]].filter(Boolean);return j("dialog",{class:he("stack-dialog",n.className),id:u,...n.role==="alertdialog"?{role:"alertdialog"}:{},"aria-labelledby":`${u}-title`,...d.length?{"aria-describedby":d.join(" ")}:{},...ye(n.attrs)},j("div",{class:"stack-dialog__surface"},[j("h2",{class:"stack-dialog__title",id:`${u}-title`},n.title),V(n.description)?j("p",{class:"stack-dialog__description",id:`${u}-description`},n.description):null,n.children?j("div",{class:"stack-dialog__body"},n.children):null,n.actions?j("div",{class:"stack-dialog__actions"},n.actions):null]),{cancel:r=>{r.preventDefault(),n.onClose&&n.onClose()}})}function kb(n){const u=ut(n.id||"stack-confirm"),d=(n.consequences||[]).filter(V),r=!V(n.requireText)||n.typed===n.requireText;return Mm({id:u,role:"alertdialog",title:n.title,description:n.description,describedBy:d.length?[`${u}-consequences`]:[],className:he("stack-confirm",n.className),attrs:n.attrs,onClose:n.busy?null:n.onCancel,children:[d.length?j("ul",{class:"stack-confirm__consequences",id:`${u}-consequences`},d.map(f=>j("li",{},f))):null,V(n.requireText)?wm({id:`${u}-typed`,name:"confirm",label:n.requireTextLabel||`Type ${n.requireText} to confirm`,value:n.typed===void 0||n.typed===null?"":n.typed,autocomplete:"off",spellcheck:"false",disabled:n.busy,onChange:n.onTypedChange}):null,n.error?ac({title:n.error.title||"Not done",message:n.error.message,code:n.error.code,requestId:n.error.requestId}):null],actions:[ml({label:n.cancelLabel||"Cancel",variant:"ghost",disabled:n.busy,onClick:n.onCancel,attrs:{"data-dialog-cancel":"true"}}),ml({label:n.confirmLabel,variant:"danger",busy:n.busy,disabled:!r,onClick:n.onConfirm,attrs:{"data-dialog-confirm":"true"}})]})}function _b(n){const u=ut(n.id||"stack-evidence"),d=(n.claims||[]).filter(p=>p&&V(p.label)),r=d.map(p=>V(p.verification)?Ur(p.verification,p.checks).state:"not_evaluated"),f=r.filter(p=>p!=="not_evaluated"),v=f.filter(p=>p==="verified").length,b=f.filter(p=>p==="verification_failed").length,g=r.length-f.length,m=f.length===0?"recorded":v===f.length&&g===0?"verified":"partial",h=g?` · ${g} recorded, not checked`:"",S=m==="recorded"?"Recorded facts · not independently verified":m==="verified"?f.length===1?"Verified":`All ${f.length} claims verified`:`${v} of ${f.length} checked claims verified${b?` · ${b} failed`:""}${h}`;return j("section",{class:he("stack-evidence",`stack-evidence--${m}`,n.className),"aria-labelledby":`${u}-title`,"data-evidence":m,...ye(n.attrs)},[j("div",{class:"stack-evidence__header"},[j(lc(n.headingLevel||2),{class:"stack-evidence__title",id:`${u}-title`},V(n.title)?n.title:"Evidence"),n.outcome?j("div",{class:"stack-evidence__outcome"},n.outcome):null]),j("p",{class:"stack-evidence__summary"},S),d.length?j("dl",{class:"stack-evidence__claims"},d.map(p=>{const N=!V(p.value)&&p.value!==0&&p.value!==!1;return j("div",{class:"stack-evidence__claim",...V(p.verification)?{"data-verification":Ur(p.verification,p.checks).state}:{},...ye(p.attrs)},[j("dt",{class:"stack-evidence__label"},p.label),j("dd",{class:he("stack-evidence__value",p.mono?"stack-evidence__value--mono":null),...N?{"data-missing":"true"}:{}},N?"—":typeof p.value=="boolean"?String(p.value):p.value),V(p.verification)?j("dd",{class:"stack-evidence__check"},Dm({state:p.verification,checks:p.checks,evidenceHref:p.evidenceHref})):null])})):null,V(n.source)||V(n.recordedAt)?j("p",{class:"stack-evidence__source"},[V(n.source)?n.source:"Recorded",V(n.recordedAt)?[" · ",tc(n.recordedAt,"stack-evidence__at")]:null]):null])}const Nb=["info","attention","critical"],Tb={info:"i",attention:"▲",critical:"✕"};function Ab(n){const u=Nb.includes(n.tone)?n.tone:"info";return j("div",{class:he("stack-alert",`stack-alert--${u}`,n.className),role:u==="critical"?"alert":"status","data-tone":u,...ye(n.attrs)},[j("span",{class:"stack-alert__glyph","aria-hidden":"true"},Tb[u]),j("div",{class:"stack-alert__content"},[V(n.title)?j("p",{class:"stack-alert__title"},n.title):null,n.children?j("div",{class:"stack-alert__body"},n.children):null,n.actions?j("div",{class:"stack-alert__actions"},n.actions):null])])}function Eb(n){const u=Xr(n),d=n.checked!==void 0&&n.checked!==null,r=j("input",{class:"stack-checkbox__control",type:"checkbox",id:u,...V(n.name)?{name:n.name}:{},...V(n.value)?{value:String(n.value)}:{},...d&&n.checked?{checked:!0}:{},...Zr(n,u)},[],n.onChange?{change:f=>n.onChange(!!f.target.checked)}:void 0);return j("div",{class:he("stack-checkbox",n.error?"stack-checkbox--invalid":null,n.className),...ye(n.attrs)},[j("div",{class:"stack-checkbox__row"},[r,j("label",{class:"stack-checkbox__label",for:u},[n.label,n.required?j("span",{class:"stack-field__required","aria-hidden":"true"}," *"):null])]),V(n.hint)?j("p",{class:"stack-field__hint",id:`${u}-hint`},n.hint):null,V(n.error)?j("p",{class:"stack-field__error",id:`${u}-error`},n.error):null])}function Cb(n){const u=ut(n.id||"stack-group"),d=[V(n.hint)?`${u}-hint`:null,V(n.error)?`${u}-error`:null].filter(Boolean);return j("fieldset",{class:he("stack-fieldgroup",n.error?"stack-fieldgroup--invalid":null,n.className),id:u,...d.length?{"aria-describedby":d.join(" ")}:{},...n.disabled?{disabled:!0}:{},...ye(n.attrs)},[j("legend",{class:"stack-fieldgroup__legend"},[n.legend,n.required?j("span",{class:"stack-field__required","aria-hidden":"true"}," *"):null]),V(n.hint)?j("p",{class:"stack-field__hint",id:`${u}-hint`},n.hint):null,j("div",{class:"stack-fieldgroup__controls"},n.children||null),V(n.error)?j("p",{class:"stack-field__error",id:`${u}-error`},n.error):null])}function Ob(n){const u=(n.items||[]).filter(f=>f&&V(f.summary)),d=V(n.label)?n.label:"Activity";let r;return n.error?r=ac(typeof n.error=="string"?{message:n.error}:n.error):n.loading&&!u.length?r=Vr({what:V(n.what)?n.what:"activity"}):u.length?r=j("ol",{class:"stack-timeline__list","aria-label":d},u.map((f,v)=>j("li",{class:"stack-timeline__item",...ye(f.attrs)},[j("span",{class:"stack-timeline__marker","aria-hidden":"true"}),j("div",{class:"stack-timeline__content"},[j("p",{class:"stack-timeline__summary"},V(f.href)?j("a",{class:"stack-timeline__link",href:f.href},f.summary):f.summary),j("p",{class:"stack-timeline__meta"},[V(f.at)?tc(f.at,"stack-timeline__at"):j("span",{class:"stack-timeline__at","data-missing":"true"},"Time not recorded"),V(f.actor)?[" · ",j("span",{class:"stack-timeline__actor"},f.actor)]:null,f.status?[" ",j("span",{class:"stack-timeline__status"},f.status)]:null]),f.detail?j("div",{class:"stack-timeline__detail"},f.detail):null])],void 0,V(f.id)?f.id:v))):r=Qr({title:V(n.emptyTitle)?n.emptyTitle:"No activity recorded",headingLevel:n.headingLevel||3}),j("section",{class:he("stack-timeline",n.className),...n.loading?{"aria-busy":"true"}:{},...ye(n.attrs)},[r,n.hasMore&&u.length?j("p",{class:"stack-timeline__more"},[V(n.moreHref)?j("a",{href:n.moreHref,class:"stack-timeline__link"},n.moreLabel||"Older activity exists"):n.onMore?ml({label:n.moreLabel||"Load older activity",onClick:n.onMore,busy:!!n.loading}):n.moreLabel||"Older activity exists"]):null])}function nc(n){const u=ut(n.idPrefix||"stack-brand-mark"),d=V(n.title);return j("svg",{class:he("stack-brand-mark",n.className),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 340 315",focusable:"false",...d?{role:"img","aria-labelledby":`${u}-title`}:{"aria-hidden":"true"},...ye(n.attrs)},[d?j("title",{id:`${u}-title`},n.title):null,j("defs",{},j("linearGradient",{id:`${u}-fill`,x1:"0",y1:"0",x2:"340",y2:"0",gradientUnits:"userSpaceOnUse"},[j("stop",{class:"stack-brand-mark__start",offset:"0.2"}),j("stop",{class:"stack-brand-mark__end",offset:"0.85"})])),j("path",{fill:`url(#${u}-fill)`,d:"M0 0H250C298 0 330 38 329 84C328 114 309 135 281 143L0 269V182L225 80H0Z"}),j("path",{fill:`url(#${u}-fill)`,d:"M0 315L290 182C318 172 341 202 340 246C339 288 306 315 268 315Z"})])}function Um(n){const u=ut(n.id||"stack-theme");return j("div",{class:he("stack-theme-switch",n.className),...ye(n.attrs)},[j("label",{class:"stack-visually-hidden",for:u},n.label||"Theme"),j("select",{class:"stack-theme-switch__control",id:u,"data-stack-theme-control":""},zm.map(d=>j("option",{value:d.value,...d.value===(n.preference||"system")?{selected:!0}:{}},d.label)),n.onChange?{change:d=>n.onChange(d.target.value)}:void 0)])}const qm=n=>n.product?{...qr(n.product.id)||{},...n.product}:null;function Db(n){const u=Ul.company,d=qm(n),r=d?d.name:u.name,f=V(n.homeHref)?n.homeHref:"/";return j("header",{class:he("stack-site-header",n.className),...d&&V(d.id)?{"data-stack-product":d.id}:{},...ye(n.attrs)},[j("a",{class:"stack-site-header__skip",href:`#${ut(n.mainId||"main")}`},n.skipLabel||"Skip to content"),j("div",{class:"stack-site-header__inner"},[j("div",{class:"stack-site-header__identity"},[j("a",{class:"stack-site-header__home",href:f,"aria-label":`${r} home`},[n.logo?j("span",{class:"stack-site-header__logo"},n.logo):d?j("span",{class:"stack-site-header__product-mark","aria-hidden":"true"},d.mark||r.slice(0,2)):nc({className:"stack-site-header__logo",idPrefix:`${ut(n.mainId||"main")}-mark`}),j("span",{class:"stack-site-header__name"},r)]),d?j("a",{class:"stack-site-header__family",href:u.href},["A ",u.name," product"]):null]),(n.navigation||[]).length?j("nav",{class:"stack-site-header__nav","aria-label":n.navigationLabel||"Main"},j("ul",{class:"stack-site-header__nav-list"},n.navigation.map(v=>j("li",{},j("a",{class:"stack-site-header__nav-item",href:v.href,...v.current?{"aria-current":"page"}:{},...ye(v.attrs)},v.label))))):null,j("div",{class:"stack-site-header__end"},[n.theme?Um({id:`${ut(n.mainId||"main")}-theme`,preference:n.theme.preference,onChange:n.theme.onChange}):null,n.actions||null])])])}function zb(n){const u=Ul.company,d=qm(n),r=n.columns||[],f=V(n.year)?n.year:null,v=V(n.owner)?n.owner:u.name;return j("footer",{class:he("stack-site-footer",n.className),...d&&V(d.id)?{"data-stack-product":d.id}:{},...ye(n.attrs)},j("div",{class:"stack-site-footer__inner"},[j("div",{class:"stack-site-footer__top"},[j("div",{class:"stack-site-footer__about"},[j("p",{class:"stack-site-footer__name"},d?d.name:u.name),V(n.tagline)?j("p",{class:"stack-site-footer__tagline"},n.tagline):null]),r.map(b=>j("nav",{class:"stack-site-footer__column","aria-label":b.title},[j("p",{class:"stack-site-footer__heading"},b.title),j("ul",{class:"stack-site-footer__list"},(b.links||[]).map(g=>j("li",{},j("a",{class:"stack-site-footer__link",href:g.href,...ye(g.attrs)},g.label))))]))]),j("nav",{class:"stack-site-footer__family","aria-label":`${u.name} products`},[j("a",{class:"stack-site-footer__company",href:u.href},[nc({className:"stack-site-footer__mark",idPrefix:`${ut(n.id||"stack-footer")}-mark`}),j("span",{},d?u.family:`${u.name} — ${u.tagline}`)]),j("ul",{class:"stack-site-footer__products"},Ul.products.map(b=>j("li",{"data-stack-product":b.id},j("a",{class:"stack-site-footer__product",href:b.href,...d&&d.id===b.id?{"aria-current":"true"}:{}},[j("span",{class:"stack-site-footer__product-name"},b.name),j("span",{class:"stack-site-footer__product-category"},b.category)]))))]),j("p",{class:"stack-site-footer__legal"},[`© ${f?`${f} `:""}${v}`,d?[" · ",d.name," is a ",j("a",{href:u.href},`${u.name} product`)]:null,n.legal?[" · ",n.legal]:null])]))}const ic=Object.freeze({Breadcrumbs:ub,Tabs:db,TabPanel:fb,DataTable:mb,FilterBar:yb,Pagination:gb,Shell:bb,StatusIndicator:Wg,VerificationBadge:Dm,FreshnessLabel:tb,Unavailable:lb,Loading:Vr,EmptyState:Qr,ErrorPanel:ac,MetadataList:ab,ResourceIdentity:nb,PageHeader:ib,Button:ml,TextField:wm,Select:xb,Form:Sb,Dialog:Mm,ConfirmAction:kb,EvidenceSummary:_b,Alert:Ab,Checkbox:Eb,FieldGroup:Cb,ActivityTimeline:Ob,BrandMark:nc,ThemeSwitch:Um,SiteHeader:Db,SiteFooter:zb}),pi="stack-ui.theme",Kr=Object.freeze(["system","light","dark"]),Bm=n=>{try{return n&&n.localStorage?n.localStorage:null}catch{return null}};function gm(n){const u=Bm(globalThis);if(!u)return"system";try{const d=u.getItem(pi);return Kr.includes(d)?d:"system"}catch{return"system"}}function Rb(n,u){const d=Bm(globalThis);if(!d||!Kr.includes(n))return!1;try{return n==="system"?d.removeItem(pi):d.setItem(pi,n),!0}catch{return!1}}function wb(n,u){const d=typeof document<"u"?document.documentElement:null;d&&(n==="light"||n==="dark"?d.setAttribute("data-stack-theme",n):d.removeAttribute("data-stack-theme"))}function Mb(n,u,d){const r=Kr.includes(n)?n:"system";return Rb(r),wb(r),r}`${JSON.stringify(pi)}`;const Ub="http://www.w3.org/2000/svg";function Br(n,u,d){const r=u||document;if(n==null||n===!1||n===!0)return r.createDocumentFragment();if(typeof n=="string"||typeof n=="number")return r.createTextNode(String(n));if(Array.isArray(n)){const f=r.createDocumentFragment();for(const v of n)f.appendChild(Br(v,r,d));return f}if(Zs(n)){const f=n.t==="svg"?Ub:d,v=f?r.createElementNS(f,n.t):r.createElement(n.t);for(const[b,g]of Object.entries(n.a))g==null||g===!1||v.setAttribute(b,g===!0?"":String(g));for(const[b,g]of Object.entries(n.on||{}))v.addEventListener(b,g);for(const b of n.c)v.appendChild(Br(b,r,f));return v}if(n&&typeof n.nodeType=="number")return n;throw new TypeError("toDom: unsupported child")}function qb(n,u){const r=document.getElementById(String(n).replace(/[^A-Za-z0-9_-]/g,"-"));r&&typeof r.focus=="function"&&r.focus({preventScroll:!0})}Object.freeze(Object.fromEntries(Object.entries(ic).map(([n,u])=>[n,(d,r)=>Br(u(d||{}),r)])));const Bb={class:"className",for:"htmlFor",datetime:"dateTime",tabindex:"tabIndex",readonly:"readOnly",autocomplete:"autoComplete",inputmode:"inputMode",maxlength:"maxLength",minlength:"minLength",spellcheck:"spellCheck"},bm={click:"onClick",change:"onChange",input:"onInput",submit:"onSubmit",keydown:"onKeyDown",cancel:"onCancel",close:"onClose"};function ji(n,u){if(n==null||n===!1||n===!0)return null;if(typeof n=="string"||typeof n=="number")return n;if(Array.isArray(n))return A.createElement(A.Fragment,u===void 0?null:{key:u},...n.map((d,r)=>ji(d,r)));if(A.isValidElement(n))return u===void 0?n:A.createElement(A.Fragment,{key:u},n);if(Zs(n)){const d=n.k===void 0?u:n.k,r=d===void 0?{}:{key:d};for(const[g,m]of Object.entries(n.a))m==null||m===!1||(r[Bb[g]||g]=m);const f=n.t==="input"||n.t==="select"||n.t==="textarea";for(const[g,m]of Object.entries(n.on||{})){if(!bm[g])throw new Error(`toReact: unsupported event ${g}`);r[f&&(g==="input"||g==="change")?"onChange":bm[g]]=m}let v=n.c;if(n.t==="textarea"&&(r.value=v.filter(g=>typeof g=="string"||typeof g=="number").join(""),v=[]),n.t==="select"){const g=v.find(m=>Zs(m)&&m.t==="option"&&m.a.selected);v=v.map(m=>Zs(m)&&m.t==="option"&&m.a.selected?{...m,a:{...m.a,selected:!1}}:m),g&&(r.value=g.a.value)}f&&"checked"in r&&!r.onChange&&(r.defaultChecked=r.checked,delete r.checked),f&&"value"in r&&!r.onChange&&(r.defaultValue=r.value,delete r.value);const b=v.map((g,m)=>ji(g,m));return A.createElement(n.t,r,...b)}throw new TypeError("toReact: unsupported child")}const Me=n=>{const u=ic[n],d=r=>ji(u(r||{}));return d.displayName=`Stack${n}`,d},Ge=Me("StatusIndicator"),pm=Me("VerificationBadge"),$m=Me("FreshnessLabel");Me("Unavailable");const $b=Me("Loading"),Hb=Me("EmptyState"),Lb=Me("ErrorPanel"),vl=Me("MetadataList");Me("ResourceIdentity");const Yb=Me("PageHeader"),Ce=Me("Button"),Gb=Me("Breadcrumbs"),Hm=Me("Tabs"),Lm=Me("TabPanel"),dt=Me("DataTable"),Ym=Me("FilterBar"),Vb=Me("Pagination"),Qb=Me("Shell"),Ne=Me("TextField"),kt=Me("Select"),Bl=Me("Form");Me("EvidenceSummary");const Ke=Me("Alert"),Js=Me("Checkbox"),$r=Me("FieldGroup"),Fs=Me("ActivityTimeline"),Xb=Me("BrandMark"),Zb=Me("ThemeSwitch");Me("SiteHeader");Me("SiteFooter");function Gm(n,u,d){const r=A.useRef(null),f=A.useRef({open:n,onDismiss:u,busy:d});return f.current={open:n,onDismiss:u,busy:d},A.useEffect(()=>{const v=r.current;if(!v)return;const b=()=>{const g=f.current;g.open&&(g.busy?v.showModal():g.onDismiss&&g.onDismiss())};return v.addEventListener("close",b),()=>v.removeEventListener("close",b)},[]),A.useEffect(()=>{const v=r.current;v&&(n&&!v.open?v.showModal():!n&&v.open&&v.close())},[n]),r}function Jr(n){const u=Gm(!!n.open,n.onClose,!n.onClose);return A.cloneElement(ji(ic.Dialog(n)),{ref:u})}Jr.displayName="StackDialog";function Fr(n){const u=Gm(!!n.open,n.onCancel,!!n.busy),[d,r]=A.useState("");A.useEffect(()=>{n.open||r("")},[n.open]);const f=n.typed!==void 0;return A.cloneElement(ji(ic.ConfirmAction({...n,typed:f?n.typed:d,onTypedChange:f?n.onTypedChange:r})),{ref:u})}Fr.displayName="StackConfirmAction";const gt="positive",hl="progress",pn="attention",Qt="critical",al="neutral",jn="unknown",Kb={"feltkit.runtime.state":{starting:hl,ready:gt,closing:hl,closed:al,failed:Qt},"feltkit.activity.outcome":{success:[gt,"Success"],error:[Qt,"Error"],denied:[al,"Denied"]},"feltkit.authority.allowed":{true:[gt,"Allowed"],false:[al,"Denied"]},"feltkit.service.state":{configured:[gt,"Configured"],unconfigured:[pn,"Not set up"],unhealthy:[Qt,"Unhealthy"],available:[al,"Not enabled"],unavailable:[Qt,"Unavailable"]},"feltkit.service.evidence":{succeeded:[gt,"Succeeded"],denied:[al,"Denied"],failed:[Qt,"Failed"],started:[jn,"Outcome unknown"]},"feltkit.webhook.delivery":{delivered:gt,pending:hl,delivering:hl,retrying:hl,failed:Qt},"feltkit.secret.state":{set:[gt,"Set"],missing:[pn,"Missing"],revoked:[al,"Removed"]},"feltkit.agent.task":{ready:hl,running:hl,waiting:hl,blocked:pn,completed:gt,failed:Qt,cancelled:al},"feltkit.agent.action":{proposed:[pn,"Waiting for approval"],approved:[hl,"Approved, starting"],executing:[hl,"Running"],succeeded:[gt,"Succeeded"],failed:[Qt,"Failed"],rejected:[al,"Rejected"],interrupted:[jn,"Outcome unknown"]},"feltkit.integration.call":{succeeded:[gt,"Succeeded"],failed:[Qt,"Failed"],unknown:[jn,"Outcome unknown"],started:[jn,"Outcome unknown"]},"feltkit.readiness.check":{pass:[gt,"Passes"],fail:[Qt,"Fails"],warn:[pn,"Review"],external:[jn,"Outside FeltKit"]},"feltkit.path.step":{done:[gt,"Done"],todo:[pn,"To do"],info:[al,"Review"],"not-tracked":[jn,"Not tracked"]},"feltkit.project.state":{current:[gt,"This dashboard"],running:[gt,"Running"],stopped:[al,"Stopped"],missing:[Qt,"Missing"]},"feltkit.model.ready":{true:[gt,"Ready"],false:[Qt,"Not ready"]},"feltkit.integration.configured":{true:[gt,"Configured"],false:[Qt,"Not configured"]},"feltkit.deployment.state":{live:[gt,"Live"],built:[al,"Not deployed"],none:[al,"Not set up"]}},jm=n=>n?n.charAt(0).toUpperCase()+n.slice(1).replace(/[_-]+/g," "):"Unknown";function Ir(n,u){const d=String(u),r=Kb[n]?.[d];return r?Array.isArray(r)?{tone:r[0],label:r[1],mapped:!0}:{tone:r,label:jm(d),mapped:!0}:{tone:"unknown",label:u==null||u===""?"Unknown":jm(d),mapped:!1}}function xt(n){if(n==null||n==="")return"—";const u=typeof n=="number"?n:Date.parse(n);if(Number.isNaN(u))return String(n);const d=Math.max(0,Math.round((Date.now()-u)/1e3));return d<5?"just now":d<60?`${d}s ago`:d<3600?`${Math.floor(d/60)}m ago`:d<86400?`${Math.floor(d/3600)}h ago`:new Date(u).toLocaleDateString()}function Vm(n=15e3){const[,u]=A.useState(0);A.useEffect(()=>{const d=setInterval(()=>u(r=>r+1),n);return()=>clearInterval(d)},[n])}function Pe({field:n,value:u,label:d,detail:r}){const f=Ir(n,u);return i.jsx(Ge,{tone:f.tone,label:d??f.label,detail:r,attrs:{"data-state":String(u)}})}function xn({outcome:n}){const u=Ir("feltkit.activity.outcome",n);return i.jsx(Ge,{tone:u.mapped?u.tone:"critical",label:u.label,attrs:{"data-outcome":n}})}function se({title:n,action:u,children:d,className:r="",label:f}){const v=A.useId();return i.jsxs("section",{className:`feltkit-panel ${r}`,...n?{"aria-labelledby":v}:f?{"aria-label":f}:{},children:[(n||u)&&i.jsxs("header",{className:"feltkit-panel__header",children:[n&&i.jsx("h2",{className:"feltkit-panel__title",id:v,children:n}),u&&i.jsx("div",{className:"feltkit-panel__actions",children:u})]}),d]})}function ql({title:n,children:u,noMatch:d,action:r}){return i.jsx(Hb,{title:n,body:u,variant:d?"no-match":"empty",action:r,headingLevel:3})}function bt({what:n}){return i.jsx($b,{what:n})}function Oe({error:n,retry:u,title:d}){const r=n;return i.jsx(Lb,{title:d??"Not done",message:r?.message??String(n),code:r?.code,requestId:r?.requestId,onRetry:u})}function da(n,u){const d=n;return{message:d?.message??String(n),...d?.code?{code:d.code}:{},...d?.requestId?{requestId:d.requestId}:{},...u?{onRetry:u}:{}}}function ki({value:n,max:u=4e3,label:d}){let r=JSON.stringify(n,null,2)??"undefined";return r.length>u&&(r=`${r.slice(0,u)}
|
|
12
|
-
… (${r.length-u} more characters)`),i.jsx("pre",{className:"feltkit-code",tabIndex:0,...d?{"aria-label":d}:{},children:r})}function xi({text:n,label:u}){return i.jsxs("div",{className:"feltkit-command",children:[i.jsx("pre",{className:"feltkit-code",tabIndex:0,...u?{"aria-label":u}:{},children:n}),i.jsx(_i,{text:n})]})}function _i({text:n,label:u="Copy"}){const[d,r]=A.useState(!1);return i.jsx(Ce,{size:"sm",variant:"ghost",label:d?"Copied":u,onClick:()=>{navigator.clipboard?.writeText(n).then(()=>{r(!0),setTimeout(()=>r(!1),1200)})}})}function Si({schema:n,label:u}){if(!n)return i.jsx("span",{className:"feltkit-muted",children:"—"});if(n.type!=="object"||!n.properties)return i.jsx("code",{className:"feltkit-type",children:Is(n)});const d=new Set(n.required??[]),r=Object.entries(n.properties);return r.length?i.jsx("ul",{className:"feltkit-schema",...u?{"aria-label":u}:{},children:r.map(([f,v])=>i.jsxs("li",{children:[i.jsxs("code",{children:[f,d.has(f)?"":"?"]}),i.jsx("code",{className:"feltkit-type",children:Is(v)}),xm(v)&&i.jsx("span",{className:"feltkit-muted feltkit-small",children:xm(v)})]},f))}):i.jsx("span",{className:"feltkit-muted",children:"no fields"})}function Is(n){return n?n.enum?n.enum.map(u=>JSON.stringify(u)).join(" | "):n.anyOf?n.anyOf.map(Is).join(" | "):n.type==="array"?`${Is(n.items)}[]`:n.type==="object"?n.properties?`{ ${Object.keys(n.properties).join(", ")} }`:"object":Array.isArray(n.type)?n.type.join(" | "):n.type??"unknown":"unknown"}function xm(n){const u=[];return n.minLength!==void 0&&u.push(`min ${n.minLength}`),n.maxLength!==void 0&&u.push(`max ${n.maxLength}`),n.minimum!==void 0&&u.push(`≥ ${n.minimum}`),n.maximum!==void 0&&u.push(`≤ ${n.maximum}`),u.join(", ")}function Ve(n,u){const[d,r]=A.useState({loading:!0}),[f,v]=A.useState(0);return A.useEffect(()=>{let b=!0;return r(g=>({...g,loading:!0})),n().then(g=>b&&r({data:g,loading:!1}),g=>b&&r(m=>({data:m.data,error:g,loading:!1}))),()=>{b=!1}},[...u,f]),{...d,reload:()=>v(b=>b+1)}}function Ee({label:n,action:u,done:d,variant:r="secondary",size:f="sm",disabled:v,confirm:b}){const[g,m]=A.useState(!1),[h,S]=A.useState(!1),[p,N]=A.useState(null),O=A.useId().replace(/:/g,""),L=async()=>{S(!0),N(null);try{const w=await u();m(!1),d?.(w)}catch(w){N(w)}finally{S(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(Ce,{label:n,size:f,variant:b&&r==="secondary"?"secondary":r,busy:h&&!b,disabled:v,onClick:()=>b?(N(null),m(!0)):void L()}),b&&i.jsx(Fr,{id:`confirm-${O}`,open:g,title:b.title,consequences:b.consequences,confirmLabel:b.confirmLabel??n,requireText:b.requireText,busy:h,error:p?da(p):null,onConfirm:()=>{L()},onCancel:()=>m(!1)}),!b&&p?i.jsx(Oe,{error:p}):null]})}function Ni({as:n,setAs:u,devUsers:d,label:r="Act as",id:f}){return d.length?i.jsx(kt,{id:f,label:r,value:n,onChange:u,options:d.map(v=>({value:v.id,label:`${v.name??v.id} (${v.roles.join(", ")})`})),className:"feltkit-identity"}):null}function Qm(){const[n,u]=A.useState(()=>gm());return A.useEffect(()=>{Mb(n)},[n]),A.useEffect(()=>{const d=r=>{r.key===pi&&u(gm())};return window.addEventListener("storage",d),()=>window.removeEventListener("storage",d)},[]),[n,u]}const Jb="/_feltkit/assets/feltkit-mark-BygpVIiS.png";function Fb(){Vm();const{overview:n,activity:u}=Xt();if(!n)return null;const d=n.capabilities??[],r=Xm(u,n.recentActivity??[]).slice(0,8),f=[...n.recentErrors??[],...n.recentDenials??[]].sort((h,S)=>S.at.localeCompare(h.at)).slice(0,6),v=Object.values(n.counts??{}).reduce((h,S)=>h+Number(S),0),b=(n.services??[]).filter(h=>h.state!=="available"&&h.state!=="unavailable"),g=n.agent??{tasks:[],waiting:0,handoffs:0},m=!!n.environment.production;return i.jsxs("div",{className:"feltkit-page",children:[i.jsx(wt,{title:n.application.name,subtitle:n.application.description??"Where this application's state lives, what it can do, and what it has done.",status:i.jsx(Pe,{field:"feltkit.runtime.state",value:n.state}),actions:n.url?i.jsx("a",{href:n.url,target:"_blank",rel:"noreferrer",children:"Open app ↗"}):null}),i.jsxs("div",{className:"feltkit-grid feltkit-grid--stats",children:[i.jsx(Qs,{label:"Records",value:v,detail:`${n.collections.length} collection${n.collections.length===1?"":"s"}`,href:"#/data"}),i.jsx(Qs,{label:"Functions",value:n.functions.length,detail:`${n.functions.filter(h=>h.kind==="query").length} queries · ${n.functions.filter(h=>h.kind==="mutation").length} mutations`,href:"#/capabilities/functions"}),i.jsx(Qs,{label:"Capabilities",value:d.length,detail:"published through AppPort",href:"#/capabilities"}),i.jsx(Qs,{label:"Errors",value:(n.recentErrors??[]).length,detail:`${(n.recentDenials??[]).length} recent denials`,href:"#/activity"})]}),i.jsxs("div",{className:"feltkit-grid feltkit-grid--wide",children:[i.jsxs(se,{title:"Where state lives",children:[i.jsx("p",{className:"feltkit-muted",children:"One FeltDB instance serves this environment. Functions, AppPort capabilities, AppPort Services, sessions and this activity log all read and write it."}),i.jsx(vl,{items:[{label:"Environment",value:n.environment.name},{label:"Storage",value:`FeltDB ${n.instance.feltdbVersion} · ${n.instance.mode} · ${n.instance.durable?"durable":"ephemeral"}`},{label:"Location",value:n.instance.location,mono:!0},{label:"Journal position",value:String(n.instance.sequence??""),mono:!0},{label:"Opened",value:`${xt(n.instance.openedAt)} by pid ${n.instance.pid}`}]}),i.jsxs("div",{children:[i.jsx("p",{className:"feltkit-label",children:"Components on this instance"}),i.jsx("ul",{className:"feltkit-list",children:Object.entries(n.components??{}).map(([h,S])=>i.jsxs("li",{className:"feltkit-list__row",children:[i.jsx("span",{className:"feltkit-list__name",children:h}),i.jsx("span",{className:"feltkit-muted feltkit-small",children:S.join(", ")})]},h))})]})]}),i.jsxs(se,{title:"Recent activity",action:i.jsx("a",{href:"#/activity",children:"All activity →"}),children:[i.jsx(Fs,{label:"Recent activity",emptyTitle:"Nothing has happened yet",items:r.map(h=>({id:h.id,at:h.at,actor:h.principal?.id??(h.kind==="system"?"system":"anonymous"),summary:i.jsxs(i.Fragment,{children:[i.jsx("code",{children:h.name})," ",i.jsxs("span",{className:"feltkit-muted",children:["via ",h.via]}),h.writes?.length?i.jsxs("span",{className:"feltkit-muted",children:[" · ",h.writes.length," write",h.writes.length===1?"":"s"]}):null]}),status:i.jsx(xn,{outcome:h.outcome}),href:`#/activity/${h.id}`}))}),r.length===0&&i.jsx("p",{className:"feltkit-muted feltkit-small",children:"Open the app and make a change. Every query, mutation, capability call and sign-in appears here."})]})]}),n.path&&i.jsx(se,{title:"Path to production",children:i.jsx("ol",{className:"feltkit-steps",children:n.path.map(h=>i.jsxs("li",{children:[i.jsx(Pe,{field:"feltkit.path.step",value:h.state}),i.jsxs("span",{children:[h.link?i.jsx("a",{href:`#/${h.link}`,children:h.step}):i.jsx("strong",{children:h.step})," ",i.jsx("span",{className:"feltkit-steps__detail",children:h.detail})]})]},h.step))})}),i.jsxs("div",{className:"feltkit-grid",children:[i.jsx(se,{title:"Data",action:i.jsx("a",{href:"#/data",children:"Explore →"}),children:n.collections.length===0?i.jsxs(ql,{title:"No collections",children:["Declare one with ",i.jsxs("code",{children:['app.collection("name", ',"{ … }",")"]}),"."]}):i.jsx("ul",{className:"feltkit-list",children:n.collections.map(h=>i.jsx("li",{children:m?i.jsxs("span",{className:"feltkit-list__row",children:[i.jsx("span",{className:"feltkit-list__name",children:h.name}),i.jsx("span",{className:"feltkit-muted",children:n.counts?.[h.name]??"—"})]}):i.jsxs("a",{href:`#/data/${h.name}`,className:"feltkit-list__row",children:[i.jsx("span",{className:"feltkit-list__name",children:h.name}),i.jsx("span",{className:"feltkit-muted",children:n.counts?.[h.name]??"—"})]})},h.name))})}),i.jsx(se,{title:"Capabilities",action:i.jsx("a",{href:"#/capabilities",children:"Inspect →"}),children:d.length===0?i.jsxs(ql,{title:"No capabilities published",children:["Add ",i.jsx("code",{children:'capability: "name.verb"'})," to a query or mutation to publish it through AppPort."]}):i.jsx("ul",{className:"feltkit-list",children:d.map(h=>i.jsx("li",{children:i.jsxs("a",{href:`#/capabilities/${h.name}`,className:"feltkit-list__row",children:[i.jsx("span",{className:"feltkit-list__name",children:h.name}),i.jsx("span",{className:"feltkit-muted feltkit-small",children:h.effect})]})},h.name))})}),i.jsx(se,{title:"Services",action:i.jsx("a",{href:"#/services",children:"Manage →"}),children:b.length===0?i.jsxs(ql,{title:"No services enabled",children:["Enable AppPort Services with ",i.jsxs("code",{children:["feltkit(","{"," services: ","{"," files: true ","}"," ","}",")"]}),"."]}):i.jsx("ul",{className:"feltkit-list",children:b.map(h=>i.jsx("li",{children:i.jsxs("a",{href:`#/services/${h.id}`,className:"feltkit-list__row",children:[i.jsx("span",{children:h.name}),i.jsx(Pe,{field:"feltkit.service.state",value:h.state})]})},h.id))})})]}),i.jsxs(se,{title:"Agent",action:i.jsx("a",{href:"#/agent",children:"Open agent →"}),children:[g.waiting>0&&i.jsx("p",{children:i.jsxs("a",{href:"#/agent",children:[g.waiting," action",g.waiting===1?"":"s"," waiting for approval: review"]})}),g.handoffs>0&&i.jsxs("p",{className:"feltkit-muted feltkit-small",children:[g.handoffs," task(s) wait for a coding agent. Nothing works on them until one claims it: connect one from the Agent screen."]}),g.tasks.length===0?i.jsx("p",{className:"feltkit-muted feltkit-small",children:"No agent tasks yet. Diagnose a failed job from Services, or start one on the Agent screen."}):i.jsx("ul",{className:"feltkit-list",children:g.tasks.map(h=>i.jsx("li",{children:i.jsxs("a",{href:`#/agent/${h.id}`,className:"feltkit-list__row",children:[i.jsx("span",{children:h.objective}),i.jsx(Pe,{field:"feltkit.agent.task",value:h.status})]})},h.id))})]}),f.length>0&&i.jsx(se,{title:"Recent errors and denials",action:i.jsx("a",{href:"#/activity",children:"Investigate →"}),children:i.jsx(Fs,{label:"Recent errors and denials",items:f.map(h=>({id:h.id,at:h.at,summary:i.jsxs(i.Fragment,{children:[i.jsx("code",{children:h.name})," ",h.error?.code?i.jsx("code",{children:h.error.code}):null," ",i.jsx("span",{className:"feltkit-muted",children:h.error?.message})]}),status:i.jsx(xn,{outcome:h.outcome}),href:`#/activity/${h.id}`}))})}),!m&&i.jsx(se,{title:"Development",children:i.jsx(vl,{items:[{label:"Runtime",value:`started ${xt(n.startedAt)} · functions loaded ${xt(n.loadedAt)} · generation ${n.generation}`},{label:"Project",value:n.projectDir,mono:!0},{label:"Endpoints",value:`${n.url}/api · ${n.url}/appport · ${n.url}/mcp`,mono:!0},{label:"Deploy",value:"npx feltkit deploy",mono:!0,hint:"Builds, verifies the production build boots, and writes a Node/Docker artifact."}]})})]})}function Qs({label:n,value:u,detail:d,href:r}){return i.jsxs("a",{className:"feltkit-stat",href:r,children:[i.jsx("span",{className:"feltkit-stat__label",children:n}),i.jsx("span",{className:"feltkit-stat__value",children:u}),i.jsx("span",{className:"feltkit-stat__detail",children:d})]})}function Xm(n,u){const d=new Set;return[...n,...u].filter(r=>d.has(r.id)?!1:(d.add(r.id),!0)).sort((r,f)=>f.id.localeCompare(r.id))}function Ib({collection:n}){const{version:u,overview:d}=Xt(),r=Ve(()=>ae("/collections"),[u]),f=r.data?.collections??[],v=f.find(g=>g.name===n)??f.find(g=>g.owner==="application")??f[0],b=!!v?.editable&&!d?.environment?.production;return i.jsxs("div",{className:"feltkit-page",children:[i.jsx(wt,{title:"Data",subtitle:"Records in this environment's FeltDB instance. Application collections are validated by their schemas; platform collections belong to FeltKit and AppPort Services and are read-only here."}),r.error&&!r.data?i.jsx(Oe,{title:"Collections could not be read",error:r.error,retry:r.reload}):r.data?i.jsxs("div",{className:"feltkit-split",children:[i.jsx("nav",{className:"feltkit-index","aria-label":"Collections",children:["application","platform"].map(g=>{const m=f.filter(h=>g==="application"?h.owner==="application":h.owner!=="application");return m.length?i.jsxs("div",{children:[i.jsx("p",{className:"feltkit-index__heading",children:g==="application"?"Application":"Platform"}),i.jsx("ul",{children:m.map(h=>i.jsx("li",{children:i.jsxs("a",{href:`#/data/${h.name}`,"aria-current":v?.name===h.name?"page":void 0,children:[i.jsx("span",{className:"feltkit-index__name",children:h.name}),i.jsx("span",{className:"feltkit-index__meta",children:h.count})]})},h.name))})]},g):null})}),i.jsx("section",{className:"feltkit-detail","aria-label":v?`Collection ${v.name}`:"Collection",children:v?i.jsx(Wb,{collection:v,editable:b},v.name):i.jsx(ql,{title:"No collections"})})]}):i.jsx(bt,{what:"collections"})]})}function Wb({collection:n,editable:u}){const{version:d}=Xt(),[r,f]=A.useState(""),[v,b]=A.useState(""),[g,m]=A.useState(null),[h,S]=A.useState([]),[p,N]=A.useState(null),[O,L]=A.useState({busy:!1,error:null}),[w,U]=A.useState(null),D=g?`&field=${encodeURIComponent(g.field)}&eq=${encodeURIComponent(g.value)}`:"",Q=Ve(()=>ae(`/collections/${encodeURIComponent(n.name)}?limit=50${D}`),[n.name,D,d]);A.useEffect(()=>{Q.data&&(S(Q.data.records),N(Q.data.nextCursor))},[Q.data]);const J=A.useMemo(()=>{const ne=n.schema?.properties?Object.keys(n.schema.properties):[],ge=[...new Set(h.flatMap(W=>Object.keys(W)))].filter(W=>W!=="id"&&W!=="__version");return["id",...(ne.length?ne:ge).slice(0,6),"__version"]},[n.schema,h]),Z=async()=>{if(p){L({busy:!0,error:null});try{const ne=await ae(`/collections/${encodeURIComponent(n.name)}?limit=50&cursor=${encodeURIComponent(p)}${D}`);S(ge=>[...ge,...ne.records]),N(ne.nextCursor),L({busy:!1,error:null})}catch(ne){L({busy:!1,error:ne})}}};return i.jsxs(i.Fragment,{children:[i.jsx(wt,{title:i.jsx("code",{children:n.name}),subtitle:`${n.owner==="application"?"Application collection":`Owned by ${n.owner}`} · ${n.count} record${n.count===1?"":"s"}${n.description?` · ${n.description}`:""}`,status:n.editable?null:i.jsx(Ge,{tone:"neutral",label:"Read-only"}),actions:u?i.jsx(Ce,{variant:"primary",label:"New record",onClick:()=>U("new")}):null}),n.schema&&i.jsxs("details",{className:"feltkit-details",children:[i.jsx("summary",{children:"Schema"}),i.jsx(Si,{schema:n.schema,label:`${n.name} schema`}),i.jsx("p",{className:"feltkit-muted feltkit-small",children:"Enforced by FeltKit on every write through ctx.db. FeltDB stores JSON documents and adds id and __version."})]}),i.jsx(Ym,{label:`Filter ${n.name}`,idPrefix:`filter-${n.name}`,filters:[{id:"field",label:"Field",type:"select",value:r,options:[{value:"",label:"Choose a field"},...J.map(ne=>({value:ne,label:ne}))]},{id:"value",label:"Equals",type:"text",value:v,placeholder:"value"}],onChange:(ne,ge)=>ne==="field"?f(ge):b(ge),onSubmit:()=>m(r&&v!==""?{field:r,value:v}:null),onClear:()=>(m(null),f(""),b("")),applied:g?1:0,result:Q.data?g?`${h.length}${p?"+":""} records match ${g.field} = ${g.value}`:`${h.length}${p?"+":""} records shown`:"",applyLabel:"Apply"}),i.jsx(dt,{label:`${n.name} records`,columns:J.map(ne=>({id:ne,header:ne})),rows:h.map(ne=>({key:ne.id,cells:Object.fromEntries(J.map(ge=>[ge,i.jsx(Pb,{value:ne[ge],mono:ge==="id"||ge==="__version"},ge)])),onSelect:()=>U(ne),selected:w!=="new"&&w?.id===ne.id})),loading:Q.loading,loadingWhat:"records",error:Q.error&&!Q.data?{title:"Records could not be read",...da(Q.error,Q.reload)}:null,noMatch:!!g,noMatchTitle:"No records match",noMatchBody:"Try another value, or clear the filter.",emptyTitle:"No records yet",emptyBody:n.owner==="application"?"Records appear here as soon as a mutation writes them.":void 0}),h.length>0&&i.jsx(Vb,{label:`${n.name} pages`,hasNext:!!p,onNext:()=>{Z()},nextLabel:O.busy?"Loading…":"Load more",summary:`${h.length} shown${p?"; more exist":""}`}),O.error?i.jsx(Oe,{title:"The next page could not be read",error:O.error,retry:()=>{Z()}}):null,w&&i.jsx(tp,{collection:n,record:w==="new"?null:w,editable:u,onClose:()=>U(null),onSaved:()=>(U(null),Q.reload())})]})}function Pb({value:n,mono:u}){if(n==null)return i.jsx("span",{className:"feltkit-muted",children:"—"});if(typeof n=="boolean")return i.jsx("code",{children:String(n)});if(typeof n=="number"&&n>1e12&&n<1e13)return i.jsx("span",{title:String(n),children:new Date(n).toLocaleString()});if(typeof n=="object")return i.jsx("span",{className:"feltkit-mono",children:JSON.stringify(n).slice(0,80)});const d=String(n),r=d.length>60?`${d.slice(0,60)}…`:d;return u?i.jsx("span",{className:"feltkit-mono",children:r}):i.jsx("span",{title:d.length>60?d:void 0,children:r})}function ep(n){const u={};for(const[d,r]of Object.entries(n?.properties??{}))(n.required??[]).includes(d)&&(u[d]=r.type==="number"||r.type==="integer"?/At$/.test(d)?Date.now():0:r.type==="boolean"?!1:"");return u}function tp({collection:n,record:u,editable:d,onClose:r,onSaved:f}){const v=u?Object.fromEntries(Object.entries(u).filter(([Q])=>Q!=="id"&&Q!=="__version")):ep(n.schema),[b,g]=A.useState(JSON.stringify(v,null,2)),[m,h]=A.useState(null),[S,p]=A.useState(!1),[N,O]=A.useState(!1),[L,w]=A.useState(null),U=async()=>{h(null);let Q;try{Q=JSON.parse(b)}catch{h({code:"INVALID_JSON",message:"That is not valid JSON."});return}p(!0);try{await ae(u?`/collections/${n.name}/${encodeURIComponent(u.id)}`:`/collections/${n.name}`,{method:u?"PATCH":"POST",body:JSON.stringify({record:Q})}),f()}catch(J){h(J)}finally{p(!1)}},D=async()=>{p(!0),w(null);try{await ae(`/collections/${n.name}/${encodeURIComponent(u.id)}`,{method:"DELETE"}),O(!1),f()}catch(Q){w(Q)}finally{p(!1)}};return i.jsxs(i.Fragment,{children:[i.jsxs(Jr,{id:"record",open:!0,className:"feltkit-dialog-wide",title:u?i.jsx("code",{children:`${n.name} / ${u.id}`}):`New ${n.name} record`,description:u?`Version ${u.__version}. Activity shows what wrote it.`:"Validated against the collection's schema when you create it.",onClose:S?void 0:r,actions:d?i.jsxs(i.Fragment,{children:[u&&i.jsx(Ce,{variant:"danger",label:"Delete record",disabled:S,onClick:()=>(w(null),O(!0))}),i.jsx(Ce,{variant:"ghost",label:"Close",disabled:S,onClick:r}),i.jsx(Ce,{variant:"primary",label:u?"Save changes":"Create record",busy:S,onClick:()=>{U()}})]}):i.jsx(Ce,{label:"Close",onClick:r}),children:[d?i.jsxs(i.Fragment,{children:[i.jsxs(Ke,{tone:"attention",title:"Development edit",children:["Validated against the schema and committed atomically, recorded in Activity as ",i.jsx("code",{children:"admin"})," via ",i.jsx("code",{children:"dashboard"}),". Function access rules do not apply to these edits; this tool is not offered in production."]}),i.jsx(Ne,{id:"record-json",label:"Record (JSON)",multiline:!0,rows:14,value:b,onChange:g,spellcheck:"false"}),m?i.jsx(Oe,{title:u?"Not saved":"Not created",error:m}):null]}):i.jsx(ki,{value:u,max:2e4,label:"Record"}),u&&n.owner!=="application"&&i.jsxs("p",{className:"feltkit-muted feltkit-small",children:[n.owner," owns this collection. Change it through its service or capability so its authorization and audit trail apply: ",i.jsx("a",{href:"#/services",children:"Services"}),"."]}),u&&i.jsx("p",{className:"feltkit-small",children:i.jsx("a",{href:"#/activity",children:"Find what wrote it in Activity →"})})]}),u&&i.jsx(Fr,{id:"record-delete",open:N,title:`Delete ${n.name} / ${u.id}?`,consequences:["The record is removed from FeltDB in one transaction.","Activity records the delete as admin via dashboard.","It cannot be undone from here."],confirmLabel:"Delete record",busy:S,error:L?da(L):null,onConfirm:()=>{D()},onCancel:()=>O(!1)})]})}const lp=(n,u)=>n==="*"||n===u||n.endsWith(".*")&&u.startsWith(n.slice(0,-1));function ap(n,u){return Object.entries(n??{}).filter(([,d])=>d.some(r=>lp(r,u))).map(([d])=>d)}function Zm(n){if(!n||n.type!=="object")return{};const u={};for(const d of n.required??[]){const r=n.properties?.[d]??{};u[d]=r.type==="boolean"?!0:r.type==="number"||r.type==="integer"?0:""}return u}function np({selected:n}){const{version:u,overview:d}=Xt(),r=Ve(()=>ae("/capabilities"),[u]),f=r.data?.capabilities??[],v=d?.functions??[],[b,g]=A.useState(n==="functions"||n?.includes(":")?"functions":"capabilities"),m=b==="capabilities"?f:v,h=m.find(S=>S.name===n)??m[0];return i.jsxs("div",{className:"feltkit-page",children:[i.jsx(wt,{title:"Capabilities",subtitle:"What this application can do. Capabilities are published through AppPort, discoverable by other applications and agents (MCP), and every invocation passes the same authorization as any other caller."}),i.jsx(Hm,{label:"Capabilities and functions",idPrefix:"capabilities",panelId:"capabilities-panel",active:b,onSelect:S=>{g(S),yl(S==="functions"?"capabilities/functions":"capabilities")},tabs:[{id:"capabilities",label:"AppPort capabilities",badge:String(f.length)},{id:"functions",label:"All functions",badge:String(v.length)}]}),i.jsx(Lm,{id:"capabilities-panel",idPrefix:"capabilities",active:b,children:r.error&&!r.data?i.jsx(Oe,{title:"Capabilities could not be read",error:r.error,retry:r.reload}):r.data?i.jsxs("div",{className:"feltkit-split",children:[i.jsx("nav",{className:"feltkit-index","aria-label":b==="capabilities"?"Capabilities":"Functions",children:m.length===0?i.jsx("p",{className:"feltkit-muted feltkit-small",children:"None published yet."}):i.jsx("ul",{children:m.map(S=>i.jsx("li",{children:i.jsxs("a",{href:`#/capabilities/${S.name}`,"aria-current":h?.name===S.name?"page":void 0,children:[i.jsx("span",{className:"feltkit-index__name",children:S.name}),i.jsx("span",{className:"feltkit-index__meta",children:b==="functions"?S.kind:`v${S.version}`})]})},S.name))})}),i.jsx("section",{className:"feltkit-detail","aria-label":h?h.name:"Detail",children:h?b==="capabilities"?i.jsx(ip,{capability:h,roles:d?.roles??{},mcpTools:r.data.mcp?.tools??[],devUsers:d?.devUsers??[],development:d?.environment?.development},h.name):i.jsx(sp,{fn:h,roles:d?.roles??{},devUsers:d?.devUsers??[],development:d?.environment?.development},h.name):i.jsx(ql,{title:b==="capabilities"?"No capabilities":"No functions",children:b==="capabilities"?i.jsxs(i.Fragment,{children:["Publish a query or mutation with ",i.jsxs("code",{children:["capability: ","{",' name: "tasks.complete", description: "…" ',"}"]})," and a returns schema."]}):i.jsxs(i.Fragment,{children:["Export ",i.jsx("code",{children:"app.query()"})," or ",i.jsx("code",{children:"app.mutation()"})," from a module in ",i.jsx("code",{children:"feltkit/"}),"."]})})})]}):i.jsx(bt,{what:"capabilities"})})]})}function Km({required:n,roles:u}){return n.length?i.jsx(i.Fragment,{children:n.map(d=>i.jsxs("span",{children:[i.jsx("code",{children:d})," ",i.jsxs("span",{className:"feltkit-muted",children:["granted to ",ap(u,d).join(", ")||"no role"]})]},d))}):i.jsx(i.Fragment,{children:"any signed-in principal"})}function ip({capability:n,roles:u,mcpTools:d,devUsers:r,development:f}){const v=d.find(b=>b.replace(/_/g,".").includes(n.name))??null;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"feltkit-stack",children:[i.jsxs("h2",{className:"feltkit-panel__title",children:[i.jsx("code",{children:n.name})," ",i.jsxs("span",{className:"feltkit-muted feltkit-small",children:["v",n.version," · ",n.effect]})]}),i.jsx("p",{children:n.description??i.jsx("span",{className:"feltkit-muted",children:"No description. Add one so agents and other applications know what this does."})})]}),i.jsxs(se,{title:"Contract",children:[i.jsx(vl,{items:[{label:"Requires",value:i.jsx(Km,{required:n.authorization,roles:u})},{label:"Implemented by",value:n.function?i.jsx("a",{href:`#/capabilities/${n.function.name}`,children:i.jsx("code",{children:n.function.name})}):null},{label:"Services used",value:n.services?.length?n.services.join(", "):"none observed"},{label:"Idempotency",value:n.idempotency??null},{label:"Reachable at",value:`POST /appport${v?` · MCP tool ${v}`:""}`,mono:!0}]}),i.jsxs("div",{className:"feltkit-grid",children:[i.jsxs("div",{children:[i.jsx("p",{className:"feltkit-label",children:"Input"}),i.jsx(Si,{schema:n.input,label:"Input fields"})]}),i.jsxs("div",{children:[i.jsx("p",{className:"feltkit-label",children:"Output"}),i.jsx(Si,{schema:n.output,label:"Output fields"})]})]})]}),i.jsx(se,{title:"Recent invocations",children:i.jsx(Fs,{label:`Recent invocations of ${n.name}`,emptyTitle:"Not invoked through AppPort yet",items:(n.recent??[]).map(b=>({id:b.id,at:b.at,actor:b.principal??"anonymous",summary:i.jsxs(i.Fragment,{children:["via ",b.via," · ",b.durationMs," ms ",b.error?i.jsx("code",{children:b.error.code}):null]}),status:i.jsx(xn,{outcome:b.outcome}),href:`#/activity/${b.id}`}))})}),f&&i.jsx(Jm,{id:`invoke-${n.name}`,title:"Invoke through AppPort",note:"Runs through AppPort's dispatch pipeline with a short-lived session for the identity you choose. The same authorization applies as for any agent or application. Input is validated against the contract before authorization runs.",example:Zm(n.input),devUsers:r,submitLabel:"Invoke",run:(b,g)=>ae("/capabilities/invoke",{method:"POST",body:JSON.stringify({capability:n.name,version:n.version,input:b,as:g})})})]})}function sp({fn:n,roles:u,devUsers:d,development:r}){const f=n.access==="public"||n.access==="authenticated"?[]:[n.access];return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"feltkit-stack",children:[i.jsxs("h2",{className:"feltkit-panel__title",children:[i.jsx("code",{children:n.name})," ",i.jsxs("span",{className:"feltkit-muted feltkit-small",children:[n.kind,n.capability?` · published as ${n.capability.name}`:""]})]}),i.jsx("p",{className:"feltkit-muted",children:n.description??(n.kind==="query"?"Read-only: its database handle cannot write.":"All writes commit in one FeltDB transaction, or none do.")})]}),i.jsxs(se,{title:"Contract",children:[i.jsx(vl,{items:[{label:"Access",value:n.access==="public"?"anyone, including anonymous callers":i.jsx(Km,{required:f,roles:u})},{label:"Endpoint",value:`POST /api/${n.kind}/${n.name}`,mono:!0}]}),i.jsxs("div",{className:"feltkit-grid",children:[i.jsxs("div",{children:[i.jsx("p",{className:"feltkit-label",children:"Arguments"}),i.jsx(Si,{schema:n.args,label:"Arguments"})]}),i.jsxs("div",{children:[i.jsx("p",{className:"feltkit-label",children:"Returns"}),n.returns?i.jsx(Si,{schema:n.returns,label:"Returns"}):i.jsx("span",{className:"feltkit-muted",children:"not declared"})]})]})]}),r&&i.jsx(Jm,{id:`run-${n.name}`,title:`Run ${n.kind}`,note:"Runs as the identity you choose, through the same validation and authorization as a request from the app.",example:Zm(n.args),devUsers:d,submitLabel:`Run ${n.kind}`,run:(v,b)=>ae("/functions/run",{method:"POST",body:JSON.stringify({name:n.name,args:v,as:b})})})]})}function Jm({id:n,title:u,note:d,example:r,devUsers:f,submitLabel:v,run:b}){const[g,m]=A.useState(JSON.stringify(r,null,2)),[h,S]=A.useState(f[0]?.id??"anonymous"),[p,N]=A.useState(null),[O,L]=A.useState(null),[w,U]=A.useState(!1),D=p?.ok===!0,Q=n.replace(/[^a-z0-9-]/gi,"-");return i.jsxs(se,{title:u,children:[i.jsx("p",{className:"feltkit-muted feltkit-small",children:d}),i.jsxs(Bl,{label:u,submitLabel:v,busy:w,onSubmit:async()=>{L(null),N(null);let J;try{J=JSON.parse(g||"{}")}catch{L({code:"INVALID_JSON",message:"That is not valid JSON."});return}U(!0);try{N(await b(J,h))}catch(Z){L(Z)}finally{U(!1)}},children:[i.jsx(kt,{id:`${Q}-as`,label:"Act as",value:h,onChange:S,options:[...f.map(J=>({value:J.id,label:`${J.name??J.id} · ${J.roles.join(", ")}`})),{value:"anonymous",label:"anonymous"}]}),i.jsx(Ne,{id:`${Q}-input`,label:"Input (JSON)",multiline:!0,rows:6,value:g,onChange:m,spellcheck:"false"})]}),O?i.jsx(Oe,{title:"Not run",error:O}):null,p&&i.jsxs("div",{className:"feltkit-stack",role:"status",children:[i.jsxs("span",{className:"feltkit-row",children:[i.jsx(xn,{outcome:D?"success":p.error?.code==="FORBIDDEN"||p.error?.code==="UNAUTHORIZED"?"denied":"error"}),p.requestId?i.jsx("code",{children:p.requestId}):null,!D&&p.error?.code?i.jsx("code",{children:p.error.code}):null]}),i.jsx(ki,{value:D?p.output??p.value:p.error,label:"Result"})]})]})}function Ti(n){const u=n.trim();if(!u||u.startsWith("credential-ref:"))return!1;if(/^(sk-|sk-ant-|sk_live_|sk_test_|rk_live_|xai-|AIza|ghp_|gho_|github_pat_|gsk_|glpat-|xox[abpr]-|hf_|pk_live_)/.test(u))return!0;if(u.length<32||/\s/.test(u)||!/[0-9]/.test(u)||!/[A-Za-z]/.test(u))return!1;const d=new Map;for(const f of u)d.set(f,(d.get(f)??0)+1);let r=0;for(const f of d.values())r-=f/u.length*Math.log2(f/u.length);return r>=4}function sc({credential:n}){return n?n.present?i.jsx(Ge,{tone:"positive",label:"Set",detail:`${n.location??n.variable??"custody"}${n.version&&n.source==="vault"?`, version ${n.version}`:""}`,attrs:{"data-credential":"set",...n.updatedAt?{title:`updated ${n.updatedAt}`}:{}}}):n.state==="revoked"?i.jsx(Ge,{tone:"neutral",label:"Removed",attrs:{"data-credential":"removed"}}):i.jsx(Ge,{tone:"attention",label:"Not set",attrs:{"data-credential":"missing"}}):null}function Wr(n){const u=n?.devUsers??[],[d,r]=A.useState("");return A.useEffect(()=>{!d&&u[0]&&r(u[0].id)},[u,d]),[d,r,u]}function Ws({credentialRef:n,provider:u,as:d,label:r="Set key",onSaved:f}){const[v,b]=A.useState(!1),[g,m]=A.useState(""),[h,S]=A.useState(!1),[p,N]=A.useState(null),[O,L]=A.useState(null),w=`key-${A.useId().replace(/:/g,"")}`,U=async()=>{if(!g.trim())return;S(!0),N(null);const D=g;m("");try{const Q=await ae("/credentials",{method:"POST",body:JSON.stringify({ref:n,value:D,...u?{provider:u}:{},...d?{as:d}:{}})});L(Q.stored),b(!1),f?.(Q.stored)}catch(Q){N(Q)}finally{S(!1)}};return v?i.jsxs("div",{className:"feltkit-stack",children:[i.jsx(Bl,{layout:"inline",label:`Value for ${n}`,submitLabel:"Save",busy:h,onSubmit:()=>{U()},actions:i.jsx(Ce,{variant:"ghost",label:"Cancel",onClick:()=>(m(""),b(!1))}),children:i.jsx(Ne,{id:w,type:"password",label:`Value for ${n}`,hint:"Stored on the server, outside FeltDB. It is never shown again.",autocomplete:"off",spellcheck:"false",value:g,onChange:m,required:!0})}),p?i.jsx(Oe,{title:"Not stored",error:p}):null]}):i.jsxs("span",{className:"feltkit-actions",children:[i.jsx(Ce,{size:"sm",label:r,onClick:()=>b(!0)}),O&&i.jsxs("span",{className:"feltkit-muted feltkit-small",role:"status",children:["Stored (",O.location??"custody",", version ",O.version,")."]})]})}function cp(n){return n.filter(u=>{const d=u.usedBy??[];return d.every(r=>r.startsWith("webhook "))&&(d.length>0||/webhook|signing/i.test(u.ref))})}function up(n){return n.status==="delivered"?null:n.lastError??null}function rp(n){return(u,d="GET",r)=>ae(`/services/manage${u}`,{method:d,headers:{"x-feltkit-as":n},...r!==void 0?{body:JSON.stringify(r)}:d!=="GET"&&d!=="DELETE"?{body:"{}"}:{}})}function Sn(n,u){if(n==null)throw new Error(`${u} was not found or changed meanwhile. Nothing was done.`);return n}const op="A credential reference, like credential-ref:stripe. Set its value under Services → Credentials; the value is never stored here.",dp={files:{title:"Files",description:"File records with ownership and audit. Bytes are stored in this environment's FeltDB instance.",render:n=>i.jsx(jp,{...n})},notifications:{title:"Notifications",description:"Durable in-app notifications. A principal reads only the notifications addressed to it.",render:n=>i.jsx(Sp,{...n})},configuration:{title:"Configuration",description:"Variables and secret references for this environment. Secret values stay in FeltKit's custody.",render:n=>i.jsx(kp,{...n})},apiKeys:{title:"API keys",description:"Durable machine identities. A secret is shown once, when a key is created or rotated. FeltKit accepts a key as an identity holding services.apiKeys.roles.",render:n=>i.jsx(Np,{...n})},webhooks:{title:"Webhooks",description:"Endpoints for signed outbound delivery, with retries and history.",render:n=>i.jsx(Ap,{...n})},jobs:{title:"Jobs",description:"Durable background work. Each job type runs the FeltKit function declared in services.jobs.handlers, as the principal that queued it.",render:n=>i.jsx(Ep,{...n})},schedules:{title:"Schedules",description:"Recurring jobs. Each run queues a job of the schedule's type.",render:n=>i.jsx(Dp,{...n})},intelligence:{title:"Intelligence",description:"The provider, model, endpoint and credential reference for this environment. Configuration only: AppPort Services never runs a model.",render:n=>i.jsx(zp,{...n})}};function fp({id:n,service:u,as:d,picker:r,development:f,summary:v,operations:b}){const{version:g}=Xt(),m=dp[n],h=i.jsx(wt,{title:m?.title??n,crumbs:[{label:"Services",href:"#/services"},{label:m?.title??n}],subtitle:m?.description,actions:r}),S=m?u?u.state==="available"||u.state==="unavailable"?i.jsx(hp,{service:u}):i.jsxs(i.Fragment,{children:[v,f?d?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Acting as ",i.jsx("strong",{children:d}),". AppPort Services' gateway authorizes every operation with this identity's roles, and Activity records it."]}),m.render({as:d,manage:rp(d),version:g})]}):i.jsxs(Ke,{tone:"attention",title:"No development identity",children:["Declare one in ",i.jsxs("code",{children:["feltkit(","{"," dev: ","{"," users ","}"," ","}",")"]}),": service operations are authorized as that identity."]}):i.jsxs(i.Fragment,{children:[b,i.jsx(Ke,{tone:"info",title:`Configuring ${m.title} is a development tool`,children:"Change it in development, or with the service's own API from your application."})]})]}):i.jsx(bt,{what:m.title}):i.jsx(ql,{title:"No such service",children:i.jsx("a",{href:"#/services",children:"Back to Services"})});return i.jsxs("div",{className:"feltkit-page",children:[h,S]})}function hp({service:n}){const u=mp[n.id]??`${n.id}: true`;return i.jsx(se,{title:`Enable ${n.name}`,action:i.jsx(Pe,{field:"feltkit.service.state",value:n.state}),children:n.state==="unavailable"?i.jsx(Ke,{tone:"critical",title:`${n.name} cannot run here`,children:n.detail}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"feltkit-small",children:["Add it to ",i.jsx("code",{children:"services"})," in ",i.jsx("code",{children:"feltkit/app.ts"}),". The backend reloads in place and keeps its state; this screen then manages it."]}),i.jsx(xi,{text:`services: { …, ${u} },`,label:`How to enable ${n.name}`}),i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Its permissions (",n.capabilities.join(", "),") are granted through your roles."]})]})})}const mp={apiKeys:'apiKeys: { roles: ["member"] }',jobs:'jobs: { handlers: { "report.build": "reports:build" } }'},vp=new Set(["text","email","url","number","password","search","tel"]);function za({title:n,fields:u,submitLabel:d,send:r,done:f}){const v=()=>Object.fromEntries(u.map(D=>[D.name,D.value??(D.options?kn(D.options[0]):D.choices?.length&&!D.multi?kn(D.choices[0]):"")])),[b,g]=A.useState(v),[m,h]=A.useState(!1),[S,p]=A.useState(null),[N,O]=A.useState(null),L=`form-${A.useId().replace(/:/g,"")}`,w=D=>Q=>g(J=>({...J,[D]:Q})),U=async()=>{h(!0),p(null),O(null);try{const D=await r(b);O(f?f(D):"Done."),g(v())}catch(D){p(D)}finally{h(!1)}};return i.jsxs(se,{title:n,children:[i.jsx(Bl,{label:n,submitLabel:d,busy:m,onSubmit:()=>{U()},children:u.map(D=>{const Q=`${L}-${D.name}`,J=b[D.name]??"";return D.choices&&D.multi?i.jsx(bp,{id:Q,field:D,value:J,onChange:w(D.name)},D.name):D.choices?i.jsx(gp,{id:Q,field:D,value:J,onChange:w(D.name)},D.name):D.options?i.jsx(kt,{id:Q,name:D.name,label:D.label,hint:D.hint,value:J,onChange:w(D.name),options:D.options,required:D.required},D.name):D.type==="datetime-local"?i.jsx(yp,{id:Q,field:D,value:J,onChange:w(D.name)},D.name):i.jsx(Ne,{id:Q,name:D.name,label:D.label,hint:D.hint,value:J,onChange:w(D.name),type:vp.has(D.type??"text")?D.type??"text":"text",placeholder:D.placeholder,required:D.required,pattern:D.pattern,multiline:D.multiline,rows:D.multiline?3:void 0,autocomplete:"off",spellcheck:"false"},D.name)})}),S?i.jsx(Oe,{title:"Not done",error:S}):null,N?i.jsx(Ke,{tone:"info",title:"Done",children:N}):null]})}function yp({id:n,field:u,value:d,onChange:r}){return i.jsxs("div",{className:"stack-field stack-field--text",children:[i.jsxs("label",{className:"stack-field__label",htmlFor:n,children:[u.label,u.required?i.jsx("span",{className:"stack-field__required","aria-hidden":"true",children:" *"}):null]}),i.jsx("input",{className:"stack-field__control",id:n,name:u.name,type:u.type,value:d,required:u.required,onChange:f=>r(f.target.value),...u.hint?{"aria-describedby":`${n}-hint`}:{}}),u.hint&&i.jsx("p",{className:"stack-field__hint",id:`${n}-hint`,children:u.hint})]})}const kn=n=>typeof n=="string"?n:n.value,Fm=n=>typeof n=="string"?n:n.label,zr="__other__";function gp({id:n,field:u,value:d,onChange:r}){const f=(u.choices??[]).some(h=>kn(h)===d),[v,b]=A.useState(!f&&d!==""),g=v||!u.choices?.length&&!u.strict,m=i.jsx(Ne,{id:`${n}-other`,name:u.name,label:u.choices?.length?`${u.label}: other value`:u.label,hint:u.choices?.length?void 0:u.hint,value:d,onChange:r,placeholder:u.placeholder,required:u.required,pattern:u.pattern,autocomplete:"off",spellcheck:"false"});return u.choices?.length?i.jsxs("div",{className:"feltkit-stack",children:[i.jsx(kt,{id:n,label:u.label,hint:u.hint,required:u.required,value:g?zr:d,onChange:h=>{const S=h===zr;b(S),r(S?"":h)},options:[...u.choices.map(h=>({value:kn(h),label:Fm(h)})),...u.strict?[]:[{value:zr,label:"Other…"}]]}),g&&m]}):u.strict?i.jsx(kt,{id:n,label:u.label,hint:u.placeholder??u.hint,value:"",options:[{value:"",label:u.placeholder??"Nothing to choose",disabled:!0}],required:u.required}):m}function bp({id:n,field:u,value:d,onChange:r}){const f=(u.choices??[]).map(kn),v=Ps(d),b=v.filter(p=>f.includes(p)),g=v.filter(p=>!f.includes(p)),[m,h]=A.useState(g.join(", ")),S=(p,N)=>r([...p,...Ps(N)].join(", "));return i.jsxs($r,{id:n,legend:u.label,hint:u.hint,required:u.required,children:[(u.choices??[]).length>0&&i.jsx("div",{className:"feltkit-choices",children:(u.choices??[]).map((p,N)=>{const O=kn(p);return i.jsx(Js,{id:`${n}-${N}`,label:i.jsx("code",{children:Fm(p)}),checked:b.includes(O),onChange:L=>S(L?[...b,O]:b.filter(w=>w!==O),m)},O)})}),!u.strict&&i.jsx(Ne,{id:`${n}-others`,label:f.length?"Others, comma separated":"Values, comma separated",value:m,placeholder:u.placeholder,autocomplete:"off",spellcheck:"false",required:u.required&&b.length===0,onChange:p=>(h(p),S(b,p))})]})}function _n(n,u=0){return Ve(()=>ae("/services/catalog"),[n,u]).data}function fa({title:n,read:u,deps:d,empty:r,columns:f,actions:v,after:b,tools:g}){const m=Ve(u,d),h=m.data??[];return i.jsxs(se,{title:n,action:i.jsxs(i.Fragment,{children:[g?.(m.reload),i.jsx(Ce,{size:"sm",variant:"ghost",label:"Refresh",busy:m.loading&&!!m.data,onClick:m.reload})]}),children:[i.jsx(dt,{label:n,columns:[...f.map(([S])=>({id:S,header:S})),...v?[{id:"__actions",header:"Actions"}]:[]],rows:h.map((S,p)=>({key:S.id??String(p),cells:{...Object.fromEntries(f.map(([N,O])=>[N,O(S)])),...v?{__actions:i.jsx("span",{className:"feltkit-actions",children:v(S,m.reload)})}:{}}})),loading:m.loading,error:m.error&&!m.data?{title:`${n} could not be read`,...da(m.error,m.reload)}:null,emptyTitle:r}),b]})}const cl=n=>n?i.jsx("span",{title:n,children:xt(n)}):null,Rt=n=>n?i.jsx("code",{children:n}):null;function pp(n,u){let d;try{d=JSON.parse(n||"{}")}catch{throw new Error(`The ${u} is not valid JSON.`)}if(!d||typeof d!="object"||Array.isArray(d))throw new Error(`The ${u} must be a JSON object, like {"invoice": 7}.`);return d}const Ps=n=>n.split(",").map(u=>u.trim()).filter(Boolean),Hr=({done:n})=>i.jsx(Ee,{label:"Run due work now",action:()=>ae("/services/run",{method:"POST",body:"{}"}),done:n});function jp({as:n,manage:u,version:d}){const[r,f]=A.useState(0),[v,b]=A.useState(null),[g,m]=A.useState(!1),[h,S]=A.useState(null),[p,N]=A.useState(null),[O,L]=A.useState(0),w=async()=>{if(v){m(!0),S(null),N(null);try{const D=await xp(v),{file:Q}=await ae("/services/files",{method:"POST",body:JSON.stringify({as:n,name:v.name,contentType:v.type||void 0,contentBase64:D})});N(`Uploaded ${Q.name} (${Q.size.toLocaleString()} bytes).`),b(null),L(J=>J+1),f(J=>J+1)}catch(D){S(D)}finally{m(!1)}}},U=async D=>{const{file:Q,contentBase64:J}=await ae(`/services/files/${encodeURIComponent(D.id)}/content?as=${encodeURIComponent(n)}`),Z=Uint8Array.from(atob(J),W=>W.charCodeAt(0)),ne=URL.createObjectURL(new Blob([Z],{type:Q.contentType??"application/octet-stream"}));Object.assign(document.createElement("a"),{href:ne,download:Q.name}).click(),setTimeout(()=>URL.revokeObjectURL(ne),1e3)};return i.jsxs(i.Fragment,{children:[i.jsxs(se,{title:"Upload a file",children:[i.jsx(Bl,{label:"Upload a file",layout:"inline",submitLabel:"Upload",busy:g,onSubmit:()=>{w()},children:i.jsxs("div",{className:"stack-field stack-field--text",children:[i.jsx("label",{className:"stack-field__label",htmlFor:"files-upload",children:"File"}),i.jsx("input",{className:"stack-field__control",id:"files-upload",type:"file",required:!0,onChange:D=>b(D.target.files?.[0]??null),"aria-describedby":"files-upload-hint"},O),i.jsxs("p",{className:"stack-field__hint",id:"files-upload-hint",children:["Stored in this environment's FeltDB instance as ",n,", through the Files service your functions use (ctx.services.files)."]})]})}),h?i.jsx(Oe,{title:"Not uploaded",error:h}):null,p?i.jsx(Ke,{tone:"info",title:"Uploaded",children:p}):null]}),i.jsx(fa,{title:"Files",read:()=>u("/_appport/files"),deps:[n,d,r],empty:"No files yet",columns:[["Name",D=>i.jsx("strong",{children:D.name})],["Owner",D=>Rt(D.owner)],["Type",D=>D.contentType??null],["Size",D=>typeof D.size=="number"?D.size.toLocaleString():null],["Updated",D=>cl(D.updatedAt??D.createdAt)]],actions:(D,Q)=>i.jsxs(i.Fragment,{children:[i.jsx(Ee,{label:"Download",action:()=>U(D)}),i.jsx(Im,{current:D.name,label:`New name for ${D.name}`,onSave:J=>u(`/_appport/files/${encodeURIComponent(D.id)}`,"PATCH",{name:J}),done:Q}),i.jsx(Ee,{label:"Delete",variant:"danger",confirm:{title:`Delete ${D.name}?`,consequences:["The file record and its bytes are deleted from this environment's FeltDB instance.","Anything that links to it stops working."],confirmLabel:"Delete file",requireText:D.name},action:()=>ae(`/services/files/${encodeURIComponent(D.id)}?as=${encodeURIComponent(n)}`,{method:"DELETE"}),done:Q})]})})]})}function xp(n){return new Promise((u,d)=>{const r=new FileReader;r.onload=()=>u(String(r.result).replace(/^data:[^,]*,/,"")),r.onerror=()=>d(r.error),r.readAsDataURL(n)})}function Im({current:n,label:u,onSave:d,done:r,edit:f="Rename"}){const[v,b]=A.useState(!1),[g,m]=A.useState(n),[h,S]=A.useState(!1),[p,N]=A.useState(null),O=`rename-${A.useId().replace(/:/g,"")}`;if(!v)return i.jsx(Ce,{size:"sm",label:f,onClick:()=>(m(n),N(null),b(!0))});const L=async()=>{if(g.trim()){N(null),S(!0);try{Sn(await d(g.trim()),"The record"),b(!1),r()}catch(w){N(w)}finally{S(!1)}}};return i.jsxs("div",{className:"feltkit-stack",children:[i.jsx(Bl,{label:u,layout:"inline",submitLabel:"Save",busy:h,onSubmit:()=>{L()},actions:i.jsx(Ce,{variant:"ghost",label:"Cancel",onClick:()=>b(!1)}),children:i.jsx(Ne,{id:O,label:u,value:g,onChange:m,required:!0,spellcheck:"false"})}),p?i.jsx(Oe,{title:"Not saved",error:p}):null]})}function Sp({as:n,manage:u,version:d}){const[r,f]=A.useState(0),v=()=>f(m=>m+1),b=_n(d,r),g=Xt().overview?.devUsers??[];return i.jsxs(i.Fragment,{children:[i.jsx(za,{title:"Send a notification",submitLabel:"Send",fields:[{name:"recipient",label:"Recipient",required:!0,value:n,choices:g.map(m=>({value:m.id,label:`${m.name??m.id} (${m.id})`})),hint:"A principal id. Only the recipient can read it."},{name:"type",label:"Type",required:!0,placeholder:"task.assigned",choices:b?.notificationTypes.all??[],hint:b?.notificationTypes.declared.length?"Declared in services.notifications.types, plus types already sent.":"Declare your types in services: { notifications: { types: [...] } } to list them here."},{name:"title",label:"Title",required:!0},{name:"priority",label:"Priority",options:["normal","low","high","urgent"]}],send:async m=>{await u("/_appport/notifications","POST",m),v()},done:()=>"Notification sent."},b?"ready":"loading"),i.jsx(fa,{title:`Notifications for ${n}`,read:()=>u(`/_appport/notifications?limit=50&recipient=${encodeURIComponent(n)}`).then(m=>m.items),deps:[n,d,r],empty:"No notifications for this identity",columns:[["Title",m=>i.jsx("strong",{children:m.title??m.type})],["Type",m=>Rt(m.type)],["Priority",m=>m.priority],["State",m=>m.dismissedAt?i.jsx(Ge,{tone:"neutral",label:"Dismissed"}):i.jsx(Ge,{field:"appport.notification.status",value:m.readAt&&m.status==="delivered"?"read":m.status,attrs:{"data-state":m.status}})],["Created",m=>cl(m.createdAt)]],actions:(m,h)=>{const S=`/_appport/notifications/${encodeURIComponent(m.id)}`;return i.jsxs(i.Fragment,{children:[!m.readAt&&i.jsx(Ee,{label:"Mark read",action:async()=>Sn(await u(`${S}/read`,"POST"),"The notification"),done:h}),!m.dismissedAt&&i.jsx(Ee,{label:"Dismiss",action:async()=>Sn(await u(`${S}/dismiss`,"POST"),"The notification"),done:h}),i.jsx(Ee,{label:"Delete",variant:"danger",confirm:{title:`Delete the notification ${m.title??m.type}?`,consequences:["The notification and its deliveries are deleted.",`${m.recipient??"Its recipient"} no longer sees it.`],confirmLabel:"Delete notification"},action:()=>u(S,"DELETE"),done:h})]})}})]})}const Sm={pattern:"[A-Z][A-Z0-9_]*",placeholder:"STRIPE_ACCOUNT",hint:"Uppercase letters, digits and underscores, starting with a letter."};function kp({as:n,manage:u,version:d}){const[r,f]=A.useState(0),v=()=>f(w=>w+1),b=_n(d,r),g=Ve(()=>u("/v1/configuration"),[n,d,r]),m=[...new Set((g.data?.secrets??[]).map(w=>w.credentialRef))],h=Ve(()=>m.length?u(`/v1/configuration/credentials/status?${m.map(w=>`ref=${encodeURIComponent(w)}`).join("&")}`):Promise.resolve([]),[m.join(","),r]),S=new Map((h.data??[]).map(w=>[w.ref,w]));if(g.error&&!g.data)return i.jsx(Oe,{title:"Configuration could not be read",error:g.error,retry:g.reload});if(!g.data)return i.jsx(bt,{what:"configuration"});const{variables:p,secrets:N,declarations:O}=g.data,L=O.filter(w=>w.required&&!p.some(U=>U.name===w.name)&&!N.some(U=>U.name===w.name)).length;return i.jsxs(i.Fragment,{children:[L===0?i.jsx("p",{className:"feltkit-small",children:i.jsx(Ge,{tone:"positive",label:"Every required value is set"})}):i.jsx(Ke,{tone:"attention",title:`${L} required value${L===1?"":"s"} missing`,children:"Add them below: the application declares them as required."}),i.jsx(se,{title:"Variables",children:i.jsx(dt,{label:"Variables",columns:[{id:"name",header:"Name"},{id:"value",header:"Value"},{id:"updated",header:"Updated"},{id:"actions",header:"Actions"}],rows:p.map(w=>({key:w.name,cells:{name:Rt(w.name),value:i.jsx("code",{children:w.value}),updated:cl(w.updatedAt),actions:i.jsxs("span",{className:"feltkit-actions",children:[i.jsx(Im,{current:w.value,edit:"Edit",label:`New value for ${w.name}`,onSave:U=>u(`/v1/configuration/variables/${encodeURIComponent(w.name)}`,"PATCH",{value:U,required:!1}),done:v}),i.jsx(Ee,{label:"Delete",variant:"danger",confirm:{title:`Delete ${w.name}?`,consequences:["Code reading this variable no longer gets a value."],confirmLabel:"Delete variable",requireText:w.name},action:()=>u(`/v1/configuration/variables/${encodeURIComponent(w.name)}`,"DELETE"),done:v})]})}})),emptyTitle:"No variables yet"})}),i.jsx(za,{title:"Add a variable",submitLabel:"Add variable",fields:[{name:"name",label:"Name",required:!0,...Sm},{name:"value",label:"Value",required:!0,hint:"Not for secrets: add a secret reference below instead."}],send:async w=>{if(Ti(w.value))throw new Error("This looks like a secret. Add it as a secret reference instead, and set its value; a variable is stored in FeltDB.");await u("/v1/configuration/variables","POST",{...w,required:!1}),v()},done:()=>"Variable added."}),i.jsx(se,{title:"Secrets",children:i.jsx(dt,{label:"Secrets",columns:[{id:"name",header:"Name"},{id:"ref",header:"Reference"},{id:"value",header:"Value"},{id:"updated",header:"Updated"},{id:"actions",header:"Actions"}],rows:N.map(w=>{const U=S.get(w.credentialRef);return{key:w.name,cells:{name:Rt(w.name),ref:Rt(w.credentialRef),value:U?i.jsx(Pe,{field:"feltkit.secret.state",value:U.state,detail:U.state==="set"&&U.version?`v${U.version}`:void 0}):i.jsx(Ge,{tone:"unknown",label:"Unknown"}),updated:cl(w.updatedAt),actions:i.jsxs("span",{className:"feltkit-actions",children:[i.jsx(Ws,{credentialRef:w.credentialRef,label:U?.state==="set"?"Replace value":"Set value",as:n,onSaved:v}),i.jsx(Ee,{label:"Delete",variant:"danger",confirm:{title:`Delete the binding ${w.name}?`,consequences:["Code reading this secret no longer gets a value.",`The stored value of ${w.credentialRef} is kept.`],confirmLabel:"Delete binding"},action:()=>u(`/v1/configuration/secrets/${encodeURIComponent(w.name)}`,"DELETE"),done:v})]})}}}),emptyTitle:"No secrets yet"})}),i.jsx(za,{title:"Add a secret reference",submitLabel:"Add secret",fields:[{name:"name",label:"Name",required:!0,...Sm},{name:"credentialRef",label:"Credential reference",required:!0,pattern:"credential-ref:.+",placeholder:"credential-ref:stripe",choices:(b?.credentials??[]).map(w=>({value:w.ref,label:`${w.ref}${w.present?"":" (not set)"}`})),hint:op}],send:async w=>{await u("/v1/configuration/secrets","POST",{...w,required:!1}),v()},done:()=>"Secret reference added. Set its value in the table above."},b?"ready":"loading")]})}function _p({lead:n,value:u,onDone:d}){return i.jsx(Ke,{tone:"attention",title:`${n} Copy this secret now: it is not shown again.`,actions:i.jsxs(i.Fragment,{children:[i.jsx(_i,{text:u,label:"Copy secret"}),i.jsx(Ce,{size:"sm",variant:"ghost",label:"Done",onClick:d})]}),children:i.jsx("code",{className:"feltkit-secret",children:u})})}function Np({manage:n,version:u}){const[d,r]=A.useState(0),f=_n(u),[v,b]=A.useState(null),[g,m]=A.useState(null),h=()=>r(p=>p+1),S="/_appport/api/keys";return i.jsxs(i.Fragment,{children:[v&&i.jsx(_p,{lead:v.lead,value:v.value,onDone:()=>b(null)}),i.jsx(za,{title:"Create an API key",submitLabel:"Create API key",fields:[{name:"name",label:"Key name",required:!0},{name:"capabilities",label:"Only these capabilities (optional)",multi:!0,choices:f?.capabilities??[],placeholder:"files.read, jobs.create",hint:"A ceiling: the key's roles still decide. None chosen: no ceiling."},{name:"expiresAt",label:"Expires at (optional)",type:"datetime-local"}],send:async p=>{const N=Ps(p.capabilities??""),O=await n(S,"POST",{name:p.name,...N.length?{restrictions:{capabilities:N}}:{},...p.expiresAt?{expiresAt:new Date(p.expiresAt).toISOString()}:{}});return O?.secret&&b({lead:`Created ${p.name}.`,value:O.secret}),h(),O},done:()=>"API key created."},f?"ready":"loading"),i.jsx(fa,{title:"API keys",read:()=>n(S),deps:[u,d],empty:"No API keys yet",columns:[["Name",p=>i.jsx("strong",{children:p.name})],["Prefix",p=>Rt(p.keyPrefix)],["Ceiling",p=>p.restrictions?p.restrictions.capabilities.length?p.restrictions.capabilities.join(", "):"denies everything":"none"],["Expires",p=>cl(p.expiresAt)],["Last used",p=>cl(p.lastUsedAt)],["State",p=>p.rotatedTo?i.jsx(Ge,{tone:"neutral",label:"Replaced"}):i.jsx(Ge,{field:"appport.api_key.revoked",value:p.status!=="active",attrs:{"data-state":p.status}})]],actions:(p,N)=>i.jsxs(i.Fragment,{children:[p.status==="active"&&!p.rotatedTo&&i.jsx(Ee,{label:"Rotate",confirm:{title:`Rotate ${p.name}?`,consequences:["A new secret is issued and shown once.","The current secret is revoked now: requests with it are refused."],confirmLabel:"Rotate key"},action:async()=>{const O=Sn(await n(`${S}/${encodeURIComponent(p.id)}/rotate`,"POST",{overlapSeconds:0}),`The API key ${p.name}`);b({lead:`Rotated ${p.name}.`,value:O.secret})},done:N}),i.jsx(Ce,{size:"sm",label:"Audit",onClick:()=>m(p)}),p.status==="active"&&i.jsx(Ee,{label:"Revoke",variant:"danger",confirm:{title:`Revoke ${p.name}?`,consequences:["Requests with this key are refused from now on.","A revoked key cannot be restored; create a new one."],confirmLabel:"Revoke key",requireText:p.name},action:()=>n(`${S}/${encodeURIComponent(p.id)}`,"DELETE"),done:N})]})}),g&&i.jsx(fa,{title:`Audit for ${g.name}`,read:()=>n(`${S}/${encodeURIComponent(g.id)}/audit`).then(p=>Array.isArray(p)?p:p.items??[]),deps:[g.id,d],empty:"No events",columns:[["Time",p=>cl(p.timestamp)],["Event",p=>Rt(p.type)],["Result",p=>p.result],["Principal",p=>Rt(p.principalId)]]})]})}const km="generate";function Tp(){const n=crypto.getRandomValues(new Uint8Array(32));return btoa(String.fromCharCode(...n)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ap({as:n,manage:u,version:d}){const[r,f]=A.useState(0),v=()=>f(m=>m+1),b=_n(d,r),g=b?.credentials??[];return i.jsxs(i.Fragment,{children:[i.jsx(za,{title:"Register an endpoint",submitLabel:"Register endpoint",fields:[{name:"url",label:"Endpoint URL",type:"url",required:!0,placeholder:"https://example.com/webhook"},{name:"events",label:"Events",required:!0,multi:!0,placeholder:"invoice.created, invoice.paid",choices:b?.webhookEvents.all??[],hint:b?.webhookEvents.declared.length?"Declared in services.webhooks.events; your mutations emit them with ctx.afterCommit.webhooks.emit().":"Declare your events in services: { webhooks: { events: [...] } } to list them here."},{name:"signingCredentialRef",label:"Signing secret",required:!0,pattern:"credential-ref:.+",placeholder:"credential-ref:webhook-signing",choices:[{value:km,label:"Generate a new signing secret"},...cp(g).map(m=>({value:m.ref,label:`${m.ref}${m.present?"":" (not set)"}`}))],hint:"A new secret is stored in FeltKit's custody and shown to you once, to configure the receiver."}],send:async m=>{const h=Ps(m.events??"");if(!h.length)throw new Error("Choose at least one event.");let S=m.signingCredentialRef,p=null;return S===km&&(S=`credential-ref:webhook-${new URL(m.url).hostname.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"")}-${Date.now().toString(36)}`,p=Tp(),await ae("/credentials",{method:"POST",body:JSON.stringify({ref:S,value:p,as:n})})),await u("/_appport/webhooks","POST",{url:m.url,events:h,signingCredentialRef:S}),v(),{ref:S,secret:p}},done:m=>m.secret?i.jsxs(i.Fragment,{children:["Endpoint registered, signing with ",i.jsx("code",{children:m.ref}),". Give the receiver this secret now; it is not shown again: ",i.jsx("code",{className:"feltkit-secret",children:m.secret})," ",i.jsx(_i,{text:m.secret,label:"Copy secret"})]}):i.jsxs(i.Fragment,{children:["Endpoint registered, signing with ",i.jsx("code",{children:m.ref}),"."]})},b?"ready":"loading"),i.jsx(fa,{title:"Endpoints",read:()=>u("/_appport/webhooks"),deps:[n,d,r],empty:"No endpoints yet",columns:[["URL",m=>Rt(m.url)],["Events",m=>(m.events??[]).join(", ")||null],["Signing secret",m=>Rt(m.signingCredentialRef)],["Created",m=>cl(m.createdAt)],["Status",m=>i.jsx(Ge,{field:"appport.webhook.disabled",value:!!m.disabledAt})]],actions:(m,h)=>m.disabledAt?null:i.jsx(Ee,{label:"Disable",variant:"danger",confirm:{title:`Disable ${m.url}?`,consequences:["Nothing more is delivered to this endpoint.","A disabled endpoint cannot be enabled again; register it anew."],confirmLabel:"Disable endpoint"},action:()=>u(`/_appport/webhooks/${encodeURIComponent(m.id)}`,"DELETE"),done:h})}),i.jsx(fa,{title:"Recent deliveries",read:()=>u("/_appport/webhooks/deliveries?limit=50").then(m=>Array.isArray(m)?m:m.items??[]),deps:[n,d,r],empty:"No deliveries yet",columns:[["Event",m=>Rt(m.eventType)],["Status",m=>i.jsx(Pe,{field:"feltkit.webhook.delivery",value:m.status})],["Attempts",m=>m.attemptCount],["HTTP",m=>m.lastStatusCode??null],["Last error",m=>up(m)],["Created",m=>cl(m.createdAt)]],tools:m=>i.jsx(Hr,{done:m}),actions:(m,h)=>m.status==="failed"?i.jsxs(i.Fragment,{children:[i.jsx(Ee,{label:"Replay",action:()=>ae(`/services/deliveries/${encodeURIComponent(m.id)}/replay`,{method:"POST",body:JSON.stringify({as:n})}),done:h}),i.jsx(Ce,{size:"sm",label:"Diagnose",onClick:()=>yl(`agent/new/diagnose-delivery/${encodeURIComponent(m.id)}`)})]}):null})]})}function Wm({handlers:n,mutations:u}){const[d,r]=A.useState(u[0]??"");if(Object.keys(n).length)return null;const v=`jobs: { handlers: { "${d.replace(":",".")}": "${d}" } },`;return i.jsxs(se,{title:"Declare a job type",children:[i.jsxs("p",{className:"feltkit-small",children:["A job type runs one of your mutations, as the person who queued it, with retries. None is declared yet. Choose the mutation it runs, then add the line to ",i.jsx("code",{children:"services"})," in ",i.jsx("code",{children:"feltkit/app.ts"}),"; the backend reloads and the type appears below."]}),u.length?i.jsxs(i.Fragment,{children:[i.jsx(kt,{id:"declare-handler-mutation",label:"Mutation",value:d,onChange:r,options:u}),i.jsx(xi,{text:v,label:"Line to add to services"})]}):i.jsx("p",{className:"feltkit-muted feltkit-small",children:"Write a mutation in feltkit/ first."})]})}function Ep({as:n,manage:u,version:d}){const[r,f]=A.useState(0),v=()=>f(h=>h+1),b=_n(d),g=b?.jobHandlers??{},m=Object.keys(g);return i.jsxs(i.Fragment,{children:[b&&i.jsx(Wm,{handlers:g,mutations:b.mutations}),i.jsx(za,{title:"Queue a job",submitLabel:"Queue job",fields:[{name:"type",label:"Job type",required:!0,strict:!0,choices:m.map(h=>({value:h,label:`${h} → ${g[h]}`})),placeholder:"Declare a handler first"},{name:"payload",label:"Payload (JSON object)",multiline:!0,value:"{}"}],send:async h=>{if(!m.includes(h.type))throw new Error(`No handler is declared for "${h.type}", so the job would fail. Declare it in services.jobs.handlers first.`);await u("/_appport/jobs","POST",{type:h.type,payload:pp(h.payload??"{}","payload")}),v()},done:()=>i.jsxs("span",{className:"feltkit-row",children:["Job queued as ",n,". ",i.jsx(Hr,{done:v})]})},m.join(",")),i.jsx(fa,{title:"Jobs",read:()=>u("/_appport/jobs").then(h=>[...h].sort((S,p)=>String(p.createdAt).localeCompare(String(S.createdAt)))),deps:[n,d,r],empty:"No jobs yet",tools:h=>i.jsx(Hr,{done:h}),columns:[["Type",h=>Rt(h.type)],["Status",h=>i.jsx(Ge,{field:"appport.job.status",value:h.status,attrs:{"data-state":h.status}})],["Attempts",h=>`${h.attemptCount}/${h.maxAttempts}`],["Run at",h=>cl(h.runAt)],["Last error",h=>h.lastError??null]],actions:(h,S)=>i.jsxs(i.Fragment,{children:[(h.status==="failed"||h.status==="completed")&&i.jsx(Ee,{label:"Retry",action:async()=>Sn(await u(`/_appport/jobs/${encodeURIComponent(h.id)}/retry`,"POST"),`The ${h.type} job`),done:S}),h.status==="failed"&&i.jsx(Ce,{size:"sm",label:"Diagnose",onClick:()=>yl(`agent/new/diagnose-job/${encodeURIComponent(h.id)}`)})]})})]})}const Cp={s:"second",m:"minute",h:"hour",d:"day"},Op=n=>{const u=/^(\d+)([smhd])$/.exec(String(n));return u?`Every ${u[1]} ${Cp[u[2]]}${u[1]==="1"?"":"s"}`:String(n)};function Dp({manage:n,version:u}){const[d,r]=A.useState(0),f=()=>r(m=>m+1),v=_n(u),b=v?.jobHandlers??{},g=Object.keys(b);return i.jsxs(i.Fragment,{children:[v&&g.length===0&&i.jsx(Wm,{handlers:b,mutations:v.mutations}),i.jsx(za,{title:"Create a schedule",submitLabel:"Create schedule",fields:[{name:"type",label:"Job type",required:!0,strict:!0,choices:g.map(m=>({value:m,label:`${m} → ${b[m]}`})),placeholder:"Declare a handler first"},{name:"interval",label:"Frequency",options:[{value:"15m",label:"Every 15 minutes"},{value:"30m",label:"Every 30 minutes"},{value:"1h",label:"Every hour"},{value:"6h",label:"Every 6 hours"},{value:"1d",label:"Every day"},{value:"7d",label:"Every week"}]}],send:async m=>{if(!g.includes(m.type))throw new Error(`No handler is declared for "${m.type}", so every scheduled job would fail. Declare it in services.jobs.handlers first.`);await n("/_appport/schedules","POST",{type:m.type,interval:m.interval}),f()},done:()=>"Schedule created."},g.join(",")),i.jsx(fa,{title:"Schedules",read:()=>n("/_appport/schedules"),deps:[u,d],empty:"No schedules yet",columns:[["Type",m=>Rt(m.type)],["Frequency",m=>Op(m.interval)],["Next run",m=>cl(m.nextRunAt)],["Created by",m=>Rt(m.createdBy)],["Status",m=>i.jsx(Ge,{field:"appport.schedule.enabled",value:!!m.enabled})]],actions:(m,h)=>m.enabled?i.jsx(Ee,{label:"Disable",variant:"danger",confirm:{title:`Disable the ${m.type} schedule?`,consequences:["It stops queueing jobs.","A disabled schedule cannot be enabled again; create a new one."],confirmLabel:"Disable schedule"},action:async()=>Sn(await n(`/_appport/schedules/${encodeURIComponent(m.id)}`,"DELETE"),"The schedule"),done:h}):null})]})}function zp({manage:n,version:u}){const[d,r]=A.useState(0),f=Ve(()=>Promise.all([n("/v1/intelligence/catalog"),n("/v1/intelligence")]),[u,d]),[v,b]=A.useState(null),[g,m]=A.useState(null),[h,S]=A.useState(!1),[p,N]=A.useState(!1);if(f.error&&!f.data)return i.jsx(Oe,{title:"Intelligence could not be read",error:f.error,retry:f.reload});if(!f.data)return i.jsx(bt,{what:"Intelligence"});const[O,L]=f.data,w=v??{provider:L.configured?L.provider:O[0]?.id??"",model:L.configured?L.model:"",endpoint:L.configured&&L.endpoint?.kind==="custom"?L.endpoint.url:"",credentialRef:""},U=O.find(Z=>Z.id===w.provider),D=Z=>(S(!1),b({...w,...Z})),Q=U?.credential==="required"&&!L.credentialConfigured,J=async()=>{m(null),N(!0);try{if(Ti(w.credentialRef))throw new Error("That looks like an API key. Enter the key in Studio → Models; here, give a credential reference.");await n("/v1/intelligence","PUT",{provider:w.provider,model:w.model,endpoint:w.endpoint&&U?.customEndpoint?w.endpoint:"default",...w.credentialRef?{credentialRef:w.credentialRef}:{}}),b(null),S(!0),r(Z=>Z+1)}catch(Z){m(Z)}finally{N(!1)}};return i.jsxs(i.Fragment,{children:[i.jsxs(se,{title:"Current",children:[i.jsx("p",{className:"feltkit-small",children:L.configured?i.jsxs(i.Fragment,{children:[i.jsx("strong",{children:L.provider})," / ",i.jsx("code",{children:L.model})," ·"," ",L.credentialConfigured?i.jsx(Ge,{tone:"positive",label:"Credential attached"}):i.jsx(Ge,{tone:"attention",label:"No credential attached"})]}):"Not configured. The platform works without it; the agent then has no model to decide with."}),i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["To enter an API key and test the model, open ",i.jsx("a",{href:"#/models",children:"Models"}),"."]})]}),i.jsxs(se,{title:"Configure",children:[i.jsxs(Bl,{label:"Configure Intelligence",submitLabel:"Save",busy:p,onSubmit:()=>{J()},actions:L.credentialConfigured&&U?.credential!=="required"?i.jsx(Ee,{label:"Remove credential",variant:"danger",size:"md",confirm:{title:"Detach the credential reference?",consequences:["Intelligence calls this provider without a key.","The stored value stays in custody."],confirmLabel:"Remove credential"},action:()=>n("/v1/intelligence/credential","DELETE"),done:()=>r(Z=>Z+1)}):null,children:[i.jsx(kt,{id:"intelligence-provider",label:"Provider",required:!0,value:w.provider,onChange:Z=>D({provider:Z,model:""}),options:O.map(Z=>({value:Z.id,label:Z.displayName}))}),i.jsx(Ne,{id:"intelligence-model",label:"Model",required:!0,list:"intelligence-models",value:w.model,onChange:Z=>D({model:Z}),spellcheck:"false"}),U?.customEndpoint&&i.jsx(Ne,{id:"intelligence-endpoint",label:"Custom endpoint (optional)",type:"url",value:w.endpoint,placeholder:U.endpoints?.[0]?.url??"http://localhost:11434/v1",onChange:Z=>D({endpoint:Z})}),i.jsx(Ne,{id:"intelligence-credential",label:"Credential reference",hint:"Leave empty to keep the current one.",value:w.credentialRef,pattern:"credential-ref:.+",placeholder:`credential-ref:${w.provider}`,required:Q,onChange:Z=>D({credentialRef:Z}),spellcheck:"false"})]}),i.jsx("datalist",{id:"intelligence-models",children:(U?.models??[]).map(Z=>i.jsx("option",{value:Z.id,children:Z.displayName},Z.id))}),g?i.jsx(Oe,{title:"Not saved",error:g}):null,h?i.jsxs(Ke,{tone:"info",title:"Saved",children:["Intelligence now uses ",L.provider??w.provider,"."]}):null]})]})}const Pm={configured:"Enabled, set up, and its records read cleanly.",unconfigured:"Enabled, but nothing is set up yet.",unhealthy:"Enabled, but its store failed a check or recent work failed.",available:"Can run here; not enabled in feltkit({ services }).",unavailable:"Cannot run in this installation."};function Lr({service:n}){return i.jsx(Pe,{field:"feltkit.service.state",value:n.state})}const ev="feltkit.services.as",Rp=()=>{try{return sessionStorage.getItem(ev)}catch{return null}};function wp(n){const[u,d]=A.useState(()=>Rp()??n[0]?.id??""),r=v=>{d(v);try{sessionStorage.setItem(ev,v)}catch{}};return A.useEffect(()=>{n.length&&!n.some(v=>v.id===u)&&d(n[0].id)},[n,u]),{as:u,picker:i.jsx(Ni,{id:"services-as",as:u,setAs:r,devUsers:n})}}const Rr=n=>n.state!=="available"&&n.state!=="unavailable";function Mp({page:n}){const{version:u}=Xt(),d=Ve(()=>ae("/services"),[u]),r=Ve(()=>ae("/overview"),[u]),f=r.data?.devUsers??[],v=!!r.data?.environment?.development,{canAct:b}=ec(r.data),{as:g,picker:m}=wp(f),h=d.data?.services??[],S=v&&f.length?m:null;if(n==="credentials")return i.jsxs("div",{className:"feltkit-page",children:[i.jsx(wt,{title:"Credentials",crumbs:[{label:"Services",href:"#/services"},{label:"Credentials"}],subtitle:"Credential references the services and configuration use, and where each value is kept.",actions:S}),i.jsx(qp,{as:g,canAct:b,development:v,version:u})]});if(n){const O=h.find(L=>L.id===n);return i.jsx(fp,{id:n,service:O,as:g,picker:S,development:v,summary:O&&Rr(O)?i.jsx(Up,{service:O}):null,operations:!v&&n==="jobs"?i.jsx(Bp,{as:g,development:!1,canAct:b,version:u}):!v&&n==="webhooks"?i.jsx($p,{as:g,development:!1,canAct:!1,version:u}):null})}const p=h.filter(Rr),N=h.filter(O=>!Rr(O));return i.jsxs("div",{className:"feltkit-page",children:[i.jsx(wt,{title:"Services",subtitle:v?"AppPort Services on this environment's FeltDB instance. Each service has its own screen; every operation there is authorized by your roles, as the identity you choose.":"AppPort Services on this environment's FeltDB instance. Configuration is a development tool; job retries here are authorized as you and recorded as yours.",actions:S}),d.error&&!d.data?i.jsx(Oe,{title:"Services could not be read",error:d.error,retry:d.reload}):d.data?i.jsxs(i.Fragment,{children:[v&&f.length===0&&i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Declare a development identity in ",i.jsxs("code",{children:["feltkit(","{"," dev: ","{"," users ","}"," ","}",")"]})," to manage services: their operations are authorized as that identity."]}),p.length===0&&i.jsxs(ql,{title:"No services enabled",children:["Enable services with ",i.jsxs("code",{children:["feltkit(","{"," services: ","{"," … ","}"," ","}",")"]}),". Each one gets its own screen here."]}),i.jsxs("div",{className:"feltkit-grid",children:[p.map(O=>i.jsxs(se,{title:i.jsx("a",{href:`#/services/${O.id}`,children:O.name}),action:i.jsx(Lr,{service:O}),className:"feltkit-service",children:[i.jsx("p",{className:"feltkit-small",children:O.detail}),O.summary&&i.jsx("p",{className:"feltkit-muted feltkit-small",children:Object.entries(O.summary).slice(0,3).map(([L,w])=>`${L} ${w}`).join(" · ")})]},O.id)),i.jsx(se,{title:i.jsx("a",{href:"#/services/credentials",children:"Credentials"}),className:"feltkit-service",children:i.jsx("p",{className:"feltkit-small",children:"References the services use, and whether each value is set. Values are never shown."})})]}),N.length>0&&i.jsx(se,{title:"Not enabled",children:i.jsx(dt,{label:"Services not enabled",columns:[{id:"name",header:"Service"},{id:"state",header:"State"},{id:"about",header:"About"},{id:"actions",header:"Actions"}],rows:N.map(O=>({key:O.id,attrs:{"data-service":O.id},cells:{name:i.jsx("strong",{children:O.name}),state:i.jsx(Lr,{service:O}),about:O.state==="unavailable"?O.detail:O.description??Pm[O.state],actions:O.state==="available"?i.jsx(Ce,{size:"sm",label:`Enable ${O.name}`,onClick:()=>yl(`services/${O.id}`)}):null}}))})})]}):i.jsx(bt,{what:"services"})]})}function Up({service:n}){return i.jsxs(se,{title:i.jsxs(i.Fragment,{children:["Status ",i.jsx(Lr,{service:n})]}),action:i.jsx("code",{children:`${n.package}@${n.version}`}),children:[i.jsx(vl,{items:[{label:"Status",value:n.detail,hint:n.lastCheckedAt?`checked ${xt(n.lastCheckedAt)}`:Pm[n.state]},...n.summary?[{label:"Records",value:Object.entries(n.summary).map(([u,d])=>`${u} ${String(d)}`).join(" · ")}]:[],...n.lastError?[{label:"Last error",value:i.jsx(Ge,{tone:"critical",label:"Failed",detail:n.lastError.message}),hint:xt(n.lastError.at)}]:[]]}),i.jsxs("details",{className:"feltkit-details",children:[i.jsx("summary",{children:"Permissions and stored state"}),i.jsx(vl,{items:[{label:"Permissions",value:n.capabilities.join(" "),mono:!0},{label:"State",value:i.jsx("span",{className:"feltkit-choices",children:n.collections.map(u=>i.jsx("a",{href:`#/data/${u}`,children:i.jsx("code",{children:u})},u))})}]})]})]})}function qp({as:n,canAct:u,development:d,version:r}){const[f,v]=A.useState(0),b=Ve(()=>ae("/credentials"),[r,f]),[g,m]=A.useState("");if(b.error&&!b.data)return i.jsx(Oe,{title:"Credentials could not be read",error:b.error,retry:b.reload});if(!b.data)return i.jsx(bt,{what:"credentials"});const{custody:h,credentials:S}=b.data,p=()=>v(O=>O+1),N=g.trim()?g.trim().startsWith("credential-ref:")?g.trim():`credential-ref:${g.trim()}`:"";return i.jsxs(se,{title:"Credentials",children:[i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Services and configuration hold credential references only. Values are kept by FeltKit's custody (",h.location,") and used inside the effect that needs them; they are never stored in FeltDB, logged, or shown. ",h.note]}),i.jsx(dt,{label:"Credential references",columns:[{id:"ref",header:"Reference"},{id:"usedBy",header:"Used by"},{id:"value",header:"Value"},{id:"variable",header:"Override variable"},{id:"actions",header:"Actions"}],rows:S.map(O=>({key:O.ref,cells:{ref:i.jsx("code",{children:O.ref}),usedBy:O.usedBy.length?O.usedBy.join(", "):"stored, not used yet",value:i.jsx(sc,{credential:O}),variable:O.variable?i.jsx("code",{children:O.variable}):"invalid reference",actions:u&&O.writable?i.jsxs("span",{className:"feltkit-actions",children:[i.jsx(Ws,{credentialRef:O.ref,label:O.present?"Replace":"Set",...d&&n?{as:n}:{},onSaved:p}),O.source==="vault"&&O.present&&i.jsx(Ee,{label:"Remove",variant:"danger",action:()=>ae(`/credentials/${encodeURIComponent(O.ref)}${d&&n?`?as=${encodeURIComponent(n)}`:""}`,{method:"DELETE"}),done:p,confirm:{title:`Remove the value of ${O.ref}?`,consequences:[O.usedBy.length?`${O.usedBy.join(", ")} can no longer use it.`:"Nothing uses it yet.","The value is deleted from custody; set it again to restore it."],confirmLabel:"Remove value",requireText:O.ref}})]}):null}})),emptyTitle:"No credential references yet"}),u&&h.writable&&i.jsxs("div",{className:"feltkit-inline",children:[i.jsx(Ne,{id:"credential-new",label:"New credential reference",value:g,onChange:O=>m(Ti(O)?"":O),placeholder:"credential-ref:stripe",hint:"A name, never the value: a pasted secret is cleared.",spellcheck:"false"}),N&&i.jsx(Ws,{credentialRef:N,label:"Set value",...d&&n?{as:n}:{},onSaved:()=>(m(""),p())})]})]})}function tv({title:n,path:u,as:d,development:r,canAct:f,version:v,retry:b,columns:g}){const[m,h]=A.useState(0),S=Ve(()=>ae(`/services/${u}`),[v,m]),p=()=>h(O=>O+1),N=S.data?.items??[];return i.jsxs(se,{title:n,action:r?i.jsx(Ee,{label:"Run due work now",action:()=>ae("/services/run",{method:"POST",body:"{}"}),done:p}):null,children:[S.data?.replay&&!S.data.replay.enabled?i.jsx("p",{className:"feltkit-muted feltkit-small",children:S.data.replay.reason}):null,i.jsx(dt,{label:n,columns:[...g.map(([O])=>({id:O,header:O})),{id:"actions",header:"Actions"}],rows:N.slice(0,50).map(O=>({key:O.id,cells:{...Object.fromEntries(g.map(([L,w])=>[L,w(O)])),actions:i.jsxs("span",{className:"feltkit-actions",children:[r&&O.status==="failed"&&i.jsx(Ce,{size:"sm",label:"Diagnose",onClick:()=>yl(`agent/new/${u==="jobs"?"diagnose-job":"diagnose-delivery"}/${encodeURIComponent(O.id)}`)}),f&&b.when(O)&&(O.retryable??!0)&&i.jsx(Ee,{label:b.label,disabled:r&&!d,action:()=>ae(`/services/${u}/${encodeURIComponent(O.id)}/${b.action}`,{method:"POST",body:JSON.stringify(r?{as:d}:{})}),done:p})]})}})),loading:S.loading,error:S.error&&!S.data?{title:`${n} could not be read`,...da(S.error,S.reload)}:null,emptyTitle:"Nothing yet"}),N.length>50&&i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["The 50 newest of ",N.length," are shown."]})]})}function Bp(n){return i.jsx(tv,{...n,title:"Job runs",path:"jobs",retry:{label:"Retry",action:"retry",when:u=>u.status==="failed"},columns:[["Type",u=>i.jsx("code",{children:u.type})],["Status",u=>i.jsx(Ge,{field:"appport.job.status",value:u.status,attrs:{"data-state":u.status}})],["Attempts",u=>`${u.attemptCount}/${u.maxAttempts}`],["As",u=>u.principal?i.jsx("code",{children:u.principal}):null],["Last error",u=>u.lastError??null],["Created",u=>xt(u.createdAt)]]})}function $p(n){return i.jsx(tv,{...n,title:"Webhook deliveries",path:"deliveries",retry:{label:"Replay",action:"replay",when:u=>u.status==="failed"},columns:[["Event",u=>i.jsx("code",{children:u.eventType})],["To",u=>i.jsx("code",{children:u.destination??u.endpointId})],["Status",u=>i.jsx(Pe,{field:"feltkit.webhook.delivery",value:u.status})],["Attempts",u=>u.attemptCount],["HTTP",u=>u.lastStatusCode??null],["Last error",u=>u.lastError??null],["Created",u=>xt(u.createdAt)]]})}const Hp=["","query","mutation","capability","integration","agent","service","auth","admin","system"],Lp=["","success","error","denied"];function Yp({selected:n}){Vm(1e4);const{activity:u,live:d}=Xt(),[r,f]=A.useState(""),[v,b]=A.useState(""),[g,m]=A.useState(!1),h=Ve(()=>ae(`/activity?limit=200${r?`&kind=${r}`:""}${v?`&outcome=${v}`:""}`),[r,v]),S=A.useMemo(()=>{const N=Xm(u.filter(O=>(!r||O.kind===r)&&(!v||O.outcome===v)),h.data?.entries??[]);return g?N.filter(O=>O.kind!=="query"):N},[u,h.data,r,v,g]),p=!!(r||v||g);return i.jsxs("div",{className:"feltkit-page",children:[i.jsx(wt,{title:"Activity",subtitle:"What actually happened, from the runtime's own records: who called what, through which interface, the authority decision, and the writes FeltDB committed.",status:i.jsx($m,{freshness:d?"live":"stale",source:"the runtime's event stream"})}),i.jsx(Ym,{live:!0,label:"Filter activity",idPrefix:"activity-filter",filters:[{id:"kind",label:"Kind",type:"select",value:r,options:Hp.map(N=>({value:N,label:N||"All kinds"}))},{id:"outcome",label:"Outcome",type:"select",value:v,options:Lp.map(N=>({value:N,label:N||"All outcomes"}))}],onChange:(N,O)=>N==="kind"?f(O):b(O),onClear:()=>(f(""),b(""),m(!1)),applied:(r?1:0)+(v?1:0)+(g?1:0),result:h.data?`${S.length} entr${S.length===1?"y":"ies"}, newest first`:""}),i.jsx(Js,{id:"activity-hide-queries",label:"Hide queries",checked:g,onChange:m}),i.jsx(dt,{label:"Activity",columns:[{id:"when",header:"When"},{id:"outcome",header:"Outcome"},{id:"kind",header:"Kind"},{id:"name",header:"Name"},{id:"principal",header:"Principal"},{id:"via",header:"Via"},{id:"writes",header:"Writes",align:"end"},{id:"ms",header:"ms",align:"end"}],rows:S.map(N=>({key:N.id,selected:n===N.id,onSelect:()=>yl(`activity/${N.id}`),attrs:{"data-activity":N.id},cells:{when:i.jsx("span",{title:N.at,children:xt(N.at)}),outcome:i.jsx(xn,{outcome:N.outcome}),kind:N.kind,name:i.jsxs(i.Fragment,{children:[i.jsx("code",{children:N.name})," ",N.error?i.jsx("code",{children:N.error.code}):null]}),principal:N.principal?N.principal.id:N.kind==="system"?null:"anonymous",via:N.via,writes:N.writes?.length?N.writes.length:null,ms:N.durationMs??null}})),loading:h.loading,loadingWhat:"activity",error:h.error&&!h.data?{title:"Activity could not be read",...da(h.error,h.reload)}:null,noMatch:p,noMatchTitle:"No activity matches",noMatchBody:"Change or clear the filters.",emptyTitle:"Nothing has happened yet",emptyBody:"Use the app, invoke a capability, or run a function from Capabilities."}),n&&i.jsx(Gp,{id:n,onClose:()=>yl("activity")})]})}function Gp({id:n,onClose:u}){const d=Ve(()=>ae(`/activity/${encodeURIComponent(n)}`),[n]),r=d.data?.entry,f=d.data?.serviceEvidence??[];return i.jsx(Jr,{id:"activity-detail",open:!0,className:"feltkit-dialog-wide",title:r?i.jsx("code",{children:r.name}):"Activity entry",description:r?`${r.kind} via ${r.via} · request ${r.requestId}`:void 0,onClose:u,actions:i.jsx(Ce,{label:"Close",onClick:u}),children:d.error?i.jsx(Oe,{title:"This entry could not be read",error:d.error,retry:d.reload}):r?i.jsxs(i.Fragment,{children:[i.jsx(vl,{items:[{label:"Outcome",value:i.jsx(xn,{outcome:r.outcome})},{label:"When",value:`${new Date(r.at).toLocaleString()} (${xt(r.at)})`},{label:"Principal",value:r.principal?`${r.principal.id} (${r.principal.type}; roles: ${r.principal.roles.join(", ")||"none"})`:"anonymous"},...r.capability?[{label:"AppPort capability",value:`${r.capability.name}@${r.capability.version}`,mono:!0}]:[],{label:"Request",value:r.requestId,mono:!0},{label:"Duration",value:`${r.durationMs} ms`},...r.argKeys?[{label:"Arguments",value:r.argKeys.length?r.argKeys.join(", "):"none",mono:!0}]:[]]}),r.error&&i.jsx(Oe,{title:r.error.code,error:{message:r.error.message}}),r.authority&&i.jsxs("section",{className:"feltkit-stack","aria-label":"Authority",children:[i.jsx("h3",{className:"feltkit-label",children:"Authority"}),i.jsx(vl,{items:[{label:"Decision",value:i.jsx(Pe,{field:"feltkit.authority.allowed",value:!!r.authority.allowed})},{label:"Required",value:r.authority.required??"an authenticated principal",mono:!!r.authority.required},...r.authority.reason?[{label:"Reason",value:r.authority.reason}]:[],{label:"Decision id",value:r.authority.decisionId,mono:!0},...r.authority.appportDecisionId?[{label:"AppPort decision",value:r.authority.appportDecisionId,mono:!0}]:[],{label:"Policy version",value:r.authority.policyVersion,mono:!0}]})]}),i.jsxs("section",{className:"feltkit-stack","aria-label":"State changes",children:[i.jsx("h3",{className:"feltkit-label",children:"State changes"}),r.writes?.length?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Committed by FeltDB in one transaction ",i.jsx("code",{children:r.transactionId}),r.commitRevision!==void 0?` at revision ${r.commitRevision}`:"","."]}),i.jsx(dt,{label:"Writes",columns:[{id:"op",header:"Op"},{id:"collection",header:"Collection"},{id:"record",header:"Record"},{id:"expected",header:"Expected version"}],rows:r.writes.map((v,b)=>({key:`${b}`,cells:{op:i.jsx("code",{children:v.op}),collection:i.jsx("code",{children:v.collection}),record:v.op==="delete"?i.jsx("code",{children:v.id}):i.jsx("a",{href:`#/data/${v.collection}`,children:i.jsx("code",{children:v.id})}),expected:v.expectedVersion??"— (create)"}}))})]}):i.jsx("p",{className:"feltkit-muted",children:r.kind==="query"?"Queries cannot write.":r.outcome!=="success"?"Nothing was written through ctx.db: a failed mutation commits nothing.":r.services?.length?"No application records changed through ctx.db. Service effects commit separately; see the evidence below.":"No application records changed."}),r.reads?.length?i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Read: ",r.reads.join(", ")]}):null]}),(f.length>0||r.services?.length)&&i.jsxs("section",{className:"feltkit-stack","aria-label":"Service evidence",children:[i.jsx("h3",{className:"feltkit-label",children:"Service evidence"}),i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Recorded by AppPort Services' gateway in the same FeltDB instance.",d.data?.serviceEvidenceState==="started"?" An effect has no recorded completion: its outcome is unknown, not failed.":"",d.data?.serviceEvidenceTruncated?" More records exist than are shown.":""]}),i.jsx(dt,{label:"Service evidence",columns:[{id:"outcome",header:"Outcome"},{id:"capability",header:"Capability"},{id:"service",header:"Service"},{id:"decision",header:"Decision"},{id:"resource",header:"Resource"}],emptyTitle:"No evidence recorded",rows:f.map(v=>({key:v.id,cells:{outcome:i.jsx(Pe,{field:"feltkit.service.evidence",value:v.outcome}),capability:i.jsx("code",{children:v.capability}),service:v.service,decision:i.jsxs(i.Fragment,{children:[v.decision==="allow"?i.jsx(Ge,{tone:"positive",label:"Allow"}):v.decision?i.jsx(Ge,{tone:"neutral",label:v.decision}):null,v.decisionId?i.jsxs("code",{children:[" ",v.decisionId]}):null]}),resource:v.resource?i.jsx("code",{children:v.resource}):null}}))})]}),r.detail&&i.jsxs("section",{className:"feltkit-stack","aria-label":"Detail",children:[i.jsx("h3",{className:"feltkit-label",children:"Detail"}),i.jsx(ki,{value:r.detail,label:"Entry detail"})]})]}):i.jsx(bt,{what:"the entry"})})}function lv(){const[n,u]=A.useState(null),[d,r]=A.useState(!1);return{open:async()=>{u(null),r(!0);const v=window.open("about:blank","_blank");try{const b=await ae("/production/studio-link",{method:"POST",body:"{}"});if(!b.url)throw new Error("No deployment is recorded for this project. Run `npx feltkit vercel deploy` or `npx feltkit cloudflare deploy` first.");v?(v.opener=null,v.location.href=b.url):window.location.assign(b.url)}catch(b){v?.close(),u(b)}finally{r(!1)}},error:n,busy:d}}const Vp=n=>n==="vercel"||n==="cloudflare"?`npx feltkit ${n} deploy`:"npx feltkit deploy";function Qp({production:n}){const u=lv(),d=Vp(n?.targetId??n?.deployment?.target),r=n?.deployment??null;return n?i.jsxs(se,{title:"Production",action:i.jsx(Pe,{field:"feltkit.deployment.state",value:r?"live":n.target?"built":"none"}),children:[r?i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:[i.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer",children:r.url})," ",i.jsxs("span",{className:"feltkit-muted feltkit-small",children:["· ",n.target??r.target," · deployed ",xt(r.deployedAt)]})]}),i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Data: ",n.storage==="remote"?i.jsx("code",{children:n.location}):n.location]}),i.jsxs("div",{className:"feltkit-actions",children:[i.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer",children:"Open app ↗"}),r.studio?i.jsx(Ce,{size:"sm",variant:"primary",label:"Manage in production Studio ↗",busy:u.busy,onClick:()=>{u.open()}}):i.jsxs("span",{className:"feltkit-muted feltkit-small",children:["Production Studio is off. Turn it on with ",i.jsxs("code",{children:[d," --studio"]}),"."]})]}),u.error!=null&&i.jsx(Oe,{title:"Production Studio did not open",error:u.error}),i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Sign someone in to the app: ",i.jsx("code",{children:"npx feltkit session create --env production --type user --id <id> --role <role>"})," in this project's folder. It uses the deployment's FeltDB settings from ",i.jsx("code",{children:".env.local"}),"."]})]}):n.target?i.jsxs("p",{className:"feltkit-muted",children:["Built for ",n.target,", not deployed from here yet. Run ",i.jsx("code",{children:d}),": it uploads the settings, deploys, and signs you in."]}):i.jsxs("p",{className:"feltkit-muted",children:["Not deployed. ",i.jsx("code",{children:"npx feltkit deploy"})," builds it for where it will run (one container, Vercel, or a FeltDB server) and says what to do next."]}),n.storage==="unconfigured"&&i.jsx(Ke,{tone:"attention",title:"Production storage is not configured",children:n.location})]}):null}function Xp(){const{version:n,overview:u}=Xt(),d=Ve(()=>ae("/environments"),[]),r=Ve(()=>ae("/sessions"),[n]),f=u?.environment?.development;return i.jsxs("div",{className:"feltkit-page",children:[i.jsx(wt,{title:"Settings",subtitle:"Environments, access policy and sessions. Configuration lives in feltkit/app.ts; this page shows what the runtime actually uses."}),f&&d.data&&i.jsx(Qp,{production:d.data.environments.find(v=>v.name==="production"&&!v.active)}),i.jsxs(se,{title:"Environments",children:[i.jsx("p",{className:"feltkit-muted feltkit-small",children:"Each environment has its own FeltDB instance. They never share state; FeltKit refuses to open two environments on the same location."}),i.jsx(dt,{label:"Environments",columns:[{id:"name",header:"Environment"},{id:"storage",header:"Storage"},{id:"location",header:"Location"},{id:"instance",header:"Instance"}],rows:(d.data?.environments??[]).map(v=>({key:v.name,selected:!!v.active,cells:{name:i.jsxs("span",{className:"feltkit-row",children:[i.jsx("strong",{children:v.name})," ",v.active&&i.jsx(Ge,{tone:"positive",label:"Active"})]}),storage:v.storage,location:i.jsxs("span",{className:"feltkit-mono",children:[v.target&&i.jsxs("span",{className:"feltkit-muted",children:[v.target," · "]}),v.location,v.deployment&&i.jsxs(i.Fragment,{children:[" · ",i.jsx("a",{href:v.deployment.url,target:"_blank",rel:"noreferrer",children:v.deployment.url})]})]}),instance:v.instanceId?i.jsx("code",{children:v.instanceId}):"not open here"}})),loading:d.loading,error:d.error&&!d.data?{title:"Environments could not be read",...da(d.error,d.reload)}:null,emptyTitle:"No environments"}),i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Production is what your deployment uses. Built with ",i.jsx("code",{children:"npx feltkit deploy"})," for Vercel or a FeltDB server, that is its FeltDB, reached with the settings in ",i.jsx("code",{children:".env.local"}),"; otherwise ",i.jsx("code",{children:"FELTDB_URL"})," + ",i.jsx("code",{children:"FELTDB_TOKEN"})," when set, else ",i.jsx("code",{children:"FELTKIT_STATE_DIR"})," or ",i.jsx("code",{children:".feltkit/production/state"}),"."]})]}),i.jsxs("div",{className:"feltkit-grid feltkit-grid--wide",children:[i.jsxs(se,{title:"Access policy",action:i.jsxs("code",{children:["policy ",u?.policyVersion]}),children:[i.jsx(dt,{label:"Roles and permissions",columns:[{id:"role",header:"Role"},{id:"permissions",header:"Permissions"}],rows:Object.entries(u?.roles??{}).map(([v,b])=>({key:v,cells:{role:i.jsx("strong",{children:v}),permissions:i.jsx("span",{className:"feltkit-mono",children:b.join(" ")})}})),emptyTitle:"No roles declared"}),i.jsx("p",{className:"feltkit-muted feltkit-small",children:"Enforced through AppPort's authorizer on functions, capabilities and services alike. Edit roles in feltkit/app.ts."})]}),i.jsx(se,{title:"Development identities",children:f?i.jsx(dt,{label:"Development identities",columns:[{id:"name",header:"Name"},{id:"id",header:"Id"},{id:"roles",header:"Roles"}],rows:(u?.devUsers??[]).map(v=>({key:v.id,cells:{name:v.name??null,id:i.jsx("code",{children:v.id}),roles:v.roles.join(", ")}})),emptyTitle:"None declared",emptyBody:i.jsxs(i.Fragment,{children:["Add ",i.jsxs("code",{children:["dev: ","{ users: [...] }"]})," to ",i.jsxs("code",{children:["feltkit(","{ … }",")"]}),"."]})}):i.jsx("p",{className:"feltkit-muted",children:"Development sign-in is disabled in this environment."})})]}),i.jsxs(se,{title:"Sessions",action:i.jsx("span",{className:"feltkit-muted feltkit-small",children:"Tokens are stored only as SHA-256 digests."}),children:[f&&i.jsx(Zp,{roles:Object.keys(u?.roles??{}),onIssued:r.reload}),i.jsx(dt,{label:"Active sessions",columns:[{id:"ref",header:"Ref"},{id:"principal",header:"Principal"},{id:"roles",header:"Roles"},{id:"kind",header:"Kind"},{id:"created",header:"Created"},{id:"expires",header:"Expires"},{id:"actions",header:"Actions"}],rows:(r.data?.sessions??[]).map(v=>({key:v.ref,cells:{ref:i.jsx("code",{children:v.ref}),principal:i.jsxs(i.Fragment,{children:[v.principal?.id," ",i.jsx("span",{className:"feltkit-muted feltkit-small",children:v.principal?.type})]}),roles:v.principal?.roles?.join(", ")||null,kind:v.kind,created:xt(v.createdAt),expires:v.expiresAt?new Date(v.expiresAt).toLocaleString():"never",actions:i.jsx(Ee,{label:"Revoke",variant:"danger",action:()=>ae(`/sessions/${v.ref}`,{method:"DELETE"}),done:r.reload,confirm:{title:`Revoke session ${v.ref}?`,consequences:[`${v.principal?.id??"Its principal"} is signed out wherever this token is used.`,"The token stops working at once; issue a new session to restore access."],confirmLabel:"Revoke session"}})}})),loading:r.loading,error:r.error&&!r.data?{title:"Sessions could not be read",...da(r.error,r.reload)}:null,emptyTitle:"No active sessions"})]})]})}function Zp({roles:n,onIssued:u}){const[d,r]=A.useState("triage-agent"),[f,v]=A.useState(n.includes("agent")?"agent":n[0]??""),[b,g]=A.useState("agent"),[m,h]=A.useState(null),[S,p]=A.useState(null),[N,O]=A.useState(!1);return i.jsxs("div",{className:"feltkit-stack",children:[i.jsxs(Bl,{label:"Issue a session",layout:"inline",submitLabel:"Issue 24-hour session",busy:N,onSubmit:async()=>{if(!(!d||!f)){p(null),O(!0);try{const L=await ae("/sessions",{method:"POST",body:JSON.stringify({principal:{id:d,type:b,roles:[f]},label:"issued from the dashboard",ttlMs:864e5})});h(L.token),u()}catch(L){p(L)}finally{O(!1)}}},children:[i.jsx(Ne,{id:"session-principal",label:"Principal id",value:d,onChange:r,required:!0,spellcheck:"false"}),i.jsx(kt,{id:"session-type",label:"Principal type",value:b,onChange:g,options:["agent","service","user"]}),i.jsx(kt,{id:"session-role",label:"Role",value:f,onChange:v,options:n,required:!0})]}),S?i.jsx(Oe,{title:"No session issued",error:S}):null,m&&i.jsxs(Ke,{tone:"attention",title:"Copy this token now: it is shown once",actions:i.jsx(_i,{text:m,label:"Copy token"}),children:[i.jsx("code",{className:"feltkit-secret",children:m}),i.jsxs("p",{className:"feltkit-small",children:["Agents: connect an MCP client to ",i.jsxs("code",{children:[location.origin,"/mcp"]})," with ",i.jsx("code",{children:"Authorization: Bearer <token>"}),". It sees only what this role allows."]})]})]})}function Kp(){const n=Ve(()=>ae("/projects"),[]),u=n.data?.projects??[],d=lv();return i.jsxs("div",{className:"feltkit-page",children:[i.jsx(wt,{title:"Projects",subtitle:"FeltKit applications this machine has run. Each has its own environments and FeltDB instances."}),n.error?i.jsx(Oe,{title:"Projects could not be read",error:n.error,retry:n.reload}):n.data?u.length===0?i.jsxs(ql,{title:"Only this project so far",children:["Create another with ",i.jsx("code",{children:"npm create feltkit@latest my-app"}),"."]}):i.jsx("div",{className:"feltkit-grid feltkit-grid--wide",children:u.map(r=>{const f=r.path===n.data.current;return i.jsxs(se,{title:r.name,className:f?"feltkit-panel--current":"",action:i.jsx(Pe,{field:"feltkit.project.state",value:f?"current":r.running?"running":r.exists?"stopped":"missing"}),children:[i.jsx("code",{className:"feltkit-path",children:r.path}),i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["last run ",xt(r.lastRunAt)," · ",r.lastEnvironment]}),r.deployment&&i.jsxs("p",{className:"feltkit-small",children:["Live:"," ",i.jsx("a",{href:r.deployment.url,target:"_blank",rel:"noreferrer",children:r.deployment.url})," ",i.jsxs("span",{className:"feltkit-muted",children:["(",r.deployment.target,", deployed ",xt(r.deployment.deployedAt),")"]})]}),i.jsxs("div",{className:"feltkit-actions",children:[r.running&&r.url&&!f&&i.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer",children:"Open app ↗"}),r.deployment&&i.jsx("a",{href:r.deployment.url,target:"_blank",rel:"noreferrer",children:"Open live app ↗"}),r.deployment?.studio&&f&&i.jsx(Ce,{size:"sm",variant:"primary",label:"Manage production ↗",busy:d.busy,onClick:()=>{d.open()}}),r.deployment?.studio&&!f&&i.jsxs("span",{className:"feltkit-muted feltkit-small",children:["Manage it: ",i.jsx("code",{children:"npx feltkit manage"})," in its directory."]}),!r.running&&r.exists&&!r.deployment&&i.jsxs("span",{className:"feltkit-muted feltkit-small",children:["Start it: ",i.jsx("code",{children:"npm run dev"})," in its directory."]})]})]},r.path)})}):i.jsx(bt,{what:"projects"}),d.error!=null&&i.jsx(Oe,{title:"Production Studio did not open",error:d.error}),i.jsx(se,{title:"Start a new application",children:i.jsx(xi,{text:`npm create feltkit@latest my-app
|
|
13
|
-
cd my-app
|
|
14
|
-
npm install
|
|
15
|
-
npm run dev`,label:"Commands to start a new application"})})]})}const wr=[{id:"inspect-app",label:"Inspect the application",help:"Capabilities you may use, unhealthy services, recent errors and denials."},{id:"diagnose-job",label:"Diagnose a job",help:"Read the job, its runs and error; propose a retry when it can help.",target:"Job id"},{id:"diagnose-delivery",label:"Diagnose a webhook delivery",help:"Read the delivery, endpoint, and signing credential; propose a replay when it can help.",target:"Delivery id"},{id:"invoke",label:"Run a capability",help:"One capability: observations run now, consequential ones wait for approval."},{id:"handoff",label:"Hand off to a coding agent",help:"Open-ended work, such as a change to the app. Nothing happens until a coding agent (Claude Code, Cursor, or another MCP client working in this project) claims it; connect one once it is created."}];function Jp({rest:n}){const{version:u}=Xt(),d=Ve(()=>ae("/overview"),[u]),r=d.data?.devUsers??[],f=!!d.data?.environment?.development,{canAct:v,actor:b}=ec(d.data),[g,m]=A.useState("");A.useEffect(()=>{!g&&r[0]&&m(r[0].id)},[r,g]);const h=Ve(()=>ae(`/agent${g?`?as=${encodeURIComponent(g)}`:""}`),[u,g]),S=n[0]&&n[0]!=="new"?n[0]:null,p=i.jsx(Ni,{id:"agent-as",as:g,setAs:m,devUsers:r});return i.jsxs("div",{className:"feltkit-page",children:[i.jsx(wt,{title:"Agent",crumbs:S?[{label:"Agent",href:"#/agent"},{label:"Task"}]:void 0,subtitle:"FeltDB's agent runtime, operating this application through its AppPort capabilities and AppPort Services. Every action runs as the task owner; consequential ones wait for a person who may perform them.",actions:r.length?p:null}),h.error&&!h.data?i.jsx(Oe,{title:"Agent tasks could not be read",error:h.error,retry:h.reload}):h.data?S?i.jsx(Wp,{taskId:S,as:g,development:f,canAct:v,actor:f?g:b??"",version:u,handoff:h.data.handoffs.find(N=>N.taskId===S)}):i.jsxs(i.Fragment,{children:[f&&r.length>0&&i.jsx(Fp,{as:g,tools:h.data.tools,initial:n[0]==="new"?{playbook:n[1],target:n[2]}:void 0}),!f&&i.jsx(Ke,{tone:"info",title:"Production tasks come from agents (over MCP) and playbooks",children:v?"Approve, reject, retry and settle their actions: each runs as the task owner and is recorded as yours.":"You can inspect them; acting needs feltkit.operations.write."}),h.data.handoffs.length>0&&i.jsxs(se,{title:"Waiting for a coding agent",children:[i.jsx("ul",{className:"feltkit-list",children:h.data.handoffs.map(N=>i.jsx("li",{children:i.jsxs("a",{href:`#/agent/${N.taskId}`,className:"feltkit-list__row",children:[i.jsx("span",{children:N.objective}),i.jsxs("span",{className:"feltkit-mono feltkit-muted",children:[N.handoffId," · from ",N.from]})]})},N.handoffId))}),i.jsx("p",{className:"feltkit-muted feltkit-small",children:"Nothing works on these until a coding agent claims them. FeltKit has no built-in coding agent: connect yours (Claude Code, Cursor, any MCP client) to this app, in this project."}),i.jsx(av,{as:g,development:f,handoffId:h.data.handoffs.length===1?h.data.handoffs[0].handoffId:void 0})]}),i.jsx(se,{title:"Tasks",children:i.jsx(dt,{label:"Agent tasks",columns:[{id:"objective",header:"Objective"},{id:"status",header:"Status"},{id:"execution",header:"FeltDB execution"},{id:"owner",header:"Owner"},{id:"waiting",header:"Waiting"},{id:"updated",header:"Updated"}],rows:h.data.tasks.map(N=>({key:N.task.task_id,onSelect:()=>yl(`agent/${N.task.task_id}`),attrs:{"data-task":N.task.task_id},cells:{objective:i.jsx("a",{href:`#/agent/${N.task.task_id}`,children:N.task.objective}),status:i.jsx(Pe,{field:"feltkit.agent.task",value:N.task.status}),execution:N.execution?.status?i.jsx("code",{children:N.execution.status}):null,owner:i.jsx("code",{children:N.task.owner}),waiting:N.pending?i.jsx(Ge,{tone:"attention",label:`${N.pending} approval${N.pending>1?"s":""}`}):null,updated:xt(N.task.updated_at)}})),emptyTitle:"No tasks yet",emptyBody:"Start one above, or from a failed job or delivery on the Services screen."})})]}):i.jsx(bt,{what:"agent tasks"})]})}function Fp({as:n,tools:u,initial:d}){const[r,f]=A.useState(d?.playbook&&wr.some(Z=>Z.id===d.playbook)?d.playbook:"inspect-app"),[v,b]=A.useState(d?.target??""),[g,m]=A.useState(""),[h,S]=A.useState(""),[p,N]=A.useState("{}"),[O,L]=A.useState(!1),[w,U]=A.useState(null),D=wr.find(Z=>Z.id===r),Q=!!n&&!(D.target&&!v)&&!(r==="invoke"&&!h)&&!(r==="handoff"&&!g),J=async()=>{if(Q){U(null),L(!0);try{let Z={};if(r==="invoke")try{Z=JSON.parse(p||"{}")}catch{throw new Error("Input is not valid JSON.")}const ne=await ae("/agent/tasks",{method:"POST",body:JSON.stringify({as:n,playbook:r,objective:g||(D.target?`${D.label}: ${v}`:r==="invoke"?`Run ${h}`:D.label),...D.target?{target:v}:{},...r==="invoke"?{capability:h,args:Z}:{}})});yl(`agent/${ne.task.task_id}`)}catch(Z){U(Z)}finally{L(!1)}}};return i.jsxs(se,{title:"New task",children:[i.jsxs(Bl,{label:"New task",submitLabel:"Start task",busy:O,onSubmit:()=>{J()},children:[i.jsx(kt,{id:"task-playbook",label:"What",hint:D.help,value:r,onChange:f,options:wr.map(Z=>({value:Z.id,label:Z.label}))}),D.target&&i.jsx(Ne,{id:"task-target",label:D.target,value:v,onChange:b,required:!0,spellcheck:"false"}),r==="invoke"&&i.jsxs(i.Fragment,{children:[i.jsx(kt,{id:"task-capability",label:"Capability",value:h,onChange:S,required:!0,options:[{value:"",label:"Choose a capability"},...u.map(Z=>({value:Z.name,label:`${Z.name}: ${Z.effect==="consequential"?"needs approval":"observation"}${Z.allowed?"":" (not permitted for this identity)"}`,disabled:!Z.allowed}))]}),i.jsx(Ne,{id:"task-args",label:"Input (JSON)",multiline:!0,rows:3,value:p,onChange:N,spellcheck:"false"})]}),i.jsx(Ne,{id:"task-objective",label:"Objective",value:g,onChange:m,required:r==="handoff",placeholder:r==="handoff"?"Describe the work for the coding agent":"Optional"})]}),w?i.jsx(Oe,{title:"Not started",error:w}):null]})}const Ip=n=>({failed:"Failed",interrupted:"Outcome unknown",executing:"Running",approved:"Approved, starting"})[n]??n;function av({as:n,development:u,handoffId:d}){const[r,f]=A.useState(null);return u?r?i.jsxs("ol",{className:"feltkit-stack",children:[i.jsxs("li",{className:"feltkit-stack",children:[i.jsxs("p",{className:"feltkit-small",children:["In a terminal in this project, add this app to Claude Code. The token is shown once, lasts 7 days, and acts with ",n,"'s roles:"]}),i.jsx(xi,{text:r.claudeCode,label:"Add this app to Claude Code"})]}),i.jsxs("li",{className:"feltkit-stack",children:[i.jsxs("p",{className:"feltkit-small",children:["Start ",i.jsx("code",{children:"claude"})," in the project and ask:"]}),i.jsx(xi,{text:r.prompt,label:"What to ask the coding agent"})]}),i.jsx("li",{children:i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Another MCP client: endpoint ",i.jsx("code",{children:r.mcpUrl})," with the header ",i.jsx("code",{children:"Authorization: Bearer …"})," from the command above. Its progress, proposals waiting for approval, and summary appear on the task here."]})})]}):i.jsx("div",{children:i.jsx(Ee,{label:"Connect a coding agent",variant:"primary",size:"md",disabled:!n,action:()=>ae("/agent/connect",{method:"POST",body:JSON.stringify({as:n,...d?{handoffId:d}:{}})}),done:f})}):i.jsxs("p",{className:"feltkit-small",children:["Give the agent a session with ",i.jsx("code",{children:"npx feltkit session create --env production --type agent --id coding-agent --role <role>"}),", add this app's ",i.jsx("code",{children:"/mcp"})," endpoint to it with that token, and ask it to claim the handoff."]})}function Wp({taskId:n,as:u,development:d,canAct:r,actor:f,version:v,handoff:b}){const[g,m]=A.useState({}),[h,S]=A.useState(0),p=Ve(()=>ae(`/agent/tasks/${encodeURIComponent(n)}${d&&u?`?as=${encodeURIComponent(u)}`:""}`),[n,v,h,u]),[N,O]=A.useState(""),L=()=>S(Y=>Y+1),w=(Y,ue={})=>()=>ae(`/agent/tasks/${encodeURIComponent(n)}/${Y}`,{method:"POST",body:JSON.stringify(d?{as:u,...ue}:ue)});if(p.error&&!p.data)return i.jsx(Oe,{title:"This task could not be read",error:p.error,retry:p.reload});if(!p.data)return i.jsx(bt,{what:"the task"});const{task:U,checkpoints:D,execution:Q,pending:J,actions:Z=[],approval:ne={}}=p.data,ge=Z.filter(Y=>Y.state==="failed"||Y.state==="interrupted"||Y.state==="executing"||Y.state==="approved"),W=U.status!=="completed"&&U.status!=="cancelled";return i.jsxs(i.Fragment,{children:[i.jsxs(se,{title:i.jsxs(i.Fragment,{children:[U.objective," ",i.jsx(Pe,{field:"feltkit.agent.task",value:U.status})]}),action:i.jsx("code",{children:U.owner}),children:[i.jsx(vl,{items:[{label:"FeltDB execution",value:Q?`${Q.agentRef} · ${Q.status}${Q.error?` · ${Q.error}`:""}`:null,mono:!0},{label:"Task",value:U.task_id,mono:!0,hint:`checkpoint v${U.checkpoint_version}`}]}),r&&W&&p.data.playbook==="decide"&&Z.every(Y=>!["proposed","approved","executing","interrupted"].includes(Y.state))&&i.jsxs("div",{className:"feltkit-actions",children:[i.jsx(Ee,{label:"Ask the model again",size:"md",action:w("decide"),done:L}),i.jsx("span",{className:"feltkit-muted feltkit-small",children:"Uses this environment's model (Models). The answer is a new proposal."})]}),b&&i.jsxs("div",{className:"feltkit-stack",children:[i.jsx(Ke,{tone:"attention",title:"Waiting for a coding agent",children:"Nothing works on this task until one claims it."}),i.jsx(av,{as:u,development:d,handoffId:b.handoffId})]}),d&&W&&i.jsxs("div",{className:"feltkit-inline",children:[i.jsx(Ne,{id:"task-summary",label:"Summary of what was done",value:N,onChange:O}),i.jsx(Ee,{label:"Complete task",variant:"primary",size:"md",disabled:J.length>0,action:w("complete",{summary:N}),done:L}),i.jsx(Ee,{label:"Cancel task",size:"md",variant:"ghost",action:w("cancel",{reason:"cancelled from Studio"}),done:L,confirm:{title:"Cancel this task?",consequences:["Nothing more runs for it.",J.length?`${J.length} proposal(s) waiting for approval are not performed.`:"Its checkpoints stay as the record of what was done."],confirmLabel:"Cancel task"}})]})]}),J.map(Y=>i.jsxs(se,{title:i.jsxs(i.Fragment,{children:["Waiting for approval ",i.jsx("code",{children:Y.capability})]}),action:i.jsxs("span",{className:"feltkit-muted feltkit-small",children:["proposed by ",Y.proposedBy]}),children:[i.jsx("p",{children:Y.reason}),Y.decision&&i.jsxs("p",{className:"feltkit-small",children:["Chosen by the model ",i.jsx("code",{children:`${Y.decision.provider}${Y.decision.model?` / ${Y.decision.model}`:""}`})," (",Y.decision.runtime,") among the options the owner may take. A choice is a proposal, not evidence."]}),i.jsx(ki,{value:Y.input,label:"Proposed input"}),i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Runs as ",i.jsx("code",{children:U.owner}),", through ",Y.source==="application"?"the application's AppPort dispatch":"AppPort Services",". You must be permitted to perform it yourself to approve it."]}),r&&i.jsxs("div",{className:"feltkit-actions",children:[ne[Y.actionId]?.allowed?i.jsx(Ee,{label:`Approve as ${f}`,variant:"primary",size:"md",action:w("approve",{actionId:Y.actionId}),done:L}):i.jsxs("span",{className:"feltkit-muted feltkit-small","data-approval-refused":!0,children:[f," cannot approve this: ",ne[Y.actionId]?.reason??"no approval decision was returned","."]}),(ne[Y.actionId]?.allowed||!/lacks feltkit\.agent\.write|only a person/.test(ne[Y.actionId]?.reason??""))&&i.jsx(Ee,{label:"Reject",size:"md",action:w("reject",{actionId:Y.actionId,reason:"rejected in Studio"}),done:L})]})]},Y.actionId)),ge.map(Y=>i.jsxs(se,{title:i.jsxs(i.Fragment,{children:[Ip(Y.state)," ",i.jsx("code",{children:Y.capability})," ",i.jsx(Pe,{field:"feltkit.agent.action",value:Y.state})]}),action:i.jsxs("span",{className:"feltkit-muted feltkit-small",children:["attempt ",Y.attempt," · approved by ",Y.decidedBy??"—"]}),children:[i.jsx("p",{children:Y.reason}),Y.outcome?.error?i.jsx(Oe,{title:Y.outcome.error.code,error:{message:Y.outcome.error.message}}):null,Y.interruption?i.jsxs(Ke,{tone:"attention",title:"The outcome is unknown",children:[String(Y.interruption).replace(/\.?$/,".")," Check the effect before settling it; it is never replayed automatically."]}):null,r&&Y.state==="failed"&&W&&i.jsx(Ee,{label:"Retry (needs approval again)",size:"md",action:w("retry",{actionId:Y.actionId}),done:L}),r&&Y.state==="interrupted"&&i.jsxs("div",{className:"feltkit-inline",children:[i.jsx(Ne,{id:`settle-${Y.actionId}`,label:"What you checked (recorded with your name)",value:g[Y.actionId]??"",onChange:ue=>m(_e=>({..._e,[Y.actionId]:ue}))}),i.jsx(Ee,{label:"It succeeded",size:"md",disabled:(g[Y.actionId]??"").trim().length<3,action:w("resolve",{actionId:Y.actionId,outcome:"succeeded",note:g[Y.actionId]}),done:L}),i.jsx(Ee,{label:"It did not take effect",size:"md",disabled:(g[Y.actionId]??"").trim().length<3,action:w("resolve",{actionId:Y.actionId,outcome:"failed",note:g[Y.actionId]}),done:L})]})]},Y.actionId)),i.jsx(se,{title:"Checkpoints",children:i.jsx(Fs,{label:"Checkpoints",emptyTitle:"No checkpoints yet",items:D.slice().reverse().map(Y=>({id:String(Y.version),at:Y.created_at,actor:Y.actor,summary:i.jsxs(i.Fragment,{children:[i.jsxs("strong",{children:["v",Y.version]})," ",Y.summary]}),status:i.jsx(Pe,{field:"feltkit.agent.task",value:Y.status}),detail:i.jsxs("div",{className:"feltkit-stack",children:[Y.completed.length>0&&i.jsx("ul",{className:"feltkit-schema","aria-label":`Done in v${Y.version}`,children:Y.completed.map((ue,_e)=>i.jsx("li",{children:i.jsx("code",{children:ue})},_e))}),Y.decisions.length>0&&Y.version===D.length&&i.jsxs("details",{className:"feltkit-details",children:[i.jsxs("summary",{children:["Decisions (",Y.decisions.length,")"]}),i.jsx("ul",{children:Y.decisions.map((ue,_e)=>i.jsx("li",{children:ue},_e))})]}),Y.evidence.filter(ue=>ue.checkpoint_version===Y.version).map((ue,_e)=>i.jsxs("div",{className:"feltkit-row",children:[i.jsx("span",{children:"Evidence:"}),ue.kind==="record"?i.jsx("a",{href:`#/activity/${ue.id}`,children:i.jsxs("code",{children:[ue.collection,"/",ue.id]})}):i.jsx("code",{children:ue.uri}),ue.verified?i.jsx(pm,{state:"verified",checks:["record verified at commit"]}):i.jsx(pm,{state:"not_verified"})]},_e))]})}))})})]})}function Pp(){const{version:n}=Xt(),[u,d]=A.useState(0),r=Ve(()=>ae("/models"),[n,u]),f=Ve(()=>ae("/overview"),[n]),{development:v,canAct:b}=ec(f.data),[g,m]=A.useState(null),[h,S]=A.useState(!1),p=i.jsx(wt,{title:"Models",subtitle:"The model that makes agent decisions in this environment. It chooses among the options your application offers and the task owner may take; its choice becomes a proposal, never an execution."});if(r.error&&!r.data)return i.jsxs("div",{className:"feltkit-page",children:[p,i.jsx(Oe,{title:"Models could not be read",error:r.error,retry:r.reload})]});if(!r.data)return i.jsxs("div",{className:"feltkit-page",children:[p,i.jsx(bt,{what:"models"})]});const{status:N,catalog:O,intelligence:L,saved:w}=r.data,U=async()=>{S(!0),m(null);try{m(await ae("/models/test",{method:"POST",body:"{}"}))}catch(Q){m({ok:!1,error:{message:Q.message,code:Q.code}})}finally{S(!1)}},D=["binary","choice","score","batch","probability_distribution"];return i.jsxs("div",{className:"feltkit-page",children:[p,i.jsxs(se,{title:i.jsxs(i.Fragment,{children:["Decision model ",i.jsx(Pe,{field:"feltkit.model.ready",value:!!N.ready})]}),action:b?i.jsx(Ce,{label:"Test the model",busy:h,disabled:!N.ready,onClick:()=>{U()}}):null,children:[i.jsx(vl,{items:[{label:"Source",value:N.source==="application"?"Application code (agent.decisions)":N.source==="resolver"?`Resolver ${N.reference?.ref??""}${N.reference?.revision!=null?` at revision ${N.reference.revision}`:""}: change it in Resolver, not here`:N.source==="intelligence"?"AppPort Services Intelligence (this environment)":"None"},{label:"Provider",value:N.provider?`${N.provider}${N.protocol?` · ${N.protocol}`:""}`:null,mono:!0},{label:"Model",value:N.model??null,mono:!0},{label:"Endpoint",value:N.endpoint??null,mono:!0},{label:"API key",value:N.credential.ref?i.jsxs(i.Fragment,{children:[i.jsx("code",{children:N.credential.ref})," ",i.jsx(sc,{credential:N.credential})]}):N.credential.required?i.jsx(Ge,{tone:"critical",label:"Required, none entered"}):"none needed"},{label:"Runtime",value:N.runtime?`${N.runtime.metadata.runtime} (${N.runtime.metadata.execution_method})`:null,mono:!0},{label:"Can decide",value:N.runtime?i.jsx("span",{className:"feltkit-choices",children:D.map(Q=>i.jsx(Ge,{tone:N.runtime.capabilities[Q]?"positive":"neutral",label:Q.replace("_"," "),detail:N.runtime.capabilities[Q]?void 0:"no"},Q))}):null}]}),N.problems.map(Q=>i.jsx(Ke,{tone:"critical",title:Q.message,children:Q.fix},Q.problem)),g&&(g.ok?i.jsx(Ke,{tone:"info",title:`The model answered in ${g.durationMs} ms (${g.provider}, ${g.runtime.runtime})`,children:i.jsx(ki,{value:g.result,label:"Model answer"})}):i.jsx(Oe,{title:"The model did not answer",error:{message:`${g.error.message}${g.error.hint?` ${g.error.hint}`:""}`,code:g.error.code}}))]}),L&&w.length>0&&i.jsx(ej,{saved:w,development:v,overview:f.data,onChanged:()=>(m(null),d(Q=>Q+1))}),v&&L&&i.jsx(tj,{catalog:O,current:N,overview:f.data,onSaved:()=>d(Q=>Q+1)}),!v&&i.jsxs(Ke,{tone:"info",title:"Production models are set on the host",children:["Select one with ",i.jsx("code",{children:"feltkit model set --env production"}),". Keys live in the host's environment as ",i.jsx("code",{children:"FELTKIT_CREDENTIAL_<ID>"})," (or in a vault the operator opted in to with"," ",i.jsx("code",{children:"FELTKIT_CREDENTIAL_VAULT=1"}),")."]}),!L&&i.jsxs(Ke,{tone:"info",title:"The Intelligence service is not enabled",children:["Add ",i.jsx("code",{children:"intelligence: true"})," to ",i.jsx("code",{children:"services"})," in ",i.jsx("code",{children:"feltkit/app.ts"})," (new apps have it on); Studio reloads and you can choose a provider and enter its API key here. Or pass"," ",i.jsx("code",{children:"agent.decisions"}),"."]})]})}function ej({saved:n,development:u,overview:d,onChanged:r}){const[f,v,b]=Wr(d);return i.jsxs(se,{title:"Saved models",action:u?i.jsx(Ni,{id:"saved-models-as",as:f,setAs:v,devUsers:b,label:"Switch as"}):null,children:[i.jsx("p",{className:"feltkit-muted feltkit-small",children:"The agent decides with the model in use. Keep others here to switch between providers and models; each keeps its own API key reference."}),i.jsx(dt,{label:"Saved models",columns:[{id:"provider",header:"Provider"},{id:"model",header:"Model"},{id:"endpoint",header:"Endpoint"},{id:"key",header:"API key"},{id:"actions",header:"Actions"}],rows:n.map(g=>({key:g.id,selected:!!g.active,cells:{provider:i.jsx("code",{children:g.provider}),model:i.jsxs("span",{className:"feltkit-row",children:[i.jsx("code",{children:g.model})," ",g.active&&i.jsx(Ge,{tone:"positive",label:"In use"})]}),endpoint:g.endpoint?i.jsx("code",{children:g.endpoint}):"default",key:g.credentialRef?i.jsx("code",{children:g.credentialRef}):"none",actions:u&&!g.active?i.jsxs("span",{className:"feltkit-actions",children:[i.jsx(Ee,{label:"Use",variant:"primary",action:()=>ae(`/models/saved/${g.id}/use`,{method:"POST",body:JSON.stringify({as:f})}),done:r}),i.jsx(Ee,{label:"Forget",action:()=>ae(`/models/saved/${g.id}`,{method:"DELETE"}),done:r,confirm:{title:`Forget ${g.provider} / ${g.model}?`,consequences:["The saved selection is removed from this environment's configuration.","Its API key stays in custody under its reference."],confirmLabel:"Forget model"}})]}):null}}))})]})}function tj({catalog:n,current:u,overview:d,onSaved:r}){const[f,v]=A.useState(u.provider??n[0]?.id??""),b=n.find(G=>G.id===f),[g,m]=A.useState(u.model??""),[h,S]=A.useState(u.endpoint??""),[p,N]=A.useState(u.credential?.ref??""),[O,L]=A.useState(""),[w,U]=A.useState(!1),[D,Q]=A.useState(null),[J,Z]=A.useState(null),[ne,ge]=A.useState(null),[W,Y,ue]=Wr(d),_e=b?b.credential!=="none":!1,Qe=`credential-ref:${f}`,Fe=p.trim()||Qe,_t=u.credential?.ref===Fe?u.credential:null;A.useEffect(()=>{b&&b.modelSelection==="catalog"&&!b.models.includes(g)&&m(b.models[0]??"")},[f]);const pt=G=>{if(Ti(G)){L(G.trim()),N(""),U(!0);return}N(G)},st=async G=>{Q(null),Z(null),ge(G?"use":"later");const P=O;L(""),U(!1);try{const je=_e?Fe:p.trim(),De={provider:f,model:g,...b?.customEndpoint&&h?{endpoint:h}:{},...je&&(P||b?.credential==="required"||p.trim())?{credentialRef:je}:{},...P?{apiKey:P}:{},...W?{as:W}:{},...G?{}:{activate:!1}},_=await ae("/models",{method:"POST",body:JSON.stringify(De)});Z({..._.stored??{},activate:G}),r()}catch(je){Q(je)}finally{ge(null)}},M=!!(f&&g)&&ne===null;return i.jsxs(se,{title:"Add a model (development)",children:[i.jsxs("div",{className:"feltkit-grid",children:[i.jsx(kt,{id:"model-provider",label:"Provider",value:f,onChange:v,options:n.map(G=>({value:G.id,label:`${G.displayName} (${G.protocol}${G.credential==="required"?", needs an API key":G.credential==="optional"?", API key optional":""})`}))}),b?.modelSelection==="catalog"?i.jsx(kt,{id:"model-model",label:"Model",value:g,onChange:m,options:b.models}):i.jsx(Ne,{id:"model-model",label:"Model",value:g,onChange:m,placeholder:b?.models[0]??"model id",spellcheck:"false",hint:"Required."}),b?.customEndpoint&&i.jsx(Ne,{id:"model-endpoint",label:"Endpoint",type:"url",value:h,onChange:S,placeholder:b.endpoints[0]??"http://localhost:11434/v1"}),_e&&i.jsx(Ne,{id:"model-key",label:`API key${b?.credential==="optional"?" (optional)":""}`,type:"password",autocomplete:"off",spellcheck:"false",value:O,onChange:L,placeholder:_t?.present?"Set: leave empty to keep it":"Paste your API key",hint:_t?.present?"A key is set. Type a new one to replace it.":void 0}),i.jsx(Ni,{id:"model-as",as:W,setAs:Y,devUsers:ue,label:"Save as"})]}),w&&i.jsx(Ke,{tone:"info",title:"This looks like an API key",children:"It moved to the key field: it will be stored securely, not in configuration."}),_e&&i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["The key is stored on the server in this environment's custody (",u.credential?.location&&u.credential.source!=="environment"?u.credential.location:"the local encrypted vault","), outside FeltDB, and never shown again. An environment variable ",i.jsx("code",{children:lj(Fe)})," overrides it.",_t?.present?i.jsxs(i.Fragment,{children:[" ","Currently: ",i.jsx(sc,{credential:_t})]}):null]}),i.jsxs("details",{className:"feltkit-details",children:[i.jsx("summary",{children:"Advanced: credential reference"}),i.jsx(Ne,{id:"model-reference",label:"Credential reference",hint:`A name for where the key is kept, such as credential-ref:openai, never the key itself. Configuration stores only this name. Default ${Qe}.`,value:p,onChange:pt,placeholder:Qe,spellcheck:"false"})]}),i.jsxs("div",{className:"feltkit-actions",children:[i.jsx(Ce,{variant:"primary",label:"Save and use",busy:ne==="use",disabled:!M,onClick:()=>{st(!0)}}),i.jsx(Ce,{label:"Save for later",busy:ne==="later",disabled:!M,onClick:()=>{st(!1)}})]}),D?i.jsx(Oe,{title:"Not saved",error:D}):null,J&&i.jsxs(Ke,{tone:"info",title:J.activate?"Saved and in use":"Saved for later",children:[J.activate?"Use Test the model above to call it.":"Switch to it under Saved models.",J.version?` API key: set (${J.location??"custody"}, version ${J.version}).`:""]})]})}function lj(n){return`FELTKIT_CREDENTIAL_${n.replace(/^credential-ref:/,"").replace(/[^A-Za-z0-9]/g,"_").toUpperCase()}`}const aj=["GET","POST","PUT","PATCH","DELETE"],nj=["string","number","integer","boolean","unknown"],_m=n=>n.map(u=>`${u.name}${u.required?"":"?"}${u.type==="string"?"":`:${u.type}`}`).join(", ");function ij(n){return n.split(",").map(u=>u.trim()).filter(Boolean).map(u=>{const[d="",r="string"]=u.split(":").map(v=>v.trim()),f=nj.includes(r)?r:"string";return{name:d.replace(/\?$/,""),type:f,required:!d.endsWith("?")}})}const sj=n=>{const d=[...n.path.matchAll(/\{([^}]+)\}/g)].map(r=>r[1]).filter(r=>!n.input.some(f=>f.name===r));return d.length?{...n,input:[...d.map(r=>({name:r,type:"string",required:!0})),...n.input]}:n},Nm=n=>n.toLowerCase().replace(/[^a-z0-9]+/g,"").replace(/^[0-9]+/,"")||"op";function cj({overview:n,existing:u,onConnected:d,onClose:r}){const f=Object.keys(n?.roles??{}),[v,b,g]=Wr(n),[m,h]=A.useState("openapi"),[S,p]=A.useState(""),[N,O]=A.useState(""),[L,w]=A.useState(""),[U,D]=A.useState(""),[Q,J]=A.useState(""),[Z,ne]=A.useState("bearer"),[ge,W]=A.useState("X-API-Key"),[Y,ue]=A.useState(""),[_e,Qe]=A.useState([]),[Fe,_t]=A.useState(f.filter(X=>X==="member"||X==="admin")),[pt,st]=A.useState(null),[M,G]=A.useState(null),[P,je]=A.useState(null),De=async()=>{G(null),st("read");try{const X=await ae("/integrations/openapi",{method:"POST",body:JSON.stringify(S.trim()?{url:S.trim()}:{document:N})});w(X.name),D(X.description??X.title??""),J(X.baseUrl??""),Qe(X.operations.map(te=>({...te,include:!0})))}catch(X){G(X)}finally{st(null)}},_=()=>Qe([..._e,{include:!0,name:"",method:"GET",path:"/",access:`${L||"api"}.read`,input:[]}]),$=(X,te)=>Qe(_e.map((me,Ue)=>{if(Ue!==X)return me;const ul={...me,...te},gl=L||"api";return te.method&&me.access===`${gl}.${me.method==="GET"?"read":"write"}`&&(ul.access=`${gl}.${te.method==="GET"?"read":"write"}`),ul})),K=X=>{const te=X.toLowerCase().replace(/[^a-z0-9]/g,""),me=`${L||"api"}.`;Qe(_e.map(Ue=>Ue.access.startsWith(me)?{...Ue,access:`${te||"api"}.${Ue.access.slice(me.length)}`}:Ue)),w(te)},F=_e.filter(X=>X.include),re=async()=>{G(null),st("connect");const X=Y;ue("");try{const te={name:L,...U.trim()?{description:U.trim()}:{},baseUrl:Q.trim(),auth:Z==="header"?{kind:"header",header:ge}:{kind:Z},operations:F.map(({include:Ue,...ul})=>{const gl=sj({...ul,include:!0}),{include:Ai,...Ra}=gl;return{...Ra,name:Nm(Ra.name),effect:Ra.method==="GET"?"observation":"consequential"}})},me=await ae("/integrations/connect",{method:"POST",body:JSON.stringify({integration:te,roles:Fe,...X?{apiKey:X,as:v}:{}})});je(me),d()}catch(te){G(te)}finally{st(null)}};return P?i.jsxs(se,{title:`Connected ${L}`,children:[i.jsxs(Ke,{tone:"info",title:`Wrote ${P.file}`,children:[P.granted.length?i.jsxs(i.Fragment,{children:["Granted ",i.jsxs("code",{children:[L,".*"]})," to ",P.granted.join(", ")," in ",i.jsx("code",{children:"feltkit/app.ts"}),"."," "]}):null,"The server reloads and publishes its operations below as capabilities.",P.stored?` The API key is stored (version ${P.stored.version}) and is never shown again.`:""]}),P.skipped.length>0&&i.jsxs("p",{className:"feltkit-small",children:["Not granted to ",P.skipped.join(", "),": add ",i.jsxs("code",{children:['"',L,'.*"']})," to their permissions in ",i.jsx("code",{children:"feltkit/app.ts"}),"."]}),i.jsxs("ul",{className:"feltkit-small",children:[i.jsxs("li",{children:["Narrow each operation's ",i.jsx("code",{children:"output"})," in ",i.jsx("code",{children:P.file})," to what the API returns: AppPort checks every response against it."]}),i.jsxs("li",{children:["For consequential operations, add ",i.jsx("code",{children:"idempotencyHeader"})," if the API deduplicates, and ",i.jsx("code",{children:"verify"})," so an unknown outcome can be settled without resending."]}),i.jsxs("li",{children:["In production set ",i.jsxs("code",{children:[L.toUpperCase(),"_URL"]}),P.credential?i.jsxs(i.Fragment,{children:[" ","and ",i.jsxs("code",{children:["FELTKIT_CREDENTIAL_",L.toUpperCase()]})]}):null," ","on the host."]})]}),i.jsxs("div",{className:"feltkit-actions",children:[i.jsx(Ce,{variant:"primary",label:"Done",onClick:r}),i.jsx(Ce,{label:"Connect another",onClick:()=>(je(null),Qe([]),w(""),p(""),O(""))})]})]}):i.jsxs(se,{title:"Connect an API",children:[i.jsxs("p",{className:"feltkit-small",children:["Connect a service your app calls: each operation becomes an AppPort capability your functions, agents and other apps can use, with its permission, effect, and every call recorded. This writes ",i.jsx("code",{children:"feltkit/<name>.ts"}),", which you own and can edit."]}),i.jsx(Hm,{label:"How to describe the API",idPrefix:"connect",panelId:"connect-panel",active:m,onSelect:X=>{h(X),X==="manual"&&_e.length===0&&_()},tabs:[{id:"openapi",label:"From an OpenAPI document"},{id:"manual",label:"Describe it yourself"}]}),i.jsx(Lm,{id:"connect-panel",idPrefix:"connect",active:m,children:i.jsxs("div",{className:"feltkit-stack",children:[m==="openapi"&&i.jsxs(i.Fragment,{children:[i.jsx(Ne,{id:"connect-url",label:"Document URL",type:"url",value:S,onChange:p,placeholder:"https://api.example.com/openapi.json"}),i.jsx(Ne,{id:"connect-pasted",label:"Or paste it (JSON)",multiline:!0,rows:4,value:N,onChange:O,placeholder:'{"openapi": "3.0.0", "paths": { … }}',spellcheck:"false"}),i.jsx("div",{children:i.jsx(Ce,{variant:"primary",label:"Read operations",busy:pt==="read",disabled:pt!==null||!S.trim()&&!N.trim(),onClick:()=>{De()}})})]}),M?i.jsx(Oe,{title:"Not connected",error:M}):null,(_e.length>0||m==="manual")&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"feltkit-grid",children:[i.jsx(Ne,{id:"connect-name",label:"Name",required:!0,value:L,onChange:K,placeholder:"crm",spellcheck:"false",hint:u.includes(L)?void 0:`Capabilities are ${L||"<name>"}.<operation>.`,error:u.includes(L)?"Already connected: choose another name.":void 0}),i.jsx(Ne,{id:"connect-base",label:"Base URL",required:!0,type:"url",value:Q,onChange:J,placeholder:"https://api.example.com",hint:`Used in development; production reads ${L?`${L.toUpperCase()}_URL`:"<NAME>_URL"}.`}),i.jsx(Ne,{id:"connect-description",label:"Description",value:U,onChange:D}),i.jsx(kt,{id:"connect-auth",label:"API key",value:Z,onChange:X=>ne(X),options:[{value:"bearer",label:"Sent as Authorization: Bearer"},{value:"header",label:"Sent in a header"},{value:"none",label:"No key"}]}),Z==="header"&&i.jsx(Ne,{id:"connect-header",label:"Header",value:ge,onChange:W,spellcheck:"false"}),Z!=="none"&&i.jsx(Ne,{id:"connect-key",label:"Key value (optional now)",type:"password",autocomplete:"off",spellcheck:"false",value:Y,onChange:ue,placeholder:"Stored securely; never shown again",hint:Y&&!Ti(Y)&&Y.length<8?"That looks short for a key.":void 0}),Z!=="none"&&Y&&i.jsx(Ni,{id:"connect-as",as:v,setAs:b,devUsers:g,label:"Store as"})]}),i.jsx("div",{className:"feltkit-stack",children:_e.map((X,te)=>i.jsxs($r,{legend:`Operation ${te+1}${X.name?`: ${X.name}`:""} · ${X.method==="GET"?"observation":"consequential"}`,hint:X.description,children:[i.jsx(Js,{id:`connect-op-${te}-include`,label:"Include this operation",checked:X.include,onChange:me=>$(te,{include:me})}),i.jsxs("div",{className:"feltkit-grid",children:[i.jsx(Ne,{id:`connect-op-${te}-name`,label:"Operation",value:X.name,onChange:me=>$(te,{name:Nm(me)}),placeholder:"listcontacts",spellcheck:"false"}),i.jsx(kt,{id:`connect-op-${te}-method`,label:"Method",value:X.method,onChange:me=>$(te,{method:me}),options:[...aj]}),i.jsx(Ne,{id:`connect-op-${te}-path`,label:"Path",value:X.path,onChange:me=>$(te,{path:me}),spellcheck:"false"}),i.jsx(uj,{id:`connect-op-${te}-input`,initial:_m(X.input),onDone:me=>$(te,{input:ij(me)})},_m(X.input)),i.jsx(Ne,{id:`connect-op-${te}-access`,label:"Permission",value:X.access,onChange:me=>$(te,{access:me}),spellcheck:"false"})]})]},te))}),i.jsxs("div",{className:"feltkit-actions",children:[i.jsx(Ce,{size:"sm",label:"Add operation",onClick:_}),i.jsx("span",{className:"feltkit-muted feltkit-small",children:"GET reads (observation); other methods may change the API (consequential). An unknown outcome is never re-sent."})]}),f.length>0&&i.jsx($r,{legend:`Grant ${L||"<name>"}.* to`,children:i.jsx("div",{className:"feltkit-choices",children:f.map(X=>i.jsx(Js,{id:`connect-grant-${X}`,label:X,checked:Fe.includes(X),onChange:te=>_t(te?[...Fe,X]:Fe.filter(me=>me!==X))},X))})}),i.jsxs("div",{className:"feltkit-actions",children:[i.jsx(Ce,{variant:"primary",label:`Connect ${F.length} operation${F.length===1?"":"s"}`,busy:pt==="connect",disabled:pt!==null||!L||!Q.trim()||F.length===0||u.includes(L),onClick:()=>{re()}}),L&&i.jsx(_i,{text:`feltkit/${L}.ts`,label:"Copy file path"})]})]})]})})]})}function uj({id:n,initial:u,onDone:d}){const[r,f]=A.useState(u);return i.jsx("div",{onBlur:()=>r!==u&&d(r),children:i.jsx(Ne,{id:n,label:"Input (name?:type)",value:r,onChange:f,placeholder:"id, amount:number, note?",spellcheck:"false"})})}function rj(){const{version:n}=Xt(),[u,d]=A.useState(0),r=Ve(()=>ae("/integrations"),[n,u]),f=Ve(()=>ae("/overview"),[n]),{development:v,canAct:b}=ec(f.data),m=(f.data?.devUsers??[])[0]?.id??"",[h,S]=A.useState({}),[p,N]=A.useState(!1),O=r.data?.integrations??[],L=r.data?.calls??[],w=i.jsx(wt,{title:"Integrations",subtitle:"Existing APIs, published as AppPort capabilities: what each operation does, who may invoke it, whether repeating it is safe, and how its outcome is verified. Seeing an operation grants nothing.",actions:v&&O.length>0&&!p?i.jsx(Ce,{variant:"primary",label:"Connect an API",onClick:()=>N(!0)}):null});return r.error&&!r.data?i.jsxs("div",{className:"feltkit-page",children:[w,i.jsx(Oe,{title:"Integrations could not be read",error:r.error,retry:r.reload})]}):r.data?i.jsxs("div",{className:"feltkit-page",children:[w,v&&(p||O.length===0)&&i.jsx(cj,{overview:f.data,existing:O.map(U=>U.name),onConnected:()=>(N(!0),d(U=>U+1)),onClose:()=>N(!1)}),O.length===0?!v&&i.jsxs(ql,{title:"No integrations yet",children:["Connect an API in development (Studio → Integrations), or with ",i.jsxs("code",{children:['app.integration("payments", ',"{"," baseUrl, credential, operations ","}",")"]})," in ",i.jsx("code",{children:"feltkit/"}),"."]}):O.map(U=>i.jsxs(se,{title:i.jsxs(i.Fragment,{children:[i.jsx("code",{children:U.name})," ",i.jsx(Pe,{field:"feltkit.integration.configured",value:U.problems.length===0})]}),action:b&&U.health?i.jsx(Ee,{label:"Check",action:()=>ae(`/integrations/${encodeURIComponent(U.name)}/check`,{method:"POST",body:"{}"}),done:D=>S(Q=>({...Q,[U.name]:D}))}):null,children:[U.description&&i.jsx("p",{children:U.description}),i.jsxs("div",{className:"feltkit-row feltkit-small",children:[i.jsx("code",{children:U.baseUrl.value??"—"}),i.jsxs("span",{className:"feltkit-muted",children:["(",U.baseUrl.source,U.baseUrl.variable?` ${U.baseUrl.variable}`:"",")"]}),U.credential&&i.jsxs(i.Fragment,{children:[i.jsx("code",{children:U.credential.ref})," ",i.jsx(sc,{credential:U.credential}),b&&U.credential.writable&&i.jsx(Ws,{credentialRef:U.credential.ref,label:U.credential.present?"Replace key":"Set key",...v&&m?{as:m}:{},onSaved:()=>d(D=>D+1)}),!U.credential.writable&&!U.credential.present&&i.jsxs("span",{className:"feltkit-muted",children:["Set ",U.credential.variable," on the host."]})]})]}),U.problems.map((D,Q)=>i.jsx(Ke,{tone:"critical",title:D.message,children:D.fix},Q)),h[U.name]&&i.jsx(Ke,{tone:h[U.name].ok?"info":"critical",title:h[U.name].ok?"The API answered":"The check failed",children:h[U.name].message}),i.jsx(dt,{label:`${U.name} operations`,columns:[{id:"capability",header:"Capability"},{id:"request",header:"Request"},{id:"effect",header:"Effect"},{id:"access",header:"Who may invoke"},{id:"repeat",header:"Repeat"},{id:"unknown",header:"Outcome unknown"}],rows:U.operations.map(D=>({key:D.capability,cells:{capability:i.jsx("code",{children:D.capability}),request:i.jsx("code",{children:`${D.method} ${D.path}`}),effect:D.effect,access:i.jsx("code",{children:D.access}),repeat:D.effect==="observation"?"safe":D.idempotent?"deduplicated by the API":"may duplicate",unknown:D.effect==="observation"?null:D.verifiable?"verify, never re-send":"a person settles it"}})),emptyTitle:"No operations declared"})]},U.name)),i.jsxs(se,{title:"Calls",children:[i.jsx(dt,{label:"Integration calls",columns:[{id:"capability",header:"Capability"},{id:"state",header:"State"},{id:"known",header:"How known"},{id:"as",header:"As"},{id:"http",header:"HTTP",align:"end"},{id:"detail",header:"Detail"},{id:"when",header:"When"},{id:"actions",header:"Actions"}],rows:L.map(U=>({key:U.id,cells:{capability:i.jsx("code",{children:U.capability}),state:i.jsx(Pe,{field:"feltkit.integration.call",value:U.state}),known:U.determinedBy?`${U.determinedBy}${U.verification?` (${U.verification.outcome})`:""}`:null,as:i.jsx("code",{children:U.principal.id}),http:U.status??null,detail:U.error?.message?i.jsx(Ge,{tone:"critical",label:U.error.code??"Error",detail:U.error.message}):null,when:xt(U.startedAt),actions:b&&(U.state==="unknown"||U.state==="started")?i.jsx(Ee,{label:"Verify",disabled:v&&!m,action:()=>ae(`/integrations/calls/${encodeURIComponent(U.id)}/verify`,{method:"POST",body:JSON.stringify(v?{as:m}:{})}),done:()=>d(D=>D+1)}):null}})),emptyTitle:"No calls yet"}),i.jsx("p",{className:"feltkit-muted feltkit-small",children:"A call is recorded before it is sent. Verify reads the API's own state through the declared probe; it never sends the request again."})]})]}):i.jsxs("div",{className:"feltkit-page",children:[w,i.jsx(bt,{what:"integrations"})]})}const oj=["fail","warn","pass","external"];function dj(){const{version:n}=Xt(),u=Ve(()=>ae("/readiness"),[n]),d=i.jsx(wt,{title:"Readiness",subtitle:"Real checks of this environment, not a status anyone sets. A passing check means the checked thing is in place; the operational requirements at the end are yours to meet.",actions:i.jsx(Ce,{label:"Check again",busy:u.loading&&!!u.data,onClick:u.reload})});if(u.error&&!u.data)return i.jsxs("div",{className:"feltkit-page",children:[d,i.jsx(Oe,{title:"Readiness could not be checked",error:u.error,retry:u.reload})]});if(!u.data)return i.jsxs("div",{className:"feltkit-page",children:[d,i.jsx(bt,{what:"this environment's checks"})]});const r=u.data,f=[...new Set(r.checks.map(v=>v.area))];return i.jsxs("div",{className:"feltkit-page",children:[d,i.jsxs(se,{label:"Summary",children:[i.jsx("p",{children:i.jsx("strong",{children:r.summary})}),i.jsx("ul",{className:"feltkit-choices","aria-label":"Checks by result",children:oj.map(v=>i.jsx("li",{className:"feltkit-row",children:i.jsx(Pe,{field:"feltkit.readiness.check",value:v,detail:String(r.counts[v]??0)})},v))}),i.jsxs("p",{className:"feltkit-muted feltkit-small",children:["The same report: ",i.jsxs("code",{children:["npx feltkit readiness --env ",r.environment.name]})]})]}),f.map(v=>i.jsx(se,{title:v,children:i.jsx("ul",{className:"feltkit-list",children:r.checks.filter(b=>b.area===v).map(b=>i.jsxs("li",{className:"feltkit-stack feltkit-check","data-check":b.id,children:[i.jsxs("span",{className:"feltkit-row",children:[i.jsx(Pe,{field:"feltkit.readiness.check",value:b.status})," ",i.jsx("strong",{children:b.title})]}),i.jsx("span",{className:"feltkit-small",children:b.detail}),b.fix&&b.status!=="pass"&&i.jsxs("span",{className:"feltkit-small feltkit-muted",children:["Fix: ",b.fix]})]},b.id))})},v))]})}const fj=new Set(["service_effect_evidence","_feltkit_activity"]),nv=A.createContext({live:!1,version:0,changed:{},activity:[],overview:void 0,reloadOverview(){}}),Xt=()=>A.useContext(nv),Pr=[{id:"overview",label:"Overview",key:"1",group:"Application"},{id:"data",label:"Data",key:"2",group:"Application"},{id:"capabilities",label:"Capabilities",key:"3",group:"Application"},{id:"integrations",label:"Integrations",key:"i",group:"Application"},{id:"services",label:"Services",key:"4",group:"Services"},{id:"agent",label:"Agent",key:"5",group:"Operate"},{id:"models",label:"Models",key:"m",group:"Operate"},{id:"activity",label:"Activity",key:"6",group:"Operate"},{id:"readiness",label:"Readiness",key:"r",group:"Operate"},{id:"settings",label:"Settings",key:"7",group:"Development"},{id:"projects",label:"Projects",key:"8",group:"Development"}],iv=["settings","projects"];function Tm(){const n=location.hash.replace(/^#\/?/,"").split("/").filter(Boolean).map(decodeURIComponent);return{route:Pr.find(d=>d.id===n[0])?.id??"overview",rest:n.slice(1)}}function yl(n){location.hash=`#/${n}`}const eo="feltkit-main";function hj(){const[n,u]=A.useState("loading"),[d,r]=A.useState("");return A.useEffect(()=>{fetch("/api/session",{credentials:"same-origin"}).then(f=>f.json()).then(f=>{r(f?.environment?.name??""),u(f?.environment?.production?"production":"development")}).catch(()=>u("development"))},[]),n==="loading"?i.jsx("main",{className:"feltkit-gate",children:i.jsx(bt,{what:"the runtime"})}):n==="production"?i.jsx(vj,{environment:d}):i.jsx(yj,{})}function mj(){const n=/(?:^|[#&])grant=([^&]+)/.exec(location.hash);if(!n)return null;history.replaceState(null,"",`${location.pathname}#/overview`);try{return decodeURIComponent(n[1])}catch{return null}}function vj({environment:n}){const[u,d]=A.useState("checking"),[r,f]=A.useState(null),[v,b]=A.useState(!1),[g]=A.useState(mj),m=S=>{S?.operator&&S?.csrf?(Dr({csrf:S.csrf,environment:n}),d("signed-in")):(Dr(null),d("signed-out"))},h=async S=>{f(null),b(!0);try{const p=await fetch("/_feltkit/api/operator/signin",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","x-feltkit-environment":n},body:JSON.stringify({grant:S})}),N=await p.json();if(!p.ok)throw new Error(N?.error?.message??`Sign-in failed (${p.status})`);m(N)}catch(p){f(`${p.message}${g===S?" The link works once and expires after 10 minutes: run `npx feltkit manage` for a new one.":""}`),d("signed-out")}finally{b(!1)}};return A.useEffect(()=>{g?h(g):ae("/operator/session").then(m,()=>d("signed-out"))},[]),u==="checking"?i.jsx("main",{className:"feltkit-gate",children:i.jsx(bt,{what:g?"your sign-in":"your operator session"})}):u==="signed-in"?i.jsx(cv,{onSignOut:()=>{ae("/operator/signout",{method:"POST",body:"{}"}).catch(()=>{}).finally(()=>(Dr(null),d("signed-out")))}}):i.jsxs(sv,{title:`Sign in to ${n} Studio`,field:{id:"operator-grant",label:"Operator grant",placeholder:"fkg1.…"},submitLabel:"Sign in",busy:v,error:r,onSubmit:S=>{h(S)},children:["Production Studio is for operators. In your project folder, run ",i.jsx("code",{children:"npx feltkit manage"})," and open the one-time link it prints, or paste the grant from"," ",i.jsx("code",{children:"npx feltkit operator grant --id <you> --role <role>"}),". Everything you do is authorized and recorded as you."]})}function yj(){const[n,u]=A.useState(()=>{const f=Lg();return Or(f),f}),[d,r]=A.useState(!1);return n?i.jsx(cv,{onSignOut:f=>(Or(null),hm(null),r(!!f),u(null))}):i.jsxs(sv,{title:"Open the FeltKit dashboard",field:{id:"admin-token",label:"Admin token",placeholder:"fka_…"},submitLabel:"Continue",error:d?"That admin token was not accepted. Delete .feltkit/<env>/admin-token to generate a new one.":null,onSubmit:f=>(Or(f),hm(f),r(!1),u(f)),children:["Open the ",i.jsx("strong",{children:"Dashboard"})," link ",i.jsx("code",{children:"feltkit dev"})," prints (it carries the token), or paste the token from ",i.jsx("code",{children:".feltkit/development/admin-token"}),"."]})}function sv({title:n,field:u,submitLabel:d,busy:r,error:f,onSubmit:v,children:b}){const[g,m]=A.useState(""),[h,S]=Qm();return i.jsxs("div",{className:"feltkit-gate","data-stack-shell":"",children:[i.jsxs("header",{className:"feltkit-gate__bar",children:[i.jsx(Zb,{id:"gate-theme",preference:h,onChange:S}),i.jsx(gj,{id:"gate-family-mark"})]}),i.jsxs("main",{className:"feltkit-gate__card",id:eo,children:[i.jsx("img",{src:Jb,width:"32",height:"32",alt:"FeltKit"}),i.jsx("h1",{className:"feltkit-gate__title",children:n}),i.jsx("p",{className:"feltkit-muted",children:b}),f&&i.jsx(Ke,{tone:"critical",title:"Not signed in",children:f}),i.jsx(Bl,{label:n,submitLabel:d,busy:r,onSubmit:()=>{g.trim()&&v(g.trim())},children:i.jsx(Ne,{id:u.id,label:u.label,value:g,onChange:m,placeholder:u.placeholder,autocomplete:"off",spellcheck:"false",required:!0})})]})]})}function gj({id:n}){return i.jsxs("a",{className:"feltkit-family",href:"https://boundry.company",children:[i.jsx(Xb,{idPrefix:n})," A Boundry product"]})}function cv({onSignOut:n}){const[{route:u,rest:d},r]=A.useState(Tm),[f,v]=A.useState(!1),[b,g]=A.useState(null),[m,h]=A.useState(0),[S,p]=A.useState({}),[N,O]=A.useState([]),[L,w]=Qm(),U=Ve(()=>ae("/overview"),[m]),D=A.useRef(null),Q=A.useRef(!0);A.useEffect(()=>{const W=()=>r(Tm());return window.addEventListener("hashchange",W),()=>window.removeEventListener("hashchange",W)},[]),A.useEffect(()=>{Q.current?Q.current=!1:qb(eo)},[u,d[0]]),A.useEffect(()=>Yg((W,Y)=>{g(new Date().toISOString()),!(W==="activity"&&(O(ue=>[Y,...ue].slice(0,200)),Y?.outcome!=="success"&&!Y?.writes?.length))&&(W==="change"&&(p(ue=>{const _e={...ue};for(const Qe of Y.collections)_e[Qe]=(_e[Qe]??0)+1;return _e}),Y.collections.every(ue=>fj.has(ue)))||D.current===null&&(D.current=window.setTimeout(()=>{D.current=null,h(ue=>ue+1)},250)))},W=>{v(W),W||g(Y=>Y??new Date().toISOString())}),[]),A.useEffect(()=>{const W=Y=>{const ue=Y.target;if(Y.metaKey||Y.ctrlKey||Y.altKey||["INPUT","TEXTAREA","SELECT"].includes(ue.tagName)||ue.isContentEditable||ue.closest("dialog"))return;const _e=Pr.find(Qe=>Qe.key===Y.key);_e&&yl(_e.id)};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[]);const J=A.useMemo(()=>({live:f,version:m,changed:S,activity:N,overview:U.data,reloadOverview:U.reload}),[f,m,S,N,U.data,U.reload]),Z=U.error?.status===401;A.useEffect(()=>{Z&&n(!0)},[Z,n]);const ne=U.data,ge=!!ne?.environment?.production;return i.jsx(nv.Provider,{value:J,children:i.jsx(pj,{overview:ne,route:u,rest:d,live:f,lastEventAt:b,theme:L,setTheme:w,onSignOut:()=>n(),children:U.loading&&!ne?i.jsx(bt,{what:"the runtime"}):ne?i.jsx(jj,{route:ge&&iv.includes(u)?"overview":u,rest:d}):i.jsx(Oe,{title:"The runtime did not answer",error:U.error,retry:U.reload})})})}const Am=n=>n.state!=="available"&&n.state!=="unavailable";function bj(n,u,d){const r=!!n?.environment?.production,f=Pr.filter(b=>!r||!iv.includes(b.id)).map((b,g)=>({id:b.id,label:b.label,href:`#/${b.id}`,group:b.group,order:g,current:u===b.id&&!(b.id==="services"&&d[0]),attrs:{"aria-keyshortcuts":b.key,"data-route":b.id}})),v=n?.services??[];if(v.length){const b=u==="services"?d[0]:void 0,g=(m,h,S,p)=>({id:`service-${m}`,label:h,href:`#/services/${m}`,group:S,order:p,current:b===m,attrs:{"data-service":m}});v.filter(Am).forEach((m,h)=>f.push(g(m.id,m.name,"Services",100+h))),f.push(g("credentials","Credentials","Services",200)),v.filter(m=>!Am(m)).forEach((m,h)=>f.push(g(m.id,m.name,"Services not enabled",300+h)))}return f}function pj({overview:n,route:u,rest:d,live:r,lastEventAt:f,theme:v,setTheme:b,onSignOut:g,children:m}){const h=!!n?.environment?.production,S=Ir("feltkit.runtime.state",n?.state);return i.jsxs(Qb,{product:{id:"feltkit",name:"FeltKit",homeHref:"#/overview",mark:"FK"},navigation:bj(n,u,d),onNavigate:p=>location.hash=p,mainId:eo,context:i.jsxs("span",{className:"feltkit-context",children:[i.jsx("strong",{className:"feltkit-context__app",children:n?.application?.name??"…"}),n&&i.jsx("code",{className:"feltkit-context__env",children:n.environment.name}),i.jsx($m,{freshness:r?"live":f?"stale":"unknown",...!r&&f?{asOf:f}:{},source:"events"})]}),theme:{preference:v,onChange:b},account:i.jsx(i.Fragment,{children:i.jsx(Ce,{size:"sm",variant:"ghost",label:n?.operator?"Sign out":"Lock",onClick:g,attrs:{title:n?.operator?"Sign out of production Studio":"Forget the admin token in this tab"}})}),children:[n&&i.jsx("div",{className:"feltkit-environment","data-environment":n.environment.name,children:h?i.jsxs(Ke,{tone:"attention",title:`Production · signed in as ${n.operator?.principal?.id??"unknown"}`,children:["Roles ",(n.operator?.principal?.roles??[]).join(", ")||"none",". Actions run on this environment only and are recorded as you."]}):i.jsxs("p",{className:"feltkit-environment__line",children:[i.jsxs("span",{children:["FeltDB ",n.instance.feltdbVersion]}),i.jsx("span",{children:n.instance.mode}),i.jsx("code",{className:"feltkit-path",title:n.instance.location,children:n.instance.location}),i.jsxs("span",{className:"feltkit-muted",children:["runtime ",S.label.toLowerCase()," · development tools on"]})]})}),m]})}function jj({route:n,rest:u}){switch(n){case"data":return i.jsx(Ib,{collection:u[0]});case"capabilities":return i.jsx(np,{selected:u[0]});case"services":return i.jsx(Mp,{page:u[0]});case"agent":return i.jsx(Jp,{rest:u});case"models":return i.jsx(Pp,{});case"integrations":return i.jsx(rj,{});case"readiness":return i.jsx(dj,{});case"activity":return i.jsx(Yp,{selected:u[0]});case"settings":return i.jsx(Xp,{});case"projects":return i.jsx(Kp,{});default:return i.jsx(Fb,{})}}function wt({title:n,subtitle:u,actions:d,crumbs:r,status:f}){return i.jsxs(i.Fragment,{children:[r&&i.jsx(Gb,{items:r}),i.jsx(Yb,{title:n,description:u,actions:d,status:f})]})}Hg.createRoot(document.getElementById("root")).render(i.jsx(A.StrictMode,{children:i.jsx(hj,{})}));
|