@netnodeag/kraftwerk 0.35.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +65 -20
  2. package/dist/cli/doctor.js +18 -1
  3. package/dist/cli/init.js +19 -12
  4. package/dist/cli/kraftwerk.js +3 -0
  5. package/dist/cli/projects.d.ts +14 -0
  6. package/dist/cli/projects.js +1 -1
  7. package/dist/cli/repos.d.ts +2 -0
  8. package/dist/cli/repos.js +115 -0
  9. package/dist/cli/routines.d.ts +10 -0
  10. package/dist/cli/routines.js +10 -10
  11. package/dist/config.d.ts +29 -2
  12. package/dist/config.js +56 -2
  13. package/dist/inspector/{team.d.ts → agents.d.ts} +21 -12
  14. package/dist/inspector/{team.js → agents.js} +34 -19
  15. package/dist/inspector/chat/backend.d.ts +1 -1
  16. package/dist/inspector/chat/sessions.js +72 -45
  17. package/dist/inspector/chat/store.js +13 -1
  18. package/dist/inspector/chat/types.d.ts +2 -2
  19. package/dist/inspector/git.d.ts +14 -0
  20. package/dist/inspector/git.js +11 -9
  21. package/dist/inspector/instances.d.ts +12 -0
  22. package/dist/inspector/instances.js +28 -0
  23. package/dist/inspector/repos.d.ts +118 -0
  24. package/dist/inspector/repos.js +249 -0
  25. package/dist/inspector/routines.d.ts +4 -4
  26. package/dist/inspector/routines.js +11 -11
  27. package/dist/inspector/search.d.ts +25 -0
  28. package/dist/inspector/search.js +31 -0
  29. package/dist/inspector/server.js +77 -30
  30. package/dist/inspector/settings.d.ts +7 -1
  31. package/dist/inspector/settings.js +32 -1
  32. package/dist/inspector/skills.d.ts +6 -6
  33. package/dist/inspector/skills.js +8 -8
  34. package/inspector/dist/assets/{editor-BABv2LmA.js → editor-vM6JSj5h.js} +3 -3
  35. package/inspector/dist/assets/{index-CCACy6uF.js → index-BAAjszPI.js} +1 -1
  36. package/inspector/dist/assets/{index-DuwmzZAr.js → index-BKcOp35r.js} +1 -1
  37. package/inspector/dist/assets/index-Ba8VU6Wz.js +217 -0
  38. package/inspector/dist/assets/{index-Ca9Qs5LZ.js → index-Bb08wK-l.js} +1 -1
  39. package/inspector/dist/assets/{index-ByWpqzAI.js → index-BrCwDkJZ.js} +1 -1
  40. package/inspector/dist/assets/{index-hkVov8T4.js → index-Bs1U0rWW.js} +1 -1
  41. package/inspector/dist/assets/{index-CdwTmXTV.js → index-C1UXlW32.js} +1 -1
  42. package/inspector/dist/assets/{index-HBdsdJhD.js → index-CQ2XKqmD.js} +1 -1
  43. package/inspector/dist/assets/{index-DCR7u4Xa.js → index-CReepirH.js} +1 -1
  44. package/inspector/dist/assets/{index-CzPQygR7.js → index-CUGfxoYt.js} +1 -1
  45. package/inspector/dist/assets/{index-sLxulPOm.js → index-CaKmxcD6.js} +1 -1
  46. package/inspector/dist/assets/{index-Bmm4zJNU.js → index-CtMGH62C.js} +1 -1
  47. package/inspector/dist/assets/{index-BXspF2KR.css → index-D4_mLTSH.css} +1 -1
  48. package/inspector/dist/assets/{index-BbTer62d.js → index-D_11IZBV.js} +1 -1
  49. package/inspector/dist/assets/{index-wkYwz0Tl.js → index-DfZT0IoM.js} +1 -1
  50. package/inspector/dist/assets/{index-Gx93brFq.js → index-DykDNrYm.js} +1 -1
  51. package/inspector/dist/assets/{index-DuPp3MUc.js → index-MWv5H1oP.js} +1 -1
  52. package/inspector/dist/assets/{index-CjlJeW9z.js → index-oIQqfbwm.js} +1 -1
  53. package/inspector/dist/assets/{index-DbWUNbt-.js → index-yGZsomcy.js} +1 -1
  54. package/inspector/dist/index.html +2 -2
  55. package/package.json +1 -1
  56. package/schema/kraftwerk.schema.json +15 -0
  57. 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-vM6JSj5h.js","assets/editor-9rr2cQaW.css"])))=>i.map(i=>d[i]);
2
+ function Ox(s,c){for(var u=0;u<c.length;u++){const o=c[u];if(typeof o!="string"&&!Array.isArray(o)){for(const d in o)if(d!=="default"&&!(d in s)){const h=Object.getOwnPropertyDescriptor(o,d);h&&Object.defineProperty(s,d,h.get?h:{enumerable:!0,get:()=>o[d]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function u(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(d){if(d.ep)return;d.ep=!0;const h=u(d);fetch(d.href,h)}})();function Dx(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Po={exports:{}},di={};var mm;function Mx(){if(mm)return di;mm=1;var s=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(o,d,h){var m=null;if(h!==void 0&&(m=""+h),d.key!==void 0&&(m=""+d.key),"key"in d){h={};for(var p in d)p!=="key"&&(h[p]=d[p])}else h=d;return d=h.ref,{$$typeof:s,type:o,key:m,ref:d!==void 0?d:null,props:h}}return di.Fragment=c,di.jsx=u,di.jsxs=u,di}var pm;function Ux(){return pm||(pm=1,Po.exports=Mx()),Po.exports}var l=Ux(),eu={exports:{}},xe={};var gm;function Lx(){if(gm)return xe;gm=1;var s=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),N=Symbol.iterator;function U(T){return T===null||typeof T!="object"?null:(T=N&&T[N]||T["@@iterator"],typeof T=="function"?T:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},J=Object.assign,H={};function E(T,X,le){this.props=T,this.context=X,this.refs=H,this.updater=le||b}E.prototype.isReactComponent={},E.prototype.setState=function(T,X){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,X,"setState")},E.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function te(){}te.prototype=E.prototype;function ie(T,X,le){this.props=T,this.context=X,this.refs=H,this.updater=le||b}var Y=ie.prototype=new te;Y.constructor=ie,J(Y,E.prototype),Y.isPureReactComponent=!0;var F=Array.isArray;function R(){}var V={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function L(T,X,le){var ee=le.ref;return{$$typeof:s,type:T,key:X,ref:ee!==void 0?ee:null,props:le}}function I(T,X){return L(T.type,X,T.props)}function ce(T){return typeof T=="object"&&T!==null&&T.$$typeof===s}function W(T){var X={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(le){return X[le]})}var he=/\/+/g;function Le(T,X){return typeof T=="object"&&T!==null&&T.key!=null?W(""+T.key):X.toString(36)}function at(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(R,R):(T.status="pending",T.then(function(X){T.status==="pending"&&(T.status="fulfilled",T.value=X)},function(X){T.status==="pending"&&(T.status="rejected",T.reason=X)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function $(T,X,le,ee,ge){var ve=typeof T;(ve==="undefined"||ve==="boolean")&&(T=null);var _e=!1;if(T===null)_e=!0;else switch(ve){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(T.$$typeof){case s:case c:_e=!0;break;case k:return _e=T._init,$(_e(T._payload),X,le,ee,ge)}}if(_e)return ge=ge(T),_e=ee===""?"."+Le(T,0):ee,F(ge)?(le="",_e!=null&&(le=_e.replace(he,"$&/")+"/"),$(ge,X,le,"",function(Re){return Re})):ge!=null&&(ce(ge)&&(ge=I(ge,le+(ge.key==null||T&&T.key===ge.key?"":(""+ge.key).replace(he,"$&/")+"/")+_e)),X.push(ge)),1;_e=0;var mt=ee===""?".":ee+":";if(F(T))for(var G=0;G<T.length;G++)ee=T[G],ve=mt+Le(ee,G),_e+=$(ee,X,le,ve,ge);else if(G=U(T),typeof G=="function")for(T=G.call(T),G=0;!(ee=T.next()).done;)ee=ee.value,ve=mt+Le(ee,G++),_e+=$(ee,X,le,ve,ge);else if(ve==="object"){if(typeof T.then=="function")return $(at(T),X,le,ee,ge);throw X=String(T),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return _e}function ne(T,X,le){if(T==null)return T;var ee=[],ge=0;return $(T,ee,"","",function(ve){return X.call(le,ve,ge++)}),ee}function de(T){if(T._status===-1){var X=T._result;X=X(),X.then(function(le){(T._status===0||T._status===-1)&&(T._status=1,T._result=le)},function(le){(T._status===0||T._status===-1)&&(T._status=2,T._result=le)}),T._status===-1&&(T._status=0,T._result=X)}if(T._status===1)return T._result.default;throw T._result}var Ce=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},be={map:ne,forEach:function(T,X,le){ne(T,function(){X.apply(this,arguments)},le)},count:function(T){var X=0;return ne(T,function(){X++}),X},toArray:function(T){return ne(T,function(X){return X})||[]},only:function(T){if(!ce(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return xe.Activity=_,xe.Children=be,xe.Component=E,xe.Fragment=u,xe.Profiler=d,xe.PureComponent=ie,xe.StrictMode=o,xe.Suspense=y,xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,xe.__COMPILER_RUNTIME={__proto__:null,c:function(T){return V.H.useMemoCache(T)}},xe.cache=function(T){return function(){return T.apply(null,arguments)}},xe.cacheSignal=function(){return null},xe.cloneElement=function(T,X,le){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var ee=J({},T.props),ge=T.key;if(X!=null)for(ve in X.key!==void 0&&(ge=""+X.key),X)!ae.call(X,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&X.ref===void 0||(ee[ve]=X[ve]);var ve=arguments.length-2;if(ve===1)ee.children=le;else if(1<ve){for(var _e=Array(ve),mt=0;mt<ve;mt++)_e[mt]=arguments[mt+2];ee.children=_e}return L(T.type,ge,ee)},xe.createContext=function(T){return T={$$typeof:m,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:h,_context:T},T},xe.createElement=function(T,X,le){var ee,ge={},ve=null;if(X!=null)for(ee in X.key!==void 0&&(ve=""+X.key),X)ae.call(X,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ge[ee]=X[ee]);var _e=arguments.length-2;if(_e===1)ge.children=le;else if(1<_e){for(var mt=Array(_e),G=0;G<_e;G++)mt[G]=arguments[G+2];ge.children=mt}if(T&&T.defaultProps)for(ee in _e=T.defaultProps,_e)ge[ee]===void 0&&(ge[ee]=_e[ee]);return L(T,ve,ge)},xe.createRef=function(){return{current:null}},xe.forwardRef=function(T){return{$$typeof:p,render:T}},xe.isValidElement=ce,xe.lazy=function(T){return{$$typeof:k,_payload:{_status:-1,_result:T},_init:de}},xe.memo=function(T,X){return{$$typeof:x,type:T,compare:X===void 0?null:X}},xe.startTransition=function(T){var X=V.T,le={};V.T=le;try{var ee=T(),ge=V.S;ge!==null&&ge(le,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(R,Ce)}catch(ve){Ce(ve)}finally{X!==null&&le.types!==null&&(X.types=le.types),V.T=X}},xe.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},xe.use=function(T){return V.H.use(T)},xe.useActionState=function(T,X,le){return V.H.useActionState(T,X,le)},xe.useCallback=function(T,X){return V.H.useCallback(T,X)},xe.useContext=function(T){return V.H.useContext(T)},xe.useDebugValue=function(){},xe.useDeferredValue=function(T,X){return V.H.useDeferredValue(T,X)},xe.useEffect=function(T,X){return V.H.useEffect(T,X)},xe.useEffectEvent=function(T){return V.H.useEffectEvent(T)},xe.useId=function(){return V.H.useId()},xe.useImperativeHandle=function(T,X,le){return V.H.useImperativeHandle(T,X,le)},xe.useInsertionEffect=function(T,X){return V.H.useInsertionEffect(T,X)},xe.useLayoutEffect=function(T,X){return V.H.useLayoutEffect(T,X)},xe.useMemo=function(T,X){return V.H.useMemo(T,X)},xe.useOptimistic=function(T,X){return V.H.useOptimistic(T,X)},xe.useReducer=function(T,X,le){return V.H.useReducer(T,X,le)},xe.useRef=function(T){return V.H.useRef(T)},xe.useState=function(T){return V.H.useState(T)},xe.useSyncExternalStore=function(T,X,le){return V.H.useSyncExternalStore(T,X,le)},xe.useTransition=function(){return V.H.useTransition()},xe.version="19.2.8",xe}var xm;function wu(){return xm||(xm=1,eu.exports=Lx()),eu.exports}var w=wu();const Hx=Dx(w),rb=Ox({__proto__:null,default:Hx},[w]);var tu={exports:{}},fi={},nu={exports:{}},au={};var vm;function $x(){return vm||(vm=1,(function(s){function c($,ne){var de=$.length;$.push(ne);e:for(;0<de;){var Ce=de-1>>>1,be=$[Ce];if(0<d(be,ne))$[Ce]=ne,$[de]=be,de=Ce;else break e}}function u($){return $.length===0?null:$[0]}function o($){if($.length===0)return null;var ne=$[0],de=$.pop();if(de!==ne){$[0]=de;e:for(var Ce=0,be=$.length,T=be>>>1;Ce<T;){var X=2*(Ce+1)-1,le=$[X],ee=X+1,ge=$[ee];if(0>d(le,de))ee<be&&0>d(ge,le)?($[Ce]=ge,$[ee]=de,Ce=ee):($[Ce]=le,$[X]=de,Ce=X);else if(ee<be&&0>d(ge,de))$[Ce]=ge,$[ee]=de,Ce=ee;else break e}}return ne}function d($,ne){var de=$.sortIndex-ne.sortIndex;return de!==0?de:$.id-ne.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;s.unstable_now=function(){return h.now()}}else{var m=Date,p=m.now();s.unstable_now=function(){return m.now()-p}}var y=[],x=[],k=1,_=null,N=3,U=!1,b=!1,J=!1,H=!1,E=typeof setTimeout=="function"?setTimeout:null,te=typeof clearTimeout=="function"?clearTimeout:null,ie=typeof setImmediate<"u"?setImmediate:null;function Y($){for(var ne=u(x);ne!==null;){if(ne.callback===null)o(x);else if(ne.startTime<=$)o(x),ne.sortIndex=ne.expirationTime,c(y,ne);else break;ne=u(x)}}function F($){if(J=!1,Y($),!b)if(u(y)!==null)b=!0,R||(R=!0,W());else{var ne=u(x);ne!==null&&at(F,ne.startTime-$)}}var R=!1,V=-1,ae=5,L=-1;function I(){return H?!0:!(s.unstable_now()-L<ae)}function ce(){if(H=!1,R){var $=s.unstable_now();L=$;var ne=!0;try{e:{b=!1,J&&(J=!1,te(V),V=-1),U=!0;var de=N;try{t:{for(Y($),_=u(y);_!==null&&!(_.expirationTime>$&&I());){var Ce=_.callback;if(typeof Ce=="function"){_.callback=null,N=_.priorityLevel;var be=Ce(_.expirationTime<=$);if($=s.unstable_now(),typeof be=="function"){_.callback=be,Y($),ne=!0;break t}_===u(y)&&o(y),Y($)}else o(y);_=u(y)}if(_!==null)ne=!0;else{var T=u(x);T!==null&&at(F,T.startTime-$),ne=!1}}break e}finally{_=null,N=de,U=!1}ne=void 0}}finally{ne?W():R=!1}}}var W;if(typeof ie=="function")W=function(){ie(ce)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,Le=he.port2;he.port1.onmessage=ce,W=function(){Le.postMessage(null)}}else W=function(){E(ce,0)};function at($,ne){V=E(function(){$(s.unstable_now())},ne)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function($){$.callback=null},s.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<$?Math.floor(1e3/$):5},s.unstable_getCurrentPriorityLevel=function(){return N},s.unstable_next=function($){switch(N){case 1:case 2:case 3:var ne=3;break;default:ne=N}var de=N;N=ne;try{return $()}finally{N=de}},s.unstable_requestPaint=function(){H=!0},s.unstable_runWithPriority=function($,ne){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var de=N;N=$;try{return ne()}finally{N=de}},s.unstable_scheduleCallback=function($,ne,de){var Ce=s.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?Ce+de:Ce):de=Ce,$){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=de+be,$={id:k++,callback:ne,priorityLevel:$,startTime:de,expirationTime:be,sortIndex:-1},de>Ce?($.sortIndex=de,c(x,$),u(y)===null&&$===u(x)&&(J?(te(V),V=-1):J=!0,at(F,de-Ce))):($.sortIndex=be,c(y,$),b||U||(b=!0,R||(R=!0,W()))),$},s.unstable_shouldYield=I,s.unstable_wrapCallback=function($){var ne=N;return function(){var de=N;N=ne;try{return $.apply(this,arguments)}finally{N=de}}}})(au)),au}var ym;function Bx(){return ym||(ym=1,nu.exports=$x()),nu.exports}var lu={exports:{}},Rt={};var jm;function qx(){if(jm)return Rt;jm=1;var s=wu();function c(y){var x="https://react.dev/errors/"+y;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)x+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+y+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(c(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},d=Symbol.for("react.portal");function h(y,x,k){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:_==null?null:""+_,children:y,containerInfo:x,implementation:k}}var m=s.__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=o,Rt.createPortal=function(y,x){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(c(299));return h(y,x,null,k)},Rt.flushSync=function(y){var x=m.T,k=o.p;try{if(m.T=null,o.p=2,y)return y()}finally{m.T=x,o.p=k,o.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,o.d.C(y,x))},Rt.prefetchDNS=function(y){typeof y=="string"&&o.d.D(y)},Rt.preinit=function(y,x){if(typeof y=="string"&&x&&typeof x.as=="string"){var k=x.as,_=p(k,x.crossOrigin),N=typeof x.integrity=="string"?x.integrity:void 0,U=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;k==="style"?o.d.S(y,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:_,integrity:N,fetchPriority:U}):k==="script"&&o.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 k=p(x.as,x.crossOrigin);o.d.M(y,{crossOrigin:k,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&o.d.M(y)},Rt.preload=function(y,x){if(typeof y=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var k=x.as,_=p(k,x.crossOrigin);o.d.L(y,k,{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 k=p(x.as,x.crossOrigin);o.d.m(y,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:k,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else o.d.m(y)},Rt.requestFormReset=function(y){o.d.r(y)},Rt.unstable_batchedUpdates=function(y,x){return y(x)},Rt.useFormState=function(y,x,k){return m.H.useFormState(y,x,k)},Rt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Rt.version="19.2.8",Rt}var bm;function Gx(){if(bm)return lu.exports;bm=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(c){console.error(c)}}return s(),lu.exports=qx(),lu.exports}var Nm;function Yx(){if(Nm)return fi;Nm=1;var s=Bx(),c=wu(),u=Gx();function o(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 d(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(o(188))}function x(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,a=t;;){var i=n.return;if(i===null)break;var r=i.alternate;if(r===null){if(a=i.return,a!==null){n=a;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===n)return y(i),e;if(r===a)return y(i),t;r=r.sibling}throw Error(o(188))}if(n.return!==a.return)n=i,a=r;else{for(var f=!1,g=i.child;g;){if(g===n){f=!0,n=i,a=r;break}if(g===a){f=!0,a=i,n=r;break}g=g.sibling}if(!f){for(g=r.child;g;){if(g===n){f=!0,n=r,a=i;break}if(g===a){f=!0,a=r,n=i;break}g=g.sibling}if(!f)throw Error(o(189))}}if(n.alternate!==a)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function k(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=k(e),t!==null)return t;e=e.sibling}return null}var _=Object.assign,N=Symbol.for("react.element"),U=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),J=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),te=Symbol.for("react.consumer"),ie=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),ce=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=ce&&e[ce]||e["@@iterator"],typeof e=="function"?e:null)}var he=Symbol.for("react.client.reference");function Le(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case J:return"Fragment";case E:return"Profiler";case H:return"StrictMode";case F:return"Suspense";case R:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case b:return"Portal";case ie:return e.displayName||"Context";case te:return(e._context.displayName||"Context")+".Consumer";case Y:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:Le(e.type)||"Memo";case ae:t=e._payload,e=e._init;try{return Le(e(t))}catch{}}return null}var at=Array.isArray,$=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},Ce=[],be=-1;function T(e){return{current:e}}function X(e){0>be||(e.current=Ce[be],Ce[be]=null,be--)}function le(e,t){be++,Ce[be]=e.current,e.current=t}var ee=T(null),ge=T(null),ve=T(null),_e=T(null);function mt(e,t){switch(le(ve,t),le(ge,e),le(ee,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}}X(ee),le(ee,e)}function G(){X(ee),X(ge),X(ve)}function Re(e){e.memoizedState!==null&&le(_e,e);var t=ee.current,n=Hh(t,e.type);t!==n&&(le(ge,e),le(ee,n))}function Ye(e){ge.current===e&&(X(ee),X(ge)),_e.current===e&&(X(_e),ci._currentValue=de)}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 Xe(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 Z=function(){throw Error()};if(Object.defineProperty(Z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Z,[])}catch(M){var D=M}Reflect.construct(e,[],Z)}else{try{Z.call()}catch(M){D=M}e.call(Z.prototype)}}else{try{throw Error()}catch(M){D=M}(Z=e())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(M){if(M&&D&&typeof M.stack=="string")return[M.stack,D.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),f=r[0],g=r[1];if(f&&g){var j=f.split(`
5
+ `),O=g.split(`
6
+ `);for(i=a=0;a<j.length&&!j[a].includes("DetermineComponentFrameRoot");)a++;for(;i<O.length&&!O[i].includes("DetermineComponentFrameRoot");)i++;if(a===j.length||i===O.length)for(a=j.length-1,i=O.length-1;1<=a&&0<=i&&j[a]!==O[i];)i--;for(;1<=a&&0<=i;a--,i--)if(j[a]!==O[i]){if(a!==1||i!==1)do if(a--,i--,0>i||j[a]!==O[i]){var B=`
7
+ `+j[a].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=a&&0<=i);break}}}finally{Xa=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Oe(n):""}function ds(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 Xe(e.type,!1);case 11:return Xe(e.type.render,!1);case 1:return Xe(e.type,!0);case 31:return Oe("Activity");default:return""}}function Yt(e){try{var t="",n=null;do t+=ds(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
8
+ Error generating stack: `+a.message+`
9
+ `+a.stack}}var qn=Object.prototype.hasOwnProperty,jl=s.unstable_scheduleCallback,an=s.unstable_cancelCallback,wi=s.unstable_shouldYield,fs=s.unstable_requestPaint,At=s.unstable_now,Si=s.unstable_getCurrentPriorityLevel,vn=s.unstable_ImmediatePriority,Rn=s.unstable_UserBlockingPriority,ln=s.unstable_NormalPriority,hs=s.unstable_LowPriority,Qa=s.unstable_IdlePriority,bl=s.log,ms=s.unstable_setDisableYieldValue,sn=null,yt=null;function Xt(e){if(typeof bl=="function"&&ms(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(sn,e)}catch{}}var Ct=Math.clz32?Math.clz32:ps,ki=Math.log,Ti=Math.LN2;function ps(e){return e>>>=0,e===0?32:31-(ki(e)/Ti|0)|0}var ua=256,yn=262144,jn=4194304;function zn(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 i=0,r=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var g=a&134217727;return g!==0?(a=g&~r,a!==0?i=zn(a):(f&=g,f!==0?i=zn(f):n||(n=g&~e,n!==0&&(i=zn(n))))):(g=a&~r,g!==0?i=zn(g):f!==0?i=zn(f):n||(n=a&~e,n!==0&&(i=zn(n)))),i===0?0:t!==0&&t!==i&&(t&r)===0&&(r=i&-i,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:i}function da(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 gs(){var e=jn;return jn<<=1,(jn&62914560)===0&&(jn=4194304),e}function fa(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function On(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function cn(e,t,n,a,i,r){var f=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,j=e.expirationTimes,O=e.hiddenUpdates;for(n=f&~n;0<n;){var B=31-Ct(n),Z=1<<B;g[B]=0,j[B]=-1;var D=O[B];if(D!==null)for(O[B]=null,B=0;B<D.length;B++){var M=D[B];M!==null&&(M.lane&=-536870913)}n&=~Z}a!==0&&Gn(e,a,0),r!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=r&~(f&~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),i=1<<a;i&t|e[a]&t&&(e[a]|=t),n&=~i}}function wl(e,t){var n=t&-t;return n=(n&42)!==0?1:xs(n),(n&(e.suspendedLanes|t))!==0?0:n}function xs(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 Sl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function kl(){var e=ne.p;return e!==0?e:(e=window.event,e===void 0?32:cm(e.type))}function vs(e,t){var n=ne.p;try{return ne.p=e,t()}finally{ne.p=n}}var rn=Math.random().toString(36).slice(2),pt="__reactFiber$"+rn,it="__reactProps$"+rn,ha="__reactContainer$"+rn,ys="__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[ys],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(o(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,bn={};function Dn(e,t){Nn(e,t),Nn(e+"Capture",t)}function Nn(e,t){for(bn[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 qn.call(Ja,e)?!0:qn.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 on(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 i=a.get,r=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(f){n=""+f,r.call(this,f)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Mn(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 wt(e){return e.replace(Fc,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function js(e,t,n,a,i,r,f,g){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Nt(t)):e.value!==""+Nt(t)&&(e.value=""+Nt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Al(e,f,Nt(t)):n!=null?Al(e,f,Nt(n)):a!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="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,i,r,f,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)){Mn(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??i,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=g?e.checked:!!a,e.defaultChecked=!!a,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Mn(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 i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,a&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ns(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(o(92));if(at(a)){if(1<a.length)throw Error(o(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),Mn(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 ws(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(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 i in t)a=t[i],t.hasOwnProperty(i)&&n[i]!==a&&Oi(e,i,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"]]),P=/^[\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 P.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function A(){}var K=null;function se(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var re=null,me=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(js(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="'+wt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var i=a[it]||null;if(!i)throw Error(o(90));js(a,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&xa(a)}break e;case"textarea":Ns(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Zn(e,!!n.multiple,t,!1)}}}var Ke=!1;function St(e,t,n){if(Ke)return e(t,n);Ke=!0;try{var a=e(t);return a}finally{if(Ke=!1,(re!==null||me!==null)&&(jc(),re&&(t=re,e=me,me=re=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(o(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 ks={};Object.defineProperty(ks,"passive",{get:function(){gt=!0}}),window.addEventListener("test",ks,ks),window.removeEventListener("test",ks,ks)}catch{gt=!1}var ya=null,Pc=null,Di=null;function Lu(){if(Di)return Di;var e,t=Pc,n=t.length,a,i="value"in ya?ya.value:ya.textContent,r=i.length;for(e=0;e<n&&t[e]===i[e];e++);var f=n-e;for(a=1;a<=f&&t[n-a]===i[r-a];a++);return Di=i.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 Hu(){return!1}function Ut(e){function t(n,a,i,r,f){this._reactName=n,this._targetInst=i,this.type=a,this.nativeEvent=r,this.target=f,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:Hu,this.isPropagationStopped=Hu,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),Ts=_({},Fa,{view:0,detail:0}),Rp=Ut(Ts),er,tr,Es,Hi=_({},Ts,{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!==Es&&(Es&&e.type==="mousemove"?(er=e.screenX-Es.screenX,tr=e.screenY-Es.screenY):tr=er=0,Es=e),er)},movementY:function(e){return"movementY"in e?e.movementY:tr}}),$u=Ut(Hi),zp=_({},Hi,{dataTransfer:0}),Op=Ut(zp),Dp=_({},Ts,{relatedTarget:0}),nr=Ut(Dp),Mp=_({},Fa,{animationName:0,elapsedTime:0,pseudoElement:0}),Up=Ut(Mp),Lp=_({},Fa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hp=Ut(Lp),$p=_({},Fa,{data:0}),Bu=Ut($p),Bp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qp={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"},Gp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gp[e])?!!t[e]:!1}function ar(){return Yp}var Xp=_({},Ts,{key:function(e){if(e.key){var t=Bp[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"?qp[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}}),Qp=Ut(Xp),Zp=_({},Hi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qu=Ut(Zp),Vp=_({},Ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar}),Kp=Ut(Vp),Jp=_({},Fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ip=Ut(Jp),Fp=_({},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}),Wp=Ut(Fp),Pp=_({},Fa,{newState:0,oldState:0}),eg=Ut(Pp),tg=[9,13,27,32],lr=Qt&&"CompositionEvent"in window,_s=null;Qt&&"documentMode"in document&&(_s=document.documentMode);var ng=Qt&&"TextEvent"in window&&!_s,Gu=Qt&&(!lr||_s&&8<_s&&11>=_s),Yu=" ",Xu=!1;function Qu(e,t){switch(e){case"keyup":return tg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cl=!1;function ag(e,t){switch(e){case"compositionend":return Zu(t);case"keypress":return t.which!==32?null:(Xu=!0,Yu);case"textInput":return e=t.data,e===Yu&&Xu?null:e;default:return null}}function lg(e,t){if(Cl)return e==="compositionend"||!lr&&Qu(e,t)?(e=Lu(),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 Gu&&t.locale!=="ko"?null:t.data;default:return null}}var sg={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 Vu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!sg[e.type]:t==="textarea"}function Ku(e,t,n,a){re?me?me.push(a):me=[a]:re=a,t=Ec(t,"onChange"),0<t.length&&(n=new Li("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var As=null,Cs=null;function ig(e){Rh(e,0)}function $i(e){var t=Ka(e);if(xa(t))return e}function Ju(e,t){if(e==="change")return t}var Iu=!1;if(Qt){var sr;if(Qt){var ir="oninput"in document;if(!ir){var Fu=document.createElement("div");Fu.setAttribute("oninput","return;"),ir=typeof Fu.oninput=="function"}sr=ir}else sr=!1;Iu=sr&&(!document.documentMode||9<document.documentMode)}function Wu(){As&&(As.detachEvent("onpropertychange",Pu),Cs=As=null)}function Pu(e){if(e.propertyName==="value"&&$i(Cs)){var t=[];Ku(t,Cs,e,se(e)),St(ig,t)}}function cg(e,t,n){e==="focusin"?(Wu(),As=t,Cs=n,As.attachEvent("onpropertychange",Pu)):e==="focusout"&&Wu()}function rg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $i(Cs)}function og(e,t){if(e==="click")return $i(t)}function ug(e,t){if(e==="input"||e==="change")return $i(t)}function dg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:dg;function Rs(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 i=n[a];if(!qn.call(t,i)||!Zt(e[i],t[i]))return!1}return!0}function ed(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function td(e,t){var n=ed(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=ed(n)}}function nd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?nd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ad(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 fg=Qt&&"documentMode"in document&&11>=document.documentMode,Rl=null,rr=null,zs=null,or=!1;function ld(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;or||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}),zs&&Rs(zs,a)||(zs=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")},ur={},sd={};Qt&&(sd=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(ur[e])return ur[e];if(!zl[e])return e;var t=zl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in sd)return ur[e]=t[n];return e}var id=Pa("animationend"),cd=Pa("animationiteration"),rd=Pa("animationstart"),hg=Pa("transitionrun"),mg=Pa("transitionstart"),pg=Pa("transitioncancel"),od=Pa("transitionend"),ud=new Map,dr="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(" ");dr.push("scrollEnd");function wn(e,t){ud.set(e,t),Dn(t,[e])}var Bi=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)},un=[],Ol=0,fr=0;function qi(){for(var e=Ol,t=fr=Ol=0;t<e;){var n=un[t];un[t++]=null;var a=un[t];un[t++]=null;var i=un[t];un[t++]=null;var r=un[t];if(un[t++]=null,a!==null&&i!==null){var f=a.pending;f===null?i.next=i:(i.next=f.next,f.next=i),a.pending=i}r!==0&&dd(n,i,r)}}function Gi(e,t,n,a){un[Ol++]=e,un[Ol++]=t,un[Ol++]=n,un[Ol++]=a,fr|=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 dd(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var i=!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||(i=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,i&&t!==null&&(i=31-Ct(n),e=r.hiddenUpdates,a=e[i],a===null?e[i]=[t]:a.push(t),t.lane=n|536870912),r):null}function Yi(e){if(50<ei)throw ei=0,wo=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Dl={};function gg(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 gg(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 fd(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,i,r){var f=0;if(a=e,typeof e=="function")mr(e)&&(f=1);else if(typeof e=="string")f=bx(e,n,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case L:return e=Vt(31,n,t,i),e.elementType=L,e.lanes=r,e;case J:return tl(n.children,i,r,t);case H:f=8,i|=24;break;case E:return e=Vt(12,n,t,i|2),e.elementType=E,e.lanes=r,e;case F:return e=Vt(13,n,t,i),e.elementType=F,e.lanes=r,e;case R:return e=Vt(19,n,t,i),e.elementType=R,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ie:f=10;break e;case te:f=9;break e;case Y:f=11;break e;case V:f=14;break e;case ae:f=16,a=null;break e}f=29,n=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=Vt(f,n,t,i),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 hd(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 md=new WeakMap;function dn(e,t){if(typeof e=="object"&&e!==null){var n=md.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Yt(t)},md.set(e,t),t)}return{value:e,source:t,stack:Yt(t)}}var Ml=[],Ul=0,Qi=null,Os=0,fn=[],hn=0,ja=null,Un=1,Ln="";function Jn(e,t){Ml[Ul++]=Os,Ml[Ul++]=Qi,Qi=e,Os=t}function pd(e,t,n){fn[hn++]=Un,fn[hn++]=Ln,fn[hn++]=ja,ja=e;var a=Un;e=Ln;var i=32-Ct(a)-1;a&=~(1<<i),n+=1;var r=32-Ct(t)+i;if(30<r){var f=i-i%5;r=(a&(1<<f)-1).toString(32),a>>=f,i-=f,Un=1<<32-Ct(t)+i|n<<i|a,Ln=r+e}else Un=1<<r|n<<i|a,Ln=e}function xr(e){e.return!==null&&(Jn(e,1),pd(e,1,0))}function vr(e){for(;e===Qi;)Qi=Ml[--Ul],Ml[Ul]=null,Os=Ml[--Ul],Ml[Ul]=null;for(;e===ja;)ja=fn[--hn],fn[hn]=null,Ln=fn[--hn],fn[hn]=null,Un=fn[--hn],fn[hn]=null}function gd(e,t){fn[hn++]=Un,fn[hn++]=Ln,fn[hn++]=ja,Un=t.id,Ln=t.overflow,ja=e}var kt=null,Ie=null,Ae=!1,ba=null,mn=!1,yr=Error(o(519));function Na(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ds(dn(t,e)),yr}function xd(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[pt]=e,t[it]=a,n){case"dialog":we("cancel",t),we("close",t);break;case"iframe":case"object":case"embed":we("load",t);break;case"video":case"audio":for(n=0;n<ni.length;n++)we(ni[n],t);break;case"source":we("error",t);break;case"img":case"image":case"link":we("error",t),we("load",t);break;case"details":we("toggle",t);break;case"input":we("invalid",t),bs(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":we("invalid",t);break;case"textarea":we("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&&(we("beforetoggle",t),we("toggle",t)),a.onScroll!=null&&we("scroll",t),a.onScrollEnd!=null&&we("scrollend",t),a.onClick!=null&&(t.onclick=A),t=!0):t=!1,t||Na(e,!0)}function vd(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 vd(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")||Ho(e.type,e.memoizedProps)),n=!n),n&&Ie&&Na(e),vd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ie=Xh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ie=Xh(e)}else t===27?(t=Ie,Ua(e.type)?(e=Yo,Yo=null,Ie=e):Ie=t):Ie=kt?gn(e.stateNode.nextSibling):null;return!0}function nl(){Ie=kt=null,Ae=!1}function jr(){var e=ba;return e!==null&&(Bt===null?Bt=e:Bt.push.apply(Bt,e),ba=null),e}function Ds(e){ba===null?ba=[e]:ba.push(e)}var br=T(null),al=null,In=null;function wa(e,t,n){le(br,t._currentValue),t._currentValue=n}function Fn(e){e._currentValue=br.current,X(br)}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 wr(e,t,n,a){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var r=i.dependencies;if(r!==null){var f=i.child;r=r.firstContext;e:for(;r!==null;){var g=r;r=i;for(var j=0;j<t.length;j++)if(g.context===t[j]){r.lanes|=n,g=r.alternate,g!==null&&(g.lanes|=n),Nr(r.return,n,e),a||(f=null);break e}r=g.next}}else if(i.tag===18){if(f=i.return,f===null)throw Error(o(341));f.lanes|=n,r=f.alternate,r!==null&&(r.lanes|=n),Nr(f,n,e),f=null}else f=i.child;if(f!==null)f.return=i;else for(f=i;f!==null;){if(f===e){f=null;break}if(i=f.sibling,i!==null){i.return=f.return,f=i;break}f=f.return}i=f}}function Hl(e,t,n,a){e=null;for(var i=t,r=!1;i!==null;){if(!r){if((i.flags&524288)!==0)r=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var f=i.alternate;if(f===null)throw Error(o(387));if(f=f.memoizedProps,f!==null){var g=i.type;Zt(i.pendingProps.value,f.value)||(e!==null?e.push(g):e=[g])}}else if(i===_e.current){if(f=i.alternate,f===null)throw Error(o(387));f.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(ci):e=[ci])}i=i.return}e!==null&&wr(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 yd(al,e)}function Vi(e,t){return al===null&&ll(e),yd(e,t)}function yd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},In===null){if(e===null)throw Error(o(308));In=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else In=In.next=t;return n}var xg=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()})}},vg=s.unstable_scheduleCallback,yg=s.unstable_NormalPriority,ot={$$typeof:ie,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sr(){return{controller:new xg,data:new Map,refCount:0}}function Ms(e){e.refCount--,e.refCount===0&&vg(yg,function(){e.controller.abort()})}var Us=null,kr=0,$l=0,Bl=null;function jg(e,t){if(Us===null){var n=Us=[];kr=0,$l=Ao(),Bl={status:"pending",value:void 0,then:function(a){n.push(a)}}}return kr++,t.then(jd,jd),t}function jd(){if(--kr===0&&Us!==null){Bl!==null&&(Bl.status="fulfilled");var e=Us;Us=null,$l=0,Bl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function bg(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(a.status="rejected",a.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),a}var bd=$.S;$.S=function(e,t){sh=At(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&jg(e,t),bd!==null&&bd(e,t)};var sl=T(null);function Tr(){var e=sl.current;return e!==null?e:Je.pooledCache}function Ki(e,t){t===null?le(sl,sl.current):le(sl,t.pool)}function Nd(){var e=Tr();return e===null?null:{parent:ot._currentValue,pool:e}}var ql=Error(o(460)),Er=Error(o(474)),Ji=Error(o(542)),Ii={then:function(){}};function wd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Sd(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,Td(e),e;default:if(typeof t.status=="string")t.then(A,A);else{if(e=Je,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=a}},function(a){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Td(e),e}throw cl=t,ql}}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,ql):n}}var cl=null;function kd(){if(cl===null)throw Error(o(459));var e=cl;return cl=null,e}function Td(e){if(e===ql||e===Ji)throw Error(o(483))}var Gl=null,Ls=0;function Fi(e){var t=Ls;return Ls+=1,Gl===null&&(Gl=[]),Sd(Gl,e,t)}function Hs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Wi(e,t){throw t.$$typeof===N?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ed(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 i(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 f(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=i(S,z),S.return=C,S)}function j(C,S,z,q){var fe=z.type;return fe===J?B(C,S,z.props.children,q,z.key):S!==null&&(S.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ae&&il(fe)===S.type)?(S=i(S,z.props),Hs(S,z),S.return=C,S):(S=Xi(z.type,z.key,z.props,null,C.mode,q),Hs(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=i(S,z.children||[]),S.return=C,S)}function B(C,S,z,q,fe){return S===null||S.tag!==7?(S=tl(z,C.mode,q,fe),S.return=C,S):(S=i(S,z),S.return=C,S)}function Z(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),Hs(z,S),z.return=C,z;case b:return S=gr(S,C.mode,z),S.return=C,S;case ae:return S=il(S),Z(C,S,z)}if(at(S)||W(S))return S=tl(S,C.mode,z,null),S.return=C,S;if(typeof S.then=="function")return Z(C,Fi(S),z);if(S.$$typeof===ie)return Z(C,Vi(C,S),z);Wi(C,S)}return null}function D(C,S,z,q){var fe=S!==null?S.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return fe!==null?null:g(C,S,""+z,q);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case U:return z.key===fe?j(C,S,z,q):null;case b:return z.key===fe?O(C,S,z,q):null;case ae:return z=il(z),D(C,S,z,q)}if(at(z)||W(z))return fe!==null?null:B(C,S,z,q,null);if(typeof z.then=="function")return D(C,S,Fi(z),q);if(z.$$typeof===ie)return D(C,S,Vi(C,z),q);Wi(C,z)}return null}function M(C,S,z,q,fe){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return C=C.get(z)||null,g(S,C,""+q,fe);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case U:return C=C.get(q.key===null?z:q.key)||null,j(S,C,q,fe);case b:return C=C.get(q.key===null?z:q.key)||null,O(S,C,q,fe);case ae:return q=il(q),M(C,S,z,q,fe)}if(at(q)||W(q))return C=C.get(z)||null,B(S,C,q,fe,null);if(typeof q.then=="function")return M(C,S,z,Fi(q),fe);if(q.$$typeof===ie)return M(C,S,z,Vi(S,q),fe);Wi(S,q)}return null}function oe(C,S,z,q){for(var fe=null,Me=null,ue=S,je=S=0,Te=null;ue!==null&&je<z.length;je++){ue.index>je?(Te=ue,ue=null):Te=ue.sibling;var Ue=D(C,ue,z[je],q);if(Ue===null){ue===null&&(ue=Te);break}e&&ue&&Ue.alternate===null&&t(C,ue),S=r(Ue,S,je),Me===null?fe=Ue:Me.sibling=Ue,Me=Ue,ue=Te}if(je===z.length)return n(C,ue),Ae&&Jn(C,je),fe;if(ue===null){for(;je<z.length;je++)ue=Z(C,z[je],q),ue!==null&&(S=r(ue,S,je),Me===null?fe=ue:Me.sibling=ue,Me=ue);return Ae&&Jn(C,je),fe}for(ue=a(ue);je<z.length;je++)Te=M(ue,C,je,z[je],q),Te!==null&&(e&&Te.alternate!==null&&ue.delete(Te.key===null?je:Te.key),S=r(Te,S,je),Me===null?fe=Te:Me.sibling=Te,Me=Te);return e&&ue.forEach(function(qa){return t(C,qa)}),Ae&&Jn(C,je),fe}function pe(C,S,z,q){if(z==null)throw Error(o(151));for(var fe=null,Me=null,ue=S,je=S=0,Te=null,Ue=z.next();ue!==null&&!Ue.done;je++,Ue=z.next()){ue.index>je?(Te=ue,ue=null):Te=ue.sibling;var qa=D(C,ue,Ue.value,q);if(qa===null){ue===null&&(ue=Te);break}e&&ue&&qa.alternate===null&&t(C,ue),S=r(qa,S,je),Me===null?fe=qa:Me.sibling=qa,Me=qa,ue=Te}if(Ue.done)return n(C,ue),Ae&&Jn(C,je),fe;if(ue===null){for(;!Ue.done;je++,Ue=z.next())Ue=Z(C,Ue.value,q),Ue!==null&&(S=r(Ue,S,je),Me===null?fe=Ue:Me.sibling=Ue,Me=Ue);return Ae&&Jn(C,je),fe}for(ue=a(ue);!Ue.done;je++,Ue=z.next())Ue=M(ue,C,je,Ue.value,q),Ue!==null&&(e&&Ue.alternate!==null&&ue.delete(Ue.key===null?je:Ue.key),S=r(Ue,S,je),Me===null?fe=Ue:Me.sibling=Ue,Me=Ue);return e&&ue.forEach(function(zx){return t(C,zx)}),Ae&&Jn(C,je),fe}function Ve(C,S,z,q){if(typeof z=="object"&&z!==null&&z.type===J&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case U:e:{for(var fe=z.key;S!==null;){if(S.key===fe){if(fe=z.type,fe===J){if(S.tag===7){n(C,S.sibling),q=i(S,z.props.children),q.return=C,C=q;break e}}else if(S.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===ae&&il(fe)===S.type){n(C,S.sibling),q=i(S,z.props),Hs(q,z),q.return=C,C=q;break e}n(C,S);break}else t(C,S);S=S.sibling}z.type===J?(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),Hs(q,z),q.return=C,C=q)}return f(C);case b:e:{for(fe=z.key;S!==null;){if(S.key===fe)if(S.tag===4&&S.stateNode.containerInfo===z.containerInfo&&S.stateNode.implementation===z.implementation){n(C,S.sibling),q=i(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 f(C);case ae:return z=il(z),Ve(C,S,z,q)}if(at(z))return oe(C,S,z,q);if(W(z)){if(fe=W(z),typeof fe!="function")throw Error(o(150));return z=fe.call(z),pe(C,S,z,q)}if(typeof z.then=="function")return Ve(C,S,Fi(z),q);if(z.$$typeof===ie)return Ve(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=i(S,z),q.return=C,C=q):(n(C,S),q=pr(z,C.mode,q),q.return=C,C=q),f(C)):n(C,S)}return function(C,S,z,q){try{Ls=0;var fe=Ve(C,S,z,q);return Gl=null,fe}catch(ue){if(ue===ql||ue===Ji)throw ue;var Me=Vt(29,ue,null,C.mode);return Me.lanes=q,Me.return=C,Me}}}var rl=Ed(!0),_d=Ed(!1),Sa=!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,(He&2)!==0){var i=a.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),a.pending=t,t=Yi(e),dd(e,null,n),t}return Gi(e,a,t,n),Yi(e)}function $s(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 i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?i=r=f:r=r.next=f,n=n.next}while(n!==null);r===null?i=r=t:r=r.next=t}else i=r=t;n={baseState:a.baseState,firstBaseUpdate:i,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=Bl;if(e!==null)throw e}}function qs(e,t,n,a){Rr=!1;var i=e.updateQueue;Sa=!1;var r=i.firstBaseUpdate,f=i.lastBaseUpdate,g=i.shared.pending;if(g!==null){i.shared.pending=null;var j=g,O=j.next;j.next=null,f===null?r=O:f.next=O,f=j;var B=e.alternate;B!==null&&(B=B.updateQueue,g=B.lastBaseUpdate,g!==f&&(g===null?B.firstBaseUpdate=O:g.next=O,B.lastBaseUpdate=j))}if(r!==null){var Z=i.baseState;f=0,B=O=j=null,g=r;do{var D=g.lane&-536870913,M=D!==g.lane;if(M?(ke&D)===D:(a&D)===D){D!==0&&D===$l&&(Rr=!0),B!==null&&(B=B.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var oe=e,pe=g;D=t;var Ve=n;switch(pe.tag){case 1:if(oe=pe.payload,typeof oe=="function"){Z=oe.call(Ve,Z,D);break e}Z=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=pe.payload,D=typeof oe=="function"?oe.call(Ve,Z,D):oe,D==null)break e;Z=_({},Z,D);break e;case 2:Sa=!0}}D=g.callback,D!==null&&(e.flags|=64,M&&(e.flags|=8192),M=i.callbacks,M===null?i.callbacks=[D]:M.push(D))}else M={lane:D,tag:g.tag,payload:g.payload,callback:g.callback,next:null},B===null?(O=B=M,j=Z):B=B.next=M,f|=D;if(g=g.next,g===null){if(g=i.shared.pending,g===null)break;M=g,g=M.next,M.next=null,i.lastBaseUpdate=M,i.shared.pending=null}}while(!0);B===null&&(j=Z),i.baseState=j,i.firstBaseUpdate=O,i.lastBaseUpdate=B,r===null&&(i.shared.lanes=0),Ra|=f,e.lanes=f,e.memoizedState=Z}}function Ad(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Cd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ad(n[e],t)}var Yl=T(null),Pi=T(0);function Rd(e,t){e=ia,le(Pi,e),le(Yl,t),ia=e|t.baseLanes}function zr(){le(Pi,ia),le(Yl,Yl.current)}function Or(){ia=Pi.current,X(Yl),X(Pi)}var Kt=T(null),pn=null;function Ea(e){var t=e.alternate;le(lt,lt.current&1),le(Kt,e),pn===null&&(t===null||Yl.current!==null||t.memoizedState!==null)&&(pn=e)}function Dr(e){le(lt,lt.current),le(Kt,e),pn===null&&(pn=e)}function zd(e){e.tag===22?(le(lt,lt.current),le(Kt,e),pn===null&&(pn=e)):_a()}function _a(){le(lt,lt.current),le(Kt,Kt.current)}function Jt(e){X(Kt),pn===e&&(pn=null),X(lt)}var lt=T(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||qo(n)||Go(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,ye=null,Qe=null,ut=null,tc=!1,Xl=!1,ol=!1,nc=0,Gs=0,Ql=null,Ng=0;function tt(){throw Error(o(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,i,r){return Wn=r,ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$.H=e===null||e.memoizedState===null?gf:Fr,ol=!1,r=n(a,i),ol=!1,Xl&&(r=Dd(t,n,a,i)),Od(e),r}function Od(e){$.H=Qs;var t=Qe!==null&&Qe.next!==null;if(Wn=0,ut=Qe=ye=null,tc=!1,Gs=0,Ql=null,t)throw Error(o(300));e===null||dt||(e=e.dependencies,e!==null&&Zi(e)&&(dt=!0))}function Dd(e,t,n,a){ye=e;var i=0;do{if(Xl&&(Ql=null),Gs=0,Xl=!1,25<=i)throw Error(o(301));if(i+=1,ut=Qe=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=xf,r=t(n,a)}while(Xl);return r}function wg(){var e=$.H,t=e.useState()[0];return t=typeof t.then=="function"?Ys(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(ye.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 $r(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,ut=Qe=ye=null,Xl=!1,Gs=nc=0,Ql=null}function Mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?ye.memoizedState=ut=e:ut=ut.next=e,ut}function st(){if(Qe===null){var e=ye.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=ut===null?ye.memoizedState:ut.next;if(t!==null)ut=t,Qe=e;else{if(e===null)throw ye.alternate===null?Error(o(467)):Error(o(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},ut===null?ye.memoizedState=ut=e:ut=ut.next=e}return ut}function ac(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ys(e){var t=Gs;return Gs+=1,Ql===null&&(Ql=[]),e=Sd(Ql,e,t),t=ye,(ut===null?t.memoizedState:ut.next)===null&&(t=t.alternate,$.H=t===null||t.memoizedState===null?gf:Fr),e}function lc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ys(e);if(e.$$typeof===ie)return Tt(e)}throw Error(o(438,String(e)))}function Br(e){var t=null,n=ye.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=ye.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ac(),ye.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]=I;return t.index++,n}function Pn(e,t){return typeof t=="function"?t(e):t}function sc(e){var t=st();return qr(t,Qe,e)}function qr(e,t,n){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=n;var i=e.baseQueue,r=a.pending;if(r!==null){if(i!==null){var f=i.next;i.next=r.next,r.next=f}t.baseQueue=i=r,a.pending=null}if(r=e.baseState,i===null)e.memoizedState=r;else{t=i.next;var g=f=null,j=null,O=t,B=!1;do{var Z=O.lane&-536870913;if(Z!==O.lane?(ke&Z)===Z:(Wn&Z)===Z){var D=O.revertLane;if(D===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),Z===$l&&(B=!0);else if((Wn&D)===D){O=O.next,D===$l&&(B=!0);continue}else Z={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},j===null?(g=j=Z,f=r):j=j.next=Z,ye.lanes|=D,Ra|=D;Z=O.action,ol&&n(r,Z),r=O.hasEagerState?O.eagerState:n(r,Z)}else D={lane:Z,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},j===null?(g=j=D,f=r):j=j.next=D,ye.lanes|=Z,Ra|=Z;O=O.next}while(O!==null&&O!==t);if(j===null?f=r:j.next=g,!Zt(r,e.memoizedState)&&(dt=!0,B&&(n=Bl,n!==null)))throw n;e.memoizedState=r,e.baseState=f,e.baseQueue=j,a.lastRenderedState=r}return i===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Gr(e){var t=st(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var a=n.dispatch,i=n.pending,r=t.memoizedState;if(i!==null){n.pending=null;var f=i=i.next;do r=e(r,f.action),f=f.next;while(f!==i);Zt(r,t.memoizedState)||(dt=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,a]}function Md(e,t,n){var a=ye,i=st(),r=Ae;if(r){if(n===void 0)throw Error(o(407));n=n()}else n=t();var f=!Zt((Qe||i).memoizedState,n);if(f&&(i.memoizedState=n,dt=!0),i=i.queue,Qr(Hd.bind(null,a,i,e),[e]),i.getSnapshot!==t||f||ut!==null&&ut.memoizedState.tag&1){if(a.flags|=2048,Zl(9,{destroy:void 0},Ld.bind(null,a,i,n,t),null),Je===null)throw Error(o(349));r||(Wn&127)!==0||Ud(a,t,n)}return n}function Ud(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ye.updateQueue,t===null?(t=ac(),ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ld(e,t,n,a){t.value=n,t.getSnapshot=a,$d(t)&&Bd(e)}function Hd(e,t,n){return n(function(){$d(t)&&Bd(e)})}function $d(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Zt(e,n)}catch{return!0}}function Bd(e){var t=el(e,2);t!==null&&qt(t,e,2)}function Yr(e){var t=Mt();if(typeof e=="function"){var n=e;if(e=n(),ol){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 qd(e,t,n,a){return e.baseState=n,qr(e,Qe,typeof a=="function"?a:Pn)}function Sg(e,t,n,a,i){if(rc(e))throw Error(o(485));if(e=t.action,e!==null){var r={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){r.listeners.push(f)}};$.T!==null?n(!0):r.isTransition=!1,a(r),n=t.pending,n===null?(r.next=t.pending=r,Gd(t,r)):(r.next=n.next,t.pending=n.next=r)}}function Gd(e,t){var n=t.action,a=t.payload,i=e.state;if(t.isTransition){var r=$.T,f={};$.T=f;try{var g=n(i,a),j=$.S;j!==null&&j(f,g),Yd(e,t,g)}catch(O){Xr(e,t,O)}finally{r!==null&&f.types!==null&&(r.types=f.types),$.T=r}}else try{r=n(i,a),Yd(e,t,r)}catch(O){Xr(e,t,O)}}function Yd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Xd(e,t,a)},function(a){return Xr(e,t,a)}):Xd(e,t,n)}function Xd(e,t,n){t.status="fulfilled",t.value=n,Qd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Gd(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,Qd(t),t=t.next;while(t!==a)}e.action=null}function Qd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zd(e,t){return t}function Vd(e,t){if(Ae){var n=Je.formState;if(n!==null){e:{var a=ye;if(Ae){if(Ie){t:{for(var i=Ie,r=mn;i.nodeType!==8;){if(!r){i=null;break t}if(i=gn(i.nextSibling),i===null){i=null;break t}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){Ie=gn(i.nextSibling),a=i.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:Zd,lastRenderedState:t},n.queue=a,n=hf.bind(null,ye,a),a.dispatch=n,a=Yr(!1),r=Ir.bind(null,ye,!1,a.queue),a=Mt(),i={state:t,dispatch:null,action:e,pending:null},a.queue=i,n=Sg.bind(null,ye,i,r,n),i.dispatch=n,a.memoizedState=e,[t,n,!1]}function Kd(e){var t=st();return Jd(t,Qe,e)}function Jd(e,t,n){if(t=qr(e,t,Zd)[0],e=sc(Pn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Ys(t)}catch(f){throw f===ql?Ji:f}else a=t;t=st();var i=t.queue,r=i.dispatch;return n!==t.memoizedState&&(ye.flags|=2048,Zl(9,{destroy:void 0},kg.bind(null,i,n),null)),[a,r,e]}function kg(e,t){e.action=t}function Id(e){var t=st(),n=Qe;if(n!==null)return Jd(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=ye.updateQueue,t===null&&(t=ac(),ye.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 Fd(){return st().memoizedState}function ic(e,t,n,a){var i=Mt();ye.flags|=e,i.memoizedState=Zl(1|t,{destroy:void 0},n,a===void 0?null:a)}function cc(e,t,n,a){var i=st();a=a===void 0?null:a;var r=i.memoizedState.inst;Qe!==null&&a!==null&&Mr(a,Qe.memoizedState.deps)?i.memoizedState=Zl(t,r,n,a):(ye.flags|=e,i.memoizedState=Zl(1|t,r,n,a))}function Wd(e,t){ic(8390656,8,e,t)}function Qr(e,t){cc(2048,8,e,t)}function Tg(e){ye.flags|=4;var t=ye.updateQueue;if(t===null)t=ac(),ye.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Pd(e){var t=st().memoizedState;return Tg({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function ef(e,t){return cc(4,2,e,t)}function tf(e,t){return cc(4,4,e,t)}function nf(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 af(e,t,n){n=n!=null?n.concat([e]):null,cc(4,4,nf.bind(null,t,e),n)}function Zr(){}function lf(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 sf(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(),ol){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(),ye.lanes|=e,Ra|=e,n)}function cf(e,t,n,a){return Zt(n,t)?n:Yl.current!==null?(e=Vr(e,n,a),Zt(e,t)||(dt=!0),e):(Wn&42)===0||(Wn&1073741824)!==0&&(ke&261930)===0?(dt=!0,e.memoizedState=n):(e=ch(),ye.lanes|=e,Ra|=e,t)}function rf(e,t,n,a,i){var r=ne.p;ne.p=r!==0&&8>r?r:8;var f=$.T,g={};$.T=g,Ir(e,!1,t,n);try{var j=i(),O=$.S;if(O!==null&&O(g,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var B=bg(j,a);Xs(e,t,B,Wt(e))}else Xs(e,t,a,Wt(e))}catch(Z){Xs(e,t,{then:function(){},status:"rejected",reason:Z},Wt())}finally{ne.p=r,f!==null&&g.types!==null&&(f.types=g.types),$.T=f}}function Eg(){}function Kr(e,t,n,a){if(e.tag!==5)throw Error(o(476));var i=of(e).queue;rf(e,i,t,de,n===null?Eg:function(){return uf(e),n(a)})}function of(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:de},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 uf(e){var t=of(e);t.next===null&&(t=e.alternate.memoizedState),Xs(e,t.next.queue,{},Wt())}function Jr(){return Tt(ci)}function df(){return st().memoizedState}function ff(){return st().memoizedState}function _g(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&&(qt(a,t,n),$s(a,t,n)),t={cache:Sr()},e.payload=t;return}t=t.return}}function Ag(e,t,n){var a=Wt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},rc(e)?mf(t,n):(n=hr(e,t,n,a),n!==null&&(qt(n,e,a),pf(n,t,a)))}function hf(e,t,n){var a=Wt();Xs(e,t,n,a)}function Xs(e,t,n,a){var i={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(rc(e))mf(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var f=t.lastRenderedState,g=r(f,n);if(i.hasEagerState=!0,i.eagerState=g,Zt(g,f))return Gi(e,t,i,0),Je===null&&qi(),!1}catch{}if(n=hr(e,t,i,a),n!==null)return qt(n,e,a),pf(n,t,a),!0}return!1}function Ir(e,t,n,a){if(a={lane:2,revertLane:Ao(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},rc(e)){if(t)throw Error(o(479))}else t=hr(e,n,a,2),t!==null&&qt(t,e,2)}function rc(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function mf(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 pf(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Nl(e,n)}}var Qs={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};Qs.useEffectEvent=tt;var gf={readContext:Tt,use:lc,useCallback:function(e,t){return Mt().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Wd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ic(4194308,4,nf.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(ol){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 i=n(t);if(ol){Xt(!0);try{n(t)}finally{Xt(!1)}}}else i=t;return a.memoizedState=a.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},a.queue=e,e=e.dispatch=Ag.bind(null,ye,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=hf.bind(null,ye,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=rf.bind(null,ye,e.queue,!0,!1),Mt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=ye,i=Mt();if(Ae){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Je===null)throw Error(o(349));(ke&127)!==0||Ud(a,t,n)}i.memoizedState=n;var r={value:n,getSnapshot:t};return i.queue=r,Wd(Hd.bind(null,a,r,e),[e]),a.flags|=2048,Zl(9,{destroy:void 0},Ld.bind(null,a,r,n,t),null),n},useId:function(){var e=Mt(),t=Je.identifierPrefix;if(Ae){var n=Ln,a=Un;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=Ng++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Jr,useFormState:Vd,useActionState:Vd,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,ye,!0,n),n.dispatch=t,[e,t]},useMemoCache:Br,useCacheRefresh:function(){return Mt().memoizedState=_g.bind(null,ye)},useEffectEvent:function(e){var t=Mt(),n={impl:e};return t.memoizedState=n,function(){if((He&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Fr={readContext:Tt,use:lc,useCallback:lf,useContext:Tt,useEffect:Qr,useImperativeHandle:af,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:sf,useReducer:sc,useRef:Fd,useState:function(){return sc(Pn)},useDebugValue:Zr,useDeferredValue:function(e,t){var n=st();return cf(n,Qe.memoizedState,e,t)},useTransition:function(){var e=sc(Pn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Ys(e),t]},useSyncExternalStore:Md,useId:df,useHostTransitionStatus:Jr,useFormState:Kd,useActionState:Kd,useOptimistic:function(e,t){var n=st();return qd(n,Qe,e,t)},useMemoCache:Br,useCacheRefresh:ff};Fr.useEffectEvent=Pd;var xf={readContext:Tt,use:lc,useCallback:lf,useContext:Tt,useEffect:Qr,useImperativeHandle:af,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:sf,useReducer:Gr,useRef:Fd,useState:function(){return Gr(Pn)},useDebugValue:Zr,useDeferredValue:function(e,t){var n=st();return Qe===null?Vr(n,e,t):cf(n,Qe.memoizedState,e,t)},useTransition:function(){var e=Gr(Pn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Ys(e),t]},useSyncExternalStore:Md,useId:df,useHostTransitionStatus:Jr,useFormState:Id,useActionState:Id,useOptimistic:function(e,t){var n=st();return Qe!==null?qd(n,Qe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Br,useCacheRefresh:ff};xf.useEffectEvent=Pd;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(),i=ka(a);i.payload=t,n!=null&&(i.callback=n),t=Ta(e,i,a),t!==null&&(qt(t,e,a),$s(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Wt(),i=ka(a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ta(e,i,a),t!==null&&(qt(t,e,a),$s(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&&(qt(t,e,n),$s(t,e,n))}};function vf(e,t,n,a,i,r,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,f):t.prototype&&t.prototype.isPureReactComponent?!Rs(n,a)||!Rs(i,r):!0}function yf(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 ul(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 i in e)n[i]===void 0&&(n[i]=e[i])}return n}function jf(e){Bi(e)}function bf(e){console.error(e)}function Nf(e){Bi(e)}function oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function wf(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function eo(e,t,n){return n=ka(n),n.tag=3,n.payload={element:null},n.callback=function(){oc(e,t)},n}function Sf(e){return e=ka(e),e.tag=3,e}function kf(e,t,n,a){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=a.value;e.payload=function(){return i(r)},e.callback=function(){wf(t,n,a)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){wf(t,n,a),typeof i!="function"&&(za===null?za=new Set([this]):za.add(this));var g=a.stack;this.componentDidCatch(a.value,{componentStack:g!==null?g:""})})}function Cg(e,t,n,a,i){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Hl(t,n,i,!0),n=Kt.current,n!==null){switch(n.tag){case 31:case 13:return pn===null?bc():n.alternate===null&&nt===0&&(nt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,a===Ii?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),To(e,a,i)),!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)),To(e,a,i)),!1}throw Error(o(435,n.tag))}return To(e,a,i),bc(),!1}if(Ae)return t=Kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,a!==yr&&(e=Error(o(422),{cause:a}),Ds(dn(e,n)))):(a!==yr&&(t=Error(o(423),{cause:a}),Ds(dn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,a=dn(a,n),i=eo(e.stateNode,a,i),Cr(e,i),nt!==4&&(nt=2)),!1;var r=Error(o(520),{cause:a});if(r=dn(r,n),Ps===null?Ps=[r]:Ps.push(r),nt!==4&&(nt=2),t===null)return!0;a=dn(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=eo(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,i&=-i,n.lanes|=i,i=Sf(i),kf(i,e,n,a),Cr(n,i),!1}n=n.return}while(n!==null);return!1}var to=Error(o(461)),dt=!1;function Et(e,t,n,a){t.child=e===null?_d(t,null,n,a):rl(t,e.child,n,a)}function Tf(e,t,n,a,i){n=n.render;var r=t.ref;if("ref"in a){var f={};for(var g in a)g!=="ref"&&(f[g]=a[g])}else f=a;return ll(t),a=Ur(e,t,n,f,r,i),g=Lr(),e!==null&&!dt?(Hr(e,t,i),ea(e,t,i)):(Ae&&g&&xr(t),t.flags|=1,Et(e,t,a,i),t.child)}function Ef(e,t,n,a,i){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,_f(e,t,r,a,i)):(e=Xi(n.type,null,a,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!oo(e,i)){var f=r.memoizedProps;if(n=n.compare,n=n!==null?n:Rs,n(f,a)&&e.ref===t.ref)return ea(e,t,i)}return t.flags|=1,e=Kn(r,a),e.ref=t.ref,e.return=t,t.child=e}function _f(e,t,n,a,i){if(e!==null){var r=e.memoizedProps;if(Rs(r,a)&&e.ref===t.ref)if(dt=!1,t.pendingProps=a=r,oo(e,i))(e.flags&131072)!==0&&(dt=!0);else return t.lanes=e.lanes,ea(e,t,i)}return no(e,t,n,a,i)}function Af(e,t,n,a){var i=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,i=0;a!==null;)i=i|a.lanes|a.childLanes,a=a.sibling;a=i&~r}else a=0,t.child=null;return Cf(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?Rd(t,r):zr(),zd(t);else return a=t.lanes=536870912,Cf(e,t,r!==null?r.baseLanes|n:n,n,a)}else r!==null?(Ki(t,r.cachePool),Rd(t,r),_a(),t.memoizedState=null):(e!==null&&Ki(t,null),zr(),_a());return Et(e,t,i,n),t.child}function Zs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Cf(e,t,n,a,i){var r=Tr();return r=r===null?null:{parent:ot._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Ki(t,null),zr(),zd(t),e!==null&&Hl(e,t,a,!0),t.childLanes=i,null}function uc(e,t){return t=fc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Rf(e,t,n){return rl(t,e.child,null,n),e=uc(t,t.pendingProps),e.flags|=2,Jt(t),t.memoizedState=null,e}function Rg(e,t,n){var a=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ae){if(a.mode==="hidden")return e=uc(t,a),t.lanes=536870912,Zs(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:ja!==null?{id:Un,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},n=hd(e),n.return=t,t.child=n,kt=t,Ie=null)):e=null,e===null)throw Na(t);return t.lanes=536870912,null}return uc(t,a)}var r=e.memoizedState;if(r!==null){var f=r.dehydrated;if(Dr(t),i)if(t.flags&256)t.flags&=-257,t=Rf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(dt||Hl(e,t,n,!1),i=(n&e.childLanes)!==0,dt||i){if(a=Je,a!==null&&(f=wl(a,n),f!==0&&f!==r.retryLane))throw r.retryLane=f,el(e,f),qt(a,e,f),to;bc(),t=Rf(e,t,n)}else e=r.treeContext,Ie=gn(f.nextSibling),kt=t,Ae=!0,ba=null,mn=!1,e!==null&&gd(t,e),t=uc(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 dc(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(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function no(e,t,n,a,i){return ll(t),n=Ur(e,t,n,a,void 0,i),a=Lr(),e!==null&&!dt?(Hr(e,t,i),ea(e,t,i)):(Ae&&a&&xr(t),t.flags|=1,Et(e,t,n,i),t.child)}function zf(e,t,n,a,i,r){return ll(t),t.updateQueue=null,n=Dd(t,a,n,i),Od(e),a=Lr(),e!==null&&!dt?(Hr(e,t,r),ea(e,t,r)):(Ae&&a&&xr(t),t.flags|=1,Et(e,t,n,r),t.child)}function Of(e,t,n,a,i){if(ll(t),t.stateNode===null){var r=Dl,f=n.contextType;typeof f=="object"&&f!==null&&(r=Tt(f)),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),f=n.contextType,r.context=typeof f=="object"&&f!==null?Tt(f):Dl,r.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(Wr(t,n,f,a),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(f=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),f!==r.state&&Pr.enqueueReplaceState(r,r.state,null),qs(t,a,r,i),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,j=ul(n,g);r.props=j;var O=r.context,B=n.contextType;f=Dl,typeof B=="object"&&B!==null&&(f=Tt(B));var Z=n.getDerivedStateFromProps;B=typeof Z=="function"||typeof r.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,B||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(g||O!==f)&&yf(t,r,a,f),Sa=!1;var D=t.memoizedState;r.state=D,qs(t,a,r,i),Bs(),O=t.memoizedState,g||D!==O||Sa?(typeof Z=="function"&&(Wr(t,n,Z,a),O=t.memoizedState),(j=Sa||vf(t,n,j,a,D,O,f))?(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=f,a=j):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,Ar(e,t),f=t.memoizedProps,B=ul(n,f),r.props=B,Z=t.pendingProps,D=r.context,O=n.contextType,j=Dl,typeof O=="object"&&O!==null&&(j=Tt(O)),g=n.getDerivedStateFromProps,(O=typeof g=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f!==Z||D!==j)&&yf(t,r,a,j),Sa=!1,D=t.memoizedState,r.state=D,qs(t,a,r,i),Bs();var M=t.memoizedState;f!==Z||D!==M||Sa||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof g=="function"&&(Wr(t,n,g,a),M=t.memoizedState),(B=Sa||vf(t,n,B,a,D,M,j)||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,M,j),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,M,j)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=M),r.props=a,r.state=M,r.context=j,a=B):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,dc(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,i),t.child=rl(t,null,n,i)):Et(e,t,n,i),t.memoizedState=r.state,e=t.child):e=ea(e,t,i),e}function Df(e,t,n,a){return nl(),t.flags|=256,Et(e,t,n,a),t.child}var ao={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lo(e){return{baseLanes:e,cachePool:Nd()}}function so(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Ft),e}function Mf(e,t,n){var a=t.pendingProps,i=!1,r=(t.flags&128)!==0,f;if((f=r)||(f=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),f&&(i=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ae){if(i?Ea(t):_a(),(e=Ie)?(e=Yh(e,mn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ja!==null?{id:Un,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},n=hd(e),n.return=t,t.child=n,kt=t,Ie=null)):e=null,e===null)throw Na(t);return Go(e)?t.lanes=32:t.lanes=536870912,null}var g=a.children;return a=a.fallback,i?(_a(),i=t.mode,g=fc({mode:"hidden",children:g},i),a=tl(a,i,n,null),g.return=t,a.return=t,g.sibling=a,t.child=g,a=t.child,a.memoizedState=lo(n),a.childLanes=so(e,f,n),t.memoizedState=ao,Zs(null,a)):(Ea(t),io(t,g))}var j=e.memoizedState;if(j!==null&&(g=j.dehydrated,g!==null)){if(r)t.flags&256?(Ea(t),t.flags&=-257,t=co(e,t,n)):t.memoizedState!==null?(_a(),t.child=e.child,t.flags|=128,t=null):(_a(),g=a.fallback,i=t.mode,a=fc({mode:"visible",children:a.children},i),g=tl(g,i,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=lo(n),a.childLanes=so(e,f,n),t.memoizedState=ao,t=Zs(null,a));else if(Ea(t),Go(g)){if(f=g.nextSibling&&g.nextSibling.dataset,f)var O=f.dgst;f=O,a=Error(o(419)),a.stack="",a.digest=f,Ds({value:a,source:null,stack:null}),t=co(e,t,n)}else if(dt||Hl(e,t,n,!1),f=(n&e.childLanes)!==0,dt||f){if(f=Je,f!==null&&(a=wl(f,n),a!==0&&a!==j.retryLane))throw j.retryLane=a,el(e,a),qt(f,e,a),to;qo(g)||bc(),t=co(e,t,n)}else qo(g)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Ie=gn(g.nextSibling),kt=t,Ae=!0,ba=null,mn=!1,e!==null&&gd(t,e),t=io(t,a.children),t.flags|=4096);return t}return i?(_a(),g=a.fallback,i=t.mode,j=e.child,O=j.sibling,a=Kn(j,{mode:"hidden",children:a.children}),a.subtreeFlags=j.subtreeFlags&65011712,O!==null?g=Kn(O,g):(g=tl(g,i,n,null),g.flags|=2),g.return=t,a.return=t,a.sibling=g,t.child=a,Zs(null,a),a=t.child,g=e.child.memoizedState,g===null?g=lo(n):(i=g.cachePool,i!==null?(j=ot._currentValue,i=i.parent!==j?{parent:j,pool:j}:i):i=Nd(),g={baseLanes:g.baseLanes|n,cachePool:i}),a.memoizedState=g,a.childLanes=so(e,f,n),t.memoizedState=ao,Zs(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&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function io(e,t){return t=fc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function fc(e,t){return e=Vt(22,e,null,t),e.lanes=0,e}function co(e,t,n){return rl(t,e.child,null,n),e=io(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Uf(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Nr(e.return,t,n)}function ro(e,t,n,a,i,r){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:i,treeForkCount:r}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=a,f.tail=n,f.tailMode=i,f.treeForkCount=r)}function Lf(e,t,n){var a=t.pendingProps,i=a.revealOrder,r=a.tail;a=a.children;var f=lt.current,g=(f&2)!==0;if(g?(f=f&1|2,t.flags|=128):f&=1,le(lt,f),Et(e,t,a,n),a=Ae?Os:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Uf(e,n,t);else if(e.tag===19)Uf(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(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ec(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ro(t,!1,i,n,r,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ec(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ro(t,!0,n,null,r,a);break;case"together":ro(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(o(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 oo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Zi(e)))}function zg(e,t,n){switch(t.tag){case 3:mt(t,t.stateNode.containerInfo),wa(t,ot,e.memoizedState.cache),nl();break;case 27:case 5:Re(t);break;case 4:mt(t,t.stateNode.containerInfo);break;case 10:wa(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?Mf(e,t,n):(Ea(t),e=ea(e,t,n),e!==null?e.sibling:null);Ea(t);break;case 19:var i=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Hl(e,t,n,!1),a=(n&t.childLanes)!==0),i){if(a)return Lf(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),le(lt,lt.current),a)break;return null;case 22:return t.lanes=0,Af(e,t,n,t.pendingProps);case 24:wa(t,ot,e.memoizedState.cache)}return ea(e,t,n)}function Hf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)dt=!0;else{if(!oo(e,n)&&(t.flags&128)===0)return dt=!1,zg(e,t,n);dt=(e.flags&131072)!==0}else dt=!1,Ae&&(t.flags&1048576)!==0&&pd(t,Os,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=ul(e,a),t.tag=1,t=Of(null,t,e,a,n)):(t.tag=0,t=no(null,t,e,a,n));else{if(e!=null){var i=e.$$typeof;if(i===Y){t.tag=11,t=Tf(null,t,e,a,n);break e}else if(i===V){t.tag=14,t=Ef(null,t,e,a,n);break e}}throw t=Le(e)||e,Error(o(306,t,""))}}return t;case 0:return no(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,i=ul(a,t.pendingProps),Of(e,t,a,i,n);case 3:e:{if(mt(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var r=t.memoizedState;i=r.element,Ar(e,t),qs(t,a,null,n);var f=t.memoizedState;if(a=f.cache,wa(t,ot,a),a!==r.cache&&wr(t,[ot],n,!0),Bs(),a=f.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Df(e,t,a,n);break e}else if(a!==i){i=dn(Error(o(424)),t),Ds(i),t=Df(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,ba=null,mn=!0,n=_d(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(nl(),a===i){t=ea(e,t,n);break e}Et(e,t,a,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=Jh(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ae||(n=t.type,e=t.pendingProps,a=_c(ve.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,ve.current),kt=t,mn=!0,i=Ie,Ua(t.type)?(Yo=i,Ie=gn(a.firstChild)):Ie=i),Et(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ae&&((i=a=Ie)&&(a=rx(a,t.type,t.pendingProps,mn),a!==null?(t.stateNode=a,kt=t,Ie=gn(a.firstChild),mn=!1,i=!0):i=!1),i||Na(t)),Re(t),i=t.type,r=t.pendingProps,f=e!==null?e.memoizedProps:null,a=r.children,Ho(i,r)?a=null:f!==null&&Ho(i,f)&&(t.flags|=32),t.memoizedState!==null&&(i=Ur(e,t,wg,null,null,n),ci._currentValue=i),dc(e,t),Et(e,t,a,n),t.child;case 6:return e===null&&Ae&&((e=n=Ie)&&(n=ox(n,t.pendingProps,mn),n!==null?(t.stateNode=n,kt=t,Ie=null,e=!0):e=!1),e||Na(t)),null;case 13:return Mf(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 Tf(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,wa(t,t.type,a.value),Et(e,t,a.children,n),t.child;case 9:return i=t.type._context,a=t.pendingProps.children,ll(t),i=Tt(i),a=a(i),t.flags|=1,Et(e,t,a,n),t.child;case 14:return Ef(e,t,t.type,t.pendingProps,n);case 15:return _f(e,t,t.type,t.pendingProps,n);case 19:return Lf(e,t,n);case 31:return Rg(e,t,n);case 22:return Af(e,t,n,t.pendingProps);case 24:return ll(t),a=Tt(ot),e===null?(i=Tr(),i===null&&(i=Je,r=Sr(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=n),i=r),t.memoizedState={parent:a,cache:i},_r(t),wa(t,ot,i)):((e.lanes&n)!==0&&(Ar(e,t),qs(t,null,null,n),Bs()),i=e.memoizedState,r=t.memoizedState,i.parent!==a?(i={parent:a,cache:a},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),wa(t,ot,a)):(a=r.cache,wa(t,ot,a),a!==i.cache&&wr(t,[ot],n,!0))),Et(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ta(e){e.flags|=4}function uo(e,t,n,a,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(dh())e.flags|=8192;else throw cl=Ii,Er}else e.flags&=-16777217}function $f(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!em(t))if(dh())e.flags|=8192;else throw cl=Ii,Er}function hc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?gs():536870912,e.lanes|=t,Il|=t)}function Vs(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 i=e.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags&65011712,a|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags,a|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function Og(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(ot),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,jr())),Fe(t),null;case 26:var i=t.type,r=t.memoizedState;return e===null?(ta(t),r!==null?(Fe(t),$f(t,r)):(Fe(t),uo(t,i,null,a,n))):r?r!==e.memoizedState?(ta(t),Fe(t),$f(t,r)):(Fe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ta(t),Fe(t),uo(t,i,e,a,n)),null;case 27:if(Ye(t),n=ve.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ta(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Fe(t),null}e=ee.current,Ll(t)?xd(t):(e=Zh(i,a,n),t.stateNode=e,ta(t))}return Fe(t),null;case 5:if(Ye(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ta(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Fe(t),null}if(r=ee.current,Ll(t))xd(t);else{var f=_c(ve.current);switch(r){case 1:r=f.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:r=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":r=f.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":r=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":r=f.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?f.createElement("select",{is:a.is}):f.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?f.createElement(i,{is:a.is}):f.createElement(i)}}r[pt]=t,r[it]=a;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)r.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=r;e:switch(_t(r,i,a),i){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),uo(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(o(166));if(e=ve.current,Ll(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,i=kt,i!==null)switch(i.tag){case 27:case 5:a=i.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(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[pt]=t}else nl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),e=!1}else n=jr(),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(o(558))}return Fe(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ll(t),a!==null&&a.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(o(317));i[pt]=t}else nl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),i=!1}else i=jr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)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,i=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(i=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==i&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),hc(t,t.updateQueue),Fe(t),null);case 4:return G(),e===null&&Oo(t.stateNode.containerInfo),Fe(t),null;case 10:return Fn(t.type),Fe(t),null;case 19:if(X(lt),a=t.memoizedState,a===null)return Fe(t),null;if(i=(t.flags&128)!==0,r=a.rendering,r===null)if(i)Vs(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,Vs(a,!1),e=r.updateQueue,t.updateQueue=e,hc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fd(n,e),n=n.sibling;return le(lt,lt.current&1|2),Ae&&Jn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&At()>vc&&(t.flags|=128,i=!0,Vs(a,!1),t.lanes=4194304)}else{if(!i)if(e=ec(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,hc(t,e),Vs(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,i=!0,Vs(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,le(lt,i?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&&X(sl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Fn(ot),Fe(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Dg(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(ot),G(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ye(t),null;case 31:if(t.memoizedState!==null){if(Jt(t),t.alternate===null)throw Error(o(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(o(340));nl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(lt),null;case 4:return G(),null;case 10:return Fn(t.type),null;case 22:case 23:return Jt(t),Or(),e!==null&&X(sl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fn(ot),null;case 25:return null;default:return null}}function Bf(e,t){switch(vr(t),t.tag){case 3:Fn(ot),G();break;case 26:case 27:case 5:Ye(t);break;case 4:G();break;case 31:t.memoizedState!==null&&Jt(t);break;case 13:Jt(t);break;case 19:X(lt);break;case 10:Fn(t.type);break;case 22:case 23:Jt(t),Or(),e!==null&&X(sl);break;case 24:Fn(ot)}}function Ks(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var i=a.next;n=i;do{if((n.tag&e)===e){a=void 0;var r=n.create,f=n.inst;a=r(),f.destroy=a}n=n.next}while(n!==i)}}catch(g){Ge(t,t.return,g)}}function Aa(e,t,n){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var r=i.next;a=r;do{if((a.tag&e)===e){var f=a.inst,g=f.destroy;if(g!==void 0){f.destroy=void 0,i=t;var j=n,O=g;try{O()}catch(B){Ge(i,j,B)}}}a=a.next}while(a!==r)}}catch(B){Ge(t,t.return,B)}}function qf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Cd(t,n)}catch(a){Ge(e,e.return,a)}}}function Gf(e,t,n){n.props=ul(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Ge(e,t,a)}}function Js(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(i){Ge(e,t,i)}}function Hn(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(i){Ge(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Ge(e,t,i)}else n.current=null}function Yf(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(i){Ge(e,e.return,i)}}function fo(e,t,n){try{var a=e.stateNode;nx(a,e.type,n,t),a[it]=t}catch(i){Ge(e,e.return,i)}}function Xf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ua(e.type)||e.tag===4}function ho(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xf(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 mo(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(mo(e,t,n),e=e.sibling;e!==null;)mo(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 Qf(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);_t(t,a,n),t[pt]=e,t[it]=n}catch(r){Ge(e,e.return,r)}}var na=!1,ft=!1,po=!1,Zf=typeof WeakSet=="function"?WeakSet:Set,jt=null;function Mg(e,t){if(e=e.containerInfo,Uo=Mc,e=ad(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 i=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var f=0,g=-1,j=-1,O=0,B=0,Z=e,D=null;t:for(;;){for(var M;Z!==n||i!==0&&Z.nodeType!==3||(g=f+i),Z!==r||a!==0&&Z.nodeType!==3||(j=f+a),Z.nodeType===3&&(f+=Z.nodeValue.length),(M=Z.firstChild)!==null;)D=Z,Z=M;for(;;){if(Z===e)break t;if(D===n&&++O===i&&(g=f),D===r&&++B===a&&(j=f),(M=Z.nextSibling)!==null)break;Z=D,D=Z.parentNode}Z=M}n=g===-1||j===-1?null:{start:g,end:j}}else n=null}n=n||{start:0,end:0}}else n=null;for(Lo={focusedElem:e,selectionRange:n},Mc=!1,jt=t;jt!==null;)if(t=jt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,jt=e;else for(;jt!==null;){switch(t=jt,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++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,n=t,i=r.memoizedProps,r=r.memoizedState,a=n.stateNode;try{var oe=ul(n.type,i);e=a.getSnapshotBeforeUpdate(oe,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(pe){Ge(n,n.return,pe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Bo(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Bo(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,jt=e;break}jt=t.return}}function Vf(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:la(e,n),a&4&&Ks(5,n);break;case 1:if(la(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){Ge(n,n.return,f)}else{var i=ul(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Ge(n,n.return,f)}}a&64&&qf(n),a&512&&Js(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{Cd(e,t)}catch(f){Ge(n,n.return,f)}}break;case 27:t===null&&a&4&&Qf(n);case 26:case 5:la(e,n),t===null&&a&4&&Yf(n),a&512&&Js(n,n.return);break;case 12:la(e,n);break;case 31:la(e,n),a&4&&If(e,n);break;case 13:la(e,n),a&4&&Ff(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xg.bind(null,n),ux(e,n))));break;case 22:if(a=n.memoizedState!==null||na,!a){t=t!==null&&t.memoizedState!==null||ft,i=na;var r=ft;na=a,(ft=t)&&!r?sa(e,n,(n.subtreeFlags&8772)!==0):la(e,n),na=i,ft=r}break;case 30:break;default:la(e,n)}}function Kf(e){var t=e.alternate;t!==null&&(e.alternate=null,Kf(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;)Jf(e,t,n),n=n.sibling}function Jf(e,t,n){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(sn,n)}catch{}switch(n.tag){case 26:ft||Hn(n,t),aa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ft||Hn(n,t);var a=Pe,i=Lt;Ua(n.type)&&(Pe=n.stateNode,Lt=!1),aa(e,t,n),li(n.stateNode),Pe=a,Lt=i;break;case 5:ft||Hn(n,t);case 6:if(a=Pe,i=Lt,Pe=null,aa(e,t,n),Pe=a,Lt=i,Pe!==null)if(Lt)try{(Pe.nodeType===9?Pe.body:Pe.nodeName==="HTML"?Pe.ownerDocument.body:Pe).removeChild(n.stateNode)}catch(r){Ge(n,t,r)}else try{Pe.removeChild(n.stateNode)}catch(r){Ge(n,t,r)}break;case 18:Pe!==null&&(Lt?(e=Pe,qh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ls(e)):qh(Pe,n.stateNode));break;case 4:a=Pe,i=Lt,Pe=n.stateNode.containerInfo,Lt=!0,aa(e,t,n),Pe=a,Lt=i;break;case 0:case 11:case 14:case 15:Aa(2,n,t),ft||Aa(4,n,t),aa(e,t,n);break;case 1:ft||(Hn(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Gf(n,t,a)),aa(e,t,n);break;case 21:aa(e,t,n);break;case 22:ft=(a=ft)||n.memoizedState!==null,aa(e,t,n),ft=a;break;default:aa(e,t,n)}}function If(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ls(e)}catch(n){Ge(t,t.return,n)}}}function Ff(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){Ge(t,t.return,n)}}function Ug(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zf),t;default:throw Error(o(435,e.tag))}}function pc(e,t){var n=Ug(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var i=Qg.bind(null,e,a);a.then(i,i)}})}function Ht(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var i=n[a],r=e,f=t,g=f;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(o(160));Jf(r,f,i),Pe=null,Lt=!1,r=i.alternate,r!==null&&(r.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Wf(t,e),t=t.sibling}var Sn=null;function Wf(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ht(t,e),$t(e),a&4&&(Aa(3,e,e.return),Ks(3,e),Aa(5,e,e.return));break;case 1:Ht(t,e),$t(e),a&512&&(ft||n===null||Hn(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 i=Sn;if(Ht(t,e),$t(e),a&512&&(ft||n===null||Hn(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,i=i.ownerDocument||i;t:switch(a){case"title":r=i.getElementsByTagName("title")[0],(!r||r[pa]||r[pt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=i.createElement(a),i.head.insertBefore(r,i.querySelector("head > title"))),_t(r,a,n),r[pt]=e,ct(r),a=r;break e;case"link":var f=Wh("link","href",i).get(a+(n.href||""));if(f){for(var g=0;g<f.length;g++)if(r=f[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)){f.splice(g,1);break t}}r=i.createElement(a),_t(r,a,n),i.head.appendChild(r);break;case"meta":if(f=Wh("meta","content",i).get(a+(n.content||""))){for(g=0;g<f.length;g++)if(r=f[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)){f.splice(g,1);break t}}r=i.createElement(a),_t(r,a,n),i.head.appendChild(r);break;default:throw Error(o(468,a))}r[pt]=e,ct(r),a=r}e.stateNode=a}else Ph(i,e.type,e.stateNode);else e.stateNode=Fh(i,a,e.memoizedProps);else r!==a?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,a===null?Ph(i,e.type,e.stateNode):Fh(i,a,e.memoizedProps)):a===null&&e.stateNode!==null&&fo(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ht(t,e),$t(e),a&512&&(ft||n===null||Hn(n,n.return)),n!==null&&a&4&&fo(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ht(t,e),$t(e),a&512&&(ft||n===null||Hn(n,n.return)),e.flags&32){i=e.stateNode;try{Vn(i,"")}catch(oe){Ge(e,e.return,oe)}}a&4&&e.stateNode!=null&&(i=e.memoizedProps,fo(e,i,n!==null?n.memoizedProps:i)),a&1024&&(po=!0);break;case 6:if(Ht(t,e),$t(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(oe){Ge(e,e.return,oe)}}break;case 3:if(Rc=null,i=Sn,Sn=Ac(t.containerInfo),Ht(t,e),Sn=i,$t(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{ls(t.containerInfo)}catch(oe){Ge(e,e.return,oe)}po&&(po=!1,Pf(e));break;case 4:a=Sn,Sn=Ac(e.stateNode.containerInfo),Ht(t,e),$t(e),Sn=a;break;case 12:Ht(t,e),$t(e);break;case 31:Ht(t,e),$t(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,pc(e,a)));break;case 13:Ht(t,e),$t(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:i=e.memoizedState!==null;var j=n!==null&&n.memoizedState!==null,O=na,B=ft;if(na=O||i,ft=B||j,Ht(t,e),ft=B,na=O,$t(e),a&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||j||na||ft||dl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){j=n=t;try{if(r=j.stateNode,i)f=r.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{g=j.stateNode;var Z=j.memoizedProps.style,D=Z!=null&&Z.hasOwnProperty("display")?Z.display:null;g.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(oe){Ge(j,j.return,oe)}}}else if(t.tag===6){if(n===null){j=t;try{j.stateNode.nodeValue=i?"":j.memoizedProps}catch(oe){Ge(j,j.return,oe)}}}else if(t.tag===18){if(n===null){j=t;try{var M=j.stateNode;i?Gh(M,!0):Gh(j.stateNode,!1)}catch(oe){Ge(j,j.return,oe)}}}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),$t(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),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Xf(a)){n=a;break}a=a.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode,r=ho(e);mc(e,r,i);break;case 5:var f=n.stateNode;n.flags&32&&(Vn(f,""),n.flags&=-33);var g=ho(e);mc(e,g,f);break;case 3:case 4:var j=n.stateNode.containerInfo,O=ho(e);mo(e,O,j);break;default:throw Error(o(161))}}catch(B){Ge(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pf(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;)Vf(e,t.alternate,t),t=t.sibling}function dl(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),dl(t);break;case 1:Hn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Gf(t,t.return,n),dl(t);break;case 27:li(t.stateNode);case 26:case 5:Hn(t,t.return),dl(t);break;case 22:t.memoizedState===null&&dl(t);break;case 30:dl(t);break;default:dl(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,i=e,r=t,f=r.flags;switch(r.tag){case 0:case 11:case 15:sa(i,r,n),Ks(4,r);break;case 1:if(sa(i,r,n),a=r,i=a.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(O){Ge(a,a.return,O)}if(a=r,i=a.updateQueue,i!==null){var g=a.stateNode;try{var j=i.shared.hiddenCallbacks;if(j!==null)for(i.shared.hiddenCallbacks=null,i=0;i<j.length;i++)Ad(j[i],g)}catch(O){Ge(a,a.return,O)}}n&&f&64&&qf(r),Js(r,r.return);break;case 27:Qf(r);case 26:case 5:sa(i,r,n),n&&a===null&&f&4&&Yf(r),Js(r,r.return);break;case 12:sa(i,r,n);break;case 31:sa(i,r,n),n&&f&4&&If(i,r);break;case 13:sa(i,r,n),n&&f&4&&Ff(i,r);break;case 22:r.memoizedState===null&&sa(i,r,n),Js(r,r.return);break;case 30:break;default:sa(i,r,n)}t=t.sibling}}function go(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&&Ms(n))}function xo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ms(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 i=t.flags;switch(t.tag){case 0:case 11:case 15:kn(e,t,n,a),i&2048&&Ks(9,t);break;case 1:kn(e,t,n,a);break;case 3:kn(e,t,n,a),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ms(e)));break;case 12:if(i&2048){kn(e,t,n,a),e=t.stateNode;try{var r=t.memoizedProps,f=r.id,g=r.onPostCommit;typeof g=="function"&&g(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Ge(t,t.return,j)}}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,f=t.alternate,t.memoizedState!==null?r._visibility&2?kn(e,t,n,a):Is(e,t):r._visibility&2?kn(e,t,n,a):(r._visibility|=2,Vl(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),i&2048&&go(f,t);break;case 24:kn(e,t,n,a),i&2048&&xo(t.alternate,t);break;default:kn(e,t,n,a)}}function Vl(e,t,n,a,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,f=t,g=n,j=a,O=f.flags;switch(f.tag){case 0:case 11:case 15:Vl(r,f,g,j,i),Ks(8,f);break;case 23:break;case 22:var B=f.stateNode;f.memoizedState!==null?B._visibility&2?Vl(r,f,g,j,i):Is(r,f):(B._visibility|=2,Vl(r,f,g,j,i)),i&&O&2048&&go(f.alternate,f);break;case 24:Vl(r,f,g,j,i),i&&O&2048&&xo(f.alternate,f);break;default:Vl(r,f,g,j,i)}t=t.sibling}}function Is(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,i=a.flags;switch(a.tag){case 22:Is(n,a),i&2048&&go(a.alternate,a);break;case 24:Is(n,a),i&2048&&xo(a.alternate,a);break;default:Is(n,a)}t=t.sibling}}var Fs=8192;function Kl(e,t,n){if(e.subtreeFlags&Fs)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&Fs&&e.memoizedState!==null&&Nx(n,Sn,e.memoizedState,e.memoizedProps);break;case 5:Kl(e,t,n);break;case 3:case 4:var a=Sn;Sn=Ac(e.stateNode.containerInfo),Kl(e,t,n),Sn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Fs,Fs=16777216,Kl(e,t,n),Fs=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 Ws(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];jt=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:Ws(e),e.flags&2048&&Aa(9,e,e.return);break;case 3:Ws(e);break;case 12:Ws(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)):Ws(e);break;default:Ws(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];jt=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(;jt!==null;){var n=jt;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:Ms(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,jt=a;else e:for(n=e;jt!==null;){a=jt;var i=a.sibling,r=a.return;if(Kf(a),a===n){jt=null;break e}if(i!==null){i.return=r,jt=i;break e}jt=r}}}var Lg={getCacheForType:function(e){var t=Tt(ot),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Tt(ot).controller.signal}},Hg=typeof WeakMap=="function"?WeakMap:Map,He=0,Je=null,Ne=null,ke=0,qe=0,It=null,Ca=!1,Jl=!1,vo=!1,ia=0,nt=0,Ra=0,fl=0,yo=0,Ft=0,Il=0,Ps=null,Bt=null,jo=!1,xc=0,sh=0,vc=1/0,yc=null,za=null,xt=0,Oa=null,Fl=null,ca=0,bo=0,No=null,ih=null,ei=0,wo=null;function Wt(){return(He&2)!==0&&ke!==0?ke&-ke:$.T!==null?Ao():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 qt(e,t,n){(e===Je&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(Wl(e,0),Da(e,ke,Ft,!1)),On(e,n),((He&2)===0||e!==Je)&&(e===Je&&((He&2)===0&&(fl|=n),nt===4&&Da(e,ke,Ft,!1)),$n(e))}function rh(e,t,n){if((He&6)!==0)throw Error(o(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||da(e,t),i=a?qg(e,t):ko(e,t,!0),r=a;do{if(i===0){Jl&&!a&&Da(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!$g(n)){i=ko(e,t,!1),r=!1;continue}if(i===2){if(r=t,e.errorRecoveryDisabledLanes&r)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var g=e;i=Ps;var j=g.current.memoizedState.isDehydrated;if(j&&(Wl(g,f).flags|=256),f=ko(g,f,!1),f!==2){if(vo&&!j){g.errorRecoveryDisabledLanes|=r,fl|=r,i=4;break e}r=Bt,Bt=i,r!==null&&(Bt===null?Bt=r:Bt.push.apply(Bt,r))}i=f}if(r=!1,i!==2)continue}}if(i===1){Wl(e,0),Da(e,t,0,!0);break}e:{switch(a=e,r=i,r){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Da(a,t,Ft,!Ca);break e;case 2:Bt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=xc+300-At(),10<i)){if(Da(a,t,Ft,!Ca),Za(a,0,!0)!==0)break e;ca=t,a.timeoutHandle=$h(oh.bind(null,a,n,Bt,yc,jo,t,Ft,fl,Il,Ca,r,"Throttled",-0,0),i);break e}oh(a,n,Bt,yc,jo,t,Ft,fl,Il,Ca,r,null,-0,0)}}break}while(!0);$n(e)}function oh(e,t,n,a,i,r,f,g,j,O,B,Z,D,M){if(e.timeoutHandle=-1,Z=t.subtreeFlags,Z&8192||(Z&16785408)===16785408){Z={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:A},th(t,r,Z);var oe=(r&62914560)===r?xc-At():(r&4194048)===r?sh-At():0;if(oe=wx(Z,oe),oe!==null){ca=r,e.cancelPendingCommit=oe(xh.bind(null,e,t,r,n,a,i,f,g,j,B,Z,null,D,M)),Da(e,r,f,!O);return}}xh(e,t,r,n,a,i,f,g,j)}function $g(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 i=n[a],r=i.getSnapshot;i=i.value;try{if(!Zt(r(),i))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&=~yo,t&=~fl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var i=t;0<i;){var r=31-Ct(i),f=1<<r;a[r]=-1,i&=~f}n!==0&&Gn(e,n,t)}function jc(){return(He&6)===0?(ti(0),!1):!0}function So(){if(Ne!==null){if(qe===0)var e=Ne.return;else e=Ne,In=al=null,$r(e),Gl=null,Ls=0,e=Ne;for(;e!==null;)Bf(e.alternate,e),e=e.return;Ne=null}}function Wl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,sx(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ca=0,So(),Je=e,Ne=n=Kn(e.current,null),ke=t,qe=0,It=null,Ca=!1,Jl=da(e,t),vo=!1,Il=Ft=yo=fl=Ra=nt=0,Bt=Ps=null,jo=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var i=31-Ct(a),r=1<<i;t|=e[i],a&=~r}return ia=t,qi(),n}function uh(e,t){ye=null,$.H=Qs,t===ql||t===Ji?(t=kd(),qe=3):t===Er?(t=kd(),qe=4):qe=t===to?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,It=t,Ne===null&&(nt=1,oc(e,dn(t,e.current)))}function dh(){var e=Kt.current;return e===null?!0:(ke&4194048)===ke?pn===null:(ke&62914560)===ke||(ke&536870912)!==0?e===pn:!1}function fh(){var e=$.H;return $.H=Qs,e===null?Qs:e}function hh(){var e=$.A;return $.A=Lg,e}function bc(){nt=4,Ca||(ke&4194048)!==ke&&Kt.current!==null||(Jl=!0),(Ra&134217727)===0&&(fl&134217727)===0||Je===null||Da(Je,ke,Ft,!1)}function ko(e,t,n){var a=He;He|=2;var i=fh(),r=hh();(Je!==e||ke!==t)&&(yc=null,Wl(e,t)),t=!1;var f=nt;e:do try{if(qe!==0&&Ne!==null){var g=Ne,j=It;switch(qe){case 8:So(),f=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,j,O),n&&Jl){f=0;break e}break;default:O=qe,qe=0,It=null,Pl(e,g,j,O)}}Bg(),f=nt;break}catch(B){uh(e,B)}while(!0);return t&&e.shellSuspendCounter++,In=al=null,He=a,$.H=i,$.A=r,Ne===null&&(Je=null,ke=0,qi()),f}function Bg(){for(;Ne!==null;)mh(Ne)}function qg(e,t){var n=He;He|=2;var a=fh(),i=hh();Je!==e||ke!==t?(yc=null,vc=At()+500,Wl(e,t)):Jl=da(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(wd(r)){qe=0,It=null,ph(t);break}t=function(){qe!==2&&qe!==9||Je!==e||(qe=7),$n(e)},r.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:wd(r)?(qe=0,It=null,ph(t)):(qe=0,It=null,Pl(e,t,r,7));break;case 5:var f=null;switch(Ne.tag){case 26:f=Ne.memoizedState;case 5:case 27:var g=Ne;if(f?em(f):g.stateNode.complete){qe=0,It=null;var j=g.sibling;if(j!==null)Ne=j;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:So(),nt=6;break e;default:throw Error(o(462))}}Gg();break}catch(B){uh(e,B)}while(!0);return In=al=null,$.H=a,$.A=i,He=n,Ne!==null?0:(Je=null,ke=0,qi(),nt)}function Gg(){for(;Ne!==null&&!wi();)mh(Ne)}function mh(e){var t=Hf(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=zf(n,t,t.pendingProps,t.type,void 0,ke);break;case 11:t=zf(n,t,t.pendingProps,t.type.render,t.ref,ke);break;case 5:$r(t);default:Bf(n,t),t=Ne=fd(t,ia),t=Hf(n,t,ia)}e.memoizedProps=e.pendingProps,t===null?Nc(e):Ne=t}function Pl(e,t,n,a){In=al=null,$r(t),Gl=null,Ls=0;var i=t.return;try{if(Cg(e,i,t,n,ke)){nt=1,oc(e,dn(n,e.current)),Ne=null;return}}catch(r){if(i!==null)throw Ne=i,r;nt=1,oc(e,dn(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=Og(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=Dg(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,i,r,f,g,j){e.cancelPendingCommit=null;do wc();while(xt!==0);if((He&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(r=t.lanes|t.childLanes,r|=fr,cn(e,n,r,f,g,j),e===Je&&(Ne=Je=null,ke=0),Fl=t,Oa=e,ca=n,bo=r,No=i,ih=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Zg(ln,function(){return Nh(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=$.T,$.T=null,i=ne.p,ne.p=2,f=He,He|=4;try{Mg(e,t,n)}finally{He=f,ne.p=i,$.T=a}}xt=1,vh(),yh(),jh()}}function vh(){if(xt===1){xt=0;var e=Oa,t=Fl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=$.T,$.T=null;var a=ne.p;ne.p=2;var i=He;He|=4;try{Wf(t,e);var r=Lo,f=ad(e.containerInfo),g=r.focusedElem,j=r.selectionRange;if(f!==g&&g&&g.ownerDocument&&nd(g.ownerDocument.documentElement,g)){if(j!==null&&cr(g)){var O=j.start,B=j.end;if(B===void 0&&(B=O),"selectionStart"in g)g.selectionStart=O,g.selectionEnd=Math.min(B,g.value.length);else{var Z=g.ownerDocument||document,D=Z&&Z.defaultView||window;if(D.getSelection){var M=D.getSelection(),oe=g.textContent.length,pe=Math.min(j.start,oe),Ve=j.end===void 0?pe:Math.min(j.end,oe);!M.extend&&pe>Ve&&(f=Ve,Ve=pe,pe=f);var C=td(g,pe),S=td(g,Ve);if(C&&S&&(M.rangeCount!==1||M.anchorNode!==C.node||M.anchorOffset!==C.offset||M.focusNode!==S.node||M.focusOffset!==S.offset)){var z=Z.createRange();z.setStart(C.node,C.offset),M.removeAllRanges(),pe>Ve?(M.addRange(z),M.extend(S.node,S.offset)):(z.setEnd(S.node,S.offset),M.addRange(z))}}}}for(Z=[],M=g;M=M.parentNode;)M.nodeType===1&&Z.push({element:M,left:M.scrollLeft,top:M.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<Z.length;g++){var q=Z[g];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}Mc=!!Uo,Lo=Uo=null}finally{He=i,ne.p=a,$.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=$.T,$.T=null;var a=ne.p;ne.p=2;var i=He;He|=4;try{Vf(e,t.alternate,t)}finally{He=i,ne.p=a,$.T=n}}xt=3}}function jh(){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,bh(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(za=null),Sl(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=$.T,i=ne.p,ne.p=2,$.T=null;try{for(var r=e.onRecoverableError,f=0;f<a.length;f++){var g=a[f];r(g.value,{componentStack:g.stack})}}finally{$.T=t,ne.p=i}}(ca&3)!==0&&wc(),$n(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===wo?ei++:(ei=0,wo=e):ei=0,ti(0)}}function bh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ms(t)))}function wc(){return vh(),yh(),jh(),Nh()}function Nh(){if(xt!==5)return!1;var e=Oa,t=bo;bo=0;var n=Sl(ca),a=$.T,i=ne.p;try{ne.p=32>n?32:n,$.T=null,n=No,No=null;var r=Oa,f=ca;if(xt=0,Fl=Oa=null,ca=0,(He&6)!==0)throw Error(o(331));var g=He;if(He|=4,ah(r.current),eh(r,r.current,f,n),He=g,ti(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(sn,r)}catch{}return!0}finally{ne.p=i,$.T=a,bh(e,t)}}function wh(e,t,n){t=dn(n,t),t=eo(e.stateNode,t,2),e=Ta(e,t,2),e!==null&&(On(e,2),$n(e))}function Ge(e,t,n){if(e.tag===3)wh(e,e,n);else for(;t!==null;){if(t.tag===3){wh(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=dn(n,e),n=Sf(2),a=Ta(t,n,2),a!==null&&(kf(n,a,t,e),On(a,2),$n(a));break}}t=t.return}}function To(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Hg;var i=new Set;a.set(t,i)}else i=a.get(t),i===void 0&&(i=new Set,a.set(t,i));i.has(n)||(vo=!0,i.add(n),e=Yg.bind(null,e,t,n),t.then(e,e))}function Yg(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Je===e&&(ke&n)===n&&(nt===4||nt===3&&(ke&62914560)===ke&&300>At()-xc?(He&2)===0&&Wl(e,0):yo|=n,Il===ke&&(Il=0)),$n(e)}function Sh(e,t){t===0&&(t=gs()),e=el(e,t),e!==null&&(On(e,t),$n(e))}function Xg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sh(e,n)}function Qg(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),Sh(e,n)}function Zg(e,t){return jl(e,t)}var Sc=null,es=null,Eo=!1,kc=!1,_o=!1,Ma=0;function $n(e){e!==es&&e.next===null&&(es===null?Sc=es=e:es=es.next=e),kc=!0,Eo||(Eo=!0,Kg())}function ti(e,t){if(!_o&&kc){_o=!0;do for(var n=!1,a=Sc;a!==null;){if(e!==0){var i=a.pendingLanes;if(i===0)var r=0;else{var f=a.suspendedLanes,g=a.pingedLanes;r=(1<<31-Ct(42|e)+1)-1,r&=i&~(f&~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===Je?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||da(a,r)||(n=!0,_h(a,r));a=a.next}while(n);_o=!1}}function Vg(){kh()}function kh(){kc=Eo=!1;var e=0;Ma!==0&&lx()&&(e=Ma);for(var t=At(),n=null,a=Sc;a!==null;){var i=a.next,r=Th(a,t);r===0?(a.next=null,n===null?Sc=i:n.next=i,i===null&&(es=n)):(n=a,(e!==0||(r&3)!==0)&&(kc=!0)),a=i}xt!==0&&xt!==5||ti(e),Ma!==0&&(Ma=0)}function Th(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var f=31-Ct(r),g=1<<f,j=i[f];j===-1?((g&n)===0||(g&a)!==0)&&(i[f]=Ei(g,t)):j<=t&&(e.expiredLanes|=g),r&=~g}if(t=Je,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||da(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&an(a),Sl(n)){case 2:case 8:n=Rn;break;case 32:n=ln;break;case 268435456:n=Qa;break;default:n=ln}return a=Eh.bind(null,e),n=jl(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(wc()&&e.callbackNode!==n)return null;var a=ke;return a=Za(e,e===Je?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(wc())return null;rh(e,t,!0)}function Kg(){ix(function(){(He&6)!==0?jl(vn,Vg):kh()})}function Ao(){if(Ma===0){var e=$l;e===0&&(e=ua,ua<<=1,(ua&261888)===0&&(ua=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 Jg(e,t,n,a,i){if(t==="submit"&&n&&n.stateNode===i){var r=Ah((i[it]||null).action),f=a.submitter;f&&(t=(t=f[it]||null)?Ah(t.formAction):f.getAttribute("formAction"),t!==null&&(r=t,f=null));var g=new Li("action","action",null,a,i);e.push({event:g,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Ma!==0){var j=f?Ch(i,f):new FormData(i);Kr(n,{pending:!0,data:j,method:i.method,action:r},null,j)}}else typeof r=="function"&&(g.preventDefault(),j=f?Ch(i,f):new FormData(i),Kr(n,{pending:!0,data:j,method:i.method,action:r},r,j))},currentTarget:i}]})}}for(var Co=0;Co<dr.length;Co++){var Ro=dr[Co],Ig=Ro.toLowerCase(),Fg=Ro[0].toUpperCase()+Ro.slice(1);wn(Ig,"on"+Fg)}wn(id,"onAnimationEnd"),wn(cd,"onAnimationIteration"),wn(rd,"onAnimationStart"),wn("dblclick","onDoubleClick"),wn("focusin","onFocus"),wn("focusout","onBlur"),wn(hg,"onTransitionRun"),wn(mg,"onTransitionStart"),wn(pg,"onTransitionCancel"),wn(od,"onTransitionEnd"),Nn("onMouseEnter",["mouseout","mouseover"]),Nn("onMouseLeave",["mouseout","mouseover"]),Nn("onPointerEnter",["pointerout","pointerover"]),Nn("onPointerLeave",["pointerout","pointerover"]),Dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Dn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ni="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(" "),Wg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ni));function Rh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],i=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var f=a.length-1;0<=f;f--){var g=a[f],j=g.instance,O=g.currentTarget;if(g=g.listener,j!==r&&i.isPropagationStopped())break e;r=g,i.currentTarget=O;try{r(i)}catch(B){Bi(B)}i.currentTarget=null,r=j}else for(f=0;f<a.length;f++){if(g=a[f],j=g.instance,O=g.currentTarget,g=g.listener,j!==r&&i.isPropagationStopped())break e;r=g,i.currentTarget=O;try{r(i)}catch(B){Bi(B)}i.currentTarget=null,r=j}}}}function we(e,t){var n=t[ys];n===void 0&&(n=t[ys]=new Set);var a=e+"__bubble";n.has(a)||(zh(t,e,2,!1),n.add(a))}function zo(e,t,n){var a=0;t&&(a|=4),zh(n,e,a,t)}var Tc="_reactListening"+Math.random().toString(36).slice(2);function Oo(e){if(!e[Tc]){e[Tc]=!0,Ai.forEach(function(n){n!=="selectionchange"&&(Wg.has(n)||zo(n,!1,e),zo(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tc]||(t[Tc]=!0,zo("selectionchange",!1,t))}}function zh(e,t,n,a){switch(cm(t)){case 2:var i=Tx;break;case 8:i=Ex;break;default:i=Ko}n=i.bind(null,t,n,e),i=void 0,!gt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),a?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Do(e,t,n,a,i){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var f=a.tag;if(f===3||f===4){var g=a.stateNode.containerInfo;if(g===i)break;if(f===4)for(f=a.return;f!==null;){var j=f.tag;if((j===3||j===4)&&f.stateNode.containerInfo===i)return;f=f.return}for(;g!==null;){if(f=Yn(g),f===null)return;if(j=f.tag,j===5||j===6||j===26||j===27){a=r=f;continue e}g=g.parentNode}}a=a.return}St(function(){var O=r,B=se(n),Z=[];e:{var D=ud.get(e);if(D!==void 0){var M=Li,oe=e;switch(e){case"keypress":if(Mi(n)===0)break e;case"keydown":case"keyup":M=Qp;break;case"focusin":oe="focus",M=nr;break;case"focusout":oe="blur",M=nr;break;case"beforeblur":case"afterblur":M=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":M=$u;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":M=Op;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":M=Kp;break;case id:case cd:case rd:M=Up;break;case od:M=Ip;break;case"scroll":case"scrollend":M=Rp;break;case"wheel":M=Wp;break;case"copy":case"cut":case"paste":M=Hp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":M=qu;break;case"toggle":case"beforetoggle":M=eg}var pe=(t&4)!==0,Ve=!pe&&(e==="scroll"||e==="scrollend"),C=pe?D!==null?D+"Capture":null:D;pe=[];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&&pe.push(ai(S,q,z))),Ve)break;S=S.return}0<pe.length&&(D=new M(D,oe,null,n,B),Z.push({event:D,listeners:pe}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",M=e==="mouseout"||e==="pointerout",D&&n!==K&&(oe=n.relatedTarget||n.fromElement)&&(Yn(oe)||oe[ha]))break e;if((M||D)&&(D=B.window===B?B:(D=B.ownerDocument)?D.defaultView||D.parentWindow:window,M?(oe=n.relatedTarget||n.toElement,M=O,oe=oe?Yn(oe):null,oe!==null&&(Ve=h(oe),pe=oe.tag,oe!==Ve||pe!==5&&pe!==27&&pe!==6)&&(oe=null)):(M=null,oe=O),M!==oe)){if(pe=$u,q="onMouseLeave",C="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(pe=qu,q="onPointerLeave",C="onPointerEnter",S="pointer"),Ve=M==null?D:Ka(M),z=oe==null?D:Ka(oe),D=new pe(q,S+"leave",M,n,B),D.target=Ve,D.relatedTarget=z,q=null,Yn(B)===O&&(pe=new pe(C,S+"enter",oe,n,B),pe.target=z,pe.relatedTarget=Ve,q=pe),Ve=q,M&&oe)t:{for(pe=Pg,C=M,S=oe,z=0,q=C;q;q=pe(q))z++;q=0;for(var fe=S;fe;fe=pe(fe))q++;for(;0<z-q;)C=pe(C),z--;for(;0<q-z;)S=pe(S),q--;for(;z--;){if(C===S||S!==null&&C===S.alternate){pe=C;break t}C=pe(C),S=pe(S)}pe=null}else pe=null;M!==null&&Oh(Z,D,M,pe,!1),oe!==null&&Ve!==null&&Oh(Z,Ve,oe,pe,!0)}}e:{if(D=O?Ka(O):window,M=D.nodeName&&D.nodeName.toLowerCase(),M==="select"||M==="input"&&D.type==="file")var Me=Ju;else if(Vu(D))if(Iu)Me=ug;else{Me=rg;var ue=cg}else M=D.nodeName,!M||M.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?O&&va(O.elementType)&&(Me=Ju):Me=og;if(Me&&(Me=Me(e,O))){Ku(Z,Me,n,B);break e}ue&&ue(e,D,O),e==="focusout"&&O&&D.type==="number"&&O.memoizedProps.value!=null&&Al(D,"number",D.value)}switch(ue=O?Ka(O):window,e){case"focusin":(Vu(ue)||ue.contentEditable==="true")&&(Rl=ue,rr=O,zs=null);break;case"focusout":zs=rr=Rl=null;break;case"mousedown":or=!0;break;case"contextmenu":case"mouseup":case"dragend":or=!1,ld(Z,n,B);break;case"selectionchange":if(fg)break;case"keydown":case"keyup":ld(Z,n,B)}var je;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?Qu(e,n)&&(Te="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Te="onCompositionStart");Te&&(Gu&&n.locale!=="ko"&&(Cl||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&Cl&&(je=Lu()):(ya=B,Pc="value"in ya?ya.value:ya.textContent,Cl=!0)),ue=Ec(O,Te),0<ue.length&&(Te=new Bu(Te,e,null,n,B),Z.push({event:Te,listeners:ue}),je?Te.data=je:(je=Zu(n),je!==null&&(Te.data=je)))),(je=ng?ag(e,n):lg(e,n))&&(Te=Ec(O,"onBeforeInput"),0<Te.length&&(ue=new Bu("onBeforeInput","beforeinput",null,n,B),Z.push({event:ue,listeners:Te}),ue.data=je)),Jg(Z,e,O,n,B)}Rh(Z,t)})}function ai(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ec(e,t){for(var n=t+"Capture",a=[];e!==null;){var i=e,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=rt(e,n),i!=null&&a.unshift(ai(e,i,r)),i=rt(e,t),i!=null&&a.push(ai(e,i,r))),e.tag===3)return a;e=e.return}return[]}function Pg(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,i){for(var r=t._reactName,f=[];n!==null&&n!==a;){var g=n,j=g.alternate,O=g.stateNode;if(g=g.tag,j!==null&&j===a)break;g!==5&&g!==26&&g!==27||O===null||(j=O,i?(O=rt(n,r),O!=null&&f.unshift(ai(n,O,j))):i||(O=rt(n,r),O!=null&&f.push(ai(n,O,j)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var ex=/\r\n?/g,tx=/\u0000|\uFFFD/g;function Dh(e){return(typeof e=="string"?e:""+e).replace(ex,`
10
+ `).replace(tx,"")}function Mh(e,t){return t=Dh(t),Dh(e)===t}function Ze(e,t,n,a,i,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":ws(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"&&Ze(e,t,"name",i.name,i,null),Ze(e,t,"formEncType",i.formEncType,i,null),Ze(e,t,"formMethod",i.formMethod,i,null),Ze(e,t,"formTarget",i.formTarget,i,null)):(Ze(e,t,"encType",i.encType,i,null),Ze(e,t,"method",i.method,i,null),Ze(e,t,"target",i.target,i,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&&we("scroll",e);break;case"onScrollEnd":a!=null&&we("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(o(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":we("beforetoggle",e),we("toggle",e),Tl(e,"popover",a);break;case"xlinkActuate":on(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":on(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":on(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":on(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":on(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":on(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":on(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":on(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":on(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 Mo(e,t,n,a,i,r){switch(n){case"style":ws(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(o(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&&we("scroll",e);break;case"onScrollEnd":a!=null&&we("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(!bn.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),r=e[it]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,i),typeof a=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,i);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":we("error",e),we("load",e);var a=!1,i=!1,r;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case"src":a=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ze(e,t,r,f,n,null)}}i&&Ze(e,t,"srcSet",n.srcSet,n,null),a&&Ze(e,t,"src",n.src,n,null);return;case"input":we("invalid",e);var g=r=f=i=null,j=null,O=null;for(a in n)if(n.hasOwnProperty(a)){var B=n[a];if(B!=null)switch(a){case"name":i=B;break;case"type":f=B;break;case"checked":j=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(o(137,t));break;default:Ze(e,t,a,B,n,null)}}bs(e,r,g,j,O,f,i,!1);return;case"select":we("invalid",e),a=f=r=null;for(i in n)if(n.hasOwnProperty(i)&&(g=n[i],g!=null))switch(i){case"value":r=g;break;case"defaultValue":f=g;break;case"multiple":a=g;default:Ze(e,t,i,g,n,null)}t=r,n=f,e.multiple=!!a,t!=null?Zn(e,!!a,t,!1):n!=null&&Zn(e,!!a,n,!0);return;case"textarea":we("invalid",e),r=i=a=null;for(f in n)if(n.hasOwnProperty(f)&&(g=n[f],g!=null))switch(f){case"value":a=g;break;case"defaultValue":i=g;break;case"children":r=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(o(91));break;default:Ze(e,t,f,g,n,null)}zi(e,a,i,r);return;case"option":for(j in n)n.hasOwnProperty(j)&&(a=n[j],a!=null)&&(j==="selected"?e.selected=a&&typeof a!="function"&&typeof a!="symbol":Ze(e,t,j,a,n,null));return;case"dialog":we("beforetoggle",e),we("toggle",e),we("cancel",e),we("close",e);break;case"iframe":case"object":we("load",e);break;case"video":case"audio":for(a=0;a<ni.length;a++)we(ni[a],e);break;case"image":we("error",e),we("load",e);break;case"details":we("toggle",e);break;case"embed":case"source":case"link":we("error",e),we("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(o(137,t));default:Ze(e,t,O,a,n,null)}return;default:if(va(t)){for(B in n)n.hasOwnProperty(B)&&(a=n[B],a!==void 0&&Mo(e,t,B,a,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(a=n[g],a!=null&&Ze(e,t,g,a,n,null))}function nx(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 i=null,r=null,f=null,g=null,j=null,O=null,B=null;for(M in n){var Z=n[M];if(n.hasOwnProperty(M)&&Z!=null)switch(M){case"checked":break;case"value":break;case"defaultValue":j=Z;default:a.hasOwnProperty(M)||Ze(e,t,M,null,a,Z)}}for(var D in a){var M=a[D];if(Z=n[D],a.hasOwnProperty(D)&&(M!=null||Z!=null))switch(D){case"type":r=M;break;case"name":i=M;break;case"checked":O=M;break;case"defaultChecked":B=M;break;case"value":f=M;break;case"defaultValue":g=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(o(137,t));break;default:M!==Z&&Ze(e,t,D,M,a,Z)}}js(e,f,g,j,O,B,r,i);return;case"select":M=f=g=D=null;for(r in n)if(j=n[r],n.hasOwnProperty(r)&&j!=null)switch(r){case"value":break;case"multiple":M=j;default:a.hasOwnProperty(r)||Ze(e,t,r,null,a,j)}for(i in a)if(r=a[i],j=n[i],a.hasOwnProperty(i)&&(r!=null||j!=null))switch(i){case"value":D=r;break;case"defaultValue":g=r;break;case"multiple":f=r;default:r!==j&&Ze(e,t,i,r,a,j)}t=g,n=f,a=M,D!=null?Zn(e,!!n,D,!1):!!a!=!!n&&(t!=null?Zn(e,!!n,t,!0):Zn(e,!!n,n?[]:"",!1));return;case"textarea":M=D=null;for(g in n)if(i=n[g],n.hasOwnProperty(g)&&i!=null&&!a.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Ze(e,t,g,null,a,i)}for(f in a)if(i=a[f],r=n[f],a.hasOwnProperty(f)&&(i!=null||r!=null))switch(f){case"value":D=i;break;case"defaultValue":M=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(o(91));break;default:i!==r&&Ze(e,t,f,i,a,r)}Ns(e,D,M);return;case"option":for(var oe in n)D=n[oe],n.hasOwnProperty(oe)&&D!=null&&!a.hasOwnProperty(oe)&&(oe==="selected"?e.selected=!1:Ze(e,t,oe,null,a,D));for(j in a)D=a[j],M=n[j],a.hasOwnProperty(j)&&D!==M&&(D!=null||M!=null)&&(j==="selected"?e.selected=D&&typeof D!="function"&&typeof D!="symbol":Ze(e,t,j,D,a,M));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 pe in n)D=n[pe],n.hasOwnProperty(pe)&&D!=null&&!a.hasOwnProperty(pe)&&Ze(e,t,pe,null,a,D);for(O in a)if(D=a[O],M=n[O],a.hasOwnProperty(O)&&D!==M&&(D!=null||M!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(o(137,t));break;default:Ze(e,t,O,D,a,M)}return;default:if(va(t)){for(var Ve in n)D=n[Ve],n.hasOwnProperty(Ve)&&D!==void 0&&!a.hasOwnProperty(Ve)&&Mo(e,t,Ve,void 0,a,D);for(B in a)D=a[B],M=n[B],!a.hasOwnProperty(B)||D===M||D===void 0&&M===void 0||Mo(e,t,B,D,a,M);return}}for(var C in n)D=n[C],n.hasOwnProperty(C)&&D!=null&&!a.hasOwnProperty(C)&&Ze(e,t,C,null,a,D);for(Z in a)D=a[Z],M=n[Z],!a.hasOwnProperty(Z)||D===M||D==null&&M==null||Ze(e,t,Z,D,a,M)}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 ax(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var i=n[a],r=i.transferSize,f=i.initiatorType,g=i.duration;if(r&&g&&Uh(f)){for(f=0,g=i.responseEnd,a+=1;a<n.length;a++){var j=n[a],O=j.startTime;if(O>g)break;var B=j.transferSize,Z=j.initiatorType;B&&Uh(Z)&&(j=j.responseEnd,f+=B*(j<g?1:(g-O)/(j-O)))}if(--a,t+=8*(r+f)/(i.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 Uo=null,Lo=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 Ho(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 $o=null;function lx(){var e=window.event;return e&&e.type==="popstate"?e===$o?!1:($o=e,!0):($o=null,!1)}var $h=typeof setTimeout=="function"?setTimeout:void 0,sx=typeof clearTimeout=="function"?clearTimeout:void 0,Bh=typeof Promise=="function"?Promise:void 0,ix=typeof queueMicrotask=="function"?queueMicrotask:typeof Bh<"u"?function(e){return Bh.resolve(null).then(e).catch(cx)}:$h;function cx(e){setTimeout(function(){throw e})}function Ua(e){return e==="head"}function qh(e,t){var n=t,a=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(i),ls(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")li(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,li(n);for(var r=n.firstChild;r;){var f=r.nextSibling,g=r.nodeName;r[pa]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=f}}else n==="body"&&li(e.ownerDocument.body);n=i}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 Bo(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":Bo(n),Va(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function rx(e,t,n,a){for(;e.nodeType===1;){var i=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!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=gn(e.nextSibling),e===null)break}return null}function ox(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 qo(e){return e.data==="$?"||e.data==="$~"}function Go(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ux(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 Yo=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(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function li(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=ne.d;ne.d={f:dx,r:fx,D:hx,C:mx,L:px,m:gx,X:vx,S:xx,M:yx};function dx(){var e=ra.f(),t=jc();return e||t}function fx(e){var t=Xn(e);t!==null&&t.tag===5&&t.type==="form"?uf(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 i=wt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),Vh.has(i)||(Vh.add(i),e={rel:e,crossOrigin:n,href:t},a.querySelector(i)===null&&(t=a.createElement("link"),_t(t,"link",e),ct(t),a.head.appendChild(t)))}}function hx(e){ra.D(e),Kh("dns-prefetch",e,null)}function mx(e,t){ra.C(e,t),Kh("preconnect",e,t)}function px(e,t,n){ra.L(e,t,n);var a=ts;if(a&&e&&t){var i='link[rel="preload"][as="'+wt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+wt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+wt(n.imageSizes)+'"]')):i+='[href="'+wt(e)+'"]';var r=i;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(i)!==null||t==="style"&&a.querySelector(si(r))||t==="script"&&a.querySelector(ii(r))||(t=a.createElement("link"),_t(t,"link",e),ct(t),a.head.appendChild(t)))}}function gx(e,t){ra.m(e,t);var n=ts;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+wt(a)+'"][href="'+wt(e)+'"]',r=i;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(i)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ii(r)))return}a=n.createElement("link"),_t(a,"link",e),ct(a),n.head.appendChild(a)}}}function xx(e,t,n){ra.S(e,t,n);var a=ts;if(a&&e){var i=ga(a).hoistableStyles,r=ns(e);t=t||"default";var f=i.get(r);if(!f){var g={loading:0,preload:null};if(f=a.querySelector(si(r)))g.loading=5;else{e=_({rel:"stylesheet",href:e,"data-precedence":t},n),(n=xn.get(r))&&Xo(e,n);var j=f=a.createElement("link");ct(j),_t(j,"link",e),j._p=new Promise(function(O,B){j.onload=O,j.onerror=B}),j.addEventListener("load",function(){g.loading|=1}),j.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Cc(f,t,a)}f={type:"stylesheet",instance:f,count:1,state:g},i.set(r,f)}}}function vx(e,t){ra.X(e,t);var n=ts;if(n&&e){var a=ga(n).hoistableScripts,i=as(e),r=a.get(i);r||(r=n.querySelector(ii(i)),r||(e=_({src:e,async:!0},t),(t=xn.get(i))&&Qo(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(i,r))}}function yx(e,t){ra.M(e,t);var n=ts;if(n&&e){var a=ga(n).hoistableScripts,i=as(e),r=a.get(i);r||(r=n.querySelector(ii(i)),r||(e=_({src:e,async:!0,type:"module"},t),(t=xn.get(i))&&Qo(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(i,r))}}function Jh(e,t,n,a){var i=(i=ve.current)?Ac(i):null;if(!i)throw Error(o(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(i).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(i).hoistableStyles,f=r.get(e);if(f||(i=i.ownerDocument||i,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,f),(r=i.querySelector(si(e)))&&!r._p&&(f.instance=r,f.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||jx(i,e,n,f.state))),t&&a===null)throw Error(o(528,""));return f}if(t&&a!==null)throw Error(o(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(i).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(o(444,e))}}function ns(e){return'href="'+wt(e)+'"'}function si(e){return'link[rel="stylesheet"]['+e+"]"}function Ih(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function jx(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="'+wt(e)+'"]'}function ii(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~="'+wt(n.href)+'"]');if(a)return t.instance=a,ct(a),a;var i=_({},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",i),Cc(a,n.precedence,e),t.instance=a;case"stylesheet":i=ns(n.href);var r=e.querySelector(si(i));if(r)return t.state.loading|=4,t.instance=r,ct(r),r;a=Ih(n),(i=xn.get(i))&&Xo(a,i),r=(e.ownerDocument||e).createElement("link"),ct(r);var f=r;return f._p=new Promise(function(g,j){f.onload=g,f.onerror=j}),_t(r,"link",a),t.state.loading|=4,Cc(r,n.precedence,e),t.instance=r;case"script":return r=as(n.src),(i=e.querySelector(ii(r)))?(t.instance=i,ct(i),i):(a=n,(i=xn.get(r))&&(a=_({},n),Qo(a,i)),e=e.ownerDocument||e,i=e.createElement("script"),ct(i),_t(i,"link",a),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(o(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]'),i=a.length?a[a.length-1]:null,r=i,f=0;f<a.length;f++){var g=a[f];if(g.dataset.precedence===t)r=g;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Xo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Qo(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,i=Rc=new Map;i.set(n,a)}else i=Rc,a=i.get(n),a||(a=new Map,i.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var r=n[i];if(!(r[pa]||r[pt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var f=r.getAttribute(t)||"";f=e+f;var g=a.get(f);g?g.push(r):a.set(f,[r])}}return a}function Ph(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function bx(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 Nx(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 i=ns(a.href),r=t.querySelector(si(i));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),(i=xn.get(i))&&Xo(a,i),r=r.createElement("link"),ct(r);var f=r;f._p=new Promise(function(g,j){f.onload=g,f.onerror=j}),_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 Zo=0;function wx(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&&Zo===0&&(Zo=62500*ax());var i=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>Zo?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(i)}}: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(Sx,e),Oc=null,zc.call(e))}function Sx(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 i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var f=i[r];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),a=f)}a&&n.set(null,a)}i=t.instance,f=i.getAttribute("data-precedence"),r=n.get(f)||a,r===a&&n.set(null,i),n.set(f,i),this.count++,a=zc.bind(this),i.addEventListener("load",a),i.addEventListener("error",a),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ci={$$typeof:ie,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function kx(e,t,n,a,i,r,f,g,j){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=fa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fa(0),this.hiddenUpdates=fa(null),this.identifierPrefix=a,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function tm(e,t,n,a,i,r,f,g,j,O,B,Z){return e=new kx(e,t,n,f,j,O,B,Z,g),t=1,r===!0&&(t|=24),r=Vt(3,null,null,t),e.current=r,r.stateNode=e,t=Sr(),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,i,r){i=nm(i),a.context===null?a.context=i:a.pendingContext=i,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&&(qt(n,e,t),$s(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 Vo(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&&qt(t,e,67108864),Vo(e,67108864)}}function im(e){if(e.tag===13||e.tag===31){var t=Wt();t=xs(t);var n=el(e,t);n!==null&&qt(n,e,t),Vo(e,t)}}var Mc=!0;function Tx(e,t,n,a){var i=$.T;$.T=null;var r=ne.p;try{ne.p=2,Ko(e,t,n,a)}finally{ne.p=r,$.T=i}}function Ex(e,t,n,a){var i=$.T;$.T=null;var r=ne.p;try{ne.p=8,Ko(e,t,n,a)}finally{ne.p=r,$.T=i}}function Ko(e,t,n,a){if(Mc){var i=Jo(a);if(i===null)Do(e,t,a,Uc,n),rm(e,a);else if(Ax(i,e,t,n,a))a.stopPropagation();else if(rm(e,a),t&4&&-1<_x.indexOf(e)){for(;i!==null;){var r=Xn(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var f=zn(r.pendingLanes);if(f!==0){var g=r;for(g.pendingLanes|=2,g.entangledLanes|=2;f;){var j=1<<31-Ct(f);g.entanglements[1]|=j,f&=~j}$n(r),(He&6)===0&&(vc=At()+500,ti(0))}}break;case 31:case 13:g=el(r,2),g!==null&&qt(g,r,2),jc(),Vo(r,2)}if(r=Jo(a),r===null&&Do(e,t,a,Uc,n),r===i)break;i=r}i!==null&&a.stopPropagation()}else Do(e,t,a,null,n)}}function Jo(e){return e=se(e),Io(e)}var Uc=null;function Io(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(Si()){case vn:return 2;case Rn:return 8;case ln:case hs:return 32;case Qa:return 268435456;default:return 32}default:return 32}}var Fo=!1,La=null,Ha=null,$a=null,ri=new Map,oi=new Map,Ba=[],_x="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":$a=null;break;case"pointerover":case"pointerout":ri.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":oi.delete(t.pointerId)}}function ui(e,t,n,a,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:r,targetContainers:[i]},t!==null&&(t=Xn(t),t!==null&&sm(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ax(e,t,n,a,i){switch(t){case"focusin":return La=ui(La,e,t,n,a,i),!0;case"dragenter":return Ha=ui(Ha,e,t,n,a,i),!0;case"mouseover":return $a=ui($a,e,t,n,a,i),!0;case"pointerover":var r=i.pointerId;return ri.set(r,ui(ri.get(r)||null,e,t,n,a,i)),!0;case"gotpointercapture":return r=i.pointerId,oi.set(r,ui(oi.get(r)||null,e,t,n,a,i)),!0}return!1}function om(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,vs(e.priority,function(){im(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,vs(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=Jo(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);K=a,n.target.dispatchEvent(a),K=null}else return t=Xn(n),t!==null&&sm(t),e.blockedOn=n,!1;t.shift()}return!0}function um(e,t,n){Lc(e)&&n.delete(t)}function Cx(){Fo=!1,La!==null&&Lc(La)&&(La=null),Ha!==null&&Lc(Ha)&&(Ha=null),$a!==null&&Lc($a)&&($a=null),ri.forEach(um),oi.forEach(um)}function Hc(e,t){e.blockedOn===t&&(e.blockedOn=null,Fo||(Fo=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Cx)))}var $c=null;function dm(e){$c!==e&&($c=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){$c===e&&($c=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],i=e[t+2];if(typeof a!="function"){if(Io(a||n)===null)continue;break}var r=Xn(n);r!==null&&(e.splice(t,3),t-=3,Kr(r,{pending:!0,data:i,method:n.method,action:a},a,i))}}))}function ls(e){function t(j){return Hc(j,e)}La!==null&&Hc(La,e),Ha!==null&&Hc(Ha,e),$a!==null&&Hc($a,e),ri.forEach(t),oi.forEach(t);for(var n=0;n<Ba.length;n++){var a=Ba[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ba.length&&(n=Ba[0],n.blockedOn===null);)om(n),n.blockedOn===null&&Ba.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var i=n[a],r=n[a+1],f=i[it]||null;if(typeof r=="function")f||dm(n);else if(f){var g=null;if(r&&r.hasAttribute("formAction")){if(i=r,f=r[it]||null)g=f.formAction;else if(Io(i)!==null)continue}else g=f.action;typeof g=="function"?n[a+1]=g:(n.splice(a,3),a-=3),dm(n)}}}function fm(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(f){return i=f})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=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,i=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),i!==null&&(i(),i=null)}}}function Wo(e){this._internalRoot=e}Bc.prototype.render=Wo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,a=Wt();am(n,a,e,t,null,null)},Bc.prototype.unmount=Wo.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),jc(),t[ha]=null}};function Bc(e){this._internalRoot=e}Bc.prototype.unstable_scheduleHydration=function(e){if(e){var t=kl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ba.length&&t!==0&&t<Ba[n].priority;n++);Ba.splice(n,0,e),n===0&&om(e)}};var hm=c.version;if(hm!=="19.2.8")throw Error(o(527,hm,"19.2.8"));ne.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?k(e):null,e=e===null?null:e.stateNode,e};var Rx={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qc.isDisabled&&qc.supportsFiber)try{sn=qc.inject(Rx),yt=qc}catch{}}return fi.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,a="",i=jf,r=bf,f=Nf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=tm(e,1,!1,null,null,n,a,null,i,r,f,fm),e[ha]=t.current,Oo(e),new Wo(t)},fi.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var a=!1,i="",r=jf,f=bf,g=Nf,j=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(j=n.formState)),t=tm(e,1,!0,t,n??null,a,i,j,r,f,g,fm),t.context=nm(null),n=t.current,a=Wt(),a=xs(a),i=ka(a),i.callback=null,Ta(n,i,a),n=a,t.current.lanes=n,On(t,n),$n(t),e[ha]=t.current,Oo(e),new Bc(t)},fi.version="19.2.8",fi}var wm;function Xx(){if(wm)return tu.exports;wm=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(c){console.error(c)}}return s(),tu.exports=Yx(),tu.exports}var Qx=Xx();const Zx="modulepreload",Vx=function(s){return"/"+s},Sm={},Kx=function(c,u,o){let d=Promise.resolve();if(u&&u.length>0){let y=function(x){return Promise.all(x.map(k=>Promise.resolve(k).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=m?.nonce||m?.getAttribute("nonce");d=y(u.map(x=>{if(x=Vx(x),x in Sm)return;Sm[x]=!0;const k=x.endsWith(".css"),_=k?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${_}`))return;const N=document.createElement("link");if(N.rel=k?"stylesheet":Zx,k||(N.as="script"),N.crossOrigin="",N.href=x,p&&N.setAttribute("nonce",p),document.head.appendChild(N),k)return new Promise((U,b)=>{N.addEventListener("load",U),N.addEventListener("error",()=>b(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 d.then(m=>{for(const p of m||[])p.status==="rejected"&&h(p.reason);return c().catch(h)})};function Q({name:s,fill:c,className:u}){return l.jsx("span",{className:`ms material-symbols-rounded${c?" ms-fill":""}${s==="progress_activity"?" ms-spin":""}${u?` ${u}`:""}`,"aria-hidden":!0,children:s})}function Jx(){const[s,c]=w.useState(()=>window.location.hash.slice(1)||"/");return w.useEffect(()=>{const u=()=>c(window.location.hash.slice(1)||"/");return window.addEventListener("hashchange",u),()=>window.removeEventListener("hashchange",u)},[]),s}let hu="kraftwerk inspector",mu="";function rp(){document.title=mu?`${mu} — ${hu}`:hu}function Ix(s){hu=s,rp()}function km(s){mu=s,rp()}function tn(s,c){c?.replace?window.location.replace(`#${s}`):window.location.hash=s}async function op(s){const c=await fetch("/api/projects/start",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({root:s})}),u=await c.json();if(!u.ok)throw new Error(u.error||`HTTP ${c.status}`);if(window.dispatchEvent(new Event("kw-meta-refresh")),u.live&&u.url)return u.url;for(let o=0;o<12;o++){await new Promise(d=>setTimeout(d,1e3));try{const h=(await fetch("/api/meta",{cache:"no-store"}).then(m=>m.json())).switcher?.find(m=>m.root===s&&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:s,...c}){return l.jsx("a",{href:`#${s}`,...c})}const up="kw-expert";let Su=(()=>{try{return localStorage.getItem(up)!=="off"}catch{return!0}})();const pu=new Set;document.documentElement.dataset.expert=Su?"on":"off";function Fx(s){Su=s,document.documentElement.dataset.expert=s?"on":"off";try{localStorage.setItem(up,s?"on":"off")}catch{}pu.forEach(c=>c())}function Cn(){return w.useSyncExternalStore(s=>(pu.add(s),()=>pu.delete(s)),()=>Su)}async function gu(s,c){const u=await fetch(s,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(c??{})}),o=await u.json().catch(()=>({}));return!u.ok&&!o.error&&(o.error=`HTTP ${u.status}`),o}function $e(s,c,u=6e3){const[o,d]=w.useState(null),h=w.useRef(s);return h.current=s,w.useEffect(()=>{let m=!0,p;const y=async()=>{try{const x=await fetch(h.current,{cache:"no-store"});x.ok&&m&&d(await x.json())}catch{}m&&(p=setTimeout(y,c?1500:u))};return y(),()=>{m=!1,clearTimeout(p)}},[s,c,u]),o}function ji(s){if(s==null)return"—";const c=Math.round(s/1e3);return c<60?`${c}s`:`${Math.floor(c/60)}m${String(c%60).padStart(2,"0")}s`}function ku(s){return s==null?"—":`$${s.toFixed(2)}`}function Xc(s){return s?s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s):"0"}function Tu(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} K`:`${(s/1024/1024).toFixed(1)} M`}function gl(s){if(!s)return"—";const c=new Date(s),u=new Date,o=c.toDateString()===u.toDateString(),d=c.toTimeString().slice(0,5);return o?d:`${c.toISOString().slice(5,10)} ${d}`}function cs(s){if(!s)return"—";const c=Date.now()-Date.parse(s);if(c<6e4)return"just now";const u=Math.floor(c/6e4);if(u<60)return`${u}m ago`;const o=Math.floor(u/60);if(o<24)return`${o}h ago`;const d=Math.floor(o/24);return d<7?`${d}d ago`:new Date(s).toISOString().slice(5,10)}function Eu({since:s}){const[,c]=w.useState(0);return w.useEffect(()=>{const u=setInterval(()=>c(o=>o+1),1e3);return()=>clearInterval(u)},[]),s?l.jsx("span",{className:"num",children:ji(Date.now()-Date.parse(s))}):null}function Jc({status:s}){return l.jsx("span",{className:`lamp ${s}`})}function Wx({status:s}){return l.jsx("span",{className:`status-word ${s}`,children:s})}function _u(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yl=_u();function dp(s){yl=s}var pl={exec:()=>null};function ss(s){let c=[];return u=>{let o=Math.max(0,Math.min(3,u-1)),d=c[o];return d||(d=s(o),c[o]=d),d}}function Se(s,c=""){let u=typeof s=="string"?s:s.source,o={replace:(d,h)=>{let m=typeof h=="string"?h:h.source;return m=m.replace(Ot.caret,"$1"),u=u.replace(d,m),o},getRegex:()=>new RegExp(u,c)};return o}var Px=((s="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+s)}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:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ss(s=>new RegExp(`^ {0,${s}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ss(s=>new RegExp(`^ {0,${s}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:ss(s=>new RegExp(`^ {0,${s}}(?:\`\`\`|~~~)`)),headingBeginRegex:ss(s=>new RegExp(`^ {0,${s}}#`)),htmlBeginRegex:ss(s=>new RegExp(`^ {0,${s}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:ss(s=>new RegExp(`^ {0,${s}}>`))},ev=/^(?:[ \t]*(?:\n|$))+/,tv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,nv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,bi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,av=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Au=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,fp=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hp=Se(fp).replace(/bull/g,Au).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(),lv=Se(fp).replace(/bull/g,Au).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(),Cu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,sv=/^[^\n]+/,Ru=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,iv=Se(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ru).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),cv=Se(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Au).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",zu=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,rv=Se("^ {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",zu).replace("tag",Ic).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),mp=s=>Se(Cu).replace("hr",bi).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",s).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ic).getRegex(),ov=mp(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),uv=mp(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),dv=Se(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",uv).getRegex(),Ou={blockquote:dv,code:tv,def:iv,fences:nv,heading:av,hr:bi,html:rv,lheading:hp,list:cv,newline:ev,paragraph:ov,table:pl,text:sv},Tm=Se("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",bi).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(),fv={...Ou,lheading:lv,table:Tm,paragraph:Se(Cu).replace("hr",bi).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()},hv={...Ou,html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zu).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:Se(Cu).replace("hr",bi).replace("heading",` *#{1,6} *[^
11
+ ]`).replace("lheading",hp).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},mv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,pv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pp=/^( {2,}|\\)\n(?!\s*$)/,gv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,oa=/[\p{P}\p{S}]/u,os=/[\s\p{P}\p{S}]/u,Ni=/[^\s\p{P}\p{S}]/u,xv=Se(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,os).getRegex(),vv=/[\p{Pi}\p{Ps}"']/u,gp=/(?!~)[\p{P}\p{S}]/u,yv=/(?!~)[\s\p{P}\p{S}]/u,jv=/(?:[^\s\p{P}\p{S}]|~)/u,bv=Se(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Px?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xp=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Nv=Se(xp,"u").replace(/punct/g,oa).getRegex(),wv=Se(xp,"u").replace(/punct/g,gp).getRegex(),Sv=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,kv=Se(Sv,"u").replace(/openQuote/g,vv).replace(/punct/g,oa).getRegex(),vp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Tv=Se(vp,"gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,os).replace(/punct/g,oa).getRegex(),Ev=Se(vp,"gu").replace(/notPunctSpace/g,jv).replace(/punctSpace/g,yv).replace(/punct/g,gp).getRegex(),_v="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Av=Se(_v,"gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,os).replace(/punct/g,oa).getRegex(),Cv=Se("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,os).replace(/punct/g,oa).getRegex(),Rv="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",zv=Se(Rv,"gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,os).replace(/punct/g,oa).getRegex(),Ov=Se(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,oa).getRegex(),Dv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Mv=Se(Dv,"gu").replace(/notPunctSpace/g,Ni).replace(/punctSpace/g,os).replace(/punct/g,oa).getRegex(),Uv=Se(/\\(punct)/,"gu").replace(/punct/g,oa).getRegex(),Lv=Se(/^<(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(),Hv=Se(zu).replace("(?:-->|$)","-->").getRegex(),$v=Se("^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",Hv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Bv=Se(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Qc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yp=Se(/^!?\[(label)\]\[(ref)\]/).replace("label",Qc).replace("ref",Ru).getRegex(),jp=Se(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ru).getRegex(),qv=Se("reflink|nolink(?!\\()","g").replace("reflink",yp).replace("nolink",jp).getRegex(),Em=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Du={_backpedal:pl,anyPunctuation:Uv,autolink:Lv,blockSkip:bv,br:pp,code:pv,del:pl,delLDelim:pl,delRDelim:pl,emStrongLDelim:Nv,emStrongRDelimAst:Tv,emStrongRDelimUnd:Cv,escape:mv,link:Bv,nolink:jp,punctuation:xv,reflink:yp,reflinkSearch:qv,tag:$v,text:gv,url:pl},Gv={...Du,emStrongLDelim:kv,emStrongRDelimAst:Av,emStrongRDelimUnd:zv,link:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",Qc).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qc).getRegex()},xu={...Du,emStrongRDelimAst:Ev,emStrongLDelim:wv,delLDelim:Ov,delRDelim:Mv,url:Se(/^((?: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:Se(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {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()},Yv={...xu,br:Se(pp).replace("{2,}","*").getRegex(),text:Se(xu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Gc={normal:Ou,gfm:fv,pedantic:hv},hi={normal:Du,gfm:xu,breaks:Yv,pedantic:Gv},Xv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_m=s=>Xv[s];function Bn(s,c){if(c){if(Ot.escapeTest.test(s))return s.replace(Ot.escapeReplace,_m)}else if(Ot.escapeTestNoEncode.test(s))return s.replace(Ot.escapeReplaceNoEncode,_m);return s}function Am(s){try{s=encodeURI(s).replace(Ot.percentDecode,"%")}catch{return null}return s}function Cm(s,c){let u=s.replace(Ot.findPipe,(h,m,p)=>{let y=!1,x=m;for(;--x>=0&&p[x]==="\\";)y=!y;return y?"|":" |"}),o=u.split(Ot.splitPipe),d=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),c)if(o.length>c)o.splice(c);else for(;o.length<c;)o.push("");for(;d<o.length;d++)o[d]=o[d].trim().replace(Ot.slashPipe,"|");return o}function Ga(s,c,u){let o=s.length;if(o===0)return"";let d=0;for(;d<o&&s.charAt(o-d-1)===c;)d++;return s.slice(0,o-d)}function Rm(s){let c=s.split(`
12
+ `),u=c.length-1;for(;u>=0&&Ot.blankLine.test(c[u]);)u--;return c.length-u<=2?s:c.slice(0,u+1).join(`
13
+ `)}function Qv(s,c){if(s.indexOf(c[1])===-1)return-1;let u=0;for(let o=0;o<s.length;o++)if(s[o]==="\\")o++;else if(s[o]===c[0])u++;else if(s[o]===c[1]&&(u--,u<0))return o;return u>0?-2:-1}function Zv(s,c=0){let u=c,o="";for(let d of s)if(d===" "){let h=4-u%4;o+=" ".repeat(h),u+=h}else o+=d,u++;return o}function zm(s,c,u,o,d){let h=c.href,m=c.title||null,p=s[1].replace(d.other.outputLinkReplace,"$1"),y=s[0].charAt(0)==="!";o.state.inLink=!0;let x=o.state.linkEmitted,k=o.state.inRawBlock;o.state.linkEmitted=!1;let _=o.inlineTokens(p),N=o.state.linkEmitted;if(o.state.linkEmitted=x,o.state.inLink=!1,!y){if(N){o.state.inRawBlock=k;return}o.state.linkEmitted=!0}return{type:y?"image":"link",raw:u,href:h,title:m,text:p,tokens:_}}function Vv(s,c,u){let o=s.match(u.other.indentCodeCompensation);if(o===null)return c;let d=o[1];return c.split(`
14
+ `).map(h=>{let m=h.match(u.other.beginningSpace);if(m===null)return h;let[p]=m;return p.length>=d.length?h.slice(d.length):h}).join(`
15
+ `)}var Zc=class{options;rules;lexer;constructor(s){this.options=s||yl}space(s){let c=this.rules.block.newline.exec(s);if(c&&c[0].length>0)return{type:"space",raw:c[0]}}code(s){let c=this.rules.block.code.exec(s);if(c){let u=this.options.pedantic?c[0]:Rm(c[0]),o=u.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:u,codeBlockStyle:"indented",text:o}}}fences(s){let c=this.rules.block.fences.exec(s);if(c){let u=c[0],o=Vv(u,c[3]||"",this.rules);return{type:"code",raw:u,lang:c[2]?c[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):c[2],text:o}}}heading(s){let c=this.rules.block.heading.exec(s);if(c){let u=c[2].trim();if(this.rules.other.endingHash.test(u)){let o=Ga(u,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(u=o.trim())}return{type:"heading",raw:Ga(c[0],`
16
+ `),depth:c[1].length,text:u,tokens:this.lexer.inline(u)}}}hr(s){let c=this.rules.block.hr.exec(s);if(c)return{type:"hr",raw:Ga(c[0],`
17
+ `)}}blockquote(s){let c=this.rules.block.blockquote.exec(s);if(c){let u=Ga(c[0],`
18
+ `).split(`
19
+ `),o="",d="",h=[];for(;u.length>0;){let m=!1,p=[],y;for(y=0;y<u.length;y++)if(this.rules.other.blockquoteStart.test(u[y]))p.push(u[y]),m=!0;else if(!m)p.push(u[y]);else break;u=u.slice(y);let x=p.join(`
20
+ `),k=x.replace(this.rules.other.blockquoteSetextReplace,`
21
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
22
+ ${x}`:x,d=d?`${d}
23
+ ${k}`:k;let _=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(k,h,!0),this.lexer.state.top=_,u.length===0)break;let N=h.at(-1);if(N?.type==="code")break;if(N?.type==="blockquote"){let U=N,b=u.join(`
24
+ `),J=U.raw+`
25
+ `+b.replace(this.rules.other.blockquoteSetextReplace2,""),H=this.blockquote(J);h[h.length-1]=H,o=`${o}
26
+ ${b}`,d=d.substring(0,d.length-U.text.length)+H.text;break}else if(N?.type==="list"){let U=N,b=U.raw+`
27
+ `+u.join(`
28
+ `),J=this.list(b);h[h.length-1]=J,o=o.substring(0,o.length-N.raw.length)+J.raw,d=d.substring(0,d.length-U.raw.length)+J.raw,u=b.substring(h.at(-1).raw.length).split(`
29
+ `);continue}}return{type:"blockquote",raw:o,tokens:h,text:d}}}list(s){let c=this.rules.block.list.exec(s);if(c){let u=c[1].trim(),o=u.length>1,d={type:"list",raw:"",ordered:o,start:o?+u.slice(0,-1):"",loose:!1,items:[]};u=o?`\\d{1,9}\\${u.slice(-1)}`:`\\${u}`,this.options.pedantic&&(u=o?u:"[*+-]");let h=this.rules.other.listItemRegex(u),m=!1;for(;s;){let y=!1,x="",k="";if(!(c=h.exec(s))||this.rules.block.hr.test(s))break;x=c[0],s=s.substring(x.length);let _=Zv(c[2].split(`
30
+ `,1)[0],c[1].length),N=s.split(`
31
+ `,1)[0],U=!_.trim(),b=0;if(this.options.pedantic?(b=2,k=_.trimStart()):U?b=c[1].length+1:(b=_.search(this.rules.other.nonSpaceChar),b=b>4?1:b,k=_.slice(b),b+=c[1].length),U&&this.rules.other.blankLine.test(N)&&(x+=N+`
32
+ `,s=s.substring(N.length+1),y=!0),!y){let J=this.rules.other.nextBulletRegex(b),H=this.rules.other.hrRegex(b),E=this.rules.other.fencesBeginRegex(b),te=this.rules.other.headingBeginRegex(b),ie=this.rules.other.htmlBeginRegex(b),Y=this.rules.other.blockquoteBeginRegex(b);for(;s;){let F=s.split(`
33
+ `,1)[0],R;if(N=F,this.options.pedantic?(N=N.replace(this.rules.other.listReplaceNesting," "),R=N):R=N.replace(this.rules.other.tabCharGlobal," "),E.test(N)||te.test(N)||ie.test(N)||Y.test(N)||J.test(N)||H.test(N))break;if(R.search(this.rules.other.nonSpaceChar)>=b||!N.trim())k+=`
34
+ `+R.slice(b);else{if(U||_.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(_)||te.test(_)||H.test(_))break;k+=`
35
+ `+N}U=!N.trim(),x+=F+`
36
+ `,s=s.substring(F.length+1),_=R.slice(b)}}d.loose||(m?d.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(m=!0)),d.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(k),loose:!1,text:k,tokens:[]}),d.raw+=x}let p=d.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;d.raw=d.raw.trimEnd();for(let y of d.items)if(this.lexer.state.top=!1,y.tokens=this.lexer.blockTokens(y.text,[]),!d.loose){let x=y.tokens.filter(_=>_.type==="space"),k=x.length>0&&x.some(_=>this.rules.other.anyLine.test(_.raw));d.loose=k}for(let y of d.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 k=this.rules.other.listTaskCheckbox.exec(y.raw);if(k){let _={type:"checkbox",raw:k[0]+" ",checked:k[0]!=="[ ]"};y.checked=_.checked,d.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(d.loose)for(let y of d.items){y.loose=!0;for(let x of y.tokens)x.type==="text"&&(x.type="paragraph")}return d}}html(s){let c=this.rules.block.html.exec(s);if(c){let u=Rm(c[0]);return{type:"html",block:!0,raw:u,pre:c[1]==="pre"||c[1]==="script"||c[1]==="style",text:u}}}def(s){let c=this.rules.block.def.exec(s);if(c){let u=c[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=c[2]?c[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=c[3]?c[3].substring(1,c[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):c[3];return{type:"def",tag:u,raw:Ga(c[0],`
37
+ `),href:o,title:d}}}table(s){let c=this.rules.block.table.exec(s);if(!c||!this.rules.other.tableDelimiter.test(c[2]))return;let u=Cm(c[1]),o=c[2].replace(this.rules.other.tableAlignChars,"").split("|"),d=c[3]?.trim()?c[3].replace(this.rules.other.tableRowBlankLine,"").split(`
38
+ `):[],h={type:"table",raw:Ga(c[0],`
39
+ `),header:[],align:[],rows:[]};if(u.length===o.length){for(let m of o)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<u.length;m++)h.header.push({text:u[m],tokens:this.lexer.inline(u[m]),header:!0,align:h.align[m]});for(let m of d)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(s){let c=this.rules.block.lheading.exec(s);if(c){let u=c[1].trim();return{type:"heading",raw:Ga(c[0],`
40
+ `),depth:c[2].charAt(0)==="="?1:2,text:u,tokens:this.lexer.inline(u)}}}paragraph(s){let c=this.rules.block.paragraph.exec(s);if(c){let u=c[1].charAt(c[1].length-1)===`
41
+ `?c[1].slice(0,-1):c[1];return{type:"paragraph",raw:c[0],text:u,tokens:this.lexer.inline(u)}}}text(s){let c=this.rules.block.text.exec(s);if(c)return{type:"text",raw:c[0],text:c[0],tokens:this.lexer.inline(c[0])}}escape(s){let c=this.rules.inline.escape.exec(s);if(c)return{type:"escape",raw:c[0],text:c[1]}}tag(s){let c=this.rules.inline.tag.exec(s);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(s){let c=this.rules.inline.link.exec(s);if(c){let u=c[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(u)){if(!this.rules.other.endAngleBracket.test(u))return;let h=Ga(u.slice(0,-1),"\\");if((u.length-h.length)%2===0)return}else{let h=Qv(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 o=c[2],d="";if(this.options.pedantic){let h=this.rules.other.pedanticHrefTitle.exec(o);h&&(o=h[1],d=h[3])}else d=c[3]?c[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(u)?o=o.slice(1):o=o.slice(1,-1)),zm(c,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},c[0],this.lexer,this.rules)}}reflink(s,c){let u;if((u=this.rules.inline.reflink.exec(s))||(u=this.rules.inline.nolink.exec(s))){let o=(u[2]||u[1]).replace(this.rules.other.multipleSpaceGlobal," "),d=c[o.toLowerCase()];if(!d){let h=u[0].charAt(0);return{type:"text",raw:h,text:h}}return zm(u,d,u[0],this.lexer,this.rules)}}emStrong(s,c,u=""){let o=this.rules.inline.emStrongLDelim.exec(s);if(!(!o||!o[1]&&!o[2]&&!o[3]&&!o[4]||o[4]&&u.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[3])||!u||this.rules.inline.punctuation.exec(u))){let d=[...o[0]].length-1,h,m,p=d,y=0,x=o[0][0],k=u===x,_=x==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(_.lastIndex=0,c=c.slice(-1*s.length+d);(o=_.exec(c))!==null;){if(h=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!h)continue;if(m=[...h].length,o[3]||o[4]){p+=m;continue}else if(o[5]||o[6]){if(d%3&&!((d+m)%3)){y+=m;continue}if(k)break}if(p-=m,p>0)continue;m=Math.min(m,m+p+y);let N=[...o[0]][0].length,U=s.slice(0,d+o.index+N+m);if(Math.min(d,m)%2){let J=U.slice(1,-1);return{type:"em",raw:U,text:J,tokens:this.lexer.inlineTokens(J)}}let b=U.slice(2,-2);return{type:"strong",raw:U,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(s){let c=this.rules.inline.code.exec(s);if(c){let u=c[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(u),d=this.rules.other.startingSpaceChar.test(u)&&this.rules.other.endingSpaceChar.test(u);return o&&d&&(u=u.substring(1,u.length-1)),{type:"codespan",raw:c[0],text:u}}}br(s){let c=this.rules.inline.br.exec(s);if(c)return{type:"br",raw:c[0]}}del(s,c,u=""){let o=this.rules.inline.delLDelim.exec(s);if(o&&(!o[1]||!u||this.rules.inline.punctuation.exec(u))){let d=[...o[0]].length-1,h,m,p=d,y=this.rules.inline.delRDelim;for(y.lastIndex=0,c=c.slice(-1*s.length+d);(o=y.exec(c))!==null;){if(h=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!h||(m=[...h].length,m!==d))continue;if(o[3]||o[4]){p+=m;continue}if(p-=m,p>0)continue;m=Math.min(m,m+p);let x=[...o[0]][0].length,k=s.slice(0,d+o.index+x+m),_=k.slice(d,-d);return{type:"del",raw:k,text:_,tokens:this.lexer.inlineTokens(_)}}}}autolink(s){let c=this.rules.inline.autolink.exec(s);if(c){let u,o;return c[2]==="@"?(u=c[1],o="mailto:"+u):(u=c[1],o=u),{type:"link",raw:c[0],text:u,href:o,tokens:[{type:"text",raw:u,text:u}]}}}url(s){let c;if(c=this.rules.inline.url.exec(s)){let u,o;if(c[2]==="@")u=c[0],o="mailto:"+u;else{let d;do d=c[0],c[0]=this.rules.inline._backpedal.exec(c[0])?.[0]??"";while(d!==c[0]);u=c[0],c[1]==="www."?o="http://"+c[0]:o=c[0]}return{type:"link",raw:c[0],text:u,href:o,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(s){let c=this.rules.inline.text.exec(s);if(c){let u=this.lexer.state.inRawBlock;return{type:"text",raw:c[0],text:c[0],escaped:u}}}},_n=class vu{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 u={other:Ot,block:Gc.normal,inline:hi.normal};this.options.pedantic?(u.block=Gc.pedantic,u.inline=hi.pedantic):this.options.gfm&&(u.block=Gc.gfm,this.options.breaks?u.inline=hi.breaks:u.inline=hi.gfm),this.tokenizer.rules=u}static get rules(){return{block:Gc,inline:hi}}static lex(c,u){return new vu(u).lex(c)}static lexInline(c,u){return new vu(u).inlineTokens(c)}lex(c){c=c.replace(Ot.carriageReturn,`
42
+ `),this.blockTokens(c,this.tokens);for(let u=0;u<this.inlineQueue.length;u++){let o=this.inlineQueue[u];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(c,u=[],o=!1){this.tokenizer.lexer=this,this.options.pedantic&&(c=c.replace(Ot.tabCharGlobal," ").replace(Ot.spaceLine,""));let d=1/0;for(;c;){if(c.length<d)d=c.length;else{this.infiniteLoopError(c.charCodeAt(0));break}let h;if(this.options.extensions?.block?.some(p=>(h=p.call({lexer:this},c,u))?(c=c.substring(h.raw.length),u.push(h),!0):!1))continue;if(h=this.tokenizer.space(c)){c=c.substring(h.raw.length);let p=u.at(-1);h.raw.length===1&&p!==void 0?p.raw+=`
43
+ `:u.push(h);continue}if(h=this.tokenizer.code(c)){c=c.substring(h.raw.length);let p=u.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):u.push(h);continue}if(h=this.tokenizer.fences(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.heading(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.hr(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.blockquote(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.list(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.html(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.def(c)){c=c.substring(h.raw.length);let p=u.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},u.push(h));continue}if(h=this.tokenizer.table(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.lheading(c)){c=c.substring(h.raw.length),u.push(h);continue}let m=c;if(this.options.extensions?.startBlock){let p=1/0,y=c.slice(1),x;this.options.extensions.startBlock.forEach(k=>{x=k.call({lexer:this},y),typeof x=="number"&&x>=0&&(p=Math.min(p,x))}),p<1/0&&p>=0&&(m=c.substring(0,p+1))}if(this.state.top&&(h=this.tokenizer.paragraph(m))){let p=u.at(-1);o&&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):u.push(h),o=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=u.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):u.push(h);continue}if(c){this.infiniteLoopError(c.charCodeAt(0));break}}return this.state.top=!0,u}inline(c,u=[]){return this.inlineQueue.push({src:c,tokens:u}),u}linkInText(c){if(!c.includes("["))return!1;let u=this.tokenizer.rules.inline.link;for(let o of c.matchAll(this.tokenizer.rules.inline.blockSkip))if(u.test(o[0])&&c.charAt(o.index-1)!=="!")return!0;for(let o of c.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let d=o[0],h=d.lastIndexOf("[");if(!(d.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,d.slice(h+1,-1)))&&!(h>1&&this.linkInText(d.slice(1,h-1))))return!0}return!1}inlineTokens(c,u=[]){this.tokenizer.lexer=this;let o=c;if(this.tokens.links&&c.includes("[")){let p=this.tokenizer.rules.inline.reflinkSearch,y=x=>{let k=x.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,x.slice(k+1,-1)))return x;if(k>1&&x.charAt(0)!=="!"){let _=x.slice(1,k-1);if(this.linkInText(_))return"["+_.replace(p,y)+"]["+"a".repeat(x.length-k-2)+"]"}return"["+"a".repeat(x.length-2)+"]"};o=o.replace(p,y)}o=o.replace(this.tokenizer.rules.inline.anyPunctuation,p=>"+".repeat(p.length)),o=o.replace(this.tokenizer.rules.inline.blockSkip,(p,y,x)=>{let k=x?x.length:0;return p.slice(0,k)+"["+"a".repeat(p.length-k-2)+"]"}),o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let d=!1,h="",m=1/0;for(;c;){if(c.length<m)m=c.length;else{this.infiniteLoopError(c.charCodeAt(0));break}d||(h=""),d=!1;let p;if(this.options.extensions?.inline?.some(x=>(p=x.call({lexer:this},c,u))?(c=c.substring(p.raw.length),u.push(p),!0):!1))continue;if(p=this.tokenizer.escape(c)){c=c.substring(p.raw.length),u.push(p);continue}if(p=this.tokenizer.tag(c)){c=c.substring(p.raw.length),u.push(p);continue}if(p=this.tokenizer.link(c)){c=c.substring(p.raw.length),u.push(p);continue}if(p=this.tokenizer.reflink(c,this.tokens.links)){c=c.substring(p.raw.length);let x=u.at(-1);p.type==="text"&&x?.type==="text"?(x.raw+=p.raw,x.text+=p.text):u.push(p);continue}if(p=this.tokenizer.emStrong(c,o,h)){c=c.substring(p.raw.length),u.push(p);continue}if(p=this.tokenizer.codespan(c)){c=c.substring(p.raw.length),u.push(p);continue}if(p=this.tokenizer.br(c)){c=c.substring(p.raw.length),u.push(p);continue}if(p=this.tokenizer.del(c,o,h)){c=c.substring(p.raw.length),u.push(p);continue}if(p=this.tokenizer.autolink(c)){c=c.substring(p.raw.length),u.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(c))){c=c.substring(p.raw.length),u.push(p);continue}let y=c;if(this.options.extensions?.startInline){let x=1/0,k=c.slice(1),_;this.options.extensions.startInline.forEach(N=>{_=N.call({lexer:this},k),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)),d=!0;let x=u.at(-1);x?.type==="text"?(x.raw+=p.raw,x.text+=p.text):u.push(p);continue}if(c){this.infiniteLoopError(c.charCodeAt(0));break}}return u}infiniteLoopError(c){let u="Infinite loop on byte: "+c;if(this.options.silent)console.error(u);else throw new Error(u)}},Vc=class{options;parser;constructor(s){this.options=s||yl}space(s){return""}code({text:s,lang:c,escaped:u}){let o=(c||"").match(Ot.notSpaceStart)?.[0],d=s.replace(Ot.endingNewline,"")+`
56
+ `;return o?'<pre><code class="language-'+Bn(o)+'">'+(u?d:Bn(d,!0))+`</code></pre>
57
+ `:"<pre><code>"+(u?d:Bn(d,!0))+`</code></pre>
58
+ `}blockquote({tokens:s}){return`<blockquote>
59
+ ${this.parser.parse(s)}</blockquote>
60
+ `}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:c}){return`<h${c}>${this.parser.parseInline(s)}</h${c}>
61
+ `}hr(s){return`<hr>
62
+ `}list(s){let c=s.ordered,u=s.start,o="";for(let m=0;m<s.items.length;m++){let p=s.items[m];o+=this.listitem(p)}let d=c?"ol":"ul",h=c&&u!==1?' start="'+u+'"':"";return"<"+d+h+`>
63
+ `+o+"</"+d+`>
64
+ `}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
65
+ `}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
66
+ `}table(s){let c="",u="";for(let d=0;d<s.header.length;d++)u+=this.tablecell(s.header[d]);c+=this.tablerow({text:u});let o="";for(let d=0;d<s.rows.length;d++){let h=s.rows[d];u="";for(let m=0;m<h.length;m++)u+=this.tablecell(h[m]);o+=this.tablerow({text:u})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
67
+ <thead>
68
+ `+c+`</thead>
69
+ `+o+`</table>
70
+ `}tablerow({text:s}){return`<tr>
71
+ ${s}</tr>
72
+ `}tablecell(s){let c=this.parser.parseInline(s.tokens),u=s.header?"th":"td";return(s.align?`<${u} align="${s.align}">`:`<${u}>`)+c+`</${u}>
73
+ `}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${Bn(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:c,tokens:u}){let o=this.parser.parseInline(u),d=Am(s);if(d===null)return o;s=d;let h='<a href="'+s+'"';return c&&(h+=' title="'+Bn(c)+'"'),h+=">"+o+"</a>",h}image({href:s,title:c,text:u,tokens:o}){o&&(u=this.parser.parseInline(o,this.parser.textRenderer));let d=Am(s);if(d===null)return Bn(u);s=d;let h=`<img src="${s}" alt="${Bn(u)}"`;return c&&(h+=` title="${Bn(c)}"`),h+=">",h}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:Bn(s.text)}},Mu=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},An=class yu{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 Mu}static parse(c,u){return new yu(u).parse(c)}static parseInline(c,u){return new yu(u).parseInline(c)}parse(c){this.renderer.parser=this;let u="";for(let o=0;o<c.length;o++){let d=c[o];if(this.options.extensions?.renderers?.[d.type]){let m=d,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)){u+=p||"";continue}}let h=d;switch(h.type){case"space":{u+=this.renderer.space(h);break}case"hr":{u+=this.renderer.hr(h);break}case"heading":{u+=this.renderer.heading(h);break}case"code":{u+=this.renderer.code(h);break}case"table":{u+=this.renderer.table(h);break}case"blockquote":{u+=this.renderer.blockquote(h);break}case"list":{u+=this.renderer.list(h);break}case"checkbox":{u+=this.renderer.checkbox(h);break}case"html":{u+=this.renderer.html(h);break}case"def":{u+=this.renderer.def(h);break}case"paragraph":{u+=this.renderer.paragraph(h);break}case"text":{u+=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 u}parseInline(c,u=this.renderer){this.renderer.parser=this;let o="";for(let d=0;d<c.length;d++){let h=c[d];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)){o+=p||"";continue}}let m=h;switch(m.type){case"escape":{o+=u.text(m);break}case"html":{o+=u.html(m);break}case"link":{o+=u.link(m);break}case"image":{o+=u.image(m);break}case"checkbox":{o+=u.checkbox(m);break}case"strong":{o+=u.strong(m);break}case"em":{o+=u.em(m);break}case"codespan":{o+=u.codespan(m);break}case"br":{o+=u.br(m);break}case"del":{o+=u.del(m);break}case"text":{o+=u.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 o}},xi=class{options;block;constructor(s){this.options=s||yl}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(s=this.block){return s?_n.lex:_n.lexInline}provideParser(s=this.block){return s?An.parse:An.parseInline}},Kv=class{defaults=_u();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=An;Renderer=Vc;TextRenderer=Mu;Lexer=_n;Tokenizer=Zc;Hooks=xi;constructor(...s){this.use(...s)}walkTokens(s,c){let u=[];for(let o of s)switch(u=u.concat(c.call(this,o)),o.type){case"table":{let d=o;for(let h of d.header)u=u.concat(this.walkTokens(h.tokens,c));for(let h of d.rows)for(let m of h)u=u.concat(this.walkTokens(m.tokens,c));break}case"list":{let d=o;u=u.concat(this.walkTokens(d.items,c));break}default:{let d=o;this.defaults.extensions?.childTokens?.[d.type]?this.defaults.extensions.childTokens[d.type].forEach(h=>{let m=d[h].flat(1/0);u=u.concat(this.walkTokens(m,c))}):d.tokens&&(u=u.concat(this.walkTokens(d.tokens,c)))}}return u}use(...s){let c=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(u=>{let o={...u};if(o.async=this.defaults.async||o.async||!1,u.extensions&&(u.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){let h=c.renderers[d.name];h?c.renderers[d.name]=function(...m){let p=d.renderer.apply(this,m);return p===!1&&(p=h.apply(this,m)),p}:c.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let h=c[d.level];h?h.unshift(d.tokenizer):c[d.level]=[d.tokenizer],d.start&&(d.level==="block"?c.startBlock?c.startBlock.push(d.start):c.startBlock=[d.start]:d.level==="inline"&&(c.startInline?c.startInline.push(d.start):c.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(c.childTokens[d.name]=d.childTokens)}),o.extensions=c),u.renderer){let d=this.defaults.renderer||new Vc(this.defaults);for(let h in u.renderer){if(!(h in d))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;let m=h,p=u.renderer[m],y=d[m];d[m]=(...x)=>{let k=p.apply(d,x);return k===!1&&(k=y.apply(d,x)),k||""}}o.renderer=d}if(u.tokenizer){let d=this.defaults.tokenizer||new Zc(this.defaults);for(let h in u.tokenizer){if(!(h in d))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;let m=h,p=u.tokenizer[m],y=d[m];d[m]=(...x)=>{let k=p.apply(d,x);return k===!1&&(k=y.apply(d,x)),k}}o.tokenizer=d}if(u.hooks){let d=this.defaults.hooks||new xi;for(let h in u.hooks){if(!(h in d))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;let m=h,p=u.hooks[m],y=d[m];xi.passThroughHooks.has(h)?d[m]=x=>{if(this.defaults.async&&xi.passThroughHooksRespectAsync.has(h))return(async()=>{let _=await p.call(d,x);return y.call(d,_)})();let k=p.call(d,x);return y.call(d,k)}:d[m]=(...x)=>{if(this.defaults.async)return(async()=>{let _=await p.apply(d,x);return _===!1&&(_=await y.apply(d,x)),_})();let k=p.apply(d,x);return k===!1&&(k=y.apply(d,x)),k}}o.hooks=d}if(u.walkTokens){let d=this.defaults.walkTokens,h=u.walkTokens;o.walkTokens=function(m){let p=[];return p.push(h.call(this,m)),d&&(p=p.concat(d.call(this,m))),p}}this.defaults={...this.defaults,...o}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,c){return _n.lex(s,c??this.defaults)}parser(s,c){return An.parse(s,c??this.defaults)}parseMarkdown(s){return(c,u)=>{let o={...u},d={...this.defaults,...o},h=this.onError(!!d.silent,!!d.async);if(this.defaults.async===!0&&o.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(d.hooks&&(d.hooks.options=d,d.hooks.block=s),d.async)return(async()=>{let m=d.hooks?await d.hooks.preprocess(c):c,p=await(d.hooks?await d.hooks.provideLexer(s):s?_n.lex:_n.lexInline)(m,d),y=d.hooks?await d.hooks.processAllTokens(p):p;d.walkTokens&&await Promise.all(this.walkTokens(y,d.walkTokens));let x=await(d.hooks?await d.hooks.provideParser(s):s?An.parse:An.parseInline)(y,d);return d.hooks?await d.hooks.postprocess(x):x})().catch(h);try{d.hooks&&(c=d.hooks.preprocess(c));let m=(d.hooks?d.hooks.provideLexer(s):s?_n.lex:_n.lexInline)(c,d);d.hooks&&(m=d.hooks.processAllTokens(m)),d.walkTokens&&this.walkTokens(m,d.walkTokens);let p=(d.hooks?d.hooks.provideParser(s):s?An.parse:An.parseInline)(m,d);return d.hooks&&(p=d.hooks.postprocess(p)),p}catch(m){return h(m)}}}onError(s,c){return u=>{if(u.message+=`
74
+ Please report this to https://github.com/markedjs/marked.`,s){let o="<p>An error occurred:</p><pre>"+Bn(u.message+"",!0)+"</pre>";return c?Promise.resolve(o):o}if(c)return Promise.reject(u);throw u}}},xl=new Kv;function ze(s,c){return xl.parse(s,c)}ze.options=ze.setOptions=function(s){return xl.setOptions(s),ze.defaults=xl.defaults,dp(ze.defaults),ze};ze.getDefaults=_u;ze.defaults=yl;function Jv(...s){return xl.use(...s),ze.defaults=xl.defaults,dp(ze.defaults),ze}ze.use=Jv;ze.walkTokens=function(s,c){return xl.walkTokens(s,c)};ze.parseInline=xl.parseInline;ze.Parser=An;ze.parser=An.parse;ze.Renderer=Vc;ze.TextRenderer=Mu;ze.Lexer=_n;ze.lexer=_n.lex;ze.Tokenizer=Zc;ze.Hooks=xi;ze.parse=ze;ze.options;ze.setOptions;ze.walkTokens;ze.parseInline;An.parse;_n.lex;function Om(s,c){(c==null||c>s.length)&&(c=s.length);for(var u=0,o=Array(c);u<c;u++)o[u]=s[u];return o}function Iv(s){if(Array.isArray(s))return s}function Fv(s,c){var u=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(u!=null){var o,d,h,m,p=[],y=!0,x=!1;try{if(h=(u=u.call(s)).next,c!==0)for(;!(y=(o=h.call(u)).done)&&(p.push(o.value),p.length!==c);y=!0);}catch(k){x=!0,d=k}finally{try{if(!y&&u.return!=null&&(m=u.return(),Object(m)!==m))return}finally{if(x)throw d}}return p}}function Wv(){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 Pv(s,c){return Iv(s)||Fv(s,c)||ey(s,c)||Wv()}function ey(s,c){if(s){if(typeof s=="string")return Om(s,c);var u={}.toString.call(s).slice(8,-1);return u==="Object"&&s.constructor&&(u=s.constructor.name),u==="Map"||u==="Set"?Array.from(s):u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)?Om(s,c):void 0}}const bp=Object.entries,Dm=Object.setPrototypeOf,ty=Object.isFrozen,ny=Object.getPrototypeOf,ay=Object.getOwnPropertyDescriptor;let vt=Object.freeze,bt=Object.seal,is=Object.create,Np=typeof Reflect<"u"&&Reflect,ju=Np.apply,bu=Np.construct;vt||(vt=function(c){return c});bt||(bt=function(c){return c});ju||(ju=function(c,u){for(var o=arguments.length,d=new Array(o>2?o-2:0),h=2;h<o;h++)d[h-2]=arguments[h];return c.apply(u,d)});bu||(bu=function(c){for(var u=arguments.length,o=new Array(u>1?u-1:0),d=1;d<u;d++)o[d-1]=arguments[d];return new c(...o)});const ml=ht(Array.prototype.forEach),ly=ht(Array.prototype.lastIndexOf),Mm=ht(Array.prototype.pop),mi=ht(Array.prototype.push),sy=ht(Array.prototype.splice),rs=Array.isArray,vi=ht(String.prototype.toLowerCase),su=ht(String.prototype.toString),Um=ht(String.prototype.match),pi=ht(String.prototype.replace),Lm=ht(String.prototype.indexOf),iy=ht(String.prototype.trim),cy=ht(Number.prototype.toString),ry=ht(Boolean.prototype.toString),Hm=typeof BigInt>"u"?null:ht(BigInt.prototype.toString),$m=typeof Symbol>"u"?null:ht(Symbol.prototype.toString),Gt=ht(Object.prototype.hasOwnProperty),gi=ht(Object.prototype.toString),zt=ht(RegExp.prototype.test),hl=oy(TypeError);function ht(s){return function(c){c instanceof RegExp&&(c.lastIndex=0);for(var u=arguments.length,o=new Array(u>1?u-1:0),d=1;d<u;d++)o[d-1]=arguments[d];return ju(s,c,o)}}function oy(s){return function(){for(var c=arguments.length,u=new Array(c),o=0;o<c;o++)u[o]=arguments[o];return bu(s,u)}}function De(s,c){let u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vi;if(Dm&&Dm(s,null),!rs(c))return s;let o=c.length;for(;o--;){let d=c[o];if(typeof d=="string"){const h=u(d);h!==d&&(ty(c)||(c[o]=h),d=h)}s[d]=!0}return s}function uy(s){for(let c=0;c<s.length;c++)Gt(s,c)||(s[c]=null);return s}function en(s){const c=is(null);for(const o of bp(s)){var u=Pv(o,2);const d=u[0],h=u[1];Gt(s,d)&&(rs(h)?c[d]=uy(h):h&&typeof h=="object"&&h.constructor===Object?c[d]=en(h):c[d]=h)}return c}function dy(s){switch(typeof s){case"string":return s;case"number":return cy(s);case"boolean":return ry(s);case"bigint":return Hm?Hm(s):"0";case"symbol":return $m?$m(s):"Symbol()";case"undefined":return gi(s);case"function":case"object":{if(s===null)return gi(s);const c=s,u=Tn(c,"toString");if(typeof u=="function"){const o=u(c);return typeof o=="string"?o:gi(o)}return gi(s)}default:return gi(s)}}function Tn(s,c){for(;s!==null;){const o=ay(s,c);if(o){if(o.get)return ht(o.get);if(typeof o.value=="function")return ht(o.value)}s=ny(s)}function u(){return null}return u}function fy(s){try{return zt(s,""),!0}catch{return!1}}const Bm=vt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),iu=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"]),cu=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"]),hy=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"]),ru=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"]),my=vt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),qm=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"]),ou=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"]),py=bt(/{{[\w\W]*|^[\w\W]*}}/g),gy=bt(/<%[\w\W]*|^[\w\W]*%>/g),xy=bt(/\${[\w\W]*/g),vy=bt(/^data-[\-\w.\u00B7-\uFFFF]+$/),yy=bt(/^aria-[\-\w]+$/),Xm=bt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jy=bt(/^(?:\w+script|data):/i),by=bt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ny=bt(/^html$/i),wy=bt(/^[a-z][.\w]*(-[.\w]+)+$/i),Qm=bt(/<[/\w!]/g),Zm=bt(/<[/\w]/g),Sy=bt(/<\/no(script|embed|frames)/i),ky=bt(/\/>/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},wp=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Ty=vt(De({},wp)),Ey=(function(){const s={};return ml(wp,c=>{s[c]=bt(new RegExp("</"+c+"(?=[\\t\\n\\f\\r />])","i"))}),vt(s)})(),_y=function(){return typeof window>"u"?null:window},Ay=function(c,u){if(typeof c!="object"||typeof c.createPolicy!="function")return null;let o=null;const d="data-tt-policy-suffix";u&&u.hasAttribute(d)&&(o=u.getAttribute(d));const h="dompurify"+(o?"#"+o:"");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,u,o,d){return Gt(c,u)&&rs(c[u])?De(d.base?en(d.base):{},c[u],d.transform):o},uu=function(c,u,o){const d=Gt(c,u)?c[u]:void 0;return d&&typeof d=="object"?en(d):o()};function Sp(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_y();const c=P=>Sp(P);if(c.version="3.4.14",c.removed=[],!s||!s.document||s.document.nodeType!==Pt.document||!s.Element)return c.isSupported=!1,c;let u=s.document;const o=u,d=o.currentScript;s.DocumentFragment;const h=s.HTMLTemplateElement,m=s.Node,p=s.Element,y=s.NodeFilter,x=s.NamedNodeMap;x===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const k=s.DOMParser,_=s.trustedTypes,N=p.prototype,U=Tn(N,"cloneNode"),b=Tn(N,"remove"),J=Tn(N,"nextSibling"),H=Tn(N,"childNodes"),E=Tn(N,"parentNode"),te=Tn(N,"shadowRoot"),ie=Tn(N,"attributes"),Y=m&&m.prototype?Tn(m.prototype,"nodeType"):null,F=m&&m.prototype?Tn(m.prototype,"nodeName"):null,R=m&&m.prototype?Tn(m.prototype,"ownerDocument"):null,V=function(v){return Y?Y(v):v.nodeType},ae=function(v){return F?F(v):v.nodeName};if(typeof h=="function"){const P=u.createElement("template");P.content&&P.content.ownerDocument&&(u=P.content.ownerDocument)}let L,I="",ce,W=!1,he=0;const Le=function(){if(he>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){Le(),he++;try{return L.createHTML(v)}finally{he--}},$=function(v){Le(),he++;try{return L.createScriptURL(v)}finally{he--}},ne=function(){return W||(ce=Ay(_,d),W=!0),ce},de=u,Ce=de.implementation,be=de.createNodeIterator,T=de.createDocumentFragment,X=de.getElementsByTagName,le=o.importNode;let ee=Vm();c.isSupported=typeof bp=="function"&&typeof E=="function"&&Ce&&Ce.createHTMLDocument!==void 0;const ge=py,ve=gy,_e=xy,mt=vy,G=yy,Re=jy,Ye=by,We=wy;let nn=Xm,Oe=null;const Xa=De({},[...Bm,...iu,...cu,...ru,...qm]);let Xe=null;const ds=De({},[...Gm,...ou,...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}})),qn=null,jl=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 wi=!0,fs=!0,At=!1,Si=!0,vn=!1,Rn=!0,ln=!1,hs=!1,Qa=null,bl=null,ms=!1,sn=!1,yt=!1,Xt=!1,Ct=!0,ki=!1;const Ti="user-content-";let ps=!0,ua=!1,yn={},jn=null;const zn=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 da=De({},["audio","video","img","source","image","track"]);let Ei=null;const gs=De({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fa="http://www.w3.org/1998/Math/MathML",On="http://www.w3.org/2000/svg",cn="http://www.w3.org/1999/xhtml";let Gn=cn,Nl=!1,wl=null;const xs=De({},[fa,On,cn],su),Sl=vt(["mi","mo","mn","ms","mtext"]);let kl=De({},Sl);const vs=vt(["annotation-xml"]);let rn=De({},vs);const pt=De({},["title","style","font","a","script"]);let it=null;const ha=["application/xhtml+xml","text/html"],ys="text/html";let et=null,ma=null;const _i=u.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?ys:v.PARSER_MEDIA_TYPE,et=it==="application/xhtml+xml"?su:vi,Oe=Ya(v,"ALLOWED_TAGS",Xa,{transform:et}),Xe=Ya(v,"ALLOWED_ATTR",ds,{transform:et}),wl=Ya(v,"ALLOWED_NAMESPACES",xs,{transform:su}),Ei=Ya(v,"ADD_URI_SAFE_ATTR",gs,{transform:et,base:gs}),Za=Ya(v,"ADD_DATA_URI_TAGS",da,{transform:et,base:da}),jn=Ya(v,"FORBID_CONTENTS",zn,{transform:et}),qn=Ya(v,"FORBID_TAGS",en({}),{transform:et}),jl=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,wi=v.ALLOW_ARIA_ATTR!==!1,fs=v.ALLOW_DATA_ATTR!==!1,At=v.ALLOW_UNKNOWN_PROTOCOLS||!1,Si=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,vn=v.SAFE_FOR_TEMPLATES||!1,Rn=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,ms=v.FORCE_BODY||!1,Ct=v.SANITIZE_DOM!==!1,ki=v.SANITIZE_NAMED_PROPS||!1,ps=v.KEEP_CONTENT!==!1,ua=v.IN_PLACE||!1,nn=fy(v.ALLOWED_URI_REGEXP)?v.ALLOWED_URI_REGEXP:Xm,Gn=typeof v.NAMESPACE=="string"?v.NAMESPACE:cn,kl=uu(v,"MATHML_TEXT_INTEGRATION_POINTS",()=>De({},Sl)),rn=uu(v,"HTML_INTEGRATION_POINTS",()=>De({},vs));const A=uu(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),bt(Yt),vn&&(fs=!1),yt&&(sn=!0),yn&&(Oe=De({},qm),Xe=is(null),yn.html===!0&&(De(Oe,Bm),De(Xe,Gm)),yn.svg===!0&&(De(Oe,iu),De(Xe,ou),De(Xe,Yc)),yn.svgFilters===!0&&(De(Oe,cu),De(Xe,ou),De(Xe,Yc)),yn.mathMl===!0&&(De(Oe,ru),De(Xe,Ym),De(Xe,Yc))),an.tagCheck=null,an.attributeCheck=null,Gt(v,"ADD_TAGS")&&(typeof v.ADD_TAGS=="function"?an.tagCheck=v.ADD_TAGS:rs(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:rs(v.ADD_ATTR)&&(Xe===ds&&(Xe=en(Xe)),De(Xe,v.ADD_ATTR,et))),Gt(v,"ADD_FORBID_CONTENTS")&&rs(v.ADD_FORBID_CONTENTS)&&(jn===zn&&(jn=en(jn)),De(jn,v.ADD_FORBID_CONTENTS,et)),ps&&(Oe["#text"]=!0),ln&&De(Oe,["html","head","body"]),Oe.table&&(De(Oe,["tbody"]),delete qn.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 K=L;L=v.TRUSTED_TYPES_POLICY;try{I=at("")}catch(se){throw L=K,se}}else v.TRUSTED_TYPES_POLICY===null?(L=void 0,I=""):(L===void 0&&(L=ne()),L&&typeof I=="string"&&(I=at("")));vt&&vt(v),ma=v},Yn=De({},[...iu,...cu,...hy]),Xn=De({},[...ru,...my]),Ka=function(v,A,K){return A.namespaceURI===cn?v==="svg":A.namespaceURI===fa?v==="svg"&&(K==="annotation-xml"||kl[K]):!!Yn[v]},ga=function(v,A,K){return A.namespaceURI===cn?v==="math":A.namespaceURI===On?v==="math"&&rn[K]:!!Xn[v]},ct=function(v,A,K){return A.namespaceURI===On&&!rn[K]||A.namespaceURI===fa&&!kl[K]?!1:!Xn[v]&&(pt[v]||!Yn[v])},Ai=function(v){let A=E(v);(!A||!A.tagName)&&(A={namespaceURI:Gn,tagName:"template"});const K=vi(v.tagName),se=vi(A.tagName);return wl[v.namespaceURI]?v.namespaceURI===On?Ka(K,A,se):v.namespaceURI===fa?ga(K,A,se):v.namespaceURI===cn?ct(K,A,se):!!(it==="application/xhtml+xml"&&wl[v.namespaceURI]):!1},bn=function(v){mi(c.removed,{element:v});try{E(v).removeChild(v)}catch{if(b(v),!E(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")}},Dn=function(v,A,K){try{v.removeAttributeNode(A)}catch{try{v.removeAttribute(K)}catch{}}},Nn=function(v){Ja(v);const A=H(v);if(A){const se=[];ml(A,re=>{mi(se,re)}),ml(se,re=>{try{b(re)}catch{}})}const K=ie(v);if(K)for(let se=K.length-1;se>=0;--se){const re=K[se],me=re&&re.name;typeof me=="string"&&Dn(v,re,me)}},Qn=function(v,A,K){if(!K)try{K=A.getAttributeNode(v)}catch{K=null}mi(c.removed,{attribute:K||null,from:A});try{K?A.removeAttributeNode(K):A.removeAttribute(v)}catch{try{A.removeAttribute(v)}catch{}}if(v==="is")if(sn||yt)try{bn(A)}catch{}else try{A.setAttribute(v,"")}catch{}},Ci=function(v){const A=ie(v);if(A)for(let K=A.length-1;K>=0;--K){const se=A[K],re=se&&se.name;typeof re!="string"||Xe[et(re)]||Dn(v,se,re)}},Ja=function(v){const A=[v];for(;A.length>0;){const K=A.pop();V(K)===Pt.element&&Ci(K);const re=H(K);if(re)for(let me=re.length-1;me>=0;--me)A.push(re[me])}},Ri=function(v,A){return Rn?v==="patchsrc"?!0:v==="for"&&A!=="label"&&A!=="output":!1},Tl=function(v){if(!Rn)return;const A=[v];for(;A.length>0;){const K=A.pop(),se=V(K);if(se===Pt.processingInstruction||se===Pt.comment&&zt(Zm,K.data)){try{b(K)}catch{}continue}if(se===Pt.element){const me=K,Be=et(ae(K));try{me.hasAttribute&&me.hasAttribute("patchsrc")&&me.removeAttribute("patchsrc"),me.hasAttribute&&me.hasAttribute("for")&&Ri("for",Be)&&me.removeAttribute("for")}catch{}}const re=H(K);if(re)for(let me=re.length-1;me>=0;--me)A.push(re[me])}},Ia=function(v){let A=null,K=null;if(ms)v="<remove></remove>"+v;else{const me=Um(v,/^[\r\n\t ]+/);K=me&&me[0]}it==="application/xhtml+xml"&&Gn===cn&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");const se=L?at(v):v;if(Gn===cn)try{A=new k().parseFromString(se,it)}catch{}if(!A||!A.documentElement){A=Ce.createDocument(Gn,"template",null);try{A.documentElement.innerHTML=Nl?I:se}catch{}}const re=A.body||A.documentElement;return v&&K&&re.insertBefore(u.createTextNode(K),re.childNodes[0]||null),Gn===cn?X.call(A,ln?"html":"body")[0]:ln?A.documentElement:re},on=function(v){const A=R?R(v):v.ownerDocument;return be.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=pi(v,ge," "),v=pi(v,ve," "),v=pi(v,_e," "),v},El=function(v){var A;v.normalize();const K=R?R(v):v.ownerDocument,se=be.call(K||v,v,y.SHOW_TEXT|y.SHOW_COMMENT|y.SHOW_CDATA_SECTION|y.SHOW_PROCESSING_INSTRUCTION,null);let re=se.nextNode();for(;re;)re.data=Nt(re.data),re=se.nextNode();const me=(A=v.querySelectorAll)===null||A===void 0?void 0:A.call(v,"template");me&&ml(me,Be=>{Mn(Be.content)&&El(Be.content)})},_l=function(v){const A=F?F(v):null;return typeof A!="string"||et(A)!=="form"?!1:typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||v.attributes!==ie(v)||typeof v.removeAttribute!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function"||v.nodeType!==Y(v)||v.childNodes!==H(v)},Mn=function(v){if(!Y||typeof v!="object"||v===null)return!1;try{return Y(v)===Pt.documentFragment}catch{return!1}},xa=function(v){if(!Y||typeof v!="object"||v===null)return!1;try{return typeof Y(v)=="number"}catch{return!1}};function Dt(P,v,A){P.length!==0&&ml(P,K=>{K.call(c,v,A,ma)})}const Fc=function(v,A){return!!(Rn&&v.hasChildNodes()&&!xa(v.firstElementChild)&&zt(Qm,v.textContent)&&zt(Qm,v.innerHTML)||Rn&&v.namespaceURI===cn&&Ty[A]&&(xa(v.firstElementChild)||typeof v.textContent=="string"&&zt(Ey[A],v.textContent))||v.nodeType===Pt.processingInstruction||Rn&&v.nodeType===Pt.comment&&zt(Zm,v.data))},wt=function(v,A){if(v instanceof RegExp)return zt(v,A);if(v instanceof Function){for(var K=arguments.length,se=new Array(K>2?K-2:0),re=2;re<K;re++)se[re-2]=arguments[re];return!!v(A,...se)}return!1},js=function(v,A,K){if(!qn[A]&&Vn(A)&&wt(Yt.tagNameCheck,A))return!1;if(ps&&!jn[A]){const se=E(v),re=H(v);if(re&&se){const me=re.length;for(let Be=me-1;Be>=0;--Be){const Ke=v===K?U(re[Be],!0):re[Be];se.insertBefore(Ke,J(v))}}}return bn(v),!0},bs=function(v,A,K,se){return v.length===0?A:A===K||A===se?en(A):A},Al=function(v,A){return v===A||E(v)!==null?!1:(ua&&Ja(v),!0)},Zn=function(v,A){if(Dt(ee.beforeSanitizeElements,v,null),Al(v,A))return!0;if(_l(v))return bn(v),!0;const K=et(ae(v));if(Oe=bs(ee.uponSanitizeElement,Oe,Xa,Qa),Dt(ee.uponSanitizeElement,v,{tagName:K,allowedTags:Oe}),Al(v,A))return!0;if(Fc(v,K))return bn(v),!0;if(qn[K]||!(an.tagCheck instanceof Function&&an.tagCheck(K))&&!Oe[K]){const re=js(v,K,A);return re===!1&&Dt(ee.afterSanitizeElements,v,null),re}if(V(v)===Pt.element&&!Ai(v)||(K==="noscript"||K==="noembed"||K==="noframes")&&zt(Sy,v.innerHTML))return bn(v),!0;if(vn&&v.nodeType===Pt.text){const re=Nt(v.textContent);v.textContent!==re&&(mi(c.removed,{element:v.cloneNode()}),v.textContent=re)}return Dt(ee.afterSanitizeElements,v,null),!1},Ns=function(v,A,K){if(jl[A]||Ri(A,v)||Ct&&(A==="id"||A==="name")&&(K in u||K in _i))return!1;const se=Xe[A]||an.attributeCheck instanceof Function&&an.attributeCheck(A,v);return fs&&zt(mt,A)||wi&&zt(G,A)?!0:se?Ei[A]||zt(nn,pi(K,Ye,""))||(A==="src"||A==="xlink:href"||A==="href")&&v!=="script"&&Lm(K,"data:")===0&&Za[v]||At&&!zt(Re,pi(K,Ye,""))?!0:!K:Vn(v)&&wt(Yt.tagNameCheck,v)&&wt(Yt.attributeNameCheck,A,v)||A==="is"&&Yt.allowCustomizedBuiltInElements&&wt(Yt.tagNameCheck,K)},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[vi(v)]&&zt(We,v)},Wc=function(v,A,K,se){if(L&&typeof _=="object"&&typeof _.getAttributeType=="function"&&!K)switch(_.getAttributeType(v,A)){case"TrustedHTML":return at(se);case"TrustedScriptURL":return $(se)}return se},Oi=function(v,A,K,se){try{K?v.setAttributeNS(K,A,se):v.setAttribute(A,se),_l(v)?bn(v):Mm(c.removed)}catch{Qn(A,v)}},ws=function(v){Dt(ee.beforeSanitizeAttributes,v,null);const A=v.attributes;if(!A||_l(v))return;Xe=bs(ee.uponSanitizeAttribute,Xe,ds,bl);const K={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Xe,forceKeepAttr:void 0};let se=A.length;const re=et(v.nodeName);for(;se--;){const me=A[se],Be=me.name,Ke=me.namespaceURI,St=me.value,rt=et(Be),Qt=St;let gt=Be==="value"?Qt:iy(Qt);if(K.attrName=rt,K.attrValue=gt,K.keepAttr=!0,K.forceKeepAttr=void 0,Dt(ee.uponSanitizeAttribute,v,K),gt=K.attrValue,ki&&(rt==="id"||rt==="name")&&Lm(gt,Ti)!==0&&(Qn(Be,v,me),gt=Ti+gt),Rn&&zt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,gt)){Qn(Be,v,me);continue}if(rt==="attributename"&&Um(gt,"href")){Qn(Be,v,me);continue}if(!K.forceKeepAttr){if(!K.keepAttr){Qn(Be,v,me);continue}if(!Si&&zt(ky,gt)){Qn(Be,v,me);continue}if(vn&&(gt=Nt(gt)),!Ns(re,rt,gt)){Qn(Be,v,me);continue}gt=Wc(re,rt,Ke,gt),gt!==Qt&&Oi(v,Be,Ke,gt)}}Dt(ee.afterSanitizeAttributes,v,null)},va=function(v){let A=null;const K=on(v);for(Dt(ee.beforeSanitizeShadowDOM,v,null);A=K.nextNode();)if(Dt(ee.uponSanitizeShadowNode,A,null),Zn(A,v),ws(A),Mn(A.content)&&va(A.content),V(A)===Pt.element){const se=te(A);Mn(se)&&(Ss(se),va(se))}Dt(ee.afterSanitizeShadowDOM,v,null)},Ss=function(v){const A=[{node:v,shadow:null}];for(;A.length>0;){const K=A.pop();if(K.shadow){va(K.shadow);continue}const se=K.node,me=V(se)===Pt.element,Be=H(se);if(Be)for(let Ke=Be.length-1;Ke>=0;--Ke)A.push({node:Be[Ke],shadow:null});if(me){const Ke=F?F(se):null;if(typeof Ke=="string"&&et(Ke)==="template"){const St=se.content;Mn(St)&&A.push({node:St,shadow:null})}}if(me){const Ke=te(se);Mn(Ke)&&A.push({node:null,shadow:Ke},{node:Ke,shadow:null})}}};return c.sanitize=function(P){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,K=null,se=null,re=null;if(Nl=!P,Nl&&(P="<!-->"),typeof P!="string"&&!xa(P)&&(P=dy(P),typeof P!="string"))throw hl("dirty is not a string, aborting");if(!c.isSupported)return P;hs?(Oe=Qa,Xe=bl):Va(v),(ee.uponSanitizeElement.length>0||ee.uponSanitizeAttribute.length>0)&&(Oe=en(Oe)),ee.uponSanitizeAttribute.length>0&&(Xe=en(Xe)),c.removed=[];const me=ua&&typeof P!="string"&&xa(P);if(me){Tl(P);const St=ae(P);if(typeof St=="string"){const rt=et(St);if(!Oe[rt]||qn[rt])throw Nn(P),hl("root node is forbidden and cannot be sanitized in-place")}if(_l(P))throw Nn(P),hl("root node is clobbered and cannot be sanitized in-place");try{Ss(P)}catch(rt){throw Nn(P),rt}}else if(xa(P))A=Ia("<!---->"),K=A.ownerDocument.importNode(P,!0),K.nodeType===Pt.element&&K.nodeName==="BODY"||K.nodeName==="HTML"?A=K:A.appendChild(K),Ss(K);else{if(!sn&&!vn&&!ln&&P.indexOf("<")===-1)return L&&Xt?at(P):P;if(A=Ia(P),!A)return sn?null:Xt?I:""}A&&ms&&bn(A.firstChild);const Be=me?P:A;try{const St=on(Be);for(;se=St.nextNode();)Zn(se,Be),ws(se),Mn(se.content)&&va(se.content)}catch(St){throw me&&(Nn(P),ml(c.removed,rt=>{rt.element&&Ja(rt.element)})),St}if(me)return ml(c.removed,St=>{St.element&&Ja(St.element)}),vn&&El(P),P;if(sn){if(vn&&El(A),yt)for(re=T.call(A.ownerDocument);A.firstChild;)re.appendChild(A.firstChild);else re=A;return(Xe.shadowroot||Xe.shadowrootmode)&&(re=le.call(o,re,!0)),re}let Ke=ln?A.outerHTML:A.innerHTML;return ln&&Oe["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&zt(Ny,A.ownerDocument.doctype.name)&&(Ke="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
76
+ `+Ke),vn&&(Ke=Nt(Ke)),L&&Xt?at(Ke):Ke},c.setConfig=function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Va(P),hs=!0,Qa=Oe,bl=Xe},c.clearConfig=function(){ma=null,hs=!1,Qa=null,bl=null,L=ce,I=""},c.isValidAttribute=function(P,v,A){ma||Va({});const K=et(P),se=et(v);return Ns(K,se,A)},c.addHook=function(P,v){typeof v=="function"&&Gt(ee,P)&&mi(ee[P],v)},c.removeHook=function(P,v){if(Gt(ee,P)){if(v!==void 0){const A=ly(ee[P],v);return A===-1?void 0:sy(ee[P],A,1)[0]}return Mm(ee[P])}},c.removeHooks=function(P){Gt(ee,P)&&(ee[P]=[])},c.removeAllHooks=function(){ee=Vm()},c}var vl=Sp();const Cy=[{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(s,c){const o=await(await fetch("/api/chats",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agent:s,scope:c})})).json();o.id&&tn(o.scope?.kind==="agent"?`/agents/${encodeURIComponent(o.scope.slug)}/chat/${o.id}`:`/agents/chats/${o.id}`)}function Ry(){const[s,c]=w.useState("claude"),[u,o]=w.useState(!0),[d,h]=w.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:Cy.map(m=>l.jsxs("button",{className:`agent-pick-btn ${s===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:u,onChange:m=>o(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:d,onClick:async()=>{h(!0),await us(s,{kind:u?"kraftwerk":"general"}),h(!1)},children:d?"starting…":"start chat"})})]})]})}function Km({id:s,agentName:c,agentDescription:u}){const[o,d]=w.useState(null),[h,m]=w.useState([]),[p,y]=w.useState(!1);w.useEffect(()=>{let _=!0,N=null;return fetch(`/api/chats/${s}`).then(U=>U.ok?U.json():Promise.reject()).then(U=>{if(!_)return;d(U.meta),m(U.events);const b=U.events[U.events.length-1]?.seq??0;N=new EventSource(`/api/chats/${s}/events?after=${b}`),N.onmessage=J=>{const H=JSON.parse(J.data);m(E=>E.some(te=>te.seq===H.seq)?E:[...E,H])}}).catch(()=>_&&y(!0)),()=>{_=!1,N?.close()}},[s]);const x=w.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]),k=w.useMemo(()=>{if(o?.title)return o.title;const _=h.find(N=>N.type==="user_message");return _&&_.type==="user_message"?_.text.replace(/\s+/g," ").trim().slice(0,80):""},[o,h]);return w.useEffect(()=>{if(!o)return;const _=c??(o.scope.kind==="agent"?o.scope.slug:o.agent);return km([_,u,k||"new chat"].filter(Boolean).join(" · ")),()=>km("")},[o,k,c,u]),p?l.jsx("div",{className:"empty",children:"chat not found"}):o?l.jsxs("div",{className:"chat-thread",children:[l.jsxs("div",{className:"detail-head",children:[l.jsx("span",{className:`lamp ${x?"running":"ok"}`}),l.jsx("h1",{children:k||"new chat"}),l.jsx("span",{className:"chip agent",children:o.agent}),o.scope.kind==="run"&&l.jsx(Ee,{href:`/runs/${o.scope.runId}`,className:"chip",children:o.scope.runId}),o.scope.kind==="kraftwerk"&&l.jsx("span",{className:"chip",children:"kraftwerk-aware"}),o.scope.kind==="knowledge"&&l.jsxs(Ee,{href:o.scope.bundle?`/knowledge/${encodeURIComponent(o.scope.bundle)}`:"/knowledge",className:"chip",children:["knowledge",o.scope.bundle?`:${o.scope.bundle}`:""]}),o.scope.kind==="agent"&&l.jsxs(Ee,{href:`/agents/${encodeURIComponent(o.scope.slug)}/info`,className:"chip",children:["agent:",o.scope.slug]}),l.jsx("span",{className:"rid",title:o.cwd,children:o.cwd})]}),l.jsx(Oy,{id:s,events:h,busy:x}),l.jsx(Ly,{id:s,busy:x,scope:o.scope})]}):l.jsx("div",{className:"empty",children:"loading…"})}function zy(s){const c=[],u=new Map,o=new Map;for(const d of s){const h=c[c.length-1];switch(d.type){case"user_message":c.push({kind:"user",text:d.text,key:`e${d.seq}`});break;case"text":h?.kind==="agent"?h.text+=d.text:c.push({kind:"agent",text:d.text,key:`e${d.seq}`});break;case"thought":h?.kind==="thought"?h.text+=d.text:c.push({kind:"thought",text:d.text,key:`e${d.seq}`});break;case"tool_call":u.set(d.callId,c.length),c.push({kind:"tool",callId:d.callId,title:d.title,toolKind:d.kind,status:d.status,key:`e${d.seq}`});break;case"tool_update":{const m=u.get(d.callId);if(m!=null){const p=c[m];d.title&&(p.title=d.title),d.status&&(p.status=d.status)}break}case"permission_request":o.set(d.requestId,c.length),c.push({kind:"permission",requestId:d.requestId,title:d.title,options:d.options,resolved:void 0,key:`e${d.seq}`});break;case"permission_resolved":{const m=o.get(d.requestId);m!=null&&(c[m].resolved=d.optionId);break}case"error":c.push({kind:"error",text:d.message,key:`e${d.seq}`});break}}return c}function Oy({id:s,events:c,busy:u}){const o=Cn(),d=w.useMemo(()=>{const p=zy(c);return o?p:p.filter(y=>y.kind!=="tool"&&y.kind!=="thought")},[c,o]),h=w.useRef(null),m=w.useRef(!0);return w.useEffect(()=>{const p=h.current;p&&m.current&&(p.scrollTop=p.scrollHeight)},[d,u]),l.jsxs("div",{className:"chat-scroll",ref:h,onScroll:p=>{const y=p.currentTarget;m.current=y.scrollHeight-y.scrollTop-y.clientHeight<60},children:[d.length===0&&l.jsx("div",{className:"empty",children:"say something — the agent starts on your first message"}),d.map(p=>l.jsx(My,{b:p,chatId:s},p.key)),u&&l.jsxs("div",{className:"chat-working",children:[l.jsx("span",{className:"lamp running"})," working…"]})]})}function Dy({text:s}){const c=w.useMemo(()=>vl.sanitize(ze.parse(s,{async:!1})),[s]);return l.jsx("div",{className:"msg agent md-body chat-md",dangerouslySetInnerHTML:{__html:c}})}function My({b:s,chatId:c}){switch(s.kind){case"user":return l.jsx("div",{className:"msg user",children:s.text});case"agent":return l.jsx(Dy,{text:s.text});case"thought":return l.jsxs("details",{className:"msg thought",children:[l.jsx("summary",{children:"thinking"}),l.jsx("div",{children:s.text})]});case"tool":return l.jsxs("div",{className:`tool-card ${s.status??""}`,children:[l.jsx("span",{className:`lamp ${s.status==="completed"?"ok":s.status==="failed"?"failed":"running"}`}),s.toolKind&&l.jsx("span",{className:"chip tool-kind",children:s.toolKind}),l.jsx("span",{className:"tool-title",children:s.title})]});case"permission":return l.jsx(Uy,{b:s,chatId:c});case"error":return l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",s.text]})}}function Uy({b:s,chatId:c}){const[u,o]=w.useState(!1),d=s.resolved===void 0;async function h(m){o(!0),await fetch(`/api/chats/${c}/permission`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({requestId:s.requestId,optionId:m})}).catch(()=>{}),o(!1)}return l.jsxs("div",{className:`perm-card ${d?"pending":""}`,children:[l.jsxs("div",{className:"perm-title",children:[l.jsx("span",{className:"microlabel",children:"permission"})," ",s.title]}),d?l.jsx("div",{className:"perm-actions",children:s.options.map(m=>l.jsx("button",{className:`perm-btn ${m.kind?.startsWith("allow")?"allow":"deny"}`,disabled:u,onClick:()=>h(m.optionId),children:m.name},m.optionId))}):l.jsx("div",{className:"perm-resolved",children:s.resolved?`→ ${s.options.find(m=>m.optionId===s.resolved)?.name??s.resolved}`:"→ dismissed"})]})}function Ly({id:s,busy:c,scope:u}){const[o,d]=w.useState(""),[h,m]=w.useState([]),[p,y]=w.useState(0),[x,k]=w.useState(!1);w.useEffect(()=>{let E=!0;return(async()=>{try{let ie=(await fetch("/api/skills").then(Y=>Y.json())).skills??[];if(u?.kind==="agent"){const[Y,F]=await Promise.all([fetch(`/api/agents/${encodeURIComponent(u.slug)}`).then(ae=>ae.ok?ae.json():null).catch(()=>null),fetch(`/api/agents/${encodeURIComponent(u.slug)}/skills`).then(ae=>ae.ok?ae.json():null).catch(()=>null)]);if(Y&&Array.isArray(Y.skills)){const ae=new Set(Y.skills.map(L=>L.toLowerCase()));ie=ie.filter(L=>ae.has(L.name.toLowerCase()))}const R=F?.skills??[],V=new Set(R.map(ae=>ae.name.toLowerCase()));ie=[...R,...ie.filter(ae=>!V.has(ae.name.toLowerCase()))]}E&&m(ie)}catch{}})(),()=>{E=!1}},[s]);const _=/^\/([\w-]*)$/.exec(o)?.[1],N=_!==void 0&&!x?h.filter(E=>E.name.toLowerCase().startsWith(_.toLowerCase())):[],U=N.length>0,b=Math.min(p,N.length-1);function J(E){d(`/${E.name} `),y(0)}async function H(){const E=o.trim();!E||c||(d(""),await fetch(`/api/chats/${s}/message`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:E})}).catch(()=>{}))}return l.jsxs("div",{className:"composer",children:[U&&l.jsx("div",{className:"skill-menu",children:N.map((E,te)=>l.jsxs("button",{className:te===b?"active":"",onMouseDown:ie=>{ie.preventDefault(),J(E)},children:[l.jsxs("b",{children:["/",E.name]}),E.description&&l.jsxs("span",{children:[" — ",E.description]}),l.jsx("span",{className:"skill-src",children:E.source})]},E.name))}),l.jsx("textarea",{value:o,placeholder:c?"agent is working…":"message · Enter to send, Shift+Enter for newline, / for skills",rows:Math.min(6,Math.max(1,o.split(`
77
+ `).length)),onChange:E=>{d(E.target.value),y(0),k(!1)},onKeyDown:E=>{if(U){if(E.key==="ArrowDown")return E.preventDefault(),y((b+1)%N.length);if(E.key==="ArrowUp")return E.preventDefault(),y((b-1+N.length)%N.length);if(E.key==="Tab"||E.key==="Enter")return E.preventDefault(),J(N[b]);if(E.key==="Escape")return E.preventDefault(),k(!0)}E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),H())}}),c?l.jsxs("button",{className:"stop-btn",onClick:()=>fetch(`/api/chats/${s}/cancel`,{method:"POST"}).catch(()=>{}),children:[l.jsx(Q,{name:"stop",className:"ms-sm"})," stop"]}):l.jsxs("button",{className:"run-btn",disabled:!o.trim(),onClick:H,children:[l.jsx(Q,{name:"send",className:"ms-sm"})," send"]})]})}function Hy({id:s}){const c=$e("/api/runs",!0),u=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:u.length})]}),l.jsxs("div",{className:"side-list",children:[u.map(o=>l.jsx($y,{r:o,active:o.id===s},o.id)),c&&u.length===0&&l.jsx("div",{className:"viewer-note",children:"no runs yet"})]})]}),l.jsx("div",{className:"runs-main",children:l.jsx(By,{id:s},s)})]})}function $y({r:s,active:c}){return l.jsxs(Ee,{href:`/runs/${s.id}`,className:`side-row ${c?"active":""}`,children:[l.jsx(Jc,{status:s.status}),l.jsxs("div",{className:"side-row-body",children:[l.jsxs("div",{className:"side-row-top",children:[l.jsx("span",{className:"side-wf",children:s.workflow??"unknown"}),l.jsx("span",{className:"side-when num",children:gl(s.startedAt)})]}),l.jsxs("div",{className:"side-row-sub",children:[l.jsx("span",{className:"side-req",title:s.request,children:s.status==="running"&&s.currentPhase?`${s.currentPhase}`:s.request??""}),l.jsx("span",{className:"side-meta num",children:s.status==="running"?l.jsx(Eu,{since:s.startedAt}):ji(s.durationMs)})]})]})]})}function By({id:s}){const c=$e(`/api/runs/${s}`,!0),u=c?.status==="running",[o,d]=w.useState(null),[h,m]=w.useState(!1),p=Cn();if(!c)return l.jsx("div",{className:"empty",children:"loading…"});const y=c.files.some(N=>N.name==="runner.json"),x=o??(u?"run":"artifacts"),k=p?c.files.length:c.files.filter(N=>!Kc(N.name)).length;async function _(){m(!0),await fetch(`/api/runs/${s}/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(Wx,{status:c.status}),y&&l.jsxs("span",{className:"chip sandbox-chip",children:[l.jsx(Q,{name:"science",className:"ms-sm"})," sandbox"]}),l.jsx("span",{className:"rid",children:s.replace(/^run-/,"")}),u&&y&&l.jsx("button",{className:"stop-btn",onClick:_,disabled:h,children:h?"stopping…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{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:s})},children:"⌬ discuss"}),l.jsxs("nav",{className:"tabs",children:[l.jsx("button",{className:x==="run"?"active":"",onClick:()=>d("run"),children:"run"}),l.jsxs("button",{className:x==="artifacts"?"active":"",onClick:()=>d("artifacts"),children:["artifacts ",l.jsxs("span",{className:"num",children:["(",k,")"]})]})]})]}),c.request&&l.jsx("p",{className:"detail-req",children:c.request}),x==="run"?l.jsx(qy,{run:c,live:u}):l.jsx(Qy,{id:s,files:c.files,live:u})]})}function qy({run:s,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:[s.phasesDone,s.phasesTotal!=null?` / ${s.phasesTotal}`:""]})]}),l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"duration"}),l.jsx("div",{className:"v num",children:c?l.jsx(Eu,{since:s.startedAt}):ji(s.durationMs)})]}),l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"cost"}),l.jsx("div",{className:"v num",children:ku(s.costUsd??Gy(s.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(s.phases,"tokensIn"))," / ",Xc(Jm(s.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:s.phases.map(u=>l.jsx(Yy,{p:u},u.phase))})]})]})}function Jm(s,c){return s.reduce((u,o)=>u+(o[c]??0),0)}function Gy(s){return s.reduce((c,u)=>c+(u.costUsd??0),0)}function Yy({p:s}){const c=s.gates.filter(u=>!u.passed);return l.jsxs("div",{className:"phase-row",children:[l.jsx(Jc,{status:s.status}),l.jsxs("div",{className:"phase-top",children:[l.jsx("span",{className:"phase-name",children:s.phase}),s.kind==="agent"?l.jsxs("span",{className:"chip agent",children:[s.agent,s.model?` · ${s.model}`:""]}):l.jsx("span",{className:"chip",children:"script"}),l.jsxs("span",{className:"right num",children:[s.attempts>1&&l.jsxs("span",{children:["att ",s.attempts]}),s.status==="running"?l.jsx(Eu,{since:s.startedAt}):s.durationMs!=null&&l.jsx("span",{children:ji(s.durationMs)}),s.kind==="agent"&&s.tokensIn!=null&&l.jsxs("span",{children:[Xc(s.tokensIn)," / ",Xc(s.tokensOut)]}),s.costUsd!=null&&s.costUsd>0&&l.jsx("span",{children:ku(s.costUsd)})]})]}),s.status==="running"&&s.lastActivity&&l.jsx("div",{className:"phase-activity",children:s.lastActivity}),s.summary&&s.status!=="running"&&l.jsx("div",{className:"phase-sub",children:s.summary}),s.gates.length>0&&l.jsx("div",{className:"gate-line",children:s.gates.map(u=>l.jsxs("span",{className:`gate ${u.passed?"":"failed"}`,title:u.failure??"",children:[l.jsx(Q,{name:u.passed?"check":"close",className:"ms-sm"})," ",u.gate]},u.gate))}),c.map(u=>l.jsx("div",{className:"gate-fail-msg",children:u.failure},u.gate))]})}const kp=new Set(["png","jpg","jpeg","gif","webp","svg"]);function Kc(s){return s==="runner.json"||s.endsWith(".jsonl")||s.endsWith(".log")}function Xy(s){const u=["report.html","recommendation.md"].find(h=>s.some(m=>m.name===h));if(u)return u;const o=h=>{const m=h.split(".").pop()?.toLowerCase()??"";return["html","md","markdown","pdf"].includes(m)||kp.has(m)?0:Kc(h)?2:1};let d=null;for(const h of s)(!d||o(h.name)<o(d.name))&&(d=h);return d?.name??null}function Qy({id:s,files:c,live:u}){const[o,d]=w.useState(null),h=Cn(),m=w.useMemo(()=>h?c:c.filter(p=>!Kc(p.name)),[c,h]);return w.useEffect(()=>{!h&&o&&Kc(o)&&d(null)},[h,o]),w.useEffect(()=>{o||m.length===0||d(Xy(m))},[m,o]),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 ${o===p.name?"active":""}`,onClick:()=>d(p.name),children:[l.jsx("span",{className:"fname",children:p.name}),l.jsx("span",{className:"fsize num",children:Tu(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:o??"viewer"}),l.jsx("span",{className:"spacer"}),o&&l.jsx("a",{className:"open-raw",href:`/api/runs/${s}/file?name=${encodeURIComponent(o)}&raw=1`,target:"_blank",children:"open raw ↗"})]}),o?l.jsx(Zy,{id:s,name:o,live:u}):l.jsx("div",{className:"empty",children:"select a file"})]})]})}function Zy({id:s,name:c,live:u}){const o=c.split(".").pop()?.toLowerCase()??"",d=`/api/runs/${s}/file?name=${encodeURIComponent(c)}&raw=1`;return o==="html"?l.jsx("div",{className:"viewer",children:l.jsx("div",{className:"viewer-body",children:l.jsx("iframe",{src:d,sandbox:"allow-scripts",allow:"clipboard-write",title:c})})}):o==="pdf"?l.jsx("div",{className:"viewer",children:l.jsx("div",{className:"viewer-body",children:l.jsx("iframe",{src:d,title:c})})}):kp.has(o)?l.jsx("div",{className:"viewer",children:l.jsx("div",{className:"viewer-body",children:l.jsx("img",{src:d,alt:c})})}):o==="md"||o==="markdown"?l.jsx(Vy,{id:s,name:c,live:u}):l.jsx(Ky,{id:s,name:c,live:u})}function Vy({id:s,name:c,live:u}){const[o,d]=w.useState("rendered"),h=$e(`/api/runs/${s}/file?name=${encodeURIComponent(c)}`,u),m=w.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:o==="rendered"?"active":"",onClick:()=>d("rendered"),children:"rendered"}),l.jsx("button",{className:o==="source"?"active":"",onClick:()=>d("source"),children:"source"})]}),h?.truncated&&l.jsxs("span",{children:["large file — showing the last ",Tu(4e5)]})]}),l.jsx("div",{className:"viewer-body",children:h?o==="rendered"?l.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:m}}):l.jsx("pre",{children:h.content||"(empty)"}):l.jsx("pre",{children:"loading…"})})]})}function Ky({id:s,name:c,live:u}){const o=$e(`/api/runs/${s}/file?name=${encodeURIComponent(c)}`,u);return l.jsxs("div",{className:"viewer",children:[o?.truncated&&l.jsxs("div",{className:"viewer-note",children:["large file — showing the last ",Tu(4e5)]}),l.jsx("div",{className:"viewer-body",children:l.jsx("pre",{children:o?o.content||"(empty)":"loading…"})})]})}function Jy(){const s=$e("/api/workflows",!1),c=s?.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"]}),s?.root&&l.jsx("span",{className:"count mono",children:s.root})]}),s&&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(u=>l.jsxs(Ee,{href:`/workflows/${u.slug}`,className:"wf-card",children:[l.jsxs("div",{className:"wf-card-head",children:[l.jsx("span",{className:"wf-name",children:u.name??u.slug}),u.error&&l.jsx("span",{className:"status-word failed",children:"broken"})]}),l.jsx("p",{className:"wf-desc",children:u.error??u.description??""}),l.jsxs("div",{className:"wf-meta num",children:[l.jsxs("span",{children:[u.agents," agents"]}),l.jsx("span",{children:"·"}),l.jsxs("span",{children:[u.steps," steps"]})]})]},u.slug))})]})}function Iy({slug:s}){const c=$e(`/api/workflows/${encodeURIComponent(s)}`,!1),u=$e("/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 o=new Map(c.agents.map((h,m)=>[h.id,m%4])),d=(u?.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(Fy,{slug:c.slug,lastRequest:d[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(Wy,{a:h,idx:o.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(Py,{s:h,i:m,idx:h.agent?o.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:["(",d.length,")"]})]})}),l.jsxs("div",{className:"file-list",children:[d.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:[ji(h.durationMs)," · ",ku(h.costUsd)," · ",gl(h.startedAt)]})]},h.id)),d.length===0&&l.jsx("div",{className:"viewer-note",children:"no runs of this workflow yet"})]})]})]})]})]})}function Fy({slug:s,lastRequest:c}){const[u,o]=w.useState(""),[d,h]=w.useState(!0),[m,p]=w.useState(!1),[y,x]=w.useState(!1),[k,_]=w.useState(null),N=$e(`/api/workflows/${encodeURIComponent(s)}/run`,!1);w.useEffect(()=>{!u&&c&&o(c)},[c]);const U=N?.available&&N?.image,b=N?N.available?N.image?"isolated container per run":"image missing — run `kraftwerk runner build`":"Docker not running — sandbox unavailable":"";async function J(){if(!(!u.trim()||y)){x(!0),_(null);try{const H=await fetch(`/api/workflows/${encodeURIComponent(s)}/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({request:u.trim(),sandbox:d,ssh:m})}),E=await H.json();if(!H.ok)throw new Error(E.error??`HTTP ${H.status}`);tn(`/runs/${E.runId}`)}catch(H){_(H.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:u,placeholder:"request — topic, URL, host …",onChange:H=>o(H.target.value),onKeyDown:H=>H.key==="Enter"&&J()}),l.jsx("button",{className:"run-btn",onClick:J,disabled:y||!u.trim()||d&&!U,children:y?"starting…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"play_arrow",className:"ms-sm"})," ",d?"run in sandbox":"run locally"]})})]}),l.jsxs("div",{className:"run-opts",children:[l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:d,onChange:H=>h(H.target.checked)}),"docker sandbox ",b&&l.jsxs("span",{className:"opt-hint",children:["— ",b]})]}),l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:m,onChange:H=>p(H.target.checked),disabled:!d}),"forward SSH agent"]})]}),k&&l.jsx("div",{className:"gate-fail-msg",children:k})]})}function Im({slug:s}){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:s})]})}function Wy({a:s,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:s.name??s.id}),l.jsxs("code",{className:"agent-id",children:["[",s.id,"]"]}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"chip",children:[s.model??"default",s.effort?` · ${s.effort}`:""]})]}),s.tools.length>0&&l.jsx("div",{className:"agent-tools",children:s.tools.map(u=>l.jsx("span",{className:"tool-chip",children:u},u))}),s.persona&&l.jsx("p",{className:"agent-persona",children:s.persona})]})}function Py({s,i:c,idx:u}){const o=s.kind==="script"?s.script:s.prompt;return l.jsxs("div",{className:"step-node",children:[l.jsx("div",{className:`step-index num ${u!=null?`aid-${u}`:"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:s.name}),s.kind==="agent"?l.jsxs("span",{className:`chip agent-chip aid-${u??0}`,children:["agent · ",s.agent]}):l.jsxs("span",{className:"chip",children:["script",s.sourceRef?` · ${s.sourceRef}`:""]})]}),o&&l.jsxs("details",{className:"step-source",children:[l.jsx("summary",{children:s.kind==="agent"?"prompt":"script"}),l.jsx("pre",{children:o})]}),s.gates.length>0&&l.jsx("div",{className:"gate-line",children:s.gates.map(d=>l.jsxs("span",{className:"gate neutral",children:["⛨ ",d]},d))})]})]})}const ej=s=>s==="ok"?"ok":s==="running"?"running":s==="aborted"?"aborted":"failed",tj=s=>s==="ok"?"done":s==="running"?"working":s==="aborted"?"stopped":"failed";function nj(s){return s.scope.kind==="agent"?`/agents/${s.scope.slug}/chat/${s.id}`:`/agents/chats/${s.id}`}function Fm(s){switch(s.scope.kind){case"agent":return s.scope.slug;case"run":return s.scope.runId;case"knowledge":return s.scope.bundle?`knowledge:${s.scope.bundle}`:"knowledge";case"kraftwerk":return"kraftwerk-aware";default:return"general"}}function Wm(s){return s.length>64?`${s.slice(0,46)}…${s.slice(-14)}`:s}function aj(){const s=$e("/api/runs",!1),c=$e("/api/chats",!1),u=$e("/api/knowledge",!1),o=$e("/api/agents",!1),d=$e("/api/workflows",!1),h=$e("/api/skills",!1),m=$e("/api/meta",!1),[p,y]=w.useState("all"),x=s?.runs??[],k=c?.chats??[],_=u?.bundles??[],N=(h?.skills??[]).filter(J=>J.source==="workspace"),U=[[d?.workflows.length,"workflows","/workflows"],[s?x.length:void 0,"runs","/runs"],[u?_.length:void 0,"bundles","/knowledge"],[h?N.length:void 0,"skills","/skills"],[c?k.length:void 0,"chats","/agents/chats"]],b=x.filter(J=>J.status==="failed"&&Date.now()-Date.parse(J.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(([J,H,E])=>l.jsxs(Ee,{href:E,children:[l.jsx("b",{className:"num",children:J??"…"})," ",H]},H))}),l.jsx(lj,{workflows:d?.workflows??[]})]}),l.jsx(sj,{agents:o?.agents.filter(J=>!J.archived),chats:k}),b.length>0&&p!=="failed"&&l.jsxs("button",{className:"dash-alert",onClick:()=>y("failed"),children:["⚠ ",b.length," run",b.length===1?"":"s"," failed in the last 24 h — review"]}),l.jsx(rj,{runs:x,chats:k,bundles:_,agents:o?.agents??[],workflows:d?.workflows??[],filter:p,setFilter:y})]})}function lj({workflows:s}){const[c,u]=w.useState(!1);return w.useEffect(()=>{if(!c)return;const o=d=>{d.target.closest(".wf-pick-wrap")||u(!1)};return window.addEventListener("mousedown",o),()=>window.removeEventListener("mousedown",o)},[c]),l.jsxs("div",{className:"dash-actions",children:[l.jsxs("button",{className:"run-btn dash-newchat",onClick:()=>tn("/agents/chats"),children:[l.jsx(Q,{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:()=>u(o=>!o),children:[l.jsx(Q,{name:"play_arrow"})," run workflow"]}),c&&l.jsxs("div",{className:"wf-pick-pop",role:"menu",children:[s.length===0&&l.jsx("span",{className:"wf-pick-empty",children:"no workflows yet"}),s.map(o=>l.jsxs(Ee,{href:`/workflows/${encodeURIComponent(o.slug)}`,className:"wf-pick-item",role:"menuitem",children:[l.jsx("span",{className:"wf-pick-name",children:o.name??o.slug}),o.description&&l.jsx("span",{className:"wf-pick-desc",children:o.description})]},o.slug))]})]})]})}function sj({agents:s,chats:c}){const u=Cn();return s&&s.length===0?l.jsx("section",{className:"panel dash-agents-empty",children:l.jsx("div",{className:"viewer-note",children:u?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:(s??[]).map(o=>{const h=c.filter(p=>p.scope.kind==="agent"&&p.scope.slug===o.slug).find(p=>p.busy),m=()=>tn(`/agents/${encodeURIComponent(o.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:o.emoji}),l.jsx("span",{className:`lamp ${h?"running":"idle"}`})]}),l.jsx("span",{className:"dash-agent-name",children:o.name}),o.description&&l.jsx("span",{className:"dash-agent-desc",children:o.description})]}),l.jsxs("div",{className:"dash-agent-foot",children:[l.jsx("span",{className:"dash-agent-state",children:h&&l.jsx(Ee,{href:`/agents/${encodeURIComponent(o.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:o.slug})},children:[l.jsx(Q,{name:"chat_bubble",className:"ms-sm"})," chat"]})]})]},o.slug)})})}function ij(s){if(s.lamp==="running")return"now";const c=new Date(s.at),u=new Date;if(c.toDateString()===u.toDateString())return"today";const o=new Date(u);return o.setDate(o.getDate()-1),c.toDateString()===o.toDateString()?"yesterday":"earlier"}const cj=[["all","all"],["run","runs"],["session","chats"],["knowledge","knowledge"]];function rj({runs:s,chats:c,bundles:u,agents:o,workflows:d,filter:h,setFilter:m}){const p=Cn(),y=w.useMemo(()=>{const k=[],_=U=>U?d.find(b=>b.slug===U)?.name??U:void 0;for(const U of s)k.push({at:U.updatedAt,kind:"run",emoji:"⚙️",title:_(U.workflow)??U.id,sub:U.request??"",href:`/runs/${U.id}`,lamp:ej(U.status),status:tj(U.status)});for(const U of c){const b=U.scope.kind==="agent"?o.find(J=>U.scope.kind==="agent"&&J.slug===U.scope.slug):void 0;k.push({at:U.updatedAt,kind:"session",emoji:b?b.emoji||"🤖":"💬",title:b?b.name:U.title||"new chat",sub:b?`${U.title||"new chat"}${p?` · ${U.agent}`:""}`:p?`${U.agent} · ${Fm(U)}`:Fm(U),href:nj(U),lamp:U.busy?"running":"ok",status:U.busy?"working":void 0})}for(const U of u)U.updatedAt&&k.push({at:U.updatedAt,kind:"knowledge",emoji:"📚",title:U.name,sub:`${U.concepts} concepts`,href:`/knowledge/${encodeURIComponent(U.name)}`,lamp:"ok"});return(h==="all"?k:h==="failed"?k.filter(U=>U.kind==="run"&&U.lamp==="failed"):k.filter(U=>U.kind===h)).sort((U,b)=>{const J=+(b.lamp==="running")-+(U.lamp==="running");return J!==0?J:b.at.localeCompare(U.at)}).slice(0,15)},[s,c,u,o,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:[cj.map(([k,_])=>l.jsx("button",{className:`feed-chip ${h===k?"on":""}`,onClick:()=>m(k),children:_},k)),h==="failed"&&l.jsxs("button",{className:"feed-chip on failed",onClick:()=>m("all"),children:["failed ",l.jsx(Q,{name:"close",className:"ms-sm"})]})]})]}),y.length===0?l.jsx("div",{className:"viewer-note",children:h==="all"?"nothing yet — run a workflow or start a session":"nothing here for this filter"}):l.jsx("div",{className:"m3-list",children:y.map(k=>{const _=ij(k),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:k.href,className:"m3-row m3-link",children:[l.jsxs("span",{className:"agent-avatar",children:[l.jsx("span",{"aria-hidden":!0,children:k.emoji}),k.lamp==="running"&&l.jsx("span",{className:"lamp running"})]}),l.jsx("span",{className:`chip dash-kind ${k.kind}`,children:k.kind==="session"?"chat":k.kind}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:Wm(k.title)}),k.sub&&l.jsx("span",{className:"m3-sub",children:Wm(k.sub)})]}),k.status&&l.jsx("span",{className:`chip status ${k.lamp}`,children:k.status}),l.jsx("span",{className:"side-when num",title:new Date(k.at).toLocaleString(),children:cs(k.at)}),l.jsx("span",{className:"m3-chev",children:l.jsx(Q,{name:"chevron_right"})})]})]},`${k.kind}:${k.href}:${k.at}`)})})]})}async function Uu(s,c){const u=window.open("","_blank");if(!u)return;const o=c?`${s}/${c}`:s;u.document.write(`<title>${En(o)}</title><body style="font-family:system-ui;padding:40px;color:#555">preparing ${En(o)}…</body>`);const d=b=>`/api/knowledge/${encodeURIComponent(s)}/concept?id=${encodeURIComponent(b)}`;let h,m="";try{const[b,J]=await Promise.all([c?Promise.resolve([c]):fetch(`/api/knowledge/${encodeURIComponent(s)}`).then(H=>H.json()).then(H=>H.concepts.map(E=>E.id)),fetch("/api/meta").then(H=>H.json()).catch(()=>({}))]);if(m=J.projectName??"",h=await Promise.all(b.map(H=>fetch(d(H)).then(E=>E.json()))),h.some(H=>typeof H?.id!="string"))throw new Error("missing concept")}catch{u.document.body.textContent=`could not load "${o}"`;return}const p=[],y=h.map(b=>{const J=[b.type,b.generated?.at?`updated ${b.generated.at.slice(0,10)}`:"",b.trustTier==="human-reviewed"?"human-reviewed":"",(b.tags??[]).map(R=>`#${R}`).join(" ")].filter(Boolean).join(" · "),{md:H,notes:E}=oj(Tp(b.body??"",null)),te=!b.title||b.title===b.id||b.title===b.id.split("/").pop(),{html:ie,title:Y}=uj(vl.sanitize(ze.parse(H,{async:!1})),{title:b.title||b.id,meta:J,titleIsFallback:te});p.push(Y);const F=E.length?`<ol class="notes">${E.map(R=>`<li id="fn-${En(R.id)}">${vl.sanitize(ze.parseInline(R.text,{async:!1}))}</li>`).join("")}</ol>`:"";return`<article>
78
+ ${ie}
79
+ ${F}
80
+ </article>`}).join(`
81
+ `),x=new Date().toISOString().slice(0,10),k=m?`${En(m)} · ${En(s)}`:En(s),_=c?p[0]||o:s,N=c?"":`<h1 class="cover">${En(s)}</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>${k}</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>`;u.location.href=URL.createObjectURL(new Blob([U],{type:"text/html"}))}function Tp(s,c){return s.split(/(```[\s\S]*?```|`[^`]*`)/).map((u,o)=>o%2===1?u:u.replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(d,h,m)=>{const p=h.trim().replace(/\.md$/,""),y=(m??p).trim();return c===null?y:`[${y}](#/knowledge/${encodeURIComponent(c)}/${p})`})).join("")}function oj(s){const c=[];return{md:s.replace(/^\[\^([^\]]+)\]:[ \t]*(.+)$/gm,(o,d,h)=>(c.push({id:d,text:h.trim()}),"")).replace(/\[\^([^\]]+)\]/g,(o,d)=>{const h=c.findIndex(m=>m.id===d);return h>=0?`<sup class="fnref">${h+1}</sup>`:""}),notes:c}}function uj(s,c){const u=new DOMParser().parseFromString(s,"text/html");let o=c.title;const d=u.body.firstElementChild;c.titleIsFallback&&d?.tagName==="H1"&&(o=d.textContent?.trim()||o,d.remove());const h=u.createElement("header");h.innerHTML=`<h1>${En(o)}</h1><div class="meta">${En(c.meta)}</div>`,u.body.prepend(h);for(const m of u.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(u.body.querySelectorAll(`:scope > h${m}`))){const y=u.createElement(`h${m+1}`);y.innerHTML=p.innerHTML,p.replaceWith(y)}for(const m of Array.from(u.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=u.createElement("div");y.className="keep",m.replaceWith(y),y.append(m,p)}return{html:u.body.innerHTML,title:o}}function En(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ep(s,c){return`/edit/${encodeURIComponent(s)}/${c.split("/").map(encodeURIComponent).join("/")}`}function dj({bundle:s,conceptId:c}){const u=$e("/api/knowledge",!1),o=u?.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(Q,{name:"add",className:"ms-sm"})," new"]})]}),l.jsxs("div",{className:"side-list",children:[o.map(d=>l.jsxs(Ee,{href:`/knowledge/${encodeURIComponent(d.name)}`,className:`side-row ${d.name===s?"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:d.name}),l.jsx("span",{className:"side-when num",children:d.concepts})]}),l.jsx("div",{className:"side-row-sub",children:l.jsxs("span",{className:"side-req",children:[d.okfVersion?`okf ${d.okfVersion}`:"okf",d.updatedAt?` · ${d.updatedAt.slice(0,10)}`:""]})})]})]},d.name)),u&&o.length===0&&l.jsx("div",{className:"viewer-note",children:"no bundles yet"})]})]}),l.jsx("div",{className:"runs-main",children:s?l.jsx(hj,{name:s,conceptId:c},s):l.jsx(fj,{root:u?.root})})]})}function fj({root:s}){const[c,u]=w.useState(""),[o,d]=w.useState(""),[h,m]=w.useState(!1);async function p(){const y=c.trim();if(!y)return;m(!0),d("");const k=await(await fetch("/api/knowledge",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:y})})).json();m(!1),k.error?d(k.error):window.location.hash=`/knowledge/${encodeURIComponent(y)}`}return l.jsxs("div",{className:"new-chat",children:[l.jsx("div",{className:"page-head",children:l.jsx("h1",{children:"context & knowledge"})}),l.jsxs("section",{className:"panel new-chat-panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"what lives here"})}),l.jsxs("div",{className:"know-intro",children:["Curated knowledge as ",l.jsx("b",{children:"OKF bundles"})," (Open Knowledge Format v0.2): plain markdown files with YAML frontmatter",s?l.jsxs(l.Fragment,{children:[" under ",l.jsx("code",{children:s})]}):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=>u(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"})]}),o&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",o]})]})]})}function Pm({tier:s}){return l.jsx("span",{className:`chip trust ${s}`,children:s})}const ep="@activity";function hj({name:s,conceptId:c}){const u=$e(`/api/knowledge/${encodeURIComponent(s)}`,!1);if(!u)return l.jsx("div",{className:"empty",children:"loading…"});if("error"in u)return l.jsx("div",{className:"empty",children:"bundle not found"});const o=c===ep?"activity":"pages",d=u.concepts,h=o==="pages"?c&&d.some(p=>p.id===c)?c:d[0]?.id:void 0,m=`/knowledge/${encodeURIComponent(s)}`;return l.jsxs("div",{className:"agent-view",children:[l.jsxs("div",{className:"page-head",children:[l.jsx("h1",{children:s}),l.jsxs("span",{className:"count",children:[d.length," pages"]}),l.jsxs("div",{className:"tabs",children:[l.jsx(Ee,{href:m,className:o==="pages"?"active":"",children:"pages"}),l.jsx(Ee,{href:`${m}/${ep}`,className:o==="activity"?"active":"",children:"activity"})]}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"open-raw",onClick:()=>{Uu(s)},children:[l.jsx(Q,{name:"picture_as_pdf",className:"ms-sm"})," export PDF"]}),l.jsx("button",{className:"run-btn",onClick:()=>{us("claude",{kind:"knowledge",bundle:s})},children:"curate in chat"})]}),o==="activity"?u.log?l.jsx(xj,{name:s,log:u.log}):l.jsx("section",{className:"panel",children:l.jsx("div",{className:"viewer-note",children:"no activity yet"})}):d.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 ",s,"/<path>"]}),"."]})}):l.jsxs("div",{className:"wiki",children:[l.jsx("aside",{className:"wiki-side",children:vj(d).map(({folder:p,concepts:y})=>l.jsxs(w.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(Q,{name:mj(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(yj,{bundle:s,conceptId:h},h)})]})]})}function mj(s){switch((s??"").toLowerCase()){case"reference":return"article";case"policy":return"gavel";case"guide":case"howto":return"route";case"decision":return"balance";default:return"menu_book"}}function pj(s){const c=[];for(const u of s.split(`
203
+ `)){const o=u.match(/^##\s+(\d{4}-\d{2}-\d{2})/);if(o){c.push({date:o[1],entries:[]});continue}const d=u.match(/^[*-]\s+\*\*([^*]+)\*\*:\s*(.*)$/);d&&c.length>0&&c[c.length-1].entries.push({kind:d[1].toLowerCase(),text:d[2]})}return c.filter(u=>u.entries.length>0)}function gj(s,c){const u=[],o=/\[([^\]]+)\]\(\/?([^)]+?)\.md\)/g;let d=0,h;for(;h=o.exec(c);)h.index>d&&u.push(c.slice(d,h.index)),u.push(l.jsx(Ee,{href:`/knowledge/${encodeURIComponent(s)}/${h[2].replace(/^\//,"")}`,children:h[1]},h.index)),d=h.index+h[0].length;return d<c.length&&u.push(c.slice(d)),u}function xj({name:s,log:c}){const u=pj(c),[o,d]=w.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:()=>d(!o),children:o?"timeline":"raw log"})]}),o||u.length===0?l.jsx("div",{className:"viewer-body",children:l.jsx("pre",{children:c})}):l.jsx("div",{className:"know-log",children:u.map(h=>l.jsxs(w.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:gj(s,m.text)})]},p))]},h.date))})]})}function vj(s){const c=new Map;for(const u of s){const o=u.id.includes("/")?u.id.slice(0,u.id.lastIndexOf("/")):"";(c.get(o)??c.set(o,[]).get(o)).push(u)}return[...c.keys()].sort((u,o)=>u===""?-1:o===""?1:u.localeCompare(o)).map(u=>({folder:u,concepts:c.get(u)}))}function yj({bundle:s,conceptId:c}){const[u,o]=w.useState(null),[d,h]=w.useState(!1),[m,p]=w.useState(!1),[y,x]=w.useState(!1),[k,_]=w.useState(""),[N,U]=w.useState(!1),[b,J]=w.useState(""),[H,E]=w.useState("rendered"),te=w.useMemo(()=>u?vl.sanitize(ze.parse(Tp(u.body,s),{async:!1})):"",[u?.body,s]),ie=()=>{fetch(`/api/knowledge/${encodeURIComponent(s)}/concept?id=${encodeURIComponent(c)}`).then(R=>R.ok?R.json():Promise.reject()).then(o).catch(()=>h(!0))};w.useEffect(()=>{if(y)return;let R=!0,V;const ae=async()=>{try{const L=await fetch(`/api/knowledge/${encodeURIComponent(s)}/concept?id=${encodeURIComponent(c)}`,{cache:"no-store"});if(L.ok){const I=await L.json();R&&(h(!1),o(ce=>JSON.stringify(ce)===JSON.stringify(I)?ce:I))}else L.status===404&&R&&h(!0)}catch{}R&&(V=setTimeout(ae,6e3))};return ae(),()=>{R=!1,clearTimeout(V)}},[s,c,y]);async function Y(){p(!0),await fetch(`/api/knowledge/${encodeURIComponent(s)}/verify`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:c})}).catch(()=>{}),p(!1),ie()}async function F(){U(!0),J("");const R=await fetch(`/api/knowledge/${encodeURIComponent(s)}/concept`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:c,content:k})}).then(V=>V.json()).catch(()=>({error:"save failed"}));U(!1),R.error?J(R.error):(o(R),x(!1))}return d?l.jsx("div",{className:"empty",children:"concept not found"}):u?l.jsxs("div",{className:"agent-view",children:[l.jsxs("div",{className:"detail-head",children:[l.jsx("h1",{children:u.title}),u.type&&l.jsx("span",{className:"chip agent",children:u.type}),l.jsx(Pm,{tier:u.trustTier}),u.status!=="stable"&&l.jsx("span",{className:`chip ${u.status}`,children:u.status}),u.stale&&l.jsxs("span",{className:"chip stale",children:["stale since ",u.staleAfter?.slice(0,10)]}),l.jsx("span",{className:"spacer"}),l.jsxs(Ee,{href:Ep(s,u.id),className:"open-raw",title:"Full-screen document editor with autosave",children:[l.jsx(Q,{name:"edit_document",className:"ms-sm"})," open in editor"]}),l.jsxs("button",{className:"open-raw",onClick:()=>{Uu(s,u.id)},children:[l.jsx(Q,{name:"picture_as_pdf",className:"ms-sm"})," export PDF"]}),l.jsx("button",{className:"run-btn",disabled:m,onClick:Y,children:m?"verifying…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"check",className:"ms-sm"})," verify (human)"]})})]}),u.error&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",u.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:[s,"/",u.id,".md"]}),y?l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"open-raw",onClick:()=>{x(!1),J("")},children:"cancel"}),l.jsx("button",{className:"open-raw",disabled:N,onClick:F,children:N?"saving…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"check",className:"ms-sm"})," save"]})})]}):l.jsxs("button",{className:"open-raw",onClick:()=>{_(u.raw),x(!0),J("")},children:[l.jsx(Q,{name:"edit",className:"ms-sm"})," edit"]})]}),y?l.jsxs(l.Fragment,{children:[l.jsx("textarea",{className:"concept-edit",value:k,rows:Math.min(40,Math.max(18,k.split(`
204
+ `).length+2)),onChange: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:H==="rendered"?"active":"",onClick:()=>E("rendered"),children:"rendered"}),l.jsx("button",{className:H==="source"?"active":"",onClick:()=>E("source"),children:"source"})]})}),l.jsx("div",{className:"viewer-body",children:H==="rendered"?l.jsx("div",{className:"md-body concept-md",dangerouslySetInnerHTML:{__html:te}}):l.jsx("pre",{children:u.body.trim()||"(empty body)"})})]}),b&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",b]})]}),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:u.trustTier})})]}),l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"generated"}),l.jsx("span",{className:`v ${u.generated?"":"dim"}`,children:u.generated?`${u.generated.by??"?"} · ${(u.generated.at??"?").slice(0,10)}`:"not stamped"})]}),l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"verified"}),u.verified.length===0?l.jsx("span",{className:"v dim",children:"never"}):u.verified.map((R,V)=>l.jsxs("span",{className:"v",children:[R.by??"?"," · ",(R.at??"?").slice(0,10)]},V))]}),u.staleAfter&&l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"stale after"}),l.jsxs("span",{className:`v ${u.stale?"":"dim"}`,children:[u.staleAfter.slice(0,10),u.stale&&l.jsx("span",{className:"chip stale",children:"stale"})]})]}),u.tags.length>0&&l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"tags"}),l.jsx("span",{className:"m3-chips",children:u.tags.map(R=>l.jsx("span",{className:"chip",children:R},R))})]})]})]}),u.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:u.sources.map((R,V)=>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(" · ")})]},V))})]})]})]})]}):l.jsx("div",{className:"empty",children:"loading…"})}const jj={workspace:"workspace",project:".claude",user:"global",agent:"agent"};function _p(s){return l.jsx("span",{className:`chip skill-src ${s}`,children:jj[s]})}function bj({name:s}){const c=$e("/api/skills",!1),u=c?.skills??[],o=u.filter(m=>m.source==="workspace"),d=u.filter(m=>m.source!=="workspace"),h=m=>l.jsxs(Ee,{href:`/skills/${encodeURIComponent(m.name)}`,className:`side-row ${m.name===s?"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"&&_p(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:[o.map(h),c&&o.length===0&&l.jsx("div",{className:"viewer-note",children:"no workspace skills yet"}),d.length>0&&l.jsxs(w.Fragment,{children:[l.jsx("div",{className:"side-head skills-local-head",children:l.jsx("span",{className:"microlabel",children:"local (this machine / repo)"})}),d.map(h)]})]})]}),l.jsx("div",{className:"runs-main",children:s?l.jsx(wj,{name:s},s):l.jsx(Nj,{root:c?.root,workspace:o})})]})}function Nj({root:s,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"}),s?l.jsxs(l.Fragment,{children:[" live under ",l.jsx("code",{children:s})]}):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:[s?`${s}/`:"skills/","<name>/SKILL.md"]}),", commit it, done — it appears here and in every session's ",l.jsx("code",{children:"/"})," menu."]})]})]})}function wj({name:s}){const[c,u]=w.useState(null),[o,d]=w.useState(!1),[h,m]=w.useState("rendered"),p=w.useMemo(()=>c?c.content.replace(/^---\r?\n[\s\S]*?\r?\n---(\r?\n|$)/,""):"",[c?.content]),y=w.useMemo(()=>c?vl.sanitize(ze.parse(p,{async:!1})):"",[p]);return w.useEffect(()=>{fetch(`/api/skills/${encodeURIComponent(s)}`).then(x=>x.ok?x.json():Promise.reject()).then(u).catch(()=>d(!0))},[s]),o?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]}),_p(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 Sj=["","low","medium","high","xhigh","max"],kj=["🤖","🧑‍💻","🎧","🛠️","📊","✍️","🔍","🧹","📦","🚀"];function tp({seg:s}){const c=s[0]&&s[0]!=="new"&&s[0]!=="chats"?decodeURIComponent(s[0]):void 0,u=s[0]==="new"?"new":s[0]==="chats"?"chats":s[1]==="edit"?"edit":s[1]==="info"?"info":s[1]==="chat"?"chat":c?"agent":"home",o=u==="chat"?s[2]:u==="chats"?s[1]:void 0,d=$e("/api/agents",!1),h=Cn(),[m,p]=w.useState(()=>{try{const G=JSON.parse(localStorage.getItem("kw-agent-groups")??"[]");return Array.isArray(G)?G.map(String):[]}catch{return[]}}),[y,x]=w.useState(!1),[k,_]=w.useState(""),[N,U]=w.useState(null),[b,J]=w.useState(""),[H,E]=w.useState(null),[te,ie]=w.useState(null),[Y,F]=w.useState({}),R=(d?.agents??[]).map(G=>Y[G.slug]!==void 0?{...G,group:Y[G.slug]||void 0}:G);w.useEffect(()=>{F(G=>{const Re={...G};let Ye=!1;for(const We of d?.agents??[])Re[We.slug]!==void 0&&(We.group??"")===Re[We.slug]&&(delete Re[We.slug],Ye=!0);return Ye?Re:G})},[d]);const V=R.filter(G=>!G.archived),ae=R.filter(G=>G.archived),[L,I]=w.useState(!1),ce=[...new Set([...V.map(G=>G.group??"").filter(Boolean),...m])].sort((G,Re)=>G.localeCompare(Re)),W=V.filter(G=>!G.group);function he(G){p(G);try{localStorage.setItem("kw-agent-groups",JSON.stringify(G))}catch{}}function Le(){const G=k.trim();x(!1),_(""),G&&!ce.includes(G)&&he([...m,G])}function at(G,Re){U(null);const Ye=Re.trim();if(!(!Ye||Ye===G)){for(const We of R.filter(nn=>nn.group===G))$(We.slug,Ye);m.includes(G)&&he([...new Set(m.map(We=>We===G?Ye:We))])}}async function $(G,Re){if((R.find(We=>We.slug===G)?.group??"")!==Re){F(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{F(We=>{const nn={...We};return delete nn[G],nn})}}}const ne=G=>h?{onDragOver:Re=>{H!=null&&(Re.preventDefault(),Re.dataTransfer.dropEffect="move",te!==G&&ie(G))},onDrop:Re=>{Re.preventDefault();const Ye=Re.dataTransfer.getData("text/plain")||H;Ye&&$(Ye,G),E(null),ie(null)}}:{},de=G=>l.jsxs(Ee,{href:`/agents/${encodeURIComponent(G.slug)}`,className:`side-row ${G.slug===c?"active":""} ${H===G.slug?"dragging":""}`,draggable:h,onDragStart:Re=>{Re.dataTransfer.setData("text/plain",G.slug),Re.dataTransfer.effectAllowed="move",E(G.slug)},onDragEnd:()=>{E(null),ie(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 be;u==="new"?be=l.jsx(ap,{},"new"):u==="edit"&&c?be=l.jsx(ap,{slug:c},c):u==="chat"&&c&&o?be=l.jsx("div",{className:"chat-main",children:l.jsx(Km,{id:o,agentName:R.find(G=>G.slug===c)?.name??c,agentDescription:R.find(G=>G.slug===c)?.description},o)}):u==="chats"?be=o?l.jsx("div",{className:"chat-main",children:l.jsx(Km,{id:o},o)}):l.jsx(Ry,{}):u==="info"&&c?be=l.jsx(Ap,{slug:c},c):c?be=l.jsx(Ej,{slug:c},c):be=l.jsx(Cj,{hasAgents:V.length>0,root:d?.root});const T=(u==="agent"||u==="info"||u==="chat")&&c?R.find(G=>G.slug===c)?.knowledge??[]:[],[X,le]=w.useState(()=>localStorage.getItem("kw-kside")!=="hidden"),[ee,ge]=w.useState(()=>Number(localStorage.getItem("kw-kside-w"))||460),ve=T.length>0&&X;function _e(G){le(G),localStorage.setItem("kw-kside",G?"open":"hidden")}function mt(G){ge(G),localStorage.setItem("kw-kside-w",String(G))}return l.jsxs("div",{className:`runs-screen agents-screen ${c||u==="chats"?"has-sessions":""} ${ve?"has-knowledge":""}`,style:ve?{"--kside-w":`${ee}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(Q,{name:"add",className:"ms-sm"})," new"]})]}),l.jsxs("div",{className:"side-list",children:[l.jsxs(Ee,{href:"/agents/chats",className:`side-row side-general ${u==="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 ${H&&te===""?"drop-over":""}`,...ne(""),children:[W.map(de),H!=null&&W.length===0&&l.jsx("div",{className:"side-group-empty",children:"no group — drop here"})]}),ce.map(G=>{const Re=V.filter(Ye=>Ye.group===G);return l.jsxs("div",{className:`side-group ${H&&te===G?"drop-over":""}`,...ne(G),children:[l.jsxs("div",{className:"side-group-head",children:[N===G?l.jsx("input",{className:"side-group-rename",autoFocus:!0,value:b,onChange:Ye=>J(Ye.target.value),onKeyDown:Ye=>{Ye.key==="Enter"&&at(G,b),Ye.key==="Escape"&&U(null)},onBlur:()=>at(G,b)}):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),J(G)},children:l.jsx(Q,{name:"edit",className:"ms-sm"})}),h&&Re.length===0&&m.includes(G)&&l.jsx("button",{className:"side-group-x",title:"Remove empty group",onClick:()=>he(m.filter(Ye=>Ye!==G)),children:l.jsx(Q,{name:"close",className:"ms-sm"})})]}),Re.map(de),Re.length===0&&l.jsx("div",{className:"side-group-empty",children:h?"drag agents here":"no agents"})]},G)}),ae.length>0&&l.jsxs("div",{className:"side-group side-archived",children:[l.jsxs("button",{className:"side-archived-toggle","aria-expanded":L,onClick:()=>I(G=>!G),children:[l.jsx("span",{className:"microlabel",children:"archived"}),l.jsx("span",{className:"side-group-count num",children:ae.length}),l.jsx("span",{className:"spacer"}),l.jsx(Q,{name:L?"expand_less":"expand_more",className:"ms-sm"})]}),L&&ae.map(Ce)]}),d&&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:k,placeholder:"group name, e.g. Team Content",onChange:G=>_(G.target.value),onKeyDown:G=>{G.key==="Enter"&&Le(),G.key==="Escape"&&(x(!1),_(""))},onBlur:Le})}):l.jsxs("button",{className:"side-group-add",onClick:()=>x(!0),children:[l.jsx(Q,{name:"add",className:"ms-sm"})," group"]}))]})]}),c&&l.jsx(_j,{slug:c,chatId:o}),u==="chats"&&l.jsx(Aj,{chatId:o}),l.jsx("div",{className:"runs-main",children:be}),ve&&l.jsx(Tj,{bundles:T,onHide:()=>_e(!1),onResize:mt}),T.length>0&&!X&&l.jsxs("button",{className:"kside-reopen",onClick:()=>_e(!0),title:"Show knowledge sidebar",children:[l.jsx(Q,{name:"menu_book",className:"ms-sm"})," knowledge"]})]})}function Tj({bundles:s,onHide:c,onResize:u}){const[o,d]=w.useState({}),[h,m]=w.useState(null),[p,y]=w.useState({}),[x,k]=w.useState({}),[_,N]=w.useState(null),[U,b]=w.useState(""),[J,H]=w.useState(!1),[E,te]=w.useState("");w.useEffect(()=>{d({});let F=!0,R;const V=async()=>{await Promise.all(s.map(async ae=>{try{const L=await fetch(`/api/knowledge/${encodeURIComponent(ae)}`,{cache:"no-store"}),I=L.ok?await L.json():null;F&&d(ce=>JSON.stringify(ce[ae])===JSON.stringify(I)?ce:{...ce,[ae]:I})}catch{F&&d(L=>ae in L?L:{...L,[ae]:null})}})),F&&(R=setTimeout(V,6e3))};return V(),()=>{F=!1,clearTimeout(R)}},[s.join(",")]),w.useEffect(()=>{if(!h||_===h)return;const F=h.indexOf("::"),R=h.slice(0,F),V=h.slice(F+2);let ae=!0,L;const I=async()=>{try{const ce=await fetch(`/api/knowledge/${encodeURIComponent(R)}/concept?id=${encodeURIComponent(V)}`,{cache:"no-store"}),W=ce.ok?await ce.json():null;ae&&y(he=>JSON.stringify(he[h])===JSON.stringify(W)?he:{...he,[h]:W})}catch{ae&&y(ce=>h in ce?ce:{...ce,[h]:null})}ae&&(L=setTimeout(I,6e3))};return I(),()=>{ae=!1,clearTimeout(L)}},[h,_]);function ie(F,R){const V=`${F}::${R}`;m(h===V?null:V)}async function Y(F,R){const V=`${F}::${R}`;H(!0),te("");try{const L=await(await fetch(`/api/knowledge/${encodeURIComponent(F)}/concept`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:R,content:U})})).json();L.error?te(L.error):(y(I=>({...I,[V]:L})),N(null))}catch(ae){te(ae.message)}H(!1)}return l.jsxs("aside",{className:"runs-side knowledge-side",children:[l.jsx("div",{className:"kside-resizer",title:"Drag to resize",onMouseDown:F=>{F.preventDefault();const R=F.clientX,V=F.currentTarget.parentElement.offsetWidth,ae=I=>u(Math.min(900,Math.max(280,V+(R-I.clientX)))),L=()=>{window.removeEventListener("mousemove",ae),window.removeEventListener("mouseup",L)};window.addEventListener("mousemove",ae),window.addEventListener("mouseup",L)}}),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(Q,{name:"close",className:"ms-sm"})]})]}),l.jsx("div",{className:"side-list",children:s.map(F=>{const R=o[F],V=x[F]===!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":!V,onClick:()=>k({...x,[F]:!V}),children:[l.jsx("span",{className:`kside-chev ${V?"":"open"}`,"aria-hidden":!0,children:l.jsx(Q,{name:"chevron_right",className:"ms-sm"})}),l.jsx("span",{className:"kside-bundle-name",children:F}),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:()=>{Uu(F)},children:l.jsx(Q,{name:"picture_as_pdf",className:"ms-sm"})}),l.jsx(Ee,{href:`/knowledge/${encodeURIComponent(F)}`,className:"kside-open",title:"Open this bundle on the knowledge screen",children:"↗"})]}),!V&&R===null&&l.jsx("div",{className:"viewer-note",children:"bundle not found"}),!V&&R?.concepts.map(ae=>{const L=`${F}::${ae.id}`,I=h===L,ce=`/knowledge/${encodeURIComponent(F)}/${ae.id.split("/").map(encodeURIComponent).join("/")}`;return l.jsxs("div",{className:`kside-concept ${I?"open":""}`,children:[l.jsxs("button",{className:"kside-row","aria-expanded":I,title:ae.description||void 0,onClick:()=>ie(F,ae.id),children:[l.jsx("span",{className:`kside-chev ${I?"open":""}`,"aria-hidden":!0,children:l.jsx(Q,{name:"chevron_right",className:"ms-sm"})}),l.jsx("span",{className:"kside-title",children:ae.title||ae.id}),ae.stale&&l.jsx("span",{className:"kside-stale",title:"Past its stale-after date — ask the agent to re-verify it",children:"stale"})]}),I&&l.jsx("div",{className:"kside-card",ref:W=>W?.scrollIntoView({block:"nearest"}),children:p[L]===void 0?l.jsx("div",{className:"viewer-note",children:"loading…"}):p[L]===null?l.jsx("div",{className:"viewer-note",children:"could not load concept"}):_===L?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:W=>b(W.target.value),spellCheck:!1}),l.jsxs("div",{className:"kside-actions",children:[l.jsx("button",{className:"open-raw",disabled:J,onClick:()=>N(null),children:"cancel"}),l.jsx("button",{className:"open-raw",disabled:J,onClick:()=>Y(F,ae.id),children:J?"saving…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"check",className:"ms-sm"})," save"]})})]}),E&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",E]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"kside-card-bar",children:[ae.type&&l.jsx("span",{className:"kside-type",children:ae.type}),np(ae)&&l.jsxs("span",{className:"kside-updated num",children:["updated ",gl(np(ae))]}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"open-raw",onClick:()=>{b(p[L].raw),N(L),te("")},children:[l.jsx(Q,{name:"edit",className:"ms-sm"})," edit"]}),l.jsxs(Ee,{href:Ep(F,ae.id),className:"open-raw",title:"Full-screen document editor with autosave",children:[l.jsx(Q,{name:"edit_document",className:"ms-sm"})," editor"]}),l.jsx(Ee,{href:ce,className:"open-raw",children:"open ↗"})]}),l.jsx("div",{className:"kside-md md-body",dangerouslySetInnerHTML:{__html:vl.sanitize(ze.parse(p[L].body??"",{async:!1}))}})]})})]},ae.id)}),!V&&R&&R.concepts.length===0&&l.jsx("div",{className:"viewer-note",children:"no concepts yet"})]},F)})})]})}function np(s){return[s.generated?.at,...s.verified.map(u=>u.at)].filter(u=>typeof u=="string"&&u.length>0).sort().pop()}function Ej({slug:s}){const[c,u]=w.useState(!1);return w.useEffect(()=>{let o=!0;return u(!1),fetch("/api/chats").then(d=>d.json()).then(d=>{if(!o)return;const h=d.chats.find(m=>m.scope.kind==="agent"&&m.scope.slug===s);h?tn(`/agents/${encodeURIComponent(s)}/chat/${h.id}`,{replace:!0}):u(!0)}).catch(()=>o&&u(!0)),()=>{o=!1}},[s]),c?l.jsx(Ap,{slug:s}):l.jsx("div",{className:"empty",children:"loading…"})}function _j({slug:s,chatId:c}){const u=$e("/api/chats",!1),o=(u?.chats??[]).filter(m=>m.scope.kind==="agent"&&m.scope.slug===s),[d,h]=w.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(s)}/info`,className:"open-raw",title:"agent profile & settings",children:"profile"}),l.jsx("button",{className:"open-raw",disabled:d,onClick:async()=>{h(!0),await us("claude",{kind:"agent",slug:s}),h(!1)},children:d?"…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"add",className:"ms-sm"})," new"]})})]}),l.jsxs("div",{className:"side-list",children:[o.map(m=>l.jsxs(Ee,{href:`/agents/${encodeURIComponent(s)}/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(s)}`))},children:l.jsx(Q,{name:"close",className:"ms-sm"})})]},m.id)),u&&o.length===0&&l.jsx("div",{className:"viewer-note",children:"no sessions yet"})]})]})}function Aj({chatId:s}){const c=$e("/api/chats",!1),u=(c?.chats??[]).filter(o=>o.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(Q,{name:"add",className:"ms-sm"})," new"]})]}),l.jsxs("div",{className:"side-list",children:[u.map(o=>l.jsxs(Ee,{href:`/agents/chats/${o.id}`,className:`side-row ${o.id===s?"active":""}`,children:[l.jsx("span",{className:`lamp ${o.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:o.title||"new chat"})}),l.jsxs("div",{className:"side-row-sub",children:[l.jsxs("span",{className:"side-req",children:[o.agent,o.scope.kind==="run"?` · ${o.scope.runId}`:o.scope.kind==="kraftwerk"?" · kraftwerk":o.scope.kind==="knowledge"?` · knowledge${o.scope.bundle?`:${o.scope.bundle}`:""}`:""]}),l.jsx("span",{className:"side-when num",children:gl(o.updatedAt)})]})]}),l.jsx("button",{type:"button",className:"row-x",title:"delete chat",onClick:async d=>{d.preventDefault(),d.stopPropagation(),window.confirm(`Delete chat "${o.title||o.id}"?`)&&(await fetch(`/api/chats/${o.id}`,{method:"DELETE"}).catch(()=>{}),o.id===s&&tn("/agents/chats"))},children:l.jsx(Q,{name:"close",className:"ms-sm"})})]},o.id)),c&&u.length===0&&l.jsx("div",{className:"viewer-note",children:"no chats yet"})]})]})}function Cj({hasAgents:s,root:c}){const u=Cn();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."]}),u?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(Q,{name:"add",className:"ms-sm"})," ",s?"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 Ap({slug:s}){const[c,u]=w.useState(null),[o,d]=w.useState(!1),[h,m]=w.useState(!1),[p,y]=w.useState(!1),[x,k]=w.useState(""),[_,N]=w.useState(""),[U,b]=w.useState([]),[J,H]=w.useState(!0),[E,te]=w.useState(!1),[ie,Y]=w.useState(""),F=$e("/api/workflows",!1),R=$e("/api/knowledge",!1),V=$e("/api/skills",!1);w.useEffect(()=>{let W=!0;return fetch(`/api/agents/${encodeURIComponent(s)}`).then(he=>he.ok?he.json():Promise.reject()).then(he=>W&&u(he)).catch(()=>W&&d(!0)),()=>{W=!1}},[s]);async function ae(W){if(c){te(!0),Y("");try{const Le=await(await fetch(`/api/agents/${encodeURIComponent(s)}`,{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,...W})})).json();Le.error?Y(Le.error):(u(Le),k(""))}catch(he){Y(he.message)}te(!1)}}function L(W,he){b(he?[...U,W]:U.filter(Le=>Le!==W))}async function I(W){te(!0),Y("");try{const Le=await(await fetch(`/api/agents/${encodeURIComponent(s)}/archive`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({archived:W})})).json();Le.error?Y(Le.error):u(Le)}catch(he){Y(he.message)}te(!1)}if(o)return l.jsx("div",{className:"empty",children:"agent not found"});if(!c)return l.jsx("div",{className:"empty",children:"loading…"});const ce=W=>l.jsxs("div",{className:"agent-form-row",style:{marginTop:8},children:[l.jsx("button",{className:"run-btn",disabled:E,onClick:()=>{ae(W)},children:E?"saving…":"save"}),l.jsx("button",{className:"open-raw",disabled:E,onClick:()=>(k(""),Y("")),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(Q,{name:"inventory_2",className:"ms-sm"})," archived"]}),l.jsx("span",{className:"spacer"}),l.jsx(Ee,{href:`/agents/${encodeURIComponent(s)}/edit`,className:"open-raw",children:"edit"}),c.archived?l.jsxs("button",{className:"run-btn tonal",disabled:E,onClick:()=>{I(!1)},children:[l.jsx(Q,{name:"unarchive",className:"ms-sm"})," ",E?"…":"unarchive"]}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"open-raw",disabled:E,title:"Hide this agent from the roster — restorable any time",onClick:()=>{I(!0)},children:[l.jsx(Q,{name:"archive",className:"ms-sm"})," archive"]}),l.jsx("button",{className:"run-btn",disabled:h,onClick:async()=>{m(!0),await us("claude",{kind:"agent",slug:s}),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(Q,{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(Q,{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),k("role"),Y("")},children:[l.jsx(Q,{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:W=>N(W.target.value),spellCheck:!1}),ce({system:_})]}),l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(Q,{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:[(F?.workflows??[]).map(W=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:U.includes(W.slug),onChange:he=>L(W.slug,he.target.checked)}),l.jsx("b",{children:W.slug}),W.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",W.description]})]},W.slug)),(F?.workflows??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no workflows in this project"})]}),ce({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(W=>l.jsx(Ee,{href:`/workflows/${encodeURIComponent(W)}`,className:"chip",children:W},W))})]}),x!=="workflows"&&l.jsx("button",{className:"open-raw",onClick:()=>{b(c.workflows),k("workflows"),Y("")},children:"edit"})]}),l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(Q,{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(W=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:U.includes(W.name),onChange:he=>L(W.name,he.target.checked)}),l.jsx("b",{children:W.name}),l.jsxs("span",{className:"opt-hint",children:[" — ",W.concepts," concepts"]})]},W.name)),(R?.bundles??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no knowledge bundles in this project"})]}),ce({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(W=>l.jsx(Ee,{href:`/knowledge/${encodeURIComponent(W)}`,className:"chip",children:W},W))})]}),x!=="knowledge"&&l.jsx("button",{className:"open-raw",onClick:()=>{b(c.knowledge),k("knowledge"),Y("")},children:"edit"})]}),l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(Q,{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:J,onChange:W=>H(W.target.checked)}),l.jsx("b",{children:"all skills"}),l.jsx("span",{className:"opt-hint",children:" — every discovered skill, including future ones"})]}),!J&&(V?.skills??[]).map(W=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:U.includes(W.name),onChange:he=>L(W.name,he.target.checked)}),l.jsxs("b",{children:["/",W.name]}),W.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",W.description]})]},W.name)),!J&&(V?.skills??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no skills found (.claude/skills, project or user)"})]}),ce({skills:J?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(W=>l.jsxs("span",{className:"chip",children:["/",W]},W))})]}),x!=="skills"&&l.jsx("button",{className:"open-raw",onClick:()=>{H(c.skills===void 0),b(c.skills??[]),k("skills"),Y("")},children:"edit"})]})]}),ie&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",ie]})]}),l.jsx(zj,{slug:s}),l.jsx(Oj,{slug:s})]})}const Rj=`---
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 zj({slug:s}){const u=$e(`/api/agents/${encodeURIComponent(s)}/skills`,!1)?.skills??[],[o,d]=w.useState(null),[h,m]=w.useState(!1),[p,y]=w.useState("");async function x(N){y("");const U=await fetch(`/api/agents/${encodeURIComponent(s)}/skills/${encodeURIComponent(N)}`),b=await U.json().catch(()=>null);if(!U.ok||!b||b.error)return void y(b?.error??"could not load skill");d({name:N,content:b.content??"",isNew:!1})}async function k(){if(!o)return;m(!0),y("");const U=await(await fetch(`/api/agents/${encodeURIComponent(s)}/skills`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:o.name,content:o.content})})).json().catch(()=>({error:"save failed"}));m(!1),U.error?y(U.error):d(null)}async function _(N){window.confirm(`Delete skill "/${N}" of this agent (its folder is removed)?`)&&(await fetch(`/api/agents/${encodeURIComponent(s)}/skills/${encodeURIComponent(N)}`,{method:"DELETE"}).catch(()=>{}),o?.name===N&&d(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"}),!o&&l.jsxs("button",{className:"open-raw",onClick:()=>{d({name:"",content:Rj,isNew:!0}),y("")},children:[l.jsx(Q,{name:"add",className:"ms-sm"})," new skill"]})]}),u.length===0&&!o&&l.jsxs("div",{className:"viewer-note",children:["none — skills in ",l.jsxs("code",{children:["agents/",s,"/skills/"]})," are private to this agent; skills for every agent live in the workspace skills folder."]}),u.length>0&&!o&&l.jsx("div",{className:"m3-list",children:u.map(N=>l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(Q,{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(Q,{name:"edit",className:"ms-sm"})," edit"]}),l.jsx("button",{className:"open-raw",onClick:()=>{_(N.name)},children:l.jsx(Q,{name:"close",className:"ms-sm"})})]},N.name))}),o&&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:o.name,placeholder:"e.g. report-html",disabled:!o.isNew,onChange:N=>d({...o,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,o.content.split(`
213
+ `).length+2)),value:o.content,spellCheck:!1,onChange:N=>d({...o,content:N.target.value})})]}),l.jsxs("div",{className:"agent-form-row",children:[l.jsx("button",{className:"run-btn",disabled:h||!o.name.trim(),onClick:()=>{k()},children:h?"saving…":"save"}),l.jsx("button",{className:"open-raw",disabled:h,onClick:()=>d(null),children:"cancel"})]})]}),p&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",p]})]})}function Oj({slug:s}){const u=$e(`/api/agents/${encodeURIComponent(s)}/routines`,!1)?.routines??[],[o,d]=w.useState(null),[h,m]=w.useState(""),[p,y]=w.useState("");async function x(N){m("");const b=await(await fetch(`/api/agents/${encodeURIComponent(s)}/routines`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(N)})).json();return b.error?(m(b.error),!1):!0}async function k(N){y(N),m("");const b=await(await fetch(`/api/agents/${encodeURIComponent(s)}/routines/${encodeURIComponent(N)}/run`,{method:"POST"})).json();y(""),b.error?m(b.error):b.chatId&&tn(`/agents/${encodeURIComponent(s)}/chat/${b.chatId}`)}async function _(N){window.confirm(`Delete routine "${N}"?`)&&await fetch(`/api/agents/${encodeURIComponent(s)}/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"}),!o&&l.jsxs("button",{className:"open-raw",onClick:()=>d({name:"",schedule:"0 9 * * 1-5",prompt:"",enabled:!0}),children:[l.jsx(Q,{name:"add",className:"ms-sm"})," new routine"]})]}),u.length===0&&!o&&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."}),u.length>0&&l.jsx("div",{className:"m3-list",children:u.map(N=>l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(Q,{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(s)}/chat/${N.lastChatId}`,children:["last run ",gl(N.lastRunAt)]}):"never ran"]})]}),l.jsx("button",{className:"open-raw",disabled:p===N.id,onClick:()=>k(N.id),children:p===N.id?"starting…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"play_arrow",className:"ms-sm"})," run"]})}),l.jsx("button",{className:"open-raw",onClick:()=>d({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))}),o&&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:o.name,placeholder:"e.g. Morning report",onChange:N=>d({...o,name:N.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:200},children:["schedule (cron)",l.jsx("input",{value:o.schedule,placeholder:"0 9 * * 1-5",onChange:N=>d({...o,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:o.enabled,onChange:N=>d({...o,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:o.prompt,placeholder:"Check ... and summarize what changed.",onChange:N=>d({...o,prompt:N.target.value})})]}),l.jsxs("div",{className:"agent-form-row",children:[l.jsx("button",{className:"run-btn",disabled:!o.name.trim()||!o.prompt.trim(),onClick:async()=>{await x(o)&&d(null)},children:o.id?"save routine":"create routine"}),l.jsx("button",{className:"open-raw",onClick:()=>(d(null),m("")),children:"cancel"})]})]}),h&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",h]})]})}function ap({slug:s}){const[c,u]=w.useState(s?null:U()),[o,d]=w.useState(""),[h,m]=w.useState(!1),y=$e("/api/workflows",!1)?.workflows??[],k=$e("/api/knowledge",!1)?.bundles??[],N=$e("/api/skills",!1)?.skills??[];w.useEffect(()=>{s&&fetch(`/api/agents/${encodeURIComponent(s)}`).then(E=>E.ok?E.json():Promise.reject()).then(E=>u({name:E.name,emoji:E.emoji,description:E.description??"",harness:E.harness,model:E.model??"",effort:E.effort??"",group:E.group??"",system:E.system,workflows:E.workflows,knowledge:E.knowledge??[],skillsAll:E.skills===void 0,skills:E.skills??[]})).catch(()=>d("agent not found"))},[s]);function U(){return{name:"",emoji:"🤖",description:"",harness:"claude",model:"",effort:"",group:"",system:"",workflows:[],knowledge:[],skillsAll:!0,skills:[]}}async function b(){if(!c)return;m(!0),d("");const te=await(await fetch(s?`/api/agents/${encodeURIComponent(s)}`:"/api/agents",{method:s?"PUT":"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...c,skills:c.skillsAll?void 0:c.skills})})).json();m(!1),te.error?d(te.error):tn(`/agents/${encodeURIComponent(te.slug)}/info`)}async function J(){!s||!window.confirm(`Delete agent "${s}" and its definition folder?`)||(await fetch(`/api/agents/${encodeURIComponent(s)}`,{method:"DELETE"}).catch(()=>{}),tn("/agents"))}if(!c)return l.jsx("div",{className:"empty",children:o||"loading…"});const H=E=>u({...c,...E});return l.jsxs("div",{className:"new-chat",children:[l.jsx("div",{className:"page-head",children:l.jsx("h1",{children:s?`edit ${s}`:"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:E=>H({name:E.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:90},children:["emoji",l.jsx("input",{value:c.emoji,onChange:E=>H({emoji:E.target.value})})]})]}),l.jsx("div",{className:"emoji-pick",children:kj.map(E=>l.jsx("button",{type:"button",className:c.emoji===E?"active":"",onClick:()=>H({emoji:E}),children:E},E))}),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:E=>H({description:E.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:180},children:["group",l.jsx("input",{value:c.group,placeholder:"none",onChange:E=>H({group:E.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:E=>H({harness:E.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:E=>H({model:E.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:140},children:["effort",l.jsx("select",{value:c.effort,onChange:E=>H({effort:E.target.value}),children:Sj.map(E=>l.jsx("option",{value:E,children:E||"default"},E))})]})]}),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:E=>H({system:E.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(E=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.workflows.includes(E.slug),onChange:te=>H({workflows:te.target.checked?[...c.workflows,E.slug]:c.workflows.filter(ie=>ie!==E.slug)})}),l.jsx("b",{children:E.slug}),E.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",E.description]})]},E.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:[k.map(E=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.knowledge.includes(E.name),onChange:te=>H({knowledge:te.target.checked?[...c.knowledge,E.name]:c.knowledge.filter(ie=>ie!==E.name)})}),l.jsx("b",{children:E.name}),l.jsxs("span",{className:"opt-hint",children:[" — ",E.concepts," concepts"]})]},E.name)),k.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:E=>H({skillsAll:E.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(E=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.skills.includes(E.name),onChange:te=>H({skills:te.target.checked?[...c.skills,E.name]:c.skills.filter(ie=>ie!==E.name)})}),l.jsxs("b",{children:["/",E.name]}),E.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",E.description]})]},E.name)),!c.skillsAll&&N.length===0&&l.jsx("div",{className:"viewer-note",children:"no skills found (.claude/skills, project or user)"})]})]}),o&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",o]}),l.jsxs("div",{className:"agent-form-row",children:[l.jsx("button",{className:"run-btn",disabled:!c.name.trim()||h,onClick:b,children:h?"saving…":s?"save":"create"}),l.jsx("span",{className:"spacer"}),s&&l.jsx("button",{className:"stop-btn",onClick:J,children:"delete agent"})]})]})})]})}const yi={enabled:!1,remote:"origin",branch:"",interval:"300",autosync:"pull"};function lp(s){const c=s.config.git;return c?{enabled:c.enabled!==!1,remote:c.remote??yi.remote,branch:c.branch??"",interval:String(c.interval??yi.interval),autosync:c.autosync??yi.autosync}:yi}const Cp={enabled:!1,root:""};function sp(s){const c=s.config.repos;return c?{enabled:c.enabled!==!1,root:c.root??""}:Cp}function Dj(){const[s,c]=w.useState(null),[u,o]=w.useState(""),[d,h]=w.useState(""),[m,p]=w.useState([]),[y,x]=w.useState(yi),[k,_]=w.useState(Cp),[N,U]=w.useState(!1),[b,J]=w.useState(!1),[H,E]=w.useState(!1),[te,ie]=w.useState("");w.useEffect(()=>{fetch("/api/settings").then(I=>I.json()).then(I=>{c(I),o(I.config.name??""),h(I.config.icon??""),p(I.config.switcher??[]),x(lp(I)),_(sp(I))}).catch(()=>ie("could not load settings"))},[]);const Y=()=>{U(!0),E(!1),ie("")};async function F(){J(!0),ie("");try{const I=await fetch("/api/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:u,icon:d,switcher:m,git:{...y,interval:y.interval===""?void 0:Number(y.interval)},repos:k})}),ce=await I.json();if(!I.ok)throw new Error(ce.error||"save failed");c(ce),p(ce.config.switcher??[]),x(lp(ce)),_(sp(ce)),U(!1),E(!0),window.dispatchEvent(new Event("kw-meta-refresh"))}catch(I){ie(I.message)}finally{J(!1)}}const R=(I,ce)=>{p(W=>W.map((he,Le)=>Le===I?{...he,...ce}:he)),Y()},V=I=>{x(ce=>({...ce,...I})),Y()},ae=I=>{_(ce=>({...ce,...I})),Y()};if(!s)return l.jsx("div",{className:"empty",children:te||"loading…"});const L=[["port",String(s.resolved.port),"kraftwerk ui listens here (CLI --port wins)"],["workflows",s.resolved.workflowsRoot??"— none found","workflow definitions"],["output",s.resolved.outputDir,"run artifacts"],["knowledge",s.config.knowledge??"knowledge","OKF knowledge bundles"],["agents",s.config.agents??"agents","agent definitions"],["skills",s.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(Q,{name:"settings",className:"ms-lg"})," Settings"]}),l.jsx("span",{className:"spacer"}),te&&l.jsx("span",{className:"settings-err",children:te}),H&&!N&&l.jsxs("span",{className:"settings-saved",children:[l.jsx(Q,{name:"check",className:"ms-sm"})," saved"]}),l.jsx("button",{className:"run-btn",disabled:b||!N,onClick:()=>{F()},children:b?"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:d,placeholder:"🤖",onChange:I=>{h(I.target.value),Y()}})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:u,placeholder:"my workspace",onChange:I=>{o(I.target.value),Y()}})]})]}),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(I=>[...I,{name:"",url:"http://localhost:"}]),Y()},children:[l.jsx(Q,{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((I,ce)=>l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{width:70},children:["icon",l.jsx("input",{value:I.icon??"",placeholder:"•",onChange:W=>R(ce,{icon:W.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:I.name,placeholder:"other workspace",onChange:W=>R(ce,{name:W.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{flex:1.4},children:["url",l.jsx("input",{value:I.url,placeholder:"http://localhost:1982",onChange:W=>R(ce,{url:W.target.value})})]}),l.jsx("button",{className:"row-x settings-row-x",title:"remove entry",onClick:()=>{p(W=>W.filter((he,Le)=>Le!==ce)),Y()},children:l.jsx(Q,{name:"close",className:"ms-sm"})})]},ce)),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(Q,{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:I=>V({enabled:I.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:I=>V({remote:I.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["branch",l.jsx("input",{value:y.branch,placeholder:"checked-out branch",onChange:I=>V({branch:I.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:I=>V({interval:I.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:150},children:["autosync",l.jsxs("select",{value:y.autosync,onChange:I=>V({autosync:I.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:"repositories"}),l.jsx("span",{className:"spacer"}),l.jsxs("a",{className:"run-btn tonal",href:"#/repos",children:[l.jsx(Q,{name:"source",className:"ms-sm"})," open repositories"]})]}),l.jsxs("div",{className:"agent-form",children:[l.jsxs("label",{className:"settings-check",children:[l.jsx("input",{type:"checkbox",checked:k.enabled,onChange:I=>ae({enabled:I.target.checked})}),"keep git repositories the agents work on under one folder"]}),k.enabled&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"agent-form-row",children:l.jsxs("label",{className:"agent-field",style:{flex:1},children:["repos root",l.jsx("input",{value:k.root,placeholder:"repos",onChange:I=>ae({root:I.target.value})})]})}),l.jsxs("div",{className:"settings-note",children:["Relative to the project root. Saving creates the folder and adds it to .gitignore; every agent gets the list of clones as context and can add more with ",l.jsx("code",{children:"kraftwerk repos add"}),"."]})]})]})]}),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:s.configPath,children:s.exists?s.configPath:`${s.configPath} (not created yet)`})]}),l.jsx("div",{className:"settings-kv-list",children:L.map(([I,ce,W])=>l.jsxs("div",{className:"settings-kv",children:[l.jsx("span",{className:"microlabel",children:I}),l.jsx("code",{children:ce}),l.jsx("span",{className:"settings-kv-hint",children:W})]},I))}),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 du={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 Mj(){const[s,c]=w.useState(null),[u,o]=w.useState(""),[d,h]=w.useState({}),[m,p]=w.useState({}),[y,x]=w.useState(null),k=w.useCallback(async()=>{try{const b=await fetch("/api/projects",{cache:"no-store"});if(b.ok){c(await b.json()),o("");return}o(b.status===404?"This workspace runs a kraftwerk without the projects API. Update it and restart its UI.":`Could not load the project registry (HTTP ${b.status}).`)}catch(b){o(b.message||"Could not reach this workspace's server.")}},[]);w.useEffect(()=>{let b=!0,J;const H=async()=>{await k(),b&&(J=setTimeout(H,6e3))};return H(),()=>{b=!1,clearTimeout(J)}},[k]);const _=b=>b.root??b.url,N=async(b,J)=>{const H=_(b);h(E=>({...E,[H]:J})),p(E=>({...E,[H]:""})),x(null);try{const E=J==="stop"?{root:b.root,url:b.url}:{root:b.root},te=await gu(`/api/projects/${J}`,E);if(!te.ok)throw new Error(te.error||"failed");window.dispatchEvent(new Event("kw-meta-refresh"))}catch(E){p(te=>({...te,[H]:E.message}))}finally{h(E=>{const te={...E};return delete te[H],te}),k()}},U=s?.filter(b=>b.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(Q,{name:"hub",className:"ms-lg"})," Workspaces"]}),l.jsx("span",{className:"spacer"}),s&&l.jsxs("span",{className:"settings-note",children:[s.length," known · ",U," running"]}),s&&u&&l.jsx("span",{className:"settings-err",children:u})]}),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"})]})]}),!s&&!u&&l.jsx("div",{className:"ws-empty",children:"loading…"}),!s&&u&&l.jsxs("div",{className:"ws-empty ws-load-error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",u]}),s&&s.length===0&&l.jsx("div",{className:"ws-empty",children:"No workspaces known yet."}),s?.map(b=>{const J=_(b),H=d[J],E=!b.live&&!!b.root&&(b.exists===!1||b.hasConfig===!1);return l.jsxs("div",{className:`ws-row state-${b.state} ${b.current?"current":""}`,children:[l.jsx("span",{className:"switcher-icon ws-icon",children:b.icon||"•"}),l.jsxs("div",{className:"ws-main",children:[l.jsxs("div",{className:"ws-title",children:[b.live&&!b.current?l.jsx("a",{href:b.url,className:"ws-name",children:b.name}):l.jsx("span",{className:"ws-name",children:b.name}),b.current&&l.jsx("span",{className:"switcher-hint",children:"current"}),l.jsxs("span",{className:`ws-state ws-state-${b.state}`,children:[b.live&&l.jsx("span",{className:"live-dot"}),du[b.state].label]}),du[b.state].note&&l.jsx("span",{className:"ws-note",children:du[b.state].note})]}),l.jsx("div",{className:"ws-root",title:b.root,children:b.rootLabel??l.jsx("span",{className:"ws-dim",children:"no root recorded (started by an older version)"})}),l.jsxs("div",{className:"ws-meta",children:[b.state!=="missing"&&b.state!=="orphaned"&&l.jsx("span",{children:b.url.replace(/^https?:\/\//,"")}),b.counts&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{children:[b.counts.agents," agents"]}),l.jsxs("span",{children:[b.counts.workflows," workflows"]}),l.jsxs("span",{children:[b.counts.runs," runs"]}),l.jsxs("span",{children:[b.counts.chats," chats"]})]}),b.lastStarted&&l.jsxs("span",{title:b.lastStarted,children:["started ",cs(b.lastStarted)]}),!b.live&&b.lastStopped&&l.jsxs("span",{title:b.lastStopped,children:["stopped ",cs(b.lastStopped)]}),b.startCount!=null&&l.jsxs("span",{children:[b.startCount,"× launched"]}),b.firstSeen&&l.jsxs("span",{title:b.firstSeen,children:["first seen ",cs(b.firstSeen)]})]}),m[J]&&l.jsx("div",{className:"settings-err",children:m[J]})]}),l.jsxs("div",{className:"ws-actions",children:[b.live&&!b.current&&l.jsxs("a",{className:"ws-btn",href:b.url,title:"Open this workspace",children:[l.jsx(Q,{name:"open_in_new",className:"ms-sm"})," open"]}),!b.live&&b.root&&b.exists!==!1&&!b.dirGone&&l.jsxs("button",{className:"ws-btn primary",disabled:!!H,onClick:()=>{N(b,"start")},children:[l.jsx(Q,{name:H==="start"?"progress_activity":"play_arrow",className:"ms-sm"}),H==="start"?"starting…":"start"]}),b.live&&!b.current&&l.jsxs("button",{className:"ws-btn danger",disabled:!!H,onClick:()=>{N(b,"stop")},children:[l.jsx(Q,{name:H==="stop"?"progress_activity":"stop",className:"ms-sm"}),H==="stop"?"stopping…":"stop"]}),E&&y!==J&&l.jsxs("button",{className:"ws-btn",disabled:!!H,title:"Drop this project from the registry (files untouched)",onClick:()=>x(J),children:[l.jsx(Q,{name:"delete",className:"ms-sm"})," remove"]}),E&&y===J&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"ws-btn danger",onClick:()=>{N(b,"forget")},children:[l.jsx(Q,{name:"delete",className:"ms-sm"})," confirm remove"]}),l.jsx("button",{className:"ws-btn",onClick:()=>x(null),children:"cancel"})]})]})]},J)})]}),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 Uj(s){if(s<60)return`${s}s`;const c=Math.round(s/60);if(c<60)return`${c} min`;const u=Math.floor(c/60),o=c%60;return o?`${u} h ${o} min`:`${u} h`}const Lj=[[/^(\+\+\+|---|diff |index )/,"d-meta"],[/^@@/,"d-hunk"],[/^\+/,"d-add"],[/^-/,"d-del"]],Hj=s=>Lj.find(([c])=>c.test(s))?.[1]??"";function $j({file:s}){const[c,u]=w.useState(null),[o,d]=w.useState(!1),[h,m]=w.useState("");return w.useEffect(()=>{let p=!0;return fetch(`/api/git/diff?path=${encodeURIComponent(s)}`).then(y=>y.json()).then(y=>{p&&(u(y.diff??""),d(!!y.truncated),m(y.error??""))}).catch(()=>p&&m("could not load the diff")),()=>{p=!1}},[s]),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:Hj(p),children:[p||" ",`
215
+ `]},y)),o&&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 Bj(){const[s,c]=w.useState(null),[u,o]=w.useState(new Set),[d,h]=w.useState(new Set),[m,p]=w.useState(""),[y,x]=w.useState(""),[k,_]=w.useState(""),[N,U]=w.useState(""),b=w.useCallback(async()=>{try{const Y=await fetch("/api/git",{cache:"no-store"});Y.ok&&c(await Y.json())}catch{}},[]);w.useEffect(()=>{let Y=!0,F;const R=async()=>{await b(),Y&&(F=setTimeout(R,6e3))};return R(),()=>{Y=!1,clearTimeout(F)}},[b]),w.useEffect(()=>{if(!s?.files)return;const Y=new Set(s.files.filter(F=>F.syncable).map(F=>F.path));o(F=>{const R=new Set([...F].filter(V=>Y.has(V)));return R.size===F.size?F:R})},[s]);const J=async(Y,F)=>{x(Y),_(""),U("");try{const R=await gu(`/api/git/${Y}`,F);R.ok?U(Y==="push"?"pushed":Y==="pull"?"pulled":"fetched"):_(R.error||`${Y} failed`)}catch(R){_(R.message||`${Y} failed`)}finally{x("")}b()},H=async()=>{x("commit"),_(""),U("");try{const Y=await gu("/api/git/commit",{paths:[...u],message:m});Y.ok?(U(`committed ${u.size} file${u.size===1?"":"s"}`),o(new Set),p("")):_(Y.error||"commit failed")}catch(Y){_(Y.message||"commit failed")}finally{x("")}b()};if(!s)return l.jsx("div",{className:"settings-screen",children:l.jsx("div",{className:"ws-empty",children:"loading…"})});if(!s.enabled)return l.jsxs("div",{className:"settings-screen",children:[l.jsx("div",{className:"settings-head",children:l.jsxs("h1",{children:[l.jsx(Q,{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 E=(s.files??[]).filter(Y=>Y.syncable),te=(s.files??[]).filter(Y=>!Y.syncable),ie=(Y,F)=>o(R=>{const V=new Set(R);return F?V.add(Y):V.delete(Y),V});return l.jsxs("div",{className:"settings-screen ws-screen",children:[l.jsxs("div",{className:"settings-head",children:[l.jsxs("h1",{children:[l.jsx(Q,{name:"cloud_sync",className:"ms-lg"})," Git sync"]}),l.jsx("span",{className:"spacer"}),N&&l.jsxs("span",{className:"settings-saved",children:[l.jsx(Q,{name:"check",className:"ms-sm"})," ",N]}),k&&l.jsx("span",{className:"settings-err",children:k})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"branch"}),l.jsx("span",{className:"spacer"}),s.lastFetch&&l.jsxs("span",{className:"settings-note",title:s.lastFetch,children:["fetched ",cs(s.lastFetch)]}),s.lastError&&l.jsxs("span",{className:"settings-err git-sync-err",title:s.lastError,children:[l.jsx(Q,{name:"cloud_off",className:"ms-sm"})," ",s.lastError.split(`
217
+ `)[0]]})]}),s.error?l.jsxs("div",{className:"ws-empty ws-load-error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",s.error]}):l.jsxs("div",{className:"git-head",children:[l.jsxs("div",{className:"git-branch",children:[l.jsx(Q,{name:"account_tree",className:"ms-sm"}),l.jsx("strong",{children:s.branch}),s.upstream?l.jsxs("span",{className:"settings-note",children:["tracking ",s.upstream]}):l.jsx("span",{className:"settings-note",children:"no upstream yet, push sets one"})]}),l.jsxs("div",{className:"git-counts",children:[s.diverged&&l.jsx("span",{className:"git-diverged",children:"diverged, resolve in a terminal"}),!!s.behind&&l.jsxs("span",{className:"git-behind",children:[s.behind," behind"]}),!!s.ahead&&l.jsxs("span",{className:"git-ahead",children:[s.ahead," ahead"]}),!s.ahead&&!s.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:()=>{J("fetch")},children:[l.jsx(Q,{name:y==="fetch"?"progress_activity":"refresh",className:"ms-sm"})," fetch"]}),l.jsxs("button",{className:"ws-btn",disabled:!!y||!s.behind||s.diverged,title:s.diverged?"Diverged. Resolve in a terminal.":"Fast-forward to the remote",onClick:()=>{J("pull")},children:[l.jsx(Q,{name:y==="pull"?"progress_activity":"download",className:"ms-sm"})," pull"]}),l.jsxs("button",{className:"ws-btn primary",disabled:!!y||!s.ahead&&!!s.upstream,title:s.upstream?"Push to the upstream":"Push and set the upstream",onClick:()=>{J("push")},children:[l.jsx(Q,{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:E.length===0?"workspace clean":`${u.size} of ${E.length} selected`})]}),E.length===0&&te.length===0&&l.jsx("div",{className:"ws-empty",children:"Nothing changed under the workspace paths."}),E.map(Y=>l.jsxs("div",{className:"git-row",children:[l.jsx("label",{className:"git-pick",children:l.jsx("input",{type:"checkbox",checked:u.has(Y.path),onChange:F=>ie(Y.path,F.target.checked)})}),l.jsxs("button",{className:"git-file",onClick:()=>h(F=>{const R=new Set(F);return R.has(Y.path)?R.delete(Y.path):R.add(Y.path),R}),children:[l.jsx(Q,{name:d.has(Y.path)?"expand_more":"chevron_right",className:"ms-sm"}),l.jsx("span",{className:`git-status s-${Y.status}`,children:Y.status}),l.jsx("span",{className:"git-path",children:Y.path})]}),d.has(Y.path)&&l.jsx($j,{file:Y.path})]},Y.path)),E.length>0&&l.jsxs("div",{className:"git-commit",children:[l.jsx("input",{className:"git-message",placeholder:"Commit message",value:m,onChange:Y=>p(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&!y&&m.trim()&&u.size>0&&H()}}),l.jsx("button",{className:"ws-btn",disabled:u.size===E.length,onClick:()=>o(new Set(E.map(Y=>Y.path))),children:"select all"}),l.jsxs("button",{className:"ws-btn primary",disabled:!!y||u.size===0||!m.trim(),onClick:()=>{H()},children:[l.jsx(Q,{name:y==="commit"?"progress_activity":"check",className:"ms-sm"}),"commit ",u.size||""]})]}),te.length>0&&l.jsxs("details",{className:"git-blocked",children:[l.jsxs("summary",{children:[te.length,s.blockedHidden?"+":""," change",te.length===1&&!s.blockedHidden?"":"s"," outside the workspace paths"]}),te.map(Y=>l.jsxs("div",{className:"git-row blocked",children:[l.jsx("span",{className:"git-status s-blocked",children:Y.status}),l.jsx("span",{className:"git-path",children:Y.path}),l.jsx("span",{className:"settings-note",children:Y.reason})]},Y.path)),!!s.blockedHidden&&l.jsx("div",{className:"git-row blocked",children:l.jsxs("span",{className:"settings-note",children:["and ",s.blockedHidden," more, not listed"]})})]})]}),l.jsxs("p",{className:"settings-note",children:["Synced paths: ",(s.scope??[]).map((Y,F)=>l.jsxs("span",{children:[F>0&&", ",l.jsx("code",{children:Y})]},Y)),". Run artifacts and files like ",l.jsx("code",{children:".env"})," are never staged."," ",s.interval?`Fetches every ${Uj(s.interval)}${s.autosync==="pull"?" and fast-forwards when the working tree is clean":""}. `:"Background fetching is off. ","Commit and push are always manual."]})]})}const qj=s=>s.replace(/^https?:\/\//,"").replace(/^git@([^:]+):/,"$1/").replace(/\.git$/,""),Gj=s=>s.error?{label:"unreadable",cls:"missing"}:s.dirty?{label:`${s.dirty} changed`,cls:"died"}:s.ahead?{label:`${s.ahead} to push`,cls:"running"}:s.behind?{label:`${s.behind} behind`,cls:"stopped"}:{label:"clean",cls:"running"},ip=s=>!!(s.error||s.dirty||s.ahead===void 0||s.ahead);function Yj(){const[s,c]=w.useState(null),[u,o]=w.useState(""),[d,h]=w.useState({}),[m,p]=w.useState({}),[y,x]=w.useState(null),[k,_]=w.useState(""),[N,U]=w.useState(""),[b,J]=w.useState(""),[H,E]=w.useState(!1),[te,ie]=w.useState(""),Y=Cn(),F=w.useCallback(async()=>{try{const L=await fetch("/api/repos",{cache:"no-store"});if(!L.ok)throw new Error(`HTTP ${L.status}`);c(await L.json()),o("")}catch(L){o(L.message||"could not load repositories")}},[]);w.useEffect(()=>{let L=!0,I;const ce=async()=>{await F(),L&&(I=setTimeout(ce,15e3))};return ce(),()=>{L=!1,clearTimeout(I)}},[F]);const R=async(L,I,ce=!1)=>{h(W=>({...W,[L]:I})),p(W=>({...W,[L]:""})),x(null);try{const W=I==="update"?await fetch(`/api/repos/${encodeURIComponent(L)}/update`,{method:"POST"}):await fetch(`/api/repos/${encodeURIComponent(L)}${ce?"?force=1":""}`,{method:"DELETE"}),he=await W.json();if(!W.ok||!he.ok)throw new Error(he.error||"failed");he.error&&p(Le=>({...Le,[L]:he.error}))}catch(W){p(he=>({...he,[L]:W.message}))}finally{h(W=>{const he={...W};return delete he[L],he}),F()}},V=async L=>{if(L.preventDefault(),!(!k.trim()||H)){E(!0),ie("");try{const I=await fetch("/api/repos",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({url:k.trim(),name:N.trim()||void 0,branch:b.trim()||void 0})}),ce=await I.json();if(!I.ok)throw new Error(ce.error||"clone failed");_(""),U(""),J(""),await F()}catch(I){ie(I.message)}finally{E(!1)}}},ae=s?.repos??[];return l.jsxs("div",{className:"settings-screen ws-screen repos-screen",children:[l.jsxs("div",{className:"settings-head",children:[l.jsxs("h1",{children:[l.jsx(Q,{name:"source",className:"ms-lg"})," Repositories"]}),l.jsx("span",{className:"spacer"}),s?.enabled&&l.jsxs("span",{className:"settings-note",children:[ae.length," cloned"]}),u&&l.jsx("span",{className:"settings-err",children:u})]}),s&&!s.enabled&&l.jsx("section",{className:"panel",children:l.jsx("div",{className:"ws-empty",children:s.error&&!/are off/.test(s.error)?l.jsx("span",{className:"settings-err",children:s.error}):l.jsxs(l.Fragment,{children:["Repositories are off. Turn them on in ",l.jsx("a",{href:"#/settings",children:"settings"})," or add a ",l.jsx("code",{children:"repos:"})," block to kraftwerk.yml."]})})}),s?.enabled&&l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"add a repository"}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"settings-note",children:["clones into ",l.jsx("code",{title:s.root,children:s.root})]})]}),l.jsxs("form",{className:"agent-form",onSubmit:L=>{V(L)},children:[l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{flex:2},children:["url",l.jsx("input",{value:k,placeholder:"https://github.com/org/repo.git, git@host:org/repo.git or github:org/repo",onChange:L=>_(L.target.value),autoFocus:!0})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:N,placeholder:"from the url",onChange:L=>U(L.target.value)})]}),l.jsxs("label",{className:"agent-field",style:{width:140},children:["branch",l.jsx("input",{value:b,placeholder:"default",onChange:L=>J(L.target.value)})]}),l.jsxs("button",{className:"ws-btn primary",type:"submit",disabled:H||!k.trim(),children:[l.jsx(Q,{name:H?"progress_activity":"download",className:"ms-sm"}),H?"cloning…":"clone"]})]}),te&&l.jsx("div",{className:"settings-err",children:te}),l.jsxs("div",{className:"settings-note",children:["Uses your own git credentials and never prompts: a private remote must already work from a terminal. Agents see every clone here and can add more with ",l.jsx("code",{children:"kraftwerk repos add"}),"."]})]})]}),s?.enabled&&l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"cloned repositories"})}),ae.length===0&&l.jsx("div",{className:"ws-empty",children:"Nothing cloned yet."}),ae.map(L=>{const I=d[L.slug],ce=Gj(L);return l.jsxs("div",{className:`ws-row repo-row state-${ce.cls}`,"data-repo":L.slug,children:[l.jsx("span",{className:"switcher-icon ws-icon",children:l.jsx(Q,{name:"folder_data"})}),l.jsxs("div",{className:"ws-main",children:[l.jsxs("div",{className:"ws-title",children:[l.jsx("span",{className:"ws-name",children:L.slug}),L.branch&&l.jsx("span",{className:"repo-branch",children:L.branch}),l.jsx("span",{className:`ws-state ws-state-${ce.cls}`,children:ce.label})]}),L.url&&l.jsx("div",{className:"ws-root",title:L.url,children:qj(L.url)}),Y&&l.jsx("div",{className:"ws-root ws-dim",title:L.path,children:L.path}),l.jsxs("div",{className:"ws-meta",children:[L.head&&l.jsxs("span",{title:L.committedAt,children:[l.jsx("code",{children:L.head})," ",L.subject,L.committedAt?` · ${cs(L.committedAt)}`:""]}),!!L.behind&&!!L.dirty&&l.jsxs("span",{children:["behind by ",L.behind]}),L.error&&l.jsx("span",{className:"settings-err",children:L.error})]}),m[L.slug]&&l.jsx("div",{className:"settings-err",children:m[L.slug]})]}),l.jsxs("div",{className:"ws-actions",children:[l.jsxs("button",{className:"ws-btn",disabled:!!I,onClick:()=>{R(L.slug,"update")},title:"git fetch, then fast-forward when clean",children:[l.jsx(Q,{name:I==="update"?"progress_activity":"sync",className:"ms-sm"}),I==="update"?"updating…":"update"]}),y!==L.slug&&l.jsxs("button",{className:"ws-btn",disabled:!!I,onClick:()=>x(L.slug),title:"Delete the clone",children:[l.jsx(Q,{name:"delete",className:"ms-sm"})," remove"]}),y===L.slug&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"ws-btn danger",onClick:()=>{R(L.slug,"remove",ip(L))},children:[l.jsx(Q,{name:"delete",className:"ms-sm"}),L.dirty||L.ahead?"delete with local changes":ip(L)?"delete anyway":"confirm remove"]}),l.jsx("button",{className:"ws-btn",onClick:()=>x(null),children:"cancel"})]})]})]},L.slug)})]})]})}const Xj=40,Qj=/Mac|iPhone|iPad/.test(navigator.platform);let fu=null;const Zj=s=>(s?.workspaces??[]).flatMap(c=>c.agents.map(u=>({agent:u,ws:c,key:`${c.url}|${u.slug}`})));function Vj(s,c){const u=c.toLowerCase().split(/\s+/).filter(Boolean);if(u.length===0)return s;const o=[];for(const d of s){const h=d.agent.name.toLowerCase(),m=[h,d.agent.slug,d.agent.description??"",d.agent.group??"",d.ws.name].join(" ").toLowerCase();if(!u.every(y=>m.includes(y)))continue;const p=h.startsWith(u[0])?0:h.includes(u[0])?1:2;o.push({hit:d,score:p})}return o.sort((d,h)=>d.score-h.score).map(d=>d.hit)}async function cp(s){const c=`/agents/${encodeURIComponent(s.agent.slug)}`;if(s.ws.current)return tn(c);const u=s.ws.live||!s.ws.root?s.ws.url:await op(s.ws.root);window.location.assign(`${u.replace(/\/+$/,"")}/#${c}`)}function Kj(){const[s,c]=w.useState(!1);return w.useEffect(()=>{const u=o=>{(o.metaKey||o.ctrlKey)&&!o.altKey&&!o.shiftKey&&o.key.toLowerCase()==="k"&&(o.preventDefault(),c(d=>!d))};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[]),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(Q,{name:"search"}),l.jsx("kbd",{className:"kbd",children:Qj?"⌘K":"Ctrl K"})]}),s&&l.jsx(Jj,{onClose:()=>c(!1)})]})}function Jj({onClose:s}){const[c,u]=w.useState(fu),[o,d]=w.useState(fu===null),[h,m]=w.useState(!1),[p,y]=w.useState(""),[x,k]=w.useState(0),[_,N]=w.useState(null),[U,b]=w.useState(""),J=w.useRef(null);w.useEffect(()=>{let R=!0;return fetch("/api/search/agents",{cache:"no-store"}).then(V=>V.ok?V.json():Promise.reject(new Error(String(V.status)))).then(V=>{fu=V,R&&u(V)}).catch(()=>R&&m(!0)).finally(()=>R&&d(!1)),()=>{R=!1}},[]);const H=w.useMemo(()=>Zj(c),[c]),E=w.useMemo(()=>Vj(H,p).slice(0,Xj),[H,p]),te=Math.min(x,Math.max(E.length-1,0));w.useEffect(()=>{J.current?.children[te]?.scrollIntoView({block:"nearest"})},[te,E]);const ie=R=>{if(!_){if(R.ws.current||R.ws.live){s(),cp(R);return}N(R.key),b(""),cp(R).catch(V=>{N(null),b(`${R.ws.name}: ${V.message}`)})}},Y=R=>{if(R.key==="ArrowDown")R.preventDefault(),k(E.length?(te+1)%E.length:0);else if(R.key==="ArrowUp")R.preventDefault(),k(E.length?(te-1+E.length)%E.length:0);else if(R.key==="Enter"){R.preventDefault();const V=E[te];V&&ie(V)}else R.key==="Escape"&&(R.preventDefault(),s())};let F;return E.length>0?F=l.jsx("ul",{className:"palette-list",role:"listbox","aria-label":"agents",ref:J,children:E.map((R,V)=>l.jsxs("li",{role:"option","aria-selected":V===te,className:`palette-item${V===te?" active":""}`,onMouseMove:()=>V!==te&&k(V),onClick:()=>ie(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(Q,{name:"progress_activity",className:"ms-sm"}):R.ws.live?!R.ws.current&&l.jsx(Q,{name:"open_in_new",className:"ms-sm"}):l.jsx("span",{className:"palette-chip",children:"stopped"})]})]},R.key))}):h?F=l.jsx("div",{className:"palette-empty",children:"could not load the agents"}):o?F=l.jsx("div",{className:"palette-empty",children:"looking for agents…"}):H.length===0?F=l.jsxs("div",{className:"palette-empty",children:["no agents yet — ",l.jsx("a",{href:"#/agents/new",onClick:s,children:"create one"})]}):F=l.jsxs("div",{className:"palette-empty",children:["no agent matches “",p,"”"]}),l.jsx("div",{className:"palette-backdrop",onMouseDown:s,children:l.jsxs("div",{className:"palette",role:"dialog","aria-label":"jump to an agent",onMouseDown:R=>R.stopPropagation(),onKeyDown:Y,children:[l.jsxs("div",{className:"palette-input",children:[l.jsx(Q,{name:"search"}),l.jsx("input",{autoFocus:!0,value:p,onChange:R=>{y(R.target.value),k(0)},placeholder:"jump to an agent…","aria-label":"search agents",autoComplete:"off",spellCheck:!1}),o&&c&&l.jsx(Q,{name:"progress_activity",className:"ms-sm"}),l.jsx("kbd",{className:"kbd",children:"esc"})]}),F,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(Q,{name:"progress_activity",className:"ms-sm"})," starting the workspace…"]}),U&&l.jsxs("span",{className:"palette-warn",title:U,children:[l.jsx(Q,{name:"warning",className:"ms-sm"})," ",U]})]})]})})}const Ij=w.lazy(()=>Kx(()=>import("./editor-vM6JSj5h.js").then(s=>s.w),__vite__mapDeps([0,1])).then(s=>({default:s.EditorScreen})));function Fj(){const c=Jx().split("/").filter(Boolean),[u,o]=w.useState(""),[d,h]=w.useState(""),[m,p]=w.useState(""),[y,x]=w.useState(!1),[k,_]=w.useState(!1),[N,U]=w.useState([]);w.useEffect(()=>{let J=!0,H;const E=async()=>{try{const ie=await fetch("/api/meta",{cache:"no-store"}).then(Y=>Y.json());if(!J)return;o(ie.projectName??""),h(ie.projectIcon??""),p(ie.projectRootLabel??""),x(!!ie.git),_(!!ie.repos),U(Array.isArray(ie.switcher)?ie.switcher:[])}catch{}J&&(H=setTimeout(E,3e4))};E();const te=()=>{clearTimeout(H),E()};return window.addEventListener("kw-meta-refresh",te),()=>{J=!1,clearTimeout(H),window.removeEventListener("kw-meta-refresh",te)}},[]),w.useEffect(()=>{if(Ix(u?`${u} — kraftwerk`:"kraftwerk inspector"),!d)return;const J=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="0.9em" font-size="85">${d}</text></svg>`;let H=document.querySelector('link[rel="icon"]');H||(H=document.createElement("link"),H.rel="icon",document.head.appendChild(H)),H.href=`data:image/svg+xml,${encodeURIComponent(J)}`},[u,d]);let b;return c[0]==="runs"&&c[1]?b=l.jsx(Hy,{id:c[1]}):c[0]==="runs"?b=l.jsx(tb,{}):c[0]==="workflows"&&c[1]?b=l.jsx(Iy,{slug:decodeURIComponent(c[1])}):c[0]==="workflows"?b=l.jsx(Jy,{}):c[0]==="chats"?b=l.jsx(tp,{seg:c}):c[0]==="skills"?b=l.jsx(bj,{name:c[1]?decodeURIComponent(c[1]):void 0}):c[0]==="settings"?b=l.jsx(Dj,{}):c[0]==="workspaces"?b=l.jsx(Mj,{}):c[0]==="git"?b=l.jsx(Bj,{}):c[0]==="repos"?b=l.jsx(Yj,{}):c[0]==="agents"||c[0]==="team"?b=l.jsx(tp,{seg:c.slice(1)}):c[0]==="knowledge"?b=l.jsx(dj,{bundle:c[1]?decodeURIComponent(c[1]):void 0,conceptId:c.length>2?c.slice(2).map(decodeURIComponent).join("/"):void 0}):b=l.jsx(aj,{}),c[0]==="edit"&&c[1]&&c.length>2?l.jsx(w.Suspense,{fallback:l.jsx("div",{className:"empty",children:"loading editor…"}),children:l.jsx(Ij,{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:d||l.jsx(Q,{name:"home"})}),u&&l.jsx(eb,{name:u,icon:d,root:m,entries:N})]}),l.jsxs("nav",{children:[l.jsxs("a",{href:"#/agents",children:[l.jsx(Q,{name:"groups"})," agents"]}),l.jsxs("a",{href:"#/knowledge",children:[l.jsx(Q,{name:"menu_book"})," context & knowledge"]}),l.jsxs("a",{href:"#/workflows",children:[l.jsx(Q,{name:"account_tree"})," workflows"]}),l.jsxs("a",{href:"#/runs",children:[l.jsx(Q,{name:"history"})," workflow runs"]}),l.jsxs("a",{href:"#/skills",children:[l.jsx(Q,{name:"extension"})," skills"]}),k&&l.jsxs("a",{href:"#/repos",children:[l.jsx(Q,{name:"source"})," repositories"]}),y&&l.jsx(Wj,{})]}),l.jsx("span",{className:"spacer"}),l.jsx(Kj,{}),l.jsx(nb,{}),l.jsx(ab,{}),l.jsx(lb,{})]}),l.jsx("main",{className:"shell",children:b})]})}function Wj(){const s=$e("/api/git",!1,15e3),c=s?.files?.filter(u=>u.syncable).length??0;return l.jsxs("a",{href:"#/git",children:[l.jsx(Q,{name:"cloud_sync"})," git",!!s?.behind&&l.jsxs("span",{className:"git-badge behind",children:[s.behind,"↓"]}),!!s?.ahead&&l.jsxs("span",{className:"git-badge ahead",children:[s.ahead,"↑"]}),!s?.ahead&&!s?.behind&&!!c&&l.jsx("span",{className:"git-badge dirty",children:c})]})}function Nu({label:s}){return!Cn()||!s?null:l.jsx("span",{className:"switcher-root",title:s,children:l.jsx("span",{dir:"ltr",children:s})})}function Pj({entry:s}){const[c,u]=w.useState("idle"),[o,d]=w.useState(""),h=s.exists===!1,m=async()=>{u("starting"),d("");try{window.location.assign(await op(s.root))}catch(p){u("error"),d(p.message)}};return l.jsxs("span",{className:`switcher-item stopped ${h?"missing":""}`,role:"menuitem",children:[l.jsx("span",{className:"switcher-icon",children:s.icon||"•"}),l.jsxs("span",{className:"switcher-text",children:[l.jsx("span",{className:"switcher-name",children:s.name}),l.jsx(Nu,{label:s.rootLabel}),l.jsx("span",{className:"switcher-sub",children:c==="error"?l.jsx("span",{className:"switcher-err",title:o,children:o}):h?"folder missing":`stopped · ${s.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(Q,{name:"progress_activity"}):l.jsx(Q,{name:"play_arrow"}),c==="starting"?"starting":"start"]})]})}function eb({name:s,icon:c,root:u,entries:o}){const[d,h]=w.useState(!1),m=Cn();return w.useEffect(()=>{if(!d)return;const p=y=>{y.target.closest(".switcher-wrap")||h(!1)};return window.addEventListener("mousedown",p),()=>window.removeEventListener("mousedown",p)},[d]),o.length===0?l.jsx("span",{className:"env-name",title:u||"Project (kraftwerk.yml: name)",children:s}):l.jsxs("span",{className:"switcher-wrap",children:[l.jsxs("button",{className:"env-name env-switch",title:u?`${u} — switch workspace`:"Switch workspace","aria-haspopup":"menu","aria-expanded":d,onClick:()=>h(p=>!p),children:[s,l.jsx(Q,{name:"expand_more"})]}),d&&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:s}),m&&u?l.jsx(Nu,{label:u}):l.jsx("span",{className:"switcher-sub",children:"this workspace"})]}),l.jsx("span",{className:"switcher-hint",children:"current"})]}),o.map(p=>p.live===!1&&p.root?l.jsx(Pj,{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(Nu,{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(Q,{name:"hub"})," manage workspaces"]})]})]})}function tb(){const[s,c]=w.useState(null);return w.useEffect(()=>{let u=!0;return fetch("/api/runs").then(o=>o.json()).then(o=>{u&&(o.runs.length>0?tn(`/runs/${o.runs[0].id}`,{replace:!0}):c({outputDir:o.outputDir}))}).catch(()=>{}),()=>{u=!1}},[]),s?l.jsxs("div",{className:"empty",children:["No runs found in ",l.jsx("code",{children:s.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 nb(){const[s,c]=w.useState(null),[u,o]=w.useState(!1);w.useEffect(()=>{let m=!0,p;const y=async()=>{try{const x=await fetch("/api/meta",{cache:"no-store"}).then(k=>k.json());m&&c(x)}catch{}m&&(p=setTimeout(y,3e4))};return y(),()=>{m=!1,clearTimeout(p)}},[]);const d=s?.restartable&&s.diskVersion&&s.diskVersion!==s.version?s.diskVersion:null;async function h(){if(d){o(!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===d)break}catch{}}location.reload()}}return!d&&!u?null:l.jsx("button",{className:"relaunch-note",disabled:u,title:`v${d} is installed on disk, the server still runs v${s?.version}. Click to relaunch with the new version.`,onClick:()=>{h()},children:u?"relaunching…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"restart_alt",className:"ms-sm"})," v",d," ready — relaunch"]})})}function ab(){const s=Cn();return l.jsxs("button",{className:`expert-toggle ${s?"on":""}`,title:s?"Expert mode on — full detail":"Expert mode off — simplified view","aria-pressed":s,onClick:()=>Fx(!s),children:[l.jsx("span",{className:"expert-track",children:l.jsx("span",{className:"expert-knob"})}),"expert"]})}function lb(){const[s,c]=w.useState(!1),[u,o]=w.useState(null),[d,h]=w.useState(null),[m,p]=w.useState("");w.useEffect(()=>{if(!s)return;fetch("/api/runs").then(k=>k.json()).then(o).catch(()=>{}),fetch("/api/workflows").then(k=>k.json()).then(h).catch(()=>{}),fetch("/api/meta").then(k=>k.json()).then(k=>p(k.version)).catch(()=>{});const x=k=>{k.target.closest(".info-wrap")||c(!1)};return window.addEventListener("mousedown",x),()=>window.removeEventListener("mousedown",x)},[s]);const y=u?.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(Q,{name:"info"})}),s&&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:d?`${d.workflows.length} discovered`:"…"}),l.jsx("code",{className:"info-path",title:d?.root,children:d?.root??""})]}),l.jsxs("div",{className:"info-row",children:[l.jsx("span",{className:"microlabel",children:"Runs"}),l.jsxs("span",{className:"info-v",children:[u?`${u.runs.length} total`:"…",y?` · latest ${y.status}`:""]}),l.jsx("code",{className:"info-path",title:u?.outputDir,children:u?.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(Q,{name:"settings",className:"ms-sm"})," settings"]})]}),l.jsxs("div",{className:"info-row info-actions",children:[l.jsx("span",{className:"microlabel",children:"Theme"}),l.jsx(cb,{})]}),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(ib,{})]})]})]})}function sb(s,c){const u=s.split(".").map(Number),o=c.split(".").map(Number);for(let d=0;d<3;d++)if((u[d]??0)!==(o[d]??0))return(u[d]??0)<(o[d]??0);return!1}function ib(){const[s,c]=w.useState("idle"),[u,o]=w.useState(null);async function d(){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;o(m),c("done")}catch{c("err")}}return s==="done"&&u?sb(u.current,u.latest)?l.jsxs("span",{className:"update-result newer",children:["v",u.latest," available — ",l.jsxs("code",{children:["npm i -g ",u.name,"@latest"]})]}):l.jsxs("span",{className:"update-result",children:[l.jsx(Q,{name:"check",className:"ms-sm"})," up to date"]}):l.jsx("button",{className:"update-btn",disabled:s==="busy",onClick:()=>{d()},children:s==="busy"?"checking…":s==="err"?"npm unreachable — retry":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"sync",className:"ms-sm"})," check for updates"]})})}function cb(){return l.jsx("button",{className:"theme-btn",onClick:()=>{const s=document.documentElement,c=s.dataset.theme==="light"?"dark":"light";s.dataset.theme=c;try{localStorage.setItem("kw-theme",c)}catch{}},children:"day / night"})}Qx.createRoot(document.getElementById("root")).render(l.jsx(w.StrictMode,{children:l.jsx(Fj,{})}));export{Q as I,Hx as R,Kx as _,Gx as a,rb as b,Dx as g,l as j,tn as n,w as r,km as s};