@netnodeag/kraftwerk 0.35.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +26 -19
  2. package/dist/cli/init.js +3 -3
  3. package/dist/cli/routines.js +9 -9
  4. package/dist/config.d.ts +2 -2
  5. package/dist/config.js +1 -1
  6. package/dist/inspector/{team.d.ts → agents.d.ts} +21 -12
  7. package/dist/inspector/{team.js → agents.js} +34 -19
  8. package/dist/inspector/chat/backend.d.ts +1 -1
  9. package/dist/inspector/chat/sessions.js +43 -43
  10. package/dist/inspector/chat/store.js +13 -1
  11. package/dist/inspector/chat/types.d.ts +2 -2
  12. package/dist/inspector/instances.d.ts +12 -0
  13. package/dist/inspector/instances.js +28 -0
  14. package/dist/inspector/routines.d.ts +4 -4
  15. package/dist/inspector/routines.js +11 -11
  16. package/dist/inspector/search.d.ts +25 -0
  17. package/dist/inspector/search.js +31 -0
  18. package/dist/inspector/server.js +34 -29
  19. package/dist/inspector/skills.d.ts +6 -6
  20. package/dist/inspector/skills.js +8 -8
  21. package/inspector/dist/assets/{editor-BABv2LmA.js → editor-7ImnDC3D.js} +3 -3
  22. package/inspector/dist/assets/{index-DbWUNbt-.js → index--2I7vpcS.js} +1 -1
  23. package/inspector/dist/assets/index-B2ThRS2S.js +217 -0
  24. package/inspector/dist/assets/{index-BXspF2KR.css → index-BA7nx4V5.css} +1 -1
  25. package/inspector/dist/assets/{index-CdwTmXTV.js → index-BC7aIJ-h.js} +1 -1
  26. package/inspector/dist/assets/{index-DuPp3MUc.js → index-BIXYBiw7.js} +1 -1
  27. package/inspector/dist/assets/{index-Bmm4zJNU.js → index-BZeYO5wT.js} +1 -1
  28. package/inspector/dist/assets/{index-sLxulPOm.js → index-B_CIhKa4.js} +1 -1
  29. package/inspector/dist/assets/{index-DCR7u4Xa.js → index-BuRajvjQ.js} +1 -1
  30. package/inspector/dist/assets/{index-Ca9Qs5LZ.js → index-C3Ob1O7W.js} +1 -1
  31. package/inspector/dist/assets/{index-HBdsdJhD.js → index-CIjv7yxE.js} +1 -1
  32. package/inspector/dist/assets/{index-wkYwz0Tl.js → index-CRAwmMfk.js} +1 -1
  33. package/inspector/dist/assets/{index-ByWpqzAI.js → index-Ct_jZSyD.js} +1 -1
  34. package/inspector/dist/assets/{index-hkVov8T4.js → index-DKrBjjGQ.js} +1 -1
  35. package/inspector/dist/assets/{index-Gx93brFq.js → index-DL_bJiOj.js} +1 -1
  36. package/inspector/dist/assets/{index-BbTer62d.js → index-DPBAv_kj.js} +1 -1
  37. package/inspector/dist/assets/{index-CCACy6uF.js → index-DbmSSHvr.js} +1 -1
  38. package/inspector/dist/assets/{index-DuwmzZAr.js → index-DjRBLY9N.js} +1 -1
  39. package/inspector/dist/assets/{index-CzPQygR7.js → index-YZtBJhWD.js} +1 -1
  40. package/inspector/dist/assets/{index-CjlJeW9z.js → index-fWUFhIGR.js} +1 -1
  41. package/inspector/dist/index.html +2 -2
  42. package/package.json +1 -1
  43. package/inspector/dist/assets/index-uEig4--d.js +0 -217
@@ -1,217 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor-BABv2LmA.js","assets/editor-9rr2cQaW.css"])))=>i.map(i=>d[i]);
2
- function Ex(i,c){for(var o=0;o<c.length;o++){const u=c[o];if(typeof u!="string"&&!Array.isArray(u)){for(const f in u)if(f!=="default"&&!(f in i)){const h=Object.getOwnPropertyDescriptor(u,f);h&&Object.defineProperty(i,f,h.get?h:{enumerable:!0,get:()=>u[f]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))u(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function o(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function u(f){if(f.ep)return;f.ep=!0;const h=o(f);fetch(f.href,h)}})();function _x(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Wu={exports:{}},oi={};var hm;function Ax(){if(hm)return oi;hm=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function o(u,f,h){var m=null;if(h!==void 0&&(m=""+h),f.key!==void 0&&(m=""+f.key),"key"in f){h={};for(var p in f)p!=="key"&&(h[p]=f[p])}else h=f;return f=h.ref,{$$typeof:i,type:u,key:m,ref:f!==void 0?f:null,props:h}}return oi.Fragment=c,oi.jsx=o,oi.jsxs=o,oi}var mm;function Cx(){return mm||(mm=1,Wu.exports=Ax()),Wu.exports}var l=Cx(),Pu={exports:{}},me={};var pm;function Rx(){if(pm)return me;pm=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),j=Symbol.iterator;function M(w){return w===null||typeof w!="object"?null:(w=j&&w[j]||w["@@iterator"],typeof w=="function"?w:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},K=Object.assign,X={};function T(w,G,te){this.props=w,this.context=G,this.refs=X,this.updater=te||N}T.prototype.isReactComponent={},T.prototype.setState=function(w,G){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,G,"setState")},T.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function le(){}le.prototype=T.prototype;function fe(w,G,te){this.props=w,this.context=G,this.refs=X,this.updater=te||N}var Z=fe.prototype=new le;Z.constructor=fe,K(Z,T.prototype),Z.isPureReactComponent=!0;var I=Array.isArray;function q(){}var H={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function ee(w,G,te){var F=te.ref;return{$$typeof:i,type:w,key:G,ref:F!==void 0?F:null,props:te}}function ve(w,G){return ee(w.type,G,w.props)}function ge(w){return typeof w=="object"&&w!==null&&w.$$typeof===i}function ae(w){var G={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(te){return G[te]})}var be=/\/+/g;function Je(w,G){return typeof w=="object"&&w!==null&&w.key!=null?ae(""+w.key):G.toString(36)}function nt(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(q,q):(w.status="pending",w.then(function(G){w.status==="pending"&&(w.status="fulfilled",w.value=G)},function(G){w.status==="pending"&&(w.status="rejected",w.reason=G)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function U(w,G,te,F,he){var pe=typeof w;(pe==="undefined"||pe==="boolean")&&(w=null);var _e=!1;if(w===null)_e=!0;else switch(pe){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(w.$$typeof){case i:case c:_e=!0;break;case k:return _e=w._init,U(_e(w._payload),G,te,F,he)}}if(_e)return he=he(w),_e=F===""?"."+Je(w,0):F,I(he)?(te="",_e!=null&&(te=_e.replace(be,"$&/")+"/"),U(he,G,te,"",function(Re){return Re})):he!=null&&(ge(he)&&(he=ve(he,te+(he.key==null||w&&w.key===he.key?"":(""+he.key).replace(be,"$&/")+"/")+_e)),G.push(he)),1;_e=0;var mt=F===""?".":F+":";if(I(w))for(var $=0;$<w.length;$++)F=w[$],pe=mt+Je(F,$),_e+=U(F,G,te,pe,he);else if($=M(w),typeof $=="function")for(w=$.call(w),$=0;!(F=w.next()).done;)F=F.value,pe=mt+Je(F,$++),_e+=U(F,G,te,pe,he);else if(pe==="object"){if(typeof w.then=="function")return U(nt(w),G,te,F,he);throw G=String(w),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return _e}function P(w,G,te){if(w==null)return w;var F=[],he=0;return U(w,F,"","",function(pe){return G.call(te,pe,he++)}),F}function re(w){if(w._status===-1){var G=w._result;G=G(),G.then(function(te){(w._status===0||w._status===-1)&&(w._status=1,w._result=te)},function(te){(w._status===0||w._status===-1)&&(w._status=2,w._result=te)}),w._status===-1&&(w._status=0,w._result=G)}if(w._status===1)return w._result.default;throw w._result}var Ce=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},je={map:P,forEach:function(w,G,te){P(w,function(){G.apply(this,arguments)},te)},count:function(w){var G=0;return P(w,function(){G++}),G},toArray:function(w){return P(w,function(G){return G})||[]},only:function(w){if(!ge(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return me.Activity=E,me.Children=je,me.Component=T,me.Fragment=o,me.Profiler=f,me.PureComponent=fe,me.StrictMode=u,me.Suspense=y,me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,me.__COMPILER_RUNTIME={__proto__:null,c:function(w){return H.H.useMemoCache(w)}},me.cache=function(w){return function(){return w.apply(null,arguments)}},me.cacheSignal=function(){return null},me.cloneElement=function(w,G,te){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var F=K({},w.props),he=w.key;if(G!=null)for(pe in G.key!==void 0&&(he=""+G.key),G)!W.call(G,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&G.ref===void 0||(F[pe]=G[pe]);var pe=arguments.length-2;if(pe===1)F.children=te;else if(1<pe){for(var _e=Array(pe),mt=0;mt<pe;mt++)_e[mt]=arguments[mt+2];F.children=_e}return ee(w.type,he,F)},me.createContext=function(w){return w={$$typeof:m,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:h,_context:w},w},me.createElement=function(w,G,te){var F,he={},pe=null;if(G!=null)for(F in G.key!==void 0&&(pe=""+G.key),G)W.call(G,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(he[F]=G[F]);var _e=arguments.length-2;if(_e===1)he.children=te;else if(1<_e){for(var mt=Array(_e),$=0;$<_e;$++)mt[$]=arguments[$+2];he.children=mt}if(w&&w.defaultProps)for(F in _e=w.defaultProps,_e)he[F]===void 0&&(he[F]=_e[F]);return ee(w,pe,he)},me.createRef=function(){return{current:null}},me.forwardRef=function(w){return{$$typeof:p,render:w}},me.isValidElement=ge,me.lazy=function(w){return{$$typeof:k,_payload:{_status:-1,_result:w},_init:re}},me.memo=function(w,G){return{$$typeof:x,type:w,compare:G===void 0?null:G}},me.startTransition=function(w){var G=H.T,te={};H.T=te;try{var F=w(),he=H.S;he!==null&&he(te,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(q,Ce)}catch(pe){Ce(pe)}finally{G!==null&&te.types!==null&&(G.types=te.types),H.T=G}},me.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},me.use=function(w){return H.H.use(w)},me.useActionState=function(w,G,te){return H.H.useActionState(w,G,te)},me.useCallback=function(w,G){return H.H.useCallback(w,G)},me.useContext=function(w){return H.H.useContext(w)},me.useDebugValue=function(){},me.useDeferredValue=function(w,G){return H.H.useDeferredValue(w,G)},me.useEffect=function(w,G){return H.H.useEffect(w,G)},me.useEffectEvent=function(w){return H.H.useEffectEvent(w)},me.useId=function(){return H.H.useId()},me.useImperativeHandle=function(w,G,te){return H.H.useImperativeHandle(w,G,te)},me.useInsertionEffect=function(w,G){return H.H.useInsertionEffect(w,G)},me.useLayoutEffect=function(w,G){return H.H.useLayoutEffect(w,G)},me.useMemo=function(w,G){return H.H.useMemo(w,G)},me.useOptimistic=function(w,G){return H.H.useOptimistic(w,G)},me.useReducer=function(w,G,te){return H.H.useReducer(w,G,te)},me.useRef=function(w){return H.H.useRef(w)},me.useState=function(w){return H.H.useState(w)},me.useSyncExternalStore=function(w,G,te){return H.H.useSyncExternalStore(w,G,te)},me.useTransition=function(){return H.H.useTransition()},me.version="19.2.8",me}var gm;function No(){return gm||(gm=1,Pu.exports=Rx()),Pu.exports}var C=No();const zx=_x(C),Vb=Ex({__proto__:null,default:zx},[C]);var eo={exports:{}},fi={},to={exports:{}},ao={};var xm;function Ox(){return xm||(xm=1,(function(i){function c(U,P){var re=U.length;U.push(P);e:for(;0<re;){var Ce=re-1>>>1,je=U[Ce];if(0<f(je,P))U[Ce]=P,U[re]=je,re=Ce;else break e}}function o(U){return U.length===0?null:U[0]}function u(U){if(U.length===0)return null;var P=U[0],re=U.pop();if(re!==P){U[0]=re;e:for(var Ce=0,je=U.length,w=je>>>1;Ce<w;){var G=2*(Ce+1)-1,te=U[G],F=G+1,he=U[F];if(0>f(te,re))F<je&&0>f(he,te)?(U[Ce]=he,U[F]=re,Ce=F):(U[Ce]=te,U[G]=re,Ce=G);else if(F<je&&0>f(he,re))U[Ce]=he,U[F]=re,Ce=F;else break e}}return P}function f(U,P){var re=U.sortIndex-P.sortIndex;return re!==0?re:U.id-P.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;i.unstable_now=function(){return h.now()}}else{var m=Date,p=m.now();i.unstable_now=function(){return m.now()-p}}var y=[],x=[],k=1,E=null,j=3,M=!1,N=!1,K=!1,X=!1,T=typeof setTimeout=="function"?setTimeout:null,le=typeof clearTimeout=="function"?clearTimeout:null,fe=typeof setImmediate<"u"?setImmediate:null;function Z(U){for(var P=o(x);P!==null;){if(P.callback===null)u(x);else if(P.startTime<=U)u(x),P.sortIndex=P.expirationTime,c(y,P);else break;P=o(x)}}function I(U){if(K=!1,Z(U),!N)if(o(y)!==null)N=!0,q||(q=!0,ae());else{var P=o(x);P!==null&&nt(I,P.startTime-U)}}var q=!1,H=-1,W=5,ee=-1;function ve(){return X?!0:!(i.unstable_now()-ee<W)}function ge(){if(X=!1,q){var U=i.unstable_now();ee=U;var P=!0;try{e:{N=!1,K&&(K=!1,le(H),H=-1),M=!0;var re=j;try{t:{for(Z(U),E=o(y);E!==null&&!(E.expirationTime>U&&ve());){var Ce=E.callback;if(typeof Ce=="function"){E.callback=null,j=E.priorityLevel;var je=Ce(E.expirationTime<=U);if(U=i.unstable_now(),typeof je=="function"){E.callback=je,Z(U),P=!0;break t}E===o(y)&&u(y),Z(U)}else u(y);E=o(y)}if(E!==null)P=!0;else{var w=o(x);w!==null&&nt(I,w.startTime-U),P=!1}}break e}finally{E=null,j=re,M=!1}P=void 0}}finally{P?ae():q=!1}}}var ae;if(typeof fe=="function")ae=function(){fe(ge)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Je=be.port2;be.port1.onmessage=ge,ae=function(){Je.postMessage(null)}}else ae=function(){T(ge,0)};function nt(U,P){H=T(function(){U(i.unstable_now())},P)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(U){U.callback=null},i.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<U?Math.floor(1e3/U):5},i.unstable_getCurrentPriorityLevel=function(){return j},i.unstable_next=function(U){switch(j){case 1:case 2:case 3:var P=3;break;default:P=j}var re=j;j=P;try{return U()}finally{j=re}},i.unstable_requestPaint=function(){X=!0},i.unstable_runWithPriority=function(U,P){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var re=j;j=U;try{return P()}finally{j=re}},i.unstable_scheduleCallback=function(U,P,re){var Ce=i.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?Ce+re:Ce):re=Ce,U){case 1:var je=-1;break;case 2:je=250;break;case 5:je=1073741823;break;case 4:je=1e4;break;default:je=5e3}return je=re+je,U={id:k++,callback:P,priorityLevel:U,startTime:re,expirationTime:je,sortIndex:-1},re>Ce?(U.sortIndex=re,c(x,U),o(y)===null&&U===o(x)&&(K?(le(H),H=-1):K=!0,nt(I,re-Ce))):(U.sortIndex=je,c(y,U),N||M||(N=!0,q||(q=!0,ae()))),U},i.unstable_shouldYield=ve,i.unstable_wrapCallback=function(U){var P=j;return function(){var re=j;j=P;try{return U.apply(this,arguments)}finally{j=re}}}})(ao)),ao}var vm;function Dx(){return vm||(vm=1,to.exports=Ox()),to.exports}var no={exports:{}},Rt={};var ym;function Mx(){if(ym)return Rt;ym=1;var i=No();function c(y){var x="https://react.dev/errors/"+y;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)x+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+y+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var u={d:{f:o,r:function(){throw Error(c(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},f=Symbol.for("react.portal");function h(y,x,k){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:E==null?null:""+E,children:y,containerInfo:x,implementation:k}}var m=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(y,x){if(y==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Rt.createPortal=function(y,x){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(c(299));return h(y,x,null,k)},Rt.flushSync=function(y){var x=m.T,k=u.p;try{if(m.T=null,u.p=2,y)return y()}finally{m.T=x,u.p=k,u.d.f()}},Rt.preconnect=function(y,x){typeof y=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,u.d.C(y,x))},Rt.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},Rt.preinit=function(y,x){if(typeof y=="string"&&x&&typeof x.as=="string"){var k=x.as,E=p(k,x.crossOrigin),j=typeof x.integrity=="string"?x.integrity:void 0,M=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;k==="style"?u.d.S(y,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:E,integrity:j,fetchPriority:M}):k==="script"&&u.d.X(y,{crossOrigin:E,integrity:j,fetchPriority:M,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Rt.preinitModule=function(y,x){if(typeof y=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var k=p(x.as,x.crossOrigin);u.d.M(y,{crossOrigin:k,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&u.d.M(y)},Rt.preload=function(y,x){if(typeof y=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var k=x.as,E=p(k,x.crossOrigin);u.d.L(y,k,{crossOrigin:E,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},Rt.preloadModule=function(y,x){if(typeof y=="string")if(x){var k=p(x.as,x.crossOrigin);u.d.m(y,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:k,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else u.d.m(y)},Rt.requestFormReset=function(y){u.d.r(y)},Rt.unstable_batchedUpdates=function(y,x){return y(x)},Rt.useFormState=function(y,x,k){return m.H.useFormState(y,x,k)},Rt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Rt.version="19.2.8",Rt}var bm;function Ux(){if(bm)return no.exports;bm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),no.exports=Mx(),no.exports}var jm;function Lx(){if(jm)return fi;jm=1;var i=Dx(),c=No(),o=Ux();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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 h(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(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 p(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 y(e){if(h(e)!==e)throw Error(u(188))}function x(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(u(188));return t!==e?null:e}for(var a=e,n=t;;){var s=a.return;if(s===null)break;var r=s.alternate;if(r===null){if(n=s.return,n!==null){a=n;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===a)return y(s),e;if(r===n)return y(s),t;r=r.sibling}throw Error(u(188))}if(a.return!==n.return)a=s,n=r;else{for(var d=!1,g=s.child;g;){if(g===a){d=!0,a=s,n=r;break}if(g===n){d=!0,n=s,a=r;break}g=g.sibling}if(!d){for(g=r.child;g;){if(g===a){d=!0,a=r,n=s;break}if(g===n){d=!0,n=r,a=s;break}g=g.sibling}if(!d)throw Error(u(189))}}if(a.alternate!==n)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?e:t}function k(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=k(e),t!==null)return t;e=e.sibling}return null}var E=Object.assign,j=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),le=Symbol.for("react.consumer"),fe=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),ve=Symbol.for("react.memo_cache_sentinel"),ge=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=ge&&e[ge]||e["@@iterator"],typeof e=="function"?e:null)}var be=Symbol.for("react.client.reference");function Je(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===be?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case T:return"Profiler";case X:return"StrictMode";case I:return"Suspense";case q:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case fe:return e.displayName||"Context";case le: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 H:return t=e.displayName||null,t!==null?t:Je(e.type)||"Memo";case W:t=e._payload,e=e._init;try{return Je(e(t))}catch{}}return null}var nt=Array.isArray,U=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},Ce=[],je=-1;function w(e){return{current:e}}function G(e){0>je||(e.current=Ce[je],Ce[je]=null,je--)}function te(e,t){je++,Ce[je]=e.current,e.current=t}var F=w(null),he=w(null),pe=w(null),_e=w(null);function mt(e,t){switch(te(pe,t),te(he,e),te(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Uh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Uh(t),e=Lh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(F),te(F,e)}function $(){G(F),G(he),G(pe)}function Re(e){e.memoizedState!==null&&te(_e,e);var t=F.current,a=Lh(t,e.type);t!==a&&(te(he,e),te(F,a))}function Ge(e){he.current===e&&(G(F),G(he)),_e.current===e&&(G(_e),ii._currentValue=re)}var We,ta;function Oe(e){if(We===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);We=t&&t[1]||"",ta=-1<a.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+We+e+ta}var Xn=!1;function Ye(e,t){if(!e||Xn)return"";Xn=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(D){var O=D}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(D){O=D}e.call(Y.prototype)}}else{try{throw Error()}catch(D){O=D}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(D){if(D&&O&&typeof D.stack=="string")return[D.stack,O.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=n.DetermineComponentFrameRoot(),d=r[0],g=r[1];if(d&&g){var b=d.split(`
5
- `),z=g.split(`
6
- `);for(s=n=0;n<b.length&&!b[n].includes("DetermineComponentFrameRoot");)n++;for(;s<z.length&&!z[s].includes("DetermineComponentFrameRoot");)s++;if(n===b.length||s===z.length)for(n=b.length-1,s=z.length-1;1<=n&&0<=s&&b[n]!==z[s];)s--;for(;1<=n&&0<=s;n--,s--)if(b[n]!==z[s]){if(n!==1||s!==1)do if(n--,s--,0>s||b[n]!==z[s]){var L=`
7
- `+b[n].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=n&&0<=s);break}}}finally{Xn=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Oe(a):""}function os(e,t){switch(e.tag){case 26:case 27:case 5:return Oe(e.type);case 16:return Oe("Lazy");case 13:return e.child!==t&&t!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return Ye(e.type,!1);case 11:return Ye(e.type.render,!1);case 1:return Ye(e.type,!0);case 31:return Oe("Activity");default:return""}}function Yt(e){try{var t="",a=null;do t+=os(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
8
- Error generating stack: `+n.message+`
9
- `+n.stack}}var qa=Object.prototype.hasOwnProperty,bl=i.unstable_scheduleCallback,aa=i.unstable_cancelCallback,Si=i.unstable_shouldYield,fs=i.unstable_requestPaint,At=i.unstable_now,wi=i.unstable_getCurrentPriorityLevel,xa=i.unstable_ImmediatePriority,Aa=i.unstable_UserBlockingPriority,na=i.unstable_NormalPriority,ds=i.unstable_LowPriority,Qn=i.unstable_IdlePriority,jl=i.log,hs=i.unstable_setDisableYieldValue,la=null,yt=null;function Xt(e){if(typeof jl=="function"&&hs(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(la,e)}catch{}}var Ct=Math.clz32?Math.clz32:ms,ki=Math.log,Ti=Math.LN2;function ms(e){return e>>>=0,e===0?32:31-(ki(e)/Ti|0)|0}var on=256,va=262144,ya=4194304;function Ca(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 Zn(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var s=0,r=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var g=n&134217727;return g!==0?(n=g&~r,n!==0?s=Ca(n):(d&=g,d!==0?s=Ca(d):a||(a=g&~e,a!==0&&(s=Ca(a))))):(g=n&~r,g!==0?s=Ca(g):d!==0?s=Ca(d):a||(a=n&~e,a!==0&&(s=Ca(a)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,a=t&-t,r>=a||r===32&&(a&4194048)!==0)?t:s}function fn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ei(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 ps(){var e=ya;return ya<<=1,(ya&62914560)===0&&(ya=4194304),e}function dn(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ra(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function sa(e,t,a,n,s,r){var d=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var g=e.entanglements,b=e.expirationTimes,z=e.hiddenUpdates;for(a=d&~a;0<a;){var L=31-Ct(a),Y=1<<L;g[L]=0,b[L]=-1;var O=z[L];if(O!==null)for(z[L]=null,L=0;L<O.length;L++){var D=O[L];D!==null&&(D.lane&=-536870913)}a&=~Y}n!==0&&$a(e,n,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(d&~t))}function $a(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Ct(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Nl(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Ct(a),s=1<<n;s&t|e[n]&t&&(e[n]|=t),a&=~s}}function Sl(e,t){var a=t&-t;return a=(a&42)!==0?1:gs(a),(a&(e.suspendedLanes|t))!==0?0:a}function gs(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 wl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function kl(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:im(e.type))}function xs(e,t){var a=P.p;try{return P.p=e,t()}finally{P.p=a}}var ia=Math.random().toString(36).slice(2),pt="__reactFiber$"+ia,it="__reactProps$"+ia,hn="__reactContainer$"+ia,vs="__reactEvents$"+ia,et="__reactListeners$"+ia,mn="__reactHandles$"+ia,_i="__reactResources$"+ia,pn="__reactMarker$"+ia;function Vn(e){delete e[pt],delete e[it],delete e[vs],delete e[et],delete e[mn]}function Ga(e){var t=e[pt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[hn]||a[pt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Xh(e);e!==null;){if(a=e[pt])return a;e=Xh(e)}return t}e=a,a=e.parentNode}return null}function Ya(e){if(e=e[pt]||e[hn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Kn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function gn(e){var t=e[_i];return t||(t=e[_i]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ct(e){e[pn]=!0}var Ai=new Set,ba={};function za(e,t){ja(e,t),ja(e+"Capture",t)}function ja(e,t){for(ba[e]=t,e=0;e<t.length;e++)Ai.add(t[e])}var Xa=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]*$"),Ci={},Jn={};function Ri(e){return qa.call(Jn,e)?!0:qa.call(Ci,e)?!1:Xa.test(e)?Jn[e]=!0:(Ci[e]=!0,!1)}function Tl(e,t,a){if(Ri(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function In(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function ca(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function Nt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function El(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _l(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(d){a=""+d,r.call(this,d)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(d){a=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oa(e){if(!e._valueTracker){var t=El(e)?"checked":"value";e._valueTracker=_l(e,t,""+e[t])}}function xn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=El(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Dt(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 Fc=/[\n"\\]/g;function St(e){return e.replace(Fc,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ys(e,t,a,n,s,r,d,g){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Nt(t)):e.value!==""+Nt(t)&&(e.value=""+Nt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Al(e,d,Nt(t)):a!=null?Al(e,d,Nt(a)):n!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+Nt(g):e.removeAttribute("name")}function bs(e,t,a,n,s,r,d,g){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||a!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){Oa(e);return}a=a!=null?""+Nt(a):"",t=t!=null?""+Nt(t):a,g||t===e.value||(e.value=t),e.defaultValue=t}n=n??s,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=g?e.checked:!!n,e.defaultChecked=!!n,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Oa(e)}function Al(e,t,a){t==="number"&&Dt(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Qa(e,t,a,n){if(e=e.options,t){t={};for(var s=0;s<a.length;s++)t["$"+a[s]]=!0;for(a=0;a<e.length;a++)s=t.hasOwnProperty("$"+e[a].value),e[a].selected!==s&&(e[a].selected=s),s&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Nt(a),t=null,s=0;s<e.length;s++){if(e[s].value===a){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function js(e,t,a){if(t!=null&&(t=""+Nt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Nt(a):""}function zi(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(u(92));if(nt(n)){if(1<n.length)throw Error(u(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Nt(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Oa(e)}function Za(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Wc=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 Oi(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||Wc.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Ns(e,t,a){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var s in t)n=t[s],t.hasOwnProperty(s)&&a[s]!==n&&Oi(e,s,n)}else for(var r in t)t.hasOwnProperty(r)&&Oi(e,r,t[r])}function vn(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 Ss=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"]]),J=/^[\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 v(e){return J.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function _(){}var Q=null;function ne(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var se=null,oe=null;function Be(e){var t=Ya(e);if(t&&(e=t.stateNode)){var a=e[it]||null;e:switch(e=t.stateNode,t.type){case"input":if(ys(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+St(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var s=n[it]||null;if(!s)throw Error(u(90));ys(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&xn(n)}break e;case"textarea":js(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Qa(e,!!a.multiple,t,!1)}}}var Ve=!1;function wt(e,t,a){if(Ve)return e(t,a);Ve=!0;try{var n=e(t);return n}finally{if(Ve=!1,(se!==null||oe!==null)&&(bc(),se&&(t=se,e=oe,oe=se=null,Be(t),e)))for(t=0;t<e.length;t++)Be(e[t])}}function rt(e,t){var a=e.stateNode;if(a===null)return null;var n=a[it]||null;if(n===null)return null;a=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(u(231,t,typeof a));return a}var Qt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gt=!1;if(Qt)try{var ws={};Object.defineProperty(ws,"passive",{get:function(){gt=!0}}),window.addEventListener("test",ws,ws),window.removeEventListener("test",ws,ws)}catch{gt=!1}var yn=null,Pc=null,Di=null;function Uo(){if(Di)return Di;var e,t=Pc,a=t.length,n,s="value"in yn?yn.value:yn.textContent,r=s.length;for(e=0;e<a&&t[e]===s[e];e++);var d=a-e;for(n=1;n<=d&&t[a-n]===s[r-n];n++);return Di=s.slice(e,1<n?1-n:void 0)}function Mi(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 Ui(){return!0}function Lo(){return!1}function Ut(e){function t(a,n,s,r,d){this._reactName=a,this._targetInst=s,this.type=n,this.nativeEvent=r,this.target=d,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(a=e[g],this[g]=a?a(r):r[g]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Ui:Lo,this.isPropagationStopped=Lo,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ui)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ui)},persist:function(){},isPersistent:Ui}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Li=Ut(Fn),ks=E({},Fn,{view:0,detail:0}),kp=Ut(ks),er,tr,Ts,Hi=E({},ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nr,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!==Ts&&(Ts&&e.type==="mousemove"?(er=e.screenX-Ts.screenX,tr=e.screenY-Ts.screenY):tr=er=0,Ts=e),er)},movementY:function(e){return"movementY"in e?e.movementY:tr}}),Ho=Ut(Hi),Tp=E({},Hi,{dataTransfer:0}),Ep=Ut(Tp),_p=E({},ks,{relatedTarget:0}),ar=Ut(_p),Ap=E({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0}),Cp=Ut(Ap),Rp=E({},Fn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zp=Ut(Rp),Op=E({},Fn,{data:0}),Bo=Ut(Op),Dp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mp={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"},Up={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Lp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Up[e])?!!t[e]:!1}function nr(){return Lp}var Hp=E({},ks,{key:function(e){if(e.key){var t=Dp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Mi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Mp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nr,charCode:function(e){return e.type==="keypress"?Mi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Mi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Bp=Ut(Hp),qp=E({},Hi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qo=Ut(qp),$p=E({},ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nr}),Gp=Ut($p),Yp=E({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xp=Ut(Yp),Qp=E({},Hi,{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}),Zp=Ut(Qp),Vp=E({},Fn,{newState:0,oldState:0}),Kp=Ut(Vp),Jp=[9,13,27,32],lr=Qt&&"CompositionEvent"in window,Es=null;Qt&&"documentMode"in document&&(Es=document.documentMode);var Ip=Qt&&"TextEvent"in window&&!Es,$o=Qt&&(!lr||Es&&8<Es&&11>=Es),Go=" ",Yo=!1;function Xo(e,t){switch(e){case"keyup":return Jp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cl=!1;function Fp(e,t){switch(e){case"compositionend":return Qo(t);case"keypress":return t.which!==32?null:(Yo=!0,Go);case"textInput":return e=t.data,e===Go&&Yo?null:e;default:return null}}function Wp(e,t){if(Cl)return e==="compositionend"||!lr&&Xo(e,t)?(e=Uo(),Di=Pc=yn=null,Cl=!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 $o&&t.locale!=="ko"?null:t.data;default:return null}}var Pp={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 Zo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Pp[e.type]:t==="textarea"}function Vo(e,t,a,n){se?oe?oe.push(n):oe=[n]:se=n,t=Ec(t,"onChange"),0<t.length&&(a=new Li("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var _s=null,As=null;function eg(e){Ch(e,0)}function Bi(e){var t=Kn(e);if(xn(t))return e}function Ko(e,t){if(e==="change")return t}var Jo=!1;if(Qt){var sr;if(Qt){var ir="oninput"in document;if(!ir){var Io=document.createElement("div");Io.setAttribute("oninput","return;"),ir=typeof Io.oninput=="function"}sr=ir}else sr=!1;Jo=sr&&(!document.documentMode||9<document.documentMode)}function Fo(){_s&&(_s.detachEvent("onpropertychange",Wo),As=_s=null)}function Wo(e){if(e.propertyName==="value"&&Bi(As)){var t=[];Vo(t,As,e,ne(e)),wt(eg,t)}}function tg(e,t,a){e==="focusin"?(Fo(),_s=t,As=a,_s.attachEvent("onpropertychange",Wo)):e==="focusout"&&Fo()}function ag(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bi(As)}function ng(e,t){if(e==="click")return Bi(t)}function lg(e,t){if(e==="input"||e==="change")return Bi(t)}function sg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:sg;function Cs(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var s=a[n];if(!qa.call(t,s)||!Zt(e[s],t[s]))return!1}return!0}function Po(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ef(e,t){var a=Po(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Po(a)}}function tf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function af(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Dt(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Dt(e.document)}return t}function cr(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 ig=Qt&&"documentMode"in document&&11>=document.documentMode,Rl=null,rr=null,Rs=null,ur=!1;function nf(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ur||Rl==null||Rl!==Dt(n)||(n=Rl,"selectionStart"in n&&cr(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Rs&&Cs(Rs,n)||(Rs=n,n=Ec(rr,"onSelect"),0<n.length&&(t=new Li("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Rl)))}function Wn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var zl={animationend:Wn("Animation","AnimationEnd"),animationiteration:Wn("Animation","AnimationIteration"),animationstart:Wn("Animation","AnimationStart"),transitionrun:Wn("Transition","TransitionRun"),transitionstart:Wn("Transition","TransitionStart"),transitioncancel:Wn("Transition","TransitionCancel"),transitionend:Wn("Transition","TransitionEnd")},or={},lf={};Qt&&(lf=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function Pn(e){if(or[e])return or[e];if(!zl[e])return e;var t=zl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in lf)return or[e]=t[a];return e}var sf=Pn("animationend"),cf=Pn("animationiteration"),rf=Pn("animationstart"),cg=Pn("transitionrun"),rg=Pn("transitionstart"),ug=Pn("transitioncancel"),uf=Pn("transitionend"),of=new Map,fr="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(" ");fr.push("scrollEnd");function Na(e,t){of.set(e,t),za(t,[e])}var qi=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)},ra=[],Ol=0,dr=0;function $i(){for(var e=Ol,t=dr=Ol=0;t<e;){var a=ra[t];ra[t++]=null;var n=ra[t];ra[t++]=null;var s=ra[t];ra[t++]=null;var r=ra[t];if(ra[t++]=null,n!==null&&s!==null){var d=n.pending;d===null?s.next=s:(s.next=d.next,d.next=s),n.pending=s}r!==0&&ff(a,s,r)}}function Gi(e,t,a,n){ra[Ol++]=e,ra[Ol++]=t,ra[Ol++]=a,ra[Ol++]=n,dr|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function hr(e,t,a,n){return Gi(e,t,a,n),Yi(e)}function el(e,t){return Gi(e,null,null,t),Yi(e)}function ff(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var s=!1,r=e.return;r!==null;)r.childLanes|=a,n=r.alternate,n!==null&&(n.childLanes|=a),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-Ct(a),e=r.hiddenUpdates,n=e[s],n===null?e[s]=[t]:n.push(t),t.lane=a|536870912),r):null}function Yi(e){if(50<Ps)throw Ps=0,Nu=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Dl={};function og(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vt(e,t,a,n){return new og(e,t,a,n)}function mr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Va(e,t){var a=e.alternate;return a===null?(a=Vt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function df(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Xi(e,t,a,n,s,r){var d=0;if(n=e,typeof e=="function")mr(e)&&(d=1);else if(typeof e=="string")d=px(e,a,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ee:return e=Vt(31,a,t,s),e.elementType=ee,e.lanes=r,e;case K:return tl(a.children,s,r,t);case X:d=8,s|=24;break;case T:return e=Vt(12,a,t,s|2),e.elementType=T,e.lanes=r,e;case I:return e=Vt(13,a,t,s),e.elementType=I,e.lanes=r,e;case q:return e=Vt(19,a,t,s),e.elementType=q,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fe:d=10;break e;case le:d=9;break e;case Z:d=11;break e;case H:d=14;break e;case W:d=16,n=null;break e}d=29,a=Error(u(130,e===null?"null":typeof e,"")),n=null}return t=Vt(d,a,t,s),t.elementType=e,t.type=n,t.lanes=r,t}function tl(e,t,a,n){return e=Vt(7,e,n,t),e.lanes=a,e}function pr(e,t,a){return e=Vt(6,e,null,t),e.lanes=a,e}function hf(e){var t=Vt(18,null,null,0);return t.stateNode=e,t}function gr(e,t,a){return t=Vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mf=new WeakMap;function ua(e,t){if(typeof e=="object"&&e!==null){var a=mf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Yt(t)},mf.set(e,t),t)}return{value:e,source:t,stack:Yt(t)}}var Ml=[],Ul=0,Qi=null,zs=0,oa=[],fa=0,bn=null,Da=1,Ma="";function Ka(e,t){Ml[Ul++]=zs,Ml[Ul++]=Qi,Qi=e,zs=t}function pf(e,t,a){oa[fa++]=Da,oa[fa++]=Ma,oa[fa++]=bn,bn=e;var n=Da;e=Ma;var s=32-Ct(n)-1;n&=~(1<<s),a+=1;var r=32-Ct(t)+s;if(30<r){var d=s-s%5;r=(n&(1<<d)-1).toString(32),n>>=d,s-=d,Da=1<<32-Ct(t)+s|a<<s|n,Ma=r+e}else Da=1<<r|a<<s|n,Ma=e}function xr(e){e.return!==null&&(Ka(e,1),pf(e,1,0))}function vr(e){for(;e===Qi;)Qi=Ml[--Ul],Ml[Ul]=null,zs=Ml[--Ul],Ml[Ul]=null;for(;e===bn;)bn=oa[--fa],oa[fa]=null,Ma=oa[--fa],oa[fa]=null,Da=oa[--fa],oa[fa]=null}function gf(e,t){oa[fa++]=Da,oa[fa++]=Ma,oa[fa++]=bn,Da=t.id,Ma=t.overflow,bn=e}var kt=null,Ie=null,Ae=!1,jn=null,da=!1,yr=Error(u(519));function Nn(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Os(ua(t,e)),yr}function xf(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[pt]=e,t[it]=n,a){case"dialog":Se("cancel",t),Se("close",t);break;case"iframe":case"object":case"embed":Se("load",t);break;case"video":case"audio":for(a=0;a<ti.length;a++)Se(ti[a],t);break;case"source":Se("error",t);break;case"img":case"image":case"link":Se("error",t),Se("load",t);break;case"details":Se("toggle",t);break;case"input":Se("invalid",t),bs(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Se("invalid",t);break;case"textarea":Se("invalid",t),zi(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||Dh(t.textContent,a)?(n.popover!=null&&(Se("beforetoggle",t),Se("toggle",t)),n.onScroll!=null&&Se("scroll",t),n.onScrollEnd!=null&&Se("scrollend",t),n.onClick!=null&&(t.onclick=_),t=!0):t=!1,t||Nn(e,!0)}function vf(e){for(kt=e.return;kt;)switch(kt.tag){case 5:case 31:case 13:da=!1;return;case 27:case 3:da=!0;return;default:kt=kt.return}}function Ll(e){if(e!==kt)return!1;if(!Ae)return vf(e),Ae=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Lu(e.type,e.memoizedProps)),a=!a),a&&Ie&&Nn(e),vf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ie=Yh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ie=Yh(e)}else t===27?(t=Ie,Un(e.type)?(e=Gu,Gu=null,Ie=e):Ie=t):Ie=kt?ma(e.stateNode.nextSibling):null;return!0}function al(){Ie=kt=null,Ae=!1}function br(){var e=jn;return e!==null&&(qt===null?qt=e:qt.push.apply(qt,e),jn=null),e}function Os(e){jn===null?jn=[e]:jn.push(e)}var jr=w(null),nl=null,Ja=null;function Sn(e,t,a){te(jr,t._currentValue),t._currentValue=a}function Ia(e){e._currentValue=jr.current,G(jr)}function Nr(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function Sr(e,t,a,n){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var d=s.child;r=r.firstContext;e:for(;r!==null;){var g=r;r=s;for(var b=0;b<t.length;b++)if(g.context===t[b]){r.lanes|=a,g=r.alternate,g!==null&&(g.lanes|=a),Nr(r.return,a,e),n||(d=null);break e}r=g.next}}else if(s.tag===18){if(d=s.return,d===null)throw Error(u(341));d.lanes|=a,r=d.alternate,r!==null&&(r.lanes|=a),Nr(d,a,e),d=null}else d=s.child;if(d!==null)d.return=s;else for(d=s;d!==null;){if(d===e){d=null;break}if(s=d.sibling,s!==null){s.return=d.return,d=s;break}d=d.return}s=d}}function Hl(e,t,a,n){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var d=s.alternate;if(d===null)throw Error(u(387));if(d=d.memoizedProps,d!==null){var g=s.type;Zt(s.pendingProps.value,d.value)||(e!==null?e.push(g):e=[g])}}else if(s===_e.current){if(d=s.alternate,d===null)throw Error(u(387));d.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(ii):e=[ii])}s=s.return}e!==null&&Sr(t,e,a,n),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ll(e){nl=e,Ja=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return yf(nl,e)}function Vi(e,t){return nl===null&&ll(e),yf(e,t)}function yf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ja===null){if(e===null)throw Error(u(308));Ja=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ja=Ja.next=t;return a}var fg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},dg=i.unstable_scheduleCallback,hg=i.unstable_NormalPriority,ut={$$typeof:fe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wr(){return{controller:new fg,data:new Map,refCount:0}}function Ds(e){e.refCount--,e.refCount===0&&dg(hg,function(){e.controller.abort()})}var Ms=null,kr=0,Bl=0,ql=null;function mg(e,t){if(Ms===null){var a=Ms=[];kr=0,Bl=_u(),ql={status:"pending",value:void 0,then:function(n){a.push(n)}}}return kr++,t.then(bf,bf),t}function bf(){if(--kr===0&&Ms!==null){ql!==null&&(ql.status="fulfilled");var e=Ms;Ms=null,Bl=0,ql=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function pg(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(s){a.push(s)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var s=0;s<a.length;s++)(0,a[s])(t)},function(s){for(n.status="rejected",n.reason=s,s=0;s<a.length;s++)(0,a[s])(void 0)}),n}var jf=U.S;U.S=function(e,t){lh=At(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&mg(e,t),jf!==null&&jf(e,t)};var sl=w(null);function Tr(){var e=sl.current;return e!==null?e:Ke.pooledCache}function Ki(e,t){t===null?te(sl,sl.current):te(sl,t.pool)}function Nf(){var e=Tr();return e===null?null:{parent:ut._currentValue,pool:e}}var $l=Error(u(460)),Er=Error(u(474)),Ji=Error(u(542)),Ii={then:function(){}};function Sf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function wf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(_,_),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Tf(e),e;default:if(typeof t.status=="string")t.then(_,_);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=n}},function(n){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Tf(e),e}throw cl=t,$l}}function il(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(cl=a,$l):a}}var cl=null;function kf(){if(cl===null)throw Error(u(459));var e=cl;return cl=null,e}function Tf(e){if(e===$l||e===Ji)throw Error(u(483))}var Gl=null,Us=0;function Fi(e){var t=Us;return Us+=1,Gl===null&&(Gl=[]),wf(Gl,e,t)}function Ls(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Wi(e,t){throw t.$$typeof===j?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ef(e){function t(A,S){if(e){var R=A.deletions;R===null?(A.deletions=[S],A.flags|=16):R.push(S)}}function a(A,S){if(!e)return null;for(;S!==null;)t(A,S),S=S.sibling;return null}function n(A){for(var S=new Map;A!==null;)A.key!==null?S.set(A.key,A):S.set(A.index,A),A=A.sibling;return S}function s(A,S){return A=Va(A,S),A.index=0,A.sibling=null,A}function r(A,S,R){return A.index=R,e?(R=A.alternate,R!==null?(R=R.index,R<S?(A.flags|=67108866,S):R):(A.flags|=67108866,S)):(A.flags|=1048576,S)}function d(A){return e&&A.alternate===null&&(A.flags|=67108866),A}function g(A,S,R,B){return S===null||S.tag!==6?(S=pr(R,A.mode,B),S.return=A,S):(S=s(S,R),S.return=A,S)}function b(A,S,R,B){var ue=R.type;return ue===K?L(A,S,R.props.children,B,R.key):S!==null&&(S.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===W&&il(ue)===S.type)?(S=s(S,R.props),Ls(S,R),S.return=A,S):(S=Xi(R.type,R.key,R.props,null,A.mode,B),Ls(S,R),S.return=A,S)}function z(A,S,R,B){return S===null||S.tag!==4||S.stateNode.containerInfo!==R.containerInfo||S.stateNode.implementation!==R.implementation?(S=gr(R,A.mode,B),S.return=A,S):(S=s(S,R.children||[]),S.return=A,S)}function L(A,S,R,B,ue){return S===null||S.tag!==7?(S=tl(R,A.mode,B,ue),S.return=A,S):(S=s(S,R),S.return=A,S)}function Y(A,S,R){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return S=pr(""+S,A.mode,R),S.return=A,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case M:return R=Xi(S.type,S.key,S.props,null,A.mode,R),Ls(R,S),R.return=A,R;case N:return S=gr(S,A.mode,R),S.return=A,S;case W:return S=il(S),Y(A,S,R)}if(nt(S)||ae(S))return S=tl(S,A.mode,R,null),S.return=A,S;if(typeof S.then=="function")return Y(A,Fi(S),R);if(S.$$typeof===fe)return Y(A,Vi(A,S),R);Wi(A,S)}return null}function O(A,S,R,B){var ue=S!==null?S.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return ue!==null?null:g(A,S,""+R,B);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case M:return R.key===ue?b(A,S,R,B):null;case N:return R.key===ue?z(A,S,R,B):null;case W:return R=il(R),O(A,S,R,B)}if(nt(R)||ae(R))return ue!==null?null:L(A,S,R,B,null);if(typeof R.then=="function")return O(A,S,Fi(R),B);if(R.$$typeof===fe)return O(A,S,Vi(A,R),B);Wi(A,R)}return null}function D(A,S,R,B,ue){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return A=A.get(R)||null,g(S,A,""+B,ue);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case M:return A=A.get(B.key===null?R:B.key)||null,b(S,A,B,ue);case N:return A=A.get(B.key===null?R:B.key)||null,z(S,A,B,ue);case W:return B=il(B),D(A,S,R,B,ue)}if(nt(B)||ae(B))return A=A.get(R)||null,L(S,A,B,ue,null);if(typeof B.then=="function")return D(A,S,R,Fi(B),ue);if(B.$$typeof===fe)return D(A,S,R,Vi(S,B),ue);Wi(S,B)}return null}function ie(A,S,R,B){for(var ue=null,Me=null,ce=S,ye=S=0,Te=null;ce!==null&&ye<R.length;ye++){ce.index>ye?(Te=ce,ce=null):Te=ce.sibling;var Ue=O(A,ce,R[ye],B);if(Ue===null){ce===null&&(ce=Te);break}e&&ce&&Ue.alternate===null&&t(A,ce),S=r(Ue,S,ye),Me===null?ue=Ue:Me.sibling=Ue,Me=Ue,ce=Te}if(ye===R.length)return a(A,ce),Ae&&Ka(A,ye),ue;if(ce===null){for(;ye<R.length;ye++)ce=Y(A,R[ye],B),ce!==null&&(S=r(ce,S,ye),Me===null?ue=ce:Me.sibling=ce,Me=ce);return Ae&&Ka(A,ye),ue}for(ce=n(ce);ye<R.length;ye++)Te=D(ce,A,ye,R[ye],B),Te!==null&&(e&&Te.alternate!==null&&ce.delete(Te.key===null?ye:Te.key),S=r(Te,S,ye),Me===null?ue=Te:Me.sibling=Te,Me=Te);return e&&ce.forEach(function($n){return t(A,$n)}),Ae&&Ka(A,ye),ue}function de(A,S,R,B){if(R==null)throw Error(u(151));for(var ue=null,Me=null,ce=S,ye=S=0,Te=null,Ue=R.next();ce!==null&&!Ue.done;ye++,Ue=R.next()){ce.index>ye?(Te=ce,ce=null):Te=ce.sibling;var $n=O(A,ce,Ue.value,B);if($n===null){ce===null&&(ce=Te);break}e&&ce&&$n.alternate===null&&t(A,ce),S=r($n,S,ye),Me===null?ue=$n:Me.sibling=$n,Me=$n,ce=Te}if(Ue.done)return a(A,ce),Ae&&Ka(A,ye),ue;if(ce===null){for(;!Ue.done;ye++,Ue=R.next())Ue=Y(A,Ue.value,B),Ue!==null&&(S=r(Ue,S,ye),Me===null?ue=Ue:Me.sibling=Ue,Me=Ue);return Ae&&Ka(A,ye),ue}for(ce=n(ce);!Ue.done;ye++,Ue=R.next())Ue=D(ce,A,ye,Ue.value,B),Ue!==null&&(e&&Ue.alternate!==null&&ce.delete(Ue.key===null?ye:Ue.key),S=r(Ue,S,ye),Me===null?ue=Ue:Me.sibling=Ue,Me=Ue);return e&&ce.forEach(function(Tx){return t(A,Tx)}),Ae&&Ka(A,ye),ue}function Ze(A,S,R,B){if(typeof R=="object"&&R!==null&&R.type===K&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case M:e:{for(var ue=R.key;S!==null;){if(S.key===ue){if(ue=R.type,ue===K){if(S.tag===7){a(A,S.sibling),B=s(S,R.props.children),B.return=A,A=B;break e}}else if(S.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===W&&il(ue)===S.type){a(A,S.sibling),B=s(S,R.props),Ls(B,R),B.return=A,A=B;break e}a(A,S);break}else t(A,S);S=S.sibling}R.type===K?(B=tl(R.props.children,A.mode,B,R.key),B.return=A,A=B):(B=Xi(R.type,R.key,R.props,null,A.mode,B),Ls(B,R),B.return=A,A=B)}return d(A);case N:e:{for(ue=R.key;S!==null;){if(S.key===ue)if(S.tag===4&&S.stateNode.containerInfo===R.containerInfo&&S.stateNode.implementation===R.implementation){a(A,S.sibling),B=s(S,R.children||[]),B.return=A,A=B;break e}else{a(A,S);break}else t(A,S);S=S.sibling}B=gr(R,A.mode,B),B.return=A,A=B}return d(A);case W:return R=il(R),Ze(A,S,R,B)}if(nt(R))return ie(A,S,R,B);if(ae(R)){if(ue=ae(R),typeof ue!="function")throw Error(u(150));return R=ue.call(R),de(A,S,R,B)}if(typeof R.then=="function")return Ze(A,S,Fi(R),B);if(R.$$typeof===fe)return Ze(A,S,Vi(A,R),B);Wi(A,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,S!==null&&S.tag===6?(a(A,S.sibling),B=s(S,R),B.return=A,A=B):(a(A,S),B=pr(R,A.mode,B),B.return=A,A=B),d(A)):a(A,S)}return function(A,S,R,B){try{Us=0;var ue=Ze(A,S,R,B);return Gl=null,ue}catch(ce){if(ce===$l||ce===Ji)throw ce;var Me=Vt(29,ce,null,A.mode);return Me.lanes=B,Me.return=A,Me}}}var rl=Ef(!0),_f=Ef(!1),wn=!1;function _r(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ar(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 kn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Tn(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Le&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=Yi(e),ff(e,null,a),t}return Gi(e,n,t,a),Yi(e)}function Hs(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Nl(e,a)}}function Cr(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var s=null,r=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};r===null?s=r=d:r=r.next=d,a=a.next}while(a!==null);r===null?s=r=t:r=r.next=t}else s=r=t;a={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Rr=!1;function Bs(){if(Rr){var e=ql;if(e!==null)throw e}}function qs(e,t,a,n){Rr=!1;var s=e.updateQueue;wn=!1;var r=s.firstBaseUpdate,d=s.lastBaseUpdate,g=s.shared.pending;if(g!==null){s.shared.pending=null;var b=g,z=b.next;b.next=null,d===null?r=z:d.next=z,d=b;var L=e.alternate;L!==null&&(L=L.updateQueue,g=L.lastBaseUpdate,g!==d&&(g===null?L.firstBaseUpdate=z:g.next=z,L.lastBaseUpdate=b))}if(r!==null){var Y=s.baseState;d=0,L=z=b=null,g=r;do{var O=g.lane&-536870913,D=O!==g.lane;if(D?(ke&O)===O:(n&O)===O){O!==0&&O===Bl&&(Rr=!0),L!==null&&(L=L.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var ie=e,de=g;O=t;var Ze=a;switch(de.tag){case 1:if(ie=de.payload,typeof ie=="function"){Y=ie.call(Ze,Y,O);break e}Y=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=de.payload,O=typeof ie=="function"?ie.call(Ze,Y,O):ie,O==null)break e;Y=E({},Y,O);break e;case 2:wn=!0}}O=g.callback,O!==null&&(e.flags|=64,D&&(e.flags|=8192),D=s.callbacks,D===null?s.callbacks=[O]:D.push(O))}else D={lane:O,tag:g.tag,payload:g.payload,callback:g.callback,next:null},L===null?(z=L=D,b=Y):L=L.next=D,d|=O;if(g=g.next,g===null){if(g=s.shared.pending,g===null)break;D=g,g=D.next,D.next=null,s.lastBaseUpdate=D,s.shared.pending=null}}while(!0);L===null&&(b=Y),s.baseState=b,s.firstBaseUpdate=z,s.lastBaseUpdate=L,r===null&&(s.shared.lanes=0),Rn|=d,e.lanes=d,e.memoizedState=Y}}function Af(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Cf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Af(a[e],t)}var Yl=w(null),Pi=w(0);function Rf(e,t){e=sn,te(Pi,e),te(Yl,t),sn=e|t.baseLanes}function zr(){te(Pi,sn),te(Yl,Yl.current)}function Or(){sn=Pi.current,G(Yl),G(Pi)}var Kt=w(null),ha=null;function En(e){var t=e.alternate;te(lt,lt.current&1),te(Kt,e),ha===null&&(t===null||Yl.current!==null||t.memoizedState!==null)&&(ha=e)}function Dr(e){te(lt,lt.current),te(Kt,e),ha===null&&(ha=e)}function zf(e){e.tag===22?(te(lt,lt.current),te(Kt,e),ha===null&&(ha=e)):_n()}function _n(){te(lt,lt.current),te(Kt,Kt.current)}function Jt(e){G(Kt),ha===e&&(ha=null),G(lt)}var lt=w(0);function ec(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||qu(a)||$u(a)))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 Fa=0,xe=null,Xe=null,ot=null,tc=!1,Xl=!1,ul=!1,ac=0,$s=0,Ql=null,gg=0;function tt(){throw Error(u(321))}function Mr(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Zt(e[a],t[a]))return!1;return!0}function Ur(e,t,a,n,s,r){return Fa=r,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?pd:Fr,ul=!1,r=a(n,s),ul=!1,Xl&&(r=Df(t,a,n,s)),Of(e),r}function Of(e){U.H=Xs;var t=Xe!==null&&Xe.next!==null;if(Fa=0,ot=Xe=xe=null,tc=!1,$s=0,Ql=null,t)throw Error(u(300));e===null||ft||(e=e.dependencies,e!==null&&Zi(e)&&(ft=!0))}function Df(e,t,a,n){xe=e;var s=0;do{if(Xl&&(Ql=null),$s=0,Xl=!1,25<=s)throw Error(u(301));if(s+=1,ot=Xe=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}U.H=gd,r=t(a,n)}while(Xl);return r}function xg(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Gs(t):t,e=e.useState()[0],(Xe!==null?Xe.memoizedState:null)!==e&&(xe.flags|=1024),t}function Lr(){var e=ac!==0;return ac=0,e}function Hr(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Br(e){if(tc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}tc=!1}Fa=0,ot=Xe=xe=null,Xl=!1,$s=ac=0,Ql=null}function Mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?xe.memoizedState=ot=e:ot=ot.next=e,ot}function st(){if(Xe===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=ot===null?xe.memoizedState:ot.next;if(t!==null)ot=t,Xe=e;else{if(e===null)throw xe.alternate===null?Error(u(467)):Error(u(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},ot===null?xe.memoizedState=ot=e:ot=ot.next=e}return ot}function nc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gs(e){var t=$s;return $s+=1,Ql===null&&(Ql=[]),e=wf(Ql,e,t),t=xe,(ot===null?t.memoizedState:ot.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?pd:Fr),e}function lc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Gs(e);if(e.$$typeof===fe)return Tt(e)}throw Error(u(438,String(e)))}function qr(e){var t=null,a=xe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=xe.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=nc(),xe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=ve;return t.index++,a}function Wa(e,t){return typeof t=="function"?t(e):t}function sc(e){var t=st();return $r(t,Xe,e)}function $r(e,t,a){var n=e.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=a;var s=e.baseQueue,r=n.pending;if(r!==null){if(s!==null){var d=s.next;s.next=r.next,r.next=d}t.baseQueue=s=r,n.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var g=d=null,b=null,z=t,L=!1;do{var Y=z.lane&-536870913;if(Y!==z.lane?(ke&Y)===Y:(Fa&Y)===Y){var O=z.revertLane;if(O===0)b!==null&&(b=b.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),Y===Bl&&(L=!0);else if((Fa&O)===O){z=z.next,O===Bl&&(L=!0);continue}else Y={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},b===null?(g=b=Y,d=r):b=b.next=Y,xe.lanes|=O,Rn|=O;Y=z.action,ul&&a(r,Y),r=z.hasEagerState?z.eagerState:a(r,Y)}else O={lane:Y,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},b===null?(g=b=O,d=r):b=b.next=O,xe.lanes|=Y,Rn|=Y;z=z.next}while(z!==null&&z!==t);if(b===null?d=r:b.next=g,!Zt(r,e.memoizedState)&&(ft=!0,L&&(a=ql,a!==null)))throw a;e.memoizedState=r,e.baseState=d,e.baseQueue=b,n.lastRenderedState=r}return s===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Gr(e){var t=st(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var n=a.dispatch,s=a.pending,r=t.memoizedState;if(s!==null){a.pending=null;var d=s=s.next;do r=e(r,d.action),d=d.next;while(d!==s);Zt(r,t.memoizedState)||(ft=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),a.lastRenderedState=r}return[r,n]}function Mf(e,t,a){var n=xe,s=st(),r=Ae;if(r){if(a===void 0)throw Error(u(407));a=a()}else a=t();var d=!Zt((Xe||s).memoizedState,a);if(d&&(s.memoizedState=a,ft=!0),s=s.queue,Qr(Hf.bind(null,n,s,e),[e]),s.getSnapshot!==t||d||ot!==null&&ot.memoizedState.tag&1){if(n.flags|=2048,Zl(9,{destroy:void 0},Lf.bind(null,n,s,a,t),null),Ke===null)throw Error(u(349));r||(Fa&127)!==0||Uf(n,t,a)}return a}function Uf(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=xe.updateQueue,t===null?(t=nc(),xe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Lf(e,t,a,n){t.value=a,t.getSnapshot=n,Bf(t)&&qf(e)}function Hf(e,t,a){return a(function(){Bf(t)&&qf(e)})}function Bf(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Zt(e,a)}catch{return!0}}function qf(e){var t=el(e,2);t!==null&&$t(t,e,2)}function Yr(e){var t=Mt();if(typeof e=="function"){var a=e;if(e=a(),ul){Xt(!0);try{a()}finally{Xt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wa,lastRenderedState:e},t}function $f(e,t,a,n){return e.baseState=a,$r(e,Xe,typeof n=="function"?n:Wa)}function vg(e,t,a,n,s){if(rc(e))throw Error(u(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){r.listeners.push(d)}};U.T!==null?a(!0):r.isTransition=!1,n(r),a=t.pending,a===null?(r.next=t.pending=r,Gf(t,r)):(r.next=a.next,t.pending=a.next=r)}}function Gf(e,t){var a=t.action,n=t.payload,s=e.state;if(t.isTransition){var r=U.T,d={};U.T=d;try{var g=a(s,n),b=U.S;b!==null&&b(d,g),Yf(e,t,g)}catch(z){Xr(e,t,z)}finally{r!==null&&d.types!==null&&(r.types=d.types),U.T=r}}else try{r=a(s,n),Yf(e,t,r)}catch(z){Xr(e,t,z)}}function Yf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Xf(e,t,n)},function(n){return Xr(e,t,n)}):Xf(e,t,a)}function Xf(e,t,a){t.status="fulfilled",t.value=a,Qf(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Gf(e,a)))}function Xr(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,Qf(t),t=t.next;while(t!==n)}e.action=null}function Qf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zf(e,t){return t}function Vf(e,t){if(Ae){var a=Ke.formState;if(a!==null){e:{var n=xe;if(Ae){if(Ie){t:{for(var s=Ie,r=da;s.nodeType!==8;){if(!r){s=null;break t}if(s=ma(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Ie=ma(s.nextSibling),n=s.data==="F!";break e}}Nn(n)}n=!1}n&&(t=a[0])}}return a=Mt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zf,lastRenderedState:t},a.queue=n,a=dd.bind(null,xe,n),n.dispatch=a,n=Yr(!1),r=Ir.bind(null,xe,!1,n.queue),n=Mt(),s={state:t,dispatch:null,action:e,pending:null},n.queue=s,a=vg.bind(null,xe,s,r,a),s.dispatch=a,n.memoizedState=e,[t,a,!1]}function Kf(e){var t=st();return Jf(t,Xe,e)}function Jf(e,t,a){if(t=$r(e,t,Zf)[0],e=sc(Wa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Gs(t)}catch(d){throw d===$l?Ji:d}else n=t;t=st();var s=t.queue,r=s.dispatch;return a!==t.memoizedState&&(xe.flags|=2048,Zl(9,{destroy:void 0},yg.bind(null,s,a),null)),[n,r,e]}function yg(e,t){e.action=t}function If(e){var t=st(),a=Xe;if(a!==null)return Jf(t,a,e);st(),t=t.memoizedState,a=st();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Zl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=xe.updateQueue,t===null&&(t=nc(),xe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function Ff(){return st().memoizedState}function ic(e,t,a,n){var s=Mt();xe.flags|=e,s.memoizedState=Zl(1|t,{destroy:void 0},a,n===void 0?null:n)}function cc(e,t,a,n){var s=st();n=n===void 0?null:n;var r=s.memoizedState.inst;Xe!==null&&n!==null&&Mr(n,Xe.memoizedState.deps)?s.memoizedState=Zl(t,r,a,n):(xe.flags|=e,s.memoizedState=Zl(1|t,r,a,n))}function Wf(e,t){ic(8390656,8,e,t)}function Qr(e,t){cc(2048,8,e,t)}function bg(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=nc(),xe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Pf(e){var t=st().memoizedState;return bg({ref:t,nextImpl:e}),function(){if((Le&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function ed(e,t){return cc(4,2,e,t)}function td(e,t){return cc(4,4,e,t)}function ad(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nd(e,t,a){a=a!=null?a.concat([e]):null,cc(4,4,ad.bind(null,t,e),a)}function Zr(){}function ld(e,t){var a=st();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Mr(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function sd(e,t){var a=st();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Mr(t,n[1]))return n[0];if(n=e(),ul){Xt(!0);try{e()}finally{Xt(!1)}}return a.memoizedState=[n,t],n}function Vr(e,t,a){return a===void 0||(Fa&1073741824)!==0&&(ke&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=ih(),xe.lanes|=e,Rn|=e,a)}function id(e,t,a,n){return Zt(a,t)?a:Yl.current!==null?(e=Vr(e,a,n),Zt(e,t)||(ft=!0),e):(Fa&42)===0||(Fa&1073741824)!==0&&(ke&261930)===0?(ft=!0,e.memoizedState=a):(e=ih(),xe.lanes|=e,Rn|=e,t)}function cd(e,t,a,n,s){var r=P.p;P.p=r!==0&&8>r?r:8;var d=U.T,g={};U.T=g,Ir(e,!1,t,a);try{var b=s(),z=U.S;if(z!==null&&z(g,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var L=pg(b,n);Ys(e,t,L,Wt(e))}else Ys(e,t,n,Wt(e))}catch(Y){Ys(e,t,{then:function(){},status:"rejected",reason:Y},Wt())}finally{P.p=r,d!==null&&g.types!==null&&(d.types=g.types),U.T=d}}function jg(){}function Kr(e,t,a,n){if(e.tag!==5)throw Error(u(476));var s=rd(e).queue;cd(e,s,t,re,a===null?jg:function(){return ud(e),a(n)})}function rd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wa,lastRenderedState:re},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wa,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ud(e){var t=rd(e);t.next===null&&(t=e.alternate.memoizedState),Ys(e,t.next.queue,{},Wt())}function Jr(){return Tt(ii)}function od(){return st().memoizedState}function fd(){return st().memoizedState}function Ng(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Wt();e=kn(a);var n=Tn(t,e,a);n!==null&&($t(n,t,a),Hs(n,t,a)),t={cache:wr()},e.payload=t;return}t=t.return}}function Sg(e,t,a){var n=Wt();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},rc(e)?hd(t,a):(a=hr(e,t,a,n),a!==null&&($t(a,e,n),md(a,t,n)))}function dd(e,t,a){var n=Wt();Ys(e,t,a,n)}function Ys(e,t,a,n){var s={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(rc(e))hd(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var d=t.lastRenderedState,g=r(d,a);if(s.hasEagerState=!0,s.eagerState=g,Zt(g,d))return Gi(e,t,s,0),Ke===null&&$i(),!1}catch{}if(a=hr(e,t,s,n),a!==null)return $t(a,e,n),md(a,t,n),!0}return!1}function Ir(e,t,a,n){if(n={lane:2,revertLane:_u(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},rc(e)){if(t)throw Error(u(479))}else t=hr(e,a,n,2),t!==null&&$t(t,e,2)}function rc(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function hd(e,t){Xl=tc=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function md(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Nl(e,a)}}var Xs={readContext:Tt,use:lc,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};Xs.useEffectEvent=tt;var pd={readContext:Tt,use:lc,useCallback:function(e,t){return Mt().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Wf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ic(4194308,4,ad.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ic(4194308,4,e,t)},useInsertionEffect:function(e,t){ic(4,2,e,t)},useMemo:function(e,t){var a=Mt();t=t===void 0?null:t;var n=e();if(ul){Xt(!0);try{e()}finally{Xt(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Mt();if(a!==void 0){var s=a(t);if(ul){Xt(!0);try{a(t)}finally{Xt(!1)}}}else s=t;return n.memoizedState=n.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},n.queue=e,e=e.dispatch=Sg.bind(null,xe,e),[n.memoizedState,e]},useRef:function(e){var t=Mt();return e={current:e},t.memoizedState=e},useState:function(e){e=Yr(e);var t=e.queue,a=dd.bind(null,xe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Zr,useDeferredValue:function(e,t){var a=Mt();return Vr(a,e,t)},useTransition:function(){var e=Yr(!1);return e=cd.bind(null,xe,e.queue,!0,!1),Mt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=xe,s=Mt();if(Ae){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),Ke===null)throw Error(u(349));(ke&127)!==0||Uf(n,t,a)}s.memoizedState=a;var r={value:a,getSnapshot:t};return s.queue=r,Wf(Hf.bind(null,n,r,e),[e]),n.flags|=2048,Zl(9,{destroy:void 0},Lf.bind(null,n,r,a,t),null),a},useId:function(){var e=Mt(),t=Ke.identifierPrefix;if(Ae){var a=Ma,n=Da;a=(n&~(1<<32-Ct(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ac++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=gg++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Jr,useFormState:Vf,useActionState:Vf,useOptimistic:function(e){var t=Mt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Ir.bind(null,xe,!0,a),a.dispatch=t,[e,t]},useMemoCache:qr,useCacheRefresh:function(){return Mt().memoizedState=Ng.bind(null,xe)},useEffectEvent:function(e){var t=Mt(),a={impl:e};return t.memoizedState=a,function(){if((Le&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},Fr={readContext:Tt,use:lc,useCallback:ld,useContext:Tt,useEffect:Qr,useImperativeHandle:nd,useInsertionEffect:ed,useLayoutEffect:td,useMemo:sd,useReducer:sc,useRef:Ff,useState:function(){return sc(Wa)},useDebugValue:Zr,useDeferredValue:function(e,t){var a=st();return id(a,Xe.memoizedState,e,t)},useTransition:function(){var e=sc(Wa)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:Mf,useId:od,useHostTransitionStatus:Jr,useFormState:Kf,useActionState:Kf,useOptimistic:function(e,t){var a=st();return $f(a,Xe,e,t)},useMemoCache:qr,useCacheRefresh:fd};Fr.useEffectEvent=Pf;var gd={readContext:Tt,use:lc,useCallback:ld,useContext:Tt,useEffect:Qr,useImperativeHandle:nd,useInsertionEffect:ed,useLayoutEffect:td,useMemo:sd,useReducer:Gr,useRef:Ff,useState:function(){return Gr(Wa)},useDebugValue:Zr,useDeferredValue:function(e,t){var a=st();return Xe===null?Vr(a,e,t):id(a,Xe.memoizedState,e,t)},useTransition:function(){var e=Gr(Wa)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:Mf,useId:od,useHostTransitionStatus:Jr,useFormState:If,useActionState:If,useOptimistic:function(e,t){var a=st();return Xe!==null?$f(a,Xe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:qr,useCacheRefresh:fd};gd.useEffectEvent=Pf;function Wr(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:E({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Pr={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Wt(),s=kn(n);s.payload=t,a!=null&&(s.callback=a),t=Tn(e,s,n),t!==null&&($t(t,e,n),Hs(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Wt(),s=kn(n);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=Tn(e,s,n),t!==null&&($t(t,e,n),Hs(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Wt(),n=kn(a);n.tag=2,t!=null&&(n.callback=t),t=Tn(e,n,a),t!==null&&($t(t,e,a),Hs(t,e,a))}};function xd(e,t,a,n,s,r,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,r,d):t.prototype&&t.prototype.isPureReactComponent?!Cs(a,n)||!Cs(s,r):!0}function vd(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Pr.enqueueReplaceState(t,t.state,null)}function ol(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=E({},a));for(var s in e)a[s]===void 0&&(a[s]=e[s])}return a}function yd(e){qi(e)}function bd(e){console.error(e)}function jd(e){qi(e)}function uc(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Nd(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function eu(e,t,a){return a=kn(a),a.tag=3,a.payload={element:null},a.callback=function(){uc(e,t)},a}function Sd(e){return e=kn(e),e.tag=3,e}function wd(e,t,a,n){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var r=n.value;e.payload=function(){return s(r)},e.callback=function(){Nd(t,a,n)}}var d=a.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Nd(t,a,n),typeof s!="function"&&(zn===null?zn=new Set([this]):zn.add(this));var g=n.stack;this.componentDidCatch(n.value,{componentStack:g!==null?g:""})})}function wg(e,t,a,n,s){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Hl(t,a,s,!0),a=Kt.current,a!==null){switch(a.tag){case 31:case 13:return ha===null?jc():a.alternate===null&&at===0&&(at=3),a.flags&=-257,a.flags|=65536,a.lanes=s,n===Ii?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),ku(e,n,s)),!1;case 22:return a.flags|=65536,n===Ii?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),ku(e,n,s)),!1}throw Error(u(435,a.tag))}return ku(e,n,s),jc(),!1}if(Ae)return t=Kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,n!==yr&&(e=Error(u(422),{cause:n}),Os(ua(e,a)))):(n!==yr&&(t=Error(u(423),{cause:n}),Os(ua(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,n=ua(n,a),s=eu(e.stateNode,n,s),Cr(e,s),at!==4&&(at=2)),!1;var r=Error(u(520),{cause:n});if(r=ua(r,a),Ws===null?Ws=[r]:Ws.push(r),at!==4&&(at=2),t===null)return!0;n=ua(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=s&-s,a.lanes|=e,e=eu(a.stateNode,n,e),Cr(a,e),!1;case 1:if(t=a.type,r=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(zn===null||!zn.has(r))))return a.flags|=65536,s&=-s,a.lanes|=s,s=Sd(s),wd(s,e,a,n),Cr(a,s),!1}a=a.return}while(a!==null);return!1}var tu=Error(u(461)),ft=!1;function Et(e,t,a,n){t.child=e===null?_f(t,null,a,n):rl(t,e.child,a,n)}function kd(e,t,a,n,s){a=a.render;var r=t.ref;if("ref"in n){var d={};for(var g in n)g!=="ref"&&(d[g]=n[g])}else d=n;return ll(t),n=Ur(e,t,a,d,r,s),g=Lr(),e!==null&&!ft?(Hr(e,t,s),Pa(e,t,s)):(Ae&&g&&xr(t),t.flags|=1,Et(e,t,n,s),t.child)}function Td(e,t,a,n,s){if(e===null){var r=a.type;return typeof r=="function"&&!mr(r)&&r.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=r,Ed(e,t,r,n,s)):(e=Xi(a.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!uu(e,s)){var d=r.memoizedProps;if(a=a.compare,a=a!==null?a:Cs,a(d,n)&&e.ref===t.ref)return Pa(e,t,s)}return t.flags|=1,e=Va(r,n),e.ref=t.ref,e.return=t,t.child=e}function Ed(e,t,a,n,s){if(e!==null){var r=e.memoizedProps;if(Cs(r,n)&&e.ref===t.ref)if(ft=!1,t.pendingProps=n=r,uu(e,s))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,Pa(e,t,s)}return au(e,t,a,n,s)}function _d(e,t,a,n){var s=n.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|a:a,e!==null){for(n=t.child=e.child,s=0;n!==null;)s=s|n.lanes|n.childLanes,n=n.sibling;n=s&~r}else n=0,t.child=null;return Ad(e,t,r,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ki(t,r!==null?r.cachePool:null),r!==null?Rf(t,r):zr(),zf(t);else return n=t.lanes=536870912,Ad(e,t,r!==null?r.baseLanes|a:a,a,n)}else r!==null?(Ki(t,r.cachePool),Rf(t,r),_n(),t.memoizedState=null):(e!==null&&Ki(t,null),zr(),_n());return Et(e,t,s,a),t.child}function Qs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ad(e,t,a,n,s){var r=Tr();return r=r===null?null:{parent:ut._currentValue,pool:r},t.memoizedState={baseLanes:a,cachePool:r},e!==null&&Ki(t,null),zr(),zf(t),e!==null&&Hl(e,t,n,!0),t.childLanes=s,null}function oc(e,t){return t=dc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Cd(e,t,a){return rl(t,e.child,null,a),e=oc(t,t.pendingProps),e.flags|=2,Jt(t),t.memoizedState=null,e}function kg(e,t,a){var n=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ae){if(n.mode==="hidden")return e=oc(t,n),t.lanes=536870912,Qs(null,e);if(Dr(t),(e=Ie)?(e=Gh(e,da),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bn!==null?{id:Da,overflow:Ma}:null,retryLane:536870912,hydrationErrors:null},a=hf(e),a.return=t,t.child=a,kt=t,Ie=null)):e=null,e===null)throw Nn(t);return t.lanes=536870912,null}return oc(t,n)}var r=e.memoizedState;if(r!==null){var d=r.dehydrated;if(Dr(t),s)if(t.flags&256)t.flags&=-257,t=Cd(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(ft||Hl(e,t,a,!1),s=(a&e.childLanes)!==0,ft||s){if(n=Ke,n!==null&&(d=Sl(n,a),d!==0&&d!==r.retryLane))throw r.retryLane=d,el(e,d),$t(n,e,d),tu;jc(),t=Cd(e,t,a)}else e=r.treeContext,Ie=ma(d.nextSibling),kt=t,Ae=!0,jn=null,da=!1,e!==null&&gf(t,e),t=oc(t,n),t.flags|=4096;return t}return e=Va(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function au(e,t,a,n,s){return ll(t),a=Ur(e,t,a,n,void 0,s),n=Lr(),e!==null&&!ft?(Hr(e,t,s),Pa(e,t,s)):(Ae&&n&&xr(t),t.flags|=1,Et(e,t,a,s),t.child)}function Rd(e,t,a,n,s,r){return ll(t),t.updateQueue=null,a=Df(t,n,a,s),Of(e),n=Lr(),e!==null&&!ft?(Hr(e,t,r),Pa(e,t,r)):(Ae&&n&&xr(t),t.flags|=1,Et(e,t,a,r),t.child)}function zd(e,t,a,n,s){if(ll(t),t.stateNode===null){var r=Dl,d=a.contextType;typeof d=="object"&&d!==null&&(r=Tt(d)),r=new a(n,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Pr,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=n,r.state=t.memoizedState,r.refs={},_r(t),d=a.contextType,r.context=typeof d=="object"&&d!==null?Tt(d):Dl,r.state=t.memoizedState,d=a.getDerivedStateFromProps,typeof d=="function"&&(Wr(t,a,d,n),r.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(d=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),d!==r.state&&Pr.enqueueReplaceState(r,r.state,null),qs(t,n,r,s),Bs(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){r=t.stateNode;var g=t.memoizedProps,b=ol(a,g);r.props=b;var z=r.context,L=a.contextType;d=Dl,typeof L=="object"&&L!==null&&(d=Tt(L));var Y=a.getDerivedStateFromProps;L=typeof Y=="function"||typeof r.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,L||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(g||z!==d)&&vd(t,r,n,d),wn=!1;var O=t.memoizedState;r.state=O,qs(t,n,r,s),Bs(),z=t.memoizedState,g||O!==z||wn?(typeof Y=="function"&&(Wr(t,a,Y,n),z=t.memoizedState),(b=wn||xd(t,a,b,n,O,z,d))?(L||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=z),r.props=n,r.state=z,r.context=d,n=b):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{r=t.stateNode,Ar(e,t),d=t.memoizedProps,L=ol(a,d),r.props=L,Y=t.pendingProps,O=r.context,z=a.contextType,b=Dl,typeof z=="object"&&z!==null&&(b=Tt(z)),g=a.getDerivedStateFromProps,(z=typeof g=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(d!==Y||O!==b)&&vd(t,r,n,b),wn=!1,O=t.memoizedState,r.state=O,qs(t,n,r,s),Bs();var D=t.memoizedState;d!==Y||O!==D||wn||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof g=="function"&&(Wr(t,a,g,n),D=t.memoizedState),(L=wn||xd(t,a,L,n,O,D,b)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(z||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(n,D,b),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(n,D,b)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=D),r.props=n,r.state=D,r.context=b,n=L):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),n=!1)}return r=n,fc(e,t),n=(t.flags&128)!==0,r||n?(r=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&n?(t.child=rl(t,e.child,null,s),t.child=rl(t,null,a,s)):Et(e,t,a,s),t.memoizedState=r.state,e=t.child):e=Pa(e,t,s),e}function Od(e,t,a,n){return al(),t.flags|=256,Et(e,t,a,n),t.child}var nu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lu(e){return{baseLanes:e,cachePool:Nf()}}function su(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ft),e}function Dd(e,t,a){var n=t.pendingProps,s=!1,r=(t.flags&128)!==0,d;if((d=r)||(d=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),d&&(s=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ae){if(s?En(t):_n(),(e=Ie)?(e=Gh(e,da),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bn!==null?{id:Da,overflow:Ma}:null,retryLane:536870912,hydrationErrors:null},a=hf(e),a.return=t,t.child=a,kt=t,Ie=null)):e=null,e===null)throw Nn(t);return $u(e)?t.lanes=32:t.lanes=536870912,null}var g=n.children;return n=n.fallback,s?(_n(),s=t.mode,g=dc({mode:"hidden",children:g},s),n=tl(n,s,a,null),g.return=t,n.return=t,g.sibling=n,t.child=g,n=t.child,n.memoizedState=lu(a),n.childLanes=su(e,d,a),t.memoizedState=nu,Qs(null,n)):(En(t),iu(t,g))}var b=e.memoizedState;if(b!==null&&(g=b.dehydrated,g!==null)){if(r)t.flags&256?(En(t),t.flags&=-257,t=cu(e,t,a)):t.memoizedState!==null?(_n(),t.child=e.child,t.flags|=128,t=null):(_n(),g=n.fallback,s=t.mode,n=dc({mode:"visible",children:n.children},s),g=tl(g,s,a,null),g.flags|=2,n.return=t,g.return=t,n.sibling=g,t.child=n,rl(t,e.child,null,a),n=t.child,n.memoizedState=lu(a),n.childLanes=su(e,d,a),t.memoizedState=nu,t=Qs(null,n));else if(En(t),$u(g)){if(d=g.nextSibling&&g.nextSibling.dataset,d)var z=d.dgst;d=z,n=Error(u(419)),n.stack="",n.digest=d,Os({value:n,source:null,stack:null}),t=cu(e,t,a)}else if(ft||Hl(e,t,a,!1),d=(a&e.childLanes)!==0,ft||d){if(d=Ke,d!==null&&(n=Sl(d,a),n!==0&&n!==b.retryLane))throw b.retryLane=n,el(e,n),$t(d,e,n),tu;qu(g)||jc(),t=cu(e,t,a)}else qu(g)?(t.flags|=192,t.child=e.child,t=null):(e=b.treeContext,Ie=ma(g.nextSibling),kt=t,Ae=!0,jn=null,da=!1,e!==null&&gf(t,e),t=iu(t,n.children),t.flags|=4096);return t}return s?(_n(),g=n.fallback,s=t.mode,b=e.child,z=b.sibling,n=Va(b,{mode:"hidden",children:n.children}),n.subtreeFlags=b.subtreeFlags&65011712,z!==null?g=Va(z,g):(g=tl(g,s,a,null),g.flags|=2),g.return=t,n.return=t,n.sibling=g,t.child=n,Qs(null,n),n=t.child,g=e.child.memoizedState,g===null?g=lu(a):(s=g.cachePool,s!==null?(b=ut._currentValue,s=s.parent!==b?{parent:b,pool:b}:s):s=Nf(),g={baseLanes:g.baseLanes|a,cachePool:s}),n.memoizedState=g,n.childLanes=su(e,d,a),t.memoizedState=nu,Qs(e.child,n)):(En(t),a=e.child,e=a.sibling,a=Va(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=a,t.memoizedState=null,a)}function iu(e,t){return t=dc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function dc(e,t){return e=Vt(22,e,null,t),e.lanes=0,e}function cu(e,t,a){return rl(t,e.child,null,a),e=iu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Md(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Nr(e.return,t,a)}function ru(e,t,a,n,s,r){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:s,treeForkCount:r}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=n,d.tail=a,d.tailMode=s,d.treeForkCount=r)}function Ud(e,t,a){var n=t.pendingProps,s=n.revealOrder,r=n.tail;n=n.children;var d=lt.current,g=(d&2)!==0;if(g?(d=d&1|2,t.flags|=128):d&=1,te(lt,d),Et(e,t,n,a),n=Ae?zs:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Md(e,a,t);else if(e.tag===19)Md(e,a,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(a=t.child,s=null;a!==null;)e=a.alternate,e!==null&&ec(e)===null&&(s=a),a=a.sibling;a=s,a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),ru(t,!1,s,a,r,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ec(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}ru(t,!0,a,null,r,n);break;case"together":ru(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Pa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Rn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Hl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,a=Va(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Va(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function uu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Zi(e)))}function Tg(e,t,a){switch(t.tag){case 3:mt(t,t.stateNode.containerInfo),Sn(t,ut,e.memoizedState.cache),al();break;case 27:case 5:Re(t);break;case 4:mt(t,t.stateNode.containerInfo);break;case 10:Sn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Dr(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(En(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Dd(e,t,a):(En(t),e=Pa(e,t,a),e!==null?e.sibling:null);En(t);break;case 19:var s=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Hl(e,t,a,!1),n=(a&t.childLanes)!==0),s){if(n)return Ud(e,t,a);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),te(lt,lt.current),n)break;return null;case 22:return t.lanes=0,_d(e,t,a,t.pendingProps);case 24:Sn(t,ut,e.memoizedState.cache)}return Pa(e,t,a)}function Ld(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!uu(e,a)&&(t.flags&128)===0)return ft=!1,Tg(e,t,a);ft=(e.flags&131072)!==0}else ft=!1,Ae&&(t.flags&1048576)!==0&&pf(t,zs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=il(t.elementType),t.type=e,typeof e=="function")mr(e)?(n=ol(e,n),t.tag=1,t=zd(null,t,e,n,a)):(t.tag=0,t=au(null,t,e,n,a));else{if(e!=null){var s=e.$$typeof;if(s===Z){t.tag=11,t=kd(null,t,e,n,a);break e}else if(s===H){t.tag=14,t=Td(null,t,e,n,a);break e}}throw t=Je(e)||e,Error(u(306,t,""))}}return t;case 0:return au(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,s=ol(n,t.pendingProps),zd(e,t,n,s,a);case 3:e:{if(mt(t,t.stateNode.containerInfo),e===null)throw Error(u(387));n=t.pendingProps;var r=t.memoizedState;s=r.element,Ar(e,t),qs(t,n,null,a);var d=t.memoizedState;if(n=d.cache,Sn(t,ut,n),n!==r.cache&&Sr(t,[ut],a,!0),Bs(),n=d.element,r.isDehydrated)if(r={element:n,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Od(e,t,n,a);break e}else if(n!==s){s=ua(Error(u(424)),t),Os(s),t=Od(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ie=ma(e.firstChild),kt=t,Ae=!0,jn=null,da=!0,a=_f(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(al(),n===s){t=Pa(e,t,a);break e}Et(e,t,n,a)}t=t.child}return t;case 26:return fc(e,t),e===null?(a=Kh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ae||(a=t.type,e=t.pendingProps,n=_c(pe.current).createElement(a),n[pt]=t,n[it]=e,_t(n,a,e),ct(n),t.stateNode=n):t.memoizedState=Kh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Re(t),e===null&&Ae&&(n=t.stateNode=Qh(t.type,t.pendingProps,pe.current),kt=t,da=!0,s=Ie,Un(t.type)?(Gu=s,Ie=ma(n.firstChild)):Ie=s),Et(e,t,t.pendingProps.children,a),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ae&&((s=n=Ie)&&(n=ax(n,t.type,t.pendingProps,da),n!==null?(t.stateNode=n,kt=t,Ie=ma(n.firstChild),da=!1,s=!0):s=!1),s||Nn(t)),Re(t),s=t.type,r=t.pendingProps,d=e!==null?e.memoizedProps:null,n=r.children,Lu(s,r)?n=null:d!==null&&Lu(s,d)&&(t.flags|=32),t.memoizedState!==null&&(s=Ur(e,t,xg,null,null,a),ii._currentValue=s),fc(e,t),Et(e,t,n,a),t.child;case 6:return e===null&&Ae&&((e=a=Ie)&&(a=nx(a,t.pendingProps,da),a!==null?(t.stateNode=a,kt=t,Ie=null,e=!0):e=!1),e||Nn(t)),null;case 13:return Dd(e,t,a);case 4:return mt(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=rl(t,null,n,a):Et(e,t,n,a),t.child;case 11:return kd(e,t,t.type,t.pendingProps,a);case 7:return Et(e,t,t.pendingProps,a),t.child;case 8:return Et(e,t,t.pendingProps.children,a),t.child;case 12:return Et(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Sn(t,t.type,n.value),Et(e,t,n.children,a),t.child;case 9:return s=t.type._context,n=t.pendingProps.children,ll(t),s=Tt(s),n=n(s),t.flags|=1,Et(e,t,n,a),t.child;case 14:return Td(e,t,t.type,t.pendingProps,a);case 15:return Ed(e,t,t.type,t.pendingProps,a);case 19:return Ud(e,t,a);case 31:return kg(e,t,a);case 22:return _d(e,t,a,t.pendingProps);case 24:return ll(t),n=Tt(ut),e===null?(s=Tr(),s===null&&(s=Ke,r=wr(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=a),s=r),t.memoizedState={parent:n,cache:s},_r(t),Sn(t,ut,s)):((e.lanes&a)!==0&&(Ar(e,t),qs(t,null,null,a),Bs()),s=e.memoizedState,r=t.memoizedState,s.parent!==n?(s={parent:n,cache:n},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Sn(t,ut,n)):(n=r.cache,Sn(t,ut,n),n!==s.cache&&Sr(t,[ut],a,!0))),Et(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function en(e){e.flags|=4}function ou(e,t,a,n,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(oh())e.flags|=8192;else throw cl=Ii,Er}else e.flags&=-16777217}function Hd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ph(t))if(oh())e.flags|=8192;else throw cl=Ii,Er}function hc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ps():536870912,e.lanes|=t,Il|=t)}function Zs(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var s=e.child;s!==null;)a|=s.lanes|s.childLanes,n|=s.subtreeFlags&65011712,n|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)a|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function Eg(e,t,a){var n=t.pendingProps;switch(vr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Fe(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ia(ut),$(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ll(t)?en(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,br())),Fe(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(en(t),r!==null?(Fe(t),Hd(t,r)):(Fe(t),ou(t,s,null,n,a))):r?r!==e.memoizedState?(en(t),Fe(t),Hd(t,r)):(Fe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&en(t),Fe(t),ou(t,s,e,n,a)),null;case 27:if(Ge(t),a=pe.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&en(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Fe(t),null}e=F.current,Ll(t)?xf(t):(e=Qh(s,n,a),t.stateNode=e,en(t))}return Fe(t),null;case 5:if(Ge(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&en(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Fe(t),null}if(r=F.current,Ll(t))xf(t);else{var d=_c(pe.current);switch(r){case 1:r=d.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=d.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=d.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof n.is=="string"?d.createElement("select",{is:n.is}):d.createElement("select"),n.multiple?r.multiple=!0:n.size&&(r.size=n.size);break;default:r=typeof n.is=="string"?d.createElement(s,{is:n.is}):d.createElement(s)}}r[pt]=t,r[it]=n;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)r.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=r;e:switch(_t(r,s,n),s){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&en(t)}}return Fe(t),ou(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&en(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(u(166));if(e=pe.current,Ll(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,s=kt,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[pt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Dh(e.nodeValue,a)),e||Nn(t,!0)}else e=_c(e).createTextNode(n),e[pt]=t,t.stateNode=e}return Fe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Ll(t),a!==null){if(e===null){if(!n)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[pt]=t}else al(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),e=!1}else a=br(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Jt(t),t):(Jt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Fe(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ll(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(u(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[pt]=t}else al(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),s=!1}else s=br(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Jt(t),t):(Jt(t),null)}return Jt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,s=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(s=n.alternate.memoizedState.cachePool.pool),r=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(r=n.memoizedState.cachePool.pool),r!==s&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),hc(t,t.updateQueue),Fe(t),null);case 4:return $(),e===null&&zu(t.stateNode.containerInfo),Fe(t),null;case 10:return Ia(t.type),Fe(t),null;case 19:if(G(lt),n=t.memoizedState,n===null)return Fe(t),null;if(s=(t.flags&128)!==0,r=n.rendering,r===null)if(s)Zs(n,!1);else{if(at!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=ec(e),r!==null){for(t.flags|=128,Zs(n,!1),e=r.updateQueue,t.updateQueue=e,hc(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)df(a,e),a=a.sibling;return te(lt,lt.current&1|2),Ae&&Ka(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&At()>vc&&(t.flags|=128,s=!0,Zs(n,!1),t.lanes=4194304)}else{if(!s)if(e=ec(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,hc(t,e),Zs(n,!0),n.tail===null&&n.tailMode==="hidden"&&!r.alternate&&!Ae)return Fe(t),null}else 2*At()-n.renderingStartTime>vc&&a!==536870912&&(t.flags|=128,s=!0,Zs(n,!1),t.lanes=4194304);n.isBackwards?(r.sibling=t.child,t.child=r):(e=n.last,e!==null?e.sibling=r:t.child=r,n.last=r)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=At(),e.sibling=null,a=lt.current,te(lt,s?a&1|2:a&1),Ae&&Ka(t,n.treeForkCount),e):(Fe(t),null);case 22:case 23:return Jt(t),Or(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),a=t.updateQueue,a!==null&&hc(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&G(sl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ia(ut),Fe(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function _g(e,t){switch(vr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ia(ut),$(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ge(t),null;case 31:if(t.memoizedState!==null){if(Jt(t),t.alternate===null)throw Error(u(340));al()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));al()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(lt),null;case 4:return $(),null;case 10:return Ia(t.type),null;case 22:case 23:return Jt(t),Or(),e!==null&&G(sl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ia(ut),null;case 25:return null;default:return null}}function Bd(e,t){switch(vr(t),t.tag){case 3:Ia(ut),$();break;case 26:case 27:case 5:Ge(t);break;case 4:$();break;case 31:t.memoizedState!==null&&Jt(t);break;case 13:Jt(t);break;case 19:G(lt);break;case 10:Ia(t.type);break;case 22:case 23:Jt(t),Or(),e!==null&&G(sl);break;case 24:Ia(ut)}}function Vs(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var s=n.next;a=s;do{if((a.tag&e)===e){n=void 0;var r=a.create,d=a.inst;n=r(),d.destroy=n}a=a.next}while(a!==s)}}catch(g){$e(t,t.return,g)}}function An(e,t,a){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&e)===e){var d=n.inst,g=d.destroy;if(g!==void 0){d.destroy=void 0,s=t;var b=a,z=g;try{z()}catch(L){$e(s,b,L)}}}n=n.next}while(n!==r)}}catch(L){$e(t,t.return,L)}}function qd(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Cf(t,a)}catch(n){$e(e,e.return,n)}}}function $d(e,t,a){a.props=ol(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){$e(e,t,n)}}function Ks(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(s){$e(e,t,s)}}function Ua(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(s){$e(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(s){$e(e,t,s)}else a.current=null}function Gd(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(s){$e(e,e.return,s)}}function fu(e,t,a){try{var n=e.stateNode;Ig(n,e.type,a,t),n[it]=t}catch(s){$e(e,e.return,s)}}function Yd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Un(e.type)||e.tag===4}function du(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yd(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&&Un(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 hu(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=_));else if(n!==4&&(n===27&&Un(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(hu(e,t,a),e=e.sibling;e!==null;)hu(e,t,a),e=e.sibling}function mc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Un(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(mc(e,t,a),e=e.sibling;e!==null;)mc(e,t,a),e=e.sibling}function Xd(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);_t(t,n,a),t[pt]=e,t[it]=a}catch(r){$e(e,e.return,r)}}var tn=!1,dt=!1,mu=!1,Qd=typeof WeakSet=="function"?WeakSet:Set,bt=null;function Ag(e,t){if(e=e.containerInfo,Mu=Mc,e=af(e),cr(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var s=n.anchorOffset,r=n.focusNode;n=n.focusOffset;try{a.nodeType,r.nodeType}catch{a=null;break e}var d=0,g=-1,b=-1,z=0,L=0,Y=e,O=null;t:for(;;){for(var D;Y!==a||s!==0&&Y.nodeType!==3||(g=d+s),Y!==r||n!==0&&Y.nodeType!==3||(b=d+n),Y.nodeType===3&&(d+=Y.nodeValue.length),(D=Y.firstChild)!==null;)O=Y,Y=D;for(;;){if(Y===e)break t;if(O===a&&++z===s&&(g=d),O===r&&++L===n&&(b=d),(D=Y.nextSibling)!==null)break;Y=O,O=Y.parentNode}Y=D}a=g===-1||b===-1?null:{start:g,end:b}}else a=null}a=a||{start:0,end:0}}else a=null;for(Uu={focusedElem:e,selectionRange:a},Mc=!1,bt=t;bt!==null;)if(t=bt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,bt=e;else for(;bt!==null;){switch(t=bt,r=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(a=0;a<e.length;a++)s=e[a],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,a=t,s=r.memoizedProps,r=r.memoizedState,n=a.stateNode;try{var ie=ol(a.type,s);e=n.getSnapshotBeforeUpdate(ie,r),n.__reactInternalSnapshotBeforeUpdate=e}catch(de){$e(a,a.return,de)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Bu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Bu(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(u(163))}if(e=t.sibling,e!==null){e.return=t.return,bt=e;break}bt=t.return}}function Zd(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:nn(e,a),n&4&&Vs(5,a);break;case 1:if(nn(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(d){$e(a,a.return,d)}else{var s=ol(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){$e(a,a.return,d)}}n&64&&qd(a),n&512&&Ks(a,a.return);break;case 3:if(nn(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Cf(e,t)}catch(d){$e(a,a.return,d)}}break;case 27:t===null&&n&4&&Xd(a);case 26:case 5:nn(e,a),t===null&&n&4&&Gd(a),n&512&&Ks(a,a.return);break;case 12:nn(e,a);break;case 31:nn(e,a),n&4&&Jd(e,a);break;case 13:nn(e,a),n&4&&Id(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Hg.bind(null,a),lx(e,a))));break;case 22:if(n=a.memoizedState!==null||tn,!n){t=t!==null&&t.memoizedState!==null||dt,s=tn;var r=dt;tn=n,(dt=t)&&!r?ln(e,a,(a.subtreeFlags&8772)!==0):nn(e,a),tn=s,dt=r}break;case 30:break;default:nn(e,a)}}function Vd(e){var t=e.alternate;t!==null&&(e.alternate=null,Vd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Vn(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 Pe=null,Lt=!1;function an(e,t,a){for(a=a.child;a!==null;)Kd(e,t,a),a=a.sibling}function Kd(e,t,a){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(la,a)}catch{}switch(a.tag){case 26:dt||Ua(a,t),an(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:dt||Ua(a,t);var n=Pe,s=Lt;Un(a.type)&&(Pe=a.stateNode,Lt=!1),an(e,t,a),ni(a.stateNode),Pe=n,Lt=s;break;case 5:dt||Ua(a,t);case 6:if(n=Pe,s=Lt,Pe=null,an(e,t,a),Pe=n,Lt=s,Pe!==null)if(Lt)try{(Pe.nodeType===9?Pe.body:Pe.nodeName==="HTML"?Pe.ownerDocument.body:Pe).removeChild(a.stateNode)}catch(r){$e(a,t,r)}else try{Pe.removeChild(a.stateNode)}catch(r){$e(a,t,r)}break;case 18:Pe!==null&&(Lt?(e=Pe,qh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),ls(e)):qh(Pe,a.stateNode));break;case 4:n=Pe,s=Lt,Pe=a.stateNode.containerInfo,Lt=!0,an(e,t,a),Pe=n,Lt=s;break;case 0:case 11:case 14:case 15:An(2,a,t),dt||An(4,a,t),an(e,t,a);break;case 1:dt||(Ua(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&$d(a,t,n)),an(e,t,a);break;case 21:an(e,t,a);break;case 22:dt=(n=dt)||a.memoizedState!==null,an(e,t,a),dt=n;break;default:an(e,t,a)}}function Jd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ls(e)}catch(a){$e(t,t.return,a)}}}function Id(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ls(e)}catch(a){$e(t,t.return,a)}}function Cg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qd),t;default:throw Error(u(435,e.tag))}}function pc(e,t){var a=Cg(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var s=Bg.bind(null,e,n);n.then(s,s)}})}function Ht(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var s=a[n],r=e,d=t,g=d;e:for(;g!==null;){switch(g.tag){case 27:if(Un(g.type)){Pe=g.stateNode,Lt=!1;break e}break;case 5:Pe=g.stateNode,Lt=!1;break e;case 3:case 4:Pe=g.stateNode.containerInfo,Lt=!0;break e}g=g.return}if(Pe===null)throw Error(u(160));Kd(r,d,s),Pe=null,Lt=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Fd(t,e),t=t.sibling}var Sa=null;function Fd(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ht(t,e),Bt(e),n&4&&(An(3,e,e.return),Vs(3,e),An(5,e,e.return));break;case 1:Ht(t,e),Bt(e),n&512&&(dt||a===null||Ua(a,a.return)),n&64&&tn&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var s=Sa;if(Ht(t,e),Bt(e),n&512&&(dt||a===null||Ua(a,a.return)),n&4){var r=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,s=s.ownerDocument||s;t:switch(n){case"title":r=s.getElementsByTagName("title")[0],(!r||r[pn]||r[pt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(n),s.head.insertBefore(r,s.querySelector("head > title"))),_t(r,n,a),r[pt]=e,ct(r),n=r;break e;case"link":var d=Fh("link","href",s).get(n+(a.href||""));if(d){for(var g=0;g<d.length;g++)if(r=d[g],r.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&r.getAttribute("rel")===(a.rel==null?null:a.rel)&&r.getAttribute("title")===(a.title==null?null:a.title)&&r.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){d.splice(g,1);break t}}r=s.createElement(n),_t(r,n,a),s.head.appendChild(r);break;case"meta":if(d=Fh("meta","content",s).get(n+(a.content||""))){for(g=0;g<d.length;g++)if(r=d[g],r.getAttribute("content")===(a.content==null?null:""+a.content)&&r.getAttribute("name")===(a.name==null?null:a.name)&&r.getAttribute("property")===(a.property==null?null:a.property)&&r.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&r.getAttribute("charset")===(a.charSet==null?null:a.charSet)){d.splice(g,1);break t}}r=s.createElement(n),_t(r,n,a),s.head.appendChild(r);break;default:throw Error(u(468,n))}r[pt]=e,ct(r),n=r}e.stateNode=n}else Wh(s,e.type,e.stateNode);else e.stateNode=Ih(s,n,e.memoizedProps);else r!==n?(r===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):r.count--,n===null?Wh(s,e.type,e.stateNode):Ih(s,n,e.memoizedProps)):n===null&&e.stateNode!==null&&fu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ht(t,e),Bt(e),n&512&&(dt||a===null||Ua(a,a.return)),a!==null&&n&4&&fu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ht(t,e),Bt(e),n&512&&(dt||a===null||Ua(a,a.return)),e.flags&32){s=e.stateNode;try{Za(s,"")}catch(ie){$e(e,e.return,ie)}}n&4&&e.stateNode!=null&&(s=e.memoizedProps,fu(e,s,a!==null?a.memoizedProps:s)),n&1024&&(mu=!0);break;case 6:if(Ht(t,e),Bt(e),n&4){if(e.stateNode===null)throw Error(u(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(ie){$e(e,e.return,ie)}}break;case 3:if(Rc=null,s=Sa,Sa=Ac(t.containerInfo),Ht(t,e),Sa=s,Bt(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{ls(t.containerInfo)}catch(ie){$e(e,e.return,ie)}mu&&(mu=!1,Wd(e));break;case 4:n=Sa,Sa=Ac(e.stateNode.containerInfo),Ht(t,e),Bt(e),Sa=n;break;case 12:Ht(t,e),Bt(e);break;case 31:Ht(t,e),Bt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,pc(e,n)));break;case 13:Ht(t,e),Bt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(xc=At()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,pc(e,n)));break;case 22:s=e.memoizedState!==null;var b=a!==null&&a.memoizedState!==null,z=tn,L=dt;if(tn=z||s,dt=L||b,Ht(t,e),dt=L,tn=z,Bt(e),n&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(a===null||b||tn||dt||fl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){b=a=t;try{if(r=b.stateNode,s)d=r.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{g=b.stateNode;var Y=b.memoizedProps.style,O=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;g.style.display=O==null||typeof O=="boolean"?"":(""+O).trim()}}catch(ie){$e(b,b.return,ie)}}}else if(t.tag===6){if(a===null){b=t;try{b.stateNode.nodeValue=s?"":b.memoizedProps}catch(ie){$e(b,b.return,ie)}}}else if(t.tag===18){if(a===null){b=t;try{var D=b.stateNode;s?$h(D,!0):$h(b.stateNode,!1)}catch(ie){$e(b,b.return,ie)}}}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;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,pc(e,a))));break;case 19:Ht(t,e),Bt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,pc(e,n)));break;case 30:break;case 21:break;default:Ht(t,e),Bt(e)}}function Bt(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(Yd(n)){a=n;break}n=n.return}if(a==null)throw Error(u(160));switch(a.tag){case 27:var s=a.stateNode,r=du(e);mc(e,r,s);break;case 5:var d=a.stateNode;a.flags&32&&(Za(d,""),a.flags&=-33);var g=du(e);mc(e,g,d);break;case 3:case 4:var b=a.stateNode.containerInfo,z=du(e);hu(e,z,b);break;default:throw Error(u(161))}}catch(L){$e(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function nn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zd(e,t.alternate,t),t=t.sibling}function fl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:An(4,t,t.return),fl(t);break;case 1:Ua(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&$d(t,t.return,a),fl(t);break;case 27:ni(t.stateNode);case 26:case 5:Ua(t,t.return),fl(t);break;case 22:t.memoizedState===null&&fl(t);break;case 30:fl(t);break;default:fl(t)}e=e.sibling}}function ln(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,s=e,r=t,d=r.flags;switch(r.tag){case 0:case 11:case 15:ln(s,r,a),Vs(4,r);break;case 1:if(ln(s,r,a),n=r,s=n.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(z){$e(n,n.return,z)}if(n=r,s=n.updateQueue,s!==null){var g=n.stateNode;try{var b=s.shared.hiddenCallbacks;if(b!==null)for(s.shared.hiddenCallbacks=null,s=0;s<b.length;s++)Af(b[s],g)}catch(z){$e(n,n.return,z)}}a&&d&64&&qd(r),Ks(r,r.return);break;case 27:Xd(r);case 26:case 5:ln(s,r,a),a&&n===null&&d&4&&Gd(r),Ks(r,r.return);break;case 12:ln(s,r,a);break;case 31:ln(s,r,a),a&&d&4&&Jd(s,r);break;case 13:ln(s,r,a),a&&d&4&&Id(s,r);break;case 22:r.memoizedState===null&&ln(s,r,a),Ks(r,r.return);break;case 30:break;default:ln(s,r,a)}t=t.sibling}}function pu(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Ds(a))}function gu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ds(e))}function wa(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Pd(e,t,a,n),t=t.sibling}function Pd(e,t,a,n){var s=t.flags;switch(t.tag){case 0:case 11:case 15:wa(e,t,a,n),s&2048&&Vs(9,t);break;case 1:wa(e,t,a,n);break;case 3:wa(e,t,a,n),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ds(e)));break;case 12:if(s&2048){wa(e,t,a,n),e=t.stateNode;try{var r=t.memoizedProps,d=r.id,g=r.onPostCommit;typeof g=="function"&&g(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(b){$e(t,t.return,b)}}else wa(e,t,a,n);break;case 31:wa(e,t,a,n);break;case 13:wa(e,t,a,n);break;case 23:break;case 22:r=t.stateNode,d=t.alternate,t.memoizedState!==null?r._visibility&2?wa(e,t,a,n):Js(e,t):r._visibility&2?wa(e,t,a,n):(r._visibility|=2,Vl(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),s&2048&&pu(d,t);break;case 24:wa(e,t,a,n),s&2048&&gu(t.alternate,t);break;default:wa(e,t,a,n)}}function Vl(e,t,a,n,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,d=t,g=a,b=n,z=d.flags;switch(d.tag){case 0:case 11:case 15:Vl(r,d,g,b,s),Vs(8,d);break;case 23:break;case 22:var L=d.stateNode;d.memoizedState!==null?L._visibility&2?Vl(r,d,g,b,s):Js(r,d):(L._visibility|=2,Vl(r,d,g,b,s)),s&&z&2048&&pu(d.alternate,d);break;case 24:Vl(r,d,g,b,s),s&&z&2048&&gu(d.alternate,d);break;default:Vl(r,d,g,b,s)}t=t.sibling}}function Js(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,s=n.flags;switch(n.tag){case 22:Js(a,n),s&2048&&pu(n.alternate,n);break;case 24:Js(a,n),s&2048&&gu(n.alternate,n);break;default:Js(a,n)}t=t.sibling}}var Is=8192;function Kl(e,t,a){if(e.subtreeFlags&Is)for(e=e.child;e!==null;)eh(e,t,a),e=e.sibling}function eh(e,t,a){switch(e.tag){case 26:Kl(e,t,a),e.flags&Is&&e.memoizedState!==null&&gx(a,Sa,e.memoizedState,e.memoizedProps);break;case 5:Kl(e,t,a);break;case 3:case 4:var n=Sa;Sa=Ac(e.stateNode.containerInfo),Kl(e,t,a),Sa=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Is,Is=16777216,Kl(e,t,a),Is=n):Kl(e,t,a));break;default:Kl(e,t,a)}}function th(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 Fs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];bt=n,nh(n,e)}th(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ah(e),e=e.sibling}function ah(e){switch(e.tag){case 0:case 11:case 15:Fs(e),e.flags&2048&&An(9,e,e.return);break;case 3:Fs(e);break;case 12:Fs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,gc(e)):Fs(e);break;default:Fs(e)}}function gc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];bt=n,nh(n,e)}th(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:An(8,t,t.return),gc(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,gc(t));break;default:gc(t)}e=e.sibling}}function nh(e,t){for(;bt!==null;){var a=bt;switch(a.tag){case 0:case 11:case 15:An(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Ds(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,bt=n;else e:for(a=e;bt!==null;){n=bt;var s=n.sibling,r=n.return;if(Vd(n),n===a){bt=null;break e}if(s!==null){s.return=r,bt=s;break e}bt=r}}}var Rg={getCacheForType:function(e){var t=Tt(ut),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Tt(ut).controller.signal}},zg=typeof WeakMap=="function"?WeakMap:Map,Le=0,Ke=null,Ne=null,ke=0,qe=0,It=null,Cn=!1,Jl=!1,xu=!1,sn=0,at=0,Rn=0,dl=0,vu=0,Ft=0,Il=0,Ws=null,qt=null,yu=!1,xc=0,lh=0,vc=1/0,yc=null,zn=null,xt=0,On=null,Fl=null,cn=0,bu=0,ju=null,sh=null,Ps=0,Nu=null;function Wt(){return(Le&2)!==0&&ke!==0?ke&-ke:U.T!==null?_u():kl()}function ih(){if(Ft===0)if((ke&536870912)===0||Ae){var e=va;va<<=1,(va&3932160)===0&&(va=262144),Ft=e}else Ft=536870912;return e=Kt.current,e!==null&&(e.flags|=32),Ft}function $t(e,t,a){(e===Ke&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(Wl(e,0),Dn(e,ke,Ft,!1)),Ra(e,a),((Le&2)===0||e!==Ke)&&(e===Ke&&((Le&2)===0&&(dl|=a),at===4&&Dn(e,ke,Ft,!1)),La(e))}function ch(e,t,a){if((Le&6)!==0)throw Error(u(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||fn(e,t),s=n?Mg(e,t):wu(e,t,!0),r=n;do{if(s===0){Jl&&!n&&Dn(e,t,0,!1);break}else{if(a=e.current.alternate,r&&!Og(a)){s=wu(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var g=e;s=Ws;var b=g.current.memoizedState.isDehydrated;if(b&&(Wl(g,d).flags|=256),d=wu(g,d,!1),d!==2){if(xu&&!b){g.errorRecoveryDisabledLanes|=r,dl|=r,s=4;break e}r=qt,qt=s,r!==null&&(qt===null?qt=r:qt.push.apply(qt,r))}s=d}if(r=!1,s!==2)continue}}if(s===1){Wl(e,0),Dn(e,t,0,!0);break}e:{switch(n=e,r=s,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Dn(n,t,Ft,!Cn);break e;case 2:qt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=xc+300-At(),10<s)){if(Dn(n,t,Ft,!Cn),Zn(n,0,!0)!==0)break e;cn=t,n.timeoutHandle=Hh(rh.bind(null,n,a,qt,yc,yu,t,Ft,dl,Il,Cn,r,"Throttled",-0,0),s);break e}rh(n,a,qt,yc,yu,t,Ft,dl,Il,Cn,r,null,-0,0)}}break}while(!0);La(e)}function rh(e,t,a,n,s,r,d,g,b,z,L,Y,O,D){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_},eh(t,r,Y);var ie=(r&62914560)===r?xc-At():(r&4194048)===r?lh-At():0;if(ie=xx(Y,ie),ie!==null){cn=r,e.cancelPendingCommit=ie(gh.bind(null,e,t,r,a,n,s,d,g,b,L,Y,null,O,D)),Dn(e,r,d,!z);return}}gh(e,t,r,a,n,s,d,g,b)}function Og(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var s=a[n],r=s.getSnapshot;s=s.value;try{if(!Zt(r(),s))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Dn(e,t,a,n){t&=~vu,t&=~dl,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var s=t;0<s;){var r=31-Ct(s),d=1<<r;n[r]=-1,s&=~d}a!==0&&$a(e,a,t)}function bc(){return(Le&6)===0?(ei(0),!1):!0}function Su(){if(Ne!==null){if(qe===0)var e=Ne.return;else e=Ne,Ja=nl=null,Br(e),Gl=null,Us=0,e=Ne;for(;e!==null;)Bd(e.alternate,e),e=e.return;Ne=null}}function Wl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Pg(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),cn=0,Su(),Ke=e,Ne=a=Va(e.current,null),ke=t,qe=0,It=null,Cn=!1,Jl=fn(e,t),xu=!1,Il=Ft=vu=dl=Rn=at=0,qt=Ws=null,yu=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var s=31-Ct(n),r=1<<s;t|=e[s],n&=~r}return sn=t,$i(),a}function uh(e,t){xe=null,U.H=Xs,t===$l||t===Ji?(t=kf(),qe=3):t===Er?(t=kf(),qe=4):qe=t===tu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,It=t,Ne===null&&(at=1,uc(e,ua(t,e.current)))}function oh(){var e=Kt.current;return e===null?!0:(ke&4194048)===ke?ha===null:(ke&62914560)===ke||(ke&536870912)!==0?e===ha:!1}function fh(){var e=U.H;return U.H=Xs,e===null?Xs:e}function dh(){var e=U.A;return U.A=Rg,e}function jc(){at=4,Cn||(ke&4194048)!==ke&&Kt.current!==null||(Jl=!0),(Rn&134217727)===0&&(dl&134217727)===0||Ke===null||Dn(Ke,ke,Ft,!1)}function wu(e,t,a){var n=Le;Le|=2;var s=fh(),r=dh();(Ke!==e||ke!==t)&&(yc=null,Wl(e,t)),t=!1;var d=at;e:do try{if(qe!==0&&Ne!==null){var g=Ne,b=It;switch(qe){case 8:Su(),d=6;break e;case 3:case 2:case 9:case 6:Kt.current===null&&(t=!0);var z=qe;if(qe=0,It=null,Pl(e,g,b,z),a&&Jl){d=0;break e}break;default:z=qe,qe=0,It=null,Pl(e,g,b,z)}}Dg(),d=at;break}catch(L){uh(e,L)}while(!0);return t&&e.shellSuspendCounter++,Ja=nl=null,Le=n,U.H=s,U.A=r,Ne===null&&(Ke=null,ke=0,$i()),d}function Dg(){for(;Ne!==null;)hh(Ne)}function Mg(e,t){var a=Le;Le|=2;var n=fh(),s=dh();Ke!==e||ke!==t?(yc=null,vc=At()+500,Wl(e,t)):Jl=fn(e,t);e:do try{if(qe!==0&&Ne!==null){t=Ne;var r=It;t:switch(qe){case 1:qe=0,It=null,Pl(e,t,r,1);break;case 2:case 9:if(Sf(r)){qe=0,It=null,mh(t);break}t=function(){qe!==2&&qe!==9||Ke!==e||(qe=7),La(e)},r.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:Sf(r)?(qe=0,It=null,mh(t)):(qe=0,It=null,Pl(e,t,r,7));break;case 5:var d=null;switch(Ne.tag){case 26:d=Ne.memoizedState;case 5:case 27:var g=Ne;if(d?Ph(d):g.stateNode.complete){qe=0,It=null;var b=g.sibling;if(b!==null)Ne=b;else{var z=g.return;z!==null?(Ne=z,Nc(z)):Ne=null}break t}}qe=0,It=null,Pl(e,t,r,5);break;case 6:qe=0,It=null,Pl(e,t,r,6);break;case 8:Su(),at=6;break e;default:throw Error(u(462))}}Ug();break}catch(L){uh(e,L)}while(!0);return Ja=nl=null,U.H=n,U.A=s,Le=a,Ne!==null?0:(Ke=null,ke=0,$i(),at)}function Ug(){for(;Ne!==null&&!Si();)hh(Ne)}function hh(e){var t=Ld(e.alternate,e,sn);e.memoizedProps=e.pendingProps,t===null?Nc(e):Ne=t}function mh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Rd(a,t,t.pendingProps,t.type,void 0,ke);break;case 11:t=Rd(a,t,t.pendingProps,t.type.render,t.ref,ke);break;case 5:Br(t);default:Bd(a,t),t=Ne=df(t,sn),t=Ld(a,t,sn)}e.memoizedProps=e.pendingProps,t===null?Nc(e):Ne=t}function Pl(e,t,a,n){Ja=nl=null,Br(t),Gl=null,Us=0;var s=t.return;try{if(wg(e,s,t,a,ke)){at=1,uc(e,ua(a,e.current)),Ne=null;return}}catch(r){if(s!==null)throw Ne=s,r;at=1,uc(e,ua(a,e.current)),Ne=null;return}t.flags&32768?(Ae||n===1?e=!0:Jl||(ke&536870912)!==0?e=!1:(Cn=e=!0,(n===2||n===9||n===3||n===6)&&(n=Kt.current,n!==null&&n.tag===13&&(n.flags|=16384))),ph(t,e)):Nc(t)}function Nc(e){var t=e;do{if((t.flags&32768)!==0){ph(t,Cn);return}e=t.return;var a=Eg(t.alternate,t,sn);if(a!==null){Ne=a;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);at===0&&(at=5)}function ph(e,t){do{var a=_g(e.alternate,e);if(a!==null){a.flags&=32767,Ne=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=a}while(e!==null);at=6,Ne=null}function gh(e,t,a,n,s,r,d,g,b){e.cancelPendingCommit=null;do Sc();while(xt!==0);if((Le&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(r=t.lanes|t.childLanes,r|=dr,sa(e,a,r,d,g,b),e===Ke&&(Ne=Ke=null,ke=0),Fl=t,On=e,cn=a,bu=r,ju=s,sh=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,qg(na,function(){return jh(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=U.T,U.T=null,s=P.p,P.p=2,d=Le,Le|=4;try{Ag(e,t,a)}finally{Le=d,P.p=s,U.T=n}}xt=1,xh(),vh(),yh()}}function xh(){if(xt===1){xt=0;var e=On,t=Fl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null;var n=P.p;P.p=2;var s=Le;Le|=4;try{Fd(t,e);var r=Uu,d=af(e.containerInfo),g=r.focusedElem,b=r.selectionRange;if(d!==g&&g&&g.ownerDocument&&tf(g.ownerDocument.documentElement,g)){if(b!==null&&cr(g)){var z=b.start,L=b.end;if(L===void 0&&(L=z),"selectionStart"in g)g.selectionStart=z,g.selectionEnd=Math.min(L,g.value.length);else{var Y=g.ownerDocument||document,O=Y&&Y.defaultView||window;if(O.getSelection){var D=O.getSelection(),ie=g.textContent.length,de=Math.min(b.start,ie),Ze=b.end===void 0?de:Math.min(b.end,ie);!D.extend&&de>Ze&&(d=Ze,Ze=de,de=d);var A=ef(g,de),S=ef(g,Ze);if(A&&S&&(D.rangeCount!==1||D.anchorNode!==A.node||D.anchorOffset!==A.offset||D.focusNode!==S.node||D.focusOffset!==S.offset)){var R=Y.createRange();R.setStart(A.node,A.offset),D.removeAllRanges(),de>Ze?(D.addRange(R),D.extend(S.node,S.offset)):(R.setEnd(S.node,S.offset),D.addRange(R))}}}}for(Y=[],D=g;D=D.parentNode;)D.nodeType===1&&Y.push({element:D,left:D.scrollLeft,top:D.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<Y.length;g++){var B=Y[g];B.element.scrollLeft=B.left,B.element.scrollTop=B.top}}Mc=!!Mu,Uu=Mu=null}finally{Le=s,P.p=n,U.T=a}}e.current=t,xt=2}}function vh(){if(xt===2){xt=0;var e=On,t=Fl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=U.T,U.T=null;var n=P.p;P.p=2;var s=Le;Le|=4;try{Zd(e,t.alternate,t)}finally{Le=s,P.p=n,U.T=a}}xt=3}}function yh(){if(xt===4||xt===3){xt=0,fs();var e=On,t=Fl,a=cn,n=sh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?xt=5:(xt=0,Fl=On=null,bh(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(zn=null),wl(a),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(la,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=U.T,s=P.p,P.p=2,U.T=null;try{for(var r=e.onRecoverableError,d=0;d<n.length;d++){var g=n[d];r(g.value,{componentStack:g.stack})}}finally{U.T=t,P.p=s}}(cn&3)!==0&&Sc(),La(e),s=e.pendingLanes,(a&261930)!==0&&(s&42)!==0?e===Nu?Ps++:(Ps=0,Nu=e):Ps=0,ei(0)}}function bh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ds(t)))}function Sc(){return xh(),vh(),yh(),jh()}function jh(){if(xt!==5)return!1;var e=On,t=bu;bu=0;var a=wl(cn),n=U.T,s=P.p;try{P.p=32>a?32:a,U.T=null,a=ju,ju=null;var r=On,d=cn;if(xt=0,Fl=On=null,cn=0,(Le&6)!==0)throw Error(u(331));var g=Le;if(Le|=4,ah(r.current),Pd(r,r.current,d,a),Le=g,ei(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(la,r)}catch{}return!0}finally{P.p=s,U.T=n,bh(e,t)}}function Nh(e,t,a){t=ua(a,t),t=eu(e.stateNode,t,2),e=Tn(e,t,2),e!==null&&(Ra(e,2),La(e))}function $e(e,t,a){if(e.tag===3)Nh(e,e,a);else for(;t!==null;){if(t.tag===3){Nh(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(zn===null||!zn.has(n))){e=ua(a,e),a=Sd(2),n=Tn(t,a,2),n!==null&&(wd(a,n,t,e),Ra(n,2),La(n));break}}t=t.return}}function ku(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new zg;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(a)||(xu=!0,s.add(a),e=Lg.bind(null,e,t,a),t.then(e,e))}function Lg(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ke===e&&(ke&a)===a&&(at===4||at===3&&(ke&62914560)===ke&&300>At()-xc?(Le&2)===0&&Wl(e,0):vu|=a,Il===ke&&(Il=0)),La(e)}function Sh(e,t){t===0&&(t=ps()),e=el(e,t),e!==null&&(Ra(e,t),La(e))}function Hg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Sh(e,a)}function Bg(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(a=s.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(u(314))}n!==null&&n.delete(t),Sh(e,a)}function qg(e,t){return bl(e,t)}var wc=null,es=null,Tu=!1,kc=!1,Eu=!1,Mn=0;function La(e){e!==es&&e.next===null&&(es===null?wc=es=e:es=es.next=e),kc=!0,Tu||(Tu=!0,Gg())}function ei(e,t){if(!Eu&&kc){Eu=!0;do for(var a=!1,n=wc;n!==null;){if(e!==0){var s=n.pendingLanes;if(s===0)var r=0;else{var d=n.suspendedLanes,g=n.pingedLanes;r=(1<<31-Ct(42|e)+1)-1,r&=s&~(d&~g),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(a=!0,Eh(n,r))}else r=ke,r=Zn(n,n===Ke?r:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(r&3)===0||fn(n,r)||(a=!0,Eh(n,r));n=n.next}while(a);Eu=!1}}function $g(){wh()}function wh(){kc=Tu=!1;var e=0;Mn!==0&&Wg()&&(e=Mn);for(var t=At(),a=null,n=wc;n!==null;){var s=n.next,r=kh(n,t);r===0?(n.next=null,a===null?wc=s:a.next=s,s===null&&(es=a)):(a=n,(e!==0||(r&3)!==0)&&(kc=!0)),n=s}xt!==0&&xt!==5||ei(e),Mn!==0&&(Mn=0)}function kh(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var d=31-Ct(r),g=1<<d,b=s[d];b===-1?((g&a)===0||(g&n)!==0)&&(s[d]=Ei(g,t)):b<=t&&(e.expiredLanes|=g),r&=~g}if(t=Ke,a=ke,a=Zn(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&aa(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||fn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&aa(n),wl(a)){case 2:case 8:a=Aa;break;case 32:a=na;break;case 268435456:a=Qn;break;default:a=na}return n=Th.bind(null,e),a=bl(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&aa(n),e.callbackPriority=2,e.callbackNode=null,2}function Th(e,t){if(xt!==0&&xt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Sc()&&e.callbackNode!==a)return null;var n=ke;return n=Zn(e,e===Ke?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(ch(e,n,t),kh(e,At()),e.callbackNode!=null&&e.callbackNode===a?Th.bind(null,e):null)}function Eh(e,t){if(Sc())return null;ch(e,t,!0)}function Gg(){ex(function(){(Le&6)!==0?bl(xa,$g):wh()})}function _u(){if(Mn===0){var e=Bl;e===0&&(e=on,on<<=1,(on&261888)===0&&(on=256)),Mn=e}return Mn}function _h(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:v(""+e)}function Ah(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Yg(e,t,a,n,s){if(t==="submit"&&a&&a.stateNode===s){var r=_h((s[it]||null).action),d=n.submitter;d&&(t=(t=d[it]||null)?_h(t.formAction):d.getAttribute("formAction"),t!==null&&(r=t,d=null));var g=new Li("action","action",null,n,s);e.push({event:g,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Mn!==0){var b=d?Ah(s,d):new FormData(s);Kr(a,{pending:!0,data:b,method:s.method,action:r},null,b)}}else typeof r=="function"&&(g.preventDefault(),b=d?Ah(s,d):new FormData(s),Kr(a,{pending:!0,data:b,method:s.method,action:r},r,b))},currentTarget:s}]})}}for(var Au=0;Au<fr.length;Au++){var Cu=fr[Au],Xg=Cu.toLowerCase(),Qg=Cu[0].toUpperCase()+Cu.slice(1);Na(Xg,"on"+Qg)}Na(sf,"onAnimationEnd"),Na(cf,"onAnimationIteration"),Na(rf,"onAnimationStart"),Na("dblclick","onDoubleClick"),Na("focusin","onFocus"),Na("focusout","onBlur"),Na(cg,"onTransitionRun"),Na(rg,"onTransitionStart"),Na(ug,"onTransitionCancel"),Na(uf,"onTransitionEnd"),ja("onMouseEnter",["mouseout","mouseover"]),ja("onMouseLeave",["mouseout","mouseover"]),ja("onPointerEnter",["pointerout","pointerover"]),ja("onPointerLeave",["pointerout","pointerover"]),za("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),za("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),za("onBeforeInput",["compositionend","keypress","textInput","paste"]),za("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),za("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),za("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ti="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(" "),Zg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ti));function Ch(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],s=n.event;n=n.listeners;e:{var r=void 0;if(t)for(var d=n.length-1;0<=d;d--){var g=n[d],b=g.instance,z=g.currentTarget;if(g=g.listener,b!==r&&s.isPropagationStopped())break e;r=g,s.currentTarget=z;try{r(s)}catch(L){qi(L)}s.currentTarget=null,r=b}else for(d=0;d<n.length;d++){if(g=n[d],b=g.instance,z=g.currentTarget,g=g.listener,b!==r&&s.isPropagationStopped())break e;r=g,s.currentTarget=z;try{r(s)}catch(L){qi(L)}s.currentTarget=null,r=b}}}}function Se(e,t){var a=t[vs];a===void 0&&(a=t[vs]=new Set);var n=e+"__bubble";a.has(n)||(Rh(t,e,2,!1),a.add(n))}function Ru(e,t,a){var n=0;t&&(n|=4),Rh(a,e,n,t)}var Tc="_reactListening"+Math.random().toString(36).slice(2);function zu(e){if(!e[Tc]){e[Tc]=!0,Ai.forEach(function(a){a!=="selectionchange"&&(Zg.has(a)||Ru(a,!1,e),Ru(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tc]||(t[Tc]=!0,Ru("selectionchange",!1,t))}}function Rh(e,t,a,n){switch(im(t)){case 2:var s=bx;break;case 8:s=jx;break;default:s=Vu}a=s.bind(null,t,a,e),s=void 0,!gt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,a,{capture:!0,passive:s}):e.addEventListener(t,a,!0):s!==void 0?e.addEventListener(t,a,{passive:s}):e.addEventListener(t,a,!1)}function Ou(e,t,a,n,s){var r=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var d=n.tag;if(d===3||d===4){var g=n.stateNode.containerInfo;if(g===s)break;if(d===4)for(d=n.return;d!==null;){var b=d.tag;if((b===3||b===4)&&d.stateNode.containerInfo===s)return;d=d.return}for(;g!==null;){if(d=Ga(g),d===null)return;if(b=d.tag,b===5||b===6||b===26||b===27){n=r=d;continue e}g=g.parentNode}}n=n.return}wt(function(){var z=r,L=ne(a),Y=[];e:{var O=of.get(e);if(O!==void 0){var D=Li,ie=e;switch(e){case"keypress":if(Mi(a)===0)break e;case"keydown":case"keyup":D=Bp;break;case"focusin":ie="focus",D=ar;break;case"focusout":ie="blur",D=ar;break;case"beforeblur":case"afterblur":D=ar;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":D=Ho;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":D=Ep;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":D=Gp;break;case sf:case cf:case rf:D=Cp;break;case uf:D=Xp;break;case"scroll":case"scrollend":D=kp;break;case"wheel":D=Zp;break;case"copy":case"cut":case"paste":D=zp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":D=qo;break;case"toggle":case"beforetoggle":D=Kp}var de=(t&4)!==0,Ze=!de&&(e==="scroll"||e==="scrollend"),A=de?O!==null?O+"Capture":null:O;de=[];for(var S=z,R;S!==null;){var B=S;if(R=B.stateNode,B=B.tag,B!==5&&B!==26&&B!==27||R===null||A===null||(B=rt(S,A),B!=null&&de.push(ai(S,B,R))),Ze)break;S=S.return}0<de.length&&(O=new D(O,ie,null,a,L),Y.push({event:O,listeners:de}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",O&&a!==Q&&(ie=a.relatedTarget||a.fromElement)&&(Ga(ie)||ie[hn]))break e;if((D||O)&&(O=L.window===L?L:(O=L.ownerDocument)?O.defaultView||O.parentWindow:window,D?(ie=a.relatedTarget||a.toElement,D=z,ie=ie?Ga(ie):null,ie!==null&&(Ze=h(ie),de=ie.tag,ie!==Ze||de!==5&&de!==27&&de!==6)&&(ie=null)):(D=null,ie=z),D!==ie)){if(de=Ho,B="onMouseLeave",A="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(de=qo,B="onPointerLeave",A="onPointerEnter",S="pointer"),Ze=D==null?O:Kn(D),R=ie==null?O:Kn(ie),O=new de(B,S+"leave",D,a,L),O.target=Ze,O.relatedTarget=R,B=null,Ga(L)===z&&(de=new de(A,S+"enter",ie,a,L),de.target=R,de.relatedTarget=Ze,B=de),Ze=B,D&&ie)t:{for(de=Vg,A=D,S=ie,R=0,B=A;B;B=de(B))R++;B=0;for(var ue=S;ue;ue=de(ue))B++;for(;0<R-B;)A=de(A),R--;for(;0<B-R;)S=de(S),B--;for(;R--;){if(A===S||S!==null&&A===S.alternate){de=A;break t}A=de(A),S=de(S)}de=null}else de=null;D!==null&&zh(Y,O,D,de,!1),ie!==null&&Ze!==null&&zh(Y,Ze,ie,de,!0)}}e:{if(O=z?Kn(z):window,D=O.nodeName&&O.nodeName.toLowerCase(),D==="select"||D==="input"&&O.type==="file")var Me=Ko;else if(Zo(O))if(Jo)Me=lg;else{Me=ag;var ce=tg}else D=O.nodeName,!D||D.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?z&&vn(z.elementType)&&(Me=Ko):Me=ng;if(Me&&(Me=Me(e,z))){Vo(Y,Me,a,L);break e}ce&&ce(e,O,z),e==="focusout"&&z&&O.type==="number"&&z.memoizedProps.value!=null&&Al(O,"number",O.value)}switch(ce=z?Kn(z):window,e){case"focusin":(Zo(ce)||ce.contentEditable==="true")&&(Rl=ce,rr=z,Rs=null);break;case"focusout":Rs=rr=Rl=null;break;case"mousedown":ur=!0;break;case"contextmenu":case"mouseup":case"dragend":ur=!1,nf(Y,a,L);break;case"selectionchange":if(ig)break;case"keydown":case"keyup":nf(Y,a,L)}var ye;if(lr)e:{switch(e){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else Cl?Xo(e,a)&&(Te="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Te="onCompositionStart");Te&&($o&&a.locale!=="ko"&&(Cl||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&Cl&&(ye=Uo()):(yn=L,Pc="value"in yn?yn.value:yn.textContent,Cl=!0)),ce=Ec(z,Te),0<ce.length&&(Te=new Bo(Te,e,null,a,L),Y.push({event:Te,listeners:ce}),ye?Te.data=ye:(ye=Qo(a),ye!==null&&(Te.data=ye)))),(ye=Ip?Fp(e,a):Wp(e,a))&&(Te=Ec(z,"onBeforeInput"),0<Te.length&&(ce=new Bo("onBeforeInput","beforeinput",null,a,L),Y.push({event:ce,listeners:Te}),ce.data=ye)),Yg(Y,e,z,a,L)}Ch(Y,t)})}function ai(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ec(e,t){for(var a=t+"Capture",n=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=rt(e,a),s!=null&&n.unshift(ai(e,s,r)),s=rt(e,t),s!=null&&n.push(ai(e,s,r))),e.tag===3)return n;e=e.return}return[]}function Vg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zh(e,t,a,n,s){for(var r=t._reactName,d=[];a!==null&&a!==n;){var g=a,b=g.alternate,z=g.stateNode;if(g=g.tag,b!==null&&b===n)break;g!==5&&g!==26&&g!==27||z===null||(b=z,s?(z=rt(a,r),z!=null&&d.unshift(ai(a,z,b))):s||(z=rt(a,r),z!=null&&d.push(ai(a,z,b)))),a=a.return}d.length!==0&&e.push({event:t,listeners:d})}var Kg=/\r\n?/g,Jg=/\u0000|\uFFFD/g;function Oh(e){return(typeof e=="string"?e:""+e).replace(Kg,`
10
- `).replace(Jg,"")}function Dh(e,t){return t=Oh(t),Oh(e)===t}function Qe(e,t,a,n,s,r){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Za(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Za(e,""+n);break;case"className":In(e,"class",n);break;case"tabIndex":In(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":In(e,a,n);break;case"style":Ns(e,n,r);break;case"data":if(t!=="object"){In(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=v(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(a==="formAction"?(t!=="input"&&Qe(e,t,"name",s.name,s,null),Qe(e,t,"formEncType",s.formEncType,s,null),Qe(e,t,"formMethod",s.formMethod,s,null),Qe(e,t,"formTarget",s.formTarget,s,null)):(Qe(e,t,"encType",s.encType,s,null),Qe(e,t,"method",s.method,s,null),Qe(e,t,"target",s.target,s,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=v(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=_);break;case"onScroll":n!=null&&Se("scroll",e);break;case"onScrollEnd":n!=null&&Se("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=v(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":Se("beforetoggle",e),Se("toggle",e),Tl(e,"popover",n);break;case"xlinkActuate":ca(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ca(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ca(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ca(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ca(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ca(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ca(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ca(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ca(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Tl(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ss.get(a)||a,Tl(e,a,n))}}function Du(e,t,a,n,s,r){switch(a){case"style":Ns(e,n,r);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Za(e,n):(typeof n=="number"||typeof n=="bigint")&&Za(e,""+n);break;case"onScroll":n!=null&&Se("scroll",e);break;case"onScrollEnd":n!=null&&Se("scrollend",e);break;case"onClick":n!=null&&(e.onclick=_);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ba.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(s=a.endsWith("Capture"),t=a.slice(2,s?a.length-7:void 0),r=e[it]||null,r=r!=null?r[a]:null,typeof r=="function"&&e.removeEventListener(t,r,s),typeof n=="function")){typeof r!="function"&&r!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,s);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Tl(e,a,n)}}}function _t(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Se("error",e),Se("load",e);var n=!1,s=!1,r;for(r in a)if(a.hasOwnProperty(r)){var d=a[r];if(d!=null)switch(r){case"src":n=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Qe(e,t,r,d,a,null)}}s&&Qe(e,t,"srcSet",a.srcSet,a,null),n&&Qe(e,t,"src",a.src,a,null);return;case"input":Se("invalid",e);var g=r=d=s=null,b=null,z=null;for(n in a)if(a.hasOwnProperty(n)){var L=a[n];if(L!=null)switch(n){case"name":s=L;break;case"type":d=L;break;case"checked":b=L;break;case"defaultChecked":z=L;break;case"value":r=L;break;case"defaultValue":g=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(u(137,t));break;default:Qe(e,t,n,L,a,null)}}bs(e,r,g,b,z,d,s,!1);return;case"select":Se("invalid",e),n=d=r=null;for(s in a)if(a.hasOwnProperty(s)&&(g=a[s],g!=null))switch(s){case"value":r=g;break;case"defaultValue":d=g;break;case"multiple":n=g;default:Qe(e,t,s,g,a,null)}t=r,a=d,e.multiple=!!n,t!=null?Qa(e,!!n,t,!1):a!=null&&Qa(e,!!n,a,!0);return;case"textarea":Se("invalid",e),r=s=n=null;for(d in a)if(a.hasOwnProperty(d)&&(g=a[d],g!=null))switch(d){case"value":n=g;break;case"defaultValue":s=g;break;case"children":r=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(u(91));break;default:Qe(e,t,d,g,a,null)}zi(e,n,s,r);return;case"option":for(b in a)a.hasOwnProperty(b)&&(n=a[b],n!=null)&&(b==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":Qe(e,t,b,n,a,null));return;case"dialog":Se("beforetoggle",e),Se("toggle",e),Se("cancel",e),Se("close",e);break;case"iframe":case"object":Se("load",e);break;case"video":case"audio":for(n=0;n<ti.length;n++)Se(ti[n],e);break;case"image":Se("error",e),Se("load",e);break;case"details":Se("toggle",e);break;case"embed":case"source":case"link":Se("error",e),Se("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(z in a)if(a.hasOwnProperty(z)&&(n=a[z],n!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Qe(e,t,z,n,a,null)}return;default:if(vn(t)){for(L in a)a.hasOwnProperty(L)&&(n=a[L],n!==void 0&&Du(e,t,L,n,a,void 0));return}}for(g in a)a.hasOwnProperty(g)&&(n=a[g],n!=null&&Qe(e,t,g,n,a,null))}function Ig(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,r=null,d=null,g=null,b=null,z=null,L=null;for(D in a){var Y=a[D];if(a.hasOwnProperty(D)&&Y!=null)switch(D){case"checked":break;case"value":break;case"defaultValue":b=Y;default:n.hasOwnProperty(D)||Qe(e,t,D,null,n,Y)}}for(var O in n){var D=n[O];if(Y=a[O],n.hasOwnProperty(O)&&(D!=null||Y!=null))switch(O){case"type":r=D;break;case"name":s=D;break;case"checked":z=D;break;case"defaultChecked":L=D;break;case"value":d=D;break;case"defaultValue":g=D;break;case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(137,t));break;default:D!==Y&&Qe(e,t,O,D,n,Y)}}ys(e,d,g,b,z,L,r,s);return;case"select":D=d=g=O=null;for(r in a)if(b=a[r],a.hasOwnProperty(r)&&b!=null)switch(r){case"value":break;case"multiple":D=b;default:n.hasOwnProperty(r)||Qe(e,t,r,null,n,b)}for(s in n)if(r=n[s],b=a[s],n.hasOwnProperty(s)&&(r!=null||b!=null))switch(s){case"value":O=r;break;case"defaultValue":g=r;break;case"multiple":d=r;default:r!==b&&Qe(e,t,s,r,n,b)}t=g,a=d,n=D,O!=null?Qa(e,!!a,O,!1):!!n!=!!a&&(t!=null?Qa(e,!!a,t,!0):Qa(e,!!a,a?[]:"",!1));return;case"textarea":D=O=null;for(g in a)if(s=a[g],a.hasOwnProperty(g)&&s!=null&&!n.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Qe(e,t,g,null,n,s)}for(d in n)if(s=n[d],r=a[d],n.hasOwnProperty(d)&&(s!=null||r!=null))switch(d){case"value":O=s;break;case"defaultValue":D=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==r&&Qe(e,t,d,s,n,r)}js(e,O,D);return;case"option":for(var ie in a)O=a[ie],a.hasOwnProperty(ie)&&O!=null&&!n.hasOwnProperty(ie)&&(ie==="selected"?e.selected=!1:Qe(e,t,ie,null,n,O));for(b in n)O=n[b],D=a[b],n.hasOwnProperty(b)&&O!==D&&(O!=null||D!=null)&&(b==="selected"?e.selected=O&&typeof O!="function"&&typeof O!="symbol":Qe(e,t,b,O,n,D));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 de in a)O=a[de],a.hasOwnProperty(de)&&O!=null&&!n.hasOwnProperty(de)&&Qe(e,t,de,null,n,O);for(z in n)if(O=n[z],D=a[z],n.hasOwnProperty(z)&&O!==D&&(O!=null||D!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:Qe(e,t,z,O,n,D)}return;default:if(vn(t)){for(var Ze in a)O=a[Ze],a.hasOwnProperty(Ze)&&O!==void 0&&!n.hasOwnProperty(Ze)&&Du(e,t,Ze,void 0,n,O);for(L in n)O=n[L],D=a[L],!n.hasOwnProperty(L)||O===D||O===void 0&&D===void 0||Du(e,t,L,O,n,D);return}}for(var A in a)O=a[A],a.hasOwnProperty(A)&&O!=null&&!n.hasOwnProperty(A)&&Qe(e,t,A,null,n,O);for(Y in n)O=n[Y],D=a[Y],!n.hasOwnProperty(Y)||O===D||O==null&&D==null||Qe(e,t,Y,O,n,D)}function Mh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Fg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var s=a[n],r=s.transferSize,d=s.initiatorType,g=s.duration;if(r&&g&&Mh(d)){for(d=0,g=s.responseEnd,n+=1;n<a.length;n++){var b=a[n],z=b.startTime;if(z>g)break;var L=b.transferSize,Y=b.initiatorType;L&&Mh(Y)&&(b=b.responseEnd,d+=L*(b<g?1:(g-z)/(b-z)))}if(--n,t+=8*(r+d)/(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 Mu=null,Uu=null;function _c(e){return e.nodeType===9?e:e.ownerDocument}function Uh(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 Lh(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 Lu(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 Hu=null;function Wg(){var e=window.event;return e&&e.type==="popstate"?e===Hu?!1:(Hu=e,!0):(Hu=null,!1)}var Hh=typeof setTimeout=="function"?setTimeout:void 0,Pg=typeof clearTimeout=="function"?clearTimeout:void 0,Bh=typeof Promise=="function"?Promise:void 0,ex=typeof queueMicrotask=="function"?queueMicrotask:typeof Bh<"u"?function(e){return Bh.resolve(null).then(e).catch(tx)}:Hh;function tx(e){setTimeout(function(){throw e})}function Un(e){return e==="head"}function qh(e,t){var a=t,n=0;do{var s=a.nextSibling;if(e.removeChild(a),s&&s.nodeType===8)if(a=s.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(s),ls(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")ni(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ni(a);for(var r=a.firstChild;r;){var d=r.nextSibling,g=r.nodeName;r[pn]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&r.rel.toLowerCase()==="stylesheet"||a.removeChild(r),r=d}}else a==="body"&&ni(e.ownerDocument.body);a=s}while(a);ls(t)}function $h(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function Bu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Bu(a),Vn(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function ax(e,t,a,n){for(;e.nodeType===1;){var s=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[pn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==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(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=ma(e.nextSibling),e===null)break}return null}function nx(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ma(e.nextSibling),e===null))return null;return e}function Gh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ma(e.nextSibling),e===null))return null;return e}function qu(e){return e.data==="$?"||e.data==="$~"}function $u(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function lx(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function ma(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 Gu=null;function Yh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ma(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Xh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Qh(e,t,a){switch(t=_c(a),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function ni(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Vn(e)}var pa=new Map,Zh=new Set;function Ac(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var rn=P.d;P.d={f:sx,r:ix,D:cx,C:rx,L:ux,m:ox,X:dx,S:fx,M:hx};function sx(){var e=rn.f(),t=bc();return e||t}function ix(e){var t=Ya(e);t!==null&&t.tag===5&&t.type==="form"?ud(t):rn.r(e)}var ts=typeof document>"u"?null:document;function Vh(e,t,a){var n=ts;if(n&&typeof t=="string"&&t){var s=St(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),Zh.has(s)||(Zh.add(s),e={rel:e,crossOrigin:a,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),_t(t,"link",e),ct(t),n.head.appendChild(t)))}}function cx(e){rn.D(e),Vh("dns-prefetch",e,null)}function rx(e,t){rn.C(e,t),Vh("preconnect",e,t)}function ux(e,t,a){rn.L(e,t,a);var n=ts;if(n&&e&&t){var s='link[rel="preload"][as="'+St(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+St(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+St(a.imageSizes)+'"]')):s+='[href="'+St(e)+'"]';var r=s;switch(t){case"style":r=as(e);break;case"script":r=ns(e)}pa.has(r)||(e=E({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),pa.set(r,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(li(r))||t==="script"&&n.querySelector(si(r))||(t=n.createElement("link"),_t(t,"link",e),ct(t),n.head.appendChild(t)))}}function ox(e,t){rn.m(e,t);var a=ts;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+St(n)+'"][href="'+St(e)+'"]',r=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=ns(e)}if(!pa.has(r)&&(e=E({rel:"modulepreload",href:e},t),pa.set(r,e),a.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(si(r)))return}n=a.createElement("link"),_t(n,"link",e),ct(n),a.head.appendChild(n)}}}function fx(e,t,a){rn.S(e,t,a);var n=ts;if(n&&e){var s=gn(n).hoistableStyles,r=as(e);t=t||"default";var d=s.get(r);if(!d){var g={loading:0,preload:null};if(d=n.querySelector(li(r)))g.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},a),(a=pa.get(r))&&Yu(e,a);var b=d=n.createElement("link");ct(b),_t(b,"link",e),b._p=new Promise(function(z,L){b.onload=z,b.onerror=L}),b.addEventListener("load",function(){g.loading|=1}),b.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Cc(d,t,n)}d={type:"stylesheet",instance:d,count:1,state:g},s.set(r,d)}}}function dx(e,t){rn.X(e,t);var a=ts;if(a&&e){var n=gn(a).hoistableScripts,s=ns(e),r=n.get(s);r||(r=a.querySelector(si(s)),r||(e=E({src:e,async:!0},t),(t=pa.get(s))&&Xu(e,t),r=a.createElement("script"),ct(r),_t(r,"link",e),a.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(s,r))}}function hx(e,t){rn.M(e,t);var a=ts;if(a&&e){var n=gn(a).hoistableScripts,s=ns(e),r=n.get(s);r||(r=a.querySelector(si(s)),r||(e=E({src:e,async:!0,type:"module"},t),(t=pa.get(s))&&Xu(e,t),r=a.createElement("script"),ct(r),_t(r,"link",e),a.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(s,r))}}function Kh(e,t,a,n){var s=(s=pe.current)?Ac(s):null;if(!s)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=as(a.href),a=gn(s).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=as(a.href);var r=gn(s).hoistableStyles,d=r.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,d),(r=s.querySelector(li(e)))&&!r._p&&(d.instance=r,d.state.loading=5),pa.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},pa.set(e,a),r||mx(s,e,a,d.state))),t&&n===null)throw Error(u(528,""));return d}if(t&&n!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ns(a),a=gn(s).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function as(e){return'href="'+St(e)+'"'}function li(e){return'link[rel="stylesheet"]['+e+"]"}function Jh(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function mx(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),_t(t,"link",a),ct(t),e.head.appendChild(t))}function ns(e){return'[src="'+St(e)+'"]'}function si(e){return"script[async]"+e}function Ih(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+St(a.href)+'"]');if(n)return t.instance=n,ct(n),n;var s=E({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ct(n),_t(n,"style",s),Cc(n,a.precedence,e),t.instance=n;case"stylesheet":s=as(a.href);var r=e.querySelector(li(s));if(r)return t.state.loading|=4,t.instance=r,ct(r),r;n=Jh(a),(s=pa.get(s))&&Yu(n,s),r=(e.ownerDocument||e).createElement("link"),ct(r);var d=r;return d._p=new Promise(function(g,b){d.onload=g,d.onerror=b}),_t(r,"link",n),t.state.loading|=4,Cc(r,a.precedence,e),t.instance=r;case"script":return r=ns(a.src),(s=e.querySelector(si(r)))?(t.instance=s,ct(s),s):(n=a,(s=pa.get(r))&&(n=E({},a),Xu(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),ct(s),_t(s,"link",n),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Cc(n,a.precedence,e));return t.instance}function Cc(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,r=s,d=0;d<n.length;d++){var g=n[d];if(g.dataset.precedence===t)r=g;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Yu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Xu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Rc=null;function Fh(e,t,a){if(Rc===null){var n=new Map,s=Rc=new Map;s.set(a,n)}else s=Rc,n=s.get(a),n||(n=new Map,s.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),s=0;s<a.length;s++){var r=a[s];if(!(r[pn]||r[pt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var d=r.getAttribute(t)||"";d=e+d;var g=n.get(d);g?g.push(r):n.set(d,[r])}}return n}function Wh(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function px(e,t,a){if(a===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 Ph(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function gx(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var s=as(n.href),r=t.querySelector(li(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=zc.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=r,ct(r);return}r=t.ownerDocument||t,n=Jh(n),(s=pa.get(s))&&Yu(n,s),r=r.createElement("link"),ct(r);var d=r;d._p=new Promise(function(g,b){d.onload=g,d.onerror=b}),_t(r,"link",n),a.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=zc.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Qu=0;function xx(e,t){return e.stylesheets&&e.count===0&&Dc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&Dc(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Qu===0&&(Qu=62500*Fg());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Dc(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Qu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function zc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Oc=null;function Dc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Oc=new Map,t.forEach(vx,e),Oc=null,zc.call(e))}function vx(e,t){if(!(t.state.loading&4)){var a=Oc.get(e);if(a)var n=a.get(null);else{a=new Map,Oc.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var d=s[r];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),n=d)}n&&a.set(null,n)}s=t.instance,d=s.getAttribute("data-precedence"),r=a.get(d)||n,r===n&&a.set(null,s),a.set(d,s),this.count++,n=zc.bind(this),s.addEventListener("load",n),s.addEventListener("error",n),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var ii={$$typeof:fe,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function yx(e,t,a,n,s,r,d,g,b){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=dn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dn(0),this.hiddenUpdates=dn(null),this.identifierPrefix=n,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function em(e,t,a,n,s,r,d,g,b,z,L,Y){return e=new yx(e,t,a,d,b,z,L,Y,g),t=1,r===!0&&(t|=24),r=Vt(3,null,null,t),e.current=r,r.stateNode=e,t=wr(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:n,isDehydrated:a,cache:t},_r(r),e}function tm(e){return e?(e=Dl,e):Dl}function am(e,t,a,n,s,r){s=tm(s),n.context===null?n.context=s:n.pendingContext=s,n=kn(t),n.payload={element:a},r=r===void 0?null:r,r!==null&&(n.callback=r),a=Tn(e,n,t),a!==null&&($t(a,e,t),Hs(a,e,t))}function nm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Zu(e,t){nm(e,t),(e=e.alternate)&&nm(e,t)}function lm(e){if(e.tag===13||e.tag===31){var t=el(e,67108864);t!==null&&$t(t,e,67108864),Zu(e,67108864)}}function sm(e){if(e.tag===13||e.tag===31){var t=Wt();t=gs(t);var a=el(e,t);a!==null&&$t(a,e,t),Zu(e,t)}}var Mc=!0;function bx(e,t,a,n){var s=U.T;U.T=null;var r=P.p;try{P.p=2,Vu(e,t,a,n)}finally{P.p=r,U.T=s}}function jx(e,t,a,n){var s=U.T;U.T=null;var r=P.p;try{P.p=8,Vu(e,t,a,n)}finally{P.p=r,U.T=s}}function Vu(e,t,a,n){if(Mc){var s=Ku(n);if(s===null)Ou(e,t,n,Uc,a),cm(e,n);else if(Sx(s,e,t,a,n))n.stopPropagation();else if(cm(e,n),t&4&&-1<Nx.indexOf(e)){for(;s!==null;){var r=Ya(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var d=Ca(r.pendingLanes);if(d!==0){var g=r;for(g.pendingLanes|=2,g.entangledLanes|=2;d;){var b=1<<31-Ct(d);g.entanglements[1]|=b,d&=~b}La(r),(Le&6)===0&&(vc=At()+500,ei(0))}}break;case 31:case 13:g=el(r,2),g!==null&&$t(g,r,2),bc(),Zu(r,2)}if(r=Ku(n),r===null&&Ou(e,t,n,Uc,a),r===s)break;s=r}s!==null&&n.stopPropagation()}else Ou(e,t,n,null,a)}}function Ku(e){return e=ne(e),Ju(e)}var Uc=null;function Ju(e){if(Uc=null,e=Ga(e),e!==null){var t=h(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Uc=e,null}function im(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(wi()){case xa:return 2;case Aa:return 8;case na:case ds:return 32;case Qn:return 268435456;default:return 32}default:return 32}}var Iu=!1,Ln=null,Hn=null,Bn=null,ci=new Map,ri=new Map,qn=[],Nx="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 cm(e,t){switch(e){case"focusin":case"focusout":Ln=null;break;case"dragenter":case"dragleave":Hn=null;break;case"mouseover":case"mouseout":Bn=null;break;case"pointerover":case"pointerout":ci.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ri.delete(t.pointerId)}}function ui(e,t,a,n,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:r,targetContainers:[s]},t!==null&&(t=Ya(t),t!==null&&lm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Sx(e,t,a,n,s){switch(t){case"focusin":return Ln=ui(Ln,e,t,a,n,s),!0;case"dragenter":return Hn=ui(Hn,e,t,a,n,s),!0;case"mouseover":return Bn=ui(Bn,e,t,a,n,s),!0;case"pointerover":var r=s.pointerId;return ci.set(r,ui(ci.get(r)||null,e,t,a,n,s)),!0;case"gotpointercapture":return r=s.pointerId,ri.set(r,ui(ri.get(r)||null,e,t,a,n,s)),!0}return!1}function rm(e){var t=Ga(e.target);if(t!==null){var a=h(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,xs(e.priority,function(){sm(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,xs(e.priority,function(){sm(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Ku(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);Q=n,a.target.dispatchEvent(n),Q=null}else return t=Ya(a),t!==null&&lm(t),e.blockedOn=a,!1;t.shift()}return!0}function um(e,t,a){Lc(e)&&a.delete(t)}function wx(){Iu=!1,Ln!==null&&Lc(Ln)&&(Ln=null),Hn!==null&&Lc(Hn)&&(Hn=null),Bn!==null&&Lc(Bn)&&(Bn=null),ci.forEach(um),ri.forEach(um)}function Hc(e,t){e.blockedOn===t&&(e.blockedOn=null,Iu||(Iu=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,wx)))}var Bc=null;function om(e){Bc!==e&&(Bc=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Bc===e&&(Bc=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],s=e[t+2];if(typeof n!="function"){if(Ju(n||a)===null)continue;break}var r=Ya(a);r!==null&&(e.splice(t,3),t-=3,Kr(r,{pending:!0,data:s,method:a.method,action:n},n,s))}}))}function ls(e){function t(b){return Hc(b,e)}Ln!==null&&Hc(Ln,e),Hn!==null&&Hc(Hn,e),Bn!==null&&Hc(Bn,e),ci.forEach(t),ri.forEach(t);for(var a=0;a<qn.length;a++){var n=qn[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<qn.length&&(a=qn[0],a.blockedOn===null);)rm(a),a.blockedOn===null&&qn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var s=a[n],r=a[n+1],d=s[it]||null;if(typeof r=="function")d||om(a);else if(d){var g=null;if(r&&r.hasAttribute("formAction")){if(s=r,d=r[it]||null)g=d.formAction;else if(Ju(s)!==null)continue}else g=d.action;typeof g=="function"?a[n+1]=g:(a.splice(n,3),n-=3),om(a)}}}function fm(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(d){return s=d})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Fu(e){this._internalRoot=e}qc.prototype.render=Fu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,n=Wt();am(a,n,e,t,null,null)},qc.prototype.unmount=Fu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;am(e.current,2,null,e,null,null),bc(),t[hn]=null}};function qc(e){this._internalRoot=e}qc.prototype.unstable_scheduleHydration=function(e){if(e){var t=kl();e={blockedOn:null,target:e,priority:t};for(var a=0;a<qn.length&&t!==0&&t<qn[a].priority;a++);qn.splice(a,0,e),a===0&&rm(e)}};var dm=c.version;if(dm!=="19.2.8")throw Error(u(527,dm,"19.2.8"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=x(t),e=e!==null?k(e):null,e=e===null?null:e.stateNode,e};var kx={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$c.isDisabled&&$c.supportsFiber)try{la=$c.inject(kx),yt=$c}catch{}}return fi.createRoot=function(e,t){if(!f(e))throw Error(u(299));var a=!1,n="",s=yd,r=bd,d=jd;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=em(e,1,!1,null,null,a,n,null,s,r,d,fm),e[hn]=t.current,zu(e),new Fu(t)},fi.hydrateRoot=function(e,t,a){if(!f(e))throw Error(u(299));var n=!1,s="",r=yd,d=bd,g=jd,b=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(r=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(g=a.onRecoverableError),a.formState!==void 0&&(b=a.formState)),t=em(e,1,!0,t,a??null,n,s,b,r,d,g,fm),t.context=tm(null),a=t.current,n=Wt(),n=gs(n),s=kn(n),s.callback=null,Tn(a,s,n),a=n,t.current.lanes=a,Ra(t,a),La(t),e[hn]=t.current,zu(e),new qc(t)},fi.version="19.2.8",fi}var Nm;function Hx(){if(Nm)return eo.exports;Nm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),eo.exports=Lx(),eo.exports}var Bx=Hx();const qx="modulepreload",$x=function(i){return"/"+i},Sm={},Gx=function(c,o,u){let f=Promise.resolve();if(o&&o.length>0){let y=function(x){return Promise.all(x.map(k=>Promise.resolve(k).then(E=>({status:"fulfilled",value:E}),E=>({status:"rejected",reason:E}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=m?.nonce||m?.getAttribute("nonce");f=y(o.map(x=>{if(x=$x(x),x in Sm)return;Sm[x]=!0;const k=x.endsWith(".css"),E=k?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${E}`))return;const j=document.createElement("link");if(j.rel=k?"stylesheet":qx,k||(j.as="script"),j.crossOrigin="",j.href=x,p&&j.setAttribute("nonce",p),document.head.appendChild(j),k)return new Promise((M,N)=>{j.addEventListener("load",M),j.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${x}`)))})}))}function h(m){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=m,window.dispatchEvent(p),!p.defaultPrevented)throw m}return f.then(m=>{for(const p of m||[])p.status==="rejected"&&h(p.reason);return c().catch(h)})};function V({name:i,fill:c,className:o}){return l.jsx("span",{className:`ms material-symbols-rounded${c?" ms-fill":""}${i==="progress_activity"?" ms-spin":""}${o?` ${o}`:""}`,"aria-hidden":!0,children:i})}function Yx(){const[i,c]=C.useState(()=>window.location.hash.slice(1)||"/");return C.useEffect(()=>{const o=()=>c(window.location.hash.slice(1)||"/");return window.addEventListener("hashchange",o),()=>window.removeEventListener("hashchange",o)},[]),i}let fo="kraftwerk inspector",ho="";function lp(){document.title=ho?`${ho} — ${fo}`:fo}function Xx(i){fo=i,lp()}function wm(i){ho=i,lp()}function ga(i,c){c?.replace?window.location.replace(`#${i}`):window.location.hash=i}function Ee({href:i,...c}){return l.jsx("a",{href:`#${i}`,...c})}const sp="kw-expert";let So=(()=>{try{return localStorage.getItem(sp)!=="off"}catch{return!0}})();const mo=new Set;document.documentElement.dataset.expert=So?"on":"off";function Qx(i){So=i,document.documentElement.dataset.expert=i?"on":"off";try{localStorage.setItem(sp,i?"on":"off")}catch{}mo.forEach(c=>c())}function Ba(){return C.useSyncExternalStore(i=>(mo.add(i),()=>mo.delete(i)),()=>So)}async function po(i,c){const o=await fetch(i,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(c??{})}),u=await o.json().catch(()=>({}));return!o.ok&&!u.error&&(u.error=`HTTP ${o.status}`),u}function He(i,c,o=6e3){const[u,f]=C.useState(null),h=C.useRef(i);return h.current=i,C.useEffect(()=>{let m=!0,p;const y=async()=>{try{const x=await fetch(h.current,{cache:"no-store"});x.ok&&m&&f(await x.json())}catch{}m&&(p=setTimeout(y,c?1500:o))};return y(),()=>{m=!1,clearTimeout(p)}},[i,c,o]),u}function bi(i){if(i==null)return"—";const c=Math.round(i/1e3);return c<60?`${c}s`:`${Math.floor(c/60)}m${String(c%60).padStart(2,"0")}s`}function wo(i){return i==null?"—":`$${i.toFixed(2)}`}function Xc(i){return i?i>=1e3?`${(i/1e3).toFixed(1)}k`:String(i):"0"}function ko(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} K`:`${(i/1024/1024).toFixed(1)} M`}function gl(i){if(!i)return"—";const c=new Date(i),o=new Date,u=c.toDateString()===o.toDateString(),f=c.toTimeString().slice(0,5);return u?f:`${c.toISOString().slice(5,10)} ${f}`}function yi(i){if(!i)return"—";const c=Date.now()-Date.parse(i);if(c<6e4)return"just now";const o=Math.floor(c/6e4);if(o<60)return`${o}m ago`;const u=Math.floor(o/60);if(u<24)return`${u}h ago`;const f=Math.floor(u/24);return f<7?`${f}d ago`:new Date(i).toISOString().slice(5,10)}function To({since:i}){const[,c]=C.useState(0);return C.useEffect(()=>{const o=setInterval(()=>c(u=>u+1),1e3);return()=>clearInterval(o)},[]),i?l.jsx("span",{className:"num",children:bi(Date.now()-Date.parse(i))}):null}function Jc({status:i}){return l.jsx("span",{className:`lamp ${i}`})}function Zx({status:i}){return l.jsx("span",{className:`status-word ${i}`,children:i})}function Eo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yl=Eo();function ip(i){yl=i}var pl={exec:()=>null};function ss(i){let c=[];return o=>{let u=Math.max(0,Math.min(3,o-1)),f=c[u];return f||(f=i(u),c[u]=f),f}}function we(i,c=""){let o=typeof i=="string"?i:i.source,u={replace:(f,h)=>{let m=typeof h=="string"?h:h.source;return m=m.replace(Ot.caret,"$1"),o=o.replace(f,m),u},getRegex:()=>new RegExp(o,c)};return u}var Vx=((i="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+i)}catch{return!1}})(),Ot={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ss(i=>new RegExp(`^ {0,${i}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ss(i=>new RegExp(`^ {0,${i}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:ss(i=>new RegExp(`^ {0,${i}}(?:\`\`\`|~~~)`)),headingBeginRegex:ss(i=>new RegExp(`^ {0,${i}}#`)),htmlBeginRegex:ss(i=>new RegExp(`^ {0,${i}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:ss(i=>new RegExp(`^ {0,${i}}>`))},Kx=/^(?:[ \t]*(?:\n|$))+/,Jx=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ix=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ji=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Fx=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_o=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,cp=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,rp=we(cp).replace(/bull/g,_o).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Wx=we(cp).replace(/bull/g,_o).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ao=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Px=/^[^\n]+/,Co=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ev=we(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Co).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tv=we(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,_o).getRegex(),Ic="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ro=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,av=we("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ro).replace("tag",Ic).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),up=i=>we(Ao).replace("hr",ji).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",i).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ic).getRegex(),nv=up(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),lv=up(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),sv=we(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",lv).getRegex(),zo={blockquote:sv,code:Jx,def:ev,fences:Ix,heading:Fx,hr:ji,html:av,lheading:rp,list:tv,newline:Kx,paragraph:nv,table:pl,text:Px},km=we("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ji).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ic).getRegex(),iv={...zo,lheading:Wx,table:km,paragraph:we(Ao).replace("hr",ji).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",km).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ic).getRegex()},cv={...zo,html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ro).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:pl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:we(Ao).replace("hr",ji).replace("heading",` *#{1,6} *[^
11
- ]`).replace("lheading",rp).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,uv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,op=/^( {2,}|\\)\n(?!\s*$)/,ov=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,un=/[\p{P}\p{S}]/u,rs=/[\s\p{P}\p{S}]/u,Ni=/[^\s\p{P}\p{S}]/u,fv=we(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,rs).getRegex(),dv=/[\p{Pi}\p{Ps}"']/u,fp=/(?!~)[\p{P}\p{S}]/u,hv=/(?!~)[\s\p{P}\p{S}]/u,mv=/(?:[^\s\p{P}\p{S}]|~)/u,pv=we(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Vx?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),dp=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,gv=we(dp,"u").replace(/punct/g,un).getRegex(),xv=we(dp,"u").replace(/punct/g,fp).getRegex(),vv=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,yv=we(vv,"u").replace(/openQuote/g,dv).replace(/punct/g,un).getRegex(),hp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bv=we(hp,"gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,rs).replace(/punct/g,un).getRegex(),jv=we(hp,"gu").replace(/notPunctSpace/g,mv).replace(/punctSpace/g,hv).replace(/punct/g,fp).getRegex(),Nv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Sv=we(Nv,"gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,rs).replace(/punct/g,un).getRegex(),wv=we("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,rs).replace(/punct/g,un).getRegex(),kv="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Tv=we(kv,"gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,rs).replace(/punct/g,un).getRegex(),Ev=we(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,un).getRegex(),_v="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Av=we(_v,"gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,rs).replace(/punct/g,un).getRegex(),Cv=we(/\\(punct)/,"gu").replace(/punct/g,un).getRegex(),Rv=we(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),zv=we(Ro).replace("(?:-->|$)","-->").getRegex(),Ov=we("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",zv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Dv=we(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Qc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),mp=we(/^!?\[(label)\]\[(ref)\]/).replace("label",Qc).replace("ref",Co).getRegex(),pp=we(/^!?\[(ref)\](?:\[\])?/).replace("ref",Co).getRegex(),Mv=we("reflink|nolink(?!\\()","g").replace("reflink",mp).replace("nolink",pp).getRegex(),Tm=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Oo={_backpedal:pl,anyPunctuation:Cv,autolink:Rv,blockSkip:pv,br:op,code:uv,del:pl,delLDelim:pl,delRDelim:pl,emStrongLDelim:gv,emStrongRDelimAst:bv,emStrongRDelimUnd:wv,escape:rv,link:Dv,nolink:pp,punctuation:fv,reflink:mp,reflinkSearch:Mv,tag:Ov,text:ov,url:pl},Uv={...Oo,emStrongLDelim:yv,emStrongRDelimAst:Sv,emStrongRDelimUnd:Tv,link:we(/^!?\[(label)\]\((.*?)\)/).replace("label",Qc).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qc).getRegex()},go={...Oo,emStrongRDelimAst:jv,emStrongLDelim:xv,delLDelim:Ev,delRDelim:Av,url:we(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Tm).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:we(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Tm).getRegex()},Lv={...go,br:we(op).replace("{2,}","*").getRegex(),text:we(go.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Gc={normal:zo,gfm:iv,pedantic:cv},di={normal:Oo,gfm:go,breaks:Lv,pedantic:Uv},Hv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Em=i=>Hv[i];function Ha(i,c){if(c){if(Ot.escapeTest.test(i))return i.replace(Ot.escapeReplace,Em)}else if(Ot.escapeTestNoEncode.test(i))return i.replace(Ot.escapeReplaceNoEncode,Em);return i}function _m(i){try{i=encodeURI(i).replace(Ot.percentDecode,"%")}catch{return null}return i}function Am(i,c){let o=i.replace(Ot.findPipe,(h,m,p)=>{let y=!1,x=m;for(;--x>=0&&p[x]==="\\";)y=!y;return y?"|":" |"}),u=o.split(Ot.splitPipe),f=0;if(u[0].trim()||u.shift(),u.length>0&&!u.at(-1)?.trim()&&u.pop(),c)if(u.length>c)u.splice(c);else for(;u.length<c;)u.push("");for(;f<u.length;f++)u[f]=u[f].trim().replace(Ot.slashPipe,"|");return u}function Gn(i,c,o){let u=i.length;if(u===0)return"";let f=0;for(;f<u&&i.charAt(u-f-1)===c;)f++;return i.slice(0,u-f)}function Cm(i){let c=i.split(`
12
- `),o=c.length-1;for(;o>=0&&Ot.blankLine.test(c[o]);)o--;return c.length-o<=2?i:c.slice(0,o+1).join(`
13
- `)}function Bv(i,c){if(i.indexOf(c[1])===-1)return-1;let o=0;for(let u=0;u<i.length;u++)if(i[u]==="\\")u++;else if(i[u]===c[0])o++;else if(i[u]===c[1]&&(o--,o<0))return u;return o>0?-2:-1}function qv(i,c=0){let o=c,u="";for(let f of i)if(f===" "){let h=4-o%4;u+=" ".repeat(h),o+=h}else u+=f,o++;return u}function Rm(i,c,o,u,f){let h=c.href,m=c.title||null,p=i[1].replace(f.other.outputLinkReplace,"$1"),y=i[0].charAt(0)==="!";u.state.inLink=!0;let x=u.state.linkEmitted,k=u.state.inRawBlock;u.state.linkEmitted=!1;let E=u.inlineTokens(p),j=u.state.linkEmitted;if(u.state.linkEmitted=x,u.state.inLink=!1,!y){if(j){u.state.inRawBlock=k;return}u.state.linkEmitted=!0}return{type:y?"image":"link",raw:o,href:h,title:m,text:p,tokens:E}}function $v(i,c,o){let u=i.match(o.other.indentCodeCompensation);if(u===null)return c;let f=u[1];return c.split(`
14
- `).map(h=>{let m=h.match(o.other.beginningSpace);if(m===null)return h;let[p]=m;return p.length>=f.length?h.slice(f.length):h}).join(`
15
- `)}var Zc=class{options;rules;lexer;constructor(i){this.options=i||yl}space(i){let c=this.rules.block.newline.exec(i);if(c&&c[0].length>0)return{type:"space",raw:c[0]}}code(i){let c=this.rules.block.code.exec(i);if(c){let o=this.options.pedantic?c[0]:Cm(c[0]),u=o.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:o,codeBlockStyle:"indented",text:u}}}fences(i){let c=this.rules.block.fences.exec(i);if(c){let o=c[0],u=$v(o,c[3]||"",this.rules);return{type:"code",raw:o,lang:c[2]?c[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):c[2],text:u}}}heading(i){let c=this.rules.block.heading.exec(i);if(c){let o=c[2].trim();if(this.rules.other.endingHash.test(o)){let u=Gn(o,"#");(this.options.pedantic||!u||this.rules.other.endingSpaceChar.test(u))&&(o=u.trim())}return{type:"heading",raw:Gn(c[0],`
16
- `),depth:c[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(i){let c=this.rules.block.hr.exec(i);if(c)return{type:"hr",raw:Gn(c[0],`
17
- `)}}blockquote(i){let c=this.rules.block.blockquote.exec(i);if(c){let o=Gn(c[0],`
18
- `).split(`
19
- `),u="",f="",h=[];for(;o.length>0;){let m=!1,p=[],y;for(y=0;y<o.length;y++)if(this.rules.other.blockquoteStart.test(o[y]))p.push(o[y]),m=!0;else if(!m)p.push(o[y]);else break;o=o.slice(y);let x=p.join(`
20
- `),k=x.replace(this.rules.other.blockquoteSetextReplace,`
21
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");u=u?`${u}
22
- ${x}`:x,f=f?`${f}
23
- ${k}`:k;let E=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(k,h,!0),this.lexer.state.top=E,o.length===0)break;let j=h.at(-1);if(j?.type==="code")break;if(j?.type==="blockquote"){let M=j,N=o.join(`
24
- `),K=M.raw+`
25
- `+N.replace(this.rules.other.blockquoteSetextReplace2,""),X=this.blockquote(K);h[h.length-1]=X,u=`${u}
26
- ${N}`,f=f.substring(0,f.length-M.text.length)+X.text;break}else if(j?.type==="list"){let M=j,N=M.raw+`
27
- `+o.join(`
28
- `),K=this.list(N);h[h.length-1]=K,u=u.substring(0,u.length-j.raw.length)+K.raw,f=f.substring(0,f.length-M.raw.length)+K.raw,o=N.substring(h.at(-1).raw.length).split(`
29
- `);continue}}return{type:"blockquote",raw:u,tokens:h,text:f}}}list(i){let c=this.rules.block.list.exec(i);if(c){let o=c[1].trim(),u=o.length>1,f={type:"list",raw:"",ordered:u,start:u?+o.slice(0,-1):"",loose:!1,items:[]};o=u?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=u?o:"[*+-]");let h=this.rules.other.listItemRegex(o),m=!1;for(;i;){let y=!1,x="",k="";if(!(c=h.exec(i))||this.rules.block.hr.test(i))break;x=c[0],i=i.substring(x.length);let E=qv(c[2].split(`
30
- `,1)[0],c[1].length),j=i.split(`
31
- `,1)[0],M=!E.trim(),N=0;if(this.options.pedantic?(N=2,k=E.trimStart()):M?N=c[1].length+1:(N=E.search(this.rules.other.nonSpaceChar),N=N>4?1:N,k=E.slice(N),N+=c[1].length),M&&this.rules.other.blankLine.test(j)&&(x+=j+`
32
- `,i=i.substring(j.length+1),y=!0),!y){let K=this.rules.other.nextBulletRegex(N),X=this.rules.other.hrRegex(N),T=this.rules.other.fencesBeginRegex(N),le=this.rules.other.headingBeginRegex(N),fe=this.rules.other.htmlBeginRegex(N),Z=this.rules.other.blockquoteBeginRegex(N);for(;i;){let I=i.split(`
33
- `,1)[0],q;if(j=I,this.options.pedantic?(j=j.replace(this.rules.other.listReplaceNesting," "),q=j):q=j.replace(this.rules.other.tabCharGlobal," "),T.test(j)||le.test(j)||fe.test(j)||Z.test(j)||K.test(j)||X.test(j))break;if(q.search(this.rules.other.nonSpaceChar)>=N||!j.trim())k+=`
34
- `+q.slice(N);else{if(M||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(E)||le.test(E)||X.test(E))break;k+=`
35
- `+j}M=!j.trim(),x+=I+`
36
- `,i=i.substring(I.length+1),E=q.slice(N)}}f.loose||(m?f.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(m=!0)),f.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(k),loose:!1,text:k,tokens:[]}),f.raw+=x}let p=f.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;f.raw=f.raw.trimEnd();for(let y of f.items)if(this.lexer.state.top=!1,y.tokens=this.lexer.blockTokens(y.text,[]),!f.loose){let x=y.tokens.filter(E=>E.type==="space"),k=x.length>0&&x.some(E=>this.rules.other.anyLine.test(E.raw));f.loose=k}for(let y of f.items){let x=y.tokens[0];if(y.task&&(x?.type==="text"||x?.type==="paragraph")){y.text=y.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let E=this.lexer.inlineQueue.length-1;E>=0;E--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[E].src)){this.lexer.inlineQueue[E].src=this.lexer.inlineQueue[E].src.replace(this.rules.other.listReplaceTask,"");break}let k=this.rules.other.listTaskCheckbox.exec(y.raw);if(k){let E={type:"checkbox",raw:k[0]+" ",checked:k[0]!=="[ ]"};y.checked=E.checked,f.loose?y.tokens[0]&&["paragraph","text"].includes(y.tokens[0].type)&&"tokens"in y.tokens[0]&&y.tokens[0].tokens?(y.tokens[0].raw=E.raw+y.tokens[0].raw,y.tokens[0].text=E.raw+y.tokens[0].text,y.tokens[0].tokens.unshift(E)):y.tokens.unshift({type:"paragraph",raw:E.raw,text:E.raw,tokens:[E]}):y.tokens.unshift(E)}}else y.task&&(y.task=!1)}if(f.loose)for(let y of f.items){y.loose=!0;for(let x of y.tokens)x.type==="text"&&(x.type="paragraph")}return f}}html(i){let c=this.rules.block.html.exec(i);if(c){let o=Cm(c[0]);return{type:"html",block:!0,raw:o,pre:c[1]==="pre"||c[1]==="script"||c[1]==="style",text:o}}}def(i){let c=this.rules.block.def.exec(i);if(c){let o=c[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),u=c[2]?c[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",f=c[3]?c[3].substring(1,c[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):c[3];return{type:"def",tag:o,raw:Gn(c[0],`
37
- `),href:u,title:f}}}table(i){let c=this.rules.block.table.exec(i);if(!c||!this.rules.other.tableDelimiter.test(c[2]))return;let o=Am(c[1]),u=c[2].replace(this.rules.other.tableAlignChars,"").split("|"),f=c[3]?.trim()?c[3].replace(this.rules.other.tableRowBlankLine,"").split(`
38
- `):[],h={type:"table",raw:Gn(c[0],`
39
- `),header:[],align:[],rows:[]};if(o.length===u.length){for(let m of u)this.rules.other.tableAlignRight.test(m)?h.align.push("right"):this.rules.other.tableAlignCenter.test(m)?h.align.push("center"):this.rules.other.tableAlignLeft.test(m)?h.align.push("left"):h.align.push(null);for(let m=0;m<o.length;m++)h.header.push({text:o[m],tokens:this.lexer.inline(o[m]),header:!0,align:h.align[m]});for(let m of f)h.rows.push(Am(m,h.header.length).map((p,y)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:h.align[y]})));return h}}lheading(i){let c=this.rules.block.lheading.exec(i);if(c){let o=c[1].trim();return{type:"heading",raw:Gn(c[0],`
40
- `),depth:c[2].charAt(0)==="="?1:2,text:o,tokens:this.lexer.inline(o)}}}paragraph(i){let c=this.rules.block.paragraph.exec(i);if(c){let o=c[1].charAt(c[1].length-1)===`
41
- `?c[1].slice(0,-1):c[1];return{type:"paragraph",raw:c[0],text:o,tokens:this.lexer.inline(o)}}}text(i){let c=this.rules.block.text.exec(i);if(c)return{type:"text",raw:c[0],text:c[0],tokens:this.lexer.inline(c[0])}}escape(i){let c=this.rules.inline.escape.exec(i);if(c)return{type:"escape",raw:c[0],text:c[1]}}tag(i){let c=this.rules.inline.tag.exec(i);if(c)return!this.lexer.state.inLink&&this.rules.other.startATag.test(c[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(c[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(c[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(c[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:c[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:c[0]}}link(i){let c=this.rules.inline.link.exec(i);if(c){let o=c[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(o)){if(!this.rules.other.endAngleBracket.test(o))return;let h=Gn(o.slice(0,-1),"\\");if((o.length-h.length)%2===0)return}else{let h=Bv(c[2],"()");if(h===-2)return;if(h>-1){let m=(c[0].indexOf("!")===0?5:4)+c[1].length+h;c[2]=c[2].substring(0,h),c[0]=c[0].substring(0,m).trim(),c[3]=""}}let u=c[2],f="";if(this.options.pedantic){let h=this.rules.other.pedanticHrefTitle.exec(u);h&&(u=h[1],f=h[3])}else f=c[3]?c[3].slice(1,-1):"";return u=u.trim(),this.rules.other.startAngleBracket.test(u)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(o)?u=u.slice(1):u=u.slice(1,-1)),Rm(c,{href:u&&u.replace(this.rules.inline.anyPunctuation,"$1"),title:f&&f.replace(this.rules.inline.anyPunctuation,"$1")},c[0],this.lexer,this.rules)}}reflink(i,c){let o;if((o=this.rules.inline.reflink.exec(i))||(o=this.rules.inline.nolink.exec(i))){let u=(o[2]||o[1]).replace(this.rules.other.multipleSpaceGlobal," "),f=c[u.toLowerCase()];if(!f){let h=o[0].charAt(0);return{type:"text",raw:h,text:h}}return Rm(o,f,o[0],this.lexer,this.rules)}}emStrong(i,c,o=""){let u=this.rules.inline.emStrongLDelim.exec(i);if(!(!u||!u[1]&&!u[2]&&!u[3]&&!u[4]||u[4]&&o.match(this.rules.other.unicodeAlphaNumeric))&&(!(u[1]||u[3])||!o||this.rules.inline.punctuation.exec(o))){let f=[...u[0]].length-1,h,m,p=f,y=0,x=u[0][0],k=o===x,E=x==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(E.lastIndex=0,c=c.slice(-1*i.length+f);(u=E.exec(c))!==null;){if(h=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!h)continue;if(m=[...h].length,u[3]||u[4]){p+=m;continue}else if(u[5]||u[6]){if(f%3&&!((f+m)%3)){y+=m;continue}if(k)break}if(p-=m,p>0)continue;m=Math.min(m,m+p+y);let j=[...u[0]][0].length,M=i.slice(0,f+u.index+j+m);if(Math.min(f,m)%2){let K=M.slice(1,-1);return{type:"em",raw:M,text:K,tokens:this.lexer.inlineTokens(K)}}let N=M.slice(2,-2);return{type:"strong",raw:M,text:N,tokens:this.lexer.inlineTokens(N)}}}}codespan(i){let c=this.rules.inline.code.exec(i);if(c){let o=c[2].replace(this.rules.other.newLineCharGlobal," "),u=this.rules.other.nonSpaceChar.test(o),f=this.rules.other.startingSpaceChar.test(o)&&this.rules.other.endingSpaceChar.test(o);return u&&f&&(o=o.substring(1,o.length-1)),{type:"codespan",raw:c[0],text:o}}}br(i){let c=this.rules.inline.br.exec(i);if(c)return{type:"br",raw:c[0]}}del(i,c,o=""){let u=this.rules.inline.delLDelim.exec(i);if(u&&(!u[1]||!o||this.rules.inline.punctuation.exec(o))){let f=[...u[0]].length-1,h,m,p=f,y=this.rules.inline.delRDelim;for(y.lastIndex=0,c=c.slice(-1*i.length+f);(u=y.exec(c))!==null;){if(h=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!h||(m=[...h].length,m!==f))continue;if(u[3]||u[4]){p+=m;continue}if(p-=m,p>0)continue;m=Math.min(m,m+p);let x=[...u[0]][0].length,k=i.slice(0,f+u.index+x+m),E=k.slice(f,-f);return{type:"del",raw:k,text:E,tokens:this.lexer.inlineTokens(E)}}}}autolink(i){let c=this.rules.inline.autolink.exec(i);if(c){let o,u;return c[2]==="@"?(o=c[1],u="mailto:"+o):(o=c[1],u=o),{type:"link",raw:c[0],text:o,href:u,tokens:[{type:"text",raw:o,text:o}]}}}url(i){let c;if(c=this.rules.inline.url.exec(i)){let o,u;if(c[2]==="@")o=c[0],u="mailto:"+o;else{let f;do f=c[0],c[0]=this.rules.inline._backpedal.exec(c[0])?.[0]??"";while(f!==c[0]);o=c[0],c[1]==="www."?u="http://"+c[0]:u=c[0]}return{type:"link",raw:c[0],text:o,href:u,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(i){let c=this.rules.inline.text.exec(i);if(c){let o=this.lexer.state.inRawBlock;return{type:"text",raw:c[0],text:c[0],escaped:o}}}},Ea=class xo{tokens;options;state;inlineQueue;tokenizer;constructor(c){this.tokens=[],this.tokens.links=Object.create(null),this.options=c||yl,this.options.tokenizer=this.options.tokenizer||new Zc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let o={other:Ot,block:Gc.normal,inline:di.normal};this.options.pedantic?(o.block=Gc.pedantic,o.inline=di.pedantic):this.options.gfm&&(o.block=Gc.gfm,this.options.breaks?o.inline=di.breaks:o.inline=di.gfm),this.tokenizer.rules=o}static get rules(){return{block:Gc,inline:di}}static lex(c,o){return new xo(o).lex(c)}static lexInline(c,o){return new xo(o).inlineTokens(c)}lex(c){c=c.replace(Ot.carriageReturn,`
42
- `),this.blockTokens(c,this.tokens);for(let o=0;o<this.inlineQueue.length;o++){let u=this.inlineQueue[o];this.inlineTokens(u.src,u.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(c,o=[],u=!1){this.tokenizer.lexer=this,this.options.pedantic&&(c=c.replace(Ot.tabCharGlobal," ").replace(Ot.spaceLine,""));let f=1/0;for(;c;){if(c.length<f)f=c.length;else{this.infiniteLoopError(c.charCodeAt(0));break}let h;if(this.options.extensions?.block?.some(p=>(h=p.call({lexer:this},c,o))?(c=c.substring(h.raw.length),o.push(h),!0):!1))continue;if(h=this.tokenizer.space(c)){c=c.substring(h.raw.length);let p=o.at(-1);h.raw.length===1&&p!==void 0?p.raw+=`
43
- `:o.push(h);continue}if(h=this.tokenizer.code(c)){c=c.substring(h.raw.length);let p=o.at(-1);p?.type==="paragraph"||p?.type==="text"?(p.raw+=(p.raw.endsWith(`
44
- `)?"":`
45
- `)+h.raw,p.text+=`
46
- `+h.text,this.inlineQueue.at(-1).src=p.text):o.push(h);continue}if(h=this.tokenizer.fences(c)){c=c.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.heading(c)){c=c.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.hr(c)){c=c.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.blockquote(c)){c=c.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.list(c)){c=c.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.html(c)){c=c.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.def(c)){c=c.substring(h.raw.length);let p=o.at(-1);p?.type==="paragraph"||p?.type==="text"?(p.raw+=(p.raw.endsWith(`
47
- `)?"":`
48
- `)+h.raw,p.text+=`
49
- `+h.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[h.tag]||(this.tokens.links[h.tag]={href:h.href,title:h.title},o.push(h));continue}if(h=this.tokenizer.table(c)){c=c.substring(h.raw.length),o.push(h);continue}if(h=this.tokenizer.lheading(c)){c=c.substring(h.raw.length),o.push(h);continue}let m=c;if(this.options.extensions?.startBlock){let p=1/0,y=c.slice(1),x;this.options.extensions.startBlock.forEach(k=>{x=k.call({lexer:this},y),typeof x=="number"&&x>=0&&(p=Math.min(p,x))}),p<1/0&&p>=0&&(m=c.substring(0,p+1))}if(this.state.top&&(h=this.tokenizer.paragraph(m))){let p=o.at(-1);u&&p?.type==="paragraph"?(p.raw+=(p.raw.endsWith(`
50
- `)?"":`
51
- `)+h.raw,p.text+=`
52
- `+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):o.push(h),u=m.length!==c.length,c=c.substring(h.raw.length);continue}if(h=this.tokenizer.text(c)){c=c.substring(h.raw.length);let p=o.at(-1);p?.type==="text"?(p.raw+=(p.raw.endsWith(`
53
- `)?"":`
54
- `)+h.raw,p.text+=`
55
- `+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):o.push(h);continue}if(c){this.infiniteLoopError(c.charCodeAt(0));break}}return this.state.top=!0,o}inline(c,o=[]){return this.inlineQueue.push({src:c,tokens:o}),o}linkInText(c){if(!c.includes("["))return!1;let o=this.tokenizer.rules.inline.link;for(let u of c.matchAll(this.tokenizer.rules.inline.blockSkip))if(o.test(u[0])&&c.charAt(u.index-1)!=="!")return!0;for(let u of c.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let f=u[0],h=f.lastIndexOf("[");if(!(f.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,f.slice(h+1,-1)))&&!(h>1&&this.linkInText(f.slice(1,h-1))))return!0}return!1}inlineTokens(c,o=[]){this.tokenizer.lexer=this;let u=c;if(this.tokens.links&&c.includes("[")){let p=this.tokenizer.rules.inline.reflinkSearch,y=x=>{let k=x.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,x.slice(k+1,-1)))return x;if(k>1&&x.charAt(0)!=="!"){let E=x.slice(1,k-1);if(this.linkInText(E))return"["+E.replace(p,y)+"]["+"a".repeat(x.length-k-2)+"]"}return"["+"a".repeat(x.length-2)+"]"};u=u.replace(p,y)}u=u.replace(this.tokenizer.rules.inline.anyPunctuation,p=>"+".repeat(p.length)),u=u.replace(this.tokenizer.rules.inline.blockSkip,(p,y,x)=>{let k=x?x.length:0;return p.slice(0,k)+"["+"a".repeat(p.length-k-2)+"]"}),u=this.options.hooks?.emStrongMask?.call({lexer:this},u)??u;let f=!1,h="",m=1/0;for(;c;){if(c.length<m)m=c.length;else{this.infiniteLoopError(c.charCodeAt(0));break}f||(h=""),f=!1;let p;if(this.options.extensions?.inline?.some(x=>(p=x.call({lexer:this},c,o))?(c=c.substring(p.raw.length),o.push(p),!0):!1))continue;if(p=this.tokenizer.escape(c)){c=c.substring(p.raw.length),o.push(p);continue}if(p=this.tokenizer.tag(c)){c=c.substring(p.raw.length),o.push(p);continue}if(p=this.tokenizer.link(c)){c=c.substring(p.raw.length),o.push(p);continue}if(p=this.tokenizer.reflink(c,this.tokens.links)){c=c.substring(p.raw.length);let x=o.at(-1);p.type==="text"&&x?.type==="text"?(x.raw+=p.raw,x.text+=p.text):o.push(p);continue}if(p=this.tokenizer.emStrong(c,u,h)){c=c.substring(p.raw.length),o.push(p);continue}if(p=this.tokenizer.codespan(c)){c=c.substring(p.raw.length),o.push(p);continue}if(p=this.tokenizer.br(c)){c=c.substring(p.raw.length),o.push(p);continue}if(p=this.tokenizer.del(c,u,h)){c=c.substring(p.raw.length),o.push(p);continue}if(p=this.tokenizer.autolink(c)){c=c.substring(p.raw.length),o.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(c))){c=c.substring(p.raw.length),o.push(p);continue}let y=c;if(this.options.extensions?.startInline){let x=1/0,k=c.slice(1),E;this.options.extensions.startInline.forEach(j=>{E=j.call({lexer:this},k),typeof E=="number"&&E>=0&&(x=Math.min(x,E))}),x<1/0&&x>=0&&(y=c.substring(0,x+1))}if(p=this.tokenizer.inlineText(y)){c=c.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(h=p.raw.slice(-1)),f=!0;let x=o.at(-1);x?.type==="text"?(x.raw+=p.raw,x.text+=p.text):o.push(p);continue}if(c){this.infiniteLoopError(c.charCodeAt(0));break}}return o}infiniteLoopError(c){let o="Infinite loop on byte: "+c;if(this.options.silent)console.error(o);else throw new Error(o)}},Vc=class{options;parser;constructor(i){this.options=i||yl}space(i){return""}code({text:i,lang:c,escaped:o}){let u=(c||"").match(Ot.notSpaceStart)?.[0],f=i.replace(Ot.endingNewline,"")+`
56
- `;return u?'<pre><code class="language-'+Ha(u)+'">'+(o?f:Ha(f,!0))+`</code></pre>
57
- `:"<pre><code>"+(o?f:Ha(f,!0))+`</code></pre>
58
- `}blockquote({tokens:i}){return`<blockquote>
59
- ${this.parser.parse(i)}</blockquote>
60
- `}html({text:i}){return i}def(i){return""}heading({tokens:i,depth:c}){return`<h${c}>${this.parser.parseInline(i)}</h${c}>
61
- `}hr(i){return`<hr>
62
- `}list(i){let c=i.ordered,o=i.start,u="";for(let m=0;m<i.items.length;m++){let p=i.items[m];u+=this.listitem(p)}let f=c?"ol":"ul",h=c&&o!==1?' start="'+o+'"':"";return"<"+f+h+`>
63
- `+u+"</"+f+`>
64
- `}listitem(i){return`<li>${this.parser.parse(i.tokens)}</li>
65
- `}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
66
- `}table(i){let c="",o="";for(let f=0;f<i.header.length;f++)o+=this.tablecell(i.header[f]);c+=this.tablerow({text:o});let u="";for(let f=0;f<i.rows.length;f++){let h=i.rows[f];o="";for(let m=0;m<h.length;m++)o+=this.tablecell(h[m]);u+=this.tablerow({text:o})}return u&&(u=`<tbody>${u}</tbody>`),`<table>
67
- <thead>
68
- `+c+`</thead>
69
- `+u+`</table>
70
- `}tablerow({text:i}){return`<tr>
71
- ${i}</tr>
72
- `}tablecell(i){let c=this.parser.parseInline(i.tokens),o=i.header?"th":"td";return(i.align?`<${o} align="${i.align}">`:`<${o}>`)+c+`</${o}>
73
- `}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${Ha(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:c,tokens:o}){let u=this.parser.parseInline(o),f=_m(i);if(f===null)return u;i=f;let h='<a href="'+i+'"';return c&&(h+=' title="'+Ha(c)+'"'),h+=">"+u+"</a>",h}image({href:i,title:c,text:o,tokens:u}){u&&(o=this.parser.parseInline(u,this.parser.textRenderer));let f=_m(i);if(f===null)return Ha(o);i=f;let h=`<img src="${i}" alt="${Ha(o)}"`;return c&&(h+=` title="${Ha(c)}"`),h+=">",h}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:Ha(i.text)}},Do=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}checkbox({raw:i}){return i}},_a=class vo{options;renderer;textRenderer;constructor(c){this.options=c||yl,this.options.renderer=this.options.renderer||new Vc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Do}static parse(c,o){return new vo(o).parse(c)}static parseInline(c,o){return new vo(o).parseInline(c)}parse(c){this.renderer.parser=this;let o="";for(let u=0;u<c.length;u++){let f=c[u];if(this.options.extensions?.renderers?.[f.type]){let m=f,p=this.options.extensions.renderers[m.type].call({parser:this},m);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(m.type)){o+=p||"";continue}}let h=f;switch(h.type){case"space":{o+=this.renderer.space(h);break}case"hr":{o+=this.renderer.hr(h);break}case"heading":{o+=this.renderer.heading(h);break}case"code":{o+=this.renderer.code(h);break}case"table":{o+=this.renderer.table(h);break}case"blockquote":{o+=this.renderer.blockquote(h);break}case"list":{o+=this.renderer.list(h);break}case"checkbox":{o+=this.renderer.checkbox(h);break}case"html":{o+=this.renderer.html(h);break}case"def":{o+=this.renderer.def(h);break}case"paragraph":{o+=this.renderer.paragraph(h);break}case"text":{o+=this.renderer.text(h);break}default:{let m='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}parseInline(c,o=this.renderer){this.renderer.parser=this;let u="";for(let f=0;f<c.length;f++){let h=c[f];if(this.options.extensions?.renderers?.[h.type]){let p=this.options.extensions.renderers[h.type].call({parser:this},h);if(p!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(h.type)){u+=p||"";continue}}let m=h;switch(m.type){case"escape":{u+=o.text(m);break}case"html":{u+=o.html(m);break}case"link":{u+=o.link(m);break}case"image":{u+=o.image(m);break}case"checkbox":{u+=o.checkbox(m);break}case"strong":{u+=o.strong(m);break}case"em":{u+=o.em(m);break}case"codespan":{u+=o.codespan(m);break}case"br":{u+=o.br(m);break}case"del":{u+=o.del(m);break}case"text":{u+=o.text(m);break}default:{let p='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return u}},gi=class{options;block;constructor(i){this.options=i||yl}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(i=this.block){return i?Ea.lex:Ea.lexInline}provideParser(i=this.block){return i?_a.parse:_a.parseInline}},Gv=class{defaults=Eo();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=_a;Renderer=Vc;TextRenderer=Do;Lexer=Ea;Tokenizer=Zc;Hooks=gi;constructor(...i){this.use(...i)}walkTokens(i,c){let o=[];for(let u of i)switch(o=o.concat(c.call(this,u)),u.type){case"table":{let f=u;for(let h of f.header)o=o.concat(this.walkTokens(h.tokens,c));for(let h of f.rows)for(let m of h)o=o.concat(this.walkTokens(m.tokens,c));break}case"list":{let f=u;o=o.concat(this.walkTokens(f.items,c));break}default:{let f=u;this.defaults.extensions?.childTokens?.[f.type]?this.defaults.extensions.childTokens[f.type].forEach(h=>{let m=f[h].flat(1/0);o=o.concat(this.walkTokens(m,c))}):f.tokens&&(o=o.concat(this.walkTokens(f.tokens,c)))}}return o}use(...i){let c=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(o=>{let u={...o};if(u.async=this.defaults.async||u.async||!1,o.extensions&&(o.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){let h=c.renderers[f.name];h?c.renderers[f.name]=function(...m){let p=f.renderer.apply(this,m);return p===!1&&(p=h.apply(this,m)),p}:c.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let h=c[f.level];h?h.unshift(f.tokenizer):c[f.level]=[f.tokenizer],f.start&&(f.level==="block"?c.startBlock?c.startBlock.push(f.start):c.startBlock=[f.start]:f.level==="inline"&&(c.startInline?c.startInline.push(f.start):c.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(c.childTokens[f.name]=f.childTokens)}),u.extensions=c),o.renderer){let f=this.defaults.renderer||new Vc(this.defaults);for(let h in o.renderer){if(!(h in f))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;let m=h,p=o.renderer[m],y=f[m];f[m]=(...x)=>{let k=p.apply(f,x);return k===!1&&(k=y.apply(f,x)),k||""}}u.renderer=f}if(o.tokenizer){let f=this.defaults.tokenizer||new Zc(this.defaults);for(let h in o.tokenizer){if(!(h in f))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;let m=h,p=o.tokenizer[m],y=f[m];f[m]=(...x)=>{let k=p.apply(f,x);return k===!1&&(k=y.apply(f,x)),k}}u.tokenizer=f}if(o.hooks){let f=this.defaults.hooks||new gi;for(let h in o.hooks){if(!(h in f))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;let m=h,p=o.hooks[m],y=f[m];gi.passThroughHooks.has(h)?f[m]=x=>{if(this.defaults.async&&gi.passThroughHooksRespectAsync.has(h))return(async()=>{let E=await p.call(f,x);return y.call(f,E)})();let k=p.call(f,x);return y.call(f,k)}:f[m]=(...x)=>{if(this.defaults.async)return(async()=>{let E=await p.apply(f,x);return E===!1&&(E=await y.apply(f,x)),E})();let k=p.apply(f,x);return k===!1&&(k=y.apply(f,x)),k}}u.hooks=f}if(o.walkTokens){let f=this.defaults.walkTokens,h=o.walkTokens;u.walkTokens=function(m){let p=[];return p.push(h.call(this,m)),f&&(p=p.concat(f.call(this,m))),p}}this.defaults={...this.defaults,...u}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,c){return Ea.lex(i,c??this.defaults)}parser(i,c){return _a.parse(i,c??this.defaults)}parseMarkdown(i){return(c,o)=>{let u={...o},f={...this.defaults,...u},h=this.onError(!!f.silent,!!f.async);if(this.defaults.async===!0&&u.async===!1)return h(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof c>"u"||c===null)return h(new Error("marked(): input parameter is undefined or null"));if(typeof c!="string")return h(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(c)+", string expected"));if(f.hooks&&(f.hooks.options=f,f.hooks.block=i),f.async)return(async()=>{let m=f.hooks?await f.hooks.preprocess(c):c,p=await(f.hooks?await f.hooks.provideLexer(i):i?Ea.lex:Ea.lexInline)(m,f),y=f.hooks?await f.hooks.processAllTokens(p):p;f.walkTokens&&await Promise.all(this.walkTokens(y,f.walkTokens));let x=await(f.hooks?await f.hooks.provideParser(i):i?_a.parse:_a.parseInline)(y,f);return f.hooks?await f.hooks.postprocess(x):x})().catch(h);try{f.hooks&&(c=f.hooks.preprocess(c));let m=(f.hooks?f.hooks.provideLexer(i):i?Ea.lex:Ea.lexInline)(c,f);f.hooks&&(m=f.hooks.processAllTokens(m)),f.walkTokens&&this.walkTokens(m,f.walkTokens);let p=(f.hooks?f.hooks.provideParser(i):i?_a.parse:_a.parseInline)(m,f);return f.hooks&&(p=f.hooks.postprocess(p)),p}catch(m){return h(m)}}}onError(i,c){return o=>{if(o.message+=`
74
- Please report this to https://github.com/markedjs/marked.`,i){let u="<p>An error occurred:</p><pre>"+Ha(o.message+"",!0)+"</pre>";return c?Promise.resolve(u):u}if(c)return Promise.reject(o);throw o}}},xl=new Gv;function ze(i,c){return xl.parse(i,c)}ze.options=ze.setOptions=function(i){return xl.setOptions(i),ze.defaults=xl.defaults,ip(ze.defaults),ze};ze.getDefaults=Eo;ze.defaults=yl;function Yv(...i){return xl.use(...i),ze.defaults=xl.defaults,ip(ze.defaults),ze}ze.use=Yv;ze.walkTokens=function(i,c){return xl.walkTokens(i,c)};ze.parseInline=xl.parseInline;ze.Parser=_a;ze.parser=_a.parse;ze.Renderer=Vc;ze.TextRenderer=Do;ze.Lexer=Ea;ze.lexer=Ea.lex;ze.Tokenizer=Zc;ze.Hooks=gi;ze.parse=ze;ze.options;ze.setOptions;ze.walkTokens;ze.parseInline;_a.parse;Ea.lex;function zm(i,c){(c==null||c>i.length)&&(c=i.length);for(var o=0,u=Array(c);o<c;o++)u[o]=i[o];return u}function Xv(i){if(Array.isArray(i))return i}function Qv(i,c){var o=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(o!=null){var u,f,h,m,p=[],y=!0,x=!1;try{if(h=(o=o.call(i)).next,c!==0)for(;!(y=(u=h.call(o)).done)&&(p.push(u.value),p.length!==c);y=!0);}catch(k){x=!0,f=k}finally{try{if(!y&&o.return!=null&&(m=o.return(),Object(m)!==m))return}finally{if(x)throw f}}return p}}function Zv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
75
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vv(i,c){return Xv(i)||Qv(i,c)||Kv(i,c)||Zv()}function Kv(i,c){if(i){if(typeof i=="string")return zm(i,c);var o={}.toString.call(i).slice(8,-1);return o==="Object"&&i.constructor&&(o=i.constructor.name),o==="Map"||o==="Set"?Array.from(i):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?zm(i,c):void 0}}const gp=Object.entries,Om=Object.setPrototypeOf,Jv=Object.isFrozen,Iv=Object.getPrototypeOf,Fv=Object.getOwnPropertyDescriptor;let vt=Object.freeze,jt=Object.seal,is=Object.create,xp=typeof Reflect<"u"&&Reflect,yo=xp.apply,bo=xp.construct;vt||(vt=function(c){return c});jt||(jt=function(c){return c});yo||(yo=function(c,o){for(var u=arguments.length,f=new Array(u>2?u-2:0),h=2;h<u;h++)f[h-2]=arguments[h];return c.apply(o,f)});bo||(bo=function(c){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return new c(...u)});const ml=ht(Array.prototype.forEach),Wv=ht(Array.prototype.lastIndexOf),Dm=ht(Array.prototype.pop),hi=ht(Array.prototype.push),Pv=ht(Array.prototype.splice),cs=Array.isArray,xi=ht(String.prototype.toLowerCase),lo=ht(String.prototype.toString),Mm=ht(String.prototype.match),mi=ht(String.prototype.replace),Um=ht(String.prototype.indexOf),ey=ht(String.prototype.trim),ty=ht(Number.prototype.toString),ay=ht(Boolean.prototype.toString),Lm=typeof BigInt>"u"?null:ht(BigInt.prototype.toString),Hm=typeof Symbol>"u"?null:ht(Symbol.prototype.toString),Gt=ht(Object.prototype.hasOwnProperty),pi=ht(Object.prototype.toString),zt=ht(RegExp.prototype.test),hl=ny(TypeError);function ht(i){return function(c){c instanceof RegExp&&(c.lastIndex=0);for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return yo(i,c,u)}}function ny(i){return function(){for(var c=arguments.length,o=new Array(c),u=0;u<c;u++)o[u]=arguments[u];return bo(i,o)}}function De(i,c){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xi;if(Om&&Om(i,null),!cs(c))return i;let u=c.length;for(;u--;){let f=c[u];if(typeof f=="string"){const h=o(f);h!==f&&(Jv(c)||(c[u]=h),f=h)}i[f]=!0}return i}function ly(i){for(let c=0;c<i.length;c++)Gt(i,c)||(i[c]=null);return i}function ea(i){const c=is(null);for(const u of gp(i)){var o=Vv(u,2);const f=o[0],h=o[1];Gt(i,f)&&(cs(h)?c[f]=ly(h):h&&typeof h=="object"&&h.constructor===Object?c[f]=ea(h):c[f]=h)}return c}function sy(i){switch(typeof i){case"string":return i;case"number":return ty(i);case"boolean":return ay(i);case"bigint":return Lm?Lm(i):"0";case"symbol":return Hm?Hm(i):"Symbol()";case"undefined":return pi(i);case"function":case"object":{if(i===null)return pi(i);const c=i,o=ka(c,"toString");if(typeof o=="function"){const u=o(c);return typeof u=="string"?u:pi(u)}return pi(i)}default:return pi(i)}}function ka(i,c){for(;i!==null;){const u=Fv(i,c);if(u){if(u.get)return ht(u.get);if(typeof u.value=="function")return ht(u.value)}i=Iv(i)}function o(){return null}return o}function iy(i){try{return zt(i,""),!0}catch{return!1}}const Bm=vt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),so=vt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),io=vt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),cy=vt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),co=vt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ry=vt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),qm=vt(["#text"]),$m=vt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ro=vt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Gm=vt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Yc=vt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),uy=jt(/{{[\w\W]*|^[\w\W]*}}/g),oy=jt(/<%[\w\W]*|^[\w\W]*%>/g),fy=jt(/\${[\w\W]*/g),dy=jt(/^data-[\-\w.\u00B7-\uFFFF]+$/),hy=jt(/^aria-[\-\w]+$/),Ym=jt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),my=jt(/^(?:\w+script|data):/i),py=jt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gy=jt(/^html$/i),xy=jt(/^[a-z][.\w]*(-[.\w]+)+$/i),Xm=jt(/<[/\w!]/g),Qm=jt(/<[/\w]/g),vy=jt(/<\/no(script|embed|frames)/i),yy=jt(/\/>/i),Pt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},vp=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],by=vt(De({},vp)),jy=(function(){const i={};return ml(vp,c=>{i[c]=jt(new RegExp("</"+c+"(?=[\\t\\n\\f\\r />])","i"))}),vt(i)})(),Ny=function(){return typeof window>"u"?null:window},Sy=function(c,o){if(typeof c!="object"||typeof c.createPolicy!="function")return null;let u=null;const f="data-tt-policy-suffix";o&&o.hasAttribute(f)&&(u=o.getAttribute(f));const h="dompurify"+(u?"#"+u:"");try{return c.createPolicy(h,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},Zm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Yn=function(c,o,u,f){return Gt(c,o)&&cs(c[o])?De(f.base?ea(f.base):{},c[o],f.transform):u},uo=function(c,o,u){const f=Gt(c,o)?c[o]:void 0;return f&&typeof f=="object"?ea(f):u()};function yp(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ny();const c=J=>yp(J);if(c.version="3.4.14",c.removed=[],!i||!i.document||i.document.nodeType!==Pt.document||!i.Element)return c.isSupported=!1,c;let o=i.document;const u=o,f=u.currentScript;i.DocumentFragment;const h=i.HTMLTemplateElement,m=i.Node,p=i.Element,y=i.NodeFilter,x=i.NamedNodeMap;x===void 0&&(i.NamedNodeMap||i.MozNamedAttrMap),i.HTMLFormElement;const k=i.DOMParser,E=i.trustedTypes,j=p.prototype,M=ka(j,"cloneNode"),N=ka(j,"remove"),K=ka(j,"nextSibling"),X=ka(j,"childNodes"),T=ka(j,"parentNode"),le=ka(j,"shadowRoot"),fe=ka(j,"attributes"),Z=m&&m.prototype?ka(m.prototype,"nodeType"):null,I=m&&m.prototype?ka(m.prototype,"nodeName"):null,q=m&&m.prototype?ka(m.prototype,"ownerDocument"):null,H=function(v){return Z?Z(v):v.nodeType},W=function(v){return I?I(v):v.nodeName};if(typeof h=="function"){const J=o.createElement("template");J.content&&J.content.ownerDocument&&(o=J.content.ownerDocument)}let ee,ve="",ge,ae=!1,be=0;const Je=function(){if(be>0)throw hl('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},nt=function(v){Je(),be++;try{return ee.createHTML(v)}finally{be--}},U=function(v){Je(),be++;try{return ee.createScriptURL(v)}finally{be--}},P=function(){return ae||(ge=Sy(E,f),ae=!0),ge},re=o,Ce=re.implementation,je=re.createNodeIterator,w=re.createDocumentFragment,G=re.getElementsByTagName,te=u.importNode;let F=Zm();c.isSupported=typeof gp=="function"&&typeof T=="function"&&Ce&&Ce.createHTMLDocument!==void 0;const he=uy,pe=oy,_e=fy,mt=dy,$=hy,Re=my,Ge=py,We=xy;let ta=Ym,Oe=null;const Xn=De({},[...Bm,...so,...io,...co,...qm]);let Ye=null;const os=De({},[...$m,...ro,...Gm,...Yc]);let Yt=Object.seal(is(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),qa=null,bl=null;const aa=Object.seal(is(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Si=!0,fs=!0,At=!1,wi=!0,xa=!1,Aa=!0,na=!1,ds=!1,Qn=null,jl=null,hs=!1,la=!1,yt=!1,Xt=!1,Ct=!0,ki=!1;const Ti="user-content-";let ms=!0,on=!1,va={},ya=null;const Ca=De({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Zn=null;const fn=De({},["audio","video","img","source","image","track"]);let Ei=null;const ps=De({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),dn="http://www.w3.org/1998/Math/MathML",Ra="http://www.w3.org/2000/svg",sa="http://www.w3.org/1999/xhtml";let $a=sa,Nl=!1,Sl=null;const gs=De({},[dn,Ra,sa],lo),wl=vt(["mi","mo","mn","ms","mtext"]);let kl=De({},wl);const xs=vt(["annotation-xml"]);let ia=De({},xs);const pt=De({},["title","style","font","a","script"]);let it=null;const hn=["application/xhtml+xml","text/html"],vs="text/html";let et=null,mn=null;const _i=o.createElement("form"),pn=function(v){return v instanceof RegExp||v instanceof Function},Vn=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(mn&&mn===v)return;(!v||typeof v!="object")&&(v={}),v=ea(v),it=hn.indexOf(v.PARSER_MEDIA_TYPE)===-1?vs:v.PARSER_MEDIA_TYPE,et=it==="application/xhtml+xml"?lo:xi,Oe=Yn(v,"ALLOWED_TAGS",Xn,{transform:et}),Ye=Yn(v,"ALLOWED_ATTR",os,{transform:et}),Sl=Yn(v,"ALLOWED_NAMESPACES",gs,{transform:lo}),Ei=Yn(v,"ADD_URI_SAFE_ATTR",ps,{transform:et,base:ps}),Zn=Yn(v,"ADD_DATA_URI_TAGS",fn,{transform:et,base:fn}),ya=Yn(v,"FORBID_CONTENTS",Ca,{transform:et}),qa=Yn(v,"FORBID_TAGS",ea({}),{transform:et}),bl=Yn(v,"FORBID_ATTR",ea({}),{transform:et}),va=Gt(v,"USE_PROFILES")?v.USE_PROFILES&&typeof v.USE_PROFILES=="object"?ea(v.USE_PROFILES):v.USE_PROFILES:!1,Si=v.ALLOW_ARIA_ATTR!==!1,fs=v.ALLOW_DATA_ATTR!==!1,At=v.ALLOW_UNKNOWN_PROTOCOLS||!1,wi=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xa=v.SAFE_FOR_TEMPLATES||!1,Aa=v.SAFE_FOR_XML!==!1,na=v.WHOLE_DOCUMENT||!1,la=v.RETURN_DOM||!1,yt=v.RETURN_DOM_FRAGMENT||!1,Xt=v.RETURN_TRUSTED_TYPE||!1,hs=v.FORCE_BODY||!1,Ct=v.SANITIZE_DOM!==!1,ki=v.SANITIZE_NAMED_PROPS||!1,ms=v.KEEP_CONTENT!==!1,on=v.IN_PLACE||!1,ta=iy(v.ALLOWED_URI_REGEXP)?v.ALLOWED_URI_REGEXP:Ym,$a=typeof v.NAMESPACE=="string"?v.NAMESPACE:sa,kl=uo(v,"MATHML_TEXT_INTEGRATION_POINTS",()=>De({},wl)),ia=uo(v,"HTML_INTEGRATION_POINTS",()=>De({},xs));const _=uo(v,"CUSTOM_ELEMENT_HANDLING",()=>is(null));if(Yt=is(null),Gt(_,"tagNameCheck")&&pn(_.tagNameCheck)&&(Yt.tagNameCheck=_.tagNameCheck),Gt(_,"attributeNameCheck")&&pn(_.attributeNameCheck)&&(Yt.attributeNameCheck=_.attributeNameCheck),Gt(_,"allowCustomizedBuiltInElements")&&typeof _.allowCustomizedBuiltInElements=="boolean"&&(Yt.allowCustomizedBuiltInElements=_.allowCustomizedBuiltInElements),jt(Yt),xa&&(fs=!1),yt&&(la=!0),va&&(Oe=De({},qm),Ye=is(null),va.html===!0&&(De(Oe,Bm),De(Ye,$m)),va.svg===!0&&(De(Oe,so),De(Ye,ro),De(Ye,Yc)),va.svgFilters===!0&&(De(Oe,io),De(Ye,ro),De(Ye,Yc)),va.mathMl===!0&&(De(Oe,co),De(Ye,Gm),De(Ye,Yc))),aa.tagCheck=null,aa.attributeCheck=null,Gt(v,"ADD_TAGS")&&(typeof v.ADD_TAGS=="function"?aa.tagCheck=v.ADD_TAGS:cs(v.ADD_TAGS)&&(Oe===Xn&&(Oe=ea(Oe)),De(Oe,v.ADD_TAGS,et))),Gt(v,"ADD_ATTR")&&(typeof v.ADD_ATTR=="function"?aa.attributeCheck=v.ADD_ATTR:cs(v.ADD_ATTR)&&(Ye===os&&(Ye=ea(Ye)),De(Ye,v.ADD_ATTR,et))),Gt(v,"ADD_FORBID_CONTENTS")&&cs(v.ADD_FORBID_CONTENTS)&&(ya===Ca&&(ya=ea(ya)),De(ya,v.ADD_FORBID_CONTENTS,et)),ms&&(Oe["#text"]=!0),na&&De(Oe,["html","head","body"]),Oe.table&&(De(Oe,["tbody"]),delete qa.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw hl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw hl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Q=ee;ee=v.TRUSTED_TYPES_POLICY;try{ve=nt("")}catch(ne){throw ee=Q,ne}}else v.TRUSTED_TYPES_POLICY===null?(ee=void 0,ve=""):(ee===void 0&&(ee=P()),ee&&typeof ve=="string"&&(ve=nt("")));vt&&vt(v),mn=v},Ga=De({},[...so,...io,...cy]),Ya=De({},[...co,...ry]),Kn=function(v,_,Q){return _.namespaceURI===sa?v==="svg":_.namespaceURI===dn?v==="svg"&&(Q==="annotation-xml"||kl[Q]):!!Ga[v]},gn=function(v,_,Q){return _.namespaceURI===sa?v==="math":_.namespaceURI===Ra?v==="math"&&ia[Q]:!!Ya[v]},ct=function(v,_,Q){return _.namespaceURI===Ra&&!ia[Q]||_.namespaceURI===dn&&!kl[Q]?!1:!Ya[v]&&(pt[v]||!Ga[v])},Ai=function(v){let _=T(v);(!_||!_.tagName)&&(_={namespaceURI:$a,tagName:"template"});const Q=xi(v.tagName),ne=xi(_.tagName);return Sl[v.namespaceURI]?v.namespaceURI===Ra?Kn(Q,_,ne):v.namespaceURI===dn?gn(Q,_,ne):v.namespaceURI===sa?ct(Q,_,ne):!!(it==="application/xhtml+xml"&&Sl[v.namespaceURI]):!1},ba=function(v){hi(c.removed,{element:v});try{T(v).removeChild(v)}catch{if(N(v),!T(v))throw hl("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},za=function(v,_,Q){try{v.removeAttributeNode(_)}catch{try{v.removeAttribute(Q)}catch{}}},ja=function(v){Jn(v);const _=X(v);if(_){const ne=[];ml(_,se=>{hi(ne,se)}),ml(ne,se=>{try{N(se)}catch{}})}const Q=fe(v);if(Q)for(let ne=Q.length-1;ne>=0;--ne){const se=Q[ne],oe=se&&se.name;typeof oe=="string"&&za(v,se,oe)}},Xa=function(v,_,Q){if(!Q)try{Q=_.getAttributeNode(v)}catch{Q=null}hi(c.removed,{attribute:Q||null,from:_});try{Q?_.removeAttributeNode(Q):_.removeAttribute(v)}catch{try{_.removeAttribute(v)}catch{}}if(v==="is")if(la||yt)try{ba(_)}catch{}else try{_.setAttribute(v,"")}catch{}},Ci=function(v){const _=fe(v);if(_)for(let Q=_.length-1;Q>=0;--Q){const ne=_[Q],se=ne&&ne.name;typeof se!="string"||Ye[et(se)]||za(v,ne,se)}},Jn=function(v){const _=[v];for(;_.length>0;){const Q=_.pop();H(Q)===Pt.element&&Ci(Q);const se=X(Q);if(se)for(let oe=se.length-1;oe>=0;--oe)_.push(se[oe])}},Ri=function(v,_){return Aa?v==="patchsrc"?!0:v==="for"&&_!=="label"&&_!=="output":!1},Tl=function(v){if(!Aa)return;const _=[v];for(;_.length>0;){const Q=_.pop(),ne=H(Q);if(ne===Pt.processingInstruction||ne===Pt.comment&&zt(Qm,Q.data)){try{N(Q)}catch{}continue}if(ne===Pt.element){const oe=Q,Be=et(W(Q));try{oe.hasAttribute&&oe.hasAttribute("patchsrc")&&oe.removeAttribute("patchsrc"),oe.hasAttribute&&oe.hasAttribute("for")&&Ri("for",Be)&&oe.removeAttribute("for")}catch{}}const se=X(Q);if(se)for(let oe=se.length-1;oe>=0;--oe)_.push(se[oe])}},In=function(v){let _=null,Q=null;if(hs)v="<remove></remove>"+v;else{const oe=Mm(v,/^[\r\n\t ]+/);Q=oe&&oe[0]}it==="application/xhtml+xml"&&$a===sa&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");const ne=ee?nt(v):v;if($a===sa)try{_=new k().parseFromString(ne,it)}catch{}if(!_||!_.documentElement){_=Ce.createDocument($a,"template",null);try{_.documentElement.innerHTML=Nl?ve:ne}catch{}}const se=_.body||_.documentElement;return v&&Q&&se.insertBefore(o.createTextNode(Q),se.childNodes[0]||null),$a===sa?G.call(_,na?"html":"body")[0]:na?_.documentElement:se},ca=function(v){const _=q?q(v):v.ownerDocument;return je.call(_||v,v,y.SHOW_ELEMENT|y.SHOW_COMMENT|y.SHOW_TEXT|y.SHOW_PROCESSING_INSTRUCTION|y.SHOW_CDATA_SECTION,null)},Nt=function(v){return v=mi(v,he," "),v=mi(v,pe," "),v=mi(v,_e," "),v},El=function(v){var _;v.normalize();const Q=q?q(v):v.ownerDocument,ne=je.call(Q||v,v,y.SHOW_TEXT|y.SHOW_COMMENT|y.SHOW_CDATA_SECTION|y.SHOW_PROCESSING_INSTRUCTION,null);let se=ne.nextNode();for(;se;)se.data=Nt(se.data),se=ne.nextNode();const oe=(_=v.querySelectorAll)===null||_===void 0?void 0:_.call(v,"template");oe&&ml(oe,Be=>{Oa(Be.content)&&El(Be.content)})},_l=function(v){const _=I?I(v):null;return typeof _!="string"||et(_)!=="form"?!1:typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||v.attributes!==fe(v)||typeof v.removeAttribute!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function"||v.nodeType!==Z(v)||v.childNodes!==X(v)},Oa=function(v){if(!Z||typeof v!="object"||v===null)return!1;try{return Z(v)===Pt.documentFragment}catch{return!1}},xn=function(v){if(!Z||typeof v!="object"||v===null)return!1;try{return typeof Z(v)=="number"}catch{return!1}};function Dt(J,v,_){J.length!==0&&ml(J,Q=>{Q.call(c,v,_,mn)})}const Fc=function(v,_){return!!(Aa&&v.hasChildNodes()&&!xn(v.firstElementChild)&&zt(Xm,v.textContent)&&zt(Xm,v.innerHTML)||Aa&&v.namespaceURI===sa&&by[_]&&(xn(v.firstElementChild)||typeof v.textContent=="string"&&zt(jy[_],v.textContent))||v.nodeType===Pt.processingInstruction||Aa&&v.nodeType===Pt.comment&&zt(Qm,v.data))},St=function(v,_){if(v instanceof RegExp)return zt(v,_);if(v instanceof Function){for(var Q=arguments.length,ne=new Array(Q>2?Q-2:0),se=2;se<Q;se++)ne[se-2]=arguments[se];return!!v(_,...ne)}return!1},ys=function(v,_,Q){if(!qa[_]&&Za(_)&&St(Yt.tagNameCheck,_))return!1;if(ms&&!ya[_]){const ne=T(v),se=X(v);if(se&&ne){const oe=se.length;for(let Be=oe-1;Be>=0;--Be){const Ve=v===Q?M(se[Be],!0):se[Be];ne.insertBefore(Ve,K(v))}}}return ba(v),!0},bs=function(v,_,Q,ne){return v.length===0?_:_===Q||_===ne?ea(_):_},Al=function(v,_){return v===_||T(v)!==null?!1:(on&&Jn(v),!0)},Qa=function(v,_){if(Dt(F.beforeSanitizeElements,v,null),Al(v,_))return!0;if(_l(v))return ba(v),!0;const Q=et(W(v));if(Oe=bs(F.uponSanitizeElement,Oe,Xn,Qn),Dt(F.uponSanitizeElement,v,{tagName:Q,allowedTags:Oe}),Al(v,_))return!0;if(Fc(v,Q))return ba(v),!0;if(qa[Q]||!(aa.tagCheck instanceof Function&&aa.tagCheck(Q))&&!Oe[Q]){const se=ys(v,Q,_);return se===!1&&Dt(F.afterSanitizeElements,v,null),se}if(H(v)===Pt.element&&!Ai(v)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&zt(vy,v.innerHTML))return ba(v),!0;if(xa&&v.nodeType===Pt.text){const se=Nt(v.textContent);v.textContent!==se&&(hi(c.removed,{element:v.cloneNode()}),v.textContent=se)}return Dt(F.afterSanitizeElements,v,null),!1},js=function(v,_,Q){if(bl[_]||Ri(_,v)||Ct&&(_==="id"||_==="name")&&(Q in o||Q in _i))return!1;const ne=Ye[_]||aa.attributeCheck instanceof Function&&aa.attributeCheck(_,v);return fs&&zt(mt,_)||Si&&zt($,_)?!0:ne?Ei[_]||zt(ta,mi(Q,Ge,""))||(_==="src"||_==="xlink:href"||_==="href")&&v!=="script"&&Um(Q,"data:")===0&&Zn[v]||At&&!zt(Re,mi(Q,Ge,""))?!0:!Q:Za(v)&&St(Yt.tagNameCheck,v)&&St(Yt.attributeNameCheck,_,v)||_==="is"&&Yt.allowCustomizedBuiltInElements&&St(Yt.tagNameCheck,Q)},zi=De({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Za=function(v){return!zi[xi(v)]&&zt(We,v)},Wc=function(v,_,Q,ne){if(ee&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!Q)switch(E.getAttributeType(v,_)){case"TrustedHTML":return nt(ne);case"TrustedScriptURL":return U(ne)}return ne},Oi=function(v,_,Q,ne){try{Q?v.setAttributeNS(Q,_,ne):v.setAttribute(_,ne),_l(v)?ba(v):Dm(c.removed)}catch{Xa(_,v)}},Ns=function(v){Dt(F.beforeSanitizeAttributes,v,null);const _=v.attributes;if(!_||_l(v))return;Ye=bs(F.uponSanitizeAttribute,Ye,os,jl);const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ye,forceKeepAttr:void 0};let ne=_.length;const se=et(v.nodeName);for(;ne--;){const oe=_[ne],Be=oe.name,Ve=oe.namespaceURI,wt=oe.value,rt=et(Be),Qt=wt;let gt=Be==="value"?Qt:ey(Qt);if(Q.attrName=rt,Q.attrValue=gt,Q.keepAttr=!0,Q.forceKeepAttr=void 0,Dt(F.uponSanitizeAttribute,v,Q),gt=Q.attrValue,ki&&(rt==="id"||rt==="name")&&Um(gt,Ti)!==0&&(Xa(Be,v,oe),gt=Ti+gt),Aa&&zt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,gt)){Xa(Be,v,oe);continue}if(rt==="attributename"&&Mm(gt,"href")){Xa(Be,v,oe);continue}if(!Q.forceKeepAttr){if(!Q.keepAttr){Xa(Be,v,oe);continue}if(!wi&&zt(yy,gt)){Xa(Be,v,oe);continue}if(xa&&(gt=Nt(gt)),!js(se,rt,gt)){Xa(Be,v,oe);continue}gt=Wc(se,rt,Ve,gt),gt!==Qt&&Oi(v,Be,Ve,gt)}}Dt(F.afterSanitizeAttributes,v,null)},vn=function(v){let _=null;const Q=ca(v);for(Dt(F.beforeSanitizeShadowDOM,v,null);_=Q.nextNode();)if(Dt(F.uponSanitizeShadowNode,_,null),Qa(_,v),Ns(_),Oa(_.content)&&vn(_.content),H(_)===Pt.element){const ne=le(_);Oa(ne)&&(Ss(ne),vn(ne))}Dt(F.afterSanitizeShadowDOM,v,null)},Ss=function(v){const _=[{node:v,shadow:null}];for(;_.length>0;){const Q=_.pop();if(Q.shadow){vn(Q.shadow);continue}const ne=Q.node,oe=H(ne)===Pt.element,Be=X(ne);if(Be)for(let Ve=Be.length-1;Ve>=0;--Ve)_.push({node:Be[Ve],shadow:null});if(oe){const Ve=I?I(ne):null;if(typeof Ve=="string"&&et(Ve)==="template"){const wt=ne.content;Oa(wt)&&_.push({node:wt,shadow:null})}}if(oe){const Ve=le(ne);Oa(Ve)&&_.push({node:null,shadow:Ve},{node:Ve,shadow:null})}}};return c.sanitize=function(J){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=null,Q=null,ne=null,se=null;if(Nl=!J,Nl&&(J="<!-->"),typeof J!="string"&&!xn(J)&&(J=sy(J),typeof J!="string"))throw hl("dirty is not a string, aborting");if(!c.isSupported)return J;ds?(Oe=Qn,Ye=jl):Vn(v),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(Oe=ea(Oe)),F.uponSanitizeAttribute.length>0&&(Ye=ea(Ye)),c.removed=[];const oe=on&&typeof J!="string"&&xn(J);if(oe){Tl(J);const wt=W(J);if(typeof wt=="string"){const rt=et(wt);if(!Oe[rt]||qa[rt])throw ja(J),hl("root node is forbidden and cannot be sanitized in-place")}if(_l(J))throw ja(J),hl("root node is clobbered and cannot be sanitized in-place");try{Ss(J)}catch(rt){throw ja(J),rt}}else if(xn(J))_=In("<!---->"),Q=_.ownerDocument.importNode(J,!0),Q.nodeType===Pt.element&&Q.nodeName==="BODY"||Q.nodeName==="HTML"?_=Q:_.appendChild(Q),Ss(Q);else{if(!la&&!xa&&!na&&J.indexOf("<")===-1)return ee&&Xt?nt(J):J;if(_=In(J),!_)return la?null:Xt?ve:""}_&&hs&&ba(_.firstChild);const Be=oe?J:_;try{const wt=ca(Be);for(;ne=wt.nextNode();)Qa(ne,Be),Ns(ne),Oa(ne.content)&&vn(ne.content)}catch(wt){throw oe&&(ja(J),ml(c.removed,rt=>{rt.element&&Jn(rt.element)})),wt}if(oe)return ml(c.removed,wt=>{wt.element&&Jn(wt.element)}),xa&&El(J),J;if(la){if(xa&&El(_),yt)for(se=w.call(_.ownerDocument);_.firstChild;)se.appendChild(_.firstChild);else se=_;return(Ye.shadowroot||Ye.shadowrootmode)&&(se=te.call(u,se,!0)),se}let Ve=na?_.outerHTML:_.innerHTML;return na&&Oe["!doctype"]&&_.ownerDocument&&_.ownerDocument.doctype&&_.ownerDocument.doctype.name&&zt(gy,_.ownerDocument.doctype.name)&&(Ve="<!DOCTYPE "+_.ownerDocument.doctype.name+`>
76
- `+Ve),xa&&(Ve=Nt(Ve)),ee&&Xt?nt(Ve):Ve},c.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vn(J),ds=!0,Qn=Oe,jl=Ye},c.clearConfig=function(){mn=null,ds=!1,Qn=null,jl=null,ee=ge,ve=""},c.isValidAttribute=function(J,v,_){mn||Vn({});const Q=et(J),ne=et(v);return js(Q,ne,_)},c.addHook=function(J,v){typeof v=="function"&&Gt(F,J)&&hi(F[J],v)},c.removeHook=function(J,v){if(Gt(F,J)){if(v!==void 0){const _=Wv(F[J],v);return _===-1?void 0:Pv(F[J],_,1)[0]}return Dm(F[J])}},c.removeHooks=function(J){Gt(F,J)&&(F[J]=[])},c.removeAllHooks=function(){F=Zm()},c}var vl=yp();const wy=[{id:"claude",label:"claude",hint:"Claude Code via ACP"},{id:"codex",label:"codex",hint:"Codex (ChatGPT) via ACP"},{id:"pi",label:"pi",hint:"pi coding agent"}];async function us(i,c){const u=await(await fetch("/api/chats",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agent:i,scope:c})})).json();u.id&&ga(u.scope?.kind==="team"?`/agents/${encodeURIComponent(u.scope.member)}/chat/${u.id}`:`/agents/chats/${u.id}`)}function ky(){const[i,c]=C.useState("claude"),[o,u]=C.useState(!0),[f,h]=C.useState(!1);return l.jsxs("div",{className:"new-chat",children:[l.jsx("div",{className:"page-head",children:l.jsx("h1",{children:"new chat"})}),l.jsxs("section",{className:"panel new-chat-panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"agent"})}),l.jsx("div",{className:"agent-pick",children:wy.map(m=>l.jsxs("button",{className:`agent-pick-btn ${i===m.id?"active":""}`,onClick:()=>c(m.id),children:[l.jsx("b",{children:m.label}),l.jsx("span",{children:m.hint})]},m.id))}),l.jsx("div",{className:"run-opts",style:{padding:"0 16px 14px"},children:l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:o,onChange:m=>u(m.target.checked)}),"kraftwerk-aware",l.jsx("span",{className:"opt-hint",children:"— agent gets workflows + recent runs as context"})]})}),l.jsx("div",{style:{padding:"0 16px 16px"},children:l.jsx("button",{className:"run-btn",disabled:f,onClick:async()=>{h(!0),await us(i,{kind:o?"kraftwerk":"general"}),h(!1)},children:f?"starting…":"start chat"})})]})]})}function Vm({id:i,agentName:c,agentDescription:o}){const[u,f]=C.useState(null),[h,m]=C.useState([]),[p,y]=C.useState(!1);C.useEffect(()=>{let E=!0,j=null;return fetch(`/api/chats/${i}`).then(M=>M.ok?M.json():Promise.reject()).then(M=>{if(!E)return;f(M.meta),m(M.events);const N=M.events[M.events.length-1]?.seq??0;j=new EventSource(`/api/chats/${i}/events?after=${N}`),j.onmessage=K=>{const X=JSON.parse(K.data);m(T=>T.some(le=>le.seq===X.seq)?T:[...T,X])}}).catch(()=>E&&y(!0)),()=>{E=!1,j?.close()}},[i]);const x=C.useMemo(()=>{for(let E=h.length-1;E>=0;E--){const j=h[E].type;if(j==="user_message")return!0;if(j==="turn_end"||j==="error")return!1}return!1},[h]),k=C.useMemo(()=>{if(u?.title)return u.title;const E=h.find(j=>j.type==="user_message");return E&&E.type==="user_message"?E.text.replace(/\s+/g," ").trim().slice(0,80):""},[u,h]);return C.useEffect(()=>{if(!u)return;const E=c??(u.scope.kind==="team"?u.scope.member:u.agent);return wm([E,o,k||"new chat"].filter(Boolean).join(" · ")),()=>wm("")},[u,k,c,o]),p?l.jsx("div",{className:"empty",children:"chat not found"}):u?l.jsxs("div",{className:"chat-thread",children:[l.jsxs("div",{className:"detail-head",children:[l.jsx("span",{className:`lamp ${x?"running":"ok"}`}),l.jsx("h1",{children:k||"new chat"}),l.jsx("span",{className:"chip agent",children:u.agent}),u.scope.kind==="run"&&l.jsx(Ee,{href:`/runs/${u.scope.runId}`,className:"chip",children:u.scope.runId}),u.scope.kind==="kraftwerk"&&l.jsx("span",{className:"chip",children:"kraftwerk-aware"}),u.scope.kind==="knowledge"&&l.jsxs(Ee,{href:u.scope.bundle?`/knowledge/${encodeURIComponent(u.scope.bundle)}`:"/knowledge",className:"chip",children:["knowledge",u.scope.bundle?`:${u.scope.bundle}`:""]}),u.scope.kind==="team"&&l.jsxs(Ee,{href:`/agents/${encodeURIComponent(u.scope.member)}/info`,className:"chip",children:["agent:",u.scope.member]}),l.jsx("span",{className:"rid",title:u.cwd,children:u.cwd})]}),l.jsx(Ey,{id:i,events:h,busy:x}),l.jsx(Ry,{id:i,busy:x,scope:u.scope})]}):l.jsx("div",{className:"empty",children:"loading…"})}function Ty(i){const c=[],o=new Map,u=new Map;for(const f of i){const h=c[c.length-1];switch(f.type){case"user_message":c.push({kind:"user",text:f.text,key:`e${f.seq}`});break;case"text":h?.kind==="agent"?h.text+=f.text:c.push({kind:"agent",text:f.text,key:`e${f.seq}`});break;case"thought":h?.kind==="thought"?h.text+=f.text:c.push({kind:"thought",text:f.text,key:`e${f.seq}`});break;case"tool_call":o.set(f.callId,c.length),c.push({kind:"tool",callId:f.callId,title:f.title,toolKind:f.kind,status:f.status,key:`e${f.seq}`});break;case"tool_update":{const m=o.get(f.callId);if(m!=null){const p=c[m];f.title&&(p.title=f.title),f.status&&(p.status=f.status)}break}case"permission_request":u.set(f.requestId,c.length),c.push({kind:"permission",requestId:f.requestId,title:f.title,options:f.options,resolved:void 0,key:`e${f.seq}`});break;case"permission_resolved":{const m=u.get(f.requestId);m!=null&&(c[m].resolved=f.optionId);break}case"error":c.push({kind:"error",text:f.message,key:`e${f.seq}`});break}}return c}function Ey({id:i,events:c,busy:o}){const u=Ba(),f=C.useMemo(()=>{const p=Ty(c);return u?p:p.filter(y=>y.kind!=="tool"&&y.kind!=="thought")},[c,u]),h=C.useRef(null),m=C.useRef(!0);return C.useEffect(()=>{const p=h.current;p&&m.current&&(p.scrollTop=p.scrollHeight)},[f,o]),l.jsxs("div",{className:"chat-scroll",ref:h,onScroll:p=>{const y=p.currentTarget;m.current=y.scrollHeight-y.scrollTop-y.clientHeight<60},children:[f.length===0&&l.jsx("div",{className:"empty",children:"say something — the agent starts on your first message"}),f.map(p=>l.jsx(Ay,{b:p,chatId:i},p.key)),o&&l.jsxs("div",{className:"chat-working",children:[l.jsx("span",{className:"lamp running"})," working…"]})]})}function _y({text:i}){const c=C.useMemo(()=>vl.sanitize(ze.parse(i,{async:!1})),[i]);return l.jsx("div",{className:"msg agent md-body chat-md",dangerouslySetInnerHTML:{__html:c}})}function Ay({b:i,chatId:c}){switch(i.kind){case"user":return l.jsx("div",{className:"msg user",children:i.text});case"agent":return l.jsx(_y,{text:i.text});case"thought":return l.jsxs("details",{className:"msg thought",children:[l.jsx("summary",{children:"thinking"}),l.jsx("div",{children:i.text})]});case"tool":return l.jsxs("div",{className:`tool-card ${i.status??""}`,children:[l.jsx("span",{className:`lamp ${i.status==="completed"?"ok":i.status==="failed"?"failed":"running"}`}),i.toolKind&&l.jsx("span",{className:"chip tool-kind",children:i.toolKind}),l.jsx("span",{className:"tool-title",children:i.title})]});case"permission":return l.jsx(Cy,{b:i,chatId:c});case"error":return l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",i.text]})}}function Cy({b:i,chatId:c}){const[o,u]=C.useState(!1),f=i.resolved===void 0;async function h(m){u(!0),await fetch(`/api/chats/${c}/permission`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({requestId:i.requestId,optionId:m})}).catch(()=>{}),u(!1)}return l.jsxs("div",{className:`perm-card ${f?"pending":""}`,children:[l.jsxs("div",{className:"perm-title",children:[l.jsx("span",{className:"microlabel",children:"permission"})," ",i.title]}),f?l.jsx("div",{className:"perm-actions",children:i.options.map(m=>l.jsx("button",{className:`perm-btn ${m.kind?.startsWith("allow")?"allow":"deny"}`,disabled:o,onClick:()=>h(m.optionId),children:m.name},m.optionId))}):l.jsx("div",{className:"perm-resolved",children:i.resolved?`→ ${i.options.find(m=>m.optionId===i.resolved)?.name??i.resolved}`:"→ dismissed"})]})}function Ry({id:i,busy:c,scope:o}){const[u,f]=C.useState(""),[h,m]=C.useState([]),[p,y]=C.useState(0),[x,k]=C.useState(!1);C.useEffect(()=>{let T=!0;return(async()=>{try{let fe=(await fetch("/api/skills").then(Z=>Z.json())).skills??[];if(o?.kind==="team"){const[Z,I]=await Promise.all([fetch(`/api/team/${encodeURIComponent(o.member)}`).then(W=>W.ok?W.json():null).catch(()=>null),fetch(`/api/team/${encodeURIComponent(o.member)}/skills`).then(W=>W.ok?W.json():null).catch(()=>null)]);if(Z&&Array.isArray(Z.skills)){const W=new Set(Z.skills.map(ee=>ee.toLowerCase()));fe=fe.filter(ee=>W.has(ee.name.toLowerCase()))}const q=I?.skills??[],H=new Set(q.map(W=>W.name.toLowerCase()));fe=[...q,...fe.filter(W=>!H.has(W.name.toLowerCase()))]}T&&m(fe)}catch{}})(),()=>{T=!1}},[i]);const E=/^\/([\w-]*)$/.exec(u)?.[1],j=E!==void 0&&!x?h.filter(T=>T.name.toLowerCase().startsWith(E.toLowerCase())):[],M=j.length>0,N=Math.min(p,j.length-1);function K(T){f(`/${T.name} `),y(0)}async function X(){const T=u.trim();!T||c||(f(""),await fetch(`/api/chats/${i}/message`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:T})}).catch(()=>{}))}return l.jsxs("div",{className:"composer",children:[M&&l.jsx("div",{className:"skill-menu",children:j.map((T,le)=>l.jsxs("button",{className:le===N?"active":"",onMouseDown:fe=>{fe.preventDefault(),K(T)},children:[l.jsxs("b",{children:["/",T.name]}),T.description&&l.jsxs("span",{children:[" — ",T.description]}),l.jsx("span",{className:"skill-src",children:T.source})]},T.name))}),l.jsx("textarea",{value:u,placeholder:c?"agent is working…":"message · Enter to send, Shift+Enter for newline, / for skills",rows:Math.min(6,Math.max(1,u.split(`
77
- `).length)),onChange:T=>{f(T.target.value),y(0),k(!1)},onKeyDown:T=>{if(M){if(T.key==="ArrowDown")return T.preventDefault(),y((N+1)%j.length);if(T.key==="ArrowUp")return T.preventDefault(),y((N-1+j.length)%j.length);if(T.key==="Tab"||T.key==="Enter")return T.preventDefault(),K(j[N]);if(T.key==="Escape")return T.preventDefault(),k(!0)}T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),X())}}),c?l.jsxs("button",{className:"stop-btn",onClick:()=>fetch(`/api/chats/${i}/cancel`,{method:"POST"}).catch(()=>{}),children:[l.jsx(V,{name:"stop",className:"ms-sm"})," stop"]}):l.jsxs("button",{className:"run-btn",disabled:!u.trim(),onClick:X,children:[l.jsx(V,{name:"send",className:"ms-sm"})," send"]})]})}function zy({id:i}){const c=He("/api/runs",!0),o=c?.runs??[];return l.jsxs("div",{className:"runs-screen",children:[l.jsxs("aside",{className:"runs-side",children:[l.jsxs("div",{className:"side-head",children:[l.jsx("span",{className:"microlabel",children:"runs"}),l.jsx("span",{className:"spacer"}),l.jsx("span",{className:"microlabel num",children:o.length})]}),l.jsxs("div",{className:"side-list",children:[o.map(u=>l.jsx(Oy,{r:u,active:u.id===i},u.id)),c&&o.length===0&&l.jsx("div",{className:"viewer-note",children:"no runs yet"})]})]}),l.jsx("div",{className:"runs-main",children:l.jsx(Dy,{id:i},i)})]})}function Oy({r:i,active:c}){return l.jsxs(Ee,{href:`/runs/${i.id}`,className:`side-row ${c?"active":""}`,children:[l.jsx(Jc,{status:i.status}),l.jsxs("div",{className:"side-row-body",children:[l.jsxs("div",{className:"side-row-top",children:[l.jsx("span",{className:"side-wf",children:i.workflow??"unknown"}),l.jsx("span",{className:"side-when num",children:gl(i.startedAt)})]}),l.jsxs("div",{className:"side-row-sub",children:[l.jsx("span",{className:"side-req",title:i.request,children:i.status==="running"&&i.currentPhase?`${i.currentPhase}`:i.request??""}),l.jsx("span",{className:"side-meta num",children:i.status==="running"?l.jsx(To,{since:i.startedAt}):bi(i.durationMs)})]})]})]})}function Dy({id:i}){const c=He(`/api/runs/${i}`,!0),o=c?.status==="running",[u,f]=C.useState(null),[h,m]=C.useState(!1),p=Ba();if(!c)return l.jsx("div",{className:"empty",children:"loading…"});const y=c.files.some(j=>j.name==="runner.json"),x=u??(o?"run":"artifacts"),k=p?c.files.length:c.files.filter(j=>!Kc(j.name)).length;async function E(){m(!0),await fetch(`/api/runs/${i}/stop`,{method:"POST"}).catch(()=>{})}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"detail-head",children:[l.jsx(Jc,{status:c.status}),l.jsx("h1",{children:c.workflow?l.jsx(Ee,{href:`/workflows/${encodeURIComponent(c.workflow)}`,title:"open workflow",children:c.workflow}):"unknown workflow"}),l.jsx(Zx,{status:c.status}),y&&l.jsxs("span",{className:"chip sandbox-chip",children:[l.jsx(V,{name:"science",className:"ms-sm"})," sandbox"]}),l.jsx("span",{className:"rid",children:i.replace(/^run-/,"")}),o&&y&&l.jsx("button",{className:"stop-btn",onClick:E,disabled:h,children:h?"stopping…":l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"stop",className:"ms-sm"})," stop"]})}),l.jsx("span",{className:"spacer"}),l.jsx("button",{className:"open-raw",title:"chat with an agent about this run",onClick:()=>{us("claude",{kind:"run",runId:i})},children:"⌬ discuss"}),l.jsxs("nav",{className:"tabs",children:[l.jsx("button",{className:x==="run"?"active":"",onClick:()=>f("run"),children:"run"}),l.jsxs("button",{className:x==="artifacts"?"active":"",onClick:()=>f("artifacts"),children:["artifacts ",l.jsxs("span",{className:"num",children:["(",k,")"]})]})]})]}),c.request&&l.jsx("p",{className:"detail-req",children:c.request}),x==="run"?l.jsx(My,{run:c,live:o}):l.jsx(By,{id:i,files:c.files,live:o})]})}function My({run:i,live:c}){return l.jsxs("div",{className:"run-tab",children:[l.jsxs("div",{className:"statgrid",children:[l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"phases"}),l.jsxs("div",{className:"v num",children:[i.phasesDone,i.phasesTotal!=null?` / ${i.phasesTotal}`:""]})]}),l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"duration"}),l.jsx("div",{className:"v num",children:c?l.jsx(To,{since:i.startedAt}):bi(i.durationMs)})]}),l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"cost"}),l.jsx("div",{className:"v num",children:wo(i.costUsd??Uy(i.phases))})]}),l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"tokens in / out"}),l.jsxs("div",{className:"v num",children:[Xc(Km(i.phases,"tokensIn"))," / ",Xc(Km(i.phases,"tokensOut"))]})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"phase timeline"}),l.jsx("span",{className:"spacer"}),c&&l.jsxs("span",{className:"live-note",children:[l.jsx("span",{className:"lamp running"})," live · polling"]})]}),l.jsx("div",{className:"phases",children:i.phases.map(o=>l.jsx(Ly,{p:o},o.phase))})]})]})}function Km(i,c){return i.reduce((o,u)=>o+(u[c]??0),0)}function Uy(i){return i.reduce((c,o)=>c+(o.costUsd??0),0)}function Ly({p:i}){const c=i.gates.filter(o=>!o.passed);return l.jsxs("div",{className:"phase-row",children:[l.jsx(Jc,{status:i.status}),l.jsxs("div",{className:"phase-top",children:[l.jsx("span",{className:"phase-name",children:i.phase}),i.kind==="agent"?l.jsxs("span",{className:"chip agent",children:[i.agent,i.model?` · ${i.model}`:""]}):l.jsx("span",{className:"chip",children:"script"}),l.jsxs("span",{className:"right num",children:[i.attempts>1&&l.jsxs("span",{children:["att ",i.attempts]}),i.status==="running"?l.jsx(To,{since:i.startedAt}):i.durationMs!=null&&l.jsx("span",{children:bi(i.durationMs)}),i.kind==="agent"&&i.tokensIn!=null&&l.jsxs("span",{children:[Xc(i.tokensIn)," / ",Xc(i.tokensOut)]}),i.costUsd!=null&&i.costUsd>0&&l.jsx("span",{children:wo(i.costUsd)})]})]}),i.status==="running"&&i.lastActivity&&l.jsx("div",{className:"phase-activity",children:i.lastActivity}),i.summary&&i.status!=="running"&&l.jsx("div",{className:"phase-sub",children:i.summary}),i.gates.length>0&&l.jsx("div",{className:"gate-line",children:i.gates.map(o=>l.jsxs("span",{className:`gate ${o.passed?"":"failed"}`,title:o.failure??"",children:[l.jsx(V,{name:o.passed?"check":"close",className:"ms-sm"})," ",o.gate]},o.gate))}),c.map(o=>l.jsx("div",{className:"gate-fail-msg",children:o.failure},o.gate))]})}const bp=new Set(["png","jpg","jpeg","gif","webp","svg"]);function Kc(i){return i==="runner.json"||i.endsWith(".jsonl")||i.endsWith(".log")}function Hy(i){const o=["report.html","recommendation.md"].find(h=>i.some(m=>m.name===h));if(o)return o;const u=h=>{const m=h.split(".").pop()?.toLowerCase()??"";return["html","md","markdown","pdf"].includes(m)||bp.has(m)?0:Kc(h)?2:1};let f=null;for(const h of i)(!f||u(h.name)<u(f.name))&&(f=h);return f?.name??null}function By({id:i,files:c,live:o}){const[u,f]=C.useState(null),h=Ba(),m=C.useMemo(()=>h?c:c.filter(p=>!Kc(p.name)),[c,h]);return C.useEffect(()=>{!h&&u&&Kc(u)&&f(null)},[h,u]),C.useEffect(()=>{u||m.length===0||f(Hy(m))},[m,u]),l.jsxs("div",{className:"art-layout",children:[l.jsxs("section",{className:"panel art-files",children:[l.jsx("div",{className:"panel-head",children:l.jsxs("span",{className:"microlabel",children:["files ",l.jsxs("span",{className:"num",children:["(",m.length,")"]})]})}),l.jsxs("div",{className:"file-list",children:[m.map(p=>l.jsxs("button",{className:`file-row ${u===p.name?"active":""}`,onClick:()=>f(p.name),children:[l.jsx("span",{className:"fname",children:p.name}),l.jsx("span",{className:"fsize num",children:ko(p.size)})]},p.name)),m.length===0&&l.jsx("div",{className:"viewer-note",children:c.length>0?"no result files — raw run files live in expert mode":"no files yet"})]})]}),l.jsxs("section",{className:"panel art-viewer",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:u??"viewer"}),l.jsx("span",{className:"spacer"}),u&&l.jsx("a",{className:"open-raw",href:`/api/runs/${i}/file?name=${encodeURIComponent(u)}&raw=1`,target:"_blank",children:"open raw ↗"})]}),u?l.jsx(qy,{id:i,name:u,live:o}):l.jsx("div",{className:"empty",children:"select a file"})]})]})}function qy({id:i,name:c,live:o}){const u=c.split(".").pop()?.toLowerCase()??"",f=`/api/runs/${i}/file?name=${encodeURIComponent(c)}&raw=1`;return u==="html"?l.jsx("div",{className:"viewer",children:l.jsx("div",{className:"viewer-body",children:l.jsx("iframe",{src:f,sandbox:"allow-scripts",allow:"clipboard-write",title:c})})}):u==="pdf"?l.jsx("div",{className:"viewer",children:l.jsx("div",{className:"viewer-body",children:l.jsx("iframe",{src:f,title:c})})}):bp.has(u)?l.jsx("div",{className:"viewer",children:l.jsx("div",{className:"viewer-body",children:l.jsx("img",{src:f,alt:c})})}):u==="md"||u==="markdown"?l.jsx($y,{id:i,name:c,live:o}):l.jsx(Gy,{id:i,name:c,live:o})}function $y({id:i,name:c,live:o}){const[u,f]=C.useState("rendered"),h=He(`/api/runs/${i}/file?name=${encodeURIComponent(c)}`,o),m=C.useMemo(()=>h?vl.sanitize(ze.parse(h.content,{async:!1})):"",[h?.content]);return l.jsxs("div",{className:"viewer",children:[l.jsxs("div",{className:"viewer-note md-toolbar",children:[l.jsxs("div",{className:"tabs",children:[l.jsx("button",{className:u==="rendered"?"active":"",onClick:()=>f("rendered"),children:"rendered"}),l.jsx("button",{className:u==="source"?"active":"",onClick:()=>f("source"),children:"source"})]}),h?.truncated&&l.jsxs("span",{children:["large file — showing the last ",ko(4e5)]})]}),l.jsx("div",{className:"viewer-body",children:h?u==="rendered"?l.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:m}}):l.jsx("pre",{children:h.content||"(empty)"}):l.jsx("pre",{children:"loading…"})})]})}function Gy({id:i,name:c,live:o}){const u=He(`/api/runs/${i}/file?name=${encodeURIComponent(c)}`,o);return l.jsxs("div",{className:"viewer",children:[u?.truncated&&l.jsxs("div",{className:"viewer-note",children:["large file — showing the last ",ko(4e5)]}),l.jsx("div",{className:"viewer-body",children:l.jsx("pre",{children:u?u.content||"(empty)":"loading…"})})]})}function Yy(){const i=He("/api/workflows",!1),c=i?.workflows??[];return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"page-head",children:[l.jsx("h1",{children:"Workflows"}),l.jsxs("span",{className:"count num",children:[c.length," discovered"]}),i?.root&&l.jsx("span",{className:"count mono",children:i.root})]}),i&&c.length===0&&l.jsxs("div",{className:"empty",children:["No workflows found — expected ",l.jsx("code",{children:"src/workflows/"})," or ",l.jsx("code",{children:"workflows/"})," ","next to the output folder."]}),l.jsx("div",{className:"wf-grid",children:c.map(o=>l.jsxs(Ee,{href:`/workflows/${o.slug}`,className:"wf-card",children:[l.jsxs("div",{className:"wf-card-head",children:[l.jsx("span",{className:"wf-name",children:o.name??o.slug}),o.error&&l.jsx("span",{className:"status-word failed",children:"broken"})]}),l.jsx("p",{className:"wf-desc",children:o.error??o.description??""}),l.jsxs("div",{className:"wf-meta num",children:[l.jsxs("span",{children:[o.agents," agents"]}),l.jsx("span",{children:"·"}),l.jsxs("span",{children:[o.steps," steps"]})]})]},o.slug))})]})}function Xy({slug:i}){const c=He(`/api/workflows/${encodeURIComponent(i)}`,!1),o=He("/api/runs",!1);if(!c)return l.jsx("div",{className:"empty",children:"loading…"});if(c.error)return l.jsxs(l.Fragment,{children:[l.jsx(Jm,{slug:c.slug}),l.jsxs("div",{className:"empty",children:[l.jsx("span",{className:"status-word failed",children:"broken workflow"}),l.jsx("pre",{style:{marginTop:12,textAlign:"left"},children:c.error})]})]});const u=new Map(c.agents.map((h,m)=>[h.id,m%4])),f=(o?.runs??[]).filter(h=>h.workflow===c.name).slice(0,8);return l.jsxs(l.Fragment,{children:[l.jsx(Jm,{slug:c.slug}),l.jsxs("div",{className:"detail-head",children:[l.jsx("h1",{children:c.name??c.slug}),l.jsx("span",{className:"rid mono",children:c.dir})]}),c.description&&l.jsx("p",{className:"detail-req",children:c.description}),l.jsxs("div",{className:"statgrid",children:[l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"agents"}),l.jsx("div",{className:"v num",children:c.agents.length})]}),l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"steps"}),l.jsxs("div",{className:"v num",children:[c.steps.length," ",l.jsxs("span",{style:{color:"var(--muted)",fontWeight:400},children:["(",c.steps.filter(h=>h.kind==="agent").length," agent ·"," ",c.steps.filter(h=>h.kind==="script").length," script)"]})]})]}),c.workspace&&l.jsxs("div",{className:"stat",style:{maxWidth:420},children:[l.jsx("div",{className:"microlabel",children:"workspace"}),l.jsx("div",{className:"wf-workspace mono",children:c.workspace})]})]}),l.jsx(Qy,{slug:c.slug,lastRequest:f[0]?.request}),l.jsxs("section",{className:"panel",style:{marginBottom:18},children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"agents"})}),l.jsxs("div",{className:"agent-grid",children:[c.agents.map(h=>l.jsx(Zy,{a:h,idx:u.get(h.id)??0},h.id)),c.agents.length===0&&l.jsx("div",{className:"viewer-note",children:"no agents — script-only workflow"})]})]}),l.jsxs("div",{className:"columns",children:[l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"pipeline"})}),l.jsx("div",{className:"pipeline",children:c.steps.map((h,m)=>l.jsx(Vy,{s:h,i:m,idx:h.agent?u.get(h.agent)??0:null},h.name))})]}),l.jsxs("div",{style:{display:"grid",gap:18},children:[l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsxs("span",{className:"microlabel",children:["folder ",l.jsxs("span",{className:"num",children:["(",c.files.length," files)"]})]})}),l.jsx("div",{className:"file-list",children:c.files.map(h=>l.jsx("div",{className:"file-row",style:{cursor:"default"},children:l.jsx("span",{className:"fname",children:h})},h))})]}),l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsxs("span",{className:"microlabel",children:["recent runs ",l.jsxs("span",{className:"num",children:["(",f.length,")"]})]})}),l.jsxs("div",{className:"file-list",children:[f.map(h=>l.jsxs(Ee,{href:`/runs/${h.id}`,className:"file-row",children:[l.jsx(Jc,{status:h.status}),l.jsx("span",{className:"fname",children:h.id.replace(/^run-/,"")}),l.jsxs("span",{className:"fsize num",children:[bi(h.durationMs)," · ",wo(h.costUsd)," · ",gl(h.startedAt)]})]},h.id)),f.length===0&&l.jsx("div",{className:"viewer-note",children:"no runs of this workflow yet"})]})]})]})]})]})}function Qy({slug:i,lastRequest:c}){const[o,u]=C.useState(""),[f,h]=C.useState(!0),[m,p]=C.useState(!1),[y,x]=C.useState(!1),[k,E]=C.useState(null),j=He(`/api/workflows/${encodeURIComponent(i)}/run`,!1);C.useEffect(()=>{!o&&c&&u(c)},[c]);const M=j?.available&&j?.image,N=j?j.available?j.image?"isolated container per run":"image missing — run `kraftwerk runner build`":"Docker not running — sandbox unavailable":"";async function K(){if(!(!o.trim()||y)){x(!0),E(null);try{const X=await fetch(`/api/workflows/${encodeURIComponent(i)}/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({request:o.trim(),sandbox:f,ssh:m})}),T=await X.json();if(!X.ok)throw new Error(T.error??`HTTP ${X.status}`);ga(`/runs/${T.runId}`)}catch(X){E(X.message),x(!1)}}}return l.jsxs("section",{className:"panel run-panel",style:{marginBottom:18},children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"trigger run"})}),l.jsxs("div",{className:"run-form",children:[l.jsx("input",{type:"text",value:o,placeholder:"request — topic, URL, host …",onChange:X=>u(X.target.value),onKeyDown:X=>X.key==="Enter"&&K()}),l.jsx("button",{className:"run-btn",onClick:K,disabled:y||!o.trim()||f&&!M,children:y?"starting…":l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"play_arrow",className:"ms-sm"})," ",f?"run in sandbox":"run locally"]})})]}),l.jsxs("div",{className:"run-opts",children:[l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:f,onChange:X=>h(X.target.checked)}),"docker sandbox ",N&&l.jsxs("span",{className:"opt-hint",children:["— ",N]})]}),l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:m,onChange:X=>p(X.target.checked),disabled:!f}),"forward SSH agent"]})]}),k&&l.jsx("div",{className:"gate-fail-msg",children:k})]})}function Jm({slug:i}){return l.jsxs("nav",{className:"crumbs",children:[l.jsx(Ee,{href:"/workflows",children:"workflows"}),l.jsx("span",{className:"sep",children:"/"}),l.jsx("span",{className:"mono",children:i})]})}function Zy({a:i,idx:c}){return l.jsxs("div",{className:`agent-card aid-${c}`,children:[l.jsxs("div",{className:"agent-head",children:[l.jsx("span",{className:"agent-dot"}),l.jsx("b",{children:i.name??i.id}),l.jsxs("code",{className:"agent-id",children:["[",i.id,"]"]}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"chip",children:[i.model??"default",i.effort?` · ${i.effort}`:""]})]}),i.tools.length>0&&l.jsx("div",{className:"agent-tools",children:i.tools.map(o=>l.jsx("span",{className:"tool-chip",children:o},o))}),i.persona&&l.jsx("p",{className:"agent-persona",children:i.persona})]})}function Vy({s:i,i:c,idx:o}){const u=i.kind==="script"?i.script:i.prompt;return l.jsxs("div",{className:"step-node",children:[l.jsx("div",{className:`step-index num ${o!=null?`aid-${o}`:"is-script"}`,children:c+1}),l.jsxs("div",{className:"step-body",children:[l.jsxs("div",{className:"phase-top",children:[l.jsx("span",{className:"phase-name",children:i.name}),i.kind==="agent"?l.jsxs("span",{className:`chip agent-chip aid-${o??0}`,children:["agent · ",i.agent]}):l.jsxs("span",{className:"chip",children:["script",i.sourceRef?` · ${i.sourceRef}`:""]})]}),u&&l.jsxs("details",{className:"step-source",children:[l.jsx("summary",{children:i.kind==="agent"?"prompt":"script"}),l.jsx("pre",{children:u})]}),i.gates.length>0&&l.jsx("div",{className:"gate-line",children:i.gates.map(f=>l.jsxs("span",{className:"gate neutral",children:["⛨ ",f]},f))})]})]})}const Ky=i=>i==="ok"?"ok":i==="running"?"running":i==="aborted"?"aborted":"failed",Jy=i=>i==="ok"?"done":i==="running"?"working":i==="aborted"?"stopped":"failed";function Iy(i){return i.scope.kind==="team"?`/agents/${i.scope.member}/chat/${i.id}`:`/agents/chats/${i.id}`}function Im(i){switch(i.scope.kind){case"team":return i.scope.member;case"run":return i.scope.runId;case"knowledge":return i.scope.bundle?`knowledge:${i.scope.bundle}`:"knowledge";case"kraftwerk":return"kraftwerk-aware";default:return"general"}}function Fm(i){return i.length>64?`${i.slice(0,46)}…${i.slice(-14)}`:i}function Fy(){const i=He("/api/runs",!1),c=He("/api/chats",!1),o=He("/api/knowledge",!1),u=He("/api/team",!1),f=He("/api/workflows",!1),h=He("/api/skills",!1),m=He("/api/meta",!1),[p,y]=C.useState("all"),x=i?.runs??[],k=c?.chats??[],E=o?.bundles??[],j=(h?.skills??[]).filter(K=>K.source==="workspace"),M=[[f?.workflows.length,"workflows","/workflows"],[i?x.length:void 0,"runs","/runs"],[o?E.length:void 0,"bundles","/knowledge"],[h?j.length:void 0,"skills","/skills"],[c?k.length:void 0,"chats","/agents/chats"]],N=x.filter(K=>K.status==="failed"&&Date.now()-Date.parse(K.updatedAt)<24*36e5);return l.jsxs("div",{className:"dash",children:[l.jsxs("div",{className:"page-head",children:[l.jsxs("h1",{children:[m?.projectIcon?`${m.projectIcon} `:"",m?.projectName||"workspace"]}),l.jsx("span",{className:"spacer"}),l.jsx("span",{className:"dash-mini",children:M.map(([K,X,T])=>l.jsxs(Ee,{href:T,children:[l.jsx("b",{className:"num",children:K??"…"})," ",X]},X))}),l.jsx(Wy,{workflows:f?.workflows??[]})]}),l.jsx(Py,{members:u?.members.filter(K=>!K.archived),chats:k}),N.length>0&&p!=="failed"&&l.jsxs("button",{className:"dash-alert",onClick:()=>y("failed"),children:["⚠ ",N.length," run",N.length===1?"":"s"," failed in the last 24 h — review"]}),l.jsx(ab,{runs:x,chats:k,bundles:E,members:u?.members??[],workflows:f?.workflows??[],filter:p,setFilter:y})]})}function Wy({workflows:i}){const[c,o]=C.useState(!1);return C.useEffect(()=>{if(!c)return;const u=f=>{f.target.closest(".wf-pick-wrap")||o(!1)};return window.addEventListener("mousedown",u),()=>window.removeEventListener("mousedown",u)},[c]),l.jsxs("div",{className:"dash-actions",children:[l.jsxs("button",{className:"run-btn dash-newchat",onClick:()=>ga("/agents/chats"),children:[l.jsx(V,{name:"forum"})," new chat"]}),l.jsxs("span",{className:"wf-pick-wrap",children:[l.jsxs("button",{className:"run-btn tonal","aria-haspopup":"menu","aria-expanded":c,onClick:()=>o(u=>!u),children:[l.jsx(V,{name:"play_arrow"})," run workflow"]}),c&&l.jsxs("div",{className:"wf-pick-pop",role:"menu",children:[i.length===0&&l.jsx("span",{className:"wf-pick-empty",children:"no workflows yet"}),i.map(u=>l.jsxs(Ee,{href:`/workflows/${encodeURIComponent(u.slug)}`,className:"wf-pick-item",role:"menuitem",children:[l.jsx("span",{className:"wf-pick-name",children:u.name??u.slug}),u.description&&l.jsx("span",{className:"wf-pick-desc",children:u.description})]},u.slug))]})]})]})}function Py({members:i,chats:c}){const o=Ba();return i&&i.length===0?l.jsx("section",{className:"panel dash-team-empty",children:l.jsx("div",{className:"viewer-note",children:o?l.jsxs(l.Fragment,{children:["No agent teammates yet — ",l.jsx(Ee,{href:"/agents/new",children:"create your first agent"})," and it will show up here, ready to chat."]}):l.jsx(l.Fragment,{children:"No agent teammates yet — ask an expert-mode user to create one."})})}):l.jsx("div",{className:"dash-team",children:(i??[]).map(u=>{const h=c.filter(p=>p.scope.kind==="team"&&p.scope.member===u.slug).find(p=>p.busy),m=()=>ga(`/agents/${encodeURIComponent(u.slug)}`);return l.jsxs("div",{className:"dash-member",role:"link",tabIndex:0,onClick:m,onKeyDown:p=>{p.key==="Enter"&&m()},children:[l.jsxs("div",{className:"dash-member-id",children:[l.jsxs("span",{className:"agent-avatar lg",children:[l.jsx("span",{"aria-hidden":!0,children:u.emoji}),l.jsx("span",{className:`lamp ${h?"running":"idle"}`})]}),l.jsx("span",{className:"dash-member-name",children:u.name}),u.description&&l.jsx("span",{className:"dash-member-desc",children:u.description})]}),l.jsxs("div",{className:"dash-member-foot",children:[l.jsx("span",{className:"dash-member-state",children:h&&l.jsx(Ee,{href:`/agents/${encodeURIComponent(u.slug)}/chat/${h.id}`,onClick:p=>p.stopPropagation(),children:"working…"})}),l.jsxs("button",{className:"run-btn dash-chat-btn",onClick:p=>{p.stopPropagation(),us("claude",{kind:"team",member:u.slug})},children:[l.jsx(V,{name:"chat_bubble",className:"ms-sm"})," chat"]})]})]},u.slug)})})}function eb(i){if(i.lamp==="running")return"now";const c=new Date(i.at),o=new Date;if(c.toDateString()===o.toDateString())return"today";const u=new Date(o);return u.setDate(u.getDate()-1),c.toDateString()===u.toDateString()?"yesterday":"earlier"}const tb=[["all","all"],["run","runs"],["session","chats"],["knowledge","knowledge"]];function ab({runs:i,chats:c,bundles:o,members:u,workflows:f,filter:h,setFilter:m}){const p=Ba(),y=C.useMemo(()=>{const k=[],E=M=>M?f.find(N=>N.slug===M)?.name??M:void 0;for(const M of i)k.push({at:M.updatedAt,kind:"run",emoji:"⚙️",title:E(M.workflow)??M.id,sub:M.request??"",href:`/runs/${M.id}`,lamp:Ky(M.status),status:Jy(M.status)});for(const M of c){const N=M.scope.kind==="team"?u.find(K=>M.scope.kind==="team"&&K.slug===M.scope.member):void 0;k.push({at:M.updatedAt,kind:"session",emoji:N?N.emoji||"🤖":"💬",title:N?N.name:M.title||"new chat",sub:N?`${M.title||"new chat"}${p?` · ${M.agent}`:""}`:p?`${M.agent} · ${Im(M)}`:Im(M),href:Iy(M),lamp:M.busy?"running":"ok",status:M.busy?"working":void 0})}for(const M of o)M.updatedAt&&k.push({at:M.updatedAt,kind:"knowledge",emoji:"📚",title:M.name,sub:`${M.concepts} concepts`,href:`/knowledge/${encodeURIComponent(M.name)}`,lamp:"ok"});return(h==="all"?k:h==="failed"?k.filter(M=>M.kind==="run"&&M.lamp==="failed"):k.filter(M=>M.kind===h)).sort((M,N)=>{const K=+(N.lamp==="running")-+(M.lamp==="running");return K!==0?K:N.at.localeCompare(M.at)}).slice(0,15)},[i,c,o,u,p,h]);let x="";return l.jsxs("section",{className:"panel dash-feed",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"activity"}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"dash-feed-filter",children:[tb.map(([k,E])=>l.jsx("button",{className:`feed-chip ${h===k?"on":""}`,onClick:()=>m(k),children:E},k)),h==="failed"&&l.jsxs("button",{className:"feed-chip on failed",onClick:()=>m("all"),children:["failed ",l.jsx(V,{name:"close",className:"ms-sm"})]})]})]}),y.length===0?l.jsx("div",{className:"viewer-note",children:h==="all"?"nothing yet — run a workflow or start a session":"nothing here for this filter"}):l.jsx("div",{className:"m3-list",children:y.map(k=>{const E=eb(k),j=E!==x?E:null;return x=E,l.jsxs("div",{className:"feed-group",children:[j&&l.jsx("div",{className:"feed-day microlabel",children:j}),l.jsxs(Ee,{href:k.href,className:"m3-row m3-link",children:[l.jsxs("span",{className:"agent-avatar",children:[l.jsx("span",{"aria-hidden":!0,children:k.emoji}),k.lamp==="running"&&l.jsx("span",{className:"lamp running"})]}),l.jsx("span",{className:`chip dash-kind ${k.kind}`,children:k.kind==="session"?"chat":k.kind}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:Fm(k.title)}),k.sub&&l.jsx("span",{className:"m3-sub",children:Fm(k.sub)})]}),k.status&&l.jsx("span",{className:`chip status ${k.lamp}`,children:k.status}),l.jsx("span",{className:"side-when num",title:new Date(k.at).toLocaleString(),children:yi(k.at)}),l.jsx("span",{className:"m3-chev",children:l.jsx(V,{name:"chevron_right"})})]})]},`${k.kind}:${k.href}:${k.at}`)})})]})}async function Mo(i,c){const o=window.open("","_blank");if(!o)return;const u=c?`${i}/${c}`:i;o.document.write(`<title>${Ta(u)}</title><body style="font-family:system-ui;padding:40px;color:#555">preparing ${Ta(u)}…</body>`);const f=N=>`/api/knowledge/${encodeURIComponent(i)}/concept?id=${encodeURIComponent(N)}`;let h,m="";try{const[N,K]=await Promise.all([c?Promise.resolve([c]):fetch(`/api/knowledge/${encodeURIComponent(i)}`).then(X=>X.json()).then(X=>X.concepts.map(T=>T.id)),fetch("/api/meta").then(X=>X.json()).catch(()=>({}))]);if(m=K.projectName??"",h=await Promise.all(N.map(X=>fetch(f(X)).then(T=>T.json()))),h.some(X=>typeof X?.id!="string"))throw new Error("missing concept")}catch{o.document.body.textContent=`could not load "${u}"`;return}const p=[],y=h.map(N=>{const K=[N.type,N.generated?.at?`updated ${N.generated.at.slice(0,10)}`:"",N.trustTier==="human-reviewed"?"human-reviewed":"",(N.tags??[]).map(q=>`#${q}`).join(" ")].filter(Boolean).join(" · "),{md:X,notes:T}=nb(jp(N.body??"",null)),le=!N.title||N.title===N.id||N.title===N.id.split("/").pop(),{html:fe,title:Z}=lb(vl.sanitize(ze.parse(X,{async:!1})),{title:N.title||N.id,meta:K,titleIsFallback:le});p.push(Z);const I=T.length?`<ol class="notes">${T.map(q=>`<li id="fn-${Ta(q.id)}">${vl.sanitize(ze.parseInline(q.text,{async:!1}))}</li>`).join("")}</ol>`:"";return`<article>
78
- ${fe}
79
- ${I}
80
- </article>`}).join(`
81
- `),x=new Date().toISOString().slice(0,10),k=m?`${Ta(m)} · ${Ta(i)}`:Ta(i),E=c?p[0]||u:i,j=c?"":`<h1 class="cover">${Ta(i)}</h1>
82
- <div class="cover-sub">${m?`${Ta(m)} · `:""}knowledge bundle · ${h.length} concept${h.length===1?"":"s"} · exported ${x}</div>`,M=`<!doctype html>
83
- <html>
84
- <head>
85
- <meta charset="utf-8">
86
- <title>${Ta(E)}</title>
87
- <style>
88
- :root { color-scheme: light; }
89
- /* Page margins live in the sheet itself (repeating thead/tfoot cells +
90
- cell padding), not in @page — print dialogs that override or drop CSS
91
- page margins (macOS system dialog, "Margins: None") then still print
92
- the intended layout. Top 14mm, right 48mm (notes), bottom 16mm, left 20mm. */
93
- @page { size: A4; margin: 0; }
94
- * { box-sizing: border-box; }
95
- body {
96
- margin: 0; background: #e9e5df;
97
- font: 10pt/1.5 -apple-system, "Segoe UI", system-ui, sans-serif; color: #1c1b19;
98
- font-feature-settings: "kern", "liga", "tnum";
99
- -webkit-print-color-adjust: exact; print-color-adjust: exact;
100
- }
101
- .no-print {
102
- position: sticky; top: 0; z-index: 1; display: flex; gap: 12px; align-items: center;
103
- padding: 10px 24px; background: #f4efea; border-bottom: 1px solid #ded6cb; font-size: 13px;
104
- }
105
- .no-print button {
106
- font: inherit; font-weight: 600; padding: 6px 16px; cursor: pointer;
107
- background: #191919; color: #fff; border: none; border-radius: 999px;
108
- }
109
- /* Screen preview mimics the printed page incl. the note gutter. */
110
- .sheet {
111
- width: 210mm; margin: 24px auto; background: #fff;
112
- border-collapse: separate; border-spacing: 0; box-shadow: 0 2px 12px rgba(0,0,0,.12);
113
- }
114
- .sheet > thead > tr > td { padding: 14mm 48mm 0 20mm; vertical-align: top; }
115
- .sheet > tbody > tr > td { padding: 0 48mm 0 20mm; vertical-align: top; }
116
- .sheet > tfoot > tr > td { padding: 16mm 0 0; }
117
-
118
- /* Running header */
119
- .runhead {
120
- display: flex; justify-content: space-between; gap: 16px;
121
- font-size: 7.5pt; line-height: 1; color: #6b6660; letter-spacing: 0.08em; text-transform: uppercase;
122
- padding-bottom: 6px; border-bottom: 0.5pt solid #1c1b19; margin-bottom: 30px;
123
- }
124
-
125
- /* Cover */
126
- .cover { margin: 0 0 3px; font-size: 22pt; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
127
- .cover-sub { color: #6b6660; font-size: 8.5pt; margin-bottom: 26px; }
128
-
129
- /* Concept */
130
- article { margin-top: 36px; }
131
- article:first-of-type { margin-top: 0; }
132
- article header { break-inside: avoid; break-after: avoid; margin-bottom: 12px; }
133
- article h1 { font-size: 16pt; font-weight: 700; margin: 0 0 3px; letter-spacing: -0.015em; line-height: 1.2; }
134
- article .meta { color: #6b6660; font-size: 8pt; letter-spacing: 0.01em; }
135
-
136
- /* Type scale for body headings (concept body starts at h2 after demotion) */
137
- h2 { font-size: 13pt; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; margin: 22px 0 6px; break-after: avoid; }
138
- h3 { font-size: 11pt; font-weight: 650; line-height: 1.3; margin: 18px 0 4px; break-after: avoid; }
139
- h4 { font-size: 9.5pt; font-weight: 650; color: #3d3a36; margin: 14px 0 2px; break-after: avoid; }
140
- h5, h6 { font-size: 10pt; font-weight: 650; margin: 12px 0 2px; }
141
- h2 + h3, h3 + h4 { margin-top: 6px; }
142
- .keep { break-inside: avoid; }
143
-
144
- /* Copy */
145
- p, ul, ol { margin: 0 0 8px; orphans: 3; widows: 3; }
146
- ul, ol { padding-left: 16px; }
147
- li { margin: 0 0 3px; padding-left: 2px; }
148
- li > p { margin: 0; }
149
- li::marker { color: #8a857e; }
150
- ul ul, ol ol, ul ol, ol ul { margin: 2px 0 0; }
151
- strong { font-weight: 650; }
152
- em { font-style: italic; }
153
- a { color: inherit; text-decoration-color: #b8b2aa; text-decoration-thickness: 0.5pt; text-underline-offset: 2px; }
154
- hr { border: 0; border-top: 0.5pt solid #ded6cb; margin: 14px 0; }
155
- code { font: 8.5pt/1.4 ui-monospace, "SF Mono", Menlo, monospace; background: #f2ede7; padding: 0 3px; border-radius: 3px; }
156
- pre { background: #f2ede7; padding: 8px 10px; border-radius: 4px; overflow-x: auto; white-space: pre-wrap; margin: 4px 0 10px; }
157
- pre code { background: none; padding: 0; }
158
- blockquote { margin: 6px 0 10px; padding: 1px 0 1px 12px; border-left: 2px solid #c9c2b8; color: #4d4944; }
159
- img { max-width: 100%; }
160
- li:has(> input[type="checkbox"]) { list-style: none; margin-left: -16px; }
161
- input[type="checkbox"] { width: 9px; height: 9px; margin: 0 6px 0 0; vertical-align: -0.5px; }
162
- pre, blockquote, table, img { break-inside: avoid; }
163
-
164
- /* Tables: hairline rules, tabular figures, tight leading */
165
- table.md { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 8.75pt; line-height: 1.35; }
166
- table.md th, table.md td { padding: 4px 10px 4px 0; text-align: left; vertical-align: top; border-bottom: 0.5pt solid #ded6cb; }
167
- table.md th:last-child, table.md td:last-child { padding-right: 0; }
168
- table.md th { font-weight: 650; padding-bottom: 5px; border-top: 0.5pt solid #1c1b19; border-bottom: 0.5pt solid #1c1b19; color: #1c1b19; }
169
- table.md tr:last-child td { border-bottom: 0.5pt solid #1c1b19; }
170
- table.md .nw { white-space: nowrap; }
171
-
172
- /* Footnotes */
173
- .fnref { font-size: 6.5pt; line-height: 0; margin-left: 1px; color: #6b6660; }
174
- .fnref + .fnref::before { content: ","; }
175
- .notes { margin: 14px 0 0; padding: 8px 0 0 14px; border-top: 0.5pt solid #ded6cb; font-size: 8pt; line-height: 1.4; color: #6b6660; }
176
- .notes li { margin: 0 0 2px; }
177
- @media print {
178
- body { background: #fff; }
179
- .no-print { display: none; }
180
- .sheet { width: 100%; margin: 0; box-shadow: none; }
181
- .runhead { margin-bottom: 24px; }
182
- }
183
- </style>
184
- </head>
185
- <body>
186
- <div class="no-print">
187
- <span>Use “Save as PDF” in the print dialog.</span>
188
- <button onclick="window.print()">print / save as PDF</button>
189
- </div>
190
- <table class="sheet">
191
- <thead><tr><td>
192
- <div class="runhead"><span>${k}</span><span>${x}</span></div>
193
- </td></tr></thead>
194
- <tbody><tr><td>
195
- ${j}
196
- ${y}
197
- </td></tr></tbody>
198
- <tfoot><tr><td></td></tr></tfoot>
199
- </table>
200
- <script>setTimeout(() => window.print(), 400);<\/script>
201
- </body>
202
- </html>`;o.location.href=URL.createObjectURL(new Blob([M],{type:"text/html"}))}function jp(i,c){return i.split(/(```[\s\S]*?```|`[^`]*`)/).map((o,u)=>u%2===1?o:o.replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(f,h,m)=>{const p=h.trim().replace(/\.md$/,""),y=(m??p).trim();return c===null?y:`[${y}](#/knowledge/${encodeURIComponent(c)}/${p})`})).join("")}function nb(i){const c=[];return{md:i.replace(/^\[\^([^\]]+)\]:[ \t]*(.+)$/gm,(u,f,h)=>(c.push({id:f,text:h.trim()}),"")).replace(/\[\^([^\]]+)\]/g,(u,f)=>{const h=c.findIndex(m=>m.id===f);return h>=0?`<sup class="fnref">${h+1}</sup>`:""}),notes:c}}function lb(i,c){const o=new DOMParser().parseFromString(i,"text/html");let u=c.title;const f=o.body.firstElementChild;c.titleIsFallback&&f?.tagName==="H1"&&(u=f.textContent?.trim()||u,f.remove());const h=o.createElement("header");h.innerHTML=`<h1>${Ta(u)}</h1><div class="meta">${Ta(c.meta)}</div>`,o.body.prepend(h);for(const m of o.querySelectorAll("table")){m.classList.add("md");for(const p of m.querySelectorAll("th, td"))(p.textContent??"").trim().length<=14&&p.classList.add("nw")}for(const m of[5,4,3,2,1])for(const p of Array.from(o.body.querySelectorAll(`:scope > h${m}`))){const y=o.createElement(`h${m+1}`);y.innerHTML=p.innerHTML,p.replaceWith(y)}for(const m of Array.from(o.body.querySelectorAll(":scope > header, :scope > h2, :scope > h3, :scope > h4"))){const p=m.nextElementSibling;if(!p||/^H[1-6]$/.test(p.tagName))continue;const y=o.createElement("div");y.className="keep",m.replaceWith(y),y.append(m,p)}return{html:o.body.innerHTML,title:u}}function Ta(i){return i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Np(i,c){return`/edit/${encodeURIComponent(i)}/${c.split("/").map(encodeURIComponent).join("/")}`}function sb({bundle:i,conceptId:c}){const o=He("/api/knowledge",!1),u=o?.bundles??[];return l.jsxs("div",{className:"runs-screen",children:[l.jsxs("aside",{className:"runs-side",children:[l.jsxs("div",{className:"side-head",children:[l.jsx("span",{className:"microlabel",children:"bundles"}),l.jsx("span",{className:"spacer"}),l.jsxs(Ee,{href:"/knowledge",className:"open-raw",children:[l.jsx(V,{name:"add",className:"ms-sm"})," new"]})]}),l.jsxs("div",{className:"side-list",children:[u.map(f=>l.jsxs(Ee,{href:`/knowledge/${encodeURIComponent(f.name)}`,className:`side-row ${f.name===i?"active":""}`,children:[l.jsx("span",{className:"lamp ok"}),l.jsxs("div",{className:"side-row-body",children:[l.jsxs("div",{className:"side-row-top",children:[l.jsx("span",{className:"side-wf",children:f.name}),l.jsx("span",{className:"side-when num",children:f.concepts})]}),l.jsx("div",{className:"side-row-sub",children:l.jsxs("span",{className:"side-req",children:[f.okfVersion?`okf ${f.okfVersion}`:"okf",f.updatedAt?` · ${f.updatedAt.slice(0,10)}`:""]})})]})]},f.name)),o&&u.length===0&&l.jsx("div",{className:"viewer-note",children:"no bundles yet"})]})]}),l.jsx("div",{className:"runs-main",children:i?l.jsx(cb,{name:i,conceptId:c},i):l.jsx(ib,{root:o?.root})})]})}function ib({root:i}){const[c,o]=C.useState(""),[u,f]=C.useState(""),[h,m]=C.useState(!1);async function p(){const y=c.trim();if(!y)return;m(!0),f("");const k=await(await fetch("/api/knowledge",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:y})})).json();m(!1),k.error?f(k.error):window.location.hash=`/knowledge/${encodeURIComponent(y)}`}return l.jsxs("div",{className:"new-chat",children:[l.jsx("div",{className:"page-head",children:l.jsx("h1",{children:"context & knowledge"})}),l.jsxs("section",{className:"panel new-chat-panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"what lives here"})}),l.jsxs("div",{className:"know-intro",children:["Curated knowledge as ",l.jsx("b",{children:"OKF bundles"})," (Open Knowledge Format v0.2): plain markdown files with YAML frontmatter",i?l.jsxs(l.Fragment,{children:[" under ",l.jsx("code",{children:i})]}):null,", readable by humans and agents, diffable in git. Agents write through"," ",l.jsx("code",{children:"kraftwerk knowledge put"})," (provenance is stamped automatically); you raise a concept's trust tier by verifying it here."]}),l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"new bundle"})}),l.jsxs("div",{className:"know-newbundle",children:[l.jsx("input",{value:c,placeholder:"bundle name, e.g. customer-support",onChange:y=>o(y.target.value),onKeyDown:y=>y.key==="Enter"&&void p()}),l.jsx("button",{className:"run-btn",disabled:!c.trim()||h,onClick:p,children:h?"creating…":"create"})]}),u&&l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",u]})]})]})}function Wm({tier:i}){return l.jsx("span",{className:`chip trust ${i}`,children:i})}const Pm="@activity";function cb({name:i,conceptId:c}){const o=He(`/api/knowledge/${encodeURIComponent(i)}`,!1);if(!o)return l.jsx("div",{className:"empty",children:"loading…"});if("error"in o)return l.jsx("div",{className:"empty",children:"bundle not found"});const u=c===Pm?"activity":"pages",f=o.concepts,h=u==="pages"?c&&f.some(p=>p.id===c)?c:f[0]?.id:void 0,m=`/knowledge/${encodeURIComponent(i)}`;return l.jsxs("div",{className:"member-view",children:[l.jsxs("div",{className:"page-head",children:[l.jsx("h1",{children:i}),l.jsxs("span",{className:"count",children:[f.length," pages"]}),l.jsxs("div",{className:"tabs",children:[l.jsx(Ee,{href:m,className:u==="pages"?"active":"",children:"pages"}),l.jsx(Ee,{href:`${m}/${Pm}`,className:u==="activity"?"active":"",children:"activity"})]}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"open-raw",onClick:()=>{Mo(i)},children:[l.jsx(V,{name:"picture_as_pdf",className:"ms-sm"})," export PDF"]}),l.jsx("button",{className:"run-btn",onClick:()=>{us("claude",{kind:"knowledge",bundle:i})},children:"curate in chat"})]}),u==="activity"?o.log?l.jsx(fb,{name:i,log:o.log}):l.jsx("section",{className:"panel",children:l.jsx("div",{className:"viewer-note",children:"no activity yet"})}):f.length===0?l.jsx("section",{className:"panel",children:l.jsxs("div",{className:"viewer-note",children:["No pages yet — start a chat to author some, or write one with"," ",l.jsxs("code",{children:["kraftwerk knowledge put ",i,"/<path>"]}),"."]})}):l.jsxs("div",{className:"wiki",children:[l.jsx("aside",{className:"wiki-side",children:db(f).map(({folder:p,concepts:y})=>l.jsxs(C.Fragment,{children:[p&&l.jsxs("div",{className:"wiki-folder",children:[p,"/"]}),y.map(x=>l.jsxs(Ee,{href:`${m}/${x.id}`,className:`wiki-page ${x.id===h?"active":""}`,title:`${x.id}.md`,children:[l.jsx(V,{name:rb(x.type),className:"ms-sm"}),l.jsx("span",{className:"wiki-page-title",children:x.title}),(x.stale||x.error)&&l.jsx("span",{className:"wiki-dot",title:x.error??"stale"})]},x.id))]},p||"."))}),l.jsx("div",{className:"wiki-main",children:h&&l.jsx(hb,{bundle:i,conceptId:h},h)})]})]})}function rb(i){switch((i??"").toLowerCase()){case"reference":return"article";case"policy":return"gavel";case"guide":case"howto":return"route";case"decision":return"balance";default:return"menu_book"}}function ub(i){const c=[];for(const o of i.split(`
203
- `)){const u=o.match(/^##\s+(\d{4}-\d{2}-\d{2})/);if(u){c.push({date:u[1],entries:[]});continue}const f=o.match(/^[*-]\s+\*\*([^*]+)\*\*:\s*(.*)$/);f&&c.length>0&&c[c.length-1].entries.push({kind:f[1].toLowerCase(),text:f[2]})}return c.filter(o=>o.entries.length>0)}function ob(i,c){const o=[],u=/\[([^\]]+)\]\(\/?([^)]+?)\.md\)/g;let f=0,h;for(;h=u.exec(c);)h.index>f&&o.push(c.slice(f,h.index)),o.push(l.jsx(Ee,{href:`/knowledge/${encodeURIComponent(i)}/${h[2].replace(/^\//,"")}`,children:h[1]},h.index)),f=h.index+h[0].length;return f<c.length&&o.push(c.slice(f)),o}function fb({name:i,log:c}){const o=ub(c),[u,f]=C.useState(!1);return l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"activity"}),l.jsx("span",{className:"spacer"}),l.jsx("button",{className:"open-raw",onClick:()=>f(!u),children:u?"timeline":"raw log"})]}),u||o.length===0?l.jsx("div",{className:"viewer-body",children:l.jsx("pre",{children:c})}):l.jsx("div",{className:"know-log",children:o.map(h=>l.jsxs(C.Fragment,{children:[l.jsx("div",{className:"m3-subhead num",children:h.date}),h.entries.map((m,p)=>l.jsxs("div",{className:"know-log-row",children:[l.jsx("span",{className:`chip log-kind log-${m.kind}`,children:m.kind}),l.jsx("span",{className:"know-log-text",children:ob(i,m.text)})]},p))]},h.date))})]})}function db(i){const c=new Map;for(const o of i){const u=o.id.includes("/")?o.id.slice(0,o.id.lastIndexOf("/")):"";(c.get(u)??c.set(u,[]).get(u)).push(o)}return[...c.keys()].sort((o,u)=>o===""?-1:u===""?1:o.localeCompare(u)).map(o=>({folder:o,concepts:c.get(o)}))}function hb({bundle:i,conceptId:c}){const[o,u]=C.useState(null),[f,h]=C.useState(!1),[m,p]=C.useState(!1),[y,x]=C.useState(!1),[k,E]=C.useState(""),[j,M]=C.useState(!1),[N,K]=C.useState(""),[X,T]=C.useState("rendered"),le=C.useMemo(()=>o?vl.sanitize(ze.parse(jp(o.body,i),{async:!1})):"",[o?.body,i]),fe=()=>{fetch(`/api/knowledge/${encodeURIComponent(i)}/concept?id=${encodeURIComponent(c)}`).then(q=>q.ok?q.json():Promise.reject()).then(u).catch(()=>h(!0))};C.useEffect(()=>{if(y)return;let q=!0,H;const W=async()=>{try{const ee=await fetch(`/api/knowledge/${encodeURIComponent(i)}/concept?id=${encodeURIComponent(c)}`,{cache:"no-store"});if(ee.ok){const ve=await ee.json();q&&(h(!1),u(ge=>JSON.stringify(ge)===JSON.stringify(ve)?ge:ve))}else ee.status===404&&q&&h(!0)}catch{}q&&(H=setTimeout(W,6e3))};return W(),()=>{q=!1,clearTimeout(H)}},[i,c,y]);async function Z(){p(!0),await fetch(`/api/knowledge/${encodeURIComponent(i)}/verify`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:c})}).catch(()=>{}),p(!1),fe()}async function I(){M(!0),K("");const q=await fetch(`/api/knowledge/${encodeURIComponent(i)}/concept`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:c,content:k})}).then(H=>H.json()).catch(()=>({error:"save failed"}));M(!1),q.error?K(q.error):(u(q),x(!1))}return f?l.jsx("div",{className:"empty",children:"concept not found"}):o?l.jsxs("div",{className:"member-view",children:[l.jsxs("div",{className:"detail-head",children:[l.jsx("h1",{children:o.title}),o.type&&l.jsx("span",{className:"chip agent",children:o.type}),l.jsx(Wm,{tier:o.trustTier}),o.status!=="stable"&&l.jsx("span",{className:`chip ${o.status}`,children:o.status}),o.stale&&l.jsxs("span",{className:"chip stale",children:["stale since ",o.staleAfter?.slice(0,10)]}),l.jsx("span",{className:"spacer"}),l.jsxs(Ee,{href:Np(i,o.id),className:"open-raw",title:"Full-screen document editor with autosave",children:[l.jsx(V,{name:"edit_document",className:"ms-sm"})," open in editor"]}),l.jsxs("button",{className:"open-raw",onClick:()=>{Mo(i,o.id)},children:[l.jsx(V,{name:"picture_as_pdf",className:"ms-sm"})," export PDF"]}),l.jsx("button",{className:"run-btn",disabled:m,onClick:Z,children:m?"verifying…":l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"check",className:"ms-sm"})," verify (human)"]})})]}),o.error&&l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",o.error]}),l.jsxs("div",{className:"detail-cols",children:[l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"content"}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"side-meta",children:[i,"/",o.id,".md"]}),y?l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"open-raw",onClick:()=>{x(!1),K("")},children:"cancel"}),l.jsx("button",{className:"open-raw",disabled:j,onClick:I,children:j?"saving…":l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"check",className:"ms-sm"})," save"]})})]}):l.jsxs("button",{className:"open-raw",onClick:()=>{E(o.raw),x(!0),K("")},children:[l.jsx(V,{name:"edit",className:"ms-sm"})," edit"]})]}),y?l.jsxs(l.Fragment,{children:[l.jsx("textarea",{className:"concept-edit",value:k,rows:Math.min(40,Math.max(18,k.split(`
204
- `).length+2)),onChange:q=>E(q.target.value),spellCheck:!1}),l.jsxs("div",{className:"viewer-note",children:["full file (frontmatter + markdown body) — saving stamps provenance as"," ",l.jsx("code",{children:"human:user"})," and logs an update."]})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"viewer-note md-toolbar",children:l.jsxs("div",{className:"tabs",children:[l.jsx("button",{className:X==="rendered"?"active":"",onClick:()=>T("rendered"),children:"rendered"}),l.jsx("button",{className:X==="source"?"active":"",onClick:()=>T("source"),children:"source"})]})}),l.jsx("div",{className:"viewer-body",children:X==="rendered"?l.jsx("div",{className:"md-body concept-md",dangerouslySetInnerHTML:{__html:le}}):l.jsx("pre",{children:o.body.trim()||"(empty body)"})})]}),N&&l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",N]})]}),l.jsxs("aside",{className:"detail-rail",children:[l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"about"})}),l.jsxs("div",{className:"rail-list",children:[l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"trust"}),l.jsx("span",{className:"v",children:l.jsx(Wm,{tier:o.trustTier})})]}),l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"generated"}),l.jsx("span",{className:`v ${o.generated?"":"dim"}`,children:o.generated?`${o.generated.by??"?"} · ${(o.generated.at??"?").slice(0,10)}`:"not stamped"})]}),l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"verified"}),o.verified.length===0?l.jsx("span",{className:"v dim",children:"never"}):o.verified.map((q,H)=>l.jsxs("span",{className:"v",children:[q.by??"?"," · ",(q.at??"?").slice(0,10)]},H))]}),o.staleAfter&&l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"stale after"}),l.jsxs("span",{className:`v ${o.stale?"":"dim"}`,children:[o.staleAfter.slice(0,10),o.stale&&l.jsx("span",{className:"chip stale",children:"stale"})]})]}),o.tags.length>0&&l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"tags"}),l.jsx("span",{className:"m3-chips",children:o.tags.map(q=>l.jsx("span",{className:"chip",children:q},q))})]})]})]}),o.sources.length>0&&l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"sources"})}),l.jsx("div",{className:"rail-list",children:o.sources.map((q,H)=>l.jsxs("div",{className:"rail-kv",children:[l.jsxs("span",{className:"v",children:[q.resource?.startsWith("http")?l.jsx("a",{href:q.resource,target:"_blank",rel:"noreferrer",children:q.title??q.resource}):q.title??q.resource??"?",q.id&&l.jsxs("span",{className:"know-id",children:["[^",q.id,"]"]})]}),l.jsx("span",{className:"v dim",children:[q.author,q.usage_count!=null?`${q.usage_count} uses`:null,q.last_modified?`mod ${q.last_modified.slice(0,10)}`:null].filter(Boolean).join(" · ")})]},H))})]})]})]})]}):l.jsx("div",{className:"empty",children:"loading…"})}const mb={workspace:"workspace",project:".claude",user:"global",agent:"agent"};function Sp(i){return l.jsx("span",{className:`chip skill-src ${i}`,children:mb[i]})}function pb({name:i}){const c=He("/api/skills",!1),o=c?.skills??[],u=o.filter(m=>m.source==="workspace"),f=o.filter(m=>m.source!=="workspace"),h=m=>l.jsxs(Ee,{href:`/skills/${encodeURIComponent(m.name)}`,className:`side-row ${m.name===i?"active":""}`,children:[l.jsx("span",{className:`lamp ${m.source==="workspace"?"ok":"dim"}`}),l.jsxs("div",{className:"side-row-body",children:[l.jsxs("div",{className:"side-row-top",children:[l.jsxs("span",{className:"side-wf",children:["/",m.name]}),m.source!=="workspace"&&Sp(m.source)]}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-req",children:m.description||"no description"})})]})]},`${m.source}:${m.name}`);return l.jsxs("div",{className:"runs-screen",children:[l.jsxs("aside",{className:"runs-side",children:[l.jsx("div",{className:"side-head",children:l.jsx("span",{className:"microlabel",children:"workspace skills"})}),l.jsxs("div",{className:"side-list",children:[u.map(h),c&&u.length===0&&l.jsx("div",{className:"viewer-note",children:"no workspace skills yet"}),f.length>0&&l.jsxs(C.Fragment,{children:[l.jsx("div",{className:"side-head skills-local-head",children:l.jsx("span",{className:"microlabel",children:"local (this machine / repo)"})}),f.map(h)]})]})]}),l.jsx("div",{className:"runs-main",children:i?l.jsx(xb,{name:i},i):l.jsx(gb,{root:c?.root,workspace:u})})]})}function gb({root:i,workspace:c}){return l.jsxs("div",{className:"new-chat",children:[l.jsxs("div",{className:"page-head",children:[l.jsx("h1",{children:"skills"}),l.jsxs("span",{className:"count",children:[c.length," in workspace"]})]}),l.jsxs("section",{className:"panel new-chat-panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"what lives here"})}),l.jsxs("div",{className:"know-intro",children:["Skills are reusable ",l.jsx("b",{children:"instruction packages"}),": one folder per skill with a"," ",l.jsx("code",{children:"SKILL.md"})," (YAML frontmatter: name, description). ",l.jsx("b",{children:"Workspace skills"}),i?l.jsxs(l.Fragment,{children:[" live under ",l.jsx("code",{children:i})]}):null,", are tracked in git and shared with everyone in this workspace — they are the ones to build on. Skills from"," ",l.jsx("code",{children:".claude/skills"})," and your personal ",l.jsx("code",{children:"~/.claude/skills"})," also work here, but stay repo-/machine-local. Invoke any skill in a session with"," ",l.jsx("code",{children:"/<name>"}),"."]}),l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"add a workspace skill"})}),l.jsxs("div",{className:"know-intro",children:["Create ",l.jsxs("code",{children:[i?`${i}/`:"skills/","<name>/SKILL.md"]}),", commit it, done — it appears here and in every session's ",l.jsx("code",{children:"/"})," menu."]})]})]})}function xb({name:i}){const[c,o]=C.useState(null),[u,f]=C.useState(!1),[h,m]=C.useState("rendered"),p=C.useMemo(()=>c?c.content.replace(/^---\r?\n[\s\S]*?\r?\n---(\r?\n|$)/,""):"",[c?.content]),y=C.useMemo(()=>c?vl.sanitize(ze.parse(p,{async:!1})):"",[p]);return C.useEffect(()=>{fetch(`/api/skills/${encodeURIComponent(i)}`).then(x=>x.ok?x.json():Promise.reject()).then(o).catch(()=>f(!0))},[i]),u?l.jsx("div",{className:"empty",children:"skill not found"}):c?l.jsxs("div",{className:"member-view",children:[l.jsxs("div",{className:"detail-head",children:[l.jsxs("h1",{children:["/",c.name]}),Sp(c.source)]}),c.description&&l.jsx("div",{className:"know-intro skill-desc",children:c.description}),l.jsxs("div",{className:"detail-cols",children:[l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"SKILL.md"}),l.jsx("span",{className:"spacer"}),l.jsxs("div",{className:"tabs",children:[l.jsx("button",{className:h==="rendered"?"active":"",onClick:()=>m("rendered"),children:"rendered"}),l.jsx("button",{className:h==="source"?"active":"",onClick:()=>m("source"),children:"source"})]})]}),l.jsx("div",{className:"viewer-body",children:h==="rendered"?l.jsx("div",{className:"md-body concept-md",dangerouslySetInnerHTML:{__html:y}}):l.jsx("pre",{children:c.content.trim()||"(empty)"})})]}),l.jsx("aside",{className:"detail-rail",children:l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"about"})}),l.jsxs("div",{className:"rail-list",children:[l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"source"}),l.jsx("span",{className:"v",children:c.source==="workspace"?"workspace — git-tracked, shared with the team":c.source==="project"?"repo .claude/skills — tracked, but outside the workspace root":"global ~/.claude/skills — only on this machine"})]}),l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"path"}),l.jsx("span",{className:"v mono skill-path",title:c.path,children:c.path})]}),l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"invoke"}),l.jsxs("span",{className:"v",children:[l.jsxs("code",{children:["/",c.name]})," in any session"]})]}),c.files.length>0&&l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"bundled files"}),c.files.map(x=>l.jsx("span",{className:"v mono",children:x},x))]})]})]})})]})]}):l.jsx("div",{className:"empty",children:"loading…"})}const vb=["","low","medium","high","xhigh","max"],yb=["🤖","🧑‍💻","🎧","🛠️","📊","✍️","🔍","🧹","📦","🚀"];function ep({seg:i}){const c=i[0]&&i[0]!=="new"&&i[0]!=="chats"?decodeURIComponent(i[0]):void 0,o=i[0]==="new"?"new":i[0]==="chats"?"chats":i[1]==="edit"?"edit":i[1]==="info"?"info":i[1]==="chat"?"chat":c?"member":"home",u=o==="chat"?i[2]:o==="chats"?i[1]:void 0,f=He("/api/team",!1),h=Ba(),[m,p]=C.useState(()=>{try{const $=JSON.parse(localStorage.getItem("kw-agent-groups")??"[]");return Array.isArray($)?$.map(String):[]}catch{return[]}}),[y,x]=C.useState(!1),[k,E]=C.useState(""),[j,M]=C.useState(null),[N,K]=C.useState(""),[X,T]=C.useState(null),[le,fe]=C.useState(null),[Z,I]=C.useState({}),q=(f?.members??[]).map($=>Z[$.slug]!==void 0?{...$,group:Z[$.slug]||void 0}:$);C.useEffect(()=>{I($=>{const Re={...$};let Ge=!1;for(const We of f?.members??[])Re[We.slug]!==void 0&&(We.group??"")===Re[We.slug]&&(delete Re[We.slug],Ge=!0);return Ge?Re:$})},[f]);const H=q.filter($=>!$.archived),W=q.filter($=>$.archived),[ee,ve]=C.useState(!1),ge=[...new Set([...H.map($=>$.group??"").filter(Boolean),...m])].sort(($,Re)=>$.localeCompare(Re)),ae=H.filter($=>!$.group);function be($){p($);try{localStorage.setItem("kw-agent-groups",JSON.stringify($))}catch{}}function Je(){const $=k.trim();x(!1),E(""),$&&!ge.includes($)&&be([...m,$])}function nt($,Re){M(null);const Ge=Re.trim();if(!(!Ge||Ge===$)){for(const We of q.filter(ta=>ta.group===$))U(We.slug,Ge);m.includes($)&&be([...new Set(m.map(We=>We===$?Ge:We))])}}async function U($,Re){if((q.find(We=>We.slug===$)?.group??"")!==Re){I(We=>({...We,[$]:Re}));try{const We=await fetch(`/api/team/${encodeURIComponent($)}`);if(!We.ok)throw new Error;const ta=await We.json();if(!(await fetch(`/api/team/${encodeURIComponent($)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({...ta,group:Re||void 0})})).ok)throw new Error}catch{I(We=>{const ta={...We};return delete ta[$],ta})}}}const P=$=>h?{onDragOver:Re=>{X!=null&&(Re.preventDefault(),Re.dataTransfer.dropEffect="move",le!==$&&fe($))},onDrop:Re=>{Re.preventDefault();const Ge=Re.dataTransfer.getData("text/plain")||X;Ge&&U(Ge,$),T(null),fe(null)}}:{},re=$=>l.jsxs(Ee,{href:`/agents/${encodeURIComponent($.slug)}`,className:`side-row ${$.slug===c?"active":""} ${X===$.slug?"dragging":""}`,draggable:h,onDragStart:Re=>{Re.dataTransfer.setData("text/plain",$.slug),Re.dataTransfer.effectAllowed="move",T($.slug)},onDragEnd:()=>{T(null),fe(null)},children:[l.jsx("span",{className:"agent-avatar sm",children:l.jsx("span",{"aria-hidden":!0,children:$.emoji})}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:$.name})}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-req",children:$.description||$.harness})})]})]},$.slug),Ce=$=>l.jsxs(Ee,{href:`/agents/${encodeURIComponent($.slug)}/info`,className:`side-row archived-row ${$.slug===c?"active":""}`,children:[l.jsx("span",{className:"agent-avatar sm",children:l.jsx("span",{"aria-hidden":!0,children:$.emoji})}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:$.name})}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-req",children:$.description||$.harness})})]})]},$.slug);let je;o==="new"?je=l.jsx(ap,{},"new"):o==="edit"&&c?je=l.jsx(ap,{slug:c},c):o==="chat"&&c&&u?je=l.jsx("div",{className:"chat-main",children:l.jsx(Vm,{id:u,agentName:q.find($=>$.slug===c)?.name??c,agentDescription:q.find($=>$.slug===c)?.description},u)}):o==="chats"?je=u?l.jsx("div",{className:"chat-main",children:l.jsx(Vm,{id:u},u)}):l.jsx(ky,{}):o==="info"&&c?je=l.jsx(wp,{slug:c},c):c?je=l.jsx(jb,{slug:c},c):je=l.jsx(wb,{hasMembers:H.length>0,root:f?.root});const w=(o==="member"||o==="info"||o==="chat")&&c?q.find($=>$.slug===c)?.knowledge??[]:[],[G,te]=C.useState(()=>localStorage.getItem("kw-kside")!=="hidden"),[F,he]=C.useState(()=>Number(localStorage.getItem("kw-kside-w"))||460),pe=w.length>0&&G;function _e($){te($),localStorage.setItem("kw-kside",$?"open":"hidden")}function mt($){he($),localStorage.setItem("kw-kside-w",String($))}return l.jsxs("div",{className:`runs-screen team-screen ${c||o==="chats"?"has-sessions":""} ${pe?"has-knowledge":""}`,style:pe?{"--kside-w":`${F}px`}:void 0,children:[l.jsxs("aside",{className:"runs-side",children:[l.jsxs("div",{className:"side-head",children:[l.jsx("span",{className:"microlabel",children:"agents"}),l.jsx("span",{className:"spacer"}),h&&l.jsxs(Ee,{href:"/agents/new",className:"open-raw",children:[l.jsx(V,{name:"add",className:"ms-sm"})," new"]})]}),l.jsxs("div",{className:"side-list",children:[l.jsxs(Ee,{href:"/agents/chats",className:`side-row side-general ${o==="chats"?"active":""}`,children:[l.jsx("span",{className:"agent-avatar sm",children:l.jsx("span",{"aria-hidden":!0,children:"💬"})}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:"General Chats"})}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-req",children:"chats without an agent"})})]})]}),l.jsxs("div",{className:`side-group ${X&&le===""?"drop-over":""}`,...P(""),children:[ae.map(re),X!=null&&ae.length===0&&l.jsx("div",{className:"side-group-empty",children:"no group — drop here"})]}),ge.map($=>{const Re=H.filter(Ge=>Ge.group===$);return l.jsxs("div",{className:`side-group ${X&&le===$?"drop-over":""}`,...P($),children:[l.jsxs("div",{className:"side-group-head",children:[j===$?l.jsx("input",{className:"side-group-rename",autoFocus:!0,value:N,onChange:Ge=>K(Ge.target.value),onKeyDown:Ge=>{Ge.key==="Enter"&&nt($,N),Ge.key==="Escape"&&M(null)},onBlur:()=>nt($,N)}):l.jsx("span",{className:"microlabel",children:$}),l.jsx("span",{className:"side-group-count num",children:Re.length}),l.jsx("span",{className:"spacer"}),h&&j!==$&&l.jsx("button",{className:"side-group-x",title:"Rename group",onClick:()=>{M($),K($)},children:l.jsx(V,{name:"edit",className:"ms-sm"})}),h&&Re.length===0&&m.includes($)&&l.jsx("button",{className:"side-group-x",title:"Remove empty group",onClick:()=>be(m.filter(Ge=>Ge!==$)),children:l.jsx(V,{name:"close",className:"ms-sm"})})]}),Re.map(re),Re.length===0&&l.jsx("div",{className:"side-group-empty",children:h?"drag agents here":"no agents"})]},$)}),W.length>0&&l.jsxs("div",{className:"side-group side-archived",children:[l.jsxs("button",{className:"side-archived-toggle","aria-expanded":ee,onClick:()=>ve($=>!$),children:[l.jsx("span",{className:"microlabel",children:"archived"}),l.jsx("span",{className:"side-group-count num",children:W.length}),l.jsx("span",{className:"spacer"}),l.jsx(V,{name:ee?"expand_less":"expand_more",className:"ms-sm"})]}),ee&&W.map(Ce)]}),f&&q.length===0&&l.jsx("div",{className:"viewer-note",children:"no agents yet"}),h&&(y?l.jsx("div",{className:"side-group-new",children:l.jsx("input",{autoFocus:!0,value:k,placeholder:"group name, e.g. Team Content",onChange:$=>E($.target.value),onKeyDown:$=>{$.key==="Enter"&&Je(),$.key==="Escape"&&(x(!1),E(""))},onBlur:Je})}):l.jsxs("button",{className:"side-group-add",onClick:()=>x(!0),children:[l.jsx(V,{name:"add",className:"ms-sm"})," group"]}))]})]}),c&&l.jsx(Nb,{slug:c,chatId:u}),o==="chats"&&l.jsx(Sb,{chatId:u}),l.jsx("div",{className:"runs-main",children:je}),pe&&l.jsx(bb,{bundles:w,onHide:()=>_e(!1),onResize:mt}),w.length>0&&!G&&l.jsxs("button",{className:"kside-reopen",onClick:()=>_e(!0),title:"Show knowledge sidebar",children:[l.jsx(V,{name:"menu_book",className:"ms-sm"})," knowledge"]})]})}function bb({bundles:i,onHide:c,onResize:o}){const[u,f]=C.useState({}),[h,m]=C.useState(null),[p,y]=C.useState({}),[x,k]=C.useState({}),[E,j]=C.useState(null),[M,N]=C.useState(""),[K,X]=C.useState(!1),[T,le]=C.useState("");C.useEffect(()=>{f({});let I=!0,q;const H=async()=>{await Promise.all(i.map(async W=>{try{const ee=await fetch(`/api/knowledge/${encodeURIComponent(W)}`,{cache:"no-store"}),ve=ee.ok?await ee.json():null;I&&f(ge=>JSON.stringify(ge[W])===JSON.stringify(ve)?ge:{...ge,[W]:ve})}catch{I&&f(ee=>W in ee?ee:{...ee,[W]:null})}})),I&&(q=setTimeout(H,6e3))};return H(),()=>{I=!1,clearTimeout(q)}},[i.join(",")]),C.useEffect(()=>{if(!h||E===h)return;const I=h.indexOf("::"),q=h.slice(0,I),H=h.slice(I+2);let W=!0,ee;const ve=async()=>{try{const ge=await fetch(`/api/knowledge/${encodeURIComponent(q)}/concept?id=${encodeURIComponent(H)}`,{cache:"no-store"}),ae=ge.ok?await ge.json():null;W&&y(be=>JSON.stringify(be[h])===JSON.stringify(ae)?be:{...be,[h]:ae})}catch{W&&y(ge=>h in ge?ge:{...ge,[h]:null})}W&&(ee=setTimeout(ve,6e3))};return ve(),()=>{W=!1,clearTimeout(ee)}},[h,E]);function fe(I,q){const H=`${I}::${q}`;m(h===H?null:H)}async function Z(I,q){const H=`${I}::${q}`;X(!0),le("");try{const ee=await(await fetch(`/api/knowledge/${encodeURIComponent(I)}/concept`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:q,content:M})})).json();ee.error?le(ee.error):(y(ve=>({...ve,[H]:ee})),j(null))}catch(W){le(W.message)}X(!1)}return l.jsxs("aside",{className:"runs-side knowledge-side",children:[l.jsx("div",{className:"kside-resizer",title:"Drag to resize",onMouseDown:I=>{I.preventDefault();const q=I.clientX,H=I.currentTarget.parentElement.offsetWidth,W=ve=>o(Math.min(900,Math.max(280,H+(q-ve.clientX)))),ee=()=>{window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",ee)};window.addEventListener("mousemove",W),window.addEventListener("mouseup",ee)}}),l.jsxs("div",{className:"side-head",children:[l.jsxs("span",{className:"kside-headline",children:[l.jsx("span",{className:"microlabel",children:"knowledge"}),l.jsx("span",{className:"kside-hint",children:"read & kept current by this agent"})]}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"open-raw",onClick:c,title:"Hide knowledge sidebar",children:["hide ",l.jsx(V,{name:"close",className:"ms-sm"})]})]}),l.jsx("div",{className:"side-list",children:i.map(I=>{const q=u[I],H=x[I]===!0;return l.jsxs("div",{className:"kside-bundle",children:[l.jsxs("div",{className:"kside-bundle-head",children:[l.jsxs("button",{className:"kside-bundle-toggle","aria-expanded":!H,onClick:()=>k({...x,[I]:!H}),children:[l.jsx("span",{className:`kside-chev ${H?"":"open"}`,"aria-hidden":!0,children:l.jsx(V,{name:"chevron_right",className:"ms-sm"})}),l.jsx("span",{className:"kside-bundle-name",children:I}),q&&l.jsx("span",{className:"kside-count num",children:q.concepts.length})]}),l.jsx("button",{className:"kside-open",title:"Export this bundle as PDF",onClick:()=>{Mo(I)},children:l.jsx(V,{name:"picture_as_pdf",className:"ms-sm"})}),l.jsx(Ee,{href:`/knowledge/${encodeURIComponent(I)}`,className:"kside-open",title:"Open this bundle on the knowledge screen",children:"↗"})]}),!H&&q===null&&l.jsx("div",{className:"viewer-note",children:"bundle not found"}),!H&&q?.concepts.map(W=>{const ee=`${I}::${W.id}`,ve=h===ee,ge=`/knowledge/${encodeURIComponent(I)}/${W.id.split("/").map(encodeURIComponent).join("/")}`;return l.jsxs("div",{className:`kside-concept ${ve?"open":""}`,children:[l.jsxs("button",{className:"kside-row","aria-expanded":ve,title:W.description||void 0,onClick:()=>fe(I,W.id),children:[l.jsx("span",{className:`kside-chev ${ve?"open":""}`,"aria-hidden":!0,children:l.jsx(V,{name:"chevron_right",className:"ms-sm"})}),l.jsx("span",{className:"kside-title",children:W.title||W.id}),W.stale&&l.jsx("span",{className:"kside-stale",title:"Past its stale-after date — ask the agent to re-verify it",children:"stale"})]}),ve&&l.jsx("div",{className:"kside-card",ref:ae=>ae?.scrollIntoView({block:"nearest"}),children:p[ee]===void 0?l.jsx("div",{className:"viewer-note",children:"loading…"}):p[ee]===null?l.jsx("div",{className:"viewer-note",children:"could not load concept"}):E===ee?l.jsxs("div",{className:"kside-edit",children:[l.jsx("textarea",{className:"concept-edit",value:M,rows:Math.min(28,Math.max(10,M.split(`
205
- `).length+2)),onChange:ae=>N(ae.target.value),spellCheck:!1}),l.jsxs("div",{className:"kside-actions",children:[l.jsx("button",{className:"open-raw",disabled:K,onClick:()=>j(null),children:"cancel"}),l.jsx("button",{className:"open-raw",disabled:K,onClick:()=>Z(I,W.id),children:K?"saving…":l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"check",className:"ms-sm"})," save"]})})]}),T&&l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",T]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"kside-card-bar",children:[W.type&&l.jsx("span",{className:"kside-type",children:W.type}),tp(W)&&l.jsxs("span",{className:"kside-updated num",children:["updated ",gl(tp(W))]}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"open-raw",onClick:()=>{N(p[ee].raw),j(ee),le("")},children:[l.jsx(V,{name:"edit",className:"ms-sm"})," edit"]}),l.jsxs(Ee,{href:Np(I,W.id),className:"open-raw",title:"Full-screen document editor with autosave",children:[l.jsx(V,{name:"edit_document",className:"ms-sm"})," editor"]}),l.jsx(Ee,{href:ge,className:"open-raw",children:"open ↗"})]}),l.jsx("div",{className:"kside-md md-body",dangerouslySetInnerHTML:{__html:vl.sanitize(ze.parse(p[ee].body??"",{async:!1}))}})]})})]},W.id)}),!H&&q&&q.concepts.length===0&&l.jsx("div",{className:"viewer-note",children:"no concepts yet"})]},I)})})]})}function tp(i){return[i.generated?.at,...i.verified.map(o=>o.at)].filter(o=>typeof o=="string"&&o.length>0).sort().pop()}function jb({slug:i}){const[c,o]=C.useState(!1);return C.useEffect(()=>{let u=!0;return o(!1),fetch("/api/chats").then(f=>f.json()).then(f=>{if(!u)return;const h=f.chats.find(m=>m.scope.kind==="team"&&m.scope.member===i);h?ga(`/agents/${encodeURIComponent(i)}/chat/${h.id}`,{replace:!0}):o(!0)}).catch(()=>u&&o(!0)),()=>{u=!1}},[i]),c?l.jsx(wp,{slug:i}):l.jsx("div",{className:"empty",children:"loading…"})}function Nb({slug:i,chatId:c}){const o=He("/api/chats",!1),u=(o?.chats??[]).filter(m=>m.scope.kind==="team"&&m.scope.member===i),[f,h]=C.useState(!1);return l.jsxs("aside",{className:"runs-side",children:[l.jsxs("div",{className:"side-head",children:[l.jsx("span",{className:"microlabel",children:"sessions"}),l.jsx("span",{className:"spacer"}),l.jsx(Ee,{href:`/agents/${encodeURIComponent(i)}/info`,className:"open-raw",title:"agent profile & settings",children:"profile"}),l.jsx("button",{className:"open-raw",disabled:f,onClick:async()=>{h(!0),await us("claude",{kind:"team",member:i}),h(!1)},children:f?"…":l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"add",className:"ms-sm"})," new"]})})]}),l.jsxs("div",{className:"side-list",children:[u.map(m=>l.jsxs(Ee,{href:`/agents/${encodeURIComponent(i)}/chat/${m.id}`,className:`side-row ${m.id===c?"active":""}`,children:[l.jsx("span",{className:`lamp ${m.busy?"running":"pending"}`}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:m.title||"new session"})}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-when num",children:gl(m.updatedAt)})})]}),l.jsx("button",{type:"button",className:"row-x",title:"delete session",onClick:async p=>{p.preventDefault(),p.stopPropagation(),window.confirm(`Delete session "${m.title||m.id}"?`)&&(await fetch(`/api/chats/${m.id}`,{method:"DELETE"}).catch(()=>{}),m.id===c&&ga(`/agents/${encodeURIComponent(i)}`))},children:l.jsx(V,{name:"close",className:"ms-sm"})})]},m.id)),o&&u.length===0&&l.jsx("div",{className:"viewer-note",children:"no sessions yet"})]})]})}function Sb({chatId:i}){const c=He("/api/chats",!1),o=(c?.chats??[]).filter(u=>u.scope.kind!=="team");return l.jsxs("aside",{className:"runs-side",children:[l.jsxs("div",{className:"side-head",children:[l.jsx("span",{className:"microlabel",children:"chats"}),l.jsx("span",{className:"spacer"}),l.jsxs(Ee,{href:"/agents/chats",className:"open-raw",children:[l.jsx(V,{name:"add",className:"ms-sm"})," new"]})]}),l.jsxs("div",{className:"side-list",children:[o.map(u=>l.jsxs(Ee,{href:`/agents/chats/${u.id}`,className:`side-row ${u.id===i?"active":""}`,children:[l.jsx("span",{className:`lamp ${u.busy?"running":"pending"}`}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:u.title||"new chat"})}),l.jsxs("div",{className:"side-row-sub",children:[l.jsxs("span",{className:"side-req",children:[u.agent,u.scope.kind==="run"?` · ${u.scope.runId}`:u.scope.kind==="kraftwerk"?" · kraftwerk":u.scope.kind==="knowledge"?` · knowledge${u.scope.bundle?`:${u.scope.bundle}`:""}`:""]}),l.jsx("span",{className:"side-when num",children:gl(u.updatedAt)})]})]}),l.jsx("button",{type:"button",className:"row-x",title:"delete chat",onClick:async f=>{f.preventDefault(),f.stopPropagation(),window.confirm(`Delete chat "${u.title||u.id}"?`)&&(await fetch(`/api/chats/${u.id}`,{method:"DELETE"}).catch(()=>{}),u.id===i&&ga("/agents/chats"))},children:l.jsx(V,{name:"close",className:"ms-sm"})})]},u.id)),c&&o.length===0&&l.jsx("div",{className:"viewer-note",children:"no chats yet"})]})]})}function wb({hasMembers:i,root:c}){const o=Ba();return l.jsxs("div",{className:"new-chat",children:[l.jsx("div",{className:"page-head",children:l.jsx("h1",{children:"agents"})}),l.jsxs("section",{className:"panel new-chat-panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"what lives here"})}),l.jsxs("div",{className:"know-intro",children:["Your agents, set up like teammates: each one has a name, a role (system prompt), a harness/model to run on, and the workflows that belong to its job. An agent lives in"," ",l.jsx("code",{children:c?`${c}/<slug>/`:"agents/<slug>/"})," as ",l.jsx("code",{children:"agent.yml"})," +"," ",l.jsx("code",{children:"system.md"})," — git-tracked, so your team travels with the repo. Every session is a persistent conversation with that agent; it knows its connected workflows and knowledge bundles, runs the workflows for you, and keeps the knowledge current."]}),o?l.jsx("div",{style:{padding:"0 16px 16px"},children:l.jsx("button",{className:"run-btn",onClick:()=>ga("/agents/new"),children:l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"add",className:"ms-sm"})," ",i?"new agent":"create your first agent"]})})}):l.jsx("div",{className:"settings-note",style:{padding:"0 16px 16px"},children:"Creating agents needs expert mode — flip the switch in the top bar."})]})]})}function wp({slug:i}){const[c,o]=C.useState(null),[u,f]=C.useState(!1),[h,m]=C.useState(!1),[p,y]=C.useState(!1),[x,k]=C.useState(""),[E,j]=C.useState(""),[M,N]=C.useState([]),[K,X]=C.useState(!0),[T,le]=C.useState(!1),[fe,Z]=C.useState(""),I=He("/api/workflows",!1),q=He("/api/knowledge",!1),H=He("/api/skills",!1);C.useEffect(()=>{let ae=!0;return fetch(`/api/team/${encodeURIComponent(i)}`).then(be=>be.ok?be.json():Promise.reject()).then(be=>ae&&o(be)).catch(()=>ae&&f(!0)),()=>{ae=!1}},[i]);async function W(ae){if(c){le(!0),Z("");try{const Je=await(await fetch(`/api/team/${encodeURIComponent(i)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:c.name,emoji:c.emoji,description:c.description,harness:c.harness,model:c.model,effort:c.effort,group:c.group,system:c.system,workflows:c.workflows,knowledge:c.knowledge,skills:c.skills,...ae})})).json();Je.error?Z(Je.error):(o(Je),k(""))}catch(be){Z(be.message)}le(!1)}}function ee(ae,be){N(be?[...M,ae]:M.filter(Je=>Je!==ae))}async function ve(ae){le(!0),Z("");try{const Je=await(await fetch(`/api/team/${encodeURIComponent(i)}/archive`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({archived:ae})})).json();Je.error?Z(Je.error):o(Je)}catch(be){Z(be.message)}le(!1)}if(u)return l.jsx("div",{className:"empty",children:"agent not found"});if(!c)return l.jsx("div",{className:"empty",children:"loading…"});const ge=ae=>l.jsxs("div",{className:"team-form-row",style:{marginTop:8},children:[l.jsx("button",{className:"run-btn",disabled:T,onClick:()=>{W(ae)},children:T?"saving…":"save"}),l.jsx("button",{className:"open-raw",disabled:T,onClick:()=>(k(""),Z("")),children:"cancel"})]});return l.jsxs("div",{className:"member-view",children:[l.jsxs("div",{className:"detail-head",children:[l.jsx("span",{className:"agent-avatar lg",children:l.jsx("span",{"aria-hidden":!0,children:c.emoji})}),l.jsx("h1",{children:c.name}),l.jsx("span",{className:"chip agent",children:c.harness}),c.model&&l.jsx("span",{className:"chip",children:c.model}),c.effort&&l.jsxs("span",{className:"chip",children:["effort: ",c.effort]}),c.archived&&l.jsxs("span",{className:"chip archived-chip",children:[l.jsx(V,{name:"inventory_2",className:"ms-sm"})," archived"]}),l.jsx("span",{className:"spacer"}),l.jsx(Ee,{href:`/agents/${encodeURIComponent(i)}/edit`,className:"open-raw",children:"edit"}),c.archived?l.jsxs("button",{className:"run-btn tonal",disabled:T,onClick:()=>{ve(!1)},children:[l.jsx(V,{name:"unarchive",className:"ms-sm"})," ",T?"…":"unarchive"]}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"open-raw",disabled:T,title:"Hide this agent from the roster — restorable any time",onClick:()=>{ve(!0)},children:[l.jsx(V,{name:"archive",className:"ms-sm"})," archive"]}),l.jsx("button",{className:"run-btn",disabled:h,onClick:async()=>{m(!0),await us("claude",{kind:"team",member:i}),m(!1)},children:h?"starting…":"new session"})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"m3-list",children:[l.jsxs("button",{type:"button",className:"m3-row m3-toggle",onClick:()=>y(!p),children:[l.jsx("span",{className:"m3-ico",children:l.jsx(V,{name:"badge"})}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:"role"}),!p&&l.jsx("span",{className:"m3-sub m3-ellipsis",children:(c.system||"").trim().split(`
206
- `)[0]||"empty — expand to give this agent a role"})]}),l.jsx("span",{className:`m3-chev ${p?"open":""}`,children:l.jsx(V,{name:"expand_more",className:"ms-sm"})})]}),p&&x!=="role"&&l.jsxs("div",{className:"m3-expand",children:[l.jsx("pre",{children:c.system||"(empty — click edit to give this agent a role)"}),l.jsxs("div",{className:"team-form-row",style:{marginTop:10},children:[l.jsxs("button",{className:"open-raw",onClick:()=>{j(c.system),k("role"),Z("")},children:[l.jsx(V,{name:"edit",className:"ms-sm"})," edit role"]}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"m3-sub",children:["agents/",c.slug,"/system.md"]})]})]}),p&&x==="role"&&l.jsxs("div",{className:"m3-expand",children:[l.jsx("textarea",{className:"concept-edit",rows:Math.min(24,Math.max(8,E.split(`
207
- `).length+2)),value:E,placeholder:"You are the ... for this project. Your job is ...",onChange:ae=>j(ae.target.value),spellCheck:!1}),ge({system:E})]}),l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(V,{name:"account_tree"})}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:"workflows"}),x==="workflows"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"wf-checks",children:[(I?.workflows??[]).map(ae=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:M.includes(ae.slug),onChange:be=>ee(ae.slug,be.target.checked)}),l.jsx("b",{children:ae.slug}),ae.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",ae.description]})]},ae.slug)),(I?.workflows??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no workflows in this project"})]}),ge({workflows:M})]}):c.workflows.length===0?l.jsx("span",{className:"m3-sub",children:"none connected — the agent can run any workflow you connect"}):l.jsx("span",{className:"m3-chips",children:c.workflows.map(ae=>l.jsx(Ee,{href:`/workflows/${encodeURIComponent(ae)}`,className:"chip",children:ae},ae))})]}),x!=="workflows"&&l.jsx("button",{className:"open-raw",onClick:()=>{N(c.workflows),k("workflows"),Z("")},children:"edit"})]}),l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(V,{name:"menu_book"})}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:"knowledge"}),x==="knowledge"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"wf-checks",children:[(q?.bundles??[]).map(ae=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:M.includes(ae.name),onChange:be=>ee(ae.name,be.target.checked)}),l.jsx("b",{children:ae.name}),l.jsxs("span",{className:"opt-hint",children:[" — ",ae.concepts," concepts"]})]},ae.name)),(q?.bundles??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no knowledge bundles in this project"})]}),ge({knowledge:M})]}):c.knowledge.length===0?l.jsx("span",{className:"m3-sub",children:"none connected — connected bundles are read and kept current by the agent"}):l.jsx("span",{className:"m3-chips",children:c.knowledge.map(ae=>l.jsx(Ee,{href:`/knowledge/${encodeURIComponent(ae)}`,className:"chip",children:ae},ae))})]}),x!=="knowledge"&&l.jsx("button",{className:"open-raw",onClick:()=>{N(c.knowledge),k("knowledge"),Z("")},children:"edit"})]}),l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(V,{name:"extension"})}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:"shared skills"}),x==="skills"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"wf-checks",children:[l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:K,onChange:ae=>X(ae.target.checked)}),l.jsx("b",{children:"all skills"}),l.jsx("span",{className:"opt-hint",children:" — every discovered skill, including future ones"})]}),!K&&(H?.skills??[]).map(ae=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:M.includes(ae.name),onChange:be=>ee(ae.name,be.target.checked)}),l.jsxs("b",{children:["/",ae.name]}),ae.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",ae.description]})]},ae.name)),!K&&(H?.skills??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no skills found (.claude/skills, project or user)"})]}),ge({skills:K?void 0:M})]}):c.skills===void 0?l.jsx("span",{className:"m3-sub",children:"all discovered skills (default) — invoke with /name in a session"}):c.skills.length===0?l.jsx("span",{className:"m3-sub",children:"none — this agent runs without skills"}):l.jsx("span",{className:"m3-chips",children:c.skills.map(ae=>l.jsxs("span",{className:"chip",children:["/",ae]},ae))})]}),x!=="skills"&&l.jsx("button",{className:"open-raw",onClick:()=>{X(c.skills===void 0),N(c.skills??[]),k("skills"),Z("")},children:"edit"})]})]}),fe&&l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",fe]})]}),l.jsx(Tb,{slug:i}),l.jsx(Eb,{slug:i})]})}const kb=`---
208
- description: What this skill is for (one line)
209
- ---
210
-
211
- Instructions this agent follows when the skill applies or is invoked with /<name>.
212
- `;function Tb({slug:i}){const o=He(`/api/team/${encodeURIComponent(i)}/skills`,!1)?.skills??[],[u,f]=C.useState(null),[h,m]=C.useState(!1),[p,y]=C.useState("");async function x(j){y("");const M=await fetch(`/api/team/${encodeURIComponent(i)}/skills/${encodeURIComponent(j)}`),N=await M.json().catch(()=>null);if(!M.ok||!N||N.error)return void y(N?.error??"could not load skill");f({name:j,content:N.content??"",isNew:!1})}async function k(){if(!u)return;m(!0),y("");const M=await(await fetch(`/api/team/${encodeURIComponent(i)}/skills`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:u.name,content:u.content})})).json().catch(()=>({error:"save failed"}));m(!1),M.error?y(M.error):f(null)}async function E(j){window.confirm(`Delete skill "/${j}" of this agent (its folder is removed)?`)&&(await fetch(`/api/team/${encodeURIComponent(i)}/skills/${encodeURIComponent(j)}`,{method:"DELETE"}).catch(()=>{}),u?.name===j&&f(null))}return l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"own skills — only this agent"}),l.jsx("span",{className:"spacer"}),!u&&l.jsxs("button",{className:"open-raw",onClick:()=>{f({name:"",content:kb,isNew:!0}),y("")},children:[l.jsx(V,{name:"add",className:"ms-sm"})," new skill"]})]}),o.length===0&&!u&&l.jsxs("div",{className:"viewer-note",children:["none — skills in ",l.jsxs("code",{children:["agents/",i,"/skills/"]})," are private to this agent; skills for every agent live in the workspace skills folder."]}),o.length>0&&!u&&l.jsx("div",{className:"m3-list",children:o.map(j=>l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(V,{name:"extension"})}),l.jsxs("span",{className:"m3-body",children:[l.jsxs("span",{className:"m3-head",children:["/",j.name]}),l.jsx("span",{className:"m3-sub",children:j.description||l.jsx("code",{children:"SKILL.md"})})]}),l.jsxs("button",{className:"open-raw",onClick:()=>{x(j.name)},children:[l.jsx(V,{name:"edit",className:"ms-sm"})," edit"]}),l.jsx("button",{className:"open-raw",onClick:()=>{E(j.name)},children:l.jsx(V,{name:"close",className:"ms-sm"})})]},j.name))}),u&&l.jsxs("div",{className:"team-form",children:[l.jsx("div",{className:"team-form-row",children:l.jsxs("label",{className:"team-field",style:{flex:1},children:["name — invoked as /<name>",l.jsx("input",{value:u.name,placeholder:"e.g. report-html",disabled:!u.isNew,onChange:j=>f({...u,name:j.target.value})})]})}),l.jsxs("label",{className:"team-field",children:["SKILL.md — frontmatter (description) + the instructions",l.jsx("textarea",{className:"concept-edit",rows:Math.min(28,Math.max(12,u.content.split(`
213
- `).length+2)),value:u.content,spellCheck:!1,onChange:j=>f({...u,content:j.target.value})})]}),l.jsxs("div",{className:"team-form-row",children:[l.jsx("button",{className:"run-btn",disabled:h||!u.name.trim(),onClick:()=>{k()},children:h?"saving…":"save"}),l.jsx("button",{className:"open-raw",disabled:h,onClick:()=>f(null),children:"cancel"})]})]}),p&&l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",p]})]})}function Eb({slug:i}){const o=He(`/api/team/${encodeURIComponent(i)}/routines`,!1)?.routines??[],[u,f]=C.useState(null),[h,m]=C.useState(""),[p,y]=C.useState("");async function x(j){m("");const N=await(await fetch(`/api/team/${encodeURIComponent(i)}/routines`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(j)})).json();return N.error?(m(N.error),!1):!0}async function k(j){y(j),m("");const N=await(await fetch(`/api/team/${encodeURIComponent(i)}/routines/${encodeURIComponent(j)}/run`,{method:"POST"})).json();y(""),N.error?m(N.error):N.chatId&&ga(`/agents/${encodeURIComponent(i)}/chat/${N.chatId}`)}async function E(j){window.confirm(`Delete routine "${j}"?`)&&await fetch(`/api/team/${encodeURIComponent(i)}/routines/${encodeURIComponent(j)}`,{method:"DELETE"}).catch(()=>{})}return l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"routines — scheduled prompts"}),l.jsx("span",{className:"spacer"}),!u&&l.jsxs("button",{className:"open-raw",onClick:()=>f({name:"",schedule:"0 9 * * 1-5",prompt:"",enabled:!0}),children:[l.jsx(V,{name:"add",className:"ms-sm"})," new routine"]})]}),o.length===0&&!u&&l.jsx("div",{className:"viewer-note",children:"none — a routine messages this agent on a schedule (cron, server local time) and each run opens a new session with the result."}),o.length>0&&l.jsx("div",{className:"m3-list",children:o.map(j=>l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(V,{name:"schedule"})}),l.jsxs("span",{className:"m3-body",children:[l.jsxs("span",{className:"m3-head",children:[j.name,j.lastError&&l.jsx("span",{className:"chip stale",title:j.lastError,children:"error"})]}),l.jsxs("span",{className:"m3-sub",children:[l.jsx("code",{children:j.schedule}),j.enabled?j.nextRunAt?` · next ${gl(j.nextRunAt)}`:"":" · paused"," · ",j.lastChatId?l.jsxs(Ee,{href:`/agents/${encodeURIComponent(i)}/chat/${j.lastChatId}`,children:["last run ",gl(j.lastRunAt)]}):"never ran"]})]}),l.jsx("button",{className:"open-raw",disabled:p===j.id,onClick:()=>k(j.id),children:p===j.id?"starting…":l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"play_arrow",className:"ms-sm"})," run"]})}),l.jsx("button",{className:"open-raw",onClick:()=>f({id:j.id,name:j.name,schedule:j.schedule,prompt:j.prompt,enabled:j.enabled}),children:"edit"}),l.jsx("button",{className:"open-raw",onClick:()=>{E(j.id)},children:"delete"}),l.jsxs("label",{className:"m3-switch",title:j.enabled?"enabled — click to pause":"paused — click to enable",children:[l.jsx("input",{type:"checkbox",checked:j.enabled,onChange:()=>{x({id:j.id,name:j.name,schedule:j.schedule,prompt:j.prompt,enabled:!j.enabled})}}),l.jsx("span",{className:"m3-switch-track"})]})]},j.id))}),u&&l.jsxs("div",{className:"team-form",children:[l.jsxs("div",{className:"team-form-row",children:[l.jsxs("label",{className:"team-field",style:{flex:1},children:["name",l.jsx("input",{value:u.name,placeholder:"e.g. Morning report",onChange:j=>f({...u,name:j.target.value})})]}),l.jsxs("label",{className:"team-field",style:{width:200},children:["schedule (cron)",l.jsx("input",{value:u.schedule,placeholder:"0 9 * * 1-5",onChange:j=>f({...u,schedule:j.target.value})})]}),l.jsxs("label",{className:"team-field wf-checks",style:{width:90},children:["enabled",l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:u.enabled,onChange:j=>f({...u,enabled:j.target.checked})}),"on"]})]})]}),l.jsxs("label",{className:"team-field",children:["prompt — what to ask this agent on each run",l.jsx("textarea",{rows:5,value:u.prompt,placeholder:"Check ... and summarize what changed.",onChange:j=>f({...u,prompt:j.target.value})})]}),l.jsxs("div",{className:"team-form-row",children:[l.jsx("button",{className:"run-btn",disabled:!u.name.trim()||!u.prompt.trim(),onClick:async()=>{await x(u)&&f(null)},children:u.id?"save routine":"create routine"}),l.jsx("button",{className:"open-raw",onClick:()=>(f(null),m("")),children:"cancel"})]})]}),h&&l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",h]})]})}function ap({slug:i}){const[c,o]=C.useState(i?null:M()),[u,f]=C.useState(""),[h,m]=C.useState(!1),y=He("/api/workflows",!1)?.workflows??[],k=He("/api/knowledge",!1)?.bundles??[],j=He("/api/skills",!1)?.skills??[];C.useEffect(()=>{i&&fetch(`/api/team/${encodeURIComponent(i)}`).then(T=>T.ok?T.json():Promise.reject()).then(T=>o({name:T.name,emoji:T.emoji,description:T.description??"",harness:T.harness,model:T.model??"",effort:T.effort??"",group:T.group??"",system:T.system,workflows:T.workflows,knowledge:T.knowledge??[],skillsAll:T.skills===void 0,skills:T.skills??[]})).catch(()=>f("agent not found"))},[i]);function M(){return{name:"",emoji:"🤖",description:"",harness:"claude",model:"",effort:"",group:"",system:"",workflows:[],knowledge:[],skillsAll:!0,skills:[]}}async function N(){if(!c)return;m(!0),f("");const le=await(await fetch(i?`/api/team/${encodeURIComponent(i)}`:"/api/team",{method:i?"PUT":"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...c,skills:c.skillsAll?void 0:c.skills})})).json();m(!1),le.error?f(le.error):ga(`/agents/${encodeURIComponent(le.slug)}/info`)}async function K(){!i||!window.confirm(`Delete agent "${i}" and its definition folder?`)||(await fetch(`/api/team/${encodeURIComponent(i)}`,{method:"DELETE"}).catch(()=>{}),ga("/agents"))}if(!c)return l.jsx("div",{className:"empty",children:u||"loading…"});const X=T=>o({...c,...T});return l.jsxs("div",{className:"new-chat",children:[l.jsx("div",{className:"page-head",children:l.jsx("h1",{children:i?`edit ${i}`:"new agent"})}),l.jsx("section",{className:"panel new-chat-panel",children:l.jsxs("div",{className:"team-form",children:[l.jsxs("div",{className:"team-form-row",children:[l.jsxs("label",{className:"team-field",style:{flex:1},children:["name",l.jsx("input",{value:c.name,placeholder:"e.g. Max",onChange:T=>X({name:T.target.value})})]}),l.jsxs("label",{className:"team-field",style:{width:90},children:["emoji",l.jsx("input",{value:c.emoji,onChange:T=>X({emoji:T.target.value})})]})]}),l.jsx("div",{className:"emoji-pick",children:yb.map(T=>l.jsx("button",{type:"button",className:c.emoji===T?"active":"",onClick:()=>X({emoji:T}),children:T},T))}),l.jsxs("div",{className:"team-form-row",children:[l.jsxs("label",{className:"team-field",style:{flex:1},children:["description",l.jsx("input",{value:c.description,placeholder:"one line: what this agent is for",onChange:T=>X({description:T.target.value})})]}),l.jsxs("label",{className:"team-field",style:{width:180},children:["group",l.jsx("input",{value:c.group,placeholder:"none",onChange:T=>X({group:T.target.value})})]})]}),l.jsxs("div",{className:"team-form-row",children:[l.jsxs("label",{className:"team-field",style:{width:140},children:["harness",l.jsxs("select",{value:c.harness,onChange:T=>X({harness:T.target.value}),children:[l.jsx("option",{value:"claude",children:"claude"}),l.jsx("option",{value:"codex",children:"codex"}),l.jsx("option",{value:"pi",children:"pi"})]})]}),l.jsxs("label",{className:"team-field",style:{flex:1},children:["model",l.jsx("input",{value:c.model,placeholder:"harness default — e.g. sonnet, gpt-5.6-sol",onChange:T=>X({model:T.target.value})})]}),l.jsxs("label",{className:"team-field",style:{width:140},children:["effort",l.jsx("select",{value:c.effort,onChange:T=>X({effort:T.target.value}),children:vb.map(T=>l.jsx("option",{value:T,children:T||"default"},T))})]})]}),l.jsxs("label",{className:"team-field",children:["system prompt — the agent's role",l.jsx("textarea",{rows:10,value:c.system,placeholder:"You are the ... for this project. Your job is ...",onChange:T=>X({system:T.target.value})})]}),l.jsxs("div",{className:"team-field",children:[l.jsx("span",{className:"team-field-label",children:"connected workflows — autoloaded into the agent's context; it can run them"}),l.jsxs("div",{className:"wf-checks",children:[y.map(T=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.workflows.includes(T.slug),onChange:le=>X({workflows:le.target.checked?[...c.workflows,T.slug]:c.workflows.filter(fe=>fe!==T.slug)})}),l.jsx("b",{children:T.slug}),T.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",T.description]})]},T.slug)),y.length===0&&l.jsx("div",{className:"viewer-note",children:"no workflows in this project"})]})]}),l.jsxs("div",{className:"team-field",children:[l.jsx("span",{className:"team-field-label",children:"connected knowledge — OKF bundles the agent consults and maintains"}),l.jsxs("div",{className:"wf-checks",children:[k.map(T=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.knowledge.includes(T.name),onChange:le=>X({knowledge:le.target.checked?[...c.knowledge,T.name]:c.knowledge.filter(fe=>fe!==T.name)})}),l.jsx("b",{children:T.name}),l.jsxs("span",{className:"opt-hint",children:[" — ",T.concepts," concepts"]})]},T.name)),k.length===0&&l.jsx("div",{className:"viewer-note",children:"no knowledge bundles in this project"})]})]}),l.jsxs("div",{className:"team-field",children:[l.jsx("span",{className:"team-field-label",children:"connected skills — workspace skill packages (see the skills tab); invoked with /name in sessions"}),l.jsxs("div",{className:"wf-checks",children:[l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.skillsAll,onChange:T=>X({skillsAll:T.target.checked})}),l.jsx("b",{children:"all skills"}),l.jsx("span",{className:"opt-hint",children:" — every discovered skill, including future ones"})]}),!c.skillsAll&&j.map(T=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.skills.includes(T.name),onChange:le=>X({skills:le.target.checked?[...c.skills,T.name]:c.skills.filter(fe=>fe!==T.name)})}),l.jsxs("b",{children:["/",T.name]}),T.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",T.description]})]},T.name)),!c.skillsAll&&j.length===0&&l.jsx("div",{className:"viewer-note",children:"no skills found (.claude/skills, project or user)"})]})]}),u&&l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",u]}),l.jsxs("div",{className:"team-form-row",children:[l.jsx("button",{className:"run-btn",disabled:!c.name.trim()||h,onClick:N,children:h?"saving…":i?"save":"create"}),l.jsx("span",{className:"spacer"}),i&&l.jsx("button",{className:"stop-btn",onClick:K,children:"delete agent"})]})]})})]})}const vi={enabled:!1,remote:"origin",branch:"",interval:"300",autosync:"pull"};function np(i){const c=i.config.git;return c?{enabled:c.enabled!==!1,remote:c.remote??vi.remote,branch:c.branch??"",interval:String(c.interval??vi.interval),autosync:c.autosync??vi.autosync}:vi}function _b(){const[i,c]=C.useState(null),[o,u]=C.useState(""),[f,h]=C.useState(""),[m,p]=C.useState([]),[y,x]=C.useState(vi),[k,E]=C.useState(!1),[j,M]=C.useState(!1),[N,K]=C.useState(!1),[X,T]=C.useState("");C.useEffect(()=>{fetch("/api/settings").then(H=>H.json()).then(H=>{c(H),u(H.config.name??""),h(H.config.icon??""),p(H.config.switcher??[]),x(np(H))}).catch(()=>T("could not load settings"))},[]);const le=()=>{E(!0),K(!1),T("")};async function fe(){M(!0),T("");try{const H=await fetch("/api/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:o,icon:f,switcher:m,git:{...y,interval:y.interval===""?void 0:Number(y.interval)}})}),W=await H.json();if(!H.ok)throw new Error(W.error||"save failed");c(W),p(W.config.switcher??[]),x(np(W)),E(!1),K(!0),window.dispatchEvent(new Event("kw-meta-refresh"))}catch(H){T(H.message)}finally{M(!1)}}const Z=(H,W)=>{p(ee=>ee.map((ve,ge)=>ge===H?{...ve,...W}:ve)),le()},I=H=>{x(W=>({...W,...H})),le()};if(!i)return l.jsx("div",{className:"empty",children:X||"loading…"});const q=[["port",String(i.resolved.port),"kraftwerk ui listens here (CLI --port wins)"],["workflows",i.resolved.workflowsRoot??"— none found","workflow definitions"],["output",i.resolved.outputDir,"run artifacts"],["knowledge",i.config.knowledge??"knowledge","OKF knowledge bundles"],["agents",i.config.agents??"agents","team agent definitions"],["skills",i.config.skills??"skills","workspace skills"]];return l.jsxs("div",{className:"settings-screen",children:[l.jsxs("div",{className:"settings-head",children:[l.jsxs("h1",{children:[l.jsx(V,{name:"settings",className:"ms-lg"})," Settings"]}),l.jsx("span",{className:"spacer"}),X&&l.jsx("span",{className:"settings-err",children:X}),N&&!k&&l.jsxs("span",{className:"settings-saved",children:[l.jsx(V,{name:"check",className:"ms-sm"})," saved"]}),l.jsx("button",{className:"run-btn",disabled:j||!k,onClick:()=>{fe()},children:j?"saving…":"save changes"})]}),l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"workspace"})}),l.jsxs("div",{className:"team-form",children:[l.jsxs("div",{className:"team-form-row",children:[l.jsxs("label",{className:"team-field",style:{width:90},children:["icon",l.jsx("input",{value:f,placeholder:"🤖",onChange:H=>{h(H.target.value),le()}})]}),l.jsxs("label",{className:"team-field",style:{flex:1},children:["name",l.jsx("input",{value:o,placeholder:"my workspace",onChange:H=>{u(H.target.value),le()}})]})]}),l.jsx("div",{className:"settings-note",children:"Shown in the header, browser tab and to other workspaces discovering this one."})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"workspace switcher"}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"run-btn tonal",onClick:()=>{p(H=>[...H,{name:"",url:"http://localhost:"}]),le()},children:[l.jsx(V,{name:"add",className:"ms-sm"})," add entry"]})]}),l.jsxs("div",{className:"team-form",children:[m.length===0&&l.jsx("div",{className:"settings-note",children:"No manual entries."}),m.map((H,W)=>l.jsxs("div",{className:"team-form-row",children:[l.jsxs("label",{className:"team-field",style:{width:70},children:["icon",l.jsx("input",{value:H.icon??"",placeholder:"•",onChange:ee=>Z(W,{icon:ee.target.value})})]}),l.jsxs("label",{className:"team-field",style:{flex:1},children:["name",l.jsx("input",{value:H.name,placeholder:"other workspace",onChange:ee=>Z(W,{name:ee.target.value})})]}),l.jsxs("label",{className:"team-field",style:{flex:1.4},children:["url",l.jsx("input",{value:H.url,placeholder:"http://localhost:1982",onChange:ee=>Z(W,{url:ee.target.value})})]}),l.jsx("button",{className:"row-x settings-row-x",title:"remove entry",onClick:()=>{p(ee=>ee.filter((ve,ge)=>ge!==W)),le()},children:l.jsx(V,{name:"close",className:"ms-sm"})})]},W)),l.jsx("div",{className:"settings-note",children:"Running workspaces on this machine are discovered automatically — manual entries are for remote instances or extra links."})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"git sync"}),l.jsx("span",{className:"spacer"}),l.jsxs("a",{className:"run-btn tonal",href:"#/git",children:[l.jsx(V,{name:"account_tree",className:"ms-sm"})," open git"]})]}),l.jsxs("div",{className:"team-form",children:[l.jsxs("label",{className:"settings-check",children:[l.jsx("input",{type:"checkbox",checked:y.enabled,onChange:H=>I({enabled:H.target.checked})}),"sync workflows, knowledge, agents and skills with a git remote"]}),y.enabled&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"team-form-row",children:[l.jsxs("label",{className:"team-field",style:{flex:1},children:["remote",l.jsx("input",{value:y.remote,placeholder:"origin",onChange:H=>I({remote:H.target.value})})]}),l.jsxs("label",{className:"team-field",style:{flex:1},children:["branch",l.jsx("input",{value:y.branch,placeholder:"checked-out branch",onChange:H=>I({branch:H.target.value})})]}),l.jsxs("label",{className:"team-field",style:{width:120},children:["interval (s)",l.jsx("input",{type:"number",min:0,step:1,value:y.interval,placeholder:"300",onChange:H=>I({interval:H.target.value})})]}),l.jsxs("label",{className:"team-field",style:{width:150},children:["autosync",l.jsxs("select",{value:y.autosync,onChange:H=>I({autosync:H.target.value}),children:[l.jsx("option",{value:"pull",children:"fetch and pull"}),l.jsx("option",{value:"off",children:"fetch only"})]})]})]}),l.jsx("div",{className:"settings-note",children:"The interval fetches in the background (0 turns the timer off); with autosync on it also fast-forwards when behind and nothing is modified locally. Commit and push stay manual on the git screen."})]})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"paths & port"}),l.jsx("span",{className:"spacer"}),l.jsx("code",{className:"settings-file",title:i.configPath,children:i.exists?i.configPath:`${i.configPath} (not created yet)`})]}),l.jsx("div",{className:"settings-kv-list",children:q.map(([H,W,ee])=>l.jsxs("div",{className:"settings-kv",children:[l.jsx("span",{className:"microlabel",children:H}),l.jsx("code",{children:W}),l.jsx("span",{className:"settings-kv-hint",children:ee})]},H))}),l.jsxs("div",{className:"settings-note",style:{padding:"0 18px 14px"},children:["Read-only here — edit ",l.jsx("code",{children:"kraftwerk.yml"})," directly to change these."]})]})]})}const oo={running:{label:"running"},stopped:{label:"stopped"},died:{label:"died",note:"was killed or crashed"},missing:{label:"missing",note:"folder is gone"},orphaned:{label:"orphaned",note:"no kraftwerk.yml any more"}};function Ab(){const[i,c]=C.useState(null),[o,u]=C.useState(""),[f,h]=C.useState({}),[m,p]=C.useState({}),[y,x]=C.useState(null),k=C.useCallback(async()=>{try{const N=await fetch("/api/projects",{cache:"no-store"});if(N.ok){c(await N.json()),u("");return}u(N.status===404?"This workspace runs a kraftwerk without the projects API. Update it and restart its UI.":`Could not load the project registry (HTTP ${N.status}).`)}catch(N){u(N.message||"Could not reach this workspace's server.")}},[]);C.useEffect(()=>{let N=!0,K;const X=async()=>{await k(),N&&(K=setTimeout(X,6e3))};return X(),()=>{N=!1,clearTimeout(K)}},[k]);const E=N=>N.root??N.url,j=async(N,K)=>{const X=E(N);h(T=>({...T,[X]:K})),p(T=>({...T,[X]:""})),x(null);try{const T=K==="stop"?{root:N.root,url:N.url}:{root:N.root},le=await po(`/api/projects/${K}`,T);if(!le.ok)throw new Error(le.error||"failed");window.dispatchEvent(new Event("kw-meta-refresh"))}catch(T){p(le=>({...le,[X]:T.message}))}finally{h(T=>{const le={...T};return delete le[X],le}),k()}},M=i?.filter(N=>N.live).length??0;return l.jsxs("div",{className:"settings-screen ws-screen",children:[l.jsxs("div",{className:"settings-head",children:[l.jsxs("h1",{children:[l.jsx(V,{name:"hub",className:"ms-lg"})," Workspaces"]}),l.jsx("span",{className:"spacer"}),i&&l.jsxs("span",{className:"settings-note",children:[i.length," known · ",M," running"]}),i&&o&&l.jsx("span",{className:"settings-err",children:o})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"projects on this machine"}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"settings-note",children:["registry: ",l.jsx("code",{children:"~/.kraftwerk/projects"})]})]}),!i&&!o&&l.jsx("div",{className:"ws-empty",children:"loading…"}),!i&&o&&l.jsxs("div",{className:"ws-empty ws-load-error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",o]}),i&&i.length===0&&l.jsx("div",{className:"ws-empty",children:"No workspaces known yet."}),i?.map(N=>{const K=E(N),X=f[K],T=!N.live&&!!N.root&&(N.exists===!1||N.hasConfig===!1);return l.jsxs("div",{className:`ws-row state-${N.state} ${N.current?"current":""}`,children:[l.jsx("span",{className:"switcher-icon ws-icon",children:N.icon||"•"}),l.jsxs("div",{className:"ws-main",children:[l.jsxs("div",{className:"ws-title",children:[N.live&&!N.current?l.jsx("a",{href:N.url,className:"ws-name",children:N.name}):l.jsx("span",{className:"ws-name",children:N.name}),N.current&&l.jsx("span",{className:"switcher-hint",children:"current"}),l.jsxs("span",{className:`ws-state ws-state-${N.state}`,children:[N.live&&l.jsx("span",{className:"live-dot"}),oo[N.state].label]}),oo[N.state].note&&l.jsx("span",{className:"ws-note",children:oo[N.state].note})]}),l.jsx("div",{className:"ws-root",title:N.root,children:N.rootLabel??l.jsx("span",{className:"ws-dim",children:"no root recorded (started by an older version)"})}),l.jsxs("div",{className:"ws-meta",children:[N.state!=="missing"&&N.state!=="orphaned"&&l.jsx("span",{children:N.url.replace(/^https?:\/\//,"")}),N.counts&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{children:[N.counts.agents," agents"]}),l.jsxs("span",{children:[N.counts.workflows," workflows"]}),l.jsxs("span",{children:[N.counts.runs," runs"]}),l.jsxs("span",{children:[N.counts.chats," chats"]})]}),N.lastStarted&&l.jsxs("span",{title:N.lastStarted,children:["started ",yi(N.lastStarted)]}),!N.live&&N.lastStopped&&l.jsxs("span",{title:N.lastStopped,children:["stopped ",yi(N.lastStopped)]}),N.startCount!=null&&l.jsxs("span",{children:[N.startCount,"× launched"]}),N.firstSeen&&l.jsxs("span",{title:N.firstSeen,children:["first seen ",yi(N.firstSeen)]})]}),m[K]&&l.jsx("div",{className:"settings-err",children:m[K]})]}),l.jsxs("div",{className:"ws-actions",children:[N.live&&!N.current&&l.jsxs("a",{className:"ws-btn",href:N.url,title:"Open this workspace",children:[l.jsx(V,{name:"open_in_new",className:"ms-sm"})," open"]}),!N.live&&N.root&&N.exists!==!1&&!N.dirGone&&l.jsxs("button",{className:"ws-btn primary",disabled:!!X,onClick:()=>{j(N,"start")},children:[l.jsx(V,{name:X==="start"?"progress_activity":"play_arrow",className:"ms-sm"}),X==="start"?"starting…":"start"]}),N.live&&!N.current&&l.jsxs("button",{className:"ws-btn danger",disabled:!!X,onClick:()=>{j(N,"stop")},children:[l.jsx(V,{name:X==="stop"?"progress_activity":"stop",className:"ms-sm"}),X==="stop"?"stopping…":"stop"]}),T&&y!==K&&l.jsxs("button",{className:"ws-btn",disabled:!!X,title:"Drop this project from the registry (files untouched)",onClick:()=>x(K),children:[l.jsx(V,{name:"delete",className:"ms-sm"})," remove"]}),T&&y===K&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"ws-btn danger",onClick:()=>{j(N,"forget")},children:[l.jsx(V,{name:"delete",className:"ms-sm"})," confirm remove"]}),l.jsx("button",{className:"ws-btn",onClick:()=>x(null),children:"cancel"})]})]})]},K)})]}),l.jsxs("p",{className:"settings-note",children:["Start launches ",l.jsx("code",{children:"kraftwerk ui"})," detached in the project root (log in ",l.jsx("code",{children:"~/.kraftwerk/logs"}),"). Stop sends SIGTERM to the running server. Remove is offered only for records whose root no longer holds a ",l.jsx("code",{children:"kraftwerk.yml"})," — the same from the terminal:"," ",l.jsx("code",{children:"kraftwerk projects"}),"."]})]})}function Cb(i){if(i<60)return`${i}s`;const c=Math.round(i/60);if(c<60)return`${c} min`;const o=Math.floor(c/60),u=c%60;return u?`${o} h ${u} min`:`${o} h`}const Rb=[[/^(\+\+\+|---|diff |index )/,"d-meta"],[/^@@/,"d-hunk"],[/^\+/,"d-add"],[/^-/,"d-del"]],zb=i=>Rb.find(([c])=>c.test(i))?.[1]??"";function Ob({file:i}){const[c,o]=C.useState(null),[u,f]=C.useState(!1),[h,m]=C.useState("");return C.useEffect(()=>{let p=!0;return fetch(`/api/git/diff?path=${encodeURIComponent(i)}`).then(y=>y.json()).then(y=>{p&&(o(y.diff??""),f(!!y.truncated),m(y.error??""))}).catch(()=>p&&m("could not load the diff")),()=>{p=!1}},[i]),h?l.jsx("div",{className:"git-diff git-diff-error",children:h}):c===null?l.jsx("div",{className:"git-diff",children:"loading…"}):c.trim()?l.jsxs("pre",{className:"git-diff",children:[c.split(`
214
- `).map((p,y)=>l.jsxs("span",{className:zb(p),children:[p||" ",`
215
- `]},y)),u&&l.jsxs("span",{className:"d-meta",children:["… diff truncated, see the rest in a terminal",`
216
- `]})]}):l.jsx("div",{className:"git-diff",children:"no textual diff (binary or empty)"})}function Db(){const[i,c]=C.useState(null),[o,u]=C.useState(new Set),[f,h]=C.useState(new Set),[m,p]=C.useState(""),[y,x]=C.useState(""),[k,E]=C.useState(""),[j,M]=C.useState(""),N=C.useCallback(async()=>{try{const Z=await fetch("/api/git",{cache:"no-store"});Z.ok&&c(await Z.json())}catch{}},[]);C.useEffect(()=>{let Z=!0,I;const q=async()=>{await N(),Z&&(I=setTimeout(q,6e3))};return q(),()=>{Z=!1,clearTimeout(I)}},[N]),C.useEffect(()=>{if(!i?.files)return;const Z=new Set(i.files.filter(I=>I.syncable).map(I=>I.path));u(I=>{const q=new Set([...I].filter(H=>Z.has(H)));return q.size===I.size?I:q})},[i]);const K=async(Z,I)=>{x(Z),E(""),M("");try{const q=await po(`/api/git/${Z}`,I);q.ok?M(Z==="push"?"pushed":Z==="pull"?"pulled":"fetched"):E(q.error||`${Z} failed`)}catch(q){E(q.message||`${Z} failed`)}finally{x("")}N()},X=async()=>{x("commit"),E(""),M("");try{const Z=await po("/api/git/commit",{paths:[...o],message:m});Z.ok?(M(`committed ${o.size} file${o.size===1?"":"s"}`),u(new Set),p("")):E(Z.error||"commit failed")}catch(Z){E(Z.message||"commit failed")}finally{x("")}N()};if(!i)return l.jsx("div",{className:"settings-screen",children:l.jsx("div",{className:"ws-empty",children:"loading…"})});if(!i.enabled)return l.jsxs("div",{className:"settings-screen",children:[l.jsx("div",{className:"settings-head",children:l.jsxs("h1",{children:[l.jsx(V,{name:"cloud_sync",className:"ms-lg"})," Git sync"]})}),l.jsx("section",{className:"panel",children:l.jsxs("div",{className:"ws-empty",children:["Git sync is off. Turn it on in ",l.jsx("a",{href:"#/settings",children:"settings"}),", or add a ",l.jsx("code",{children:"git:"})," block to kraftwerk.yml."]})})]});const T=(i.files??[]).filter(Z=>Z.syncable),le=(i.files??[]).filter(Z=>!Z.syncable),fe=(Z,I)=>u(q=>{const H=new Set(q);return I?H.add(Z):H.delete(Z),H});return l.jsxs("div",{className:"settings-screen ws-screen",children:[l.jsxs("div",{className:"settings-head",children:[l.jsxs("h1",{children:[l.jsx(V,{name:"cloud_sync",className:"ms-lg"})," Git sync"]}),l.jsx("span",{className:"spacer"}),j&&l.jsxs("span",{className:"settings-saved",children:[l.jsx(V,{name:"check",className:"ms-sm"})," ",j]}),k&&l.jsx("span",{className:"settings-err",children:k})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"branch"}),l.jsx("span",{className:"spacer"}),i.lastFetch&&l.jsxs("span",{className:"settings-note",title:i.lastFetch,children:["fetched ",yi(i.lastFetch)]}),i.lastError&&l.jsxs("span",{className:"settings-err git-sync-err",title:i.lastError,children:[l.jsx(V,{name:"cloud_off",className:"ms-sm"})," ",i.lastError.split(`
217
- `)[0]]})]}),i.error?l.jsxs("div",{className:"ws-empty ws-load-error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",i.error]}):l.jsxs("div",{className:"git-head",children:[l.jsxs("div",{className:"git-branch",children:[l.jsx(V,{name:"account_tree",className:"ms-sm"}),l.jsx("strong",{children:i.branch}),i.upstream?l.jsxs("span",{className:"settings-note",children:["tracking ",i.upstream]}):l.jsx("span",{className:"settings-note",children:"no upstream yet, push sets one"})]}),l.jsxs("div",{className:"git-counts",children:[i.diverged&&l.jsx("span",{className:"git-diverged",children:"diverged, resolve in a terminal"}),!!i.behind&&l.jsxs("span",{className:"git-behind",children:[i.behind," behind"]}),!!i.ahead&&l.jsxs("span",{className:"git-ahead",children:[i.ahead," ahead"]}),!i.ahead&&!i.behind&&l.jsx("span",{className:"settings-note",children:"up to date"})]}),l.jsxs("div",{className:"ws-actions",children:[l.jsxs("button",{className:"ws-btn",disabled:!!y,onClick:()=>{K("fetch")},children:[l.jsx(V,{name:y==="fetch"?"progress_activity":"refresh",className:"ms-sm"})," fetch"]}),l.jsxs("button",{className:"ws-btn",disabled:!!y||!i.behind||i.diverged,title:i.diverged?"Diverged. Resolve in a terminal.":"Fast-forward to the remote",onClick:()=>{K("pull")},children:[l.jsx(V,{name:y==="pull"?"progress_activity":"download",className:"ms-sm"})," pull"]}),l.jsxs("button",{className:"ws-btn primary",disabled:!!y||!i.ahead&&!!i.upstream,title:i.upstream?"Push to the upstream":"Push and set the upstream",onClick:()=>{K("push")},children:[l.jsx(V,{name:y==="push"?"progress_activity":"upload",className:"ms-sm"})," push"]})]})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"changes"}),l.jsx("span",{className:"spacer"}),l.jsx("span",{className:"settings-note",children:T.length===0?"workspace clean":`${o.size} of ${T.length} selected`})]}),T.length===0&&le.length===0&&l.jsx("div",{className:"ws-empty",children:"Nothing changed under the workspace paths."}),T.map(Z=>l.jsxs("div",{className:"git-row",children:[l.jsx("label",{className:"git-pick",children:l.jsx("input",{type:"checkbox",checked:o.has(Z.path),onChange:I=>fe(Z.path,I.target.checked)})}),l.jsxs("button",{className:"git-file",onClick:()=>h(I=>{const q=new Set(I);return q.has(Z.path)?q.delete(Z.path):q.add(Z.path),q}),children:[l.jsx(V,{name:f.has(Z.path)?"expand_more":"chevron_right",className:"ms-sm"}),l.jsx("span",{className:`git-status s-${Z.status}`,children:Z.status}),l.jsx("span",{className:"git-path",children:Z.path})]}),f.has(Z.path)&&l.jsx(Ob,{file:Z.path})]},Z.path)),T.length>0&&l.jsxs("div",{className:"git-commit",children:[l.jsx("input",{className:"git-message",placeholder:"Commit message",value:m,onChange:Z=>p(Z.target.value),onKeyDown:Z=>{Z.key==="Enter"&&!y&&m.trim()&&o.size>0&&X()}}),l.jsx("button",{className:"ws-btn",disabled:o.size===T.length,onClick:()=>u(new Set(T.map(Z=>Z.path))),children:"select all"}),l.jsxs("button",{className:"ws-btn primary",disabled:!!y||o.size===0||!m.trim(),onClick:()=>{X()},children:[l.jsx(V,{name:y==="commit"?"progress_activity":"check",className:"ms-sm"}),"commit ",o.size||""]})]}),le.length>0&&l.jsxs("details",{className:"git-blocked",children:[l.jsxs("summary",{children:[le.length,i.blockedHidden?"+":""," change",le.length===1&&!i.blockedHidden?"":"s"," outside the workspace paths"]}),le.map(Z=>l.jsxs("div",{className:"git-row blocked",children:[l.jsx("span",{className:"git-status s-blocked",children:Z.status}),l.jsx("span",{className:"git-path",children:Z.path}),l.jsx("span",{className:"settings-note",children:Z.reason})]},Z.path)),!!i.blockedHidden&&l.jsx("div",{className:"git-row blocked",children:l.jsxs("span",{className:"settings-note",children:["and ",i.blockedHidden," more, not listed"]})})]})]}),l.jsxs("p",{className:"settings-note",children:["Synced paths: ",(i.scope??[]).map((Z,I)=>l.jsxs("span",{children:[I>0&&", ",l.jsx("code",{children:Z})]},Z)),". Run artifacts and files like ",l.jsx("code",{children:".env"})," are never staged."," ",i.interval?`Fetches every ${Cb(i.interval)}${i.autosync==="pull"?" and fast-forwards when the working tree is clean":""}. `:"Background fetching is off. ","Commit and push are always manual."]})]})}const Mb=C.lazy(()=>Gx(()=>import("./editor-BABv2LmA.js").then(i=>i.w),__vite__mapDeps([0,1])).then(i=>({default:i.EditorScreen})));function Ub(){const c=Yx().split("/").filter(Boolean),[o,u]=C.useState(""),[f,h]=C.useState(""),[m,p]=C.useState(""),[y,x]=C.useState(!1),[k,E]=C.useState([]);C.useEffect(()=>{let M=!0,N;const K=async()=>{try{const T=await fetch("/api/meta",{cache:"no-store"}).then(le=>le.json());if(!M)return;u(T.projectName??""),h(T.projectIcon??""),p(T.projectRootLabel??""),x(!!T.git),E(Array.isArray(T.switcher)?T.switcher:[])}catch{}M&&(N=setTimeout(K,3e4))};K();const X=()=>{clearTimeout(N),K()};return window.addEventListener("kw-meta-refresh",X),()=>{M=!1,clearTimeout(N),window.removeEventListener("kw-meta-refresh",X)}},[]),C.useEffect(()=>{if(Xx(o?`${o} — kraftwerk`:"kraftwerk inspector"),!f)return;const M=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="0.9em" font-size="85">${f}</text></svg>`;let N=document.querySelector('link[rel="icon"]');N||(N=document.createElement("link"),N.rel="icon",document.head.appendChild(N)),N.href=`data:image/svg+xml,${encodeURIComponent(M)}`},[o,f]);let j;return c[0]==="runs"&&c[1]?j=l.jsx(zy,{id:c[1]}):c[0]==="runs"?j=l.jsx(qb,{}):c[0]==="workflows"&&c[1]?j=l.jsx(Xy,{slug:decodeURIComponent(c[1])}):c[0]==="workflows"?j=l.jsx(Yy,{}):c[0]==="chats"?j=l.jsx(ep,{seg:c}):c[0]==="skills"?j=l.jsx(pb,{name:c[1]?decodeURIComponent(c[1]):void 0}):c[0]==="settings"?j=l.jsx(_b,{}):c[0]==="workspaces"?j=l.jsx(Ab,{}):c[0]==="git"?j=l.jsx(Db,{}):c[0]==="agents"||c[0]==="team"?j=l.jsx(ep,{seg:c.slice(1)}):c[0]==="knowledge"?j=l.jsx(sb,{bundle:c[1]?decodeURIComponent(c[1]):void 0,conceptId:c.length>2?c.slice(2).map(decodeURIComponent).join("/"):void 0}):j=l.jsx(Fy,{}),c[0]==="edit"&&c[1]&&c.length>2?l.jsx(C.Suspense,{fallback:l.jsx("div",{className:"empty",children:"loading editor…"}),children:l.jsx(Mb,{bundle:decodeURIComponent(c[1]),conceptId:c.slice(2).map(decodeURIComponent).join("/")},c.slice(1).join("/"))}):l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:"topbar",children:[l.jsxs("span",{className:"wordmark",children:[l.jsx("a",{href:"#/",className:"home-link",title:"Dashboard",children:f||l.jsx(V,{name:"home"})}),o&&l.jsx(Bb,{name:o,icon:f,root:m,entries:k})]}),l.jsxs("nav",{children:[l.jsxs("a",{href:"#/agents",children:[l.jsx(V,{name:"groups"})," agents"]}),l.jsxs("a",{href:"#/knowledge",children:[l.jsx(V,{name:"menu_book"})," context & knowledge"]}),l.jsxs("a",{href:"#/workflows",children:[l.jsx(V,{name:"account_tree"})," workflows"]}),l.jsxs("a",{href:"#/runs",children:[l.jsx(V,{name:"history"})," workflow runs"]}),l.jsxs("a",{href:"#/skills",children:[l.jsx(V,{name:"extension"})," skills"]}),y&&l.jsx(Lb,{})]}),l.jsx("span",{className:"spacer"}),l.jsx($b,{}),l.jsx(Gb,{}),l.jsx(Yb,{})]}),l.jsx("main",{className:"shell",children:j})]})}function Lb(){const i=He("/api/git",!1,15e3),c=i?.files?.filter(o=>o.syncable).length??0;return l.jsxs("a",{href:"#/git",children:[l.jsx(V,{name:"cloud_sync"})," git",!!i?.behind&&l.jsxs("span",{className:"git-badge behind",children:[i.behind,"↓"]}),!!i?.ahead&&l.jsxs("span",{className:"git-badge ahead",children:[i.ahead,"↑"]}),!i?.ahead&&!i?.behind&&!!c&&l.jsx("span",{className:"git-badge dirty",children:c})]})}function jo({label:i}){return!Ba()||!i?null:l.jsx("span",{className:"switcher-root",title:i,children:l.jsx("span",{dir:"ltr",children:i})})}function Hb({entry:i}){const[c,o]=C.useState("idle"),[u,f]=C.useState(""),h=i.exists===!1,m=async()=>{o("starting"),f("");try{const p=await fetch("/api/projects/start",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({root:i.root})}),y=await p.json();if(!y.ok)throw new Error(y.error||`HTTP ${p.status}`);if(window.dispatchEvent(new Event("kw-meta-refresh")),y.live&&y.url){window.location.assign(y.url);return}for(let x=0;x<12;x++){await new Promise(k=>setTimeout(k,1e3));try{const E=(await fetch("/api/meta",{cache:"no-store"}).then(j=>j.json())).switcher?.find(j=>j.root===i.root&&j.live);if(E){window.location.assign(E.url);return}}catch{}}throw new Error("started, but the UI did not answer yet — see ~/.kraftwerk/logs")}catch(p){o("error"),f(p.message)}};return l.jsxs("span",{className:`switcher-item stopped ${h?"missing":""}`,role:"menuitem",children:[l.jsx("span",{className:"switcher-icon",children:i.icon||"•"}),l.jsxs("span",{className:"switcher-text",children:[l.jsx("span",{className:"switcher-name",children:i.name}),l.jsx(jo,{label:i.rootLabel}),l.jsx("span",{className:"switcher-sub",children:c==="error"?l.jsx("span",{className:"switcher-err",title:u,children:u}):h?"folder missing":`stopped · ${i.url.replace(/^https?:\/\//,"")}`})]}),l.jsxs("button",{className:"switcher-start",disabled:h||c==="starting",title:h?"The project folder no longer exists":"Start the UI for this project",onClick:p=>{p.stopPropagation(),m()},children:[c==="starting"?l.jsx(V,{name:"progress_activity"}):l.jsx(V,{name:"play_arrow"}),c==="starting"?"starting":"start"]})]})}function Bb({name:i,icon:c,root:o,entries:u}){const[f,h]=C.useState(!1),m=Ba();return C.useEffect(()=>{if(!f)return;const p=y=>{y.target.closest(".switcher-wrap")||h(!1)};return window.addEventListener("mousedown",p),()=>window.removeEventListener("mousedown",p)},[f]),u.length===0?l.jsx("span",{className:"env-name",title:o||"Project (kraftwerk.yml: name)",children:i}):l.jsxs("span",{className:"switcher-wrap",children:[l.jsxs("button",{className:"env-name env-switch",title:o?`${o} — switch workspace`:"Switch workspace","aria-haspopup":"menu","aria-expanded":f,onClick:()=>h(p=>!p),children:[i,l.jsx(V,{name:"expand_more"})]}),f&&l.jsxs("div",{className:"switcher-pop",role:"menu",children:[l.jsx("div",{className:"switcher-head",children:"Workspaces"}),l.jsxs("span",{className:"switcher-item current","aria-current":"true",children:[l.jsx("span",{className:"switcher-icon",children:c||"•"}),l.jsxs("span",{className:"switcher-text",children:[l.jsx("span",{className:"switcher-name",children:i}),m&&o?l.jsx(jo,{label:o}):l.jsx("span",{className:"switcher-sub",children:"this workspace"})]}),l.jsx("span",{className:"switcher-hint",children:"current"})]}),u.map(p=>p.live===!1&&p.root?l.jsx(Hb,{entry:p},p.root):l.jsxs("a",{className:"switcher-item",role:"menuitem",href:p.url,children:[l.jsx("span",{className:"switcher-icon",children:p.icon||"•"}),l.jsxs("span",{className:"switcher-text",children:[l.jsx("span",{className:"switcher-name",children:p.name}),l.jsx(jo,{label:p.rootLabel}),l.jsxs("span",{className:"switcher-sub",children:[p.live&&l.jsx("span",{className:"live-dot",title:"running"}),p.url.replace(/^https?:\/\//,"")]})]})]},p.root??p.url)),m&&l.jsxs("a",{className:"switcher-foot",href:"#/workspaces",role:"menuitem",onClick:()=>h(!1),children:[l.jsx(V,{name:"hub"})," manage workspaces"]})]})]})}function qb(){const[i,c]=C.useState(null);return C.useEffect(()=>{let o=!0;return fetch("/api/runs").then(u=>u.json()).then(u=>{o&&(u.runs.length>0?ga(`/runs/${u.runs[0].id}`,{replace:!0}):c({outputDir:u.outputDir}))}).catch(()=>{}),()=>{o=!1}},[]),i?l.jsxs("div",{className:"empty",children:["No runs found in ",l.jsx("code",{children:i.outputDir}),". Start one with"," ",l.jsx("code",{children:"kraftwerk run <workflow> <request>"})," or from a workflow page."]}):l.jsx("div",{className:"empty",children:"loading…"})}function $b(){const[i,c]=C.useState(null),[o,u]=C.useState(!1);C.useEffect(()=>{let m=!0,p;const y=async()=>{try{const x=await fetch("/api/meta",{cache:"no-store"}).then(k=>k.json());m&&c(x)}catch{}m&&(p=setTimeout(y,3e4))};return y(),()=>{m=!1,clearTimeout(p)}},[]);const f=i?.restartable&&i.diskVersion&&i.diskVersion!==i.version?i.diskVersion:null;async function h(){if(f){u(!0),await fetch("/api/restart",{method:"POST"}).catch(()=>{});for(let m=0;m<60;m++){await new Promise(p=>setTimeout(p,500));try{if((await fetch("/api/meta",{cache:"no-store"}).then(y=>y.json())).version===f)break}catch{}}location.reload()}}return!f&&!o?null:l.jsx("button",{className:"relaunch-note",disabled:o,title:`v${f} is installed on disk, the server still runs v${i?.version}. Click to relaunch with the new version.`,onClick:()=>{h()},children:o?"relaunching…":l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"restart_alt",className:"ms-sm"})," v",f," ready — relaunch"]})})}function Gb(){const i=Ba();return l.jsxs("button",{className:`expert-toggle ${i?"on":""}`,title:i?"Expert mode on — full detail":"Expert mode off — simplified view","aria-pressed":i,onClick:()=>Qx(!i),children:[l.jsx("span",{className:"expert-track",children:l.jsx("span",{className:"expert-knob"})}),"expert"]})}function Yb(){const[i,c]=C.useState(!1),[o,u]=C.useState(null),[f,h]=C.useState(null),[m,p]=C.useState("");C.useEffect(()=>{if(!i)return;fetch("/api/runs").then(k=>k.json()).then(u).catch(()=>{}),fetch("/api/workflows").then(k=>k.json()).then(h).catch(()=>{}),fetch("/api/meta").then(k=>k.json()).then(k=>p(k.version)).catch(()=>{});const x=k=>{k.target.closest(".info-wrap")||c(!1)};return window.addEventListener("mousedown",x),()=>window.removeEventListener("mousedown",x)},[i]);const y=o?.runs[0];return l.jsxs("span",{className:"info-wrap",children:[l.jsx("button",{className:"info-btn",title:"Project info","aria-label":"Project info",onClick:()=>c(x=>!x),children:l.jsx(V,{name:"info"})}),i&&l.jsxs("div",{className:"info-pop",children:[l.jsxs("div",{className:"info-row",children:[l.jsx("span",{className:"microlabel",children:"Workflows"}),l.jsx("span",{className:"info-v",children:f?`${f.workflows.length} discovered`:"…"}),l.jsx("code",{className:"info-path",title:f?.root,children:f?.root??""})]}),l.jsxs("div",{className:"info-row",children:[l.jsx("span",{className:"microlabel",children:"Runs"}),l.jsxs("span",{className:"info-v",children:[o?`${o.runs.length} total`:"…",y?` · latest ${y.status}`:""]}),l.jsx("code",{className:"info-path",title:o?.outputDir,children:o?.outputDir??""})]}),l.jsxs("div",{className:"info-row info-actions",children:[l.jsx("span",{className:"microlabel",children:"Workspace"}),l.jsxs("a",{className:"update-btn",href:"#/settings",onClick:()=>c(!1),children:[l.jsx(V,{name:"settings",className:"ms-sm"})," settings"]})]}),l.jsxs("div",{className:"info-row info-actions",children:[l.jsx("span",{className:"microlabel",children:"Theme"}),l.jsx(Zb,{})]}),l.jsxs("div",{className:"info-row info-actions",children:[l.jsx("span",{className:"microlabel",children:"Version"}),l.jsx("span",{className:"info-v mono",children:m?`kraftwerk ${m}`:"…"}),l.jsx(Qb,{})]})]})]})}function Xb(i,c){const o=i.split(".").map(Number),u=c.split(".").map(Number);for(let f=0;f<3;f++)if((o[f]??0)!==(u[f]??0))return(o[f]??0)<(u[f]??0);return!1}function Qb(){const[i,c]=C.useState("idle"),[o,u]=C.useState(null);async function f(){c("busy");try{const h=await fetch("/api/update-check",{cache:"no-store"}),m=await h.json();if(!h.ok||!m.latest)throw new Error;u(m),c("done")}catch{c("err")}}return i==="done"&&o?Xb(o.current,o.latest)?l.jsxs("span",{className:"update-result newer",children:["v",o.latest," available — ",l.jsxs("code",{children:["npm i -g ",o.name,"@latest"]})]}):l.jsxs("span",{className:"update-result",children:[l.jsx(V,{name:"check",className:"ms-sm"})," up to date"]}):l.jsx("button",{className:"update-btn",disabled:i==="busy",onClick:()=>{f()},children:i==="busy"?"checking…":i==="err"?"npm unreachable — retry":l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"sync",className:"ms-sm"})," check for updates"]})})}function Zb(){return l.jsx("button",{className:"theme-btn",onClick:()=>{const i=document.documentElement,c=i.dataset.theme==="light"?"dark":"light";i.dataset.theme=c;try{localStorage.setItem("kw-theme",c)}catch{}},children:"day / night"})}Bx.createRoot(document.getElementById("root")).render(l.jsx(C.StrictMode,{children:l.jsx(Ub,{})}));export{V as I,zx as R,Gx as _,Ux as a,Vb as b,_x as g,l as j,ga as n,C as r,wm as s};