@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.
- package/README.md +26 -19
- package/dist/cli/init.js +3 -3
- package/dist/cli/routines.js +9 -9
- package/dist/config.d.ts +2 -2
- package/dist/config.js +1 -1
- package/dist/inspector/{team.d.ts → agents.d.ts} +21 -12
- package/dist/inspector/{team.js → agents.js} +34 -19
- package/dist/inspector/chat/backend.d.ts +1 -1
- package/dist/inspector/chat/sessions.js +43 -43
- package/dist/inspector/chat/store.js +13 -1
- package/dist/inspector/chat/types.d.ts +2 -2
- package/dist/inspector/instances.d.ts +12 -0
- package/dist/inspector/instances.js +28 -0
- package/dist/inspector/routines.d.ts +4 -4
- package/dist/inspector/routines.js +11 -11
- package/dist/inspector/search.d.ts +25 -0
- package/dist/inspector/search.js +31 -0
- package/dist/inspector/server.js +34 -29
- package/dist/inspector/skills.d.ts +6 -6
- package/dist/inspector/skills.js +8 -8
- package/inspector/dist/assets/{editor-BABv2LmA.js → editor-7ImnDC3D.js} +3 -3
- package/inspector/dist/assets/{index-DbWUNbt-.js → index--2I7vpcS.js} +1 -1
- package/inspector/dist/assets/index-B2ThRS2S.js +217 -0
- package/inspector/dist/assets/{index-BXspF2KR.css → index-BA7nx4V5.css} +1 -1
- package/inspector/dist/assets/{index-CdwTmXTV.js → index-BC7aIJ-h.js} +1 -1
- package/inspector/dist/assets/{index-DuPp3MUc.js → index-BIXYBiw7.js} +1 -1
- package/inspector/dist/assets/{index-Bmm4zJNU.js → index-BZeYO5wT.js} +1 -1
- package/inspector/dist/assets/{index-sLxulPOm.js → index-B_CIhKa4.js} +1 -1
- package/inspector/dist/assets/{index-DCR7u4Xa.js → index-BuRajvjQ.js} +1 -1
- package/inspector/dist/assets/{index-Ca9Qs5LZ.js → index-C3Ob1O7W.js} +1 -1
- package/inspector/dist/assets/{index-HBdsdJhD.js → index-CIjv7yxE.js} +1 -1
- package/inspector/dist/assets/{index-wkYwz0Tl.js → index-CRAwmMfk.js} +1 -1
- package/inspector/dist/assets/{index-ByWpqzAI.js → index-Ct_jZSyD.js} +1 -1
- package/inspector/dist/assets/{index-hkVov8T4.js → index-DKrBjjGQ.js} +1 -1
- package/inspector/dist/assets/{index-Gx93brFq.js → index-DL_bJiOj.js} +1 -1
- package/inspector/dist/assets/{index-BbTer62d.js → index-DPBAv_kj.js} +1 -1
- package/inspector/dist/assets/{index-CCACy6uF.js → index-DbmSSHvr.js} +1 -1
- package/inspector/dist/assets/{index-DuwmzZAr.js → index-DjRBLY9N.js} +1 -1
- package/inspector/dist/assets/{index-CzPQygR7.js → index-YZtBJhWD.js} +1 -1
- package/inspector/dist/assets/{index-CjlJeW9z.js → index-fWUFhIGR.js} +1 -1
- package/inspector/dist/index.html +2 -2
- package/package.json +1 -1
- package/inspector/dist/assets/index-uEig4--d.js +0 -217
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor-7ImnDC3D.js","assets/editor-9rr2cQaW.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
function Cx(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 Rx(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Wu={exports:{}},oi={};var mm;function zx(){if(mm)return oi;mm=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 pm;function Ox(){return pm||(pm=1,Wu.exports=zx()),Wu.exports}var l=Ox(),Pu={exports:{}},me={};var gm;function Dx(){if(gm)return me;gm=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"),T=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),N=Symbol.iterator;function U(k){return k===null||typeof k!="object"?null:(k=N&&k[N]||k["@@iterator"],typeof k=="function"?k:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},K=Object.assign,$={};function w(k,Y,ne){this.props=k,this.context=Y,this.refs=$,this.updater=ne||j}w.prototype.isReactComponent={},w.prototype.setState=function(k,Y){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,Y,"setState")},w.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function P(){}P.prototype=w.prototype;function re(k,Y,ne){this.props=k,this.context=Y,this.refs=$,this.updater=ne||j}var Z=re.prototype=new P;Z.constructor=re,K(Z,w.prototype),Z.isPureReactComponent=!0;var J=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function te(k,Y,ne){var F=ne.ref;return{$$typeof:i,type:k,key:Y,ref:F!==void 0?F:null,props:ne}}function ve(k,Y){return te(k.type,Y,k.props)}function ge(k){return typeof k=="object"&&k!==null&&k.$$typeof===i}function ae(k){var Y={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ne){return Y[ne]})}var be=/\/+/g;function Je(k,Y){return typeof k=="object"&&k!==null&&k.key!=null?ae(""+k.key):Y.toString(36)}function at(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(R,R):(k.status="pending",k.then(function(Y){k.status==="pending"&&(k.status="fulfilled",k.value=Y)},function(Y){k.status==="pending"&&(k.status="rejected",k.reason=Y)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function H(k,Y,ne,F,he){var pe=typeof k;(pe==="undefined"||pe==="boolean")&&(k=null);var _e=!1;if(k===null)_e=!0;else switch(pe){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(k.$$typeof){case i:case c:_e=!0;break;case T:return _e=k._init,H(_e(k._payload),Y,ne,F,he)}}if(_e)return he=he(k),_e=F===""?"."+Je(k,0):F,J(he)?(ne="",_e!=null&&(ne=_e.replace(be,"$&/")+"/"),H(he,Y,ne,"",function(Re){return Re})):he!=null&&(ge(he)&&(he=ve(he,ne+(he.key==null||k&&k.key===he.key?"":(""+he.key).replace(be,"$&/")+"/")+_e)),Y.push(he)),1;_e=0;var mt=F===""?".":F+":";if(J(k))for(var G=0;G<k.length;G++)F=k[G],pe=mt+Je(F,G),_e+=H(F,Y,ne,pe,he);else if(G=U(k),typeof G=="function")for(k=G.call(k),G=0;!(F=k.next()).done;)F=F.value,pe=mt+Je(F,G++),_e+=H(F,Y,ne,pe,he);else if(pe==="object"){if(typeof k.then=="function")return H(at(k),Y,ne,F,he);throw Y=String(k),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return _e}function ee(k,Y,ne){if(k==null)return k;var F=[],he=0;return H(k,F,"","",function(pe){return Y.call(ne,pe,he++)}),F}function ue(k){if(k._status===-1){var Y=k._result;Y=Y(),Y.then(function(ne){(k._status===0||k._status===-1)&&(k._status=1,k._result=ne)},function(ne){(k._status===0||k._status===-1)&&(k._status=2,k._result=ne)}),k._status===-1&&(k._status=0,k._result=Y)}if(k._status===1)return k._result.default;throw k._result}var Ce=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},je={map:ee,forEach:function(k,Y,ne){ee(k,function(){Y.apply(this,arguments)},ne)},count:function(k){var Y=0;return ee(k,function(){Y++}),Y},toArray:function(k){return ee(k,function(Y){return Y})||[]},only:function(k){if(!ge(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return me.Activity=_,me.Children=je,me.Component=w,me.Fragment=o,me.Profiler=f,me.PureComponent=re,me.StrictMode=u,me.Suspense=y,me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,me.__COMPILER_RUNTIME={__proto__:null,c:function(k){return M.H.useMemoCache(k)}},me.cache=function(k){return function(){return k.apply(null,arguments)}},me.cacheSignal=function(){return null},me.cloneElement=function(k,Y,ne){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var F=K({},k.props),he=k.key;if(Y!=null)for(pe in Y.key!==void 0&&(he=""+Y.key),Y)!W.call(Y,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&Y.ref===void 0||(F[pe]=Y[pe]);var pe=arguments.length-2;if(pe===1)F.children=ne;else if(1<pe){for(var _e=Array(pe),mt=0;mt<pe;mt++)_e[mt]=arguments[mt+2];F.children=_e}return te(k.type,he,F)},me.createContext=function(k){return k={$$typeof:m,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:h,_context:k},k},me.createElement=function(k,Y,ne){var F,he={},pe=null;if(Y!=null)for(F in Y.key!==void 0&&(pe=""+Y.key),Y)W.call(Y,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(he[F]=Y[F]);var _e=arguments.length-2;if(_e===1)he.children=ne;else if(1<_e){for(var mt=Array(_e),G=0;G<_e;G++)mt[G]=arguments[G+2];he.children=mt}if(k&&k.defaultProps)for(F in _e=k.defaultProps,_e)he[F]===void 0&&(he[F]=_e[F]);return te(k,pe,he)},me.createRef=function(){return{current:null}},me.forwardRef=function(k){return{$$typeof:p,render:k}},me.isValidElement=ge,me.lazy=function(k){return{$$typeof:T,_payload:{_status:-1,_result:k},_init:ue}},me.memo=function(k,Y){return{$$typeof:x,type:k,compare:Y===void 0?null:Y}},me.startTransition=function(k){var Y=M.T,ne={};M.T=ne;try{var F=k(),he=M.S;he!==null&&he(ne,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(R,Ce)}catch(pe){Ce(pe)}finally{Y!==null&&ne.types!==null&&(Y.types=ne.types),M.T=Y}},me.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},me.use=function(k){return M.H.use(k)},me.useActionState=function(k,Y,ne){return M.H.useActionState(k,Y,ne)},me.useCallback=function(k,Y){return M.H.useCallback(k,Y)},me.useContext=function(k){return M.H.useContext(k)},me.useDebugValue=function(){},me.useDeferredValue=function(k,Y){return M.H.useDeferredValue(k,Y)},me.useEffect=function(k,Y){return M.H.useEffect(k,Y)},me.useEffectEvent=function(k){return M.H.useEffectEvent(k)},me.useId=function(){return M.H.useId()},me.useImperativeHandle=function(k,Y,ne){return M.H.useImperativeHandle(k,Y,ne)},me.useInsertionEffect=function(k,Y){return M.H.useInsertionEffect(k,Y)},me.useLayoutEffect=function(k,Y){return M.H.useLayoutEffect(k,Y)},me.useMemo=function(k,Y){return M.H.useMemo(k,Y)},me.useOptimistic=function(k,Y){return M.H.useOptimistic(k,Y)},me.useReducer=function(k,Y,ne){return M.H.useReducer(k,Y,ne)},me.useRef=function(k){return M.H.useRef(k)},me.useState=function(k){return M.H.useState(k)},me.useSyncExternalStore=function(k,Y,ne){return M.H.useSyncExternalStore(k,Y,ne)},me.useTransition=function(){return M.H.useTransition()},me.version="19.2.8",me}var xm;function So(){return xm||(xm=1,Pu.exports=Dx()),Pu.exports}var E=So();const Mx=Rx(E),nj=Cx({__proto__:null,default:Mx},[E]);var eo={exports:{}},fi={},to={exports:{}},no={};var vm;function Ux(){return vm||(vm=1,(function(i){function c(H,ee){var ue=H.length;H.push(ee);e:for(;0<ue;){var Ce=ue-1>>>1,je=H[Ce];if(0<f(je,ee))H[Ce]=ee,H[ue]=je,ue=Ce;else break e}}function o(H){return H.length===0?null:H[0]}function u(H){if(H.length===0)return null;var ee=H[0],ue=H.pop();if(ue!==ee){H[0]=ue;e:for(var Ce=0,je=H.length,k=je>>>1;Ce<k;){var Y=2*(Ce+1)-1,ne=H[Y],F=Y+1,he=H[F];if(0>f(ne,ue))F<je&&0>f(he,ne)?(H[Ce]=he,H[F]=ue,Ce=F):(H[Ce]=ne,H[Y]=ue,Ce=Y);else if(F<je&&0>f(he,ue))H[Ce]=he,H[F]=ue,Ce=F;else break e}}return ee}function f(H,ee){var ue=H.sortIndex-ee.sortIndex;return ue!==0?ue:H.id-ee.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=[],T=1,_=null,N=3,U=!1,j=!1,K=!1,$=!1,w=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,re=typeof setImmediate<"u"?setImmediate:null;function Z(H){for(var ee=o(x);ee!==null;){if(ee.callback===null)u(x);else if(ee.startTime<=H)u(x),ee.sortIndex=ee.expirationTime,c(y,ee);else break;ee=o(x)}}function J(H){if(K=!1,Z(H),!j)if(o(y)!==null)j=!0,R||(R=!0,ae());else{var ee=o(x);ee!==null&&at(J,ee.startTime-H)}}var R=!1,M=-1,W=5,te=-1;function ve(){return $?!0:!(i.unstable_now()-te<W)}function ge(){if($=!1,R){var H=i.unstable_now();te=H;var ee=!0;try{e:{j=!1,K&&(K=!1,P(M),M=-1),U=!0;var ue=N;try{t:{for(Z(H),_=o(y);_!==null&&!(_.expirationTime>H&&ve());){var Ce=_.callback;if(typeof Ce=="function"){_.callback=null,N=_.priorityLevel;var je=Ce(_.expirationTime<=H);if(H=i.unstable_now(),typeof je=="function"){_.callback=je,Z(H),ee=!0;break t}_===o(y)&&u(y),Z(H)}else u(y);_=o(y)}if(_!==null)ee=!0;else{var k=o(x);k!==null&&at(J,k.startTime-H),ee=!1}}break e}finally{_=null,N=ue,U=!1}ee=void 0}}finally{ee?ae():R=!1}}}var ae;if(typeof re=="function")ae=function(){re(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(){w(ge,0)};function at(H,ee){M=w(function(){H(i.unstable_now())},ee)}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(H){H.callback=null},i.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<H?Math.floor(1e3/H):5},i.unstable_getCurrentPriorityLevel=function(){return N},i.unstable_next=function(H){switch(N){case 1:case 2:case 3:var ee=3;break;default:ee=N}var ue=N;N=ee;try{return H()}finally{N=ue}},i.unstable_requestPaint=function(){$=!0},i.unstable_runWithPriority=function(H,ee){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ue=N;N=H;try{return ee()}finally{N=ue}},i.unstable_scheduleCallback=function(H,ee,ue){var Ce=i.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?Ce+ue:Ce):ue=Ce,H){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=ue+je,H={id:T++,callback:ee,priorityLevel:H,startTime:ue,expirationTime:je,sortIndex:-1},ue>Ce?(H.sortIndex=ue,c(x,H),o(y)===null&&H===o(x)&&(K?(P(M),M=-1):K=!0,at(J,ue-Ce))):(H.sortIndex=je,c(y,H),j||U||(j=!0,R||(R=!0,ae()))),H},i.unstable_shouldYield=ve,i.unstable_wrapCallback=function(H){var ee=N;return function(){var ue=N;N=ee;try{return H.apply(this,arguments)}finally{N=ue}}}})(no)),no}var ym;function Lx(){return ym||(ym=1,to.exports=Ux()),to.exports}var ao={exports:{}},Rt={};var bm;function Hx(){if(bm)return Rt;bm=1;var i=So();function c(y){var x="https://react.dev/errors/"+y;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)x+="&args[]="+encodeURIComponent(arguments[T])}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,T){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:_==null?null:""+_,children:y,containerInfo:x,implementation:T}}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 T=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,T)},Rt.flushSync=function(y){var x=m.T,T=u.p;try{if(m.T=null,u.p=2,y)return y()}finally{m.T=x,u.p=T,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 T=x.as,_=p(T,x.crossOrigin),N=typeof x.integrity=="string"?x.integrity:void 0,U=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;T==="style"?u.d.S(y,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:_,integrity:N,fetchPriority:U}):T==="script"&&u.d.X(y,{crossOrigin:_,integrity:N,fetchPriority:U,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 T=p(x.as,x.crossOrigin);u.d.M(y,{crossOrigin:T,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 T=x.as,_=p(T,x.crossOrigin);u.d.L(y,T,{crossOrigin:_,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 T=p(x.as,x.crossOrigin);u.d.m(y,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:T,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,T){return m.H.useFormState(y,x,T)},Rt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Rt.version="19.2.8",Rt}var jm;function Bx(){if(jm)return ao.exports;jm=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(),ao.exports=Hx(),ao.exports}var Nm;function qx(){if(Nm)return fi;Nm=1;var i=Lx(),c=So(),o=Bx();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n: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 n=e,a=t;;){var s=n.return;if(s===null)break;var r=s.alternate;if(r===null){if(a=s.return,a!==null){n=a;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===n)return y(s),e;if(r===a)return y(s),t;r=r.sibling}throw Error(u(188))}if(n.return!==a.return)n=s,a=r;else{for(var d=!1,g=s.child;g;){if(g===n){d=!0,n=s,a=r;break}if(g===a){d=!0,a=s,n=r;break}g=g.sibling}if(!d){for(g=r.child;g;){if(g===n){d=!0,n=r,a=s;break}if(g===a){d=!0,a=r,n=s;break}g=g.sibling}if(!d)throw Error(u(189))}}if(n.alternate!==a)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function T(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=T(e),t!==null)return t;e=e.sibling}return null}var _=Object.assign,N=Symbol.for("react.element"),U=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),re=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),te=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 w:return"Profiler";case $:return"StrictMode";case J:return"Suspense";case R:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case j:return"Portal";case re:return e.displayName||"Context";case P: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 M: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 at=Array.isArray,H=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},Ce=[],je=-1;function k(e){return{current:e}}function Y(e){0>je||(e.current=Ce[je],Ce[je]=null,je--)}function ne(e,t){je++,Ce[je]=e.current,e.current=t}var F=k(null),he=k(null),pe=k(null),_e=k(null);function mt(e,t){switch(ne(pe,t),ne(he,e),ne(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lh(t),e=Hh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(F),ne(F,e)}function G(){Y(F),Y(he),Y(pe)}function Re(e){e.memoizedState!==null&&ne(_e,e);var t=F.current,n=Hh(t,e.type);t!==n&&(ne(he,e),ne(F,n))}function Ge(e){he.current===e&&(Y(F),Y(he)),_e.current===e&&(Y(_e),ii._currentValue=ue)}var We,nn;function Oe(e){if(We===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);We=t&&t[1]||"",nn=-1<n.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+We+e+nn}var Xa=!1;function Ye(e,t){if(!e||Xa)return"";Xa=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch(L){var D=L}Reflect.construct(e,[],X)}else{try{X.call()}catch(L){D=L}e.call(X.prototype)}}else{try{throw Error()}catch(L){D=L}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(L){if(L&&D&&typeof L.stack=="string")return[L.stack,D.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),d=r[0],g=r[1];if(d&&g){var b=d.split(`
|
|
5
|
+
`),O=g.split(`
|
|
6
|
+
`);for(s=a=0;a<b.length&&!b[a].includes("DetermineComponentFrameRoot");)a++;for(;s<O.length&&!O[s].includes("DetermineComponentFrameRoot");)s++;if(a===b.length||s===O.length)for(a=b.length-1,s=O.length-1;1<=a&&0<=s&&b[a]!==O[s];)s--;for(;1<=a&&0<=s;a--,s--)if(b[a]!==O[s]){if(a!==1||s!==1)do if(a--,s--,0>s||b[a]!==O[s]){var B=`
|
|
7
|
+
`+b[a].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=a&&0<=s);break}}}finally{Xa=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Oe(n):""}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="",n=null;do t+=os(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
8
|
+
Error generating stack: `+a.message+`
|
|
9
|
+
`+a.stack}}var $n=Object.prototype.hasOwnProperty,bl=i.unstable_scheduleCallback,an=i.unstable_cancelCallback,Si=i.unstable_shouldYield,fs=i.unstable_requestPaint,At=i.unstable_now,wi=i.unstable_getCurrentPriorityLevel,vn=i.unstable_ImmediatePriority,Cn=i.unstable_UserBlockingPriority,ln=i.unstable_NormalPriority,ds=i.unstable_LowPriority,Qa=i.unstable_IdlePriority,jl=i.log,hs=i.unstable_setDisableYieldValue,sn=null,yt=null;function Xt(e){if(typeof jl=="function"&&hs(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(sn,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 oa=256,yn=262144,bn=4194304;function Rn(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 Za(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var g=a&134217727;return g!==0?(a=g&~r,a!==0?s=Rn(a):(d&=g,d!==0?s=Rn(d):n||(n=g&~e,n!==0&&(s=Rn(n))))):(g=a&~r,g!==0?s=Rn(g):d!==0?s=Rn(d):n||(n=a&~e,n!==0&&(s=Rn(n)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:s}function fa(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=bn;return bn<<=1,(bn&62914560)===0&&(bn=4194304),e}function da(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function zn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function cn(e,t,n,a,s,r){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,b=e.expirationTimes,O=e.hiddenUpdates;for(n=d&~n;0<n;){var B=31-Ct(n),X=1<<B;g[B]=0,b[B]=-1;var D=O[B];if(D!==null)for(O[B]=null,B=0;B<D.length;B++){var L=D[B];L!==null&&(L.lane&=-536870913)}n&=~X}a!==0&&Gn(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(d&~t))}function Gn(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Ct(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Nl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Ct(n),s=1<<a;s&t|e[a]&t&&(e[a]|=t),n&=~s}}function Sl(e,t){var n=t&-t;return n=(n&42)!==0?1:gs(n),(n&(e.suspendedLanes|t))!==0?0:n}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=ee.p;return e!==0?e:(e=window.event,e===void 0?32:cm(e.type))}function xs(e,t){var n=ee.p;try{return ee.p=e,t()}finally{ee.p=n}}var rn=Math.random().toString(36).slice(2),pt="__reactFiber$"+rn,it="__reactProps$"+rn,ha="__reactContainer$"+rn,vs="__reactEvents$"+rn,et="__reactListeners$"+rn,ma="__reactHandles$"+rn,_i="__reactResources$"+rn,pa="__reactMarker$"+rn;function Va(e){delete e[pt],delete e[it],delete e[vs],delete e[et],delete e[ma]}function Yn(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ha]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qh(e);e!==null;){if(n=e[pt])return n;e=Qh(e)}return t}e=n,n=e.parentNode}return null}function Xn(e){if(e=e[pt]||e[ha]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ka(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function ga(e){var t=e[_i];return t||(t=e[_i]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ct(e){e[pa]=!0}var Ai=new Set,jn={};function On(e,t){Nn(e,t),Nn(e+"Capture",t)}function Nn(e,t){for(jn[e]=t,e=0;e<t.length;e++)Ai.add(t[e])}var Qn=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={},Ja={};function Ri(e){return $n.call(Ja,e)?!0:$n.call(Ci,e)?!1:Qn.test(e)?Ja[e]=!0:(Ci[e]=!0,!1)}function Tl(e,t,n){if(Ri(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Ia(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function un(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}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,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var s=a.get,r=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(d){n=""+d,r.call(this,d)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Dn(e){if(!e._valueTracker){var t=El(e)?"checked":"value";e._valueTracker=_l(e,t,""+e[t])}}function xa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=El(e)?e.checked?"true":"false":e.value),e=a,e!==n?(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,n,a,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)):n!=null?Al(e,d,Nt(n)):a!=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,n,a,s,r,d,g){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){Dn(e);return}n=n!=null?""+Nt(n):"",t=t!=null?""+Nt(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=g?e.checked:!!a,e.defaultChecked=!!a,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Dn(e)}function Al(e,t,n){t==="number"&&Dt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Zn(e,t,n,a){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Nt(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,a&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function js(e,t,n){if(t!=null&&(t=""+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Nt(n):""}function zi(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(u(92));if(at(a)){if(1<a.length)throw Error(u(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Nt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Dn(e)}function Vn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.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,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||Wc.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ns(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var s in t)a=t[s],t.hasOwnProperty(s)&&n[s]!==a&&Oi(e,s,a)}else for(var r in t)t.hasOwnProperty(r)&&Oi(e,r,t[r])}function va(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"]]),I=/^[\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 I.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function A(){}var Q=null;function le(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var se=null,fe=null;function Be(e){var t=Xn(e);if(t&&(e=t.stateNode)){var n=e[it]||null;e:switch(e=t.stateNode,t.type){case"input":if(ys(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+St(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var s=a[it]||null;if(!s)throw Error(u(90));ys(a,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&xa(a)}break e;case"textarea":js(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Zn(e,!!n.multiple,t,!1)}}}var Ve=!1;function wt(e,t,n){if(Ve)return e(t,n);Ve=!0;try{var a=e(t);return a}finally{if(Ve=!1,(se!==null||fe!==null)&&(bc(),se&&(t=se,e=fe,fe=se=null,Be(t),e)))for(t=0;t<e.length;t++)Be(e[t])}}function rt(e,t){var n=e.stateNode;if(n===null)return null;var a=n[it]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}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 ya=null,Pc=null,Di=null;function Lo(){if(Di)return Di;var e,t=Pc,n=t.length,a,s="value"in ya?ya.value:ya.textContent,r=s.length;for(e=0;e<n&&t[e]===s[e];e++);var d=n-e;for(a=1;a<=d&&t[n-a]===s[r-a];a++);return Di=s.slice(e,1<a?1-a: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 Ho(){return!1}function Ut(e){function t(n,a,s,r,d){this._reactName=n,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=d,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(r):r[g]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Ui:Ho,this.isPropagationStopped=Ho,this}return _(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ui)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ui)},persist:function(){},isPersistent:Ui}),t}var Fa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Li=Ut(Fa),ks=_({},Fa,{view:0,detail:0}),_p=Ut(ks),er,tr,Ts,Hi=_({},ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,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}}),Bo=Ut(Hi),Ap=_({},Hi,{dataTransfer:0}),Cp=Ut(Ap),Rp=_({},ks,{relatedTarget:0}),nr=Ut(Rp),zp=_({},Fa,{animationName:0,elapsedTime:0,pseudoElement:0}),Op=Ut(zp),Dp=_({},Fa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mp=Ut(Dp),Up=_({},Fa,{data:0}),qo=Ut(Up),Lp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hp={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"},Bp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bp[e])?!!t[e]:!1}function ar(){return qp}var $p=_({},ks,{key:function(e){if(e.key){var t=Lp[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"?Hp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,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}}),Gp=Ut($p),Yp=_({},Hi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$o=Ut(Yp),Xp=_({},ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar}),Qp=Ut(Xp),Zp=_({},Fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vp=Ut(Zp),Kp=_({},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}),Jp=Ut(Kp),Ip=_({},Fa,{newState:0,oldState:0}),Fp=Ut(Ip),Wp=[9,13,27,32],lr=Qt&&"CompositionEvent"in window,Es=null;Qt&&"documentMode"in document&&(Es=document.documentMode);var Pp=Qt&&"TextEvent"in window&&!Es,Go=Qt&&(!lr||Es&&8<Es&&11>=Es),Yo=" ",Xo=!1;function Qo(e,t){switch(e){case"keyup":return Wp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cl=!1;function eg(e,t){switch(e){case"compositionend":return Zo(t);case"keypress":return t.which!==32?null:(Xo=!0,Yo);case"textInput":return e=t.data,e===Yo&&Xo?null:e;default:return null}}function tg(e,t){if(Cl)return e==="compositionend"||!lr&&Qo(e,t)?(e=Lo(),Di=Pc=ya=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 Go&&t.locale!=="ko"?null:t.data;default:return null}}var ng={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 Vo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ng[e.type]:t==="textarea"}function Ko(e,t,n,a){se?fe?fe.push(a):fe=[a]:se=a,t=Ec(t,"onChange"),0<t.length&&(n=new Li("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var _s=null,As=null;function ag(e){Rh(e,0)}function Bi(e){var t=Ka(e);if(xa(t))return e}function Jo(e,t){if(e==="change")return t}var Io=!1;if(Qt){var sr;if(Qt){var ir="oninput"in document;if(!ir){var Fo=document.createElement("div");Fo.setAttribute("oninput","return;"),ir=typeof Fo.oninput=="function"}sr=ir}else sr=!1;Io=sr&&(!document.documentMode||9<document.documentMode)}function Wo(){_s&&(_s.detachEvent("onpropertychange",Po),As=_s=null)}function Po(e){if(e.propertyName==="value"&&Bi(As)){var t=[];Ko(t,As,e,le(e)),wt(ag,t)}}function lg(e,t,n){e==="focusin"?(Wo(),_s=t,As=n,_s.attachEvent("onpropertychange",Po)):e==="focusout"&&Wo()}function sg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bi(As)}function ig(e,t){if(e==="click")return Bi(t)}function cg(e,t){if(e==="input"||e==="change")return Bi(t)}function rg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:rg;function Cs(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var s=n[a];if(!$n.call(t,s)||!Zt(e[s],t[s]))return!1}return!0}function ef(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tf(e,t){var n=ef(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ef(n)}}function nf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?nf(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 n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)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 ug=Qt&&"documentMode"in document&&11>=document.documentMode,Rl=null,rr=null,Rs=null,ur=!1;function lf(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ur||Rl==null||Rl!==Dt(a)||(a=Rl,"selectionStart"in a&&cr(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Rs&&Cs(Rs,a)||(Rs=a,a=Ec(rr,"onSelect"),0<a.length&&(t=new Li("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Rl)))}function Wa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var zl={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionrun:Wa("Transition","TransitionRun"),transitionstart:Wa("Transition","TransitionStart"),transitioncancel:Wa("Transition","TransitionCancel"),transitionend:Wa("Transition","TransitionEnd")},or={},sf={};Qt&&(sf=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 Pa(e){if(or[e])return or[e];if(!zl[e])return e;var t=zl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in sf)return or[e]=t[n];return e}var cf=Pa("animationend"),rf=Pa("animationiteration"),uf=Pa("animationstart"),og=Pa("transitionrun"),fg=Pa("transitionstart"),dg=Pa("transitioncancel"),of=Pa("transitionend"),ff=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 Sn(e,t){ff.set(e,t),On(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)},on=[],Ol=0,dr=0;function $i(){for(var e=Ol,t=dr=Ol=0;t<e;){var n=on[t];on[t++]=null;var a=on[t];on[t++]=null;var s=on[t];on[t++]=null;var r=on[t];if(on[t++]=null,a!==null&&s!==null){var d=a.pending;d===null?s.next=s:(s.next=d.next,d.next=s),a.pending=s}r!==0&&df(n,s,r)}}function Gi(e,t,n,a){on[Ol++]=e,on[Ol++]=t,on[Ol++]=n,on[Ol++]=a,dr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function hr(e,t,n,a){return Gi(e,t,n,a),Yi(e)}function el(e,t){return Gi(e,null,null,t),Yi(e)}function df(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var s=!1,r=e.return;r!==null;)r.childLanes|=n,a=r.alternate,a!==null&&(a.childLanes|=n),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(n),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=n|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 hg(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vt(e,t,n,a){return new hg(e,t,n,a)}function mr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kn(e,t){var n=e.alternate;return n===null?(n=Vt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function hf(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Xi(e,t,n,a,s,r){var d=0;if(a=e,typeof e=="function")mr(e)&&(d=1);else if(typeof e=="string")d=vx(e,n,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=Vt(31,n,t,s),e.elementType=te,e.lanes=r,e;case K:return tl(n.children,s,r,t);case $:d=8,s|=24;break;case w:return e=Vt(12,n,t,s|2),e.elementType=w,e.lanes=r,e;case J:return e=Vt(13,n,t,s),e.elementType=J,e.lanes=r,e;case R:return e=Vt(19,n,t,s),e.elementType=R,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case re:d=10;break e;case P:d=9;break e;case Z:d=11;break e;case M:d=14;break e;case W:d=16,a=null;break e}d=29,n=Error(u(130,e===null?"null":typeof e,"")),a=null}return t=Vt(d,n,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function tl(e,t,n,a){return e=Vt(7,e,a,t),e.lanes=n,e}function pr(e,t,n){return e=Vt(6,e,null,t),e.lanes=n,e}function mf(e){var t=Vt(18,null,null,0);return t.stateNode=e,t}function gr(e,t,n){return t=Vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pf=new WeakMap;function fn(e,t){if(typeof e=="object"&&e!==null){var n=pf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Yt(t)},pf.set(e,t),t)}return{value:e,source:t,stack:Yt(t)}}var Ml=[],Ul=0,Qi=null,zs=0,dn=[],hn=0,ba=null,Mn=1,Un="";function Jn(e,t){Ml[Ul++]=zs,Ml[Ul++]=Qi,Qi=e,zs=t}function gf(e,t,n){dn[hn++]=Mn,dn[hn++]=Un,dn[hn++]=ba,ba=e;var a=Mn;e=Un;var s=32-Ct(a)-1;a&=~(1<<s),n+=1;var r=32-Ct(t)+s;if(30<r){var d=s-s%5;r=(a&(1<<d)-1).toString(32),a>>=d,s-=d,Mn=1<<32-Ct(t)+s|n<<s|a,Un=r+e}else Mn=1<<r|n<<s|a,Un=e}function xr(e){e.return!==null&&(Jn(e,1),gf(e,1,0))}function vr(e){for(;e===Qi;)Qi=Ml[--Ul],Ml[Ul]=null,zs=Ml[--Ul],Ml[Ul]=null;for(;e===ba;)ba=dn[--hn],dn[hn]=null,Un=dn[--hn],dn[hn]=null,Mn=dn[--hn],dn[hn]=null}function xf(e,t){dn[hn++]=Mn,dn[hn++]=Un,dn[hn++]=ba,Mn=t.id,Un=t.overflow,ba=e}var kt=null,Ie=null,Ae=!1,ja=null,mn=!1,yr=Error(u(519));function Na(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Os(fn(t,e)),yr}function vf(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[pt]=e,t[it]=a,n){case"dialog":Se("cancel",t),Se("close",t);break;case"iframe":case"object":case"embed":Se("load",t);break;case"video":case"audio":for(n=0;n<ti.length;n++)Se(ti[n],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,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Se("invalid",t);break;case"textarea":Se("invalid",t),zi(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Mh(t.textContent,n)?(a.popover!=null&&(Se("beforetoggle",t),Se("toggle",t)),a.onScroll!=null&&Se("scroll",t),a.onScrollEnd!=null&&Se("scrollend",t),a.onClick!=null&&(t.onclick=A),t=!0):t=!1,t||Na(e,!0)}function yf(e){for(kt=e.return;kt;)switch(kt.tag){case 5:case 31:case 13:mn=!1;return;case 27:case 3:mn=!0;return;default:kt=kt.return}}function Ll(e){if(e!==kt)return!1;if(!Ae)return yf(e),Ae=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Lu(e.type,e.memoizedProps)),n=!n),n&&Ie&&Na(e),yf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ie=Xh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ie=Xh(e)}else t===27?(t=Ie,Ua(e.type)?(e=Gu,Gu=null,Ie=e):Ie=t):Ie=kt?gn(e.stateNode.nextSibling):null;return!0}function nl(){Ie=kt=null,Ae=!1}function br(){var e=ja;return e!==null&&(qt===null?qt=e:qt.push.apply(qt,e),ja=null),e}function Os(e){ja===null?ja=[e]:ja.push(e)}var jr=k(null),al=null,In=null;function Sa(e,t,n){ne(jr,t._currentValue),t._currentValue=n}function Fn(e){e._currentValue=jr.current,Y(jr)}function Nr(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Sr(e,t,n,a){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|=n,g=r.alternate,g!==null&&(g.lanes|=n),Nr(r.return,n,e),a||(d=null);break e}r=g.next}}else if(s.tag===18){if(d=s.return,d===null)throw Error(u(341));d.lanes|=n,r=d.alternate,r!==null&&(r.lanes|=n),Nr(d,n,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,n,a){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,n,a),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){al=e,In=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return bf(al,e)}function Vi(e,t){return al===null&&ll(e),bf(e,t)}function bf(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},In===null){if(e===null)throw Error(u(308));In=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else In=In.next=t;return n}var mg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},pg=i.unstable_scheduleCallback,gg=i.unstable_NormalPriority,ut={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wr(){return{controller:new mg,data:new Map,refCount:0}}function Ds(e){e.refCount--,e.refCount===0&&pg(gg,function(){e.controller.abort()})}var Ms=null,kr=0,Bl=0,ql=null;function xg(e,t){if(Ms===null){var n=Ms=[];kr=0,Bl=_u(),ql={status:"pending",value:void 0,then:function(a){n.push(a)}}}return kr++,t.then(jf,jf),t}function jf(){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 vg(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(s){n.push(s)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var s=0;s<n.length;s++)(0,n[s])(t)},function(s){for(a.status="rejected",a.reason=s,s=0;s<n.length;s++)(0,n[s])(void 0)}),a}var Nf=H.S;H.S=function(e,t){sh=At(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&xg(e,t),Nf!==null&&Nf(e,t)};var sl=k(null);function Tr(){var e=sl.current;return e!==null?e:Ke.pooledCache}function Ki(e,t){t===null?ne(sl,sl.current):ne(sl,t.pool)}function Sf(){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 wf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function kf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(A,A),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e;default:if(typeof t.status=="string")t.then(A,A);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=a}},function(a){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e}throw cl=t,$l}}function il(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(cl=n,$l):n}}var cl=null;function Tf(){if(cl===null)throw Error(u(459));var e=cl;return cl=null,e}function Ef(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=[]),kf(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===N?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function _f(e){function t(C,S){if(e){var z=C.deletions;z===null?(C.deletions=[S],C.flags|=16):z.push(S)}}function n(C,S){if(!e)return null;for(;S!==null;)t(C,S),S=S.sibling;return null}function a(C){for(var S=new Map;C!==null;)C.key!==null?S.set(C.key,C):S.set(C.index,C),C=C.sibling;return S}function s(C,S){return C=Kn(C,S),C.index=0,C.sibling=null,C}function r(C,S,z){return C.index=z,e?(z=C.alternate,z!==null?(z=z.index,z<S?(C.flags|=67108866,S):z):(C.flags|=67108866,S)):(C.flags|=1048576,S)}function d(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function g(C,S,z,q){return S===null||S.tag!==6?(S=pr(z,C.mode,q),S.return=C,S):(S=s(S,z),S.return=C,S)}function b(C,S,z,q){var oe=z.type;return oe===K?B(C,S,z.props.children,q,z.key):S!==null&&(S.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===W&&il(oe)===S.type)?(S=s(S,z.props),Ls(S,z),S.return=C,S):(S=Xi(z.type,z.key,z.props,null,C.mode,q),Ls(S,z),S.return=C,S)}function O(C,S,z,q){return S===null||S.tag!==4||S.stateNode.containerInfo!==z.containerInfo||S.stateNode.implementation!==z.implementation?(S=gr(z,C.mode,q),S.return=C,S):(S=s(S,z.children||[]),S.return=C,S)}function B(C,S,z,q,oe){return S===null||S.tag!==7?(S=tl(z,C.mode,q,oe),S.return=C,S):(S=s(S,z),S.return=C,S)}function X(C,S,z){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return S=pr(""+S,C.mode,z),S.return=C,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case U:return z=Xi(S.type,S.key,S.props,null,C.mode,z),Ls(z,S),z.return=C,z;case j:return S=gr(S,C.mode,z),S.return=C,S;case W:return S=il(S),X(C,S,z)}if(at(S)||ae(S))return S=tl(S,C.mode,z,null),S.return=C,S;if(typeof S.then=="function")return X(C,Fi(S),z);if(S.$$typeof===re)return X(C,Vi(C,S),z);Wi(C,S)}return null}function D(C,S,z,q){var oe=S!==null?S.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return oe!==null?null:g(C,S,""+z,q);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case U:return z.key===oe?b(C,S,z,q):null;case j:return z.key===oe?O(C,S,z,q):null;case W:return z=il(z),D(C,S,z,q)}if(at(z)||ae(z))return oe!==null?null:B(C,S,z,q,null);if(typeof z.then=="function")return D(C,S,Fi(z),q);if(z.$$typeof===re)return D(C,S,Vi(C,z),q);Wi(C,z)}return null}function L(C,S,z,q,oe){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return C=C.get(z)||null,g(S,C,""+q,oe);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case U:return C=C.get(q.key===null?z:q.key)||null,b(S,C,q,oe);case j:return C=C.get(q.key===null?z:q.key)||null,O(S,C,q,oe);case W:return q=il(q),L(C,S,z,q,oe)}if(at(q)||ae(q))return C=C.get(z)||null,B(S,C,q,oe,null);if(typeof q.then=="function")return L(C,S,z,Fi(q),oe);if(q.$$typeof===re)return L(C,S,z,Vi(S,q),oe);Wi(S,q)}return null}function ie(C,S,z,q){for(var oe=null,Me=null,ce=S,ye=S=0,Te=null;ce!==null&&ye<z.length;ye++){ce.index>ye?(Te=ce,ce=null):Te=ce.sibling;var Ue=D(C,ce,z[ye],q);if(Ue===null){ce===null&&(ce=Te);break}e&&ce&&Ue.alternate===null&&t(C,ce),S=r(Ue,S,ye),Me===null?oe=Ue:Me.sibling=Ue,Me=Ue,ce=Te}if(ye===z.length)return n(C,ce),Ae&&Jn(C,ye),oe;if(ce===null){for(;ye<z.length;ye++)ce=X(C,z[ye],q),ce!==null&&(S=r(ce,S,ye),Me===null?oe=ce:Me.sibling=ce,Me=ce);return Ae&&Jn(C,ye),oe}for(ce=a(ce);ye<z.length;ye++)Te=L(ce,C,ye,z[ye],q),Te!==null&&(e&&Te.alternate!==null&&ce.delete(Te.key===null?ye:Te.key),S=r(Te,S,ye),Me===null?oe=Te:Me.sibling=Te,Me=Te);return e&&ce.forEach(function($a){return t(C,$a)}),Ae&&Jn(C,ye),oe}function de(C,S,z,q){if(z==null)throw Error(u(151));for(var oe=null,Me=null,ce=S,ye=S=0,Te=null,Ue=z.next();ce!==null&&!Ue.done;ye++,Ue=z.next()){ce.index>ye?(Te=ce,ce=null):Te=ce.sibling;var $a=D(C,ce,Ue.value,q);if($a===null){ce===null&&(ce=Te);break}e&&ce&&$a.alternate===null&&t(C,ce),S=r($a,S,ye),Me===null?oe=$a:Me.sibling=$a,Me=$a,ce=Te}if(Ue.done)return n(C,ce),Ae&&Jn(C,ye),oe;if(ce===null){for(;!Ue.done;ye++,Ue=z.next())Ue=X(C,Ue.value,q),Ue!==null&&(S=r(Ue,S,ye),Me===null?oe=Ue:Me.sibling=Ue,Me=Ue);return Ae&&Jn(C,ye),oe}for(ce=a(ce);!Ue.done;ye++,Ue=z.next())Ue=L(ce,C,ye,Ue.value,q),Ue!==null&&(e&&Ue.alternate!==null&&ce.delete(Ue.key===null?ye:Ue.key),S=r(Ue,S,ye),Me===null?oe=Ue:Me.sibling=Ue,Me=Ue);return e&&ce.forEach(function(Ax){return t(C,Ax)}),Ae&&Jn(C,ye),oe}function Ze(C,S,z,q){if(typeof z=="object"&&z!==null&&z.type===K&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case U:e:{for(var oe=z.key;S!==null;){if(S.key===oe){if(oe=z.type,oe===K){if(S.tag===7){n(C,S.sibling),q=s(S,z.props.children),q.return=C,C=q;break e}}else if(S.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===W&&il(oe)===S.type){n(C,S.sibling),q=s(S,z.props),Ls(q,z),q.return=C,C=q;break e}n(C,S);break}else t(C,S);S=S.sibling}z.type===K?(q=tl(z.props.children,C.mode,q,z.key),q.return=C,C=q):(q=Xi(z.type,z.key,z.props,null,C.mode,q),Ls(q,z),q.return=C,C=q)}return d(C);case j:e:{for(oe=z.key;S!==null;){if(S.key===oe)if(S.tag===4&&S.stateNode.containerInfo===z.containerInfo&&S.stateNode.implementation===z.implementation){n(C,S.sibling),q=s(S,z.children||[]),q.return=C,C=q;break e}else{n(C,S);break}else t(C,S);S=S.sibling}q=gr(z,C.mode,q),q.return=C,C=q}return d(C);case W:return z=il(z),Ze(C,S,z,q)}if(at(z))return ie(C,S,z,q);if(ae(z)){if(oe=ae(z),typeof oe!="function")throw Error(u(150));return z=oe.call(z),de(C,S,z,q)}if(typeof z.then=="function")return Ze(C,S,Fi(z),q);if(z.$$typeof===re)return Ze(C,S,Vi(C,z),q);Wi(C,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,S!==null&&S.tag===6?(n(C,S.sibling),q=s(S,z),q.return=C,C=q):(n(C,S),q=pr(z,C.mode,q),q.return=C,C=q),d(C)):n(C,S)}return function(C,S,z,q){try{Us=0;var oe=Ze(C,S,z,q);return Gl=null,oe}catch(ce){if(ce===$l||ce===Ji)throw ce;var Me=Vt(29,ce,null,C.mode);return Me.lanes=q,Me.return=C,Me}}}var rl=_f(!0),Af=_f(!1),wa=!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 ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ta(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Le&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=Yi(e),df(e,null,n),t}return Gi(e,a,t,n),Yi(e)}function Hs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Nl(e,n)}}function Cr(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var s=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?s=r=d:r=r.next=d,n=n.next}while(n!==null);r===null?s=r=t:r=r.next=t}else s=r=t;n={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Rr=!1;function Bs(){if(Rr){var e=ql;if(e!==null)throw e}}function qs(e,t,n,a){Rr=!1;var s=e.updateQueue;wa=!1;var r=s.firstBaseUpdate,d=s.lastBaseUpdate,g=s.shared.pending;if(g!==null){s.shared.pending=null;var b=g,O=b.next;b.next=null,d===null?r=O:d.next=O,d=b;var B=e.alternate;B!==null&&(B=B.updateQueue,g=B.lastBaseUpdate,g!==d&&(g===null?B.firstBaseUpdate=O:g.next=O,B.lastBaseUpdate=b))}if(r!==null){var X=s.baseState;d=0,B=O=b=null,g=r;do{var D=g.lane&-536870913,L=D!==g.lane;if(L?(ke&D)===D:(a&D)===D){D!==0&&D===Bl&&(Rr=!0),B!==null&&(B=B.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var ie=e,de=g;D=t;var Ze=n;switch(de.tag){case 1:if(ie=de.payload,typeof ie=="function"){X=ie.call(Ze,X,D);break e}X=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=de.payload,D=typeof ie=="function"?ie.call(Ze,X,D):ie,D==null)break e;X=_({},X,D);break e;case 2:wa=!0}}D=g.callback,D!==null&&(e.flags|=64,L&&(e.flags|=8192),L=s.callbacks,L===null?s.callbacks=[D]:L.push(D))}else L={lane:D,tag:g.tag,payload:g.payload,callback:g.callback,next:null},B===null?(O=B=L,b=X):B=B.next=L,d|=D;if(g=g.next,g===null){if(g=s.shared.pending,g===null)break;L=g,g=L.next,L.next=null,s.lastBaseUpdate=L,s.shared.pending=null}}while(!0);B===null&&(b=X),s.baseState=b,s.firstBaseUpdate=O,s.lastBaseUpdate=B,r===null&&(s.shared.lanes=0),Ra|=d,e.lanes=d,e.memoizedState=X}}function Cf(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Rf(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Cf(n[e],t)}var Yl=k(null),Pi=k(0);function zf(e,t){e=ia,ne(Pi,e),ne(Yl,t),ia=e|t.baseLanes}function zr(){ne(Pi,ia),ne(Yl,Yl.current)}function Or(){ia=Pi.current,Y(Yl),Y(Pi)}var Kt=k(null),pn=null;function Ea(e){var t=e.alternate;ne(lt,lt.current&1),ne(Kt,e),pn===null&&(t===null||Yl.current!==null||t.memoizedState!==null)&&(pn=e)}function Dr(e){ne(lt,lt.current),ne(Kt,e),pn===null&&(pn=e)}function Of(e){e.tag===22?(ne(lt,lt.current),ne(Kt,e),pn===null&&(pn=e)):_a()}function _a(){ne(lt,lt.current),ne(Kt,Kt.current)}function Jt(e){Y(Kt),pn===e&&(pn=null),Y(lt)}var lt=k(0);function ec(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||qu(n)||$u(n)))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 Wn=0,xe=null,Xe=null,ot=null,tc=!1,Xl=!1,ul=!1,nc=0,$s=0,Ql=null,yg=0;function tt(){throw Error(u(321))}function Mr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Zt(e[n],t[n]))return!1;return!0}function Ur(e,t,n,a,s,r){return Wn=r,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,H.H=e===null||e.memoizedState===null?gd:Fr,ul=!1,r=n(a,s),ul=!1,Xl&&(r=Mf(t,n,a,s)),Df(e),r}function Df(e){H.H=Xs;var t=Xe!==null&&Xe.next!==null;if(Wn=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 Mf(e,t,n,a){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)}H.H=xd,r=t(n,a)}while(Xl);return r}function bg(){var e=H.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=nc!==0;return nc=0,e}function Hr(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}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}Wn=0,ot=Xe=xe=null,Xl=!1,$s=nc=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 ac(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gs(e){var t=$s;return $s+=1,Ql===null&&(Ql=[]),e=kf(Ql,e,t),t=xe,(ot===null?t.memoizedState:ot.next)===null&&(t=t.alternate,H.H=t===null||t.memoizedState===null?gd:Fr),e}function lc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Gs(e);if(e.$$typeof===re)return Tt(e)}throw Error(u(438,String(e)))}function qr(e){var t=null,n=xe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=xe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ac(),xe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=ve;return t.index++,n}function Pn(e,t){return typeof t=="function"?t(e):t}function sc(e){var t=st();return $r(t,Xe,e)}function $r(e,t,n){var a=e.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=n;var s=e.baseQueue,r=a.pending;if(r!==null){if(s!==null){var d=s.next;s.next=r.next,r.next=d}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var g=d=null,b=null,O=t,B=!1;do{var X=O.lane&-536870913;if(X!==O.lane?(ke&X)===X:(Wn&X)===X){var D=O.revertLane;if(D===0)b!==null&&(b=b.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),X===Bl&&(B=!0);else if((Wn&D)===D){O=O.next,D===Bl&&(B=!0);continue}else X={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},b===null?(g=b=X,d=r):b=b.next=X,xe.lanes|=D,Ra|=D;X=O.action,ul&&n(r,X),r=O.hasEagerState?O.eagerState:n(r,X)}else D={lane:X,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},b===null?(g=b=D,d=r):b=b.next=D,xe.lanes|=X,Ra|=X;O=O.next}while(O!==null&&O!==t);if(b===null?d=r:b.next=g,!Zt(r,e.memoizedState)&&(ft=!0,B&&(n=ql,n!==null)))throw n;e.memoizedState=r,e.baseState=d,e.baseQueue=b,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Gr(e){var t=st(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var a=n.dispatch,s=n.pending,r=t.memoizedState;if(s!==null){n.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),n.lastRenderedState=r}return[r,a]}function Uf(e,t,n){var a=xe,s=st(),r=Ae;if(r){if(n===void 0)throw Error(u(407));n=n()}else n=t();var d=!Zt((Xe||s).memoizedState,n);if(d&&(s.memoizedState=n,ft=!0),s=s.queue,Qr(Bf.bind(null,a,s,e),[e]),s.getSnapshot!==t||d||ot!==null&&ot.memoizedState.tag&1){if(a.flags|=2048,Zl(9,{destroy:void 0},Hf.bind(null,a,s,n,t),null),Ke===null)throw Error(u(349));r||(Wn&127)!==0||Lf(a,t,n)}return n}function Lf(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xe.updateQueue,t===null?(t=ac(),xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Hf(e,t,n,a){t.value=n,t.getSnapshot=a,qf(t)&&$f(e)}function Bf(e,t,n){return n(function(){qf(t)&&$f(e)})}function qf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Zt(e,n)}catch{return!0}}function $f(e){var t=el(e,2);t!==null&&$t(t,e,2)}function Yr(e){var t=Mt();if(typeof e=="function"){var n=e;if(e=n(),ul){Xt(!0);try{n()}finally{Xt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:e},t}function Gf(e,t,n,a){return e.baseState=n,$r(e,Xe,typeof a=="function"?a:Pn)}function jg(e,t,n,a,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)}};H.T!==null?n(!0):r.isTransition=!1,a(r),n=t.pending,n===null?(r.next=t.pending=r,Yf(t,r)):(r.next=n.next,t.pending=n.next=r)}}function Yf(e,t){var n=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=H.T,d={};H.T=d;try{var g=n(s,a),b=H.S;b!==null&&b(d,g),Xf(e,t,g)}catch(O){Xr(e,t,O)}finally{r!==null&&d.types!==null&&(r.types=d.types),H.T=r}}else try{r=n(s,a),Xf(e,t,r)}catch(O){Xr(e,t,O)}}function Xf(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Qf(e,t,a)},function(a){return Xr(e,t,a)}):Qf(e,t,n)}function Qf(e,t,n){t.status="fulfilled",t.value=n,Zf(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Yf(e,n)))}function Xr(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Zf(t),t=t.next;while(t!==a)}e.action=null}function Zf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Vf(e,t){return t}function Kf(e,t){if(Ae){var n=Ke.formState;if(n!==null){e:{var a=xe;if(Ae){if(Ie){t:{for(var s=Ie,r=mn;s.nodeType!==8;){if(!r){s=null;break t}if(s=gn(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Ie=gn(s.nextSibling),a=s.data==="F!";break e}}Na(a)}a=!1}a&&(t=n[0])}}return n=Mt(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vf,lastRenderedState:t},n.queue=a,n=hd.bind(null,xe,a),a.dispatch=n,a=Yr(!1),r=Ir.bind(null,xe,!1,a.queue),a=Mt(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,n=jg.bind(null,xe,s,r,n),s.dispatch=n,a.memoizedState=e,[t,n,!1]}function Jf(e){var t=st();return If(t,Xe,e)}function If(e,t,n){if(t=$r(e,t,Vf)[0],e=sc(Pn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Gs(t)}catch(d){throw d===$l?Ji:d}else a=t;t=st();var s=t.queue,r=s.dispatch;return n!==t.memoizedState&&(xe.flags|=2048,Zl(9,{destroy:void 0},Ng.bind(null,s,n),null)),[a,r,e]}function Ng(e,t){e.action=t}function Ff(e){var t=st(),n=Xe;if(n!==null)return If(t,n,e);st(),t=t.memoizedState,n=st();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Zl(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=xe.updateQueue,t===null&&(t=ac(),xe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Wf(){return st().memoizedState}function ic(e,t,n,a){var s=Mt();xe.flags|=e,s.memoizedState=Zl(1|t,{destroy:void 0},n,a===void 0?null:a)}function cc(e,t,n,a){var s=st();a=a===void 0?null:a;var r=s.memoizedState.inst;Xe!==null&&a!==null&&Mr(a,Xe.memoizedState.deps)?s.memoizedState=Zl(t,r,n,a):(xe.flags|=e,s.memoizedState=Zl(1|t,r,n,a))}function Pf(e,t){ic(8390656,8,e,t)}function Qr(e,t){cc(2048,8,e,t)}function Sg(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=ac(),xe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ed(e){var t=st().memoizedState;return Sg({ref:t,nextImpl:e}),function(){if((Le&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function td(e,t){return cc(4,2,e,t)}function nd(e,t){return cc(4,4,e,t)}function ad(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ld(e,t,n){n=n!=null?n.concat([e]):null,cc(4,4,ad.bind(null,t,e),n)}function Zr(){}function sd(e,t){var n=st();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Mr(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function id(e,t){var n=st();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Mr(t,a[1]))return a[0];if(a=e(),ul){Xt(!0);try{e()}finally{Xt(!1)}}return n.memoizedState=[a,t],a}function Vr(e,t,n){return n===void 0||(Wn&1073741824)!==0&&(ke&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=ch(),xe.lanes|=e,Ra|=e,n)}function cd(e,t,n,a){return Zt(n,t)?n:Yl.current!==null?(e=Vr(e,n,a),Zt(e,t)||(ft=!0),e):(Wn&42)===0||(Wn&1073741824)!==0&&(ke&261930)===0?(ft=!0,e.memoizedState=n):(e=ch(),xe.lanes|=e,Ra|=e,t)}function rd(e,t,n,a,s){var r=ee.p;ee.p=r!==0&&8>r?r:8;var d=H.T,g={};H.T=g,Ir(e,!1,t,n);try{var b=s(),O=H.S;if(O!==null&&O(g,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var B=vg(b,a);Ys(e,t,B,Wt(e))}else Ys(e,t,a,Wt(e))}catch(X){Ys(e,t,{then:function(){},status:"rejected",reason:X},Wt())}finally{ee.p=r,d!==null&&g.types!==null&&(d.types=g.types),H.T=d}}function wg(){}function Kr(e,t,n,a){if(e.tag!==5)throw Error(u(476));var s=ud(e).queue;rd(e,s,t,ue,n===null?wg:function(){return od(e),n(a)})}function ud(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function od(e){var t=ud(e);t.next===null&&(t=e.alternate.memoizedState),Ys(e,t.next.queue,{},Wt())}function Jr(){return Tt(ii)}function fd(){return st().memoizedState}function dd(){return st().memoizedState}function kg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Wt();e=ka(n);var a=Ta(t,e,n);a!==null&&($t(a,t,n),Hs(a,t,n)),t={cache:wr()},e.payload=t;return}t=t.return}}function Tg(e,t,n){var a=Wt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},rc(e)?md(t,n):(n=hr(e,t,n,a),n!==null&&($t(n,e,a),pd(n,t,a)))}function hd(e,t,n){var a=Wt();Ys(e,t,n,a)}function Ys(e,t,n,a){var s={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(rc(e))md(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,n);if(s.hasEagerState=!0,s.eagerState=g,Zt(g,d))return Gi(e,t,s,0),Ke===null&&$i(),!1}catch{}if(n=hr(e,t,s,a),n!==null)return $t(n,e,a),pd(n,t,a),!0}return!1}function Ir(e,t,n,a){if(a={lane:2,revertLane:_u(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},rc(e)){if(t)throw Error(u(479))}else t=hr(e,n,a,2),t!==null&&$t(t,e,2)}function rc(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function md(e,t){Xl=tc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pd(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Nl(e,n)}}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 gd={readContext:Tt,use:lc,useCallback:function(e,t){return Mt().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Pf,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ic(4194308,4,ad.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ic(4194308,4,e,t)},useInsertionEffect:function(e,t){ic(4,2,e,t)},useMemo:function(e,t){var n=Mt();t=t===void 0?null:t;var a=e();if(ul){Xt(!0);try{e()}finally{Xt(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Mt();if(n!==void 0){var s=n(t);if(ul){Xt(!0);try{n(t)}finally{Xt(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=Tg.bind(null,xe,e),[a.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,n=hd.bind(null,xe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Zr,useDeferredValue:function(e,t){var n=Mt();return Vr(n,e,t)},useTransition:function(){var e=Yr(!1);return e=rd.bind(null,xe,e.queue,!0,!1),Mt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=xe,s=Mt();if(Ae){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Ke===null)throw Error(u(349));(ke&127)!==0||Lf(a,t,n)}s.memoizedState=n;var r={value:n,getSnapshot:t};return s.queue=r,Pf(Bf.bind(null,a,r,e),[e]),a.flags|=2048,Zl(9,{destroy:void 0},Hf.bind(null,a,r,n,t),null),n},useId:function(){var e=Mt(),t=Ke.identifierPrefix;if(Ae){var n=Un,a=Mn;n=(a&~(1<<32-Ct(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=nc++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=yg++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Jr,useFormState:Kf,useActionState:Kf,useOptimistic:function(e){var t=Mt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ir.bind(null,xe,!0,n),n.dispatch=t,[e,t]},useMemoCache:qr,useCacheRefresh:function(){return Mt().memoizedState=kg.bind(null,xe)},useEffectEvent:function(e){var t=Mt(),n={impl:e};return t.memoizedState=n,function(){if((Le&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},Fr={readContext:Tt,use:lc,useCallback:sd,useContext:Tt,useEffect:Qr,useImperativeHandle:ld,useInsertionEffect:td,useLayoutEffect:nd,useMemo:id,useReducer:sc,useRef:Wf,useState:function(){return sc(Pn)},useDebugValue:Zr,useDeferredValue:function(e,t){var n=st();return cd(n,Xe.memoizedState,e,t)},useTransition:function(){var e=sc(Pn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:Uf,useId:fd,useHostTransitionStatus:Jr,useFormState:Jf,useActionState:Jf,useOptimistic:function(e,t){var n=st();return Gf(n,Xe,e,t)},useMemoCache:qr,useCacheRefresh:dd};Fr.useEffectEvent=ed;var xd={readContext:Tt,use:lc,useCallback:sd,useContext:Tt,useEffect:Qr,useImperativeHandle:ld,useInsertionEffect:td,useLayoutEffect:nd,useMemo:id,useReducer:Gr,useRef:Wf,useState:function(){return Gr(Pn)},useDebugValue:Zr,useDeferredValue:function(e,t){var n=st();return Xe===null?Vr(n,e,t):cd(n,Xe.memoizedState,e,t)},useTransition:function(){var e=Gr(Pn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:Uf,useId:fd,useHostTransitionStatus:Jr,useFormState:Ff,useActionState:Ff,useOptimistic:function(e,t){var n=st();return Xe!==null?Gf(n,Xe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:qr,useCacheRefresh:dd};xd.useEffectEvent=ed;function Wr(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:_({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Pr={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Wt(),s=ka(a);s.payload=t,n!=null&&(s.callback=n),t=Ta(e,s,a),t!==null&&($t(t,e,a),Hs(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Wt(),s=ka(a);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Ta(e,s,a),t!==null&&($t(t,e,a),Hs(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Wt(),a=ka(n);a.tag=2,t!=null&&(a.callback=t),t=Ta(e,a,n),t!==null&&($t(t,e,n),Hs(t,e,n))}};function vd(e,t,n,a,s,r,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,d):t.prototype&&t.prototype.isPureReactComponent?!Cs(n,a)||!Cs(s,r):!0}function yd(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Pr.enqueueReplaceState(t,t.state,null)}function ol(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=_({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function bd(e){qi(e)}function jd(e){console.error(e)}function Nd(e){qi(e)}function uc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Sd(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function eu(e,t,n){return n=ka(n),n.tag=3,n.payload={element:null},n.callback=function(){uc(e,t)},n}function wd(e){return e=ka(e),e.tag=3,e}function kd(e,t,n,a){var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var r=a.value;e.payload=function(){return s(r)},e.callback=function(){Sd(t,n,a)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Sd(t,n,a),typeof s!="function"&&(za===null?za=new Set([this]):za.add(this));var g=a.stack;this.componentDidCatch(a.value,{componentStack:g!==null?g:""})})}function Eg(e,t,n,a,s){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Hl(t,n,s,!0),n=Kt.current,n!==null){switch(n.tag){case 31:case 13:return pn===null?jc():n.alternate===null&&nt===0&&(nt=3),n.flags&=-257,n.flags|=65536,n.lanes=s,a===Ii?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),ku(e,a,s)),!1;case 22:return n.flags|=65536,a===Ii?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),ku(e,a,s)),!1}throw Error(u(435,n.tag))}return ku(e,a,s),jc(),!1}if(Ae)return t=Kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==yr&&(e=Error(u(422),{cause:a}),Os(fn(e,n)))):(a!==yr&&(t=Error(u(423),{cause:a}),Os(fn(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=fn(a,n),s=eu(e.stateNode,a,s),Cr(e,s),nt!==4&&(nt=2)),!1;var r=Error(u(520),{cause:a});if(r=fn(r,n),Ws===null?Ws=[r]:Ws.push(r),nt!==4&&(nt=2),t===null)return!0;a=fn(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=eu(n.stateNode,a,e),Cr(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(za===null||!za.has(r))))return n.flags|=65536,s&=-s,n.lanes|=s,s=wd(s),kd(s,e,n,a),Cr(n,s),!1}n=n.return}while(n!==null);return!1}var tu=Error(u(461)),ft=!1;function Et(e,t,n,a){t.child=e===null?Af(t,null,n,a):rl(t,e.child,n,a)}function Td(e,t,n,a,s){n=n.render;var r=t.ref;if("ref"in a){var d={};for(var g in a)g!=="ref"&&(d[g]=a[g])}else d=a;return ll(t),a=Ur(e,t,n,d,r,s),g=Lr(),e!==null&&!ft?(Hr(e,t,s),ea(e,t,s)):(Ae&&g&&xr(t),t.flags|=1,Et(e,t,a,s),t.child)}function Ed(e,t,n,a,s){if(e===null){var r=n.type;return typeof r=="function"&&!mr(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,_d(e,t,r,a,s)):(e=Xi(n.type,null,a,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(n=n.compare,n=n!==null?n:Cs,n(d,a)&&e.ref===t.ref)return ea(e,t,s)}return t.flags|=1,e=Kn(r,a),e.ref=t.ref,e.return=t,t.child=e}function _d(e,t,n,a,s){if(e!==null){var r=e.memoizedProps;if(Cs(r,a)&&e.ref===t.ref)if(ft=!1,t.pendingProps=a=r,uu(e,s))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,ea(e,t,s)}return nu(e,t,n,a,s)}function Ad(e,t,n,a){var s=a.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|n:n,e!==null){for(a=t.child=e.child,s=0;a!==null;)s=s|a.lanes|a.childLanes,a=a.sibling;a=s&~r}else a=0,t.child=null;return Cd(e,t,r,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ki(t,r!==null?r.cachePool:null),r!==null?zf(t,r):zr(),Of(t);else return a=t.lanes=536870912,Cd(e,t,r!==null?r.baseLanes|n:n,n,a)}else r!==null?(Ki(t,r.cachePool),zf(t,r),_a(),t.memoizedState=null):(e!==null&&Ki(t,null),zr(),_a());return Et(e,t,s,n),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 Cd(e,t,n,a,s){var r=Tr();return r=r===null?null:{parent:ut._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Ki(t,null),zr(),Of(t),e!==null&&Hl(e,t,a,!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 Rd(e,t,n){return rl(t,e.child,null,n),e=oc(t,t.pendingProps),e.flags|=2,Jt(t),t.memoizedState=null,e}function _g(e,t,n){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ae){if(a.mode==="hidden")return e=oc(t,a),t.lanes=536870912,Qs(null,e);if(Dr(t),(e=Ie)?(e=Yh(e,mn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ba!==null?{id:Mn,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},n=mf(e),n.return=t,t.child=n,kt=t,Ie=null)):e=null,e===null)throw Na(t);return t.lanes=536870912,null}return oc(t,a)}var r=e.memoizedState;if(r!==null){var d=r.dehydrated;if(Dr(t),s)if(t.flags&256)t.flags&=-257,t=Rd(e,t,n);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,n,!1),s=(n&e.childLanes)!==0,ft||s){if(a=Ke,a!==null&&(d=Sl(a,n),d!==0&&d!==r.retryLane))throw r.retryLane=d,el(e,d),$t(a,e,d),tu;jc(),t=Rd(e,t,n)}else e=r.treeContext,Ie=gn(d.nextSibling),kt=t,Ae=!0,ja=null,mn=!1,e!==null&&xf(t,e),t=oc(t,a),t.flags|=4096;return t}return e=Kn(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function nu(e,t,n,a,s){return ll(t),n=Ur(e,t,n,a,void 0,s),a=Lr(),e!==null&&!ft?(Hr(e,t,s),ea(e,t,s)):(Ae&&a&&xr(t),t.flags|=1,Et(e,t,n,s),t.child)}function zd(e,t,n,a,s,r){return ll(t),t.updateQueue=null,n=Mf(t,a,n,s),Df(e),a=Lr(),e!==null&&!ft?(Hr(e,t,r),ea(e,t,r)):(Ae&&a&&xr(t),t.flags|=1,Et(e,t,n,r),t.child)}function Od(e,t,n,a,s){if(ll(t),t.stateNode===null){var r=Dl,d=n.contextType;typeof d=="object"&&d!==null&&(r=Tt(d)),r=new n(a,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=a,r.state=t.memoizedState,r.refs={},_r(t),d=n.contextType,r.context=typeof d=="object"&&d!==null?Tt(d):Dl,r.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Wr(t,n,d,a),r.state=t.memoizedState),typeof n.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,a,r,s),Bs(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var g=t.memoizedProps,b=ol(n,g);r.props=b;var O=r.context,B=n.contextType;d=Dl,typeof B=="object"&&B!==null&&(d=Tt(B));var X=n.getDerivedStateFromProps;B=typeof X=="function"||typeof r.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,B||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(g||O!==d)&&yd(t,r,a,d),wa=!1;var D=t.memoizedState;r.state=D,qs(t,a,r,s),Bs(),O=t.memoizedState,g||D!==O||wa?(typeof X=="function"&&(Wr(t,n,X,a),O=t.memoizedState),(b=wa||vd(t,n,b,a,D,O,d))?(B||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=a,t.memoizedState=O),r.props=a,r.state=O,r.context=d,a=b):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,Ar(e,t),d=t.memoizedProps,B=ol(n,d),r.props=B,X=t.pendingProps,D=r.context,O=n.contextType,b=Dl,typeof O=="object"&&O!==null&&(b=Tt(O)),g=n.getDerivedStateFromProps,(O=typeof g=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(d!==X||D!==b)&&yd(t,r,a,b),wa=!1,D=t.memoizedState,r.state=D,qs(t,a,r,s),Bs();var L=t.memoizedState;d!==X||D!==L||wa||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof g=="function"&&(Wr(t,n,g,a),L=t.memoizedState),(B=wa||vd(t,n,B,a,D,L,b)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(O||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,L,b),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,L,b)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=L),r.props=a,r.state=L,r.context=b,a=B):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,fc(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=rl(t,e.child,null,s),t.child=rl(t,null,n,s)):Et(e,t,n,s),t.memoizedState=r.state,e=t.child):e=ea(e,t,s),e}function Dd(e,t,n,a){return nl(),t.flags|=256,Et(e,t,n,a),t.child}var au={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lu(e){return{baseLanes:e,cachePool:Sf()}}function su(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Ft),e}function Md(e,t,n){var a=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?Ea(t):_a(),(e=Ie)?(e=Yh(e,mn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ba!==null?{id:Mn,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},n=mf(e),n.return=t,t.child=n,kt=t,Ie=null)):e=null,e===null)throw Na(t);return $u(e)?t.lanes=32:t.lanes=536870912,null}var g=a.children;return a=a.fallback,s?(_a(),s=t.mode,g=dc({mode:"hidden",children:g},s),a=tl(a,s,n,null),g.return=t,a.return=t,g.sibling=a,t.child=g,a=t.child,a.memoizedState=lu(n),a.childLanes=su(e,d,n),t.memoizedState=au,Qs(null,a)):(Ea(t),iu(t,g))}var b=e.memoizedState;if(b!==null&&(g=b.dehydrated,g!==null)){if(r)t.flags&256?(Ea(t),t.flags&=-257,t=cu(e,t,n)):t.memoizedState!==null?(_a(),t.child=e.child,t.flags|=128,t=null):(_a(),g=a.fallback,s=t.mode,a=dc({mode:"visible",children:a.children},s),g=tl(g,s,n,null),g.flags|=2,a.return=t,g.return=t,a.sibling=g,t.child=a,rl(t,e.child,null,n),a=t.child,a.memoizedState=lu(n),a.childLanes=su(e,d,n),t.memoizedState=au,t=Qs(null,a));else if(Ea(t),$u(g)){if(d=g.nextSibling&&g.nextSibling.dataset,d)var O=d.dgst;d=O,a=Error(u(419)),a.stack="",a.digest=d,Os({value:a,source:null,stack:null}),t=cu(e,t,n)}else if(ft||Hl(e,t,n,!1),d=(n&e.childLanes)!==0,ft||d){if(d=Ke,d!==null&&(a=Sl(d,n),a!==0&&a!==b.retryLane))throw b.retryLane=a,el(e,a),$t(d,e,a),tu;qu(g)||jc(),t=cu(e,t,n)}else qu(g)?(t.flags|=192,t.child=e.child,t=null):(e=b.treeContext,Ie=gn(g.nextSibling),kt=t,Ae=!0,ja=null,mn=!1,e!==null&&xf(t,e),t=iu(t,a.children),t.flags|=4096);return t}return s?(_a(),g=a.fallback,s=t.mode,b=e.child,O=b.sibling,a=Kn(b,{mode:"hidden",children:a.children}),a.subtreeFlags=b.subtreeFlags&65011712,O!==null?g=Kn(O,g):(g=tl(g,s,n,null),g.flags|=2),g.return=t,a.return=t,a.sibling=g,t.child=a,Qs(null,a),a=t.child,g=e.child.memoizedState,g===null?g=lu(n):(s=g.cachePool,s!==null?(b=ut._currentValue,s=s.parent!==b?{parent:b,pool:b}:s):s=Sf(),g={baseLanes:g.baseLanes|n,cachePool:s}),a.memoizedState=g,a.childLanes=su(e,d,n),t.memoizedState=au,Qs(e.child,a)):(Ea(t),n=e.child,e=n.sibling,n=Kn(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}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,n){return rl(t,e.child,null,n),e=iu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ud(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Nr(e.return,t,n)}function ru(e,t,n,a,s,r){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:s,treeForkCount:r}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=a,d.tail=n,d.tailMode=s,d.treeForkCount=r)}function Ld(e,t,n){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var d=lt.current,g=(d&2)!==0;if(g?(d=d&1|2,t.flags|=128):d&=1,ne(lt,d),Et(e,t,a,n),a=Ae?zs:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ud(e,n,t);else if(e.tag===19)Ud(e,n,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(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&ec(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),ru(t,!1,s,n,r,a);break;case"backwards":case"unstable_legacy-backwards":for(n=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=n,n=s,s=e}ru(t,!0,n,null,r,a);break;case"together":ru(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function ea(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ra|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Hl(e,t,n,!1),(n&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,n=Kn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Kn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function uu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Zi(e)))}function Ag(e,t,n){switch(t.tag){case 3:mt(t,t.stateNode.containerInfo),Sa(t,ut,e.memoizedState.cache),nl();break;case 27:case 5:Re(t);break;case 4:mt(t,t.stateNode.containerInfo);break;case 10:Sa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Dr(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Ea(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Md(e,t,n):(Ea(t),e=ea(e,t,n),e!==null?e.sibling:null);Ea(t);break;case 19:var s=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Hl(e,t,n,!1),a=(n&t.childLanes)!==0),s){if(a)return Ld(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ne(lt,lt.current),a)break;return null;case 22:return t.lanes=0,Ad(e,t,n,t.pendingProps);case 24:Sa(t,ut,e.memoizedState.cache)}return ea(e,t,n)}function Hd(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!uu(e,n)&&(t.flags&128)===0)return ft=!1,Ag(e,t,n);ft=(e.flags&131072)!==0}else ft=!1,Ae&&(t.flags&1048576)!==0&&gf(t,zs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=il(t.elementType),t.type=e,typeof e=="function")mr(e)?(a=ol(e,a),t.tag=1,t=Od(null,t,e,a,n)):(t.tag=0,t=nu(null,t,e,a,n));else{if(e!=null){var s=e.$$typeof;if(s===Z){t.tag=11,t=Td(null,t,e,a,n);break e}else if(s===M){t.tag=14,t=Ed(null,t,e,a,n);break e}}throw t=Je(e)||e,Error(u(306,t,""))}}return t;case 0:return nu(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,s=ol(a,t.pendingProps),Od(e,t,a,s,n);case 3:e:{if(mt(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,Ar(e,t),qs(t,a,null,n);var d=t.memoizedState;if(a=d.cache,Sa(t,ut,a),a!==r.cache&&Sr(t,[ut],n,!0),Bs(),a=d.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Dd(e,t,a,n);break e}else if(a!==s){s=fn(Error(u(424)),t),Os(s),t=Dd(e,t,a,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ie=gn(e.firstChild),kt=t,Ae=!0,ja=null,mn=!0,n=Af(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(nl(),a===s){t=ea(e,t,n);break e}Et(e,t,a,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=Jh(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ae||(n=t.type,e=t.pendingProps,a=_c(pe.current).createElement(n),a[pt]=t,a[it]=e,_t(a,n,e),ct(a),t.stateNode=a):t.memoizedState=Jh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Re(t),e===null&&Ae&&(a=t.stateNode=Zh(t.type,t.pendingProps,pe.current),kt=t,mn=!0,s=Ie,Ua(t.type)?(Gu=s,Ie=gn(a.firstChild)):Ie=s),Et(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ae&&((s=a=Ie)&&(a=sx(a,t.type,t.pendingProps,mn),a!==null?(t.stateNode=a,kt=t,Ie=gn(a.firstChild),mn=!1,s=!0):s=!1),s||Na(t)),Re(t),s=t.type,r=t.pendingProps,d=e!==null?e.memoizedProps:null,a=r.children,Lu(s,r)?a=null:d!==null&&Lu(s,d)&&(t.flags|=32),t.memoizedState!==null&&(s=Ur(e,t,bg,null,null,n),ii._currentValue=s),fc(e,t),Et(e,t,a,n),t.child;case 6:return e===null&&Ae&&((e=n=Ie)&&(n=ix(n,t.pendingProps,mn),n!==null?(t.stateNode=n,kt=t,Ie=null,e=!0):e=!1),e||Na(t)),null;case 13:return Md(e,t,n);case 4:return mt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=rl(t,null,a,n):Et(e,t,a,n),t.child;case 11:return Td(e,t,t.type,t.pendingProps,n);case 7:return Et(e,t,t.pendingProps,n),t.child;case 8:return Et(e,t,t.pendingProps.children,n),t.child;case 12:return Et(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,Sa(t,t.type,a.value),Et(e,t,a.children,n),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,ll(t),s=Tt(s),a=a(s),t.flags|=1,Et(e,t,a,n),t.child;case 14:return Ed(e,t,t.type,t.pendingProps,n);case 15:return _d(e,t,t.type,t.pendingProps,n);case 19:return Ld(e,t,n);case 31:return _g(e,t,n);case 22:return Ad(e,t,n,t.pendingProps);case 24:return ll(t),a=Tt(ut),e===null?(s=Tr(),s===null&&(s=Ke,r=wr(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=n),s=r),t.memoizedState={parent:a,cache:s},_r(t),Sa(t,ut,s)):((e.lanes&n)!==0&&(Ar(e,t),qs(t,null,null,n),Bs()),s=e.memoizedState,r=t.memoizedState,s.parent!==a?(s={parent:a,cache:a},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Sa(t,ut,a)):(a=r.cache,Sa(t,ut,a),a!==s.cache&&Sr(t,[ut],n,!0))),Et(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function ta(e){e.flags|=4}function ou(e,t,n,a,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(fh())e.flags|=8192;else throw cl=Ii,Er}else e.flags&=-16777217}function Bd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!em(t))if(fh())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 n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,a|=s.subtreeFlags&65011712,a|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,a|=s.subtreeFlags,a|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function Cg(e,t,n){var a=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 n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Fn(ut),G(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ll(t)?ta(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?(ta(t),r!==null?(Fe(t),Bd(t,r)):(Fe(t),ou(t,s,null,a,n))):r?r!==e.memoizedState?(ta(t),Fe(t),Bd(t,r)):(Fe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ta(t),Fe(t),ou(t,s,e,a,n)),null;case 27:if(Ge(t),n=pe.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ta(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Fe(t),null}e=F.current,Ll(t)?vf(t):(e=Zh(s,a,n),t.stateNode=e,ta(t))}return Fe(t),null;case 5:if(Ge(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ta(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Fe(t),null}if(r=F.current,Ll(t))vf(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 a.is=="string"?d.createElement("select",{is:a.is}):d.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?d.createElement(s,{is:a.is}):d.createElement(s)}}r[pt]=t,r[it]=a;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,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ta(t)}}return Fe(t),ou(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ta(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=pe.current,Ll(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,s=kt,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Mh(e.nodeValue,n)),e||Na(t,!0)}else e=_c(e).createTextNode(a),e[pt]=t,t.stateNode=e}return Fe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ll(t),n!==null){if(e===null){if(!a)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[pt]=t}else nl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),e=!1}else n=br(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),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(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ll(t),a!==null&&a.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 nl(),(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=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),hc(t,t.updateQueue),Fe(t),null);case 4:return G(),e===null&&zu(t.stateNode.containerInfo),Fe(t),null;case 10:return Fn(t.type),Fe(t),null;case 19:if(Y(lt),a=t.memoizedState,a===null)return Fe(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)Zs(a,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=ec(e),r!==null){for(t.flags|=128,Zs(a,!1),e=r.updateQueue,t.updateQueue=e,hc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)hf(n,e),n=n.sibling;return ne(lt,lt.current&1|2),Ae&&Jn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&At()>vc&&(t.flags|=128,s=!0,Zs(a,!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(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!Ae)return Fe(t),null}else 2*At()-a.renderingStartTime>vc&&n!==536870912&&(t.flags|=128,s=!0,Zs(a,!1),t.lanes=4194304);a.isBackwards?(r.sibling=t.child,t.child=r):(e=a.last,e!==null?e.sibling=r:t.child=r,a.last=r)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=At(),e.sibling=null,n=lt.current,ne(lt,s?n&1|2:n&1),Ae&&Jn(t,a.treeForkCount),e):(Fe(t),null);case 22:case 23:return Jt(t),Or(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),n=t.updateQueue,n!==null&&hc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&Y(sl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Fn(ut),Fe(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Rg(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 Fn(ut),G(),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));nl()}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));nl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(lt),null;case 4:return G(),null;case 10:return Fn(t.type),null;case 22:case 23:return Jt(t),Or(),e!==null&&Y(sl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fn(ut),null;case 25:return null;default:return null}}function qd(e,t){switch(vr(t),t.tag){case 3:Fn(ut),G();break;case 26:case 27:case 5:Ge(t);break;case 4:G();break;case 31:t.memoizedState!==null&&Jt(t);break;case 13:Jt(t);break;case 19:Y(lt);break;case 10:Fn(t.type);break;case 22:case 23:Jt(t),Or(),e!==null&&Y(sl);break;case 24:Fn(ut)}}function Vs(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var s=a.next;n=s;do{if((n.tag&e)===e){a=void 0;var r=n.create,d=n.inst;a=r(),d.destroy=a}n=n.next}while(n!==s)}}catch(g){$e(t,t.return,g)}}function Aa(e,t,n){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var r=s.next;a=r;do{if((a.tag&e)===e){var d=a.inst,g=d.destroy;if(g!==void 0){d.destroy=void 0,s=t;var b=n,O=g;try{O()}catch(B){$e(s,b,B)}}}a=a.next}while(a!==r)}}catch(B){$e(t,t.return,B)}}function $d(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Rf(t,n)}catch(a){$e(e,e.return,a)}}}function Gd(e,t,n){n.props=ol(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){$e(e,t,a)}}function Ks(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(s){$e(e,t,s)}}function Ln(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(s){$e(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){$e(e,t,s)}else n.current=null}function Yd(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(s){$e(e,e.return,s)}}function fu(e,t,n){try{var a=e.stateNode;Pg(a,e.type,n,t),a[it]=t}catch(s){$e(e,e.return,s)}}function Xd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ua(e.type)||e.tag===4}function du(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xd(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&&Ua(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,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=A));else if(a!==4&&(a===27&&Ua(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(hu(e,t,n),e=e.sibling;e!==null;)hu(e,t,n),e=e.sibling}function mc(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Ua(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(mc(e,t,n),e=e.sibling;e!==null;)mc(e,t,n),e=e.sibling}function Qd(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);_t(t,a,n),t[pt]=e,t[it]=n}catch(r){$e(e,e.return,r)}}var na=!1,dt=!1,mu=!1,Zd=typeof WeakSet=="function"?WeakSet:Set,bt=null;function zg(e,t){if(e=e.containerInfo,Mu=Mc,e=af(e),cr(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var s=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var d=0,g=-1,b=-1,O=0,B=0,X=e,D=null;t:for(;;){for(var L;X!==n||s!==0&&X.nodeType!==3||(g=d+s),X!==r||a!==0&&X.nodeType!==3||(b=d+a),X.nodeType===3&&(d+=X.nodeValue.length),(L=X.firstChild)!==null;)D=X,X=L;for(;;){if(X===e)break t;if(D===n&&++O===s&&(g=d),D===r&&++B===a&&(b=d),(L=X.nextSibling)!==null)break;X=D,D=X.parentNode}X=L}n=g===-1||b===-1?null:{start:g,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(Uu={focusedElem:e,selectionRange:n},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(n=0;n<e.length;n++)s=e[n],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,n=t,s=r.memoizedProps,r=r.memoizedState,a=n.stateNode;try{var ie=ol(n.type,s);e=a.getSnapshotBeforeUpdate(ie,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(de){$e(n,n.return,de)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Bu(e);else if(n===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 Vd(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:la(e,n),a&4&&Vs(5,n);break;case 1:if(la(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){$e(n,n.return,d)}else{var s=ol(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){$e(n,n.return,d)}}a&64&&$d(n),a&512&&Ks(n,n.return);break;case 3:if(la(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Rf(e,t)}catch(d){$e(n,n.return,d)}}break;case 27:t===null&&a&4&&Qd(n);case 26:case 5:la(e,n),t===null&&a&4&&Yd(n),a&512&&Ks(n,n.return);break;case 12:la(e,n);break;case 31:la(e,n),a&4&&Id(e,n);break;case 13:la(e,n),a&4&&Fd(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=$g.bind(null,n),cx(e,n))));break;case 22:if(a=n.memoizedState!==null||na,!a){t=t!==null&&t.memoizedState!==null||dt,s=na;var r=dt;na=a,(dt=t)&&!r?sa(e,n,(n.subtreeFlags&8772)!==0):la(e,n),na=s,dt=r}break;case 30:break;default:la(e,n)}}function Kd(e){var t=e.alternate;t!==null&&(e.alternate=null,Kd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Va(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 aa(e,t,n){for(n=n.child;n!==null;)Jd(e,t,n),n=n.sibling}function Jd(e,t,n){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(sn,n)}catch{}switch(n.tag){case 26:dt||Ln(n,t),aa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:dt||Ln(n,t);var a=Pe,s=Lt;Ua(n.type)&&(Pe=n.stateNode,Lt=!1),aa(e,t,n),ai(n.stateNode),Pe=a,Lt=s;break;case 5:dt||Ln(n,t);case 6:if(a=Pe,s=Lt,Pe=null,aa(e,t,n),Pe=a,Lt=s,Pe!==null)if(Lt)try{(Pe.nodeType===9?Pe.body:Pe.nodeName==="HTML"?Pe.ownerDocument.body:Pe).removeChild(n.stateNode)}catch(r){$e(n,t,r)}else try{Pe.removeChild(n.stateNode)}catch(r){$e(n,t,r)}break;case 18:Pe!==null&&(Lt?(e=Pe,$h(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ls(e)):$h(Pe,n.stateNode));break;case 4:a=Pe,s=Lt,Pe=n.stateNode.containerInfo,Lt=!0,aa(e,t,n),Pe=a,Lt=s;break;case 0:case 11:case 14:case 15:Aa(2,n,t),dt||Aa(4,n,t),aa(e,t,n);break;case 1:dt||(Ln(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Gd(n,t,a)),aa(e,t,n);break;case 21:aa(e,t,n);break;case 22:dt=(a=dt)||n.memoizedState!==null,aa(e,t,n),dt=a;break;default:aa(e,t,n)}}function Id(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ls(e)}catch(n){$e(t,t.return,n)}}}function Fd(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(n){$e(t,t.return,n)}}function Og(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zd),t;default:throw Error(u(435,e.tag))}}function pc(e,t){var n=Og(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var s=Gg.bind(null,e,a);a.then(s,s)}})}function Ht(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var s=n[a],r=e,d=t,g=d;e:for(;g!==null;){switch(g.tag){case 27:if(Ua(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));Jd(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;)Wd(t,e),t=t.sibling}var wn=null;function Wd(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ht(t,e),Bt(e),a&4&&(Aa(3,e,e.return),Vs(3,e),Aa(5,e,e.return));break;case 1:Ht(t,e),Bt(e),a&512&&(dt||n===null||Ln(n,n.return)),a&64&&na&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var s=wn;if(Ht(t,e),Bt(e),a&512&&(dt||n===null||Ln(n,n.return)),a&4){var r=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,s=s.ownerDocument||s;t:switch(a){case"title":r=s.getElementsByTagName("title")[0],(!r||r[pa]||r[pt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(a),s.head.insertBefore(r,s.querySelector("head > title"))),_t(r,a,n),r[pt]=e,ct(r),a=r;break e;case"link":var d=Wh("link","href",s).get(a+(n.href||""));if(d){for(var g=0;g<d.length;g++)if(r=d[g],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(g,1);break t}}r=s.createElement(a),_t(r,a,n),s.head.appendChild(r);break;case"meta":if(d=Wh("meta","content",s).get(a+(n.content||""))){for(g=0;g<d.length;g++)if(r=d[g],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(g,1);break t}}r=s.createElement(a),_t(r,a,n),s.head.appendChild(r);break;default:throw Error(u(468,a))}r[pt]=e,ct(r),a=r}e.stateNode=a}else Ph(s,e.type,e.stateNode);else e.stateNode=Fh(s,a,e.memoizedProps);else r!==a?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,a===null?Ph(s,e.type,e.stateNode):Fh(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&fu(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ht(t,e),Bt(e),a&512&&(dt||n===null||Ln(n,n.return)),n!==null&&a&4&&fu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ht(t,e),Bt(e),a&512&&(dt||n===null||Ln(n,n.return)),e.flags&32){s=e.stateNode;try{Vn(s,"")}catch(ie){$e(e,e.return,ie)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,fu(e,s,n!==null?n.memoizedProps:s)),a&1024&&(mu=!0);break;case 6:if(Ht(t,e),Bt(e),a&4){if(e.stateNode===null)throw Error(u(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(ie){$e(e,e.return,ie)}}break;case 3:if(Rc=null,s=wn,wn=Ac(t.containerInfo),Ht(t,e),wn=s,Bt(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{ls(t.containerInfo)}catch(ie){$e(e,e.return,ie)}mu&&(mu=!1,Pd(e));break;case 4:a=wn,wn=Ac(e.stateNode.containerInfo),Ht(t,e),Bt(e),wn=a;break;case 12:Ht(t,e),Bt(e);break;case 31:Ht(t,e),Bt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pc(e,a)));break;case 13:Ht(t,e),Bt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(xc=At()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pc(e,a)));break;case 22:s=e.memoizedState!==null;var b=n!==null&&n.memoizedState!==null,O=na,B=dt;if(na=O||s,dt=B||b,Ht(t,e),dt=B,na=O,Bt(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(n===null||b||na||dt||fl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){b=n=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 X=b.memoizedProps.style,D=X!=null&&X.hasOwnProperty("display")?X.display:null;g.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(ie){$e(b,b.return,ie)}}}else if(t.tag===6){if(n===null){b=t;try{b.stateNode.nodeValue=s?"":b.memoizedProps}catch(ie){$e(b,b.return,ie)}}}else if(t.tag===18){if(n===null){b=t;try{var L=b.stateNode;s?Gh(L,!0):Gh(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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,pc(e,n))));break;case 19:Ht(t,e),Bt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pc(e,a)));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 n,a=e.return;a!==null;){if(Xd(a)){n=a;break}a=a.return}if(n==null)throw Error(u(160));switch(n.tag){case 27:var s=n.stateNode,r=du(e);mc(e,r,s);break;case 5:var d=n.stateNode;n.flags&32&&(Vn(d,""),n.flags&=-33);var g=du(e);mc(e,g,d);break;case 3:case 4:var b=n.stateNode.containerInfo,O=du(e);hu(e,O,b);break;default:throw Error(u(161))}}catch(B){$e(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function la(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Vd(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:Aa(4,t,t.return),fl(t);break;case 1:Ln(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Gd(t,t.return,n),fl(t);break;case 27:ai(t.stateNode);case 26:case 5:Ln(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 sa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,d=r.flags;switch(r.tag){case 0:case 11:case 15:sa(s,r,n),Vs(4,r);break;case 1:if(sa(s,r,n),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(O){$e(a,a.return,O)}if(a=r,s=a.updateQueue,s!==null){var g=a.stateNode;try{var b=s.shared.hiddenCallbacks;if(b!==null)for(s.shared.hiddenCallbacks=null,s=0;s<b.length;s++)Cf(b[s],g)}catch(O){$e(a,a.return,O)}}n&&d&64&&$d(r),Ks(r,r.return);break;case 27:Qd(r);case 26:case 5:sa(s,r,n),n&&a===null&&d&4&&Yd(r),Ks(r,r.return);break;case 12:sa(s,r,n);break;case 31:sa(s,r,n),n&&d&4&&Id(s,r);break;case 13:sa(s,r,n),n&&d&4&&Fd(s,r);break;case 22:r.memoizedState===null&&sa(s,r,n),Ks(r,r.return);break;case 30:break;default:sa(s,r,n)}t=t.sibling}}function pu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ds(n))}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 kn(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)eh(e,t,n,a),t=t.sibling}function eh(e,t,n,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:kn(e,t,n,a),s&2048&&Vs(9,t);break;case 1:kn(e,t,n,a);break;case 3:kn(e,t,n,a),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){kn(e,t,n,a),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 kn(e,t,n,a);break;case 31:kn(e,t,n,a);break;case 13:kn(e,t,n,a);break;case 23:break;case 22:r=t.stateNode,d=t.alternate,t.memoizedState!==null?r._visibility&2?kn(e,t,n,a):Js(e,t):r._visibility&2?kn(e,t,n,a):(r._visibility|=2,Vl(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&pu(d,t);break;case 24:kn(e,t,n,a),s&2048&&gu(t.alternate,t);break;default:kn(e,t,n,a)}}function Vl(e,t,n,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,d=t,g=n,b=a,O=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 B=d.stateNode;d.memoizedState!==null?B._visibility&2?Vl(r,d,g,b,s):Js(r,d):(B._visibility|=2,Vl(r,d,g,b,s)),s&&O&2048&&pu(d.alternate,d);break;case 24:Vl(r,d,g,b,s),s&&O&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 n=e,a=t,s=a.flags;switch(a.tag){case 22:Js(n,a),s&2048&&pu(a.alternate,a);break;case 24:Js(n,a),s&2048&&gu(a.alternate,a);break;default:Js(n,a)}t=t.sibling}}var Is=8192;function Kl(e,t,n){if(e.subtreeFlags&Is)for(e=e.child;e!==null;)th(e,t,n),e=e.sibling}function th(e,t,n){switch(e.tag){case 26:Kl(e,t,n),e.flags&Is&&e.memoizedState!==null&&yx(n,wn,e.memoizedState,e.memoizedProps);break;case 5:Kl(e,t,n);break;case 3:case 4:var a=wn;wn=Ac(e.stateNode.containerInfo),Kl(e,t,n),wn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Is,Is=16777216,Kl(e,t,n),Is=a):Kl(e,t,n));break;default:Kl(e,t,n)}}function nh(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 n=0;n<t.length;n++){var a=t[n];bt=a,lh(a,e)}nh(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&&Aa(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 n=0;n<t.length;n++){var a=t[n];bt=a,lh(a,e)}nh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Aa(8,t,t.return),gc(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,gc(t));break;default:gc(t)}e=e.sibling}}function lh(e,t){for(;bt!==null;){var n=bt;switch(n.tag){case 0:case 11:case 15:Aa(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ds(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,bt=a;else e:for(n=e;bt!==null;){a=bt;var s=a.sibling,r=a.return;if(Kd(a),a===n){bt=null;break e}if(s!==null){s.return=r,bt=s;break e}bt=r}}}var Dg={getCacheForType:function(e){var t=Tt(ut),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Tt(ut).controller.signal}},Mg=typeof WeakMap=="function"?WeakMap:Map,Le=0,Ke=null,Ne=null,ke=0,qe=0,It=null,Ca=!1,Jl=!1,xu=!1,ia=0,nt=0,Ra=0,dl=0,vu=0,Ft=0,Il=0,Ws=null,qt=null,yu=!1,xc=0,sh=0,vc=1/0,yc=null,za=null,xt=0,Oa=null,Fl=null,ca=0,bu=0,ju=null,ih=null,Ps=0,Nu=null;function Wt(){return(Le&2)!==0&&ke!==0?ke&-ke:H.T!==null?_u():kl()}function ch(){if(Ft===0)if((ke&536870912)===0||Ae){var e=yn;yn<<=1,(yn&3932160)===0&&(yn=262144),Ft=e}else Ft=536870912;return e=Kt.current,e!==null&&(e.flags|=32),Ft}function $t(e,t,n){(e===Ke&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(Wl(e,0),Da(e,ke,Ft,!1)),zn(e,n),((Le&2)===0||e!==Ke)&&(e===Ke&&((Le&2)===0&&(dl|=n),nt===4&&Da(e,ke,Ft,!1)),Hn(e))}function rh(e,t,n){if((Le&6)!==0)throw Error(u(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||fa(e,t),s=a?Hg(e,t):wu(e,t,!0),r=a;do{if(s===0){Jl&&!a&&Da(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!Ug(n)){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),Da(e,t,0,!0);break}e:{switch(a=e,r=s,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Da(a,t,Ft,!Ca);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(Da(a,t,Ft,!Ca),Za(a,0,!0)!==0)break e;ca=t,a.timeoutHandle=Bh(uh.bind(null,a,n,qt,yc,yu,t,Ft,dl,Il,Ca,r,"Throttled",-0,0),s);break e}uh(a,n,qt,yc,yu,t,Ft,dl,Il,Ca,r,null,-0,0)}}break}while(!0);Hn(e)}function uh(e,t,n,a,s,r,d,g,b,O,B,X,D,L){if(e.timeoutHandle=-1,X=t.subtreeFlags,X&8192||(X&16785408)===16785408){X={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:A},th(t,r,X);var ie=(r&62914560)===r?xc-At():(r&4194048)===r?sh-At():0;if(ie=bx(X,ie),ie!==null){ca=r,e.cancelPendingCommit=ie(xh.bind(null,e,t,r,n,a,s,d,g,b,B,X,null,D,L)),Da(e,r,d,!O);return}}xh(e,t,r,n,a,s,d,g,b)}function Ug(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var s=n[a],r=s.getSnapshot;s=s.value;try{if(!Zt(r(),s))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Da(e,t,n,a){t&=~vu,t&=~dl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-Ct(s),d=1<<r;a[r]=-1,s&=~d}n!==0&&Gn(e,n,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,In=al=null,Br(e),Gl=null,Us=0,e=Ne;for(;e!==null;)qd(e.alternate,e),e=e.return;Ne=null}}function Wl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,nx(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ca=0,Su(),Ke=e,Ne=n=Kn(e.current,null),ke=t,qe=0,It=null,Ca=!1,Jl=fa(e,t),xu=!1,Il=Ft=vu=dl=Ra=nt=0,qt=Ws=null,yu=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var s=31-Ct(a),r=1<<s;t|=e[s],a&=~r}return ia=t,$i(),n}function oh(e,t){xe=null,H.H=Xs,t===$l||t===Ji?(t=Tf(),qe=3):t===Er?(t=Tf(),qe=4):qe=t===tu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,It=t,Ne===null&&(nt=1,uc(e,fn(t,e.current)))}function fh(){var e=Kt.current;return e===null?!0:(ke&4194048)===ke?pn===null:(ke&62914560)===ke||(ke&536870912)!==0?e===pn:!1}function dh(){var e=H.H;return H.H=Xs,e===null?Xs:e}function hh(){var e=H.A;return H.A=Dg,e}function jc(){nt=4,Ca||(ke&4194048)!==ke&&Kt.current!==null||(Jl=!0),(Ra&134217727)===0&&(dl&134217727)===0||Ke===null||Da(Ke,ke,Ft,!1)}function wu(e,t,n){var a=Le;Le|=2;var s=dh(),r=hh();(Ke!==e||ke!==t)&&(yc=null,Wl(e,t)),t=!1;var d=nt;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 O=qe;if(qe=0,It=null,Pl(e,g,b,O),n&&Jl){d=0;break e}break;default:O=qe,qe=0,It=null,Pl(e,g,b,O)}}Lg(),d=nt;break}catch(B){oh(e,B)}while(!0);return t&&e.shellSuspendCounter++,In=al=null,Le=a,H.H=s,H.A=r,Ne===null&&(Ke=null,ke=0,$i()),d}function Lg(){for(;Ne!==null;)mh(Ne)}function Hg(e,t){var n=Le;Le|=2;var a=dh(),s=hh();Ke!==e||ke!==t?(yc=null,vc=At()+500,Wl(e,t)):Jl=fa(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(wf(r)){qe=0,It=null,ph(t);break}t=function(){qe!==2&&qe!==9||Ke!==e||(qe=7),Hn(e)},r.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:wf(r)?(qe=0,It=null,ph(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?em(d):g.stateNode.complete){qe=0,It=null;var b=g.sibling;if(b!==null)Ne=b;else{var O=g.return;O!==null?(Ne=O,Nc(O)):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(),nt=6;break e;default:throw Error(u(462))}}Bg();break}catch(B){oh(e,B)}while(!0);return In=al=null,H.H=a,H.A=s,Le=n,Ne!==null?0:(Ke=null,ke=0,$i(),nt)}function Bg(){for(;Ne!==null&&!Si();)mh(Ne)}function mh(e){var t=Hd(e.alternate,e,ia);e.memoizedProps=e.pendingProps,t===null?Nc(e):Ne=t}function ph(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=zd(n,t,t.pendingProps,t.type,void 0,ke);break;case 11:t=zd(n,t,t.pendingProps,t.type.render,t.ref,ke);break;case 5:Br(t);default:qd(n,t),t=Ne=hf(t,ia),t=Hd(n,t,ia)}e.memoizedProps=e.pendingProps,t===null?Nc(e):Ne=t}function Pl(e,t,n,a){In=al=null,Br(t),Gl=null,Us=0;var s=t.return;try{if(Eg(e,s,t,n,ke)){nt=1,uc(e,fn(n,e.current)),Ne=null;return}}catch(r){if(s!==null)throw Ne=s,r;nt=1,uc(e,fn(n,e.current)),Ne=null;return}t.flags&32768?(Ae||a===1?e=!0:Jl||(ke&536870912)!==0?e=!1:(Ca=e=!0,(a===2||a===9||a===3||a===6)&&(a=Kt.current,a!==null&&a.tag===13&&(a.flags|=16384))),gh(t,e)):Nc(t)}function Nc(e){var t=e;do{if((t.flags&32768)!==0){gh(t,Ca);return}e=t.return;var n=Cg(t.alternate,t,ia);if(n!==null){Ne=n;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);nt===0&&(nt=5)}function gh(e,t){do{var n=Rg(e.alternate,e);if(n!==null){n.flags&=32767,Ne=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=n}while(e!==null);nt=6,Ne=null}function xh(e,t,n,a,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,cn(e,n,r,d,g,b),e===Ke&&(Ne=Ke=null,ke=0),Fl=t,Oa=e,ca=n,bu=r,ju=s,ih=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Yg(ln,function(){return Nh(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=H.T,H.T=null,s=ee.p,ee.p=2,d=Le,Le|=4;try{zg(e,t,n)}finally{Le=d,ee.p=s,H.T=a}}xt=1,vh(),yh(),bh()}}function vh(){if(xt===1){xt=0;var e=Oa,t=Fl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=H.T,H.T=null;var a=ee.p;ee.p=2;var s=Le;Le|=4;try{Wd(t,e);var r=Uu,d=af(e.containerInfo),g=r.focusedElem,b=r.selectionRange;if(d!==g&&g&&g.ownerDocument&&nf(g.ownerDocument.documentElement,g)){if(b!==null&&cr(g)){var O=b.start,B=b.end;if(B===void 0&&(B=O),"selectionStart"in g)g.selectionStart=O,g.selectionEnd=Math.min(B,g.value.length);else{var X=g.ownerDocument||document,D=X&&X.defaultView||window;if(D.getSelection){var L=D.getSelection(),ie=g.textContent.length,de=Math.min(b.start,ie),Ze=b.end===void 0?de:Math.min(b.end,ie);!L.extend&&de>Ze&&(d=Ze,Ze=de,de=d);var C=tf(g,de),S=tf(g,Ze);if(C&&S&&(L.rangeCount!==1||L.anchorNode!==C.node||L.anchorOffset!==C.offset||L.focusNode!==S.node||L.focusOffset!==S.offset)){var z=X.createRange();z.setStart(C.node,C.offset),L.removeAllRanges(),de>Ze?(L.addRange(z),L.extend(S.node,S.offset)):(z.setEnd(S.node,S.offset),L.addRange(z))}}}}for(X=[],L=g;L=L.parentNode;)L.nodeType===1&&X.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<X.length;g++){var q=X[g];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}Mc=!!Mu,Uu=Mu=null}finally{Le=s,ee.p=a,H.T=n}}e.current=t,xt=2}}function yh(){if(xt===2){xt=0;var e=Oa,t=Fl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=H.T,H.T=null;var a=ee.p;ee.p=2;var s=Le;Le|=4;try{Vd(e,t.alternate,t)}finally{Le=s,ee.p=a,H.T=n}}xt=3}}function bh(){if(xt===4||xt===3){xt=0,fs();var e=Oa,t=Fl,n=ca,a=ih;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?xt=5:(xt=0,Fl=Oa=null,jh(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(za=null),wl(n),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(sn,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=H.T,s=ee.p,ee.p=2,H.T=null;try{for(var r=e.onRecoverableError,d=0;d<a.length;d++){var g=a[d];r(g.value,{componentStack:g.stack})}}finally{H.T=t,ee.p=s}}(ca&3)!==0&&Sc(),Hn(e),s=e.pendingLanes,(n&261930)!==0&&(s&42)!==0?e===Nu?Ps++:(Ps=0,Nu=e):Ps=0,ei(0)}}function jh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ds(t)))}function Sc(){return vh(),yh(),bh(),Nh()}function Nh(){if(xt!==5)return!1;var e=Oa,t=bu;bu=0;var n=wl(ca),a=H.T,s=ee.p;try{ee.p=32>n?32:n,H.T=null,n=ju,ju=null;var r=Oa,d=ca;if(xt=0,Fl=Oa=null,ca=0,(Le&6)!==0)throw Error(u(331));var g=Le;if(Le|=4,ah(r.current),eh(r,r.current,d,n),Le=g,ei(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(sn,r)}catch{}return!0}finally{ee.p=s,H.T=a,jh(e,t)}}function Sh(e,t,n){t=fn(n,t),t=eu(e.stateNode,t,2),e=Ta(e,t,2),e!==null&&(zn(e,2),Hn(e))}function $e(e,t,n){if(e.tag===3)Sh(e,e,n);else for(;t!==null;){if(t.tag===3){Sh(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(za===null||!za.has(a))){e=fn(n,e),n=wd(2),a=Ta(t,n,2),a!==null&&(kd(n,a,t,e),zn(a,2),Hn(a));break}}t=t.return}}function ku(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Mg;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(n)||(xu=!0,s.add(n),e=qg.bind(null,e,t,n),t.then(e,e))}function qg(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ke===e&&(ke&n)===n&&(nt===4||nt===3&&(ke&62914560)===ke&&300>At()-xc?(Le&2)===0&&Wl(e,0):vu|=n,Il===ke&&(Il=0)),Hn(e)}function wh(e,t){t===0&&(t=ps()),e=el(e,t),e!==null&&(zn(e,t),Hn(e))}function $g(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wh(e,n)}function Gg(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(u(314))}a!==null&&a.delete(t),wh(e,n)}function Yg(e,t){return bl(e,t)}var wc=null,es=null,Tu=!1,kc=!1,Eu=!1,Ma=0;function Hn(e){e!==es&&e.next===null&&(es===null?wc=es=e:es=es.next=e),kc=!0,Tu||(Tu=!0,Qg())}function ei(e,t){if(!Eu&&kc){Eu=!0;do for(var n=!1,a=wc;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var d=a.suspendedLanes,g=a.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&&(n=!0,_h(a,r))}else r=ke,r=Za(a,a===Ke?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||fa(a,r)||(n=!0,_h(a,r));a=a.next}while(n);Eu=!1}}function Xg(){kh()}function kh(){kc=Tu=!1;var e=0;Ma!==0&&tx()&&(e=Ma);for(var t=At(),n=null,a=wc;a!==null;){var s=a.next,r=Th(a,t);r===0?(a.next=null,n===null?wc=s:n.next=s,s===null&&(es=n)):(n=a,(e!==0||(r&3)!==0)&&(kc=!0)),a=s}xt!==0&&xt!==5||ei(e),Ma!==0&&(Ma=0)}function Th(e,t){for(var n=e.suspendedLanes,a=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&n)===0||(g&a)!==0)&&(s[d]=Ei(g,t)):b<=t&&(e.expiredLanes|=g),r&=~g}if(t=Ke,n=ke,n=Za(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&an(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||fa(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&an(a),wl(n)){case 2:case 8:n=Cn;break;case 32:n=ln;break;case 268435456:n=Qa;break;default:n=ln}return a=Eh.bind(null,e),n=bl(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&an(a),e.callbackPriority=2,e.callbackNode=null,2}function Eh(e,t){if(xt!==0&&xt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Sc()&&e.callbackNode!==n)return null;var a=ke;return a=Za(e,e===Ke?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(rh(e,a,t),Th(e,At()),e.callbackNode!=null&&e.callbackNode===n?Eh.bind(null,e):null)}function _h(e,t){if(Sc())return null;rh(e,t,!0)}function Qg(){ax(function(){(Le&6)!==0?bl(vn,Xg):kh()})}function _u(){if(Ma===0){var e=Bl;e===0&&(e=oa,oa<<=1,(oa&261888)===0&&(oa=256)),Ma=e}return Ma}function Ah(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:v(""+e)}function Ch(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Zg(e,t,n,a,s){if(t==="submit"&&n&&n.stateNode===s){var r=Ah((s[it]||null).action),d=a.submitter;d&&(t=(t=d[it]||null)?Ah(t.formAction):d.getAttribute("formAction"),t!==null&&(r=t,d=null));var g=new Li("action","action",null,a,s);e.push({event:g,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Ma!==0){var b=d?Ch(s,d):new FormData(s);Kr(n,{pending:!0,data:b,method:s.method,action:r},null,b)}}else typeof r=="function"&&(g.preventDefault(),b=d?Ch(s,d):new FormData(s),Kr(n,{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],Vg=Cu.toLowerCase(),Kg=Cu[0].toUpperCase()+Cu.slice(1);Sn(Vg,"on"+Kg)}Sn(cf,"onAnimationEnd"),Sn(rf,"onAnimationIteration"),Sn(uf,"onAnimationStart"),Sn("dblclick","onDoubleClick"),Sn("focusin","onFocus"),Sn("focusout","onBlur"),Sn(og,"onTransitionRun"),Sn(fg,"onTransitionStart"),Sn(dg,"onTransitionCancel"),Sn(of,"onTransitionEnd"),Nn("onMouseEnter",["mouseout","mouseover"]),Nn("onMouseLeave",["mouseout","mouseover"]),Nn("onPointerEnter",["pointerout","pointerover"]),Nn("onPointerLeave",["pointerout","pointerover"]),On("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),On("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),On("onBeforeInput",["compositionend","keypress","textInput","paste"]),On("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),On("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),On("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(" "),Jg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ti));function Rh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],s=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var d=a.length-1;0<=d;d--){var g=a[d],b=g.instance,O=g.currentTarget;if(g=g.listener,b!==r&&s.isPropagationStopped())break e;r=g,s.currentTarget=O;try{r(s)}catch(B){qi(B)}s.currentTarget=null,r=b}else for(d=0;d<a.length;d++){if(g=a[d],b=g.instance,O=g.currentTarget,g=g.listener,b!==r&&s.isPropagationStopped())break e;r=g,s.currentTarget=O;try{r(s)}catch(B){qi(B)}s.currentTarget=null,r=b}}}}function Se(e,t){var n=t[vs];n===void 0&&(n=t[vs]=new Set);var a=e+"__bubble";n.has(a)||(zh(t,e,2,!1),n.add(a))}function Ru(e,t,n){var a=0;t&&(a|=4),zh(n,e,a,t)}var Tc="_reactListening"+Math.random().toString(36).slice(2);function zu(e){if(!e[Tc]){e[Tc]=!0,Ai.forEach(function(n){n!=="selectionchange"&&(Jg.has(n)||Ru(n,!1,e),Ru(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tc]||(t[Tc]=!0,Ru("selectionchange",!1,t))}}function zh(e,t,n,a){switch(cm(t)){case 2:var s=Sx;break;case 8:s=wx;break;default:s=Vu}n=s.bind(null,t,n,e),s=void 0,!gt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),a?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Ou(e,t,n,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var d=a.tag;if(d===3||d===4){var g=a.stateNode.containerInfo;if(g===s)break;if(d===4)for(d=a.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=Yn(g),d===null)return;if(b=d.tag,b===5||b===6||b===26||b===27){a=r=d;continue e}g=g.parentNode}}a=a.return}wt(function(){var O=r,B=le(n),X=[];e:{var D=ff.get(e);if(D!==void 0){var L=Li,ie=e;switch(e){case"keypress":if(Mi(n)===0)break e;case"keydown":case"keyup":L=Gp;break;case"focusin":ie="focus",L=nr;break;case"focusout":ie="blur",L=nr;break;case"beforeblur":case"afterblur":L=nr;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":L=Bo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=Cp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=Qp;break;case cf:case rf:case uf:L=Op;break;case of:L=Vp;break;case"scroll":case"scrollend":L=_p;break;case"wheel":L=Jp;break;case"copy":case"cut":case"paste":L=Mp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=$o;break;case"toggle":case"beforetoggle":L=Fp}var de=(t&4)!==0,Ze=!de&&(e==="scroll"||e==="scrollend"),C=de?D!==null?D+"Capture":null:D;de=[];for(var S=O,z;S!==null;){var q=S;if(z=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||z===null||C===null||(q=rt(S,C),q!=null&&de.push(ni(S,q,z))),Ze)break;S=S.return}0<de.length&&(D=new L(D,ie,null,n,B),X.push({event:D,listeners:de}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",D&&n!==Q&&(ie=n.relatedTarget||n.fromElement)&&(Yn(ie)||ie[ha]))break e;if((L||D)&&(D=B.window===B?B:(D=B.ownerDocument)?D.defaultView||D.parentWindow:window,L?(ie=n.relatedTarget||n.toElement,L=O,ie=ie?Yn(ie):null,ie!==null&&(Ze=h(ie),de=ie.tag,ie!==Ze||de!==5&&de!==27&&de!==6)&&(ie=null)):(L=null,ie=O),L!==ie)){if(de=Bo,q="onMouseLeave",C="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(de=$o,q="onPointerLeave",C="onPointerEnter",S="pointer"),Ze=L==null?D:Ka(L),z=ie==null?D:Ka(ie),D=new de(q,S+"leave",L,n,B),D.target=Ze,D.relatedTarget=z,q=null,Yn(B)===O&&(de=new de(C,S+"enter",ie,n,B),de.target=z,de.relatedTarget=Ze,q=de),Ze=q,L&&ie)t:{for(de=Ig,C=L,S=ie,z=0,q=C;q;q=de(q))z++;q=0;for(var oe=S;oe;oe=de(oe))q++;for(;0<z-q;)C=de(C),z--;for(;0<q-z;)S=de(S),q--;for(;z--;){if(C===S||S!==null&&C===S.alternate){de=C;break t}C=de(C),S=de(S)}de=null}else de=null;L!==null&&Oh(X,D,L,de,!1),ie!==null&&Ze!==null&&Oh(X,Ze,ie,de,!0)}}e:{if(D=O?Ka(O):window,L=D.nodeName&&D.nodeName.toLowerCase(),L==="select"||L==="input"&&D.type==="file")var Me=Jo;else if(Vo(D))if(Io)Me=cg;else{Me=sg;var ce=lg}else L=D.nodeName,!L||L.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?O&&va(O.elementType)&&(Me=Jo):Me=ig;if(Me&&(Me=Me(e,O))){Ko(X,Me,n,B);break e}ce&&ce(e,D,O),e==="focusout"&&O&&D.type==="number"&&O.memoizedProps.value!=null&&Al(D,"number",D.value)}switch(ce=O?Ka(O):window,e){case"focusin":(Vo(ce)||ce.contentEditable==="true")&&(Rl=ce,rr=O,Rs=null);break;case"focusout":Rs=rr=Rl=null;break;case"mousedown":ur=!0;break;case"contextmenu":case"mouseup":case"dragend":ur=!1,lf(X,n,B);break;case"selectionchange":if(ug)break;case"keydown":case"keyup":lf(X,n,B)}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?Qo(e,n)&&(Te="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Te="onCompositionStart");Te&&(Go&&n.locale!=="ko"&&(Cl||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&Cl&&(ye=Lo()):(ya=B,Pc="value"in ya?ya.value:ya.textContent,Cl=!0)),ce=Ec(O,Te),0<ce.length&&(Te=new qo(Te,e,null,n,B),X.push({event:Te,listeners:ce}),ye?Te.data=ye:(ye=Zo(n),ye!==null&&(Te.data=ye)))),(ye=Pp?eg(e,n):tg(e,n))&&(Te=Ec(O,"onBeforeInput"),0<Te.length&&(ce=new qo("onBeforeInput","beforeinput",null,n,B),X.push({event:ce,listeners:Te}),ce.data=ye)),Zg(X,e,O,n,B)}Rh(X,t)})}function ni(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ec(e,t){for(var n=t+"Capture",a=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=rt(e,n),s!=null&&a.unshift(ni(e,s,r)),s=rt(e,t),s!=null&&a.push(ni(e,s,r))),e.tag===3)return a;e=e.return}return[]}function Ig(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Oh(e,t,n,a,s){for(var r=t._reactName,d=[];n!==null&&n!==a;){var g=n,b=g.alternate,O=g.stateNode;if(g=g.tag,b!==null&&b===a)break;g!==5&&g!==26&&g!==27||O===null||(b=O,s?(O=rt(n,r),O!=null&&d.unshift(ni(n,O,b))):s||(O=rt(n,r),O!=null&&d.push(ni(n,O,b)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var Fg=/\r\n?/g,Wg=/\u0000|\uFFFD/g;function Dh(e){return(typeof e=="string"?e:""+e).replace(Fg,`
|
|
10
|
+
`).replace(Wg,"")}function Mh(e,t){return t=Dh(t),Dh(e)===t}function Qe(e,t,n,a,s,r){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Vn(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Vn(e,""+a);break;case"className":Ia(e,"class",a);break;case"tabIndex":Ia(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Ia(e,n,a);break;case"style":Ns(e,a,r);break;case"data":if(t!=="object"){Ia(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=v(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"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"&&(n==="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(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=v(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=A);break;case"onScroll":a!=null&&Se("scroll",e);break;case"onScrollEnd":a!=null&&Se("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(n=a.__html,n!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=v(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":Se("beforetoggle",e),Se("toggle",e),Tl(e,"popover",a);break;case"xlinkActuate":un(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":un(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":un(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":un(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":un(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":un(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":un(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":un(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":un(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Tl(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Ss.get(n)||n,Tl(e,n,a))}}function Du(e,t,n,a,s,r){switch(n){case"style":Ns(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(n=a.__html,n!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"children":typeof a=="string"?Vn(e,a):(typeof a=="number"||typeof a=="bigint")&&Vn(e,""+a);break;case"onScroll":a!=null&&Se("scroll",e);break;case"onScrollEnd":a!=null&&Se("scrollend",e);break;case"onClick":a!=null&&(e.onclick=A);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jn.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),r=e[it]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,s),typeof a=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,s);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):Tl(e,n,a)}}}function _t(e,t,n){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 a=!1,s=!1,r;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Qe(e,t,r,d,n,null)}}s&&Qe(e,t,"srcSet",n.srcSet,n,null),a&&Qe(e,t,"src",n.src,n,null);return;case"input":Se("invalid",e);var g=r=d=s=null,b=null,O=null;for(a in n)if(n.hasOwnProperty(a)){var B=n[a];if(B!=null)switch(a){case"name":s=B;break;case"type":d=B;break;case"checked":b=B;break;case"defaultChecked":O=B;break;case"value":r=B;break;case"defaultValue":g=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(u(137,t));break;default:Qe(e,t,a,B,n,null)}}bs(e,r,g,b,O,d,s,!1);return;case"select":Se("invalid",e),a=d=r=null;for(s in n)if(n.hasOwnProperty(s)&&(g=n[s],g!=null))switch(s){case"value":r=g;break;case"defaultValue":d=g;break;case"multiple":a=g;default:Qe(e,t,s,g,n,null)}t=r,n=d,e.multiple=!!a,t!=null?Zn(e,!!a,t,!1):n!=null&&Zn(e,!!a,n,!0);return;case"textarea":Se("invalid",e),r=s=a=null;for(d in n)if(n.hasOwnProperty(d)&&(g=n[d],g!=null))switch(d){case"value":a=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,n,null)}zi(e,a,s,r);return;case"option":for(b in n)n.hasOwnProperty(b)&&(a=n[b],a!=null)&&(b==="selected"?e.selected=a&&typeof a!="function"&&typeof a!="symbol":Qe(e,t,b,a,n,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(a=0;a<ti.length;a++)Se(ti[a],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(O in n)if(n.hasOwnProperty(O)&&(a=n[O],a!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Qe(e,t,O,a,n,null)}return;default:if(va(t)){for(B in n)n.hasOwnProperty(B)&&(a=n[B],a!==void 0&&Du(e,t,B,a,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(a=n[g],a!=null&&Qe(e,t,g,a,n,null))}function Pg(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,r=null,d=null,g=null,b=null,O=null,B=null;for(L in n){var X=n[L];if(n.hasOwnProperty(L)&&X!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":b=X;default:a.hasOwnProperty(L)||Qe(e,t,L,null,a,X)}}for(var D in a){var L=a[D];if(X=n[D],a.hasOwnProperty(D)&&(L!=null||X!=null))switch(D){case"type":r=L;break;case"name":s=L;break;case"checked":O=L;break;case"defaultChecked":B=L;break;case"value":d=L;break;case"defaultValue":g=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(u(137,t));break;default:L!==X&&Qe(e,t,D,L,a,X)}}ys(e,d,g,b,O,B,r,s);return;case"select":L=d=g=D=null;for(r in n)if(b=n[r],n.hasOwnProperty(r)&&b!=null)switch(r){case"value":break;case"multiple":L=b;default:a.hasOwnProperty(r)||Qe(e,t,r,null,a,b)}for(s in a)if(r=a[s],b=n[s],a.hasOwnProperty(s)&&(r!=null||b!=null))switch(s){case"value":D=r;break;case"defaultValue":g=r;break;case"multiple":d=r;default:r!==b&&Qe(e,t,s,r,a,b)}t=g,n=d,a=L,D!=null?Zn(e,!!n,D,!1):!!a!=!!n&&(t!=null?Zn(e,!!n,t,!0):Zn(e,!!n,n?[]:"",!1));return;case"textarea":L=D=null;for(g in n)if(s=n[g],n.hasOwnProperty(g)&&s!=null&&!a.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Qe(e,t,g,null,a,s)}for(d in a)if(s=a[d],r=n[d],a.hasOwnProperty(d)&&(s!=null||r!=null))switch(d){case"value":D=s;break;case"defaultValue":L=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==r&&Qe(e,t,d,s,a,r)}js(e,D,L);return;case"option":for(var ie in n)D=n[ie],n.hasOwnProperty(ie)&&D!=null&&!a.hasOwnProperty(ie)&&(ie==="selected"?e.selected=!1:Qe(e,t,ie,null,a,D));for(b in a)D=a[b],L=n[b],a.hasOwnProperty(b)&&D!==L&&(D!=null||L!=null)&&(b==="selected"?e.selected=D&&typeof D!="function"&&typeof D!="symbol":Qe(e,t,b,D,a,L));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 n)D=n[de],n.hasOwnProperty(de)&&D!=null&&!a.hasOwnProperty(de)&&Qe(e,t,de,null,a,D);for(O in a)if(D=a[O],L=n[O],a.hasOwnProperty(O)&&D!==L&&(D!=null||L!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(137,t));break;default:Qe(e,t,O,D,a,L)}return;default:if(va(t)){for(var Ze in n)D=n[Ze],n.hasOwnProperty(Ze)&&D!==void 0&&!a.hasOwnProperty(Ze)&&Du(e,t,Ze,void 0,a,D);for(B in a)D=a[B],L=n[B],!a.hasOwnProperty(B)||D===L||D===void 0&&L===void 0||Du(e,t,B,D,a,L);return}}for(var C in n)D=n[C],n.hasOwnProperty(C)&&D!=null&&!a.hasOwnProperty(C)&&Qe(e,t,C,null,a,D);for(X in a)D=a[X],L=n[X],!a.hasOwnProperty(X)||D===L||D==null&&L==null||Qe(e,t,X,D,a,L)}function Uh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ex(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var s=n[a],r=s.transferSize,d=s.initiatorType,g=s.duration;if(r&&g&&Uh(d)){for(d=0,g=s.responseEnd,a+=1;a<n.length;a++){var b=n[a],O=b.startTime;if(O>g)break;var B=b.transferSize,X=b.initiatorType;B&&Uh(X)&&(b=b.responseEnd,d+=B*(b<g?1:(g-O)/(b-O)))}if(--a,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 Lh(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 Hh(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 tx(){var e=window.event;return e&&e.type==="popstate"?e===Hu?!1:(Hu=e,!0):(Hu=null,!1)}var Bh=typeof setTimeout=="function"?setTimeout:void 0,nx=typeof clearTimeout=="function"?clearTimeout:void 0,qh=typeof Promise=="function"?Promise:void 0,ax=typeof queueMicrotask=="function"?queueMicrotask:typeof qh<"u"?function(e){return qh.resolve(null).then(e).catch(lx)}:Bh;function lx(e){setTimeout(function(){throw e})}function Ua(e){return e==="head"}function $h(e,t){var n=t,a=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(s),ls(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")ai(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ai(n);for(var r=n.firstChild;r;){var d=r.nextSibling,g=r.nodeName;r[pa]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=d}}else n==="body"&&ai(e.ownerDocument.body);n=s}while(n);ls(t)}function Gh(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function Bu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Bu(n),Va(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function sx(e,t,n,a){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[pa])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=gn(e.nextSibling),e===null)break}return null}function ix(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=gn(e.nextSibling),e===null))return null;return e}function Yh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=gn(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 cx(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function gn(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 Xh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return gn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Qh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Zh(e,t,n){switch(t=_c(n),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 ai(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Va(e)}var xn=new Map,Vh=new Set;function Ac(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ra=ee.d;ee.d={f:rx,r:ux,D:ox,C:fx,L:dx,m:hx,X:px,S:mx,M:gx};function rx(){var e=ra.f(),t=bc();return e||t}function ux(e){var t=Xn(e);t!==null&&t.tag===5&&t.type==="form"?od(t):ra.r(e)}var ts=typeof document>"u"?null:document;function Kh(e,t,n){var a=ts;if(a&&typeof t=="string"&&t){var s=St(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),Vh.has(s)||(Vh.add(s),e={rel:e,crossOrigin:n,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),_t(t,"link",e),ct(t),a.head.appendChild(t)))}}function ox(e){ra.D(e),Kh("dns-prefetch",e,null)}function fx(e,t){ra.C(e,t),Kh("preconnect",e,t)}function dx(e,t,n){ra.L(e,t,n);var a=ts;if(a&&e&&t){var s='link[rel="preload"][as="'+St(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+St(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+St(n.imageSizes)+'"]')):s+='[href="'+St(e)+'"]';var r=s;switch(t){case"style":r=ns(e);break;case"script":r=as(e)}xn.has(r)||(e=_({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),xn.set(r,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(li(r))||t==="script"&&a.querySelector(si(r))||(t=a.createElement("link"),_t(t,"link",e),ct(t),a.head.appendChild(t)))}}function hx(e,t){ra.m(e,t);var n=ts;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+St(a)+'"][href="'+St(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=as(e)}if(!xn.has(r)&&(e=_({rel:"modulepreload",href:e},t),xn.set(r,e),n.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(si(r)))return}a=n.createElement("link"),_t(a,"link",e),ct(a),n.head.appendChild(a)}}}function mx(e,t,n){ra.S(e,t,n);var a=ts;if(a&&e){var s=ga(a).hoistableStyles,r=ns(e);t=t||"default";var d=s.get(r);if(!d){var g={loading:0,preload:null};if(d=a.querySelector(li(r)))g.loading=5;else{e=_({rel:"stylesheet",href:e,"data-precedence":t},n),(n=xn.get(r))&&Yu(e,n);var b=d=a.createElement("link");ct(b),_t(b,"link",e),b._p=new Promise(function(O,B){b.onload=O,b.onerror=B}),b.addEventListener("load",function(){g.loading|=1}),b.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Cc(d,t,a)}d={type:"stylesheet",instance:d,count:1,state:g},s.set(r,d)}}}function px(e,t){ra.X(e,t);var n=ts;if(n&&e){var a=ga(n).hoistableScripts,s=as(e),r=a.get(s);r||(r=n.querySelector(si(s)),r||(e=_({src:e,async:!0},t),(t=xn.get(s))&&Xu(e,t),r=n.createElement("script"),ct(r),_t(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function gx(e,t){ra.M(e,t);var n=ts;if(n&&e){var a=ga(n).hoistableScripts,s=as(e),r=a.get(s);r||(r=n.querySelector(si(s)),r||(e=_({src:e,async:!0,type:"module"},t),(t=xn.get(s))&&Xu(e,t),r=n.createElement("script"),ct(r),_t(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Jh(e,t,n,a){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 n.precedence=="string"&&typeof n.href=="string"?(t=ns(n.href),n=ga(s).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ns(n.href);var r=ga(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),xn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},xn.set(e,n),r||xx(s,e,n,d.state))),t&&a===null)throw Error(u(528,""));return d}if(t&&a!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=as(n),n=ga(s).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function ns(e){return'href="'+St(e)+'"'}function li(e){return'link[rel="stylesheet"]['+e+"]"}function Ih(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function xx(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),_t(t,"link",n),ct(t),e.head.appendChild(t))}function as(e){return'[src="'+St(e)+'"]'}function si(e){return"script[async]"+e}function Fh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+St(n.href)+'"]');if(a)return t.instance=a,ct(a),a;var s=_({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),ct(a),_t(a,"style",s),Cc(a,n.precedence,e),t.instance=a;case"stylesheet":s=ns(n.href);var r=e.querySelector(li(s));if(r)return t.state.loading|=4,t.instance=r,ct(r),r;a=Ih(n),(s=xn.get(s))&&Yu(a,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",a),t.state.loading|=4,Cc(r,n.precedence,e),t.instance=r;case"script":return r=as(n.src),(s=e.querySelector(si(r)))?(t.instance=s,ct(s),s):(a=n,(s=xn.get(r))&&(a=_({},n),Xu(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),ct(s),_t(s,"link",a),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&&(a=t.instance,t.state.loading|=4,Cc(a,n.precedence,e));return t.instance}function Cc(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,r=s,d=0;d<a.length;d++){var g=a[d];if(g.dataset.precedence===t)r=g;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,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 Wh(e,t,n){if(Rc===null){var a=new Map,s=Rc=new Map;s.set(n,a)}else s=Rc,a=s.get(n),a||(a=new Map,s.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var r=n[s];if(!(r[pa]||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=a.get(d);g?g.push(r):a.set(d,[r])}}return a}function Ph(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function vx(e,t,n){if(n===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 em(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function yx(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=ns(a.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)),n.state.loading|=4,n.instance=r,ct(r);return}r=t.ownerDocument||t,a=Ih(a),(s=xn.get(s))&&Yu(a,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",a),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=zc.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Qu=0;function bx(e,t){return e.stylesheets&&e.count===0&&Dc(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=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*ex());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=n,function(){e.unsuspend=null,clearTimeout(a),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(jx,e),Oc=null,zc.call(e))}function jx(e,t){if(!(t.state.loading&4)){var n=Oc.get(e);if(n)var a=n.get(null);else{n=new Map,Oc.set(e,n);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")&&(n.set(d.dataset.precedence,d),a=d)}a&&n.set(null,a)}s=t.instance,d=s.getAttribute("data-precedence"),r=n.get(d)||a,r===a&&n.set(null,s),n.set(d,s),this.count++,a=zc.bind(this),s.addEventListener("load",a),s.addEventListener("error",a),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:re,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function Nx(e,t,n,a,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=da(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=da(0),this.hiddenUpdates=da(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function tm(e,t,n,a,s,r,d,g,b,O,B,X){return e=new Nx(e,t,n,d,b,O,B,X,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:a,isDehydrated:n,cache:t},_r(r),e}function nm(e){return e?(e=Dl,e):Dl}function am(e,t,n,a,s,r){s=nm(s),a.context===null?a.context=s:a.pendingContext=s,a=ka(t),a.payload={element:n},r=r===void 0?null:r,r!==null&&(a.callback=r),n=Ta(e,a,t),n!==null&&($t(n,e,t),Hs(n,e,t))}function lm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Zu(e,t){lm(e,t),(e=e.alternate)&&lm(e,t)}function sm(e){if(e.tag===13||e.tag===31){var t=el(e,67108864);t!==null&&$t(t,e,67108864),Zu(e,67108864)}}function im(e){if(e.tag===13||e.tag===31){var t=Wt();t=gs(t);var n=el(e,t);n!==null&&$t(n,e,t),Zu(e,t)}}var Mc=!0;function Sx(e,t,n,a){var s=H.T;H.T=null;var r=ee.p;try{ee.p=2,Vu(e,t,n,a)}finally{ee.p=r,H.T=s}}function wx(e,t,n,a){var s=H.T;H.T=null;var r=ee.p;try{ee.p=8,Vu(e,t,n,a)}finally{ee.p=r,H.T=s}}function Vu(e,t,n,a){if(Mc){var s=Ku(a);if(s===null)Ou(e,t,a,Uc,n),rm(e,a);else if(Tx(s,e,t,n,a))a.stopPropagation();else if(rm(e,a),t&4&&-1<kx.indexOf(e)){for(;s!==null;){var r=Xn(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var d=Rn(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}Hn(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(a),r===null&&Ou(e,t,a,Uc,n),r===s)break;s=r}s!==null&&a.stopPropagation()}else Ou(e,t,a,null,n)}}function Ku(e){return e=le(e),Ju(e)}var Uc=null;function Ju(e){if(Uc=null,e=Yn(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===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 cm(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 vn:return 2;case Cn:return 8;case ln:case ds:return 32;case Qa:return 268435456;default:return 32}default:return 32}}var Iu=!1,La=null,Ha=null,Ba=null,ci=new Map,ri=new Map,qa=[],kx="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 rm(e,t){switch(e){case"focusin":case"focusout":La=null;break;case"dragenter":case"dragleave":Ha=null;break;case"mouseover":case"mouseout":Ba=null;break;case"pointerover":case"pointerout":ci.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ri.delete(t.pointerId)}}function ui(e,t,n,a,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:r,targetContainers:[s]},t!==null&&(t=Xn(t),t!==null&&sm(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Tx(e,t,n,a,s){switch(t){case"focusin":return La=ui(La,e,t,n,a,s),!0;case"dragenter":return Ha=ui(Ha,e,t,n,a,s),!0;case"mouseover":return Ba=ui(Ba,e,t,n,a,s),!0;case"pointerover":var r=s.pointerId;return ci.set(r,ui(ci.get(r)||null,e,t,n,a,s)),!0;case"gotpointercapture":return r=s.pointerId,ri.set(r,ui(ri.get(r)||null,e,t,n,a,s)),!0}return!1}function um(e){var t=Yn(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,xs(e.priority,function(){im(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,xs(e.priority,function(){im(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.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 n=Ku(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Q=a,n.target.dispatchEvent(a),Q=null}else return t=Xn(n),t!==null&&sm(t),e.blockedOn=n,!1;t.shift()}return!0}function om(e,t,n){Lc(e)&&n.delete(t)}function Ex(){Iu=!1,La!==null&&Lc(La)&&(La=null),Ha!==null&&Lc(Ha)&&(Ha=null),Ba!==null&&Lc(Ba)&&(Ba=null),ci.forEach(om),ri.forEach(om)}function Hc(e,t){e.blockedOn===t&&(e.blockedOn=null,Iu||(Iu=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Ex)))}var Bc=null;function fm(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 n=e[t],a=e[t+1],s=e[t+2];if(typeof a!="function"){if(Ju(a||n)===null)continue;break}var r=Xn(n);r!==null&&(e.splice(t,3),t-=3,Kr(r,{pending:!0,data:s,method:n.method,action:a},a,s))}}))}function ls(e){function t(b){return Hc(b,e)}La!==null&&Hc(La,e),Ha!==null&&Hc(Ha,e),Ba!==null&&Hc(Ba,e),ci.forEach(t),ri.forEach(t);for(var n=0;n<qa.length;n++){var a=qa[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<qa.length&&(n=qa[0],n.blockedOn===null);)um(n),n.blockedOn===null&&qa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var s=n[a],r=n[a+1],d=s[it]||null;if(typeof r=="function")d||fm(n);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"?n[a+1]=g:(n.splice(a,3),a-=3),fm(n)}}}function dm(){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),a||setTimeout(n,20)}function n(){if(!a&&!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 a=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!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 n=t.current,a=Wt();am(n,a,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[ha]=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 n=0;n<qa.length&&t!==0&&t<qa[n].priority;n++);qa.splice(n,0,e),n===0&&um(e)}};var hm=c.version;if(hm!=="19.2.8")throw Error(u(527,hm,"19.2.8"));ee.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?T(e):null,e=e===null?null:e.stateNode,e};var _x={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$c.isDisabled&&$c.supportsFiber)try{sn=$c.inject(_x),yt=$c}catch{}}return fi.createRoot=function(e,t){if(!f(e))throw Error(u(299));var n=!1,a="",s=bd,r=jd,d=Nd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=tm(e,1,!1,null,null,n,a,null,s,r,d,dm),e[ha]=t.current,zu(e),new Fu(t)},fi.hydrateRoot=function(e,t,n){if(!f(e))throw Error(u(299));var a=!1,s="",r=bd,d=jd,g=Nd,b=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(b=n.formState)),t=tm(e,1,!0,t,n??null,a,s,b,r,d,g,dm),t.context=nm(null),n=t.current,a=Wt(),a=gs(a),s=ka(a),s.callback=null,Ta(n,s,a),n=a,t.current.lanes=n,zn(t,n),Hn(t),e[ha]=t.current,zu(e),new qc(t)},fi.version="19.2.8",fi}var Sm;function $x(){if(Sm)return eo.exports;Sm=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=qx(),eo.exports}var Gx=$x();const Yx="modulepreload",Xx=function(i){return"/"+i},wm={},Qx=function(c,o,u){let f=Promise.resolve();if(o&&o.length>0){let y=function(x){return Promise.all(x.map(T=>Promise.resolve(T).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=m?.nonce||m?.getAttribute("nonce");f=y(o.map(x=>{if(x=Xx(x),x in wm)return;wm[x]=!0;const T=x.endsWith(".css"),_=T?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${_}`))return;const N=document.createElement("link");if(N.rel=T?"stylesheet":Yx,T||(N.as="script"),N.crossOrigin="",N.href=x,p&&N.setAttribute("nonce",p),document.head.appendChild(N),T)return new Promise((U,j)=>{N.addEventListener("load",U),N.addEventListener("error",()=>j(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 Zx(){const[i,c]=E.useState(()=>window.location.hash.slice(1)||"/");return E.useEffect(()=>{const o=()=>c(window.location.hash.slice(1)||"/");return window.addEventListener("hashchange",o),()=>window.removeEventListener("hashchange",o)},[]),i}let ho="kraftwerk inspector",mo="";function ip(){document.title=mo?`${mo} — ${ho}`:ho}function Vx(i){ho=i,ip()}function km(i){mo=i,ip()}function tn(i,c){c?.replace?window.location.replace(`#${i}`):window.location.hash=i}async function cp(i){const c=await fetch("/api/projects/start",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({root:i})}),o=await c.json();if(!o.ok)throw new Error(o.error||`HTTP ${c.status}`);if(window.dispatchEvent(new Event("kw-meta-refresh")),o.live&&o.url)return o.url;for(let u=0;u<12;u++){await new Promise(f=>setTimeout(f,1e3));try{const h=(await fetch("/api/meta",{cache:"no-store"}).then(m=>m.json())).switcher?.find(m=>m.root===i&&m.live);if(h)return h.url}catch{}}throw new Error("started, but the UI did not answer yet — see ~/.kraftwerk/logs")}function Ee({href:i,...c}){return l.jsx("a",{href:`#${i}`,...c})}const rp="kw-expert";let wo=(()=>{try{return localStorage.getItem(rp)!=="off"}catch{return!0}})();const po=new Set;document.documentElement.dataset.expert=wo?"on":"off";function Kx(i){wo=i,document.documentElement.dataset.expert=i?"on":"off";try{localStorage.setItem(rp,i?"on":"off")}catch{}po.forEach(c=>c())}function qn(){return E.useSyncExternalStore(i=>(po.add(i),()=>po.delete(i)),()=>wo)}async function go(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]=E.useState(null),h=E.useRef(i);return h.current=i,E.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 ko(i){return i==null?"—":`$${i.toFixed(2)}`}function Xc(i){return i?i>=1e3?`${(i/1e3).toFixed(1)}k`:String(i):"0"}function To(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 Eo({since:i}){const[,c]=E.useState(0);return E.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 Jx({status:i}){return l.jsx("span",{className:`status-word ${i}`,children:i})}function _o(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yl=_o();function up(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 Ix=((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}}>`))},Fx=/^(?:[ \t]*(?:\n|$))+/,Wx=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Px=/^ {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+|$)/,ev=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ao=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,op=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fp=we(op).replace(/bull/g,Ao).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(),tv=we(op).replace(/bull/g,Ao).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(),Co=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,nv=/^[^\n]+/,Ro=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,av=we(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ro).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),lv=we(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ao).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",zo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sv=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",zo).replace("tag",Ic).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dp=i=>we(Co).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(),iv=dp(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),cv=dp(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),rv=we(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cv).getRegex(),Oo={blockquote:rv,code:Wx,def:av,fences:Px,heading:ev,hr:ji,html:sv,lheading:fp,list:lv,newline:Fx,paragraph:iv,table:pl,text:nv},Tm=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(),uv={...Oo,lheading:tv,table:Tm,paragraph:we(Co).replace("hr",ji).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Tm).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()},ov={...Oo,html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zo).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(Co).replace("hr",ji).replace("heading",` *#{1,6} *[^
|
|
11
|
+
]`).replace("lheading",fp).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},fv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,dv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,hp=/^( {2,}|\\)\n(?!\s*$)/,hv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ua=/[\p{P}\p{S}]/u,rs=/[\s\p{P}\p{S}]/u,Ni=/[^\s\p{P}\p{S}]/u,mv=we(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,rs).getRegex(),pv=/[\p{Pi}\p{Ps}"']/u,mp=/(?!~)[\p{P}\p{S}]/u,gv=/(?!~)[\s\p{P}\p{S}]/u,xv=/(?:[^\s\p{P}\p{S}]|~)/u,vv=we(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ix?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),pp=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,yv=we(pp,"u").replace(/punct/g,ua).getRegex(),bv=we(pp,"u").replace(/punct/g,mp).getRegex(),jv=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Nv=we(jv,"u").replace(/openQuote/g,pv).replace(/punct/g,ua).getRegex(),gp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Sv=we(gp,"gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,rs).replace(/punct/g,ua).getRegex(),wv=we(gp,"gu").replace(/notPunctSpace/g,xv).replace(/punctSpace/g,gv).replace(/punct/g,mp).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,ua).getRegex(),Ev=we("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,rs).replace(/punct/g,ua).getRegex(),_v="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Av=we(_v,"gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,rs).replace(/punct/g,ua).getRegex(),Cv=we(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ua).getRegex(),Rv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",zv=we(Rv,"gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,rs).replace(/punct/g,ua).getRegex(),Ov=we(/\\(punct)/,"gu").replace(/punct/g,ua).getRegex(),Dv=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(),Mv=we(zo).replace("(?:-->|$)","-->").getRegex(),Uv=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",Mv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Lv=we(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Qc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xp=we(/^!?\[(label)\]\[(ref)\]/).replace("label",Qc).replace("ref",Ro).getRegex(),vp=we(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ro).getRegex(),Hv=we("reflink|nolink(?!\\()","g").replace("reflink",xp).replace("nolink",vp).getRegex(),Em=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Do={_backpedal:pl,anyPunctuation:Ov,autolink:Dv,blockSkip:vv,br:hp,code:dv,del:pl,delLDelim:pl,delRDelim:pl,emStrongLDelim:yv,emStrongRDelimAst:Sv,emStrongRDelimUnd:Ev,escape:fv,link:Lv,nolink:vp,punctuation:mv,reflink:xp,reflinkSearch:Hv,tag:Uv,text:hv,url:pl},Bv={...Do,emStrongLDelim:Nv,emStrongRDelimAst:Tv,emStrongRDelimUnd:Av,link:we(/^!?\[(label)\]\((.*?)\)/).replace("label",Qc).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qc).getRegex()},xo={...Do,emStrongRDelimAst:wv,emStrongLDelim:bv,delLDelim:Cv,delRDelim:zv,url:we(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Em).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",Em).getRegex()},qv={...xo,br:we(hp).replace("{2,}","*").getRegex(),text:we(xo.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Gc={normal:Oo,gfm:uv,pedantic:ov},di={normal:Do,gfm:xo,breaks:qv,pedantic:Bv},$v={"&":"&","<":"<",">":">",'"':""","'":"'"},_m=i=>$v[i];function Bn(i,c){if(c){if(Ot.escapeTest.test(i))return i.replace(Ot.escapeReplace,_m)}else if(Ot.escapeTestNoEncode.test(i))return i.replace(Ot.escapeReplaceNoEncode,_m);return i}function Am(i){try{i=encodeURI(i).replace(Ot.percentDecode,"%")}catch{return null}return i}function Cm(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 Ga(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 Rm(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 Gv(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 Yv(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 zm(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,T=u.state.inRawBlock;u.state.linkEmitted=!1;let _=u.inlineTokens(p),N=u.state.linkEmitted;if(u.state.linkEmitted=x,u.state.inLink=!1,!y){if(N){u.state.inRawBlock=T;return}u.state.linkEmitted=!0}return{type:y?"image":"link",raw:o,href:h,title:m,text:p,tokens:_}}function Xv(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]:Rm(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=Xv(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=Ga(o,"#");(this.options.pedantic||!u||this.rules.other.endingSpaceChar.test(u))&&(o=u.trim())}return{type:"heading",raw:Ga(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:Ga(c[0],`
|
|
17
|
+
`)}}blockquote(i){let c=this.rules.block.blockquote.exec(i);if(c){let o=Ga(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
|
+
`),T=x.replace(this.rules.other.blockquoteSetextReplace,`
|
|
21
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");u=u?`${u}
|
|
22
|
+
${x}`:x,f=f?`${f}
|
|
23
|
+
${T}`:T;let _=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(T,h,!0),this.lexer.state.top=_,o.length===0)break;let N=h.at(-1);if(N?.type==="code")break;if(N?.type==="blockquote"){let U=N,j=o.join(`
|
|
24
|
+
`),K=U.raw+`
|
|
25
|
+
`+j.replace(this.rules.other.blockquoteSetextReplace2,""),$=this.blockquote(K);h[h.length-1]=$,u=`${u}
|
|
26
|
+
${j}`,f=f.substring(0,f.length-U.text.length)+$.text;break}else if(N?.type==="list"){let U=N,j=U.raw+`
|
|
27
|
+
`+o.join(`
|
|
28
|
+
`),K=this.list(j);h[h.length-1]=K,u=u.substring(0,u.length-N.raw.length)+K.raw,f=f.substring(0,f.length-U.raw.length)+K.raw,o=j.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="",T="";if(!(c=h.exec(i))||this.rules.block.hr.test(i))break;x=c[0],i=i.substring(x.length);let _=Yv(c[2].split(`
|
|
30
|
+
`,1)[0],c[1].length),N=i.split(`
|
|
31
|
+
`,1)[0],U=!_.trim(),j=0;if(this.options.pedantic?(j=2,T=_.trimStart()):U?j=c[1].length+1:(j=_.search(this.rules.other.nonSpaceChar),j=j>4?1:j,T=_.slice(j),j+=c[1].length),U&&this.rules.other.blankLine.test(N)&&(x+=N+`
|
|
32
|
+
`,i=i.substring(N.length+1),y=!0),!y){let K=this.rules.other.nextBulletRegex(j),$=this.rules.other.hrRegex(j),w=this.rules.other.fencesBeginRegex(j),P=this.rules.other.headingBeginRegex(j),re=this.rules.other.htmlBeginRegex(j),Z=this.rules.other.blockquoteBeginRegex(j);for(;i;){let J=i.split(`
|
|
33
|
+
`,1)[0],R;if(N=J,this.options.pedantic?(N=N.replace(this.rules.other.listReplaceNesting," "),R=N):R=N.replace(this.rules.other.tabCharGlobal," "),w.test(N)||P.test(N)||re.test(N)||Z.test(N)||K.test(N)||$.test(N))break;if(R.search(this.rules.other.nonSpaceChar)>=j||!N.trim())T+=`
|
|
34
|
+
`+R.slice(j);else{if(U||_.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(_)||P.test(_)||$.test(_))break;T+=`
|
|
35
|
+
`+N}U=!N.trim(),x+=J+`
|
|
36
|
+
`,i=i.substring(J.length+1),_=R.slice(j)}}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(T),loose:!1,text:T,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(_=>_.type==="space"),T=x.length>0&&x.some(_=>this.rules.other.anyLine.test(_.raw));f.loose=T}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 _=this.lexer.inlineQueue.length-1;_>=0;_--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[_].src)){this.lexer.inlineQueue[_].src=this.lexer.inlineQueue[_].src.replace(this.rules.other.listReplaceTask,"");break}let T=this.rules.other.listTaskCheckbox.exec(y.raw);if(T){let _={type:"checkbox",raw:T[0]+" ",checked:T[0]!=="[ ]"};y.checked=_.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=_.raw+y.tokens[0].raw,y.tokens[0].text=_.raw+y.tokens[0].text,y.tokens[0].tokens.unshift(_)):y.tokens.unshift({type:"paragraph",raw:_.raw,text:_.raw,tokens:[_]}):y.tokens.unshift(_)}}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=Rm(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:Ga(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=Cm(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:Ga(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(Cm(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:Ga(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=Ga(o.slice(0,-1),"\\");if((o.length-h.length)%2===0)return}else{let h=Gv(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)),zm(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 zm(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],T=o===x,_=x==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(_.lastIndex=0,c=c.slice(-1*i.length+f);(u=_.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(T)break}if(p-=m,p>0)continue;m=Math.min(m,m+p+y);let N=[...u[0]][0].length,U=i.slice(0,f+u.index+N+m);if(Math.min(f,m)%2){let K=U.slice(1,-1);return{type:"em",raw:U,text:K,tokens:this.lexer.inlineTokens(K)}}let j=U.slice(2,-2);return{type:"strong",raw:U,text:j,tokens:this.lexer.inlineTokens(j)}}}}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,T=i.slice(0,f+u.index+x+m),_=T.slice(f,-f);return{type:"del",raw:T,text:_,tokens:this.lexer.inlineTokens(_)}}}}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}}}},_n=class vo{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 vo(o).lex(c)}static lexInline(c,o){return new vo(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(T=>{x=T.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 T=x.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,x.slice(T+1,-1)))return x;if(T>1&&x.charAt(0)!=="!"){let _=x.slice(1,T-1);if(this.linkInText(_))return"["+_.replace(p,y)+"]["+"a".repeat(x.length-T-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 T=x?x.length:0;return p.slice(0,T)+"["+"a".repeat(p.length-T-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,T=c.slice(1),_;this.options.extensions.startInline.forEach(N=>{_=N.call({lexer:this},T),typeof _=="number"&&_>=0&&(x=Math.min(x,_))}),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-'+Bn(u)+'">'+(o?f:Bn(f,!0))+`</code></pre>
|
|
57
|
+
`:"<pre><code>"+(o?f:Bn(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>${Bn(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=Am(i);if(f===null)return u;i=f;let h='<a href="'+i+'"';return c&&(h+=' title="'+Bn(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=Am(i);if(f===null)return Bn(o);i=f;let h=`<img src="${i}" alt="${Bn(o)}"`;return c&&(h+=` title="${Bn(c)}"`),h+=">",h}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:Bn(i.text)}},Mo=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}},An=class yo{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 Mo}static parse(c,o){return new yo(o).parse(c)}static parseInline(c,o){return new yo(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?_n.lex:_n.lexInline}provideParser(i=this.block){return i?An.parse:An.parseInline}},Qv=class{defaults=_o();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=An;Renderer=Vc;TextRenderer=Mo;Lexer=_n;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 T=p.apply(f,x);return T===!1&&(T=y.apply(f,x)),T||""}}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 T=p.apply(f,x);return T===!1&&(T=y.apply(f,x)),T}}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 _=await p.call(f,x);return y.call(f,_)})();let T=p.call(f,x);return y.call(f,T)}:f[m]=(...x)=>{if(this.defaults.async)return(async()=>{let _=await p.apply(f,x);return _===!1&&(_=await y.apply(f,x)),_})();let T=p.apply(f,x);return T===!1&&(T=y.apply(f,x)),T}}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 _n.lex(i,c??this.defaults)}parser(i,c){return An.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?_n.lex:_n.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?An.parse:An.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?_n.lex:_n.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?An.parse:An.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>"+Bn(o.message+"",!0)+"</pre>";return c?Promise.resolve(u):u}if(c)return Promise.reject(o);throw o}}},xl=new Qv;function ze(i,c){return xl.parse(i,c)}ze.options=ze.setOptions=function(i){return xl.setOptions(i),ze.defaults=xl.defaults,up(ze.defaults),ze};ze.getDefaults=_o;ze.defaults=yl;function Zv(...i){return xl.use(...i),ze.defaults=xl.defaults,up(ze.defaults),ze}ze.use=Zv;ze.walkTokens=function(i,c){return xl.walkTokens(i,c)};ze.parseInline=xl.parseInline;ze.Parser=An;ze.parser=An.parse;ze.Renderer=Vc;ze.TextRenderer=Mo;ze.Lexer=_n;ze.lexer=_n.lex;ze.Tokenizer=Zc;ze.Hooks=gi;ze.parse=ze;ze.options;ze.setOptions;ze.walkTokens;ze.parseInline;An.parse;_n.lex;function Om(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 Vv(i){if(Array.isArray(i))return i}function Kv(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(T){x=!0,f=T}finally{try{if(!y&&o.return!=null&&(m=o.return(),Object(m)!==m))return}finally{if(x)throw f}}return p}}function Jv(){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 Iv(i,c){return Vv(i)||Kv(i,c)||Fv(i,c)||Jv()}function Fv(i,c){if(i){if(typeof i=="string")return Om(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)?Om(i,c):void 0}}const yp=Object.entries,Dm=Object.setPrototypeOf,Wv=Object.isFrozen,Pv=Object.getPrototypeOf,ey=Object.getOwnPropertyDescriptor;let vt=Object.freeze,jt=Object.seal,is=Object.create,bp=typeof Reflect<"u"&&Reflect,bo=bp.apply,jo=bp.construct;vt||(vt=function(c){return c});jt||(jt=function(c){return c});bo||(bo=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)});jo||(jo=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),ty=ht(Array.prototype.lastIndexOf),Mm=ht(Array.prototype.pop),hi=ht(Array.prototype.push),ny=ht(Array.prototype.splice),cs=Array.isArray,xi=ht(String.prototype.toLowerCase),lo=ht(String.prototype.toString),Um=ht(String.prototype.match),mi=ht(String.prototype.replace),Lm=ht(String.prototype.indexOf),ay=ht(String.prototype.trim),ly=ht(Number.prototype.toString),sy=ht(Boolean.prototype.toString),Hm=typeof BigInt>"u"?null:ht(BigInt.prototype.toString),Bm=typeof Symbol>"u"?null:ht(Symbol.prototype.toString),Gt=ht(Object.prototype.hasOwnProperty),pi=ht(Object.prototype.toString),zt=ht(RegExp.prototype.test),hl=iy(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 bo(i,c,u)}}function iy(i){return function(){for(var c=arguments.length,o=new Array(c),u=0;u<c;u++)o[u]=arguments[u];return jo(i,o)}}function De(i,c){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xi;if(Dm&&Dm(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&&(Wv(c)||(c[u]=h),f=h)}i[f]=!0}return i}function cy(i){for(let c=0;c<i.length;c++)Gt(i,c)||(i[c]=null);return i}function en(i){const c=is(null);for(const u of yp(i)){var o=Iv(u,2);const f=o[0],h=o[1];Gt(i,f)&&(cs(h)?c[f]=cy(h):h&&typeof h=="object"&&h.constructor===Object?c[f]=en(h):c[f]=h)}return c}function ry(i){switch(typeof i){case"string":return i;case"number":return ly(i);case"boolean":return sy(i);case"bigint":return Hm?Hm(i):"0";case"symbol":return Bm?Bm(i):"Symbol()";case"undefined":return pi(i);case"function":case"object":{if(i===null)return pi(i);const c=i,o=Tn(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 Tn(i,c){for(;i!==null;){const u=ey(i,c);if(u){if(u.get)return ht(u.get);if(typeof u.value=="function")return ht(u.value)}i=Pv(i)}function o(){return null}return o}function uy(i){try{return zt(i,""),!0}catch{return!1}}const qm=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"]),oy=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"]),fy=vt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$m=vt(["#text"]),Gm=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"]),Ym=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"]),dy=jt(/{{[\w\W]*|^[\w\W]*}}/g),hy=jt(/<%[\w\W]*|^[\w\W]*%>/g),my=jt(/\${[\w\W]*/g),py=jt(/^data-[\-\w.\u00B7-\uFFFF]+$/),gy=jt(/^aria-[\-\w]+$/),Xm=jt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xy=jt(/^(?:\w+script|data):/i),vy=jt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yy=jt(/^html$/i),by=jt(/^[a-z][.\w]*(-[.\w]+)+$/i),Qm=jt(/<[/\w!]/g),Zm=jt(/<[/\w]/g),jy=jt(/<\/no(script|embed|frames)/i),Ny=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},jp=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Sy=vt(De({},jp)),wy=(function(){const i={};return ml(jp,c=>{i[c]=jt(new RegExp("</"+c+"(?=[\\t\\n\\f\\r />])","i"))}),vt(i)})(),ky=function(){return typeof window>"u"?null:window},Ty=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}},Vm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ya=function(c,o,u,f){return Gt(c,o)&&cs(c[o])?De(f.base?en(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"?en(f):u()};function Np(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ky();const c=I=>Np(I);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 T=i.DOMParser,_=i.trustedTypes,N=p.prototype,U=Tn(N,"cloneNode"),j=Tn(N,"remove"),K=Tn(N,"nextSibling"),$=Tn(N,"childNodes"),w=Tn(N,"parentNode"),P=Tn(N,"shadowRoot"),re=Tn(N,"attributes"),Z=m&&m.prototype?Tn(m.prototype,"nodeType"):null,J=m&&m.prototype?Tn(m.prototype,"nodeName"):null,R=m&&m.prototype?Tn(m.prototype,"ownerDocument"):null,M=function(v){return Z?Z(v):v.nodeType},W=function(v){return J?J(v):v.nodeName};if(typeof h=="function"){const I=o.createElement("template");I.content&&I.content.ownerDocument&&(o=I.content.ownerDocument)}let te,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.')},at=function(v){Je(),be++;try{return te.createHTML(v)}finally{be--}},H=function(v){Je(),be++;try{return te.createScriptURL(v)}finally{be--}},ee=function(){return ae||(ge=Ty(_,f),ae=!0),ge},ue=o,Ce=ue.implementation,je=ue.createNodeIterator,k=ue.createDocumentFragment,Y=ue.getElementsByTagName,ne=u.importNode;let F=Vm();c.isSupported=typeof yp=="function"&&typeof w=="function"&&Ce&&Ce.createHTMLDocument!==void 0;const he=dy,pe=hy,_e=my,mt=py,G=gy,Re=xy,Ge=vy,We=by;let nn=Xm,Oe=null;const Xa=De({},[...qm,...so,...io,...co,...$m]);let Ye=null;const os=De({},[...Gm,...ro,...Ym,...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}})),$n=null,bl=null;const an=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,vn=!1,Cn=!0,ln=!1,ds=!1,Qa=null,jl=null,hs=!1,sn=!1,yt=!1,Xt=!1,Ct=!0,ki=!1;const Ti="user-content-";let ms=!0,oa=!1,yn={},bn=null;const Rn=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 Za=null;const fa=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"]),da="http://www.w3.org/1998/Math/MathML",zn="http://www.w3.org/2000/svg",cn="http://www.w3.org/1999/xhtml";let Gn=cn,Nl=!1,Sl=null;const gs=De({},[da,zn,cn],lo),wl=vt(["mi","mo","mn","ms","mtext"]);let kl=De({},wl);const xs=vt(["annotation-xml"]);let rn=De({},xs);const pt=De({},["title","style","font","a","script"]);let it=null;const ha=["application/xhtml+xml","text/html"],vs="text/html";let et=null,ma=null;const _i=o.createElement("form"),pa=function(v){return v instanceof RegExp||v instanceof Function},Va=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ma&&ma===v)return;(!v||typeof v!="object")&&(v={}),v=en(v),it=ha.indexOf(v.PARSER_MEDIA_TYPE)===-1?vs:v.PARSER_MEDIA_TYPE,et=it==="application/xhtml+xml"?lo:xi,Oe=Ya(v,"ALLOWED_TAGS",Xa,{transform:et}),Ye=Ya(v,"ALLOWED_ATTR",os,{transform:et}),Sl=Ya(v,"ALLOWED_NAMESPACES",gs,{transform:lo}),Ei=Ya(v,"ADD_URI_SAFE_ATTR",ps,{transform:et,base:ps}),Za=Ya(v,"ADD_DATA_URI_TAGS",fa,{transform:et,base:fa}),bn=Ya(v,"FORBID_CONTENTS",Rn,{transform:et}),$n=Ya(v,"FORBID_TAGS",en({}),{transform:et}),bl=Ya(v,"FORBID_ATTR",en({}),{transform:et}),yn=Gt(v,"USE_PROFILES")?v.USE_PROFILES&&typeof v.USE_PROFILES=="object"?en(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,vn=v.SAFE_FOR_TEMPLATES||!1,Cn=v.SAFE_FOR_XML!==!1,ln=v.WHOLE_DOCUMENT||!1,sn=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,oa=v.IN_PLACE||!1,nn=uy(v.ALLOWED_URI_REGEXP)?v.ALLOWED_URI_REGEXP:Xm,Gn=typeof v.NAMESPACE=="string"?v.NAMESPACE:cn,kl=uo(v,"MATHML_TEXT_INTEGRATION_POINTS",()=>De({},wl)),rn=uo(v,"HTML_INTEGRATION_POINTS",()=>De({},xs));const A=uo(v,"CUSTOM_ELEMENT_HANDLING",()=>is(null));if(Yt=is(null),Gt(A,"tagNameCheck")&&pa(A.tagNameCheck)&&(Yt.tagNameCheck=A.tagNameCheck),Gt(A,"attributeNameCheck")&&pa(A.attributeNameCheck)&&(Yt.attributeNameCheck=A.attributeNameCheck),Gt(A,"allowCustomizedBuiltInElements")&&typeof A.allowCustomizedBuiltInElements=="boolean"&&(Yt.allowCustomizedBuiltInElements=A.allowCustomizedBuiltInElements),jt(Yt),vn&&(fs=!1),yt&&(sn=!0),yn&&(Oe=De({},$m),Ye=is(null),yn.html===!0&&(De(Oe,qm),De(Ye,Gm)),yn.svg===!0&&(De(Oe,so),De(Ye,ro),De(Ye,Yc)),yn.svgFilters===!0&&(De(Oe,io),De(Ye,ro),De(Ye,Yc)),yn.mathMl===!0&&(De(Oe,co),De(Ye,Ym),De(Ye,Yc))),an.tagCheck=null,an.attributeCheck=null,Gt(v,"ADD_TAGS")&&(typeof v.ADD_TAGS=="function"?an.tagCheck=v.ADD_TAGS:cs(v.ADD_TAGS)&&(Oe===Xa&&(Oe=en(Oe)),De(Oe,v.ADD_TAGS,et))),Gt(v,"ADD_ATTR")&&(typeof v.ADD_ATTR=="function"?an.attributeCheck=v.ADD_ATTR:cs(v.ADD_ATTR)&&(Ye===os&&(Ye=en(Ye)),De(Ye,v.ADD_ATTR,et))),Gt(v,"ADD_FORBID_CONTENTS")&&cs(v.ADD_FORBID_CONTENTS)&&(bn===Rn&&(bn=en(bn)),De(bn,v.ADD_FORBID_CONTENTS,et)),ms&&(Oe["#text"]=!0),ln&&De(Oe,["html","head","body"]),Oe.table&&(De(Oe,["tbody"]),delete $n.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=te;te=v.TRUSTED_TYPES_POLICY;try{ve=at("")}catch(le){throw te=Q,le}}else v.TRUSTED_TYPES_POLICY===null?(te=void 0,ve=""):(te===void 0&&(te=ee()),te&&typeof ve=="string"&&(ve=at("")));vt&&vt(v),ma=v},Yn=De({},[...so,...io,...oy]),Xn=De({},[...co,...fy]),Ka=function(v,A,Q){return A.namespaceURI===cn?v==="svg":A.namespaceURI===da?v==="svg"&&(Q==="annotation-xml"||kl[Q]):!!Yn[v]},ga=function(v,A,Q){return A.namespaceURI===cn?v==="math":A.namespaceURI===zn?v==="math"&&rn[Q]:!!Xn[v]},ct=function(v,A,Q){return A.namespaceURI===zn&&!rn[Q]||A.namespaceURI===da&&!kl[Q]?!1:!Xn[v]&&(pt[v]||!Yn[v])},Ai=function(v){let A=w(v);(!A||!A.tagName)&&(A={namespaceURI:Gn,tagName:"template"});const Q=xi(v.tagName),le=xi(A.tagName);return Sl[v.namespaceURI]?v.namespaceURI===zn?Ka(Q,A,le):v.namespaceURI===da?ga(Q,A,le):v.namespaceURI===cn?ct(Q,A,le):!!(it==="application/xhtml+xml"&&Sl[v.namespaceURI]):!1},jn=function(v){hi(c.removed,{element:v});try{w(v).removeChild(v)}catch{if(j(v),!w(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")}},On=function(v,A,Q){try{v.removeAttributeNode(A)}catch{try{v.removeAttribute(Q)}catch{}}},Nn=function(v){Ja(v);const A=$(v);if(A){const le=[];ml(A,se=>{hi(le,se)}),ml(le,se=>{try{j(se)}catch{}})}const Q=re(v);if(Q)for(let le=Q.length-1;le>=0;--le){const se=Q[le],fe=se&&se.name;typeof fe=="string"&&On(v,se,fe)}},Qn=function(v,A,Q){if(!Q)try{Q=A.getAttributeNode(v)}catch{Q=null}hi(c.removed,{attribute:Q||null,from:A});try{Q?A.removeAttributeNode(Q):A.removeAttribute(v)}catch{try{A.removeAttribute(v)}catch{}}if(v==="is")if(sn||yt)try{jn(A)}catch{}else try{A.setAttribute(v,"")}catch{}},Ci=function(v){const A=re(v);if(A)for(let Q=A.length-1;Q>=0;--Q){const le=A[Q],se=le&&le.name;typeof se!="string"||Ye[et(se)]||On(v,le,se)}},Ja=function(v){const A=[v];for(;A.length>0;){const Q=A.pop();M(Q)===Pt.element&&Ci(Q);const se=$(Q);if(se)for(let fe=se.length-1;fe>=0;--fe)A.push(se[fe])}},Ri=function(v,A){return Cn?v==="patchsrc"?!0:v==="for"&&A!=="label"&&A!=="output":!1},Tl=function(v){if(!Cn)return;const A=[v];for(;A.length>0;){const Q=A.pop(),le=M(Q);if(le===Pt.processingInstruction||le===Pt.comment&&zt(Zm,Q.data)){try{j(Q)}catch{}continue}if(le===Pt.element){const fe=Q,Be=et(W(Q));try{fe.hasAttribute&&fe.hasAttribute("patchsrc")&&fe.removeAttribute("patchsrc"),fe.hasAttribute&&fe.hasAttribute("for")&&Ri("for",Be)&&fe.removeAttribute("for")}catch{}}const se=$(Q);if(se)for(let fe=se.length-1;fe>=0;--fe)A.push(se[fe])}},Ia=function(v){let A=null,Q=null;if(hs)v="<remove></remove>"+v;else{const fe=Um(v,/^[\r\n\t ]+/);Q=fe&&fe[0]}it==="application/xhtml+xml"&&Gn===cn&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");const le=te?at(v):v;if(Gn===cn)try{A=new T().parseFromString(le,it)}catch{}if(!A||!A.documentElement){A=Ce.createDocument(Gn,"template",null);try{A.documentElement.innerHTML=Nl?ve:le}catch{}}const se=A.body||A.documentElement;return v&&Q&&se.insertBefore(o.createTextNode(Q),se.childNodes[0]||null),Gn===cn?Y.call(A,ln?"html":"body")[0]:ln?A.documentElement:se},un=function(v){const A=R?R(v):v.ownerDocument;return je.call(A||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 A;v.normalize();const Q=R?R(v):v.ownerDocument,le=je.call(Q||v,v,y.SHOW_TEXT|y.SHOW_COMMENT|y.SHOW_CDATA_SECTION|y.SHOW_PROCESSING_INSTRUCTION,null);let se=le.nextNode();for(;se;)se.data=Nt(se.data),se=le.nextNode();const fe=(A=v.querySelectorAll)===null||A===void 0?void 0:A.call(v,"template");fe&&ml(fe,Be=>{Dn(Be.content)&&El(Be.content)})},_l=function(v){const A=J?J(v):null;return typeof A!="string"||et(A)!=="form"?!1:typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||v.attributes!==re(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!==$(v)},Dn=function(v){if(!Z||typeof v!="object"||v===null)return!1;try{return Z(v)===Pt.documentFragment}catch{return!1}},xa=function(v){if(!Z||typeof v!="object"||v===null)return!1;try{return typeof Z(v)=="number"}catch{return!1}};function Dt(I,v,A){I.length!==0&&ml(I,Q=>{Q.call(c,v,A,ma)})}const Fc=function(v,A){return!!(Cn&&v.hasChildNodes()&&!xa(v.firstElementChild)&&zt(Qm,v.textContent)&&zt(Qm,v.innerHTML)||Cn&&v.namespaceURI===cn&&Sy[A]&&(xa(v.firstElementChild)||typeof v.textContent=="string"&&zt(wy[A],v.textContent))||v.nodeType===Pt.processingInstruction||Cn&&v.nodeType===Pt.comment&&zt(Zm,v.data))},St=function(v,A){if(v instanceof RegExp)return zt(v,A);if(v instanceof Function){for(var Q=arguments.length,le=new Array(Q>2?Q-2:0),se=2;se<Q;se++)le[se-2]=arguments[se];return!!v(A,...le)}return!1},ys=function(v,A,Q){if(!$n[A]&&Vn(A)&&St(Yt.tagNameCheck,A))return!1;if(ms&&!bn[A]){const le=w(v),se=$(v);if(se&&le){const fe=se.length;for(let Be=fe-1;Be>=0;--Be){const Ve=v===Q?U(se[Be],!0):se[Be];le.insertBefore(Ve,K(v))}}}return jn(v),!0},bs=function(v,A,Q,le){return v.length===0?A:A===Q||A===le?en(A):A},Al=function(v,A){return v===A||w(v)!==null?!1:(oa&&Ja(v),!0)},Zn=function(v,A){if(Dt(F.beforeSanitizeElements,v,null),Al(v,A))return!0;if(_l(v))return jn(v),!0;const Q=et(W(v));if(Oe=bs(F.uponSanitizeElement,Oe,Xa,Qa),Dt(F.uponSanitizeElement,v,{tagName:Q,allowedTags:Oe}),Al(v,A))return!0;if(Fc(v,Q))return jn(v),!0;if($n[Q]||!(an.tagCheck instanceof Function&&an.tagCheck(Q))&&!Oe[Q]){const se=ys(v,Q,A);return se===!1&&Dt(F.afterSanitizeElements,v,null),se}if(M(v)===Pt.element&&!Ai(v)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&zt(jy,v.innerHTML))return jn(v),!0;if(vn&&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,A,Q){if(bl[A]||Ri(A,v)||Ct&&(A==="id"||A==="name")&&(Q in o||Q in _i))return!1;const le=Ye[A]||an.attributeCheck instanceof Function&&an.attributeCheck(A,v);return fs&&zt(mt,A)||Si&&zt(G,A)?!0:le?Ei[A]||zt(nn,mi(Q,Ge,""))||(A==="src"||A==="xlink:href"||A==="href")&&v!=="script"&&Lm(Q,"data:")===0&&Za[v]||At&&!zt(Re,mi(Q,Ge,""))?!0:!Q:Vn(v)&&St(Yt.tagNameCheck,v)&&St(Yt.attributeNameCheck,A,v)||A==="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"]),Vn=function(v){return!zi[xi(v)]&&zt(We,v)},Wc=function(v,A,Q,le){if(te&&typeof _=="object"&&typeof _.getAttributeType=="function"&&!Q)switch(_.getAttributeType(v,A)){case"TrustedHTML":return at(le);case"TrustedScriptURL":return H(le)}return le},Oi=function(v,A,Q,le){try{Q?v.setAttributeNS(Q,A,le):v.setAttribute(A,le),_l(v)?jn(v):Mm(c.removed)}catch{Qn(A,v)}},Ns=function(v){Dt(F.beforeSanitizeAttributes,v,null);const A=v.attributes;if(!A||_l(v))return;Ye=bs(F.uponSanitizeAttribute,Ye,os,jl);const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ye,forceKeepAttr:void 0};let le=A.length;const se=et(v.nodeName);for(;le--;){const fe=A[le],Be=fe.name,Ve=fe.namespaceURI,wt=fe.value,rt=et(Be),Qt=wt;let gt=Be==="value"?Qt:ay(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")&&Lm(gt,Ti)!==0&&(Qn(Be,v,fe),gt=Ti+gt),Cn&&zt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,gt)){Qn(Be,v,fe);continue}if(rt==="attributename"&&Um(gt,"href")){Qn(Be,v,fe);continue}if(!Q.forceKeepAttr){if(!Q.keepAttr){Qn(Be,v,fe);continue}if(!wi&&zt(Ny,gt)){Qn(Be,v,fe);continue}if(vn&&(gt=Nt(gt)),!js(se,rt,gt)){Qn(Be,v,fe);continue}gt=Wc(se,rt,Ve,gt),gt!==Qt&&Oi(v,Be,Ve,gt)}}Dt(F.afterSanitizeAttributes,v,null)},va=function(v){let A=null;const Q=un(v);for(Dt(F.beforeSanitizeShadowDOM,v,null);A=Q.nextNode();)if(Dt(F.uponSanitizeShadowNode,A,null),Zn(A,v),Ns(A),Dn(A.content)&&va(A.content),M(A)===Pt.element){const le=P(A);Dn(le)&&(Ss(le),va(le))}Dt(F.afterSanitizeShadowDOM,v,null)},Ss=function(v){const A=[{node:v,shadow:null}];for(;A.length>0;){const Q=A.pop();if(Q.shadow){va(Q.shadow);continue}const le=Q.node,fe=M(le)===Pt.element,Be=$(le);if(Be)for(let Ve=Be.length-1;Ve>=0;--Ve)A.push({node:Be[Ve],shadow:null});if(fe){const Ve=J?J(le):null;if(typeof Ve=="string"&&et(Ve)==="template"){const wt=le.content;Dn(wt)&&A.push({node:wt,shadow:null})}}if(fe){const Ve=P(le);Dn(Ve)&&A.push({node:null,shadow:Ve},{node:Ve,shadow:null})}}};return c.sanitize=function(I){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,Q=null,le=null,se=null;if(Nl=!I,Nl&&(I="<!-->"),typeof I!="string"&&!xa(I)&&(I=ry(I),typeof I!="string"))throw hl("dirty is not a string, aborting");if(!c.isSupported)return I;ds?(Oe=Qa,Ye=jl):Va(v),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(Oe=en(Oe)),F.uponSanitizeAttribute.length>0&&(Ye=en(Ye)),c.removed=[];const fe=oa&&typeof I!="string"&&xa(I);if(fe){Tl(I);const wt=W(I);if(typeof wt=="string"){const rt=et(wt);if(!Oe[rt]||$n[rt])throw Nn(I),hl("root node is forbidden and cannot be sanitized in-place")}if(_l(I))throw Nn(I),hl("root node is clobbered and cannot be sanitized in-place");try{Ss(I)}catch(rt){throw Nn(I),rt}}else if(xa(I))A=Ia("<!---->"),Q=A.ownerDocument.importNode(I,!0),Q.nodeType===Pt.element&&Q.nodeName==="BODY"||Q.nodeName==="HTML"?A=Q:A.appendChild(Q),Ss(Q);else{if(!sn&&!vn&&!ln&&I.indexOf("<")===-1)return te&&Xt?at(I):I;if(A=Ia(I),!A)return sn?null:Xt?ve:""}A&&hs&&jn(A.firstChild);const Be=fe?I:A;try{const wt=un(Be);for(;le=wt.nextNode();)Zn(le,Be),Ns(le),Dn(le.content)&&va(le.content)}catch(wt){throw fe&&(Nn(I),ml(c.removed,rt=>{rt.element&&Ja(rt.element)})),wt}if(fe)return ml(c.removed,wt=>{wt.element&&Ja(wt.element)}),vn&&El(I),I;if(sn){if(vn&&El(A),yt)for(se=k.call(A.ownerDocument);A.firstChild;)se.appendChild(A.firstChild);else se=A;return(Ye.shadowroot||Ye.shadowrootmode)&&(se=ne.call(u,se,!0)),se}let Ve=ln?A.outerHTML:A.innerHTML;return ln&&Oe["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&zt(yy,A.ownerDocument.doctype.name)&&(Ve="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
|
|
76
|
+
`+Ve),vn&&(Ve=Nt(Ve)),te&&Xt?at(Ve):Ve},c.setConfig=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Va(I),ds=!0,Qa=Oe,jl=Ye},c.clearConfig=function(){ma=null,ds=!1,Qa=null,jl=null,te=ge,ve=""},c.isValidAttribute=function(I,v,A){ma||Va({});const Q=et(I),le=et(v);return js(Q,le,A)},c.addHook=function(I,v){typeof v=="function"&&Gt(F,I)&&hi(F[I],v)},c.removeHook=function(I,v){if(Gt(F,I)){if(v!==void 0){const A=ty(F[I],v);return A===-1?void 0:ny(F[I],A,1)[0]}return Mm(F[I])}},c.removeHooks=function(I){Gt(F,I)&&(F[I]=[])},c.removeAllHooks=function(){F=Vm()},c}var vl=Np();const Ey=[{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&&tn(u.scope?.kind==="agent"?`/agents/${encodeURIComponent(u.scope.slug)}/chat/${u.id}`:`/agents/chats/${u.id}`)}function _y(){const[i,c]=E.useState("claude"),[o,u]=E.useState(!0),[f,h]=E.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:Ey.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 Km({id:i,agentName:c,agentDescription:o}){const[u,f]=E.useState(null),[h,m]=E.useState([]),[p,y]=E.useState(!1);E.useEffect(()=>{let _=!0,N=null;return fetch(`/api/chats/${i}`).then(U=>U.ok?U.json():Promise.reject()).then(U=>{if(!_)return;f(U.meta),m(U.events);const j=U.events[U.events.length-1]?.seq??0;N=new EventSource(`/api/chats/${i}/events?after=${j}`),N.onmessage=K=>{const $=JSON.parse(K.data);m(w=>w.some(P=>P.seq===$.seq)?w:[...w,$])}}).catch(()=>_&&y(!0)),()=>{_=!1,N?.close()}},[i]);const x=E.useMemo(()=>{for(let _=h.length-1;_>=0;_--){const N=h[_].type;if(N==="user_message")return!0;if(N==="turn_end"||N==="error")return!1}return!1},[h]),T=E.useMemo(()=>{if(u?.title)return u.title;const _=h.find(N=>N.type==="user_message");return _&&_.type==="user_message"?_.text.replace(/\s+/g," ").trim().slice(0,80):""},[u,h]);return E.useEffect(()=>{if(!u)return;const _=c??(u.scope.kind==="agent"?u.scope.slug:u.agent);return km([_,o,T||"new chat"].filter(Boolean).join(" · ")),()=>km("")},[u,T,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:T||"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==="agent"&&l.jsxs(Ee,{href:`/agents/${encodeURIComponent(u.scope.slug)}/info`,className:"chip",children:["agent:",u.scope.slug]}),l.jsx("span",{className:"rid",title:u.cwd,children:u.cwd})]}),l.jsx(Cy,{id:i,events:h,busy:x}),l.jsx(Dy,{id:i,busy:x,scope:u.scope})]}):l.jsx("div",{className:"empty",children:"loading…"})}function Ay(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 Cy({id:i,events:c,busy:o}){const u=qn(),f=E.useMemo(()=>{const p=Ay(c);return u?p:p.filter(y=>y.kind!=="tool"&&y.kind!=="thought")},[c,u]),h=E.useRef(null),m=E.useRef(!0);return E.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(zy,{b:p,chatId:i},p.key)),o&&l.jsxs("div",{className:"chat-working",children:[l.jsx("span",{className:"lamp running"})," working…"]})]})}function Ry({text:i}){const c=E.useMemo(()=>vl.sanitize(ze.parse(i,{async:!1})),[i]);return l.jsx("div",{className:"msg agent md-body chat-md",dangerouslySetInnerHTML:{__html:c}})}function zy({b:i,chatId:c}){switch(i.kind){case"user":return l.jsx("div",{className:"msg user",children:i.text});case"agent":return l.jsx(Ry,{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(Oy,{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 Oy({b:i,chatId:c}){const[o,u]=E.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 Dy({id:i,busy:c,scope:o}){const[u,f]=E.useState(""),[h,m]=E.useState([]),[p,y]=E.useState(0),[x,T]=E.useState(!1);E.useEffect(()=>{let w=!0;return(async()=>{try{let re=(await fetch("/api/skills").then(Z=>Z.json())).skills??[];if(o?.kind==="agent"){const[Z,J]=await Promise.all([fetch(`/api/agents/${encodeURIComponent(o.slug)}`).then(W=>W.ok?W.json():null).catch(()=>null),fetch(`/api/agents/${encodeURIComponent(o.slug)}/skills`).then(W=>W.ok?W.json():null).catch(()=>null)]);if(Z&&Array.isArray(Z.skills)){const W=new Set(Z.skills.map(te=>te.toLowerCase()));re=re.filter(te=>W.has(te.name.toLowerCase()))}const R=J?.skills??[],M=new Set(R.map(W=>W.name.toLowerCase()));re=[...R,...re.filter(W=>!M.has(W.name.toLowerCase()))]}w&&m(re)}catch{}})(),()=>{w=!1}},[i]);const _=/^\/([\w-]*)$/.exec(u)?.[1],N=_!==void 0&&!x?h.filter(w=>w.name.toLowerCase().startsWith(_.toLowerCase())):[],U=N.length>0,j=Math.min(p,N.length-1);function K(w){f(`/${w.name} `),y(0)}async function $(){const w=u.trim();!w||c||(f(""),await fetch(`/api/chats/${i}/message`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:w})}).catch(()=>{}))}return l.jsxs("div",{className:"composer",children:[U&&l.jsx("div",{className:"skill-menu",children:N.map((w,P)=>l.jsxs("button",{className:P===j?"active":"",onMouseDown:re=>{re.preventDefault(),K(w)},children:[l.jsxs("b",{children:["/",w.name]}),w.description&&l.jsxs("span",{children:[" — ",w.description]}),l.jsx("span",{className:"skill-src",children:w.source})]},w.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:w=>{f(w.target.value),y(0),T(!1)},onKeyDown:w=>{if(U){if(w.key==="ArrowDown")return w.preventDefault(),y((j+1)%N.length);if(w.key==="ArrowUp")return w.preventDefault(),y((j-1+N.length)%N.length);if(w.key==="Tab"||w.key==="Enter")return w.preventDefault(),K(N[j]);if(w.key==="Escape")return w.preventDefault(),T(!0)}w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),$())}}),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:$,children:[l.jsx(V,{name:"send",className:"ms-sm"})," send"]})]})}function My({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(Uy,{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(Ly,{id:i},i)})]})}function Uy({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(Eo,{since:i.startedAt}):bi(i.durationMs)})]})]})]})}function Ly({id:i}){const c=He(`/api/runs/${i}`,!0),o=c?.status==="running",[u,f]=E.useState(null),[h,m]=E.useState(!1),p=qn();if(!c)return l.jsx("div",{className:"empty",children:"loading…"});const y=c.files.some(N=>N.name==="runner.json"),x=u??(o?"run":"artifacts"),T=p?c.files.length:c.files.filter(N=>!Kc(N.name)).length;async function _(){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(Jx,{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:_,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:["(",T,")"]})]})]})]}),c.request&&l.jsx("p",{className:"detail-req",children:c.request}),x==="run"?l.jsx(Hy,{run:c,live:o}):l.jsx(Gy,{id:i,files:c.files,live:o})]})}function Hy({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(Eo,{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:ko(i.costUsd??By(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(Jm(i.phases,"tokensIn"))," / ",Xc(Jm(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(qy,{p:o},o.phase))})]})]})}function Jm(i,c){return i.reduce((o,u)=>o+(u[c]??0),0)}function By(i){return i.reduce((c,o)=>c+(o.costUsd??0),0)}function qy({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(Eo,{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:ko(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 Sp=new Set(["png","jpg","jpeg","gif","webp","svg"]);function Kc(i){return i==="runner.json"||i.endsWith(".jsonl")||i.endsWith(".log")}function $y(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)||Sp.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 Gy({id:i,files:c,live:o}){const[u,f]=E.useState(null),h=qn(),m=E.useMemo(()=>h?c:c.filter(p=>!Kc(p.name)),[c,h]);return E.useEffect(()=>{!h&&u&&Kc(u)&&f(null)},[h,u]),E.useEffect(()=>{u||m.length===0||f($y(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:To(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(Yy,{id:i,name:u,live:o}):l.jsx("div",{className:"empty",children:"select a file"})]})]})}function Yy({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})})}):Sp.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(Xy,{id:i,name:c,live:o}):l.jsx(Qy,{id:i,name:c,live:o})}function Xy({id:i,name:c,live:o}){const[u,f]=E.useState("rendered"),h=He(`/api/runs/${i}/file?name=${encodeURIComponent(c)}`,o),m=E.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 ",To(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 Qy({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 ",To(4e5)]}),l.jsx("div",{className:"viewer-body",children:l.jsx("pre",{children:u?u.content||"(empty)":"loading…"})})]})}function Zy(){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 Vy({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(Im,{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(Im,{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(Ky,{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(Jy,{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(Iy,{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)," · ",ko(h.costUsd)," · ",gl(h.startedAt)]})]},h.id)),f.length===0&&l.jsx("div",{className:"viewer-note",children:"no runs of this workflow yet"})]})]})]})]})]})}function Ky({slug:i,lastRequest:c}){const[o,u]=E.useState(""),[f,h]=E.useState(!0),[m,p]=E.useState(!1),[y,x]=E.useState(!1),[T,_]=E.useState(null),N=He(`/api/workflows/${encodeURIComponent(i)}/run`,!1);E.useEffect(()=>{!o&&c&&u(c)},[c]);const U=N?.available&&N?.image,j=N?N.available?N.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),_(null);try{const $=await fetch(`/api/workflows/${encodeURIComponent(i)}/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({request:o.trim(),sandbox:f,ssh:m})}),w=await $.json();if(!$.ok)throw new Error(w.error??`HTTP ${$.status}`);tn(`/runs/${w.runId}`)}catch($){_($.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:$=>u($.target.value),onKeyDown:$=>$.key==="Enter"&&K()}),l.jsx("button",{className:"run-btn",onClick:K,disabled:y||!o.trim()||f&&!U,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:$=>h($.target.checked)}),"docker sandbox ",j&&l.jsxs("span",{className:"opt-hint",children:["— ",j]})]}),l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:m,onChange:$=>p($.target.checked),disabled:!f}),"forward SSH agent"]})]}),T&&l.jsx("div",{className:"gate-fail-msg",children:T})]})}function Im({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 Jy({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 Iy({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 Fy=i=>i==="ok"?"ok":i==="running"?"running":i==="aborted"?"aborted":"failed",Wy=i=>i==="ok"?"done":i==="running"?"working":i==="aborted"?"stopped":"failed";function Py(i){return i.scope.kind==="agent"?`/agents/${i.scope.slug}/chat/${i.id}`:`/agents/chats/${i.id}`}function Fm(i){switch(i.scope.kind){case"agent":return i.scope.slug;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 Wm(i){return i.length>64?`${i.slice(0,46)}…${i.slice(-14)}`:i}function eb(){const i=He("/api/runs",!1),c=He("/api/chats",!1),o=He("/api/knowledge",!1),u=He("/api/agents",!1),f=He("/api/workflows",!1),h=He("/api/skills",!1),m=He("/api/meta",!1),[p,y]=E.useState("all"),x=i?.runs??[],T=c?.chats??[],_=o?.bundles??[],N=(h?.skills??[]).filter(K=>K.source==="workspace"),U=[[f?.workflows.length,"workflows","/workflows"],[i?x.length:void 0,"runs","/runs"],[o?_.length:void 0,"bundles","/knowledge"],[h?N.length:void 0,"skills","/skills"],[c?T.length:void 0,"chats","/agents/chats"]],j=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:U.map(([K,$,w])=>l.jsxs(Ee,{href:w,children:[l.jsx("b",{className:"num",children:K??"…"})," ",$]},$))}),l.jsx(tb,{workflows:f?.workflows??[]})]}),l.jsx(nb,{agents:u?.agents.filter(K=>!K.archived),chats:T}),j.length>0&&p!=="failed"&&l.jsxs("button",{className:"dash-alert",onClick:()=>y("failed"),children:["⚠ ",j.length," run",j.length===1?"":"s"," failed in the last 24 h — review"]}),l.jsx(sb,{runs:x,chats:T,bundles:_,agents:u?.agents??[],workflows:f?.workflows??[],filter:p,setFilter:y})]})}function tb({workflows:i}){const[c,o]=E.useState(!1);return E.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:()=>tn("/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 nb({agents:i,chats:c}){const o=qn();return i&&i.length===0?l.jsx("section",{className:"panel dash-agents-empty",children:l.jsx("div",{className:"viewer-note",children:o?l.jsxs(l.Fragment,{children:["No agents 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 agents yet — ask an expert-mode user to create one."})})}):l.jsx("div",{className:"dash-agents",children:(i??[]).map(u=>{const h=c.filter(p=>p.scope.kind==="agent"&&p.scope.slug===u.slug).find(p=>p.busy),m=()=>tn(`/agents/${encodeURIComponent(u.slug)}`);return l.jsxs("div",{className:"dash-agent",role:"link",tabIndex:0,onClick:m,onKeyDown:p=>{p.key==="Enter"&&m()},children:[l.jsxs("div",{className:"dash-agent-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-agent-name",children:u.name}),u.description&&l.jsx("span",{className:"dash-agent-desc",children:u.description})]}),l.jsxs("div",{className:"dash-agent-foot",children:[l.jsx("span",{className:"dash-agent-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:"agent",slug:u.slug})},children:[l.jsx(V,{name:"chat_bubble",className:"ms-sm"})," chat"]})]})]},u.slug)})})}function ab(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 lb=[["all","all"],["run","runs"],["session","chats"],["knowledge","knowledge"]];function sb({runs:i,chats:c,bundles:o,agents:u,workflows:f,filter:h,setFilter:m}){const p=qn(),y=E.useMemo(()=>{const T=[],_=U=>U?f.find(j=>j.slug===U)?.name??U:void 0;for(const U of i)T.push({at:U.updatedAt,kind:"run",emoji:"⚙️",title:_(U.workflow)??U.id,sub:U.request??"",href:`/runs/${U.id}`,lamp:Fy(U.status),status:Wy(U.status)});for(const U of c){const j=U.scope.kind==="agent"?u.find(K=>U.scope.kind==="agent"&&K.slug===U.scope.slug):void 0;T.push({at:U.updatedAt,kind:"session",emoji:j?j.emoji||"🤖":"💬",title:j?j.name:U.title||"new chat",sub:j?`${U.title||"new chat"}${p?` · ${U.agent}`:""}`:p?`${U.agent} · ${Fm(U)}`:Fm(U),href:Py(U),lamp:U.busy?"running":"ok",status:U.busy?"working":void 0})}for(const U of o)U.updatedAt&&T.push({at:U.updatedAt,kind:"knowledge",emoji:"📚",title:U.name,sub:`${U.concepts} concepts`,href:`/knowledge/${encodeURIComponent(U.name)}`,lamp:"ok"});return(h==="all"?T:h==="failed"?T.filter(U=>U.kind==="run"&&U.lamp==="failed"):T.filter(U=>U.kind===h)).sort((U,j)=>{const K=+(j.lamp==="running")-+(U.lamp==="running");return K!==0?K:j.at.localeCompare(U.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:[lb.map(([T,_])=>l.jsx("button",{className:`feed-chip ${h===T?"on":""}`,onClick:()=>m(T),children:_},T)),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(T=>{const _=ab(T),N=_!==x?_:null;return x=_,l.jsxs("div",{className:"feed-group",children:[N&&l.jsx("div",{className:"feed-day microlabel",children:N}),l.jsxs(Ee,{href:T.href,className:"m3-row m3-link",children:[l.jsxs("span",{className:"agent-avatar",children:[l.jsx("span",{"aria-hidden":!0,children:T.emoji}),T.lamp==="running"&&l.jsx("span",{className:"lamp running"})]}),l.jsx("span",{className:`chip dash-kind ${T.kind}`,children:T.kind==="session"?"chat":T.kind}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:Wm(T.title)}),T.sub&&l.jsx("span",{className:"m3-sub",children:Wm(T.sub)})]}),T.status&&l.jsx("span",{className:`chip status ${T.lamp}`,children:T.status}),l.jsx("span",{className:"side-when num",title:new Date(T.at).toLocaleString(),children:yi(T.at)}),l.jsx("span",{className:"m3-chev",children:l.jsx(V,{name:"chevron_right"})})]})]},`${T.kind}:${T.href}:${T.at}`)})})]})}async function Uo(i,c){const o=window.open("","_blank");if(!o)return;const u=c?`${i}/${c}`:i;o.document.write(`<title>${En(u)}</title><body style="font-family:system-ui;padding:40px;color:#555">preparing ${En(u)}…</body>`);const f=j=>`/api/knowledge/${encodeURIComponent(i)}/concept?id=${encodeURIComponent(j)}`;let h,m="";try{const[j,K]=await Promise.all([c?Promise.resolve([c]):fetch(`/api/knowledge/${encodeURIComponent(i)}`).then($=>$.json()).then($=>$.concepts.map(w=>w.id)),fetch("/api/meta").then($=>$.json()).catch(()=>({}))]);if(m=K.projectName??"",h=await Promise.all(j.map($=>fetch(f($)).then(w=>w.json()))),h.some($=>typeof $?.id!="string"))throw new Error("missing concept")}catch{o.document.body.textContent=`could not load "${u}"`;return}const p=[],y=h.map(j=>{const K=[j.type,j.generated?.at?`updated ${j.generated.at.slice(0,10)}`:"",j.trustTier==="human-reviewed"?"human-reviewed":"",(j.tags??[]).map(R=>`#${R}`).join(" ")].filter(Boolean).join(" · "),{md:$,notes:w}=ib(wp(j.body??"",null)),P=!j.title||j.title===j.id||j.title===j.id.split("/").pop(),{html:re,title:Z}=cb(vl.sanitize(ze.parse($,{async:!1})),{title:j.title||j.id,meta:K,titleIsFallback:P});p.push(Z);const J=w.length?`<ol class="notes">${w.map(R=>`<li id="fn-${En(R.id)}">${vl.sanitize(ze.parseInline(R.text,{async:!1}))}</li>`).join("")}</ol>`:"";return`<article>
|
|
78
|
+
${re}
|
|
79
|
+
${J}
|
|
80
|
+
</article>`}).join(`
|
|
81
|
+
`),x=new Date().toISOString().slice(0,10),T=m?`${En(m)} · ${En(i)}`:En(i),_=c?p[0]||u:i,N=c?"":`<h1 class="cover">${En(i)}</h1>
|
|
82
|
+
<div class="cover-sub">${m?`${En(m)} · `:""}knowledge bundle · ${h.length} concept${h.length===1?"":"s"} · exported ${x}</div>`,U=`<!doctype html>
|
|
83
|
+
<html>
|
|
84
|
+
<head>
|
|
85
|
+
<meta charset="utf-8">
|
|
86
|
+
<title>${En(_)}</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>${T}</span><span>${x}</span></div>
|
|
193
|
+
</td></tr></thead>
|
|
194
|
+
<tbody><tr><td>
|
|
195
|
+
${N}
|
|
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([U],{type:"text/html"}))}function wp(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 ib(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 cb(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>${En(u)}</h1><div class="meta">${En(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 En(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function kp(i,c){return`/edit/${encodeURIComponent(i)}/${c.split("/").map(encodeURIComponent).join("/")}`}function rb({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(ob,{name:i,conceptId:c},i):l.jsx(ub,{root:o?.root})})]})}function ub({root:i}){const[c,o]=E.useState(""),[u,f]=E.useState(""),[h,m]=E.useState(!1);async function p(){const y=c.trim();if(!y)return;m(!0),f("");const T=await(await fetch("/api/knowledge",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:y})})).json();m(!1),T.error?f(T.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 Pm({tier:i}){return l.jsx("span",{className:`chip trust ${i}`,children:i})}const ep="@activity";function ob({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===ep?"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:"agent-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}/${ep}`,className:u==="activity"?"active":"",children:"activity"})]}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"open-raw",onClick:()=>{Uo(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(mb,{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:pb(f).map(({folder:p,concepts:y})=>l.jsxs(E.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:fb(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(gb,{bundle:i,conceptId:h},h)})]})]})}function fb(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 db(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 hb(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 mb({name:i,log:c}){const o=db(c),[u,f]=E.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(E.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:hb(i,m.text)})]},p))]},h.date))})]})}function pb(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 gb({bundle:i,conceptId:c}){const[o,u]=E.useState(null),[f,h]=E.useState(!1),[m,p]=E.useState(!1),[y,x]=E.useState(!1),[T,_]=E.useState(""),[N,U]=E.useState(!1),[j,K]=E.useState(""),[$,w]=E.useState("rendered"),P=E.useMemo(()=>o?vl.sanitize(ze.parse(wp(o.body,i),{async:!1})):"",[o?.body,i]),re=()=>{fetch(`/api/knowledge/${encodeURIComponent(i)}/concept?id=${encodeURIComponent(c)}`).then(R=>R.ok?R.json():Promise.reject()).then(u).catch(()=>h(!0))};E.useEffect(()=>{if(y)return;let R=!0,M;const W=async()=>{try{const te=await fetch(`/api/knowledge/${encodeURIComponent(i)}/concept?id=${encodeURIComponent(c)}`,{cache:"no-store"});if(te.ok){const ve=await te.json();R&&(h(!1),u(ge=>JSON.stringify(ge)===JSON.stringify(ve)?ge:ve))}else te.status===404&&R&&h(!0)}catch{}R&&(M=setTimeout(W,6e3))};return W(),()=>{R=!1,clearTimeout(M)}},[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),re()}async function J(){U(!0),K("");const R=await fetch(`/api/knowledge/${encodeURIComponent(i)}/concept`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:c,content:T})}).then(M=>M.json()).catch(()=>({error:"save failed"}));U(!1),R.error?K(R.error):(u(R),x(!1))}return f?l.jsx("div",{className:"empty",children:"concept not found"}):o?l.jsxs("div",{className:"agent-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(Pm,{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:kp(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:()=>{Uo(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:N,onClick:J,children:N?"saving…":l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"check",className:"ms-sm"})," save"]})})]}):l.jsxs("button",{className:"open-raw",onClick:()=>{_(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:T,rows:Math.min(40,Math.max(18,T.split(`
|
|
204
|
+
`).length+2)),onChange:R=>_(R.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:$==="rendered"?"active":"",onClick:()=>w("rendered"),children:"rendered"}),l.jsx("button",{className:$==="source"?"active":"",onClick:()=>w("source"),children:"source"})]})}),l.jsx("div",{className:"viewer-body",children:$==="rendered"?l.jsx("div",{className:"md-body concept-md",dangerouslySetInnerHTML:{__html:P}}):l.jsx("pre",{children:o.body.trim()||"(empty body)"})})]}),j&&l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",j]})]}),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(Pm,{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((R,M)=>l.jsxs("span",{className:"v",children:[R.by??"?"," · ",(R.at??"?").slice(0,10)]},M))]}),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(R=>l.jsx("span",{className:"chip",children:R},R))})]})]})]}),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((R,M)=>l.jsxs("div",{className:"rail-kv",children:[l.jsxs("span",{className:"v",children:[R.resource?.startsWith("http")?l.jsx("a",{href:R.resource,target:"_blank",rel:"noreferrer",children:R.title??R.resource}):R.title??R.resource??"?",R.id&&l.jsxs("span",{className:"know-id",children:["[^",R.id,"]"]})]}),l.jsx("span",{className:"v dim",children:[R.author,R.usage_count!=null?`${R.usage_count} uses`:null,R.last_modified?`mod ${R.last_modified.slice(0,10)}`:null].filter(Boolean).join(" · ")})]},M))})]})]})]})]}):l.jsx("div",{className:"empty",children:"loading…"})}const xb={workspace:"workspace",project:".claude",user:"global",agent:"agent"};function Tp(i){return l.jsx("span",{className:`chip skill-src ${i}`,children:xb[i]})}function vb({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"&&Tp(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(E.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(bb,{name:i},i):l.jsx(yb,{root:c?.root,workspace:u})})]})}function yb({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 bb({name:i}){const[c,o]=E.useState(null),[u,f]=E.useState(!1),[h,m]=E.useState("rendered"),p=E.useMemo(()=>c?c.content.replace(/^---\r?\n[\s\S]*?\r?\n---(\r?\n|$)/,""):"",[c?.content]),y=E.useMemo(()=>c?vl.sanitize(ze.parse(p,{async:!1})):"",[p]);return E.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:"agent-view",children:[l.jsxs("div",{className:"detail-head",children:[l.jsxs("h1",{children:["/",c.name]}),Tp(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 jb=["","low","medium","high","xhigh","max"],Nb=["🤖","🧑💻","🎧","🛠️","📊","✍️","🔍","🧹","📦","🚀"];function tp({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?"agent":"home",u=o==="chat"?i[2]:o==="chats"?i[1]:void 0,f=He("/api/agents",!1),h=qn(),[m,p]=E.useState(()=>{try{const G=JSON.parse(localStorage.getItem("kw-agent-groups")??"[]");return Array.isArray(G)?G.map(String):[]}catch{return[]}}),[y,x]=E.useState(!1),[T,_]=E.useState(""),[N,U]=E.useState(null),[j,K]=E.useState(""),[$,w]=E.useState(null),[P,re]=E.useState(null),[Z,J]=E.useState({}),R=(f?.agents??[]).map(G=>Z[G.slug]!==void 0?{...G,group:Z[G.slug]||void 0}:G);E.useEffect(()=>{J(G=>{const Re={...G};let Ge=!1;for(const We of f?.agents??[])Re[We.slug]!==void 0&&(We.group??"")===Re[We.slug]&&(delete Re[We.slug],Ge=!0);return Ge?Re:G})},[f]);const M=R.filter(G=>!G.archived),W=R.filter(G=>G.archived),[te,ve]=E.useState(!1),ge=[...new Set([...M.map(G=>G.group??"").filter(Boolean),...m])].sort((G,Re)=>G.localeCompare(Re)),ae=M.filter(G=>!G.group);function be(G){p(G);try{localStorage.setItem("kw-agent-groups",JSON.stringify(G))}catch{}}function Je(){const G=T.trim();x(!1),_(""),G&&!ge.includes(G)&&be([...m,G])}function at(G,Re){U(null);const Ge=Re.trim();if(!(!Ge||Ge===G)){for(const We of R.filter(nn=>nn.group===G))H(We.slug,Ge);m.includes(G)&&be([...new Set(m.map(We=>We===G?Ge:We))])}}async function H(G,Re){if((R.find(We=>We.slug===G)?.group??"")!==Re){J(We=>({...We,[G]:Re}));try{const We=await fetch(`/api/agents/${encodeURIComponent(G)}`);if(!We.ok)throw new Error;const nn=await We.json();if(!(await fetch(`/api/agents/${encodeURIComponent(G)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({...nn,group:Re||void 0})})).ok)throw new Error}catch{J(We=>{const nn={...We};return delete nn[G],nn})}}}const ee=G=>h?{onDragOver:Re=>{$!=null&&(Re.preventDefault(),Re.dataTransfer.dropEffect="move",P!==G&&re(G))},onDrop:Re=>{Re.preventDefault();const Ge=Re.dataTransfer.getData("text/plain")||$;Ge&&H(Ge,G),w(null),re(null)}}:{},ue=G=>l.jsxs(Ee,{href:`/agents/${encodeURIComponent(G.slug)}`,className:`side-row ${G.slug===c?"active":""} ${$===G.slug?"dragging":""}`,draggable:h,onDragStart:Re=>{Re.dataTransfer.setData("text/plain",G.slug),Re.dataTransfer.effectAllowed="move",w(G.slug)},onDragEnd:()=>{w(null),re(null)},children:[l.jsx("span",{className:"agent-avatar sm",children:l.jsx("span",{"aria-hidden":!0,children:G.emoji})}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:G.name})}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-req",children:G.description||G.harness})})]})]},G.slug),Ce=G=>l.jsxs(Ee,{href:`/agents/${encodeURIComponent(G.slug)}/info`,className:`side-row archived-row ${G.slug===c?"active":""}`,children:[l.jsx("span",{className:"agent-avatar sm",children:l.jsx("span",{"aria-hidden":!0,children:G.emoji})}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:G.name})}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-req",children:G.description||G.harness})})]})]},G.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(Km,{id:u,agentName:R.find(G=>G.slug===c)?.name??c,agentDescription:R.find(G=>G.slug===c)?.description},u)}):o==="chats"?je=u?l.jsx("div",{className:"chat-main",children:l.jsx(Km,{id:u},u)}):l.jsx(_y,{}):o==="info"&&c?je=l.jsx(Ep,{slug:c},c):c?je=l.jsx(wb,{slug:c},c):je=l.jsx(Eb,{hasAgents:M.length>0,root:f?.root});const k=(o==="agent"||o==="info"||o==="chat")&&c?R.find(G=>G.slug===c)?.knowledge??[]:[],[Y,ne]=E.useState(()=>localStorage.getItem("kw-kside")!=="hidden"),[F,he]=E.useState(()=>Number(localStorage.getItem("kw-kside-w"))||460),pe=k.length>0&&Y;function _e(G){ne(G),localStorage.setItem("kw-kside",G?"open":"hidden")}function mt(G){he(G),localStorage.setItem("kw-kside-w",String(G))}return l.jsxs("div",{className:`runs-screen agents-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 ${$&&P===""?"drop-over":""}`,...ee(""),children:[ae.map(ue),$!=null&&ae.length===0&&l.jsx("div",{className:"side-group-empty",children:"no group — drop here"})]}),ge.map(G=>{const Re=M.filter(Ge=>Ge.group===G);return l.jsxs("div",{className:`side-group ${$&&P===G?"drop-over":""}`,...ee(G),children:[l.jsxs("div",{className:"side-group-head",children:[N===G?l.jsx("input",{className:"side-group-rename",autoFocus:!0,value:j,onChange:Ge=>K(Ge.target.value),onKeyDown:Ge=>{Ge.key==="Enter"&&at(G,j),Ge.key==="Escape"&&U(null)},onBlur:()=>at(G,j)}):l.jsx("span",{className:"microlabel",children:G}),l.jsx("span",{className:"side-group-count num",children:Re.length}),l.jsx("span",{className:"spacer"}),h&&N!==G&&l.jsx("button",{className:"side-group-x",title:"Rename group",onClick:()=>{U(G),K(G)},children:l.jsx(V,{name:"edit",className:"ms-sm"})}),h&&Re.length===0&&m.includes(G)&&l.jsx("button",{className:"side-group-x",title:"Remove empty group",onClick:()=>be(m.filter(Ge=>Ge!==G)),children:l.jsx(V,{name:"close",className:"ms-sm"})})]}),Re.map(ue),Re.length===0&&l.jsx("div",{className:"side-group-empty",children:h?"drag agents here":"no agents"})]},G)}),W.length>0&&l.jsxs("div",{className:"side-group side-archived",children:[l.jsxs("button",{className:"side-archived-toggle","aria-expanded":te,onClick:()=>ve(G=>!G),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:te?"expand_less":"expand_more",className:"ms-sm"})]}),te&&W.map(Ce)]}),f&&R.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:T,placeholder:"group name, e.g. Team Content",onChange:G=>_(G.target.value),onKeyDown:G=>{G.key==="Enter"&&Je(),G.key==="Escape"&&(x(!1),_(""))},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(kb,{slug:c,chatId:u}),o==="chats"&&l.jsx(Tb,{chatId:u}),l.jsx("div",{className:"runs-main",children:je}),pe&&l.jsx(Sb,{bundles:k,onHide:()=>_e(!1),onResize:mt}),k.length>0&&!Y&&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 Sb({bundles:i,onHide:c,onResize:o}){const[u,f]=E.useState({}),[h,m]=E.useState(null),[p,y]=E.useState({}),[x,T]=E.useState({}),[_,N]=E.useState(null),[U,j]=E.useState(""),[K,$]=E.useState(!1),[w,P]=E.useState("");E.useEffect(()=>{f({});let J=!0,R;const M=async()=>{await Promise.all(i.map(async W=>{try{const te=await fetch(`/api/knowledge/${encodeURIComponent(W)}`,{cache:"no-store"}),ve=te.ok?await te.json():null;J&&f(ge=>JSON.stringify(ge[W])===JSON.stringify(ve)?ge:{...ge,[W]:ve})}catch{J&&f(te=>W in te?te:{...te,[W]:null})}})),J&&(R=setTimeout(M,6e3))};return M(),()=>{J=!1,clearTimeout(R)}},[i.join(",")]),E.useEffect(()=>{if(!h||_===h)return;const J=h.indexOf("::"),R=h.slice(0,J),M=h.slice(J+2);let W=!0,te;const ve=async()=>{try{const ge=await fetch(`/api/knowledge/${encodeURIComponent(R)}/concept?id=${encodeURIComponent(M)}`,{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&&(te=setTimeout(ve,6e3))};return ve(),()=>{W=!1,clearTimeout(te)}},[h,_]);function re(J,R){const M=`${J}::${R}`;m(h===M?null:M)}async function Z(J,R){const M=`${J}::${R}`;$(!0),P("");try{const te=await(await fetch(`/api/knowledge/${encodeURIComponent(J)}/concept`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:R,content:U})})).json();te.error?P(te.error):(y(ve=>({...ve,[M]:te})),N(null))}catch(W){P(W.message)}$(!1)}return l.jsxs("aside",{className:"runs-side knowledge-side",children:[l.jsx("div",{className:"kside-resizer",title:"Drag to resize",onMouseDown:J=>{J.preventDefault();const R=J.clientX,M=J.currentTarget.parentElement.offsetWidth,W=ve=>o(Math.min(900,Math.max(280,M+(R-ve.clientX)))),te=()=>{window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",te)};window.addEventListener("mousemove",W),window.addEventListener("mouseup",te)}}),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(J=>{const R=u[J],M=x[J]===!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":!M,onClick:()=>T({...x,[J]:!M}),children:[l.jsx("span",{className:`kside-chev ${M?"":"open"}`,"aria-hidden":!0,children:l.jsx(V,{name:"chevron_right",className:"ms-sm"})}),l.jsx("span",{className:"kside-bundle-name",children:J}),R&&l.jsx("span",{className:"kside-count num",children:R.concepts.length})]}),l.jsx("button",{className:"kside-open",title:"Export this bundle as PDF",onClick:()=>{Uo(J)},children:l.jsx(V,{name:"picture_as_pdf",className:"ms-sm"})}),l.jsx(Ee,{href:`/knowledge/${encodeURIComponent(J)}`,className:"kside-open",title:"Open this bundle on the knowledge screen",children:"↗"})]}),!M&&R===null&&l.jsx("div",{className:"viewer-note",children:"bundle not found"}),!M&&R?.concepts.map(W=>{const te=`${J}::${W.id}`,ve=h===te,ge=`/knowledge/${encodeURIComponent(J)}/${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:()=>re(J,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[te]===void 0?l.jsx("div",{className:"viewer-note",children:"loading…"}):p[te]===null?l.jsx("div",{className:"viewer-note",children:"could not load concept"}):_===te?l.jsxs("div",{className:"kside-edit",children:[l.jsx("textarea",{className:"concept-edit",value:U,rows:Math.min(28,Math.max(10,U.split(`
|
|
205
|
+
`).length+2)),onChange:ae=>j(ae.target.value),spellCheck:!1}),l.jsxs("div",{className:"kside-actions",children:[l.jsx("button",{className:"open-raw",disabled:K,onClick:()=>N(null),children:"cancel"}),l.jsx("button",{className:"open-raw",disabled:K,onClick:()=>Z(J,W.id),children:K?"saving…":l.jsxs(l.Fragment,{children:[l.jsx(V,{name:"check",className:"ms-sm"})," save"]})})]}),w&&l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",w]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"kside-card-bar",children:[W.type&&l.jsx("span",{className:"kside-type",children:W.type}),np(W)&&l.jsxs("span",{className:"kside-updated num",children:["updated ",gl(np(W))]}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"open-raw",onClick:()=>{j(p[te].raw),N(te),P("")},children:[l.jsx(V,{name:"edit",className:"ms-sm"})," edit"]}),l.jsxs(Ee,{href:kp(J,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[te].body??"",{async:!1}))}})]})})]},W.id)}),!M&&R&&R.concepts.length===0&&l.jsx("div",{className:"viewer-note",children:"no concepts yet"})]},J)})})]})}function np(i){return[i.generated?.at,...i.verified.map(o=>o.at)].filter(o=>typeof o=="string"&&o.length>0).sort().pop()}function wb({slug:i}){const[c,o]=E.useState(!1);return E.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==="agent"&&m.scope.slug===i);h?tn(`/agents/${encodeURIComponent(i)}/chat/${h.id}`,{replace:!0}):o(!0)}).catch(()=>u&&o(!0)),()=>{u=!1}},[i]),c?l.jsx(Ep,{slug:i}):l.jsx("div",{className:"empty",children:"loading…"})}function kb({slug:i,chatId:c}){const o=He("/api/chats",!1),u=(o?.chats??[]).filter(m=>m.scope.kind==="agent"&&m.scope.slug===i),[f,h]=E.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:"agent",slug: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&&tn(`/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 Tb({chatId:i}){const c=He("/api/chats",!1),o=(c?.chats??[]).filter(u=>u.scope.kind!=="agent");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&&tn("/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 Eb({hasAgents:i,root:c}){const o=qn();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 agents: 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:()=>tn("/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 Ep({slug:i}){const[c,o]=E.useState(null),[u,f]=E.useState(!1),[h,m]=E.useState(!1),[p,y]=E.useState(!1),[x,T]=E.useState(""),[_,N]=E.useState(""),[U,j]=E.useState([]),[K,$]=E.useState(!0),[w,P]=E.useState(!1),[re,Z]=E.useState(""),J=He("/api/workflows",!1),R=He("/api/knowledge",!1),M=He("/api/skills",!1);E.useEffect(()=>{let ae=!0;return fetch(`/api/agents/${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){P(!0),Z("");try{const Je=await(await fetch(`/api/agents/${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),T(""))}catch(be){Z(be.message)}P(!1)}}function te(ae,be){j(be?[...U,ae]:U.filter(Je=>Je!==ae))}async function ve(ae){P(!0),Z("");try{const Je=await(await fetch(`/api/agents/${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)}P(!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:"agent-form-row",style:{marginTop:8},children:[l.jsx("button",{className:"run-btn",disabled:w,onClick:()=>{W(ae)},children:w?"saving…":"save"}),l.jsx("button",{className:"open-raw",disabled:w,onClick:()=>(T(""),Z("")),children:"cancel"})]});return l.jsxs("div",{className:"agent-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:w,onClick:()=>{ve(!1)},children:[l.jsx(V,{name:"unarchive",className:"ms-sm"})," ",w?"…":"unarchive"]}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"open-raw",disabled:w,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:"agent",slug: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:"agent-form-row",style:{marginTop:10},children:[l.jsxs("button",{className:"open-raw",onClick:()=>{N(c.system),T("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,_.split(`
|
|
207
|
+
`).length+2)),value:_,placeholder:"You are the ... for this project. Your job is ...",onChange:ae=>N(ae.target.value),spellCheck:!1}),ge({system:_})]}),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:[(J?.workflows??[]).map(ae=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:U.includes(ae.slug),onChange:be=>te(ae.slug,be.target.checked)}),l.jsx("b",{children:ae.slug}),ae.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",ae.description]})]},ae.slug)),(J?.workflows??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no workflows in this project"})]}),ge({workflows:U})]}):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:()=>{j(c.workflows),T("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:[(R?.bundles??[]).map(ae=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:U.includes(ae.name),onChange:be=>te(ae.name,be.target.checked)}),l.jsx("b",{children:ae.name}),l.jsxs("span",{className:"opt-hint",children:[" — ",ae.concepts," concepts"]})]},ae.name)),(R?.bundles??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no knowledge bundles in this project"})]}),ge({knowledge:U})]}):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:()=>{j(c.knowledge),T("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=>$(ae.target.checked)}),l.jsx("b",{children:"all skills"}),l.jsx("span",{className:"opt-hint",children:" — every discovered skill, including future ones"})]}),!K&&(M?.skills??[]).map(ae=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:U.includes(ae.name),onChange:be=>te(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&&(M?.skills??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no skills found (.claude/skills, project or user)"})]}),ge({skills:K?void 0:U})]}):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:()=>{$(c.skills===void 0),j(c.skills??[]),T("skills"),Z("")},children:"edit"})]})]}),re&&l.jsxs("div",{className:"msg error",children:[l.jsx(V,{name:"error",className:"ms-sm"})," ",re]})]}),l.jsx(Ab,{slug:i}),l.jsx(Cb,{slug:i})]})}const _b=`---
|
|
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 Ab({slug:i}){const o=He(`/api/agents/${encodeURIComponent(i)}/skills`,!1)?.skills??[],[u,f]=E.useState(null),[h,m]=E.useState(!1),[p,y]=E.useState("");async function x(N){y("");const U=await fetch(`/api/agents/${encodeURIComponent(i)}/skills/${encodeURIComponent(N)}`),j=await U.json().catch(()=>null);if(!U.ok||!j||j.error)return void y(j?.error??"could not load skill");f({name:N,content:j.content??"",isNew:!1})}async function T(){if(!u)return;m(!0),y("");const U=await(await fetch(`/api/agents/${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),U.error?y(U.error):f(null)}async function _(N){window.confirm(`Delete skill "/${N}" of this agent (its folder is removed)?`)&&(await fetch(`/api/agents/${encodeURIComponent(i)}/skills/${encodeURIComponent(N)}`,{method:"DELETE"}).catch(()=>{}),u?.name===N&&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:_b,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(N=>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:["/",N.name]}),l.jsx("span",{className:"m3-sub",children:N.description||l.jsx("code",{children:"SKILL.md"})})]}),l.jsxs("button",{className:"open-raw",onClick:()=>{x(N.name)},children:[l.jsx(V,{name:"edit",className:"ms-sm"})," edit"]}),l.jsx("button",{className:"open-raw",onClick:()=>{_(N.name)},children:l.jsx(V,{name:"close",className:"ms-sm"})})]},N.name))}),u&&l.jsxs("div",{className:"agent-form",children:[l.jsx("div",{className:"agent-form-row",children:l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name — invoked as /<name>",l.jsx("input",{value:u.name,placeholder:"e.g. report-html",disabled:!u.isNew,onChange:N=>f({...u,name:N.target.value})})]})}),l.jsxs("label",{className:"agent-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:N=>f({...u,content:N.target.value})})]}),l.jsxs("div",{className:"agent-form-row",children:[l.jsx("button",{className:"run-btn",disabled:h||!u.name.trim(),onClick:()=>{T()},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 Cb({slug:i}){const o=He(`/api/agents/${encodeURIComponent(i)}/routines`,!1)?.routines??[],[u,f]=E.useState(null),[h,m]=E.useState(""),[p,y]=E.useState("");async function x(N){m("");const j=await(await fetch(`/api/agents/${encodeURIComponent(i)}/routines`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(N)})).json();return j.error?(m(j.error),!1):!0}async function T(N){y(N),m("");const j=await(await fetch(`/api/agents/${encodeURIComponent(i)}/routines/${encodeURIComponent(N)}/run`,{method:"POST"})).json();y(""),j.error?m(j.error):j.chatId&&tn(`/agents/${encodeURIComponent(i)}/chat/${j.chatId}`)}async function _(N){window.confirm(`Delete routine "${N}"?`)&&await fetch(`/api/agents/${encodeURIComponent(i)}/routines/${encodeURIComponent(N)}`,{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(N=>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:[N.name,N.lastError&&l.jsx("span",{className:"chip stale",title:N.lastError,children:"error"})]}),l.jsxs("span",{className:"m3-sub",children:[l.jsx("code",{children:N.schedule}),N.enabled?N.nextRunAt?` · next ${gl(N.nextRunAt)}`:"":" · paused"," · ",N.lastChatId?l.jsxs(Ee,{href:`/agents/${encodeURIComponent(i)}/chat/${N.lastChatId}`,children:["last run ",gl(N.lastRunAt)]}):"never ran"]})]}),l.jsx("button",{className:"open-raw",disabled:p===N.id,onClick:()=>T(N.id),children:p===N.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:N.id,name:N.name,schedule:N.schedule,prompt:N.prompt,enabled:N.enabled}),children:"edit"}),l.jsx("button",{className:"open-raw",onClick:()=>{_(N.id)},children:"delete"}),l.jsxs("label",{className:"m3-switch",title:N.enabled?"enabled — click to pause":"paused — click to enable",children:[l.jsx("input",{type:"checkbox",checked:N.enabled,onChange:()=>{x({id:N.id,name:N.name,schedule:N.schedule,prompt:N.prompt,enabled:!N.enabled})}}),l.jsx("span",{className:"m3-switch-track"})]})]},N.id))}),u&&l.jsxs("div",{className:"agent-form",children:[l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:u.name,placeholder:"e.g. Morning report",onChange:N=>f({...u,name:N.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:200},children:["schedule (cron)",l.jsx("input",{value:u.schedule,placeholder:"0 9 * * 1-5",onChange:N=>f({...u,schedule:N.target.value})})]}),l.jsxs("label",{className:"agent-field wf-checks",style:{width:90},children:["enabled",l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:u.enabled,onChange:N=>f({...u,enabled:N.target.checked})}),"on"]})]})]}),l.jsxs("label",{className:"agent-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:N=>f({...u,prompt:N.target.value})})]}),l.jsxs("div",{className:"agent-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]=E.useState(i?null:U()),[u,f]=E.useState(""),[h,m]=E.useState(!1),y=He("/api/workflows",!1)?.workflows??[],T=He("/api/knowledge",!1)?.bundles??[],N=He("/api/skills",!1)?.skills??[];E.useEffect(()=>{i&&fetch(`/api/agents/${encodeURIComponent(i)}`).then(w=>w.ok?w.json():Promise.reject()).then(w=>o({name:w.name,emoji:w.emoji,description:w.description??"",harness:w.harness,model:w.model??"",effort:w.effort??"",group:w.group??"",system:w.system,workflows:w.workflows,knowledge:w.knowledge??[],skillsAll:w.skills===void 0,skills:w.skills??[]})).catch(()=>f("agent not found"))},[i]);function U(){return{name:"",emoji:"🤖",description:"",harness:"claude",model:"",effort:"",group:"",system:"",workflows:[],knowledge:[],skillsAll:!0,skills:[]}}async function j(){if(!c)return;m(!0),f("");const P=await(await fetch(i?`/api/agents/${encodeURIComponent(i)}`:"/api/agents",{method:i?"PUT":"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...c,skills:c.skillsAll?void 0:c.skills})})).json();m(!1),P.error?f(P.error):tn(`/agents/${encodeURIComponent(P.slug)}/info`)}async function K(){!i||!window.confirm(`Delete agent "${i}" and its definition folder?`)||(await fetch(`/api/agents/${encodeURIComponent(i)}`,{method:"DELETE"}).catch(()=>{}),tn("/agents"))}if(!c)return l.jsx("div",{className:"empty",children:u||"loading…"});const $=w=>o({...c,...w});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:"agent-form",children:[l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:c.name,placeholder:"e.g. Max",onChange:w=>$({name:w.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:90},children:["emoji",l.jsx("input",{value:c.emoji,onChange:w=>$({emoji:w.target.value})})]})]}),l.jsx("div",{className:"emoji-pick",children:Nb.map(w=>l.jsx("button",{type:"button",className:c.emoji===w?"active":"",onClick:()=>$({emoji:w}),children:w},w))}),l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{flex:1},children:["description",l.jsx("input",{value:c.description,placeholder:"one line: what this agent is for",onChange:w=>$({description:w.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:180},children:["group",l.jsx("input",{value:c.group,placeholder:"none",onChange:w=>$({group:w.target.value})})]})]}),l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{width:140},children:["harness",l.jsxs("select",{value:c.harness,onChange:w=>$({harness:w.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:"agent-field",style:{flex:1},children:["model",l.jsx("input",{value:c.model,placeholder:"harness default — e.g. sonnet, gpt-5.6-sol",onChange:w=>$({model:w.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:140},children:["effort",l.jsx("select",{value:c.effort,onChange:w=>$({effort:w.target.value}),children:jb.map(w=>l.jsx("option",{value:w,children:w||"default"},w))})]})]}),l.jsxs("label",{className:"agent-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:w=>$({system:w.target.value})})]}),l.jsxs("div",{className:"agent-field",children:[l.jsx("span",{className:"agent-field-label",children:"connected workflows — autoloaded into the agent's context; it can run them"}),l.jsxs("div",{className:"wf-checks",children:[y.map(w=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.workflows.includes(w.slug),onChange:P=>$({workflows:P.target.checked?[...c.workflows,w.slug]:c.workflows.filter(re=>re!==w.slug)})}),l.jsx("b",{children:w.slug}),w.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",w.description]})]},w.slug)),y.length===0&&l.jsx("div",{className:"viewer-note",children:"no workflows in this project"})]})]}),l.jsxs("div",{className:"agent-field",children:[l.jsx("span",{className:"agent-field-label",children:"connected knowledge — OKF bundles the agent consults and maintains"}),l.jsxs("div",{className:"wf-checks",children:[T.map(w=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.knowledge.includes(w.name),onChange:P=>$({knowledge:P.target.checked?[...c.knowledge,w.name]:c.knowledge.filter(re=>re!==w.name)})}),l.jsx("b",{children:w.name}),l.jsxs("span",{className:"opt-hint",children:[" — ",w.concepts," concepts"]})]},w.name)),T.length===0&&l.jsx("div",{className:"viewer-note",children:"no knowledge bundles in this project"})]})]}),l.jsxs("div",{className:"agent-field",children:[l.jsx("span",{className:"agent-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:w=>$({skillsAll:w.target.checked})}),l.jsx("b",{children:"all skills"}),l.jsx("span",{className:"opt-hint",children:" — every discovered skill, including future ones"})]}),!c.skillsAll&&N.map(w=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.skills.includes(w.name),onChange:P=>$({skills:P.target.checked?[...c.skills,w.name]:c.skills.filter(re=>re!==w.name)})}),l.jsxs("b",{children:["/",w.name]}),w.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",w.description]})]},w.name)),!c.skillsAll&&N.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:"agent-form-row",children:[l.jsx("button",{className:"run-btn",disabled:!c.name.trim()||h,onClick:j,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 lp(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 Rb(){const[i,c]=E.useState(null),[o,u]=E.useState(""),[f,h]=E.useState(""),[m,p]=E.useState([]),[y,x]=E.useState(vi),[T,_]=E.useState(!1),[N,U]=E.useState(!1),[j,K]=E.useState(!1),[$,w]=E.useState("");E.useEffect(()=>{fetch("/api/settings").then(M=>M.json()).then(M=>{c(M),u(M.config.name??""),h(M.config.icon??""),p(M.config.switcher??[]),x(lp(M))}).catch(()=>w("could not load settings"))},[]);const P=()=>{_(!0),K(!1),w("")};async function re(){U(!0),w("");try{const M=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 M.json();if(!M.ok)throw new Error(W.error||"save failed");c(W),p(W.config.switcher??[]),x(lp(W)),_(!1),K(!0),window.dispatchEvent(new Event("kw-meta-refresh"))}catch(M){w(M.message)}finally{U(!1)}}const Z=(M,W)=>{p(te=>te.map((ve,ge)=>ge===M?{...ve,...W}:ve)),P()},J=M=>{x(W=>({...W,...M})),P()};if(!i)return l.jsx("div",{className:"empty",children:$||"loading…"});const R=[["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","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"}),$&&l.jsx("span",{className:"settings-err",children:$}),j&&!T&&l.jsxs("span",{className:"settings-saved",children:[l.jsx(V,{name:"check",className:"ms-sm"})," saved"]}),l.jsx("button",{className:"run-btn",disabled:N||!T,onClick:()=>{re()},children:N?"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:"agent-form",children:[l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{width:90},children:["icon",l.jsx("input",{value:f,placeholder:"🤖",onChange:M=>{h(M.target.value),P()}})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:o,placeholder:"my workspace",onChange:M=>{u(M.target.value),P()}})]})]}),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(M=>[...M,{name:"",url:"http://localhost:"}]),P()},children:[l.jsx(V,{name:"add",className:"ms-sm"})," add entry"]})]}),l.jsxs("div",{className:"agent-form",children:[m.length===0&&l.jsx("div",{className:"settings-note",children:"No manual entries."}),m.map((M,W)=>l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{width:70},children:["icon",l.jsx("input",{value:M.icon??"",placeholder:"•",onChange:te=>Z(W,{icon:te.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:M.name,placeholder:"other workspace",onChange:te=>Z(W,{name:te.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{flex:1.4},children:["url",l.jsx("input",{value:M.url,placeholder:"http://localhost:1982",onChange:te=>Z(W,{url:te.target.value})})]}),l.jsx("button",{className:"row-x settings-row-x",title:"remove entry",onClick:()=>{p(te=>te.filter((ve,ge)=>ge!==W)),P()},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:"agent-form",children:[l.jsxs("label",{className:"settings-check",children:[l.jsx("input",{type:"checkbox",checked:y.enabled,onChange:M=>J({enabled:M.target.checked})}),"sync workflows, knowledge, agents and skills with a git remote"]}),y.enabled&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{flex:1},children:["remote",l.jsx("input",{value:y.remote,placeholder:"origin",onChange:M=>J({remote:M.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["branch",l.jsx("input",{value:y.branch,placeholder:"checked-out branch",onChange:M=>J({branch:M.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:120},children:["interval (s)",l.jsx("input",{type:"number",min:0,step:1,value:y.interval,placeholder:"300",onChange:M=>J({interval:M.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:150},children:["autosync",l.jsxs("select",{value:y.autosync,onChange:M=>J({autosync:M.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:R.map(([M,W,te])=>l.jsxs("div",{className:"settings-kv",children:[l.jsx("span",{className:"microlabel",children:M}),l.jsx("code",{children:W}),l.jsx("span",{className:"settings-kv-hint",children:te})]},M))}),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 zb(){const[i,c]=E.useState(null),[o,u]=E.useState(""),[f,h]=E.useState({}),[m,p]=E.useState({}),[y,x]=E.useState(null),T=E.useCallback(async()=>{try{const j=await fetch("/api/projects",{cache:"no-store"});if(j.ok){c(await j.json()),u("");return}u(j.status===404?"This workspace runs a kraftwerk without the projects API. Update it and restart its UI.":`Could not load the project registry (HTTP ${j.status}).`)}catch(j){u(j.message||"Could not reach this workspace's server.")}},[]);E.useEffect(()=>{let j=!0,K;const $=async()=>{await T(),j&&(K=setTimeout($,6e3))};return $(),()=>{j=!1,clearTimeout(K)}},[T]);const _=j=>j.root??j.url,N=async(j,K)=>{const $=_(j);h(w=>({...w,[$]:K})),p(w=>({...w,[$]:""})),x(null);try{const w=K==="stop"?{root:j.root,url:j.url}:{root:j.root},P=await go(`/api/projects/${K}`,w);if(!P.ok)throw new Error(P.error||"failed");window.dispatchEvent(new Event("kw-meta-refresh"))}catch(w){p(P=>({...P,[$]:w.message}))}finally{h(w=>{const P={...w};return delete P[$],P}),T()}},U=i?.filter(j=>j.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 · ",U," 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(j=>{const K=_(j),$=f[K],w=!j.live&&!!j.root&&(j.exists===!1||j.hasConfig===!1);return l.jsxs("div",{className:`ws-row state-${j.state} ${j.current?"current":""}`,children:[l.jsx("span",{className:"switcher-icon ws-icon",children:j.icon||"•"}),l.jsxs("div",{className:"ws-main",children:[l.jsxs("div",{className:"ws-title",children:[j.live&&!j.current?l.jsx("a",{href:j.url,className:"ws-name",children:j.name}):l.jsx("span",{className:"ws-name",children:j.name}),j.current&&l.jsx("span",{className:"switcher-hint",children:"current"}),l.jsxs("span",{className:`ws-state ws-state-${j.state}`,children:[j.live&&l.jsx("span",{className:"live-dot"}),oo[j.state].label]}),oo[j.state].note&&l.jsx("span",{className:"ws-note",children:oo[j.state].note})]}),l.jsx("div",{className:"ws-root",title:j.root,children:j.rootLabel??l.jsx("span",{className:"ws-dim",children:"no root recorded (started by an older version)"})}),l.jsxs("div",{className:"ws-meta",children:[j.state!=="missing"&&j.state!=="orphaned"&&l.jsx("span",{children:j.url.replace(/^https?:\/\//,"")}),j.counts&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{children:[j.counts.agents," agents"]}),l.jsxs("span",{children:[j.counts.workflows," workflows"]}),l.jsxs("span",{children:[j.counts.runs," runs"]}),l.jsxs("span",{children:[j.counts.chats," chats"]})]}),j.lastStarted&&l.jsxs("span",{title:j.lastStarted,children:["started ",yi(j.lastStarted)]}),!j.live&&j.lastStopped&&l.jsxs("span",{title:j.lastStopped,children:["stopped ",yi(j.lastStopped)]}),j.startCount!=null&&l.jsxs("span",{children:[j.startCount,"× launched"]}),j.firstSeen&&l.jsxs("span",{title:j.firstSeen,children:["first seen ",yi(j.firstSeen)]})]}),m[K]&&l.jsx("div",{className:"settings-err",children:m[K]})]}),l.jsxs("div",{className:"ws-actions",children:[j.live&&!j.current&&l.jsxs("a",{className:"ws-btn",href:j.url,title:"Open this workspace",children:[l.jsx(V,{name:"open_in_new",className:"ms-sm"})," open"]}),!j.live&&j.root&&j.exists!==!1&&!j.dirGone&&l.jsxs("button",{className:"ws-btn primary",disabled:!!$,onClick:()=>{N(j,"start")},children:[l.jsx(V,{name:$==="start"?"progress_activity":"play_arrow",className:"ms-sm"}),$==="start"?"starting…":"start"]}),j.live&&!j.current&&l.jsxs("button",{className:"ws-btn danger",disabled:!!$,onClick:()=>{N(j,"stop")},children:[l.jsx(V,{name:$==="stop"?"progress_activity":"stop",className:"ms-sm"}),$==="stop"?"stopping…":"stop"]}),w&&y!==K&&l.jsxs("button",{className:"ws-btn",disabled:!!$,title:"Drop this project from the registry (files untouched)",onClick:()=>x(K),children:[l.jsx(V,{name:"delete",className:"ms-sm"})," remove"]}),w&&y===K&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"ws-btn danger",onClick:()=>{N(j,"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 Ob(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 Db=[[/^(\+\+\+|---|diff |index )/,"d-meta"],[/^@@/,"d-hunk"],[/^\+/,"d-add"],[/^-/,"d-del"]],Mb=i=>Db.find(([c])=>c.test(i))?.[1]??"";function Ub({file:i}){const[c,o]=E.useState(null),[u,f]=E.useState(!1),[h,m]=E.useState("");return E.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:Mb(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 Lb(){const[i,c]=E.useState(null),[o,u]=E.useState(new Set),[f,h]=E.useState(new Set),[m,p]=E.useState(""),[y,x]=E.useState(""),[T,_]=E.useState(""),[N,U]=E.useState(""),j=E.useCallback(async()=>{try{const Z=await fetch("/api/git",{cache:"no-store"});Z.ok&&c(await Z.json())}catch{}},[]);E.useEffect(()=>{let Z=!0,J;const R=async()=>{await j(),Z&&(J=setTimeout(R,6e3))};return R(),()=>{Z=!1,clearTimeout(J)}},[j]),E.useEffect(()=>{if(!i?.files)return;const Z=new Set(i.files.filter(J=>J.syncable).map(J=>J.path));u(J=>{const R=new Set([...J].filter(M=>Z.has(M)));return R.size===J.size?J:R})},[i]);const K=async(Z,J)=>{x(Z),_(""),U("");try{const R=await go(`/api/git/${Z}`,J);R.ok?U(Z==="push"?"pushed":Z==="pull"?"pulled":"fetched"):_(R.error||`${Z} failed`)}catch(R){_(R.message||`${Z} failed`)}finally{x("")}j()},$=async()=>{x("commit"),_(""),U("");try{const Z=await go("/api/git/commit",{paths:[...o],message:m});Z.ok?(U(`committed ${o.size} file${o.size===1?"":"s"}`),u(new Set),p("")):_(Z.error||"commit failed")}catch(Z){_(Z.message||"commit failed")}finally{x("")}j()};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 w=(i.files??[]).filter(Z=>Z.syncable),P=(i.files??[]).filter(Z=>!Z.syncable),re=(Z,J)=>u(R=>{const M=new Set(R);return J?M.add(Z):M.delete(Z),M});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"}),N&&l.jsxs("span",{className:"settings-saved",children:[l.jsx(V,{name:"check",className:"ms-sm"})," ",N]}),T&&l.jsx("span",{className:"settings-err",children:T})]}),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:w.length===0?"workspace clean":`${o.size} of ${w.length} selected`})]}),w.length===0&&P.length===0&&l.jsx("div",{className:"ws-empty",children:"Nothing changed under the workspace paths."}),w.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:J=>re(Z.path,J.target.checked)})}),l.jsxs("button",{className:"git-file",onClick:()=>h(J=>{const R=new Set(J);return R.has(Z.path)?R.delete(Z.path):R.add(Z.path),R}),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(Ub,{file:Z.path})]},Z.path)),w.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&&$()}}),l.jsx("button",{className:"ws-btn",disabled:o.size===w.length,onClick:()=>u(new Set(w.map(Z=>Z.path))),children:"select all"}),l.jsxs("button",{className:"ws-btn primary",disabled:!!y||o.size===0||!m.trim(),onClick:()=>{$()},children:[l.jsx(V,{name:y==="commit"?"progress_activity":"check",className:"ms-sm"}),"commit ",o.size||""]})]}),P.length>0&&l.jsxs("details",{className:"git-blocked",children:[l.jsxs("summary",{children:[P.length,i.blockedHidden?"+":""," change",P.length===1&&!i.blockedHidden?"":"s"," outside the workspace paths"]}),P.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,J)=>l.jsxs("span",{children:[J>0&&", ",l.jsx("code",{children:Z})]},Z)),". Run artifacts and files like ",l.jsx("code",{children:".env"})," are never staged."," ",i.interval?`Fetches every ${Ob(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 Hb=40,Bb=/Mac|iPhone|iPad/.test(navigator.platform);let fo=null;const qb=i=>(i?.workspaces??[]).flatMap(c=>c.agents.map(o=>({agent:o,ws:c,key:`${c.url}|${o.slug}`})));function $b(i,c){const o=c.toLowerCase().split(/\s+/).filter(Boolean);if(o.length===0)return i;const u=[];for(const f of i){const h=f.agent.name.toLowerCase(),m=[h,f.agent.slug,f.agent.description??"",f.agent.group??"",f.ws.name].join(" ").toLowerCase();if(!o.every(y=>m.includes(y)))continue;const p=h.startsWith(o[0])?0:h.includes(o[0])?1:2;u.push({hit:f,score:p})}return u.sort((f,h)=>f.score-h.score).map(f=>f.hit)}async function sp(i){const c=`/agents/${encodeURIComponent(i.agent.slug)}`;if(i.ws.current)return tn(c);const o=i.ws.live||!i.ws.root?i.ws.url:await cp(i.ws.root);window.location.assign(`${o.replace(/\/+$/,"")}/#${c}`)}function Gb(){const[i,c]=E.useState(!1);return E.useEffect(()=>{const o=u=>{(u.metaKey||u.ctrlKey)&&!u.altKey&&!u.shiftKey&&u.key.toLowerCase()==="k"&&(u.preventDefault(),c(f=>!f))};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[]),l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"search-btn",onClick:()=>c(!0),title:"jump to an agent","aria-label":"search agents",children:[l.jsx(V,{name:"search"}),l.jsx("kbd",{className:"kbd",children:Bb?"⌘K":"Ctrl K"})]}),i&&l.jsx(Yb,{onClose:()=>c(!1)})]})}function Yb({onClose:i}){const[c,o]=E.useState(fo),[u,f]=E.useState(fo===null),[h,m]=E.useState(!1),[p,y]=E.useState(""),[x,T]=E.useState(0),[_,N]=E.useState(null),[U,j]=E.useState(""),K=E.useRef(null);E.useEffect(()=>{let R=!0;return fetch("/api/search/agents",{cache:"no-store"}).then(M=>M.ok?M.json():Promise.reject(new Error(String(M.status)))).then(M=>{fo=M,R&&o(M)}).catch(()=>R&&m(!0)).finally(()=>R&&f(!1)),()=>{R=!1}},[]);const $=E.useMemo(()=>qb(c),[c]),w=E.useMemo(()=>$b($,p).slice(0,Hb),[$,p]),P=Math.min(x,Math.max(w.length-1,0));E.useEffect(()=>{K.current?.children[P]?.scrollIntoView({block:"nearest"})},[P,w]);const re=R=>{if(!_){if(R.ws.current||R.ws.live){i(),sp(R);return}N(R.key),j(""),sp(R).catch(M=>{N(null),j(`${R.ws.name}: ${M.message}`)})}},Z=R=>{if(R.key==="ArrowDown")R.preventDefault(),T(w.length?(P+1)%w.length:0);else if(R.key==="ArrowUp")R.preventDefault(),T(w.length?(P-1+w.length)%w.length:0);else if(R.key==="Enter"){R.preventDefault();const M=w[P];M&&re(M)}else R.key==="Escape"&&(R.preventDefault(),i())};let J;return w.length>0?J=l.jsx("ul",{className:"palette-list",role:"listbox","aria-label":"agents",ref:K,children:w.map((R,M)=>l.jsxs("li",{role:"option","aria-selected":M===P,className:`palette-item${M===P?" active":""}`,onMouseMove:()=>M!==P&&T(M),onClick:()=>re(R),children:[l.jsx("span",{className:"palette-emoji","aria-hidden":!0,children:R.agent.emoji}),l.jsxs("span",{className:"palette-text",children:[l.jsx("span",{className:"palette-name",children:R.agent.name}),R.agent.description&&l.jsx("span",{className:"palette-sub",children:R.agent.description})]}),l.jsxs("span",{className:"palette-ws",title:R.ws.current?"this workspace":R.ws.url,children:[R.ws.icon&&l.jsx("span",{"aria-hidden":!0,children:R.ws.icon}),R.ws.name,_===R.key?l.jsx(V,{name:"progress_activity",className:"ms-sm"}):R.ws.live?!R.ws.current&&l.jsx(V,{name:"open_in_new",className:"ms-sm"}):l.jsx("span",{className:"palette-chip",children:"stopped"})]})]},R.key))}):h?J=l.jsx("div",{className:"palette-empty",children:"could not load the agents"}):u?J=l.jsx("div",{className:"palette-empty",children:"looking for agents…"}):$.length===0?J=l.jsxs("div",{className:"palette-empty",children:["no agents yet — ",l.jsx("a",{href:"#/agents/new",onClick:i,children:"create one"})]}):J=l.jsxs("div",{className:"palette-empty",children:["no agent matches “",p,"”"]}),l.jsx("div",{className:"palette-backdrop",onMouseDown:i,children:l.jsxs("div",{className:"palette",role:"dialog","aria-label":"jump to an agent",onMouseDown:R=>R.stopPropagation(),onKeyDown:Z,children:[l.jsxs("div",{className:"palette-input",children:[l.jsx(V,{name:"search"}),l.jsx("input",{autoFocus:!0,value:p,onChange:R=>{y(R.target.value),T(0)},placeholder:"jump to an agent…","aria-label":"search agents",autoComplete:"off",spellCheck:!1}),u&&c&&l.jsx(V,{name:"progress_activity",className:"ms-sm"}),l.jsx("kbd",{className:"kbd",children:"esc"})]}),J,l.jsxs("div",{className:"palette-foot",children:[l.jsxs("span",{children:[l.jsx("kbd",{className:"kbd",children:"↑"}),l.jsx("kbd",{className:"kbd",children:"↓"})," move"]}),l.jsxs("span",{children:[l.jsx("kbd",{className:"kbd",children:"↵"})," open"]}),_&&l.jsxs("span",{className:"palette-note",children:[l.jsx(V,{name:"progress_activity",className:"ms-sm"})," starting the workspace…"]}),U&&l.jsxs("span",{className:"palette-warn",title:U,children:[l.jsx(V,{name:"warning",className:"ms-sm"})," ",U]})]})]})})}const Xb=E.lazy(()=>Qx(()=>import("./editor-7ImnDC3D.js").then(i=>i.w),__vite__mapDeps([0,1])).then(i=>({default:i.EditorScreen})));function Qb(){const c=Zx().split("/").filter(Boolean),[o,u]=E.useState(""),[f,h]=E.useState(""),[m,p]=E.useState(""),[y,x]=E.useState(!1),[T,_]=E.useState([]);E.useEffect(()=>{let U=!0,j;const K=async()=>{try{const w=await fetch("/api/meta",{cache:"no-store"}).then(P=>P.json());if(!U)return;u(w.projectName??""),h(w.projectIcon??""),p(w.projectRootLabel??""),x(!!w.git),_(Array.isArray(w.switcher)?w.switcher:[])}catch{}U&&(j=setTimeout(K,3e4))};K();const $=()=>{clearTimeout(j),K()};return window.addEventListener("kw-meta-refresh",$),()=>{U=!1,clearTimeout(j),window.removeEventListener("kw-meta-refresh",$)}},[]),E.useEffect(()=>{if(Vx(o?`${o} — kraftwerk`:"kraftwerk inspector"),!f)return;const U=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="0.9em" font-size="85">${f}</text></svg>`;let j=document.querySelector('link[rel="icon"]');j||(j=document.createElement("link"),j.rel="icon",document.head.appendChild(j)),j.href=`data:image/svg+xml,${encodeURIComponent(U)}`},[o,f]);let N;return c[0]==="runs"&&c[1]?N=l.jsx(My,{id:c[1]}):c[0]==="runs"?N=l.jsx(Jb,{}):c[0]==="workflows"&&c[1]?N=l.jsx(Vy,{slug:decodeURIComponent(c[1])}):c[0]==="workflows"?N=l.jsx(Zy,{}):c[0]==="chats"?N=l.jsx(tp,{seg:c}):c[0]==="skills"?N=l.jsx(vb,{name:c[1]?decodeURIComponent(c[1]):void 0}):c[0]==="settings"?N=l.jsx(Rb,{}):c[0]==="workspaces"?N=l.jsx(zb,{}):c[0]==="git"?N=l.jsx(Lb,{}):c[0]==="agents"||c[0]==="team"?N=l.jsx(tp,{seg:c.slice(1)}):c[0]==="knowledge"?N=l.jsx(rb,{bundle:c[1]?decodeURIComponent(c[1]):void 0,conceptId:c.length>2?c.slice(2).map(decodeURIComponent).join("/"):void 0}):N=l.jsx(eb,{}),c[0]==="edit"&&c[1]&&c.length>2?l.jsx(E.Suspense,{fallback:l.jsx("div",{className:"empty",children:"loading editor…"}),children:l.jsx(Xb,{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(Kb,{name:o,icon:f,root:m,entries:T})]}),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(Zb,{})]}),l.jsx("span",{className:"spacer"}),l.jsx(Gb,{}),l.jsx(Ib,{}),l.jsx(Fb,{}),l.jsx(Wb,{})]}),l.jsx("main",{className:"shell",children:N})]})}function Zb(){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 No({label:i}){return!qn()||!i?null:l.jsx("span",{className:"switcher-root",title:i,children:l.jsx("span",{dir:"ltr",children:i})})}function Vb({entry:i}){const[c,o]=E.useState("idle"),[u,f]=E.useState(""),h=i.exists===!1,m=async()=>{o("starting"),f("");try{window.location.assign(await cp(i.root))}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(No,{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 Kb({name:i,icon:c,root:o,entries:u}){const[f,h]=E.useState(!1),m=qn();return E.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(No,{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(Vb,{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(No,{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 Jb(){const[i,c]=E.useState(null);return E.useEffect(()=>{let o=!0;return fetch("/api/runs").then(u=>u.json()).then(u=>{o&&(u.runs.length>0?tn(`/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 Ib(){const[i,c]=E.useState(null),[o,u]=E.useState(!1);E.useEffect(()=>{let m=!0,p;const y=async()=>{try{const x=await fetch("/api/meta",{cache:"no-store"}).then(T=>T.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 Fb(){const i=qn();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:()=>Kx(!i),children:[l.jsx("span",{className:"expert-track",children:l.jsx("span",{className:"expert-knob"})}),"expert"]})}function Wb(){const[i,c]=E.useState(!1),[o,u]=E.useState(null),[f,h]=E.useState(null),[m,p]=E.useState("");E.useEffect(()=>{if(!i)return;fetch("/api/runs").then(T=>T.json()).then(u).catch(()=>{}),fetch("/api/workflows").then(T=>T.json()).then(h).catch(()=>{}),fetch("/api/meta").then(T=>T.json()).then(T=>p(T.version)).catch(()=>{});const x=T=>{T.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(tj,{})]}),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(ej,{})]})]})]})}function Pb(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 ej(){const[i,c]=E.useState("idle"),[o,u]=E.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?Pb(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 tj(){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"})}Gx.createRoot(document.getElementById("root")).render(l.jsx(E.StrictMode,{children:l.jsx(Qb,{})}));export{V as I,Mx as R,Qx as _,Bx as a,nj as b,Rx as g,l as j,tn as n,E as r,km as s};
|