@origintrail-official/dkg-node-ui 10.0.16 → 10.0.18

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 (55) hide show
  1. package/dist/chain-cursor-stores.d.ts +48 -0
  2. package/dist/chain-cursor-stores.d.ts.map +1 -1
  3. package/dist/chain-cursor-stores.js +145 -0
  4. package/dist/chain-cursor-stores.js.map +1 -1
  5. package/dist/chain-event-log-store.d.ts +84 -0
  6. package/dist/chain-event-log-store.d.ts.map +1 -0
  7. package/dist/chain-event-log-store.js +289 -0
  8. package/dist/chain-event-log-store.js.map +1 -0
  9. package/dist/db.d.ts +16 -58
  10. package/dist/db.d.ts.map +1 -1
  11. package/dist/db.js +125 -144
  12. package/dist/db.js.map +1 -1
  13. package/dist/index.d.ts +3 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +3 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/protocol-outbox-store.d.ts +67 -0
  18. package/dist/protocol-outbox-store.d.ts.map +1 -0
  19. package/dist/protocol-outbox-store.js +199 -0
  20. package/dist/protocol-outbox-store.js.map +1 -0
  21. package/dist-ui/assets/{3d-force-graph-bUKbeTGZ.js → 3d-force-graph-DGF2sXeK.js} +1 -1
  22. package/dist-ui/assets/ActivityFeed-DNatshHL.js +99 -0
  23. package/dist-ui/assets/{AgentHub-4c4sH_Jd.js → AgentHub-lOm96XuE.js} +1 -1
  24. package/dist-ui/assets/{AgentProfilePage-ClhUeZxy.js → AgentProfilePage-BRtazufK.js} +1 -1
  25. package/dist-ui/assets/ApproveWalletsModal-BMtRgndO.js +3 -0
  26. package/dist-ui/assets/{ContextGraphPrimitives-Bwc2i7EX.js → ContextGraphPrimitives-CBc6kvmp.js} +1 -1
  27. package/dist-ui/assets/ConvictionDetailView-DOTYSm7p.js +2 -0
  28. package/dist-ui/assets/{MemoryLayerView-DxL2MjyA.js → MemoryLayerView-DDFI2ngR.js} +2 -2
  29. package/dist-ui/assets/{MemoryStackView-BLhA3bn0.js → MemoryStackView-Bol2eMyq.js} +1 -1
  30. package/dist-ui/assets/{Network-BNhbBzOD.js → Network-B49IxpAj.js} +1 -1
  31. package/dist-ui/assets/{OnChainProvenanceCard-DKyfVEjF.js → OnChainProvenanceCard-BpUoHg4b.js} +1 -1
  32. package/dist-ui/assets/{Operations-mCPe0E-j.js → Operations-BCQ545Yk.js} +1 -1
  33. package/dist-ui/assets/{ProjectView-jrGPu5ON.js → ProjectView-BaQQSy8L.js} +20 -20
  34. package/dist-ui/assets/PublishingConviction-B5nWRsUP.js +2 -0
  35. package/dist-ui/assets/Settings-DeZKX_Ry.js +1 -0
  36. package/dist-ui/assets/browserWalletTransaction-B6wyaMOV.js +55 -0
  37. package/dist-ui/assets/ccip-B_vQl40F.js +1 -0
  38. package/dist-ui/assets/{index-VYV5TH6q.css → index-BLQUVvVz.css} +1 -1
  39. package/dist-ui/assets/index-CT-LdpBE.js +1175 -0
  40. package/dist-ui/assets/{index-UvxrSkC_.js → index-DHd3qhAk.js} +3 -3
  41. package/dist-ui/assets/{jsonld-32FQRO67-Dl6_9Lk9.js → jsonld-32FQRO67-BYu8pE-5.js} +2 -2
  42. package/dist-ui/assets/{jsonld-Dj4KMENF.js → jsonld-Crm5iwcE.js} +1 -1
  43. package/dist-ui/assets/{renderer-3d-2EVDZII7-DfnhcMkF.js → renderer-3d-2EVDZII7-C2z5aUgo.js} +2 -2
  44. package/dist-ui/assets/{shikiHighlighter-ByXDJnWi.js → shikiHighlighter-DW1fRfBU.js} +1 -1
  45. package/dist-ui/assets/{useEntityOnChainReceipt-BRK_O_sb.js → useEntityOnChainReceipt-0Ub24t6e.js} +1 -1
  46. package/dist-ui/assets/{useProjectActivity-OdoQs9mK.js → useProjectActivity-CLza3psq.js} +1 -1
  47. package/dist-ui/index.html +2 -2
  48. package/package.json +3 -3
  49. package/dist-ui/assets/ActivityFeed-CC5S_gk9.js +0 -100
  50. package/dist-ui/assets/ApproveWalletsModal-CBKp6zQB.js +0 -57
  51. package/dist-ui/assets/ConvictionDetailView-a3v7xwcm.js +0 -2
  52. package/dist-ui/assets/PublishingConviction-BGi128uo.js +0 -2
  53. package/dist-ui/assets/Settings-D1oxLo1Y.js +0 -1
  54. package/dist-ui/assets/ccip-WHHgwjp-.js +0 -1
  55. package/dist-ui/assets/index-RLb1kuzE.js +0 -1174
@@ -1,1174 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/Operations-mCPe0E-j.js","assets/string-DtUow4KV.js","assets/AgentProfilePage-ClhUeZxy.js","assets/ActivityFeed-CC5S_gk9.js","assets/useProjectActivity-OdoQs9mK.js","assets/PublishingConviction-BGi128uo.js","assets/ContextGraphPrimitives-Bwc2i7EX.js","assets/ApproveWalletsModal-CBKp6zQB.js","assets/ConvictionDetailView-a3v7xwcm.js","assets/ProjectView-jrGPu5ON.js","assets/truncate-BaiMkAOo.js","assets/useEntityOnChainReceipt-BRK_O_sb.js","assets/MemoryLayerView-DxL2MjyA.js","assets/MemoryStackView-BLhA3bn0.js"])))=>i.map(i=>d[i]);
2
- var O2=Object.defineProperty;var D2=(e,n,a)=>n in e?O2(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var Gt=(e,n,a)=>D2(e,typeof n!="symbol"?n+"":n,a);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function a(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=a(o);fetch(o.href,s)}})();var LI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Po(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zI(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var a=function r(){return this instanceof r?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};a.prototype=n.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),a}var kf={exports:{}},oo={};/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var $v;function M2(){if($v)return oo;$v=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(r,o,s){var u=null;if(s!==void 0&&(u=""+s),o.key!==void 0&&(u=""+o.key),"key"in o){s={};for(var d in o)d!=="key"&&(s[d]=o[d])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:u,ref:o!==void 0?o:null,props:s}}return oo.Fragment=n,oo.jsx=a,oo.jsxs=a,oo}var qv;function L2(){return qv||(qv=1,kf.exports=M2()),kf.exports}var m=L2(),Cf={exports:{}},De={};/**
11
- * @license React
12
- * react.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var Fv;function z2(){if(Fv)return De;Fv=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function b(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,j={};function E(M,Q,N){this.props=M,this.context=Q,this.refs=j,this.updater=N||k}E.prototype.isReactComponent={},E.prototype.setState=function(M,Q){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,Q,"setState")},E.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function R(){}R.prototype=E.prototype;function O(M,Q,N){this.props=M,this.context=Q,this.refs=j,this.updater=N||k}var G=O.prototype=new R;G.constructor=O,C(G,E.prototype),G.isPureReactComponent=!0;var U=Array.isArray;function _(){}var W={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function L(M,Q,N){var ue=N.ref;return{$$typeof:e,type:M,key:Q,ref:ue!==void 0?ue:null,props:N}}function T(M,Q){return L(M.type,Q,M.props)}function F(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function V(M){var Q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(N){return Q[N]})}var ie=/\/+/g;function B(M,Q){return typeof M=="object"&&M!==null&&M.key!=null?V(""+M.key):Q.toString(36)}function K(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(_,_):(M.status="pending",M.then(function(Q){M.status==="pending"&&(M.status="fulfilled",M.value=Q)},function(Q){M.status==="pending"&&(M.status="rejected",M.reason=Q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function P(M,Q,N,ue,pe){var he=typeof M;(he==="undefined"||he==="boolean")&&(M=null);var be=!1;if(M===null)be=!0;else switch(he){case"bigint":case"string":case"number":be=!0;break;case"object":switch(M.$$typeof){case e:case n:be=!0;break;case y:return be=M._init,P(be(M._payload),Q,N,ue,pe)}}if(be)return pe=pe(M),be=ue===""?"."+B(M,0):ue,U(pe)?(N="",be!=null&&(N=be.replace(ie,"$&/")+"/"),P(pe,Q,N,"",function(et){return et})):pe!=null&&(F(pe)&&(pe=T(pe,N+(pe.key==null||M&&M.key===pe.key?"":(""+pe.key).replace(ie,"$&/")+"/")+be)),Q.push(pe)),1;be=0;var Oe=ue===""?".":ue+":";if(U(M))for(var Ne=0;Ne<M.length;Ne++)ue=M[Ne],he=Oe+B(ue,Ne),be+=P(ue,Q,N,he,pe);else if(Ne=b(M),typeof Ne=="function")for(M=Ne.call(M),Ne=0;!(ue=M.next()).done;)ue=ue.value,he=Oe+B(ue,Ne++),be+=P(ue,Q,N,he,pe);else if(he==="object"){if(typeof M.then=="function")return P(K(M),Q,N,ue,pe);throw Q=String(M),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return be}function Z(M,Q,N){if(M==null)return M;var ue=[],pe=0;return P(M,ue,"","",function(he){return Q.call(N,he,pe++)}),ue}function ne(M){if(M._status===-1){var Q=M._result;Q=Q(),Q.then(function(N){(M._status===0||M._status===-1)&&(M._status=1,M._result=N)},function(N){(M._status===0||M._status===-1)&&(M._status=2,M._result=N)}),M._status===-1&&(M._status=0,M._result=Q)}if(M._status===1)return M._result.default;throw M._result}var X=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},D={map:Z,forEach:function(M,Q,N){Z(M,function(){Q.apply(this,arguments)},N)},count:function(M){var Q=0;return Z(M,function(){Q++}),Q},toArray:function(M){return Z(M,function(Q){return Q})||[]},only:function(M){if(!F(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return De.Activity=g,De.Children=D,De.Component=E,De.Fragment=a,De.Profiler=o,De.PureComponent=O,De.StrictMode=r,De.Suspense=p,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,De.__COMPILER_RUNTIME={__proto__:null,c:function(M){return W.H.useMemoCache(M)}},De.cache=function(M){return function(){return M.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(M,Q,N){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ue=C({},M.props),pe=M.key;if(Q!=null)for(he in Q.key!==void 0&&(pe=""+Q.key),Q)!H.call(Q,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&Q.ref===void 0||(ue[he]=Q[he]);var he=arguments.length-2;if(he===1)ue.children=N;else if(1<he){for(var be=Array(he),Oe=0;Oe<he;Oe++)be[Oe]=arguments[Oe+2];ue.children=be}return L(M.type,pe,ue)},De.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:s,_context:M},M},De.createElement=function(M,Q,N){var ue,pe={},he=null;if(Q!=null)for(ue in Q.key!==void 0&&(he=""+Q.key),Q)H.call(Q,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(pe[ue]=Q[ue]);var be=arguments.length-2;if(be===1)pe.children=N;else if(1<be){for(var Oe=Array(be),Ne=0;Ne<be;Ne++)Oe[Ne]=arguments[Ne+2];pe.children=Oe}if(M&&M.defaultProps)for(ue in be=M.defaultProps,be)pe[ue]===void 0&&(pe[ue]=be[ue]);return L(M,he,pe)},De.createRef=function(){return{current:null}},De.forwardRef=function(M){return{$$typeof:d,render:M}},De.isValidElement=F,De.lazy=function(M){return{$$typeof:y,_payload:{_status:-1,_result:M},_init:ne}},De.memo=function(M,Q){return{$$typeof:f,type:M,compare:Q===void 0?null:Q}},De.startTransition=function(M){var Q=W.T,N={};W.T=N;try{var ue=M(),pe=W.S;pe!==null&&pe(N,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(_,X)}catch(he){X(he)}finally{Q!==null&&N.types!==null&&(Q.types=N.types),W.T=Q}},De.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},De.use=function(M){return W.H.use(M)},De.useActionState=function(M,Q,N){return W.H.useActionState(M,Q,N)},De.useCallback=function(M,Q){return W.H.useCallback(M,Q)},De.useContext=function(M){return W.H.useContext(M)},De.useDebugValue=function(){},De.useDeferredValue=function(M,Q){return W.H.useDeferredValue(M,Q)},De.useEffect=function(M,Q){return W.H.useEffect(M,Q)},De.useEffectEvent=function(M){return W.H.useEffectEvent(M)},De.useId=function(){return W.H.useId()},De.useImperativeHandle=function(M,Q,N){return W.H.useImperativeHandle(M,Q,N)},De.useInsertionEffect=function(M,Q){return W.H.useInsertionEffect(M,Q)},De.useLayoutEffect=function(M,Q){return W.H.useLayoutEffect(M,Q)},De.useMemo=function(M,Q){return W.H.useMemo(M,Q)},De.useOptimistic=function(M,Q){return W.H.useOptimistic(M,Q)},De.useReducer=function(M,Q,N){return W.H.useReducer(M,Q,N)},De.useRef=function(M){return W.H.useRef(M)},De.useState=function(M){return W.H.useState(M)},De.useSyncExternalStore=function(M,Q,N){return W.H.useSyncExternalStore(M,Q,N)},De.useTransition=function(){return W.H.useTransition()},De.version="19.2.4",De}var Gv;function oh(){return Gv||(Gv=1,Cf.exports=z2()),Cf.exports}var S=oh();const hn=Po(S);var Ef={exports:{}},so={},Af={exports:{}},jf={};/**
19
- * @license React
20
- * scheduler.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var Vv;function I2(){return Vv||(Vv=1,(function(e){function n(P,Z){var ne=P.length;P.push(Z);e:for(;0<ne;){var X=ne-1>>>1,D=P[X];if(0<o(D,Z))P[X]=Z,P[ne]=D,ne=X;else break e}}function a(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var Z=P[0],ne=P.pop();if(ne!==Z){P[0]=ne;e:for(var X=0,D=P.length,M=D>>>1;X<M;){var Q=2*(X+1)-1,N=P[Q],ue=Q+1,pe=P[ue];if(0>o(N,ne))ue<D&&0>o(pe,N)?(P[X]=pe,P[ue]=ne,X=ue):(P[X]=N,P[Q]=ne,X=Q);else if(ue<D&&0>o(pe,ne))P[X]=pe,P[ue]=ne,X=ue;else break e}}return Z}function o(P,Z){var ne=P.sortIndex-Z.sortIndex;return ne!==0?ne:P.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var p=[],f=[],y=1,g=null,x=3,b=!1,k=!1,C=!1,j=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function G(P){for(var Z=a(f);Z!==null;){if(Z.callback===null)r(f);else if(Z.startTime<=P)r(f),Z.sortIndex=Z.expirationTime,n(p,Z);else break;Z=a(f)}}function U(P){if(C=!1,G(P),!k)if(a(p)!==null)k=!0,_||(_=!0,V());else{var Z=a(f);Z!==null&&K(U,Z.startTime-P)}}var _=!1,W=-1,H=5,L=-1;function T(){return j?!0:!(e.unstable_now()-L<H)}function F(){if(j=!1,_){var P=e.unstable_now();L=P;var Z=!0;try{e:{k=!1,C&&(C=!1,R(W),W=-1),b=!0;var ne=x;try{t:{for(G(P),g=a(p);g!==null&&!(g.expirationTime>P&&T());){var X=g.callback;if(typeof X=="function"){g.callback=null,x=g.priorityLevel;var D=X(g.expirationTime<=P);if(P=e.unstable_now(),typeof D=="function"){g.callback=D,G(P),Z=!0;break t}g===a(p)&&r(p),G(P)}else r(p);g=a(p)}if(g!==null)Z=!0;else{var M=a(f);M!==null&&K(U,M.startTime-P),Z=!1}}break e}finally{g=null,x=ne,b=!1}Z=void 0}}finally{Z?V():_=!1}}}var V;if(typeof O=="function")V=function(){O(F)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,B=ie.port2;ie.port1.onmessage=F,V=function(){B.postMessage(null)}}else V=function(){E(F,0)};function K(P,Z){W=E(function(){P(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(P){switch(x){case 1:case 2:case 3:var Z=3;break;default:Z=x}var ne=x;x=Z;try{return P()}finally{x=ne}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(P,Z){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var ne=x;x=P;try{return Z()}finally{x=ne}},e.unstable_scheduleCallback=function(P,Z,ne){var X=e.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?X+ne:X):ne=X,P){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=ne+D,P={id:y++,callback:Z,priorityLevel:P,startTime:ne,expirationTime:D,sortIndex:-1},ne>X?(P.sortIndex=ne,n(f,P),a(p)===null&&P===a(f)&&(C?(R(W),W=-1):C=!0,K(U,ne-X))):(P.sortIndex=D,n(p,P),k||b||(k=!0,_||(_=!0,V()))),P},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(P){var Z=x;return function(){var ne=x;x=Z;try{return P.apply(this,arguments)}finally{x=ne}}}})(jf)),jf}var Wv;function P2(){return Wv||(Wv=1,Af.exports=I2()),Af.exports}var Tf={exports:{}},rn={};/**
27
- * @license React
28
- * react-dom.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var Yv;function U2(){if(Yv)return rn;Yv=1;var e=oh();function n(p){var f="https://react.dev/errors/"+p;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)f+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(p,f,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:p,containerInfo:f,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(p,f){if(p==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,rn.createPortal=function(p,f){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(n(299));return s(p,f,null,y)},rn.flushSync=function(p){var f=u.T,y=r.p;try{if(u.T=null,r.p=2,p)return p()}finally{u.T=f,r.p=y,r.d.f()}},rn.preconnect=function(p,f){typeof p=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(p,f))},rn.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},rn.preinit=function(p,f){if(typeof p=="string"&&f&&typeof f.as=="string"){var y=f.as,g=d(y,f.crossOrigin),x=typeof f.integrity=="string"?f.integrity:void 0,b=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;y==="style"?r.d.S(p,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:b}):y==="script"&&r.d.X(p,{crossOrigin:g,integrity:x,fetchPriority:b,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},rn.preinitModule=function(p,f){if(typeof p=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var y=d(f.as,f.crossOrigin);r.d.M(p,{crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(p)},rn.preload=function(p,f){if(typeof p=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var y=f.as,g=d(y,f.crossOrigin);r.d.L(p,y,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},rn.preloadModule=function(p,f){if(typeof p=="string")if(f){var y=d(f.as,f.crossOrigin);r.d.m(p,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(p)},rn.requestFormReset=function(p){r.d.r(p)},rn.unstable_batchedUpdates=function(p,f){return p(f)},rn.useFormState=function(p,f,y){return u.H.useFormState(p,f,y)},rn.useFormStatus=function(){return u.H.useHostTransitionStatus()},rn.version="19.2.4",rn}var Kv;function Rx(){if(Kv)return Tf.exports;Kv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Tf.exports=U2(),Tf.exports}/**
35
- * @license React
36
- * react-dom-client.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var Qv;function B2(){if(Qv)return so;Qv=1;var e=P2(),n=oh(),a=Rx();function r(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function s(t){var i=t,l=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(l=i.return),t=i.return;while(t)}return i.tag===3?l:null}function u(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function d(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function p(t){if(s(t)!==t)throw Error(r(188))}function f(t){var i=t.alternate;if(!i){if(i=s(t),i===null)throw Error(r(188));return i!==t?null:t}for(var l=t,c=i;;){var h=l.return;if(h===null)break;var v=h.alternate;if(v===null){if(c=h.return,c!==null){l=c;continue}break}if(h.child===v.child){for(v=h.child;v;){if(v===l)return p(h),t;if(v===c)return p(h),i;v=v.sibling}throw Error(r(188))}if(l.return!==c.return)l=h,c=v;else{for(var w=!1,A=h.child;A;){if(A===l){w=!0,l=h,c=v;break}if(A===c){w=!0,c=h,l=v;break}A=A.sibling}if(!w){for(A=v.child;A;){if(A===l){w=!0,l=v,c=h;break}if(A===c){w=!0,c=v,l=h;break}A=A.sibling}if(!w)throw Error(r(189))}}if(l.alternate!==c)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:i}function y(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=y(t),i!==null)return i;t=t.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),O=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function V(t){return t===null||typeof t!="object"?null:(t=F&&t[F]||t["@@iterator"],typeof t=="function"?t:null)}var ie=Symbol.for("react.client.reference");function B(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ie?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case E:return"Profiler";case j:return"StrictMode";case U:return"Suspense";case _:return"SuspenseList";case L:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case O:return t.displayName||"Context";case R:return(t._context.displayName||"Context")+".Consumer";case G:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case W:return i=t.displayName||null,i!==null?i:B(t.type)||"Memo";case H:i=t._payload,t=t._init;try{return B(t(i))}catch{}}return null}var K=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},X=[],D=-1;function M(t){return{current:t}}function Q(t){0>D||(t.current=X[D],X[D]=null,D--)}function N(t,i){D++,X[D]=t.current,t.current=i}var ue=M(null),pe=M(null),he=M(null),be=M(null);function Oe(t,i){switch(N(he,i),N(pe,t),N(ue,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?dv(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=dv(i),t=fv(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Q(ue),N(ue,t)}function Ne(){Q(ue),Q(pe),Q(he)}function et(t){t.memoizedState!==null&&N(be,t);var i=ue.current,l=fv(i,t.type);i!==l&&(N(pe,t),N(ue,l))}function Ot(t){pe.current===t&&(Q(ue),Q(pe)),be.current===t&&(Q(be),ao._currentValue=ne)}var xt,bt;function yt(t){if(xt===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);xt=i&&i[1]||"",bt=-1<l.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+xt+t+bt}var Zt=!1;function Ue(t,i){if(!t||Zt)return"";Zt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ae){var te=ae}Reflect.construct(t,[],ce)}else{try{ce.call()}catch(ae){te=ae}t.call(ce.prototype)}}else{try{throw Error()}catch(ae){te=ae}(ce=t())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ae){if(ae&&te&&typeof ae.stack=="string")return[ae.stack,te.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),w=v[0],A=v[1];if(w&&A){var z=w.split(`
45
- `),ee=A.split(`
46
- `);for(h=c=0;c<z.length&&!z[c].includes("DetermineComponentFrameRoot");)c++;for(;h<ee.length&&!ee[h].includes("DetermineComponentFrameRoot");)h++;if(c===z.length||h===ee.length)for(c=z.length-1,h=ee.length-1;1<=c&&0<=h&&z[c]!==ee[h];)h--;for(;1<=c&&0<=h;c--,h--)if(z[c]!==ee[h]){if(c!==1||h!==1)do if(c--,h--,0>h||z[c]!==ee[h]){var re=`
47
- `+z[c].replace(" at new "," at ");return t.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",t.displayName)),re}while(1<=c&&0<=h);break}}}finally{Zt=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?yt(l):""}function pt(t,i){switch(t.tag){case 26:case 27:case 5:return yt(t.type);case 16:return yt("Lazy");case 13:return t.child!==i&&i!==null?yt("Suspense Fallback"):yt("Suspense");case 19:return yt("SuspenseList");case 0:case 15:return Ue(t.type,!1);case 11:return Ue(t.type.render,!1);case 1:return Ue(t.type,!0);case 31:return yt("Activity");default:return""}}function Dt(t){try{var i="",l=null;do i+=pt(t,l),l=t,t=t.return;while(t);return i}catch(c){return`
48
- Error generating stack: `+c.message+`
49
- `+c.stack}}var Nt=Object.prototype.hasOwnProperty,ge=e.unstable_scheduleCallback,Mt=e.unstable_cancelCallback,qn=e.unstable_shouldYield,yn=e.unstable_requestPaint,it=e.unstable_now,fe=e.unstable_getCurrentPriorityLevel,$=e.unstable_ImmediatePriority,le=e.unstable_UserBlockingPriority,me=e.unstable_NormalPriority,ye=e.unstable_LowPriority,I=e.unstable_IdlePriority,Te=e.log,at=e.unstable_setDisableYieldValue,Pe=null,Xe=null;function Ve(t){if(typeof Te=="function"&&at(t),Xe&&typeof Xe.setStrictMode=="function")try{Xe.setStrictMode(Pe,t)}catch{}}var ke=Math.clz32?Math.clz32:ja,Wt=Math.log,rt=Math.LN2;function ja(t){return t>>>=0,t===0?32:31-(Wt(t)/rt|0)|0}var ti=256,Ii=262144,mr=4194304;function Ta(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function gr(t,i,l){var c=t.pendingLanes;if(c===0)return 0;var h=0,v=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var A=c&134217727;return A!==0?(c=A&~v,c!==0?h=Ta(c):(w&=A,w!==0?h=Ta(w):l||(l=A&~t,l!==0&&(h=Ta(l))))):(A=c&~v,A!==0?h=Ta(A):w!==0?h=Ta(w):l||(l=c&~t,l!==0&&(h=Ta(l)))),h===0?0:i!==0&&i!==h&&(i&v)===0&&(v=h&-h,l=i&-i,v>=l||v===32&&(l&4194048)!==0)?i:h}function Pi(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function fu(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vo(){var t=mr;return mr<<=1,(mr&62914560)===0&&(mr=4194304),t}function yl(t){for(var i=[],l=0;31>l;l++)i.push(t);return i}function Ui(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function pu(t,i,l,c,h,v){var w=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var A=t.entanglements,z=t.expirationTimes,ee=t.hiddenUpdates;for(l=w&~l;0<l;){var re=31-ke(l),ce=1<<re;A[re]=0,z[re]=-1;var te=ee[re];if(te!==null)for(ee[re]=null,re=0;re<te.length;re++){var ae=te[re];ae!==null&&(ae.lane&=-536870913)}l&=~ce}c!==0&&Wo(t,c,0),v!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=v&~(w&~i))}function Wo(t,i,l){t.pendingLanes|=i,t.suspendedLanes&=~i;var c=31-ke(i);t.entangledLanes|=i,t.entanglements[c]=t.entanglements[c]|1073741824|l&261930}function se(t,i){var l=t.entangledLanes|=i;for(t=t.entanglements;l;){var c=31-ke(l),h=1<<c;h&i|t[c]&i&&(t[c]|=i),l&=~h}}function ve(t,i){var l=i&-i;return l=(l&42)!==0?1:Ce(l),(l&(t.suspendedLanes|i))!==0?0:l}function Ce(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Me(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ye(){var t=Z.p;return t!==0?t:(t=window.event,t===void 0?32:Lv(t.type))}function lt(t,i){var l=Z.p;try{return Z.p=t,i()}finally{Z.p=l}}var Re=Math.random().toString(36).slice(2),Se="__reactFiber$"+Re,_e="__reactProps$"+Re,an="__reactContainer$"+Re,Na="__reactEvents$"+Re,vl="__reactListeners$"+Re,Yo="__reactHandles$"+Re,ni="__reactResources$"+Re,ha="__reactMarker$"+Re;function yr(t){delete t[Se],delete t[_e],delete t[Na],delete t[vl],delete t[Yo]}function Ra(t){var i=t[Se];if(i)return i;for(var l=t.parentNode;l;){if(i=l[an]||l[Se]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(t=xv(t);t!==null;){if(l=t[Se])return l;t=xv(t)}return i}t=l,l=t.parentNode}return null}function Yt(t){if(t=t[Se]||t[an]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function sn(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(r(33))}function Fn(t){var i=t[ni];return i||(i=t[ni]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function At(t){t[ha]=!0}var vn=new Set,ma={};function cn(t,i){Gn(t,i),Gn(t+"Capture",i)}function Gn(t,i){for(ma[t]=i,t=0;t<i.length;t++)vn.add(i[t])}var ai=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]*$"),xl={},Ko={};function hu(t){return Nt.call(Ko,t)?!0:Nt.call(xl,t)?!1:ai.test(t)?Ko[t]=!0:(xl[t]=!0,!1)}function un(t,i,l){if(hu(i))if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+l)}}function Bi(t,i,l){if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+l)}}function xn(t,i,l,c){if(c===null)t.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(i,l,""+c)}}function Be(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function qt(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function _a(t,i,l){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var h=c.get,v=c.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return h.call(this)},set:function(w){l=""+w,v.call(this,w)}}),Object.defineProperty(t,i,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(w){l=""+w},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function mu(t){if(!t._valueTracker){var i=qt(t)?"checked":"value";t._valueTracker=_a(t,i,""+t[i])}}function im(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var l=i.getValue(),c="";return t&&(c=qt(t)?t.checked?"true":"false":t.value),t=c,t!==l?(i.setValue(t),!0):!1}function Qo(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var AS=/[\n"\\]/g;function Vn(t){return t.replace(AS,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function gu(t,i,l,c,h,v,w,A){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),i!=null?w==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Be(i)):t.value!==""+Be(i)&&(t.value=""+Be(i)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),i!=null?yu(t,w,Be(i)):l!=null?yu(t,w,Be(l)):c!=null&&t.removeAttribute("value"),h==null&&v!=null&&(t.defaultChecked=!!v),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?t.name=""+Be(A):t.removeAttribute("name")}function rm(t,i,l,c,h,v,w,A){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.type=v),i!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){mu(t);return}l=l!=null?""+Be(l):"",i=i!=null?""+Be(i):l,A||i===t.value||(t.value=i),t.defaultValue=i}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=A?t.checked:!!c,t.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),mu(t)}function yu(t,i,l){i==="number"&&Qo(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function vr(t,i,l,c){if(t=t.options,i){i={};for(var h=0;h<l.length;h++)i["$"+l[h]]=!0;for(l=0;l<t.length;l++)h=i.hasOwnProperty("$"+t[l].value),t[l].selected!==h&&(t[l].selected=h),h&&c&&(t[l].defaultSelected=!0)}else{for(l=""+Be(l),i=null,h=0;h<t.length;h++){if(t[h].value===l){t[h].selected=!0,c&&(t[h].defaultSelected=!0);return}i!==null||t[h].disabled||(i=t[h])}i!==null&&(i.selected=!0)}}function lm(t,i,l){if(i!=null&&(i=""+Be(i),i!==t.value&&(t.value=i),l==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=l!=null?""+Be(l):""}function om(t,i,l,c){if(i==null){if(c!=null){if(l!=null)throw Error(r(92));if(K(c)){if(1<c.length)throw Error(r(93));c=c[0]}l=c}l==null&&(l=""),i=l}l=Be(i),t.defaultValue=l,c=t.textContent,c===l&&c!==""&&c!==null&&(t.value=c),mu(t)}function xr(t,i){if(i){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=i;return}}t.textContent=i}var jS=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 sm(t,i,l){var c=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":c?t.setProperty(i,l):typeof l!="number"||l===0||jS.has(i)?i==="float"?t.cssFloat=l:t[i]=(""+l).trim():t[i]=l+"px"}function cm(t,i,l){if(i!=null&&typeof i!="object")throw Error(r(62));if(t=t.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var h in i)c=i[h],i.hasOwnProperty(h)&&l[h]!==c&&sm(t,h,c)}else for(var v in i)i.hasOwnProperty(v)&&sm(t,v,i[v])}function vu(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var TS=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"]]),NS=/^[\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 Xo(t){return NS.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Oa(){}var xu=null;function bu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var br=null,wr=null;function um(t){var i=Yt(t);if(i&&(t=i.stateNode)){var l=t[_e]||null;e:switch(t=i.stateNode,i.type){case"input":if(gu(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Vn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var c=l[i];if(c!==t&&c.form===t.form){var h=c[_e]||null;if(!h)throw Error(r(90));gu(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<l.length;i++)c=l[i],c.form===t.form&&im(c)}break e;case"textarea":lm(t,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&vr(t,!!l.multiple,i,!1)}}}var wu=!1;function dm(t,i,l){if(wu)return t(i,l);wu=!0;try{var c=t(i);return c}finally{if(wu=!1,(br!==null||wr!==null)&&(Ps(),br&&(i=br,t=wr,wr=br=null,um(i),t)))for(i=0;i<t.length;i++)um(t[i])}}function bl(t,i){var l=t.stateNode;if(l===null)return null;var c=l[_e]||null;if(c===null)return null;l=c[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,i,typeof l));return l}var Da=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=!1;if(Da)try{var wl={};Object.defineProperty(wl,"passive",{get:function(){Su=!0}}),window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{Su=!1}var ii=null,ku=null,Zo=null;function fm(){if(Zo)return Zo;var t,i=ku,l=i.length,c,h="value"in ii?ii.value:ii.textContent,v=h.length;for(t=0;t<l&&i[t]===h[t];t++);var w=l-t;for(c=1;c<=w&&i[l-c]===h[v-c];c++);return Zo=h.slice(t,1<c?1-c:void 0)}function Jo(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function es(){return!0}function pm(){return!1}function bn(t){function i(l,c,h,v,w){this._reactName=l,this._targetInst=h,this.type=c,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var A in t)t.hasOwnProperty(A)&&(l=t[A],this[A]=l?l(v):v[A]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?es:pm,this.isPropagationStopped=pm,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=es)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=es)},persist:function(){},isPersistent:es}),i}var Hi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ts=bn(Hi),Sl=g({},Hi,{view:0,detail:0}),RS=bn(Sl),Cu,Eu,kl,ns=g({},Sl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ju,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==kl&&(kl&&t.type==="mousemove"?(Cu=t.screenX-kl.screenX,Eu=t.screenY-kl.screenY):Eu=Cu=0,kl=t),Cu)},movementY:function(t){return"movementY"in t?t.movementY:Eu}}),hm=bn(ns),_S=g({},ns,{dataTransfer:0}),OS=bn(_S),DS=g({},Sl,{relatedTarget:0}),Au=bn(DS),MS=g({},Hi,{animationName:0,elapsedTime:0,pseudoElement:0}),LS=bn(MS),zS=g({},Hi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),IS=bn(zS),PS=g({},Hi,{data:0}),mm=bn(PS),US={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BS={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"},HS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $S(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=HS[t])?!!i[t]:!1}function ju(){return $S}var qS=g({},Sl,{key:function(t){if(t.key){var i=US[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Jo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?BS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ju,charCode:function(t){return t.type==="keypress"?Jo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Jo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),FS=bn(qS),GS=g({},ns,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gm=bn(GS),VS=g({},Sl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ju}),WS=bn(VS),YS=g({},Hi,{propertyName:0,elapsedTime:0,pseudoElement:0}),KS=bn(YS),QS=g({},ns,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),XS=bn(QS),ZS=g({},Hi,{newState:0,oldState:0}),JS=bn(ZS),ek=[9,13,27,32],Tu=Da&&"CompositionEvent"in window,Cl=null;Da&&"documentMode"in document&&(Cl=document.documentMode);var tk=Da&&"TextEvent"in window&&!Cl,ym=Da&&(!Tu||Cl&&8<Cl&&11>=Cl),vm=" ",xm=!1;function bm(t,i){switch(t){case"keyup":return ek.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Sr=!1;function nk(t,i){switch(t){case"compositionend":return wm(i);case"keypress":return i.which!==32?null:(xm=!0,vm);case"textInput":return t=i.data,t===vm&&xm?null:t;default:return null}}function ak(t,i){if(Sr)return t==="compositionend"||!Tu&&bm(t,i)?(t=fm(),Zo=ku=ii=null,Sr=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return ym&&i.locale!=="ko"?null:i.data;default:return null}}var ik={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 Sm(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!ik[t.type]:i==="textarea"}function km(t,i,l,c){br?wr?wr.push(c):wr=[c]:br=c,i=Gs(i,"onChange"),0<i.length&&(l=new ts("onChange","change",null,l,c),t.push({event:l,listeners:i}))}var El=null,Al=null;function rk(t){rv(t,0)}function as(t){var i=sn(t);if(im(i))return t}function Cm(t,i){if(t==="change")return i}var Em=!1;if(Da){var Nu;if(Da){var Ru="oninput"in document;if(!Ru){var Am=document.createElement("div");Am.setAttribute("oninput","return;"),Ru=typeof Am.oninput=="function"}Nu=Ru}else Nu=!1;Em=Nu&&(!document.documentMode||9<document.documentMode)}function jm(){El&&(El.detachEvent("onpropertychange",Tm),Al=El=null)}function Tm(t){if(t.propertyName==="value"&&as(Al)){var i=[];km(i,Al,t,bu(t)),dm(rk,i)}}function lk(t,i,l){t==="focusin"?(jm(),El=i,Al=l,El.attachEvent("onpropertychange",Tm)):t==="focusout"&&jm()}function ok(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return as(Al)}function sk(t,i){if(t==="click")return as(i)}function ck(t,i){if(t==="input"||t==="change")return as(i)}function uk(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Nn=typeof Object.is=="function"?Object.is:uk;function jl(t,i){if(Nn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var l=Object.keys(t),c=Object.keys(i);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var h=l[c];if(!Nt.call(i,h)||!Nn(t[h],i[h]))return!1}return!0}function Nm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Rm(t,i){var l=Nm(t);t=0;for(var c;l;){if(l.nodeType===3){if(c=t+l.textContent.length,t<=i&&c>=i)return{node:l,offset:i-t};t=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Nm(l)}}function _m(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?_m(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Om(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=Qo(t.document);i instanceof t.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)t=i.contentWindow;else break;i=Qo(t.document)}return i}function _u(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var dk=Da&&"documentMode"in document&&11>=document.documentMode,kr=null,Ou=null,Tl=null,Du=!1;function Dm(t,i,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Du||kr==null||kr!==Qo(c)||(c=kr,"selectionStart"in c&&_u(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Tl&&jl(Tl,c)||(Tl=c,c=Gs(Ou,"onSelect"),0<c.length&&(i=new ts("onSelect","select",null,i,l),t.push({event:i,listeners:c}),i.target=kr)))}function $i(t,i){var l={};return l[t.toLowerCase()]=i.toLowerCase(),l["Webkit"+t]="webkit"+i,l["Moz"+t]="moz"+i,l}var Cr={animationend:$i("Animation","AnimationEnd"),animationiteration:$i("Animation","AnimationIteration"),animationstart:$i("Animation","AnimationStart"),transitionrun:$i("Transition","TransitionRun"),transitionstart:$i("Transition","TransitionStart"),transitioncancel:$i("Transition","TransitionCancel"),transitionend:$i("Transition","TransitionEnd")},Mu={},Mm={};Da&&(Mm=document.createElement("div").style,"AnimationEvent"in window||(delete Cr.animationend.animation,delete Cr.animationiteration.animation,delete Cr.animationstart.animation),"TransitionEvent"in window||delete Cr.transitionend.transition);function qi(t){if(Mu[t])return Mu[t];if(!Cr[t])return t;var i=Cr[t],l;for(l in i)if(i.hasOwnProperty(l)&&l in Mm)return Mu[t]=i[l];return t}var Lm=qi("animationend"),zm=qi("animationiteration"),Im=qi("animationstart"),fk=qi("transitionrun"),pk=qi("transitionstart"),hk=qi("transitioncancel"),Pm=qi("transitionend"),Um=new Map,Lu="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(" ");Lu.push("scrollEnd");function la(t,i){Um.set(t,i),cn(i,[t])}var is=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Wn=[],Er=0,zu=0;function rs(){for(var t=Er,i=zu=Er=0;i<t;){var l=Wn[i];Wn[i++]=null;var c=Wn[i];Wn[i++]=null;var h=Wn[i];Wn[i++]=null;var v=Wn[i];if(Wn[i++]=null,c!==null&&h!==null){var w=c.pending;w===null?h.next=h:(h.next=w.next,w.next=h),c.pending=h}v!==0&&Bm(l,h,v)}}function ls(t,i,l,c){Wn[Er++]=t,Wn[Er++]=i,Wn[Er++]=l,Wn[Er++]=c,zu|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Iu(t,i,l,c){return ls(t,i,l,c),os(t)}function Fi(t,i){return ls(t,null,null,i),os(t)}function Bm(t,i,l){t.lanes|=l;var c=t.alternate;c!==null&&(c.lanes|=l);for(var h=!1,v=t.return;v!==null;)v.childLanes|=l,c=v.alternate,c!==null&&(c.childLanes|=l),v.tag===22&&(t=v.stateNode,t===null||t._visibility&1||(h=!0)),t=v,v=v.return;return t.tag===3?(v=t.stateNode,h&&i!==null&&(h=31-ke(l),t=v.hiddenUpdates,c=t[h],c===null?t[h]=[i]:c.push(i),i.lane=l|536870912),v):null}function os(t){if(50<Ql)throw Ql=0,Vd=null,Error(r(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var Ar={};function mk(t,i,l,c){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rn(t,i,l,c){return new mk(t,i,l,c)}function Pu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ma(t,i){var l=t.alternate;return l===null?(l=Rn(t.tag,i,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=i,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,i=t.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Hm(t,i){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,i=l.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function ss(t,i,l,c,h,v){var w=0;if(c=t,typeof t=="function")Pu(t)&&(w=1);else if(typeof t=="string")w=b2(t,l,ue.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case L:return t=Rn(31,l,i,h),t.elementType=L,t.lanes=v,t;case C:return Gi(l.children,h,v,i);case j:w=8,h|=24;break;case E:return t=Rn(12,l,i,h|2),t.elementType=E,t.lanes=v,t;case U:return t=Rn(13,l,i,h),t.elementType=U,t.lanes=v,t;case _:return t=Rn(19,l,i,h),t.elementType=_,t.lanes=v,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case O:w=10;break e;case R:w=9;break e;case G:w=11;break e;case W:w=14;break e;case H:w=16,c=null;break e}w=29,l=Error(r(130,t===null?"null":typeof t,"")),c=null}return i=Rn(w,l,i,h),i.elementType=t,i.type=c,i.lanes=v,i}function Gi(t,i,l,c){return t=Rn(7,t,c,i),t.lanes=l,t}function Uu(t,i,l){return t=Rn(6,t,null,i),t.lanes=l,t}function $m(t){var i=Rn(18,null,null,0);return i.stateNode=t,i}function Bu(t,i,l){return i=Rn(4,t.children!==null?t.children:[],t.key,i),i.lanes=l,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var qm=new WeakMap;function Yn(t,i){if(typeof t=="object"&&t!==null){var l=qm.get(t);return l!==void 0?l:(i={value:t,source:i,stack:Dt(i)},qm.set(t,i),i)}return{value:t,source:i,stack:Dt(i)}}var jr=[],Tr=0,cs=null,Nl=0,Kn=[],Qn=0,ri=null,ga=1,ya="";function La(t,i){jr[Tr++]=Nl,jr[Tr++]=cs,cs=t,Nl=i}function Fm(t,i,l){Kn[Qn++]=ga,Kn[Qn++]=ya,Kn[Qn++]=ri,ri=t;var c=ga;t=ya;var h=32-ke(c)-1;c&=~(1<<h),l+=1;var v=32-ke(i)+h;if(30<v){var w=h-h%5;v=(c&(1<<w)-1).toString(32),c>>=w,h-=w,ga=1<<32-ke(i)+h|l<<h|c,ya=v+t}else ga=1<<v|l<<h|c,ya=t}function Hu(t){t.return!==null&&(La(t,1),Fm(t,1,0))}function $u(t){for(;t===cs;)cs=jr[--Tr],jr[Tr]=null,Nl=jr[--Tr],jr[Tr]=null;for(;t===ri;)ri=Kn[--Qn],Kn[Qn]=null,ya=Kn[--Qn],Kn[Qn]=null,ga=Kn[--Qn],Kn[Qn]=null}function Gm(t,i){Kn[Qn++]=ga,Kn[Qn++]=ya,Kn[Qn++]=ri,ga=i.id,ya=i.overflow,ri=t}var Jt=null,wt=null,We=!1,li=null,Xn=!1,qu=Error(r(519));function oi(t){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Rl(Yn(i,t)),qu}function Vm(t){var i=t.stateNode,l=t.type,c=t.memoizedProps;switch(i[Se]=t,i[_e]=c,l){case"dialog":$e("cancel",i),$e("close",i);break;case"iframe":case"object":case"embed":$e("load",i);break;case"video":case"audio":for(l=0;l<Zl.length;l++)$e(Zl[l],i);break;case"source":$e("error",i);break;case"img":case"image":case"link":$e("error",i),$e("load",i);break;case"details":$e("toggle",i);break;case"input":$e("invalid",i),rm(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":$e("invalid",i);break;case"textarea":$e("invalid",i),om(i,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||c.suppressHydrationWarning===!0||cv(i.textContent,l)?(c.popover!=null&&($e("beforetoggle",i),$e("toggle",i)),c.onScroll!=null&&$e("scroll",i),c.onScrollEnd!=null&&$e("scrollend",i),c.onClick!=null&&(i.onclick=Oa),i=!0):i=!1,i||oi(t,!0)}function Wm(t){for(Jt=t.return;Jt;)switch(Jt.tag){case 5:case 31:case 13:Xn=!1;return;case 27:case 3:Xn=!0;return;default:Jt=Jt.return}}function Nr(t){if(t!==Jt)return!1;if(!We)return Wm(t),We=!0,!1;var i=t.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||sf(t.type,t.memoizedProps)),l=!l),l&&wt&&oi(t),Wm(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));wt=vv(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));wt=vv(t)}else i===27?(i=wt,wi(t.type)?(t=pf,pf=null,wt=t):wt=i):wt=Jt?Jn(t.stateNode.nextSibling):null;return!0}function Vi(){wt=Jt=null,We=!1}function Fu(){var t=li;return t!==null&&(Cn===null?Cn=t:Cn.push.apply(Cn,t),li=null),t}function Rl(t){li===null?li=[t]:li.push(t)}var Gu=M(null),Wi=null,za=null;function si(t,i,l){N(Gu,i._currentValue),i._currentValue=l}function Ia(t){t._currentValue=Gu.current,Q(Gu)}function Vu(t,i,l){for(;t!==null;){var c=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),t===l)break;t=t.return}}function Wu(t,i,l,c){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var v=h.dependencies;if(v!==null){var w=h.child;v=v.firstContext;e:for(;v!==null;){var A=v;v=h;for(var z=0;z<i.length;z++)if(A.context===i[z]){v.lanes|=l,A=v.alternate,A!==null&&(A.lanes|=l),Vu(v.return,l,t),c||(w=null);break e}v=A.next}}else if(h.tag===18){if(w=h.return,w===null)throw Error(r(341));w.lanes|=l,v=w.alternate,v!==null&&(v.lanes|=l),Vu(w,l,t),w=null}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===t){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}}function Rr(t,i,l,c){t=null;for(var h=i,v=!1;h!==null;){if(!v){if((h.flags&524288)!==0)v=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var w=h.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var A=h.type;Nn(h.pendingProps.value,w.value)||(t!==null?t.push(A):t=[A])}}else if(h===be.current){if(w=h.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(ao):t=[ao])}h=h.return}t!==null&&Wu(i,t,l,c),i.flags|=262144}function us(t){for(t=t.firstContext;t!==null;){if(!Nn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Yi(t){Wi=t,za=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function en(t){return Ym(Wi,t)}function ds(t,i){return Wi===null&&Yi(t),Ym(t,i)}function Ym(t,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},za===null){if(t===null)throw Error(r(308));za=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else za=za.next=i;return l}var gk=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(l,c){t.push(c)}};this.abort=function(){i.aborted=!0,t.forEach(function(l){return l()})}},yk=e.unstable_scheduleCallback,vk=e.unstable_NormalPriority,Lt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yu(){return{controller:new gk,data:new Map,refCount:0}}function _l(t){t.refCount--,t.refCount===0&&yk(vk,function(){t.controller.abort()})}var Ol=null,Ku=0,_r=0,Or=null;function xk(t,i){if(Ol===null){var l=Ol=[];Ku=0,_r=Zd(),Or={status:"pending",value:void 0,then:function(c){l.push(c)}}}return Ku++,i.then(Km,Km),i}function Km(){if(--Ku===0&&Ol!==null){Or!==null&&(Or.status="fulfilled");var t=Ol;Ol=null,_r=0,Or=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function bk(t,i){var l=[],c={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return t.then(function(){c.status="fulfilled",c.value=i;for(var h=0;h<l.length;h++)(0,l[h])(i)},function(h){for(c.status="rejected",c.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),c}var Qm=P.S;P.S=function(t,i){Dy=it(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&xk(t,i),Qm!==null&&Qm(t,i)};var Ki=M(null);function Qu(){var t=Ki.current;return t!==null?t:ht.pooledCache}function fs(t,i){i===null?N(Ki,Ki.current):N(Ki,i.pool)}function Xm(){var t=Qu();return t===null?null:{parent:Lt._currentValue,pool:t}}var Dr=Error(r(460)),Xu=Error(r(474)),ps=Error(r(542)),hs={then:function(){}};function Zm(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Jm(t,i,l){switch(l=t[l],l===void 0?t.push(i):l!==i&&(i.then(Oa,Oa),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,tg(t),t;default:if(typeof i.status=="string")i.then(Oa,Oa);else{if(t=ht,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=i,t.status="pending",t.then(function(c){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=c}},function(c){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,tg(t),t}throw Xi=i,Dr}}function Qi(t){try{var i=t._init;return i(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Xi=l,Dr):l}}var Xi=null;function eg(){if(Xi===null)throw Error(r(459));var t=Xi;return Xi=null,t}function tg(t){if(t===Dr||t===ps)throw Error(r(483))}var Mr=null,Dl=0;function ms(t){var i=Dl;return Dl+=1,Mr===null&&(Mr=[]),Jm(Mr,t,i)}function Ml(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function gs(t,i){throw i.$$typeof===x?Error(r(525)):(t=Object.prototype.toString.call(i),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function ng(t){function i(Y,q){if(t){var J=Y.deletions;J===null?(Y.deletions=[q],Y.flags|=16):J.push(q)}}function l(Y,q){if(!t)return null;for(;q!==null;)i(Y,q),q=q.sibling;return null}function c(Y){for(var q=new Map;Y!==null;)Y.key!==null?q.set(Y.key,Y):q.set(Y.index,Y),Y=Y.sibling;return q}function h(Y,q){return Y=Ma(Y,q),Y.index=0,Y.sibling=null,Y}function v(Y,q,J){return Y.index=J,t?(J=Y.alternate,J!==null?(J=J.index,J<q?(Y.flags|=67108866,q):J):(Y.flags|=67108866,q)):(Y.flags|=1048576,q)}function w(Y){return t&&Y.alternate===null&&(Y.flags|=67108866),Y}function A(Y,q,J,oe){return q===null||q.tag!==6?(q=Uu(J,Y.mode,oe),q.return=Y,q):(q=h(q,J),q.return=Y,q)}function z(Y,q,J,oe){var Ee=J.type;return Ee===C?re(Y,q,J.props.children,oe,J.key):q!==null&&(q.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===H&&Qi(Ee)===q.type)?(q=h(q,J.props),Ml(q,J),q.return=Y,q):(q=ss(J.type,J.key,J.props,null,Y.mode,oe),Ml(q,J),q.return=Y,q)}function ee(Y,q,J,oe){return q===null||q.tag!==4||q.stateNode.containerInfo!==J.containerInfo||q.stateNode.implementation!==J.implementation?(q=Bu(J,Y.mode,oe),q.return=Y,q):(q=h(q,J.children||[]),q.return=Y,q)}function re(Y,q,J,oe,Ee){return q===null||q.tag!==7?(q=Gi(J,Y.mode,oe,Ee),q.return=Y,q):(q=h(q,J),q.return=Y,q)}function ce(Y,q,J){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Uu(""+q,Y.mode,J),q.return=Y,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case b:return J=ss(q.type,q.key,q.props,null,Y.mode,J),Ml(J,q),J.return=Y,J;case k:return q=Bu(q,Y.mode,J),q.return=Y,q;case H:return q=Qi(q),ce(Y,q,J)}if(K(q)||V(q))return q=Gi(q,Y.mode,J,null),q.return=Y,q;if(typeof q.then=="function")return ce(Y,ms(q),J);if(q.$$typeof===O)return ce(Y,ds(Y,q),J);gs(Y,q)}return null}function te(Y,q,J,oe){var Ee=q!==null?q.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Ee!==null?null:A(Y,q,""+J,oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===Ee?z(Y,q,J,oe):null;case k:return J.key===Ee?ee(Y,q,J,oe):null;case H:return J=Qi(J),te(Y,q,J,oe)}if(K(J)||V(J))return Ee!==null?null:re(Y,q,J,oe,null);if(typeof J.then=="function")return te(Y,q,ms(J),oe);if(J.$$typeof===O)return te(Y,q,ds(Y,J),oe);gs(Y,J)}return null}function ae(Y,q,J,oe,Ee){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Y=Y.get(J)||null,A(q,Y,""+oe,Ee);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return Y=Y.get(oe.key===null?J:oe.key)||null,z(q,Y,oe,Ee);case k:return Y=Y.get(oe.key===null?J:oe.key)||null,ee(q,Y,oe,Ee);case H:return oe=Qi(oe),ae(Y,q,J,oe,Ee)}if(K(oe)||V(oe))return Y=Y.get(J)||null,re(q,Y,oe,Ee,null);if(typeof oe.then=="function")return ae(Y,q,J,ms(oe),Ee);if(oe.$$typeof===O)return ae(Y,q,J,ds(q,oe),Ee);gs(q,oe)}return null}function xe(Y,q,J,oe){for(var Ee=null,Ze=null,we=q,ze=q=0,Ge=null;we!==null&&ze<J.length;ze++){we.index>ze?(Ge=we,we=null):Ge=we.sibling;var Je=te(Y,we,J[ze],oe);if(Je===null){we===null&&(we=Ge);break}t&&we&&Je.alternate===null&&i(Y,we),q=v(Je,q,ze),Ze===null?Ee=Je:Ze.sibling=Je,Ze=Je,we=Ge}if(ze===J.length)return l(Y,we),We&&La(Y,ze),Ee;if(we===null){for(;ze<J.length;ze++)we=ce(Y,J[ze],oe),we!==null&&(q=v(we,q,ze),Ze===null?Ee=we:Ze.sibling=we,Ze=we);return We&&La(Y,ze),Ee}for(we=c(we);ze<J.length;ze++)Ge=ae(we,Y,ze,J[ze],oe),Ge!==null&&(t&&Ge.alternate!==null&&we.delete(Ge.key===null?ze:Ge.key),q=v(Ge,q,ze),Ze===null?Ee=Ge:Ze.sibling=Ge,Ze=Ge);return t&&we.forEach(function(Ai){return i(Y,Ai)}),We&&La(Y,ze),Ee}function je(Y,q,J,oe){if(J==null)throw Error(r(151));for(var Ee=null,Ze=null,we=q,ze=q=0,Ge=null,Je=J.next();we!==null&&!Je.done;ze++,Je=J.next()){we.index>ze?(Ge=we,we=null):Ge=we.sibling;var Ai=te(Y,we,Je.value,oe);if(Ai===null){we===null&&(we=Ge);break}t&&we&&Ai.alternate===null&&i(Y,we),q=v(Ai,q,ze),Ze===null?Ee=Ai:Ze.sibling=Ai,Ze=Ai,we=Ge}if(Je.done)return l(Y,we),We&&La(Y,ze),Ee;if(we===null){for(;!Je.done;ze++,Je=J.next())Je=ce(Y,Je.value,oe),Je!==null&&(q=v(Je,q,ze),Ze===null?Ee=Je:Ze.sibling=Je,Ze=Je);return We&&La(Y,ze),Ee}for(we=c(we);!Je.done;ze++,Je=J.next())Je=ae(we,Y,ze,Je.value,oe),Je!==null&&(t&&Je.alternate!==null&&we.delete(Je.key===null?ze:Je.key),q=v(Je,q,ze),Ze===null?Ee=Je:Ze.sibling=Je,Ze=Je);return t&&we.forEach(function(_2){return i(Y,_2)}),We&&La(Y,ze),Ee}function dt(Y,q,J,oe){if(typeof J=="object"&&J!==null&&J.type===C&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case b:e:{for(var Ee=J.key;q!==null;){if(q.key===Ee){if(Ee=J.type,Ee===C){if(q.tag===7){l(Y,q.sibling),oe=h(q,J.props.children),oe.return=Y,Y=oe;break e}}else if(q.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===H&&Qi(Ee)===q.type){l(Y,q.sibling),oe=h(q,J.props),Ml(oe,J),oe.return=Y,Y=oe;break e}l(Y,q);break}else i(Y,q);q=q.sibling}J.type===C?(oe=Gi(J.props.children,Y.mode,oe,J.key),oe.return=Y,Y=oe):(oe=ss(J.type,J.key,J.props,null,Y.mode,oe),Ml(oe,J),oe.return=Y,Y=oe)}return w(Y);case k:e:{for(Ee=J.key;q!==null;){if(q.key===Ee)if(q.tag===4&&q.stateNode.containerInfo===J.containerInfo&&q.stateNode.implementation===J.implementation){l(Y,q.sibling),oe=h(q,J.children||[]),oe.return=Y,Y=oe;break e}else{l(Y,q);break}else i(Y,q);q=q.sibling}oe=Bu(J,Y.mode,oe),oe.return=Y,Y=oe}return w(Y);case H:return J=Qi(J),dt(Y,q,J,oe)}if(K(J))return xe(Y,q,J,oe);if(V(J)){if(Ee=V(J),typeof Ee!="function")throw Error(r(150));return J=Ee.call(J),je(Y,q,J,oe)}if(typeof J.then=="function")return dt(Y,q,ms(J),oe);if(J.$$typeof===O)return dt(Y,q,ds(Y,J),oe);gs(Y,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,q!==null&&q.tag===6?(l(Y,q.sibling),oe=h(q,J),oe.return=Y,Y=oe):(l(Y,q),oe=Uu(J,Y.mode,oe),oe.return=Y,Y=oe),w(Y)):l(Y,q)}return function(Y,q,J,oe){try{Dl=0;var Ee=dt(Y,q,J,oe);return Mr=null,Ee}catch(we){if(we===Dr||we===ps)throw we;var Ze=Rn(29,we,null,Y.mode);return Ze.lanes=oe,Ze.return=Y,Ze}finally{}}}var Zi=ng(!0),ag=ng(!1),ci=!1;function Zu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ju(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ui(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function di(t,i,l){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(tt&2)!==0){var h=c.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),c.pending=i,i=os(t),Bm(t,null,l),i}return ls(t,c,i,l),os(t)}function Ll(t,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var c=i.lanes;c&=t.pendingLanes,l|=c,i.lanes=l,se(t,l)}}function ed(t,i){var l=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var h=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var w={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?h=v=w:v=v.next=w,l=l.next}while(l!==null);v===null?h=v=i:v=v.next=i}else h=v=i;l={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=i:t.next=i,l.lastBaseUpdate=i}var td=!1;function zl(){if(td){var t=Or;if(t!==null)throw t}}function Il(t,i,l,c){td=!1;var h=t.updateQueue;ci=!1;var v=h.firstBaseUpdate,w=h.lastBaseUpdate,A=h.shared.pending;if(A!==null){h.shared.pending=null;var z=A,ee=z.next;z.next=null,w===null?v=ee:w.next=ee,w=z;var re=t.alternate;re!==null&&(re=re.updateQueue,A=re.lastBaseUpdate,A!==w&&(A===null?re.firstBaseUpdate=ee:A.next=ee,re.lastBaseUpdate=z))}if(v!==null){var ce=h.baseState;w=0,re=ee=z=null,A=v;do{var te=A.lane&-536870913,ae=te!==A.lane;if(ae?(Fe&te)===te:(c&te)===te){te!==0&&te===_r&&(td=!0),re!==null&&(re=re.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var xe=t,je=A;te=i;var dt=l;switch(je.tag){case 1:if(xe=je.payload,typeof xe=="function"){ce=xe.call(dt,ce,te);break e}ce=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=je.payload,te=typeof xe=="function"?xe.call(dt,ce,te):xe,te==null)break e;ce=g({},ce,te);break e;case 2:ci=!0}}te=A.callback,te!==null&&(t.flags|=64,ae&&(t.flags|=8192),ae=h.callbacks,ae===null?h.callbacks=[te]:ae.push(te))}else ae={lane:te,tag:A.tag,payload:A.payload,callback:A.callback,next:null},re===null?(ee=re=ae,z=ce):re=re.next=ae,w|=te;if(A=A.next,A===null){if(A=h.shared.pending,A===null)break;ae=A,A=ae.next,ae.next=null,h.lastBaseUpdate=ae,h.shared.pending=null}}while(!0);re===null&&(z=ce),h.baseState=z,h.firstBaseUpdate=ee,h.lastBaseUpdate=re,v===null&&(h.shared.lanes=0),gi|=w,t.lanes=w,t.memoizedState=ce}}function ig(t,i){if(typeof t!="function")throw Error(r(191,t));t.call(i)}function rg(t,i){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)ig(l[t],i)}var Lr=M(null),ys=M(0);function lg(t,i){t=Va,N(ys,t),N(Lr,i),Va=t|i.baseLanes}function nd(){N(ys,Va),N(Lr,Lr.current)}function ad(){Va=ys.current,Q(Lr),Q(ys)}var _n=M(null),Zn=null;function fi(t){var i=t.alternate;N(Rt,Rt.current&1),N(_n,t),Zn===null&&(i===null||Lr.current!==null||i.memoizedState!==null)&&(Zn=t)}function id(t){N(Rt,Rt.current),N(_n,t),Zn===null&&(Zn=t)}function og(t){t.tag===22?(N(Rt,Rt.current),N(_n,t),Zn===null&&(Zn=t)):pi()}function pi(){N(Rt,Rt.current),N(_n,_n.current)}function On(t){Q(_n),Zn===t&&(Zn=null),Q(Rt)}var Rt=M(0);function vs(t){for(var i=t;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||df(l)||ff(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Pa=0,Le=null,ct=null,zt=null,xs=!1,zr=!1,Ji=!1,bs=0,Pl=0,Ir=null,wk=0;function jt(){throw Error(r(321))}function rd(t,i){if(i===null)return!1;for(var l=0;l<i.length&&l<t.length;l++)if(!Nn(t[l],i[l]))return!1;return!0}function ld(t,i,l,c,h,v){return Pa=v,Le=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,P.H=t===null||t.memoizedState===null?Fg:wd,Ji=!1,v=l(c,h),Ji=!1,zr&&(v=cg(i,l,c,h)),sg(t),v}function sg(t){P.H=Hl;var i=ct!==null&&ct.next!==null;if(Pa=0,zt=ct=Le=null,xs=!1,Pl=0,Ir=null,i)throw Error(r(300));t===null||It||(t=t.dependencies,t!==null&&us(t)&&(It=!0))}function cg(t,i,l,c){Le=t;var h=0;do{if(zr&&(Ir=null),Pl=0,zr=!1,25<=h)throw Error(r(301));if(h+=1,zt=ct=null,t.updateQueue!=null){var v=t.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}P.H=Gg,v=i(l,c)}while(zr);return v}function Sk(){var t=P.H,i=t.useState()[0];return i=typeof i.then=="function"?Ul(i):i,t=t.useState()[0],(ct!==null?ct.memoizedState:null)!==t&&(Le.flags|=1024),i}function od(){var t=bs!==0;return bs=0,t}function sd(t,i,l){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~l}function cd(t){if(xs){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}xs=!1}Pa=0,zt=ct=Le=null,zr=!1,Pl=bs=0,Ir=null}function dn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?Le.memoizedState=zt=t:zt=zt.next=t,zt}function _t(){if(ct===null){var t=Le.alternate;t=t!==null?t.memoizedState:null}else t=ct.next;var i=zt===null?Le.memoizedState:zt.next;if(i!==null)zt=i,ct=t;else{if(t===null)throw Le.alternate===null?Error(r(467)):Error(r(310));ct=t,t={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},zt===null?Le.memoizedState=zt=t:zt=zt.next=t}return zt}function ws(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ul(t){var i=Pl;return Pl+=1,Ir===null&&(Ir=[]),t=Jm(Ir,t,i),i=Le,(zt===null?i.memoizedState:zt.next)===null&&(i=i.alternate,P.H=i===null||i.memoizedState===null?Fg:wd),t}function Ss(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ul(t);if(t.$$typeof===O)return en(t)}throw Error(r(438,String(t)))}function ud(t){var i=null,l=Le.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var c=Le.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=ws(),Le.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(t),c=0;c<t;c++)l[c]=T;return i.index++,l}function Ua(t,i){return typeof i=="function"?i(t):i}function ks(t){var i=_t();return dd(i,ct,t)}function dd(t,i,l){var c=t.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=l;var h=t.baseQueue,v=c.pending;if(v!==null){if(h!==null){var w=h.next;h.next=v.next,v.next=w}i.baseQueue=h=v,c.pending=null}if(v=t.baseState,h===null)t.memoizedState=v;else{i=h.next;var A=w=null,z=null,ee=i,re=!1;do{var ce=ee.lane&-536870913;if(ce!==ee.lane?(Fe&ce)===ce:(Pa&ce)===ce){var te=ee.revertLane;if(te===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),ce===_r&&(re=!0);else if((Pa&te)===te){ee=ee.next,te===_r&&(re=!0);continue}else ce={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},z===null?(A=z=ce,w=v):z=z.next=ce,Le.lanes|=te,gi|=te;ce=ee.action,Ji&&l(v,ce),v=ee.hasEagerState?ee.eagerState:l(v,ce)}else te={lane:ce,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},z===null?(A=z=te,w=v):z=z.next=te,Le.lanes|=ce,gi|=ce;ee=ee.next}while(ee!==null&&ee!==i);if(z===null?w=v:z.next=A,!Nn(v,t.memoizedState)&&(It=!0,re&&(l=Or,l!==null)))throw l;t.memoizedState=v,t.baseState=w,t.baseQueue=z,c.lastRenderedState=v}return h===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function fd(t){var i=_t(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var c=l.dispatch,h=l.pending,v=i.memoizedState;if(h!==null){l.pending=null;var w=h=h.next;do v=t(v,w.action),w=w.next;while(w!==h);Nn(v,i.memoizedState)||(It=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),l.lastRenderedState=v}return[v,c]}function ug(t,i,l){var c=Le,h=_t(),v=We;if(v){if(l===void 0)throw Error(r(407));l=l()}else l=i();var w=!Nn((ct||h).memoizedState,l);if(w&&(h.memoizedState=l,It=!0),h=h.queue,md(pg.bind(null,c,h,t),[t]),h.getSnapshot!==i||w||zt!==null&&zt.memoizedState.tag&1){if(c.flags|=2048,Pr(9,{destroy:void 0},fg.bind(null,c,h,l,i),null),ht===null)throw Error(r(349));v||(Pa&127)!==0||dg(c,i,l)}return l}function dg(t,i,l){t.flags|=16384,t={getSnapshot:i,value:l},i=Le.updateQueue,i===null?(i=ws(),Le.updateQueue=i,i.stores=[t]):(l=i.stores,l===null?i.stores=[t]:l.push(t))}function fg(t,i,l,c){i.value=l,i.getSnapshot=c,hg(i)&&mg(t)}function pg(t,i,l){return l(function(){hg(i)&&mg(t)})}function hg(t){var i=t.getSnapshot;t=t.value;try{var l=i();return!Nn(t,l)}catch{return!0}}function mg(t){var i=Fi(t,2);i!==null&&En(i,t,2)}function pd(t){var i=dn();if(typeof t=="function"){var l=t;if(t=l(),Ji){Ve(!0);try{l()}finally{Ve(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:t},i}function gg(t,i,l,c){return t.baseState=l,dd(t,ct,typeof c=="function"?c:Ua)}function kk(t,i,l,c,h){if(As(t))throw Error(r(485));if(t=i.action,t!==null){var v={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};P.T!==null?l(!0):v.isTransition=!1,c(v),l=i.pending,l===null?(v.next=i.pending=v,yg(i,v)):(v.next=l.next,i.pending=l.next=v)}}function yg(t,i){var l=i.action,c=i.payload,h=t.state;if(i.isTransition){var v=P.T,w={};P.T=w;try{var A=l(h,c),z=P.S;z!==null&&z(w,A),vg(t,i,A)}catch(ee){hd(t,i,ee)}finally{v!==null&&w.types!==null&&(v.types=w.types),P.T=v}}else try{v=l(h,c),vg(t,i,v)}catch(ee){hd(t,i,ee)}}function vg(t,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){xg(t,i,c)},function(c){return hd(t,i,c)}):xg(t,i,l)}function xg(t,i,l){i.status="fulfilled",i.value=l,bg(i),t.state=l,i=t.pending,i!==null&&(l=i.next,l===i?t.pending=null:(l=l.next,i.next=l,yg(t,l)))}function hd(t,i,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=l,bg(i),i=i.next;while(i!==c)}t.action=null}function bg(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function wg(t,i){return i}function Sg(t,i){if(We){var l=ht.formState;if(l!==null){e:{var c=Le;if(We){if(wt){t:{for(var h=wt,v=Xn;h.nodeType!==8;){if(!v){h=null;break t}if(h=Jn(h.nextSibling),h===null){h=null;break t}}v=h.data,h=v==="F!"||v==="F"?h:null}if(h){wt=Jn(h.nextSibling),c=h.data==="F!";break e}}oi(c)}c=!1}c&&(i=l[0])}}return l=dn(),l.memoizedState=l.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wg,lastRenderedState:i},l.queue=c,l=Hg.bind(null,Le,c),c.dispatch=l,c=pd(!1),v=bd.bind(null,Le,!1,c.queue),c=dn(),h={state:i,dispatch:null,action:t,pending:null},c.queue=h,l=kk.bind(null,Le,h,v,l),h.dispatch=l,c.memoizedState=t,[i,l,!1]}function kg(t){var i=_t();return Cg(i,ct,t)}function Cg(t,i,l){if(i=dd(t,i,wg)[0],t=ks(Ua)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=Ul(i)}catch(w){throw w===Dr?ps:w}else c=i;i=_t();var h=i.queue,v=h.dispatch;return l!==i.memoizedState&&(Le.flags|=2048,Pr(9,{destroy:void 0},Ck.bind(null,h,l),null)),[c,v,t]}function Ck(t,i){t.action=i}function Eg(t){var i=_t(),l=ct;if(l!==null)return Cg(i,l,t);_t(),i=i.memoizedState,l=_t();var c=l.queue.dispatch;return l.memoizedState=t,[i,c,!1]}function Pr(t,i,l,c){return t={tag:t,create:l,deps:c,inst:i,next:null},i=Le.updateQueue,i===null&&(i=ws(),Le.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=t.next=t:(c=l.next,l.next=t,t.next=c,i.lastEffect=t),t}function Ag(){return _t().memoizedState}function Cs(t,i,l,c){var h=dn();Le.flags|=t,h.memoizedState=Pr(1|i,{destroy:void 0},l,c===void 0?null:c)}function Es(t,i,l,c){var h=_t();c=c===void 0?null:c;var v=h.memoizedState.inst;ct!==null&&c!==null&&rd(c,ct.memoizedState.deps)?h.memoizedState=Pr(i,v,l,c):(Le.flags|=t,h.memoizedState=Pr(1|i,v,l,c))}function jg(t,i){Cs(8390656,8,t,i)}function md(t,i){Es(2048,8,t,i)}function Ek(t){Le.flags|=4;var i=Le.updateQueue;if(i===null)i=ws(),Le.updateQueue=i,i.events=[t];else{var l=i.events;l===null?i.events=[t]:l.push(t)}}function Tg(t){var i=_t().memoizedState;return Ek({ref:i,nextImpl:t}),function(){if((tt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function Ng(t,i){return Es(4,2,t,i)}function Rg(t,i){return Es(4,4,t,i)}function _g(t,i){if(typeof i=="function"){t=t();var l=i(t);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function Og(t,i,l){l=l!=null?l.concat([t]):null,Es(4,4,_g.bind(null,i,t),l)}function gd(){}function Dg(t,i){var l=_t();i=i===void 0?null:i;var c=l.memoizedState;return i!==null&&rd(i,c[1])?c[0]:(l.memoizedState=[t,i],t)}function Mg(t,i){var l=_t();i=i===void 0?null:i;var c=l.memoizedState;if(i!==null&&rd(i,c[1]))return c[0];if(c=t(),Ji){Ve(!0);try{t()}finally{Ve(!1)}}return l.memoizedState=[c,i],c}function yd(t,i,l){return l===void 0||(Pa&1073741824)!==0&&(Fe&261930)===0?t.memoizedState=i:(t.memoizedState=l,t=Ly(),Le.lanes|=t,gi|=t,l)}function Lg(t,i,l,c){return Nn(l,i)?l:Lr.current!==null?(t=yd(t,l,c),Nn(t,i)||(It=!0),t):(Pa&42)===0||(Pa&1073741824)!==0&&(Fe&261930)===0?(It=!0,t.memoizedState=l):(t=Ly(),Le.lanes|=t,gi|=t,i)}function zg(t,i,l,c,h){var v=Z.p;Z.p=v!==0&&8>v?v:8;var w=P.T,A={};P.T=A,bd(t,!1,i,l);try{var z=h(),ee=P.S;if(ee!==null&&ee(A,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var re=bk(z,c);Bl(t,i,re,Ln(t))}else Bl(t,i,c,Ln(t))}catch(ce){Bl(t,i,{then:function(){},status:"rejected",reason:ce},Ln())}finally{Z.p=v,w!==null&&A.types!==null&&(w.types=A.types),P.T=w}}function Ak(){}function vd(t,i,l,c){if(t.tag!==5)throw Error(r(476));var h=Ig(t).queue;zg(t,h,i,ne,l===null?Ak:function(){return Pg(t),l(c)})}function Ig(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:ne},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:l},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function Pg(t){var i=Ig(t);i.next===null&&(i=t.alternate.memoizedState),Bl(t,i.next.queue,{},Ln())}function xd(){return en(ao)}function Ug(){return _t().memoizedState}function Bg(){return _t().memoizedState}function jk(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var l=Ln();t=ui(l);var c=di(i,t,l);c!==null&&(En(c,i,l),Ll(c,i,l)),i={cache:Yu()},t.payload=i;return}i=i.return}}function Tk(t,i,l){var c=Ln();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},As(t)?$g(i,l):(l=Iu(t,i,l,c),l!==null&&(En(l,t,c),qg(l,i,c)))}function Hg(t,i,l){var c=Ln();Bl(t,i,l,c)}function Bl(t,i,l,c){var h={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(As(t))$g(i,h);else{var v=t.alternate;if(t.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var w=i.lastRenderedState,A=v(w,l);if(h.hasEagerState=!0,h.eagerState=A,Nn(A,w))return ls(t,i,h,0),ht===null&&rs(),!1}catch{}finally{}if(l=Iu(t,i,h,c),l!==null)return En(l,t,c),qg(l,i,c),!0}return!1}function bd(t,i,l,c){if(c={lane:2,revertLane:Zd(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},As(t)){if(i)throw Error(r(479))}else i=Iu(t,l,c,2),i!==null&&En(i,t,2)}function As(t){var i=t.alternate;return t===Le||i!==null&&i===Le}function $g(t,i){zr=xs=!0;var l=t.pending;l===null?i.next=i:(i.next=l.next,l.next=i),t.pending=i}function qg(t,i,l){if((l&4194048)!==0){var c=i.lanes;c&=t.pendingLanes,l|=c,i.lanes=l,se(t,l)}}var Hl={readContext:en,use:Ss,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};Hl.useEffectEvent=jt;var Fg={readContext:en,use:Ss,useCallback:function(t,i){return dn().memoizedState=[t,i===void 0?null:i],t},useContext:en,useEffect:jg,useImperativeHandle:function(t,i,l){l=l!=null?l.concat([t]):null,Cs(4194308,4,_g.bind(null,i,t),l)},useLayoutEffect:function(t,i){return Cs(4194308,4,t,i)},useInsertionEffect:function(t,i){Cs(4,2,t,i)},useMemo:function(t,i){var l=dn();i=i===void 0?null:i;var c=t();if(Ji){Ve(!0);try{t()}finally{Ve(!1)}}return l.memoizedState=[c,i],c},useReducer:function(t,i,l){var c=dn();if(l!==void 0){var h=l(i);if(Ji){Ve(!0);try{l(i)}finally{Ve(!1)}}}else h=i;return c.memoizedState=c.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},c.queue=t,t=t.dispatch=Tk.bind(null,Le,t),[c.memoizedState,t]},useRef:function(t){var i=dn();return t={current:t},i.memoizedState=t},useState:function(t){t=pd(t);var i=t.queue,l=Hg.bind(null,Le,i);return i.dispatch=l,[t.memoizedState,l]},useDebugValue:gd,useDeferredValue:function(t,i){var l=dn();return yd(l,t,i)},useTransition:function(){var t=pd(!1);return t=zg.bind(null,Le,t.queue,!0,!1),dn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,l){var c=Le,h=dn();if(We){if(l===void 0)throw Error(r(407));l=l()}else{if(l=i(),ht===null)throw Error(r(349));(Fe&127)!==0||dg(c,i,l)}h.memoizedState=l;var v={value:l,getSnapshot:i};return h.queue=v,jg(pg.bind(null,c,v,t),[t]),c.flags|=2048,Pr(9,{destroy:void 0},fg.bind(null,c,v,l,i),null),l},useId:function(){var t=dn(),i=ht.identifierPrefix;if(We){var l=ya,c=ga;l=(c&~(1<<32-ke(c)-1)).toString(32)+l,i="_"+i+"R_"+l,l=bs++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=wk++,i="_"+i+"r_"+l.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:xd,useFormState:Sg,useActionState:Sg,useOptimistic:function(t){var i=dn();i.memoizedState=i.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=bd.bind(null,Le,!0,l),l.dispatch=i,[t,i]},useMemoCache:ud,useCacheRefresh:function(){return dn().memoizedState=jk.bind(null,Le)},useEffectEvent:function(t){var i=dn(),l={impl:t};return i.memoizedState=l,function(){if((tt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},wd={readContext:en,use:Ss,useCallback:Dg,useContext:en,useEffect:md,useImperativeHandle:Og,useInsertionEffect:Ng,useLayoutEffect:Rg,useMemo:Mg,useReducer:ks,useRef:Ag,useState:function(){return ks(Ua)},useDebugValue:gd,useDeferredValue:function(t,i){var l=_t();return Lg(l,ct.memoizedState,t,i)},useTransition:function(){var t=ks(Ua)[0],i=_t().memoizedState;return[typeof t=="boolean"?t:Ul(t),i]},useSyncExternalStore:ug,useId:Ug,useHostTransitionStatus:xd,useFormState:kg,useActionState:kg,useOptimistic:function(t,i){var l=_t();return gg(l,ct,t,i)},useMemoCache:ud,useCacheRefresh:Bg};wd.useEffectEvent=Tg;var Gg={readContext:en,use:Ss,useCallback:Dg,useContext:en,useEffect:md,useImperativeHandle:Og,useInsertionEffect:Ng,useLayoutEffect:Rg,useMemo:Mg,useReducer:fd,useRef:Ag,useState:function(){return fd(Ua)},useDebugValue:gd,useDeferredValue:function(t,i){var l=_t();return ct===null?yd(l,t,i):Lg(l,ct.memoizedState,t,i)},useTransition:function(){var t=fd(Ua)[0],i=_t().memoizedState;return[typeof t=="boolean"?t:Ul(t),i]},useSyncExternalStore:ug,useId:Ug,useHostTransitionStatus:xd,useFormState:Eg,useActionState:Eg,useOptimistic:function(t,i){var l=_t();return ct!==null?gg(l,ct,t,i):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:ud,useCacheRefresh:Bg};Gg.useEffectEvent=Tg;function Sd(t,i,l,c){i=t.memoizedState,l=l(c,i),l=l==null?i:g({},i,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var kd={enqueueSetState:function(t,i,l){t=t._reactInternals;var c=Ln(),h=ui(c);h.payload=i,l!=null&&(h.callback=l),i=di(t,h,c),i!==null&&(En(i,t,c),Ll(i,t,c))},enqueueReplaceState:function(t,i,l){t=t._reactInternals;var c=Ln(),h=ui(c);h.tag=1,h.payload=i,l!=null&&(h.callback=l),i=di(t,h,c),i!==null&&(En(i,t,c),Ll(i,t,c))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var l=Ln(),c=ui(l);c.tag=2,i!=null&&(c.callback=i),i=di(t,c,l),i!==null&&(En(i,t,l),Ll(i,t,l))}};function Vg(t,i,l,c,h,v,w){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,v,w):i.prototype&&i.prototype.isPureReactComponent?!jl(l,c)||!jl(h,v):!0}function Wg(t,i,l,c){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,c),i.state!==t&&kd.enqueueReplaceState(i,i.state,null)}function er(t,i){var l=i;if("ref"in i){l={};for(var c in i)c!=="ref"&&(l[c]=i[c])}if(t=t.defaultProps){l===i&&(l=g({},l));for(var h in t)l[h]===void 0&&(l[h]=t[h])}return l}function Yg(t){is(t)}function Kg(t){console.error(t)}function Qg(t){is(t)}function js(t,i){try{var l=t.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function Xg(t,i,l){try{var c=t.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Cd(t,i,l){return l=ui(l),l.tag=3,l.payload={element:null},l.callback=function(){js(t,i)},l}function Zg(t){return t=ui(t),t.tag=3,t}function Jg(t,i,l,c){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var v=c.value;t.payload=function(){return h(v)},t.callback=function(){Xg(i,l,c)}}var w=l.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(t.callback=function(){Xg(i,l,c),typeof h!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var A=c.stack;this.componentDidCatch(c.value,{componentStack:A!==null?A:""})})}function Nk(t,i,l,c,h){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=l.alternate,i!==null&&Rr(i,l,h,!0),l=_n.current,l!==null){switch(l.tag){case 31:case 13:return Zn===null?Us():l.alternate===null&&Tt===0&&(Tt=3),l.flags&=-257,l.flags|=65536,l.lanes=h,c===hs?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([c]):i.add(c),Kd(t,c,h)),!1;case 22:return l.flags|=65536,c===hs?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([c]):l.add(c)),Kd(t,c,h)),!1}throw Error(r(435,l.tag))}return Kd(t,c,h),Us(),!1}if(We)return i=_n.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,c!==qu&&(t=Error(r(422),{cause:c}),Rl(Yn(t,l)))):(c!==qu&&(i=Error(r(423),{cause:c}),Rl(Yn(i,l))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,c=Yn(c,l),h=Cd(t.stateNode,c,h),ed(t,h),Tt!==4&&(Tt=2)),!1;var v=Error(r(520),{cause:c});if(v=Yn(v,l),Kl===null?Kl=[v]:Kl.push(v),Tt!==4&&(Tt=2),i===null)return!0;c=Yn(c,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,t=h&-h,l.lanes|=t,t=Cd(l.stateNode,c,t),ed(l,t),!1;case 1:if(i=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(yi===null||!yi.has(v))))return l.flags|=65536,h&=-h,l.lanes|=h,h=Zg(h),Jg(h,t,l,c),ed(l,h),!1}l=l.return}while(l!==null);return!1}var Ed=Error(r(461)),It=!1;function tn(t,i,l,c){i.child=t===null?ag(i,null,l,c):Zi(i,t.child,l,c)}function ey(t,i,l,c,h){l=l.render;var v=i.ref;if("ref"in c){var w={};for(var A in c)A!=="ref"&&(w[A]=c[A])}else w=c;return Yi(i),c=ld(t,i,l,w,v,h),A=od(),t!==null&&!It?(sd(t,i,h),Ba(t,i,h)):(We&&A&&Hu(i),i.flags|=1,tn(t,i,c,h),i.child)}function ty(t,i,l,c,h){if(t===null){var v=l.type;return typeof v=="function"&&!Pu(v)&&v.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=v,ny(t,i,v,c,h)):(t=ss(l.type,null,c,i,i.mode,h),t.ref=i.ref,t.return=i,i.child=t)}if(v=t.child,!Dd(t,h)){var w=v.memoizedProps;if(l=l.compare,l=l!==null?l:jl,l(w,c)&&t.ref===i.ref)return Ba(t,i,h)}return i.flags|=1,t=Ma(v,c),t.ref=i.ref,t.return=i,i.child=t}function ny(t,i,l,c,h){if(t!==null){var v=t.memoizedProps;if(jl(v,c)&&t.ref===i.ref)if(It=!1,i.pendingProps=c=v,Dd(t,h))(t.flags&131072)!==0&&(It=!0);else return i.lanes=t.lanes,Ba(t,i,h)}return Ad(t,i,l,c,h)}function ay(t,i,l,c){var h=c.children,v=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,t!==null){for(c=i.child=t.child,h=0;c!==null;)h=h|c.lanes|c.childLanes,c=c.sibling;c=h&~v}else c=0,i.child=null;return iy(t,i,v,l,c)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&fs(i,v!==null?v.cachePool:null),v!==null?lg(i,v):nd(),og(i);else return c=i.lanes=536870912,iy(t,i,v!==null?v.baseLanes|l:l,l,c)}else v!==null?(fs(i,v.cachePool),lg(i,v),pi(),i.memoizedState=null):(t!==null&&fs(i,null),nd(),pi());return tn(t,i,h,l),i.child}function $l(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function iy(t,i,l,c,h){var v=Qu();return v=v===null?null:{parent:Lt._currentValue,pool:v},i.memoizedState={baseLanes:l,cachePool:v},t!==null&&fs(i,null),nd(),og(i),t!==null&&Rr(t,i,c,!0),i.childLanes=h,null}function Ts(t,i){return i=Rs({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function ry(t,i,l){return Zi(i,t.child,null,l),t=Ts(i,i.pendingProps),t.flags|=2,On(i),i.memoizedState=null,t}function Rk(t,i,l){var c=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(We){if(c.mode==="hidden")return t=Ts(i,c),i.lanes=536870912,$l(null,t);if(id(i),(t=wt)?(t=yv(t,Xn),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ri!==null?{id:ga,overflow:ya}:null,retryLane:536870912,hydrationErrors:null},l=$m(t),l.return=i,i.child=l,Jt=i,wt=null)):t=null,t===null)throw oi(i);return i.lanes=536870912,null}return Ts(i,c)}var v=t.memoizedState;if(v!==null){var w=v.dehydrated;if(id(i),h)if(i.flags&256)i.flags&=-257,i=ry(t,i,l);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(r(558));else if(It||Rr(t,i,l,!1),h=(l&t.childLanes)!==0,It||h){if(c=ht,c!==null&&(w=ve(c,l),w!==0&&w!==v.retryLane))throw v.retryLane=w,Fi(t,w),En(c,t,w),Ed;Us(),i=ry(t,i,l)}else t=v.treeContext,wt=Jn(w.nextSibling),Jt=i,We=!0,li=null,Xn=!1,t!==null&&Gm(i,t),i=Ts(i,c),i.flags|=4096;return i}return t=Ma(t.child,{mode:c.mode,children:c.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Ns(t,i){var l=i.ref;if(l===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(t===null||t.ref!==l)&&(i.flags|=4194816)}}function Ad(t,i,l,c,h){return Yi(i),l=ld(t,i,l,c,void 0,h),c=od(),t!==null&&!It?(sd(t,i,h),Ba(t,i,h)):(We&&c&&Hu(i),i.flags|=1,tn(t,i,l,h),i.child)}function ly(t,i,l,c,h,v){return Yi(i),i.updateQueue=null,l=cg(i,c,l,h),sg(t),c=od(),t!==null&&!It?(sd(t,i,v),Ba(t,i,v)):(We&&c&&Hu(i),i.flags|=1,tn(t,i,l,v),i.child)}function oy(t,i,l,c,h){if(Yi(i),i.stateNode===null){var v=Ar,w=l.contextType;typeof w=="object"&&w!==null&&(v=en(w)),v=new l(c,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=kd,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=c,v.state=i.memoizedState,v.refs={},Zu(i),w=l.contextType,v.context=typeof w=="object"&&w!==null?en(w):Ar,v.state=i.memoizedState,w=l.getDerivedStateFromProps,typeof w=="function"&&(Sd(i,l,w,c),v.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&kd.enqueueReplaceState(v,v.state,null),Il(i,c,v,h),zl(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(t===null){v=i.stateNode;var A=i.memoizedProps,z=er(l,A);v.props=z;var ee=v.context,re=l.contextType;w=Ar,typeof re=="object"&&re!==null&&(w=en(re));var ce=l.getDerivedStateFromProps;re=typeof ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",A=i.pendingProps!==A,re||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(A||ee!==w)&&Wg(i,v,c,w),ci=!1;var te=i.memoizedState;v.state=te,Il(i,c,v,h),zl(),ee=i.memoizedState,A||te!==ee||ci?(typeof ce=="function"&&(Sd(i,l,ce,c),ee=i.memoizedState),(z=ci||Vg(i,l,z,c,te,ee,w))?(re||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=ee),v.props=c,v.state=ee,v.context=w,c=z):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{v=i.stateNode,Ju(t,i),w=i.memoizedProps,re=er(l,w),v.props=re,ce=i.pendingProps,te=v.context,ee=l.contextType,z=Ar,typeof ee=="object"&&ee!==null&&(z=en(ee)),A=l.getDerivedStateFromProps,(ee=typeof A=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==ce||te!==z)&&Wg(i,v,c,z),ci=!1,te=i.memoizedState,v.state=te,Il(i,c,v,h),zl();var ae=i.memoizedState;w!==ce||te!==ae||ci||t!==null&&t.dependencies!==null&&us(t.dependencies)?(typeof A=="function"&&(Sd(i,l,A,c),ae=i.memoizedState),(re=ci||Vg(i,l,re,c,te,ae,z)||t!==null&&t.dependencies!==null&&us(t.dependencies))?(ee||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,ae,z),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,ae,z)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=ae),v.props=c,v.state=ae,v.context=z,c=re):(typeof v.componentDidUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(i.flags|=1024),c=!1)}return v=c,Ns(t,i),c=(i.flags&128)!==0,v||c?(v=i.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,t!==null&&c?(i.child=Zi(i,t.child,null,h),i.child=Zi(i,null,l,h)):tn(t,i,l,h),i.memoizedState=v.state,t=i.child):t=Ba(t,i,h),t}function sy(t,i,l,c){return Vi(),i.flags|=256,tn(t,i,l,c),i.child}var jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Td(t){return{baseLanes:t,cachePool:Xm()}}function Nd(t,i,l){return t=t!==null?t.childLanes&~l:0,i&&(t|=Mn),t}function cy(t,i,l){var c=i.pendingProps,h=!1,v=(i.flags&128)!==0,w;if((w=v)||(w=t!==null&&t.memoizedState===null?!1:(Rt.current&2)!==0),w&&(h=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,t===null){if(We){if(h?fi(i):pi(),(t=wt)?(t=yv(t,Xn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ri!==null?{id:ga,overflow:ya}:null,retryLane:536870912,hydrationErrors:null},l=$m(t),l.return=i,i.child=l,Jt=i,wt=null)):t=null,t===null)throw oi(i);return ff(t)?i.lanes=32:i.lanes=536870912,null}var A=c.children;return c=c.fallback,h?(pi(),h=i.mode,A=Rs({mode:"hidden",children:A},h),c=Gi(c,h,l,null),A.return=i,c.return=i,A.sibling=c,i.child=A,c=i.child,c.memoizedState=Td(l),c.childLanes=Nd(t,w,l),i.memoizedState=jd,$l(null,c)):(fi(i),Rd(i,A))}var z=t.memoizedState;if(z!==null&&(A=z.dehydrated,A!==null)){if(v)i.flags&256?(fi(i),i.flags&=-257,i=_d(t,i,l)):i.memoizedState!==null?(pi(),i.child=t.child,i.flags|=128,i=null):(pi(),A=c.fallback,h=i.mode,c=Rs({mode:"visible",children:c.children},h),A=Gi(A,h,l,null),A.flags|=2,c.return=i,A.return=i,c.sibling=A,i.child=c,Zi(i,t.child,null,l),c=i.child,c.memoizedState=Td(l),c.childLanes=Nd(t,w,l),i.memoizedState=jd,i=$l(null,c));else if(fi(i),ff(A)){if(w=A.nextSibling&&A.nextSibling.dataset,w)var ee=w.dgst;w=ee,c=Error(r(419)),c.stack="",c.digest=w,Rl({value:c,source:null,stack:null}),i=_d(t,i,l)}else if(It||Rr(t,i,l,!1),w=(l&t.childLanes)!==0,It||w){if(w=ht,w!==null&&(c=ve(w,l),c!==0&&c!==z.retryLane))throw z.retryLane=c,Fi(t,c),En(w,t,c),Ed;df(A)||Us(),i=_d(t,i,l)}else df(A)?(i.flags|=192,i.child=t.child,i=null):(t=z.treeContext,wt=Jn(A.nextSibling),Jt=i,We=!0,li=null,Xn=!1,t!==null&&Gm(i,t),i=Rd(i,c.children),i.flags|=4096);return i}return h?(pi(),A=c.fallback,h=i.mode,z=t.child,ee=z.sibling,c=Ma(z,{mode:"hidden",children:c.children}),c.subtreeFlags=z.subtreeFlags&65011712,ee!==null?A=Ma(ee,A):(A=Gi(A,h,l,null),A.flags|=2),A.return=i,c.return=i,c.sibling=A,i.child=c,$l(null,c),c=i.child,A=t.child.memoizedState,A===null?A=Td(l):(h=A.cachePool,h!==null?(z=Lt._currentValue,h=h.parent!==z?{parent:z,pool:z}:h):h=Xm(),A={baseLanes:A.baseLanes|l,cachePool:h}),c.memoizedState=A,c.childLanes=Nd(t,w,l),i.memoizedState=jd,$l(t.child,c)):(fi(i),l=t.child,t=l.sibling,l=Ma(l,{mode:"visible",children:c.children}),l.return=i,l.sibling=null,t!==null&&(w=i.deletions,w===null?(i.deletions=[t],i.flags|=16):w.push(t)),i.child=l,i.memoizedState=null,l)}function Rd(t,i){return i=Rs({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Rs(t,i){return t=Rn(22,t,null,i),t.lanes=0,t}function _d(t,i,l){return Zi(i,t.child,null,l),t=Rd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function uy(t,i,l){t.lanes|=i;var c=t.alternate;c!==null&&(c.lanes|=i),Vu(t.return,i,l)}function Od(t,i,l,c,h,v){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:h,treeForkCount:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=l,w.tailMode=h,w.treeForkCount=v)}function dy(t,i,l){var c=i.pendingProps,h=c.revealOrder,v=c.tail;c=c.children;var w=Rt.current,A=(w&2)!==0;if(A?(w=w&1|2,i.flags|=128):w&=1,N(Rt,w),tn(t,i,c,l),c=We?Nl:0,!A&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&uy(t,l,i);else if(t.tag===19)uy(t,l,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(l=i.child,h=null;l!==null;)t=l.alternate,t!==null&&vs(t)===null&&(h=l),l=l.sibling;l=h,l===null?(h=i.child,i.child=null):(h=l.sibling,l.sibling=null),Od(i,!1,h,l,v,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=i.child,i.child=null;h!==null;){if(t=h.alternate,t!==null&&vs(t)===null){i.child=h;break}t=h.sibling,h.sibling=l,l=h,h=t}Od(i,!0,l,null,v,c);break;case"together":Od(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function Ba(t,i,l){if(t!==null&&(i.dependencies=t.dependencies),gi|=i.lanes,(l&i.childLanes)===0)if(t!==null){if(Rr(t,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(r(153));if(i.child!==null){for(t=i.child,l=Ma(t,t.pendingProps),i.child=l,l.return=i;t.sibling!==null;)t=t.sibling,l=l.sibling=Ma(t,t.pendingProps),l.return=i;l.sibling=null}return i.child}function Dd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&us(t)))}function _k(t,i,l){switch(i.tag){case 3:Oe(i,i.stateNode.containerInfo),si(i,Lt,t.memoizedState.cache),Vi();break;case 27:case 5:et(i);break;case 4:Oe(i,i.stateNode.containerInfo);break;case 10:si(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,id(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(fi(i),i.flags|=128,null):(l&i.child.childLanes)!==0?cy(t,i,l):(fi(i),t=Ba(t,i,l),t!==null?t.sibling:null);fi(i);break;case 19:var h=(t.flags&128)!==0;if(c=(l&i.childLanes)!==0,c||(Rr(t,i,l,!1),c=(l&i.childLanes)!==0),h){if(c)return dy(t,i,l);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),N(Rt,Rt.current),c)break;return null;case 22:return i.lanes=0,ay(t,i,l,i.pendingProps);case 24:si(i,Lt,t.memoizedState.cache)}return Ba(t,i,l)}function fy(t,i,l){if(t!==null)if(t.memoizedProps!==i.pendingProps)It=!0;else{if(!Dd(t,l)&&(i.flags&128)===0)return It=!1,_k(t,i,l);It=(t.flags&131072)!==0}else It=!1,We&&(i.flags&1048576)!==0&&Fm(i,Nl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(t=Qi(i.elementType),i.type=t,typeof t=="function")Pu(t)?(c=er(t,c),i.tag=1,i=oy(null,i,t,c,l)):(i.tag=0,i=Ad(null,i,t,c,l));else{if(t!=null){var h=t.$$typeof;if(h===G){i.tag=11,i=ey(null,i,t,c,l);break e}else if(h===W){i.tag=14,i=ty(null,i,t,c,l);break e}}throw i=B(t)||t,Error(r(306,i,""))}}return i;case 0:return Ad(t,i,i.type,i.pendingProps,l);case 1:return c=i.type,h=er(c,i.pendingProps),oy(t,i,c,h,l);case 3:e:{if(Oe(i,i.stateNode.containerInfo),t===null)throw Error(r(387));c=i.pendingProps;var v=i.memoizedState;h=v.element,Ju(t,i),Il(i,c,null,l);var w=i.memoizedState;if(c=w.cache,si(i,Lt,c),c!==v.cache&&Wu(i,[Lt],l,!0),zl(),c=w.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=sy(t,i,c,l);break e}else if(c!==h){h=Yn(Error(r(424)),i),Rl(h),i=sy(t,i,c,l);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(wt=Jn(t.firstChild),Jt=i,We=!0,li=null,Xn=!0,l=ag(i,null,c,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Vi(),c===h){i=Ba(t,i,l);break e}tn(t,i,c,l)}i=i.child}return i;case 26:return Ns(t,i),t===null?(l=kv(i.type,null,i.pendingProps,null))?i.memoizedState=l:We||(l=i.type,t=i.pendingProps,c=Vs(he.current).createElement(l),c[Se]=i,c[_e]=t,nn(c,l,t),At(c),i.stateNode=c):i.memoizedState=kv(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return et(i),t===null&&We&&(c=i.stateNode=bv(i.type,i.pendingProps,he.current),Jt=i,Xn=!0,h=wt,wi(i.type)?(pf=h,wt=Jn(c.firstChild)):wt=h),tn(t,i,i.pendingProps.children,l),Ns(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&We&&((h=c=wt)&&(c=o2(c,i.type,i.pendingProps,Xn),c!==null?(i.stateNode=c,Jt=i,wt=Jn(c.firstChild),Xn=!1,h=!0):h=!1),h||oi(i)),et(i),h=i.type,v=i.pendingProps,w=t!==null?t.memoizedProps:null,c=v.children,sf(h,v)?c=null:w!==null&&sf(h,w)&&(i.flags|=32),i.memoizedState!==null&&(h=ld(t,i,Sk,null,null,l),ao._currentValue=h),Ns(t,i),tn(t,i,c,l),i.child;case 6:return t===null&&We&&((t=l=wt)&&(l=s2(l,i.pendingProps,Xn),l!==null?(i.stateNode=l,Jt=i,wt=null,t=!0):t=!1),t||oi(i)),null;case 13:return cy(t,i,l);case 4:return Oe(i,i.stateNode.containerInfo),c=i.pendingProps,t===null?i.child=Zi(i,null,c,l):tn(t,i,c,l),i.child;case 11:return ey(t,i,i.type,i.pendingProps,l);case 7:return tn(t,i,i.pendingProps,l),i.child;case 8:return tn(t,i,i.pendingProps.children,l),i.child;case 12:return tn(t,i,i.pendingProps.children,l),i.child;case 10:return c=i.pendingProps,si(i,i.type,c.value),tn(t,i,c.children,l),i.child;case 9:return h=i.type._context,c=i.pendingProps.children,Yi(i),h=en(h),c=c(h),i.flags|=1,tn(t,i,c,l),i.child;case 14:return ty(t,i,i.type,i.pendingProps,l);case 15:return ny(t,i,i.type,i.pendingProps,l);case 19:return dy(t,i,l);case 31:return Rk(t,i,l);case 22:return ay(t,i,l,i.pendingProps);case 24:return Yi(i),c=en(Lt),t===null?(h=Qu(),h===null&&(h=ht,v=Yu(),h.pooledCache=v,v.refCount++,v!==null&&(h.pooledCacheLanes|=l),h=v),i.memoizedState={parent:c,cache:h},Zu(i),si(i,Lt,h)):((t.lanes&l)!==0&&(Ju(t,i),Il(i,null,null,l),zl()),h=t.memoizedState,v=i.memoizedState,h.parent!==c?(h={parent:c,cache:c},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),si(i,Lt,c)):(c=v.cache,si(i,Lt,c),c!==h.cache&&Wu(i,[Lt],l,!0))),tn(t,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function Ha(t){t.flags|=4}function Md(t,i,l,c,h){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Uy())t.flags|=8192;else throw Xi=hs,Xu}else t.flags&=-16777217}function py(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Tv(i))if(Uy())t.flags|=8192;else throw Xi=hs,Xu}function _s(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Vo():536870912,t.lanes|=i,$r|=i)}function ql(t,i){if(!We)switch(t.tailMode){case"hidden":i=t.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function St(t){var i=t.alternate!==null&&t.alternate.child===t.child,l=0,c=0;if(i)for(var h=t.child;h!==null;)l|=h.lanes|h.childLanes,c|=h.subtreeFlags&65011712,c|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)l|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=c,t.childLanes=l,i}function Ok(t,i,l){var c=i.pendingProps;switch($u(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(i),null;case 1:return St(i),null;case 3:return l=i.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Ia(Lt),Ne(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(Nr(i)?Ha(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Fu())),St(i),null;case 26:var h=i.type,v=i.memoizedState;return t===null?(Ha(i),v!==null?(St(i),py(i,v)):(St(i),Md(i,h,null,c,l))):v?v!==t.memoizedState?(Ha(i),St(i),py(i,v)):(St(i),i.flags&=-16777217):(t=t.memoizedProps,t!==c&&Ha(i),St(i),Md(i,h,t,c,l)),null;case 27:if(Ot(i),l=he.current,h=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==c&&Ha(i);else{if(!c){if(i.stateNode===null)throw Error(r(166));return St(i),null}t=ue.current,Nr(i)?Vm(i):(t=bv(h,c,l),i.stateNode=t,Ha(i))}return St(i),null;case 5:if(Ot(i),h=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==c&&Ha(i);else{if(!c){if(i.stateNode===null)throw Error(r(166));return St(i),null}if(v=ue.current,Nr(i))Vm(i);else{var w=Vs(he.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?w.createElement(h,{is:c.is}):w.createElement(h)}}v[Se]=i,v[_e]=c;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=v;e:switch(nn(v,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Ha(i)}}return St(i),Md(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,l),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==c&&Ha(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(r(166));if(t=he.current,Nr(i)){if(t=i.stateNode,l=i.memoizedProps,c=null,h=Jt,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}t[Se]=i,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||cv(t.nodeValue,l)),t||oi(i,!0)}else t=Vs(t).createTextNode(c),t[Se]=i,i.stateNode=t}return St(i),null;case 31:if(l=i.memoizedState,t===null||t.memoizedState!==null){if(c=Nr(i),l!==null){if(t===null){if(!c)throw Error(r(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Se]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;St(i),t=!1}else l=Fu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return i.flags&256?(On(i),i):(On(i),null);if((i.flags&128)!==0)throw Error(r(558))}return St(i),null;case 13:if(c=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Nr(i),c!==null&&c.dehydrated!==null){if(t===null){if(!h)throw Error(r(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[Se]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;St(i),h=!1}else h=Fu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(On(i),i):(On(i),null)}return On(i),(i.flags&128)!==0?(i.lanes=l,i):(l=c!==null,t=t!==null&&t.memoizedState!==null,l&&(c=i.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==h&&(c.flags|=2048)),l!==t&&l&&(i.child.flags|=8192),_s(i,i.updateQueue),St(i),null);case 4:return Ne(),t===null&&nf(i.stateNode.containerInfo),St(i),null;case 10:return Ia(i.type),St(i),null;case 19:if(Q(Rt),c=i.memoizedState,c===null)return St(i),null;if(h=(i.flags&128)!==0,v=c.rendering,v===null)if(h)ql(c,!1);else{if(Tt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(v=vs(t),v!==null){for(i.flags|=128,ql(c,!1),t=v.updateQueue,i.updateQueue=t,_s(i,t),i.subtreeFlags=0,t=l,l=i.child;l!==null;)Hm(l,t),l=l.sibling;return N(Rt,Rt.current&1|2),We&&La(i,c.treeForkCount),i.child}t=t.sibling}c.tail!==null&&it()>zs&&(i.flags|=128,h=!0,ql(c,!1),i.lanes=4194304)}else{if(!h)if(t=vs(v),t!==null){if(i.flags|=128,h=!0,t=t.updateQueue,i.updateQueue=t,_s(i,t),ql(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!We)return St(i),null}else 2*it()-c.renderingStartTime>zs&&l!==536870912&&(i.flags|=128,h=!0,ql(c,!1),i.lanes=4194304);c.isBackwards?(v.sibling=i.child,i.child=v):(t=c.last,t!==null?t.sibling=v:i.child=v,c.last=v)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=it(),t.sibling=null,l=Rt.current,N(Rt,h?l&1|2:l&1),We&&La(i,c.treeForkCount),t):(St(i),null);case 22:case 23:return On(i),ad(),c=i.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(l&536870912)!==0&&(i.flags&128)===0&&(St(i),i.subtreeFlags&6&&(i.flags|=8192)):St(i),l=i.updateQueue,l!==null&&_s(i,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==l&&(i.flags|=2048),t!==null&&Q(Ki),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ia(Lt),St(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function Dk(t,i){switch($u(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return Ia(Lt),Ne(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Ot(i),null;case 31:if(i.memoizedState!==null){if(On(i),i.alternate===null)throw Error(r(340));Vi()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(On(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Vi()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return Q(Rt),null;case 4:return Ne(),null;case 10:return Ia(i.type),null;case 22:case 23:return On(i),ad(),t!==null&&Q(Ki),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return Ia(Lt),null;case 25:return null;default:return null}}function hy(t,i){switch($u(i),i.tag){case 3:Ia(Lt),Ne();break;case 26:case 27:case 5:Ot(i);break;case 4:Ne();break;case 31:i.memoizedState!==null&&On(i);break;case 13:On(i);break;case 19:Q(Rt);break;case 10:Ia(i.type);break;case 22:case 23:On(i),ad(),t!==null&&Q(Ki);break;case 24:Ia(Lt)}}function Fl(t,i){try{var l=i.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var h=c.next;l=h;do{if((l.tag&t)===t){c=void 0;var v=l.create,w=l.inst;c=v(),w.destroy=c}l=l.next}while(l!==h)}}catch(A){st(i,i.return,A)}}function hi(t,i,l){try{var c=i.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var v=h.next;c=v;do{if((c.tag&t)===t){var w=c.inst,A=w.destroy;if(A!==void 0){w.destroy=void 0,h=i;var z=l,ee=A;try{ee()}catch(re){st(h,z,re)}}}c=c.next}while(c!==v)}}catch(re){st(i,i.return,re)}}function my(t){var i=t.updateQueue;if(i!==null){var l=t.stateNode;try{rg(i,l)}catch(c){st(t,t.return,c)}}}function gy(t,i,l){l.props=er(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){st(t,i,c)}}function Gl(t,i){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof l=="function"?t.refCleanup=l(c):l.current=c}}catch(h){st(t,i,h)}}function va(t,i){var l=t.ref,c=t.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(h){st(t,i,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){st(t,i,h)}else l.current=null}function yy(t){var i=t.type,l=t.memoizedProps,c=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(h){st(t,t.return,h)}}function Ld(t,i,l){try{var c=t.stateNode;t2(c,t.type,l,i),c[_e]=i}catch(h){st(t,t.return,h)}}function vy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&wi(t.type)||t.tag===4}function zd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||vy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&wi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Id(t,i,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(t),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=Oa));else if(c!==4&&(c===27&&wi(t.type)&&(l=t.stateNode,i=null),t=t.child,t!==null))for(Id(t,i,l),t=t.sibling;t!==null;)Id(t,i,l),t=t.sibling}function Os(t,i,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,i?l.insertBefore(t,i):l.appendChild(t);else if(c!==4&&(c===27&&wi(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Os(t,i,l),t=t.sibling;t!==null;)Os(t,i,l),t=t.sibling}function xy(t){var i=t.stateNode,l=t.memoizedProps;try{for(var c=t.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);nn(i,c,l),i[Se]=t,i[_e]=l}catch(v){st(t,t.return,v)}}var $a=!1,Pt=!1,Pd=!1,by=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function Mk(t,i){if(t=t.containerInfo,lf=Js,t=Om(t),_u(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var h=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var w=0,A=-1,z=-1,ee=0,re=0,ce=t,te=null;t:for(;;){for(var ae;ce!==l||h!==0&&ce.nodeType!==3||(A=w+h),ce!==v||c!==0&&ce.nodeType!==3||(z=w+c),ce.nodeType===3&&(w+=ce.nodeValue.length),(ae=ce.firstChild)!==null;)te=ce,ce=ae;for(;;){if(ce===t)break t;if(te===l&&++ee===h&&(A=w),te===v&&++re===c&&(z=w),(ae=ce.nextSibling)!==null)break;ce=te,te=ce.parentNode}ce=ae}l=A===-1||z===-1?null:{start:A,end:z}}else l=null}l=l||{start:0,end:0}}else l=null;for(of={focusedElem:t,selectionRange:l},Js=!1,Kt=i;Kt!==null;)if(i=Kt,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Kt=t;else for(;Kt!==null;){switch(i=Kt,v=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)h=t[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&v!==null){t=void 0,l=i,h=v.memoizedProps,v=v.memoizedState,c=l.stateNode;try{var xe=er(l.type,h);t=c.getSnapshotBeforeUpdate(xe,v),c.__reactInternalSnapshotBeforeUpdate=t}catch(je){st(l,l.return,je)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,l=t.nodeType,l===9)uf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":uf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=i.sibling,t!==null){t.return=i.return,Kt=t;break}Kt=i.return}}function wy(t,i,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:Fa(t,l),c&4&&Fl(5,l);break;case 1:if(Fa(t,l),c&4)if(t=l.stateNode,i===null)try{t.componentDidMount()}catch(w){st(l,l.return,w)}else{var h=er(l.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(h,i,t.__reactInternalSnapshotBeforeUpdate)}catch(w){st(l,l.return,w)}}c&64&&my(l),c&512&&Gl(l,l.return);break;case 3:if(Fa(t,l),c&64&&(t=l.updateQueue,t!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{rg(t,i)}catch(w){st(l,l.return,w)}}break;case 27:i===null&&c&4&&xy(l);case 26:case 5:Fa(t,l),i===null&&c&4&&yy(l),c&512&&Gl(l,l.return);break;case 12:Fa(t,l);break;case 31:Fa(t,l),c&4&&Cy(t,l);break;case 13:Fa(t,l),c&4&&Ey(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=qk.bind(null,l),c2(t,l))));break;case 22:if(c=l.memoizedState!==null||$a,!c){i=i!==null&&i.memoizedState!==null||Pt,h=$a;var v=Pt;$a=c,(Pt=i)&&!v?Ga(t,l,(l.subtreeFlags&8772)!==0):Fa(t,l),$a=h,Pt=v}break;case 30:break;default:Fa(t,l)}}function Sy(t){var i=t.alternate;i!==null&&(t.alternate=null,Sy(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&yr(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Ct=null,wn=!1;function qa(t,i,l){for(l=l.child;l!==null;)ky(t,i,l),l=l.sibling}function ky(t,i,l){if(Xe&&typeof Xe.onCommitFiberUnmount=="function")try{Xe.onCommitFiberUnmount(Pe,l)}catch{}switch(l.tag){case 26:Pt||va(l,i),qa(t,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Pt||va(l,i);var c=Ct,h=wn;wi(l.type)&&(Ct=l.stateNode,wn=!1),qa(t,i,l),eo(l.stateNode),Ct=c,wn=h;break;case 5:Pt||va(l,i);case 6:if(c=Ct,h=wn,Ct=null,qa(t,i,l),Ct=c,wn=h,Ct!==null)if(wn)try{(Ct.nodeType===9?Ct.body:Ct.nodeName==="HTML"?Ct.ownerDocument.body:Ct).removeChild(l.stateNode)}catch(v){st(l,i,v)}else try{Ct.removeChild(l.stateNode)}catch(v){st(l,i,v)}break;case 18:Ct!==null&&(wn?(t=Ct,mv(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Qr(t)):mv(Ct,l.stateNode));break;case 4:c=Ct,h=wn,Ct=l.stateNode.containerInfo,wn=!0,qa(t,i,l),Ct=c,wn=h;break;case 0:case 11:case 14:case 15:hi(2,l,i),Pt||hi(4,l,i),qa(t,i,l);break;case 1:Pt||(va(l,i),c=l.stateNode,typeof c.componentWillUnmount=="function"&&gy(l,i,c)),qa(t,i,l);break;case 21:qa(t,i,l);break;case 22:Pt=(c=Pt)||l.memoizedState!==null,qa(t,i,l),Pt=c;break;default:qa(t,i,l)}}function Cy(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Qr(t)}catch(l){st(i,i.return,l)}}}function Ey(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Qr(t)}catch(l){st(i,i.return,l)}}function Lk(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new by),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new by),i;default:throw Error(r(435,t.tag))}}function Ds(t,i){var l=Lk(t);i.forEach(function(c){if(!l.has(c)){l.add(c);var h=Fk.bind(null,t,c);c.then(h,h)}})}function Sn(t,i){var l=i.deletions;if(l!==null)for(var c=0;c<l.length;c++){var h=l[c],v=t,w=i,A=w;e:for(;A!==null;){switch(A.tag){case 27:if(wi(A.type)){Ct=A.stateNode,wn=!1;break e}break;case 5:Ct=A.stateNode,wn=!1;break e;case 3:case 4:Ct=A.stateNode.containerInfo,wn=!0;break e}A=A.return}if(Ct===null)throw Error(r(160));ky(v,w,h),Ct=null,wn=!1,v=h.alternate,v!==null&&(v.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Ay(i,t),i=i.sibling}var oa=null;function Ay(t,i){var l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Sn(i,t),kn(t),c&4&&(hi(3,t,t.return),Fl(3,t),hi(5,t,t.return));break;case 1:Sn(i,t),kn(t),c&512&&(Pt||l===null||va(l,l.return)),c&64&&$a&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var h=oa;if(Sn(i,t),kn(t),c&512&&(Pt||l===null||va(l,l.return)),c&4){var v=l!==null?l.memoizedState:null;if(c=t.memoizedState,l===null)if(c===null)if(t.stateNode===null){e:{c=t.type,l=t.memoizedProps,h=h.ownerDocument||h;t:switch(c){case"title":v=h.getElementsByTagName("title")[0],(!v||v[ha]||v[Se]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=h.createElement(c),h.head.insertBefore(v,h.querySelector("head > title"))),nn(v,c,l),v[Se]=t,At(v),c=v;break e;case"link":var w=Av("link","href",h).get(c+(l.href||""));if(w){for(var A=0;A<w.length;A++)if(v=w[A],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){w.splice(A,1);break t}}v=h.createElement(c),nn(v,c,l),h.head.appendChild(v);break;case"meta":if(w=Av("meta","content",h).get(c+(l.content||""))){for(A=0;A<w.length;A++)if(v=w[A],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){w.splice(A,1);break t}}v=h.createElement(c),nn(v,c,l),h.head.appendChild(v);break;default:throw Error(r(468,c))}v[Se]=t,At(v),c=v}t.stateNode=c}else jv(h,t.type,t.stateNode);else t.stateNode=Ev(h,c,t.memoizedProps);else v!==c?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,c===null?jv(h,t.type,t.stateNode):Ev(h,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Ld(t,t.memoizedProps,l.memoizedProps)}break;case 27:Sn(i,t),kn(t),c&512&&(Pt||l===null||va(l,l.return)),l!==null&&c&4&&Ld(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Sn(i,t),kn(t),c&512&&(Pt||l===null||va(l,l.return)),t.flags&32){h=t.stateNode;try{xr(h,"")}catch(xe){st(t,t.return,xe)}}c&4&&t.stateNode!=null&&(h=t.memoizedProps,Ld(t,h,l!==null?l.memoizedProps:h)),c&1024&&(Pd=!0);break;case 6:if(Sn(i,t),kn(t),c&4){if(t.stateNode===null)throw Error(r(162));c=t.memoizedProps,l=t.stateNode;try{l.nodeValue=c}catch(xe){st(t,t.return,xe)}}break;case 3:if(Ks=null,h=oa,oa=Ws(i.containerInfo),Sn(i,t),oa=h,kn(t),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Qr(i.containerInfo)}catch(xe){st(t,t.return,xe)}Pd&&(Pd=!1,jy(t));break;case 4:c=oa,oa=Ws(t.stateNode.containerInfo),Sn(i,t),kn(t),oa=c;break;case 12:Sn(i,t),kn(t);break;case 31:Sn(i,t),kn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Ds(t,c)));break;case 13:Sn(i,t),kn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ls=it()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Ds(t,c)));break;case 22:h=t.memoizedState!==null;var z=l!==null&&l.memoizedState!==null,ee=$a,re=Pt;if($a=ee||h,Pt=re||z,Sn(i,t),Pt=re,$a=ee,kn(t),c&8192)e:for(i=t.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(l===null||z||$a||Pt||tr(t)),l=null,i=t;;){if(i.tag===5||i.tag===26){if(l===null){z=l=i;try{if(v=z.stateNode,h)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{A=z.stateNode;var ce=z.memoizedProps.style,te=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;A.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(xe){st(z,z.return,xe)}}}else if(i.tag===6){if(l===null){z=i;try{z.stateNode.nodeValue=h?"":z.memoizedProps}catch(xe){st(z,z.return,xe)}}}else if(i.tag===18){if(l===null){z=i;try{var ae=z.stateNode;h?gv(ae,!0):gv(z.stateNode,!1)}catch(xe){st(z,z.return,xe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=t.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,Ds(t,l))));break;case 19:Sn(i,t),kn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Ds(t,c)));break;case 30:break;case 21:break;default:Sn(i,t),kn(t)}}function kn(t){var i=t.flags;if(i&2){try{for(var l,c=t.return;c!==null;){if(vy(c)){l=c;break}c=c.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var h=l.stateNode,v=zd(t);Os(t,v,h);break;case 5:var w=l.stateNode;l.flags&32&&(xr(w,""),l.flags&=-33);var A=zd(t);Os(t,A,w);break;case 3:case 4:var z=l.stateNode.containerInfo,ee=zd(t);Id(t,ee,z);break;default:throw Error(r(161))}}catch(re){st(t,t.return,re)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function jy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;jy(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Fa(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)wy(t,i.alternate,i),i=i.sibling}function tr(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:hi(4,i,i.return),tr(i);break;case 1:va(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&gy(i,i.return,l),tr(i);break;case 27:eo(i.stateNode);case 26:case 5:va(i,i.return),tr(i);break;case 22:i.memoizedState===null&&tr(i);break;case 30:tr(i);break;default:tr(i)}t=t.sibling}}function Ga(t,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,h=t,v=i,w=v.flags;switch(v.tag){case 0:case 11:case 15:Ga(h,v,l),Fl(4,v);break;case 1:if(Ga(h,v,l),c=v,h=c.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(ee){st(c,c.return,ee)}if(c=v,h=c.updateQueue,h!==null){var A=c.stateNode;try{var z=h.shared.hiddenCallbacks;if(z!==null)for(h.shared.hiddenCallbacks=null,h=0;h<z.length;h++)ig(z[h],A)}catch(ee){st(c,c.return,ee)}}l&&w&64&&my(v),Gl(v,v.return);break;case 27:xy(v);case 26:case 5:Ga(h,v,l),l&&c===null&&w&4&&yy(v),Gl(v,v.return);break;case 12:Ga(h,v,l);break;case 31:Ga(h,v,l),l&&w&4&&Cy(h,v);break;case 13:Ga(h,v,l),l&&w&4&&Ey(h,v);break;case 22:v.memoizedState===null&&Ga(h,v,l),Gl(v,v.return);break;case 30:break;default:Ga(h,v,l)}i=i.sibling}}function Ud(t,i){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&_l(l))}function Bd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&_l(t))}function sa(t,i,l,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ty(t,i,l,c),i=i.sibling}function Ty(t,i,l,c){var h=i.flags;switch(i.tag){case 0:case 11:case 15:sa(t,i,l,c),h&2048&&Fl(9,i);break;case 1:sa(t,i,l,c);break;case 3:sa(t,i,l,c),h&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&_l(t)));break;case 12:if(h&2048){sa(t,i,l,c),t=i.stateNode;try{var v=i.memoizedProps,w=v.id,A=v.onPostCommit;typeof A=="function"&&A(w,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(z){st(i,i.return,z)}}else sa(t,i,l,c);break;case 31:sa(t,i,l,c);break;case 13:sa(t,i,l,c);break;case 23:break;case 22:v=i.stateNode,w=i.alternate,i.memoizedState!==null?v._visibility&2?sa(t,i,l,c):Vl(t,i):v._visibility&2?sa(t,i,l,c):(v._visibility|=2,Ur(t,i,l,c,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Ud(w,i);break;case 24:sa(t,i,l,c),h&2048&&Bd(i.alternate,i);break;default:sa(t,i,l,c)}}function Ur(t,i,l,c,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=t,w=i,A=l,z=c,ee=w.flags;switch(w.tag){case 0:case 11:case 15:Ur(v,w,A,z,h),Fl(8,w);break;case 23:break;case 22:var re=w.stateNode;w.memoizedState!==null?re._visibility&2?Ur(v,w,A,z,h):Vl(v,w):(re._visibility|=2,Ur(v,w,A,z,h)),h&&ee&2048&&Ud(w.alternate,w);break;case 24:Ur(v,w,A,z,h),h&&ee&2048&&Bd(w.alternate,w);break;default:Ur(v,w,A,z,h)}i=i.sibling}}function Vl(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=t,c=i,h=c.flags;switch(c.tag){case 22:Vl(l,c),h&2048&&Ud(c.alternate,c);break;case 24:Vl(l,c),h&2048&&Bd(c.alternate,c);break;default:Vl(l,c)}i=i.sibling}}var Wl=8192;function Br(t,i,l){if(t.subtreeFlags&Wl)for(t=t.child;t!==null;)Ny(t,i,l),t=t.sibling}function Ny(t,i,l){switch(t.tag){case 26:Br(t,i,l),t.flags&Wl&&t.memoizedState!==null&&w2(l,oa,t.memoizedState,t.memoizedProps);break;case 5:Br(t,i,l);break;case 3:case 4:var c=oa;oa=Ws(t.stateNode.containerInfo),Br(t,i,l),oa=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=Wl,Wl=16777216,Br(t,i,l),Wl=c):Br(t,i,l));break;default:Br(t,i,l)}}function Ry(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function Yl(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var c=i[l];Kt=c,Oy(c,t)}Ry(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)_y(t),t=t.sibling}function _y(t){switch(t.tag){case 0:case 11:case 15:Yl(t),t.flags&2048&&hi(9,t,t.return);break;case 3:Yl(t);break;case 12:Yl(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Ms(t)):Yl(t);break;default:Yl(t)}}function Ms(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var c=i[l];Kt=c,Oy(c,t)}Ry(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:hi(8,i,i.return),Ms(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Ms(i));break;default:Ms(i)}t=t.sibling}}function Oy(t,i){for(;Kt!==null;){var l=Kt;switch(l.tag){case 0:case 11:case 15:hi(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:_l(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,Kt=c;else e:for(l=t;Kt!==null;){c=Kt;var h=c.sibling,v=c.return;if(Sy(c),c===l){Kt=null;break e}if(h!==null){h.return=v,Kt=h;break e}Kt=v}}}var zk={getCacheForType:function(t){var i=en(Lt),l=i.data.get(t);return l===void 0&&(l=t(),i.data.set(t,l)),l},cacheSignal:function(){return en(Lt).controller.signal}},Ik=typeof WeakMap=="function"?WeakMap:Map,tt=0,ht=null,He=null,Fe=0,ot=0,Dn=null,mi=!1,Hr=!1,Hd=!1,Va=0,Tt=0,gi=0,nr=0,$d=0,Mn=0,$r=0,Kl=null,Cn=null,qd=!1,Ls=0,Dy=0,zs=1/0,Is=null,yi=null,Ft=0,vi=null,qr=null,Wa=0,Fd=0,Gd=null,My=null,Ql=0,Vd=null;function Ln(){return(tt&2)!==0&&Fe!==0?Fe&-Fe:P.T!==null?Zd():Ye()}function Ly(){if(Mn===0)if((Fe&536870912)===0||We){var t=Ii;Ii<<=1,(Ii&3932160)===0&&(Ii=262144),Mn=t}else Mn=536870912;return t=_n.current,t!==null&&(t.flags|=32),Mn}function En(t,i,l){(t===ht&&(ot===2||ot===9)||t.cancelPendingCommit!==null)&&(Fr(t,0),xi(t,Fe,Mn,!1)),Ui(t,l),((tt&2)===0||t!==ht)&&(t===ht&&((tt&2)===0&&(nr|=l),Tt===4&&xi(t,Fe,Mn,!1)),xa(t))}function zy(t,i,l){if((tt&6)!==0)throw Error(r(327));var c=!l&&(i&127)===0&&(i&t.expiredLanes)===0||Pi(t,i),h=c?Bk(t,i):Yd(t,i,!0),v=c;do{if(h===0){Hr&&!c&&xi(t,i,0,!1);break}else{if(l=t.current.alternate,v&&!Pk(l)){h=Yd(t,i,!1),v=!1;continue}if(h===2){if(v=i,t.errorRecoveryDisabledLanes&v)var w=0;else w=t.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var A=t;h=Kl;var z=A.current.memoizedState.isDehydrated;if(z&&(Fr(A,w).flags|=256),w=Yd(A,w,!1),w!==2){if(Hd&&!z){A.errorRecoveryDisabledLanes|=v,nr|=v,h=4;break e}v=Cn,Cn=h,v!==null&&(Cn===null?Cn=v:Cn.push.apply(Cn,v))}h=w}if(v=!1,h!==2)continue}}if(h===1){Fr(t,0),xi(t,i,0,!0);break}e:{switch(c=t,v=h,v){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:xi(c,i,Mn,!mi);break e;case 2:Cn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(h=Ls+300-it(),10<h)){if(xi(c,i,Mn,!mi),gr(c,0,!0)!==0)break e;Wa=i,c.timeoutHandle=pv(Iy.bind(null,c,l,Cn,Is,qd,i,Mn,nr,$r,mi,v,"Throttled",-0,0),h);break e}Iy(c,l,Cn,Is,qd,i,Mn,nr,$r,mi,v,null,-0,0)}}break}while(!0);xa(t)}function Iy(t,i,l,c,h,v,w,A,z,ee,re,ce,te,ae){if(t.timeoutHandle=-1,ce=i.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Oa},Ny(i,v,ce);var xe=(v&62914560)===v?Ls-it():(v&4194048)===v?Dy-it():0;if(xe=S2(ce,xe),xe!==null){Wa=v,t.cancelPendingCommit=xe(Gy.bind(null,t,i,v,l,c,h,w,A,z,re,ce,null,te,ae)),xi(t,v,w,!ee);return}}Gy(t,i,v,l,c,h,w,A,z)}function Pk(t){for(var i=t;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var h=l[c],v=h.getSnapshot;h=h.value;try{if(!Nn(v(),h))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function xi(t,i,l,c){i&=~$d,i&=~nr,t.suspendedLanes|=i,t.pingedLanes&=~i,c&&(t.warmLanes|=i),c=t.expirationTimes;for(var h=i;0<h;){var v=31-ke(h),w=1<<v;c[v]=-1,h&=~w}l!==0&&Wo(t,l,i)}function Ps(){return(tt&6)===0?(Xl(0),!1):!0}function Wd(){if(He!==null){if(ot===0)var t=He.return;else t=He,za=Wi=null,cd(t),Mr=null,Dl=0,t=He;for(;t!==null;)hy(t.alternate,t),t=t.return;He=null}}function Fr(t,i){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,i2(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Wa=0,Wd(),ht=t,He=l=Ma(t.current,null),Fe=i,ot=0,Dn=null,mi=!1,Hr=Pi(t,i),Hd=!1,$r=Mn=$d=nr=gi=Tt=0,Cn=Kl=null,qd=!1,(i&8)!==0&&(i|=i&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=i;0<c;){var h=31-ke(c),v=1<<h;i|=t[h],c&=~v}return Va=i,rs(),l}function Py(t,i){Le=null,P.H=Hl,i===Dr||i===ps?(i=eg(),ot=3):i===Xu?(i=eg(),ot=4):ot=i===Ed?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Dn=i,He===null&&(Tt=1,js(t,Yn(i,t.current)))}function Uy(){var t=_n.current;return t===null?!0:(Fe&4194048)===Fe?Zn===null:(Fe&62914560)===Fe||(Fe&536870912)!==0?t===Zn:!1}function By(){var t=P.H;return P.H=Hl,t===null?Hl:t}function Hy(){var t=P.A;return P.A=zk,t}function Us(){Tt=4,mi||(Fe&4194048)!==Fe&&_n.current!==null||(Hr=!0),(gi&134217727)===0&&(nr&134217727)===0||ht===null||xi(ht,Fe,Mn,!1)}function Yd(t,i,l){var c=tt;tt|=2;var h=By(),v=Hy();(ht!==t||Fe!==i)&&(Is=null,Fr(t,i)),i=!1;var w=Tt;e:do try{if(ot!==0&&He!==null){var A=He,z=Dn;switch(ot){case 8:Wd(),w=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(i=!0);var ee=ot;if(ot=0,Dn=null,Gr(t,A,z,ee),l&&Hr){w=0;break e}break;default:ee=ot,ot=0,Dn=null,Gr(t,A,z,ee)}}Uk(),w=Tt;break}catch(re){Py(t,re)}while(!0);return i&&t.shellSuspendCounter++,za=Wi=null,tt=c,P.H=h,P.A=v,He===null&&(ht=null,Fe=0,rs()),w}function Uk(){for(;He!==null;)$y(He)}function Bk(t,i){var l=tt;tt|=2;var c=By(),h=Hy();ht!==t||Fe!==i?(Is=null,zs=it()+500,Fr(t,i)):Hr=Pi(t,i);e:do try{if(ot!==0&&He!==null){i=He;var v=Dn;t:switch(ot){case 1:ot=0,Dn=null,Gr(t,i,v,1);break;case 2:case 9:if(Zm(v)){ot=0,Dn=null,qy(i);break}i=function(){ot!==2&&ot!==9||ht!==t||(ot=7),xa(t)},v.then(i,i);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:Zm(v)?(ot=0,Dn=null,qy(i)):(ot=0,Dn=null,Gr(t,i,v,7));break;case 5:var w=null;switch(He.tag){case 26:w=He.memoizedState;case 5:case 27:var A=He;if(w?Tv(w):A.stateNode.complete){ot=0,Dn=null;var z=A.sibling;if(z!==null)He=z;else{var ee=A.return;ee!==null?(He=ee,Bs(ee)):He=null}break t}}ot=0,Dn=null,Gr(t,i,v,5);break;case 6:ot=0,Dn=null,Gr(t,i,v,6);break;case 8:Wd(),Tt=6;break e;default:throw Error(r(462))}}Hk();break}catch(re){Py(t,re)}while(!0);return za=Wi=null,P.H=c,P.A=h,tt=l,He!==null?0:(ht=null,Fe=0,rs(),Tt)}function Hk(){for(;He!==null&&!qn();)$y(He)}function $y(t){var i=fy(t.alternate,t,Va);t.memoizedProps=t.pendingProps,i===null?Bs(t):He=i}function qy(t){var i=t,l=i.alternate;switch(i.tag){case 15:case 0:i=ly(l,i,i.pendingProps,i.type,void 0,Fe);break;case 11:i=ly(l,i,i.pendingProps,i.type.render,i.ref,Fe);break;case 5:cd(i);default:hy(l,i),i=He=Hm(i,Va),i=fy(l,i,Va)}t.memoizedProps=t.pendingProps,i===null?Bs(t):He=i}function Gr(t,i,l,c){za=Wi=null,cd(i),Mr=null,Dl=0;var h=i.return;try{if(Nk(t,h,i,l,Fe)){Tt=1,js(t,Yn(l,t.current)),He=null;return}}catch(v){if(h!==null)throw He=h,v;Tt=1,js(t,Yn(l,t.current)),He=null;return}i.flags&32768?(We||c===1?t=!0:Hr||(Fe&536870912)!==0?t=!1:(mi=t=!0,(c===2||c===9||c===3||c===6)&&(c=_n.current,c!==null&&c.tag===13&&(c.flags|=16384))),Fy(i,t)):Bs(i)}function Bs(t){var i=t;do{if((i.flags&32768)!==0){Fy(i,mi);return}t=i.return;var l=Ok(i.alternate,i,Va);if(l!==null){He=l;return}if(i=i.sibling,i!==null){He=i;return}He=i=t}while(i!==null);Tt===0&&(Tt=5)}function Fy(t,i){do{var l=Dk(t.alternate,t);if(l!==null){l.flags&=32767,He=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(t=t.sibling,t!==null)){He=t;return}He=t=l}while(t!==null);Tt=6,He=null}function Gy(t,i,l,c,h,v,w,A,z){t.cancelPendingCommit=null;do Hs();while(Ft!==0);if((tt&6)!==0)throw Error(r(327));if(i!==null){if(i===t.current)throw Error(r(177));if(v=i.lanes|i.childLanes,v|=zu,pu(t,l,v,w,A,z),t===ht&&(He=ht=null,Fe=0),qr=i,vi=t,Wa=l,Fd=v,Gd=h,My=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Gk(me,function(){return Qy(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=P.T,P.T=null,h=Z.p,Z.p=2,w=tt,tt|=4;try{Mk(t,i,l)}finally{tt=w,Z.p=h,P.T=c}}Ft=1,Vy(),Wy(),Yy()}}function Vy(){if(Ft===1){Ft=0;var t=vi,i=qr,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=P.T,P.T=null;var c=Z.p;Z.p=2;var h=tt;tt|=4;try{Ay(i,t);var v=of,w=Om(t.containerInfo),A=v.focusedElem,z=v.selectionRange;if(w!==A&&A&&A.ownerDocument&&_m(A.ownerDocument.documentElement,A)){if(z!==null&&_u(A)){var ee=z.start,re=z.end;if(re===void 0&&(re=ee),"selectionStart"in A)A.selectionStart=ee,A.selectionEnd=Math.min(re,A.value.length);else{var ce=A.ownerDocument||document,te=ce&&ce.defaultView||window;if(te.getSelection){var ae=te.getSelection(),xe=A.textContent.length,je=Math.min(z.start,xe),dt=z.end===void 0?je:Math.min(z.end,xe);!ae.extend&&je>dt&&(w=dt,dt=je,je=w);var Y=Rm(A,je),q=Rm(A,dt);if(Y&&q&&(ae.rangeCount!==1||ae.anchorNode!==Y.node||ae.anchorOffset!==Y.offset||ae.focusNode!==q.node||ae.focusOffset!==q.offset)){var J=ce.createRange();J.setStart(Y.node,Y.offset),ae.removeAllRanges(),je>dt?(ae.addRange(J),ae.extend(q.node,q.offset)):(J.setEnd(q.node,q.offset),ae.addRange(J))}}}}for(ce=[],ae=A;ae=ae.parentNode;)ae.nodeType===1&&ce.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<ce.length;A++){var oe=ce[A];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Js=!!lf,of=lf=null}finally{tt=h,Z.p=c,P.T=l}}t.current=i,Ft=2}}function Wy(){if(Ft===2){Ft=0;var t=vi,i=qr,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=P.T,P.T=null;var c=Z.p;Z.p=2;var h=tt;tt|=4;try{wy(t,i.alternate,i)}finally{tt=h,Z.p=c,P.T=l}}Ft=3}}function Yy(){if(Ft===4||Ft===3){Ft=0,yn();var t=vi,i=qr,l=Wa,c=My;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ft=5:(Ft=0,qr=vi=null,Ky(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(yi=null),Me(l),i=i.stateNode,Xe&&typeof Xe.onCommitFiberRoot=="function")try{Xe.onCommitFiberRoot(Pe,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=P.T,h=Z.p,Z.p=2,P.T=null;try{for(var v=t.onRecoverableError,w=0;w<c.length;w++){var A=c[w];v(A.value,{componentStack:A.stack})}}finally{P.T=i,Z.p=h}}(Wa&3)!==0&&Hs(),xa(t),h=t.pendingLanes,(l&261930)!==0&&(h&42)!==0?t===Vd?Ql++:(Ql=0,Vd=t):Ql=0,Xl(0)}}function Ky(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,_l(i)))}function Hs(){return Vy(),Wy(),Yy(),Qy()}function Qy(){if(Ft!==5)return!1;var t=vi,i=Fd;Fd=0;var l=Me(Wa),c=P.T,h=Z.p;try{Z.p=32>l?32:l,P.T=null,l=Gd,Gd=null;var v=vi,w=Wa;if(Ft=0,qr=vi=null,Wa=0,(tt&6)!==0)throw Error(r(331));var A=tt;if(tt|=4,_y(v.current),Ty(v,v.current,w,l),tt=A,Xl(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot=="function")try{Xe.onPostCommitFiberRoot(Pe,v)}catch{}return!0}finally{Z.p=h,P.T=c,Ky(t,i)}}function Xy(t,i,l){i=Yn(l,i),i=Cd(t.stateNode,i,2),t=di(t,i,2),t!==null&&(Ui(t,2),xa(t))}function st(t,i,l){if(t.tag===3)Xy(t,t,l);else for(;i!==null;){if(i.tag===3){Xy(i,t,l);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(yi===null||!yi.has(c))){t=Yn(l,t),l=Zg(2),c=di(i,l,2),c!==null&&(Jg(l,c,i,t),Ui(c,2),xa(c));break}}i=i.return}}function Kd(t,i,l){var c=t.pingCache;if(c===null){c=t.pingCache=new Ik;var h=new Set;c.set(i,h)}else h=c.get(i),h===void 0&&(h=new Set,c.set(i,h));h.has(l)||(Hd=!0,h.add(l),t=$k.bind(null,t,i,l),i.then(t,t))}function $k(t,i,l){var c=t.pingCache;c!==null&&c.delete(i),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,ht===t&&(Fe&l)===l&&(Tt===4||Tt===3&&(Fe&62914560)===Fe&&300>it()-Ls?(tt&2)===0&&Fr(t,0):$d|=l,$r===Fe&&($r=0)),xa(t)}function Zy(t,i){i===0&&(i=Vo()),t=Fi(t,i),t!==null&&(Ui(t,i),xa(t))}function qk(t){var i=t.memoizedState,l=0;i!==null&&(l=i.retryLane),Zy(t,l)}function Fk(t,i){var l=0;switch(t.tag){case 31:case 13:var c=t.stateNode,h=t.memoizedState;h!==null&&(l=h.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(i),Zy(t,l)}function Gk(t,i){return ge(t,i)}var $s=null,Vr=null,Qd=!1,qs=!1,Xd=!1,bi=0;function xa(t){t!==Vr&&t.next===null&&(Vr===null?$s=Vr=t:Vr=Vr.next=t),qs=!0,Qd||(Qd=!0,Wk())}function Xl(t,i){if(!Xd&&qs){Xd=!0;do for(var l=!1,c=$s;c!==null;){if(t!==0){var h=c.pendingLanes;if(h===0)var v=0;else{var w=c.suspendedLanes,A=c.pingedLanes;v=(1<<31-ke(42|t)+1)-1,v&=h&~(w&~A),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,nv(c,v))}else v=Fe,v=gr(c,c===ht?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||Pi(c,v)||(l=!0,nv(c,v));c=c.next}while(l);Xd=!1}}function Vk(){Jy()}function Jy(){qs=Qd=!1;var t=0;bi!==0&&a2()&&(t=bi);for(var i=it(),l=null,c=$s;c!==null;){var h=c.next,v=ev(c,i);v===0?(c.next=null,l===null?$s=h:l.next=h,h===null&&(Vr=l)):(l=c,(t!==0||(v&3)!==0)&&(qs=!0)),c=h}Ft!==0&&Ft!==5||Xl(t),bi!==0&&(bi=0)}function ev(t,i){for(var l=t.suspendedLanes,c=t.pingedLanes,h=t.expirationTimes,v=t.pendingLanes&-62914561;0<v;){var w=31-ke(v),A=1<<w,z=h[w];z===-1?((A&l)===0||(A&c)!==0)&&(h[w]=fu(A,i)):z<=i&&(t.expiredLanes|=A),v&=~A}if(i=ht,l=Fe,l=gr(t,t===i?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,l===0||t===i&&(ot===2||ot===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Mt(c),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Pi(t,l)){if(i=l&-l,i===t.callbackPriority)return i;switch(c!==null&&Mt(c),Me(l)){case 2:case 8:l=le;break;case 32:l=me;break;case 268435456:l=I;break;default:l=me}return c=tv.bind(null,t),l=ge(l,c),t.callbackPriority=i,t.callbackNode=l,i}return c!==null&&c!==null&&Mt(c),t.callbackPriority=2,t.callbackNode=null,2}function tv(t,i){if(Ft!==0&&Ft!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Hs()&&t.callbackNode!==l)return null;var c=Fe;return c=gr(t,t===ht?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(zy(t,c,i),ev(t,it()),t.callbackNode!=null&&t.callbackNode===l?tv.bind(null,t):null)}function nv(t,i){if(Hs())return null;zy(t,i,!0)}function Wk(){r2(function(){(tt&6)!==0?ge($,Vk):Jy()})}function Zd(){if(bi===0){var t=_r;t===0&&(t=ti,ti<<=1,(ti&261888)===0&&(ti=256)),bi=t}return bi}function av(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Xo(""+t)}function iv(t,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,t.id&&l.setAttribute("form",t.id),i.parentNode.insertBefore(l,i),t=new FormData(t),l.parentNode.removeChild(l),t}function Yk(t,i,l,c,h){if(i==="submit"&&l&&l.stateNode===h){var v=av((h[_e]||null).action),w=c.submitter;w&&(i=(i=w[_e]||null)?av(i.formAction):w.getAttribute("formAction"),i!==null&&(v=i,w=null));var A=new ts("action","action",null,c,h);t.push({event:A,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(bi!==0){var z=w?iv(h,w):new FormData(h);vd(l,{pending:!0,data:z,method:h.method,action:v},null,z)}}else typeof v=="function"&&(A.preventDefault(),z=w?iv(h,w):new FormData(h),vd(l,{pending:!0,data:z,method:h.method,action:v},v,z))},currentTarget:h}]})}}for(var Jd=0;Jd<Lu.length;Jd++){var ef=Lu[Jd],Kk=ef.toLowerCase(),Qk=ef[0].toUpperCase()+ef.slice(1);la(Kk,"on"+Qk)}la(Lm,"onAnimationEnd"),la(zm,"onAnimationIteration"),la(Im,"onAnimationStart"),la("dblclick","onDoubleClick"),la("focusin","onFocus"),la("focusout","onBlur"),la(fk,"onTransitionRun"),la(pk,"onTransitionStart"),la(hk,"onTransitionCancel"),la(Pm,"onTransitionEnd"),Gn("onMouseEnter",["mouseout","mouseover"]),Gn("onMouseLeave",["mouseout","mouseover"]),Gn("onPointerEnter",["pointerout","pointerover"]),Gn("onPointerLeave",["pointerout","pointerover"]),cn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),cn("onBeforeInput",["compositionend","keypress","textInput","paste"]),cn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zl="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(" "),Xk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zl));function rv(t,i){i=(i&4)!==0;for(var l=0;l<t.length;l++){var c=t[l],h=c.event;c=c.listeners;e:{var v=void 0;if(i)for(var w=c.length-1;0<=w;w--){var A=c[w],z=A.instance,ee=A.currentTarget;if(A=A.listener,z!==v&&h.isPropagationStopped())break e;v=A,h.currentTarget=ee;try{v(h)}catch(re){is(re)}h.currentTarget=null,v=z}else for(w=0;w<c.length;w++){if(A=c[w],z=A.instance,ee=A.currentTarget,A=A.listener,z!==v&&h.isPropagationStopped())break e;v=A,h.currentTarget=ee;try{v(h)}catch(re){is(re)}h.currentTarget=null,v=z}}}}function $e(t,i){var l=i[Na];l===void 0&&(l=i[Na]=new Set);var c=t+"__bubble";l.has(c)||(lv(i,t,2,!1),l.add(c))}function tf(t,i,l){var c=0;i&&(c|=4),lv(l,t,c,i)}var Fs="_reactListening"+Math.random().toString(36).slice(2);function nf(t){if(!t[Fs]){t[Fs]=!0,vn.forEach(function(l){l!=="selectionchange"&&(Xk.has(l)||tf(l,!1,t),tf(l,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Fs]||(i[Fs]=!0,tf("selectionchange",!1,i))}}function lv(t,i,l,c){switch(Lv(i)){case 2:var h=E2;break;case 8:h=A2;break;default:h=vf}l=h.bind(null,i,l,t),h=void 0,!Su||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),c?h!==void 0?t.addEventListener(i,l,{capture:!0,passive:h}):t.addEventListener(i,l,!0):h!==void 0?t.addEventListener(i,l,{passive:h}):t.addEventListener(i,l,!1)}function af(t,i,l,c,h){var v=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var A=c.stateNode.containerInfo;if(A===h)break;if(w===4)for(w=c.return;w!==null;){var z=w.tag;if((z===3||z===4)&&w.stateNode.containerInfo===h)return;w=w.return}for(;A!==null;){if(w=Ra(A),w===null)return;if(z=w.tag,z===5||z===6||z===26||z===27){c=v=w;continue e}A=A.parentNode}}c=c.return}dm(function(){var ee=v,re=bu(l),ce=[];e:{var te=Um.get(t);if(te!==void 0){var ae=ts,xe=t;switch(t){case"keypress":if(Jo(l)===0)break e;case"keydown":case"keyup":ae=FS;break;case"focusin":xe="focus",ae=Au;break;case"focusout":xe="blur",ae=Au;break;case"beforeblur":case"afterblur":ae=Au;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=hm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=OS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=WS;break;case Lm:case zm:case Im:ae=LS;break;case Pm:ae=KS;break;case"scroll":case"scrollend":ae=RS;break;case"wheel":ae=XS;break;case"copy":case"cut":case"paste":ae=IS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=gm;break;case"toggle":case"beforetoggle":ae=JS}var je=(i&4)!==0,dt=!je&&(t==="scroll"||t==="scrollend"),Y=je?te!==null?te+"Capture":null:te;je=[];for(var q=ee,J;q!==null;){var oe=q;if(J=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||J===null||Y===null||(oe=bl(q,Y),oe!=null&&je.push(Jl(q,oe,J))),dt)break;q=q.return}0<je.length&&(te=new ae(te,xe,null,l,re),ce.push({event:te,listeners:je}))}}if((i&7)===0){e:{if(te=t==="mouseover"||t==="pointerover",ae=t==="mouseout"||t==="pointerout",te&&l!==xu&&(xe=l.relatedTarget||l.fromElement)&&(Ra(xe)||xe[an]))break e;if((ae||te)&&(te=re.window===re?re:(te=re.ownerDocument)?te.defaultView||te.parentWindow:window,ae?(xe=l.relatedTarget||l.toElement,ae=ee,xe=xe?Ra(xe):null,xe!==null&&(dt=s(xe),je=xe.tag,xe!==dt||je!==5&&je!==27&&je!==6)&&(xe=null)):(ae=null,xe=ee),ae!==xe)){if(je=hm,oe="onMouseLeave",Y="onMouseEnter",q="mouse",(t==="pointerout"||t==="pointerover")&&(je=gm,oe="onPointerLeave",Y="onPointerEnter",q="pointer"),dt=ae==null?te:sn(ae),J=xe==null?te:sn(xe),te=new je(oe,q+"leave",ae,l,re),te.target=dt,te.relatedTarget=J,oe=null,Ra(re)===ee&&(je=new je(Y,q+"enter",xe,l,re),je.target=J,je.relatedTarget=dt,oe=je),dt=oe,ae&&xe)t:{for(je=Zk,Y=ae,q=xe,J=0,oe=Y;oe;oe=je(oe))J++;oe=0;for(var Ee=q;Ee;Ee=je(Ee))oe++;for(;0<J-oe;)Y=je(Y),J--;for(;0<oe-J;)q=je(q),oe--;for(;J--;){if(Y===q||q!==null&&Y===q.alternate){je=Y;break t}Y=je(Y),q=je(q)}je=null}else je=null;ae!==null&&ov(ce,te,ae,je,!1),xe!==null&&dt!==null&&ov(ce,dt,xe,je,!0)}}e:{if(te=ee?sn(ee):window,ae=te.nodeName&&te.nodeName.toLowerCase(),ae==="select"||ae==="input"&&te.type==="file")var Ze=Cm;else if(Sm(te))if(Em)Ze=ck;else{Ze=ok;var we=lk}else ae=te.nodeName,!ae||ae.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ee&&vu(ee.elementType)&&(Ze=Cm):Ze=sk;if(Ze&&(Ze=Ze(t,ee))){km(ce,Ze,l,re);break e}we&&we(t,te,ee),t==="focusout"&&ee&&te.type==="number"&&ee.memoizedProps.value!=null&&yu(te,"number",te.value)}switch(we=ee?sn(ee):window,t){case"focusin":(Sm(we)||we.contentEditable==="true")&&(kr=we,Ou=ee,Tl=null);break;case"focusout":Tl=Ou=kr=null;break;case"mousedown":Du=!0;break;case"contextmenu":case"mouseup":case"dragend":Du=!1,Dm(ce,l,re);break;case"selectionchange":if(dk)break;case"keydown":case"keyup":Dm(ce,l,re)}var ze;if(Tu)e:{switch(t){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else Sr?bm(t,l)&&(Ge="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ge="onCompositionStart");Ge&&(ym&&l.locale!=="ko"&&(Sr||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&Sr&&(ze=fm()):(ii=re,ku="value"in ii?ii.value:ii.textContent,Sr=!0)),we=Gs(ee,Ge),0<we.length&&(Ge=new mm(Ge,t,null,l,re),ce.push({event:Ge,listeners:we}),ze?Ge.data=ze:(ze=wm(l),ze!==null&&(Ge.data=ze)))),(ze=tk?nk(t,l):ak(t,l))&&(Ge=Gs(ee,"onBeforeInput"),0<Ge.length&&(we=new mm("onBeforeInput","beforeinput",null,l,re),ce.push({event:we,listeners:Ge}),we.data=ze)),Yk(ce,t,ee,l,re)}rv(ce,i)})}function Jl(t,i,l){return{instance:t,listener:i,currentTarget:l}}function Gs(t,i){for(var l=i+"Capture",c=[];t!==null;){var h=t,v=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||v===null||(h=bl(t,l),h!=null&&c.unshift(Jl(t,h,v)),h=bl(t,i),h!=null&&c.push(Jl(t,h,v))),t.tag===3)return c;t=t.return}return[]}function Zk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function ov(t,i,l,c,h){for(var v=i._reactName,w=[];l!==null&&l!==c;){var A=l,z=A.alternate,ee=A.stateNode;if(A=A.tag,z!==null&&z===c)break;A!==5&&A!==26&&A!==27||ee===null||(z=ee,h?(ee=bl(l,v),ee!=null&&w.unshift(Jl(l,ee,z))):h||(ee=bl(l,v),ee!=null&&w.push(Jl(l,ee,z)))),l=l.return}w.length!==0&&t.push({event:i,listeners:w})}var Jk=/\r\n?/g,e2=/\u0000|\uFFFD/g;function sv(t){return(typeof t=="string"?t:""+t).replace(Jk,`
50
- `).replace(e2,"")}function cv(t,i){return i=sv(i),sv(t)===i}function ut(t,i,l,c,h,v){switch(l){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||xr(t,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&xr(t,""+c);break;case"className":Bi(t,"class",c);break;case"tabIndex":Bi(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Bi(t,l,c);break;case"style":cm(t,c,v);break;case"data":if(i!=="object"){Bi(t,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||l!=="href")){t.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Xo(""+c),t.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(l==="formAction"?(i!=="input"&&ut(t,i,"name",h.name,h,null),ut(t,i,"formEncType",h.formEncType,h,null),ut(t,i,"formMethod",h.formMethod,h,null),ut(t,i,"formTarget",h.formTarget,h,null)):(ut(t,i,"encType",h.encType,h,null),ut(t,i,"method",h.method,h,null),ut(t,i,"target",h.target,h,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Xo(""+c),t.setAttribute(l,c);break;case"onClick":c!=null&&(t.onclick=Oa);break;case"onScroll":c!=null&&$e("scroll",t);break;case"onScrollEnd":c!=null&&$e("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(l=c.__html,l!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}l=Xo(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""+c):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":c===!0?t.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,c):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(l,c):t.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(l):t.setAttribute(l,c);break;case"popover":$e("beforetoggle",t),$e("toggle",t),un(t,"popover",c);break;case"xlinkActuate":xn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":xn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":xn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":xn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":xn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":xn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":xn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":xn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":xn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":un(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=TS.get(l)||l,un(t,l,c))}}function rf(t,i,l,c,h,v){switch(l){case"style":cm(t,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(l=c.__html,l!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof c=="string"?xr(t,c):(typeof c=="number"||typeof c=="bigint")&&xr(t,""+c);break;case"onScroll":c!=null&&$e("scroll",t);break;case"onScrollEnd":c!=null&&$e("scrollend",t);break;case"onClick":c!=null&&(t.onclick=Oa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ma.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(h=l.endsWith("Capture"),i=l.slice(2,h?l.length-7:void 0),v=t[_e]||null,v=v!=null?v[l]:null,typeof v=="function"&&t.removeEventListener(i,v,h),typeof c=="function")){typeof v!="function"&&v!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(i,c,h);break e}l in t?t[l]=c:c===!0?t.setAttribute(l,""):un(t,l,c)}}}function nn(t,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",t),$e("load",t);var c=!1,h=!1,v;for(v in l)if(l.hasOwnProperty(v)){var w=l[v];if(w!=null)switch(v){case"src":c=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:ut(t,i,v,w,l,null)}}h&&ut(t,i,"srcSet",l.srcSet,l,null),c&&ut(t,i,"src",l.src,l,null);return;case"input":$e("invalid",t);var A=v=w=h=null,z=null,ee=null;for(c in l)if(l.hasOwnProperty(c)){var re=l[c];if(re!=null)switch(c){case"name":h=re;break;case"type":w=re;break;case"checked":z=re;break;case"defaultChecked":ee=re;break;case"value":v=re;break;case"defaultValue":A=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,i));break;default:ut(t,i,c,re,l,null)}}rm(t,v,A,z,ee,w,h,!1);return;case"select":$e("invalid",t),c=w=v=null;for(h in l)if(l.hasOwnProperty(h)&&(A=l[h],A!=null))switch(h){case"value":v=A;break;case"defaultValue":w=A;break;case"multiple":c=A;default:ut(t,i,h,A,l,null)}i=v,l=w,t.multiple=!!c,i!=null?vr(t,!!c,i,!1):l!=null&&vr(t,!!c,l,!0);return;case"textarea":$e("invalid",t),v=h=c=null;for(w in l)if(l.hasOwnProperty(w)&&(A=l[w],A!=null))switch(w){case"value":c=A;break;case"defaultValue":h=A;break;case"children":v=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(91));break;default:ut(t,i,w,A,l,null)}om(t,c,h,v);return;case"option":for(z in l)if(l.hasOwnProperty(z)&&(c=l[z],c!=null))switch(z){case"selected":t.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:ut(t,i,z,c,l,null)}return;case"dialog":$e("beforetoggle",t),$e("toggle",t),$e("cancel",t),$e("close",t);break;case"iframe":case"object":$e("load",t);break;case"video":case"audio":for(c=0;c<Zl.length;c++)$e(Zl[c],t);break;case"image":$e("error",t),$e("load",t);break;case"details":$e("toggle",t);break;case"embed":case"source":case"link":$e("error",t),$e("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in l)if(l.hasOwnProperty(ee)&&(c=l[ee],c!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:ut(t,i,ee,c,l,null)}return;default:if(vu(i)){for(re in l)l.hasOwnProperty(re)&&(c=l[re],c!==void 0&&rf(t,i,re,c,l,void 0));return}}for(A in l)l.hasOwnProperty(A)&&(c=l[A],c!=null&&ut(t,i,A,c,l,null))}function t2(t,i,l,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,v=null,w=null,A=null,z=null,ee=null,re=null;for(ae in l){var ce=l[ae];if(l.hasOwnProperty(ae)&&ce!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":z=ce;default:c.hasOwnProperty(ae)||ut(t,i,ae,null,c,ce)}}for(var te in c){var ae=c[te];if(ce=l[te],c.hasOwnProperty(te)&&(ae!=null||ce!=null))switch(te){case"type":v=ae;break;case"name":h=ae;break;case"checked":ee=ae;break;case"defaultChecked":re=ae;break;case"value":w=ae;break;case"defaultValue":A=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,i));break;default:ae!==ce&&ut(t,i,te,ae,c,ce)}}gu(t,w,A,z,ee,re,v,h);return;case"select":ae=w=A=te=null;for(v in l)if(z=l[v],l.hasOwnProperty(v)&&z!=null)switch(v){case"value":break;case"multiple":ae=z;default:c.hasOwnProperty(v)||ut(t,i,v,null,c,z)}for(h in c)if(v=c[h],z=l[h],c.hasOwnProperty(h)&&(v!=null||z!=null))switch(h){case"value":te=v;break;case"defaultValue":A=v;break;case"multiple":w=v;default:v!==z&&ut(t,i,h,v,c,z)}i=A,l=w,c=ae,te!=null?vr(t,!!l,te,!1):!!c!=!!l&&(i!=null?vr(t,!!l,i,!0):vr(t,!!l,l?[]:"",!1));return;case"textarea":ae=te=null;for(A in l)if(h=l[A],l.hasOwnProperty(A)&&h!=null&&!c.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:ut(t,i,A,null,c,h)}for(w in c)if(h=c[w],v=l[w],c.hasOwnProperty(w)&&(h!=null||v!=null))switch(w){case"value":te=h;break;case"defaultValue":ae=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(r(91));break;default:h!==v&&ut(t,i,w,h,c,v)}lm(t,te,ae);return;case"option":for(var xe in l)if(te=l[xe],l.hasOwnProperty(xe)&&te!=null&&!c.hasOwnProperty(xe))switch(xe){case"selected":t.selected=!1;break;default:ut(t,i,xe,null,c,te)}for(z in c)if(te=c[z],ae=l[z],c.hasOwnProperty(z)&&te!==ae&&(te!=null||ae!=null))switch(z){case"selected":t.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:ut(t,i,z,te,c,ae)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var je in l)te=l[je],l.hasOwnProperty(je)&&te!=null&&!c.hasOwnProperty(je)&&ut(t,i,je,null,c,te);for(ee in c)if(te=c[ee],ae=l[ee],c.hasOwnProperty(ee)&&te!==ae&&(te!=null||ae!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,i));break;default:ut(t,i,ee,te,c,ae)}return;default:if(vu(i)){for(var dt in l)te=l[dt],l.hasOwnProperty(dt)&&te!==void 0&&!c.hasOwnProperty(dt)&&rf(t,i,dt,void 0,c,te);for(re in c)te=c[re],ae=l[re],!c.hasOwnProperty(re)||te===ae||te===void 0&&ae===void 0||rf(t,i,re,te,c,ae);return}}for(var Y in l)te=l[Y],l.hasOwnProperty(Y)&&te!=null&&!c.hasOwnProperty(Y)&&ut(t,i,Y,null,c,te);for(ce in c)te=c[ce],ae=l[ce],!c.hasOwnProperty(ce)||te===ae||te==null&&ae==null||ut(t,i,ce,te,c,ae)}function uv(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function n2(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var h=l[c],v=h.transferSize,w=h.initiatorType,A=h.duration;if(v&&A&&uv(w)){for(w=0,A=h.responseEnd,c+=1;c<l.length;c++){var z=l[c],ee=z.startTime;if(ee>A)break;var re=z.transferSize,ce=z.initiatorType;re&&uv(ce)&&(z=z.responseEnd,w+=re*(z<A?1:(A-ee)/(z-ee)))}if(--c,i+=8*(v+w)/(h.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var lf=null,of=null;function Vs(t){return t.nodeType===9?t:t.ownerDocument}function dv(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fv(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function sf(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var cf=null;function a2(){var t=window.event;return t&&t.type==="popstate"?t===cf?!1:(cf=t,!0):(cf=null,!1)}var pv=typeof setTimeout=="function"?setTimeout:void 0,i2=typeof clearTimeout=="function"?clearTimeout:void 0,hv=typeof Promise=="function"?Promise:void 0,r2=typeof queueMicrotask=="function"?queueMicrotask:typeof hv<"u"?function(t){return hv.resolve(null).then(t).catch(l2)}:pv;function l2(t){setTimeout(function(){throw t})}function wi(t){return t==="head"}function mv(t,i){var l=i,c=0;do{var h=l.nextSibling;if(t.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(c===0){t.removeChild(h),Qr(i);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")eo(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,eo(l);for(var v=l.firstChild;v;){var w=v.nextSibling,A=v.nodeName;v[ha]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=w}}else l==="body"&&eo(t.ownerDocument.body);l=h}while(l);Qr(i)}function gv(t,i){var l=t;t=0;do{var c=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=c}while(l)}function uf(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":uf(l),yr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function o2(t,i,l,c){for(;t.nodeType===1;){var h=l;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[ha])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(v=t.getAttribute("rel"),v==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(v!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(v=t.getAttribute("src"),(v!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&v&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var v=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===v)return t}else return t;if(t=Jn(t.nextSibling),t===null)break}return null}function s2(t,i,l){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Jn(t.nextSibling),t===null))return null;return t}function yv(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Jn(t.nextSibling),t===null))return null;return t}function df(t){return t.data==="$?"||t.data==="$~"}function ff(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function c2(t,i){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||l.readyState!=="loading")i();else{var c=function(){i(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function Jn(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var pf=null;function vv(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(i===0)return Jn(t.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}t=t.nextSibling}return null}function xv(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return t;i--}else l!=="/$"&&l!=="/&"||i++}t=t.previousSibling}return null}function bv(t,i,l){switch(i=Vs(l),t){case"html":if(t=i.documentElement,!t)throw Error(r(452));return t;case"head":if(t=i.head,!t)throw Error(r(453));return t;case"body":if(t=i.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function eo(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);yr(t)}var ea=new Map,wv=new Set;function Ws(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ya=Z.d;Z.d={f:u2,r:d2,D:f2,C:p2,L:h2,m:m2,X:y2,S:g2,M:v2};function u2(){var t=Ya.f(),i=Ps();return t||i}function d2(t){var i=Yt(t);i!==null&&i.tag===5&&i.type==="form"?Pg(i):Ya.r(t)}var Wr=typeof document>"u"?null:document;function Sv(t,i,l){var c=Wr;if(c&&typeof i=="string"&&i){var h=Vn(i);h='link[rel="'+t+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),wv.has(h)||(wv.add(h),t={rel:t,crossOrigin:l,href:i},c.querySelector(h)===null&&(i=c.createElement("link"),nn(i,"link",t),At(i),c.head.appendChild(i)))}}function f2(t){Ya.D(t),Sv("dns-prefetch",t,null)}function p2(t,i){Ya.C(t,i),Sv("preconnect",t,i)}function h2(t,i,l){Ya.L(t,i,l);var c=Wr;if(c&&t&&i){var h='link[rel="preload"][as="'+Vn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+Vn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+Vn(l.imageSizes)+'"]')):h+='[href="'+Vn(t)+'"]';var v=h;switch(i){case"style":v=Yr(t);break;case"script":v=Kr(t)}ea.has(v)||(t=g({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:t,as:i},l),ea.set(v,t),c.querySelector(h)!==null||i==="style"&&c.querySelector(to(v))||i==="script"&&c.querySelector(no(v))||(i=c.createElement("link"),nn(i,"link",t),At(i),c.head.appendChild(i)))}}function m2(t,i){Ya.m(t,i);var l=Wr;if(l&&t){var c=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Vn(c)+'"][href="'+Vn(t)+'"]',v=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Kr(t)}if(!ea.has(v)&&(t=g({rel:"modulepreload",href:t},i),ea.set(v,t),l.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(no(v)))return}c=l.createElement("link"),nn(c,"link",t),At(c),l.head.appendChild(c)}}}function g2(t,i,l){Ya.S(t,i,l);var c=Wr;if(c&&t){var h=Fn(c).hoistableStyles,v=Yr(t);i=i||"default";var w=h.get(v);if(!w){var A={loading:0,preload:null};if(w=c.querySelector(to(v)))A.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":i},l),(l=ea.get(v))&&hf(t,l);var z=w=c.createElement("link");At(z),nn(z,"link",t),z._p=new Promise(function(ee,re){z.onload=ee,z.onerror=re}),z.addEventListener("load",function(){A.loading|=1}),z.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Ys(w,i,c)}w={type:"stylesheet",instance:w,count:1,state:A},h.set(v,w)}}}function y2(t,i){Ya.X(t,i);var l=Wr;if(l&&t){var c=Fn(l).hoistableScripts,h=Kr(t),v=c.get(h);v||(v=l.querySelector(no(h)),v||(t=g({src:t,async:!0},i),(i=ea.get(h))&&mf(t,i),v=l.createElement("script"),At(v),nn(v,"link",t),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(h,v))}}function v2(t,i){Ya.M(t,i);var l=Wr;if(l&&t){var c=Fn(l).hoistableScripts,h=Kr(t),v=c.get(h);v||(v=l.querySelector(no(h)),v||(t=g({src:t,async:!0,type:"module"},i),(i=ea.get(h))&&mf(t,i),v=l.createElement("script"),At(v),nn(v,"link",t),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(h,v))}}function kv(t,i,l,c){var h=(h=he.current)?Ws(h):null;if(!h)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=Yr(l.href),l=Fn(h).hoistableStyles,c=l.get(i),c||(c={type:"style",instance:null,count:0,state:null},l.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Yr(l.href);var v=Fn(h).hoistableStyles,w=v.get(t);if(w||(h=h.ownerDocument||h,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(t,w),(v=h.querySelector(to(t)))&&!v._p&&(w.instance=v,w.state.loading=5),ea.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ea.set(t,l),v||x2(h,t,l,w.state))),i&&c===null)throw Error(r(528,""));return w}if(i&&c!==null)throw Error(r(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Kr(l),l=Fn(h).hoistableScripts,c=l.get(i),c||(c={type:"script",instance:null,count:0,state:null},l.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Yr(t){return'href="'+Vn(t)+'"'}function to(t){return'link[rel="stylesheet"]['+t+"]"}function Cv(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function x2(t,i,l,c){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=t.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),nn(i,"link",l),At(i),t.head.appendChild(i))}function Kr(t){return'[src="'+Vn(t)+'"]'}function no(t){return"script[async]"+t}function Ev(t,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var c=t.querySelector('style[data-href~="'+Vn(l.href)+'"]');if(c)return i.instance=c,At(c),c;var h=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),At(c),nn(c,"style",h),Ys(c,l.precedence,t),i.instance=c;case"stylesheet":h=Yr(l.href);var v=t.querySelector(to(h));if(v)return i.state.loading|=4,i.instance=v,At(v),v;c=Cv(l),(h=ea.get(h))&&hf(c,h),v=(t.ownerDocument||t).createElement("link"),At(v);var w=v;return w._p=new Promise(function(A,z){w.onload=A,w.onerror=z}),nn(v,"link",c),i.state.loading|=4,Ys(v,l.precedence,t),i.instance=v;case"script":return v=Kr(l.src),(h=t.querySelector(no(v)))?(i.instance=h,At(h),h):(c=l,(h=ea.get(v))&&(c=g({},l),mf(c,h)),t=t.ownerDocument||t,h=t.createElement("script"),At(h),nn(h,"link",c),t.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,Ys(c,l.precedence,t));return i.instance}function Ys(t,i,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,v=h,w=0;w<c.length;w++){var A=c[w];if(A.dataset.precedence===i)v=A;else if(v!==h)break}v?v.parentNode.insertBefore(t,v.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(t,i.firstChild))}function hf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function mf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var Ks=null;function Av(t,i,l){if(Ks===null){var c=new Map,h=Ks=new Map;h.set(l,c)}else h=Ks,c=h.get(l),c||(c=new Map,h.set(l,c));if(c.has(t))return c;for(c.set(t,null),l=l.getElementsByTagName(t),h=0;h<l.length;h++){var v=l[h];if(!(v[ha]||v[Se]||t==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(i)||"";w=t+w;var A=c.get(w);A?A.push(v):c.set(w,[v])}}return c}function jv(t,i,l){t=t.ownerDocument||t,t.head.insertBefore(l,i==="title"?t.querySelector("head > title"):null)}function b2(t,i,l){if(l===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Tv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function w2(t,i,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=Yr(c.href),v=i.querySelector(to(h));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=Qs.bind(t),i.then(t,t)),l.state.loading|=4,l.instance=v,At(v);return}v=i.ownerDocument||i,c=Cv(c),(h=ea.get(h))&&hf(c,h),v=v.createElement("link"),At(v);var w=v;w._p=new Promise(function(A,z){w.onload=A,w.onerror=z}),nn(v,"link",c),l.instance=v}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Qs.bind(t),i.addEventListener("load",l),i.addEventListener("error",l))}}var gf=0;function S2(t,i){return t.stylesheets&&t.count===0&&Zs(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var c=setTimeout(function(){if(t.stylesheets&&Zs(t,t.stylesheets),t.unsuspend){var v=t.unsuspend;t.unsuspend=null,v()}},6e4+i);0<t.imgBytes&&gf===0&&(gf=62500*n2());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Zs(t,t.stylesheets),t.unsuspend)){var v=t.unsuspend;t.unsuspend=null,v()}},(t.imgBytes>gf?50:800)+i);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function Qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zs(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Xs=null;function Zs(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Xs=new Map,i.forEach(k2,t),Xs=null,Qs.call(t))}function k2(t,i){if(!(i.state.loading&4)){var l=Xs.get(t);if(l)var c=l.get(null);else{l=new Map,Xs.set(t,l);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<h.length;v++){var w=h[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(l.set(w.dataset.precedence,w),c=w)}c&&l.set(null,c)}h=i.instance,w=h.getAttribute("data-precedence"),v=l.get(w)||c,v===c&&l.set(null,h),l.set(w,h),this.count++,c=Qs.bind(this),h.addEventListener("load",c),h.addEventListener("error",c),v?v.parentNode.insertBefore(h,v.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),i.state.loading|=4}}var ao={$$typeof:O,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function C2(t,i,l,c,h,v,w,A,z){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=yl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yl(0),this.hiddenUpdates=yl(null),this.identifierPrefix=c,this.onUncaughtError=h,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function Nv(t,i,l,c,h,v,w,A,z,ee,re,ce){return t=new C2(t,i,l,w,z,ee,re,ce,A),i=1,v===!0&&(i|=24),v=Rn(3,null,null,i),t.current=v,v.stateNode=t,i=Yu(),i.refCount++,t.pooledCache=i,i.refCount++,v.memoizedState={element:c,isDehydrated:l,cache:i},Zu(v),t}function Rv(t){return t?(t=Ar,t):Ar}function _v(t,i,l,c,h,v){h=Rv(h),c.context===null?c.context=h:c.pendingContext=h,c=ui(i),c.payload={element:l},v=v===void 0?null:v,v!==null&&(c.callback=v),l=di(t,c,i),l!==null&&(En(l,t,i),Ll(l,t,i))}function Ov(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<i?l:i}}function yf(t,i){Ov(t,i),(t=t.alternate)&&Ov(t,i)}function Dv(t){if(t.tag===13||t.tag===31){var i=Fi(t,67108864);i!==null&&En(i,t,67108864),yf(t,67108864)}}function Mv(t){if(t.tag===13||t.tag===31){var i=Ln();i=Ce(i);var l=Fi(t,i);l!==null&&En(l,t,i),yf(t,i)}}var Js=!0;function E2(t,i,l,c){var h=P.T;P.T=null;var v=Z.p;try{Z.p=2,vf(t,i,l,c)}finally{Z.p=v,P.T=h}}function A2(t,i,l,c){var h=P.T;P.T=null;var v=Z.p;try{Z.p=8,vf(t,i,l,c)}finally{Z.p=v,P.T=h}}function vf(t,i,l,c){if(Js){var h=xf(c);if(h===null)af(t,i,c,ec,l),zv(t,c);else if(T2(h,t,i,l,c))c.stopPropagation();else if(zv(t,c),i&4&&-1<j2.indexOf(t)){for(;h!==null;){var v=Yt(h);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Ta(v.pendingLanes);if(w!==0){var A=v;for(A.pendingLanes|=2,A.entangledLanes|=2;w;){var z=1<<31-ke(w);A.entanglements[1]|=z,w&=~z}xa(v),(tt&6)===0&&(zs=it()+500,Xl(0))}}break;case 31:case 13:A=Fi(v,2),A!==null&&En(A,v,2),Ps(),yf(v,2)}if(v=xf(c),v===null&&af(t,i,c,ec,l),v===h)break;h=v}h!==null&&c.stopPropagation()}else af(t,i,c,null,l)}}function xf(t){return t=bu(t),bf(t)}var ec=null;function bf(t){if(ec=null,t=Ra(t),t!==null){var i=s(t);if(i===null)t=null;else{var l=i.tag;if(l===13){if(t=u(i),t!==null)return t;t=null}else if(l===31){if(t=d(i),t!==null)return t;t=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return ec=t,null}function Lv(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(fe()){case $:return 2;case le:return 8;case me:case ye:return 32;case I:return 268435456;default:return 32}default:return 32}}var wf=!1,Si=null,ki=null,Ci=null,io=new Map,ro=new Map,Ei=[],j2="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 zv(t,i){switch(t){case"focusin":case"focusout":Si=null;break;case"dragenter":case"dragleave":ki=null;break;case"mouseover":case"mouseout":Ci=null;break;case"pointerover":case"pointerout":io.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":ro.delete(i.pointerId)}}function lo(t,i,l,c,h,v){return t===null||t.nativeEvent!==v?(t={blockedOn:i,domEventName:l,eventSystemFlags:c,nativeEvent:v,targetContainers:[h]},i!==null&&(i=Yt(i),i!==null&&Dv(i)),t):(t.eventSystemFlags|=c,i=t.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),t)}function T2(t,i,l,c,h){switch(i){case"focusin":return Si=lo(Si,t,i,l,c,h),!0;case"dragenter":return ki=lo(ki,t,i,l,c,h),!0;case"mouseover":return Ci=lo(Ci,t,i,l,c,h),!0;case"pointerover":var v=h.pointerId;return io.set(v,lo(io.get(v)||null,t,i,l,c,h)),!0;case"gotpointercapture":return v=h.pointerId,ro.set(v,lo(ro.get(v)||null,t,i,l,c,h)),!0}return!1}function Iv(t){var i=Ra(t.target);if(i!==null){var l=s(i);if(l!==null){if(i=l.tag,i===13){if(i=u(l),i!==null){t.blockedOn=i,lt(t.priority,function(){Mv(l)});return}}else if(i===31){if(i=d(l),i!==null){t.blockedOn=i,lt(t.priority,function(){Mv(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function tc(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var l=xf(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);xu=c,l.target.dispatchEvent(c),xu=null}else return i=Yt(l),i!==null&&Dv(i),t.blockedOn=l,!1;i.shift()}return!0}function Pv(t,i,l){tc(t)&&l.delete(i)}function N2(){wf=!1,Si!==null&&tc(Si)&&(Si=null),ki!==null&&tc(ki)&&(ki=null),Ci!==null&&tc(Ci)&&(Ci=null),io.forEach(Pv),ro.forEach(Pv)}function nc(t,i){t.blockedOn===i&&(t.blockedOn=null,wf||(wf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,N2)))}var ac=null;function Uv(t){ac!==t&&(ac=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ac===t&&(ac=null);for(var i=0;i<t.length;i+=3){var l=t[i],c=t[i+1],h=t[i+2];if(typeof c!="function"){if(bf(c||l)===null)continue;break}var v=Yt(l);v!==null&&(t.splice(i,3),i-=3,vd(v,{pending:!0,data:h,method:l.method,action:c},c,h))}}))}function Qr(t){function i(z){return nc(z,t)}Si!==null&&nc(Si,t),ki!==null&&nc(ki,t),Ci!==null&&nc(Ci,t),io.forEach(i),ro.forEach(i);for(var l=0;l<Ei.length;l++){var c=Ei[l];c.blockedOn===t&&(c.blockedOn=null)}for(;0<Ei.length&&(l=Ei[0],l.blockedOn===null);)Iv(l),l.blockedOn===null&&Ei.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var h=l[c],v=l[c+1],w=h[_e]||null;if(typeof v=="function")w||Uv(l);else if(w){var A=null;if(v&&v.hasAttribute("formAction")){if(h=v,w=v[_e]||null)A=w.formAction;else if(bf(h)!==null)continue}else A=w.action;typeof A=="function"?l[c+1]=A:(l.splice(c,3),c-=3),Uv(l)}}}function Bv(){function t(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return h=w})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function Sf(t){this._internalRoot=t}ic.prototype.render=Sf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(r(409));var l=i.current,c=Ln();_v(l,c,t,i,null,null)},ic.prototype.unmount=Sf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;_v(t.current,2,null,t,null,null),Ps(),i[an]=null}};function ic(t){this._internalRoot=t}ic.prototype.unstable_scheduleHydration=function(t){if(t){var i=Ye();t={blockedOn:null,target:t,priority:i};for(var l=0;l<Ei.length&&i!==0&&i<Ei[l].priority;l++);Ei.splice(l,0,t),l===0&&Iv(t)}};var Hv=n.version;if(Hv!=="19.2.4")throw Error(r(527,Hv,"19.2.4"));Z.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=f(i),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var R2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{Pe=rc.inject(R2),Xe=rc}catch{}}return so.createRoot=function(t,i){if(!o(t))throw Error(r(299));var l=!1,c="",h=Yg,v=Kg,w=Qg;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=Nv(t,1,!1,null,null,l,c,null,h,v,w,Bv),t[an]=i.current,nf(t),new Sf(i)},so.hydrateRoot=function(t,i,l){if(!o(t))throw Error(r(299));var c=!1,h="",v=Yg,w=Kg,A=Qg,z=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(A=l.onRecoverableError),l.formState!==void 0&&(z=l.formState)),i=Nv(t,1,!0,i,l??null,c,h,z,v,w,A,Bv),i.context=Rv(null),l=i.current,c=Ln(),c=Ce(c),h=ui(c),h.callback=null,di(l,h,c),l=c,i.current.lanes=l,Ui(i,l),xa(i),t[an]=i.current,nf(t),new ic(i)},so.version="19.2.4",so}var Xv;function H2(){if(Xv)return Ef.exports;Xv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Ef.exports=B2(),Ef.exports}var $2=H2();/**
51
- * react-router v7.17.0
52
- *
53
- * Copyright (c) Remix Software Inc.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE.md file in the root directory of this source tree.
57
- *
58
- * @license MIT
59
- */var Zv="popstate";function Jv(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function q2(e={}){function n(r,o){var f;let s=(f=o.state)==null?void 0:f.masked,{pathname:u,search:d,hash:p}=s||r.location;return Np("",{pathname:u,search:d,hash:p},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function a(r,o){return typeof o=="string"?o:_o(o)}return G2(n,a,null,e)}function Et(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function fa(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function F2(){return Math.random().toString(36).substring(2,10)}function e0(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Np(e,n,a=null,r,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?sl(n):n,state:a,key:n&&n.key||r||F2(),mask:o}}function _o({pathname:e="/",search:n="",hash:a=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function sl(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substring(a),e=e.substring(0,a));let r=e.indexOf("?");r>=0&&(n.search=e.substring(r),e=e.substring(0,r)),e&&(n.pathname=e)}return n}function G2(e,n,a,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,u=o.history,d="POP",p=null,f=y();f==null&&(f=0,u.replaceState({...u.state,idx:f},""));function y(){return(u.state||{idx:null}).idx}function g(){d="POP";let j=y(),E=j==null?null:j-f;f=j,p&&p({action:d,location:C.location,delta:E})}function x(j,E){d="PUSH";let R=Jv(j)?j:Np(C.location,j,E);f=y()+1;let O=e0(R,f),G=C.createHref(R.mask||R);try{u.pushState(O,"",G)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;o.location.assign(G)}s&&p&&p({action:d,location:C.location,delta:1})}function b(j,E){d="REPLACE";let R=Jv(j)?j:Np(C.location,j,E);f=y();let O=e0(R,f),G=C.createHref(R.mask||R);u.replaceState(O,"",G),s&&p&&p({action:d,location:C.location,delta:0})}function k(j){return V2(o,j)}let C={get action(){return d},get location(){return e(o,u)},listen(j){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(Zv,g),p=j,()=>{o.removeEventListener(Zv,g),p=null}},createHref(j){return n(o,j)},createURL:k,encodeLocation(j){let E=k(j);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:b,go(j){return u.go(j)}};return C}function V2(e,n,a=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),Et(r,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:_o(n);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=r+o),new URL(o,r)}function _x(e,n,a="/"){return W2(e,n,a,!1)}function W2(e,n,a,r,o){let s=typeof n=="string"?sl(n):n,u=Za(s.pathname||"/",a);if(u==null)return null;let d=Y2(e),p=null,f=lC(u);for(let y=0;p==null&&y<d.length;++y)p=iC(d[y],f,r);return p}function Y2(e){let n=Ox(e);return K2(n),n}function Ox(e,n=[],a=[],r="",o=!1){let s=(u,d,p=o,f)=>{let y={relativePath:f===void 0?u.path||"":f,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(r)&&p)return;Et(y.relativePath.startsWith(r),`Absolute route path "${y.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(r.length)}let g=ua([r,y.relativePath]),x=a.concat(y);u.children&&u.children.length>0&&(Et(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Ox(u.children,n,x,g,p)),!(u.path==null&&!u.index)&&n.push({path:g,score:nC(g,u.index),routesMeta:x})};return e.forEach((u,d)=>{var p;if(u.path===""||!((p=u.path)!=null&&p.includes("?")))s(u,d);else for(let f of Dx(u.path))s(u,d,!0,f)}),n}function Dx(e){let n=e.split("/");if(n.length===0)return[];let[a,...r]=n,o=a.endsWith("?"),s=a.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let u=Dx(r.join("/")),d=[];return d.push(...u.map(p=>p===""?s:[s,p].join("/"))),o&&d.push(...u),d.map(p=>e.startsWith("/")&&p===""?"/":p)}function K2(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:aC(n.routesMeta.map(r=>r.childrenIndex),a.routesMeta.map(r=>r.childrenIndex)))}var Q2=/^:[\w-]+$/,X2=3,Z2=2,J2=1,eC=10,tC=-2,t0=e=>e==="*";function nC(e,n){let a=e.split("/"),r=a.length;return a.some(t0)&&(r+=tC),n&&(r+=Z2),a.filter(o=>!t0(o)).reduce((o,s)=>o+(Q2.test(s)?X2:s===""?J2:eC),r)}function aC(e,n){return e.length===n.length&&e.slice(0,-1).every((r,o)=>r===n[o])?e[e.length-1]-n[n.length-1]:0}function iC(e,n,a=!1){let{routesMeta:r}=e,o={},s="/",u=[];for(let d=0;d<r.length;++d){let p=r[d],f=d===r.length-1,y=s==="/"?n:n.slice(s.length)||"/",g=Rc({path:p.relativePath,caseSensitive:p.caseSensitive,end:f},y),x=p.route;if(!g&&f&&a&&!r[r.length-1].route.index&&(g=Rc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!g)return null;Object.assign(o,g.params),u.push({params:o,pathname:ua([s,g.pathname]),pathnameBase:uC(ua([s,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(s=ua([s,g.pathnameBase]))}return u}function Rc(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=rC(e.path,e.caseSensitive,e.end),o=n.match(a);if(!o)return null;let s=o[0],u=s.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:r.reduce((f,{paramName:y,isOptional:g},x)=>{if(y==="*"){let k=d[x]||"";u=s.slice(0,s.length-k.length).replace(/(.)\/+$/,"$1")}const b=d[x];return g&&!b?f[y]=void 0:f[y]=(b||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:u,pattern:e}}function rC(e,n=!1,a=!0){fa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,p,f,y)=>{if(r.push({paramName:d,isOptional:p!=null}),p){let g=y.charAt(f+u.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),r]}function lC(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return fa(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Za(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,r=e.charAt(a);return r&&r!=="/"?null:e.slice(a)||"/"}var oC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function sC(e,n="/"){let{pathname:a,search:r="",hash:o=""}=typeof e=="string"?sl(e):e,s;return a?(a=Mx(a),a.startsWith("/")?s=n0(a.substring(1),"/"):s=n0(a,n)):s=n,{pathname:s,search:dC(r),hash:fC(o)}}function n0(e,n){let a=_c(n).split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function Nf(e,n,a,r){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function cC(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function sh(e){let n=cC(e);return n.map((a,r)=>r===n.length-1?a.pathname:a.pathnameBase)}function Zc(e,n,a,r=!1){let o;typeof e=="string"?o=sl(e):(o={...e},Et(!o.pathname||!o.pathname.includes("?"),Nf("?","pathname","search",o)),Et(!o.pathname||!o.pathname.includes("#"),Nf("#","pathname","hash",o)),Et(!o.search||!o.search.includes("#"),Nf("#","search","hash",o)));let s=e===""||o.pathname==="",u=s?"/":o.pathname,d;if(u==null)d=a;else{let g=n.length-1;if(!r&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),g-=1;o.pathname=x.join("/")}d=g>=0?n[g]:"/"}let p=sC(o,d),f=u&&u!=="/"&&u.endsWith("/"),y=(s||u===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(f||y)&&(p.pathname+="/"),p}var Mx=e=>e.replace(/\/\/+/g,"/"),ua=e=>Mx(e.join("/")),_c=e=>e.replace(/\/+$/,""),uC=e=>_c(e).replace(/^\/*/,"/"),dC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,pC=class{constructor(e,n,a,r=!1){this.status=e,this.statusText=n||"",this.internal=r,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function hC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function mC(e){let n=e.map(a=>a.route.path).filter(Boolean);return ua(n)||"/"}var Lx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function zx(e,n){let a=e;if(typeof a!="string"||!oC.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let r=a,o=!1;if(Lx)try{let s=new URL(window.location.href),u=a.startsWith("//")?new URL(s.protocol+a):new URL(a),d=Za(u.pathname,n);u.origin===s.origin&&d!=null?a=d+u.search+u.hash:o=!0}catch{fa(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ix=["POST","PUT","PATCH","DELETE"];new Set(Ix);var gC=["GET",...Ix];new Set(gC);var cl=S.createContext(null);cl.displayName="DataRouter";var Jc=S.createContext(null);Jc.displayName="DataRouterState";var Px=S.createContext(!1);function yC(){return S.useContext(Px)}var Ux=S.createContext({isTransitioning:!1});Ux.displayName="ViewTransition";var vC=S.createContext(new Map);vC.displayName="Fetchers";var xC=S.createContext(null);xC.displayName="Await";var $n=S.createContext(null);$n.displayName="Navigation";var Uo=S.createContext(null);Uo.displayName="Location";var Ea=S.createContext({outlet:null,matches:[],isDataRoute:!1});Ea.displayName="Route";var ch=S.createContext(null);ch.displayName="RouteError";var Bx="REACT_ROUTER_ERROR",bC="REDIRECT",wC="ROUTE_ERROR_RESPONSE";function SC(e){if(e.startsWith(`${Bx}:${bC}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function kC(e){if(e.startsWith(`${Bx}:${wC}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new pC(n.status,n.statusText,n.data)}catch{}}function CC(e,{relative:n}={}){Et(ul(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:r}=S.useContext($n),{hash:o,pathname:s,search:u}=Bo(e,{relative:n}),d=s;return a!=="/"&&(d=s==="/"?a:ua([a,s])),r.createHref({pathname:d,search:u,hash:o})}function ul(){return S.useContext(Uo)!=null}function pa(){return Et(ul(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(Uo).location}var Hx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function $x(e){S.useContext($n).static||S.useLayoutEffect(e)}function uh(){let{isDataRoute:e}=S.useContext(Ea);return e?IC():EC()}function EC(){Et(ul(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(cl),{basename:n,navigator:a}=S.useContext($n),{matches:r}=S.useContext(Ea),{pathname:o}=pa(),s=JSON.stringify(sh(r)),u=S.useRef(!1);return $x(()=>{u.current=!0}),S.useCallback((p,f={})=>{if(fa(u.current,Hx),!u.current)return;if(typeof p=="number"){a.go(p);return}let y=Zc(p,JSON.parse(s),o,f.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:ua([n,y.pathname])),(f.replace?a.replace:a.push)(y,f.state,f)},[n,a,s,o,e])}S.createContext(null);function Bo(e,{relative:n}={}){let{matches:a}=S.useContext(Ea),{pathname:r}=pa(),o=JSON.stringify(sh(a));return S.useMemo(()=>Zc(e,JSON.parse(o),r,n==="path"),[e,o,r,n])}function AC(e,n){return qx(e,n)}function qx(e,n,a){var j;Et(ul(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=S.useContext($n),{matches:o}=S.useContext(Ea),s=o[o.length-1],u=s?s.params:{},d=s?s.pathname:"/",p=s?s.pathnameBase:"/",f=s&&s.route;{let E=f&&f.path||"";Gx(d,!f||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
-
61
- Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=pa(),g;if(n){let E=typeof n=="string"?sl(n):n;Et(p==="/"||((j=E.pathname)==null?void 0:j.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${E.pathname}" was given in the \`location\` prop.`),g=E}else g=y;let x=g.pathname||"/",b=x;if(p!=="/"){let E=p.replace(/^\//,"").split("/");b="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=a&&a.state.matches.length?a.state.matches.map(E=>Object.assign(E,{route:a.manifest[E.route.id]||E.route})):_x(e,{pathname:b});fa(f||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),fa(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=_C(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},u,E.params),pathname:ua([p,r.encodeLocation?r.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?p:ua([p,r.encodeLocation?r.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),o,a);return n&&C?S.createElement(Uo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},C):C}function jC(){let e=zC(),n=hC(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:s},"ErrorBoundary")," or"," ",S.createElement("code",{style:s},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},n),a?S.createElement("pre",{style:o},a):null,u)}var TC=S.createElement(jC,null),Fx=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=kC(e.digest);a&&(e=a)}let n=e!==void 0?S.createElement(Ea.Provider,{value:this.props.routeContext},S.createElement(ch.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?S.createElement(NC,{error:e},n):n}};Fx.contextType=Px;var Rf=new WeakMap;function NC({children:e,error:n}){let{basename:a}=S.useContext($n);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let r=SC(n.digest);if(r){let o=Rf.get(n);if(o)throw o;let s=zx(r.location,a);if(Lx&&!Rf.get(n))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw Rf.set(n,u),u}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function RC({routeContext:e,match:n,children:a}){let r=S.useContext(cl);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),S.createElement(Ea.Provider,{value:e},a)}function _C(e,n=[],a){let r=a==null?void 0:a.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(n.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=r==null?void 0:r.errors;if(s!=null){let y=o.findIndex(g=>g.route.id&&(s==null?void 0:s[g.route.id])!==void 0);Et(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,y+1))}let u=!1,d=-1;if(a&&r){u=r.renderFallback;for(let y=0;y<o.length;y++){let g=o[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(d=y),g.route.id){let{loaderData:x,errors:b}=r,k=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!b||b[g.route.id]===void 0);if(g.route.lazy||k){a.isStatic&&(u=!0),d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}}let p=a==null?void 0:a.onError,f=r&&p?(y,g)=>{var x,b;p(y,{location:r.location,params:((b=(x=r.matches)==null?void 0:x[0])==null?void 0:b.params)??{},pattern:mC(r.matches),errorInfo:g})}:void 0;return o.reduceRight((y,g,x)=>{let b,k=!1,C=null,j=null;r&&(b=s&&g.route.id?s[g.route.id]:void 0,C=g.route.errorElement||TC,u&&(d<0&&x===0?(Gx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,j=null):d===x&&(k=!0,j=g.route.hydrateFallbackElement||null)));let E=n.concat(o.slice(0,x+1)),R=()=>{let O;return b?O=C:k?O=j:g.route.Component?O=S.createElement(g.route.Component,null):g.route.element?O=g.route.element:O=y,S.createElement(RC,{match:g,routeContext:{outlet:y,matches:E,isDataRoute:r!=null},children:O})};return r&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?S.createElement(Fx,{location:r.location,revalidation:r.revalidation,component:C,error:b,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:f}):R()},null)}function dh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function OC(e){let n=S.useContext(cl);return Et(n,dh(e)),n}function DC(e){let n=S.useContext(Jc);return Et(n,dh(e)),n}function MC(e){let n=S.useContext(Ea);return Et(n,dh(e)),n}function fh(e){let n=MC(e),a=n.matches[n.matches.length-1];return Et(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function LC(){return fh("useRouteId")}function zC(){var r;let e=S.useContext(ch),n=DC("useRouteError"),a=fh("useRouteError");return e!==void 0?e:(r=n.errors)==null?void 0:r[a]}function IC(){let{router:e}=OC("useNavigate"),n=fh("useNavigate"),a=S.useRef(!1);return $x(()=>{a.current=!0}),S.useCallback(async(o,s={})=>{fa(a.current,Hx),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...s}))},[e,n])}var a0={};function Gx(e,n,a){!n&&!a0[e]&&(a0[e]=!0,fa(!1,a))}S.memo(PC);function PC({routes:e,manifest:n,future:a,state:r,isStatic:o,onError:s}){return qx(e,void 0,{manifest:n,state:r,isStatic:o,onError:s})}function So({to:e,replace:n,state:a,relative:r}){Et(ul(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=S.useContext($n);fa(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=S.useContext(Ea),{pathname:u}=pa(),d=uh(),p=Zc(e,sh(s),u,r==="path"),f=JSON.stringify(p);return S.useEffect(()=>{d(JSON.parse(f),{replace:n,state:a,relative:r})},[d,f,r,n,a]),null}function Ni(e){Et(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function UC({basename:e="/",children:n=null,location:a,navigationType:r="POP",navigator:o,static:s=!1,useTransitions:u}){Et(!ul(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),p=S.useMemo(()=>({basename:d,navigator:o,static:s,useTransitions:u,future:{}}),[d,o,s,u]);typeof a=="string"&&(a=sl(a));let{pathname:f="/",search:y="",hash:g="",state:x=null,key:b="default",mask:k}=a,C=S.useMemo(()=>{let j=Za(f,d);return j==null?null:{location:{pathname:j,search:y,hash:g,state:x,key:b,mask:k},navigationType:r}},[d,f,y,g,x,b,r,k]);return fa(C!=null,`<Router basename="${d}"> is not able to match the URL "${f}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:S.createElement($n.Provider,{value:p},S.createElement(Uo.Provider,{children:n,value:C}))}function BC({children:e,location:n}){return AC(Rp(e),n)}function Rp(e,n=[]){let a=[];return S.Children.forEach(e,(r,o)=>{if(!S.isValidElement(r))return;let s=[...n,o];if(r.type===S.Fragment){a.push.apply(a,Rp(r.props.children,s));return}Et(r.type===Ni,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Et(!r.props.index||!r.props.children,"An index route cannot have child routes.");let u={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(u.children=Rp(r.props.children,s)),a.push(u)}),a}var wc="get",Sc="application/x-www-form-urlencoded";function eu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function HC(e){return eu(e)&&e.tagName.toLowerCase()==="button"}function $C(e){return eu(e)&&e.tagName.toLowerCase()==="form"}function qC(e){return eu(e)&&e.tagName.toLowerCase()==="input"}function FC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function GC(e,n){return e.button===0&&(!n||n==="_self")&&!FC(e)}var lc=null;function VC(){if(lc===null)try{new FormData(document.createElement("form"),0),lc=!1}catch{lc=!0}return lc}var WC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _f(e){return e!=null&&!WC.has(e)?(fa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sc}"`),null):e}function YC(e,n){let a,r,o,s,u;if($C(e)){let d=e.getAttribute("action");r=d?Za(d,n):null,a=e.getAttribute("method")||wc,o=_f(e.getAttribute("enctype"))||Sc,s=new FormData(e)}else if(HC(e)||qC(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||d.getAttribute("action");if(r=p?Za(p,n):null,a=e.getAttribute("formmethod")||d.getAttribute("method")||wc,o=_f(e.getAttribute("formenctype"))||_f(d.getAttribute("enctype"))||Sc,s=new FormData(d,e),!VC()){let{name:f,type:y,value:g}=e;if(y==="image"){let x=f?`${f}.`:"";s.append(`${x}x`,"0"),s.append(`${x}y`,"0")}else f&&s.append(f,g)}}else{if(eu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=wc,r=null,o=Sc,u=e}return s&&o==="text/plain"&&(u=s,s=void 0),{action:r,method:a.toLowerCase(),encType:o,formData:s,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ph(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Vx(e,n,a,r){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${r}`:o.pathname=`${o.pathname}.${r}`:o.pathname==="/"?o.pathname=`_root.${r}`:n&&Za(o.pathname,n)==="/"?o.pathname=`${_c(n)}/_root.${r}`:o.pathname=`${_c(o.pathname)}.${r}`,o}async function KC(e,n){if(e.id in n)return n[e.id];try{let a=await import(e.module);return n[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function QC(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function XC(e,n,a){let r=await Promise.all(e.map(async o=>{let s=n.routes[o.route.id];if(s){let u=await KC(s,a);return u.links?u.links():[]}return[]}));return tE(r.flat(1).filter(QC).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function i0(e,n,a,r,o,s){let u=(p,f)=>a[f]?p.route.id!==a[f].route.id:!0,d=(p,f)=>{var y;return a[f].pathname!==p.pathname||((y=a[f].route.path)==null?void 0:y.endsWith("*"))&&a[f].params["*"]!==p.params["*"]};return s==="assets"?n.filter((p,f)=>u(p,f)||d(p,f)):s==="data"?n.filter((p,f)=>{var g;let y=r.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(u(p,f)||d(p,f))return!0;if(p.route.shouldRevalidate){let x=p.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((g=a[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function ZC(e,n,{includeHydrateFallback:a}={}){return JC(e.map(r=>{let o=n.routes[r.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function JC(e){return[...new Set(e)]}function eE(e){let n={},a=Object.keys(e).sort();for(let r of a)n[r]=e[r];return n}function tE(e,n){let a=new Set;return new Set(n),e.reduce((r,o)=>{let s=JSON.stringify(eE(o));return a.has(s)||(a.add(s),r.push({key:s,link:o})),r},[])}function hh(){let e=S.useContext(cl);return ph(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function nE(){let e=S.useContext(Jc);return ph(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var mh=S.createContext(void 0);mh.displayName="FrameworkContext";function gh(){let e=S.useContext(mh);return ph(e,"You must render this element inside a <HydratedRouter> element"),e}function aE(e,n){let a=S.useContext(mh),[r,o]=S.useState(!1),[s,u]=S.useState(!1),{onFocus:d,onBlur:p,onMouseEnter:f,onMouseLeave:y,onTouchStart:g}=n,x=S.useRef(null);S.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let C=E=>{E.forEach(R=>{u(R.isIntersecting)})},j=new IntersectionObserver(C,{threshold:.5});return x.current&&j.observe(x.current),()=>{j.disconnect()}}},[e]),S.useEffect(()=>{if(r){let C=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(C)}}},[r]);let b=()=>{o(!0)},k=()=>{o(!1),u(!1)};return a?e!=="intent"?[s,x,{}]:[s,x,{onFocus:co(d,b),onBlur:co(p,k),onMouseEnter:co(f,b),onMouseLeave:co(y,k),onTouchStart:co(g,b)}]:[!1,x,{}]}function co(e,n){return a=>{e&&e(a),a.defaultPrevented||n(a)}}function iE({page:e,...n}){let a=yC(),{router:r}=hh(),o=S.useMemo(()=>_x(r.routes,e,r.basename),[r.routes,e,r.basename]);return o?a?S.createElement(lE,{page:e,matches:o,...n}):S.createElement(oE,{page:e,matches:o,...n}):null}function rE(e){let{manifest:n,routeModules:a}=gh(),[r,o]=S.useState([]);return S.useEffect(()=>{let s=!1;return XC(e,n,a).then(u=>{s||o(u)}),()=>{s=!0}},[e,n,a]),r}function lE({page:e,matches:n,...a}){let r=pa(),{future:o}=gh(),{basename:s}=hh(),u=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let d=Vx(e,s,o.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,f=[];for(let y of n)typeof y.route.shouldRevalidate=="function"?p=!0:f.push(y.route.id);return p&&f.length>0&&d.searchParams.set("_routes",f.join(",")),[d.pathname+d.search]},[s,o.v8_trailingSlashAwareDataRequests,e,r,n]);return S.createElement(S.Fragment,null,u.map(d=>S.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...a})))}function oE({page:e,matches:n,...a}){let r=pa(),{future:o,manifest:s,routeModules:u}=gh(),{basename:d}=hh(),{loaderData:p,matches:f}=nE(),y=S.useMemo(()=>i0(e,n,f,s,r,"data"),[e,n,f,s,r]),g=S.useMemo(()=>i0(e,n,f,s,r,"assets"),[e,n,f,s,r]),x=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,j=!1;if(n.forEach(R=>{var G;let O=s.routes[R.route.id];!O||!O.hasLoader||(!y.some(U=>U.route.id===R.route.id)&&R.route.id in p&&((G=u[R.route.id])!=null&&G.shouldRevalidate)||O.hasClientLoader?j=!0:C.add(R.route.id))}),C.size===0)return[];let E=Vx(e,d,o.v8_trailingSlashAwareDataRequests,"data");return j&&C.size>0&&E.searchParams.set("_routes",n.filter(R=>C.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[d,o.v8_trailingSlashAwareDataRequests,p,r,s,y,n,e,u]),b=S.useMemo(()=>ZC(g,s),[g,s]),k=rE(g);return S.createElement(S.Fragment,null,x.map(C=>S.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...a})),b.map(C=>S.createElement("link",{key:C,rel:"modulepreload",href:C,...a})),k.map(({key:C,link:j})=>S.createElement("link",{key:C,nonce:a.nonce,...j,crossOrigin:j.crossOrigin??a.crossOrigin})))}function sE(...e){return n=>{e.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var cE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{cE&&(window.__reactRouterVersion="7.17.0")}catch{}function uE({basename:e,children:n,useTransitions:a,window:r}){let o=S.useRef();o.current==null&&(o.current=q2({window:r,v5Compat:!0}));let s=o.current,[u,d]=S.useState({action:s.action,location:s.location}),p=S.useCallback(f=>{a===!1?d(f):S.startTransition(()=>d(f))},[a]);return S.useLayoutEffect(()=>s.listen(p),[s,p]),S.createElement(UC,{basename:e,children:n,location:u.location,navigationType:u.action,navigator:s,useTransitions:a})}var Wx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yx=S.forwardRef(function({onClick:n,discover:a="render",prefetch:r="none",relative:o,reloadDocument:s,replace:u,mask:d,state:p,target:f,to:y,preventScrollReset:g,viewTransition:x,defaultShouldRevalidate:b,...k},C){let{basename:j,navigator:E,useTransitions:R}=S.useContext($n),O=typeof y=="string"&&Wx.test(y),G=zx(y,j);y=G.to;let U=CC(y,{relative:o}),_=pa(),W=null;if(d){let K=Zc(d,[],_.mask?_.mask.pathname:"/",!0);j!=="/"&&(K.pathname=K.pathname==="/"?j:ua([j,K.pathname])),W=E.createHref(K)}let[H,L,T]=aE(r,k),F=hE(y,{replace:u,mask:d,state:p,target:f,preventScrollReset:g,relative:o,viewTransition:x,defaultShouldRevalidate:b,useTransitions:R});function V(K){n&&n(K),K.defaultPrevented||F(K)}let ie=!(G.isExternal||s),B=S.createElement("a",{...k,...T,href:(ie?W:void 0)||G.absoluteURL||U,onClick:ie?V:n,ref:sE(C,L),target:f,"data-discover":!O&&a==="render"?"true":void 0});return H&&!O?S.createElement(S.Fragment,null,B,S.createElement(iE,{page:U})):B});Yx.displayName="Link";var dE=S.forwardRef(function({"aria-current":n="page",caseSensitive:a=!1,className:r="",end:o=!1,style:s,to:u,viewTransition:d,children:p,...f},y){let g=Bo(u,{relative:f.relative}),x=pa(),b=S.useContext(Jc),{navigator:k,basename:C}=S.useContext($n),j=b!=null&&xE(g)&&d===!0,E=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,R=x.pathname,O=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;a||(R=R.toLowerCase(),O=O?O.toLowerCase():null,E=E.toLowerCase()),O&&C&&(O=Za(O,C)||O);const G=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let U=R===E||!o&&R.startsWith(E)&&R.charAt(G)==="/",_=O!=null&&(O===E||!o&&O.startsWith(E)&&O.charAt(E.length)==="/"),W={isActive:U,isPending:_,isTransitioning:j},H=U?n:void 0,L;typeof r=="function"?L=r(W):L=[r,U?"active":null,_?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let T=typeof s=="function"?s(W):s;return S.createElement(Yx,{...f,"aria-current":H,className:L,ref:y,style:T,to:u,viewTransition:d},typeof p=="function"?p(W):p)});dE.displayName="NavLink";var fE=S.forwardRef(({discover:e="render",fetcherKey:n,navigate:a,reloadDocument:r,replace:o,state:s,method:u=wc,action:d,onSubmit:p,relative:f,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:x,...b},k)=>{let{useTransitions:C}=S.useContext($n),j=yE(),E=vE(d,{relative:f}),R=u.toLowerCase()==="get"?"get":"post",O=typeof d=="string"&&Wx.test(d),G=U=>{if(p&&p(U),U.defaultPrevented)return;U.preventDefault();let _=U.nativeEvent.submitter,W=(_==null?void 0:_.getAttribute("formmethod"))||u,H=()=>j(_||U.currentTarget,{fetcherKey:n,method:W,navigate:a,replace:o,state:s,relative:f,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:x});C&&a!==!1?S.startTransition(()=>H()):H()};return S.createElement("form",{ref:k,method:R,action:E,onSubmit:r?p:G,...b,"data-discover":!O&&e==="render"?"true":void 0})});fE.displayName="Form";function pE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Kx(e){let n=S.useContext(cl);return Et(n,pE(e)),n}function hE(e,{target:n,replace:a,mask:r,state:o,preventScrollReset:s,relative:u,viewTransition:d,defaultShouldRevalidate:p,useTransitions:f}={}){let y=uh(),g=pa(),x=Bo(e,{relative:u});return S.useCallback(b=>{if(GC(b,n)){b.preventDefault();let k=a!==void 0?a:_o(g)===_o(x),C=()=>y(e,{replace:k,mask:r,state:o,preventScrollReset:s,relative:u,viewTransition:d,defaultShouldRevalidate:p});f?S.startTransition(()=>C()):C()}},[g,y,x,a,r,o,n,e,s,u,d,p,f])}var mE=0,gE=()=>`__${String(++mE)}__`;function yE(){let{router:e}=Kx("useSubmit"),{basename:n}=S.useContext($n),a=LC(),r=e.fetch,o=e.navigate;return S.useCallback(async(s,u={})=>{let{action:d,method:p,encType:f,formData:y,body:g}=YC(s,n);if(u.navigate===!1){let x=u.fetcherKey||gE();await r(x,a,u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||p,formEncType:u.encType||f,flushSync:u.flushSync})}else await o(u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||p,formEncType:u.encType||f,replace:u.replace,state:u.state,fromRouteId:a,flushSync:u.flushSync,viewTransition:u.viewTransition})},[r,o,n,a])}function vE(e,{relative:n}={}){let{basename:a}=S.useContext($n),r=S.useContext(Ea);Et(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...Bo(e||".",{relative:n})},u=pa();if(e==null){s.search=u.search;let d=new URLSearchParams(s.search),p=d.getAll("index");if(p.some(y=>y==="")){d.delete("index"),p.filter(g=>g).forEach(g=>d.append("index",g));let y=d.toString();s.search=y?`?${y}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(s.pathname=s.pathname==="/"?a:ua([a,s.pathname])),_o(s)}function xE(e,{relative:n}={}){let a=S.useContext(Ux);Et(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Kx("useViewTransitionState"),o=Bo(e,{relative:n});if(!a.isTransitioning)return!1;let s=Za(a.currentLocation.pathname,r)||a.currentLocation.pathname,u=Za(a.nextLocation.pathname,r)||a.nextLocation.pathname;return Rc(o.pathname,u)!=null||Rc(o.pathname,s)!=null}var bE=Rx();const wE="modulepreload",SE=function(e){return"/ui/"+e},r0={},nt=function(n,a,r){let o=Promise.resolve();if(a&&a.length>0){let u=function(f){return Promise.all(f.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=u(a.map(f=>{if(f=SE(f),f in r0)return;r0[f]=!0;const y=f.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const x=document.createElement("link");if(x.rel=y?"stylesheet":wE,y||(x.as="script"),x.crossOrigin="",x.href=f,p&&x.setAttribute("nonce",p),document.head.appendChild(x),y)return new Promise((b,k)=>{x.addEventListener("load",b),x.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return o.then(u=>{for(const d of u||[])d.status==="rejected"&&s(d.reason);return n().catch(s)})},l0=e=>{let n;const a=new Set,r=(f,y)=>{const g=typeof f=="function"?f(n):f;if(!Object.is(g,n)){const x=n;n=y??(typeof g!="object"||g===null)?g:Object.assign({},n,g),a.forEach(b=>b(n,x))}},o=()=>n,d={setState:r,getState:o,getInitialState:()=>p,subscribe:f=>(a.add(f),()=>a.delete(f))},p=n=e(r,o,d);return d},kE=(e=>e?l0(e):l0),CE=e=>e;function EE(e,n=CE){const a=hn.useSyncExternalStore(e.subscribe,hn.useCallback(()=>n(e.getState()),[e,n]),hn.useCallback(()=>n(e.getInitialState()),[e,n]));return hn.useDebugValue(a),a}const o0=e=>{const n=kE(e),a=r=>EE(n,r);return Object.assign(a,n),a},ur=(e=>e?o0(e):o0),Qx="dkg-layout",AE=260,ba={leftCollapsed:!1,rightCollapsed:!1,bottomCollapsed:!0,leftSectionMyProjectsOpen:!0,leftSectionIntegrationsOpen:!1,leftWidth:240,rightWidth:360,bottomHeight:AE},Xx=140,Zx=400,Jx=200,eb=500,tb=120,Oc=600,jE=240;function TE(e,n){if(typeof document>"u")return n;const a=getComputedStyle(document.documentElement).getPropertyValue(e).trim(),r=parseFloat(a);return Number.isFinite(r)?r:n}function Dc(){const e=TE("--header-h",44),n=typeof window<"u"&&window.innerHeight?window.innerHeight:0;if(!n)return Oc;const a=n-e-jE;return Math.max(0,Math.min(Oc,a))}function kc(e,n,a){return Math.max(n,Math.min(a,e))}function Of(e,n,a,r){return typeof e!="number"||!Number.isFinite(e)?n:kc(e,a,r)}function NE(){try{const e=localStorage.getItem(Qx);if(!e)return ba;const n=JSON.parse(e);return{leftCollapsed:typeof n.leftCollapsed=="boolean"?n.leftCollapsed:ba.leftCollapsed,rightCollapsed:typeof n.rightCollapsed=="boolean"?n.rightCollapsed:ba.rightCollapsed,bottomCollapsed:typeof n.bottomCollapsed=="boolean"?n.bottomCollapsed:ba.bottomCollapsed,leftSectionMyProjectsOpen:typeof n.leftSectionMyProjectsOpen=="boolean"?n.leftSectionMyProjectsOpen:ba.leftSectionMyProjectsOpen,leftSectionIntegrationsOpen:typeof n.leftSectionIntegrationsOpen=="boolean"?n.leftSectionIntegrationsOpen:ba.leftSectionIntegrationsOpen,leftWidth:Of(n.leftWidth,ba.leftWidth,Xx,Zx),rightWidth:Of(n.rightWidth,ba.rightWidth,Jx,eb),bottomHeight:Of(n.bottomHeight,ba.bottomHeight,tb,Oc)}}catch{return ba}}let oc=null;function Ka(e){oc&&clearTimeout(oc),oc=setTimeout(()=>{oc=null;try{localStorage.setItem(Qx,JSON.stringify(e))}catch{}},150)}function Qa(e){return{leftCollapsed:e.leftCollapsed,rightCollapsed:e.rightCollapsed,bottomCollapsed:e.bottomCollapsed,leftSectionMyProjectsOpen:e.leftSectionMyProjectsOpen,leftSectionIntegrationsOpen:e.leftSectionIntegrationsOpen,leftWidth:e.leftWidth,rightWidth:e.rightWidth,bottomHeight:e.bottomHeight}}const ji=NE(),aa=ur((e,n)=>({leftCollapsed:ji.leftCollapsed,rightCollapsed:ji.rightCollapsed,bottomCollapsed:ji.bottomCollapsed,bottomMaximised:!1,leftSectionMyProjectsOpen:ji.leftSectionMyProjectsOpen,leftSectionIntegrationsOpen:ji.leftSectionIntegrationsOpen,theme:localStorage.getItem("dkg-theme")||"dark",leftWidth:ji.leftWidth,rightWidth:ji.rightWidth,bottomHeight:ji.bottomHeight,toggleLeft:()=>{e(a=>({leftCollapsed:!a.leftCollapsed})),Ka(Qa(n()))},toggleRight:()=>{e(a=>({rightCollapsed:!a.rightCollapsed})),Ka(Qa(n()))},toggleBottom:()=>{e(a=>({bottomCollapsed:!a.bottomCollapsed,bottomMaximised:!1})),Ka(Qa(n()))},toggleBottomMaximised:()=>{e(a=>({bottomMaximised:!a.bottomMaximised,bottomCollapsed:!1})),Ka(Qa(n()))},toggleLeftSectionMyProjects:()=>{e(a=>({leftSectionMyProjectsOpen:!a.leftSectionMyProjectsOpen})),Ka(Qa(n()))},toggleLeftSectionIntegrations:()=>{e(a=>({leftSectionIntegrationsOpen:!a.leftSectionIntegrationsOpen})),Ka(Qa(n()))},setTheme:a=>{localStorage.setItem("dkg-theme",a),e({theme:a})},setLeftWidth:a=>{e({leftWidth:kc(a,Xx,Zx)}),Ka(Qa(n()))},setRightWidth:a=>{e({rightWidth:kc(a,Jx,eb)}),Ka(Qa(n()))},setBottomHeight:a=>{const r=Math.min(tb,Dc());e({bottomHeight:kc(a,r,Oc)}),Ka(Qa(n()))}})),yh=ur(e=>({agents:[],activeAgentName:null,nodeStatus:null,setAgents:n=>e({agents:n}),setActiveAgent:n=>e({activeAgentName:n}),setNodeStatus:n=>e({nodeStatus:n})})),RE=[{id:"dashboard",label:"Dashboard",closable:!1}],mn=ur((e,n)=>({tabs:RE,activeTabId:"dashboard",openTab:a=>{const{tabs:r}=n();r.find(o=>o.id===a.id)?e({activeTabId:a.id}):e({tabs:[...r,a],activeTabId:a.id})},closeTab:a=>{var d;const{tabs:r,activeTabId:o}=n(),s=r.filter(p=>p.id!==a);if(s.length===0)return;const u=o===a?((d=s[Math.max(0,r.findIndex(p=>p.id===a)-1)])==null?void 0:d.id)??s[0].id:o;e({tabs:s,activeTabId:u})},setActiveTab:a=>e({activeTabId:a})})),ra="";function Vt(){if(typeof window>"u")return{};const e=window.__DKG_TOKEN__;return e?{Authorization:`Bearer ${e}`}:{}}class gn extends Error{constructor(a,r,o){super(r??`HTTP ${a}`);Gt(this,"status");Gt(this,"body");this.status=a,this.body=o}}async function vh(e,n={},a=1e4){try{return await fetch(e,{...n,signal:AbortSignal.timeout(a)})}catch(r){throw r instanceof Error&&r.name==="TimeoutError"?new Error(`Request timed out after ${Math.round(a/1e3)}s`):r}}async function Qe(e){const n=await fetch(`${ra}${e}`,{headers:Vt()});if(!n.ok){const a=await n.json().catch(()=>({})),r=(a==null?void 0:a.error)??`HTTP ${n.status}`;throw new gn(n.status,r,a)}return n.json()}async function dl(e){const n=await fetch(`${ra}${e}`,{headers:Vt()});if(!n.ok){const a=await n.json().catch(()=>({})),r=(a==null?void 0:a.error)??`HTTP ${n.status}`;throw new gn(n.status,r,a)}return n.json()}async function nb(e,n){const a=await vh(`${ra}${e}`,{headers:Vt()},n);if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new gn(a.status,o,r)}return a.json()}async function Ht(e,n){const a=await fetch(`${ra}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...Vt()},body:JSON.stringify(n)});if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new gn(a.status,o,r)}return a.json()}async function xh(e,n){const a=await fetch(`${ra}${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...Vt()},body:JSON.stringify(n)});if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}async function _E(e){const n=await fetch(`${ra}${e}`,{method:"DELETE",headers:Vt()});if(!n.ok){const a=await n.json().catch(()=>({})),r=(a==null?void 0:a.error)??`HTTP ${n.status}`;throw new gn(n.status,r,a)}return n.json()}class s0{constructor(n,a=()=>!0){Gt(this,"maxEntries");Gt(this,"shouldAdmit");Gt(this,"entries",new Map);if(this.maxEntries=n,this.shouldAdmit=a,!Number.isSafeInteger(n)||n<1)throw new RangeError("maxEntries must be a positive safe integer")}get size(){return this.entries.size}has(n){return this.entries.has(n)}get(n){if(!this.entries.has(n))return;const a=this.entries.get(n);return this.entries.delete(n),this.entries.set(n,a),a}set(n,a){if(!this.shouldAdmit(n)||(this.entries.delete(n),this.entries.set(n,a),this.entries.size<=this.maxEntries))return;const r=this.entries.keys().next();r.done||this.entries.delete(r.value)}}const OE=256,_p=64*1024,DE=4,ME=2*1024*1024;function LE(){return{small:new s0(OE,e=>e.length<=_p),large:new s0(DE,e=>e.length>_p&&e.length<=ME)}}class zE{constructor(){Gt(this,"tiers",LE())}tierFor(n){return n.length<=_p?"small":"large"}get(n){return this.tiers[this.tierFor(n)].get(n)}set(n,a){const r=this.tierFor(n);r==="large"&&!a.largeCacheable||this.tiers[r].set(n,a)}}function IE(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Op(e){return e<=1114111&&!(e>=55296&&e<=57343)}function Bt(e,n){if(n<0||n>=e.length)return null;const a=e.charCodeAt(n);if(a!==92){const d=e.codePointAt(n);return d===void 0||!Op(d)?null:{codePoint:d,rawWidth:d>65535?2:1}}const r=e[n+1];if(r!=="u"&&r!=="U")return{codePoint:a,rawWidth:1};const o=r==="u"?4:8,s=n+2+o;if(s>e.length)return null;let u=0;for(let d=n+2;d<s;d++){const p=e.charCodeAt(d);if(!IE(p))return null;u=u*16+Number.parseInt(e[d],16)}return Op(u)?{codePoint:u,rawWidth:2+o}:null}function ab(e){return e>=65&&e<=90||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function tu(e){return e===95||ab(e)}function PE(e){return tu(e)||e===45||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}function fl(e,n,a){const r=Bt(e,n);return r&&a(r.codePoint)?r.rawWidth:0}function ib(e,n){return fl(e,n,ab)}function UE(e,n){return fl(e,n,tu)}function Mc(e,n){return fl(e,n,PE)}function Dp(e,n){return fl(e,n,a=>a>=48&&a<=57)}function BE(e){return tu(e)||e>=48&&e<=57}function HE(e){return tu(e)||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}function $E(e,n){return fl(e,n,BE)}function c0(e,n){return fl(e,n,HE)}function qE(e,n){const a=Bt(e,n);if(!a||a.codePoint!==63&&a.codePoint!==36)return null;let r=n+a.rawWidth;const o=$E(e,r);if(!o)return null;r+=o;let s=c0(e,r);for(;s;)r+=s,s=c0(e,r);return r}function FE(e,n,a){const r=Bt(e,n);return(r==null?void 0:r.codePoint)===a?r.rawWidth:0}function GE(e,n){const a=Bt(e,n);if(!a||a.codePoint!==34&&a.codePoint!==39)return null;const r=a.codePoint,o=a.rawWidth>1,s=g=>{if(o)return FE(e,g,r);const x=e.codePointAt(g);return x===r?x>65535?2:1:0};let u=n+a.rawWidth;const d=s(u),p=d?s(u+d):0,f=d>0&&p>0;f&&(u+=d+p);let y=!1;for(;u<e.length;){if(!o&&e.charCodeAt(u)===92){if(e[u+1]==="u"||e[u+1]==="U"){const E=Bt(e,u);E||(y=!0),u+=(E==null?void 0:E.rawWidth)??1;continue}const j=e.codePointAt(u+1);u+=1+(j!==void 0&&j>65535?2:1);continue}const g=Bt(e,u);if(!g){y=!0,u++;continue}if(g.codePoint===92){const j=Bt(e,u+g.rawWidth);u+=g.rawWidth+((j==null?void 0:j.rawWidth)??0);continue}const x=s(u);if(!x){u+=g.rawWidth;continue}if(!f)return{end:u+x,closed:!0,malformedUchar:y};const b=u+x,k=s(b),C=k?s(b+k):0;if(k&&C)return{end:b+k+C,closed:!0,malformedUchar:y};u+=g.rawWidth}return{end:e.length,closed:!1,malformedUchar:y}}function u0(e){return e>32&&e!==60&&e!==62&&e!==34&&e!==123&&e!==125&&e!==124&&e!==94&&e!==96&&e!==92}function VE(e,n,a){let r=n;if(!a){let s=null,u=n;for(;r<e.length;){const d=e.charCodeAt(r);if(d===62)return{end:r+1,logicalValue:s===null?e.slice(n,r):[...s,e.slice(u,r)].join("")};if(d===92){const f=Bt(e,r);if(!f||e[r+1]!=="u"&&e[r+1]!=="U")return null;s??(s=[]),s.push(e.slice(u,r),String.fromCodePoint(f.codePoint)),r+=f.rawWidth,u=r;continue}const p=e.codePointAt(r);if(p===void 0||!Op(p)||!u0(p))return null;r+=p>65535?2:1}return null}const o=[];for(;r<e.length;){const s=Bt(e,r);if(!s)return null;if(s.codePoint===62)return{end:r+s.rawWidth,logicalValue:o.join("")};if(!u0(s.codePoint))return null;o.push(String.fromCodePoint(s.codePoint)),r+=s.rawWidth}return null}function WE(e,n){const a=Bt(e,n);return!a||a.codePoint!==60?null:VE(e,n+a.rawWidth,a.rawWidth>1)}function Oo(e,n,a){const r=Bt(e,n);return(r==null?void 0:r.codePoint)===a?r.rawWidth:0}function d0(e,n){const a=Bt(e,n);return a&&(a.codePoint>=48&&a.codePoint<=57||a.codePoint>=65&&a.codePoint<=70||a.codePoint>=97&&a.codePoint<=102)?a.rawWidth:0}function rb(e,n){const a=Bt(e,n);if(!a)return 0;if(a.codePoint===37){const s=d0(e,n+a.rawWidth);if(!s)return 0;const u=d0(e,n+a.rawWidth+s);return u?a.rawWidth+s+u:0}if(a.codePoint!==92)return 0;const r=Bt(e,n+a.rawWidth);if(!r)return 0;const o=String.fromCodePoint(r.codePoint);return"_~.-!$&'()*+,;=/?#@%".includes(o)?a.rawWidth+r.rawWidth:0}function YE(e,n){return UE(e,n)||Dp(e,n)||Oo(e,n,58)||rb(e,n)}function KE(e,n){return Mc(e,n)||Oo(e,n,58)||rb(e,n)}function f0(e,n){let a=n,r=YE(e,a);if(!r)return a;a+=r;let o=a;for(;a<e.length;){if(r=KE(e,a),r){a+=r,o=a;continue}const s=Oo(e,a,46);if(s){a+=s;continue}break}return o}function QE(e,n){const a=ib(e,n);if(!a)return;let r=n+a,o=r;for(;r<e.length;){const u=Mc(e,r);if(u){r+=u,o=r;continue}const d=Oo(e,r,46);if(d){r+=d;continue}break}const s=Oo(e,r,58);return s&&r===o?{end:r+s}:void 0}function XE(e){return/\s/u.test(String.fromCodePoint(e))}function Df(e,n,a){for(let r=n;r<a;r++)e[r]=" "}function ZE(e,n,a){const r=[];let o=n;for(;o<a;){const s=Bt(e,o);if(!s||o+s.rawWidth>a)return null;r.push(String.fromCodePoint(s.codePoint)),o+=s.rawWidth}return r.join("")}function Mf(e,n){let a=n,r=0,o=Dp(e,a);for(;o>0;)a+=o,r++,o=Dp(e,a);return{end:a,count:r}}function JE(e,n){let a=n;const r=Bt(e,a);((r==null?void 0:r.codePoint)===43||(r==null?void 0:r.codePoint)===45)&&(a+=r.rawWidth);const o=Mf(e,a);a=o.end;const s=a,u=Bt(e,a);let d=0,p=!1;if((u==null?void 0:u.codePoint)===46){p=!0;const y=Mf(e,a+u.rawWidth);a=y.end,d=y.count}if(o.count===0&&d===0)return null;const f=Bt(e,a);if((f==null?void 0:f.codePoint)===69||(f==null?void 0:f.codePoint)===101){let y=a+f.rawWidth;const g=Bt(e,y);((g==null?void 0:g.codePoint)===43||(g==null?void 0:g.codePoint)===45)&&(y+=g.rawWidth);const x=Mf(e,y);if(x.count>0)return x.end}return p&&d===0?o.count>0?s:null:a}function uo(e,n,a,r,o=ZE(n,a,r)){if(o===null)return null;const s={raw:n.slice(a,r),logicalValue:o,start:a,end:r};return e==="word"?{kind:e,...s,upper:o.toUpperCase()}:{kind:e,...s}}function eA(e){return e?e.kind==="variable"||e.kind==="prefixed-name"||e.kind==="number"||e.kind==="iri"||e.kind==="string"?!0:e.kind==="word"?e.upper==="TRUE"||e.upper==="FALSE":e.logicalValue===")":!1}function tA(e,n){return!(n[n.length-1]==="("&&eA(e[e.length-1]))}function nA(e,n){if(n==="("||n==="{"){e.push(n);return}const a=n===")"?"(":n==="}"?"{":void 0;a!==void 0&&e[e.length-1]===a&&e.pop()}function aA(e){var r;const n=[];let a=0;for(;a<e.length;){const o=e[a];if((o==null?void 0:o.kind)!=="word")break;if(o.upper==="BASE"&&((r=e[a+1])==null?void 0:r.kind)==="iri"){a+=2;continue}if(o.upper!=="PREFIX")break;const s=e[a+1],u=e[a+2];if((s==null?void 0:s.kind)!=="prefixed-name"||o.end===s.start||(u==null?void 0:u.kind)!=="iri"||s.logicalValue.indexOf(":")!==s.logicalValue.length-1)break;n.push(s.logicalValue.slice(0,-1)),a+=3}return{endTokenIndex:a,declaredPrefixes:n}}function p0(e){const n=e.split(""),a=[],r=[],o=[];let s=!1,u=0;for(;u<e.length;){const f=Bt(e,u);if(!f)return null;if(XE(f.codePoint)){a.push(String.fromCodePoint(f.codePoint)),u+=f.rawWidth;continue}if(f.codePoint===35){const k=u;u+=f.rawWidth;const C=u;for(;u<e.length&&e[u]!==`
62
- `&&e[u]!=="\r";)u++;a.push(String.fromCodePoint(f.codePoint),e.slice(C,u)),Df(n,k,u);continue}if(f.codePoint===34||f.codePoint===39){const k=u,C=GE(e,k);if(!C){a.push(String.fromCodePoint(f.codePoint)),u+=f.rawWidth;continue}if(C.malformedUchar)return null;u=C.end,a.push(e.slice(k,u)),Df(n,k,u),r.push({kind:"string",raw:e.slice(k,u),start:k,end:u}),C.closed||(s=!0);continue}if(f.codePoint===60&&tA(r,o)){const k=WE(e,u);if(k!==null){const C=u;u=k.end,a.push(e.slice(C,u)),Df(n,C,u),r.push({kind:"iri",raw:e.slice(C,u),logicalValue:k.logicalValue,start:C,end:u});continue}}if(f.codePoint===63||f.codePoint===36){const k=qE(e,u);if(k!==null){const C=u;u=k;const j=uo("variable",e,C,u);if(!j)return null;r.push(j),a.push(j.logicalValue);continue}}const y=JE(e,u);if(y!==null){const k=u;u=y;const C=uo("number",e,k,u);if(!C)return null;r.push(C),a.push(C.logicalValue);continue}if(f.codePoint===58){const k=u;u=f0(e,u+f.rawWidth);const C=uo("prefixed-name",e,k,u);if(!C)return null;r.push(C),a.push(C.logicalValue);continue}const g=ib(e,u);if(g){const k=u,C=QE(e,u);let j;if(C)j="prefixed-name",u=f0(e,C.end);else{j="word",u+=g;let R=Mc(e,u);for(;R;)u+=R,R=Mc(e,u)}const E=uo(j,e,k,u);if(!E)return null;r.push(E),a.push(E.logicalValue);continue}const x=u;u+=f.rawWidth;const b=uo("symbol",e,x,u,String.fromCodePoint(f.codePoint));if(!b)return null;r.push(b),a.push(b.logicalValue),nA(o,b.logicalValue)}const d=n.join(""),p=new Set;for(const f of r)f.kind==="word"&&p.add(f.upper);return{masked:d,materialized:a.join(""),tokens:r,unterminated:s,wordTokens:p,prologue:aA(r)}}function h0(e){return{status:"malformed-uchar",source:e,masked:" ".repeat(e.length),materialized:e,tokens:[],unterminated:!1,wordTokens:new Set,prologue:{endTokenIndex:0,declaredPrefixes:[]}}}function iA(e,n){return e.unterminated!==n.unterminated||e.tokens.length!==n.tokens.length?!1:e.tokens.every((a,r)=>{const o=n.tokens[r];return(o==null?void 0:o.kind)!==a.kind?!1:a.kind==="string"?o.raw===a.raw:o.kind==="string"?!1:o.logicalValue===a.logicalValue})}function rA(e){const n=p0(e);if(n===null)return h0(e);if(n.materialized!==e){const a=p0(n.materialized);if(a===null||a.materialized!==n.materialized||!iA(n,a))return h0(e)}return{status:"valid",source:e,masked:n.masked,materialized:n.materialized,tokens:n.tokens,unterminated:n.unterminated,wordTokens:new Set(n.wordTokens),prologue:n.prologue}}function Lf(e,n,a){const r=[],o=Array(e.length).fill(-1),s=[],u=[];let d=0,p=!0;for(let f=0;f<e.length;f++){r.push(d);const y=e[f];if(y.kind!=="symbol")continue;if(y.logicalValue===n){u.push(f),d++;continue}if(y.logicalValue!==a)continue;const g=u.pop();g===void 0?p=!1:(o[g]=f,o[f]=g,s.push({openingTokenIndex:g,closingTokenIndex:f,depth:r[g]})),d--}return Object.freeze({depthBefore:Object.freeze(r),matchingTokenIndexes:Object.freeze(o),ranges:Object.freeze(s.sort((f,y)=>f.openingTokenIndex-y.openingTokenIndex)),balanced:p&&u.length===0&&d===0})}function lA(e){const{tokens:n}=e,a=Lf(n,"{","}"),r=Lf(n,"(",")"),o=Lf(n,"[","]");return Object.freeze({braces:a,parentheses:r,brackets:o,balanced:a.balanced&&r.balanced&&o.balanced})}function m0(e,n,a=0,r=e.depthBefore.length){const o=[];for(let s=a;s<r;s++)e.depthBefore[s]===n&&o.push(s);return o}function lb(e){return(e==null?void 0:e.kind)==="iri"?e.logicalValue:null}function oA(e){const n=new Map;for(let a=0;a+2<e.prologue.endTokenIndex;a++){const r=e.tokens[a],o=e.tokens[a+1],s=e.tokens[a+2];if((r==null?void 0:r.kind)!=="word"||r.upper!=="PREFIX"||(o==null?void 0:o.kind)!=="prefixed-name"||!o.logicalValue.endsWith(":"))continue;const u=lb(s);u!==null&&n.set(o.logicalValue.slice(0,-1),u),a+=2}return n}function sA(e,n){const{tokens:a}=e,r=[];let o=-1;for(const f of m0(n.braces,0)){const y=a[f];if((y==null?void 0:y.kind)==="word"&&y.upper==="WHERE"){const g=a[f+1];if((g==null?void 0:g.kind)!=="symbol"||g.logicalValue!=="{")return null;o=f+1;break}(y==null?void 0:y.kind)==="symbol"&&y.logicalValue==="{"&&r.push(f)}const s=o>=0?o:n.braces.balanced?r.at(-1)??-1:-1;if(s<0)return null;const u=n.braces.matchingTokenIndexes[s]??-1;if(u<0)return null;const d=n.braces.depthBefore[s]+1,p=m0(n.braces,d,s+1,u).some(f=>{const y=a[f];return(y==null?void 0:y.kind)==="word"&&y.upper==="UNION"});return{openStart:a[s].start,openEnd:a[s].end,close:a[u].start,hasUnion:p,openingTokenIndex:s,closingTokenIndex:u}}function g0(e,n,a){const r=[],o=new Set;for(let s=n;s<a;s++){const u=e.tokens[s];if((u==null?void 0:u.kind)!=="variable")continue;const d=u.logicalValue.slice(1);o.has(d)||(o.add(d),r.push({source:u.raw,logicalName:d}))}return r}function cA(e){const n=lA(e),a=sA(e,n),r=e.tokens[e.prologue.endTokenIndex],o=oA(e),s=n.braces.depthBefore,u=[],d=[],p=new Set;let f=!1;for(let y=0;y<e.tokens.length;y++){const g=e.tokens[y];if(g.kind!=="word"||(g.upper==="FROM"&&(f=!0),g.upper!=="GRAPH"))continue;const x=e.tokens[y+1];if((x==null?void 0:x.kind)==="variable"){const k={source:x.raw,logicalName:x.logicalValue.slice(1)};u.push({kind:"variable",variable:k,keywordTokenIndex:y,targetTokenIndex:y+1,braceDepth:s[y]}),p.has(k.logicalName)||(p.add(k.logicalName),d.push(k));continue}const b=lb(x);if(b!==null){u.push({kind:"iri",iri:b,keywordTokenIndex:y,targetTokenIndex:y+1,braceDepth:s[y]});continue}if((x==null?void 0:x.kind)==="prefixed-name"){const k=x.logicalValue.indexOf(":"),C=o.get(x.logicalValue.slice(0,k));if(k>=0&&C!==void 0){u.push({kind:"iri",iri:`${C}${x.logicalValue.slice(k+1)}`,keywordTokenIndex:y,targetTokenIndex:y+1,braceDepth:s[y]});continue}}u.push({kind:"invalid",keywordTokenIndex:y,targetTokenIndex:y+1,braceDepth:s[y]})}return{source:e.source,prepared:e,structure:n,operation:(r==null?void 0:r.kind)==="word"?r.upper:null,where:a,queryVariables:g0(e,0,e.tokens.length),whereVariables:a?g0(e,a.openingTokenIndex+1,a.closingTokenIndex):[],prefixes:o,hasDatasetClause:f,hasGraphClause:u.length>0,graphTargets:u,graphVariables:d}}const uA=["SELECT","CONSTRUCT","ASK","DESCRIBE"],ob=["INSERT","DELETE","LOAD","CLEAR","DROP","CREATE","COPY","MOVE","ADD"],dA=[...ob,"WITH"],y0=new zE,fA=new Set(ob),pA=new Set(dA),hA=new Set(uA);function mA(e){const{operation:n}=e;return n===null?"UNKNOWN":sb(n)||cb(n)?n:"UNKNOWN"}function sb(e){return hA.has(e)}function cb(e){return pA.has(e)}function gA(e){return sb(e)?{kind:"read",form:e}:cb(e)?{kind:"update"}:{kind:"unknown"}}function zf(e){return{operation:gA(e.form),mutatingKeyword:e.mutatingKeyword}}function v0(e){if(e.status!=="valid")return Object.freeze({facts:Object.freeze({form:"UNKNOWN",mutatingKeyword:null}),largeCacheable:!1});const n=cA(e),a=mA(n),r=e.tokens.find(o=>o.kind==="word"&&fA.has(o.upper));return Object.freeze({facts:Object.freeze({form:a,mutatingKeyword:(r==null?void 0:r.kind)==="word"?r.raw:null}),largeCacheable:a!=="UNKNOWN"&&!e.unterminated&&n.structure.balanced})}function yA(e){if(typeof e!="string")return zf(v0(e).facts);const n=y0.get(e);if(n)return zf(n.facts);const a=v0(rA(e));return y0.set(e,a),zf(a.facts)}function vA(e){return yA(e).operation}const x0=(e,n,a)=>{const r=new URLSearchParams;n&&r.set("key",n),a!=null&&a.extended&&r.set("extended","1");const o=r.toString();return dl(`/api/pca/${encodeURIComponent(e)}${o?`?${o}`:""}`).then(s=>a!=null&&a.extended?{...s,extendedRequested:!0}:s)},II=e=>Ht("/api/pca",{tokens:e.tokens,primaryNode:e.primaryNode}),PI=(e,n)=>Ht(`/api/pca/${encodeURIComponent(e)}/agent`,{agent:n}),UI=(e,n)=>_E(`/api/pca/${encodeURIComponent(e)}/agent/${encodeURIComponent(n)}`),BI=(e,n)=>Ht(`/api/pca/${encodeURIComponent(e)}/funds`,{tokens:n}),HI=e=>Ht(`/api/pca/${encodeURIComponent(e)}/settle`,{}),$I=e=>dl(`/api/pca/${encodeURIComponent(e)}/agents`),qI=e=>dl(`/api/pca/agent/${encodeURIComponent(e)}`),FI=e=>dl("/api/pca/mine?hydrate=1"),GI=e=>dl(`/api/pca/designatable-nodes${e!=null&&e.fresh?"?fresh=1":""}`),xA=()=>dl("/api/pca/contracts");function ub(e){var a;if(!(e instanceof gn))return!1;const n=(a=e.body)==null?void 0:a.code;return typeof n=="string"&&(n.startsWith("RPC_")||n==="TIMEOUT")}function VI(e){return e instanceof gn&&e.status===503&&!ub(e)}function WI(e){if(!(e instanceof gn)||e.status!==503)return!1;const n=e.body;return(n==null?void 0:n.code)==="PCA_LOOKUP_READ_FAILED"||(n==null?void 0:n.error)==="PCA_LOOKUP_READ_FAILED"}const bA=["PrimaryNodeNotInShardingTable","PrimaryNodeUnchanged","PrimaryNodeChangeRateLimited","ZeroPrimaryNode","InvalidAmount","ZeroAgentAddress","TokenTransferFailed","NotAccountOwner","AgentAlreadyRegistered","AgentNotRegistered","AgentCapReached","AccountExpired","AccountAlreadyFullySettled","UnknownAccount"];function YI(e,n={}){if(!(e instanceof gn))return null;const a=e.status,r=e.body??{},o=typeof r.error=="string"&&r.error.length>0?r.error:e.message,s=n.accountId?`PCA #${n.accountId}`:"this Publisher Conviction Account",u=r.existingAccountId!=null?String(r.existingAccountId):void 0;if(ub(e))return{code:"ServerError",status:a,message:"The chain RPC is temporarily unavailable — try again."};if(a===503)return{code:"FEATURE_UNAVAILABLE",status:a,message:"Publisher Conviction Accounts aren't available on this network."};const d=bA.find(p=>new RegExp(`\\b${p}\\b`).test(o));if(d){let p;switch(d){case"InvalidAmount":p="Enter a TRAC amount greater than 0.";break;case"PrimaryNodeNotInShardingTable":p="That primary node isn't a staked node in the sharding table.";break;case"ZeroPrimaryNode":p="Choose a staked node as the primary node.";break;case"PrimaryNodeUnchanged":p="That's already this account's primary node.";break;case"PrimaryNodeChangeRateLimited":p="The primary node was changed too recently — try again later.";break;case"ZeroAgentAddress":p="Enter a valid operational wallet address.";break;case"TokenTransferFailed":p="The TRAC transfer failed — check the owner wallet's TRAC balance and allowance.";break;case"NotAccountOwner":p=`This node isn't the owner of ${s}, so it can't manage it.`;break;case"UnknownAccount":p=`${s} doesn't exist.`;break;case"AgentAlreadyRegistered":p=u?`This operational wallet is already an approved publishing wallet on PCA #${u} — deregister it there first.`:"This operational wallet is already approved on another PCA — deregister it there first.";break;case"AgentNotRegistered":p=`This operational wallet isn't an approved publishing wallet on ${s}.`;break;case"AgentCapReached":p=`${s} already has the maximum 100 approved publishing wallets.`;break;case"AccountExpired":p=`${s} has expired.`;break;case"AccountAlreadyFullySettled":p=`${s} is already fully settled.`;break;default:p=o}return{code:d,status:a,message:p,...u?{existingAccountId:u}:{}}}return a===404?{code:"UnknownAccount",status:a,message:`${s} doesn't exist.`}:a===403?{code:"NotAccountOwner",status:a,message:`This node isn't the owner of ${s}, so it can't manage it.`}:a===400?{code:"BadRequest",status:a,message:o}:a===409?{code:"Conflict",status:a,message:o}:a>=500?{code:"ServerError",status:a,message:"Something went wrong talking to the chain — try again."}:{code:"Unknown",status:a,message:o}}const b0="did:dkg:context-graph:",db=6e4;function fb(e){const n=e.trim();return n.startsWith(b0)?n.slice(b0.length):n}class Lc extends Error{constructor(a,r={}){super(a);Gt(this,"status");Gt(this,"code");Gt(this,"source");Gt(this,"details");Gt(this,"correlationId");Gt(this,"timeoutMs");Gt(this,"target");Gt(this,"route");Gt(this,"integrationId");Gt(this,"retryable");Gt(this,"text");Gt(this,"timedOut");this.name="LocalAgentApiError",Object.assign(this,r)}}const wA=()=>Qe("/api/status"),KI=()=>Qe("/api/settings/retention"),QI=e=>xh("/api/settings/retention",{retentionDays:e}),XI=()=>Qe("/api/settings/telemetry"),ZI=e=>xh("/api/settings/telemetry",{enabled:e}),SA=()=>Qe("/api/connections"),kA=(e,n=1e4)=>vh(`${ra}/api/connect`,{method:"POST",headers:{"Content-Type":"application/json",...Vt()},body:JSON.stringify({multiaddr:e})},n).then(async a=>{if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}),CA=(e,n=2e4)=>vh(`${ra}/api/connect`,{method:"POST",headers:{"Content-Type":"application/json",...Vt()},body:JSON.stringify({peerId:e})},n).then(async a=>{if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}),pb=()=>Qe("/api/agents"),EA=()=>Qe("/api/metrics"),JI=(e,n,a=300)=>Qe(`/api/metrics/history?from=${e}&to=${n}&maxPoints=${a}`),AA=(e={})=>{const n=new URLSearchParams({...e,phases:"1"}).toString();return Qe(`/api/operations?${n}`)},e8=e=>Qe(`/api/operations/${e}`),t8=e=>{const n=e?`?periodMs=${e}`:"";return Qe(`/api/error-hotspots${n}`)},n8=(e={})=>{const n=new URLSearchParams;e.phase&&n.set("phase",e.phase),e.operationName&&n.set("operationName",e.operationName),e.periodMs&&n.set("periodMs",String(e.periodMs)),e.q&&n.set("q",e.q),e.limit&&n.set("limit",String(e.limit));const a=n.toString();return Qe(`/api/failed-operations${a?"?"+a:""}`)},a8=e=>Qe(`/api/replication/summary${e?`?periodMs=${e}`:""}`),i8=e=>Qe(`/api/replication/per-cg${e?`?periodMs=${e}`:""}`),r8=(e={})=>{const n=new URLSearchParams;e.periodMs&&n.set("periodMs",String(e.periodMs)),e.bucketMs&&n.set("bucketMs",String(e.bucketMs)),e.cg&&n.set("cg",e.cg);const a=n.toString();return Qe(`/api/replication/timeline${a?"?"+a:""}`)},l8=()=>Qe("/api/replication/cursors"),o8=(e,n=100)=>Qe(`/api/replication/events?cg=${encodeURIComponent(e)}&limit=${n}`),s8=e=>Qe(`/api/success-rates?periodMs=${e}`),c8=(e,n)=>{const a=`periodMs=${e}${n?`&bucketMs=${n}`:""}`;return Qe(`/api/per-type-stats?${a}`)},jA=(e={})=>{const n=new URLSearchParams;e.lines&&n.set("lines",String(e.lines)),e.q&&n.set("q",e.q);const a=n.toString();return Qe(`/api/node-log${a?"?"+a:""}`)};async function bh(){return{contextGraphs:((await nb("/api/context-graph/list",db)).contextGraphs??[]).filter(a=>!a.isSystem)}}const nu=()=>Qe("/api/agent/identity");async function TA(e,n,a,r){const o=new AbortController,s=setTimeout(()=>o.abort(),3e4);try{const u=await fetch(`${ra}/api/context-graph/create`,{method:"POST",headers:{"Content-Type":"application/json",...Vt()},body:JSON.stringify({id:e,name:n,description:a,...r!=null&&r.register?{register:!0}:{},...r!=null&&r.allowedAgents?{allowedAgents:r.allowedAgents}:{},...(r==null?void 0:r.accessPolicy)!==void 0?{accessPolicy:r.accessPolicy}:{},...(r==null?void 0:r.publishPolicy)!==void 0?{publishPolicy:r.publishPolicy}:{}}),signal:o.signal});if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error((d==null?void 0:d.error)??`HTTP ${u.status}`)}return u.json()}catch(u){throw u.name==="AbortError"?new Error("Creating project is taking longer than expected — it may still complete in the background. Refresh the page in a moment."):u}finally{clearTimeout(s)}}const u8=(e,n)=>Ht(`/api/context-graph/${encodeURIComponent(e)}/remove-participant`,{agentAddress:n}),NA=e=>Qe(`/api/context-graph/${encodeURIComponent(e)}/participants`),RA=e=>Ht(`/api/context-graph/${encodeURIComponent(e)}/sign-join`,{}),_A=(e,n)=>Ht(`/api/context-graph/${encodeURIComponent(e)}/request-join`,n),d8=e=>Qe(`/api/context-graph/${encodeURIComponent(e)}/join-requests`),OA=(e,n)=>Ht(`/api/context-graph/${encodeURIComponent(e)}/approve-join`,{agentAddress:n}),DA=(e,n)=>Ht(`/api/context-graph/${encodeURIComponent(e)}/reject-join`,{agentAddress:n}),MA={md:"text/markdown",markdown:"text/markdown",txt:"text/plain",csv:"text/csv",json:"application/json",xml:"application/xml",yaml:"text/yaml",yml:"text/yaml",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",doc:"application/msword",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",epub:"application/epub+zip",ttl:"text/turtle",rdf:"application/rdf+xml",owl:"application/rdf+xml",html:"text/html",htm:"text/html",py:"text/x-python",ts:"text/typescript",js:"text/javascript",tsx:"text/typescript",jsx:"text/javascript",java:"text/x-java",go:"text/x-go",rs:"text/x-rust",c:"text/x-c",cpp:"text/x-c++",h:"text/x-c",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"};function LA(e){var a;if(e.type&&e.type!=="application/octet-stream")return e.type;const n=((a=e.name.split(".").pop())==null?void 0:a.toLowerCase())??"";return MA[n]}async function zA(e,n,a,r){const o=new FormData;o.append("file",a),o.append("contextGraphId",n);const s=LA(a);s&&o.append("contentType",s);const u=await fetch(`${ra}/api/knowledge-assets/${encodeURIComponent(e)}/wm/import-file`,{method:"POST",headers:Vt(),body:o});if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error((d==null?void 0:d.error)??`HTTP ${u.status}`)}return u.json()}function IA(e,n){var d;const a=e&&typeof e=="object"&&!Array.isArray(e)?e:{},r=a.result??a.results,o=r&&typeof r=="object"&&!Array.isArray(r)?r:{};if(o.type==="boolean"&&typeof o.value=="boolean")return{result:{type:"boolean",value:o.value}};if(o.type==="quads"&&Array.isArray(o.quads))return{result:{type:"quads",quads:o.quads}};if(o.type==="bindings"&&Array.isArray(o.bindings))return{result:{type:"bindings",bindings:o.bindings}};const s=vA(n),u=Array.isArray(o.bindings)?o.bindings:[];if(s.kind==="read"&&s.form==="ASK"){const p=(d=u[0])==null?void 0:d.result,f=p&&typeof p=="object"&&!Array.isArray(p)?p.value:p;return{result:{type:"boolean",value:String(f).toLowerCase()==="true"}}}return s.kind==="read"&&(s.form==="CONSTRUCT"||s.form==="DESCRIBE")?{result:{type:"quads",quads:Array.isArray(o.quads)?o.quads:[]}}:{result:{type:"bindings",bindings:u}}}const If=new Map;function zc(e){const n=JSON.stringify(e),a=If.get(n);if(a)return a;const r=(async()=>{const o=await fetch(`${ra}/api/query`,{method:"POST",headers:{"Content-Type":"application/json",...Vt()},body:n});if(!o.ok){const s=await o.json().catch(()=>({})),u=(s==null?void 0:s.error)??`HTTP ${o.status}`;throw new gn(o.status,u,s)}return IA(await o.json(),String(e.sparql??""))})().finally(()=>{If.delete(n)});return If.set(n,r),r}const wh=(e,n={})=>zc({sparql:e,...n});async function f8(e){var s,u,d;const a=`SELECT ?name ?ual WHERE {
63
- GRAPH <${`did:dkg:context-graph:${e}/_meta`}> {
64
- ?lc <http://dkg.io/ontology/assertionName> ?name ;
65
- <http://dkg.io/ontology/reservedUal> ?ual .
66
- }
67
- }`,r=await wh(a,{contextGraphId:e}),o={};for(const p of((s=r==null?void 0:r.result)==null?void 0:s.bindings)??[]){const f=typeof p.name=="string"?p.name:(u=p.name)==null?void 0:u.value,y=typeof p.ual=="string"?p.ual:(d=p.ual)==null?void 0:d.value;f&&y&&!o[f]&&(o[f]=y)}return o}const p8=(e,n)=>Ht("/api/profile/query-catalog/write",{contextGraphId:e,quads:n}),h8=e=>Ht("/api/profile/query-catalog/read",{contextGraphId:e}),PA=new Set(["clearAfter","publishEpochs","publisherNodeIdentityIdOverride"]),UA=e=>{if(typeof e=="string"&&/^\d+$/.test(e))return e;throw new Error("publisherNodeIdentityIdOverride must be passed as a decimal string")},BA=(e,n=[])=>{if(!e)return;const a=Object.keys(e).filter(s=>!PA.has(s)&&!n.includes(s));if(a.length>0)throw new Error(`Unsupported finalized publish option(s): ${a.join(", ")}`);const r={};e.clearAfter!==void 0&&(r.clearSharedMemoryAfter=e.clearAfter),e.publishEpochs!==void 0&&(r.publishEpochs=e.publishEpochs);const o=e.publisherNodeIdentityIdOverride;return o!==void 0&&(r.publisherNodeIdentityIdOverride=UA(o)),Object.keys(r).length>0?r:void 0};function HA(e){const n=e;if(Array.isArray(n.entities))throw Object.assign(new Error("Knowledge Assets are shared atomically; root-entity selection is not supported"),{code:"KA_ATOMIC_SHARE_REQUIRED"});if(n.entities!==void 0&&n.entities!=="all")throw Object.assign(new Error("Knowledge Assets are shared atomically; omit entities to share the complete asset"),{code:"KA_ATOMIC_SHARE_REQUIRED"});if(n.skipSeal===!0)throw Object.assign(new Error("Knowledge Assets are always sealed before sharing"),{code:"UNSEALED_SHARE_BLOCKED"});if(n.skipSeal!==void 0&&n.skipSeal!==!1)throw new TypeError("skipSeal must be false or omitted");if(n.awaitCuratorAck!==void 0&&typeof n.awaitCuratorAck!="boolean")throw new TypeError("awaitCuratorAck must be a boolean when supplied");return{...n.subGraphName?{subGraphName:n.subGraphName}:{},awaitCuratorAck:n.awaitCuratorAck??!0}}const $A=(e,n,a={})=>{const r=HA(a);return Ht(`/api/knowledge-assets/${encodeURIComponent(n)}/swm/share`,{contextGraphId:fb(e),...r.subGraphName?{subGraphName:r.subGraphName}:{},awaitCuratorAck:r.awaitCuratorAck})},qA=(e,n,a={})=>{const r=BA(a,["subGraphName"]);return Ht(`/api/knowledge-assets/${encodeURIComponent(n)}/vm/publish`,{contextGraphId:fb(e),...a.subGraphName?{subGraphName:a.subGraphName}:{},...r?{options:r}:{}})};async function m8(e,n){let a=0,r=0,o;const s=[];let u=null,d=0n,p=0n,f=0n,y=0n,g,x=!0,b=!0;for(const C of n)try{const j=await qA(e,C.name,C.subGraph?{subGraphName:C.subGraph}:{});a+=1,j.contextGraphError&&(r+=1,o===void 0&&(o=j.contextGraphError));const E=j;(!u||E.status==="confirmed"&&E.txHash&&!E.contextGraphError)&&(u=E);const R=E.convictionCostCovered;if(R)try{d+=BigInt(R.baseCost),p+=BigInt(R.discountedCost),f+=BigInt(R.drawnFromEpoch),y+=BigInt(R.drawnFromTopUp),g?(R.accountId!==g.accountId&&(x=!1),R.epoch!==g.epoch&&(b=!1)):g=R}catch{}}catch(j){const E=(j==null?void 0:j.message)??"publish failed";s.push({name:C.name,...C.subGraph?{subGraph:C.subGraph}:{},error:E})}const k=g?{...x&&g.accountId?{accountId:g.accountId}:{},...b&&g.epoch!=null?{epoch:g.epoch}:{},baseCost:d.toString(),discountedCost:p.toString(),drawnFromEpoch:f.toString(),drawnFromTopUp:y.toString()}:void 0;return{published:a,total:n.length,partial:r,partialError:o,failures:s,sample:u,convictionCostCovered:k}}async function g8(e,n="wm",a={}){var R,O,G,U,_,W,H,L;const r=a.includeQueryCatalog??!1,o=(T,F)=>T!=="meta"||r&&F.startsWith("query-catalog-");if(n==="swm"){const T=`did:dkg:context-graph:${e}/_meta`,F=`did:dkg:context-graph:${e}/`,V=`urn:dkg:assertion:${e}:`,B=`SELECT ?g ?vm WHERE {
68
- GRAPH <${T}> {
69
- ?g <http://dkg.io/ontology/memoryLayer> "SWM"
70
- OPTIONAL { ?g <http://dkg.io/ontology/vmCurrentAssertion> ?vm }
71
- }
72
- ${r?"":'FILTER(!CONTAINS(STR(?g), "/meta/assertion/"))'}
73
- }`,K=await wh(B,{contextGraphId:e}),P=((R=K==null?void 0:K.result)==null?void 0:R.bindings)??[],Z=new Set,ne=[];for(const M of P){const Q=typeof M.g=="string"?M.g:(O=M.g)==null?void 0:O.value;if(!Q)continue;const N=typeof M.vm=="string"?M.vm:(G=M.vm)==null?void 0:G.value;let ue,pe;if(Q.startsWith(F)){const be=Q.slice(F.length).split("/");if(be.length===3&&be[0]==="assertion")pe=be[2];else if(be.length===4&&be[1]==="assertion")ue=be[0],pe=be[3];else continue}else if(Q.startsWith(V)){const be=Q.slice(V.length);let Oe=/^(0x[0-9a-fA-F]{40}):(.+)$/.exec(be);Oe?pe=Oe[2]:(Oe=/^([^:]+):(0x[0-9a-fA-F]{40}):(.+)$/.exec(be),Oe&&(ue=Oe[1],pe=Oe[3]))}else continue;if(!pe||!o(ue,pe))continue;const he=`${ue??""} ${pe}`;ne.push({key:he,name:pe,subGraph:ue,g:Q}),N&&Z.add(he)}const X=new Set,D=[];for(const M of ne)Z.has(M.key)||X.has(M.key)||(X.add(M.key),D.push({name:M.name,graphUri:M.g,subGraph:M.subGraph}));return D}const s=`did:dkg:context-graph:${e}/_meta`,u=`did:dkg:context-graph:${e}/`,d=r?"":'FILTER(!CONTAINS(STR(?g), "/meta/assertion/"))',p=`SELECT ?g WHERE {
74
- GRAPH <${s}> { ?g <http://dkg.io/ontology/memoryLayer> "WM" }
75
- ${d}
76
- }`,f=`SELECT ?g (COUNT(*) AS ?cnt) WHERE {
77
- GRAPH <${s}> {
78
- ?g <http://dkg.io/ontology/memoryLayer> "WM" ;
79
- <http://dkg.io/ontology/assertionGraph> ?dg
80
- }
81
- GRAPH ?dg { ?s ?p ?o }
82
- ${d}
83
- } GROUP BY ?g`,[y,g]=await Promise.all([zc({sparql:p,contextGraphId:e,includeContextGraphPartitions:!0}),zc({sparql:f,contextGraphId:e,includeContextGraphPartitions:!0}).catch(()=>null)]),x=((U=y==null?void 0:y.result)==null?void 0:U.bindings)??[],b=new Map;for(const T of((_=g==null?void 0:g.result)==null?void 0:_.bindings)??[]){const F=typeof T.g=="string"?T.g:(W=T.g)==null?void 0:W.value,V=typeof T.cnt=="string"?T.cnt:(H=T.cnt)==null?void 0:H.value,ie=typeof V=="string"?V.match(/^"?(\d+)/):null,B=ie?parseInt(ie[1],10):NaN;F&&Number.isFinite(B)&&b.set(F,B)}const k=[],C=new Set,j=`urn:dkg:assertion:${e}:`,E=[...x].sort((T,F)=>{var B,K;const V=(typeof T.g=="string"?T.g:(B=T.g)==null?void 0:B.value)??"",ie=(typeof F.g=="string"?F.g:(K=F.g)==null?void 0:K.value)??"";return(V.startsWith(u)?0:1)-(ie.startsWith(u)?0:1)});for(const T of E){const F=typeof T.g=="string"?T.g:(L=T.g)==null?void 0:L.value;if(!F)continue;let V,ie;if(F.startsWith(u)){const P=F.slice(u.length).split("/");if(P.length===3&&P[0]==="assertion")ie=P[2];else if(P.length===4&&P[1]==="assertion")V=P[0],ie=P[3];else continue}else if(F.startsWith(j)){const P=F.slice(j.length);let Z=/^(0x[0-9a-fA-F]{40}):(.+)$/.exec(P);Z?ie=Z[2]:(Z=/^([^:]+):(0x[0-9a-fA-F]{40}):(.+)$/.exec(P),Z&&(V=Z[1],ie=Z[3]))}else continue;if(!ie||!o(V,ie))continue;const B=`${V??""}\0${ie}`;if(C.has(B))continue;C.add(B);const K=b.get(F);k.push({name:ie,graphUri:F,tripleCount:K,subGraph:V})}return k}const y8=(e,n,a,r)=>{if(Array.isArray(a))throw Object.assign(new Error("Knowledge Assets are shared atomically; root-entity selection is not supported"),{code:"KA_ATOMIC_SHARE_REQUIRED"});if(typeof a=="string"&&a!=="all")throw Object.assign(new Error("Knowledge Assets are shared atomically; omit entities to share the complete asset"),{code:"KA_ATOMIC_SHARE_REQUIRED"});const o=a===void 0||typeof a=="string"?{subGraphName:r}:{...a,subGraphName:a.subGraphName??r};return $A(e,n,o)};function v8(e,n){return n.promotedCount>0?{kind:"success",promotedCount:n.promotedCount,message:`Shared the complete Knowledge Asset ${e} to Shared Working Memory (${n.promotedCount} triple${n.promotedCount===1?"":"s"}).`}:{kind:"noop",message:`${e} was not newly shared. Its complete Knowledge Asset may already be in Shared Working Memory, or its content is still being committed — refresh and try again.`}}function x8(e,n){if(n instanceof gn&&n.status===413){const a=n.body;if((a==null?void 0:a.code)==="SWM_GOSSIP_PAYLOAD_TOO_LARGE")return{kind:"payload-too-large",actualBytes:typeof a.actualBytes=="number"?a.actualBytes:void 0,limitBytes:typeof a.limitBytes=="number"?a.limitBytes:void 0,message:`${e} is too large to share atomically. Split its content into smaller Knowledge Assets before sharing.`}}if(n instanceof gn&&n.status===409){const a=n.body;if((a==null?void 0:a.code)==="ASSERTION_NOT_PERSISTED"){const r=typeof a.expectedTripleCount=="number"?a.expectedTripleCount:void 0;return{kind:"not-persisted",expectedTripleCount:r,message:r?`${e} was imported with ${r} extracted triple${r===1?"":"s"} but the data graph is empty. Re-import the source file (or re-write the assertion) before promoting.`:`${e}'s data graph is empty but its extraction metadata says it should hold content. Re-import the source file before promoting.`}}}return null}const b8=(e,n,a)=>{const r=new URLSearchParams({contextGraphId:n});return a&&r.set("subGraphName",a),Qe(`/api/knowledge-assets/${encodeURIComponent(e)}/wm/extraction-status?${r}`)};function FA(e,n){const a=e.startsWith("sha256:")||e.startsWith("keccak256:")?e:`sha256:${e}`,r=n?`?contentType=${encodeURIComponent(n)}`:"";return`${ra}/api/file/${encodeURIComponent(a)}${r}`}const w8="binding incomplete";function S8(e){const n="Published on-chain, but linking it into the context graph did not complete, so context-graph views may be incomplete.";return e?`${n} (${e})`:n}const GA=(e=20)=>Qe(`/api/memory/sessions?limit=${e}`),VA=(e,n={})=>{const a=new URLSearchParams;n.limit&&Number.isInteger(n.limit)&&n.limit>0&&a.set("limit",String(n.limit)),(n.order==="desc"||n.order==="asc")&&a.set("order",n.order);const r=a.toString();return Qe(`/api/memory/sessions/${encodeURIComponent(e)}${r?`?${r}`:""}`)};function hb(e,n){var a,r,o;return{text:e,correlationId:(n==null?void 0:n.correlationId)??crypto.randomUUID(),...n!=null&&n.identity?{identity:n.identity}:{},...n!=null&&n.sessionId?{sessionId:n.sessionId}:{},...n!=null&&n.profile?{profile:n.profile}:{},...n!=null&&n.persistUserMessage?{persistUserMessage:n.persistUserMessage}:{},...(a=n==null?void 0:n.attachments)!=null&&a.length?{attachmentRefs:n.attachments}:{},...(r=n==null?void 0:n.attachmentImportResults)!=null&&r.length?{attachmentImportResults:n.attachmentImportResults}:{},...(o=n==null?void 0:n.contextEntries)!=null&&o.length?{contextEntries:n.contextEntries}:{},...n!=null&&n.contextGraphId?{contextGraphId:n.contextGraphId}:{}}}async function WA(e,n={}){var g;const a=await fetch("/api/openclaw-channel/stream",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",...Vt()},body:JSON.stringify(hb(e,n)),signal:n.signal});if(!a.ok){const x=await a.json().catch(()=>({}));throw Do(x,`Request failed (${a.status})`,a.status)}const r=(a.headers.get("content-type")??"").toLowerCase();if(!a.body||!r.includes("text/event-stream")){const x=await a.json();return(g=n.onEvent)==null||g.call(n,{type:"final",...x}),x}const o=a.body.getReader(),s=new TextDecoder;let u="",d,p;const f=x=>{var b;(b=n.onEvent)==null||b.call(n,x),x.type==="error"?p=Do(x,x.error||"Stream failed"):x.type==="final"&&(d={text:x.text,correlationId:x.correlationId,...x.sessionId?{sessionId:x.sessionId}:{},...x.turnId?{turnId:x.turnId}:{}})},y=x=>{let b=u.indexOf(`
84
- `);for(;b!==-1;){const k=u.slice(0,b).trim();if(u=u.slice(b+1),b=u.indexOf(`
85
- `),!k.startsWith("data:"))continue;const C=k.slice(5).trim();if(C){try{f(JSON.parse(C))}catch{}if(p)return}}if(x&&u.trim().startsWith("data:")){const k=u.trim().slice(5).trim();if(!k)return;try{f(JSON.parse(k))}catch{}u=""}};for(;;){const{done:x,value:b}=await o.read();if(x||(u+=s.decode(b,{stream:!0}),y(!1),p))break;if(d)return o.cancel().catch(()=>{}),d}if(u+=s.decode(),y(!0),p)throw p;if(!d)throw new Error("Stream ended without final payload");return d}const YA=()=>Qe("/api/openclaw-channel/health");async function mb(e,n,a={}){var b;const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",...Vt()},body:JSON.stringify(hb(n,a)),signal:a.signal});if(!r.ok){const k=await r.json().catch(()=>({}));throw Do(k,`Request failed (${r.status})`,r.status)}const o=(r.headers.get("content-type")??"").toLowerCase();if(!r.body||!o.includes("text/event-stream")){const k=await r.json();return(b=a.onEvent)==null||b.call(a,{type:"final",...k}),k}const s=r.body.getReader(),u=new TextDecoder;let d="",p,f;const y=k=>k.type==="delta"?{type:"text_delta",delta:k.text??""}:k,g=k=>{var C;(C=a.onEvent)==null||C.call(a,k),k.type==="error"?f=Do(k,k.error||"Stream failed"):k.type==="final"&&(p={text:k.text,correlationId:k.correlationId,...k.sessionId?{sessionId:k.sessionId}:{},...k.turnId?{turnId:k.turnId}:{}})},x=k=>{let C=d.indexOf(`
86
- `);for(;C!==-1;){const j=d.slice(0,C).trim();if(d=d.slice(C+1),C=d.indexOf(`
87
- `),!j.startsWith("data:"))continue;const E=j.slice(5).trim();if(E){try{g(y(JSON.parse(E)))}catch{}if(f)return}}if(k&&d.trim().startsWith("data:")){const j=d.trim().slice(5).trim();if(!j)return;try{g(y(JSON.parse(j)))}catch{}d=""}};for(;;){const{done:k,value:C}=await s.read();if(k||(d+=u.decode(C,{stream:!0}),x(!1),f))break;if(p)return s.cancel().catch(()=>{}),p}if(d+=u.decode(),x(!0),f)throw f;if(!p)throw new Error("Stream ended without final payload");return p}const KA=(e,n={})=>mb("/api/hermes-channel/stream",e,n),QA=()=>Qe("/api/hermes-channel/health"),XA=(e,n={})=>mb("/api/prime-agent-channel/stream",e,n),ZA=()=>Qe("/api/prime-agent-channel/health"),JA=()=>Qe("/api/local-llm/health");async function ej(e,n){const a=(n==null?void 0:n.correlationId)??crypto.randomUUID(),r=await fetch("/api/local-llm/chat",{method:"POST",headers:{"Content-Type":"application/json",...Vt()},body:JSON.stringify({message:e,sessionId:"local-llm:dkg-ui",...n!=null&&n.contextGraphId?{contextGraphId:n.contextGraphId}:{}}),signal:n==null?void 0:n.signal});if(!r.ok){const s=await r.json().catch(()=>({}));throw Do(s,`Request failed (${r.status})`,r.status)}return{...await r.json(),correlationId:a,turnId:a}}async function tj(e,n={}){var r;const a=await ej(e,n);return(r=n.onEvent)==null||r.call(n,{type:"final",...a}),a}const nj=()=>Ht("/api/local-llm/session/clear",{});function aj(e,n){if(!e||typeof e!="object"||Array.isArray(e))return n;const a=e,r=typeof a.error=="string"&&a.error.trim()?a.error.trim():n;if(a.details===void 0||a.details===null)return r;const o=typeof a.details=="string"?a.details.trim():JSON.stringify(a.details);return!o||o===r?r:`${r}: ${o}`}function Do(e,n,a){if(!e||typeof e!="object"||Array.isArray(e))return new Lc(n,{status:a});const r=e,o=aj(r,n),s=f=>{const y=r[f];return typeof y=="string"&&y.trim()?y.trim():void 0},u=f=>{const y=r[f];return typeof y=="number"&&Number.isFinite(y)?y:void 0},d=f=>{const y=r[f];return typeof y=="boolean"?y:void 0},p=typeof r.text=="string"&&r.text.trim()?r.text:void 0;return new Lc(o,{status:a,code:s("code"),source:s("source"),details:s("details"),correlationId:s("correlationId"),timeoutMs:u("timeoutMs"),target:s("target"),route:s("route"),integrationId:s("integrationId"),retryable:d("retryable"),text:p,timedOut:d("timedOut")})}const au={"local-llm":{connectSupported:!1,chatSupported:!0,defaultSessionId:()=>"local-llm:dkg-ui",resolveChatContext:()=>({}),fetchHealth:JA,streamChat:tj},openclaw:{connectSupported:!0,chatSupported:!0,defaultSessionId:({integrationId:e})=>`${e}:dkg-ui`,resolveChatContext:({integrationId:e,sessionId:n})=>{if(!n)return{};const a=`${e}:dkg-ui:`;if(!n.startsWith(a))return{};const r=n.slice(a.length).trim();return r?{identity:r}:{}},fetchHealth:YA,streamChat:WA},hermes:{connectSupported:!0,chatSupported:!0,defaultSessionId:({integrationId:e,record:n,health:a})=>sj(e,n,a),resolveChatContext:({sessionId:e,profile:n})=>({...e?{sessionId:e}:{},...n?{profile:n}:{}}),fetchHealth:QA,streamChat:KA},"prime-agent":{connectSupported:!0,chatSupported:!0,defaultSessionId:({record:e,health:n})=>uj(e,n),resolveChatContext:({sessionId:e,liveSession:n})=>{if(!n)return{};if(e&&n.sessionId!==e)throw new Error("Prime Agent live session does not match the selected conversation");return{sessionId:n.rawSessionId}},fetchHealth:ZA,streamChat:XA}};function rr(e){var a,r;const n=e.trim().toLowerCase();return((r=(a=au[n])==null?void 0:a.defaultSessionId)==null?void 0:r.call(a,{integrationId:n}))??null}function ij(e,n){return n!=null&&n.trim()?n.trim():rr(e)}async function rj(e,n=50){const a=r=>{if(r.turnId)return`urn:dkg:chat:turn:${encodeURIComponent(r.turnId)}:${encodeURIComponent(r.author)}`;const o=`${e}
88
- ${r.author}
89
- ${r.ts}
90
- ${r.text}`;let s=2166136261;for(let u=0;u<o.length;u+=1)s^=o.charCodeAt(u),s=Math.imul(s,16777619);return`urn:dkg:chat:session:${encodeURIComponent(e)}:message:${(s>>>0).toString(16)}`};try{return[...(await VA(e,{limit:n,order:"desc"})).messages].reverse().map(o=>({uri:o.uri||a(o),text:o.text,author:o.author,ts:o.ts,turnId:o.turnId,persistStatus:o.persistStatus,failureReason:o.failureReason,attachmentRefs:o.attachmentRefs,toolCalls:o.toolCalls}))}catch(r){if(r instanceof gn&&r.status===404)return[];throw r}}function lj(e){var n,a,r;return!!((n=e.transport)!=null&&n.bridgeUrl||(a=e.transport)!=null&&a.gatewayUrl||(r=e.transport)!=null&&r.healthUrl)}function Ic(...e){for(const n of e)if(typeof n=="string"&&n.trim())return n.trim();return null}function oj(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||Sh(e)}function Sh(e){let n=2166136261;for(let a=0;a<e.length;a+=1)n^=e.charCodeAt(a),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function sj(e,n,a){const r=(n==null?void 0:n.metadata)??{},o=Ic(a==null?void 0:a.profile,r.profileName,r.profile),s=Ic(r.hermesHome),u=s?null:cj(n),d=[o?`profile-${oj(o)}`:null,s?`home-${Sh(s)}`:null,u].filter(p=>p!=null);return d.length?`${e}:dkg-ui:${d.join(":")}`:`${e}:dkg-ui`}function cj(e){const n=e==null?void 0:e.transport;if(!n)return null;const a=[n.kind,n.bridgeUrl,n.gatewayUrl,n.healthUrl].filter(r=>typeof r=="string"&&r.trim().length>0);return a.length?`transport-${Sh(a.join("|"))}`:null}function uj(e,n){var a,r,o;return Ic((a=e==null?void 0:e.metadata)==null?void 0:a.activeMemorySessionId,(o=(r=n==null?void 0:n.sessions)==null?void 0:r[0])==null?void 0:o.memorySessionId)??void 0}function dj(e){return e?typeof e=="string"?e:[e.provider,e.mode,e.status].filter(Boolean).join(" / ")||null:null}function fj(e,n){if(e==="degraded")return!0;const a=String((n==null?void 0:n.status)??"").toLowerCase(),r=n==null?void 0:n.memory;return a.includes("degraded")||a.includes("conflict")||typeof r=="object"&&r!=null&&r.conflict===!0}function gb(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function w0(e){if(!gb(e))return-1;let n=e.ok===!1?100:0;return e.profile&&(n+=10),e.memory&&(n+=10),e.status&&(n+=10),e.error&&(n+=10),e.ok===!0&&(n+=1),n}function pj(e){if(e.target==="bridge")return{target:"bridge",details:e.bridge};if(e.target==="gateway")return{target:"gateway",details:e.gateway};const n=w0(e.bridge),a=w0(e.gateway);return n<0&&a<0?{}:n>=a?{target:"bridge",details:e.bridge}:{target:"gateway",details:e.gateway}}function hj(e){if(!e)return null;const{target:n,details:a}=pj(e);if(!gb(a))return e;const r=typeof a.ok=="boolean"?a.ok:void 0;return{...a,...e,ok:e.ok===!1?!1:r??e.ok,target:e.target??n,profile:e.profile??a.profile,memory:e.memory??a.memory,status:e.status??a.status,error:e.error??a.error}}function mj(e,n){if(String(e.id??"").toLowerCase()!=="hermes")return null;const a=n==null?void 0:n.profile,r=a?`profile ${a}`:"the configured profile",o=dj(n==null?void 0:n.memory),s=typeof(n==null?void 0:n.memory)=="object"&&n.memory!=null?n.memory:null;return(s==null?void 0:s.conflict)===!0||String((n==null?void 0:n.status)??"").toLowerCase().includes("conflict")?`${e.name} ${r} has a memory provider conflict${o?` (${o})`:""}.`:n!=null&&n.ok?`${e.name} ${r} is connected${o?` with ${o} memory`:""}.`:n!=null&&n.status?`${e.name} ${r} reports ${n.status}${o?` (${o})`:""}.`:null}async function kh(e){var W,H,L,T,F,V,ie,B,K,P,Z,ne,X,D,M,Q;const n=String(e.id??"").toLowerCase(),a=au[n],r=((W=e.capabilities)==null?void 0:W.localChat)===!0&&(a==null?void 0:a.chatSupported)===!0,o=r&&((H=e.capabilities)==null?void 0:H.chatAttachments)===!0,s=((L=e.capabilities)==null?void 0:L.connectFromUi)===!0&&(a==null?void 0:a.connectSupported)===!0,u=e.enabled===!0,d=(T=e.runtime)==null?void 0:T.status,p=u&&r&&(a!=null&&a.fetchHealth)?hj(await a.fetchHealth().catch(()=>null)):null;if(n==="local-llm"&&(p==null?void 0:p.configured)===!1&&p.reachable!==!0)return null;const f=fj(d,p),y=(p==null?void 0:p.ok)===!0&&!f,g=y,b=u&&r&&(n==="local-llm"&&u&&r||y||d==="connecting"||d==="degraded"||((F=e.runtime)==null?void 0:F.ready)===!0||lj(e)),k=mj(e,p),C=(V=a==null?void 0:a.defaultSessionId)==null?void 0:V.call(a,{integrationId:n,record:e,health:p}),j=n==="prime-agent"&&(p==null?void 0:p.busy)===!0&&p.clientConnected===!1,E=n==="prime-agent"&&Array.isArray(p==null?void 0:p.sessions)?p.sessions.filter(N=>typeof(N==null?void 0:N.rawSessionId)=="string"&&N.rawSessionId.trim()&&typeof N.memorySessionId=="string"&&N.memorySessionId.trim()).map(N=>({...N,sessionId:N.memorySessionId.trim(),rawSessionId:N.rawSessionId.trim()})):void 0,R=n==="hermes"?Ic(p==null?void 0:p.profile,(ie=e.metadata)==null?void 0:ie.profileName,(B=e.metadata)==null?void 0:B.profile)??void 0:void 0;let O,G,U;b&&f?(O="degraded",G="Degraded",U=k??(p==null?void 0:p.error)??((K=e.runtime)==null?void 0:K.lastError)??`${e.name} is attached to this node, but one capability is degraded.`):b&&((P=e.runtime)==null?void 0:P.status)==="connecting"?(O="connecting",G="Connecting",U=((Z=e.runtime)==null?void 0:Z.lastError)??`${e.name} is registered and still starting up.`):g?(O="chat_ready",G=j?"Still working":p!=null&&p.busy?"Working":"Chat ready",U=j?`${e.name} is still working after the browser stream disconnected. Wait for it to finish before sending another message.`:p!=null&&p.busy?`${e.name} is working on the current turn.`:`${e.name} is connected to this node and ready for chat.`):b?(O="bridge_offline",G="Bridge offline",U=k??(p==null?void 0:p.error)??((ne=e.runtime)==null?void 0:ne.lastError)??`${e.name} is attached to this node, but it is not responding right now.`):a?(O="available",G=s?"Ready to connect":"Awaiting chat bridge",U=u?`${e.name} is registered, but this panel is waiting for the framework chat bridge.`:((X=e.runtime)==null?void 0:X.lastError)??`Use the node-served skill plus ${e.name} onboarding to attach an existing local agent.`):(O="coming_soon",G=u?"Registered, panel pending":"Next integration",U=u?`${e.name} is registered on the node, but the right-panel chat bridge is not wired yet.`:"The local-agent registry is in place so this framework can plug into the same side-panel flow next.");const _=g?"Connected":O==="connecting"?"Connecting":O==="degraded"?"Degraded":b?"Unavailable":s?"Ready to connect":"Coming next";return{id:n,name:e.name,framework:e.name,description:e.description,defaultSessionId:C,profile:R,chatSupported:r,chatAttachments:o,connectSupported:s,configured:u,detected:u||y,persistentChat:b,chatReady:y,bridgeOnline:g,bridgeStatusLabel:_,status:O,statusLabel:G,detail:U,error:y?void 0:(p==null?void 0:p.error)??((D=e.runtime)==null?void 0:D.lastError)??void 0,target:p==null?void 0:p.target,source:u||a?"live":"planned",...typeof((M=e.metadata)==null?void 0:M.sessionCount)=="number"?{sessionCount:e.metadata.sessionCount}:{},...typeof((Q=e.metadata)==null?void 0:Q.activeSessionId)=="string"?{activeSessionId:e.metadata.activeSessionId}:{},...E!=null&&E.length?{liveSessions:E}:{},...typeof(p==null?void 0:p.busy)=="boolean"?{busy:p.busy}:{}}}async function iu(){const e=await Qe("/api/local-agent-integrations"),a=(await Promise.all((e.integrations??[]).map(kh))).filter(r=>r!==null);return a.sort((r,o)=>{const s=r.id==="openclaw"?0:1,u=o.id==="openclaw"?0:1;return s!==u?s-u:r.persistentChat!==o.persistentChat?r.persistentChat?-1:1:r.name.localeCompare(o.name)}),{integrations:a}}async function gj(e){const n=e.trim().toLowerCase(),a=au[n];if(!(a!=null&&a.connectSupported))throw new Error(`${e} local connect is not available yet.`);const r=await Ht("/api/local-agent-integrations/connect",{id:n,metadata:{source:"node-ui"}}),o=r.integration?await kh(r.integration):(await iu()).integrations.find(s=>s.id===n);if(!o)throw new Error(`Missing local agent integration: ${n}`);return{integration:o,notice:r.notice}}async function yj(e){const n=e.trim().toLowerCase();await xh(`/api/local-agent-integrations/${encodeURIComponent(n)}`,{enabled:!1,runtime:{status:"disconnected",ready:!1,lastError:null}})}async function vj(e){const n=e.trim().toLowerCase(),a=await Ht(`/api/local-agent-integrations/${encodeURIComponent(n)}/refresh`,{}),r=a.integration?await kh(a.integration):(await iu()).integrations.find(o=>o.id===n);if(!r)throw new Error(`Missing local agent integration: ${n}`);return{integration:r,notice:a.notice}}async function S0(e,n=50,a={}){if(e.trim().toLowerCase()==="local-llm")return[];const r=ij(e,a.sessionId);return r?rj(r,n):[]}async function xj(e){var a;const n=(a=e.sessionId)==null?void 0:a.trim();if(!n)throw new Error("Missing Hermes session id");return Ht("/api/hermes-channel/persist-turn",{sessionId:n,userMessage:e.userMessage,assistantReply:e.assistantReply??"",correlationId:e.correlationId,attachmentRefs:e.attachments,persistenceState:"failed",failureReason:e.failureReason,contextGraphId:e.contextGraphId,profile:e.profile,metadata:{source:"node-ui-failed-turn"}})}async function bj(e,n){if(e.trim().toLowerCase()==="hermes")return xj(n);throw new Error(`${e} local chat persistence is not available yet.`)}async function wj(e,n,a={}){const r=e.trim().toLowerCase(),o=au[r];if(o!=null&&o.streamChat){const{sessionId:s,liveSession:u,profile:d,...p}=a,f=(y,g)=>{var x;return{...p,...(x=o.resolveChatContext)==null?void 0:x.call(o,{integrationId:r,sessionId:y,liveSession:g,profile:d})}};try{return await o.streamChat(n,f(s,u))}catch(y){if(r==="prime-agent"&&u&&y instanceof Lc&&y.code==="PRIME_AGENT_NO_SESSION")return o.streamChat(n,f());throw y}}throw new Error(`${e} local chat is not available yet.`)}const Sj=()=>Qe("/api/economics"),yb=()=>Qe("/api/wallets/balances"),k8=()=>Ht("/api/shutdown",{}),kj=(e,n)=>Ht("/api/subscribe",{contextGraphId:e,syncMode:(n==null?void 0:n.syncMode)??"on-demand"}),Cj=()=>Qe("/api/notifications"),vb=e=>Ht("/api/notifications/read",e?{ids:e}:{}),Ej=e=>nb(`/api/sub-graph/list?contextGraphId=${encodeURIComponent(e)}`,db),Aj={name:"my-dkg-node",networkName:"DKG Mainnet",connectedPeers:12,synced:!0,version:"10.0.0-rc"},jj={total_kcs:1842,confirmed_kcs:1623,tentative_kcs:219},Tj={agents:[{name:"my-dkg-node",peerId:"QmYourNode123",connectionStatus:"self"},{name:"research-agent",peerId:"QmResearch456",connectionStatus:"connected",lastSeen:Date.now()},{name:"data-curator",peerId:"QmCurator789",connectionStatus:"connected",lastSeen:Date.now()-6e4},{name:"pharma-bot",peerId:"QmPharma012",connectionStatus:"discovered",lastSeen:Date.now()-3e5}]},Nj={contextGraphs:[{id:"cg:pharma-drug-interactions",name:"Pharma Drug Interactions",description:"Drug interaction knowledge graph for clinical decision support",assetCount:227,agentCount:3,callerInvolved:!0,curator:"did:dkg:agent:0x1111111111111111111111111111111111111111"},{id:"cg:climate-science",name:"Climate Science",description:"Climate research data and projections",assetCount:45,agentCount:2,callerInvolved:!0,curator:"did:dkg:agent:0x1111111111111111111111111111111111111111"},{id:"cg:supply-chain-eu",name:"EU Supply Chain",description:"European supply chain provenance tracking",assetCount:89,agentCount:1,callerInvolved:!0,curator:"did:dkg:agent:0x5555555555555555555555555555555555555555"}]},Rj={"cg:pharma-drug-interactions":{contextGraphId:"cg:pharma-drug-interactions",allowedAgents:["0x2222222222222222222222222222222222222222","0x3333333333333333333333333333333333333333"]},"cg:climate-science":{contextGraphId:"cg:climate-science",allowedAgents:["0x4444444444444444444444444444444444444444"]},"cg:supply-chain-eu":{contextGraphId:"cg:supply-chain-eu",allowedAgents:[]}},_j={operations:[{id:"op-1",name:"publish",status:"completed",startedAt:Date.now()-12e4},{id:"op-2",name:"query",status:"completed",startedAt:Date.now()-3e5},{id:"op-3",name:"publish",status:"completed",startedAt:Date.now()-6e5},{id:"op-4",name:"chat",status:"completed",startedAt:Date.now()-9e5},{id:"op-5",name:"sync",status:"failed",startedAt:Date.now()-18e5},{id:"op-6",name:"publish",status:"completed",startedAt:Date.now()-36e5}],total:6},Oj={periods:[{label:"24h",publishCount:3,successCount:3,totalGasEth:7e-4,totalTrac:9.1,avgGasEth:23e-5,avgTrac:3.03},{label:"7d",publishCount:14,successCount:12,totalGasEth:.0034,totalTrac:42.5,avgGasEth:24e-5,avgTrac:3.04},{label:"30d",publishCount:47,successCount:43,totalGasEth:.012,totalTrac:156.8,avgGasEth:26e-5,avgTrac:3.34}]},Dj={agentAddress:"0x1111111111111111111111111111111111111111",agentDid:"did:dkg:agent:0x1111111111111111111111111111111111111111",name:"mock-node-agent",framework:"mock",peerId:"QmMockNodeAgentPeer000000000000000000000000",nodeIdentityId:"mock-node-identity"},Mj={wallets:["0xA1b2C3d4E5f60718293a4B5c6D7e8F9012345678","0xB2c3D4e5F60718293a4B5c6D7e8F90123456789a","0xC3d4E5f60718293a4B5c6D7e8F90123456789aB1"],balances:[{address:"0xA1b2C3d4E5f60718293a4B5c6D7e8F9012345678",eth:"0.842",trac:"1250.50",symbol:"TRAC"},{address:"0xB2c3D4e5F60718293a4B5c6D7e8F90123456789a",eth:"0.310",trac:"480.00",symbol:"TRAC"},{address:"0xC3d4E5f60718293a4B5c6D7e8F90123456789aB1",eth:"0.005",trac:"0.00",symbol:"TRAC"}],chainId:"8453",rpcUrl:"https://mock.rpc",symbol:"TRAC"},Lj={notifications:[{type:"join_request",id:101,ts:Date.now()-12e4,read:0,contextGraphId:"cg:pharma-drug-interactions",meta:{contextGraphName:"Pharma Drug Interactions",agentAddress:"0xab12cd34ef56ab78cd90ab12cd34ef56ab78cd90",agentName:"research-agent"}},{type:"assertion_activity",id:"activity:cg:pharma-drug-interactions:promoted:29812",ts:Date.now()-3e5,read:0,contextGraphId:"cg:pharma-drug-interactions",meta:{contextGraphName:"Pharma Drug Interactions",kind:"promoted",count:3,actorAgentDid:"did:dkg:agent:0xdana00000000000000000000000000000000dana",actorAgentName:"Dana",soleAuthor:!0}},{type:"join_approved",id:102,ts:Date.now()-9e5,read:1,contextGraphId:"cg:climate-arctic",meta:{contextGraphName:"Arctic Climate",agentAddress:"0x0000000000000000000000000000000000000001"}}],badgeCount:2},zj={lines:["[2026-04-11 10:30:01] INFO Node started on port 8900","[2026-04-11 10:30:02] INFO Connected to DKG mainnet","[2026-04-11 10:30:03] INFO Discovered 12 peers","[2026-04-11 10:30:05] INFO Syncing context graph cg:pharma-drug-interactions","[2026-04-11 10:30:08] INFO Sync complete: 227 assets, 3 agents","[2026-04-11 10:30:15] INFO Agent research-agent connected via libp2p","[2026-04-11 10:31:00] INFO Publish operation started: warfarin-aspirin-001","[2026-04-11 10:31:12] INFO Triple store updated: +34 triples","[2026-04-11 10:31:15] INFO Publish complete: warfarin-aspirin-001 → Verifiable Memory","[2026-04-11 10:32:00] DEBUG SPARQL query executed in 23ms (42 results)","[2026-04-11 10:33:00] INFO Gossip: received 3 proposals from data-curator","[2026-04-11 10:34:00] INFO SWM cleanup: 0 expired triples removed","[2026-04-11 10:35:00] INFO Heartbeat: 12 peers, 1842 KAs, memory 245MB"],totalSize:13},Ij={sessions:[{session:"sess-abc123",messages:[{author:"user",text:"What drug interactions should I know about warfarin?",ts:"2026-04-11T10:00:00Z"},{author:"assistant",text:"Warfarin has significant interactions with aspirin, NSAIDs, and several antibiotics. The most critical ones involve...",ts:"2026-04-11T10:00:05Z"}]},{session:"sess-def456",messages:[{author:"user",text:"Summarize the latest climate data for Arctic ice",ts:"2026-04-10T14:00:00Z"},{author:"assistant",text:"Based on the latest projections in the verifiable memory...",ts:"2026-04-10T14:00:03Z"}]}]},Pj={"cg:pharma-drug-interactions":{contextGraphId:"cg:pharma-drug-interactions",subGraphs:[{name:"interactions",uri:"did:dkg:context-graph:cg:pharma-drug-interactions/interactions",description:"Pairwise drug interaction records",createdBy:"did:dkg:agent:0x1111111111111111111111111111111111111111",createdAt:"2026-04-02T09:15:00Z",entityCount:148,tripleCount:1721},{name:"contraindications",uri:"did:dkg:context-graph:cg:pharma-drug-interactions/contraindications",createdBy:"did:dkg:agent:0x2222222222222222222222222222222222222222",createdAt:"2026-04-05T16:40:00Z",entityCount:79,tripleCount:604}]},"cg:climate-science":{contextGraphId:"cg:climate-science",subGraphs:[{name:"arctic-ice",uri:"did:dkg:context-graph:cg:climate-science/arctic-ice",description:"Sea-ice extent projections",createdBy:"did:dkg:agent:0x3333333333333333333333333333333333333333",createdAt:"2026-04-11T08:05:00Z",entityCount:32,tripleCount:410}]}};function zn(e,n=50){return new Promise(a=>setTimeout(()=>a(e),n))}const In={fetchStatus:()=>zn(Aj),fetchMetrics:()=>zn(jj),fetchAgents:()=>zn(Tj),fetchContextGraphs:()=>zn(Nj),fetchOperationsWithPhases:()=>zn(_j),fetchEconomics:()=>zn(Oj),fetchWalletsBalances:()=>zn(Mj),fetchCurrentAgent:()=>zn(Dj),listParticipants:e=>zn(Rj[e]??{contextGraphId:e,allowedAgents:[]}),fetchSubGraphs:e=>zn(Pj[e]??{contextGraphId:e,subGraphs:[]}),fetchNotificationsFeed:()=>zn(Lj),fetchNodeLog:()=>zn(zj),fetchMemorySessions:()=>zn(Ij)};let Xa=null,fo=null;const Uj=5e3,k0=2,Bj=250,Mp=new Set;function Hj(){return Xa===!0}function $j(e){return Mp.add(e),e(Xa===!0),()=>{Mp.delete(e)}}function qj(){if(typeof window>"u")return{};const e=window.__DKG_TOKEN__;return e?{Authorization:`Bearer ${e}`}:{}}function Fj(e){return new Promise(n=>setTimeout(n,e))}async function Gj(){for(let e=1;e<=k0;e+=1){try{const n=await fetch("/api/status",{cache:"no-store",headers:qj(),signal:AbortSignal.timeout(Uj)});if(n.ok||n.status===401)return!1}catch{}e<k0&&await Fj(Bj)}return!0}async function Vj(){if(Xa!==null)return Xa;if(fo)return fo;fo=(async()=>(Xa=await Gj(),typeof window<"u"&&(window.__DKG_USING_MOCKS__=Xa,Xa&&console.warn("[dkg-ui] /api/status unreachable (timeout/5xx/network) — falling back to demo (mock) data. The UI is NOT showing live node state.")),Mp.forEach(e=>e(Xa)),Xa))();try{return await fo}finally{fo=null}}async function Pn(e,n){return await Vj()?n():e()}const Bn={fetchStatus:()=>Pn(wA,In.fetchStatus),fetchMetrics:()=>Pn(EA,In.fetchMetrics),fetchAgents:()=>Pn(pb,In.fetchAgents),fetchContextGraphs:()=>Pn(bh,In.fetchContextGraphs),fetchOperationsWithPhases:e=>Pn(()=>AA(e),In.fetchOperationsWithPhases),fetchEconomics:()=>Pn(Sj,In.fetchEconomics),fetchWalletsBalances:()=>Pn(yb,In.fetchWalletsBalances),fetchCurrentAgent:()=>Pn(nu,In.fetchCurrentAgent),listParticipants:e=>Pn(()=>NA(e),()=>In.listParticipants(e)),fetchSubGraphs:e=>Pn(()=>Ej(e),()=>In.fetchSubGraphs(e)),fetchNotificationsFeed:()=>Pn(Cj,In.fetchNotificationsFeed),fetchNodeLog:e=>Pn(()=>jA(e),In.fetchNodeLog),fetchMemorySessions:e=>Pn(()=>GA(e),In.fetchMemorySessions),markNotificationsRead:vb,executeQuery:wh},Wj=6e4;let Di={data:null,loading:!0,error:null},Sa=null,Co=null,ko=0,Oi="";const Pc=new Set;function lr(){if(typeof window>"u")return"";const e=window.__DKG_TOKEN__;return e?`Bearer ${e}`:""}function Cc(e){Oi=e,Di={data:null,loading:!0,error:null}}function Pf(){const e=lr();return e!==Oi&&Cc(e),Di}function Ec(){for(const e of Pc)e()}function Uf(e){Di=e,Ec()}function Uc(){const e=ko,n=lr();if((Sa==null?void 0:Sa.authKey)===n)return Sa.promise;n!==Oi?(Cc(n),Ec()):Uf({...Di,loading:!0,error:null});const a=Bn.fetchCurrentAgent().then(r=>{if(e===ko){if(n!==lr()){const o=lr(),s=Oi!==o||Di.loading;Oi!==o&&(Cc(o),Ec()),s&&Uc();return}Uf({data:r,loading:!1,error:null})}}).catch(r=>{if(e===ko){if(n!==lr()){const o=lr(),s=Oi!==o||Di.loading;Oi!==o&&(Cc(o),Ec()),s&&Uc();return}Uf({data:Di.data,loading:!1,error:r instanceof Error?r.message:"Failed to load current agent"})}}).finally(()=>{e===ko&&(Sa==null?void 0:Sa.promise)===a&&(Sa=null)});return Sa={authKey:n,promise:a},a}function Yj(){Uc(),!Co&&(Co=setInterval(()=>{Uc()},Wj))}function Kj(){Pc.size>0||!Co||(clearInterval(Co),Co=null,ko+=1,Sa=null,Di={data:null,loading:!0,error:null},Oi=lr())}function Ch(){const[e,n]=S.useState(Pf);return S.useEffect(()=>{const a=()=>n(Pf());return Pc.add(a),n(Pf()),Yj(),()=>{Pc.delete(a),Kj()}},[]),e}const ca=ur(e=>({contextGraphs:[],loading:!1,activeProjectId:null,setContextGraphs:n=>e({contextGraphs:n}),setLoading:n=>e({loading:n}),setActiveProject:n=>e({activeProjectId:n})})),tl=new Set;let Qt=null,Ac=null;const Qj=350;function C0(e){return e==="wm"||e==="swm"||e==="vm"}function Xj(e){const n=e.layers;return Array.isArray(n)?n.filter(C0):C0(e.layer)?[e.layer]:[]}function Zj(e,n,a){if(!n||e.contextGraphId!==n)return!1;if(!a||a.length===0)return!0;const r=Xj(e);return r.length===0?!0:a.some(o=>r.includes(o))}function xb(){if(Qt)return;const e=typeof window<"u"?window.__DKG_TOKEN__:void 0,n=e?`/api/events?token=${encodeURIComponent(e)}`:"/api/events";Qt=new EventSource(n);const a=r=>o=>{let s={};try{s=JSON.parse(o.data)}catch{}const u={type:r,data:s};for(const d of tl)try{d(u)}catch{}};Qt.addEventListener("join_request",a("join_request")),Qt.addEventListener("join_approved",a("join_approved")),Qt.addEventListener("join_rejected",a("join_rejected")),Qt.addEventListener("project_synced",a("project_synced")),Qt.addEventListener("memory_graph_changed",a("memory_graph_changed")),Qt.addEventListener("notification",a("notification")),Qt.addEventListener("connected",a("connected")),Qt.onerror=()=>{Qt==null||Qt.close(),Qt=null,tl.size>0&&(Ac=setTimeout(xb,3e3))}}function Jj(){Ac&&(clearTimeout(Ac),Ac=null),Qt==null||Qt.close(),Qt=null}function eT(e){return tl.add(e),tl.size===1&&xb(),()=>{tl.delete(e),tl.size===0&&Jj()}}function pl(e){const n=S.useRef(e);n.current=e,S.useEffect(()=>eT(a=>n.current(a)),[])}function tT(e,n,a={}){var p;const r=S.useRef(n),o=S.useRef(null);r.current=n;const s=a.debounceMs??Qj,u=S.useMemo(()=>a.layers??[],[(p=a.layers)==null?void 0:p.join("|")]),d=S.useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]);pl(S.useCallback(f=>{f.type==="memory_graph_changed"&&Zj(f.data,e,u)&&(d(),o.current=setTimeout(()=>{o.current=null,r.current(f.data)},s))},[d,e,s,u])),S.useEffect(()=>d,[d])}function Ho(e,n,a={}){const r=S.useRef(e);r.current=e;const o=S.useRef(a);o.current=a,S.useEffect(()=>{if(n<=0)return;let s=null,u=!1;const d=()=>{s||u||(s=setInterval(()=>r.current(),n))},p=()=>{s&&(clearInterval(s),s=null)},f=()=>{if(document.hidden){p();return}r.current(),d()};return o.current.runImmediately!==!1&&!document.hidden&&r.current(),document.hidden||d(),document.addEventListener("visibilitychange",f),()=>{u=!0,document.removeEventListener("visibilitychange",f),p()}},[n])}const nT="No pending join request found";function aT(e){const n=[];for(const a of e)a.type==="join_request"&&n.push({id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,agentAddress:a.meta.agentAddress,agentName:a.meta.agentName,ts:a.ts,read:a.read===1});return n.sort((a,r)=>r.ts-a.ts),n}function iT(e){const n=[];for(const a of e)a.type==="assertion_activity"?n.push({kind:"digest",id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,event:a.meta.kind,count:a.meta.count,...a.meta.soleAuthor&&a.meta.actorAgentDid?{actorAgentDid:a.meta.actorAgentDid,actorAgentName:a.meta.actorAgentName}:{},...a.meta.bySelf?{bySelf:!0}:{},ts:a.ts,read:a.read===1}):a.type==="join_approved"||a.type==="join_rejected"?n.push({kind:a.type,id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,ts:a.ts,read:a.read===1}):a.type==="pca_cost_covered"&&n.push({kind:"pca_cost_covered",id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,covered:a.meta,publisherAddress:a.meta.publisherAddress,ts:a.ts,read:a.read===1});return n.sort((a,r)=>r.ts-a.ts),n}function E0(e){return e.filter(n=>n.type!=="join_request"&&n.read===0).map(n=>n.id)}function A0(e){const n=e instanceof Error?e.message:String(e);if(n.includes(nT))return{ok:!0,alreadyHandled:!0};const a=/context graph creator|manage (invitations|join requests)|curator/i.test(n);return{ok:!1,error:n,roleError:a}}function rT(){const[e,n]=S.useState(null),[a,r]=S.useState("loading"),[o,s]=S.useState(!1),u=S.useRef(!1),d=S.useCallback(()=>{Bn.fetchNotificationsFeed().then(O=>{u.current=!0,n(O),s(!1),r(O.scopeUnknown?"identity-pending":"ready")}).catch(()=>{u.current?s(!0):r("error")})},[]);Ho(d,6e4);const p=S.useRef(null),f=S.useCallback(()=>{p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{p.current=null,d()},400)},[d]);S.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]),pl(S.useCallback(O=>{O.type==="notification"&&f()},[f]));const y=S.useMemo(()=>aT((e==null?void 0:e.notifications)??[]),[e]),g=S.useMemo(()=>iT((e==null?void 0:e.notifications)??[]),[e]),x=(e==null?void 0:e.badgeCount)??0,b=S.useMemo(()=>E0((e==null?void 0:e.notifications)??[]).length>0,[e]),k=S.useCallback(O=>{O.length!==0&&(n(G=>{if(!G)return G;const U=new Set(O.map(String));return{...G,notifications:G.notifications.map(_=>U.has(String(_.id))?{..._,read:1}:_)}}),vb(O).then(d).catch(()=>{}))},[d]),C=S.useCallback(()=>{k(E0((e==null?void 0:e.notifications)??[]))},[e,k]),j=S.useCallback(async(O,G)=>{try{return await OA(O,G),d(),{ok:!0}}catch(U){const _=A0(U);return _.ok&&_.alreadyHandled&&d(),_}},[d]),E=S.useCallback(async(O,G)=>{try{return await DA(O,G),d(),{ok:!0}}catch(U){const _=A0(U);return _.ok&&_.alreadyHandled&&d(),_}},[d]),R=S.useCallback(()=>{s(!1),r(u.current?"ready":"loading"),d()},[d]);return{joinRequests:y,activity:g,unread:x,hasInformationalUnread:b,status:a,refreshError:o,partialActivityError:!1,approve:j,deny:E,markSeen:k,markAllInformationalSeen:C,retry:R}}const lT="dkg-pca",oT=150;function sT(e){return[String(e.chainId).toLowerCase(),e.nft.toLowerCase(),e.token.toLowerCase()].join(":")}function Ri(e){return e?`${lT}:${e}`:null}const Bf={trackedIds:[],createPending:null,topUpPending:{}};function Eo(e){return typeof e=="string"&&/^\d+$/.test(e)}function cT(e){if(!Array.isArray(e))return[];const n=new Set,a=[];for(const r of e)Eo(r)&&!n.has(r)&&(n.add(r),a.push(r));return a}function uT(e){if(e==null||typeof e!="object")return null;const n=e;return typeof n.ownerEoa!="string"||n.ownerEoa.length===0||typeof n.submittedAt!="number"||!Number.isFinite(n.submittedAt)?null:{ownerEoa:n.ownerEoa,submittedAt:n.submittedAt,...typeof n.txHash=="string"&&n.txHash.length>0?{txHash:n.txHash}:{}}}function dT(e){if(e==null||typeof e!="object")return{};const n={};for(const[a,r]of Object.entries(e)){if(!Eo(a)||r==null||typeof r!="object")continue;const o=r;o.accountId===a&&(typeof o.ownerEoa!="string"||o.ownerEoa.length===0||typeof o.txHash!="string"||o.txHash.length===0||typeof o.submittedAt!="number"||!Number.isFinite(o.submittedAt)||(n[a]={accountId:a,ownerEoa:o.ownerEoa,txHash:o.txHash,submittedAt:o.submittedAt,...typeof o.tokens=="string"?{tokens:o.tokens}:{},...typeof o.previousTopUpBufferTrac=="string"?{previousTopUpBufferTrac:o.previousTopUpBufferTrac}:{}}))}return n}function bb(e){const n=Ri(e);if(!n)return{...Bf};try{const a=localStorage.getItem(n);if(!a)return{...Bf};const r=JSON.parse(a);return{trackedIds:cT(r.trackedIds),createPending:uT(r.createPending),topUpPending:dT(r.topUpPending)}}catch{return{...Bf}}}let Ca=null;function sc(e,n){e&&(Ca&&clearTimeout(Ca),Ca=setTimeout(()=>{Ca=null;try{localStorage.setItem(e,JSON.stringify(n))}catch{}},oT))}function Hf(e,n){if(Ca&&(clearTimeout(Ca),Ca=null),!e)return!1;try{return localStorage.setItem(e,JSON.stringify(n)),!0}catch{return!1}}function ar(e){return{trackedIds:e.trackedIds,createPending:e.createPending,topUpPending:e.topUpPending}}const cc=bb(null),Lp=ur((e,n)=>({scopeKey:null,trackedIds:cc.trackedIds,createPending:cc.createPending,topUpPending:cc.topUpPending,createPendingPersisted:cc.createPending!=null,setScope:a=>{if(n().scopeKey===a)return;Ca&&(clearTimeout(Ca),Ca=null);const r=bb(a);e({scopeKey:a,trackedIds:r.trackedIds,createPending:r.createPending,topUpPending:r.topUpPending,createPendingPersisted:r.createPending!=null})},trackAccount:a=>{Eo(a)&&(e(r=>r.trackedIds.includes(a)?r:{trackedIds:[...r.trackedIds,a]}),sc(Ri(n().scopeKey),ar(n())))},untrackAccount:a=>{e(r=>r.trackedIds.includes(a)?{trackedIds:r.trackedIds.filter(o=>o!==a)}:r),sc(Ri(n().scopeKey),ar(n()))},isTracked:a=>n().trackedIds.includes(a),setCreatePending:a=>{e({createPending:a});const r=Hf(Ri(n().scopeKey),ar(n()));return e({createPendingPersisted:r}),r},clearCreatePending:()=>{e({createPending:null,createPendingPersisted:!1}),sc(Ri(n().scopeKey),ar(n()))},setTopUpPending:a=>{Eo(a.accountId)&&(e(r=>({topUpPending:{...r.topUpPending,[a.accountId]:a}})),Hf(Ri(n().scopeKey),ar(n())))},clearTopUpPending:a=>{e(r=>{if(!r.topUpPending[a])return r;const o={...r.topUpPending};return delete o[a],{topUpPending:o}}),sc(Ri(n().scopeKey),ar(n()))},finishCreate:a=>{e(r=>({createPending:null,createPendingPersisted:!1,trackedIds:Eo(a)&&!r.trackedIds.includes(a)?[...r.trackedIds,a]:r.trackedIds})),Hf(Ri(n().scopeKey),ar(n()))}}));function $f(e){if(!e)return!1;try{return BigInt(e)>0n}catch{return!1}}function wb(e,n=Math.floor(Date.now()/1e3)){const{expiresAtTimestamp:a}=e;return typeof a=="number"&&a>0&&n>=a}function Sb(e,n){return wb(e,n)||!!e.fullySwept}function Eh(e){return $f(e.topUpBuffer)?!0:e.remainingAllowance!==void 0?$f(e.remainingAllowance):e.extendedRequested?null:$f(e.baseEpochAllowance)}function fT(e){return Eh(e)===!0}function pT(e){return e.remainingAllowance!==void 0&&Eh(e)===!1}const kb=90,Cb=10080*60;function hT(e,n=Math.floor(Date.now()/1e3)){const{expiresAtTimestamp:a,fullySwept:r,agentCount:o}=e,s=typeof a=="number"&&a>0;return wb(e,n)?"expired":r?"swept":pT(e)?"insolvent":typeof o=="number"&&o>=kb?"cap-near":s&&a-n<=Cb?"expiring":"healthy"}function mT(e,n){return!Sb(e,n)&&fT(e)}function gT(e){return(e==null?void 0:e.adapterSupported)===!1?null:(e==null?void 0:e.registered)??null}function yT(e,n){var u;const a=gT(e.probedKey);if(a===null)return{outcome:"inconclusive",registered:null,adapterUnsupported:((u=e.probedKey)==null?void 0:u.adapterSupported)===!1};if(a===!1)return{outcome:"unregistered",registered:!1};const r=Sb(e,n),o=Eh(e);if(o===null)return{outcome:"inconclusive",registered:null,adapterUnsupported:!1};const s=o;return!r&&s?{outcome:"covers",registered:!0}:{outcome:"uncovered",registered:!0,dead:r,hasBudget:s}}const j0=(e,n)=>!!e&&!!n&&e.toLowerCase()===n.toLowerCase();async function vT(e,n){const a={accountId:e,snapshot:null,error:null,notFound:!1,classification:"unknown",ownerIsPrimaryWallet:!1,health:null,walletProbes:[],approvedCount:0,walletCount:n.length,probesInconclusive:!1};let r;try{r=await x0(e,void 0,{extended:!0})}catch(f){return{...a,error:f,notFound:f instanceof gn&&f.status===404}}const o=await Promise.all(n.map(f=>x0(e,f,{extended:!0}).then(y=>({wallet:f,registered:yT(y).registered})).catch(()=>({wallet:f,registered:null})))),s=o.filter(f=>f.registered===!0).length,u=o.some(f=>f.registered===null),p=n.some(f=>j0(f,r.owner))?"owned":s>0?"approved":"unknown";return{accountId:e,snapshot:r,error:null,notFound:!1,classification:p,ownerIsPrimaryWallet:j0(n[0],r.owner),health:hT(r),walletProbes:o,approvedCount:s,walletCount:n.length,probesInconclusive:u}}const nl=new Map;function T0(e){for(const n of e.subs)n()}async function Bc(e){const n=++e.seq;if(e.ids.length===0){if(n!==e.seq)return;e.data={wallets:[],walletsError:!1,accounts:[]},e.error=null,e.loading=!1,T0(e);return}try{const a=await yb().catch(()=>null),r=(a==null?void 0:a.wallets)??[],o=!a||!!a.error,s=await Promise.all(e.ids.map(u=>vT(u,r)));if(n!==e.seq)return;e.data={wallets:r,walletsError:o,accounts:s},e.error=null}catch(a){if(n!==e.seq)return;e.error=(a==null?void 0:a.message)??"Failed to resolve PCAs."}finally{n===e.seq&&(e.loading=!1,T0(e))}}function qf(e){e.timer||e.intervalMs<=0||typeof document<"u"&&document.hidden||(e.timer=setInterval(()=>Bc(e),e.intervalMs))}function Ff(e){e.timer&&(clearInterval(e.timer),e.timer=null)}function xT(e,n,a,r){let o=nl.get(e);const s=!o;if(o||(o={ids:n,data:null,loading:!0,error:null,subs:new Set,timer:null,intervalMs:a,onVisibility:null,seq:0},nl.set(e,o)),o.subs.add(r),s){const u=o,d=()=>{typeof document>"u"||(document.hidden?Ff(u):(Bc(u),qf(u)))};o.onVisibility=d,typeof document<"u"&&document.addEventListener("visibilitychange",d),Bc(o),qf(o)}else a<o.intervalMs&&(o.intervalMs=a,Ff(o),qf(o));return()=>{const u=nl.get(e);u&&(u.subs.delete(r),u.subs.size===0&&(Ff(u),u.onVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",u.onVisibility),nl.delete(e)))}}const bT=[];function Eb(e=3e4,n=[]){var C,j,E;const a=Lp(R=>R.trackedIds),r=n.join(","),o=S.useMemo(()=>[...a,...n.filter(R=>!a.includes(R))],[a.join(","),r]),s=o.join(","),[,u]=S.useReducer(R=>R+1,0);S.useEffect(()=>xT(s,o,e,u),[s,e]);const d=nl.get(s),p=((C=d==null?void 0:d.data)==null?void 0:C.accounts)??bT,f=d?d.loading:!0,y=(d==null?void 0:d.error)??null,{bestCoveringDiscountBps:g,covered:x}=S.useMemo(()=>{let R=null;for(const O of p){if(!O.snapshot||O.approvedCount<=0||!mT(O.snapshot))continue;const G=O.snapshot.discountBps;typeof G=="number"&&(R==null||G>R)&&(R=G)}return{bestCoveringDiscountBps:R,covered:R!=null}},[p]),b=((j=d==null?void 0:d.data)==null?void 0:j.wallets)??[],k=((E=d==null?void 0:d.data)==null?void 0:E.walletsError)??!1;return{accounts:p,wallets:b,walletsError:k,walletsInconclusive:k&&b.length===0,loading:f,error:y,refresh:()=>{const R=nl.get(s);R&&Bc(R)},bestCoveringDiscountBps:g,covered:x}}let Gf=null;function Ab(){const e=Lp(a=>a.scopeKey),n=Lp(a=>a.setScope);S.useEffect(()=>{e||Gf||(Gf=xA().then(a=>{n(sT(a))}).catch(()=>{}).finally(()=>{Gf=null}))},[e,n])}function wT(){Ab();const{accounts:e}=Eb(3e4);return S.useMemo(()=>{const n=[],a=Math.floor(Date.now()/1e3);for(const r of e){const o=r.snapshot;if(!o)continue;const s=r.accountId,u=typeof o.expiresAtTimestamp=="number"&&o.expiresAtTimestamp>0,d=u&&a>=o.expiresAtTimestamp;d?n.push({id:`pca-${s}-expired`,accountId:s,kind:"expired",severity:"danger",title:`PCA #${s} has expired`,message:"Publishes no longer get its discount. Create a replacement account to keep saving."}):u&&o.expiresAtTimestamp-a<=Cb&&n.push({id:`pca-${s}-expiring`,accountId:s,kind:"expiring",severity:"warn",title:`PCA #${s} is expiring soon`,message:"Top-up can’t extend the lock period — plan a replacement before it expires."}),o.fullySwept&&n.push({id:`pca-${s}-swept`,accountId:s,kind:"swept",severity:"warn",title:`PCA #${s} is fully swept`,message:"Its epoch budgets have been swept to the staker reward pool."}),typeof o.agentCount=="number"&&o.agentCount>=kb&&n.push({id:`pca-${s}-cap`,accountId:s,kind:"cap-near",severity:"warn",title:`PCA #${s} is near the 100-wallet cap`,message:"Deregister unused wallets to make room before approving more."}),r.classification==="owned"&&r.approvedCount===0&&!r.probesInconclusive&&!d&&n.push({id:`pca-${s}-fallthrough`,accountId:s,kind:"fallthrough",severity:"warn",title:`PCA #${s} discounts nothing yet`,message:"Publishes from this node pay the direct cost until you approve this node’s operational wallets."})}return n},[e])}function Mo(e,n=new Date){if(e==null||e==="")return"";const a=e instanceof Date?e:new Date(e);if(Number.isNaN(a.getTime()))return"";if(a.toDateString()===n.toDateString())return a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});const o=new Date(n);if(o.setDate(n.getDate()-1),a.toDateString()===o.toDateString())return`Yesterday ${a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`;const s=n.getTime()-a.getTime();return s>=0&&s<10080*60*1e3?`${a.toLocaleDateString(void 0,{weekday:"short"})} ${a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`:a.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}/**
91
- * @license lucide-react v1.14.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const jb=(...e)=>e.filter((n,a,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===a).join(" ").trim();/**
96
- * @license lucide-react v1.14.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const ST=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
101
- * @license lucide-react v1.14.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const kT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,r)=>r?r.toUpperCase():a.toLowerCase());/**
106
- * @license lucide-react v1.14.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const N0=e=>{const n=kT(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
111
- * @license lucide-react v1.14.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */var Vf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
116
- * @license lucide-react v1.14.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const CT=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},ET=S.createContext({}),AT=()=>S.useContext(ET),jT=S.forwardRef(({color:e,size:n,strokeWidth:a,absoluteStrokeWidth:r,className:o="",children:s,iconNode:u,...d},p)=>{const{size:f=24,strokeWidth:y=2,absoluteStrokeWidth:g=!1,color:x="currentColor",className:b=""}=AT()??{},k=r??g?Number(a??y)*24/Number(n??f):a??y;return S.createElement("svg",{ref:p,...Vf,width:n??f??Vf.width,height:n??f??Vf.height,stroke:e??x,strokeWidth:k,className:jb("lucide",b,o),...!s&&!CT(d)&&{"aria-hidden":"true"},...d},[...u.map(([C,j])=>S.createElement(C,j)),...Array.isArray(s)?s:[s]])});/**
121
- * @license lucide-react v1.14.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const $t=(e,n)=>{const a=S.forwardRef(({className:r,...o},s)=>S.createElement(jT,{ref:s,iconNode:n,className:jb(`lucide-${ST(N0(e))}`,`lucide-${e}`,r),...o}));return a.displayName=N0(e),a};/**
126
- * @license lucide-react v1.14.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const TT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],NT=$t("arrow-down",TT);/**
131
- * @license lucide-react v1.14.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const RT=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],_T=$t("arrow-up",RT);/**
136
- * @license lucide-react v1.14.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const OT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],DT=$t("ban",OT);/**
141
- * @license lucide-react v1.14.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const MT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],LT=$t("check",MT);/**
146
- * @license lucide-react v1.14.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const zT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],IT=$t("chevron-down",zT);/**
151
- * @license lucide-react v1.14.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const PT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],zp=$t("chevron-right",PT);/**
156
- * @license lucide-react v1.14.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const UT=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],BT=$t("copy",UT);/**
161
- * @license lucide-react v1.14.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const HT=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],$T=$t("ellipsis",HT);/**
166
- * @license lucide-react v1.14.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const qT=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],FT=$t("folder",qT);/**
171
- * @license lucide-react v1.14.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const GT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],VT=$t("globe",GT);/**
176
- * @license lucide-react v1.14.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const WT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],YT=$t("loader-circle",WT);/**
181
- * @license lucide-react v1.14.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const KT=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],QT=$t("lock",KT);/**
186
- * @license lucide-react v1.14.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const XT=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],ZT=$t("paperclip",XT);/**
191
- * @license lucide-react v1.14.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const JT=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],R0=$t("share-2",JT);/**
196
- * @license lucide-react v1.14.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const eN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],tN=$t("square",eN);/**
201
- * @license lucide-react v1.14.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const nN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],aN=$t("trending-up",nN);/**
206
- * @license lucide-react v1.14.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const iN=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],rN=$t("upload",iN);/**
211
- * @license lucide-react v1.14.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const lN=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],oN=$t("users-round",lN);/**
216
- * @license lucide-react v1.14.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const sN=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],cN=$t("wallet",sN);/**
221
- * @license lucide-react v1.14.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const uN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],dN=$t("x",uN),Wf={1:"ETH",8453:"ETH",84532:"ETH",11155111:"ETH",31337:"ETH",100:"xDAI",10200:"xDAI",2043:"NEURO",20430:"NEURO"};function Tb(e){var r;if(e==null)return"ETH";const n=String(e);if(Wf[n])return Wf[n];const a=(r=n.match(/(\d+)\s*$/))==null?void 0:r[1];return a&&Wf[a]||"ETH"}function C8(e,n=6,a=4){const r=(e??"").trim();return r.length<=n+a+1?r:`${r.slice(0,n)}…${r.slice(-a)}`}const Yf="—";function fN(e,n=2){if(e==null)return Yf;let a;if(typeof e=="number")a=e;else{const s=String(e).trim();if(!/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(s))return Yf;a=Number(s)}if(!Number.isFinite(a))return Yf;const r=Math.abs(a),o=r>0&&r<10?n:0;return new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:o}).format(a)}function pN(e,n=2){if(e==null||e==="")return"—";let a;try{a=BigInt(e)}catch{return"—"}const r=a<0n;r&&(a=-a);const o=10n**18n,s=a/o,u=(a%o+o).toString().slice(1).slice(0,n);return fN(`${r?"-":""}${s}.${u||"0"}`,n)}const hN=new Set(["84532","11155111","31337","10200","20430"]);function E8(e){if(e==null)return!1;const n=String(e),a=n.includes(":")?n.split(":").pop():n;return hN.has(a)}function A8(e,n=Math.floor(Date.now()/1e3)){if(!e||e<=0)return"Expiry unknown";const a=e-n,r=Math.round(Math.abs(a)/86400);return a<=0?r===0?"Expired today":`Expired ~${r} day${r===1?"":"s"} ago`:`Expires in ~${r} day${r===1?"":"s"}`}function Nb(e){if(!e)return null;let n,a;try{n=BigInt(e.baseCost),a=BigInt(e.discountedCost)}catch{return null}return n<=0n||a<0n||a>=n?null:Number(((n-a)*10000n+n/2n)/n)}function j8({convictionCostCovered:e,className:n=""}){const a=Nb(e);if(e==null||a==null)return null;const r=(a/100).toFixed(a%100===0?0:1),o=e.accountId?`via PCA #${e.accountId}`:"across multiple PCAs";return m.jsxs("span",{className:["badge","badge-success","v10-pca-discount-applied",n].filter(Boolean).join(" "),"data-testid":"pca-discount-badge",role:"status",children:[m.jsx("span",{"aria-hidden":"true",children:"◉ "}),"Discount applied — −",r,"% ",o]})}const Hc=new Map,Ip=new Set;let _0=!1;function mN(){const e=[...Hc.values()];for(const n of Ip)n(e)}function gN(e){const n=e.detail;Hc.has(n.info.uuid)||(Hc.set(n.info.uuid,n),mN())}function yN(){_0||typeof window>"u"||(_0=!0,window.addEventListener("eip6963:announceProvider",gN),window.dispatchEvent(new Event("eip6963:requestProvider")))}function vN(e){return Ip.add(e),e([...Hc.values()]),()=>{Ip.delete(e)}}function Pp(e){var r;if(typeof e=="number")return e;const n=(r=String(e).match(/(\d+)\s*$/))==null?void 0:r[1],a=n?Number(n):NaN;if(!Number.isFinite(a))throw new Error(`Unrecognized chainId: ${e}`);return a}function xN(e){return`0x${Pp(e).toString(16)}`}const Ah="dkg-node-ui:wallet-provider-rdns";function bN(e){var n;try{(n=globalThis.localStorage)==null||n.setItem(Ah,e)}catch{}}function wN(){var e;try{return((e=globalThis.localStorage)==null?void 0:e.getItem(Ah))??null}catch{return null}}function O0(){var e;try{(e=globalThis.localStorage)==null||e.removeItem(Ah)}catch{}}const Rb=new Set(["app.phantom"]),SN=300;function kN(e){return e.filter(n=>!Rb.has(n.info.rdns))}function CN(e,n){if(!n)return null;const a=e.filter(r=>r.info.rdns===n);return a.length===1?a[0]:null}function T8(e){return e.address!=null&&e.expectedChainId!=null&&e.chainId!==e.expectedChainId}function EN(e){return(e.walletRpcUrls??[]).filter(n=>/^https?:\/\//i.test(n))}let uc=!1,dc=null,D0=!1;const N8=ur((e,n)=>{function a(o){o.on&&(o.on("accountsChanged",(...s)=>{const u=s[0],d=(u==null?void 0:u[0])??null;if(d===null){n().disconnect();return}e({address:d})}),o.on("chainChanged",(...s)=>{e({chainId:parseInt(s[0],16)})}),o.on("disconnect",()=>n().disconnect()))}async function r(o){const s=o.provider;try{const u=await s.request({method:"eth_accounts"});if(u.length===0){O0();return}const d=await s.request({method:"eth_chainId"});a(s),e({provider:s,providerInfo:o.info,address:u[0],chainId:parseInt(d,16)})}catch(u){console.warn("[wallet] silent reconnect failed",u)}}return{discovered:[],unsupported:[],provider:null,providerInfo:null,address:null,chainId:null,expectedChainId:null,bootstrap:null,setBootstrap(o){e({bootstrap:o,expectedChainId:Pp(o.chainId)})},initWallet(){if(typeof window>"u"||(yN(),D0))return;D0=!0;const o=wN();vN(s=>{e({discovered:kN(s),unsupported:s.filter(u=>Rb.has(u.info.rdns))}),!(!o||uc)&&(dc&&clearTimeout(dc),dc=setTimeout(()=>{if(dc=null,uc)return;const u=CN(n().discovered,o);u&&(uc=!0,r(u))},SN))})},async connect(o){const s=o.provider,u=await s.request({method:"eth_requestAccounts"}),d=await s.request({method:"eth_chainId"});a(s),e({provider:s,providerInfo:o.info,address:u[0]??null,chainId:parseInt(d,16)}),bN(o.info.rdns),uc=!1},disconnect(){e({provider:null,providerInfo:null,address:null,chainId:null}),O0()},async switchToExpectedChain(){const{provider:o,bootstrap:s}=n();if(!o)throw new Error("Wallet not connected.");if(!s)throw new Error("Chain not bootstrapped.");const u=xN(s.chainId);try{await o.request({method:"wallet_switchEthereumChain",params:[{chainId:u}]})}catch(d){if((d==null?void 0:d.code)===4902){const p=Tb(s.chainId),f=EN(s);if(f.length===0)throw new Error("Wallet does not know this chain and the node did not provide wallet-public RPC URLs. Add the network in your wallet, then try again.");await o.request({method:"wallet_addEthereumChain",params:[{chainId:u,chainName:`chain-${Pp(s.chainId)}`,nativeCurrency:{name:p,symbol:p,decimals:18},rpcUrls:f}]})}else throw d}}}});function jh(e,n){return e&&e.trim()?e:n.length>20?`${n.slice(0,16)}…`:n}function M0(e){return e.length>12?`${e.slice(0,6)}…${e.slice(-4)}`:e}function AN({item:e,onApprove:n,onDeny:a,onOpen:r}){var y;const[o,s]=S.useState({kind:"idle"}),u=jh(e.contextGraphName,e.cgId),d=((y=e.agentName)==null?void 0:y.trim())||M0(e.agentAddress),p=async g=>{s({kind:"working",action:g});const b=await(g==="approve"?n:a)(e.cgId,e.agentAddress);if(b.ok){const k=b.alreadyHandled?"Already handled":g==="approve"?`Approved — ${d} can now access ${u}`:`Request from ${d} declined`;s({kind:"done",label:k})}else{const k=b.roleError?`You're no longer the curator of ${u}`:g==="approve"?"Couldn’t approve":"Couldn’t deny";s({kind:"error",action:g,message:k})}};if(o.kind==="done")return m.jsxs("div",{className:"v10-notif-row v10-notif-row-terminal",role:"status","aria-live":"polite",children:[m.jsx("span",{className:"v10-notif-glyph","aria-hidden":"true",children:"✓"}),m.jsx("span",{className:"v10-notif-terminal-text",children:o.label})]});const f=o.kind==="working";return m.jsxs("div",{className:"v10-notif-row v10-notif-row-join",children:[m.jsx("span",{className:"v10-notif-glyph v10-notif-glyph-join","aria-hidden":"true",children:"🔑"}),m.jsxs("div",{className:"v10-notif-row-body",children:[m.jsx("div",{className:"v10-notif-row-title",children:"Join request"}),m.jsxs("div",{className:"v10-notif-row-detail",children:[m.jsx("span",{className:"v10-notif-actor",children:d})," wants to join"," ",m.jsx("button",{type:"button",className:"v10-notif-cg-link",onClick:()=>r(e.cgId),title:`Open ${u}`,children:u})]}),m.jsxs("div",{className:"v10-notif-row-sub",children:[m.jsx("span",{className:"v10-notif-addr",title:e.agentAddress,children:M0(e.agentAddress)}),m.jsx("span",{className:"v10-notif-dot",children:"·"}),m.jsx("span",{className:"v10-notif-time",title:new Date(e.ts).toLocaleString(),children:Mo(e.ts)})]}),o.kind==="error"&&m.jsxs("div",{className:"v10-notif-row-error",role:"status","aria-live":"polite",children:[o.message," ",m.jsx("button",{type:"button",className:"v10-notif-retry",onClick:()=>p(o.action),children:"Retry"})]}),m.jsx("span",{className:"v10-sr-only",role:"status","aria-live":"polite",children:f?o.action==="approve"?"Approving…":"Denying…":""})]}),m.jsx("div",{className:"v10-notif-row-actions",children:o.kind==="confirming-deny"?m.jsxs("span",{className:"v10-notif-deny-confirm",role:"group","aria-label":"Confirm deny",onKeyDown:g=>{g.key==="Escape"&&(g.stopPropagation(),s({kind:"idle"}))},onBlur:g=>{g.currentTarget.contains(g.relatedTarget)||s({kind:"idle"})},children:[m.jsx("span",{className:"v10-notif-deny-confirm-label",children:"Deny?"}),m.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-deny",onClick:()=>p("deny"),"aria-label":`Confirm deny join request from ${d} for ${u}`,children:"Yes"}),m.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-ghost",onClick:()=>s({kind:"idle"}),autoFocus:!0,children:"Cancel"})]}):m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-approve",onClick:()=>p("approve"),disabled:f,"aria-label":`Approve join request from ${d} for ${u}`,children:f&&o.action==="approve"?"…":"Approve"}),m.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-ghost",onClick:()=>s({kind:"confirming-deny"}),disabled:f,"aria-label":`Deny join request from ${d} for ${u}`,children:f&&o.action==="deny"?"…":"Deny"})]})})]})}const jN={created:"+",promoted:"⇡",published:"◉"};function TN(e,n,a){const r=n,o=r===1?"assertion":"assertions";return e==="created"?a?`${a} added ${r} ${o}`:`${r} new ${o} added`:e==="promoted"?a?`${a} promoted ${r} ${o}`:`${r} ${o} promoted`:a?`${a} published ${r} ${o} to Verifiable Memory`:`${r} ${o} published to Verifiable Memory`}function NN({item:e,onOpen:n}){var d;const a=jh(e.contextGraphName,e.cgId),r=e.bySelf?"You":((d=e.actorAgentName)==null?void 0:d.trim())||void 0,o=TN(e.event,e.count,r),s=Mo(e.ts),u=`${o} in ${a}${s?`, ${s}`:""}. Open ${a} recent activity.`;return m.jsxs("button",{type:"button",className:`v10-notif-row v10-notif-row-activity v10-notif-activity-${e.event}${e.bySelf?" v10-notif-by-self":""}${e.read?"":" v10-notif-unread"}`,onClick:()=>n(e.cgId),title:`Open ${a} · recent activity`,"aria-label":u,children:[m.jsx("span",{className:`v10-notif-glyph v10-notif-glyph-${e.event}`,"aria-hidden":"true",children:jN[e.event]}),m.jsx("span",{className:"v10-notif-row-body","aria-hidden":"true",children:m.jsxs("span",{className:"v10-notif-row-detail",children:[o," in ",m.jsx("span",{className:"v10-notif-cg-name",children:a})]})}),m.jsx("span",{className:"v10-notif-time","aria-hidden":"true",title:new Date(e.ts).toLocaleString(),children:s})]})}function RN({item:e,onOpen:n}){const a=jh(e.contextGraphName,e.cgId),r=e.kind==="join_approved",o=m.jsxs(m.Fragment,{children:[m.jsx("span",{className:`v10-notif-glyph ${r?"v10-notif-glyph-approved":"v10-notif-glyph-rejected"}`,"aria-hidden":"true",children:r?"✓":"✕"}),m.jsxs("span",{className:"v10-notif-row-body",children:[m.jsx("span",{className:"v10-notif-row-title",children:r?"Request approved":"Request declined"}),m.jsx("span",{className:"v10-notif-row-detail",children:r?m.jsxs(m.Fragment,{children:["You can now access ",m.jsx("span",{className:"v10-notif-cg-name",children:a})]}):m.jsxs(m.Fragment,{children:["Your request to join ",m.jsx("span",{className:"v10-notif-cg-name",children:a})," wasn’t approved"]})})]}),m.jsx("span",{className:"v10-notif-time",title:new Date(e.ts).toLocaleString(),children:Mo(e.ts)})]});if(r){const s=Mo(e.ts);return m.jsx("button",{type:"button",className:`v10-notif-row v10-notif-row-confirm v10-notif-confirm-approved${e.read?"":" v10-notif-unread"}`,onClick:()=>n(e.cgId),title:`Open ${a}`,"aria-label":`Request approved: you can now access ${a}${s?`, ${s}`:""}. Open ${a}.`,children:o})}return m.jsx("div",{className:`v10-notif-row v10-notif-row-confirm v10-notif-confirm-rejected${e.read?"":" v10-notif-unread"}`,"aria-disabled":"true",children:o})}function _N({item:e}){var f;const n=Nb(e.covered),a=n!=null?(n/100).toFixed(n%100===0?0:1):null;let r=null;try{const y=BigInt(e.covered.baseCost),g=BigInt(e.covered.discountedCost);y>0n&&g>=0n&&g<y&&(r=pN((y-g).toString()))}catch{r=null}const o=`PCA #${e.covered.accountId}`,s=(f=e.contextGraphName)!=null&&f.trim()?` in ${e.contextGraphName.trim()}`:"",u=a!=null?"Publishing discount applied":"Publishing fee covered",d=a!=null?`−${a}% via ${o}${r?` · saved ${r} TRAC`:""}${s}`:`via ${o}${s}`,p=Mo(e.ts);return m.jsxs("div",{className:`v10-notif-row v10-notif-row-confirm v10-notif-pca-discount${e.read?"":" v10-notif-unread"}`,role:"status","aria-label":`${u}, ${d}${p?`, ${p}`:""}.`,children:[m.jsx("span",{className:"v10-notif-glyph v10-notif-glyph-approved","aria-hidden":"true",children:"◉"}),m.jsxs("span",{className:"v10-notif-row-body","aria-hidden":"true",children:[m.jsx("span",{className:"v10-notif-row-title",children:u}),m.jsx("span",{className:"v10-notif-row-detail",children:d})]}),m.jsx("span",{className:"v10-notif-time","aria-hidden":"true",title:new Date(e.ts).toLocaleString(),children:p})]})}function ON({feed:e,onOpenContextGraph:n,pcaAlerts:a=[],onOpenPca:r,id:o,paneRef:s}){const{joinRequests:u,activity:d,status:p,refreshError:f,partialActivityError:y,hasInformationalUnread:g,approve:x,deny:b,markSeen:k,markAllInformationalSeen:C}=e,j=(U,_)=>{k([_]),n(U)},E=u.length>0,R=d.length>0,O=a.length>0,G=!E&&!R&&!O;return m.jsxs("div",{className:"v10-notif-pane",role:"region","aria-label":"Notifications",id:o,ref:s,tabIndex:-1,children:[m.jsxs("div",{className:"v10-notif-pane-titlebar",children:[m.jsx("div",{className:"v10-notif-pane-title",children:"Notifications"}),g&&m.jsx("button",{type:"button",className:"v10-notif-pane-markread",onClick:C,title:"Mark informational notifications as read",children:"Mark all read"})]}),m.jsxs("div",{className:"v10-notif-pane-body",children:[O&&m.jsxs("section",{className:"v10-notif-section v10-notif-section-pca","aria-label":"Publisher Conviction",children:[m.jsxs("div",{className:"v10-notif-section-head",children:[m.jsx("span",{className:"v10-notif-section-label",children:"Publisher Conviction"}),m.jsx("span",{className:"v10-notif-section-count",children:a.length})]}),m.jsx("div",{className:"v10-notif-section-rows",children:a.map(U=>m.jsxs("div",{className:"v10-pca-alert-row","data-severity":U.severity,"data-testid":"pca-bell-alert",role:U.severity==="danger"?"alert":"status",children:[m.jsx("div",{className:"v10-pca-alert-title",children:U.title}),m.jsx("div",{className:"v10-pca-alert-msg",children:U.message}),r&&m.jsxs("button",{type:"button",className:"v10-pca-alert-action",onClick:()=>r(U.accountId),children:["Manage PCA #",U.accountId]})]},U.id))})]}),p==="identity-pending"?m.jsx("div",{className:"v10-notif-pane-state",role:"status",children:"Verifying access…"}):p==="loading"&&G?m.jsx("div",{className:"v10-notif-pane-state",role:"status",children:"Loading notifications…"}):p==="error"&&G?m.jsxs("div",{className:"v10-notif-pane-error",role:"status","aria-live":"polite",children:["Couldn’t load notifications."," ",m.jsx("button",{type:"button",className:"v10-notif-retry",onClick:e.retry,children:"Retry"})]}):G?m.jsxs("div",{className:"v10-notif-pane-empty",role:"status",children:[m.jsx("div",{className:"v10-notif-pane-empty-lead",children:"You’re all caught up."}),m.jsx("div",{className:"v10-notif-pane-empty-sub",children:"Join requests, approvals, and new activity in your context graphs will show up here."})]}):m.jsxs(m.Fragment,{children:[f&&m.jsxs("div",{className:"v10-notif-pane-error v10-notif-pane-error-inline",role:"status","aria-live":"polite",children:["Couldn’t refresh notifications."," ",m.jsx("button",{type:"button",className:"v10-notif-retry",onClick:e.retry,children:"Retry"})]}),E&&m.jsxs("section",{className:"v10-notif-section v10-notif-section-action","aria-label":"Needs your action",children:[m.jsxs("div",{className:"v10-notif-section-head",children:[m.jsx("span",{className:"v10-notif-section-label",children:"Needs your action"}),m.jsx("span",{className:"v10-notif-section-count",children:u.length})]}),m.jsx("div",{className:"v10-notif-section-rows",children:u.map(U=>m.jsx(AN,{item:U,onApprove:x,onDeny:b,onOpen:n},U.id))})]}),m.jsxs("section",{className:"v10-notif-section v10-notif-section-activity","aria-label":"Activity",children:[m.jsx("div",{className:"v10-notif-section-head",children:m.jsx("span",{className:"v10-notif-section-label",children:"Activity"})}),y&&m.jsx("div",{className:"v10-notif-pane-error v10-notif-pane-error-inline",role:"status","aria-live":"polite",children:"Recent activity couldn’t load."}),R?m.jsx("div",{className:"v10-notif-section-rows",children:d.map(U=>U.kind==="digest"?m.jsx(NN,{item:U,onOpen:_=>j(_,U.id)},U.id):U.kind==="pca_cost_covered"?m.jsx(_N,{item:U},U.id):m.jsx(RN,{item:U,onOpen:_=>j(_,U.id)},U.id))}):!y&&m.jsx("div",{className:"v10-notif-section-empty",children:"No recent activity."})]})]})]})]})}const DN=m.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),m.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),L0="v10-notifications-pane";function MN(){const e=rT(),n=wT(),[a,r]=S.useState(!1),o=S.useRef(null),s=S.useRef(null),u=ca(b=>b.setActiveProject),{openTab:d}=mn(),p=S.useRef(null),f=S.useCallback((b=!1)=>{var k;r(!1),b&&((k=s.current)==null||k.focus())},[]);S.useEffect(()=>{if(!a)return;const b=k=>{o.current&&!o.current.contains(k.target)&&f()};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a,f]),S.useEffect(()=>{if(!a)return;const b=p.current;if(!b)return;const k=b.querySelector(".v10-notif-section-action .v10-notif-btn-approve"),C=b.querySelector(".v10-notif-section-rows button, .v10-notif-section-rows a[href]"),j=b.querySelector('button:not(.v10-notif-pane-markread), [href], [tabindex]:not([tabindex="-1"])');(k??C??j??b).focus()},[a]);const y=S.useCallback(b=>{u(b),d({id:`project:${b}`,label:b.slice(0,16),closable:!0}),f()},[u,d,f]),g=S.useCallback(b=>{d({id:`conviction:${b}`,label:`PCA #${b}`,closable:!0}),f()},[d,f]),x=e.unread+n.length;return m.jsxs("div",{className:"v10-header-notif-wrap",ref:o,onKeyDown:a?b=>{b.key==="Escape"&&(b.stopPropagation(),f(!0))}:void 0,children:[m.jsxs("button",{ref:s,className:"v10-header-icon-btn",onClick:()=>r(b=>!b),title:x>0?`Notifications (${x} unread)`:"Notifications","aria-label":x>0?`Notifications, ${x} unread`:"Notifications","aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?L0:void 0,children:[DN,x>0&&m.jsx("span",{className:"v10-header-notif-badge",children:x})]}),a&&m.jsx(ON,{id:L0,paneRef:p,feed:e,onOpenContextGraph:y,pcaAlerts:n,onOpenPca:g})]})}function LN(e,n,a,r,o){const s=[e?"Synced with the network":"Syncing with the network",`${n} peer${n===1?"":"s"} (${a} direct, ${r} relayed)`];return o>0&&s.push(`Uptime ${zN(o)}`),s.join(`
226
- `)}function zN(e){const n=Math.max(0,Math.floor(e/1e3)),a=Math.floor(n/86400),r=Math.floor(n%86400/3600),o=Math.floor(n%3600/60),s=[];return a>0&&s.push(`${a}d`),(r>0||a>0)&&s.push(`${r}h`),s.push(`${o}m`),s.join(" ")}const IN=m.jsx("span",{className:"v10-header-ot-wordmark",children:m.jsxs("svg",{width:"60",height:"13",viewBox:"0 0 180 40",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[m.jsx("path",{d:"M55.0428 28.0111C59.7903 28.0111 62.6388 24.531 62.6388 20.3908C62.6388 16.2806 59.7903 12.8005 55.0428 12.8005C50.325 12.8005 47.4766 16.2806 47.4766 20.3908C47.4766 24.531 50.325 28.0111 55.0428 28.0111ZM55.0428 24.621C52.6988 24.621 51.3932 22.6709 51.3932 20.3908C51.3932 18.1407 52.6988 16.1906 55.0428 16.1906C57.3869 16.1906 58.7221 18.1407 58.7221 20.3908C58.7221 22.6709 57.3869 24.621 55.0428 24.621Z",fill:"currentColor"}),m.jsx("path",{d:"M65.4344 27.6511H69.2027V18.0807C69.8258 17.1507 71.4874 16.4606 72.7336 16.4606C73.149 16.4606 73.5051 16.4906 73.7721 16.5507V12.8305C71.9918 12.8305 70.2115 13.8505 69.2027 15.1406V13.1605H65.4344V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M77.9959 11.0304C79.2421 11.0304 80.251 10.0104 80.251 8.75031C80.251 7.49026 79.2421 6.47021 77.9959 6.47021C76.7794 6.47021 75.7409 7.49026 75.7409 8.75031C75.7409 10.0104 76.7794 11.0304 77.9959 11.0304ZM76.1266 27.6511H79.8949V13.1605H76.1266V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M83.3347 31.3713C85.115 32.9614 87.0437 33.5314 89.5064 33.5314C93.0373 33.5314 97.2507 32.1813 97.2507 26.6611V13.1605H93.4527V15.0206C92.2955 13.5505 90.7526 12.8005 89.0317 12.8005C85.4117 12.8005 82.7116 15.4406 82.7116 20.1808C82.7116 25.011 85.4414 27.5611 89.0317 27.5611C90.7823 27.5611 92.3252 26.7211 93.4527 25.281V26.7511C93.4527 29.6012 91.3164 30.4113 89.5064 30.4113C87.6964 30.4113 86.1832 29.9012 85.026 28.6112L83.3347 31.3713ZM93.4527 22.5209C92.8296 23.4509 91.4647 24.171 90.2185 24.171C88.0822 24.171 86.5986 22.6709 86.5986 20.1808C86.5986 17.6907 88.0822 16.1906 90.2185 16.1906C91.4647 16.1906 92.8296 16.8807 93.4527 17.8407V22.5209Z",fill:"currentColor"}),m.jsx("path",{d:"M102.857 11.0304C104.104 11.0304 105.113 10.0104 105.113 8.75031C105.113 7.49026 104.104 6.47021 102.857 6.47021C101.641 6.47021 100.602 7.49026 100.602 8.75031C100.602 10.0104 101.641 11.0304 102.857 11.0304ZM100.988 27.6511H104.756V13.1605H100.988V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M118.166 27.6511H121.934V17.4207C121.934 14.6006 120.421 12.8005 117.276 12.8005C114.932 12.8005 113.181 13.9405 112.261 15.0506V13.1605H108.493V27.6511H112.261V17.9007C112.884 17.0307 114.042 16.1906 115.525 16.1906C117.127 16.1906 118.166 16.8807 118.166 18.8908V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M130.483 28.0111C132.055 28.0111 133.064 27.5911 133.628 27.0811L132.827 24.201C132.619 24.411 132.085 24.621 131.521 24.621C130.69 24.621 130.216 23.931 130.216 23.0309V16.4906H133.123V13.1605H130.216V9.20033H126.418V13.1605H124.044V16.4906H126.418V24.051C126.418 26.6311 127.842 28.0111 130.483 28.0111Z",fill:"currentColor"}),m.jsx("path",{d:"M135.702 27.6511H139.47V18.0807C140.093 17.1507 141.755 16.4606 143.001 16.4606C143.416 16.4606 143.772 16.4906 144.039 16.5507V12.8305C142.259 12.8305 140.479 13.8505 139.47 15.1406V13.1605H135.702V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M156.245 27.6511H160.043V13.1605H156.245V15.0206C155.117 13.5505 153.515 12.8005 151.824 12.8005C148.174 12.8005 145.474 15.6806 145.474 20.4208C145.474 25.251 148.204 28.0111 151.824 28.0111C153.545 28.0111 155.117 27.2311 156.245 25.8211V27.6511ZM156.245 22.9709C155.592 23.931 154.257 24.621 152.981 24.621C150.845 24.621 149.361 22.9109 149.361 20.4208C149.361 17.9007 150.845 16.2206 152.981 16.2206C154.257 16.2206 155.592 16.9107 156.245 17.8707V22.9709Z",fill:"currentColor"}),m.jsx("path",{d:"M165.649 11.0304C166.895 11.0304 167.904 10.0104 167.904 8.75031C167.904 7.49026 166.895 6.47021 165.649 6.47021C164.432 6.47021 163.394 7.49026 163.394 8.75031C163.394 10.0104 164.432 11.0304 165.649 11.0304ZM163.78 27.6511H167.548V13.1605H163.78V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M175.32 28.0111C176.863 28.0111 177.871 27.5911 178.435 27.0811L177.634 24.201C177.456 24.411 176.922 24.621 176.358 24.621C175.527 24.621 175.053 23.931 175.053 23.0309V7.64026H171.284V24.051C171.284 26.6311 172.679 28.0111 175.32 28.0111Z",fill:"currentColor"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.781 9.94781C14.2903 9.94781 9.8385 14.4484 9.8385 20.0008C9.8385 25.5525 14.2903 30.0531 19.781 30.0531C22.833 30.0531 25.5632 28.6622 27.3869 26.4736L34.9141 32.8796C31.2855 37.2341 25.8532 40.0016 19.781 40.0016C8.85592 40.0016 0 31.0467 0 20.0008C0 8.95432 8.85592 0 19.781 0V9.94781ZM36.8737 30.0724L28.3719 25.0628C28.662 24.5606 28.9105 24.0308 29.112 23.4781L38.3464 26.9194C37.9453 28.0192 37.4508 29.0732 36.8737 30.0724ZM29.7216 20.0007H39.5609C39.5609 18.8159 39.4583 17.6554 39.2628 16.5272L29.5719 18.2549C29.6701 18.822 29.7216 19.4053 29.7216 20.0007ZM34.988 7.20831L27.425 13.5712C27.0546 13.1215 26.646 12.7054 26.2045 12.3272L32.5596 4.73338C33.4381 5.4858 34.251 6.31374 34.988 7.20831Z",fill:"currentColor"})]})}),PN=m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("circle",{cx:"12",cy:"12",r:"5"}),m.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),m.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),m.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),m.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),m.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),m.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),m.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),m.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}),UN=m.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:m.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),BN=m.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),m.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]}),HN=m.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),m.jsx("line",{x1:"15",y1:"3",x2:"15",y2:"21"})]}),$N=m.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("circle",{cx:"12",cy:"12",r:"3"}),m.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),qN=m.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),FN=m.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.78 4.78 4 4 0 0 1-6.74 0 4 4 0 0 1-4.78-4.78 4 4 0 0 1 0-6.75z"}),m.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),m.jsx("circle",{cx:"9.5",cy:"9.5",r:".5"}),m.jsx("circle",{cx:"14.5",cy:"14.5",r:".5"})]});function GN(){var j,E;const{theme:e,setTheme:n,leftCollapsed:a,toggleLeft:r,rightCollapsed:o,toggleRight:s}=aa(),u=yh(R=>R.nodeStatus),d=Ch().data,{openTab:p}=mn(),f=(u==null?void 0:u.connectedPeers)??(u==null?void 0:u.peerCount)??0,y=((j=u==null?void 0:u.connections)==null?void 0:j.direct)??0,g=((E=u==null?void 0:u.connections)==null?void 0:E.relayed)??0,x=(u==null?void 0:u.uptimeMs)??0,k=u!=null&&(u==null?void 0:u.synced)!==!1,C=LN(k,f,y,g,x);return m.jsxs("header",{className:"v10-header",children:[m.jsxs("div",{className:"v10-header-logo",children:[m.jsxs("span",{className:"v10-header-logo-text",children:["DKG ",m.jsx("span",{className:"v10-header-logo-version",children:"v10"})]}),m.jsxs("div",{className:"v10-header-logo-ot","aria-label":"Powered by OriginTrail",children:[m.jsx("span",{className:"v10-header-logo-ot-by",children:"powered by"}),IN]})]}),m.jsx("button",{className:`v10-header-icon-btn ${a?"":"active-toggle"}`,onClick:r,title:"Toggle sidebar",children:BN}),m.jsx("div",{className:"v10-header-sep"}),m.jsxs("div",{className:"v10-header-agent-switcher",title:d?`${d.agentDid}
227
- ${d.agentAddress}`:void 0,children:[m.jsx("span",{className:"v10-header-agent-dot"}),m.jsx("span",{className:"v10-header-agent-name",children:(d!=null&&d.name&&d.name!=="**"?d.name:null)||(u==null?void 0:u.name)||"Agent"}),(d==null?void 0:d.agentAddress)&&m.jsxs("span",{className:"v10-header-agent-addr",children:[d.agentAddress.slice(0,6),"…",d.agentAddress.slice(-4)]})]}),m.jsx("div",{className:"v10-header-spacer"}),m.jsxs("div",{className:"v10-header-meta",title:C,children:[m.jsx("span",{className:`v10-header-status-dot ${k?"online":"offline"}`}),m.jsx("span",{children:k?"synced":"syncing"}),m.jsx("span",{className:"v10-header-meta-sep",children:"·"}),m.jsxs("span",{children:[f," peer",f!==1?"s":""]})]}),m.jsxs("div",{className:"v10-header-actions",children:[m.jsx(MN,{}),m.jsx("button",{className:"v10-header-icon-btn",onClick:()=>p({id:"operations",label:"Observability",closable:!0}),title:"Observability",children:qN}),m.jsx("button",{className:"v10-header-icon-btn","data-testid":"pca-launch-btn",onClick:()=>p({id:"conviction",label:"Publisher Conviction",closable:!0}),title:"Publisher Conviction - publishing discounts",children:FN}),m.jsx("button",{className:"v10-header-icon-btn",onClick:()=>p({id:"settings",label:"Settings",closable:!0}),title:"Settings",children:$N}),m.jsx("button",{className:"v10-header-icon-btn",onClick:()=>n(e==="dark"?"light":"dark"),title:e==="dark"?"Switch to light mode":"Switch to dark mode",children:e==="dark"?PN:UN}),m.jsx("button",{className:`v10-header-icon-btn ${o?"":"active-toggle"}`,onClick:s,title:"Toggle agent panel",children:HN})]})]})}function VN(){const e=localStorage.getItem("dkg-journey-stage");return e==="1"?1:e==="2"?2:0}const Th=ur((e,n)=>({stage:VN(),setStage:a=>{localStorage.setItem("dkg-journey-stage",String(a)),e({stage:a})},advance:()=>{const a=Math.min(n().stage+1,2);localStorage.setItem("dkg-journey-stage",String(a)),e({stage:a})}})),WN=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
228
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
229
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
230
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
231
- @prefix dcterms: <http://purl.org/dc/terms/> .
232
- @prefix schema: <http://schema.org/> .
233
- @prefix foaf: <http://xmlns.com/foaf/0.1/> .
234
- @prefix prov: <http://www.w3.org/ns/prov#> .
235
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
236
- @prefix bibo: <http://purl.org/ontology/bibo/> .
237
- @prefix fabio: <http://purl.org/spar/fabio/> .
238
- @prefix cito: <http://purl.org/spar/cito/> .
239
- @prefix frbr: <http://purl.org/vocab/frbr/core#> .
240
-
241
- @prefix chat: <http://dkg.io/ontology/chat/> .
242
- @prefix dkg: <http://dkg.io/ontology/> .
243
- @prefix : <http://dkg.io/ontology/book-research/> .
244
-
245
- <http://dkg.io/ontology/book-research/>
246
- a owl:Ontology ;
247
- dcterms:title "DKG Book Research Project Ontology (v1)" ;
248
- dcterms:description """Starter ontology for projects that research and
249
- write books, papers, or long-form non-fiction. Built on schema.org +
250
- BIBO + the SPAR family (FaBiO, CiTO) + FRBR + SKOS so it composes with
251
- existing scholarly publishing infrastructure.""" ;
252
- owl:versionInfo "1.0.0" ;
253
- dcterms:created "2026-04-18"^^xsd:date ;
254
- owl:imports
255
- <http://schema.org/> , <http://purl.org/dc/terms/> ,
256
- <http://www.w3.org/ns/prov#> , <http://xmlns.com/foaf/0.1/> ,
257
- <http://www.w3.org/2004/02/skos/core#> ,
258
- <http://purl.org/ontology/bibo/> ,
259
- <http://purl.org/spar/fabio/> ,
260
- <http://purl.org/spar/cito/> ,
261
- <http://purl.org/vocab/frbr/core#> .
262
-
263
- # ─── Universal annotation predicates (shared across all starters) ───
264
- chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
265
- chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
266
- chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range owl:Thing .
267
- chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range owl:Thing .
268
- chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Finding .
269
- chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
270
-
271
- # ─── Universal annotation entities ──────────────────────────────────
272
- :Concept rdfs:subClassOf skos:Concept .
273
- :Topic rdfs:subClassOf skos:Concept .
274
- :Question rdfs:subClassOf schema:Question .
275
- :Finding rdfs:subClassOf prov:Entity .
276
-
277
- # ─── Book-research specific ─────────────────────────────────────────
278
-
279
- :Hypothesis a owl:Class ;
280
- rdfs:label "Hypothesis" ;
281
- rdfs:comment "A claim under investigation. Supersedes when refuted; promotes to a Finding when supported." ;
282
- rdfs:subClassOf prov:Entity .
283
-
284
- :Argument a owl:Class ;
285
- rdfs:label "Argument" ;
286
- rdfs:comment "A reasoned position taken on a Hypothesis or other entity." ;
287
- rdfs:subClassOf prov:Entity .
288
-
289
- :Counterexample a owl:Class ;
290
- rdfs:label "Counterexample" ;
291
- rdfs:comment "Evidence that refutes a Hypothesis or Argument." ;
292
- rdfs:subClassOf prov:Entity .
293
-
294
- :Quote a owl:Class ;
295
- rdfs:label "Quote" ;
296
- rdfs:comment "Verbatim passage extracted from a source. Subclass of bibo:Quote so it composes with bibliographic tools." ;
297
- rdfs:subClassOf bibo:Quote .
298
-
299
- :supports a owl:ObjectProperty ;
300
- rdfs:label "supports" ;
301
- rdfs:comment "An Argument or Quote supports a Hypothesis." ;
302
- rdfs:subPropertyOf cito:agreesWith .
303
-
304
- :refutes a owl:ObjectProperty ;
305
- rdfs:label "refutes" ;
306
- rdfs:comment "An Argument, Counterexample, or Quote refutes a Hypothesis." ;
307
- rdfs:subPropertyOf cito:disagreesWith .
308
-
309
- :cites a owl:ObjectProperty ;
310
- rdfs:label "cites" ;
311
- rdfs:subPropertyOf cito:cites ;
312
- rdfs:range bibo:Document .
313
-
314
- # ─── URI patterns ───────────────────────────────────────────────────
315
- :UriPattern rdfs:label "URI minting pattern" .
316
-
317
- :concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
318
- :topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
319
- :question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
320
- :finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
321
- :hypothesis-pattern a :UriPattern ; skos:notation "urn:dkg:hypothesis:<slug>" .
322
- :argument-pattern a :UriPattern ; skos:notation "urn:dkg:argument:<slug>" .
323
- :quote-pattern a :UriPattern ; skos:notation "urn:dkg:quote:<slug>" .
324
- :citation-pattern a :UriPattern ; skos:notation "urn:dkg:citation:<slug>" ;
325
- skos:definition "Bibliographic citation; aligned with bibo:Document via cito:cites." .
326
-
327
- :slug-normalisation a skos:Note ;
328
- skos:definition "Lowercase → ASCII-fold → strip stopwords (the/a/an/of/for/and/or/to/in/on/with) → hyphenate → ≤60 chars. Apply BEFORE comparing free-text recall results (\`dkg_memory_search\`) to decide reuse-vs-mint." .
329
- `,YN=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
330
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
331
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
332
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
333
- @prefix dcterms: <http://purl.org/dc/terms/> .
334
- @prefix schema: <http://schema.org/> .
335
- @prefix foaf: <http://xmlns.com/foaf/0.1/> .
336
- @prefix prov: <http://www.w3.org/ns/prov#> .
337
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
338
- @prefix doap: <http://usefulinc.com/ns/doap#> .
339
-
340
- # DKG project namespaces — v1 ontology for any "coding project"
341
- # context graph. Imports widely-adopted Linked Data vocabs first;
342
- # only declares extensions for genuinely net-new concepts.
343
- @prefix chat: <http://dkg.io/ontology/chat/> .
344
- @prefix code: <http://dkg.io/ontology/code/> .
345
- @prefix github: <http://dkg.io/ontology/github/> .
346
- @prefix decisions: <http://dkg.io/ontology/decisions/> .
347
- @prefix tasks: <http://dkg.io/ontology/tasks/> .
348
- @prefix agent: <http://dkg.io/ontology/agent/> .
349
- @prefix dkg: <http://dkg.io/ontology/> .
350
-
351
- @prefix : <http://dkg.io/ontology/coding-project/> .
352
-
353
- # ─── Ontology header ────────────────────────────────────────────────
354
- <http://dkg.io/ontology/coding-project/>
355
- a owl:Ontology ;
356
- dcterms:title "DKG Coding Project Ontology (v1)" ;
357
- dcterms:description """The starter ontology for any DKG context graph that
358
- represents a software project — its decisions, tasks, code structure, GitHub
359
- activity, agents, and chat. Designed to be \`owl:imports\`-ed by per-project
360
- ontologies, which add their own extensions on top.
361
-
362
- Every predicate is either reused from a globally-adopted vocabulary
363
- (schema.org, DCTerms, PROV-O, FOAF, SKOS, DOAP) or declared here as a
364
- project-specific extension. Companion document \`agent-guide.md\` translates
365
- this formal model into operational instructions for AI coding agents.""" ;
366
- dcterms:creator "branarakic" ;
367
- owl:versionInfo "1.0.0" ;
368
- dcterms:created "2026-04-18"^^xsd:date ;
369
- owl:imports
370
- <http://schema.org/> ,
371
- <http://purl.org/dc/terms/> ,
372
- <http://www.w3.org/ns/prov#> ,
373
- <http://xmlns.com/foaf/0.1/> ,
374
- <http://www.w3.org/2004/02/skos/core#> ,
375
- <http://usefulinc.com/ns/doap#> .
376
-
377
- # ─── Section 1 — Universal annotation primitives ────────────────────
378
- # Predicates expressing what each chat turn was ABOUT — written into
379
- # the project's \`chat\` sub-graph by the capture-chat hook (and later
380
- # read by \`dkg_query\` / \`dkg_memory_search\`). These predicates apply
381
- # to ANY project type, not just coding.
382
-
383
- chat:topic
384
- a owl:DatatypeProperty ;
385
- rdfs:label "topic" ;
386
- rdfs:comment "Free-text topical bucket the chat turn lives under. Multiple per turn; emit liberally. Renderer can use these to cluster the activity feed." ;
387
- rdfs:domain chat:Turn ;
388
- rdfs:range xsd:string .
389
-
390
- chat:mentions
391
- a owl:ObjectProperty ;
392
- rdfs:label "mentions" ;
393
- rdfs:comment "An entity the chat turn referenced. The most common edge in the graph. To find existing entities to reuse before minting fresh URIs, use \`dkg_memory_search\` (free-text recall across WM/SWM/VM)." ;
394
- rdfs:domain chat:Turn ;
395
- rdfs:range owl:Thing ;
396
- rdfs:subPropertyOf schema:mentions .
397
-
398
- chat:examines
399
- a owl:ObjectProperty ;
400
- rdfs:label "examines" ;
401
- rdfs:comment "Entity the chat turn walked through in detail (vs just mentioning in passing). Implies the agent or operator is ANALYSING the entity, not merely citing it." ;
402
- rdfs:domain chat:Turn ;
403
- rdfs:range owl:Thing .
404
-
405
- chat:proposes
406
- a owl:ObjectProperty ;
407
- rdfs:label "proposes" ;
408
- rdfs:comment "An idea/decision/task the chat turn put forward. Often points at a freshly-minted Decision or Task entity created in the same write batch." ;
409
- rdfs:domain chat:Turn ;
410
- rdfs:range owl:Thing .
411
-
412
- chat:concludes
413
- a owl:ObjectProperty ;
414
- rdfs:label "concludes" ;
415
- rdfs:comment "A Finding entity the chat turn produced — a claim worth preserving as a first-class node, separate from the turn body." ;
416
- rdfs:domain chat:Turn ;
417
- rdfs:range :Finding .
418
-
419
- chat:asks
420
- a owl:ObjectProperty ;
421
- rdfs:label "asks" ;
422
- rdfs:comment "A Question entity the chat turn left open. Tracking these lets a future query surface 'what did we never resolve?'." ;
423
- rdfs:domain chat:Turn ;
424
- rdfs:range :Question .
425
-
426
- # ─── Section 2 — Universal annotation entity classes ────────────────
427
-
428
- :Concept
429
- a owl:Class ;
430
- rdfs:label "Concept" ;
431
- rdfs:comment "A free-text concept emerging from chat that doesn't fit into a more specific class. Aligned with skos:Concept so it composes with any knowledge organisation system." ;
432
- rdfs:subClassOf skos:Concept .
433
-
434
- :Topic
435
- a owl:Class ;
436
- rdfs:label "Topic" ;
437
- rdfs:comment "A broad topical bucket grouping related concepts/turns/entities. URI pattern: urn:dkg:topic:<slug>." ;
438
- rdfs:subClassOf skos:Concept .
439
-
440
- :Question
441
- a owl:Class ;
442
- rdfs:label "Question" ;
443
- rdfs:comment "An open question raised in chat that hasn't been answered yet. URI pattern: urn:dkg:question:<slug>. Resolved by linking a chat:Turn or :Finding via :answers." ;
444
- rdfs:subClassOf schema:Question .
445
-
446
- :Finding
447
- a owl:Class ;
448
- rdfs:label "Finding" ;
449
- rdfs:comment "A claim or observation worth preserving as a first-class entity, separate from the chat turn that produced it. URI pattern: urn:dkg:finding:<slug>. Findings can be cited by future Decisions, Tasks, and chat turns." ;
450
- rdfs:subClassOf prov:Entity .
451
-
452
- :answers
453
- a owl:ObjectProperty ;
454
- rdfs:label "answers" ;
455
- rdfs:comment "Links a Finding (or chat turn) to the Question it resolves." ;
456
- rdfs:domain owl:Thing ;
457
- rdfs:range :Question .
458
-
459
- :supersedes
460
- a owl:ObjectProperty ;
461
- rdfs:label "supersedes" ;
462
- rdfs:comment "This entity replaces an older one (e.g. a revised Finding supersedes an earlier one)." ;
463
- rdfs:range owl:Thing ;
464
- owl:inverseOf prov:wasRevisionOf .
465
-
466
- # ─── Section 3 — Coding-project-specific classes ────────────────────
467
- # Formalises the predicates already used informally in
468
- # scripts/lib/ontology.mjs, anchoring them in PROV-O and schema.org.
469
-
470
- decisions:Decision
471
- a owl:Class ;
472
- rdfs:label "Decision" ;
473
- rdfs:comment "An architectural decision the project made — context, outcome, consequences. Modelled as a prov:Activity because it represents a deliberate act of choosing." ;
474
- rdfs:subClassOf prov:Activity, schema:Action .
475
-
476
- decisions:context
477
- a owl:DatatypeProperty ;
478
- rdfs:label "context" ;
479
- rdfs:domain decisions:Decision ;
480
- rdfs:range xsd:string ;
481
- rdfs:comment "Why this decision was being made — problem, constraints, alternatives considered." .
482
-
483
- decisions:outcome
484
- a owl:DatatypeProperty ;
485
- rdfs:label "outcome" ;
486
- rdfs:domain decisions:Decision ;
487
- rdfs:range xsd:string ;
488
- rdfs:comment "The chosen direction — the decision itself, in one paragraph." .
489
-
490
- decisions:consequences
491
- a owl:DatatypeProperty ;
492
- rdfs:label "consequences" ;
493
- rdfs:domain decisions:Decision ;
494
- rdfs:range xsd:string ;
495
- rdfs:comment "What this implies going forward — trade-offs, follow-ups." .
496
-
497
- decisions:status
498
- a owl:DatatypeProperty ;
499
- rdfs:label "status" ;
500
- rdfs:domain decisions:Decision ;
501
- rdfs:range xsd:string ;
502
- rdfs:comment "One of: proposed | accepted | rejected | superseded." .
503
-
504
- tasks:Task
505
- a owl:Class ;
506
- rdfs:label "Task" ;
507
- rdfs:comment "A piece of planned or in-flight work on the project." ;
508
- rdfs:subClassOf schema:Action .
509
-
510
- tasks:status
511
- a owl:DatatypeProperty ;
512
- rdfs:label "status" ;
513
- rdfs:domain tasks:Task ;
514
- rdfs:range xsd:string ;
515
- rdfs:comment "One of: todo | in_progress | blocked | done | cancelled." .
516
-
517
- tasks:priority
518
- a owl:DatatypeProperty ;
519
- rdfs:label "priority" ;
520
- rdfs:domain tasks:Task ;
521
- rdfs:range xsd:string ;
522
- rdfs:comment "One of: p0 | p1 | p2 | p3." .
523
-
524
- tasks:relatedDecision
525
- a owl:ObjectProperty ;
526
- rdfs:label "related decision" ;
527
- rdfs:domain tasks:Task ;
528
- rdfs:range decisions:Decision ;
529
- rdfs:comment "The Decision this task implements or follows from." .
530
-
531
- tasks:dependsOn
532
- a owl:ObjectProperty ;
533
- rdfs:label "depends on" ;
534
- rdfs:domain tasks:Task ;
535
- rdfs:range tasks:Task .
536
-
537
- tasks:touches
538
- a owl:ObjectProperty ;
539
- rdfs:label "touches" ;
540
- rdfs:domain tasks:Task ;
541
- rdfs:range owl:Thing ;
542
- rdfs:comment "A code:File or code:Package this task edits." .
543
-
544
- # Code structure — aligned with schema:SoftwareSourceCode + DOAP.
545
-
546
- code:Package
547
- a owl:Class ;
548
- rdfs:label "Package" ;
549
- rdfs:subClassOf doap:Project, schema:SoftwareApplication .
550
-
551
- code:File
552
- a owl:Class ;
553
- rdfs:label "Source file" ;
554
- rdfs:subClassOf schema:SoftwareSourceCode .
555
-
556
- code:Function a owl:Class ; rdfs:label "Function" .
557
- code:Class a owl:Class ; rdfs:label "Class" .
558
- code:Interface a owl:Class ; rdfs:label "Interface" .
559
-
560
- # GitHub — minimal aliasing onto schema.org where sensible.
561
-
562
- github:Repository
563
- a owl:Class ;
564
- rdfs:label "GitHub repository" ;
565
- rdfs:subClassOf schema:SoftwareSourceCode, doap:Project .
566
-
567
- github:PullRequest
568
- a owl:Class ;
569
- rdfs:label "Pull request" ;
570
- rdfs:subClassOf schema:CreativeWork .
571
-
572
- github:Issue
573
- a owl:Class ;
574
- rdfs:label "GitHub issue" ;
575
- rdfs:subClassOf schema:Question, schema:CreativeWork .
576
-
577
- # ─── Section 4 — Chat sub-graph classes ─────────────────────────────
578
-
579
- chat:Session
580
- a owl:Class ;
581
- rdfs:label "Chat session" ;
582
- rdfs:comment "One conversation between an operator and their coding assistant (Cursor window, Claude Code thread, etc.)." ;
583
- rdfs:subClassOf schema:Conversation .
584
-
585
- chat:Turn
586
- a owl:Class ;
587
- rdfs:label "Chat turn" ;
588
- rdfs:comment "One user-prompt + assistant-response pair within a Session. Carries provenance via prov:wasAttributedTo." ;
589
- rdfs:subClassOf schema:Message, prov:Entity .
590
-
591
- chat:userPrompt a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
592
- chat:assistantResponse a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
593
- chat:turnIndex a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:integer .
594
- chat:inSession a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range chat:Session .
595
- chat:speakerTool a owl:DatatypeProperty ; rdfs:range xsd:string ;
596
- rdfs:comment "Identifier of the coding assistant that produced the turn (e.g. 'cursor', 'claude-code')." .
597
- chat:privacy a owl:DatatypeProperty ; rdfs:domain chat:Session ; rdfs:range xsd:string ;
598
- rdfs:comment "One of: private | team | public. Controls auto-promote behaviour of the capture hook." .
599
-
600
- # ─── Section 5 — Agent identity ─────────────────────────────────────
601
-
602
- agent:Agent
603
- a owl:Class ;
604
- rdfs:label "Agent" ;
605
- rdfs:subClassOf prov:Agent, foaf:Agent .
606
-
607
- agent:HumanAgent rdfs:subClassOf agent:Agent, foaf:Person .
608
- agent:AIAgent rdfs:subClassOf agent:Agent, schema:SoftwareApplication .
609
-
610
- agent:framework
611
- a owl:DatatypeProperty ;
612
- rdfs:label "framework" ;
613
- rdfs:domain agent:AIAgent ;
614
- rdfs:range xsd:string ;
615
- rdfs:comment "Name of the agent runtime — 'cursor', 'claude-code', 'openclaw', 'hermes', etc." .
616
-
617
- agent:operator
618
- a owl:ObjectProperty ;
619
- rdfs:label "operator" ;
620
- rdfs:domain agent:AIAgent ;
621
- rdfs:range agent:HumanAgent ;
622
- rdfs:comment "The human operator who runs and is responsible for this AI agent." .
623
-
624
- # ─── Section 6 — URI minting conventions (machine-readable) ─────────
625
- # These are encoded as SKOS notes so an agent reading the ontology can
626
- # pull them out programmatically. The agent guide repeats them in
627
- # prose for human readability.
628
-
629
- :UriPattern
630
- a owl:Class ;
631
- rdfs:label "URI minting pattern" ;
632
- rdfs:comment "Documents the URI shape the agent should produce when minting a new entity of a given type." .
633
-
634
- :concept-pattern a :UriPattern ;
635
- skos:notation "urn:dkg:concept:<slug>" ;
636
- skos:definition "Free-text concept; aligned with skos:Concept." .
637
- :topic-pattern a :UriPattern ;
638
- skos:notation "urn:dkg:topic:<slug>" ;
639
- skos:definition "Broad topical bucket grouping related entities." .
640
- :question-pattern a :UriPattern ;
641
- skos:notation "urn:dkg:question:<slug>" ;
642
- skos:definition "An open question awaiting an answer." .
643
- :finding-pattern a :UriPattern ;
644
- skos:notation "urn:dkg:finding:<slug>" ;
645
- skos:definition "A claim or observation worth preserving as a first-class node." .
646
- :decision-pattern a :UriPattern ;
647
- skos:notation "urn:dkg:decision:<slug>" ;
648
- skos:definition "An architectural decision (coding-project specific)." .
649
- :task-pattern a :UriPattern ;
650
- skos:notation "urn:dkg:task:<slug>" ;
651
- skos:definition "A piece of planned or in-flight work (coding-project specific)." .
652
-
653
- # ─── Section 7 — Slug normalisation rule (deterministic) ────────────
654
-
655
- :slug-normalisation a skos:Note ;
656
- skos:prefLabel "slug normalisation" ;
657
- skos:definition """To compute the canonical slug from a free-text label:
658
- 1. Lowercase.
659
- 2. Apply Unicode NFKD then strip combining marks (ASCII fold).
660
- 3. Strip common stopwords (the / a / an / of / for / and / or / to / in / on / with).
661
- 4. Replace any run of non-[a-z0-9] with a single hyphen.
662
- 5. Trim leading/trailing hyphens.
663
- 6. Truncate to 60 characters max.
664
-
665
- Example: "the Tree-Sitter library", "Tree sitter", "TREE_SITTER" all
666
- normalise to "tree-sitter". Always apply this BEFORE comparing free-text
667
- recall results (\`dkg_memory_search\`) in the look-before-mint protocol.""" .
668
- `,KN=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
669
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
670
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
671
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
672
- @prefix dcterms: <http://purl.org/dc/terms/> .
673
- @prefix schema: <http://schema.org/> .
674
- @prefix foaf: <http://xmlns.com/foaf/0.1/> .
675
- @prefix prov: <http://www.w3.org/ns/prov#> .
676
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
677
- @prefix bibo: <http://purl.org/ontology/bibo/> .
678
-
679
- @prefix chat: <http://dkg.io/ontology/chat/> .
680
- @prefix : <http://dkg.io/ontology/narrative-writing/> .
681
-
682
- <http://dkg.io/ontology/narrative-writing/>
683
- a owl:Ontology ;
684
- dcterms:title "DKG Narrative Writing Project Ontology (v1)" ;
685
- dcterms:description """Starter for fiction or narrative non-fiction
686
- projects: novels, screenplays, biographies. Tracks Characters, Scenes,
687
- Plot Points, Themes, and the relationships between them.""" ;
688
- owl:versionInfo "1.0.0" ;
689
- dcterms:created "2026-04-18"^^xsd:date ;
690
- owl:imports
691
- <http://schema.org/> , <http://purl.org/dc/terms/> ,
692
- <http://xmlns.com/foaf/0.1/> ,
693
- <http://www.w3.org/2004/02/skos/core#> ,
694
- <http://purl.org/ontology/bibo/> .
695
-
696
- # ─── Universal annotation predicates ────────────────────────────────
697
- chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
698
- chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
699
- chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
700
- chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
701
- chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Finding .
702
- chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
703
-
704
- # ─── Universal annotation entities ──────────────────────────────────
705
- :Concept rdfs:subClassOf skos:Concept .
706
- :Topic rdfs:subClassOf skos:Concept .
707
- :Question rdfs:subClassOf schema:Question .
708
- :Finding rdfs:subClassOf prov:Entity .
709
-
710
- # ─── Narrative-writing-specific ─────────────────────────────────────
711
-
712
- :Character a owl:Class ;
713
- rdfs:label "Character" ;
714
- rdfs:comment "A character in the narrative — fictional or historical." ;
715
- rdfs:subClassOf foaf:Person, schema:Person .
716
-
717
- :Scene a owl:Class ;
718
- rdfs:label "Scene" ;
719
- rdfs:comment "A discrete unit of narrative action — a single place/time/event in the story." ;
720
- rdfs:subClassOf schema:Event .
721
-
722
- :PlotPoint a owl:Class ;
723
- rdfs:label "Plot point" ;
724
- rdfs:comment "A structural moment in the narrative arc (inciting incident, climax, resolution, etc.)." .
725
-
726
- :Theme a owl:Class ;
727
- rdfs:label "Theme" ;
728
- rdfs:comment "A unifying idea explored across the narrative." ;
729
- rdfs:subClassOf skos:Concept .
730
-
731
- :Setting a owl:Class ;
732
- rdfs:label "Setting" ;
733
- rdfs:comment "A place + time context within which Scenes occur." .
734
-
735
- :appearsIn a owl:ObjectProperty ;
736
- rdfs:label "appears in" ;
737
- rdfs:domain :Character ;
738
- rdfs:range :Scene .
739
-
740
- :setIn a owl:ObjectProperty ;
741
- rdfs:label "set in" ;
742
- rdfs:domain :Scene ;
743
- rdfs:range :Setting .
744
-
745
- :develops a owl:ObjectProperty ;
746
- rdfs:label "develops" ;
747
- rdfs:comment "A Scene or PlotPoint develops a Theme or a Character arc." ;
748
- rdfs:range owl:Thing .
749
-
750
- :precedes a owl:ObjectProperty ;
751
- rdfs:label "precedes" ;
752
- rdfs:domain :Scene ;
753
- rdfs:range :Scene .
754
-
755
- # ─── URI patterns ───────────────────────────────────────────────────
756
- :UriPattern rdfs:label "URI minting pattern" .
757
-
758
- :concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
759
- :topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
760
- :question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
761
- :character-pattern a :UriPattern ; skos:notation "urn:dkg:character:<slug>" .
762
- :scene-pattern a :UriPattern ; skos:notation "urn:dkg:scene:<slug>" .
763
- :plotpoint-pattern a :UriPattern ; skos:notation "urn:dkg:plotpoint:<slug>" .
764
- :theme-pattern a :UriPattern ; skos:notation "urn:dkg:theme:<slug>" .
765
- :setting-pattern a :UriPattern ; skos:notation "urn:dkg:setting:<slug>" .
766
-
767
- :slug-normalisation a skos:Note ;
768
- skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
769
- `,QN=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
770
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
771
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
772
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
773
- @prefix dcterms: <http://purl.org/dc/terms/> .
774
- @prefix schema: <http://schema.org/> .
775
- @prefix foaf: <http://xmlns.com/foaf/0.1/> .
776
- @prefix prov: <http://www.w3.org/ns/prov#> .
777
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
778
- @prefix time: <http://www.w3.org/2006/time#> .
779
-
780
- @prefix chat: <http://dkg.io/ontology/chat/> .
781
- @prefix : <http://dkg.io/ontology/pkm/> .
782
-
783
- <http://dkg.io/ontology/pkm/>
784
- a owl:Ontology ;
785
- dcterms:title "DKG Personal Knowledge Management Ontology (v1)" ;
786
- dcterms:description """Starter for personal/team knowledge gardens.
787
- Notes, highlights, questions, insights — the daily-driver vocabulary
788
- of an Obsidian/Roam-style PKM workflow, but graph-native and shareable
789
- with teammates' agents.""" ;
790
- owl:versionInfo "1.0.0" ;
791
- dcterms:created "2026-04-18"^^xsd:date ;
792
- owl:imports
793
- <http://schema.org/> , <http://purl.org/dc/terms/> ,
794
- <http://xmlns.com/foaf/0.1/> ,
795
- <http://www.w3.org/2004/02/skos/core#> ,
796
- <http://www.w3.org/2006/time#> .
797
-
798
- # ─── Universal annotation predicates ────────────────────────────────
799
- chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
800
- chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
801
- chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
802
- chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
803
- chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Insight .
804
- chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
805
-
806
- # ─── Universal annotation entities ──────────────────────────────────
807
- :Concept rdfs:subClassOf skos:Concept .
808
- :Topic rdfs:subClassOf skos:Concept .
809
- :Question rdfs:subClassOf schema:Question .
810
- :Finding rdfs:subClassOf prov:Entity .
811
-
812
- # ─── PKM-specific ────────────────────────────────────────────────────
813
-
814
- :Note a owl:Class ;
815
- rdfs:label "Note" ;
816
- rdfs:comment "An atomic note — a single self-contained thought worth capturing. The fundamental unit of a PKM graph." ;
817
- rdfs:subClassOf schema:CreativeWork .
818
-
819
- :Highlight a owl:Class ;
820
- rdfs:label "Highlight" ;
821
- rdfs:comment "A passage of text marked as significant from a source (article, book, transcript). Carries provenance back to the source." ;
822
- rdfs:subClassOf schema:Quotation .
823
-
824
- :Insight a owl:Class ;
825
- rdfs:label "Insight" ;
826
- rdfs:comment "A connection or realisation that synthesises across multiple Notes/Highlights. Promotes from a chat turn via chat:concludes." ;
827
- rdfs:subClassOf prov:Entity .
828
-
829
- :relatedTo a owl:ObjectProperty ;
830
- rdfs:label "related to" ;
831
- rdfs:subPropertyOf skos:related .
832
-
833
- :references a owl:ObjectProperty ;
834
- rdfs:label "references" ;
835
- rdfs:subPropertyOf dcterms:references .
836
-
837
- :source a owl:ObjectProperty ;
838
- rdfs:label "source" ;
839
- rdfs:domain :Highlight ;
840
- rdfs:range schema:CreativeWork ;
841
- rdfs:comment "Where a Highlight was extracted from." ;
842
- rdfs:subPropertyOf dcterms:source .
843
-
844
- # ─── URI patterns ───────────────────────────────────────────────────
845
- :UriPattern rdfs:label "URI minting pattern" .
846
-
847
- :concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
848
- :topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
849
- :question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
850
- :finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
851
- :note-pattern a :UriPattern ; skos:notation "urn:dkg:note:<slug>" .
852
- :highlight-pattern a :UriPattern ; skos:notation "urn:dkg:highlight:<slug>" .
853
- :insight-pattern a :UriPattern ; skos:notation "urn:dkg:insight:<slug>" .
854
-
855
- :slug-normalisation a skos:Note ;
856
- skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
857
- `,XN=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
858
- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
859
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
860
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
861
- @prefix dcterms: <http://purl.org/dc/terms/> .
862
- @prefix schema: <http://schema.org/> .
863
- @prefix prov: <http://www.w3.org/ns/prov#> .
864
- @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
865
- @prefix dcat: <http://www.w3.org/ns/dcat#> .
866
- @prefix fabio: <http://purl.org/spar/fabio/> .
867
- @prefix time: <http://www.w3.org/2006/time#> .
868
-
869
- @prefix chat: <http://dkg.io/ontology/chat/> .
870
- @prefix : <http://dkg.io/ontology/scientific-research/> .
871
-
872
- <http://dkg.io/ontology/scientific-research/>
873
- a owl:Ontology ;
874
- dcterms:title "DKG Scientific Research Project Ontology (v1)" ;
875
- dcterms:description """Starter for empirical scientific research:
876
- hypotheses → experiments → results → reproducibility chains. Composes
877
- with FaBiO for scholarly works, DCAT for datasets, PROV-O for
878
- provenance, OWL Time for sequencing.""" ;
879
- owl:versionInfo "1.0.0" ;
880
- dcterms:created "2026-04-18"^^xsd:date ;
881
- owl:imports
882
- <http://schema.org/> , <http://purl.org/dc/terms/> ,
883
- <http://www.w3.org/ns/prov#> ,
884
- <http://www.w3.org/2004/02/skos/core#> ,
885
- <http://www.w3.org/ns/dcat#> ,
886
- <http://purl.org/spar/fabio/> ,
887
- <http://www.w3.org/2006/time#> .
888
-
889
- # ─── Universal annotation predicates ────────────────────────────────
890
- chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
891
- chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
892
- chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
893
- chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
894
- chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Result .
895
- chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
896
-
897
- # ─── Universal annotation entities ──────────────────────────────────
898
- :Concept rdfs:subClassOf skos:Concept .
899
- :Topic rdfs:subClassOf skos:Concept .
900
- :Question rdfs:subClassOf schema:Question .
901
- :Finding rdfs:subClassOf prov:Entity .
902
-
903
- # ─── Scientific-research-specific ───────────────────────────────────
904
-
905
- :Hypothesis a owl:Class ;
906
- rdfs:label "Hypothesis" ;
907
- rdfs:comment "A testable claim. Linked to Experiments via :testedBy and to Results via :supportedBy / :refutedBy." ;
908
- rdfs:subClassOf prov:Entity .
909
-
910
- :Experiment a owl:Class ;
911
- rdfs:label "Experiment" ;
912
- rdfs:comment "A defined procedure executed to test a Hypothesis. Subclass of prov:Activity for full provenance." ;
913
- rdfs:subClassOf prov:Activity .
914
-
915
- :Method a owl:Class ;
916
- rdfs:label "Method" ;
917
- rdfs:comment "A reusable methodology applied within Experiments." ;
918
- rdfs:subClassOf prov:Plan .
919
-
920
- :Result a owl:Class ;
921
- rdfs:label "Result" ;
922
- rdfs:comment "An outcome produced by an Experiment — quantitative or qualitative." ;
923
- rdfs:subClassOf prov:Entity .
924
-
925
- :Dataset a owl:Class ;
926
- rdfs:label "Dataset" ;
927
- rdfs:comment "An input or output dataset for an Experiment. Aligned with DCAT." ;
928
- rdfs:subClassOf dcat:Dataset .
929
-
930
- :testedBy a owl:ObjectProperty ;
931
- rdfs:label "tested by" ;
932
- rdfs:domain :Hypothesis ;
933
- rdfs:range :Experiment .
934
-
935
- :supportedBy a owl:ObjectProperty ;
936
- rdfs:label "supported by" ;
937
- rdfs:domain :Hypothesis ;
938
- rdfs:range :Result .
939
-
940
- :refutedBy a owl:ObjectProperty ;
941
- rdfs:label "refuted by" ;
942
- rdfs:domain :Hypothesis ;
943
- rdfs:range :Result .
944
-
945
- :usesDataset a owl:ObjectProperty ;
946
- rdfs:label "uses dataset" ;
947
- rdfs:domain :Experiment ;
948
- rdfs:range :Dataset .
949
-
950
- :reproducedBy a owl:ObjectProperty ;
951
- rdfs:label "reproduced by" ;
952
- rdfs:domain :Experiment ;
953
- rdfs:range :Experiment ;
954
- rdfs:comment "An Experiment that successfully reproduced this one's Results." .
955
-
956
- # ─── URI patterns ───────────────────────────────────────────────────
957
- :UriPattern rdfs:label "URI minting pattern" .
958
-
959
- :concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
960
- :topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
961
- :question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
962
- :finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
963
- :hypothesis-pattern a :UriPattern ; skos:notation "urn:dkg:hypothesis:<slug>" .
964
- :experiment-pattern a :UriPattern ; skos:notation "urn:dkg:experiment:<slug>" .
965
- :method-pattern a :UriPattern ; skos:notation "urn:dkg:method:<slug>" .
966
- :result-pattern a :UriPattern ; skos:notation "urn:dkg:result:<slug>" .
967
- :dataset-pattern a :UriPattern ; skos:notation "urn:dkg:dataset:<slug>" .
968
-
969
- :slug-normalisation a skos:Note ;
970
- skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
971
- `,ZN=`# Book-research agent guide
972
-
973
- This starter ships an RDF ontology for **book-research projects** —
974
- research notebooks anchored in scholarly sources (citations, quotes,
975
- arguments, hypotheses). The formal schema lives in \`ontology.ttl\`
976
- alongside this guide.
977
-
978
- For V10 MCP tool usage, see
979
- [\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
980
- The tool surface to use against this ontology:
981
-
982
- - \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
983
- - \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
984
- - \`dkg_knowledge_asset_share\` — share with peers (SWM)
985
- - \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
986
- - \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
987
-
988
- The longer per-domain agent-guide walkthrough format will return when
989
- the V10 ontology endpoint and per-project annotation workflow stabilise.
990
- `,JN=`# Coding-project agent guide
991
-
992
- This starter ships an RDF ontology for **coding projects** —
993
- shared project memory for AI coding agents (decisions, tasks, code
994
- references, GitHub activity, chat turns). The formal schema lives in
995
- \`ontology.ttl\` alongside this guide.
996
-
997
- For V10 MCP tool usage, see
998
- [\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
999
- The tool surface to use against this ontology:
1000
-
1001
- - \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
1002
- - \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
1003
- - \`dkg_knowledge_asset_share\` — share with peers (SWM)
1004
- - \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
1005
- - \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
1006
-
1007
- The longer per-domain agent-guide walkthrough format will return when
1008
- the V10 ontology endpoint and per-project annotation workflow stabilise.
1009
- `,eR=`# Narrative-writing agent guide
1010
-
1011
- This starter ships an RDF ontology for **narrative-writing projects** —
1012
- the structural elements of long-form narrative (Characters, Scenes,
1013
- PlotPoints, Themes, Settings) and their relationships. The formal
1014
- schema lives in \`ontology.ttl\` alongside this guide.
1015
-
1016
- For V10 MCP tool usage, see
1017
- [\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
1018
- The tool surface to use against this ontology:
1019
-
1020
- - \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
1021
- - \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
1022
- - \`dkg_knowledge_asset_share\` — share with peers (SWM)
1023
- - \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
1024
- - \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
1025
-
1026
- The longer per-domain agent-guide walkthrough format will return when
1027
- the V10 ontology endpoint and per-project annotation workflow stabilise.
1028
- `,tR=`# PKM agent guide
1029
-
1030
- This starter ships an RDF ontology for **PKM (Personal Knowledge
1031
- Management) projects** — Notes, Highlights, Insights, and the links
1032
- that grow a knowledge garden organically. The formal schema lives in
1033
- \`ontology.ttl\` alongside this guide.
1034
-
1035
- For V10 MCP tool usage, see
1036
- [\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
1037
- The tool surface to use against this ontology:
1038
-
1039
- - \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
1040
- - \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
1041
- - \`dkg_knowledge_asset_share\` — share with peers (SWM)
1042
- - \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
1043
- - \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
1044
-
1045
- The longer per-domain agent-guide walkthrough format will return when
1046
- the V10 ontology endpoint and per-project annotation workflow stabilise.
1047
- `,nR=`# Scientific-research agent guide
1048
-
1049
- This starter ships an RDF ontology for **scientific-research projects** —
1050
- the empirical research arc (Hypotheses → Experiments → Results →
1051
- Reproducibility chains), anchored in PROV-O and FaBiO so the graph
1052
- composes with existing scholarly publishing infrastructure. The formal
1053
- schema lives in \`ontology.ttl\` alongside this guide.
1054
-
1055
- For V10 MCP tool usage, see
1056
- [\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
1057
- The tool surface to use against this ontology:
1058
-
1059
- - \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
1060
- - \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
1061
- - \`dkg_knowledge_asset_share\` — share with peers (SWM)
1062
- - \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
1063
- - \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
1064
-
1065
- The longer per-domain agent-guide walkthrough format will return when
1066
- the V10 ontology endpoint and per-project annotation workflow stabilise.
1067
- `,aR=/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>"{}|\\^`\x00-\x20]+$/;function iR(e){return e?aR.test(e):!1}function Nh(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}function R8(e){return`"${Nh(e)}"`}const ft={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",schema:"http://schema.org/",dcterms:"http://purl.org/dc/terms/",xsd:"http://www.w3.org/2001/XMLSchema#",prov:"http://www.w3.org/ns/prov#",owl:"http://www.w3.org/2002/07/owl#"};function _i(e){if(!iR(e))throw new Error(`Invalid /wm/write IRI object: ${e}`);return e}function ta(e){return`"${Nh(e)}"`}function fc(e,n){return`"${Nh(e)}"^^<${_i(n)}>`}function rR({contextGraphId:e,starterSlug:n,ttl:a,guide:r,nowIso:o=new Date().toISOString()}){if(!e)throw new Error("contextGraphId is required");if(!n)throw new Error("starterSlug is required");const s=_i(`urn:dkg:project:${e}:ontology`),u=_i(`${s}:agent-guide`),d=[{subject:s,predicate:ft.rdf+"type",object:_i(ft.owl+"Ontology")},{subject:s,predicate:ft.rdf+"type",object:_i(ft.prov+"Entity")},{subject:s,predicate:ft.rdfs+"label",object:ta(`Project ontology — ${e}`)},{subject:s,predicate:ft.schema+"name",object:ta(`Project ontology — ${e}`)},{subject:s,predicate:ft.dcterms+"title",object:ta(`Project ontology — ${e}`)},{subject:s,predicate:ft.dcterms+"description",object:ta(`The active ontology for context graph ${e}, derived from the '${n}' starter.`)},{subject:s,predicate:ft.dcterms+"created",object:fc(o,ft.xsd+"dateTime")},{subject:s,predicate:ft.dcterms+"modified",object:fc(o,ft.xsd+"dateTime")},{subject:s,predicate:ft.dcterms+"source",object:ta(n)},{subject:s,predicate:ft.schema+"encodingFormat",object:ta("text/turtle")},{subject:s,predicate:ft.schema+"text",object:ta(a)},{subject:s,predicate:ft.dcterms+"references",object:_i(u)},{subject:u,predicate:ft.rdf+"type",object:_i(ft.schema+"DigitalDocument")},{subject:u,predicate:ft.rdfs+"label",object:ta(`Agent guide — ${e} ontology`)},{subject:u,predicate:ft.schema+"name",object:ta(`Agent guide — ${e} ontology`)},{subject:u,predicate:ft.dcterms+"title",object:ta(`Agent guide — ${e} ontology`)},{subject:u,predicate:ft.dcterms+"created",object:fc(o,ft.xsd+"dateTime")},{subject:u,predicate:ft.dcterms+"modified",object:fc(o,ft.xsd+"dateTime")},{subject:u,predicate:ft.schema+"encodingFormat",object:ta("text/markdown")},{subject:u,predicate:ft.schema+"text",object:ta(r)},{subject:u,predicate:ft.schema+"about",object:_i(s)}];return{ontologyUri:s,guideUri:u,quads:d}}async function pc(e,n){const a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...Vt()},body:JSON.stringify(n)});if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}const lR=Object.assign({"../../../../mcp-dkg/templates/ontologies/book-research/ontology.ttl":WN,"../../../../mcp-dkg/templates/ontologies/coding-project/ontology.ttl":YN,"../../../../mcp-dkg/templates/ontologies/narrative-writing/ontology.ttl":KN,"../../../../mcp-dkg/templates/ontologies/pkm/ontology.ttl":QN,"../../../../mcp-dkg/templates/ontologies/scientific-research/ontology.ttl":XN}),oR=Object.assign({"../../../../mcp-dkg/templates/ontologies/book-research/agent-guide.md":ZN,"../../../../mcp-dkg/templates/ontologies/coding-project/agent-guide.md":JN,"../../../../mcp-dkg/templates/ontologies/narrative-writing/agent-guide.md":eR,"../../../../mcp-dkg/templates/ontologies/pkm/agent-guide.md":tR,"../../../../mcp-dkg/templates/ontologies/scientific-research/agent-guide.md":nR});function sR(){const e={};for(const[n,a]of Object.entries(lR)){const r=n.match(/ontologies\/([^/]+)\/ontology\.ttl$/);if(!r)continue;const o=r[1];e[o]={ttl:a,guide:""}}for(const[n,a]of Object.entries(oR)){const r=n.match(/ontologies\/([^/]+)\/agent-guide\.md$/);if(!r)continue;const o=r[1];e[o]&&(e[o].guide=a)}return e}const Rh=sR(),cR=[{slug:"coding-project",displayName:"Coding project",description:"Software projects: decisions, tasks, code, GitHub. The v1 reference ontology."},{slug:"book-research",displayName:"Book / paper research",description:"Long-form non-fiction: hypotheses, arguments, citations, quotes. Built on BIBO + SPAR."},{slug:"pkm",displayName:"Personal knowledge management",description:"Notes, highlights, insights — daily-driver PKM workflow. Composes with SKOS."},{slug:"scientific-research",displayName:"Scientific research",description:"Empirical research: hypotheses → experiments → results → reproducibility. Built on PROV-O + DCAT + FaBiO."},{slug:"narrative-writing",displayName:"Narrative writing",description:"Fiction or narrative non-fiction: characters, scenes, plot points, themes."}];function uR(){return cR.filter(e=>Rh[e.slug])}function dR(e){return Rh[e]??null}async function fR(e,n){const a=dR(n);if(!a)throw new Error(`Unknown ontology starter '${n}'. Available: ${Object.keys(Rh).join(", ")}`);if(!a.ttl||!a.guide)throw new Error(`Starter '${n}' is missing ontology.ttl or agent-guide.md.`);await pc("/api/sub-graph/create",{contextGraphId:e,subGraphName:"meta"}).catch(d=>{if(!String((d==null?void 0:d.message)??d).includes("already exists"))throw d});const{ontologyUri:r,guideUri:o,quads:s}=rR({contextGraphId:e,starterSlug:n,ttl:a.ttl,guide:a.guide});await pc("/api/knowledge-assets/project-ontology/wm/discard",{contextGraphId:e,subGraphName:"meta"}).catch(d=>{const p=String((d==null?void 0:d.message)??d);if(!/404|not found/i.test(p))throw d}),await pc("/api/knowledge-assets/project-ontology/wm/write",{contextGraphId:e,subGraphName:"meta",quads:s});const u=await pc("/api/knowledge-assets/project-ontology/swm/share",{contextGraphId:e,subGraphName:"meta"});if(!u.swmShared||!u.sealed||!u.publishReady)throw new Error("Project ontology atomic share did not reach Shared Working Memory");return{ontologyUri:r,guideUri:o,tripleCount:s.length}}async function _h(e,n){const a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...Vt()},body:JSON.stringify(n)}),r=await a.text();let o;if(r)try{o=JSON.parse(r)}catch{o={raw:r}}if(!a.ok){const s=(o==null?void 0:o.error)??`HTTP ${a.status}`;throw new Error(typeof s=="string"?s:JSON.stringify(s))}return o}function pR(e,n={}){return _h(`/api/context-graph/${encodeURIComponent(e)}/manifest/publish`,n)}function hR(e,n){return _h(`/api/context-graph/${encodeURIComponent(e)}/manifest/plan-install`,n)}function mR(e,n){return _h(`/api/context-graph/${encodeURIComponent(e)}/manifest/install`,n)}const z0="dkg.wireWorkspace.parentDir",I0="dkg.wireWorkspace.nickname",P0="dkg.wireWorkspace.tools",Kf=[{value:"cursor",label:"Cursor",description:"Wires .cursor/mcp.json + hooks + rules into the workspace."},{value:"claude-code",label:"Claude Code",description:"Merges hooks into ~/.claude/settings.json. Requires Claude Code installed."},{value:"both",label:"Both Cursor and Claude Code",description:"Wires both tools so either can operate on this project."},{value:"cursor",label:"Codex (coming soon)",description:"Codex CLI integration isn't shipped yet — pick another tool for now.",disabled:!0,comingSoon:!0}];function gR(e,n){const a=n.split("/"),r=a[a.length-1]??"";return r||(e??"project").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function yR(e){if(!e)return"";const n=e.hostname.replace(/\.local$/,"").replace(/-/g," ");return`${e.username} @ ${n}`}function U0(e){return e==="both"?["cursor","claude-code"]:[e]}function _b({contextGraphId:e,projectName:n,defaultAgentNickname:a,onDone:r,onCancel:o,variant:s}){var ie;const u=S.useMemo(()=>gR(n,e),[n,e]),[d,p]=S.useState(null),[f,y]=S.useState(null),[g,x]=S.useState(""),[b,k]=S.useState(""),[C,j]=S.useState("cursor"),[E,R]=S.useState(!1),[O,G]=S.useState(null),[U,_]=S.useState(null),[W,H]=S.useState(null);S.useEffect(()=>{let B=!1;return(async()=>{try{const[K,P]=await Promise.all([fetch("/api/host/info",{headers:Vt()}).then(X=>X.ok?X.json():null),nu().catch(()=>null)]);if(B)return;if(K){p(K);const X=typeof window<"u"&&window.localStorage.getItem(z0)||K.defaultWorkspaceParent;x(`${X}/${u}`)}P&&y(P);const Z=typeof window<"u"&&window.localStorage.getItem(I0);a?k(a):Z?k(Z):K&&k(yR(K));const ne=typeof window<"u"&&window.localStorage.getItem(P0);ne&&(ne==="cursor"||ne==="claude-code"||ne==="both")&&j(ne)}catch(K){B||console.warn("[WireWorkspacePanel] host info / identity fetch failed:",K)}})(),()=>{B=!0}},[u,a]);function L(B){typeof window>"u"||(window.localStorage.setItem(z0,B),b&&window.localStorage.setItem(I0,b),window.localStorage.setItem(P0,C))}async function T(){R(!0),G(null);try{const B=g.trim();if(!B||B.startsWith("~"))throw new Error("Workspace path must be an absolute path (start with `/`). The daemon will create the directory if it does not exist.");const K=await hR(e,{workspaceRoot:B,agentNickname:b.trim(),tools:U0(C)});_(K);const P=B.lastIndexOf("/");P>0&&L(B.slice(0,P))}catch(B){G((B==null?void 0:B.message)||"Preview failed")}finally{R(!1)}}async function F(){R(!0),G(null);try{const B=g.trim(),K=await mR(e,{workspaceRoot:B,agentNickname:b.trim(),tools:U0(C)});H(K)}catch(B){G((B==null?void 0:B.message)||"Install failed")}finally{R(!1)}}if(W)return m.jsxs("div",{children:[m.jsxs("div",{style:{padding:"12px 14px",borderRadius:8,marginBottom:14,fontSize:12,background:"rgba(34, 197, 94, 0.08)",border:"1px solid rgba(34, 197, 94, 0.25)",color:"var(--accent-green)"},children:[m.jsx("div",{style:{fontWeight:600,marginBottom:6},children:"Workspace wired."}),"Open ",m.jsx("code",{style:{fontFamily:"var(--font-mono)"},children:g})," in ",C==="claude-code"?"Claude Code":C==="both"?"Cursor or Claude Code":"Cursor",". On the first chat, your agent will see the project ontology",s==="join"?", tasks, and decisions":" you publish via the canonical assertion-write flow","."]}),m.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:8},children:"Files written:"}),m.jsxs("pre",{style:{fontSize:10,fontFamily:"var(--font-mono)",maxHeight:200,overflow:"auto",padding:10,borderRadius:6,background:"var(--bg-secondary)",border:"1px solid var(--border-primary)",margin:0},children:[W.written.map(B=>`${B.action.padEnd(9)} ${B.absPath} (${B.bytesWritten.toLocaleString()} bytes)`).join(`
1068
- `),W.skipped.length?`
1069
-
1070
- Skipped:
1071
- `+W.skipped.map(B=>` - ${B}`).join(`
1072
- `):"",W.warnings.length?`
1073
-
1074
- Warnings:
1075
- `+W.warnings.map(B=>` - ${B}`).join(`
1076
- `):""]}),m.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:14},children:m.jsx("button",{className:"v10-modal-btn primary",onClick:r,children:"Done"})})]});if(U)return m.jsxs("div",{children:[O&&m.jsx("div",{className:"v10-modal-error",style:{marginBottom:12},children:O}),m.jsx("div",{style:{marginBottom:10,fontSize:11,color:"var(--text-secondary)"},children:"Review the install plan. Files are only written when you click Install."}),m.jsx("pre",{style:{fontSize:10,fontFamily:"var(--font-mono)",maxHeight:320,overflow:"auto",padding:12,borderRadius:6,background:"var(--bg-secondary)",border:"1px solid var(--border-primary)",margin:0,whiteSpace:"pre-wrap"},children:U.markdown}),m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:14,gap:10},children:[m.jsx("button",{className:"v10-modal-btn",onClick:()=>{_(null),G(null)},disabled:E,children:"← Back"}),m.jsxs("div",{style:{display:"flex",gap:8},children:[m.jsx("button",{className:"v10-modal-btn",onClick:r,disabled:E,children:"Skip for now"}),m.jsx("button",{className:"v10-modal-btn primary",onClick:F,disabled:E,children:E?"Installing…":"Install"})]})]})]});const V=((ie=Kf.find(B=>B.value===C&&!B.disabled))==null?void 0:ie.description)??Kf[0].description;return m.jsxs("div",{children:[m.jsxs("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:14,fontSize:12,background:"rgba(59, 130, 246, 0.08)",border:"1px solid rgba(59, 130, 246, 0.25)",color:"var(--accent-primary, #3b82f6)"},children:[m.jsx("div",{style:{fontWeight:600,marginBottom:4},children:s==="create"?"Wire your local workspace":"Wire this project locally"}),s==="create"?"Choose a directory for the new project and which coding tool you want it wired for. The daemon will populate the workspace with the right config files so your agent can join the project from turn one.":"Choose a local directory for this project and which coding tool you want it wired for. The daemon will populate the workspace with the right config files so your agent can collaborate on this project."]}),O&&m.jsx("div",{className:"v10-modal-error",style:{marginBottom:12},children:O}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Workspace path"}),m.jsx("input",{className:"v10-form-input",type:"text",value:g,onChange:B=>x(B.target.value),placeholder:d?`${d.defaultWorkspaceParent}/${u}`:"/Users/you/code/project",spellCheck:!1,style:{fontFamily:"var(--font-mono)",fontSize:12}}),m.jsxs("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:["Absolute path. Created if it doesn't exist. Daemon writes only inside this dir (plus optionally ",m.jsx("code",{children:"~/.claude/settings.json"})," if Claude Code is selected).",d&&m.jsxs(m.Fragment,{children:[" Defaulted from your ",m.jsx("code",{children:"$HOME"})," = ",m.jsx("code",{children:d.homedir}),"."]})]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Coding tool to wire"}),m.jsx("select",{className:"v10-form-select",value:C,onChange:B=>j(B.target.value),children:Kf.map((B,K)=>m.jsx("option",{value:B.disabled?"__disabled__":B.value,disabled:B.disabled,children:B.label},`${B.label}-${K}`))}),m.jsx("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:V})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Your agent identity"}),m.jsx("input",{className:"v10-form-input",type:"text",value:f?`urn:dkg:agent:${f.agentAddress.toLowerCase()}`:"fetching…",disabled:!0,spellCheck:!1,style:{fontFamily:"var(--font-mono)",fontSize:11,opacity:.75}}),m.jsxs("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:["Cryptographic URI derived from this node's wallet address. Same on every project on this machine. Attribution (",m.jsx("code",{children:"prov:wasAttributedTo"}),") on every chat turn uses this URI."]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Nickname for this agent"}),m.jsx("input",{className:"v10-form-input",type:"text",value:b,onChange:B=>k(B.target.value),placeholder:"e.g. Alice on laptop 1",spellCheck:!1,maxLength:80}),m.jsx("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:"Free-form human label rendered as the agent's name in chips, lists, and rdfs:label triples. Doesn't affect attribution — only changes how you appear to others."})]}),m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:14,gap:10},children:[o?m.jsx("button",{className:"v10-modal-btn",onClick:o,disabled:E,children:"Cancel"}):m.jsx("button",{className:"v10-modal-btn",onClick:r,disabled:E,children:"Skip for now"}),m.jsx("button",{className:"v10-modal-btn primary",onClick:T,disabled:E||!g.trim()||!b.trim(),children:E?"Loading preview…":"Preview install"})]})]})}const B0='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), iframe, [tabindex]:not([tabindex="-1"])';function $c(e,n){const a=S.useRef(null),r=S.useRef(null);S.useEffect(()=>{if(e)return r.current=document.activeElement??null,queueMicrotask(()=>{const s=a.current;if(!s)return;const u=s.querySelector(B0),p=s.querySelector("[autofocus]")??u;p?p.focus():(s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1"),s.focus())}),()=>{var s,u;(u=(s=r.current)==null?void 0:s.focus)==null||u.call(s)}},[e]),S.useEffect(()=>{if(!e)return;const s=u=>{if(u.key==="Escape"){u.stopPropagation(),n();return}if(u.key!=="Tab")return;const d=a.current;if(!d)return;const p=Array.from(d.querySelectorAll(B0)).filter(x=>x.offsetParent!==null||x===document.activeElement);if(p.length===0){u.preventDefault(),d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.focus();return}const f=p[0],y=p[p.length-1],g=document.activeElement;if(g===d){u.preventDefault(),(u.shiftKey?y:f).focus();return}u.shiftKey&&g===f?(u.preventDefault(),y.focus()):!u.shiftKey&&g===y&&(u.preventDefault(),f.focus())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,n]);const o=S.useCallback(s=>{s.target===s.currentTarget&&n()},[n]);return{dialogRef:a,onBackdropClick:o}}const rl=80,vR=/<\/?[a-z][^>]*>/i,xR=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,bR=/[a-z0-9]/i;function wR(e){let n="",a=0;for(;a<e.length;){if(e.charCodeAt(a)===60){const o=e.charCodeAt(a+1);if(o>=65&&o<=90||o>=97&&o<=122||o===47){const u=e.indexOf(">",a+1);if(u===-1)break;a=u+1;continue}}n+=e[a],a+=1}return n}function Ob(e){if(typeof e!="string")return"";let n=wR(e);return n=n.replace(/[<>]/g,""),n=n.replace(xR,""),n=n.replace(/\s+/g," "),n=n.trim(),n.length>rl&&(n=n.slice(0,rl)),n}function H0(e){const n=Ob(e);return n?bR.test(n)?vR.test(e)?"HTML tags are not allowed in the name — they have been stripped automatically.":/[<>]/.test(e)?"Angle brackets (< or >) are not allowed in the name — they and any text consumed by an unclosed tag have been stripped automatically.":e.length>rl?`Name was trimmed to ${rl} characters (was ${e.length}).`:null:"Name must contain at least one letter or digit.":"Enter a name with at least one letter or digit."}function $0(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function SR({open:e,onClose:n}){var it,fe;const[a,r]=S.useState(""),[o,s]=S.useState(""),[u,d]=S.useState("curated"),[p,f]=S.useState("curator-only"),[y,g]=S.useState(!1),[x,b]=S.useState("community"),k=uR(),[C,j]=S.useState(((it=k[0])==null?void 0:it.slug)??"coding-project"),[E,R]=S.useState(!1),[O,G]=S.useState("off"),[U,_]=S.useState("7d"),[W,H]=S.useState("100k"),[L,T]=S.useState(!1),[F,V]=S.useState(""),[ie,B]=S.useState(null),[K,P]=S.useState(null),[Z,ne]=S.useState(null),[X,D]=S.useState(null),[M,Q]=S.useState(""),[N,ue]=S.useState(!0),[pe,he]=S.useState(!1),{setContextGraphs:be,contextGraphs:Oe,setActiveProject:Ne}=ca(),{openTab:et}=mn(),{setStage:Ot,stage:xt}=Th(),bt=()=>{ue(!0),he(!1),nu().then($=>{ne($.agentAddress),he(!1)}).catch(()=>{ne(null),he(!0)}).finally(()=>ue(!1))};S.useEffect(()=>{e&&(P(null),bt())},[e]);const yt=$c(e&&!X,n),Zt=$c(e&&!!X,()=>{D(null),Q(""),P(null),r(""),s(""),n()});if(!e)return null;const Ue=Ob(a),pt=$0(Ue),Dt=Z&&pt?`${Z}/${pt}`:pt?`<agent-address>/${pt}`:"",Nt=a?H0(a):null,ge=$=>{r($)},Mt=async()=>{const $=Ue;if(!$||Nt)return;T(!0),B(null),P(null),V(y?"Registering context graph on the network…":"Creating context graph locally…");const le=$0($);if(!Z){B("Agent identity is still loading. Please wait a moment and try again."),T(!1);return}const me=`${Z}/${le}`;try{const ye=setTimeout(()=>V(y?"On-chain registration in progress — this can take up to 30s…":"Setting up local context graph…"),5e3),I=u==="curated"?1:0,Te=p==="curator-only"?0:1,at=u==="curated"?{accessPolicy:I,publishPolicy:Te,allowedAgents:Z?[Z]:[],register:y}:{accessPolicy:I,publishPolicy:Te,register:y},Pe=await TA(me,$,o.trim()||void 0,at);if(clearTimeout(ye),y&&Pe.registered===!1){const ke=`On-chain registration failed: ${Pe.registerError??"unknown error"}. Project is created locally and usable for everything except Verifiable Memory publishing. Retry registration from the project's Settings when ready.`;console.warn("[CreateProjectModal]",ke),P(ke)}if(x==="community"||x==="agent")try{V(`Installing '${C}' ontology…`),await fR(Pe.created,C)}catch(ke){console.warn("[CreateProjectModal] ontology install failed:",ke),V(`Context graph created, but ontology install failed: ${(ke==null?void 0:ke.message)??ke}`)}let Xe=!0;try{V("Publishing context graph manifest…"),await pR(Pe.created,{})}catch(ke){Xe=!1,console.warn("[CreateProjectModal] manifest publish failed:",ke),V(`Context graph created, but manifest publish failed: ${(ke==null?void 0:ke.message)??ke}`)}V("Refreshing context graph list…");const{contextGraphs:Ve}=await bh();be(Ve??[]),Ne(Pe.created),et({id:`project:${Pe.created}`,label:$,closable:!0}),xt<2&&Ot(2),Xe?(Q($),D(Pe.created),V("")):setTimeout(()=>{r(""),s(""),V(""),n()},2500)}catch(ye){const I=(ye==null?void 0:ye.message)||"Failed to create context graph";I.includes("already exists")||I.includes("409")?B("A context graph with this ID already exists. Try a different name."):(I.includes("taking longer"),B(I)),V("")}finally{T(!1)}},qn=Oe.length===0;function yn(){D(null),Q(""),P(null),r(""),s(""),n()}return X?m.jsx("div",{className:"v10-modal-overlay",onClick:Zt.onBackdropClick,role:"presentation",children:m.jsxs("div",{className:"v10-modal-box",ref:Zt.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-wire-modal-title",children:[m.jsx("button",{type:"button",className:"v10-modal-close",onClick:yn,"aria-label":"Close wire workspace dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4},children:"×"}),m.jsxs("div",{className:"v10-modal-header",children:[m.jsxs("div",{id:"dkg-wire-modal-title",className:"v10-modal-title",children:["Wire workspace for ",M]}),m.jsx("div",{className:"v10-modal-subtitle",children:"Context graph created. Now wire a local workspace so you can plan it from your own Cursor."})]}),m.jsxs("div",{className:"v10-modal-body",children:[K&&m.jsx("div",{className:"v10-modal-warning",children:K}),m.jsx(_b,{contextGraphId:X,projectName:M,variant:"create",onDone:yn})]})]})}):m.jsx("div",{className:"v10-modal-overlay",onClick:yt.onBackdropClick,role:"presentation",children:m.jsxs("div",{className:"v10-modal-box",ref:yt.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-create-cg-title","aria-describedby":"dkg-create-cg-subtitle",children:[m.jsx("button",{type:"button",className:"v10-modal-close",onClick:n,"aria-label":"Close create context graph dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4,zIndex:1},children:"×"}),m.jsxs("div",{className:"v10-modal-header",children:[m.jsx("div",{id:"dkg-create-cg-title",className:"v10-modal-title",children:"Create New Context Graph"}),m.jsx("div",{id:"dkg-create-cg-subtitle",className:"v10-modal-subtitle",children:"A context graph gives your agent structured memory — a place to draft, share, and publish knowledge."})]}),m.jsxs("div",{className:"v10-modal-body",children:[ie&&m.jsx("div",{className:"v10-modal-error",children:ie}),K&&m.jsx("div",{className:"v10-modal-warning",children:K}),qn&&m.jsxs("div",{className:"v10-modal-tip",children:[m.jsx("div",{className:"v10-modal-tip-title",children:"First context graph tip"}),"This is your agent's first memory space. Consider importing any existing knowledge your agent has — notes, documents, conversation logs — so it can build on what it already knows."]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",htmlFor:"dkg-cg-name",children:"Context Graph Name"}),m.jsx("input",{id:"dkg-cg-name",name:"dkg-cg-name",className:"v10-form-input",type:"text",placeholder:"e.g. Pharma Drug Interactions",value:a,onChange:$=>ge($.target.value),autoFocus:!0,maxLength:rl,"aria-invalid":Nt?"true":"false","aria-describedby":"dkg-cg-name-help",autoComplete:"off",spellCheck:!0}),m.jsx("div",{id:"dkg-cg-name-help",style:{marginTop:4,fontSize:11,color:Nt?"var(--red, #f87171)":"var(--text-tertiary)",fontFamily:"var(--font-mono)"},children:Nt||(Dt?`ID: did:dkg:context-graph:${Dt}`:`${a.length}/${rl} characters`)})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",htmlFor:"dkg-cg-description",children:"Description"}),m.jsx("textarea",{id:"dkg-cg-description",name:"dkg-cg-description",className:"v10-form-textarea",placeholder:"What should your agent remember? Describe the domain, goals, or context...",value:o,onChange:$=>s($.target.value),"aria-label":"Context graph description"})]}),m.jsx("div",{className:"v10-form-divider"}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Sharing"}),m.jsxs("div",{className:"v10-form-radio-group",children:[m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:u==="curated",onChange:()=>d("curated")}),"Invite-only — only invited agents can read and subscribe"]}),m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:u==="public",onChange:()=>d("public")}),"Open — publicly discoverable; anyone can subscribe"]})]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Contribution"}),m.jsxs("div",{className:"v10-form-radio-group",children:[m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:p==="curator-only",onChange:()=>f("curator-only")}),"Curators-only — only the curator may publish to Verifiable Memory"]}),m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:p==="open",onChange:()=>f("open")}),"Open — any wallet may publish to Verifiable Memory (not just members)"]})]}),u==="curated"&&p==="open"&&m.jsxs("div",{style:{marginTop:6,fontSize:11,color:"var(--text-tertiary)"},children:["Note: an invite-only sharing graph with open contribution still lets ",m.jsx("em",{children:"any"})," wallet publish to Verifiable Memory — the on-chain publish check is not gated by the allowlist. See SPEC_CG_MEMORY_MODEL §2.5."]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"On-chain registration"}),m.jsxs("label",{className:"v10-form-radio",style:{display:"flex",alignItems:"flex-start",gap:8},children:[m.jsx("input",{type:"checkbox",checked:y,onChange:$=>g($.target.checked),style:{marginTop:3}}),m.jsxs("span",{children:["Register on chain now (required for Verifiable Memory publishing)",m.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",marginTop:4},children:"Off by default — the project is created locally and can be registered later from its Settings tab when your wallet is funded and a working RPC is configured."})]})]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Ontology"}),m.jsxs("div",{className:"v10-form-radio-group",children:[m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:x==="community",onChange:()=>b("community")}),"Choose a starter — install one of the bundled context-graph-type ontologies"]}),x==="community"&&m.jsxs("div",{style:{marginLeft:24,marginTop:4,marginBottom:8},children:[m.jsx("select",{className:"v10-form-select",value:C,onChange:$=>j($.target.value),children:k.map($=>m.jsx("option",{value:$.slug,children:$.displayName},$.slug))}),m.jsx("div",{style:{marginTop:6,fontSize:11,color:"var(--text-tertiary)"},children:(fe=k.find($=>$.slug===C))==null?void 0:fe.description})]}),m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:x==="agent",onChange:()=>b("agent")}),"Let agent decide — defaults to the closest starter (v1)"]}),x==="agent"&&m.jsxs("div",{className:"v10-form-radio-desc",style:{marginLeft:24,marginTop:4,marginBottom:8},children:["v1 installs the ",m.jsx("code",{children:C})," starter as a sensible default. A future release will have the agent draft a context-graph-specific ontology by extending the closest starter from the context graph description."]}),m.jsxs("label",{className:"v10-form-radio",style:{opacity:.5},children:[m.jsx("input",{type:"radio",checked:x==="upload",onChange:()=>b("upload"),disabled:!0}),"Upload an ontology file (.ttl, .owl, .rdf) ",m.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]})]})]}),m.jsxs("div",{className:"v10-form-advanced-toggle",onClick:()=>R(!E),children:[m.jsx("span",{className:`v10-form-adv-chevron ${E?"open":""}`,children:"▸"}),m.jsx("span",{children:"Advanced settings"})]}),E&&m.jsxs("div",{className:"v10-form-advanced-body",style:{opacity:.5,pointerEvents:"none"},children:[m.jsxs("div",{className:"v10-form-group",children:[m.jsxs("label",{className:"v10-form-label",children:["Consensus Quorum ",m.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]}),m.jsxs("select",{className:"v10-form-select",value:O,disabled:!0,children:[m.jsx("option",{value:"off",children:"Off — no consensus verification required"}),m.jsx("option",{value:"2of3",children:"2 of 3 — lightweight consensus"}),m.jsx("option",{value:"3of5",children:"3 of 5 — standard consensus (recommended for teams)"}),m.jsx("option",{value:"custom",children:"Custom — set your own M of N"})]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsxs("label",{className:"v10-form-label",children:["SWM TTL ",m.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]}),m.jsxs("select",{className:"v10-form-select",value:U,disabled:!0,children:[m.jsx("option",{value:"7d",children:"7 days (default)"}),m.jsx("option",{value:"1h",children:"1 hour"}),m.jsx("option",{value:"1d",children:"1 day"}),m.jsx("option",{value:"30d",children:"30 days"})]})]}),m.jsxs("div",{className:"v10-form-group",style:{marginBottom:0},children:[m.jsxs("label",{className:"v10-form-label",children:["SWM Size Cap ",m.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]}),m.jsxs("select",{className:"v10-form-select",value:W,disabled:!0,children:[m.jsx("option",{value:"100k",children:"100K triples (default)"}),m.jsx("option",{value:"10k",children:"10K triples"}),m.jsx("option",{value:"1m",children:"1M triples"})]})]})]})]}),m.jsxs("div",{className:"v10-modal-footer",children:[m.jsx("button",{className:"v10-modal-btn",onClick:n,children:"Cancel"}),pe&&m.jsx("button",{className:"v10-modal-btn",onClick:bt,disabled:N,children:N?"Retrying…":"Retry Loading Agent"}),m.jsx("button",{className:"v10-modal-btn primary",onClick:Mt,disabled:!a.trim()||!!H0(a)||L||!Z||N,children:L?F||"Creating…":Z?"Create Context Graph":pe?"Agent unavailable":"Loading agent…"})]})]})})}function Oh(e){return{agentDid:e.agentDid,peerId:e.peerId}}function qc(e){if(!(e!=null&&e.trim()))return"unknown";const n=e.trim().replace(/^["']|["']$/g,"").toLowerCase();return n==="private"?"private":n==="public"?"public":"unknown"}function Mi(e){let n=e.trim().replace(/^["']|["']$/g,"");n.startsWith("<")&&n.endsWith(">")&&(n=n.slice(1,-1));const a="did:dkg:agent:";if(n.length>=a.length&&n.slice(0,a.length).toLowerCase()===a.toLowerCase()){const o=n.slice(a.length),s=/^(0x[a-fA-F0-9]{40})$/i.exec(o);return s?`${a}${s[1].toLowerCase()}`:`${a}${o}`}return/^0x[a-fA-F0-9]{40}$/.exec(n)?`${a}${n.toLowerCase()}`:n.toLowerCase()}function ru(e,n){var a,r;return e.callerInvolved===!0?!0:e.callerInvolved===!1||!((a=n==null?void 0:n.agentDid)!=null&&a.trim())?!1:!!((r=e.curator)!=null&&r.trim()&&Mi(e.curator)===Mi(n.agentDid))}function kR(e,n,a){const r=e.filter(o=>ru(o,n));if(a&&!r.some(o=>o.id===a)){const o=e.find(s=>s.id===a);if(o)return[o,...r]}return r}function CR(e,n){return!(ru(e,n)||qc(e.accessPolicy)!=="public")}function ER(e){return e.subscribed===!0||e.synced===!0?"project":"catalogue"}function AR(e){return e.alreadyMember===!0||e.autoApproved===!0||e.status==="approved"||e.status==="already-member"}const q0=/^(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|12D3Koo[1-9A-HJ-NP-Za-km-z]{45,53})$/;function jR(e){var b;const n=e.trim().replace(/\\n/g,`
1077
- `),a=n.split(`
1078
- `).map(k=>k.trim()).filter(Boolean),r=a[0]??"",o=a.slice(1).join(" ").trim(),s=n.match(/(?:^|\s)(\/(?:ip4|ip6|dns|dns4|dns6|dnsaddr)\/\S+)/),u=((b=s==null?void 0:s[1])==null?void 0:b.replace(/\s+/g,""))??null,d=o.replace(/\s+/g,""),p=d.startsWith("/")?d:u;let f=null;if(p){const k=p.match(/\/p2p\/([^/]+)$/);k&&q0.test(k[1])&&(f=k[1])}else for(const k of[o,...a.slice(1)]){const C=k.trim();if(q0.test(C)){f=C;break}}let y=r;u&&y.includes(u)&&(y=y.replace(u,"")),y=y.replace(/\s*@\s*$/,"").trim();const x=(a.length>1||o.length>0)&&f===null&&p===null;return{cgId:y,curatorPeerId:f,legacyMultiaddr:p,hasUnparsedExtra:x}}function TR(e,n){return!e.hasUnparsedExtra&&n.some(a=>a.id===e.cgId&&qc(a.accessPolicy)==="public")}function F0(e,n){const a=jR(e);return TR(a,n)?{kind:"publicSubscribe",invite:a,validationError:V0(a,{allowBareContextGraphId:!0}),idleLabel:"Subscribe",sendingLabel:"Subscribing…"}:{kind:"privateJoin",invite:a,validationError:V0(a),idleLabel:"Request to Join",sendingLabel:"Sending request…"}}async function G0(e){if(e.curatorPeerId){await CA(e.curatorPeerId).catch(()=>{});return}e.legacyMultiaddr&&(console.warn("[DKG] This invite uses a legacy multiaddr (deprecated). Ask the curator to regenerate using the current Share Context Graph modal — V10 invites carry a peer id and resolve via DHT, so they survive relay rotations."),await kA(e.legacyMultiaddr).catch(()=>{}))}function V0(e,n={}){if(!e.cgId)return"Missing context graph ID";if(e.hasUnparsedExtra)return"Invite contains a second line that is not a valid peer ID (12D3Koo…) or multiaddr (/ip4/…). Check for typos.";if(!e.curatorPeerId&&!e.legacyMultiaddr&&!n.allowBareContextGraphId)return"This invite is missing the curator peer id. Ask the curator to regenerate the invite from the Share Context Graph dialog.";if(e.legacyMultiaddr){if(!e.legacyMultiaddr.startsWith("/"))return"Invalid curator multiaddr";if(!e.legacyMultiaddr.includes("/p2p/"))return"Curator multiaddr is missing peer ID"}return null}function NR(e){if(e instanceof gn&&e.status===502){const n=RR(e.body);if(n.length===0)return"Request signed, but we couldn't deliver it to any reachable curator. Try again in a moment once your node has discovered more peers, or ask the curator for an updated invite.";const a=n.join("; "),r=n.some(_R),o=r?"Curator rejected this join request.":"Couldn't deliver this join request to the curator.",s=OR(a,r);return s?`${o} Reason: ${a}. ${s}`:`${o} Reason: ${a}.`}return e instanceof Error&&e.message?e.message:"Failed to send join request"}function RR(e){if(!e||typeof e!="object")return[];const n=e.errors;return Array.isArray(n)?n.filter(a=>typeof a=="string"&&a.length>0):[]}function _R(e){const n=e.replace(/^[^:]+:\s*/,"").trim();return!(!n||/^dial failed\b/i.test(n)||/^not curator$/i.test(n))}function OR(e,n){return n?/scope mismatch/i.test(e)?"This usually means your daemon's network config has a stale ContextGraphsHub address — pull the latest release (or `git pull && pnpm install && pnpm run build:runtime`) and try again.":/unknown CG/i.test(e)?"The curator doesn't recognise this context graph id — double-check the invite, or ask the curator to share an updated one.":null:/not curator/i.test(e)?"Your node reached other peers, but none of them curate this context graph. Make sure the curator's daemon is online and the invite carries the right curator peer id.":null}function DR({open:e,onClose:n,initialContextGraphId:a}){const[r,o]=S.useState(a??""),[s,u]=S.useState("idle"),[d,p]=S.useState(null),[f,y]=S.useState(null),[g,x]=S.useState(!1),[b,k]=S.useState(null),[C,j]=S.useState(""),{contextGraphs:E,setContextGraphs:R,setActiveProject:O}=ca(),{openTab:G}=mn();S.useEffect(()=>{a&&o(a)},[a]),S.useEffect(()=>{e||(o(a??""),p(null),u("idle"),y(null),x(!1))},[e,a]);const U=S.useCallback(ne=>{O(ne.id),G({id:`project:${ne.id}`,label:ne.name||ne.id,closable:!0})},[O,G]),_=S.useCallback(async(ne,X)=>{const{contextGraphs:D}=await bh(),M=D??[];R(M);const Q=M.find(N=>N.id===ne)??X;return Q&&U(Q),Q},[R,U]),W=S.useCallback(async ne=>{u("approved");try{const X=await _(ne);X&&(j(X.name??ne),k(ne))}catch{}},[_]),H=S.useCallback(ne=>{var D;if(!(!f||ne.type!=="join_approved"&&ne.type!=="join_rejected"||((D=ne.data)==null?void 0:D.contextGraphId)!==f)){if(ne.type==="join_rejected"){u("rejected");return}W(f)}},[f,W]);pl(H);const L=$c(e&&!b,n),T=$c(e&&!!b,()=>{k(null),j(""),n()});if(!e)return null;const F=async()=>{const ne=F0(r,E);if(ne.validationError){p(ne.validationError);return}const{cgId:X,curatorPeerId:D}=ne.invite;if(p(null),ne.kind==="publicSubscribe"){u("sending");try{const Q=E.find(N=>N.id===X);await G0(ne.invite),await kj(X,{syncMode:g?"always-on":"on-demand"}),await _(X,Q),n()}catch(Q){p(Q instanceof Error?Q.message:"Could not subscribe to this public context graph."),u("idle")}return}const M=E.find(Q=>Q.id===X);if(M){U(M),n();return}u("sending");try{await G0(ne.invite);const Q=await RA(X),N=await nu().then(pe=>pe.name).catch(()=>{}),ue=await _A(X,{delegation:Q.delegation,agentName:N,curatorPeerId:D??void 0});if(y(X),AR(ue)){await W(X);return}u("pending")}catch(Q){p(NR(Q)),u("idle")}};function V(){k(null),j(""),n()}if(b)return m.jsx("div",{className:"v10-modal-overlay",onClick:T.onBackdropClick,role:"presentation",children:m.jsxs("div",{className:"v10-modal-box",ref:T.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-join-wire-title",children:[m.jsx("button",{type:"button",className:"v10-modal-close",onClick:V,"aria-label":"Close wire workspace dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4,zIndex:1},children:"×"}),m.jsxs("div",{className:"v10-modal-header",children:[m.jsxs("div",{id:"dkg-join-wire-title",className:"v10-modal-title",children:["Wire workspace for ",C]}),m.jsx("div",{className:"v10-modal-subtitle",children:"Curator approved. Now wire a local workspace so this Cursor can collaborate on the context graph."})]}),m.jsx("div",{className:"v10-modal-body",children:m.jsx(_b,{contextGraphId:b,projectName:C,variant:"join",onDone:V})})]})});const ie=s==="sending",B=s==="pending",K=s==="approved",P=s==="rejected",Z=F0(r,E);return m.jsx("div",{className:"v10-modal-overlay",onClick:L.onBackdropClick,role:"presentation",children:m.jsxs("div",{className:"v10-modal-box",ref:L.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-join-cg-title","aria-describedby":"dkg-join-cg-subtitle",children:[m.jsx("button",{type:"button",className:"v10-modal-close",onClick:n,"aria-label":"Close join context graph dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4,zIndex:1},children:"×"}),m.jsxs("div",{className:"v10-modal-header",children:[m.jsx("div",{id:"dkg-join-cg-title",className:"v10-modal-title",children:"Join a Context Graph"}),m.jsx("div",{id:"dkg-join-cg-subtitle",className:"v10-modal-subtitle",children:"Enter a discovered public Context Graph ID to subscribe, or paste a curator invite for a private graph."})]}),m.jsxs("div",{className:"v10-modal-body",children:[d&&m.jsx("div",{className:"v10-modal-error",children:d}),B&&m.jsx("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:16,fontSize:12,background:"rgba(59, 130, 246, 0.08)",border:"1px solid rgba(59, 130, 246, 0.25)",color:"var(--accent-primary, #3b82f6)"},children:"Join request sent. Waiting for the curator to approve — this modal will move forward automatically once they do."}),K&&m.jsx("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:16,fontSize:12,background:"rgba(34, 197, 94, 0.08)",border:"1px solid rgba(34, 197, 94, 0.25)",color:"var(--accent-green)"},children:"Approved! Loading context graph…"}),P&&m.jsx("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:16,fontSize:12,background:"rgba(245, 158, 11, 0.08)",border:"1px solid rgba(245, 158, 11, 0.25)",color:"var(--accent-warning, #f59e0b)"},children:"The curator declined this join request."}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",htmlFor:"dkg-cg-invite",children:"Context Graph ID or Invite Code"}),m.jsx("textarea",{id:"dkg-cg-invite",name:"dkg-cg-invite",className:"v10-form-textarea",placeholder:`Public: paste a Context Graph ID
1079
-
1080
- Private: paste the curator invite
1081
- my-context-graph-abc123
1082
- 12D3KooW...`,value:r,onChange:ne=>o(ne.target.value),autoFocus:!0,rows:3,disabled:ie||B||K,style:{fontFamily:"var(--font-mono)",fontSize:11},"aria-label":"Context graph invite code",autoComplete:"off",spellCheck:!1})]}),Z.kind==="publicSubscribe"&&m.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:8,fontSize:12,color:"var(--text-secondary)",cursor:ie?"default":"pointer"},children:[m.jsx("input",{type:"checkbox",checked:g,onChange:ne=>x(ne.target.checked),disabled:ie,"aria-label":"Keep this Context Graph synchronized after restart"}),m.jsxs("span",{children:["Keep synchronized after restart",m.jsx("span",{style:{display:"block",color:"var(--text-tertiary)",marginTop:2},children:"Off by default. This node otherwise syncs the graph only when you open it."})]})]})]}),m.jsxs("div",{className:"v10-modal-footer",children:[m.jsx("button",{className:"v10-modal-btn",onClick:n,children:B||K?"Close":"Cancel"}),m.jsx("button",{className:"v10-modal-btn primary",onClick:F,disabled:!r.trim()||ie||B||K,children:ie?Z.sendingLabel:B?"Awaiting approval…":K?"Approved":Z.idleLabel})]})]})})}const Db="v10:hiddenProjectIds",Up="v10:hidden-projects-change";function Qf(){try{const e=localStorage.getItem(Db);if(!e)return new Set;const n=JSON.parse(e);return new Set(Array.isArray(n)?n:[])}catch{return new Set}}function W0(e){try{localStorage.setItem(Db,JSON.stringify([...e])),window.dispatchEvent(new Event(Up))}catch{}}function Mb(){const[e,n]=S.useState(()=>Qf());S.useEffect(()=>{const o=()=>n(Qf());return window.addEventListener(Up,o),window.addEventListener("storage",o),()=>{window.removeEventListener(Up,o),window.removeEventListener("storage",o)}},[]);const a=S.useCallback(o=>{const s=new Set(Qf());s.add(o),W0(s)},[]),r=S.useCallback(()=>{W0(new Set)},[]);return{hidden:e,hide:a,unhideAll:r}}function Y0({cg:e,isActive:n,onSelect:a,onHide:r}){return m.jsx("div",{className:"v10-tree-section",children:m.jsxs("div",{className:`v10-tree-section-header ${n?"active":""}`,onClick:a,children:[m.jsx("span",{className:"v10-tree-project-dot"}),m.jsx("span",{className:"v10-tree-section-label",children:e.name||e.id.slice(0,16)}),m.jsx("button",{type:"button",className:"v10-tree-hide-btn",title:"Hide this context graph from the sidebar (reversible)",onClick:o=>{o.stopPropagation(),r()},children:"×"})]})})}function MR({cg:e,isBrowsing:n,onBrowse:a,onSubscribe:r,onHide:o}){const s=e.name||e.id.slice(0,16);return m.jsx("div",{className:"v10-tree-section",children:m.jsxs("div",{className:`v10-tree-section-header catalogue ${n?"active":""}`,children:[m.jsx("span",{className:"v10-tree-project-dot"}),m.jsx("span",{className:"v10-tree-section-label",children:s}),m.jsx("button",{type:"button",className:"v10-tree-catalogue-btn","aria-label":`Browse ${s}`,onClick:a,children:"Browse"}),m.jsx("button",{type:"button",className:"v10-tree-catalogue-btn primary","aria-label":`Subscribe to ${s}`,onClick:r,children:"Subscribe"}),m.jsx("button",{type:"button",className:"v10-tree-hide-btn",title:"Hide this context graph from the sidebar (reversible)",onClick:o,children:"×"})]})})}function LR(e){switch(e){case"chat_ready":return"var(--accent-green, #22c55e)";case"connecting":return"var(--accent-yellow, #eab308)";case"degraded":case"bridge_offline":return"var(--accent-orange, #f97316)";case"available":case"coming_soon":default:return"var(--text-tertiary, #6b7280)"}}function zR(){const[e,n]=S.useState([]),[a,r]=S.useState(null),o=S.useCallback(()=>{iu().then(s=>{n(s.integrations),r(null)}).catch(s=>r(s.message))},[]);return Ho(o,3e4),m.jsxs("div",{className:"v10-tree-items",style:{display:"block"},children:[m.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-tertiary)",textTransform:"uppercase",letterSpacing:.5,padding:"6px 12px 2px 24px"},children:"Agents"}),a&&m.jsx("div",{style:{fontSize:11,color:"var(--accent-orange, #f97316)",padding:"4px 12px 4px 24px"},children:a}),!a&&e.length===0&&m.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",padding:"4px 12px 4px 24px",fontStyle:"italic"},children:"No agents detected."}),e.map(s=>m.jsxs("div",{className:"v10-tree-item",title:s.detail,style:{cursor:"default"},children:[m.jsx("span",{"aria-label":s.statusLabel,style:{width:7,height:7,borderRadius:"50%",background:LR(s.status),flexShrink:0}}),m.jsx("span",{className:"v10-tree-item-label",children:s.name}),m.jsx("span",{style:{fontSize:11,color:"var(--text-tertiary)",marginLeft:4},children:s.statusLabel})]},s.id))]})}function IR(){const e=aa(X=>X.leftSectionMyProjectsOpen),n=aa(X=>X.leftSectionIntegrationsOpen),a=aa(X=>X.toggleLeftSectionMyProjects),r=aa(X=>X.toggleLeftSectionIntegrations),o=S.useId(),s=S.useId(),{openTab:u,activeTabId:d,setActiveTab:p}=mn(),{contextGraphs:f,setContextGraphs:y,setLoading:g,activeProjectId:x,setActiveProject:b}=ca(),k=Th(X=>X.stage),[C,j]=S.useState("explorer"),{hidden:E,hide:R,unhideAll:O}=Mb(),G=Ch().data,U=G?Oh(G):null,_=f.filter(X=>!E.has(X.id)),W=_.filter(X=>ru(X,U)),H=_.filter(X=>CR(X,U)),L=f.length-_.length,[T,F]=S.useState(!1),[V,ie]=S.useState(!1),[B,K]=S.useState(),P=S.useCallback(X=>{K(X),ie(!0)},[]),Z=S.useCallback(()=>{ie(!1),K(void 0)},[]),ne=S.useCallback(()=>{g(!0),Bn.fetchContextGraphs().then(({contextGraphs:X})=>y(X??[])).catch(()=>{}).finally(()=>g(!1))},[y,g]);return Ho(ne,6e4),pl(S.useCallback(X=>{(X.type==="join_approved"||X.type==="project_synced")&&ne()},[ne])),m.jsxs("div",{className:"v10-panel-left",children:[m.jsxs("div",{style:{display:"flex",gap:4,padding:"8px 8px 4px"},children:[m.jsx("button",{className:"v10-new-project-btn",onClick:()=>F(!0),children:"+ New Context Graph"}),m.jsx("button",{className:"v10-new-project-btn",onClick:()=>P(),children:"↗ Join Context Graph"})]}),m.jsxs("div",{className:"v10-tree-header",children:[m.jsx("button",{className:`v10-tree-mode-btn ${C==="explorer"?"active":""}`,onClick:()=>j("explorer"),children:"Context Graphs"}),m.jsx("button",{className:`v10-tree-mode-btn ${C==="oracle"?"active":""}`,onClick:()=>j("oracle"),children:"Context Oracle"})]}),C==="explorer"&&m.jsxs("div",{className:"v10-tree-content",children:[m.jsxs("div",{className:`v10-tree-dashboard ${d==="dashboard"?"active":""}`,onClick:()=>{p("dashboard"),b(null)},children:[m.jsx("span",{children:"▦"})," Dashboard"]}),f.length===0&&k<=1&&m.jsxs("div",{className:"v10-journey-empty-card",children:[m.jsx("div",{className:"v10-jec-title",children:"No context graphs yet"}),m.jsx("div",{className:"v10-jec-hint",children:k===0?"Connect an agent to get started.":"Create your first context graph to give your agent structured memory."}),k===1&&m.jsx("button",{className:"v10-new-project-btn",style:{margin:0},onClick:()=>F(!0),children:"+ Create First Context Graph"})]}),(f.length>0||k>=2)&&m.jsxs("div",{className:"v10-peer-group",children:[m.jsxs("button",{type:"button",className:"v10-peer-group-header","aria-expanded":e,"aria-controls":o,onClick:a,children:[m.jsx(zp,{size:14,className:`v10-peer-group-chevron ${e?"expanded":""}`,"aria-hidden":"true"}),m.jsx("span",{className:"v10-peer-group-label",children:"My Context Graphs"})]}),e&&m.jsx("div",{id:o,className:"v10-peer-group-body",children:W.length===0?m.jsx("div",{className:"v10-tree-item",style:{cursor:"default",color:"var(--text-tertiary)",fontStyle:"italic"},children:m.jsx("span",{className:"v10-tree-item-label",children:"No context graphs in this view yet."})}):W.map(X=>m.jsx(Y0,{cg:X,isActive:x===X.id,onSelect:()=>{b(X.id),u({id:`project:${X.id}`,label:X.name||X.id.slice(0,16),closable:!0})},onHide:()=>{R(X.id),x===X.id&&b(null)}},X.id))})]}),L>0&&m.jsxs("button",{type:"button",className:"v10-tree-show-hidden",onClick:O,title:"Restore all context graphs dismissed from the sidebar",children:["↺ Show ",L," hidden context graph",L!==1?"s":""]}),k>=1&&m.jsxs("div",{className:"v10-peer-group",children:[m.jsxs("button",{type:"button",className:"v10-peer-group-header","aria-expanded":n,"aria-controls":s,onClick:r,children:[m.jsx(zp,{size:14,className:`v10-peer-group-chevron ${n?"expanded":""}`,"aria-hidden":"true"}),m.jsx("span",{className:"v10-peer-group-label",children:"Integrations"})]}),n&&m.jsx("div",{id:s,className:"v10-peer-group-body",children:m.jsx(zR,{})})]})]}),C==="oracle"&&m.jsxs("div",{className:"v10-tree-content",children:[H.length>0&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"v10-tree-group-label",children:"Context Oracle"}),H.map(X=>{const D=()=>{R(X.id),x===X.id&&b(null)};return ER(X)==="catalogue"?m.jsx(MR,{cg:X,isBrowsing:d===`project:${X.id}`,onBrowse:()=>{b(null),u({id:`project:${X.id}`,label:X.name||X.id.slice(0,16),closable:!0})},onSubscribe:()=>P(X.id),onHide:D},X.id):m.jsx(Y0,{cg:X,isActive:x===X.id,onSelect:()=>{b(X.id),u({id:`project:${X.id}`,label:X.name||X.id.slice(0,16),closable:!0})},onHide:D},X.id)})]}),H.length===0&&m.jsxs("p",{style:{fontSize:12,color:"var(--text-tertiary)",padding:"20px 12px",textAlign:"center",lineHeight:1.5},children:["No discovered public Context Graphs yet. Public graphs appear here as soon as your node discovers them; use ",m.jsx("strong",{children:"Join Context Graph"})," to subscribe by ID."]}),L>0&&m.jsxs("button",{type:"button",className:"v10-tree-show-hidden",onClick:O,title:"Restore all context graphs dismissed from the sidebar",children:["↺ Show ",L," hidden context graph",L!==1?"s":""]})]}),m.jsx(SR,{open:T,onClose:()=>F(!1)}),m.jsx(DR,{open:V,onClose:Z,initialContextGraphId:B})]})}const PR=[/failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/importing a module script failed/i,/loading (?:css )?chunk [^ ]+ failed/i];function Lb(e,n=0){if(!(!(e instanceof Error)||n>4))return e.name==="ChunkLoadError"||e.code==="CSS_CHUNK_LOAD_FAILED"||PR.some(a=>a.test(e.message))?e:Lb(e.cause,n+1)}function UR(){return m.jsxs("div",{className:"lazy-spinner",role:"alert",children:[m.jsx("p",{children:"This view could not be opened. Reload the page to try again."}),m.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Reload page"})]})}function Ja(e,n){function a(s){return m.jsx(UR,{})}const r=hn.lazy(async()=>{try{return{default:await e()}}catch(s){const u=Lb(s);if(!u)throw s;return console.error("Failed to load a lazy view chunk.",u),{default:a}}});function o(s){const u=typeof n=="function"?n(s):n;return m.jsx(S.Suspense,{fallback:m.jsxs("div",{className:"lazy-spinner",children:["Loading ",u,"..."]}),children:m.jsx(r,{...s})})}return o}function Xf(e,n=[],a=0){const[r,o]=S.useState(null),[s,u]=S.useState(!0),[d,p]=S.useState(null),f=S.useRef(!0),y=S.useCallback(async()=>{try{const g=await e();f.current&&(o(g),p(null))}catch(g){if(f.current){if((g==null?void 0:g.status)===401){const x=!!window.__DKG_TOKEN__,b=sessionStorage.getItem("__dkg_401_reloaded")==="1";if(x&&!b){sessionStorage.setItem("__dkg_401_reloaded","1"),window.location.reload();return}p("Authentication expired — please refresh the page.");return}p(g.message)}}finally{f.current&&u(!1)}},n);return S.useEffect(()=>{f.current=!0,u(!0),y();let g=null;const x=()=>{a<=0||g||(g=setInterval(y,a))},b=()=>{g&&(clearInterval(g),g=null)},k=()=>{typeof document>"u"||(document.hidden?b():(y(),x()))};return(typeof document>"u"||!document.hidden)&&x(),typeof document<"u"&&document.addEventListener("visibilitychange",k),()=>{f.current=!1,b(),typeof document<"u"&&document.removeEventListener("visibilitychange",k)}},[y,a]),{data:r,loading:s,error:d,refresh:y}}function _8(e){return e==null?"—":e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(2)} GB`}function K0(e){if(e==null)return"—";if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;if(e<36e5)return`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`;const n=Math.floor(e/36e5),a=Math.floor(e%36e5/6e4);return`${n}h ${a}m`}function BR(e,n=new Date){if(e==null||e==="")return"—";const a=e instanceof Date?e:new Date(e);if(Number.isNaN(a.getTime()))return"—";if(a.toDateString()===n.toDateString())return a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"});const r=new Date(n);if(r.setDate(n.getDate()-1),a.toDateString()===r.toDateString())return`Yesterday ${a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`;const o=n.getTime()-a.getTime();return o>=0&&o<10080*60*1e3?`${a.toLocaleDateString(void 0,{weekday:"short"})} ${a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Q0(e,n=8){return e?e.length<=n*2?e:e.slice(0,n)+"..."+e.slice(-4):"—"}function HR(){const e=ca(g=>g.contextGraphs),n=ca(g=>g.setContextGraphs),{hidden:a}=Mb(),[r,o]=S.useState(null),[s,u]=S.useState(!0),[d,p]=S.useState(()=>e.length===0),f=S.useCallback(()=>{Bn.fetchContextGraphs().then(({contextGraphs:g})=>n(g??[])).catch(()=>{}).finally(()=>p(!1))},[n]);return S.useEffect(()=>{f();const g=setInterval(f,6e4);return()=>clearInterval(g)},[f]),pl(S.useCallback(g=>{g.type!=="join_approved"&&g.type!=="join_rejected"&&g.type!=="project_synced"||f()},[f])),S.useEffect(()=>{let g=!0;return u(!0),Bn.fetchCurrentAgent().then(x=>{g&&o(Oh(x))}).catch(()=>{}).finally(()=>{g&&u(!1)}),()=>{g=!1}},[e]),{myCgs:S.useMemo(()=>e.filter(g=>!a.has(g.id)).filter(g=>ru(g,r)),[e,a,r]),identity:r,identityLoading:s,cgsLoading:d}}const zb=["http://schema.org/name","http://www.w3.org/2000/01/rdf-schema#label","http://purl.org/dc/terms/title","http://purl.org/dc/elements/1.1/title","http://xmlns.com/foaf/0.1/name"];function $R(e={}){const n={predicates:[...e.extraPredicates??[],...zb]};return e.minZoomForLabels!==void 0&&(n.minZoomForLabels=e.minZoomForLabels),n}function Ib(e){if(!e)return"";const n=e.match(/^"([\s\S]*)"(?:\^\^<[^>]+>)?(?:@[A-Za-z0-9-]+)?$/);if(!n)return e;try{return JSON.parse(`"${n[1]}"`)}catch{return n[1]}}const X0="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",qR="http://dkg.io/ontology/profile/QueryCatalog";function hc(e){if(e!=null)return typeof e=="string"?e:typeof e=="object"&&"value"in e?String(e.value):String(e)}function jc(e){const n=Xt(e);return!n||n.startsWith('"')||/\s/.test(n)?!1:n.startsWith("_:")?!0:/^[A-Za-z][A-Za-z0-9+.-]*:/.test(n)}function Xt(e){const n=e.trim();return n.startsWith('"')?n:n.startsWith("<")&&n.endsWith(">")?n.slice(1,-1):n}function al(e){if(!e)return"—";if(e.startsWith('"'))return Ib(e);const n=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=Math.max(n,a);return r>=0?e.slice(r+1):e}function FR(e){const n=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=e.lastIndexOf(":"),o=Math.max(n,a,r),s=o>=0?e.slice(o+1):e;try{return decodeURIComponent(s)}catch{return s}}function GR(e){const n=FR(e).trim();return n?(/^[0-9a-f-]{16,}$/i.test(n)?n.replace(/-/g,"").slice(0,12):n).replace(/[_-]+/g," ").trim():""}function VR(e,n){return e===n&&/^urn:dkg:extraction:[^\s]+$/i.test(n)}function WR(e,n){return e===n&&jc(n)}function YR(e){const n=GR(e.uri),a=e.types.map(al).find(r=>r&&r!=="Thing"&&r!=="Entity");return/^urn:dkg:extraction:[^\s]+$/i.test(e.uri)?n?`Extraction ${n}`:"Extraction":a?n&&n!==a?`${a} ${n}`:a:n||al(e.uri)}function KR(e){for(const a of zb){const r=e.properties.get(a),o=r==null?void 0:r.find(s=>s.trim().length>0);if(o)return o}const n=al(e.uri);return e.label&&(e.label!==n||!WR(e.label,e.uri))&&!VR(e.label,e.uri)?e.label:YR(e)}const Pb=5e4,Ao=2e4,Ub=2e4;function Z0(e,n){const a=`did:dkg:context-graph:${e}`,r=n==="wm"?`(
1083
- STRSTARTS(STR(?g), "${a}/meta/assertion/") ||
1084
- STRSTARTS(STR(?g), "${a}/meta/_working_memory/")
1085
- )`:`STRSTARTS(STR(?g), "${a}/meta/_shared_memory/")`;return`SELECT ?s ?p ?o ?g WHERE {
1086
- GRAPH ?g {
1087
- ?catalog a <${qR}> .
1088
- ?s ?p ?o
1089
- }
1090
- FILTER(${r})
1091
- } LIMIT ${Ao}`}function QR(e){const n=`did:dkg:context-graph:${e}`;return`SELECT ?s ?p ?o ?g WHERE {
1092
- GRAPH ?g { ?s ?p ?o }
1093
- FILTER(
1094
- STRSTARTS(STR(?g), "${n}/") &&
1095
- (CONTAINS(STR(?g), "/assertion/") || CONTAINS(STR(?g), "/_working_memory/")) &&
1096
- STR(?g) != "${n}/meta" &&
1097
- !CONTAINS(STR(?g), "/meta/") &&
1098
- !STRENDS(STR(?g), "/_meta")
1099
- )
1100
- } LIMIT ${Pb}`}function XR(e){const n=`did:dkg:context-graph:${e}`;return`SELECT ?s ?p ?o ?g WHERE {
1101
- GRAPH ?g { ?s ?p ?o }
1102
- FILTER(
1103
- STRSTARTS(STR(?g), "${n}") &&
1104
- (STRENDS(STR(?g), "/_shared_memory") || CONTAINS(STR(?g), "/_shared_memory/")) &&
1105
- STR(?g) != "${n}/meta/_shared_memory" &&
1106
- !CONTAINS(STR(?g), "/meta/") &&
1107
- !CONTAINS(STR(?g), "/_shared_memory/staging/") &&
1108
- ?p != <http://dkg.io/ontology/workspaceOwner>
1109
- )
1110
- } LIMIT ${Ao}`}function ZR(e){const n=`did:dkg:context-graph:${e}`;return`SELECT ?s ?p ?o ?g WHERE {
1111
- GRAPH ?g { ?s ?p ?o }
1112
- FILTER(
1113
- STRSTARTS(STR(?g), "${n}") &&
1114
- !CONTAINS(STR(?g), "/assertion/") &&
1115
- !CONTAINS(STR(?g), "/_working_memory") &&
1116
- !CONTAINS(STR(?g), "/_shared_memory") &&
1117
- !CONTAINS(STR(?g), "_verifiable_memory_meta") &&
1118
- !STRENDS(STR(?g), "/_meta") &&
1119
- STR(?g) != "${n}/meta" &&
1120
- !CONTAINS(STR(?g), "/meta/") &&
1121
- !CONTAINS(STR(?g), "/_private") &&
1122
- !CONTAINS(STR(?g), "/_rules")
1123
- )
1124
- } LIMIT ${Ub}`}function JR(e,n){const a=`did:dkg:context-graph:${n}/`;if(!e.startsWith(a))return;const r=e.slice(a.length),o=r.indexOf("/"),s=o>=0?r.slice(0,o):r;if(!(!s||s.startsWith("_")||s==="assertion"||s==="meta"))return s}const J0={wm:"loading",swm:"loading",vm:"loading"},e4={wm:"error",swm:"error",vm:"error"};async function po(e,n,a){var r,o;try{const{layerLimit:s,...u}=a??{},d={sparql:e,contextGraphId:n,...u},p=await zc(d),f=((r=p==null?void 0:p.result)==null?void 0:r.bindings)??((o=p==null?void 0:p.results)==null?void 0:o.bindings)??[],y=typeof s=="number"&&f.length>=s;return{triples:f.map(x=>{const b=hc(x.g);return{subject:hc(x.s)??"",predicate:hc(x.p)??"",object:hc(x.o)??"",subGraph:b?JR(b,n):void 0}}).filter(x=>x.subject&&x.predicate&&x.object),ok:!0,truncated:y}}catch{return{triples:[],ok:!1,truncated:!1}}}function t4(e){var p;const n=new Map,a=new Map,r=new Map,o=new Map,s=new Map;function u(f,y,g){let x=o.get(f);x||(x=new Map,o.set(f,x));let b=x.get(y);if(b||(b=new Set,x.set(y,b)),b.has(g))return!1;b.add(g);let k=s.get(f);return k||(k={working:0,shared:0,verified:0},s.set(f,k)),k[y]++,!0}function d(f){const y=Xt(f);let g=n.get(y);return g||(g={uri:y,label:al(y),types:[],trustLevel:"working",layers:new Set,subGraphs:new Set,properties:new Map,connections:[],tripleCount:0},n.set(y,g)),g}for(const f of e){const y=d(f.subject);if(y.layers.add(f.layer),f.subGraph&&y.subGraphs.add(f.subGraph),f.predicate===X0){const g=Xt(f.object);y.types.includes(g)||y.types.push(g)}else if(jc(f.object)){const g=Xt(f.object),x=d(g);x.layers.add(f.layer),f.subGraph&&x.subGraphs.add(f.subGraph);const b=a.get(y.uri)??new Set,k=`${f.predicate}\0${g}`;b.has(k)||(b.add(k),a.set(y.uri,b),y.connections.push({predicate:f.predicate,targetUri:g,targetLabel:al(g)}))}else{const g=r.get(y.uri)??new Set,x=`${f.predicate}\0${f.object}`;if(!g.has(x)){g.add(x),r.set(y.uri,g);const b=y.properties.get(f.predicate)??[];b.push(Ib(f.object)),y.properties.set(f.predicate,b)}}}for(const f of n.values())f.label=KR(f),f.layers.has("verified")?f.trustLevel="verified":f.layers.has("shared")?f.trustLevel="shared":f.trustLevel="working";for(const f of e){const y=Xt(f.subject),g=n.get(y);if(g&&g.trustLevel!==f.layer)continue;const x=jc(f.object)?Xt(f.object):f.object,b=jc(f.object);if(b){const C=n.get(x);if(C&&C.trustLevel!==f.layer)continue}const k=`${y}\0${f.predicate}\0${x}`;if(g&&u(g.uri,f.layer,k),f.predicate===X0){if(x!==y){const C=n.get(x);C&&u(C.uri,f.layer,k)}}else if(b&&x!==y){const C=n.get(x);C&&u(C.uri,f.layer,k)}}for(const f of n.values()){const y=s.get(f.uri);f.tripleCount=y?y[f.trustLevel]:0}for(const f of n.values())for(const y of f.connections)y.targetLabel=((p=n.get(y.targetUri))==null?void 0:p.label)??al(y.targetUri);return n}const n4=t4;function a4(e){return e.types.length>0||e.properties.size>0||e.connections.length>0}function i4(e,n){const a=(n==null?void 0:n.signalErrors)??!1,r=(n==null?void 0:n.includeQueryCatalog)??!1,[o,s]=S.useState([]),[u,d]=S.useState(!0),[p,f]=S.useState(null),[y,g]=S.useState(!1),[x,b]=S.useState(J0),k=S.useRef(0),C=S.useCallback(async()=>{if(!e)return;const U=++k.current;d(!0),f(null),g(!1),b(J0);try{const _={includeContextGraphPartitions:!0},W={triples:[],ok:!0,truncated:!1},[H,L,T,F,V]=await Promise.all([po(QR(e),e,{..._,layerLimit:Pb}),po(XR(e),e,{..._,layerLimit:Ao}),po(ZR(e),e,{..._,layerLimit:Ub}),r?po(Z0(e,"wm"),e,{..._,layerLimit:Ao}):Promise.resolve(W),r?po(Z0(e,"swm"),e,{..._,layerLimit:Ao}):Promise.resolve(W)]);if(U!==k.current)return;const ie=[...H.triples.map(X=>({...X,layer:"working"})),...F.triples.map(X=>({...X,layer:"working"})),...L.triples.map(X=>({...X,layer:"shared"})),...V.triples.map(X=>({...X,layer:"shared"})),...T.triples.map(X=>({...X,layer:"verified"}))],B=H.ok&&F.ok,K=L.ok&&V.ok;s(ie),b({wm:B?"ok":"error",swm:K?"ok":"error",vm:T.ok?"ok":"error"});const P=[{ok:B,truncated:H.truncated||F.truncated},{ok:K,truncated:L.truncated||V.truncated},T],Z=P.filter(X=>!X.ok).length,ne=P.some(X=>X.truncated);g(Z>0&&Z<3||ne),f(a&&Z===3?"Failed to load memory data":null)}catch(_){U===k.current&&(f(_.message??"Failed to load memory data"),b(e4))}finally{U===k.current&&d(!1)}},[e,r,a]);tT(e,C),S.useEffect(()=>{C()},[C]);const j=S.useMemo(()=>n4(o),[o]),E=S.useMemo(()=>[...j.values()].filter(a4).sort((U,_)=>{const W={verified:0,shared:1,working:2},H=W[U.trustLevel]-W[_.trustLevel];if(H!==0)return H;const L=U.tripleCount??0,T=_.tripleCount??0;return T!==L?T-L:U.label.localeCompare(_.label)}),[j]),R=S.useMemo(()=>{const U=new Set;return o.filter(_=>{const W=`${_.subject}|${_.predicate}|${_.object}`;return U.has(W)?!1:(U.add(W),!0)}).map(({subject:_,predicate:W,object:H,subGraph:L})=>({subject:_,predicate:W,object:H,subGraph:L}))},[o]),O=S.useMemo(()=>{const U=new Map;for(const[_,W]of j)U.set(_,W.trustLevel);return U},[j]),G=S.useMemo(()=>{let U=0,_=0,W=0;for(const H of E)H.trustLevel==="verified"?W++:H.trustLevel==="shared"?_++:U++;return{wm:U,swm:_,vm:W,total:E.length}},[E]);return{entities:j,entityList:E,allTriples:o,graphTriples:R,trustMap:O,counts:G,loading:u,error:p,partial:y,layerStatus:x,refresh:C}}const $o="http://dkg.io/viz/",Bb=`${$o}OnChainAnchor`,Hb=`${$o}AgentIdentity`,$b=`${$o}anchoredIn`,qb=`${$o}signedBy`,Fb=`${$o}consensus`,e1="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",t1="http://schema.org/name",n1="http://schema.org/description";function ho(e){if(e!=null)return typeof e=="string"?e.startsWith('"')?e.replace(/^"/,"").replace(/"(\^\^<[^>]*>)?$/,""):e:typeof e=="object"&&e!==null&&"value"in e?String(e.value):String(e)}function r4(e){const n=e.opId.slice(0,10);try{const r=new Date(e.publishedAt).toISOString().slice(11,16);return`anchor ${n} · ${r}UTC`}catch{return`anchor ${n}`}}function l4(e){if(e.startsWith("did:dkg:agent:")){const n=e.slice(14);return n.startsWith("0x")?n.slice(0,6)+"…"+n.slice(-4):n.slice(0,6)+"…"+n.slice(-6)}return e.length>18?e.slice(0,8)+"…"+e.slice(-6):e}function o4(e){return`PREFIX dkg: <http://dkg.io/ontology/>
1125
- PREFIX prov: <http://www.w3.org/ns/prov#>
1126
- SELECT ?op ?root ?agent ?publishedAt ?g WHERE {
1127
- GRAPH ?g {
1128
- ?op a dkg:WorkspaceOperation ;
1129
- dkg:rootEntity ?root ;
1130
- dkg:publishedAt ?publishedAt ;
1131
- prov:wasAttributedTo ?agent .
1132
- }
1133
- FILTER(
1134
- STRSTARTS(STR(?g), "${`did:dkg:context-graph:${e}/`}") &&
1135
- CONTAINS(STR(?g), "_shared_memory_meta")
1136
- )
1137
- } ORDER BY ?publishedAt LIMIT 2000`}function s4(e,n){const a=`did:dkg:context-graph:${n}/`;if(!e.startsWith(a))return;const r=e.slice(a.length),o=r.indexOf("/");if(o<0)return;const s=r.slice(0,o);if(!(!s||s.startsWith("_")))return s}function c4(e){const n=e.lastIndexOf(":");return n>=0?e.slice(n+1):e}function u4(e,n){const a=[],r=new Set;for(const o of e){const s=n?o.roots.filter(d=>n.has(d)):o.roots;if(s.length===0)continue;const u=`urn:dkg:viz:anchor:${o.opId}`;a.push({subject:u,predicate:e1,object:Bb,subGraph:o.subGraph}),a.push({subject:u,predicate:t1,object:`"${r4(o)}"`,subGraph:o.subGraph}),a.push({subject:u,predicate:n1,object:`"Published ${o.roots.length} KA${o.roots.length===1?"":"s"} · ${new Date(o.publishedAt).toISOString()}"`,subGraph:o.subGraph});for(const d of s)a.push({subject:d,predicate:$b,object:u,subGraph:o.subGraph}),a.push({subject:d,predicate:Fb,object:`"${o.agents.length}-of-${o.agents.length}"`,subGraph:o.subGraph});for(const d of o.agents){const p=d.startsWith("did:")||d.startsWith("12D3")?d:`did:dkg:agent:${d}`,f=`urn:dkg:viz:agent:${encodeURIComponent(p)}`;a.push({subject:u,predicate:qb,object:f,subGraph:o.subGraph}),r.has(f)||(r.add(f),a.push({subject:f,predicate:e1,object:Hb,subGraph:o.subGraph}),a.push({subject:f,predicate:t1,object:`"${l4(p)}"`,subGraph:o.subGraph}),a.push({subject:f,predicate:n1,object:`"${p}"`,subGraph:o.subGraph}))}}return a}function O8(e,n){const[a,r]=S.useState([]),[o,s]=S.useState(!1),[u,d]=S.useState(null),p=S.useRef(0);S.useEffect(()=>{if(!e){r([]),s(!1);return}const x=++p.current;s(!0),d(null),(async()=>{var b;try{const k=await fetch("/api/query",{method:"POST",headers:{"Content-Type":"application/json",...Vt()},body:JSON.stringify({sparql:o4(e)})});if(!k.ok)throw new Error(`SPARQL query failed: ${k.status}`);const C=await k.json(),j=((b=C==null?void 0:C.result)==null?void 0:b.bindings)??[],E=new Map;for(const R of j){const O=ho(R.op),G=ho(R.root),U=ho(R.agent),_=ho(R.publishedAt),W=ho(R.g);if(!O||!G||!U||!_)continue;let H=E.get(O);H||(H={opId:c4(O),opUri:O,agents:[],roots:[],publishedAt:_,subGraph:W?s4(W,e):void 0},E.set(O,H)),H.roots.includes(G)||H.roots.push(G),H.agents.includes(U)||H.agents.push(U)}if(x!==p.current)return;r([...E.values()].sort((R,O)=>O.publishedAt.localeCompare(R.publishedAt)))}catch(k){if(x!==p.current)return;d((k==null?void 0:k.message)??"Failed to load anchors"),r([])}finally{x===p.current&&s(!1)}})()},[e]);const f=S.useMemo(()=>{if(!n)return null;const x=[];if(n instanceof Set)for(const b of n)x.push(b);else for(const b of n)x.push(b);return x.sort(),x.join("|")},[n]),y=S.useMemo(()=>f==null?null:new Set(f.length===0?[]:f.split("|")),[f]),g=S.useMemo(()=>u4(a,y),[a,y]);return{anchors:a,decorationTriples:g,loading:o,error:u}}function D8(e){return e.activeSubGraph?!1:e.activeLayer==="swm"}const M8={verified:"#22c55e",shared:"#f59e0b",working:"#64748b"},Xr={Person:{icon:"👤",group:"People"},SoftwareApplication:{icon:"💻",group:"Software"},SoftwareSourceCode:{icon:"📦",group:"Code"},Organization:{icon:"🏢",group:"Organizations"},Event:{icon:"📅",group:"Events"},ChooseAction:{icon:"⚡",group:"Decisions"},DefinedTerm:{icon:"📘",group:"Concepts"},CreativeWork:{icon:"📄",group:"Documents"},Product:{icon:"🪙",group:"Products"},ConversationTurn:{icon:"💬",group:"Conversations"},Thing:{icon:"◆",group:"Other"},Package:{icon:"📦",group:"Packages"},File:{icon:"📄",group:"Files"},Class:{icon:"🔷",group:"Classes"},Interface:{icon:"🔶",group:"Interfaces"},Function:{icon:"ƒ",group:"Functions"},TypeAlias:{icon:"🏷️",group:"Types"},Enum:{icon:"🔢",group:"Enums"},ExternalModule:{icon:"🌐",group:"External Modules"}},d4="http://www.w3.org/ns/prov#wasAttributedTo",hl="http://dkg.io/ontology/agent/",f4=hl+"createdBy",p4=hl+"promotedBy",h4=hl+"publishedBy",m4=hl+"createdAt",g4=hl+"promotedAt",y4=hl+"publishedAt";function v4(e){for(const n of e.connections)if(n.predicate===d4)return n.targetUri;return null}function L8(e,n){const a=n==="created"?f4:n==="promoted"?p4:h4;for(const r of e.connections)if(r.predicate===a)return r.targetUri;return v4(e)}function z8(e,n){const a=n==="created"?m4:n==="promoted"?g4:y4,r=e.properties.get(a);return(r==null?void 0:r[0])??null}function a1(e){const n=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=Math.max(n,a);return r>=0?e.slice(r+1):e}function I8(e){const n=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=Math.max(n,a);return(r>=0?e.slice(r+1):e).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ")}function P8(e,n){var o,s;if(n)for(const u of e.types){const d=n.forType(u),p=a1(u),f=d.label??p;if(d.icon||d.color||d.label)return{icon:d.icon??((o=Xr[p])==null?void 0:o.icon)??Xr.Thing.icon,group:d.label??((s=Xr[p])==null?void 0:s.group)??Xr.Thing.group,color:d.color,type:f}}const a=e.types[0]?a1(e.types[0]):"Entity";return{...Xr[a]??Xr.Thing,type:a}}const Gb={wm:{icon:"◇",color:"#64748b",title:"Working Memory",desc:"Private agent scratchpad — ephemeral, fast local storage",trustLabel:"Working",trustLevel:"working"},swm:{icon:"◈",color:"#f59e0b",title:"Shared Working Memory",desc:"Team workspace — shared proposals, TTL-bounded",trustLabel:"Shared",trustLevel:"shared"},vm:{icon:"◉",color:"#22c55e",title:"Verifiable Memory",desc:"Endorsed, published, on-chain knowledge",trustLabel:"Verifiable",trustLevel:"verified"}};function U8(e,n=2){const a=e==="working"?"wm":e==="shared"?"swm":e==="verified"?"vm":e,r=n!==1;return a==="vm"?r?"Knowledge Assets":"Knowledge Asset":r?"Entities":"Entity"}const jn="http://dkg.io/ontology/code/",x4={[jn+"Package"]:"#a855f7",[jn+"File"]:"#3b82f6",[jn+"Class"]:"#22c55e",[jn+"Interface"]:"#06b6d4",[jn+"Function"]:"#f59e0b",[jn+"TypeAlias"]:"#ec4899",[jn+"Enum"]:"#ef4444",[jn+"ExternalModule"]:"#64748b",[Bb]:"#f5a524",[Hb]:"#c084fc"},b4={[jn+"imports"]:"#60a5fa",[jn+"contains"]:"#a855f7",[jn+"definedIn"]:"#3b82f6",[jn+"exports"]:"#f59e0b",[jn+"extends"]:"#22c55e",[jn+"implements"]:"#06b6d4",[$b]:"#f5a524",[qb]:"#c084fc",[Fb]:"#22c55e"};function w4(e){return{"https://schema.org/":e,"http://www.w3.org/ns/prov#":e,"http://xmlns.com/foaf/0.1/":e,"http://purl.org/dc/terms/":e}}function B8(e,n){const{color:a}=Gb[e],r=e==="vm";return{labelMode:"humanized",renderer:"2d",labels:$R({minZoomForLabels:r?.2:.3}),style:{classColors:x4,predicateColors:b4,namespaceColors:w4(a),...n&&Object.keys(n).length>0?{nodeColors:n}:{},defaultNodeColor:a,defaultEdgeColor:r?"#4ade80":"#64748b",edgeWidth:r?1.8:1.2,fontSize:r?12:11,gradient:!0,gradientIntensity:r?.65:.4},hexagon:{baseSize:r?13:11,minSize:r?8:7,maxSize:r?42:28,scaleWithDegree:!0},focus:{maxNodes:3e3,hops:999}}}function H8(e){const n=["http://schema.org/description","http://schema.org/text"];for(const a of n){const r=e.properties.get(a);if(r!=null&&r[0])return r[0]}return null}function $8(e,n,a=2){const r=d=>Xt(d.subject),o=d=>Xt(d.object),s=new Set([e]);let u=new Set([e]);for(let d=0;d<a;d++){const p=new Set;for(const f of n){const y=r(f),g=o(f);u.has(y)&&!s.has(g)&&p.add(g),u.has(g)&&!s.has(y)&&p.add(y)}for(const f of p)s.add(f);if(u=p,u.size===0)break}return n.filter(d=>s.has(r(d))&&s.has(o(d)))}function q8(e,n){const a=n.lastIndexOf("/"),r=n.lastIndexOf("#"),o=n.lastIndexOf(":"),s=Math.max(a,r,o),u=s>=0?n.slice(s+1):n,d=(()=>{try{return decodeURIComponent(u)}catch{return u}})();if(/^urn:dkg:extraction:[^\s]+$/i.test(n)){const p=d.replace(/-/g,"").replace(/_+/g," ").slice(0,12).trim();return p?`Extraction ${p}`:"Extraction"}return d||n}function Dh(e){const n=e.trim();return!n||n.startsWith('"')?!1:n.startsWith("_:")||n.startsWith("<")&&n.endsWith(">")?!0:/\s/.test(n)?!1:/^[A-Za-z][A-Za-z0-9+.-]*:/.test(n)}function F8(e,n){return!n.isRoot&&e.subGraph===n.slug?!0:e.subGraph?!1:n.scopedUris.has(e.subject)?!0:n.requireResourceObject?Dh(e.object)&&n.scopedUris.has(e.object):n.scopedUris.has(e.object)}function Vb(e,n){const a=n.get(Xt(e.subject));return a!==void 0&&a.trustLevel!==e.layer}function Wb(e,n){if(!Dh(e.object))return!1;const a=n.get(Xt(e.object));return a!==void 0&&a.trustLevel!==e.layer}function Yb(e,n){return Vb(e,n)||Wb(e,n)}function Kb(e,n){return Vb(e,n)&&Wb(e,n)}function S4(e,n){const a=new Set,r=[];for(const o of e){if(Kb(o,n))continue;const s=`${Xt(o.subject)}|${o.predicate}|${Xt(o.object)}`;a.has(s)||(a.add(s),r.push(o))}return r}function G8(e){return S.useMemo(()=>{const n=S4(e.allTriples,e.entities);return{triples:n,total:n.length}},[e.allTriples,e.entities])}function k4(e){return S.useMemo(()=>{const n=new Set,a=new Set,r=new Set,o=new Set;let s=0,u=0,d=0,p=0;for(const f of e.allTriples){const y=`${Xt(f.subject)}|${f.predicate}|${Xt(f.object)}`;!Kb(f,e.entities)&&!o.has(y)&&(o.add(y),p++),Yb(f,e.entities)||(f.layer==="working"&&!n.has(y)?(n.add(y),s++):f.layer==="shared"&&!a.has(y)?(a.add(y),u++):f.layer==="verified"&&!r.has(y)&&(r.add(y),d++))}return{wm:s,swm:u,vm:d,canonical:p}},[e.allTriples,e.entities])}function V8(e,n){const a=Gb[n].trustLevel;return S.useMemo(()=>{const r=new Set,o=[];for(const s of e.allTriples){if(s.layer!==a||Yb(s,e.entities))continue;const u=`${Xt(s.subject)}|${s.predicate}|${Xt(s.object)}`;r.has(u)||(r.add(u),o.push(s))}return o},[e.allTriples,e.entities,a])}const C4="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function E4(e){const n=e.trim();return(n.startsWith("<")&&n.endsWith(">")?n.slice(1,-1):n)===C4}function W8(e,n,a){const r=[],o=a==null?void 0:a.focalSubjects;for(const s of e){const u=Xt(s.subject);!n.has(u)&&!(o!=null&&o.has(u))||Dh(s.object)&&!E4(s.predicate)&&!n.has(Xt(s.object))||r.push(s)}return r}const Y8="http://dkg.io/ontology/sourceContentType",K8="http://dkg.io/ontology/markdownForm",Q8="http://dkg.io/ontology/sourceFile",X8="http://dkg.io/ontology/size";function Z8(e){const n=e.replace(/^"|"$/g,"").replace(/^"(.+)"(?:@\w+|\^\^.+)?$/,"$1"),a=new Date(n);return Number.isFinite(a.getTime())?a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):n}function J8(e){const[n,a]=e.split("-"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o=Math.max(0,Math.min(11,parseInt(a,10)-1));return`${r[o]} ${n}`}function e9(e,n){const a=e.properties.get(n),r=a==null?void 0:a[0];if(!r)return null;const o=r.replace(/^"|"$/g,"").replace(/^"(.+)"(?:@\w+|\^\^.+)?$/,"$1"),s=Date.parse(o);return Number.isNaN(s)?null:s}function t9(e){const n=Date.now()-e;if(n<0)return"just now";const a=Math.floor(n/1e3);if(a<45)return"just now";const r=Math.floor(a/60);if(r<60)return`${r}m ago`;const o=Math.floor(r/60);if(o<24)return`${o}h ago`;const s=Math.floor(o/24);return s<30?`${s}d ago`:new Date(e).toISOString().slice(0,10)}function A4(e,n=6){if(e==null||e==="")return"—";const a=typeof e=="number"?e:parseFloat(String(e));if(!Number.isFinite(a))return"—";if(a===0)return"0";const o=a.toFixed(n).replace(/\.?0+$/,"");return a>0&&Number(o)===0?`< ${1/Math.pow(10,n)}`:o}function j4(e){if(!(e==null||e===""))return`Exact balance: ${e} (full precision from chain)`}function T4(e){if(e==null)return"—";const n=e/100;return`${n%1===0?n.toFixed(0):n.toFixed(1)}%`}function N4(){Ab();const e=yh(s=>{var u;return(u=s.nodeStatus)==null?void 0:u.nodeRole}),n=mn(s=>s.openTab),{covered:a,bestCoveringDiscountBps:r,walletsInconclusive:o}=Eb();return m.jsxs("div",{className:"v10-ws-pca",children:[m.jsx("span",{className:"v10-ws-pca-label",children:"Publishing discount"}),m.jsx("span",{className:"v10-ws-pca-value","data-covered":a,children:o?"Couldn’t verify your wallets — retry":a?`${T4(r)} discount`:"None — publishing at the direct cost"}),m.jsxs("button",{type:"button",className:"v10-ws-pca-cta",onClick:()=>n({id:"conviction",label:"Publisher Conviction",closable:!0}),children:[e==="edge"?"Get added to a PCA":"Set up PCA"," ->"]})]})}const R4="Context graphs you created or joined — scoped knowledge domains with configurable access (private, curated and peer-shared, or public) where agents build and collaborate on shared context with verifiable provenance.",Bp=[{key:"wm",label:"Working Memory",short:"WM",color:"var(--layer-working)",desc:"Private agent drafts — free, self-attested, persists locally."},{key:"swm",label:"Shared Working Memory",short:"SWM",color:"var(--layer-shared)",desc:"Team proposals — free, gossip-replicated across context-graph peers."},{key:"vm",label:"Verifiable Memory",short:"VM",color:"var(--layer-verified)",desc:"On-chain knowledge — permanent, verifiable, requires TRAC to publish."}],mc={1:"Ethereum",8453:"Base",84532:"Base Sepolia",100:"Gnosis",10200:"Chiado",2043:"NeuroWeb",20430:"NeuroWeb Testnet"};function Zf(e){var o;const n=Tb(e);if(e==null)return{name:"Unknown chain",gas:n};const a=String(e);if(mc[a])return{name:mc[a],gas:n};const r=(o=a.match(/(\d+)\s*$/))==null?void 0:o[1];return r&&mc[r]?{name:mc[r],gas:n}:{name:r?`Chain ${r}`:`Chain ${a}`,gas:n}}function mo(e){return e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`.replace(".0",""):`${(e/1e6).toFixed(1)}M`.replace(".0","")}function Jf({label:e,value:n,sub:a,accentColor:r,children:o,icon:s,className:u}){return m.jsxs("div",{className:`stat-card v10-anim-mount${u?` ${u}`:""}`,children:[r&&m.jsx("div",{className:"accent",style:{background:r}}),m.jsxs("div",{className:"stat-label",children:[s,e]}),n!=null&&n!==""&&m.jsx("div",{className:"stat-value",children:n}),o,a!=null&&a!==""&&m.jsx("div",{className:"stat-sub",children:a})]})}function i1({counts:e}){const n=e.wm+e.swm+e.vm,a=Bp.map(r=>`${r.short} ${e[r.key]}`).join(" · ");return m.jsx("div",{className:"v10-layerbar","aria-label":a,children:n===0?m.jsx("span",{className:"v10-layerbar-empty"}):Bp.map(r=>{const o=e[r.key]/n*100;return o<=0?null:m.jsx("span",{className:"v10-layerbar-seg",title:`${r.label} (${e[r.key]}) — ${r.desc}`,style:{width:`${o}%`,background:r.color}},r.key)})})}function _4(){return m.jsx("div",{className:"v10-layer-legend",children:Bp.map(e=>m.jsxs("span",{className:"v10-layer-legend-item",title:`${e.label} — ${e.desc}`,children:[m.jsx("span",{className:"v10-layer-legend-dot",style:{background:e.color}}),e.short]},e.key))})}function O4({curator:e,joined:n,refreshing:a}){const r=e+n,o=`Curator ${e} · Joined ${n}`,s="var(--accent-green)",u="var(--text-secondary)";return m.jsxs("div",{className:`v10-cg-rolesplit${a?" is-refreshing":""}`,title:a?"Refreshing — agent identity is being re-checked":void 0,"aria-busy":a||void 0,children:[m.jsx("div",{className:"v10-layerbar","aria-label":o,children:r===0?m.jsx("span",{className:"v10-layerbar-empty"}):m.jsxs(m.Fragment,{children:[e>0&&m.jsx("span",{className:"v10-layerbar-seg",title:`Curator (${e}) — context graphs you created and curate`,style:{width:`${e/r*100}%`,background:s}}),n>0&&m.jsx("span",{className:"v10-layerbar-seg",title:`Joined (${n}) — context graphs you joined as a member`,style:{width:`${n/r*100}%`,background:u}})]})}),m.jsxs("div",{className:"v10-layer-legend",children:[m.jsxs("span",{className:"v10-layer-legend-item",title:"Curator — context graphs you created and curate",children:[m.jsx("span",{className:"v10-layer-legend-dot",style:{background:s}}),"Curator ",e]}),m.jsxs("span",{className:"v10-layer-legend-item",title:"Joined — context graphs you joined as a member",children:[m.jsx("span",{className:"v10-layer-legend-dot",style:{background:u}}),"Joined ",n]})]})]})}function D4({cg:e,identity:n,onReport:a,onOpen:r}){var W,H;const o=i4(e.id,{signalErrors:!0}),[s,u]=S.useState(null),[d,p]=S.useState(!1),f=s===null&&!d,y=S.useRef(!0),g=S.useRef(0),x=S.useCallback(()=>{const L=++g.current;Bn.listParticipants(e.id).then(T=>{y.current&&L===g.current&&(u((T.allowedAgents??[]).map(Mi)),p(!1))}).catch(()=>{y.current&&L===g.current&&(u(null),p(!0))})},[e.id]);S.useEffect(()=>{y.current=!0,u(null),p(!1),x();const L=setInterval(x,3e4);return()=>{y.current=!1,clearInterval(L)}},[x]),pl(S.useCallback(L=>{var F,V;if(L.type!=="join_approved"&&L.type!=="join_rejected"&&L.type!=="project_synced")return;const T=((F=L.data)==null?void 0:F.contextGraphId)??((V=L.data)==null?void 0:V.projectId);T&&T!==e.id||x()},[e.id,x]));const b=qc(e.accessPolicy)==="public",k=S.useMemo(()=>{var V;if(b)return null;const L=(V=e.curator)==null?void 0:V.trim(),T=L?Mi(L):null;if(s===null)return d&&T?[T]:null;const F=new Set(s);return T&&F.add(T),[...F]},[s,d,e.curator,b]),C=Number.isFinite(e.assetCount??e.assets)?e.assetCount??e.assets:0,j=S.useMemo(()=>{if(o.error)return{wm:0,swm:0,vm:0,total:C};const L=new Set(o.allTriples.map(T=>T.subject)).size;return{wm:o.counts.wm,swm:o.counts.swm,vm:o.counts.vm,total:L}},[o.error,o.allTriples,o.counts.wm,o.counts.swm,o.counts.vm,C]),E=k4(o),R=S.useMemo(()=>({wm:E.wm,swm:E.swm,vm:E.vm,total:E.canonical}),[E]),O=[o.loading?1:0,o.error?1:0,o.partial?1:0,f?1:0,d?1:0,b?1:0,j.wm,j.swm,j.vm,j.total,R.wm,R.swm,R.vm,R.total,k?k.slice().sort().join(","):"∅"].join("|");S.useEffect(()=>{a(e.id,{entities:j,triples:R,agents:k??[],sizeLoading:o.loading,sizeError:!!o.error||o.partial,sizeFallback:!!o.error,agentsLoading:f,agentsError:d,agentsUnknown:b,sig:O})},[e.id,O]);const G=qc(e.accessPolicy),U=G==="private"?"Curated":G==="public"?"Public":"Unknown",_=!!((W=e.curator)!=null&&W.trim()&&((H=n==null?void 0:n.agentDid)!=null&&H.trim())&&Mi(e.curator)===Mi(n.agentDid));return m.jsxs("button",{className:"v10-cg-row",onClick:()=>r(e),children:[m.jsx("span",{className:"v10-cg-cell v10-cg-name",children:e.name||e.id.slice(0,16)}),m.jsx("span",{className:"v10-cg-cell v10-cg-type",title:`${U} context graph`,"aria-label":`${U} context graph`,children:G==="private"?m.jsx(QT,{size:13,"aria-hidden":"true"}):G==="public"?m.jsx(VT,{size:13,"aria-hidden":"true"}):m.jsx("span",{className:"v10-cg-dim",children:"—"})}),m.jsx("span",{className:"v10-cg-cell v10-cg-size",children:o.loading?m.jsx("span",{className:"v10-stat-loading",children:"loading…"}):o.error?m.jsxs("span",{title:"Live entity count unavailable — showing the published Knowledge-Asset summary, not the full WM/SWM/VM entity total",children:[mo(j.total)," ",m.jsx("span",{className:"v10-cg-dim",children:"KA (summary)"})," · ",m.jsx("span",{className:"v10-cg-dim",children:"— triples"})]}):o.partial?m.jsxs("span",{title:"Partial — one or more memory layers were unavailable; counts are a lower bound",children:["~",mo(j.total)," ",m.jsx("span",{className:"v10-cg-dim",children:"entities"})," · ~",mo(R.total)," ",m.jsx("span",{className:"v10-cg-dim",children:"triples"})]}):m.jsxs(m.Fragment,{children:[mo(j.total)," ",m.jsx("span",{className:"v10-cg-dim",children:"entities"})," · ",mo(R.total)," ",m.jsx("span",{className:"v10-cg-dim",children:"triples"})]})}),m.jsx("span",{className:"v10-cg-cell v10-cg-agents",children:k===null?m.jsx("span",{className:"v10-cg-dim",children:"—"}):d?m.jsxs("span",{title:"Participant list unavailable — curator-only lower bound",children:["~",k.length]}):k.length}),m.jsx("span",{className:"v10-cg-cell v10-cg-role",children:m.jsx("span",{className:`v10-cg-badge v10-cg-badge-${_?"curator":"joined"}`,children:_?"CURATOR":"JOINED"})})]})}const r1={wm:0,swm:0,vm:0,total:0};function M4(){var _,W;const{data:e}=Xf(Bn.fetchStatus,[],1e4),{data:n}=Xf(Bn.fetchEconomics,[],6e4),{data:a,loading:r,error:o}=Xf(Bn.fetchWalletsBalances,[],3e4),{openTab:s}=mn(),{setActiveProject:u}=ca(),{myCgs:d,identity:p,identityLoading:f,cgsLoading:y}=HR(),g=(f||y)&&d.length===0,[x,b]=S.useState({}),k=S.useCallback((H,L)=>{b(T=>{var F;return((F=T[H])==null?void 0:F.sig)===L.sig?T:{...T,[H]:L}})},[]);S.useEffect(()=>{const H=new Set(d.map(L=>L.id));b(L=>{const T=Object.keys(L);if(T.every(V=>H.has(V)))return L;const F={};for(const V of T)H.has(V)&&(F[V]=L[V]);return F})},[d]);const C=S.useMemo(()=>{const H={...r1},L={...r1},T=new Set;let F=!1,V=!1,ie=!1,B=!1,K=!1;for(const Z of d){const ne=x[Z.id];if(!ne){F=!0,V=!0;continue}ne.sizeLoading&&(F=!0),ne.agentsLoading&&(V=!0),ne.sizeError&&(ie=!0),ne.sizeFallback&&(K=!0),(ne.agentsError||ne.agentsUnknown)&&(B=!0);for(const X of["wm","swm","vm","total"])H[X]+=ne.entities[X],L[X]+=ne.triples[X];for(const X of ne.agents)T.add(X)}const P=d.length>0;return{entities:H,triples:L,agentCount:T.size,sizeLoading:P&&F,agentsLoading:P&&V,sizePartial:ie,agentsPartial:B,triplesUnknown:P&&ie&&L.total===0,sizeApprox:P&&K,hasCgs:P}},[d,x]),j=S.useMemo(()=>{var F,V;const H=(F=p==null?void 0:p.agentDid)!=null&&F.trim()?Mi(p.agentDid):null;let L=0,T=0;for(const ie of d)!!(H&&((V=ie.curator)!=null&&V.trim())&&Mi(ie.curator)===H)?L++:T++;return{curator:L,joined:T}},[d,p]),E=[{label:"24h",display:"Last 24h"},{label:"7d",display:"Last 7d"},{label:"30d",display:"Last 30d"}],R=H=>{if(H==null||typeof H=="string"&&H.trim()==="")return"—";const L=Number(H);return isFinite(L)?L.toLocaleString(void 0,{maximumFractionDigits:L>=1e3?0:2}):String(H)},O=E.map(H=>{var T;const L=(T=n==null?void 0:n.periods)==null?void 0:T.find(F=>F.label===H.label);return{display:H.display,publishes:L?String(L.publishCount):"—",trac:L?R(L.totalTrac):"—"}});a!=null&&a.symbol;const G=(a==null?void 0:a.balances)??[],U=H=>H.length>12?`${H.slice(0,6)}…${H.slice(-4)}`:H;return m.jsxs("div",{className:"v10-dashboard",children:[m.jsxs("div",{className:"v10-dash-header",children:[m.jsx("h1",{className:"v10-dash-title",children:"Dashboard"}),m.jsxs("p",{className:"v10-dash-subtitle",children:[(e==null?void 0:e.name)||"DKG Node"," · ",(e==null?void 0:e.networkName)||"network",(a==null?void 0:a.chainId)!=null?` · ${Zf(a.chainId).name}`:""]})]}),m.jsxs("div",{className:"v10-dash-stats v10-dash-stats-3",children:[m.jsx(Jf,{label:"My Context Graphs",className:"v10-stat-tight",icon:m.jsx(R0,{size:13,"aria-hidden":!0}),value:g?m.jsx("span",{className:"v10-stat-loading",children:"loading…"}):d.length,accentColor:"var(--accent-blue)",sub:R4,children:C.hasCgs&&!g?m.jsx(O4,{curator:j.curator,joined:j.joined,refreshing:f}):null}),m.jsxs(Jf,{label:"Context Graph Size",icon:m.jsx(aN,{size:13,"aria-hidden":!0}),className:"v10-stat-tight",accentColor:"var(--accent-green)",children:[C.hasCgs?C.sizeLoading?m.jsx("div",{className:"v10-stat-loading",children:"loading…"}):m.jsxs("div",{className:"v10-cg-size-detail",children:[m.jsxs("div",{className:"v10-cg-size-metric",children:[m.jsxs("div",{className:"v10-cg-size-num",children:[m.jsxs("span",{className:"v10-cg-size-big",children:[C.sizeApprox&&!C.triplesUnknown?"~":"",C.entities.total.toLocaleString()]}),C.triplesUnknown?m.jsx("span",{className:"v10-cg-dim",title:"Live entity count unavailable — showing the published Knowledge-Asset summary (not the full WM/SWM/VM entity total)",children:"Knowledge Assets (summary)"}):C.sizeApprox?m.jsx("span",{className:"v10-cg-dim",title:"Some context graphs reported only their Knowledge-Asset summary — this total mixes summary and live counts and is approximate",children:"entities / KA · approx."}):m.jsx("span",{className:"v10-cg-dim",children:"entities / Knowledge Assets"})]}),C.triplesUnknown||C.sizeApprox?null:m.jsx(i1,{counts:C.entities})]}),m.jsxs("div",{className:"v10-cg-size-metric",children:[m.jsxs("div",{className:"v10-cg-size-num",children:[m.jsx("span",{className:"v10-cg-size-big",children:C.triplesUnknown?"—":`${C.sizeApprox?"~":""}${C.triples.total.toLocaleString()}`}),m.jsx("span",{className:"v10-cg-dim",children:"triples"})]}),C.triplesUnknown||C.sizeApprox?null:m.jsx(i1,{counts:C.triples})]}),m.jsx(_4,{})]}):m.jsx("div",{className:"v10-stat-empty",children:"—"}),m.jsx("div",{className:"stat-sub",children:C.hasCgs?C.sizePartial?"Some context graphs could not report size; total is partial.":"Totals across all your context graphs, summed over Working, Shared Working & Verifiable Memory. Knowledge Assets are entities that have been published to Verifiable Memory.":"No context graphs yet."})]}),m.jsx(Jf,{label:"Collaborating Agents",icon:m.jsx(oN,{size:13,"aria-hidden":!0}),value:C.hasCgs?C.agentsLoading?m.jsx("span",{className:"v10-stat-loading",children:"loading…"}):C.agentsPartial?`~${C.agentCount}`:C.agentCount:m.jsx("span",{className:"v10-stat-empty",children:"—"}),sub:C.hasCgs?C.agentsPartial?"Some context graphs could not report agents; count is partial.":"Unique agents — your own and others' — allow-listed and collaborating across your context graphs.":"No context graphs yet.",accentColor:"var(--purple)"})]}),m.jsxs("div",{className:"v10-dash-grid v10-dash-grid-2",children:[m.jsxs("div",{className:"v10-dash-section v10-dash-section-wide v10-anim-mount",children:[m.jsxs("div",{className:"v10-dash-section-header",children:[m.jsxs("div",{className:"v10-dash-section-title",children:[m.jsx(R0,{size:13,"aria-hidden":!0}),m.jsx("h3",{children:"My Context Graphs"})]}),m.jsx("span",{className:"v10-dash-section-badge",children:d.length})]}),g?m.jsx("p",{className:"v10-cg-empty",children:"Loading context graphs…"}):d.length===0?m.jsx("p",{className:"v10-cg-empty",children:"No context graphs yet — create or join one from the sidebar."}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"v10-cg-colhead",children:[m.jsx("span",{className:"v10-cg-cell v10-cg-name",children:"Name"}),m.jsx("span",{className:"v10-cg-cell v10-cg-type",children:"Type"}),m.jsx("span",{className:"v10-cg-cell v10-cg-size",children:"Size"}),m.jsx("span",{className:"v10-cg-cell v10-cg-agents",title:"Agents allow-listed with access to this context graph",children:"Agents"}),m.jsx("span",{className:"v10-cg-cell v10-cg-role",children:"Role"})]}),m.jsx("div",{className:"v10-cg-list",children:d.map(H=>m.jsx(D4,{cg:H,identity:p,onReport:k,onOpen:L=>{u(L.id),s({id:`project:${L.id}`,label:L.name||L.id.slice(0,12),closable:!0})}},H.id))})]})]}),m.jsxs("div",{className:"v10-dash-section v10-anim-mount",children:[m.jsx("div",{className:"v10-dash-section-header",children:m.jsxs("div",{className:"v10-dash-section-title",children:[m.jsx(cN,{size:13,"aria-hidden":!0}),m.jsx("h3",{children:"Wallets and Spending"})]})}),(a==null?void 0:a.chainId)!=null?m.jsxs("div",{className:"v10-ws-chain-row",children:[m.jsx("span",{className:"v10-ws-chain-label",children:"Chain"}),m.jsx("span",{className:"v10-ws-chain-value",children:Zf(a.chainId).name})]}):null,m.jsx("div",{className:"v10-ws-subhead",children:"Node wallets"}),r&&!a?m.jsx("p",{className:"v10-cg-empty",children:"Loading wallets…"}):G.length>0?m.jsxs("div",{className:"v10-ws-wtable",children:[m.jsxs("div",{className:"v10-ws-wrow v10-ws-whead",children:[m.jsx("span",{children:"Wallet"}),m.jsx("span",{children:"TRAC"}),m.jsxs("span",{children:["Gas (",Zf(a==null?void 0:a.chainId).gas,")"]})]}),G.map(H=>m.jsxs("div",{className:"v10-ws-wrow",children:[m.jsx("span",{className:"v10-ws-addr",title:H.address,children:U(H.address)}),m.jsx("span",{className:"v10-ws-bal",children:R(H.trac)}),m.jsx("span",{className:"v10-ws-bal-sec",title:j4(H.eth),children:A4(H.eth)})]},H.address))]}):(((_=a==null?void 0:a.wallets)==null?void 0:_.length)??0)>0?m.jsx("ul",{className:"v10-ws-wallets",children:((a==null?void 0:a.wallets)??[]).map(H=>m.jsxs("li",{className:"v10-ws-wallet",children:[m.jsx("span",{className:"v10-ws-addr",title:H,children:U(H)}),m.jsx("span",{className:"v10-cg-dim",children:"—"})]},H))}):a!=null&&a.error||o?m.jsx("p",{className:"v10-cg-empty",children:"Wallet balances unavailable."}):m.jsx("p",{className:"v10-cg-empty",children:"No node wallets found."}),(a!=null&&a.error||o)&&(G.length>0||(((W=a==null?void 0:a.wallets)==null?void 0:W.length)??0)>0)?m.jsx("p",{className:"v10-ws-note",children:"Balances may be stale — the chain/RPC reported an error."}):null,m.jsx("div",{className:"v10-ws-subhead",children:"Spending"}),m.jsxs("div",{className:"v10-ws-spend",children:[m.jsxs("div",{className:"v10-ws-spend-head",children:[m.jsx("span",{children:"Period"}),m.jsx("span",{title:"Publishes to Verifiable Memory that spent TRAC on-chain. Free SWM/local/testnet publishes are not counted (they don't burn TRAC).",children:"Publishes to VM"}),m.jsx("span",{children:"TRAC"})]}),O.map(H=>m.jsxs("div",{className:"v10-ws-spend-row",children:[m.jsx("span",{className:"v10-cg-dim",children:H.display}),m.jsx("span",{className:"v10-ws-spend-val",children:H.publishes}),m.jsx("span",{className:"v10-ws-spend-val",children:H.trac})]},H.display))]}),m.jsx(N4,{})]})]})]})}const Mh="context-graph-primer",L4={id:Mh,label:"What is a Context Graph?",closable:!0},z4=[{title:"Memory layers",body:"Working Memory is private staging, Shared Working Memory is the collaborative review layer, and Verifiable Memory is the published on-chain layer. Counts show where entities live now."},{title:"Subgraphs",body:"Subgraphs organize the same Context Graph by topic or source. They cut across memory layers, so a subgraph can contain Working, Shared Working, and Verifiable Memory at the same time."},{title:"Entities and Knowledge Assets",body:"Working Memory and Shared Working Memory contain entities. When published, an assertion/triple bundle is anchored as a Knowledge Asset in Verifiable Memory, giving included entities on-chain provenance."},{title:"Assertions",body:"Assertions are batches of triples that explain how entities entered or moved through the Context Graph. They are useful for reviewing provenance and lifecycle state."},{title:"Roles",body:"A curator controls access and publication policy. A participant can collaborate inside the Context Graph according to that policy."}];function I4(){const e=mn(a=>a.closeTab),n=hn.useCallback(()=>e(Mh),[e]);return hn.useEffect(()=>{const a=r=>{r.key==="Escape"&&(r.preventDefault(),n())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n]),m.jsxs("div",{className:"v10-primer-view",children:[m.jsxs("header",{className:"v10-primer-header",children:[m.jsx("button",{type:"button",className:"v10-primer-back",onClick:n,"aria-label":"Close primer and return to the previous tab",children:"← Back"}),m.jsx("p",{className:"v10-primer-kicker",children:"Context Graph Primer"}),m.jsx("h1",{children:"What is a Context Graph?"}),m.jsx("p",{children:"A Context Graph is a shared knowledge workspace where agents stage, review, organize, and publish structured memory."})]}),m.jsxs("section",{className:"v10-primer-pipeline","aria-label":"Context Graph pipeline",children:[m.jsx("span",{className:"wm",children:"Working Memory"}),m.jsx("span",{className:"connector","aria-hidden":"true"}),m.jsx("span",{className:"swm",children:"Shared Working Memory"}),m.jsx("span",{className:"connector","aria-hidden":"true"}),m.jsx("span",{className:"vm",children:"Verifiable Memory"})]}),m.jsx("div",{className:"v10-primer-sections",children:z4.map(a=>m.jsxs("section",{className:"v10-primer-section",children:[m.jsx("h2",{children:a.title}),m.jsx("p",{children:a.body})]},a.title))})]})}const Lh="doc:";function n9(e,n,a){return`${Lh}${e}|${n}|${a}`}function a9(e,n,a){return e?{ref:e,contentType:"text/markdown"}:n?{ref:n,contentType:a}:{ref:void 0,contentType:a}}function P4(e){const n=e.slice(Lh.length),a=n.indexOf("|"),r=n.lastIndexOf("|");return a<0?{docRef:n,contentType:""}:{docRef:n.slice(a+1,r),contentType:n.slice(r+1)}}function U4(e,n){const a=n||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const B4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,H4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$4={};function l1(e,n){return($4.jsx?H4:B4).test(e)}const q4=/[ \t\n\f\r]/g;function F4(e){return typeof e=="object"?e.type==="text"?o1(e.value):!1:o1(e)}function o1(e){return e.replace(q4,"")===""}class qo{constructor(n,a,r){this.normal=a,this.property=n,r&&(this.space=r)}}qo.prototype.normal={};qo.prototype.property={};qo.prototype.space=void 0;function Qb(e,n){const a={},r={};for(const o of e)Object.assign(a,o.property),Object.assign(r,o.normal);return new qo(a,r,n)}function Hp(e){return e.toLowerCase()}class Tn{constructor(n,a){this.attribute=a,this.property=n}}Tn.prototype.attribute="";Tn.prototype.booleanish=!1;Tn.prototype.boolean=!1;Tn.prototype.commaOrSpaceSeparated=!1;Tn.prototype.commaSeparated=!1;Tn.prototype.defined=!1;Tn.prototype.mustUseProperty=!1;Tn.prototype.number=!1;Tn.prototype.overloadedBoolean=!1;Tn.prototype.property="";Tn.prototype.spaceSeparated=!1;Tn.prototype.space=void 0;let G4=0;const Ie=dr(),Ut=dr(),$p=dr(),de=dr(),vt=dr(),il=dr(),Un=dr();function dr(){return 2**++G4}const qp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Ut,commaOrSpaceSeparated:Un,commaSeparated:il,number:de,overloadedBoolean:$p,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),ep=Object.keys(qp);class zh extends Tn{constructor(n,a,r,o){let s=-1;if(super(n,a),s1(this,"space",o),typeof r=="number")for(;++s<ep.length;){const u=ep[s];s1(this,ep[s],(r&qp[u])===qp[u])}}}zh.prototype.defined=!0;function s1(e,n,a){a&&(e[n]=a)}function ml(e){const n={},a={};for(const[r,o]of Object.entries(e.properties)){const s=new zh(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),n[r]=s,a[Hp(r)]=r,a[Hp(s.attribute)]=r}return new qo(n,a,e.space)}const Xb=ml({properties:{ariaActiveDescendant:null,ariaAtomic:Ut,ariaAutoComplete:null,ariaBusy:Ut,ariaChecked:Ut,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:Ut,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:Ut,ariaFlowTo:vt,ariaGrabbed:Ut,ariaHasPopup:null,ariaHidden:Ut,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:de,ariaLive:null,ariaModal:Ut,ariaMultiLine:Ut,ariaMultiSelectable:Ut,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:Ut,ariaReadOnly:Ut,ariaRelevant:null,ariaRequired:Ut,ariaRoleDescription:vt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:Ut,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Zb(e,n){return n in e?e[n]:n}function Jb(e,n){return Zb(e,n.toLowerCase())}const V4=ml({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:il,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:vt,autoFocus:Ie,autoPlay:Ie,blocking:vt,capture:null,charSet:null,checked:Ie,cite:null,className:vt,cols:de,colSpan:null,content:null,contentEditable:Ut,controls:Ie,controlsList:vt,coords:de|il,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:$p,draggable:Ut,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:vt,height:de,hidden:$p,high:de,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:vt,itemRef:vt,itemScope:Ie,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:de,pattern:null,ping:vt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:vt,required:Ie,reversed:Ie,rows:de,rowSpan:de,sandbox:vt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:Ut,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Ut,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:Ut,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:Jb}),W4=ml({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Un,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:vt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:il,g2:il,glyphName:il,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Un,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Un,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Un,rev:Un,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Un,requiredFeatures:Un,requiredFonts:Un,requiredFormats:Un,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Un,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Un,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Un,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Zb}),ew=ml({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),tw=ml({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Jb}),nw=ml({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Y4={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},K4=/[A-Z]/g,c1=/-[a-z]/g,Q4=/^data[-\w.:]+$/i;function X4(e,n){const a=Hp(n);let r=n,o=Tn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&Q4.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(c1,J4);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!c1.test(s)){let u=s.replace(K4,Z4);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}o=zh}return new o(r,n)}function Z4(e){return"-"+e.toLowerCase()}function J4(e){return e.charAt(1).toUpperCase()}const e3=Qb([Xb,V4,ew,tw,nw],"html"),Ih=Qb([Xb,W4,ew,tw,nw],"svg");function t3(e){return e.join(" ").trim()}var Zr={},tp,u1;function n3(){if(u1)return tp;u1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,d=/^\s+|\s+$/g,p=`
1138
- `,f="/",y="*",g="",x="comment",b="declaration";function k(j,E){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];E=E||{};var R=1,O=1;function G(B){var K=B.match(n);K&&(R+=K.length);var P=B.lastIndexOf(p);O=~P?B.length-P:O+B.length}function U(){var B={line:R,column:O};return function(K){return K.position=new _(B),L(),K}}function _(B){this.start=B,this.end={line:R,column:O},this.source=E.source}_.prototype.content=j;function W(B){var K=new Error(E.source+":"+R+":"+O+": "+B);if(K.reason=B,K.filename=E.source,K.line=R,K.column=O,K.source=j,!E.silent)throw K}function H(B){var K=B.exec(j);if(K){var P=K[0];return G(P),j=j.slice(P.length),K}}function L(){H(a)}function T(B){var K;for(B=B||[];K=F();)K!==!1&&B.push(K);return B}function F(){var B=U();if(!(f!=j.charAt(0)||y!=j.charAt(1))){for(var K=2;g!=j.charAt(K)&&(y!=j.charAt(K)||f!=j.charAt(K+1));)++K;if(K+=2,g===j.charAt(K-1))return W("End of comment missing");var P=j.slice(2,K-2);return O+=2,G(P),j=j.slice(K),O+=2,B({type:x,comment:P})}}function V(){var B=U(),K=H(r);if(K){if(F(),!H(o))return W("property missing ':'");var P=H(s),Z=B({type:b,property:C(K[0].replace(e,g)),value:P?C(P[0].replace(e,g)):g});return H(u),Z}}function ie(){var B=[];T(B);for(var K;K=V();)K!==!1&&(B.push(K),T(B));return B}return L(),ie()}function C(j){return j?j.replace(d,g):g}return tp=k,tp}var d1;function a3(){if(d1)return Zr;d1=1;var e=Zr&&Zr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.default=a;const n=e(n3());function a(r,o){let s=null;if(!r||typeof r!="string")return s;const u=(0,n.default)(r),d=typeof o=="function";return u.forEach(p=>{if(p.type!=="declaration")return;const{property:f,value:y}=p;d?o(f,y,p):y&&(s=s||{},s[f]=y)}),s}return Zr}var go={},f1;function i3(){if(f1)return go;f1=1,Object.defineProperty(go,"__esModule",{value:!0}),go.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(f){return!f||a.test(f)||e.test(f)},u=function(f,y){return y.toUpperCase()},d=function(f,y){return"".concat(y,"-")},p=function(f,y){return y===void 0&&(y={}),s(f)?f:(f=f.toLowerCase(),y.reactCompat?f=f.replace(o,d):f=f.replace(r,d),f.replace(n,u))};return go.camelCase=p,go}var yo,p1;function r3(){if(p1)return yo;p1=1;var e=yo&&yo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},n=e(a3()),a=i3();function r(o,s){var u={};return!o||typeof o!="string"||(0,n.default)(o,function(d,p){d&&p&&(u[(0,a.camelCase)(d,s)]=p)}),u}return r.default=r,yo=r,yo}var l3=r3();const o3=Po(l3),aw=iw("end"),Ph=iw("start");function iw(e){return n;function n(a){const r=a&&a.position&&a.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function s3(e){const n=Ph(e),a=aw(e);if(n&&a)return{start:n,end:a}}function jo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?h1(e.position):"start"in e||"end"in e?h1(e):"line"in e||"column"in e?Fp(e):""}function Fp(e){return m1(e&&e.line)+":"+m1(e&&e.column)}function h1(e){return Fp(e&&e.start)+"-"+Fp(e&&e.end)}function m1(e){return e&&typeof e=="number"?e:1}class on extends Error{constructor(n,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let o="",s={},u=!1;if(a&&("line"in a&&"column"in a?s={place:a}:"start"in a&&"end"in a?s={place:a}:"type"in a?s={ancestors:[a],place:a.position}:s={...a}),typeof n=="string"?o=n:!s.cause&&n&&(u=!0,o=n.message,s.cause=n),!s.ruleId&&!s.source&&typeof r=="string"){const p=r.indexOf(":");p===-1?s.ruleId=r:(s.source=r.slice(0,p),s.ruleId=r.slice(p+1))}if(!s.place&&s.ancestors&&s.ancestors){const p=s.ancestors[s.ancestors.length-1];p&&(s.place=p.position)}const d=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=d?d.line:void 0,this.name=jo(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=u&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}on.prototype.file="";on.prototype.name="";on.prototype.reason="";on.prototype.message="";on.prototype.stack="";on.prototype.column=void 0;on.prototype.line=void 0;on.prototype.ancestors=void 0;on.prototype.cause=void 0;on.prototype.fatal=void 0;on.prototype.place=void 0;on.prototype.ruleId=void 0;on.prototype.source=void 0;const Uh={}.hasOwnProperty,c3=new Map,u3=/[A-Z]/g,d3=new Set(["table","tbody","thead","tfoot","tr"]),f3=new Set(["td","th"]),rw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function p3(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=w3(a,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=b3(a,n.jsx,n.jsxs)}const o={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Ih:e3,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=lw(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function lw(e,n,a){if(n.type==="element")return h3(e,n,a);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return m3(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return y3(e,n,a);if(n.type==="mdxjsEsm")return g3(e,n);if(n.type==="root")return v3(e,n,a);if(n.type==="text")return x3(e,n)}function h3(e,n,a){const r=e.schema;let o=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Ih,e.schema=o),e.ancestors.push(n);const s=sw(e,n.tagName,!1),u=S3(e,n);let d=Hh(e,n);return d3.has(n.tagName)&&(d=d.filter(function(p){return typeof p=="string"?!F4(p):!0})),ow(e,u,s,n),Bh(u,d),e.ancestors.pop(),e.schema=r,e.create(n,s,u,a)}function m3(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Lo(e,n.position)}function g3(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Lo(e,n.position)}function y3(e,n,a){const r=e.schema;let o=r;n.name==="svg"&&r.space==="html"&&(o=Ih,e.schema=o),e.ancestors.push(n);const s=n.name===null?e.Fragment:sw(e,n.name,!0),u=k3(e,n),d=Hh(e,n);return ow(e,u,s,n),Bh(u,d),e.ancestors.pop(),e.schema=r,e.create(n,s,u,a)}function v3(e,n,a){const r={};return Bh(r,Hh(e,n)),e.create(n,e.Fragment,r,a)}function x3(e,n){return n.value}function ow(e,n,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(n.node=r)}function Bh(e,n){if(n.length>0){const a=n.length>1?n:n[0];a&&(e.children=a)}}function b3(e,n,a){return r;function r(o,s,u,d){const f=Array.isArray(u.children)?a:n;return d?f(s,u,d):f(s,u)}}function w3(e,n){return a;function a(r,o,s,u){const d=Array.isArray(s.children),p=Ph(r);return n(o,s,u,d,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function S3(e,n){const a={};let r,o;for(o in n.properties)if(o!=="children"&&Uh.call(n.properties,o)){const s=C3(e,o,n.properties[o]);if(s){const[u,d]=s;e.tableCellAlignToStyle&&u==="align"&&typeof d=="string"&&f3.has(n.tagName)?r=d:a[u]=d}}if(r){const s=a.style||(a.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function k3(e,n){const a={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const u=s.expression;u.type;const d=u.properties[0];d.type,Object.assign(a,e.evaluater.evaluateExpression(d.argument))}else Lo(e,n.position);else{const o=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const d=r.value.data.estree.body[0];d.type,s=e.evaluater.evaluateExpression(d.expression)}else Lo(e,n.position);else s=r.value===null?!0:r.value;a[o]=s}return a}function Hh(e,n){const a=[];let r=-1;const o=e.passKeys?new Map:c3;for(;++r<n.children.length;){const s=n.children[r];let u;if(e.passKeys){const p=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(p){const f=o.get(p)||0;u=p+"-"+f,o.set(p,f+1)}}const d=lw(e,s,u);d!==void 0&&a.push(d)}return a}function C3(e,n,a){const r=X4(e.schema,n);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?U4(a):t3(a)),r.property==="style"){let o=typeof a=="object"?a:E3(e,String(a));return e.stylePropertyNameCase==="css"&&(o=A3(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?Y4[r.property]||r.property:r.attribute,a]}}function E3(e,n){try{return o3(n,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,o=new on("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=rw+"#cannot-parse-style-attribute",o}}function sw(e,n,a){let r;if(!a)r={type:"Literal",value:n};else if(n.includes(".")){const o=n.split(".");let s=-1,u;for(;++s<o.length;){const d=l1(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};u=u?{type:"MemberExpression",object:u,property:d,computed:!!(s&&d.type==="Literal"),optional:!1}:d}r=u}else r=l1(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const o=r.value;return Uh.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Lo(e)}function Lo(e,n){const a=new on("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=rw+"#cannot-handle-mdx-estrees-without-createevaluater",a}function A3(e){const n={};let a;for(a in e)Uh.call(e,a)&&(n[j3(a)]=e[a]);return n}function j3(e){let n=e.replace(u3,T3);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function T3(e){return"-"+e.toLowerCase()}const np={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},N3={};function $h(e,n){const a=N3,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return cw(e,r,o)}function cw(e,n,a){if(R3(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return g1(e.children,n,a)}return Array.isArray(e)?g1(e,n,a):""}function g1(e,n,a){const r=[];let o=-1;for(;++o<e.length;)r[o]=cw(e[o],n,a);return r.join("")}function R3(e){return!!(e&&typeof e=="object")}const y1=document.createElement("i");function qh(e){const n="&"+e+";";y1.innerHTML=n;const a=y1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===n?!1:a}function Hn(e,n,a,r){const o=e.length;let s=0,u;if(n<0?n=-n>o?0:o+n:n=n>o?o:n,a=a>0?a:0,r.length<1e4)u=Array.from(r),u.unshift(n,a),e.splice(...u);else for(a&&e.splice(n,a);s<r.length;)u=r.slice(s,s+1e4),u.unshift(n,0),e.splice(...u),s+=1e4,n+=1e4}function na(e,n){return e.length>0?(Hn(e,e.length,0,n),e):n}const v1={}.hasOwnProperty;function uw(e){const n={};let a=-1;for(;++a<e.length;)_3(n,e[a]);return n}function _3(e,n){let a;for(a in n){const o=(v1.call(e,a)?e[a]:void 0)||(e[a]={}),s=n[a];let u;if(s)for(u in s){v1.call(o,u)||(o[u]=[]);const d=s[u];O3(o[u],Array.isArray(d)?d:d?[d]:[])}}}function O3(e,n){let a=-1;const r=[];for(;++a<n.length;)(n[a].add==="after"?e:r).push(n[a]);Hn(e,0,0,r)}function dw(e,n){const a=Number.parseInt(e,n);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function da(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pn=Li(/[A-Za-z]/),ln=Li(/[\dA-Za-z]/),D3=Li(/[#-'*+\--9=?A-Z^-~]/);function Fc(e){return e!==null&&(e<32||e===127)}const Gp=Li(/\d/),M3=Li(/[\dA-Fa-f]/),L3=Li(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function gt(e){return e!==null&&(e<0||e===32)}function qe(e){return e===-2||e===-1||e===32}const lu=Li(new RegExp("\\p{P}|\\p{S}","u")),cr=Li(/\s/);function Li(e){return n;function n(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function gl(e){const n=[];let a=-1,r=0,o=0;for(;++a<e.length;){const s=e.charCodeAt(a);let u="";if(s===37&&ln(e.charCodeAt(a+1))&&ln(e.charCodeAt(a+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(u=String.fromCharCode(s));else if(s>55295&&s<57344){const d=e.charCodeAt(a+1);s<56320&&d>56319&&d<57344?(u=String.fromCharCode(s,d),o=1):u="�"}else u=String.fromCharCode(s);u&&(n.push(e.slice(r,a),encodeURIComponent(u)),r=a+o+1,u=""),o&&(a+=o,o=0)}return n.join("")+e.slice(r)}function Ke(e,n,a,r){const o=r?r-1:Number.POSITIVE_INFINITY;let s=0;return u;function u(p){return qe(p)?(e.enter(a),d(p)):n(p)}function d(p){return qe(p)&&s++<o?(e.consume(p),d):(e.exit(a),n(p))}}const z3={tokenize:I3};function I3(e){const n=e.attempt(this.parser.constructs.contentInitial,r,o);let a;return n;function r(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Ke(e,n,"linePrefix")}function o(d){return e.enter("paragraph"),s(d)}function s(d){const p=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,u(d)}function u(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Ae(d)?(e.consume(d),e.exit("chunkText"),s):(e.consume(d),u)}}const P3={tokenize:U3},x1={tokenize:B3};function U3(e){const n=this,a=[];let r=0,o,s,u;return d;function d(O){if(r<a.length){const G=a[r];return n.containerState=G[1],e.attempt(G[0].continuation,p,f)(O)}return f(O)}function p(O){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,o&&R();const G=n.events.length;let U=G,_;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){_=n.events[U][1].end;break}E(r);let W=G;for(;W<n.events.length;)n.events[W][1].end={..._},W++;return Hn(n.events,U+1,0,n.events.slice(G)),n.events.length=W,f(O)}return d(O)}function f(O){if(r===a.length){if(!o)return x(O);if(o.currentConstruct&&o.currentConstruct.concrete)return k(O);n.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(x1,y,g)(O)}function y(O){return o&&R(),E(r),x(O)}function g(O){return n.parser.lazy[n.now().line]=r!==a.length,u=n.now().offset,k(O)}function x(O){return n.containerState={},e.attempt(x1,b,k)(O)}function b(O){return r++,a.push([n.currentConstruct,n.containerState]),x(O)}function k(O){if(O===null){o&&R(),E(0),e.consume(O);return}return o=o||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),C(O)}function C(O){if(O===null){j(e.exit("chunkFlow"),!0),E(0),e.consume(O);return}return Ae(O)?(e.consume(O),j(e.exit("chunkFlow")),r=0,n.interrupt=void 0,d):(e.consume(O),C)}function j(O,G){const U=n.sliceStream(O);if(G&&U.push(null),O.previous=s,s&&(s.next=O),s=O,o.defineSkip(O.start),o.write(U),n.parser.lazy[O.start.line]){let _=o.events.length;for(;_--;)if(o.events[_][1].start.offset<u&&(!o.events[_][1].end||o.events[_][1].end.offset>u))return;const W=n.events.length;let H=W,L,T;for(;H--;)if(n.events[H][0]==="exit"&&n.events[H][1].type==="chunkFlow"){if(L){T=n.events[H][1].end;break}L=!0}for(E(r),_=W;_<n.events.length;)n.events[_][1].end={...T},_++;Hn(n.events,H+1,0,n.events.slice(W)),n.events.length=_}}function E(O){let G=a.length;for(;G-- >O;){const U=a[G];n.containerState=U[1],U[0].exit.call(n,e)}a.length=O}function R(){o.write([null]),s=void 0,o=void 0,n.containerState._closeFlow=void 0}}function B3(e,n,a){return Ke(e,e.attempt(this.parser.constructs.document,n,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ll(e){if(e===null||gt(e)||cr(e))return 1;if(lu(e))return 2}function ou(e,n,a){const r=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!r.includes(s)&&(n=s(n,a),r.push(s))}return n}const Vp={name:"attention",resolveAll:H3,tokenize:$3};function H3(e,n){let a=-1,r,o,s,u,d,p,f,y;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;p=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const g={...e[r][1].end},x={...e[a][1].start};b1(g,-p),b1(x,p),u={type:p>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},d={type:p>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:x},s={type:p>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},o={type:p>1?"strong":"emphasis",start:{...u.start},end:{...d.end}},e[r][1].end={...u.start},e[a][1].start={...d.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=na(f,[["enter",e[r][1],n],["exit",e[r][1],n]])),f=na(f,[["enter",o,n],["enter",u,n],["exit",u,n],["enter",s,n]]),f=na(f,ou(n.parser.constructs.insideSpan.null,e.slice(r+1,a),n)),f=na(f,[["exit",s,n],["enter",d,n],["exit",d,n],["exit",o,n]]),e[a][1].end.offset-e[a][1].start.offset?(y=2,f=na(f,[["enter",e[a][1],n],["exit",e[a][1],n]])):y=0,Hn(e,r-1,a-r+3,f),a=r+f.length-y-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function $3(e,n){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,o=ll(r);let s;return u;function u(p){return s=p,e.enter("attentionSequence"),d(p)}function d(p){if(p===s)return e.consume(p),d;const f=e.exit("attentionSequence"),y=ll(p),g=!y||y===2&&o||a.includes(p),x=!o||o===2&&y||a.includes(r);return f._open=!!(s===42?g:g&&(o||!x)),f._close=!!(s===42?x:x&&(y||!g)),n(p)}}function b1(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const q3={name:"autolink",tokenize:F3};function F3(e,n,a){let r=0;return o;function o(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(b){return pn(b)?(e.consume(b),u):b===64?a(b):f(b)}function u(b){return b===43||b===45||b===46||ln(b)?(r=1,d(b)):f(b)}function d(b){return b===58?(e.consume(b),r=0,p):(b===43||b===45||b===46||ln(b))&&r++<32?(e.consume(b),d):(r=0,f(b))}function p(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):b===null||b===32||b===60||Fc(b)?a(b):(e.consume(b),p)}function f(b){return b===64?(e.consume(b),y):D3(b)?(e.consume(b),f):a(b)}function y(b){return ln(b)?g(b):a(b)}function g(b){return b===46?(e.consume(b),r=0,y):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):x(b)}function x(b){if((b===45||ln(b))&&r++<63){const k=b===45?x:g;return e.consume(b),k}return a(b)}}const Fo={partial:!0,tokenize:G3};function G3(e,n,a){return r;function r(s){return qe(s)?Ke(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Ae(s)?n(s):a(s)}}const fw={continuation:{tokenize:W3},exit:Y3,name:"blockQuote",tokenize:V3};function V3(e,n,a){const r=this;return o;function o(u){if(u===62){const d=r.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),s}return a(u)}function s(u){return qe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function W3(e,n,a){const r=this;return o;function o(u){return qe(u)?Ke(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):s(u)}function s(u){return e.attempt(fw,n,a)(u)}}function Y3(e){e.exit("blockQuote")}const pw={name:"characterEscape",tokenize:K3};function K3(e,n,a){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return L3(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):a(s)}}const hw={name:"characterReference",tokenize:Q3};function Q3(e,n,a){const r=this;let o=0,s,u;return d;function d(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),p}function p(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),s=31,u=ln,y(g))}function f(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,u=M3,y):(e.enter("characterReferenceValue"),s=7,u=Gp,y(g))}function y(g){if(g===59&&o){const x=e.exit("characterReferenceValue");return u===ln&&!qh(r.sliceSerialize(x))?a(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(g)&&o++<s?(e.consume(g),y):a(g)}}const w1={partial:!0,tokenize:Z3},S1={concrete:!0,name:"codeFenced",tokenize:X3};function X3(e,n,a){const r=this,o={partial:!0,tokenize:U};let s=0,u=0,d;return p;function p(_){return f(_)}function f(_){const W=r.events[r.events.length-1];return s=W&&W[1].type==="linePrefix"?W[2].sliceSerialize(W[1],!0).length:0,d=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(_)}function y(_){return _===d?(u++,e.consume(_),y):u<3?a(_):(e.exit("codeFencedFenceSequence"),qe(_)?Ke(e,g,"whitespace")(_):g(_))}function g(_){return _===null||Ae(_)?(e.exit("codeFencedFence"),r.interrupt?n(_):e.check(w1,C,G)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(_))}function x(_){return _===null||Ae(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(_)):qe(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ke(e,b,"whitespace")(_)):_===96&&_===d?a(_):(e.consume(_),x)}function b(_){return _===null||Ae(_)?g(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(_))}function k(_){return _===null||Ae(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(_)):_===96&&_===d?a(_):(e.consume(_),k)}function C(_){return e.attempt(o,G,j)(_)}function j(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),E}function E(_){return s>0&&qe(_)?Ke(e,R,"linePrefix",s+1)(_):R(_)}function R(_){return _===null||Ae(_)?e.check(w1,C,G)(_):(e.enter("codeFlowValue"),O(_))}function O(_){return _===null||Ae(_)?(e.exit("codeFlowValue"),R(_)):(e.consume(_),O)}function G(_){return e.exit("codeFenced"),n(_)}function U(_,W,H){let L=0;return T;function T(K){return _.enter("lineEnding"),_.consume(K),_.exit("lineEnding"),F}function F(K){return _.enter("codeFencedFence"),qe(K)?Ke(_,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):V(K)}function V(K){return K===d?(_.enter("codeFencedFenceSequence"),ie(K)):H(K)}function ie(K){return K===d?(L++,_.consume(K),ie):L>=u?(_.exit("codeFencedFenceSequence"),qe(K)?Ke(_,B,"whitespace")(K):B(K)):H(K)}function B(K){return K===null||Ae(K)?(_.exit("codeFencedFence"),W(K)):H(K)}}}function Z3(e,n,a){const r=this;return o;function o(u){return u===null?a(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s)}function s(u){return r.parser.lazy[r.now().line]?a(u):n(u)}}const ap={name:"codeIndented",tokenize:e_},J3={partial:!0,tokenize:t_};function e_(e,n,a){const r=this;return o;function o(f){return e.enter("codeIndented"),Ke(e,s,"linePrefix",5)(f)}function s(f){const y=r.events[r.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?u(f):a(f)}function u(f){return f===null?p(f):Ae(f)?e.attempt(J3,u,p)(f):(e.enter("codeFlowValue"),d(f))}function d(f){return f===null||Ae(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),d)}function p(f){return e.exit("codeIndented"),n(f)}}function t_(e,n,a){const r=this;return o;function o(u){return r.parser.lazy[r.now().line]?a(u):Ae(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):Ke(e,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?n(u):Ae(u)?o(u):a(u)}}const n_={name:"codeText",previous:i_,resolve:a_,tokenize:r_};function a_(e){let n=e.length-4,a=3,r,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=a;++r<n;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[n][1].type="codeTextPadding",a+=2,n-=2;break}}for(r=a-1,n++;++r<=n;)o===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(o=r):(r===n||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),n-=r-o-2,r=o+2),o=void 0);return e}function i_(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function r_(e,n,a){let r=0,o,s;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),d(g)}function d(g){return g===96?(e.consume(g),r++,d):(e.exit("codeTextSequence"),p(g))}function p(g){return g===null?a(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),p):g===96?(s=e.enter("codeTextSequence"),o=0,y(g)):Ae(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("codeTextData"),f(g))}function f(g){return g===null||g===32||g===96||Ae(g)?(e.exit("codeTextData"),p(g)):(e.consume(g),f)}function y(g){return g===96?(e.consume(g),o++,y):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(g)):(s.type="codeTextData",f(g))}}class l_{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,a,r){const o=a||0;this.setCursor(Math.trunc(n));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&vo(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),vo(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),vo(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const a=this.left.splice(n,Number.POSITIVE_INFINITY);vo(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);vo(this.left,a.reverse())}}}function vo(e,n){let a=0;if(n.length<1e4)e.push(...n);else for(;a<n.length;)e.push(...n.slice(a,a+1e4)),a+=1e4}function mw(e){const n={};let a=-1,r,o,s,u,d,p,f;const y=new l_(e);for(;++a<y.length;){for(;a in n;)a=n[a];if(r=y.get(a),a&&r[1].type==="chunkFlow"&&y.get(a-1)[1].type==="listItemPrefix"&&(p=r[1]._tokenizer.events,s=0,s<p.length&&p[s][1].type==="lineEndingBlank"&&(s+=2),s<p.length&&p[s][1].type==="content"))for(;++s<p.length&&p[s][1].type!=="content";)p[s][1].type==="chunkText"&&(p[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,o_(y,a)),a=n[a],f=!0);else if(r[1]._container){for(s=a,o=void 0;s--;)if(u=y.get(s),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(y.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=s);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(r[1].end={...y.get(o)[1].start},d=y.slice(o,a),d.unshift(r),y.splice(o,a-o+1,d))}}return Hn(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!f}function o_(e,n){const a=e.get(n)[1],r=e.get(n)[2];let o=n-1;const s=[];let u=a._tokenizer;u||(u=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const d=u.events,p=[],f={};let y,g,x=-1,b=a,k=0,C=0;const j=[C];for(;b;){for(;e.get(++o)[1]!==b;);s.push(o),b._tokenizer||(y=r.sliceStream(b),b.next||y.push(null),g&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=a;++x<d.length;)d[x][0]==="exit"&&d[x-1][0]==="enter"&&d[x][1].type===d[x-1][1].type&&d[x][1].start.line!==d[x][1].end.line&&(C=x+1,j.push(C),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):j.pop(),x=j.length;x--;){const E=d.slice(j[x],j[x+1]),R=s.pop();p.push([R,R+E.length-1]),e.splice(R,2,E)}for(p.reverse(),x=-1;++x<p.length;)f[k+p[x][0]]=k+p[x][1],k+=p[x][1]-p[x][0]-1;return f}const s_={resolve:u_,tokenize:d_},c_={partial:!0,tokenize:f_};function u_(e){return mw(e),e}function d_(e,n){let a;return r;function r(d){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(d)}function o(d){return d===null?s(d):Ae(d)?e.check(c_,u,s)(d):(e.consume(d),o)}function s(d){return e.exit("chunkContent"),e.exit("content"),n(d)}function u(d){return e.consume(d),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function f_(e,n,a){const r=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ke(e,s,"linePrefix")}function s(u){if(u===null||Ae(u))return a(u);const d=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?n(u):e.interrupt(r.parser.constructs.flow,a,n)(u)}}function gw(e,n,a,r,o,s,u,d,p){const f=p||Number.POSITIVE_INFINITY;let y=0;return g;function g(E){return E===60?(e.enter(r),e.enter(o),e.enter(s),e.consume(E),e.exit(s),x):E===null||E===32||E===41||Fc(E)?a(E):(e.enter(r),e.enter(u),e.enter(d),e.enter("chunkString",{contentType:"string"}),C(E))}function x(E){return E===62?(e.enter(s),e.consume(E),e.exit(s),e.exit(o),e.exit(r),n):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(e.exit("chunkString"),e.exit(d),x(E)):E===null||E===60||Ae(E)?a(E):(e.consume(E),E===92?k:b)}function k(E){return E===60||E===62||E===92?(e.consume(E),b):b(E)}function C(E){return!y&&(E===null||E===41||gt(E))?(e.exit("chunkString"),e.exit(d),e.exit(u),e.exit(r),n(E)):y<f&&E===40?(e.consume(E),y++,C):E===41?(e.consume(E),y--,C):E===null||E===32||E===40||Fc(E)?a(E):(e.consume(E),E===92?j:C)}function j(E){return E===40||E===41||E===92?(e.consume(E),C):C(E)}}function yw(e,n,a,r,o,s){const u=this;let d=0,p;return f;function f(b){return e.enter(r),e.enter(o),e.consume(b),e.exit(o),e.enter(s),y}function y(b){return d>999||b===null||b===91||b===93&&!p||b===94&&!d&&"_hiddenFootnoteSupport"in u.parser.constructs?a(b):b===93?(e.exit(s),e.enter(o),e.consume(b),e.exit(o),e.exit(r),n):Ae(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Ae(b)||d++>999?(e.exit("chunkString"),y(b)):(e.consume(b),p||(p=!qe(b)),b===92?x:g)}function x(b){return b===91||b===92||b===93?(e.consume(b),d++,g):g(b)}}function vw(e,n,a,r,o,s){let u;return d;function d(x){return x===34||x===39||x===40?(e.enter(r),e.enter(o),e.consume(x),e.exit(o),u=x===40?41:x,p):a(x)}function p(x){return x===u?(e.enter(o),e.consume(x),e.exit(o),e.exit(r),n):(e.enter(s),f(x))}function f(x){return x===u?(e.exit(s),p(u)):x===null?a(x):Ae(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Ke(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===u||x===null||Ae(x)?(e.exit("chunkString"),f(x)):(e.consume(x),x===92?g:y)}function g(x){return x===u||x===92?(e.consume(x),y):y(x)}}function To(e,n){let a;return r;function r(o){return Ae(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,r):qe(o)?Ke(e,r,a?"linePrefix":"lineSuffix")(o):n(o)}}const p_={name:"definition",tokenize:m_},h_={partial:!0,tokenize:g_};function m_(e,n,a){const r=this;let o;return s;function s(b){return e.enter("definition"),u(b)}function u(b){return yw.call(r,e,d,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return o=da(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),p):a(b)}function p(b){return gt(b)?To(e,f)(b):f(b)}function f(b){return gw(e,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function y(b){return e.attempt(h_,g,g)(b)}function g(b){return qe(b)?Ke(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Ae(b)?(e.exit("definition"),r.parser.defined.push(o),n(b)):a(b)}}function g_(e,n,a){return r;function r(d){return gt(d)?To(e,o)(d):a(d)}function o(d){return vw(e,s,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function s(d){return qe(d)?Ke(e,u,"whitespace")(d):u(d)}function u(d){return d===null||Ae(d)?n(d):a(d)}}const y_={name:"hardBreakEscape",tokenize:v_};function v_(e,n,a){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Ae(s)?(e.exit("hardBreakEscape"),n(s)):a(s)}}const x_={name:"headingAtx",resolve:b_,tokenize:w_};function b_(e,n){let a=e.length-2,r=3,o,s;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},s={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},Hn(e,r,a-r+1,[["enter",o,n],["enter",s,n],["exit",s,n],["exit",o,n]])),e}function w_(e,n,a){let r=0;return o;function o(y){return e.enter("atxHeading"),s(y)}function s(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&r++<6?(e.consume(y),u):y===null||gt(y)?(e.exit("atxHeadingSequence"),d(y)):a(y)}function d(y){return y===35?(e.enter("atxHeadingSequence"),p(y)):y===null||Ae(y)?(e.exit("atxHeading"),n(y)):qe(y)?Ke(e,d,"whitespace")(y):(e.enter("atxHeadingText"),f(y))}function p(y){return y===35?(e.consume(y),p):(e.exit("atxHeadingSequence"),d(y))}function f(y){return y===null||y===35||gt(y)?(e.exit("atxHeadingText"),d(y)):(e.consume(y),f)}}const S_=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],k1=["pre","script","style","textarea"],k_={concrete:!0,name:"htmlFlow",resolveTo:A_,tokenize:j_},C_={partial:!0,tokenize:N_},E_={partial:!0,tokenize:T_};function A_(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function j_(e,n,a){const r=this;let o,s,u,d,p;return f;function f(N){return y(N)}function y(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),g}function g(N){return N===33?(e.consume(N),x):N===47?(e.consume(N),s=!0,C):N===63?(e.consume(N),o=3,r.interrupt?n:D):pn(N)?(e.consume(N),u=String.fromCharCode(N),j):a(N)}function x(N){return N===45?(e.consume(N),o=2,b):N===91?(e.consume(N),o=5,d=0,k):pn(N)?(e.consume(N),o=4,r.interrupt?n:D):a(N)}function b(N){return N===45?(e.consume(N),r.interrupt?n:D):a(N)}function k(N){const ue="CDATA[";return N===ue.charCodeAt(d++)?(e.consume(N),d===ue.length?r.interrupt?n:V:k):a(N)}function C(N){return pn(N)?(e.consume(N),u=String.fromCharCode(N),j):a(N)}function j(N){if(N===null||N===47||N===62||gt(N)){const ue=N===47,pe=u.toLowerCase();return!ue&&!s&&k1.includes(pe)?(o=1,r.interrupt?n(N):V(N)):S_.includes(u.toLowerCase())?(o=6,ue?(e.consume(N),E):r.interrupt?n(N):V(N)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(N):s?R(N):O(N))}return N===45||ln(N)?(e.consume(N),u+=String.fromCharCode(N),j):a(N)}function E(N){return N===62?(e.consume(N),r.interrupt?n:V):a(N)}function R(N){return qe(N)?(e.consume(N),R):T(N)}function O(N){return N===47?(e.consume(N),T):N===58||N===95||pn(N)?(e.consume(N),G):qe(N)?(e.consume(N),O):T(N)}function G(N){return N===45||N===46||N===58||N===95||ln(N)?(e.consume(N),G):U(N)}function U(N){return N===61?(e.consume(N),_):qe(N)?(e.consume(N),U):O(N)}function _(N){return N===null||N===60||N===61||N===62||N===96?a(N):N===34||N===39?(e.consume(N),p=N,W):qe(N)?(e.consume(N),_):H(N)}function W(N){return N===p?(e.consume(N),p=null,L):N===null||Ae(N)?a(N):(e.consume(N),W)}function H(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||gt(N)?U(N):(e.consume(N),H)}function L(N){return N===47||N===62||qe(N)?O(N):a(N)}function T(N){return N===62?(e.consume(N),F):a(N)}function F(N){return N===null||Ae(N)?V(N):qe(N)?(e.consume(N),F):a(N)}function V(N){return N===45&&o===2?(e.consume(N),P):N===60&&o===1?(e.consume(N),Z):N===62&&o===4?(e.consume(N),M):N===63&&o===3?(e.consume(N),D):N===93&&o===5?(e.consume(N),X):Ae(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(C_,Q,ie)(N)):N===null||Ae(N)?(e.exit("htmlFlowData"),ie(N)):(e.consume(N),V)}function ie(N){return e.check(E_,B,Q)(N)}function B(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),K}function K(N){return N===null||Ae(N)?ie(N):(e.enter("htmlFlowData"),V(N))}function P(N){return N===45?(e.consume(N),D):V(N)}function Z(N){return N===47?(e.consume(N),u="",ne):V(N)}function ne(N){if(N===62){const ue=u.toLowerCase();return k1.includes(ue)?(e.consume(N),M):V(N)}return pn(N)&&u.length<8?(e.consume(N),u+=String.fromCharCode(N),ne):V(N)}function X(N){return N===93?(e.consume(N),D):V(N)}function D(N){return N===62?(e.consume(N),M):N===45&&o===2?(e.consume(N),D):V(N)}function M(N){return N===null||Ae(N)?(e.exit("htmlFlowData"),Q(N)):(e.consume(N),M)}function Q(N){return e.exit("htmlFlow"),n(N)}}function T_(e,n,a){const r=this;return o;function o(u){return Ae(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):a(u)}function s(u){return r.parser.lazy[r.now().line]?a(u):n(u)}}function N_(e,n,a){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Fo,n,a)}}const R_={name:"htmlText",tokenize:__};function __(e,n,a){const r=this;let o,s,u;return d;function d(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),p}function p(D){return D===33?(e.consume(D),f):D===47?(e.consume(D),U):D===63?(e.consume(D),O):pn(D)?(e.consume(D),H):a(D)}function f(D){return D===45?(e.consume(D),y):D===91?(e.consume(D),s=0,k):pn(D)?(e.consume(D),R):a(D)}function y(D){return D===45?(e.consume(D),b):a(D)}function g(D){return D===null?a(D):D===45?(e.consume(D),x):Ae(D)?(u=g,Z(D)):(e.consume(D),g)}function x(D){return D===45?(e.consume(D),b):g(D)}function b(D){return D===62?P(D):D===45?x(D):g(D)}function k(D){const M="CDATA[";return D===M.charCodeAt(s++)?(e.consume(D),s===M.length?C:k):a(D)}function C(D){return D===null?a(D):D===93?(e.consume(D),j):Ae(D)?(u=C,Z(D)):(e.consume(D),C)}function j(D){return D===93?(e.consume(D),E):C(D)}function E(D){return D===62?P(D):D===93?(e.consume(D),E):C(D)}function R(D){return D===null||D===62?P(D):Ae(D)?(u=R,Z(D)):(e.consume(D),R)}function O(D){return D===null?a(D):D===63?(e.consume(D),G):Ae(D)?(u=O,Z(D)):(e.consume(D),O)}function G(D){return D===62?P(D):O(D)}function U(D){return pn(D)?(e.consume(D),_):a(D)}function _(D){return D===45||ln(D)?(e.consume(D),_):W(D)}function W(D){return Ae(D)?(u=W,Z(D)):qe(D)?(e.consume(D),W):P(D)}function H(D){return D===45||ln(D)?(e.consume(D),H):D===47||D===62||gt(D)?L(D):a(D)}function L(D){return D===47?(e.consume(D),P):D===58||D===95||pn(D)?(e.consume(D),T):Ae(D)?(u=L,Z(D)):qe(D)?(e.consume(D),L):P(D)}function T(D){return D===45||D===46||D===58||D===95||ln(D)?(e.consume(D),T):F(D)}function F(D){return D===61?(e.consume(D),V):Ae(D)?(u=F,Z(D)):qe(D)?(e.consume(D),F):L(D)}function V(D){return D===null||D===60||D===61||D===62||D===96?a(D):D===34||D===39?(e.consume(D),o=D,ie):Ae(D)?(u=V,Z(D)):qe(D)?(e.consume(D),V):(e.consume(D),B)}function ie(D){return D===o?(e.consume(D),o=void 0,K):D===null?a(D):Ae(D)?(u=ie,Z(D)):(e.consume(D),ie)}function B(D){return D===null||D===34||D===39||D===60||D===61||D===96?a(D):D===47||D===62||gt(D)?L(D):(e.consume(D),B)}function K(D){return D===47||D===62||gt(D)?L(D):a(D)}function P(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),n):a(D)}function Z(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),ne}function ne(D){return qe(D)?Ke(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):X(D)}function X(D){return e.enter("htmlTextData"),u(D)}}const Fh={name:"labelEnd",resolveAll:L_,resolveTo:z_,tokenize:I_},O_={tokenize:P_},D_={tokenize:U_},M_={tokenize:B_};function L_(e){let n=-1;const a=[];for(;++n<e.length;){const r=e[n][1];if(a.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",n+=o}}return e.length!==a.length&&Hn(e,0,e.length,a),e}function z_(e,n){let a=e.length,r=0,o,s,u,d;for(;a--;)if(o=e[a][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[a][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(e[a][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=a,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(u=a);const p={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[s][1].start},end:{...e[u][1].end}},y={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[u-2][1].start}};return d=[["enter",p,n],["enter",f,n]],d=na(d,e.slice(s+1,s+r+3)),d=na(d,[["enter",y,n]]),d=na(d,ou(n.parser.constructs.insideSpan.null,e.slice(s+r+4,u-3),n)),d=na(d,[["exit",y,n],e[u-2],e[u-1],["exit",f,n]]),d=na(d,e.slice(u+1)),d=na(d,[["exit",p,n]]),Hn(e,s,e.length,d),e}function I_(e,n,a){const r=this;let o=r.events.length,s,u;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){s=r.events[o][1];break}return d;function d(x){return s?s._inactive?g(x):(u=r.parser.defined.includes(da(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),p):a(x)}function p(x){return x===40?e.attempt(O_,y,u?y:g)(x):x===91?e.attempt(D_,y,u?f:g)(x):u?y(x):g(x)}function f(x){return e.attempt(M_,y,g)(x)}function y(x){return n(x)}function g(x){return s._balanced=!0,a(x)}}function P_(e,n,a){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return gt(g)?To(e,s)(g):s(g)}function s(g){return g===41?y(g):gw(e,u,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return gt(g)?To(e,p)(g):y(g)}function d(g){return a(g)}function p(g){return g===34||g===39||g===40?vw(e,f,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function f(g){return gt(g)?To(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),n):a(g)}}function U_(e,n,a){const r=this;return o;function o(d){return yw.call(r,e,s,u,"reference","referenceMarker","referenceString")(d)}function s(d){return r.parser.defined.includes(da(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(d):a(d)}function u(d){return a(d)}}function B_(e,n,a){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),n):a(s)}}const H_={name:"labelStartImage",resolveAll:Fh.resolveAll,tokenize:$_};function $_(e,n,a){const r=this;return o;function o(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),s}function s(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),u):a(d)}function u(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(d):n(d)}}const q_={name:"labelStartLink",resolveAll:Fh.resolveAll,tokenize:F_};function F_(e,n,a){const r=this;return o;function o(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),s}function s(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(u):n(u)}}const ip={name:"lineEnding",tokenize:G_};function G_(e,n){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ke(e,n,"linePrefix")}}const Tc={name:"thematicBreak",tokenize:V_};function V_(e,n,a){let r=0,o;return s;function s(f){return e.enter("thematicBreak"),u(f)}function u(f){return o=f,d(f)}function d(f){return f===o?(e.enter("thematicBreakSequence"),p(f)):r>=3&&(f===null||Ae(f))?(e.exit("thematicBreak"),n(f)):a(f)}function p(f){return f===o?(e.consume(f),r++,p):(e.exit("thematicBreakSequence"),qe(f)?Ke(e,d,"whitespace")(f):d(f))}}const An={continuation:{tokenize:Q_},exit:Z_,name:"list",tokenize:K_},W_={partial:!0,tokenize:J_},Y_={partial:!0,tokenize:X_};function K_(e,n,a){const r=this,o=r.events[r.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return d;function d(b){const k=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:Gp(b)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Tc,a,f)(b):f(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(b)}return a(b)}function p(b){return Gp(b)&&++u<10?(e.consume(b),p):(!r.interrupt||u<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),f(b)):a(b)}function f(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(Fo,r.interrupt?a:y,e.attempt(W_,x,g))}function y(b){return r.containerState.initialBlankLine=!0,s++,x(b)}function g(b){return qe(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):a(b)}function x(b){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(b)}}function Q_(e,n,a){const r=this;return r.containerState._closeFlow=void 0,e.check(Fo,o,s);function o(d){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ke(e,n,"listItemIndent",r.containerState.size+1)(d)}function s(d){return r.containerState.furtherBlankLines||!qe(d)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(d)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Y_,n,u)(d))}function u(d){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ke(e,e.attempt(An,n,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function X_(e,n,a){const r=this;return Ke(e,o,"listItemIndent",r.containerState.size+1);function o(s){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?n(s):a(s)}}function Z_(e){e.exit(this.containerState.type)}function J_(e,n,a){const r=this;return Ke(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const u=r.events[r.events.length-1];return!qe(s)&&u&&u[1].type==="listItemPrefixWhitespace"?n(s):a(s)}}const C1={name:"setextUnderline",resolveTo:eO,tokenize:tO};function eO(e,n){let a=e.length,r,o,s;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}e[a][1].type==="paragraph"&&(o=a)}else e[a][1].type==="content"&&e.splice(a,1),!s&&e[a][1].type==="definition"&&(s=a);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",u,n]),e.splice(s+1,0,["exit",e[r][1],n]),e[r][1].end={...e[s][1].end}):e[r][1]=u,e.push(["exit",u,n]),e}function tO(e,n,a){const r=this;let o;return s;function s(f){let y=r.events.length,g;for(;y--;)if(r.events[y][1].type!=="lineEnding"&&r.events[y][1].type!=="linePrefix"&&r.events[y][1].type!=="content"){g=r.events[y][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),o=f,u(f)):a(f)}function u(f){return e.enter("setextHeadingLineSequence"),d(f)}function d(f){return f===o?(e.consume(f),d):(e.exit("setextHeadingLineSequence"),qe(f)?Ke(e,p,"lineSuffix")(f):p(f))}function p(f){return f===null||Ae(f)?(e.exit("setextHeadingLine"),n(f)):a(f)}}const nO={tokenize:aO};function aO(e){const n=this,a=e.attempt(Fo,r,e.attempt(this.parser.constructs.flowInitial,o,Ke(e,e.attempt(this.parser.constructs.flow,o,e.attempt(s_,o)),"linePrefix")));return a;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),n.currentConstruct=void 0,a}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n.currentConstruct=void 0,a}}const iO={resolveAll:bw()},rO=xw("string"),lO=xw("text");function xw(e){return{resolveAll:bw(e==="text"?oO:void 0),tokenize:n};function n(a){const r=this,o=this.parser.constructs[e],s=a.attempt(o,u,d);return u;function u(y){return f(y)?s(y):d(y)}function d(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return f(y)?(a.exit("data"),s(y)):(a.consume(y),p)}function f(y){if(y===null)return!0;const g=o[y];let x=-1;if(g)for(;++x<g.length;){const b=g[x];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function bw(e){return n;function n(a,r){let o=-1,s;for(;++o<=a.length;)s===void 0?a[o]&&a[o][1].type==="data"&&(s=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==s+2&&(a[s][1].end=a[o-1][1].end,a.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(a,r):a}}function oO(e,n){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const r=e[a-1][1],o=n.sliceStream(r);let s=o.length,u=-1,d=0,p;for(;s--;){const f=o[s];if(typeof f=="string"){for(u=f.length;f.charCodeAt(u-1)===32;)d++,u--;if(u)break;u=-1}else if(f===-2)p=!0,d++;else if(f!==-1){s++;break}}if(n._contentTypeTextTrailing&&a===e.length&&(d=0),d){const f={type:a===e.length||p||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?u:r.start._bufferIndex+u,_index:r.start._index+s,line:r.end.line,column:r.end.column-d,offset:r.end.offset-d},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(a,0,["enter",f,n],["exit",f,n]),a+=2)}a++}return e}const sO={42:An,43:An,45:An,48:An,49:An,50:An,51:An,52:An,53:An,54:An,55:An,56:An,57:An,62:fw},cO={91:p_},uO={[-2]:ap,[-1]:ap,32:ap},dO={35:x_,42:Tc,45:[C1,Tc],60:k_,61:C1,95:Tc,96:S1,126:S1},fO={38:hw,92:pw},pO={[-5]:ip,[-4]:ip,[-3]:ip,33:H_,38:hw,42:Vp,60:[q3,R_],91:q_,92:[y_,pw],93:Fh,95:Vp,96:n_},hO={null:[Vp,iO]},mO={null:[42,95]},gO={null:[]},yO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:mO,contentInitial:cO,disable:gO,document:sO,flow:dO,flowInitial:uO,insideSpan:hO,string:fO,text:pO},Symbol.toStringTag,{value:"Module"}));function vO(e,n,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},s=[];let u=[],d=[];const p={attempt:W(U),check:W(_),consume:R,enter:O,exit:G,interrupt:W(_,{interrupt:!0})},f={code:null,containerState:{},defineSkip:C,events:[],now:k,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:g};let y=n.tokenize.call(f,p);return n.resolveAll&&s.push(n),f;function g(F){return u=na(u,F),j(),u[u.length-1]!==null?[]:(H(n,0),f.events=ou(s,f.events,f),f.events)}function x(F,V){return bO(b(F),V)}function b(F){return xO(u,F)}function k(){const{_bufferIndex:F,_index:V,line:ie,column:B,offset:K}=r;return{_bufferIndex:F,_index:V,line:ie,column:B,offset:K}}function C(F){o[F.line]=F.column,T()}function j(){let F;for(;r._index<u.length;){const V=u[r._index];if(typeof V=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<V.length;)E(V.charCodeAt(r._bufferIndex));else E(V)}}function E(F){y=y(F)}function R(F){Ae(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,T()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=F}function O(F,V){const ie=V||{};return ie.type=F,ie.start=k(),f.events.push(["enter",ie,f]),d.push(ie),ie}function G(F){const V=d.pop();return V.end=k(),f.events.push(["exit",V,f]),V}function U(F,V){H(F,V.from)}function _(F,V){V.restore()}function W(F,V){return ie;function ie(B,K,P){let Z,ne,X,D;return Array.isArray(B)?Q(B):"tokenize"in B?Q([B]):M(B);function M(he){return be;function be(Oe){const Ne=Oe!==null&&he[Oe],et=Oe!==null&&he.null,Ot=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(et)?et:et?[et]:[]];return Q(Ot)(Oe)}}function Q(he){return Z=he,ne=0,he.length===0?P:N(he[ne])}function N(he){return be;function be(Oe){return D=L(),X=he,he.partial||(f.currentConstruct=he),he.name&&f.parser.constructs.disable.null.includes(he.name)?pe():he.tokenize.call(V?Object.assign(Object.create(f),V):f,p,ue,pe)(Oe)}}function ue(he){return F(X,D),K}function pe(he){return D.restore(),++ne<Z.length?N(Z[ne]):P}}}function H(F,V){F.resolveAll&&!s.includes(F)&&s.push(F),F.resolve&&Hn(f.events,V,f.events.length-V,F.resolve(f.events.slice(V),f)),F.resolveTo&&(f.events=F.resolveTo(f.events,f))}function L(){const F=k(),V=f.previous,ie=f.currentConstruct,B=f.events.length,K=Array.from(d);return{from:B,restore:P};function P(){r=F,f.previous=V,f.currentConstruct=ie,f.events.length=B,d=K,T()}}function T(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function xO(e,n){const a=n.start._index,r=n.start._bufferIndex,o=n.end._index,s=n.end._bufferIndex;let u;if(a===o)u=[e[a].slice(r,s)];else{if(u=e.slice(a,o),r>-1){const d=u[0];typeof d=="string"?u[0]=d.slice(r):u.shift()}s>0&&u.push(e[o].slice(0,s))}return u}function bO(e,n){let a=-1;const r=[];let o;for(;++a<e.length;){const s=e[a];let u;if(typeof s=="string")u=s;else switch(s){case-5:{u="\r";break}case-4:{u=`
1139
- `;break}case-3:{u=`\r
1140
- `;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&o)continue;u=" ";break}default:u=String.fromCharCode(s)}o=s===-2,r.push(u)}return r.join("")}function wO(e){const r={constructs:uw([yO,...(e||{}).extensions||[]]),content:o(z3),defined:[],document:o(P3),flow:o(nO),lazy:{},string:o(rO),text:o(lO)};return r;function o(s){return u;function u(d){return vO(r,s,d)}}}function SO(e){for(;!mw(e););return e}const E1=/[\0\t\n\r]/g;function kO(){let e=1,n="",a=!0,r;return o;function o(s,u,d){const p=[];let f,y,g,x,b;for(s=n+(typeof s=="string"?s.toString():new TextDecoder(u||void 0).decode(s)),g=0,n="",a&&(s.charCodeAt(0)===65279&&g++,a=void 0);g<s.length;){if(E1.lastIndex=g,f=E1.exec(s),x=f&&f.index!==void 0?f.index:s.length,b=s.charCodeAt(x),!f){n=s.slice(g);break}if(b===10&&g===x&&r)p.push(-3),r=void 0;else switch(r&&(p.push(-5),r=void 0),g<x&&(p.push(s.slice(g,x)),e+=x-g),b){case 0:{p.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,p.push(-2);e++<y;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:r=!0,e=1}g=x+1}return d&&(r&&p.push(-5),n&&p.push(n),p.push(null)),p}}const CO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function EO(e){return e.replace(CO,AO)}function AO(e,n,a){if(n)return n;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),s=o===120||o===88;return dw(a.slice(s?2:1),s?16:10)}return qh(a)||e}const ww={}.hasOwnProperty;function jO(e,n,a){return n&&typeof n=="object"&&(a=n,n=void 0),TO(a)(SO(wO(a).document().write(kO()(e,n,!0))))}function TO(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Nt),autolinkProtocol:L,autolinkEmail:L,atxHeading:s(Zt),blockQuote:s(et),characterEscape:L,characterReference:L,codeFenced:s(Ot),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(Ot,u),codeText:s(xt,u),codeTextData:L,data:L,codeFlowValue:L,definition:s(bt),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(yt),hardBreakEscape:s(Ue),hardBreakTrailing:s(Ue),htmlFlow:s(pt,u),htmlFlowData:L,htmlText:s(pt,u),htmlTextData:L,image:s(Dt),label:u,link:s(Nt),listItem:s(Mt),listItemValue:x,listOrdered:s(ge,g),listUnordered:s(ge),paragraph:s(qn),reference:N,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(Zt),strong:s(yn),thematicBreak:s(fe)},exit:{atxHeading:p(),atxHeadingSequence:U,autolink:p(),autolinkEmail:Ne,autolinkProtocol:Oe,blockQuote:p(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:he,characterReference:be,codeFenced:p(j),codeFencedFence:C,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:T,codeIndented:p(E),codeText:p(K),codeTextData:T,data:T,definition:p(),definitionDestinationString:G,definitionLabelString:R,definitionTitleString:O,emphasis:p(),hardBreakEscape:p(V),hardBreakTrailing:p(V),htmlFlow:p(ie),htmlFlowData:T,htmlText:p(B),htmlTextData:T,image:p(Z),label:X,labelText:ne,lineEnding:F,link:p(P),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ue,resourceDestinationString:D,resourceTitleString:M,resource:Q,setextHeading:p(H),setextHeadingLineSequence:W,setextHeadingText:_,strong:p(),thematicBreak:p()}};Sw(n,(e||{}).mdastExtensions||[]);const a={};return r;function r($){let le={type:"root",children:[]};const me={stack:[le],tokenStack:[],config:n,enter:d,exit:f,buffer:u,resume:y,data:a},ye=[];let I=-1;for(;++I<$.length;)if($[I][1].type==="listOrdered"||$[I][1].type==="listUnordered")if($[I][0]==="enter")ye.push(I);else{const Te=ye.pop();I=o($,Te,I)}for(I=-1;++I<$.length;){const Te=n[$[I][0]];ww.call(Te,$[I][1].type)&&Te[$[I][1].type].call(Object.assign({sliceSerialize:$[I][2].sliceSerialize},me),$[I][1])}if(me.tokenStack.length>0){const Te=me.tokenStack[me.tokenStack.length-1];(Te[1]||A1).call(me,void 0,Te[0])}for(le.position={start:Ti($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:Ti($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},I=-1;++I<n.transforms.length;)le=n.transforms[I](le)||le;return le}function o($,le,me){let ye=le-1,I=-1,Te=!1,at,Pe,Xe,Ve;for(;++ye<=me;){const ke=$[ye];switch(ke[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ke[0]==="enter"?I++:I--,Ve=void 0;break}case"lineEndingBlank":{ke[0]==="enter"&&(at&&!Ve&&!I&&!Xe&&(Xe=ye),Ve=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ve=void 0}if(!I&&ke[0]==="enter"&&ke[1].type==="listItemPrefix"||I===-1&&ke[0]==="exit"&&(ke[1].type==="listUnordered"||ke[1].type==="listOrdered")){if(at){let Wt=ye;for(Pe=void 0;Wt--;){const rt=$[Wt];if(rt[1].type==="lineEnding"||rt[1].type==="lineEndingBlank"){if(rt[0]==="exit")continue;Pe&&($[Pe][1].type="lineEndingBlank",Te=!0),rt[1].type="lineEnding",Pe=Wt}else if(!(rt[1].type==="linePrefix"||rt[1].type==="blockQuotePrefix"||rt[1].type==="blockQuotePrefixWhitespace"||rt[1].type==="blockQuoteMarker"||rt[1].type==="listItemIndent"))break}Xe&&(!Pe||Xe<Pe)&&(at._spread=!0),at.end=Object.assign({},Pe?$[Pe][1].start:ke[1].end),$.splice(Pe||ye,0,["exit",at,ke[2]]),ye++,me++}if(ke[1].type==="listItemPrefix"){const Wt={type:"listItem",_spread:!1,start:Object.assign({},ke[1].start),end:void 0};at=Wt,$.splice(ye,0,["enter",Wt,ke[2]]),ye++,me++,Xe=void 0,Ve=!0}}}return $[le][1]._spread=Te,me}function s($,le){return me;function me(ye){d.call(this,$(ye),ye),le&&le.call(this,ye)}}function u(){this.stack.push({type:"fragment",children:[]})}function d($,le,me){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([le,me||void 0]),$.position={start:Ti(le.start),end:void 0}}function p($){return le;function le(me){$&&$.call(this,me),f.call(this,me)}}function f($,le){const me=this.stack.pop(),ye=this.tokenStack.pop();if(ye)ye[0].type!==$.type&&(le?le.call(this,$,ye[0]):(ye[1]||A1).call(this,$,ye[0]));else throw new Error("Cannot close `"+$.type+"` ("+jo({start:$.start,end:$.end})+"): it’s not open");me.position.end=Ti($.end)}function y(){return $h(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x($){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function b(){const $=this.resume(),le=this.stack[this.stack.length-1];le.lang=$}function k(){const $=this.resume(),le=this.stack[this.stack.length-1];le.meta=$}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const $=this.resume(),le=this.stack[this.stack.length-1];le.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const $=this.resume(),le=this.stack[this.stack.length-1];le.value=$.replace(/(\r?\n|\r)$/g,"")}function R($){const le=this.resume(),me=this.stack[this.stack.length-1];me.label=le,me.identifier=da(this.sliceSerialize($)).toLowerCase()}function O(){const $=this.resume(),le=this.stack[this.stack.length-1];le.title=$}function G(){const $=this.resume(),le=this.stack[this.stack.length-1];le.url=$}function U($){const le=this.stack[this.stack.length-1];if(!le.depth){const me=this.sliceSerialize($).length;le.depth=me}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function W($){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function L($){const me=this.stack[this.stack.length-1].children;let ye=me[me.length-1];(!ye||ye.type!=="text")&&(ye=it(),ye.position={start:Ti($.start),end:void 0},me.push(ye)),this.stack.push(ye)}function T($){const le=this.stack.pop();le.value+=this.sliceSerialize($),le.position.end=Ti($.end)}function F($){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const me=le.children[le.children.length-1];me.position.end=Ti($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(le.type)&&(L.call(this,$),T.call(this,$))}function V(){this.data.atHardBreak=!0}function ie(){const $=this.resume(),le=this.stack[this.stack.length-1];le.value=$}function B(){const $=this.resume(),le=this.stack[this.stack.length-1];le.value=$}function K(){const $=this.resume(),le=this.stack[this.stack.length-1];le.value=$}function P(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=le,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function Z(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=le,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function ne($){const le=this.sliceSerialize($),me=this.stack[this.stack.length-2];me.label=EO(le),me.identifier=da(le).toLowerCase()}function X(){const $=this.stack[this.stack.length-1],le=this.resume(),me=this.stack[this.stack.length-1];if(this.data.inReference=!0,me.type==="link"){const ye=$.children;me.children=ye}else me.alt=le}function D(){const $=this.resume(),le=this.stack[this.stack.length-1];le.url=$}function M(){const $=this.resume(),le=this.stack[this.stack.length-1];le.title=$}function Q(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ue($){const le=this.resume(),me=this.stack[this.stack.length-1];me.label=le,me.identifier=da(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function pe($){this.data.characterReferenceType=$.type}function he($){const le=this.sliceSerialize($),me=this.data.characterReferenceType;let ye;me?(ye=dw(le,me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ye=qh(le);const I=this.stack[this.stack.length-1];I.value+=ye}function be($){const le=this.stack.pop();le.position.end=Ti($.end)}function Oe($){T.call(this,$);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize($)}function Ne($){T.call(this,$);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize($)}function et(){return{type:"blockquote",children:[]}}function Ot(){return{type:"code",lang:null,meta:null,value:""}}function xt(){return{type:"inlineCode",value:""}}function bt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function yt(){return{type:"emphasis",children:[]}}function Zt(){return{type:"heading",depth:0,children:[]}}function Ue(){return{type:"break"}}function pt(){return{type:"html",value:""}}function Dt(){return{type:"image",title:null,url:"",alt:null}}function Nt(){return{type:"link",title:null,url:"",children:[]}}function ge($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function Mt($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function qn(){return{type:"paragraph",children:[]}}function yn(){return{type:"strong",children:[]}}function it(){return{type:"text",value:""}}function fe(){return{type:"thematicBreak"}}}function Ti(e){return{line:e.line,column:e.column,offset:e.offset}}function Sw(e,n){let a=-1;for(;++a<n.length;){const r=n[a];Array.isArray(r)?Sw(e,r):NO(e,r)}}function NO(e,n){let a;for(a in n)if(ww.call(n,a))switch(a){case"canContainEols":{const r=n[a];r&&e[a].push(...r);break}case"transforms":{const r=n[a];r&&e[a].push(...r);break}case"enter":case"exit":{const r=n[a];r&&Object.assign(e[a],r);break}}}function A1(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+jo({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+jo({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+jo({start:n.start,end:n.end})+") is still open")}function RO(e){const n=this;n.parser=a;function a(r){return jO(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function _O(e,n){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,a),e.applyData(n,a)}function OO(e,n){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,a),[e.applyData(n,a),{type:"text",value:`
1141
- `}]}function DO(e,n){const a=n.value?n.value+`
1142
- `:"",r={},o=n.lang?n.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return n.meta&&(s.data={meta:n.meta}),e.patch(n,s),s=e.applyData(n,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(n,s),s}function MO(e,n){const a={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function LO(e,n){const a={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function zO(e,n){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),o=gl(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let u,d=e.footnoteCounts.get(r);d===void 0?(d=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=s+1,d+=1,e.footnoteCounts.set(r,d);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(n,p);const f={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(n,f),e.applyData(n,f)}function IO(e,n){const a={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function PO(e,n){if(e.options.allowDangerousHtml){const a={type:"raw",value:n.value};return e.patch(n,a),e.applyData(n,a)}}function kw(e,n){const a=n.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const o=e.all(n),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=r:o.push({type:"text",value:r}),o}function UO(e,n){const a=String(n.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return kw(e,n);const o={src:gl(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(n,s),e.applyData(n,s)}function BO(e,n){const a={src:gl(n.url)};n.alt!==null&&n.alt!==void 0&&(a.alt=n.alt),n.title!==null&&n.title!==void 0&&(a.title=n.title);const r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(n,r),e.applyData(n,r)}function HO(e,n){const a={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(n,r),e.applyData(n,r)}function $O(e,n){const a=String(n.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return kw(e,n);const o={href:gl(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const s={type:"element",tagName:"a",properties:o,children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function qO(e,n){const a={href:gl(n.url)};n.title!==null&&n.title!==void 0&&(a.title=n.title);const r={type:"element",tagName:"a",properties:a,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function FO(e,n,a){const r=e.all(n),o=a?GO(a):Cw(n),s={},u=[];if(typeof n.checked=="boolean"){const y=r[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let d=-1;for(;++d<r.length;){const y=r[d];(o||d!==0||y.type!=="element"||y.tagName!=="p")&&u.push({type:"text",value:`
1143
- `}),y.type==="element"&&y.tagName==="p"&&!o?u.push(...y.children):u.push(y)}const p=r[r.length-1];p&&(o||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:`
1144
- `});const f={type:"element",tagName:"li",properties:s,children:u};return e.patch(n,f),e.applyData(n,f)}function GO(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const a=e.children;let r=-1;for(;!n&&++r<a.length;)n=Cw(a[r])}return n}function Cw(e){const n=e.spread;return n??e.children.length>1}function VO(e,n){const a={},r=e.all(n);let o=-1;for(typeof n.start=="number"&&n.start!==1&&(a.start=n.start);++o<r.length;){const u=r[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const s={type:"element",tagName:n.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(n,s),e.applyData(n,s)}function WO(e,n){const a={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function YO(e,n){const a={type:"root",children:e.wrap(e.all(n))};return e.patch(n,a),e.applyData(n,a)}function KO(e,n){const a={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function QO(e,n){const a=e.all(n),r=a.shift(),o=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],u),o.push(u)}if(a.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},d=Ph(n.children[1]),p=aw(n.children[n.children.length-1]);d&&p&&(u.position={start:d,end:p}),o.push(u)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(n,s),e.applyData(n,s)}function XO(e,n,a){const r=a?a.children:void 0,s=(r?r.indexOf(n):1)===0?"th":"td",u=a&&a.type==="table"?a.align:void 0,d=u?u.length:n.children.length;let p=-1;const f=[];for(;++p<d;){const g=n.children[p],x={},b=u?u[p]:void 0;b&&(x.align=b);let k={type:"element",tagName:s,properties:x,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),f.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(n,y),e.applyData(n,y)}function ZO(e,n){const a={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}const j1=9,T1=32;function JO(e){const n=String(e),a=/\r?\n|\r/g;let r=a.exec(n),o=0;const s=[];for(;r;)s.push(N1(n.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=a.exec(n);return s.push(N1(n.slice(o),o>0,!1)),s.join("")}function N1(e,n,a){let r=0,o=e.length;if(n){let s=e.codePointAt(r);for(;s===j1||s===T1;)r++,s=e.codePointAt(r)}if(a){let s=e.codePointAt(o-1);for(;s===j1||s===T1;)o--,s=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function eD(e,n){const a={type:"text",value:JO(String(n.value))};return e.patch(n,a),e.applyData(n,a)}function tD(e,n){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,a),e.applyData(n,a)}const nD={blockquote:_O,break:OO,code:DO,delete:MO,emphasis:LO,footnoteReference:zO,heading:IO,html:PO,imageReference:UO,image:BO,inlineCode:HO,linkReference:$O,link:qO,listItem:FO,list:VO,paragraph:WO,root:YO,strong:KO,table:QO,tableCell:ZO,tableRow:XO,text:eD,thematicBreak:tD,toml:gc,yaml:gc,definition:gc,footnoteDefinition:gc};function gc(){}const Ew=-1,su=0,No=1,Gc=2,Gh=3,Vh=4,Wh=5,Yh=6,Aw=7,jw=8,aD=typeof self=="object"?self:globalThis,R1=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new aD[e](n)},iD=(e,n)=>{const a=(o,s)=>(e.set(s,o),o),r=o=>{if(e.has(o))return e.get(o);const[s,u]=n[o];switch(s){case su:case Ew:return a(u,o);case No:{const d=a([],o);for(const p of u)d.push(r(p));return d}case Gc:{const d=a({},o);for(const[p,f]of u)d[r(p)]=r(f);return d}case Gh:return a(new Date(u),o);case Vh:{const{source:d,flags:p}=u;return a(new RegExp(d,p),o)}case Wh:{const d=a(new Map,o);for(const[p,f]of u)d.set(r(p),r(f));return d}case Yh:{const d=a(new Set,o);for(const p of u)d.add(r(p));return d}case Aw:{const{name:d,message:p}=u;return a(R1(d,p),o)}case jw:return a(BigInt(u),o);case"BigInt":return a(Object(BigInt(u)),o);case"ArrayBuffer":return a(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:d}=new Uint8Array(u);return a(new DataView(d),u)}}return a(R1(s,u),o)};return r},_1=e=>iD(new Map,e)(0),Jr="",{toString:rD}={},{keys:lD}=Object,xo=e=>{const n=typeof e;if(n!=="object"||!e)return[su,n];const a=rD.call(e).slice(8,-1);switch(a){case"Array":return[No,Jr];case"Object":return[Gc,Jr];case"Date":return[Gh,Jr];case"RegExp":return[Vh,Jr];case"Map":return[Wh,Jr];case"Set":return[Yh,Jr];case"DataView":return[No,a]}return a.includes("Array")?[No,a]:a.includes("Error")?[Aw,a]:[Gc,a]},yc=([e,n])=>e===su&&(n==="function"||n==="symbol"),oD=(e,n,a,r)=>{const o=(u,d)=>{const p=r.push(u)-1;return a.set(d,p),p},s=u=>{if(a.has(u))return a.get(u);let[d,p]=xo(u);switch(d){case su:{let y=u;switch(p){case"bigint":d=jw,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return o([Ew],u)}return o([d,y],u)}case No:{if(p){let x=u;return p==="DataView"?x=new Uint8Array(u.buffer):p==="ArrayBuffer"&&(x=new Uint8Array(u)),o([p,[...x]],u)}const y=[],g=o([d,y],u);for(const x of u)y.push(s(x));return g}case Gc:{if(p)switch(p){case"BigInt":return o([p,u.toString()],u);case"Boolean":case"Number":case"String":return o([p,u.valueOf()],u)}if(n&&"toJSON"in u)return s(u.toJSON());const y=[],g=o([d,y],u);for(const x of lD(u))(e||!yc(xo(u[x])))&&y.push([s(x),s(u[x])]);return g}case Gh:return o([d,u.toISOString()],u);case Vh:{const{source:y,flags:g}=u;return o([d,{source:y,flags:g}],u)}case Wh:{const y=[],g=o([d,y],u);for(const[x,b]of u)(e||!(yc(xo(x))||yc(xo(b))))&&y.push([s(x),s(b)]);return g}case Yh:{const y=[],g=o([d,y],u);for(const x of u)(e||!yc(xo(x)))&&y.push(s(x));return g}}const{message:f}=u;return o([d,{name:p,message:f}],u)};return s},O1=(e,{json:n,lossy:a}={})=>{const r=[];return oD(!(n||a),!!n,new Map,r)(e),r},Vc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?_1(O1(e,n)):structuredClone(e):(e,n)=>_1(O1(e,n));function sD(e,n){const a=[{type:"text",value:"↩"}];return n>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),a}function cD(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function uD(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||sD,r=e.options.footnoteBackLabel||cD,o=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let p=-1;for(;++p<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[p]);if(!f)continue;const y=e.all(f),g=String(f.identifier).toUpperCase(),x=gl(g.toLowerCase());let b=0;const k=[],C=e.footnoteCounts.get(g);for(;C!==void 0&&++b<=C;){k.length>0&&k.push({type:"text",value:" "});let R=typeof a=="string"?a:a(p,b);typeof R=="string"&&(R={type:"text",value:R}),k.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(p,b),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const j=y[y.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const R=j.children[j.children.length-1];R&&R.type==="text"?R.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...k)}else y.push(...k);const E={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(y,!0)};e.patch(f,E),d.push(E)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Vc(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
1145
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
1146
- `}]}}const cu=(function(e){if(e==null)return hD;if(typeof e=="function")return uu(e);if(typeof e=="object")return Array.isArray(e)?dD(e):fD(e);if(typeof e=="string")return pD(e);throw new Error("Expected function, string, or object as test")});function dD(e){const n=[];let a=-1;for(;++a<e.length;)n[a]=cu(e[a]);return uu(r);function r(...o){let s=-1;for(;++s<n.length;)if(n[s].apply(this,o))return!0;return!1}}function fD(e){const n=e;return uu(a);function a(r){const o=r;let s;for(s in e)if(o[s]!==n[s])return!1;return!0}}function pD(e){return uu(n);function n(a){return a&&a.type===e}}function uu(e){return n;function n(a,r,o){return!!(mD(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function hD(){return!0}function mD(e){return e!==null&&typeof e=="object"&&"type"in e}const Tw=[],gD=!0,Wp=!1,yD="skip";function Nw(e,n,a,r){let o;typeof n=="function"&&typeof a!="function"?(r=a,a=n):o=n;const s=cu(o),u=r?-1:1;d(e,void 0,[])();function d(p,f,y){const g=p&&typeof p=="object"?p:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(p.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=Tw,k,C,j;if((!n||s(p,f,y[y.length-1]||void 0))&&(b=vD(a(p,y)),b[0]===Wp))return b;if("children"in p&&p.children){const E=p;if(E.children&&b[0]!==yD)for(C=(r?E.children.length:-1)+u,j=y.concat(E);C>-1&&C<E.children.length;){const R=E.children[C];if(k=d(R,C,j)(),k[0]===Wp)return k;C=typeof k[1]=="number"?k[1]:C+u}}return b}}}function vD(e){return Array.isArray(e)?e:typeof e=="number"?[gD,e]:e==null?Tw:[e]}function Kh(e,n,a,r){let o,s,u;typeof n=="function"&&typeof a!="function"?(s=void 0,u=n,o=a):(s=n,u=a,o=r),Nw(e,s,d,o);function d(p,f){const y=f[f.length-1],g=y?y.children.indexOf(p):void 0;return u(p,g,y)}}const Yp={}.hasOwnProperty,xD={};function bD(e,n){const a=n||xD,r=new Map,o=new Map,s=new Map,u={...nD,...a.handlers},d={all:f,applyData:SD,definitionById:r,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:u,one:p,options:a,patch:wD,wrap:CD};return Kh(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?r:o,x=String(y.identifier).toUpperCase();g.has(x)||g.set(x,y)}}),d;function p(y,g){const x=y.type,b=d.handlers[x];if(Yp.call(d.handlers,x)&&b)return b(d,y,g);if(d.options.passThrough&&d.options.passThrough.includes(x)){if("children"in y){const{children:C,...j}=y,E=Vc(j);return E.children=d.all(y),E}return Vc(y)}return(d.options.unknownHandler||kD)(d,y,g)}function f(y){const g=[];if("children"in y){const x=y.children;let b=-1;for(;++b<x.length;){const k=d.one(x[b],y);if(k){if(b&&x[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=D1(k.value)),!Array.isArray(k)&&k.type==="element")){const C=k.children[0];C&&C.type==="text"&&(C.value=D1(C.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function wD(e,n){e.position&&(n.position=s3(e))}function SD(e,n){let a=n;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const u="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:u}}a.type==="element"&&s&&Object.assign(a.properties,Vc(s)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function kD(e,n){const a=n.data||{},r="value"in n&&!(Yp.call(a,"hProperties")||Yp.call(a,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function CD(e,n){const a=[];let r=-1;for(n&&a.push({type:"text",value:`
1147
- `});++r<e.length;)r&&a.push({type:"text",value:`
1148
- `}),a.push(e[r]);return n&&e.length>0&&a.push({type:"text",value:`
1149
- `}),a}function D1(e){let n=0,a=e.charCodeAt(n);for(;a===9||a===32;)n++,a=e.charCodeAt(n);return e.slice(n)}function M1(e,n){const a=bD(e,n),r=a.one(e,void 0),o=uD(a),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
1150
- `},o),s}function ED(e,n){return e&&"run"in e?async function(a,r){const o=M1(a,{file:r,...n});await e.run(o,r)}:function(a,r){return M1(a,{file:r,...e||n})}}function L1(e){if(e)throw e}var rp,z1;function AD(){if(z1)return rp;z1=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):n.call(f)==="[object Array]"},s=function(f){if(!f||n.call(f)!=="[object Object]")return!1;var y=e.call(f,"constructor"),g=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!y&&!g)return!1;var x;for(x in f);return typeof x>"u"||e.call(f,x)},u=function(f,y){a&&y.name==="__proto__"?a(f,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):f[y.name]=y.newValue},d=function(f,y){if(y==="__proto__")if(e.call(f,y)){if(r)return r(f,y).value}else return;return f[y]};return rp=function p(){var f,y,g,x,b,k,C=arguments[0],j=1,E=arguments.length,R=!1;for(typeof C=="boolean"&&(R=C,C=arguments[1]||{},j=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});j<E;++j)if(f=arguments[j],f!=null)for(y in f)g=d(C,y),x=d(f,y),C!==x&&(R&&x&&(s(x)||(b=o(x)))?(b?(b=!1,k=g&&o(g)?g:[]):k=g&&s(g)?g:{},u(C,{name:y,newValue:p(R,k,x)})):typeof x<"u"&&u(C,{name:y,newValue:x}));return C},rp}var jD=AD();const lp=Po(jD);function Kp(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function TD(){const e=[],n={run:a,use:r};return n;function a(...o){let s=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);d(null,...o);function d(p,...f){const y=e[++s];let g=-1;if(p){u(p);return}for(;++g<o.length;)(f[g]===null||f[g]===void 0)&&(f[g]=o[g]);o=f,y?ND(y,d)(...f):u(null,...f)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),n}}function ND(e,n){let a;return r;function r(...u){const d=e.length>u.length;let p;d&&u.push(o);try{p=e.apply(this,u)}catch(f){const y=f;if(d&&a)throw y;return o(y)}d||(p&&p.then&&typeof p.then=="function"?p.then(s,o):p instanceof Error?o(p):s(p))}function o(u,...d){a||(a=!0,n(u,...d))}function s(u){o(null,u)}}const ka={basename:RD,dirname:_D,extname:OD,join:DD,sep:"/"};function RD(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Go(e);let a=0,r=-1,o=e.length,s;if(n===void 0||n.length===0||n.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){a=o+1;break}}else r<0&&(s=!0,r=o+1);return r<0?"":e.slice(a,r)}if(n===e)return"";let u=-1,d=n.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){a=o+1;break}}else u<0&&(s=!0,u=o+1),d>-1&&(e.codePointAt(o)===n.codePointAt(d--)?d<0&&(r=o):(d=-1,r=u));return a===r?r=u:r<0&&(r=e.length),e.slice(a,r)}function _D(e){if(Go(e),e.length===0)return".";let n=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){n=a;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function OD(e){Go(e);let n=e.length,a=-1,r=0,o=-1,s=0,u;for(;n--;){const d=e.codePointAt(n);if(d===47){if(u){r=n+1;break}continue}a<0&&(u=!0,a=n+1),d===46?o<0?o=n:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||a<0||s===0||s===1&&o===a-1&&o===r+1?"":e.slice(o,a)}function DD(...e){let n=-1,a;for(;++n<e.length;)Go(e[n]),e[n]&&(a=a===void 0?e[n]:a+"/"+e[n]);return a===void 0?".":MD(a)}function MD(e){Go(e);const n=e.codePointAt(0)===47;let a=LD(e,!n);return a.length===0&&!n&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),n?"/"+a:a}function LD(e,n){let a="",r=0,o=-1,s=0,u=-1,d,p;for(;++u<=e.length;){if(u<e.length)d=e.codePointAt(u);else{if(d===47)break;d=47}if(d===47){if(!(o===u-1||s===1))if(o!==u-1&&s===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",r=0):(a=a.slice(0,p),r=a.length-1-a.lastIndexOf("/")),o=u,s=0;continue}}else if(a.length>0){a="",r=0,o=u,s=0;continue}}n&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(o+1,u):a=e.slice(o+1,u),r=u-o-1;o=u,s=0}else d===46&&s>-1?s++:s=-1}return a}function Go(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const zD={cwd:ID};function ID(){return"/"}function Qp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function PD(e){if(typeof e=="string")e=new URL(e);else if(!Qp(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return UD(e)}function UD(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let a=-1;for(;++a<n.length;)if(n.codePointAt(a)===37&&n.codePointAt(a+1)===50){const r=n.codePointAt(a+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(n)}const op=["history","path","basename","stem","extname","dirname"];class Rw{constructor(n){let a;n?Qp(n)?a={path:n}:typeof n=="string"||BD(n)?a={value:n}:a=n:a={},this.cwd="cwd"in a?"":zD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<op.length;){const s=op[r];s in a&&a[s]!==void 0&&a[s]!==null&&(this[s]=s==="history"?[...a[s]]:a[s])}let o;for(o in a)op.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?ka.basename(this.path):void 0}set basename(n){cp(n,"basename"),sp(n,"basename"),this.path=ka.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ka.dirname(this.path):void 0}set dirname(n){I1(this.basename,"dirname"),this.path=ka.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ka.extname(this.path):void 0}set extname(n){if(sp(n,"extname"),I1(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ka.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Qp(n)&&(n=PD(n)),cp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ka.basename(this.path,this.extname):void 0}set stem(n){cp(n,"stem"),sp(n,"stem"),this.path=ka.join(this.dirname||"",n+(this.extname||""))}fail(n,a,r){const o=this.message(n,a,r);throw o.fatal=!0,o}info(n,a,r){const o=this.message(n,a,r);return o.fatal=void 0,o}message(n,a,r){const o=new on(n,a,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function sp(e,n){if(e&&e.includes(ka.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ka.sep+"`")}function cp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function I1(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function BD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const HD=(function(e){const r=this.constructor.prototype,o=r[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),$D={}.hasOwnProperty;class Qh extends HD{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=TD()}copy(){const n=new Qh;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];n.use(...r)}return n.data(lp(!0,{},this.namespace)),n}data(n,a){return typeof n=="string"?arguments.length===2?(fp("data",this.frozen),this.namespace[n]=a,this):$D.call(this.namespace,n)&&this.namespace[n]||void 0:n?(fp("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=a.call(n,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const a=vc(n),r=this.parser||this.Parser;return up("parse",r),r(String(a),a)}process(n,a){const r=this;return this.freeze(),up("process",this.parser||this.Parser),dp("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(s,u){const d=vc(n),p=r.parse(d);r.run(p,d,function(y,g,x){if(y||!g||!x)return f(y);const b=g,k=r.stringify(b,x);GD(k)?x.value=k:x.result=k,f(y,x)});function f(y,g){y||!g?u(y):s?s(g):a(void 0,g)}}}processSync(n){let a=!1,r;return this.freeze(),up("processSync",this.parser||this.Parser),dp("processSync",this.compiler||this.Compiler),this.process(n,o),U1("processSync","process",a),r;function o(s,u){a=!0,L1(s),r=u}}run(n,a,r){P1(n),this.freeze();const o=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?s(void 0,r):new Promise(s);function s(u,d){const p=vc(a);o.run(n,p,f);function f(y,g,x){const b=g||n;y?d(y):u?u(b):r(void 0,b,x)}}}runSync(n,a){let r=!1,o;return this.run(n,a,s),U1("runSync","run",r),o;function s(u,d){L1(u),o=d,r=!0}}stringify(n,a){this.freeze();const r=vc(a),o=this.compiler||this.Compiler;return dp("stringify",o),P1(n),o(n,r)}use(n,...a){const r=this.attachers,o=this.namespace;if(fp("use",this.frozen),n!=null)if(typeof n=="function")p(n,a);else if(typeof n=="object")Array.isArray(n)?d(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function s(f){if(typeof f=="function")p(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[y,...g]=f;p(y,g)}else u(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function u(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(f.plugins),f.settings&&(o.settings=lp(!0,o.settings,f.settings))}function d(f){let y=-1;if(f!=null)if(Array.isArray(f))for(;++y<f.length;){const g=f[y];s(g)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function p(f,y){let g=-1,x=-1;for(;++g<r.length;)if(r[g][0]===f){x=g;break}if(x===-1)r.push([f,...y]);else if(y.length>0){let[b,...k]=y;const C=r[x][1];Kp(C)&&Kp(b)&&(b=lp(!0,C,b)),r[x]=[f,b,...k]}}}}const qD=new Qh().freeze();function up(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fp(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function P1(e){if(!Kp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function U1(e,n,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function vc(e){return FD(e)?e:new Rw(e)}function FD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function GD(e){return typeof e=="string"||VD(e)}function VD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const WD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",B1=[],H1={allowDangerousHtml:!0},YD=/^(https?|ircs?|mailto|xmpp)$/i,KD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function QD(e){const n=XD(e),a=ZD(e);return JD(n.runSync(n.parse(a),a),e)}function XD(e){const n=e.rehypePlugins||B1,a=e.remarkPlugins||B1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...H1}:H1;return qD().use(RO).use(a).use(ED,r).use(n)}function ZD(e){const n=e.children||"",a=new Rw;return typeof n=="string"&&(a.value=n),a}function JD(e,n){const a=n.allowedElements,r=n.allowElement,o=n.components,s=n.disallowedElements,u=n.skipHtml,d=n.unwrapDisallowed,p=n.urlTransform||eM;for(const y of KD)Object.hasOwn(n,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+WD+y.id,void 0);return Kh(e,f),p3(e,{Fragment:m.Fragment,components:o,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function f(y,g,x){if(y.type==="raw"&&x&&typeof g=="number")return u?x.children.splice(g,1):x.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let b;for(b in np)if(Object.hasOwn(np,b)&&Object.hasOwn(y.properties,b)){const k=y.properties[b],C=np[b];(C===null||C.includes(y.tagName))&&(y.properties[b]=p(String(k||""),b,y))}}if(y.type==="element"){let b=a?!a.includes(y.tagName):s?s.includes(y.tagName):!1;if(!b&&r&&typeof g=="number"&&(b=!r(y,g,x)),b&&x&&typeof g=="number")return d&&y.children?x.children.splice(g,1,...y.children):x.children.splice(g,1),g}}}function eM(e){const n=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return n===-1||o!==-1&&n>o||a!==-1&&n>a||r!==-1&&n>r||YD.test(e.slice(0,n))?e:""}function $1(e,n){const a=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,o=a.indexOf(n);for(;o!==-1;)r++,o=a.indexOf(n,o+n.length);return r}function tM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _w(e,n,a){const o=cu((a||{}).ignore||[]),s=nM(n);let u=-1;for(;++u<s.length;)Nw(e,"text",d);function d(f,y){let g=-1,x;for(;++g<y.length;){const b=y[g],k=x?x.children:void 0;if(o(b,k?k.indexOf(b):void 0,x))return;x=b}if(x)return p(f,y)}function p(f,y){const g=y[y.length-1],x=s[u][0],b=s[u][1];let k=0;const j=g.children.indexOf(f);let E=!1,R=[];x.lastIndex=0;let O=x.exec(f.value);for(;O;){const G=O.index,U={index:O.index,input:O.input,stack:[...y,f]};let _=b(...O,U);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?x.lastIndex=G+1:(k!==G&&R.push({type:"text",value:f.value.slice(k,G)}),Array.isArray(_)?R.push(..._):_&&R.push(_),k=G+O[0].length,E=!0),!x.global)break;O=x.exec(f.value)}return E?(k<f.value.length&&R.push({type:"text",value:f.value.slice(k)}),g.children.splice(j,1,...R)):R=[f],j+R.length}}function nM(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const o=a[r];n.push([aM(o[0]),iM(o[1])])}return n}function aM(e){return typeof e=="string"?new RegExp(tM(e),"g"):e}function iM(e){return typeof e=="function"?e:function(){return e}}const pp="phrasing",hp=["autolink","link","image","label"];function rM(){return{transforms:[fM],enter:{literalAutolink:oM,literalAutolinkEmail:mp,literalAutolinkHttp:mp,literalAutolinkWww:mp},exit:{literalAutolink:dM,literalAutolinkEmail:uM,literalAutolinkHttp:sM,literalAutolinkWww:cM}}}function lM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pp,notInConstruct:hp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pp,notInConstruct:hp},{character:":",before:"[ps]",after:"\\/",inConstruct:pp,notInConstruct:hp}]}}function oM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mp(e){this.config.enter.autolinkProtocol.call(this,e)}function sM(e){this.config.exit.autolinkProtocol.call(this,e)}function cM(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function uM(e){this.config.exit.autolinkEmail.call(this,e)}function dM(e){this.exit(e)}function fM(e){_w(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,pM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),hM]],{ignore:["link","linkReference"]})}function pM(e,n,a,r,o){let s="";if(!Ow(o)||(/^w/i.test(n)&&(a=n+a,n="",s="http://"),!mM(a)))return!1;const u=gM(a+r);if(!u[0])return!1;const d={type:"link",title:null,url:s+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[d,{type:"text",value:u[1]}]:d}function hM(e,n,a,r){return!Ow(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+a,children:[{type:"text",value:n+"@"+a}]}}function mM(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function gM(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let a=n[0],r=a.indexOf(")");const o=$1(e,"(");let s=$1(e,")");for(;r!==-1&&o>s;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),s++;return[e,a]}function Ow(e,n){const a=e.input.charCodeAt(e.index-1);return(e.index===0||cr(a)||lu(a))&&(!n||a!==47)}Dw.peek=EM;function yM(){this.buffer()}function vM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function xM(){this.buffer()}function bM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function wM(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=da(this.sliceSerialize(e)).toLowerCase(),a.label=n}function SM(e){this.exit(e)}function kM(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=da(this.sliceSerialize(e)).toLowerCase(),a.label=n}function CM(e){this.exit(e)}function EM(){return"["}function Dw(e,n,a,r){const o=a.createTracker(r);let s=o.move("[^");const u=a.enter("footnoteReference"),d=a.enter("reference");return s+=o.move(a.safe(a.associationId(e),{after:"]",before:s})),d(),u(),s+=o.move("]"),s}function AM(){return{enter:{gfmFootnoteCallString:yM,gfmFootnoteCall:vM,gfmFootnoteDefinitionLabelString:xM,gfmFootnoteDefinition:bM},exit:{gfmFootnoteCallString:wM,gfmFootnoteCall:SM,gfmFootnoteDefinitionLabelString:kM,gfmFootnoteDefinition:CM}}}function jM(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:a,footnoteReference:Dw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,o,s,u){const d=s.createTracker(u);let p=d.move("[^");const f=s.enter("footnoteDefinition"),y=s.enter("label");return p+=d.move(s.safe(s.associationId(r),{before:p,after:"]"})),y(),p+=d.move("]:"),r.children&&r.children.length>0&&(d.shift(4),p+=d.move((n?`
1151
- `:" ")+s.indentLines(s.containerFlow(r,d.current()),n?Mw:TM))),f(),p}}function TM(e,n,a){return n===0?e:Mw(e,n,a)}function Mw(e,n,a){return(a?"":" ")+e}const NM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Lw.peek=MM;function RM(){return{canContainEols:["delete"],enter:{strikethrough:OM},exit:{strikethrough:DM}}}function _M(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:NM}],handlers:{delete:Lw}}}function OM(e){this.enter({type:"delete",children:[]},e)}function DM(e){this.exit(e)}function Lw(e,n,a,r){const o=a.createTracker(r),s=a.enter("strikethrough");let u=o.move("~~");return u+=a.containerPhrasing(e,{...o.current(),before:u,after:"~"}),u+=o.move("~~"),s(),u}function MM(){return"~"}function LM(e){return e.length}function zM(e,n){const a=n||{},r=(a.align||[]).concat(),o=a.stringLength||LM,s=[],u=[],d=[],p=[];let f=0,y=-1;for(;++y<e.length;){const C=[],j=[];let E=-1;for(e[y].length>f&&(f=e[y].length);++E<e[y].length;){const R=IM(e[y][E]);if(a.alignDelimiters!==!1){const O=o(R);j[E]=O,(p[E]===void 0||O>p[E])&&(p[E]=O)}C.push(R)}u[y]=C,d[y]=j}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<f;)s[g]=q1(r[g]);else{const C=q1(r);for(;++g<f;)s[g]=C}g=-1;const x=[],b=[];for(;++g<f;){const C=s[g];let j="",E="";C===99?(j=":",E=":"):C===108?j=":":C===114&&(E=":");let R=a.alignDelimiters===!1?1:Math.max(1,p[g]-j.length-E.length);const O=j+"-".repeat(R)+E;a.alignDelimiters!==!1&&(R=j.length+R+E.length,R>p[g]&&(p[g]=R),b[g]=R),x[g]=O}u.splice(1,0,x),d.splice(1,0,b),y=-1;const k=[];for(;++y<u.length;){const C=u[y],j=d[y];g=-1;const E=[];for(;++g<f;){const R=C[g]||"";let O="",G="";if(a.alignDelimiters!==!1){const U=p[g]-(j[g]||0),_=s[g];_===114?O=" ".repeat(U):_===99?U%2?(O=" ".repeat(U/2+.5),G=" ".repeat(U/2-.5)):(O=" ".repeat(U/2),G=O):G=" ".repeat(U)}a.delimiterStart!==!1&&!g&&E.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&R==="")&&(a.delimiterStart!==!1||g)&&E.push(" "),a.alignDelimiters!==!1&&E.push(O),E.push(R),a.alignDelimiters!==!1&&E.push(G),a.padding!==!1&&E.push(" "),(a.delimiterEnd!==!1||g!==f-1)&&E.push("|")}k.push(a.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
1152
- `)}function IM(e){return e==null?"":String(e)}function q1(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function PM(e,n,a,r){const o=a.enter("blockquote"),s=a.createTracker(r);s.move("> "),s.shift(2);const u=a.indentLines(a.containerFlow(e,s.current()),UM);return o(),u}function UM(e,n,a){return">"+(a?"":" ")+e}function BM(e,n){return F1(e,n.inConstruct,!0)&&!F1(e,n.notInConstruct,!1)}function F1(e,n,a){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return a;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function G1(e,n,a,r){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
1153
- `&&BM(a.stack,a.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
1154
- `}function HM(e,n){const a=String(e);let r=a.indexOf(n),o=r,s=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++s>u&&(u=s):s=1,o=r+n.length,r=a.indexOf(n,o);return u}function $M(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function qM(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function FM(e,n,a,r){const o=qM(a),s=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if($M(e,a)){const g=a.enter("codeIndented"),x=a.indentLines(s,GM);return g(),x}const d=a.createTracker(r),p=o.repeat(Math.max(HM(s,o)+1,3)),f=a.enter("codeFenced");let y=d.move(p);if(e.lang){const g=a.enter(`codeFencedLang${u}`);y+=d.move(a.safe(e.lang,{before:y,after:" ",encode:["`"],...d.current()})),g()}if(e.lang&&e.meta){const g=a.enter(`codeFencedMeta${u}`);y+=d.move(" "),y+=d.move(a.safe(e.meta,{before:y,after:`
1155
- `,encode:["`"],...d.current()})),g()}return y+=d.move(`
1156
- `),s&&(y+=d.move(s+`
1157
- `)),y+=d.move(p),f(),y}function GM(e,n,a){return(a?"":" ")+e}function Xh(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function VM(e,n,a,r){const o=Xh(a),s=o==='"'?"Quote":"Apostrophe",u=a.enter("definition");let d=a.enter("label");const p=a.createTracker(r);let f=p.move("[");return f+=p.move(a.safe(a.associationId(e),{before:f,after:"]",...p.current()})),f+=p.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=a.enter("destinationLiteral"),f+=p.move("<"),f+=p.move(a.safe(e.url,{before:f,after:">",...p.current()})),f+=p.move(">")):(d=a.enter("destinationRaw"),f+=p.move(a.safe(e.url,{before:f,after:e.title?" ":`
1158
- `,...p.current()}))),d(),e.title&&(d=a.enter(`title${s}`),f+=p.move(" "+o),f+=p.move(a.safe(e.title,{before:f,after:o,...p.current()})),f+=p.move(o),d()),u(),f}function WM(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function zo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Wc(e,n,a){const r=ll(e),o=ll(n);return r===void 0?o===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}zw.peek=YM;function zw(e,n,a,r){const o=WM(a),s=a.enter("emphasis"),u=a.createTracker(r),d=u.move(o);let p=u.move(a.containerPhrasing(e,{after:o,before:d,...u.current()}));const f=p.charCodeAt(0),y=Wc(r.before.charCodeAt(r.before.length-1),f,o);y.inside&&(p=zo(f)+p.slice(1));const g=p.charCodeAt(p.length-1),x=Wc(r.after.charCodeAt(0),g,o);x.inside&&(p=p.slice(0,-1)+zo(g));const b=u.move(o);return s(),a.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},d+p+b}function YM(e,n,a){return a.options.emphasis||"*"}function KM(e,n){let a=!1;return Kh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,Wp}),!!((!e.depth||e.depth<3)&&$h(e)&&(n.options.setext||a))}function QM(e,n,a,r){const o=Math.max(Math.min(6,e.depth||1),1),s=a.createTracker(r);if(KM(e,a)){const y=a.enter("headingSetext"),g=a.enter("phrasing"),x=a.containerPhrasing(e,{...s.current(),before:`
1159
- `,after:`
1160
- `});return g(),y(),x+`
1161
- `+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
1162
- `))+1))}const u="#".repeat(o),d=a.enter("headingAtx"),p=a.enter("phrasing");s.move(u+" ");let f=a.containerPhrasing(e,{before:"# ",after:`
1163
- `,...s.current()});return/^[\t ]/.test(f)&&(f=zo(f.charCodeAt(0))+f.slice(1)),f=f?u+" "+f:u,a.options.closeAtx&&(f+=" "+u),p(),d(),f}Iw.peek=XM;function Iw(e){return e.value||""}function XM(){return"<"}Pw.peek=ZM;function Pw(e,n,a,r){const o=Xh(a),s=o==='"'?"Quote":"Apostrophe",u=a.enter("image");let d=a.enter("label");const p=a.createTracker(r);let f=p.move("![");return f+=p.move(a.safe(e.alt,{before:f,after:"]",...p.current()})),f+=p.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=a.enter("destinationLiteral"),f+=p.move("<"),f+=p.move(a.safe(e.url,{before:f,after:">",...p.current()})),f+=p.move(">")):(d=a.enter("destinationRaw"),f+=p.move(a.safe(e.url,{before:f,after:e.title?" ":")",...p.current()}))),d(),e.title&&(d=a.enter(`title${s}`),f+=p.move(" "+o),f+=p.move(a.safe(e.title,{before:f,after:o,...p.current()})),f+=p.move(o),d()),f+=p.move(")"),u(),f}function ZM(){return"!"}Uw.peek=JM;function Uw(e,n,a,r){const o=e.referenceType,s=a.enter("imageReference");let u=a.enter("label");const d=a.createTracker(r);let p=d.move("![");const f=a.safe(e.alt,{before:p,after:"]",...d.current()});p+=d.move(f+"]["),u();const y=a.stack;a.stack=[],u=a.enter("reference");const g=a.safe(a.associationId(e),{before:p,after:"]",...d.current()});return u(),a.stack=y,s(),o==="full"||!f||f!==g?p+=d.move(g+"]"):o==="shortcut"?p=p.slice(0,-1):p+=d.move("]"),p}function JM(){return"!"}Bw.peek=e6;function Bw(e,n,a){let r=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<a.unsafe.length;){const u=a.unsafe[s],d=a.compilePattern(u);let p;if(u.atBreak)for(;p=d.exec(r);){let f=p.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(p.index+1)}}return o+r+o}function e6(){return"`"}function Hw(e,n){const a=$h(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}$w.peek=t6;function $w(e,n,a,r){const o=Xh(a),s=o==='"'?"Quote":"Apostrophe",u=a.createTracker(r);let d,p;if(Hw(e,a)){const y=a.stack;a.stack=[],d=a.enter("autolink");let g=u.move("<");return g+=u.move(a.containerPhrasing(e,{before:g,after:">",...u.current()})),g+=u.move(">"),d(),a.stack=y,g}d=a.enter("link"),p=a.enter("label");let f=u.move("[");return f+=u.move(a.containerPhrasing(e,{before:f,after:"](",...u.current()})),f+=u.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(a.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(p=a.enter("destinationRaw"),f+=u.move(a.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),p(),e.title&&(p=a.enter(`title${s}`),f+=u.move(" "+o),f+=u.move(a.safe(e.title,{before:f,after:o,...u.current()})),f+=u.move(o),p()),f+=u.move(")"),d(),f}function t6(e,n,a){return Hw(e,a)?"<":"["}qw.peek=n6;function qw(e,n,a,r){const o=e.referenceType,s=a.enter("linkReference");let u=a.enter("label");const d=a.createTracker(r);let p=d.move("[");const f=a.containerPhrasing(e,{before:p,after:"]",...d.current()});p+=d.move(f+"]["),u();const y=a.stack;a.stack=[],u=a.enter("reference");const g=a.safe(a.associationId(e),{before:p,after:"]",...d.current()});return u(),a.stack=y,s(),o==="full"||!f||f!==g?p+=d.move(g+"]"):o==="shortcut"?p=p.slice(0,-1):p+=d.move("]"),p}function n6(){return"["}function Zh(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function a6(e){const n=Zh(e),a=e.options.bulletOther;if(!a)return n==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+a+"`) to be different");return a}function i6(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Fw(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function r6(e,n,a,r){const o=a.enter("list"),s=a.bulletCurrent;let u=e.ordered?i6(a):Zh(a);const d=e.ordered?u==="."?")":".":a6(a);let p=n&&a.bulletLastUsed?u===a.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),Fw(a)===u&&y){let g=-1;for(;++g<e.children.length;){const x=e.children[g];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(u=d),a.bulletCurrent=u;const f=a.containerFlow(e,r);return a.bulletLastUsed=u,a.bulletCurrent=s,o(),f}function l6(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function o6(e,n,a,r){const o=l6(a);let s=a.bulletCurrent||Zh(a);n&&n.type==="list"&&n.ordered&&(s=(typeof n.start=="number"&&n.start>-1?n.start:1)+(a.options.incrementListMarker===!1?0:n.children.indexOf(e))+s);let u=s.length+1;(o==="tab"||o==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const d=a.createTracker(r);d.move(s+" ".repeat(u-s.length)),d.shift(u);const p=a.enter("listItem"),f=a.indentLines(a.containerFlow(e,d.current()),y);return p(),f;function y(g,x,b){return x?(b?"":" ".repeat(u))+g:(b?s:s+" ".repeat(u-s.length))+g}}function s6(e,n,a,r){const o=a.enter("paragraph"),s=a.enter("phrasing"),u=a.containerPhrasing(e,r);return s(),o(),u}const c6=cu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function u6(e,n,a,r){return(e.children.some(function(u){return c6(u)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function d6(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Gw.peek=f6;function Gw(e,n,a,r){const o=d6(a),s=a.enter("strong"),u=a.createTracker(r),d=u.move(o+o);let p=u.move(a.containerPhrasing(e,{after:o,before:d,...u.current()}));const f=p.charCodeAt(0),y=Wc(r.before.charCodeAt(r.before.length-1),f,o);y.inside&&(p=zo(f)+p.slice(1));const g=p.charCodeAt(p.length-1),x=Wc(r.after.charCodeAt(0),g,o);x.inside&&(p=p.slice(0,-1)+zo(g));const b=u.move(o+o);return s(),a.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},d+p+b}function f6(e,n,a){return a.options.strong||"*"}function p6(e,n,a,r){return a.safe(e.value,r)}function h6(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function m6(e,n,a){const r=(Fw(a)+(a.options.ruleSpaces?" ":"")).repeat(h6(a));return a.options.ruleSpaces?r.slice(0,-1):r}const Vw={blockquote:PM,break:G1,code:FM,definition:VM,emphasis:zw,hardBreak:G1,heading:QM,html:Iw,image:Pw,imageReference:Uw,inlineCode:Bw,link:$w,linkReference:qw,list:r6,listItem:o6,paragraph:s6,root:u6,strong:Gw,text:p6,thematicBreak:m6};function g6(){return{enter:{table:y6,tableData:V1,tableHeader:V1,tableRow:x6},exit:{codeText:b6,table:v6,tableData:gp,tableHeader:gp,tableRow:gp}}}function y6(e){const n=e._align;this.enter({type:"table",align:n.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function v6(e){this.exit(e),this.data.inTable=void 0}function x6(e){this.enter({type:"tableRow",children:[]},e)}function gp(e){this.exit(e)}function V1(e){this.enter({type:"tableCell",children:[]},e)}function b6(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,w6));const a=this.stack[this.stack.length-1];a.type,a.value=n,this.exit(e)}function w6(e,n){return n==="|"?n:e}function S6(e){const n=e||{},a=n.tableCellPadding,r=n.tablePipeAlign,o=n.stringLength,s=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
1164
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:u,tableCell:p,tableRow:d}};function u(b,k,C,j){return f(y(b,C,j),b.align)}function d(b,k,C,j){const E=g(b,C,j),R=f([E]);return R.slice(0,R.indexOf(`
1165
- `))}function p(b,k,C,j){const E=C.enter("tableCell"),R=C.enter("phrasing"),O=C.containerPhrasing(b,{...j,before:s,after:s});return R(),E(),O}function f(b,k){return zM(b,{align:k,alignDelimiters:r,padding:a,stringLength:o})}function y(b,k,C){const j=b.children;let E=-1;const R=[],O=k.enter("table");for(;++E<j.length;)R[E]=g(j[E],k,C);return O(),R}function g(b,k,C){const j=b.children;let E=-1;const R=[],O=k.enter("tableRow");for(;++E<j.length;)R[E]=p(j[E],b,k,C);return O(),R}function x(b,k,C){let j=Vw.inlineCode(b,k,C);return C.stack.includes("tableCell")&&(j=j.replace(/\|/g,"\\$&")),j}}function k6(){return{exit:{taskListCheckValueChecked:W1,taskListCheckValueUnchecked:W1,paragraph:E6}}}function C6(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:A6}}}function W1(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function E6(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const o=n.children;let s=-1,u;for(;++s<o.length;){const d=o[s];if(d.type==="paragraph"){u=d;break}}u===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function A6(e,n,a,r){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",d=a.createTracker(r);s&&d.move(u);let p=Vw.listItem(e,n,a,{...r,...d.current()});return s&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),p;function f(y){return y+u}}function j6(){return[rM(),AM(),RM(),g6(),k6()]}function T6(e){return{extensions:[lM(),jM(e),_M(),S6(e),C6()]}}const N6={tokenize:L6,partial:!0},Ww={tokenize:z6,partial:!0},Yw={tokenize:I6,partial:!0},Kw={tokenize:P6,partial:!0},R6={tokenize:U6,partial:!0},Qw={name:"wwwAutolink",tokenize:D6,previous:Zw},Xw={name:"protocolAutolink",tokenize:M6,previous:Jw},ei={name:"emailAutolink",tokenize:O6,previous:eS},Aa={};function _6(){return{text:Aa}}let ir=48;for(;ir<123;)Aa[ir]=ei,ir++,ir===58?ir=65:ir===91&&(ir=97);Aa[43]=ei;Aa[45]=ei;Aa[46]=ei;Aa[95]=ei;Aa[72]=[ei,Xw];Aa[104]=[ei,Xw];Aa[87]=[ei,Qw];Aa[119]=[ei,Qw];function O6(e,n,a){const r=this;let o,s;return u;function u(g){return!Xp(g)||!eS.call(r,r.previous)||Jh(r.events)?a(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(g))}function d(g){return Xp(g)?(e.consume(g),d):g===64?(e.consume(g),p):a(g)}function p(g){return g===46?e.check(R6,y,f)(g):g===45||g===95||ln(g)?(s=!0,e.consume(g),p):y(g)}function f(g){return e.consume(g),o=!0,p}function y(g){return s&&o&&pn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(g)):a(g)}}function D6(e,n,a){const r=this;return o;function o(u){return u!==87&&u!==119||!Zw.call(r,r.previous)||Jh(r.events)?a(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(N6,e.attempt(Ww,e.attempt(Yw,s),a),a)(u))}function s(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function M6(e,n,a){const r=this;let o="",s=!1;return u;function u(g){return(g===72||g===104)&&Jw.call(r,r.previous)&&!Jh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),e.consume(g),d):a(g)}function d(g){if(pn(g)&&o.length<5)return o+=String.fromCodePoint(g),e.consume(g),d;if(g===58){const x=o.toLowerCase();if(x==="http"||x==="https")return e.consume(g),p}return a(g)}function p(g){return g===47?(e.consume(g),s?f:(s=!0,p)):a(g)}function f(g){return g===null||Fc(g)||gt(g)||cr(g)||lu(g)?a(g):e.attempt(Ww,e.attempt(Yw,y),a)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(g)}}function L6(e,n,a){let r=0;return o;function o(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),o):u===46&&r===3?(e.consume(u),s):a(u)}function s(u){return u===null?a(u):n(u)}}function z6(e,n,a){let r,o,s;return u;function u(f){return f===46||f===95?e.check(Kw,p,d)(f):f===null||gt(f)||cr(f)||f!==45&&lu(f)?p(f):(s=!0,e.consume(f),u)}function d(f){return f===95?r=!0:(o=r,r=void 0),e.consume(f),u}function p(f){return o||r||!s?a(f):n(f)}}function I6(e,n){let a=0,r=0;return o;function o(u){return u===40?(a++,e.consume(u),o):u===41&&r<a?s(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(Kw,n,s)(u):u===null||gt(u)||cr(u)?n(u):(e.consume(u),o)}function s(u){return u===41&&r++,e.consume(u),o}}function P6(e,n,a){return r;function r(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),r):d===38?(e.consume(d),s):d===93?(e.consume(d),o):d===60||d===null||gt(d)||cr(d)?n(d):a(d)}function o(d){return d===null||d===40||d===91||gt(d)||cr(d)?n(d):r(d)}function s(d){return pn(d)?u(d):a(d)}function u(d){return d===59?(e.consume(d),r):pn(d)?(e.consume(d),u):a(d)}}function U6(e,n,a){return r;function r(s){return e.consume(s),o}function o(s){return ln(s)?a(s):n(s)}}function Zw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gt(e)}function Jw(e){return!pn(e)}function eS(e){return!(e===47||Xp(e))}function Xp(e){return e===43||e===45||e===46||e===95||ln(e)}function Jh(e){let n=e.length,a=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const B6={tokenize:Y6,partial:!0};function H6(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:G6,continuation:{tokenize:V6},exit:W6}},text:{91:{name:"gfmFootnoteCall",tokenize:F6},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:$6,resolveTo:q6}}}}function $6(e,n,a){const r=this;let o=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;o--;){const p=r.events[o][1];if(p.type==="labelImage"){u=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return d;function d(p){if(!u||!u._balanced)return a(p);const f=da(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!s.includes(f.slice(1))?a(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),n(p))}}function q6(e,n){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},d=[e[a+1],e[a+2],["enter",r,n],e[a+3],e[a+4],["enter",o,n],["exit",o,n],["enter",s,n],["enter",u,n],["exit",u,n],["exit",s,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(a,e.length-a+1,...d),e}function F6(e,n,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,u;return d;function d(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?a(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(g){if(s>999||g===93&&!u||g===null||g===91||gt(g))return a(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return o.includes(da(r.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):a(g)}return gt(g)||(u=!0),s++,e.consume(g),g===92?y:f}function y(g){return g===91||g===92||g===93?(e.consume(g),s++,f):f(g)}}function G6(e,n,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,u=0,d;return p;function p(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):a(k)}function y(k){if(u>999||k===93&&!d||k===null||k===91||gt(k))return a(k);if(k===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return s=da(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return gt(k)||(d=!0),u++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),u++,y):y(k)}function x(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),o.includes(s)||o.push(s),Ke(e,b,"gfmFootnoteDefinitionWhitespace")):a(k)}function b(k){return n(k)}}function V6(e,n,a){return e.check(Fo,n,e.attempt(B6,n,a))}function W6(e){e.exit("gfmFootnoteDefinition")}function Y6(e,n,a){const r=this;return Ke(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(s):a(s)}}function K6(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:o};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(u,d){let p=-1;for(;++p<u.length;)if(u[p][0]==="enter"&&u[p][1].type==="strikethroughSequenceTemporary"&&u[p][1]._close){let f=p;for(;f--;)if(u[f][0]==="exit"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._open&&u[p][1].end.offset-u[p][1].start.offset===u[f][1].end.offset-u[f][1].start.offset){u[p][1].type="strikethroughSequence",u[f][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[f][1].start),end:Object.assign({},u[p][1].end)},g={type:"strikethroughText",start:Object.assign({},u[f][1].end),end:Object.assign({},u[p][1].start)},x=[["enter",y,d],["enter",u[f][1],d],["exit",u[f][1],d],["enter",g,d]],b=d.parser.constructs.insideSpan.null;b&&Hn(x,x.length,0,ou(b,u.slice(f+1,p),d)),Hn(x,x.length,0,[["exit",g,d],["enter",u[p][1],d],["exit",u[p][1],d],["exit",y,d]]),Hn(u,f-1,p-f+3,x),p=f+x.length-2;break}}for(p=-1;++p<u.length;)u[p][1].type==="strikethroughSequenceTemporary"&&(u[p][1].type="data");return u}function s(u,d,p){const f=this.previous,y=this.events;let g=0;return x;function x(k){return f===126&&y[y.length-1][1].type!=="characterEscape"?p(k):(u.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const C=ll(f);if(k===126)return g>1?p(k):(u.consume(k),g++,b);if(g<2&&!a)return p(k);const j=u.exit("strikethroughSequenceTemporary"),E=ll(k);return j._open=!E||E===2&&!!C,j._close=!C||C===2&&!!E,d(k)}}}class Q6{constructor(){this.map=[]}add(n,a,r){X6(this,n,a,r)}consume(n){if(this.map.sort(function(s,u){return s[0]-u[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(n.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),n.length=this.map[a][0];r.push(n.slice()),n.length=0;let o=r.pop();for(;o;){for(const s of o)n.push(s);o=r.pop()}this.map.length=0}}function X6(e,n,a,r){let o=0;if(!(a===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===n){e.map[o][1]+=a,e.map[o][2].push(...r);return}o+=1}e.map.push([n,a,r])}}function Z6(e,n){let a=!1;const r=[];for(;n<e.length;){const o=e[n];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);n+=1}return r}function J6(){return{flow:{null:{name:"table",tokenize:e5,resolveAll:t5}}}}function e5(e,n,a){const r=this;let o=0,s=0,u;return d;function d(T){let F=r.events.length-1;for(;F>-1;){const B=r.events[F][1].type;if(B==="lineEnding"||B==="linePrefix")F--;else break}const V=F>-1?r.events[F][1].type:null,ie=V==="tableHead"||V==="tableRow"?_:p;return ie===_&&r.parser.lazy[r.now().line]?a(T):ie(T)}function p(T){return e.enter("tableHead"),e.enter("tableRow"),f(T)}function f(T){return T===124||(u=!0,s+=1),y(T)}function y(T){return T===null?a(T):Ae(T)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),b):a(T):qe(T)?Ke(e,y,"whitespace")(T):(s+=1,u&&(u=!1,o+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),g(T)))}function g(T){return T===null||T===124||gt(T)?(e.exit("data"),y(T)):(e.consume(T),T===92?x:g)}function x(T){return T===92||T===124?(e.consume(T),g):g(T)}function b(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(T):(e.enter("tableDelimiterRow"),u=!1,qe(T)?Ke(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):k(T))}function k(T){return T===45||T===58?j(T):T===124?(u=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),C):U(T)}function C(T){return qe(T)?Ke(e,j,"whitespace")(T):j(T)}function j(T){return T===58?(s+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),E):T===45?(s+=1,E(T)):T===null||Ae(T)?G(T):U(T)}function E(T){return T===45?(e.enter("tableDelimiterFiller"),R(T)):U(T)}function R(T){return T===45?(e.consume(T),R):T===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(T))}function O(T){return qe(T)?Ke(e,G,"whitespace")(T):G(T)}function G(T){return T===124?k(T):T===null||Ae(T)?!u||o!==s?U(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(T)):U(T)}function U(T){return a(T)}function _(T){return e.enter("tableRow"),W(T)}function W(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),W):T===null||Ae(T)?(e.exit("tableRow"),n(T)):qe(T)?Ke(e,W,"whitespace")(T):(e.enter("data"),H(T))}function H(T){return T===null||T===124||gt(T)?(e.exit("data"),W(T)):(e.consume(T),T===92?L:H)}function L(T){return T===92||T===124?(e.consume(T),H):H(T)}}function t5(e,n){let a=-1,r=!0,o=0,s=[0,0,0,0],u=[0,0,0,0],d=!1,p=0,f,y,g;const x=new Q6;for(;++a<e.length;){const b=e[a],k=b[1];b[0]==="enter"?k.type==="tableHead"?(d=!1,p!==0&&(Y1(x,n,p,f,y),y=void 0,p=0),f={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.add(a,0,[["enter",f,n]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,g=void 0,s=[0,0,0,0],u=[0,a+1,0,0],d&&(d=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.add(a,0,[["enter",y,n]])),o=k.type==="tableDelimiterRow"?2:y?3:1):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(s[1]!==0&&(u[0]=u[1],g=xc(x,n,s,o,void 0,g),s=[0,0,0,0]),u[2]=a)):k.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(u[0]=u[1],g=xc(x,n,s,o,void 0,g)),s=u,u=[s[1],a,0,0])):k.type==="tableHead"?(d=!0,p=a):k.type==="tableRow"||k.type==="tableDelimiterRow"?(p=a,s[1]!==0?(u[0]=u[1],g=xc(x,n,s,o,a,g)):u[1]!==0&&(g=xc(x,n,u,o,a,g)),o=0):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=a)}for(p!==0&&Y1(x,n,p,f,y),x.consume(n.events),a=-1;++a<n.events.length;){const b=n.events[a];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=Z6(n.events,a))}return e}function xc(e,n,a,r,o,s){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",d="tableContent";a[0]!==0&&(s.end=Object.assign({},el(n.events,a[0])),e.add(a[0],0,[["exit",s,n]]));const p=el(n.events,a[1]);if(s={type:u,start:Object.assign({},p),end:Object.assign({},p)},e.add(a[1],0,[["enter",s,n]]),a[2]!==0){const f=el(n.events,a[2]),y=el(n.events,a[3]),g={type:d,start:Object.assign({},f),end:Object.assign({},y)};if(e.add(a[2],0,[["enter",g,n]]),r!==2){const x=n.events[a[2]],b=n.events[a[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",a[3]>a[2]+1){const k=a[2]+1,C=a[3]-a[2]-1;e.add(k,C,[])}}e.add(a[3]+1,0,[["exit",g,n]])}return o!==void 0&&(s.end=Object.assign({},el(n.events,o)),e.add(o,0,[["exit",s,n]]),s=void 0),s}function Y1(e,n,a,r,o){const s=[],u=el(n.events,a);o&&(o.end=Object.assign({},u),s.push(["exit",o,n])),r.end=Object.assign({},u),s.push(["exit",r,n]),e.add(a+1,0,s)}function el(e,n){const a=e[n],r=a[0]==="enter"?"start":"end";return a[1][r]}const n5={name:"tasklistCheck",tokenize:i5};function a5(){return{text:{91:n5}}}function i5(e,n,a){const r=this;return o;function o(p){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),s)}function s(p){return gt(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),u):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),u):a(p)}function u(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):a(p)}function d(p){return Ae(p)?n(p):qe(p)?e.check({tokenize:r5},n,a)(p):a(p)}}function r5(e,n,a){return Ke(e,r,"whitespace");function r(o){return o===null?a(o):n(o)}}function l5(e){return uw([_6(),H6(),K6(e),J6(),a5()])}const o5={};function s5(e){const n=this,a=e||o5,r=n.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(l5(a)),s.push(j6()),u.push(T6(a))}function c5(e){_w(e,[/\r?\n|\r/g,u5])}function u5(){return{type:"break"}}function d5(){return function(e){c5(e)}}const tS=[{aliases:{sh:"sh",shell:"sh",zsh:"sh",bash:"bash"},load:()=>nt(()=>import("./bash-Yzrsuije.js"),[])},{aliases:{css:"css"},load:()=>nt(()=>import("./css-CLj8gQPS.js"),[])},{aliases:{diff:"diff",patch:"diff"},load:()=>nt(()=>import("./diff-D97Zzqfu.js"),[])},{aliases:{dockerfile:"dockerfile",docker:"dockerfile"},load:()=>nt(()=>import("./dockerfile-BcOcwvcX.js"),[])},{aliases:{go:"go",golang:"go"},load:()=>nt(()=>import("./go-C27-OAKa.js"),[])},{aliases:{html:"html"},load:()=>nt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]))},{aliases:{js:"js",javascript:"js"},load:()=>nt(()=>import("./javascript-wDzz0qaB.js"),[])},{aliases:{json:"json"},load:()=>nt(()=>import("./json-Cp-IABpG.js"),[])},{aliases:{jsx:"jsx"},load:()=>nt(()=>import("./jsx-g9-lgVsj.js"),[])},{aliases:{md:"md",markdown:"md"},load:()=>nt(()=>import("./markdown-Cvjx9yec.js"),[])},{aliases:{py:"py",python:"py"},load:()=>nt(()=>import("./python-B6aJPvgy.js"),[])},{aliases:{rust:"rust",rs:"rust"},load:()=>nt(()=>import("./rust-B1yitclQ.js"),[])},{aliases:{solidity:"solidity",sol:"solidity"},load:()=>nt(()=>import("./solidity-rGO070M0.js"),[])},{aliases:{sparql:"sparql"},load:()=>nt(()=>import("./sparql-DVZY-KUA.js"),[])},{aliases:{sql:"sql"},load:()=>nt(()=>import("./sql-BLtJtn59.js"),[])},{aliases:{toml:"toml"},load:()=>nt(()=>import("./toml-vGWfd6FD.js"),[])},{aliases:{tsx:"tsx"},load:()=>nt(()=>import("./tsx-COt5Ahok.js"),[])},{aliases:{ts:"ts",typescript:"ts"},load:()=>nt(()=>import("./typescript-BPQ3VLAy.js"),[])},{aliases:{xml:"xml"},load:()=>nt(()=>import("./xml-B8PEiB0p.js"),[])},{aliases:{yaml:"yaml",yml:"yaml"},load:()=>nt(()=>import("./yaml-Buea-lGh.js"),[])}],nS=Object.freeze(Object.assign({},...tS.map(({aliases:e})=>e)));Object.freeze(Object.keys(nS));function f5(e){if(!e)return null;const n=e.toLowerCase().trim();return nS[n]??null}async function i9(){return(await Promise.all(tS.map(({load:n})=>n()))).flatMap(({default:n})=>n).filter((n,a,r)=>r.findIndex(o=>o.name===n.name)===a)}let bo=null;function p5(){return bo||(bo=nt(()=>import("./shikiHighlighter-ByXDJnWi.js"),[]).then(e=>e.createHighlighter()).catch(e=>{throw bo=null,e}),bo)}function h5({code:e,lang:n}){const a=f5(n),[r,o]=S.useState(null),[s,u]=S.useState(!1),p=aa(g=>g.theme)==="light"?"github-light":"github-dark",f=S.useRef(null);S.useEffect(()=>{if(!a){o(null);return}let g=!1;return p5().then(x=>{if(!g)try{o(x.codeToHtml(e,{lang:a,theme:p}))}catch{o(null)}}).catch(()=>{g||o(null)}),()=>{g=!0}},[e,a,p]),S.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const y=async()=>{try{await navigator.clipboard.writeText(e),u(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>u(!1),1200)}catch{}};return m.jsxs("div",{className:"v10-md-pre",children:[m.jsx("button",{type:"button",className:"v10-md-copy",onClick:y,"aria-label":s?"Copied":"Copy code",title:s?"Copied":"Copy code",children:s?m.jsx(LT,{size:14,"aria-hidden":"true"}):m.jsx(BT,{size:14,"aria-hidden":"true"})}),m.jsx("span",{className:"v10-md-copy-announce","aria-live":"polite",children:s?"Copied":""}),a&&m.jsx("span",{className:"v10-md-pre-lang","aria-hidden":"true",children:a}),r?m.jsx("div",{className:"v10-md-pre-rendered",dangerouslySetInnerHTML:{__html:r}}):m.jsx("pre",{className:"v10-md-pre-fallback",children:m.jsx("code",{children:e})})]})}function m5(){return e=>{let n="none",a=null;const r=new Set(["img","hr","br"]),o=(d,p)=>{const f=d.children;if(Array.isArray(f))for(let y=0;y<f.length;y++){const g=f[y];if(g.type==="text"&&typeof g.value=="string"&&g.value.trim().length>0)p?n="code":(a={siblings:f,index:y},n="text");else if(g.type==="element"){const x=g.tagName;x==="pre"?(n="code",o(g,!0)):x&&r.has(x)?n="leaf":o(g,p)}}},s=e;o(s,!1);const u={type:"element",tagName:"span",properties:{className:["v10-chat-cursor"]},children:[]};if(n==="text"&&a){const{siblings:d,index:p}=a;d.splice(p+1,0,u)}else n==="leaf"&&Array.isArray(s.children)&&s.children.push(u)}}function g5(e){return e?/^https?:\/\//i.test(e)?"http":/^mailto:/i.test(e)?"mailto":"inert":"inert"}function aS({content:e,streaming:n}){return m.jsx("div",{className:"v10-md",children:m.jsx(QD,{remarkPlugins:[s5,d5],rehypePlugins:n?[m5]:[],components:{img:({src:a,alt:r,title:o})=>m.jsxs("span",{className:"v10-md-image-placeholder",title:o||(typeof a=="string"?a:void 0),children:["[image",r?`: ${r}`:"","]"]}),h1:({children:a})=>m.jsx("h1",{className:"v10-md-h1",children:a}),h2:({children:a})=>m.jsx("h2",{className:"v10-md-h2",children:a}),h3:({children:a})=>m.jsx("h3",{className:"v10-md-h3",children:a}),h4:({children:a})=>m.jsx("h4",{className:"v10-md-h4",children:a}),h5:({children:a})=>m.jsx("h5",{className:"v10-md-h5",children:a}),h6:({children:a})=>m.jsx("h6",{className:"v10-md-h6",children:a}),p:({children:a})=>m.jsx("p",{className:"v10-md-p",children:a}),ul:({children:a})=>m.jsx("ul",{className:"v10-md-ul",children:a}),ol:({children:a})=>m.jsx("ol",{className:"v10-md-ol",children:a}),li:({children:a})=>m.jsx("li",{className:"v10-md-li",children:a}),a:({href:a,children:r})=>{const o=g5(a);return o==="http"?m.jsx("a",{className:"v10-md-link",href:a,target:"_blank",rel:"noopener noreferrer",children:r}):o==="mailto"?m.jsx("a",{className:"v10-md-link",href:a,children:r}):m.jsx("span",{className:"v10-md-link v10-md-link-inert",title:a,children:r})},blockquote:({children:a})=>m.jsx("blockquote",{className:"v10-md-blockquote",children:a}),hr:()=>m.jsx("hr",{className:"v10-md-hr"}),table:({children:a})=>m.jsx("div",{className:"v10-md-table-scroll",children:m.jsx("table",{className:"v10-md-table",children:a})}),thead:({children:a,node:r,...o})=>m.jsx("thead",{className:"v10-md-thead",...o,children:a}),tbody:({children:a,node:r,...o})=>m.jsx("tbody",{className:"v10-md-tbody",...o,children:a}),tr:({children:a,node:r,...o})=>m.jsx("tr",{className:"v10-md-tr",...o,children:a}),th:({children:a,node:r,...o})=>m.jsx("th",{className:"v10-md-th",...o,children:a}),td:({children:a,node:r,...o})=>m.jsx("td",{className:"v10-md-td",...o,children:a}),pre:({children:a,node:r})=>{var s,u,d;const o=(s=r==null?void 0:r.children)==null?void 0:s[0];if((o==null?void 0:o.tagName)==="code"){const p=((d=(u=o.properties)==null?void 0:u.className)==null?void 0:d[0])??"",f=/language-([\w-]+)/.exec(p),y=(o.children??[]).map(g=>(g==null?void 0:g.value)??"").join("").replace(/\n$/,"");return m.jsx(h5,{code:y,lang:f==null?void 0:f[1]})}return m.jsx("pre",{children:a})},code:({children:a})=>m.jsx("code",{className:"v10-md-code",children:a})},children:e})})}const y5=m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),v5=Ja(()=>nt(()=>import("./Operations-mCPe0E-j.js"),__vite__mapDeps([3,4])).then(e=>e.OperationsPage),"operations"),x5=Ja(()=>nt(()=>import("./AgentHub-4c4sH_Jd.js"),[]).then(e=>e.AgentHubPage),"agent hub"),b5=Ja(()=>nt(()=>import("./Settings-D1oxLo1Y.js"),[]).then(e=>e.SettingsPage),"settings"),w5=Ja(()=>nt(()=>import("./AgentProfilePage-ClhUeZxy.js"),__vite__mapDeps([5,6,7])).then(e=>e.AgentProfilePage),"account"),S5=Ja(()=>nt(()=>import("./PublishingConviction-BGi128uo.js"),__vite__mapDeps([8,9,10])).then(e=>e.PublishingConvictionPage),"Publisher Conviction"),k5=Ja(()=>nt(()=>import("./ConvictionDetailView-a3v7xwcm.js"),__vite__mapDeps([11,10,9])).then(e=>e.ConvictionDetailView),"account"),C5=Ja(()=>nt(()=>import("./ProjectView-jrGPu5ON.js"),__vite__mapDeps([12,6,7,9,13,14])).then(e=>e.ProjectView),"project"),yp=Ja(()=>nt(()=>import("./MemoryLayerView-DxL2MjyA.js"),__vite__mapDeps([15,13])).then(e=>e.MemoryLayerView),({layer:e})=>({wm:"working memory",swm:"shared memory",vm:"verifiable memory"})[e]),E5=Ja(()=>nt(()=>import("./MemoryStackView-BLhA3bn0.js"),__vite__mapDeps([16,7])).then(e=>e.MemoryStackView),"memory stack");function A5(){const{tabs:e,activeTabId:n,setActiveTab:a,closeTab:r}=mn();return m.jsx("div",{className:"v10-center-tabs",children:e.map(o=>m.jsxs("button",{className:`v10-center-tab ${o.id===n?"active":""}`,onClick:()=>a(o.id),children:[m.jsx("span",{className:"v10-center-tab-label",children:o.label}),o.closable&&m.jsx("span",{className:"v10-center-tab-close",onClick:s=>{s.stopPropagation(),r(o.id)},children:y5})]},o.id))})}const j5=["text/","application/json","application/xml","application/javascript","application/x-yaml"];function T5(e){return j5.some(n=>e.startsWith(n))}function N5({docRef:e,contentType:n}){const{tabs:a,activeTabId:r,closeTab:o}=mn(),s=mn(T=>T.setActiveTab),[u,d]=S.useState(null),[p,f]=S.useState(null),[y,g]=S.useState(""),[x,b]=S.useState(!0),[k,C]=S.useState(null),[j,E]=S.useState("formatted"),R=e.startsWith("urn:dkg:file:"),O=a.find(T=>T.id===r),G=(O==null?void 0:O.label)??"Document",U=()=>{const T=a.find(F=>F.id.startsWith("project:"));T&&s(T.id),o(r)};S.useEffect(()=>{let T=!1;if(b(!0),C(null),d(null),f(null),g(""),!R){b(!1);return}const F=e.replace("urn:dkg:file:",""),V=new AbortController;return fetch(FA(F,n||void 0),{headers:Vt(),signal:V.signal}).then(async ie=>{if(!ie.ok)throw new Error(`HTTP ${ie.status}`);const B=ie.headers.get("content-type")??"application/octet-stream";if(!T)if(g(B),T5(B)){const K=await ie.text();T||(d(K),b(!1))}else if(B.startsWith("image/")){const K=await ie.blob();T||(f(URL.createObjectURL(K)),b(!1))}else if(B==="application/pdf"){const K=await ie.blob();T||(f(URL.createObjectURL(K)),b(!1))}else{const K=await ie.text();T||(d(K),b(!1))}}).catch(ie=>{T||(C(ie.message),b(!1))}),()=>{T=!0,V.abort()}},[e,R,n]),S.useEffect(()=>{E("formatted")},[e]),S.useEffect(()=>{const T=p;return()=>{T&&URL.revokeObjectURL(T)}},[p]);const _=y.startsWith("image/"),W=y==="application/pdf",H=y.startsWith("text/markdown")||n.startsWith("text/markdown"),L=!x&&!k&&R&&H&&u!==null;return m.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[m.jsxs("div",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:10,padding:"8px 16px",borderBottom:"1px solid var(--border-subtle)",background:"var(--bg-panel)"},children:[m.jsx("button",{onClick:U,style:{border:"1px solid var(--border-default)",borderRadius:5,background:"none",color:"var(--text-secondary)",fontSize:11,fontWeight:600,padding:"4px 10px",cursor:"pointer",fontFamily:"var(--font-sans)"},children:"← Back to Project"}),m.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:["📄 ",G]}),L&&m.jsx("div",{role:"group","aria-label":"Document view mode",style:{marginLeft:"auto",display:"flex",gap:2,padding:2,border:"1px solid var(--border-default)",borderRadius:6,background:"var(--bg-surface)"},children:["formatted","raw"].map(T=>{const F=j===T;return m.jsx("button",{type:"button","aria-pressed":F,onClick:()=>E(T),style:{border:"none",borderRadius:4,cursor:"pointer",padding:"3px 12px",fontSize:11,fontWeight:600,fontFamily:"var(--font-sans)",color:F?"var(--text-primary)":"var(--text-secondary)",background:F?"var(--bg-elevated)":"transparent"},children:T==="formatted"?"Formatted":"Raw"},T)})})]}),m.jsx("div",{style:{flex:1,overflow:"auto",padding:"20px 24px"},children:R?m.jsxs(m.Fragment,{children:[x&&m.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:12},children:"Loading document..."}),k&&m.jsxs("div",{style:{color:"var(--accent-red)",fontSize:12},children:["Failed to load: ",k]}),!x&&_&&p&&m.jsx("img",{src:p,alt:G,style:{maxWidth:"100%",borderRadius:8}}),!x&&W&&p&&m.jsx("iframe",{src:p,title:G,style:{width:"100%",height:"100%",border:"none",borderRadius:8}}),u!==null&&!_&&!W&&H&&j==="formatted"&&m.jsx("div",{style:{background:"var(--bg-surface)",borderRadius:8,padding:"16px 20px",border:"1px solid var(--border-default)",color:"var(--text-primary)"},children:m.jsx(aS,{content:u})}),u!==null&&!_&&!W&&!(H&&j==="formatted")&&m.jsx("pre",{style:{fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.7,color:"var(--text-primary)",whiteSpace:"pre-wrap",wordBreak:"break-word",background:"var(--bg-surface)",borderRadius:8,padding:16,border:"1px solid var(--border-default)",margin:0},children:u})]}):m.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:10,height:"100%",color:"var(--text-tertiary)",textAlign:"center"},children:[m.jsx("span",{style:{fontSize:28,opacity:.6},children:"📄"}),m.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-secondary)"},children:"Source file not available for this document"}),m.jsx("span",{style:{fontSize:12,maxWidth:360,lineHeight:1.6},children:"This document was indexed into the graph without a stored source file, so there is nothing to preview here. You can still explore its extracted entities and relationships in the graph."})]})})]})}function R5(){const e=mn(n=>n.activeTabId);if(e==="dashboard")return m.jsx(M4,{});if(e==="operations")return m.jsx(v5,{});if(e==="agent-hub")return m.jsx(x5,{});if(e==="settings")return m.jsx(b5,{});if(e==="conviction")return m.jsx(S5,{});if(e==="memory-stack")return m.jsx(E5,{});if(e===Mh)return m.jsx(I4,{});if(e.startsWith("project:")){const n=e.slice(8);return m.jsx(C5,{contextGraphId:n})}if(e.startsWith("conviction:")){const n=e.slice(11);return m.jsx(k5,{accountId:n})}if(e.startsWith("agent:")){const n=e.slice(6),a=n.indexOf("|");if(a>0){const r=n.slice(0,a),o=n.slice(a+1),s=o.includes(":")?o:`urn:dkg:agent:${o}`;return m.jsx(w5,{contextGraphId:r,agentUri:s})}}if(e.startsWith(Lh)){const{docRef:n,contentType:a}=P4(e);return m.jsx(N5,{docRef:n,contentType:a})}return e.startsWith("wm:")?m.jsx(yp,{layer:"wm",contextGraphId:e.slice(3)}):e.startsWith("swm:")?m.jsx(yp,{layer:"swm",contextGraphId:e.slice(4)}):e.startsWith("vm:")?m.jsx(yp,{layer:"vm",contextGraphId:e.slice(3)}):m.jsx("div",{className:"v10-view-placeholder",children:m.jsxs("p",{style:{color:"var(--text-tertiary)",fontSize:12},children:['View "',e,'" coming soon.']})})}function _5(){return m.jsxs("div",{className:"v10-panel-center",children:[m.jsx(A5,{}),m.jsx("div",{className:"v10-center-content",children:m.jsx(R5,{})})]})}const O5=["Node Log","Transactions"],D5=m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:m.jsx("polyline",{points:"6 9 12 15 18 9"})}),M5=m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("polyline",{points:"15 3 21 3 21 9"}),m.jsx("polyline",{points:"9 21 3 21 3 15"}),m.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),m.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),L5=m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("polyline",{points:"4 14 10 14 10 20"}),m.jsx("polyline",{points:"20 10 14 10 14 4"}),m.jsx("line",{x1:"10",y1:"14",x2:"3",y2:"21"}),m.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"})]}),z5=/(\x1B\[[0-9;]*[mGKHFJA-Z]|\[[0-9;]*m)/g;function I5(e){return e.replace(z5,"")}function K1(e){const n=e.toLowerCase();return n.includes("error")||n.includes(" err ")||n.includes("[error]")?"error":n.includes("warn")||n.includes("[warn]")?"warn":n.includes("debug")||n.includes("[debug]")||n.includes("trace")?"debug":"info"}const P5={error:"var(--accent-red, #ef4444)",warn:"var(--accent-yellow, #f59e0b)",info:"var(--text-primary)",debug:"var(--text-tertiary)"};function U5(e){const n=S.useRef(null),a=S.useRef(!0);return S.useEffect(()=>{const r=n.current;if(!r)return;const o=()=>{a.current=r.scrollHeight-r.scrollTop-r.clientHeight<40};return r.addEventListener("scroll",o),()=>r.removeEventListener("scroll",o)},[]),S.useEffect(()=>{a.current&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e]),n}function B5(){const[e,n]=S.useState([]),[a,r]=S.useState(""),[o,s]=S.useState("all"),u=S.useCallback(()=>{Bn.fetchNodeLog({lines:300,q:a||void 0}).then(({lines:y})=>n((y??[]).map(I5))).catch(()=>{})},[a]);S.useEffect(()=>{u();const y=setInterval(u,3e3);return()=>clearInterval(y)},[u]);const d=e.filter(y=>o==="all"||K1(y)===o),p=d.length>0?d[d.length-1]:"",f=U5(p);return m.jsxs("div",{className:"v10-log-container",children:[m.jsxs("div",{className:"v10-log-toolbar",children:[m.jsx("input",{id:"dkg-node-log-filter",name:"dkg-node-log-filter",type:"text",placeholder:"Filter logs...",className:"v10-log-filter",value:a,onChange:y=>r(y.target.value),"aria-label":"Filter node log lines"}),m.jsxs("select",{id:"dkg-node-log-level",name:"dkg-node-log-level",className:"v10-log-level-select",value:o,onChange:y=>s(y.target.value),"aria-label":"Filter node log level",children:[m.jsx("option",{value:"all",children:"All"}),m.jsx("option",{value:"error",children:"Error"}),m.jsx("option",{value:"warn",children:"Warn"}),m.jsx("option",{value:"info",children:"Info"}),m.jsx("option",{value:"debug",children:"Debug"})]})]}),m.jsxs("div",{className:"v10-log-output",ref:f,children:[d.map((y,g)=>m.jsx("div",{className:"v10-log-line",style:{color:P5[K1(y)]},children:y},g)),d.length===0&&m.jsx("div",{className:"v10-log-line",style:{color:"var(--text-tertiary)"},children:"No log output"})]})]})}const H5=new Set(["publish","publishFromSWM","update","ka-update","verify","reconstruct"]),$5={publish:"#22c55e",publishFromSWM:"#16a34a",update:"#14b8a6","ka-update":"#0d9488",verify:"#8b5cf6",reconstruct:"#fb923c"};function q5(){const[e,n]=S.useState([]),[a,r]=S.useState(null),o=S.useCallback(()=>{const s=String(Date.now()-216e5),u=[...H5].join(",");Bn.fetchOperationsWithPhases({limit:"100",from:s,names:u}).then(d=>{n((d==null?void 0:d.operations)??[])}).catch(()=>{})},[]);return S.useEffect(()=>{o();const s=setInterval(o,1e4);return()=>clearInterval(s)},[o]),e.length===0?m.jsx("div",{style:{padding:"20px 16px",color:"var(--text-tertiary)",fontSize:12},children:"No publish, update, or verify activity in the last 6 hours."}):m.jsx("div",{className:"v10-log-output",style:{overflowY:"auto",flex:1},children:m.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:11},children:[m.jsx("thead",{children:m.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)",color:"var(--text-secondary)",textAlign:"left"},children:[m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Type"}),m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"ID"}),m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Status"}),m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Duration"}),m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Time"}),m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Tx Hash"})]})}),m.jsx("tbody",{children:e.map(s=>{const u=(s.phases??[]).find(f=>f.phase==="chain"),d=s.tx_hash??(u==null?void 0:u.tx_hash),p=a===s.operation_id;return m.jsxs(hn.Fragment,{children:[m.jsxs("tr",{onClick:()=>r(f=>f===s.operation_id?null:s.operation_id),style:{borderBottom:"1px solid var(--border-subtle)",cursor:"pointer",background:p?"rgba(255,255,255,.03)":void 0},children:[m.jsx("td",{style:{padding:"7px 12px",color:$5[s.operation_name]??"var(--text-secondary)",fontWeight:600},children:s.operation_name}),m.jsx("td",{style:{padding:"7px 12px",fontFamily:"var(--font-mono)",color:"var(--text-secondary)"},children:Q0(s.operation_id)}),m.jsx("td",{style:{padding:"7px 12px"},children:m.jsx("span",{style:{padding:"2px 6px",borderRadius:4,fontSize:10,fontWeight:600,background:s.status==="success"?"rgba(34,197,94,.15)":s.status==="error"?"rgba(239,68,68,.15)":"rgba(245,158,11,.15)",color:s.status==="success"?"#22c55e":s.status==="error"?"#ef4444":"#f59e0b"},children:s.status})}),m.jsx("td",{style:{padding:"7px 12px",color:"var(--text-secondary)"},children:s.duration_ms!=null?K0(s.duration_ms):"—"}),m.jsx("td",{style:{padding:"7px 12px",color:"var(--text-secondary)"},children:s.started_at?BR(s.started_at):"—"}),m.jsx("td",{style:{padding:"7px 12px",fontFamily:"var(--font-mono)",color:"var(--text-tertiary)",maxWidth:140,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d?`${d.slice(0,10)}…`:s.status==="success"?m.jsx("span",{style:{fontFamily:"var(--font-sans)",fontStyle:"italic",color:"var(--text-tertiary)"},children:"local"}):"—"})]}),p&&m.jsx("tr",{style:{background:"rgba(0,0,0,.2)"},children:m.jsxs("td",{colSpan:6,style:{padding:"8px 16px"},children:[m.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:16,fontSize:11,color:"var(--text-secondary)"},children:[m.jsxs("span",{children:[m.jsx("b",{children:"ID:"})," ",m.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:s.operation_id})]}),d&&m.jsxs("span",{children:[m.jsx("b",{children:"Tx:"})," ",m.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:d})]}),s.peer_id&&m.jsxs("span",{children:[m.jsx("b",{children:"Peer:"})," ",m.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:Q0(s.peer_id)})]}),s.error_message&&m.jsxs("span",{style:{color:"#ef4444"},children:[m.jsx("b",{children:"Error:"})," ",s.error_message]})]}),(s.phases??[]).length>0&&m.jsx("div",{style:{marginTop:8,display:"flex",gap:6,flexWrap:"wrap"},children:s.phases.map(f=>m.jsxs("span",{style:{padding:"2px 8px",borderRadius:4,fontSize:10,fontWeight:600,background:"rgba(255,255,255,.06)",color:"var(--text-secondary)"},children:[f.phase," ",f.duration_ms!=null?K0(f.duration_ms):""]},f.phase))})]})})]},s.operation_id)})})]})})}function F5(){const{bottomCollapsed:e,toggleBottom:n,bottomMaximised:a,toggleBottomMaximised:r,bottomHeight:o,setBottomHeight:s}=aa(),[u,d]=S.useState("Node Log"),p=S.useRef(null),f=S.useRef(o);f.current=o,S.useEffect(()=>{const g=p.current;if(!g)return;let x=0;const b=j=>{const E=x-j.clientY;x=j.clientY,s(f.current+E)},k=()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",k),document.body.style.cursor="",document.body.style.userSelect="",g.classList.remove("active")},C=j=>{j.preventDefault(),x=j.clientY,document.addEventListener("mousemove",b),document.addEventListener("mouseup",k),document.body.style.cursor="row-resize",document.body.style.userSelect="none",g.classList.add("active")};return g.addEventListener("mousedown",C),()=>g.removeEventListener("mousedown",C)},[s]);const y=e?void 0:a?"80vh":Math.min(o,Dc());return m.jsxs("div",{className:`v10-panel-bottom ${e?"collapsed":""} ${a?"maximised":""}`,style:e?void 0:{height:y},children:[!e&&!a&&m.jsx("div",{className:"v10-resize-handle-v",ref:p,title:"Drag to resize"}),m.jsxs("div",{className:"v10-bottom-tabs",children:[O5.map(g=>m.jsx("button",{className:`v10-bottom-tab ${g===u?"active":""}`,onClick:()=>{d(g),e&&n()},children:g},g)),m.jsx("div",{style:{flex:1}}),m.jsx("button",{className:"v10-bottom-toggle",onClick:r,title:a?"Restore":"Maximise",style:{display:e?"none":void 0},children:a?L5:M5}),m.jsx("button",{className:"v10-bottom-toggle",onClick:n,title:e?"Expand":"Collapse",children:m.jsx("span",{style:{transform:e?"rotate(180deg)":"none",display:"flex",transition:"transform 0.15s"},children:D5})})]}),!e&&m.jsxs("div",{className:"v10-bottom-content",children:[u==="Node Log"&&m.jsx(B5,{}),u==="Transactions"&&m.jsx(q5,{})]})]})}function Q1(e){const n=Math.floor(e/1e3);if(n<60)return`${n}s`;const a=Math.floor(n/60);return a<60?`${a}m`:`${Math.floor(a/60)}h ${a%60}m`}function Yc(e){if(e==null||e==="")return"";const n=e instanceof Date?e:new Date(e);return Number.isNaN(n.valueOf())?typeof e=="string"?e:"":n.toLocaleString([],{dateStyle:"medium",timeStyle:"short"})}function Zp(e){if(e==null||e==="")return;const n=e instanceof Date?e:new Date(e);if(!Number.isNaN(n.valueOf()))return n.toISOString()}function G5(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function V5(e){var a;const n=((a=e.split(".").pop())==null?void 0:a.toLowerCase())??"";return["md","txt","csv","json","xml","yaml","yml"].includes(n)?"TXT":["pdf"].includes(n)?"PDF":["docx","doc"].includes(n)?"DOC":["png","jpg","jpeg","webp"].includes(n)?"IMG":["py","ts","js","tsx","jsx","java","go","rs","c","cpp"].includes(n)?"CODE":"FILE"}function Jp(e,n){var a;return((a=e.find(r=>r.id===n))==null?void 0:a.name)??n}function W5(e){return e.startsWith("did:dkg:context-graph:")?e:`did:dkg:context-graph:${e}`}function Y5(e){return String(e??"").replace(/[\u0000-\u001F\u007F]/g," ").replace(/\s+/g," ").trim()}function iS(e){if(e.length===0)return"";const n=e.map(a=>a.fileName);return n.length<=2?`Attached ${n.join(" and ")}.`:`Attached ${n[0]} and ${n.length-1} more files.`}function rS(e){return e.status==="queued"||e.status==="completed"||e.status==="skipped"}function lS(e){return e.name.trim()}function K5(e){if(e.status!=="completed"||!e.result)return null;const n=e.result.extraction.mdIntermediateHash,a=n??(e.result.detectedContentType==="text/markdown"?e.result.fileHash:void 0);return{id:e.id,fileName:lS(e.file),contextGraphId:e.contextGraphId,assertionName:e.assertionName,assertionUri:e.result.assertionUri,fileHash:e.result.fileHash,detectedContentType:e.result.detectedContentType,rootEntity:e.result.rootEntity,extractionStatus:"completed",tripleCount:e.result.extraction.tripleCount??e.result.extraction.triplesWritten,...n?{mdIntermediateHash:n}:{},...a?{markdownHash:a,markdownForm:`urn:dkg:file:${a}`}:{}}}function Q5(e){const n=[];return{results:e.flatMap(r=>{if(r.status!=="skipped"||!r.result)return[];n.push(r.id);const o=r.result,s=o.extraction;return[{id:r.id,fileName:lS(r.file),contextGraphId:r.contextGraphId,assertionName:r.assertionName,assertionUri:o.assertionUri,fileHash:o.fileHash,detectedContentType:o.detectedContentType,extractionStatus:"skipped",pipelineUsed:s.pipelineUsed??null,tripleCount:s.tripleCount??s.triplesWritten??0,...o.rootEntity?{rootEntity:o.rootEntity}:{},...s.mdIntermediateHash?{mdIntermediateHash:s.mdIntermediateHash}:{},...s.error?{error:s.error}:{}}]}),deliveredDraftIds:n}}function oS(e){return e.length===0?"":e.length===1?`Attachment import result: ${Y5(e[0].fileName)}.`:`Attached ${e.length} document import results.`}function X5(e,n){const a=[iS(e),oS(n)].filter(r=>r.length>0).map(r=>r.replace(/\.$/,""));return a.length?`${a.join("; ")}.`:""}function Z5(e,n,a){const r=[];if(n){const o=Jp(e,n);r.push({key:"target_context_graph",label:"Target context graph id",value:n}),r.push({key:"target_context_graph_uri",label:"Target context graph URI",value:W5(n)}),r.push({key:"target_context_graph_name",label:"Target context graph name",value:o})}return a!=null&&a.agentAddress&&r.push({key:"current_agent_address",label:"Current agent address",value:a.agentAddress}),a!=null&&a.agentDid&&r.push({key:"current_agent_did",label:"Current agent DID",value:a.agentDid}),a!=null&&a.peerId&&r.push({key:"current_agent_peer_id",label:"Current agent peer ID",value:a.peerId}),r}const J5="https://docs.openclaw.ai/",eL="https://github.com/openclaw/openclaw/releases",sr="__add_agent__",tL=["openclaw"];function nL(e,n){const a=n instanceof Error?n.message:String(n??"Unknown error");if(n instanceof Lc){if(n.code==="HERMES_BRIDGE_RESPONSE_TIMEOUT")return`${e.name} bridge response timed out.`;if(n.code==="HERMES_GATEWAY_RESPONSE_TIMEOUT")return`${e.name} gateway response timed out.`;if(n.code==="OPENCLAW_BRIDGE_RESPONSE_TIMEOUT")return`${e.name} bridge response timed out.`;if(n.code==="OPENCLAW_GATEWAY_RESPONSE_TIMEOUT")return`${e.name} gateway response timed out.`;if(n.code==="PRIME_AGENT_SESSION_BUSY")return`${e.name} session is busy — try again in a moment.`;if(n.code==="PRIME_AGENT_NO_SESSION")return`No live ${e.name} session is available. Start or resume a session, then send again.`;if(n.code==="PRIME_AGENT_PROVIDER_UNAUTHORIZED")return`${e.name} provider authentication failed. Check its provider credentials and try again.`;if(n.code==="PRIME_AGENT_PROVIDER_ERROR")return`${e.name} provider request failed. Check its provider configuration and try again.`;if(n.code==="PRIME_AGENT_TURN_ABORTED")return`${e.name} turn was aborted.`;if(n.code==="PRIME_AGENT_TURN_TIMEOUT")return`${e.name} turn exceeded its maximum run time.`;if(n.code==="PRIME_AGENT_DELIVERY_FAILED")return`${e.name} rejected the message before starting the turn.`;if(n.code==="SWM_SYNC_TIMEOUT"||n.source==="background-sync")return"Background sync timed out. The chat request was not marked as failed by the local-agent bridge."}return/OpenClaw bridge unreachable/i.test(a)?`${e.name} is unavailable right now.`:/Hermes bridge unreachable/i.test(a)?`${e.name} is unavailable right now.`:/gateway response timeout/i.test(a)?`${e.name} gateway response timed out.`:/bridge response timeout/i.test(a)||/aborted due to timeout/i.test(a)?`${e.name} bridge response timed out.`:/Agent response timeout/i.test(a)?`${e.name} took too long to respond.`:/Agent returned no text response/i.test(a)||/\(no response\)/i.test(a)?`${e.name} did not return a text reply.`:a}function vp(e,n,a){return e+(n-e)*a}function sS(e){return e-Math.floor(e)}function xp(e,n){const a=Math.floor(e),r=Math.floor(n);let o=e-a,s=n-r;o=o*o*(3-2*o),s=s*s*(3-2*s);const u=ia(a,r),d=ia(a+1,r),p=ia(a,r+1),f=ia(a+1,r+1);return u+(d-u)*o+(p-u)*s+(u-d-p+f)*o*s}function ia(e,n){const a=Math.sin(e*12.9898+n*78.233)*43758.5453;return a-Math.floor(a)}function em(e,n){const a=Math.PI*(3-Math.sqrt(5)),r=1-2*(e+.5)/n,o=Math.sqrt(1-r*r),s=e*a;return[o*Math.cos(s),r,o*Math.sin(s)]}function aL(e,n){return Math.atan2(Math.sin(e-n),Math.cos(e-n))}function fr(e,n,a,r,o){const s=Math.sin(n),u=Math.cos(n),d=Math.sin(e),p=Math.cos(e);return(f,y,g)=>{const x=f*p+g*d,b=-f*d+g*p,k=y*u-b*s,C=y*s+b*u;return[a+x*o,r-k*o,C]}}function zi(e,n,a,r=.3){n.sort((o,s)=>o.z-s.z);for(const o of n){const s=o.a??1;if(s<.02)continue;const u=Math.min(1,Math.max(0,o.white)),d=Math.round((a?1-u:u)*255);e.fillStyle=`rgba(${d},${d},${d},${s})`,e.beginPath(),e.arc(o.x,o.y,Math.max(r,o.r),0,Math.PI*2),e.fill()}}function iL(e,n,a){for(const r of n){const o=r.a??1;if(o<.02)continue;const s=Math.min(1,Math.max(0,r.white)),u=Math.round((a?1-s:s)*255);e.strokeStyle=`rgba(${u},${u},${u},${o})`,e.lineWidth=r.w,e.beginPath(),e.moveTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.stroke()}}function pr(e,n){return(e/300)**n}const rL=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.76,p=fr(a*.4,.3,s,u,1),f=pr(n,o.rsPow??.6),y=[],g=o.ghostN??150;for(let k=0;k<g;k++){const C=em(k,g),[j,E,R]=p(C[0]*d,C[1]*d,C[2]*d),O=(R/d+1)/2;y.push({x:j,y:E,z:R,r:.8*f,white:.78,a:.1+.22*O})}const x=o.strandN??52,b=o.turns??3;for(let k=0;k<3;k++){const C=k/3*2*Math.PI;for(let j=0;j<x;j++){const E=(sS(j/x+a*.045)*2-1)*.96,R=Math.sqrt(Math.max(0,1-E*E)),O=Math.min(1,(1-Math.abs(E))/.1),G=E*Math.PI*b+C,U=1+.075*Math.sin(E*Math.PI*b*2+C*2+a*.8),_=R*d*U,[W,H,L]=p(Math.cos(G)*_,E*d*U,Math.sin(G)*_),T=(L/d+1)/2;y.push({x:W,y:H,z:L,r:((o.rBase??1.2)+(o.rDepth??1.8)*T)*f,white:.55-.45*T,a:O*(.45+.55*T)})}}zi(e,y,r,o.rMin)};function lL(e,n,a,r){const o=2*n*a+r,s=e%o,u=new Array(n).fill(0);let d=-1;if(s<2*n*a){const p=Math.floor(s/a),f=(s-p*a)/a,y=1-(1-Math.min(1,f/.7))**3;if(p<n){for(let g=0;g<p;g++)u[g]=1;u[p]=y,d=p}else{const g=2*n-1-p;for(let x=0;x<g;x++)u[x]=1;u[g]=1-y,d=g}}return{amount:u,active:d}}function oL(e,n,a){let[r,o,s]=e,u=!1;for(let d=0;d<n.length;d++){if(a.amount[d]<=0)continue;const p=n[d],f=p.axis===0?r:p.axis===1?o:s;if(f<p.lo||f>=p.hi)continue;d===a.active&&(u=!0);const y=p.ang*a.amount[d],g=Math.cos(y),x=Math.sin(y);if(p.axis===0){const b=o*g-s*x;s=o*x+s*g,o=b}else if(p.axis===1){const b=r*g+s*x;s=-r*x+s*g,r=b}else{const b=r*g-o*x;o=r*x+o*g,r=b}}return[r,o,s,u]}function sL(e){const n=[];for(let a=0;a<e;a++){const r=Math.min(2,Math.floor(ia(a,2.3)*3)),o=-1+.5*Math.min(3,Math.floor(ia(a,5.9)*4)),s=ia(a,7.7)<.5?1:-1;n.push({axis:r,lo:o,hi:o+.5,ang:s*Math.PI/2})}return n}const cL=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.82,p=.4+.06*Math.sin(a*.35),f=fr(a*.5,p,s,u,d),y=a*(.5+(1.7-.5)*(o.scanMul??1)),g=pr(n,o.rsPow??.6),x=o.dimBase??1,b=[],k=o.latRings??17,C=o.lonDensity??44;for(let j=0;j<=k;j++){const E=-Math.PI/2+j/k*Math.PI,R=Math.cos(E),O=Math.sin(E),G=Math.max(1,Math.round(Math.abs(R)*C));for(let U=0;U<G;U++){const _=U/G*2*Math.PI,[W,H,L]=f(R*Math.cos(_),O,R*Math.sin(_)),T=(L+1)/2,F=aL(_+a*.5,y),V=Math.exp(-(F*F)/.18)*Math.max(0,L);b.push({x:W,y:H,z:L,r:((o.rBase??.6)+(o.rDepth??1.7)*T+(o.rBoost??1)*V)*g,white:(o.inkFar??.62)-(o.inkSpan??.54)*T,a:x+(1-x)*Math.min(1,V)})}}zi(e,b,r,o.rMin)},uL=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.82,p=fr(a*.55,.35+.1*Math.sin(a*.9),s,u,d),f=pr(n,o.rsPow??.6),y=o.moveCount??14,g=sL(y),x=lL(a,y,.42,1.2),b=[],k=o.latRings??15,C=o.lonDensity??40;for(let j=0;j<=k;j++){const E=-Math.PI/2+j/k*Math.PI,R=Math.cos(E),O=Math.sin(E),G=Math.max(1,Math.round(Math.abs(R)*C));for(let U=0;U<G;U++){const _=U/G*2*Math.PI,[W,H,L,T]=oL([R*Math.cos(_),O,R*Math.sin(_)],g,x),[F,V,ie]=p(W,H,L),B=(ie+1)/2;b.push({x:F,y:V,z:ie,r:((o.rBase??.6)+(o.rDepth??1.7)*B+(T?o.rActive??.3:0))*f,white:(o.inkFar??.62)-(o.inkSpan??.54)*B-(T?.14:0)})}}zi(e,b,r,o.rMin)},dL=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.874,p=fr(a*.18,.38,s,u,1),f=pr(n,o.rsPow??.6),y=[],g=o.rings??15,x=o.lonDensity??40;for(let b=0;b<=g;b++){const k=-Math.PI/2+b/g*Math.PI,C=Math.cos(k),j=Math.sin(k),E=.62*Math.sin(a*2.1-b*.52)+.38*Math.sin(a*1.27+b*.83),R=d*(.88+.105*E),O=Math.max(1,Math.round(Math.abs(C)*x));for(let G=0;G<O;G++){const U=G/O*2*Math.PI,[_,W,H]=p(C*Math.cos(U)*R,j*R,C*Math.sin(U)*R),L=(H/d+1)/2,T=Math.max(0,E);y.push({x:_,y:W,z:H,r:((o.rBase??.6)+(o.rDepth??1.7)*L)*(1+.4*T)*f,white:.66-.56*L-.1*T})}}zi(e,y,r,o.rMin)};function fL(e){return e*e*(3-2*e)}function cS(e){const n=e.length,a=[];let r=0;for(let o=0;o<n;o++){const s=e[o],u=e[(o+1)%n],d=Math.hypot(u[0]-s[0],u[1]-s[1]);a.push(d),r+=d}return o=>{let s=o*r,u=0;for(;s>a[u]&&u<n-1;)s-=a[u],u++;const d=e[u],p=e[(u+1)%n],f=a[u]?Math.min(1,s/a[u]):0;return[d[0]+(p[0]-d[0])*f,d[1]+(p[1]-d[1])*f]}}const pL=e=>{const n=-Math.PI/2+e*2*Math.PI;return[Math.cos(n)*.24,Math.sin(n)*.24]},hL=cS([[0,-.26],[.24,.16],[-.24,.16]]),mL=cS([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),bp=[pL,hL,mL];function gL(e){return Math.max(6,Math.round(34*e))}const eh=1.4,uS=.9,wp=eh+uS,yL=(e,n,a,r,o)=>{const s=bp.length,u=a%(wp*s),d=Math.floor(u/wp),p=u-d*wp,f=p>eh?fL((p-eh)/uS):0,y=o.spread??1,g=bp[d],x=bp[(d+1)%s],b=160,k=[];for(let H=0;H<b;H++){const L=H/b,T=g(L),F=x(L);k.push([(T[0]+(F[0]-T[0])*f)*y,(T[1]+(F[1]-T[1])*f)*y])}const C=[];let j=0;for(let H=0;H<b;H++){const L=k[H],T=k[(H+1)%b],F=Math.hypot(T[0]-L[0],T[1]-L[1]);C.push(F),j+=F}const E=gL(o.iconD??1),R=(o.rDot??.021)*1.35*y,O=1+.02*Math.sin(p*3.1),G=[],U=n/2;let _=0,W=0;for(let H=0;H<E;H++){const L=H/E*j;for(;W+C[_]<L&&_<b-1;)W+=C[_],_++;const T=k[_],F=k[(_+1)%b],V=C[_]?Math.min(1,(L-W)/C[_]):0,ie=(T[0]+(F[0]-T[0])*V)*O,B=(T[1]+(F[1]-T[1])*V)*O;G.push({x:U+ie*n,y:U+B*n,z:0,r:Math.max(.35,R*n),white:.1})}zi(e,G,r,o.rMin)},vL=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.82,p=fr(a*.12,.3,s,u,1),f=pr(n,o.rsPow??.6),y=[],g=o.orbitN??12,x=o.ghostN??40,b=o.particles??3;for(let k=0;k<g;k++){const C=ia(k,1.7),j=ia(k,5.2),E=ia(k,8.9),R=d*(.45+.52*C),O=C*2*Math.PI,G=Math.acos(2*j-1),U=Math.sin(G)*Math.cos(O),_=Math.cos(G),W=Math.sin(G)*Math.sin(O);let H=-_,L=U;const T=0,F=Math.max(1e-6,Math.sqrt(H*H+L*L));H/=F,L/=F;const V=_*T-W*L,ie=W*H-U*T,B=U*L-_*H,K=(.25+.55*E)*(E>.5?1:-1);for(let P=0;P<x;P++){const Z=P/x*2*Math.PI,[ne,X,D]=p((H*Math.cos(Z)+V*Math.sin(Z))*R,(L*Math.cos(Z)+ie*Math.sin(Z))*R,(T*Math.cos(Z)+B*Math.sin(Z))*R),M=(D/R+1)/2;y.push({x:ne,y:X,z:D,r:(o.ghostR??.9)*f,white:.72,a:(o.ghostA??.5)*(.4+.6*M)})}for(let P=0;P<b;P++){const Z=a*K+P/b*2*Math.PI+j*6,[ne,X,D]=p((H*Math.cos(Z)+V*Math.sin(Z))*R,(L*Math.cos(Z)+ie*Math.sin(Z))*R,(T*Math.cos(Z)+B*Math.sin(Z))*R),M=(D/R+1)/2;y.push({x:ne,y:X,z:D,r:((o.partR??1.2)+(o.partRDepth??1.6)*M)*f,white:.3-.22*M})}}zi(e,y,r,o.rMin)},X1=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.78,p=o.spin??1,f=.3,y=fr(a*.1*p,f,s,u,1),g=pr(n,o.rsPow??.6),x=[],b=o.ghostN??150;for(let B=0;B<b;B++){const K=em(B,b),[P,Z,ne]=y(K[0]*d,K[1]*d,K[2]*d),X=(ne/d+1)/2;x.push({x:P,y:Z,z:ne,r:.8*g,white:.78,a:.1+.22*X})}const k=a*.24*p,C=o.faceOn?-f:.55+.3*Math.sin(a*.18)*p,j=Math.cos(k),E=0,R=Math.sin(k),O=-R*Math.sin(C),G=Math.cos(C),U=j*Math.sin(C),_=E*U-R*G,W=R*O-j*U,H=j*G-E*O,L=.23*(o.wobMul??1),T=o.faceOn?d/(1+.85*L):d,F=o.lanes??5,V=o.segs??88,ie=Math.max(1,Math.round(F*(o.bandMul??1)));for(let B=0;B<ie;B++){const K=(B-(ie-1)/2)*.075,P=Math.abs(B-(ie-1)/2)/Math.max(1,(ie-1)/2);for(let Z=0;Z<V;Z++){const ne=Z/V*2*Math.PI,X=(.16*Math.sin(ne*3-a*1.7+B*.22)+.07*Math.sin(ne*5+a*1.1))*(o.wobMul??1),D=o.faceOn?1+X:1,M=o.faceOn?K:K+X,Q=j*Math.cos(ne)+O*Math.sin(ne)+_*M,N=E*Math.cos(ne)+G*Math.sin(ne)+W*M,ue=R*Math.cos(ne)+U*Math.sin(ne)+H*M,pe=Math.sqrt(Q*Q+N*N+ue*ue),he=T*D,[be,Oe,Ne]=y(Q/pe*he,N/pe*he,ue/pe*he),et=(Ne/d+1)/2;x.push({x:be,y:Oe,z:Ne,r:((o.rBase??1.1)+(o.rDepth??1.7)*et)*(1-.25*P)*g,white:.52-.44*et+.18*P,a:.4+.6*et})}}zi(e,x,r,o.rMin)},xL=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.8*(o.spread??1),p=fr(a*.12,.32,s,u,d),f=pr(n,o.rsPow??.6),y=o.nodeN??30,g=o.thr??.72,x=o.nodeR??1.4,b=o.nodeRDepth??1.8,k=[];for(let R=0;R<y;R++){const O=em(R,y),G=O[0]+.3*(xp(R*.31+9,a*.24)-.5)*2,U=O[1]+.3*(xp(R*.53+27,a*.21)-.5)*2,_=O[2]+.3*(xp(R*.77+55,a*.27)-.5)*2,W=Math.sqrt(G*G+U*U+_*_);k.push([G/W,U/W,_/W])}const C=[],j=[];for(let R=0;R<y;R++)for(let O=R+1;O<y;O++){const G=k[R][0]-k[O][0],U=k[R][1]-k[O][1],_=k[R][2]-k[O][2],W=Math.sqrt(G*G+U*U+_*_);if(W>=g)continue;const[H,L,T]=p(k[R][0],k[R][1],k[R][2]),[F,V,ie]=p(k[O][0],k[O][1],k[O][2]),B=((T+ie)/2+1)/2;C.push({x1:H,y1:L,x2:F,y2:V,white:.42,a:(1-W/g)*(.3+.55*B),w:Math.max(.6,(o.lineW??.8)*f)})}for(let R=0;R<y;R++){const[O,G,U]=p(k[R][0],k[R][1],k[R][2]),_=(U+1)/2,W=1+.25*Math.sin(a*1.4+R*2.7);j.push({x:O,y:G,z:U,r:(x+b*_)*W*f,white:.55-.45*_})}const E=o.signals??5;for(let R=0;R<E;R++){const O=Math.floor(a*.55+R*7.31),G=Math.floor(ia(O,R*3.1+1.7)*y),U=Math.floor(ia(O,R*5.7+4.2)*y);if(G===U)continue;const _=sS(a*.55+R*7.31),W=vp(k[G][0],k[U][0],_),H=vp(k[G][1],k[U][1],_),L=vp(k[G][2],k[U][2],_),T=Math.max(1e-6,Math.sqrt(W*W+H*H+L*L)),[F,V,ie]=p(W/T,H/T,L/T),B=(ie+1)/2;j.push({x:F,y:V,z:ie,r:(x*1.5+b*B)*f,white:.05,a:.5+.5*B})}iL(e,C,r),zi(e,j,r,o.rMin)},bL={orbits:vL,globe:cL,rubik:uL,wave:dL,web:xL,braid:rL,ribbon:X1,ring:X1,morph:yL},wL=[["latRings","lonDensity"],["rings","lonDensity"],["lanes","segs"]],SL=["orbitN","ghostN","nodeN","strandN","signals"],kL=["iconD"],CL=["rBase","rDepth","rActive","rDot","ghostR","partR","partRDepth","nodeR","nodeRDepth"];function EL(e,n){const a={...e},r=new Set,o=Math.sqrt(n);for(const[s,u]of wL){const d=a[s],p=a[u];d!=null&&p!=null&&!r.has(s)&&!r.has(u)&&(a[s]=Math.max(2,Math.round(d*o)),a[u]=Math.max(2,Math.round(p*o)),r.add(s),r.add(u))}for(const s of SL){const u=a[s];u!=null&&u!==0&&!r.has(s)&&(a[s]=Math.max(1,Math.round(u*n)))}for(const s of kL){const u=a[s];u!=null&&(a[s]=Math.max(.02,u*n))}return a}function AL(e,n){const a={...e};for(const r of CL){const o=a[r];o!=null&&(a[r]=o*n)}return a.rSizeMul=(a.rSizeMul??1)*n,a}const jL={globe:{latRings:17,lonDensity:44,rBase:.6,rDepth:1.7,rBoost:1,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},orbits:{orbitN:12,ghostN:40,ghostR:.9,ghostA:.5,particles:3,partR:1.2,partRDepth:1.6,rsPow:.6,rMin:.3},rubik:{latRings:15,lonDensity:40,moveCount:14,rBase:.6,rDepth:1.7,rActive:.3,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},wave:{rings:15,lonDensity:40,rBase:.6,rDepth:1.7,rsPow:.6,rMin:.3},web:{nodeN:30,thr:.72,signals:5,nodeR:1.4,nodeRDepth:1.8,lineW:.8,rsPow:.6,rMin:.3},braid:{strandN:52,turns:3,ghostN:150,rBase:1.2,rDepth:1.8,rsPow:.6,rMin:.3},ribbon:{lanes:5,segs:88,ghostN:150,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},ring:{lanes:5,segs:88,ghostN:0,faceOn:1,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},morph:{rDot:.021,iconD:1,rMin:.25}},TL={working:"orbits",searching:"globe",solving:"rubik",listening:"wave",connecting:"web",weaving:"braid",composing:"ribbon",breathing:"ring",shaping:"morph"},NL={orbits:{64:{speed:1.885,count:1,size:1},20:{speed:3.9,count:.238,size:2.4}},globe:{64:{speed:2.015,count:.42,size:1.15,extra:{scanMul:4.08,dimBase:.45}},20:{speed:2.665,count:.105,size:1.75,extra:{scanMul:4.335,dimBase:.45}}},rubik:{64:{speed:1.82,count:.35,size:1.05},20:{speed:1.95,count:.088,size:1.9}},wave:{64:{speed:4.388,count:.341,size:1},20:{speed:3.998,count:.105,size:1.6}},web:{64:{speed:3.315,count:1.35,size:.95},20:{speed:6.63,count:.25,size:1.52}},braid:{64:{speed:1.625,count:.5,size:1},20:{speed:2.75,count:.1125,size:1.36}},ribbon:{64:{speed:2.34,count:.25,size:.85,extra:{spin:0,bandMul:3.9,wobMul:1}},20:{speed:3.12,count:.051,size:1.073,extra:{spin:0,bandMul:4.94,wobMul:1}}},ring:{64:{speed:3.24,count:.25,size:.956,extra:{spin:0,bandMul:3.627,wobMul:.368}},20:{speed:3.78,count:.028,size:1.622,extra:{spin:0,bandMul:3.968,wobMul:.565}}},morph:{64:{speed:2.405,count:.702,size:.395,extra:{spread:1.45}},20:{speed:2.08,count:.53,size:1.011,extra:{spread:1.45}}}},Z1=new Map;function RL(e,n){const a=`${e}-${n}`,r=Z1.get(a);if(r)return r;const o=TL[e],s=NL[o][n];let u={...jL[o]};s.count!==1&&(u=EL(u,s.count)),s.size!==1&&(u=AL(u,s.size)),s.extra&&(u={...u,...s.extra});const d={mode:o,speed:s.speed,opts:u};return Z1.set(a,d),d}function _L(e){let n=e;for(;n;){const a=n.getAttribute("data-theme");if(a==="dark")return!0;if(a==="light")return!1;if(n.classList.contains("dark"))return!0;if(n.classList.contains("light"))return!1;n=n.parentElement}return null}function OL(){return typeof matchMedia>"u"||matchMedia("(prefers-color-scheme: dark)").matches}function DL(e,n){const[a,r]=S.useState(!0);return S.useEffect(()=>{if(e==="dark"){r(!0);return}if(e==="light"){r(!1);return}const o=()=>{const p=_L(n.current);r(p??OL())};o();const s=typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,u=()=>o();s==null||s.addEventListener("change",u);let d=null;return typeof MutationObserver<"u"&&n.current&&(d=new MutationObserver(o),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"],subtree:!0})),()=>{s==null||s.removeEventListener("change",u),d==null||d.disconnect()}},[e,n]),a}function ML(){const[e,n]=S.useState(!1);return S.useEffect(()=>{if(typeof matchMedia>"u")return;const a=matchMedia("(prefers-reduced-motion: reduce)");n(a.matches);const r=o=>n(o.matches);return a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[]),e}const LL={working:"Working…",searching:"Searching…",solving:"Solving…",listening:"Listening…",connecting:"Connecting…",weaving:"Weaving…",composing:"Composing…",breathing:"Thinking…",shaping:"Shaping…"};function zL({state:e="working",size:n=64,theme:a="auto",speed:r=1,paused:o=!1,style:s,"aria-label":u,...d}){const p=S.useRef(null),f=DL(a,p),y=ML();return S.useEffect(()=>{const g=p.current;if(!g)return;const x=Math.min(2,typeof devicePixelRatio<"u"&&devicePixelRatio||1);g.width=Math.round(n*x),g.height=Math.round(n*x);const b=g.getContext("2d");if(!b)return;const{mode:k,speed:C,opts:j}=RL(e,n),E=bL[k],R=C*r,O=V=>{b.setTransform(x,0,0,x,0,0),b.clearRect(0,0,n,n),E(b,n,V,f,j)};if(y){O(.6);return}let G=0,U=!1;const _=()=>{O(performance.now()/1e3*R),U&&(G=requestAnimationFrame(_))},W=()=>{U||o||(U=!0,G=requestAnimationFrame(_))},H=()=>{U=!1,cancelAnimationFrame(G)};O(performance.now()/1e3*R);let L=!0;const T=typeof IntersectionObserver<"u"?new IntersectionObserver(([V])=>{L=V.isIntersecting,L&&document.visibilityState!=="hidden"?W():H()}):null;T==null||T.observe(g);const F=()=>{document.visibilityState==="hidden"?H():L&&W()};return document.addEventListener("visibilitychange",F),T||W(),()=>{H(),T==null||T.disconnect(),document.removeEventListener("visibilitychange",F)}},[e,n,f,r,o,y]),m.jsx("canvas",{ref:p,role:"img","aria-label":u??LL[e],style:{width:n,height:n,display:"block",...s},...d})}let IL=0;function PL(e,n,a){const r=e.trim();return r?r===n?!0:a==="Request cancelled."&&r===a:!1}function UL(e,n,a,r){return e&&PL(e,n,a)?{content:e,synthesized:!0}:e?r==="hermes"?{content:e,failureNotice:n,synthesized:!1}:{content:e,synthesized:!1}:{content:"",failureNotice:n,synthesized:!0}}function BL(e,n){return e?{content:e,failureNotice:n,synthesized:!1}:{content:n,synthesized:!0}}function J1(e,n=""){const a=e.author.toLowerCase(),r=a.includes("assistant")||a.includes("agent")?"assistant":"user",o=typeof e.failureReason=="string"&&e.failureReason.trim()?e.failureReason.trim():void 0,s=r==="assistant"&&(e.persistStatus==="failed"||!!o),u=`Error: ${o??"The local agent turn failed."}`,d=s?UL(e.text,u,o,n):null,p=(d==null?void 0:d.content)??(e.text||iS(e.attachmentRefs??[])),f=!!e.text;return{id:e.uri||`local-history:${++IL}`,uri:e.uri,turnId:e.turnId,role:r,content:p,ts:Yc(e.ts),tsRaw:Zp(e.ts),attachments:e.attachmentRefs,failureNotice:d==null?void 0:d.failureNotice,synthesized:(d==null?void 0:d.synthesized)??!f}}function HL(e){return e.turnId?`turn:${e.turnId}:${e.role}`:e.uri??`${e.role}:${e.ts??""}:${e.content}`}function Sp(e,n){const a=new Set,r=[];for(const o of[...n,...e]){const s=HL(o);a.has(s)||(a.add(s),r.push(o))}return r}function ex(e,n,a){const r=typeof a=="string"&&a.trim()?a.trim():n;return!r||r===n?e:e.map(o=>o.turnId===n?{...o,turnId:r}:o)}function tx(e){return e.replace(/\r\n/g,`
1166
- `).replace(/^(?:[ \t]*\n)+/,"").replace(/(?:\n[ \t]*)+$/,"")}function $L(e,n,a,r,o){const s=tx(e),u=o?tx(o):"";if(n==="assistant"&&r&&s.trim()===""&&!u)return m.jsxs("span",{className:"v10-chat-thinking",role:"status","aria-live":"polite",children:[m.jsx(zL,{"aria-hidden":"true",className:"v10-chat-thinking-orb",state:"connecting",size:64,style:{width:28,height:28},theme:"auto"}),m.jsx("span",{children:"Connecting dots..."})]});if(n==="assistant"&&!a&&s.trim()!=="")return m.jsxs(m.Fragment,{children:[m.jsx(aS,{content:s,streaming:r&&!u}),u&&m.jsxs("span",{className:"v10-chat-plaintext v10-chat-failure-notice",children:[u,r&&m.jsx("span",{className:"v10-chat-cursor"})]})]});const d=[s,u].filter(Boolean).join(`
1167
-
1168
- `);return m.jsxs("span",{className:"v10-chat-plaintext",children:[d,r&&m.jsx("span",{className:"v10-chat-cursor"})]})}function th(){return th=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},th.apply(null,arguments)}function qL(e,n){if(e==null)return{};var a={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(n.indexOf(r)!==-1)continue;a[r]=e[r]}return a}var FL=S.useLayoutEffect,GL=function(n){var a=hn.useRef(n);return FL(function(){a.current=n}),a},nx=function(n,a){if(typeof n=="function"){n(a);return}n.current=a},VL=function(n,a){var r=hn.useRef();return hn.useCallback(function(o){n.current=o,r.current&&nx(r.current,null),r.current=a,a&&nx(a,o)},[a])},ax={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},WL=function(n){Object.keys(ax).forEach(function(a){n.style.setProperty(a,ax[a],"important")})},ix=WL,fn=null,rx=function(n,a){var r=n.scrollHeight;return a.sizingStyle.boxSizing==="border-box"?r+a.borderSize:r-a.paddingSize};function YL(e,n,a,r){a===void 0&&(a=1),r===void 0&&(r=1/0),fn||(fn=document.createElement("textarea"),fn.setAttribute("tabindex","-1"),fn.setAttribute("aria-hidden","true"),ix(fn)),fn.parentNode===null&&document.body.appendChild(fn);var o=e.paddingSize,s=e.borderSize,u=e.sizingStyle,d=u.boxSizing;Object.keys(u).forEach(function(x){var b=x;fn.style[b]=u[b]}),ix(fn),fn.value=n;var p=rx(fn,e);fn.value=n,p=rx(fn,e),fn.value="x";var f=fn.scrollHeight-o,y=f*a;d==="border-box"&&(y=y+o+s),p=Math.max(y,p);var g=f*r;return d==="border-box"&&(g=g+o+s),p=Math.min(g,p),[p,f]}var lx=function(){},KL=function(n,a){return n.reduce(function(r,o){return r[o]=a[o],r},{})},QL=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],XL=!!document.documentElement.currentStyle,ZL=function(n){var a=window.getComputedStyle(n);if(a===null)return null;var r=KL(QL,a),o=r.boxSizing;if(o==="")return null;XL&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),u=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:u}},JL=ZL;function tm(e,n,a){var r=GL(a);S.useLayoutEffect(function(){var o=function(u){return r.current(u)};if(e)return e.addEventListener(n,o),function(){return e.removeEventListener(n,o)}},[])}var ez=function(n,a){tm(document.body,"reset",function(r){n.current.form===r.target&&a(r)})},tz=function(n){tm(window,"resize",n)},nz=function(n){tm(document.fonts,"loadingdone",n)},az=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],iz=function(n,a){var r=n.cacheMeasurements,o=n.maxRows,s=n.minRows,u=n.onChange,d=u===void 0?lx:u,p=n.onHeightChange,f=p===void 0?lx:p,y=qL(n,az),g=y.value!==void 0,x=S.useRef(null),b=VL(x,a),k=S.useRef(0),C=S.useRef(),j=function(){var O=x.current,G=r&&C.current?C.current:JL(O);if(G){C.current=G;var U=YL(G,O.value||O.placeholder||"x",s,o),_=U[0],W=U[1];k.current!==_&&(k.current=_,O.style.setProperty("height",_+"px","important"),f(_,{rowHeight:W}))}},E=function(O){g||j(),d(O)};return S.useLayoutEffect(j),ez(x,function(){if(!g){var R=x.current.value;requestAnimationFrame(function(){var O=x.current;O&&R!==O.value&&j()})}}),tz(j),nz(j),S.createElement("textarea",th({},y,{onChange:E,ref:b}))},rz=S.forwardRef(iz),kp={exports:{}},Cp,ox;function lz(){if(ox)return Cp;ox=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Cp=e,Cp}var Ep,sx;function oz(){if(sx)return Ep;sx=1;var e=lz();function n(){}function a(){}return a.resetWarningCache=n,Ep=function(){function r(u,d,p,f,y,g){if(g!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:a,resetWarningCache:n};return s.PropTypes=s,s},Ep}var cx;function sz(){return cx||(cx=1,kp.exports=oz()()),kp.exports}var cz=sz();const mt=Po(cz);function hr(e,n,a,r){function o(s){return s instanceof a?s:new a(function(u){u(s)})}return new(a||(a=Promise))(function(s,u){function d(y){try{f(r.next(y))}catch(g){u(g)}}function p(y){try{f(r.throw(y))}catch(g){u(g)}}function f(y){y.done?s(y.value):o(y.value).then(d,p)}f((r=r.apply(e,n||[])).next())})}const uz=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function ol(e,n,a){const r=dz(e),{webkitRelativePath:o}=e,s=typeof n=="string"?n:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&ux(r,"path",s),ux(r,"relativePath",s),r}function dz(e){const{name:n}=e;if(n&&n.lastIndexOf(".")!==-1&&!e.type){const r=n.split(".").pop().toLowerCase(),o=uz.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function ux(e,n,a){Object.defineProperty(e,n,{value:a,writable:!1,configurable:!1,enumerable:!0})}const fz=[".DS_Store","Thumbs.db"];function pz(e){return hr(this,void 0,void 0,function*(){return Kc(e)&&hz(e.dataTransfer)?vz(e.dataTransfer,e.type):mz(e)?gz(e):Array.isArray(e)&&e.every(n=>"getFile"in n&&typeof n.getFile=="function")?yz(e):[]})}function hz(e){return Kc(e)}function mz(e){return Kc(e)&&Kc(e.target)}function Kc(e){return typeof e=="object"&&e!==null}function gz(e){return nh(e.target.files).map(n=>ol(n))}function yz(e){return hr(this,void 0,void 0,function*(){return(yield Promise.all(e.map(a=>a.getFile()))).map(a=>ol(a))})}function vz(e,n){return hr(this,void 0,void 0,function*(){if(e.items){const a=nh(e.items).filter(o=>o.kind==="file");if(n!=="drop")return a;const r=yield Promise.all(a.map(xz));return dx(dS(r))}return dx(nh(e.files).map(a=>ol(a)))})}function dx(e){return e.filter(n=>fz.indexOf(n.name)===-1)}function nh(e){if(e===null)return[];const n=[];for(let a=0;a<e.length;a++){const r=e[a];n.push(r)}return n}function xz(e){if(typeof e.webkitGetAsEntry!="function")return fx(e);const n=e.webkitGetAsEntry();return n&&n.isDirectory?fS(n):fx(e,n)}function dS(e){return e.reduce((n,a)=>[...n,...Array.isArray(a)?dS(a):[a]],[])}function fx(e,n){return hr(this,void 0,void 0,function*(){var a;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const u=yield s.getFile();return u.handle=s,ol(u)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return ol(r,(a=n==null?void 0:n.fullPath)!==null&&a!==void 0?a:void 0)})}function bz(e){return hr(this,void 0,void 0,function*(){return e.isDirectory?fS(e):wz(e)})}function fS(e){const n=e.createReader();return new Promise((a,r)=>{const o=[];function s(){n.readEntries(u=>hr(this,void 0,void 0,function*(){if(u.length){const d=Promise.all(u.map(bz));o.push(d),s()}else try{const d=yield Promise.all(o);a(d)}catch(d){r(d)}}),u=>{r(u)})}s()})}function wz(e){return hr(this,void 0,void 0,function*(){return new Promise((n,a)=>{e.file(r=>{const o=ol(r,e.fullPath);n(o)},r=>{a(r)})})})}var bc={},px;function Sz(){return px||(px=1,bc.__esModule=!0,bc.default=function(e,n){if(e&&n){var a=Array.isArray(n)?n:n.split(",");if(a.length===0)return!0;var r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return a.some(function(u){var d=u.trim().toLowerCase();return d.charAt(0)==="."?r.toLowerCase().endsWith(d):d.endsWith("/*")?s===d.replace(/\/.*$/,""):o===d})}return!0}),bc}var kz=Sz();const Ap=Po(kz);function hx(e){return Az(e)||Ez(e)||hS(e)||Cz()}function Cz(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1169
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ez(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Az(e){if(Array.isArray(e))return ah(e)}function mx(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,r)}return a}function gx(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?mx(Object(a),!0).forEach(function(r){pS(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):mx(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}function pS(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function Io(e,n){return Nz(e)||Tz(e,n)||hS(e,n)||jz()}function jz(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1170
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hS(e,n){if(e){if(typeof e=="string")return ah(e,n);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return ah(e,n)}}function ah(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,r=new Array(n);a<n;a++)r[a]=e[a];return r}function Tz(e,n){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var r=[],o=!0,s=!1,u,d;try{for(a=a.call(e);!(o=(u=a.next()).done)&&(r.push(u.value),!(n&&r.length===n));o=!0);}catch(p){s=!0,d=p}finally{try{!o&&a.return!=null&&a.return()}finally{if(s)throw d}}return r}}function Nz(e){if(Array.isArray(e))return e}var Rz=typeof Ap=="function"?Ap:Ap.default,_z="file-invalid-type",Oz="file-too-large",Dz="file-too-small",Mz="too-many-files",Lz=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=n.split(","),r=a.length>1?"one of ".concat(a.join(", ")):a[0];return{code:_z,message:"File type must be ".concat(r)}},yx=function(n){return{code:Oz,message:"File is larger than ".concat(n," ").concat(n===1?"byte":"bytes")}},vx=function(n){return{code:Dz,message:"File is smaller than ".concat(n," ").concat(n===1?"byte":"bytes")}},zz={code:Mz,message:"Too many files"};function Iz(e){return e.type===""&&typeof e.getAsFile=="function"}function mS(e,n){var a=e.type==="application/x-moz-file"||Rz(e,n)||Iz(e);return[a,a?null:Lz(n)]}function gS(e,n,a){if(or(e.size))if(or(n)&&or(a)){if(e.size>a)return[!1,yx(a)];if(e.size<n)return[!1,vx(n)]}else{if(or(n)&&e.size<n)return[!1,vx(n)];if(or(a)&&e.size>a)return[!1,yx(a)]}return[!0,null]}function or(e){return e!=null}function Pz(e){var n=e.files,a=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,u=e.maxFiles,d=e.validator;return!s&&n.length>1||s&&u>=1&&n.length>u?!1:n.every(function(p){var f=mS(p,a),y=Io(f,1),g=y[0],x=gS(p,r,o),b=Io(x,1),k=b[0],C=d?d(p):null;return g&&k&&!C})}function Qc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function wo(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(n){return n==="Files"||n==="application/x-moz-file"}):!!e.target&&!!e.target.files}function xx(e){e.preventDefault()}function Uz(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Bz(e){return e.indexOf("Edge/")!==-1}function Hz(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Uz(e)||Bz(e)}function wa(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),u=1;u<o;u++)s[u-1]=arguments[u];return n.some(function(d){return!Qc(r)&&d&&d.apply(void 0,[r].concat(s)),Qc(r)})}}function $z(){return"showOpenFilePicker"in window}function qz(e){if(or(e)){var n=Object.entries(e).filter(function(a){var r=Io(a,2),o=r[0],s=r[1],u=!0;return yS(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),u=!1),(!Array.isArray(s)||!s.every(vS))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),u=!1),u}).reduce(function(a,r){var o=Io(r,2),s=o[0],u=o[1];return gx(gx({},a),{},pS({},s,u))},{});return[{description:"Files",accept:n}]}return e}function Fz(e){if(or(e))return Object.entries(e).reduce(function(n,a){var r=Io(a,2),o=r[0],s=r[1];return[].concat(hx(n),[o],hx(s))},[]).filter(function(n){return yS(n)||vS(n)}).join(",")}function Gz(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Vz(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function yS(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function vS(e){return/^.*\.[\w]+$/.test(e)}var Wz=["children"],Yz=["open"],Kz=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Qz=["refKey","onChange","onClick"];function bx(e){return Jz(e)||Zz(e)||xS(e)||Xz()}function Xz(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1171
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zz(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jz(e){if(Array.isArray(e))return ih(e)}function jp(e,n){return nI(e)||tI(e,n)||xS(e,n)||eI()}function eI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1172
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xS(e,n){if(e){if(typeof e=="string")return ih(e,n);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return ih(e,n)}}function ih(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,r=new Array(n);a<n;a++)r[a]=e[a];return r}function tI(e,n){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var r=[],o=!0,s=!1,u,d;try{for(a=a.call(e);!(o=(u=a.next()).done)&&(r.push(u.value),!(n&&r.length===n));o=!0);}catch(p){s=!0,d=p}finally{try{!o&&a.return!=null&&a.return()}finally{if(s)throw d}}return r}}function nI(e){if(Array.isArray(e))return e}function wx(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,r)}return a}function kt(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?wx(Object(a),!0).forEach(function(r){rh(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):wx(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}function rh(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function Xc(e,n){if(e==null)return{};var a=aI(e,n),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function aI(e,n){if(e==null)return{};var a={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(n.indexOf(o)>=0)&&(a[o]=e[o]);return a}var nm=S.forwardRef(function(e,n){var a=e.children,r=Xc(e,Wz),o=wS(r),s=o.open,u=Xc(o,Yz);return S.useImperativeHandle(n,function(){return{open:s}},[s]),hn.createElement(S.Fragment,null,a(kt(kt({},u),{},{open:s})))});nm.displayName="Dropzone";var bS={disabled:!1,getFilesFromEvent:pz,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};nm.defaultProps=bS;nm.propTypes={children:mt.func,accept:mt.objectOf(mt.arrayOf(mt.string)),multiple:mt.bool,preventDropOnDocument:mt.bool,noClick:mt.bool,noKeyboard:mt.bool,noDrag:mt.bool,noDragEventsBubbling:mt.bool,minSize:mt.number,maxSize:mt.number,maxFiles:mt.number,disabled:mt.bool,getFilesFromEvent:mt.func,onFileDialogCancel:mt.func,onFileDialogOpen:mt.func,useFsAccessApi:mt.bool,autoFocus:mt.bool,onDragEnter:mt.func,onDragLeave:mt.func,onDragOver:mt.func,onDrop:mt.func,onDropAccepted:mt.func,onDropRejected:mt.func,onError:mt.func,validator:mt.func};var lh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragGlobal:!1,acceptedFiles:[],fileRejections:[]};function wS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=kt(kt({},bS),e),a=n.accept,r=n.disabled,o=n.getFilesFromEvent,s=n.maxSize,u=n.minSize,d=n.multiple,p=n.maxFiles,f=n.onDragEnter,y=n.onDragLeave,g=n.onDragOver,x=n.onDrop,b=n.onDropAccepted,k=n.onDropRejected,C=n.onFileDialogCancel,j=n.onFileDialogOpen,E=n.useFsAccessApi,R=n.autoFocus,O=n.preventDropOnDocument,G=n.noClick,U=n.noKeyboard,_=n.noDrag,W=n.noDragEventsBubbling,H=n.onError,L=n.validator,T=S.useMemo(function(){return Fz(a)},[a]),F=S.useMemo(function(){return qz(a)},[a]),V=S.useMemo(function(){return typeof j=="function"?j:Sx},[j]),ie=S.useMemo(function(){return typeof C=="function"?C:Sx},[C]),B=S.useRef(null),K=S.useRef(null),P=S.useReducer(iI,lh),Z=jp(P,2),ne=Z[0],X=Z[1],D=ne.isFocused,M=ne.isFileDialogActive,Q=S.useRef(typeof window<"u"&&window.isSecureContext&&E&&$z()),N=function(){!Q.current&&M&&setTimeout(function(){if(K.current){var $=K.current.files;$.length||(X({type:"closeDialog"}),ie())}},300)};S.useEffect(function(){return window.addEventListener("focus",N,!1),function(){window.removeEventListener("focus",N,!1)}},[K,M,ie,Q]);var ue=S.useRef([]),pe=S.useRef([]),he=function($){B.current&&B.current.contains($.target)||($.preventDefault(),ue.current=[])};S.useEffect(function(){return O&&(document.addEventListener("dragover",xx,!1),document.addEventListener("drop",he,!1)),function(){O&&(document.removeEventListener("dragover",xx),document.removeEventListener("drop",he))}},[B,O]),S.useEffect(function(){var fe=function(I){pe.current=[].concat(bx(pe.current),[I.target]),wo(I)&&X({isDragGlobal:!0,type:"setDragGlobal"})},$=function(I){pe.current=pe.current.filter(function(Te){return Te!==I.target&&Te!==null}),!(pe.current.length>0)&&X({isDragGlobal:!1,type:"setDragGlobal"})},le=function(){pe.current=[],X({isDragGlobal:!1,type:"setDragGlobal"})},me=function(){pe.current=[],X({isDragGlobal:!1,type:"setDragGlobal"})};return document.addEventListener("dragenter",fe,!1),document.addEventListener("dragleave",$,!1),document.addEventListener("dragend",le,!1),document.addEventListener("drop",me,!1),function(){document.removeEventListener("dragenter",fe),document.removeEventListener("dragleave",$),document.removeEventListener("dragend",le),document.removeEventListener("drop",me)}},[B]),S.useEffect(function(){return!r&&R&&B.current&&B.current.focus(),function(){}},[B,R,r]);var be=S.useCallback(function(fe){H?H(fe):console.error(fe)},[H]),Oe=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Mt(fe),ue.current=[].concat(bx(ue.current),[fe.target]),wo(fe)&&Promise.resolve(o(fe)).then(function($){if(!(Qc(fe)&&!W)){var le=$.length,me=le>0&&Pz({files:$,accept:T,minSize:u,maxSize:s,multiple:d,maxFiles:p,validator:L}),ye=le>0&&!me;X({isDragAccept:me,isDragReject:ye,isDragActive:!0,type:"setDraggedFiles"}),f&&f(fe)}}).catch(function($){return be($)})},[o,f,be,W,T,u,s,d,p,L]),Ne=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Mt(fe);var $=wo(fe);if($&&fe.dataTransfer)try{fe.dataTransfer.dropEffect="copy"}catch{}return $&&g&&g(fe),!1},[g,W]),et=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Mt(fe);var $=ue.current.filter(function(me){return B.current&&B.current.contains(me)}),le=$.indexOf(fe.target);le!==-1&&$.splice(le,1),ue.current=$,!($.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),wo(fe)&&y&&y(fe))},[B,y,W]),Ot=S.useCallback(function(fe,$){var le=[],me=[];fe.forEach(function(ye){var I=mS(ye,T),Te=jp(I,2),at=Te[0],Pe=Te[1],Xe=gS(ye,u,s),Ve=jp(Xe,2),ke=Ve[0],Wt=Ve[1],rt=L?L(ye):null;if(at&&ke&&!rt)le.push(ye);else{var ja=[Pe,Wt];rt&&(ja=ja.concat(rt)),me.push({file:ye,errors:ja.filter(function(ti){return ti})})}}),(!d&&le.length>1||d&&p>=1&&le.length>p)&&(le.forEach(function(ye){me.push({file:ye,errors:[zz]})}),le.splice(0)),X({acceptedFiles:le,fileRejections:me,type:"setFiles"}),x&&x(le,me,$),me.length>0&&k&&k(me,$),le.length>0&&b&&b(le,$)},[X,d,T,u,s,p,x,b,k,L]),xt=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Mt(fe),ue.current=[],wo(fe)&&Promise.resolve(o(fe)).then(function($){Qc(fe)&&!W||Ot($,fe)}).catch(function($){return be($)}),X({type:"reset"})},[o,Ot,be,W]),bt=S.useCallback(function(){if(Q.current){X({type:"openDialog"}),V();var fe={multiple:d,types:F};window.showOpenFilePicker(fe).then(function($){return o($)}).then(function($){Ot($,null),X({type:"closeDialog"})}).catch(function($){Gz($)?(ie($),X({type:"closeDialog"})):Vz($)?(Q.current=!1,K.current?(K.current.value=null,K.current.click()):be(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):be($)});return}K.current&&(X({type:"openDialog"}),V(),K.current.value=null,K.current.click())},[X,V,ie,E,Ot,be,F,d]),yt=S.useCallback(function(fe){!B.current||!B.current.isEqualNode(fe.target)||(fe.key===" "||fe.key==="Enter"||fe.keyCode===32||fe.keyCode===13)&&(fe.preventDefault(),bt())},[B,bt]),Zt=S.useCallback(function(){X({type:"focus"})},[]),Ue=S.useCallback(function(){X({type:"blur"})},[]),pt=S.useCallback(function(){G||(Hz()?setTimeout(bt,0):bt())},[G,bt]),Dt=function($){return r?null:$},Nt=function($){return U?null:Dt($)},ge=function($){return _?null:Dt($)},Mt=function($){W&&$.stopPropagation()},qn=S.useMemo(function(){return function(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$=fe.refKey,le=$===void 0?"ref":$,me=fe.role,ye=fe.onKeyDown,I=fe.onFocus,Te=fe.onBlur,at=fe.onClick,Pe=fe.onDragEnter,Xe=fe.onDragOver,Ve=fe.onDragLeave,ke=fe.onDrop,Wt=Xc(fe,Kz);return kt(kt(rh({onKeyDown:Nt(wa(ye,yt)),onFocus:Nt(wa(I,Zt)),onBlur:Nt(wa(Te,Ue)),onClick:Dt(wa(at,pt)),onDragEnter:ge(wa(Pe,Oe)),onDragOver:ge(wa(Xe,Ne)),onDragLeave:ge(wa(Ve,et)),onDrop:ge(wa(ke,xt)),role:typeof me=="string"&&me!==""?me:"presentation"},le,B),!r&&!U?{tabIndex:0}:{}),Wt)}},[B,yt,Zt,Ue,pt,Oe,Ne,et,xt,U,_,r]),yn=S.useCallback(function(fe){fe.stopPropagation()},[]),it=S.useMemo(function(){return function(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$=fe.refKey,le=$===void 0?"ref":$,me=fe.onChange,ye=fe.onClick,I=Xc(fe,Qz),Te=rh({accept:T,multiple:d,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Dt(wa(me,xt)),onClick:Dt(wa(ye,yn)),tabIndex:-1},le,K);return kt(kt({},Te),I)}},[K,a,d,xt,r]);return kt(kt({},ne),{},{isFocused:D&&!r,getRootProps:qn,getInputProps:it,rootRef:B,inputRef:K,open:Dt(bt)})}function iI(e,n){switch(n.type){case"focus":return kt(kt({},e),{},{isFocused:!0});case"blur":return kt(kt({},e),{},{isFocused:!1});case"openDialog":return kt(kt({},lh),{},{isFileDialogActive:!0});case"closeDialog":return kt(kt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return kt(kt({},e),{},{isDragActive:n.isDragActive,isDragAccept:n.isDragAccept,isDragReject:n.isDragReject});case"setFiles":return kt(kt({},e),{},{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections,isDragReject:!1});case"setDragGlobal":return kt(kt({},e),{},{isDragGlobal:n.isDragGlobal});case"reset":return kt({},lh);default:return e}}function Sx(){}function kx({value:e,onChange:n,options:a,placeholder:r="Select…",disabled:o=!1,className:s,ariaLabel:u,prefixIcon:d}){const[p,f]=S.useState(!1),[y,g]=S.useState(null),[x,b]=S.useState(()=>{const L=a.findIndex(T=>T.value===e);return L>=0?L:0}),k=S.useRef(null),C=S.useRef(null),j=S.useRef(null),E=a.find(L=>L.value===e),R=(E==null?void 0:E.label)??r,O=S.useCallback(()=>{var L;f(!1),(L=C.current)==null||L.focus()},[]),G=S.useCallback(()=>{const L=C.current;if(!L)return;const T=L.getBoundingClientRect(),F=Math.min(240,a.length*36+16),V=window.innerHeight-T.bottom,ie=T.top,B=V<F+16&&ie>V?"above":"below";g({left:T.left,top:B==="below"?T.bottom+4:T.top-4,width:T.width,placement:B})},[a.length]);S.useLayoutEffect(()=>{p&&G()},[p,G]),S.useEffect(()=>{if(!p)return;const L=()=>G(),T=()=>G(),F=ie=>{var K,P;const B=ie.target;(K=k.current)!=null&&K.contains(B)||(P=j.current)!=null&&P.contains(B)||f(!1)},V=ie=>{ie.key==="Escape"&&(ie.preventDefault(),O())};return window.addEventListener("scroll",L,!0),window.addEventListener("resize",T),document.addEventListener("mousedown",F),document.addEventListener("keydown",V),()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",T),document.removeEventListener("mousedown",F),document.removeEventListener("keydown",V)}},[p,O,G]),S.useEffect(()=>{if(p){const L=a.findIndex(T=>T.value===e);b(L>=0?L:0),requestAnimationFrame(()=>{var T;return(T=j.current)==null?void 0:T.focus()})}},[p,e,a]),S.useEffect(()=>{o&&p&&f(!1)},[o,p]);const U=L=>{o||(L.key==="ArrowDown"||L.key==="Enter"||L.key===" ")&&(L.preventDefault(),f(!0))},_=L=>{var T;if(L.key==="ArrowDown")L.preventDefault(),b(F=>{var V;for(let ie=1;ie<=a.length;ie++){const B=(F+ie)%a.length;if(!((V=a[B])!=null&&V.disabled))return B}return F});else if(L.key==="ArrowUp")L.preventDefault(),b(F=>{var V;for(let ie=1;ie<=a.length;ie++){const B=(F-ie+a.length)%a.length;if(!((V=a[B])!=null&&V.disabled))return B}return F});else if(L.key==="Enter"){L.preventDefault();const F=a[x];F&&!F.disabled&&(n(F.value),O())}else if(L.key==="Home"){L.preventDefault();const F=a.findIndex(V=>!V.disabled);F>=0&&b(F)}else if(L.key==="End"){L.preventDefault();let F=-1;for(let V=a.length-1;V>=0;V--)if(!((T=a[V])!=null&&T.disabled)){F=V;break}F>=0&&b(F)}},W=["v10-select",s,o?"disabled":"",p?"open":""].filter(Boolean).join(" "),H=y?y.placement==="below"?{position:"fixed",left:y.left,top:y.top,width:y.width}:{position:"fixed",left:y.left,top:y.top,width:y.width,transform:"translateY(-100%)"}:void 0;return m.jsxs("div",{ref:k,className:W,children:[m.jsxs("button",{ref:C,type:"button",className:"v10-select-trigger",onClick:()=>!o&&f(L=>!L),onKeyDown:U,disabled:o,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":u,children:[d&&m.jsx("span",{className:"v10-select-prefix","aria-hidden":"true",children:d}),m.jsx("span",{className:`v10-select-value ${E?"":"placeholder"}`,children:R}),m.jsx(IT,{className:"v10-select-caret",size:12,"aria-hidden":"true"})]}),p&&y&&bE.createPortal(m.jsxs("ul",{ref:j,className:`v10-select-menu v10-select-menu-${y.placement}`,role:"listbox",tabIndex:-1,onKeyDown:_,style:H,children:[a.length===0&&m.jsx("li",{className:"v10-select-option empty","aria-disabled":"true",children:"No options"}),a.map((L,T)=>m.jsx("li",{role:"option","aria-selected":L.value===e,title:L.label,className:["v10-select-option",L.value===e?"selected":"",T===x?"highlighted":"",L.disabled?"disabled":""].filter(Boolean).join(" "),onMouseEnter:()=>b(T),onMouseDown:F=>F.preventDefault(),onClick:()=>{o||L.disabled||(n(L.value),O())},children:L.label},L.value))]}),document.body)]})}function Cx(e){return e.bridgeOnline?"connected":e.status==="connecting"?"known":e.status==="degraded"?"degraded":"offline"}function rI(e,n){return n?"Session history":e.chatReady?`${e.name} connected`:e.status==="connecting"?`${e.name} is connecting…`:e.status==="degraded"?`${e.name} degraded`:`${e.name} is unavailable`}function lI(e){const[n,a]=S.useState(!1),[r,o]=S.useState(!1),s=S.useRef(null),u=S.useRef(null),d=S.useRef(null);S.useLayoutEffect(()=>{if(!n)return;const g=d.current,x=u.current;if(!g||!x)return;const k=(x.closest(".v10-panel-right")||document.body).getBoundingClientRect();x.getBoundingClientRect().left+g.offsetWidth>k.right-4?o(!0):o(!1)},[n]);const p=S.useCallback(()=>{var g;a(!1),(g=u.current)==null||g.focus()},[]);S.useEffect(()=>{if(!n)return;const g=b=>{var k;(k=s.current)!=null&&k.contains(b.target)||a(!1)},x=b=>{b.key==="Escape"&&(b.preventDefault(),p())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",x)}},[n,p]),S.useEffect(()=>{var x;if(!n)return;const g=(x=d.current)==null?void 0:x.querySelector(".v10-agent-tab-menu-item:not(:disabled)");g==null||g.focus()},[n]);const f=g=>{(g.key==="ArrowDown"||g.key==="Enter"||g.key===" ")&&(g.preventDefault(),a(!0))},y=g=>{var j,E;if(g.key==="Tab"){a(!1);return}if(g.key!=="ArrowDown"&&g.key!=="ArrowUp")return;g.preventDefault();const x=Array.from(((j=d.current)==null?void 0:j.querySelectorAll(".v10-agent-tab-menu-item:not(:disabled)"))??[]);if(x.length===0)return;const b=x.findIndex(R=>R===document.activeElement),k=g.key==="ArrowDown"?1:-1,C=b===-1?k===1?0:x.length-1:(b+k+x.length)%x.length;(E=x[C])==null||E.focus()};return m.jsxs("div",{className:"v10-agent-tab-menu",ref:s,children:[m.jsx("button",{ref:u,type:"button",className:"v10-agent-tab-menu-trigger","aria-label":`More actions for ${e.integration.name}`,"aria-haspopup":"menu","aria-expanded":n,title:`More actions for ${e.integration.name}`,onClick:g=>{g.stopPropagation(),a(x=>!x)},onKeyDown:f,children:m.jsx($T,{"aria-hidden":"true",size:14})}),n&&m.jsxs("div",{ref:d,className:`v10-agent-tab-menu-popover${r?" align-right":""}`,role:"menu",onKeyDown:y,children:[m.jsxs("div",{className:"v10-agent-tab-menu-status","aria-hidden":"true",children:[m.jsx("span",{className:`v10-agents-stat-dot ${e.statusDotClass}`}),m.jsx("span",{children:e.statusLabel})]}),m.jsx("button",{type:"button",role:"menuitem",className:"v10-agent-tab-menu-item",disabled:e.refreshBusy,onClick:()=>{p(),e.onRefresh()},children:e.refreshBusy?"Refreshing…":"Refresh"}),e.canClearSession&&m.jsx("button",{type:"button",role:"menuitem",className:"v10-agent-tab-menu-item",disabled:e.clearBusy,onClick:()=>{var g;p(),(g=e.onClearSession)==null||g.call(e)},children:e.clearBusy?"Clearing…":"Clear session"}),e.canDisconnect&&m.jsx("button",{type:"button",role:"menuitem",className:"v10-agent-tab-menu-item danger",onClick:()=>{p(),e.onDisconnect()},children:"Disconnect"})]})]})}function am(e,n){return(n==null?void 0:n.trim())||`integration:${e}`}function Ro(e){const n=e.sessionId??e.defaultSessionId??rr(e.integrationId);return{integrationId:e.integrationId,sessionId:n,stateKey:am(e.integrationId,n)}}function SS(e,n){for(const a of n)if(e===a.id||e.startsWith(`${a.id}:`))return{id:a.id,name:a.name};return null}function kS(e){var a;if(e.selectedSessionId==null)return!1;const n=e.integrations.find(r=>r.id===e.integrationId);return!(((a=SS(e.selectedSessionId,e.integrations))==null?void 0:a.id)!==e.integrationId||n!=null&&n.defaultSessionId&&e.selectedSessionId!==n.defaultSessionId&&sI(e.integrationId,e.selectedSessionId))}function oI(e){return kS(e)}function sI(e,n){return n===`${e}:dkg-ui`||n.startsWith(`${e}:dkg-ui:profile-`)||n.startsWith(`${e}:dkg-ui:home-`)||n.startsWith(`${e}:dkg-ui:transport-`)}function Ex(e,n){const a=e.flatMap(r=>{var d;const o=SS(r.session,n);if(!o)return[];const s=r.messages.find(p=>p.author==="user"),u=r.messages[r.messages.length-1];return[{sessionId:r.session,integrationId:o.id,integrationName:o.name,preview:((d=s==null?void 0:s.text)==null?void 0:d.slice(0,60))||r.session,messageCount:r.messages.length,lastTs:u==null?void 0:u.ts}]});return a.sort((r,o)=>{const s=Date.parse(r.lastTs??""),u=Date.parse(o.lastTs??"");return Number.isFinite(s)&&Number.isFinite(u)?u-s:String(o.lastTs??"").localeCompare(String(r.lastTs??""))}),a}function CS(e,n,a,r,o){var u;const s=Ro({integrationId:e,sessionId:n,defaultSessionId:o});return(((u=a[s.stateKey])==null?void 0:u.length)??0)>0||(s.sessionId?r.some(d=>d.sessionId===s.sessionId):!1)}function ES(e,n,a){const r=am(e,null);return Object.entries(n).some(([o,s])=>s.length>0&&(o===r||o.startsWith(`${e}:`)))||a.some(o=>o.integrationId===e)}function cI(e){const n=[...e.integrations].sort(du),a=n.filter(d=>d.persistentChat),r=n.find(d=>d.id===e.selectedIntegrationId)??a[0]??null,o=r?Ro({integrationId:r.id,sessionId:e.selectedSessionId,defaultSessionId:r.defaultSessionId}):null,s=r?CS(r.id,e.selectedSessionId,e.localMessagesByConversation,e.sessions,r.defaultSessionId):!1,u=r?ES(r.id,e.localMessagesByConversation,e.sessions):!1;return{sortedIntegrations:n,connectedIntegrations:a,selectedIntegration:r,selectedConversation:o,selectedHasConversation:s,selectedIntegrationHasAnyConversation:u}}function uI(e){const n=e.selectedIntegration,a=!!(n&&!n.persistentChat&&e.selectedHasConversation),r=!!(n&&!n.persistentChat&&e.selectedIntegrationHasAnyConversation),o=r?[n,...e.connectedAgents.filter(d=>d.id!==n.id)]:e.connectedAgents,s=e.selectedIntegrationId===sr||!n&&e.connectedAgents.length===0||!!(n&&!n.persistentChat&&!e.selectedIntegrationHasAnyConversation),u=!e.localHistoryLoaded&&e.localMessagesCount===0&&!!(n!=null&&n.persistentChat||e.selectedHasConversation);return{showingSessionHistory:a,showingStoredSessions:r,visibleAgentTabs:o,showAddFlow:s,shouldShowConversationLoader:u}}function du(e,n){const a=e.id==="openclaw"?0:1,r=n.id==="openclaw"?0:1;return a!==r?a-r:e.persistentChat!==n.persistentChat?e.persistentChat?-1:1:e.name.localeCompare(n.name)}function Nc(e,n){return[...e.filter(a=>a.id!==n.id),n].sort(du)}function dI(e,n){const a=e.find(u=>u.id===n);if(!a)return e;const r=a.connectSupported,o=r?"available":"coming_soon",s=r?"Ready to connect":"Coming next";return Nc(e,{...a,configured:!1,detected:!1,persistentChat:!1,chatReady:!1,bridgeOnline:!1,bridgeStatusLabel:s,status:o,statusLabel:s,detail:r?`${a.name} is no longer attached to this node. Reconnect from the + tab when you want live chat again.`:a.detail,error:void 0,target:void 0})}function fI(e){const n=e.selectedItem;return e.selectedIntegrationId===sr||n!=null&&(n.persistentChat||CS(e.selectedIntegrationId,e.selectedSessionId,e.localMessagesByConversation,e.sessionSummaries,n.defaultSessionId)||ES(e.selectedIntegrationId,e.localMessagesByConversation,e.sessionSummaries))}const pI={openclaw:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAEy0lEQVR42u2ba4hVVRTHf1OmM9GUjzITRmEyX4nglxwjzZKMIsFHGEJJJlLfJGTGBD8kRkRCVmrRA8ueSqmRqJFOpqb2QafR0sovvbTygaPQpONM3s6W/43D7Z65Zx/OuWcfuAsWM/fOXnut/9pr77322nugQhWqUIWiUzVwC1CXgu466a5OC/wdwA9ADugE9gCPAD0S1NlDOvZIp9H9I9CQhgOmA98BrwIfAG0yaDswIgF9I9S30XFGOo3uVs8h96QVBVf6fh8IvCADTwFTfH8bANztOWk+sBLYAHyhkfwKaAbWAyvUZhJwk09+ivrMScdA39+qXFsX7gV+Bi4Ay4GtPuNt+LQX2p8BL6ov0+fkLCyMozWiuZi5WX07S4OBNzVauYT4gnQMdg38w8DxBIEX8nHtBqlTL+ClMgIv5JdlQyp0LbAxRfB5/kS2lJWu0eqec4S3yqaykMnG1joEPs9rE85C/6MlDoLP89NJg5/sy8HDrNQ7gIMRwVwCWtTHiZAyF5NMi3sD31usztdLrqfODW0W4H8H7vPp7g+sCSlrbLwuzdBvVn5u5uMqL2r2Ard6ETEvpPw/3iHrQekcBuwE3tEAHAjZx5IksrwzIZU/7jM+/90qjcq5EPLHgFr1sdj3/RhgYUgbjK2D4nTA8xbh+5ivWPKGRu12L2HqE3Ia/OLpu1p9jAK+1kmxxsIBhp+LC3w/zcmwijcUyF+hn7O0sJWS79TRudhxd6flOtIvDgfMtVy9zRxuBK7y9WEi4FeLPg4XnPxMND0bYSeZE4cDXrPY+vxsQv8tYDPwdwT5c0q1V3u7yKEI8p2qGFnTDcBQb+Wt18pbo89TlWgccTgROiIbp8rmamGo1+f+3QE3CcQWJR3m3N3uhf9vwDYtPg+oElujUXEN/GrZVidbm7yp97kwtAvTSZ0b/pcszVYWVUrJX5rfPR2LhMOyqVE2hskYZ/uLmactlHWoYPmMQw5YKpsuWtYcLxdXn4igcGxEuaTY2HJbRDnrUlaHsqyljkXAIMsIyGlrvjx/bIRaIiQlSfOXsqnFUu5blCzYJhc3ezvDeYcccF422WJ5FF0whk1U9snTaxzcBt+WbftCtjeYh+Rz7U0hBMxBZriurbocdECXbBse8tD1qf+cMa7EAmISifuVSf3kcCZobLtRtraXyAPGFSZDTd10epdSyr0Og/dP096yOWiwGoPSYXNk3a3t4RttL30UVvszAD7P+2VzX2FoUZ1hF/BQmANRre/q+ymLapBL3Cbb89f4tVHvAFozCD7PrXHcFSzKsAMWxlEQGVpiRXWV25XjxELrM+iAj+OsCk9UrS8r4I2td8bpgCpVi7LigC1JPJ4aq6Ow6+A7VBtIhFZmwAErkrwdNhcNRx0GfzSuy5DuaJKjU6FDtpWFmhx0QFM53whV6cbIFfCvp/Fk1jxPW+cA+HVpPpUzNzHvpgj+PdmQKpnT1rIUwC8r16swm+eyf5QB+J/S5STVKyy7Eip6vq/yt/M0HvgQOBsD8LNa6MaTQZoT8P7vSWAB8Iq200X6fKmbN0eZpGkBo1rsn5waAtpOy7IDZgSAmlCk7YSAtjMqDsgwzQwANTGg6lSs7cwsO8DM64+K8MgibUcGtG2gQsnRv1P7PFimYrmBAAAAAElFTkSuQmCC",hermes:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAANwElEQVR42rVbCZAcVRn+Z3bume6ZnnN3dg0EEzmMiWCJpVUmIjEeWJZiqRRBEw8owERRU4pXieWBEsAyZUlQMXhfSCkBQUuU9RY8IhQaECMEEjAEYyRkQULWflPfW7/8eT3dvYtb1cl0v9fv/e//X//H9/9PRGRURMZEpCIiIyLSFpGeiORFpIS2Jto8EemLSA33LbxfFJEC3mujrYq+Pu6bGKuEsbsi0hGRHOY2bQ30bRBNOfTrRtDkK5raoKkAukZB5wj69LEOcx8IBusTAzp4yU7Wx2RZvDiOgbIYeIwYwJNV0ddH3ybGsgzoYS7Tt4y2Ovo2FE1d9M8RTQH6+pinGsGAMdCUBd3jWIelaTBJBZO20KmKxgBtNbT5ILaO9hraA0ffOvVtYVI7T4A57DwNtPk0j+3bpL4B9fUc8zSJfk1TE30q1NeMMeDaSIyEKuCcllCZJGS3aFlJqJ5CQkl2WBttVUVToOi3NPEOaxBNdocNBuxgwCIY0cZAFbQFaPMwqIf7AH0rmKSN94tYRBfSLGDyDvqWsLgmftfQVld9a0RTS9HUQF8f83DfDugpJ6B/IOlRMCCPRXQxeAntAb4/DxKp4b6J9hIG7IHQHMYbA4G27yiIKoCwNuasoK2Bvg3cV4imDt4ro83S5BP9OczfAz2W/ibaaqDJw/2AAfkIArsOAusRBHZwcV8mcEwR2FUEagYzgczgLt7POxgcOBjciWBwnZg2M3iACewWbWOyIjryFq2rz6aF/tx32BZtp9iivJ2TfmKWJvvZRNFf02bQ2lzrBxQdfoBWUlahsZKKM4N2HvMsQz6ET0p2DIt2+QFxZrBHNEWZQav4B/9ok9bE7ypeZtPTVCatGWHSPGU6PZKsmWueiDxdRI4TkWNF5Kloz2CRwRAz2yTz56cws57DzA44YaXZB9dykCabEWtyMnhxHISOgOM9/C6ibcBdkq55tlhEVoVjbxSRX4vIv0VkWkT2icgOEflVKMHPhP+vwNhl2mF5/O6QGZzAYjJY9Djm1zSV0NZAX2uazfgDrvi46iSpOt3bNl/dR/X1aOuuDNs+FT67RETeKiInYVsa4k8VkWvABH39UUTejjGKKWjyU/YdSN1yI0OucA6c72N3ZPDyBLZhBt9bX0mohuttInKnY2FTIRMmReQ0vGf+3kC7QV9mVywnbc87LIPnE9gRlv4x0GPpb6Othr72UzPrmiG4Tt9dDduljt8e3VcxaQPPa/Q7D6luiViMvjbSQl4qIv+K6LdXRF6PxTeIpgC0MP1MU0PRb/sy/Ye5wi4dUIkIVkoUVR2B7/eJhIu31w8gNcEio95/VETeTIGMtjLWFY7SAZGusLXhNXwGUVbAatw2iCjTjjkmlOBvUy7cLmpXyOjP0g7aOKT/dSKyEAtoYGF+Cvo9Rf/ACgzDA2w8HYUHmPsTReQOReiBIYv4h4jcH37320TkZSJyPBTeKuy8Ptq13vge9MoFMKENhQdE+QHD8ICBpbKRlvUEy3jWwYsFDN5VwUobjNsMSVpid4rIfSThg2oxRuLvFZHV2ParwMBPgzAz14WhxXhQRK7CWJeh79PwfDW2ck95gl3yBNvknVaI/jz+71lXuEAMYL/bBiuWAT0awDobhpD3iMgPsdDHQi5fDM1tFv8dfLdmkb8RkZtCBpwLzp+P7b4VfS8XkaVY0KJwsV8XkVNE5EuhhXgnpH8ZmHgzuc0+0dQjAXIAVUFbw8WAniOwcX0COfoEzCRHwpRNYGBj59eLyGtxvxzm7cMiskRE1sIRssStc3wel0LShpZfQtrb0fZIyPC78fsgrIaoTyCXABLjYKsptFWsErGxdxmEtEnheASSvE9ErghN1DtE5IVYqJHwnyGhu5Vtn4K3twXt9zgY8AcQlsH4wxTolRRtWvqtC90ipKuNZ0y/h/vGbMxgBjvkNmx5I42HhxCaxiz+M5zvI2Dk9WDatEOPWGV6HAVmgTLNvaSIUDXCEbL4W1U5HYZBy1IsbAe2b5K+ByhGuAUMngaDXZZlJekopr9KjpCmv6qcpkNc4azDFR5XrrB5cU0KqW5P6SPcA6VoJHwXGL0vwku8FBKekyvsp7yMYvloigX9B9p7KkHfgyR1vTO2R8QJVRXQ+erei1nPIeHwuEMHZFU4LPhOoxZxr0Mn/FREfj4LT5Gvvyt/YxpWYh5omnU43HSAHAHphkAFQRXY5ChCH4E5NJ7e37B9jT9wpoj8Dtv6r7AEO1Iw4EFcWsEupbC8GkG/BnR8yg8cAollyY7mFCSWJTPybIc0DsDLW0tJltfAz/+JiPxIRN5PQGsfKNDahAx4DLtAPz+bFsz052MgsZnMUIlsYocw/pYCIBlUNO1fIYlPw3F5tYicTjsqA/9gJzHJMOJVGFfg0OhF3Qo7f5PS/tsc1mADRag67+ACRYsaFNWweEnB4jkHLO7BE7wBfvyfoORug2u7jCRiwuQ3Ybt+F4y7CN9mBszQDDDO0u8BnOxXccYe1fdnlFAdpcwQw+LlCFh84Ad0yS/OE26vEyN5LHyUpNuGb38q0B8TGO0ml7cLs2Pc46/B3z+Nkh1GAq9IoQcexi7gZ7vhEJUV/Tbv0IVw85hvlELvQWLEQs5VLJpTY4zbFxRuXyDEpQTp347vvEC4vcXnngKNnaN4wIx/VgoGGDP5F4dn+EqKXWxqjOlvEv09on/AgJz6BIoqOcr5+7rK31vn6UhI4luUlQlUvF4mJdUjPHBDSnO43eFZnk8KTydHc5ib6w/qhIHMKD2ruat41kyQ8rbZnmPgx38QW/4EQl0Yt9eITR6QWBoG7MVc/GwzKT6mvxlBv0/0H2YGu8oV1unrCQpAbCS5BP77i4HyWLvLuH2THJUc6YetKRnwOMwtP7sfNLtc4TFKqbMrbJ2/maDBhfF7Ch32FbpqCw5egu/yFIAfPukBxukbymlZFBNJDnOKtG5YQSYuDf2RmaGxCFdYZ4bM31tAyDp4gb8Ix/m4iCwg3L6iJGT+Tp6lW7zfoQjXg67UrnBDYfxpOVgExjcN2OuM0PZvwk44j96tq3mKAFN0JPjQLGKEaTC94shaRdHvaVeYy11cmaGsgsSsDvCRD7BbcQ22Y5USkRmF21tn6vNqMRfCnKZhwHUInffC1AbkCueT6IA0VsBmVxeRD2AWc63y4loOK6Bx+5yyAFOAyG9JyQBjeq/G79cRAmStQDnOCuQIEovzA4pwXE4mZ6nokNo6jJGlChGrL9qEPnMKbRLKdFdKBnwj1Anvxu9PKmvm8gMOg8RcnmDH4Qla13ES+LwFJBdj+2lnZQlBUB5qAE4kBs9TIMduoD4PpGTAlaSENyH7vIwWHusJRsUC7Etbr24cEloBaZpn5wwxVZOIErdicfvhKpu/+QoPMLvhBcAN0jDgYwSxm+DsmSFzv0hFlbGxQFw0mCd4+Xho6S0IY5dTCny/AyOI8udXgQm30vM34tn6lAxYCcDFhuSjwCCPpoKqodFgHB5QonTz82HqXN7ZNxPiftNAhM5TDHsAKNHBFIvfA8bZ/MON+LTuBWjjx+AB1TSIkMDn3wx8z8Li9yEkvp6QmycS5gAuSrlgVxXJzXR/OT5PI4ijsJ5YRIgxwWoMJmgY8mUR+bGIfAAWYQUU0TQ5QwcSuLIvgg7ZOAcG6HnOAS07KTvE+Q2fMMGqyxXmYEWjwjYIasPrOgDQc4+SyLeHEDwFp2kpdpQNWz80C/Onr4dgDSwM7ydwhSs6L1Afgp/XaSc0kbG9HVt+JzTwakduX6O4a6i2x5bQmb9PUL+7yBxOYXG7AL1NRiRJroBg9kFZV2LW47uKpLJDXGEukqqA6HmY1Ciil2MHRAUrXB+wgOIJgwx/FYvbAMj9KliXM6HNj4X3eRLc5UuQhOV44EYw+FxKgycuknLl1oIEuTXDpHepxd4JizBMuRk7/YyQmC8A4roAWns+lOkdWPAIudBlbGUjnM9BFzHavAPp+JwjN+jKbwRcJMWlrMWURVIZwOEXwyE5CvZ4WKrscWzza7FdF8Jz3IRFHY0dZs8LcBmeFdLVSKTuhwu8kGqOc2mKpNqEkZcS1gd4Khc/Iv/7Oz0mdN0GTb0Y0jgC1WFnw56fQBUqVQdNVrqL8dlcQ7uDaSonqA8IbJHU6JBiaV0hwucFuDbfMOG5sAyPQnlN4Zu/AZ+GSY19n7bhfEhyMUpizgITG1T6HnVoqgK4/QxiVk6BrvoMg64Qac2lRqgHIgpUWt/HYp4XOkzPQtC0AIpnARypcSrDN/8/B+NN0Lg18tW7JN0Oubc18lR1jVCB8EquEXIWSaWtEssPqciyIESTymmrNG6WzgCUaHsHVHano7UubXGmqeYQiqapparEuEjKnmGYU52gPjeoj80lPTdYprxDNuG5wSBBnWAxSZ1gKwKxSVIpqlEkV1WmH4M4ldWxvJLKO5QVxl8ldKcUUb0aVynKNM3ZDLrOC0Sd6Miqg5lx6WuXGXSdF4grknKZwRlXuBaB2rqqxV3V1royuxaBxHpqnpoDtfUcqHNSmmZLv7NIaizleYE8FT20SfkNywz1Ep5IyRJqNfL/OC/gqcyN/yScGBn2bt3xrp+iL4/bmOOJEc+VGSrO8cyQDT0Dh4RcOqAfk3vsz+LMUC5NZihQgMiwU2OuE1p8aqxFuQR9aowPZ8edBNMHrgOV6Y07NaZPsgURp8aC/wJs6rIsXDWrggAAAABJRU5ErkJggg==","prime-agent":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAEUElEQVR42u2Za4hWRRjHf7uuklZ0pSuRG26WUdHVIilqsduHXa39UJBCJWWlkNLNCrthQR+iD4ZWFLFZEhWRKJYVka6Q+qnY7trFG9GuZRetzextBv4Lw2HOeed99z3nLNv8YfZlmTkzzzPnufyf50BERERERERERERERETEiMcRwAH/J4UPAqYAC4E1wE7gY+C4kaz0aOBSYDHwDVDxjPaRqPhhwGxgU4rSg+N5YOxIUnwMcCvwdRXF7XgMaG7UwQcD5wHnAseUpPxkY+4fBSj+BzCrkQdfDnwJ7NfoAz4E5ijSFuHn9wK/Byj/I3BFo33tu4wDrSlek6Pyk4D3AhS3Y6ustKE426SVf6scvA+4rcHnNgG3y9pClN8BnJPHGzjVmN+fAQLYS5jeoDNbgTcS+9uLeCfl7F3K/7lgArA38C1sA44d4nnX6226+/bIFR5NefMX5RmArg5wAXc8Wec59uK6Pfs9Z3L58cALnrkf8jJ7F695Dv7EpJq7UnJxfx3Us9PD4v4B7tP8ZZ5zdio+5YoLgQHP4VdpfmWKFcwN3P9IYInHwqzLzXTWnZJIgft1abnjrZS3byusccDmlAtYF8DAbK7u9Tz7C9ChNW3mz8PiIO6aZ4pQ/nzgb4+AMzR/ckZw3Kv5NF7xtLJG8rmfgalOJtjlzFlL3GAC7c1ASxEX4As6PeLiyA2yguEdnj3bZUGVlDc/NbH+YrlChy50VFGc+2gPARmQQIO4u8oF9Do0+XBlh4GM9XMcAjTPMLpVRulXlRlelys0F3UB13kE7E6seSkgJX5qeMSyjFhhx1+KNWOcam9bCscYV9QFLPf49GnO/KiAOjx0LJN5jzfnTjRF1iVKpe6aX03Ov7HIsnNDQoAVntL4+wYovxv4AvhANPdtFT5r9f/L4gKTiq67Z4qY7JGgt3gKlcnqt9Wj+JtKgyeojzda+05JWFqpaNHtV1KaC03K97Uq/xlwiGe/+WJ//XkWNrXA0s8tEnq5Z/6COpS3fYUzE/vYDLHUQ7YOLFP5WY75D5aiyTbYWTUqv0qVpWtB01PYYEX7l4K5KdXfnYl1zXIRG7Ce8tDVipjk+0bJrsRzV5o6490qqbGtDOWnZZCVrxSw0uDygs9NYFtkgt3pzrz1+xt0YdWsZXWRrG8QJ6rEzBJsXsbzC9Q5WqRiaazM+CZT6z/rxJNqY08RNb4P3QHC9Sv9pbXNJ6hGf8XEke01NlLSXK0QnCG/CxGwTxnCB+vbvw2BGD1RVuB7vEZBfxJtdXGoIVDf1qm4zf8PlKW8jcrr6xD6wcQ+HXUqvzXn7wpBX116axB4QGVqa2Kf++ukxOOHA+tbHWimK9Un9GFhDYpvSfT8SkdXhrC2LfViAD9vD1DcptlHgKMYZmjyBMI+fYhorSGWPKTWVrKXsNH83qP+/rBGpwqfxUOgoicB16p52amWdgsREREREREREREREREREaXhPxXZ1AH/I5YbAAAAAElFTkSuQmCC"};function hI(e){return pI[e.trim().toLowerCase()]}function Ax({integrationId:e}){const n=hI(e);return n?m.jsx("span",{className:"v10-local-agent-logo","aria-hidden":"true","data-agent-logo":e,style:{maskImage:`url("${n}")`,WebkitMaskImage:`url("${n}")`}}):null}function mI(e){var me,ye;const{integrations:n,selectedIntegrationId:a,selectedIntegration:r,selectedSessionId:o,selectedHasConversation:s,selectedIntegrationHasAnyConversation:u,onSelectIntegration:d,onConnectIntegration:p,onDisconnectIntegration:f,onRefreshIntegration:y,onClearIntegrationSession:g,connectBusyId:x,refreshBusyId:b,clearBusyId:k,connectNotice:C,connectError:j,localMessages:E,localHistoryLoaded:R,localChatEndRef:O,localInput:G,onLocalInputChange:U,onSendLocalMessage:_,onStopLocalStream:W,localSending:H,activeProjectId:L,availableProjects:T,projectsLoading:F,onSelectProject:V,attachments:ie,onAddAttachments:B,onRemoveAttachment:K}=e,P=e.selectableProjects??T,Z=ie,ne=Z.some(rS),X=[...new Set(Z.map(I=>I.contextGraphId))],D=Z.some(I=>I.status==="uploading"),Q=E.some(I=>I.streaming)?"streaming":D?"uploading":"idle",N=Z.length>0&&Z.some(I=>I.contextGraphId!==L),ue=S.useRef(null),pe=S.useRef(null),[he,be]=S.useState(null),Oe=S.useCallback(I=>{pe.current=I,be(I)},[]),[Ne,et]=S.useState(!1),Ot=S.useCallback(()=>{const I=pe.current;if(!I)return;const Te=I.scrollHeight-I.scrollTop-I.clientHeight;et(Te>40)},[]),xt=S.useCallback(()=>{const I=pe.current;I&&I.scrollTo({top:I.scrollHeight,behavior:"smooth"})},[]);S.useEffect(()=>{const I=pe.current;if(!I)return;const Te=requestAnimationFrame(()=>{const at=I.scrollHeight-I.scrollTop-I.clientHeight;et(at>40)});return()=>cancelAnimationFrame(Te)},[a,o,E.length]),S.useEffect(()=>{if(!he||typeof MutationObserver>"u")return;const I=()=>{const at=he.scrollHeight-he.scrollTop-he.clientHeight;et(at>40)};I();const Te=new MutationObserver(I);return Te.observe(he,{childList:!0,subtree:!0,characterData:!0}),()=>Te.disconnect()},[he]);const bt=(me=e.selectedIntegration)!=null&&me.chatAttachments?e.activeProjectId?e.localSending?"sending":null:"noProject":"unsupported",yt=bt===null,Zt=S.useCallback(I=>{yt&&B(I)},[yt,B]),Ue=wS({onDrop:Zt,noClick:!0,noKeyboard:!0}),pt=[...n].sort(du),Dt=pt.filter(I=>I.persistentChat),Nt=pt.filter(I=>!I.persistentChat),ge=r,{showingSessionHistory:Mt,showingStoredSessions:qn,visibleAgentTabs:yn,showAddFlow:it,shouldShowConversationLoader:fe}=uI({connectedAgents:Dt,selectedIntegration:r,selectedIntegrationId:a,selectedHasConversation:s,selectedIntegrationHasAnyConversation:u,localHistoryLoaded:R,localMessagesCount:E.length}),$=H||!(ge!=null&&ge.chatReady)||ge.busy===!0,le=!$&&!D&&(G.trim()!==""||ne);return m.jsxs("div",{className:"v10-agents-tab",children:[m.jsxs("div",{className:"v10-agent-subtabs",role:"tablist","aria-label":"Integrated agents",children:[yn.map(I=>{const Te=(ge==null?void 0:ge.id)===I.id&&!it;return m.jsxs("div",{className:`v10-agent-subtab-group ${Te?"active":""}`,children:[m.jsxs("button",{className:`v10-agent-subtab ${Te?"active":""}`,onClick:()=>d(I.id,{preserveSession:kS({integrationId:I.id,selectedSessionId:o,integrations:n}),sessionId:I.defaultSessionId}),role:"tab","aria-selected":Te,children:[m.jsx("span",{className:`v10-agents-stat-dot ${Cx(I)}`}),m.jsx(Ax,{integrationId:I.id}),m.jsx("span",{children:I.name})]}),Te&&m.jsx(lI,{integration:I,statusLabel:rI(I,Mt),statusDotClass:Cx(I),refreshBusy:b===I.id,clearBusy:k===I.id,canDisconnect:I.connectSupported&&I.persistentChat,canClearSession:I.id==="local-llm",onRefresh:()=>y(I.id),onDisconnect:()=>f(I.id),onClearSession:()=>g(I.id)})]},I.id)}),m.jsx("button",{className:`v10-agent-subtab add ${it?"active":""}`,onClick:()=>d(sr),role:"tab","aria-selected":it,"aria-label":"Add another integrated agent",title:"Add another integrated agent",children:"+"})]}),it?m.jsxs("div",{className:"v10-agent-add-surface",children:[m.jsx("div",{className:"v10-agents-section-label",children:"Connect Another Agent"}),C&&m.jsx("div",{className:"v10-local-agent-notice",children:C}),j&&m.jsx("div",{className:"v10-local-agent-error",children:j}),m.jsxs("div",{className:"v10-local-agent-list","aria-label":"Available agent integrations",children:[Nt.length===0&&m.jsx("div",{className:"v10-agent-empty-state",children:"No additional local agent integrations are available yet."}),Nt.map(I=>m.jsxs("div",{className:"v10-local-agent-detail v10-local-agent-choice",children:[m.jsxs("div",{className:"v10-local-agent-detail-head",children:[m.jsxs("div",{children:[m.jsxs("div",{className:"v10-local-agent-title",children:[m.jsx(Ax,{integrationId:I.id}),I.name]}),m.jsx("div",{className:"v10-local-agent-subtitle",children:I.description})]}),m.jsx("span",{className:`v10-local-agent-status-pill ${I.status}`,children:I.statusLabel})]}),m.jsx("p",{className:"v10-local-agent-copy",children:I.detail}),I.error&&m.jsx("div",{className:"v10-local-agent-warning offline",role:"status","data-testid":`local-agent-warning-${I.id}`,children:I.error}),I.id==="openclaw"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"v10-local-agent-copy",children:"Connect your local OpenClaw once, then this tab becomes the persistent chat surface for that agent. The node can retry the bridge without forcing you back through setup."}),m.jsxs("div",{className:"v10-local-agent-actions",children:[m.jsx("button",{className:"v10-agent-send-btn secondary",onClick:()=>p(I.id),disabled:x===I.id,children:x===I.id?"Connecting...":"Connect OpenClaw"}),m.jsx("a",{className:"v10-agent-link-btn",href:J5,target:"_blank",rel:"noreferrer",children:"Docs"}),m.jsx("a",{className:"v10-agent-link-btn",href:eL,target:"_blank",rel:"noreferrer",children:"Release Notes"})]})]}),I.id==="prime-agent"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"v10-local-agent-copy",children:"Connect a local Prime Agent through the node, then this tab becomes the persistent chat surface for it. Prime Agent publishes a bridge per live session; the first chat pins one session, and you can switch explicitly when several are live."}),typeof I.sessionCount=="number"&&m.jsx("p",{className:"v10-local-agent-copy","data-testid":`local-agent-sessions-${I.id}`,children:I.sessionCount===0?"No live session. Start a Prime Agent session, then refresh — the extension publishes its bridge on session start.":I.sessionCount===1?"1 live session.":`${I.sessionCount} live sessions — choose which session this chat should use.`}),I.connectSupported&&m.jsx("div",{className:"v10-local-agent-actions",children:m.jsx("button",{className:"v10-agent-send-btn secondary",onClick:()=>p(I.id),disabled:x===I.id,children:x===I.id?"Connecting...":"Connect Prime Agent"})})]}),I.id==="hermes"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"v10-local-agent-copy",children:"Connect a local Hermes profile through the node, then this tab becomes the persistent chat surface for that profile."}),I.connectSupported&&m.jsx("div",{className:"v10-local-agent-actions",children:m.jsx("button",{className:"v10-agent-send-btn secondary",onClick:()=>p(I.id),disabled:x===I.id,children:x===I.id?"Connecting...":"Connect Hermes"})})]})]},I.id))]})]}):ge&&m.jsxs("div",{...Ue.getRootProps({className:"v10-local-agent-chat-shell"}),children:[m.jsx("input",{...Ue.getInputProps()}),C&&m.jsx("div",{className:"v10-local-agent-notice",children:C}),j&&m.jsx("div",{className:"v10-local-agent-error",children:j}),!ge.chatReady&&m.jsx("div",{className:`v10-local-agent-warning ${ge.status==="connecting"?"connecting":"offline"}`,children:Mt?`${ge.name} is not currently attached to this node. Session history remains available here; reconnect from the + tab when you want live chat again.`:ge.status==="connecting"?`${ge.name} is still finishing setup. This chat tab stays in place and will go live automatically when the connection is ready.`:ge.status==="degraded"?ge.detail:qn?`${ge.name} has saved sessions on this node. Open one from Sessions or reconnect from the + tab to resume live chat here.`:`${ge.name} is temporarily unavailable. Refresh after it recovers to resume chatting here.`}),ge.id==="prime-agent"&&ge.busy===!0&&m.jsx("div",{className:"v10-local-agent-warning connecting",role:"status","data-testid":"prime-agent-active-turn-status",children:ge.detail}),ge.id==="prime-agent"&&(((ye=ge.liveSessions)==null?void 0:ye.length)??0)>1&&m.jsxs("div",{className:"v10-composer-target","data-testid":"prime-agent-session-picker",children:[m.jsx("span",{className:"v10-local-agent-target-label",children:"Prime session"}),m.jsx(kx,{className:"v10-local-agent-target-select",value:o??ge.defaultSessionId??"",onChange:I=>d(ge.id,{sessionId:I}),options:ge.liveSessions.map((I,Te)=>{var at;return{value:I.sessionId,label:((at=I.sessionName)==null?void 0:at.trim())||`${Te===0?"Most recent":`Session ${Te+1}`} · ${I.sessionId.slice(0,8)}…`}}),ariaLabel:"Prime Agent session",disabled:H||ge.busy===!0})]}),Ue.isDragActive&&m.jsx("div",{className:`v10-drop-overlay active ${yt?"accept":"refuse"}`,role:"status","aria-live":"polite",children:m.jsxs("div",{className:"v10-drop-overlay-card",children:[yt?m.jsx(rN,{className:"v10-drop-overlay-icon",size:32,"aria-hidden":"true"}):m.jsx(DT,{className:"v10-drop-overlay-icon",size:32,"aria-hidden":"true"}),m.jsx("div",{className:"v10-drop-overlay-title",children:yt?`Drop files to attach to ${Jp(T,L)}`:bt==="sending"?"Wait for the current send to finish.":bt==="unsupported"?`${ge.name} doesn't accept file attachments.`:"Choose a context graph before attaching files."}),m.jsx("div",{className:"v10-drop-overlay-hint",children:yt?"Release to upload to this conversation.":bt==="sending"?"Drop will be accepted once the agent reply lands.":bt==="unsupported"?"Try a different agent that supports attachments.":"Use the picker below the composer."})]})}),m.jsxs("div",{className:"v10-chat-messages v10-local-agent-messages",ref:Oe,onScroll:Ot,children:[fe&&m.jsx("div",{className:"v10-agent-empty-state",children:"Loading the latest conversation from DKG memory..."}),!fe&&E.length===0&&(()=>{const I=Mt?{title:"No turns in this session yet.",hint:`Reconnect ${ge.name} from the + tab to start a new live thread.`}:qn?{title:`${ge.name} has saved sessions.`,hint:"Open one from Sessions, or reconnect from + to start fresh."}:ge.chatReady?{title:`Start a conversation with ${ge.name}.`,hint:'Try: "What can you help me with?"'}:{title:`${ge.name} is offline.`,hint:"Conversation history stays here while the bridge reconnects."};return m.jsxs("div",{className:"v10-agent-empty-state",children:[m.jsx("div",{className:"v10-agent-empty-state-title",children:I.title}),m.jsx("div",{className:"v10-agent-empty-state-hint",children:I.hint})]})})(),E.map(I=>{var Te,at;return m.jsxs("div",{className:`v10-chat-msg ${I.role}`,children:[m.jsx("div",{className:`v10-chat-bubble ${I.role}`,children:$L(I.content,I.role,!!I.synthesized,!!I.streaming,I.failureNotice)}),I.attachments&&I.attachments.length>0&&m.jsx("div",{className:"v10-local-agent-attachment-row",style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:6},children:I.attachments.map(Pe=>m.jsx("span",{className:"v10-local-agent-attachment-chip",style:{padding:"2px 8px",borderRadius:999,background:"var(--bg-elevated)",fontSize:11},children:Pe.fileName},Pe.id??Pe.assertionUri??Pe.fileHash))}),I.role==="assistant"&&(((Te=I.toolCalls)==null?void 0:Te.length)||I.traceFile)&&m.jsxs("div",{className:"v10-local-agent-copy","data-testid":"local-llm-turn-metadata",children:[(at=I.toolCalls)!=null&&at.length?`Tools: ${I.toolCalls.map(Pe=>Pe.name).join(", ")}`:"Tools: none",I.traceFile?` · Trace: ${I.traceFile}`:""]}),I.ts&&m.jsx("time",{className:`v10-local-agent-msg-time ${I.role}`,dateTime:I.tsRaw,children:I.ts})]},I.id)}),m.jsx("div",{ref:O}),m.jsx("button",{type:"button",className:`v10-scroll-to-bottom ${Ne?"visible":""}`,onClick:xt,"aria-label":"Scroll to latest message",title:"Scroll to latest message",tabIndex:Ne?0:-1,"aria-hidden":!Ne,children:m.jsx(NT,{size:14,"aria-hidden":"true"})})]}),m.jsx("div",{className:"v10-agent-input-area",children:m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,width:"100%"},children:[Z.length>0&&m.jsx("div",{className:"v10-attachment-chips",role:"list","aria-label":"Attached files",children:Z.map(I=>{var Pe,Xe;const Te=((Pe=I.result)==null?void 0:Pe.extraction.tripleCount)??((Xe=I.result)==null?void 0:Xe.extraction.triplesWritten),at=I.status==="queued"?"Queued":I.status==="uploading"?"Importing…":I.status==="completed"?Te!=null?`Ready · ${Te} triples`:"Ready":I.status==="skipped"?"Stored only":I.error??"Failed";return m.jsxs("div",{className:"v10-attachment-chip","data-status":I.status,role:"listitem",children:[m.jsx("div",{className:"v10-attachment-chip-badge","aria-hidden":"true",children:V5(I.file.name)}),m.jsxs("div",{className:"v10-attachment-chip-body",children:[m.jsx("div",{className:"v10-attachment-chip-name",title:I.file.name,children:I.file.name}),m.jsxs("div",{className:"v10-attachment-chip-meta",children:[m.jsx("span",{children:G5(I.file.size)}),m.jsx("span",{"aria-hidden":"true",children:"·"}),m.jsx("span",{className:"v10-attachment-chip-status",children:at})]})]}),m.jsx("button",{type:"button",className:"v10-attachment-chip-remove",onClick:()=>K(I.id),disabled:H,"aria-label":`Remove ${I.file.name}`,title:"Remove attachment",children:m.jsx(dN,{size:12,"aria-hidden":"true"})})]},I.id)})}),N&&m.jsx("div",{className:"v10-local-agent-copy",style:{margin:0,color:"var(--text-tertiary)"},children:X.length>1?"Queued files keep their stored targets and may span multiple projects.":`Queued files keep their stored target (${Jp(T,X[0])}), not the active project.`}),m.jsx("input",{ref:ue,type:"file",multiple:!0,style:{display:"none"},onChange:I=>{I.target.files&&(B(I.target.files),I.target.value="")}}),m.jsx("div",{className:"v10-local-agent-composer-row",children:m.jsxs("div",{className:"v10-local-agent-composer-shell",children:[m.jsx(rz,{placeholder:Mt?`Reconnect ${ge.name} to resume live chat...`:ge.chatReady?`Message ${ge.name}...`:ge.status==="connecting"?`${ge.name} is still connecting...`:`${ge.name} bridge offline...`,className:"v10-agent-input",value:G,onChange:I=>U(I.target.value),onKeyDown:I=>{if(!I.nativeEvent.isComposing){if(I.key==="Enter"&&!I.shiftKey&&!I.ctrlKey&&!I.metaKey){I.preventDefault(),le&&_();return}if((I.ctrlKey||I.metaKey)&&I.key==="Enter"){I.preventDefault(),le&&_();return}I.key==="Escape"&&G.length>0&&(I.preventDefault(),U(""))}},disabled:$,minRows:1,maxRows:8}),m.jsxs("div",{className:"v10-composer-controls",children:[m.jsxs("div",{className:"v10-composer-controls-left",children:[m.jsx("button",{type:"button",className:"v10-composer-attach",onClick:()=>{var I;return(I=ue.current)==null?void 0:I.click()},disabled:!yt,title:yt?"Attach files":bt==="noProject"?"Choose a context graph to attach files":bt==="sending"?"Wait for the current message to send":"This agent does not support attachments","aria-label":"Attach files",children:m.jsx(ZT,{size:14,"aria-hidden":"true"})}),m.jsx("div",{className:"v10-composer-target",children:m.jsx(kx,{className:"v10-local-agent-target-select",value:L??"",onChange:V,options:[...L?[{value:"",label:"No context graph (clear selection)"}]:[],...P.map(I=>({value:I.id,label:I.name}))],placeholder:F?"Loading context graphs…":"Choose a context graph",disabled:F||!L&&P.length===0,ariaLabel:"Active project",prefixIcon:m.jsx(FT,{size:12,"aria-hidden":"true"})})})]}),m.jsx("button",{type:"button",className:`v10-local-agent-inline-send v10-local-agent-inline-send-${Q}`,onClick:Q==="streaming"?W:_,disabled:Q==="streaming"?!1:Q==="uploading"?!0:!le,"aria-label":Q==="streaming"?"Stop reply":Q==="uploading"?"Send message (attachments uploading)":"Send message",title:Q==="streaming"?"Stop reply":Q==="uploading"?"Send message (attachments uploading)…":"Send message",children:Q==="streaming"?m.jsx(tN,{size:12,"aria-hidden":"true"}):Q==="uploading"?m.jsx(YT,{className:"v10-local-agent-inline-send-spinner",size:14,"aria-hidden":"true"}):m.jsx(_T,{size:14,"aria-hidden":"true"})})]})]})})]})})]})]})}function Tp(e){return e.length>12?e.slice(-8):e}function gI(e){if(!e)return"";const n=e.lastIndexOf(":"),a=n>=0?e.slice(n+1):e;return a.length>10?a.slice(-10):a||e.slice(-8)}function yI(e,n){const a=new Map;for(const y of n){if(!y.peerId)continue;const g=a.get(y.peerId)??[];g.push(y),a.set(y.peerId,g)}const r=new Map;for(const y of e){if(!y.peerId)continue;const g=r.get(y.peerId)??{hasDirect:!1,hasRelay:!1,openedAt:null},x=g.hasDirect||y.transport==="direct",b=g.hasRelay||y.transport==="relayed",k=y.openedAt!=null?g.openedAt!=null?Math.min(g.openedAt,y.openedAt):y.openedAt:g.openedAt;r.set(y.peerId,{hasDirect:x,hasRelay:b,openedAt:k})}const o=y=>{var g;return(g=y.find(x=>x.name))==null?void 0:g.name},s=y=>y.reduce((g,x)=>x.lastSeen!=null&&(g==null||x.lastSeen>g)?x.lastSeen:g,void 0),u=[],d=new Set;for(const[y,g]of r){const x=a.get(y)??[];u.push({peerId:y,name:o(x),transport:g.hasDirect?"direct":"relayed",hasDirect:g.hasDirect,hasRelay:g.hasRelay,openedAt:g.openedAt,connected:!0,lastSeen:s(x),agents:x}),d.add(y)}for(const[y,g]of a){if(d.has(y))continue;const x=g.filter(j=>j.connectionStatus==="connected");if(x.length===0)continue;const b=x.some(j=>j.connectionTransport==="direct"),k=x.some(j=>j.connectionTransport==="relayed"),C=k&&!b?"relayed":"direct";u.push({peerId:y,name:o(g),transport:C,hasDirect:b,hasRelay:k,openedAt:null,connected:!0,lastSeen:s(g),agents:g}),d.add(y)}const p=[];for(const[y,g]of a){if(d.has(y))continue;const x=s(g);x!=null&&p.push({peerId:y,name:o(g),transport:"direct",hasDirect:!1,hasRelay:!1,openedAt:null,connected:!1,lastSeen:x,agents:g})}p.sort((y,g)=>(g.lastSeen??0)-(y.lastSeen??0));const f=u.filter(y=>y.transport==="direct").length;return{connected:u,recentlySeen:p,directCount:f,relayedCount:u.length-f}}function vI({peer:e}){var y;const[n,a]=S.useState(!1),r=S.useId(),o=3,s=e.connected?"connected":"offline",u=((y=e.name)==null?void 0:y.trim())||Tp(e.peerId),d=n?e.agents:e.agents.slice(0,o),p=e.connected?e.transport:"Disconnected",f=e.connected&&e.hasDirect&&e.hasRelay?"Direct + relay paths active — direct shown":void 0;return m.jsxs("div",{className:`v10-agent-card v10-peer-card ${s}`,children:[m.jsxs("div",{className:"v10-agent-card-header",children:[m.jsx("span",{className:`v10-agent-card-dot ${s}`}),m.jsx("span",{className:"v10-peer-card-name",children:u}),m.jsx("span",{className:"v10-agent-card-badge",title:f,children:p})]}),m.jsxs("div",{className:"v10-peer-card-meta",children:[m.jsx("span",{title:e.peerId,children:Tp(e.peerId)}),e.connected&&e.openedAt!=null&&m.jsxs("span",{children:["up ",Q1(Date.now()-e.openedAt)]}),!e.connected&&e.lastSeen!=null&&m.jsxs("span",{children:[Q1(Date.now()-e.lastSeen)," ago"]}),e.agents.length>0&&m.jsxs("span",{children:[e.agents.length," agent",e.agents.length===1?"":"s"]})]}),e.agents.length>0&&m.jsxs("ul",{id:r,className:"v10-peer-card-chips","aria-label":`Agents on ${u}`,children:[d.map((g,x)=>m.jsx("li",{className:"v10-peer-chip",title:g.agentUri||"",children:m.jsx("span",{className:"v10-peer-chip-label",children:gI(g.agentUri)||Tp(g.peerId)})},g.agentUri||`${e.peerId}:${x}`)),e.agents.length>o&&m.jsx("li",{children:m.jsx("button",{type:"button",className:"v10-peer-chip-more","aria-expanded":n,"aria-controls":r,onClick:()=>a(g=>!g),children:n?"Show less":`+${e.agents.length-o} more`})})]})]})}function jx(e){const{label:n,peers:a,expanded:r,onToggle:o,emptyMessage:s}=e;return m.jsxs("div",{className:"v10-peer-group",children:[m.jsxs("button",{type:"button",className:"v10-peer-group-header",onClick:o,"aria-expanded":r,children:[m.jsx(zp,{size:14,className:`v10-peer-group-chevron ${r?"expanded":""}`,"aria-hidden":"true"}),m.jsx("span",{className:"v10-peer-group-label",children:n}),m.jsx("span",{className:"v10-peer-group-count",children:a.length})]}),r&&m.jsx("div",{className:"v10-peer-group-body",children:a.length===0?m.jsx("div",{className:"v10-agent-empty-state",children:s}):a.map(u=>m.jsx(vI,{peer:u},u.peerId))})]})}function xI(e){const{peerAgents:n,connections:a,loading:r,onRefresh:o}=e,[s,u]=S.useState(!0),[d,p]=S.useState(!1),{connected:f,recentlySeen:y,directCount:g,relayedCount:x}=yI(a.rows,n);return m.jsxs("div",{className:"v10-agent-scroll-tab",children:[m.jsxs("div",{className:"v10-agents-summary",children:[m.jsxs("span",{className:"v10-agents-stat",children:[m.jsx("span",{className:`v10-agents-stat-dot ${f.length>0||a.total>0?"connected":"known"}`}),m.jsxs("span",{title:"Unique libp2p peers connected to this node — matches the count in the header.",children:[f.length," peer",f.length===1?"":"s"]})]}),m.jsxs("span",{className:"v10-agents-stat",title:"Preferred transport per peer (peers reachable via direct + relay are bucketed under direct)",children:[g," direct / ",x," relayed"]}),m.jsx("button",{className:"v10-agents-refresh",onClick:o,title:"Refresh network peers",children:"Refresh"})]}),r&&m.jsx("p",{className:"v10-agents-loading",children:"Loading peers..."}),!r&&f.length===0&&y.length===0&&a.total===0&&m.jsx("div",{className:"v10-agent-empty-state",children:"No network peers detected yet."}),!r&&f.length===0&&a.total>0&&m.jsxs("div",{className:"v10-agent-empty-state",children:["Connected to ",a.total," peer",a.total===1?"":"s"," (peer metadata syncing…)."]}),(f.length>0||y.length>0)&&m.jsxs(m.Fragment,{children:[m.jsx(jx,{label:"Connected",peers:f,expanded:s,onToggle:()=>u(b=>!b),emptyMessage:"No peers currently connected."}),m.jsx(jx,{label:"Recently seen",peers:y,expanded:d,onToggle:()=>p(b=>!b),emptyMessage:"No previously-seen peers."})]})]})}function bI(e){const{sessions:n,onOpenSession:a}=e;return m.jsx("div",{className:"v10-agent-scroll-tab",children:m.jsxs("div",{className:"v10-sessions-list",children:[m.jsx("div",{className:"v10-local-agent-copy",style:{marginBottom:12},children:"Sessions track DKG-persisted conversations for your integrated agents."}),n.length===0?m.jsx("p",{className:"v10-agent-empty-state",children:"No integrated-agent sessions yet."}):n.map(r=>m.jsxs("button",{className:"v10-session-item",onClick:()=>a(r),children:[m.jsxs("span",{className:"v10-session-preview",children:[r.integrationName,": ",r.preview]}),m.jsxs("span",{className:"v10-session-count",children:[r.messageCount," msg",r.messageCount!==1?"s":"",r.lastTs?` - ${Yc(r.lastTs)}`:""]})]},r.sessionId))]})})}function wI(){return Ch().data}function SI(){const{stage:e,advance:n}=Th(),[a,r]=S.useState("agents"),[o,s]=S.useState([]),[u,d]=S.useState([]),[p,f]=S.useState({total:0,direct:0,relayed:0,rows:[]}),[y,g]=S.useState(!0),x=wI(),[b,k]=S.useState([]),[C,j]=S.useState("openclaw"),[E,R]=S.useState(()=>rr("openclaw")),[O,G]=S.useState(null),[U,_]=S.useState(null),[W,H]=S.useState(null),[L,T]=S.useState(null),[F,V]=S.useState(null),[ie,B]=S.useState({}),[K,P]=S.useState({}),[Z,ne]=S.useState({}),[X,D]=S.useState({}),[M,Q]=S.useState({}),N=S.useRef(new Map),ue=S.useRef(!1),pe=S.useRef(null),he=S.useRef([]),be=S.useRef({}),Oe=S.useRef("openclaw"),Ne=S.useRef(rr("openclaw")),et=ca(se=>se.contextGraphs),Ot=ca(se=>se.loading),xt=ca(se=>se.activeProjectId),bt=ca(se=>se.setActiveProject),yt=S.useMemo(()=>kR(et,x?Oh(x):null,xt),[et,x,xt]),Zt=Ex(o,b),{selectedIntegration:Ue,selectedConversation:pt,selectedHasConversation:Dt,selectedIntegrationHasAnyConversation:Nt}=cI({integrations:b,selectedIntegrationId:C,selectedSessionId:E,localMessagesByConversation:ie,sessions:Zt}),ge=(pt==null?void 0:pt.stateKey)??null,Mt=ge?ie[ge]??[]:[],qn=ge?X[ge]??!1:!1,yn=ge?K[ge]??"":"",it=ge?Z[ge]??!1:!1,fe=ge?M[ge]??[]:[],$=S.useCallback(()=>{var se;(se=pe.current)==null||se.scrollIntoView({behavior:"smooth"})},[]);S.useEffect($,[ge,Mt,$]),S.useEffect(()=>{he.current=o},[o]),S.useEffect(()=>{be.current=ie},[ie]),S.useEffect(()=>{Oe.current=C},[C]),S.useEffect(()=>{Ne.current=E},[E]);const le=S.useCallback((se,ve)=>{B(Ce=>({...Ce,[se]:ve(Ce[se]??[])}))},[]),me=S.useCallback((se,ve)=>{se&&P(Ce=>({...Ce,[se]:ve}))},[]),ye=S.useCallback((se,ve)=>{ne(Ce=>({...Ce,[se]:ve}))},[]),I=S.useCallback((se,ve)=>{Q(Ce=>({...Ce,[se]:ve(Ce[se]??[])}))},[]),Te=S.useCallback((se,ve,Ce)=>{const Me=Array.from(ve);if(Me.length===0)return;const Ye=new Set((M[se]??[]).map(Se=>`${Se.contextGraphId}:${Se.file.name}:${Se.file.size}:${Se.file.lastModified}`)),lt=Me.filter(Se=>{const _e=`${Ce}:${Se.name}:${Se.size}:${Se.lastModified}`;return Ye.has(_e)?!1:(Ye.add(_e),!0)});if(lt.length===0)return;const Re=lt.map(Se=>({id:`${se}:${Se.name}:${Se.size}:${Se.lastModified}:${crypto.randomUUID()}`,file:Se,contextGraphId:Ce,assertionName:`${Date.now().toString(36)}-${crypto.randomUUID().slice(0,8)}-${Se.name.replace(/[^a-zA-Z0-9._-]/g,"_")}`,status:"queued"}));I(se,Se=>[...Se,...Re])},[M,I]),at=S.useCallback(async(se,ve)=>{const Ce=[];for(const Me of ve){if(Me.status==="completed"||Me.status==="skipped"){Ce.push(Me);continue}I(se,Ye=>Ye.map(lt=>lt.id===Me.id?{...lt,status:"uploading",error:void 0}:lt));try{const Ye=await zA(Me.assertionName,Me.contextGraphId,Me.file),lt=Ye.extraction.status==="completed"?"completed":Ye.extraction.status==="skipped"?"skipped":"error",Re={...Me,status:lt,result:Ye,error:Ye.extraction.error};Ce.push(Re),I(se,Se=>Se.map(_e=>_e.id===Me.id?Re:_e))}catch(Ye){const lt={...Me,status:"error",error:(Ye==null?void 0:Ye.message)??"Upload failed"};Ce.push(lt),I(se,Re=>Re.map(Se=>Se.id===Me.id?lt:Se))}}return Ce},[I]),Pe=S.useCallback((se,ve)=>{I(se,Ce=>Ce.filter(Me=>Me.id!==ve))},[I]),Xe=S.useCallback((se,ve)=>{const Ce=new Set(ve);I(se,Me=>Me.filter(Ye=>!Ce.has(Ye.id)))},[I]),Ve=S.useCallback((se,ve={})=>{j(se),se!==sr&&(ve.preserveSession||R(ve.sessionId??rr(se)))},[]),ke=S.useCallback(()=>{Bn.fetchMemorySessions(50).then(({sessions:se})=>s(se??[])).catch(()=>{})},[]),Wt=S.useCallback(async()=>{try{const[se,ve]=await Promise.all([pb().catch(()=>({agents:[]})),SA().catch(()=>({total:0,direct:0,relayed:0,connections:[]}))]),Ce=(se.agents??[]).filter(Me=>Me.connectionStatus!=="self");d(Ce),f({total:ve.total??0,direct:ve.direct??0,relayed:ve.relayed??0,rows:Array.isArray(ve.connections)?ve.connections:[]})}catch{}g(!1)},[]),rt=S.useCallback(async()=>{try{const{integrations:se}=await iu();k(se);const ve=Ex(he.current,se),Ce=[...se].sort(du).filter(_e=>_e.persistentChat),Me=Oe.current,Ye=Ne.current,lt=se.find(_e=>_e.id===Me)??null,Re=fI({selectedIntegrationId:Me,selectedItem:lt,selectedSessionId:Ye,localMessagesByConversation:be.current,sessionSummaries:ve});if(!Re){const _e=Ce[0];Ve((_e==null?void 0:_e.id)??sr,{sessionId:(_e==null?void 0:_e.defaultSessionId)??null})}const Se=Ce[0];Se&&!ue.current&&Me!==sr?(ue.current=!0,Ve(Se.id,{sessionId:Se.defaultSessionId}),r("agents")):!Se&&!Re&&(ue.current=!1,Ve(sr))}catch{}},[Ve]),ja=S.useCallback(async(se,ve=null,Ce=null)=>{const Me=Ro({integrationId:se,sessionId:ve,defaultSessionId:Ce});D(Ye=>({...Ye,[Me.stateKey]:!1}));try{const lt=(await S0(se,100,{sessionId:Me.sessionId??void 0})).map(Re=>J1(Re,se));le(Me.stateKey,Re=>Sp(Re,lt))}catch{le(Me.stateKey,Ye=>Ye)}finally{D(Ye=>({...Ye,[Me.stateKey]:!0})),ke()}},[ke,le]);S.useEffect(()=>{ke(),Wt(),rt()},[ke,Wt,rt]),S.useEffect(()=>{for(const se of tL)ja(se,rr(se))},[]);const ti=S.useCallback(()=>{ke(),Wt()},[ke,Wt]);Ho(ti,15e3,{runImmediately:!1});const Ii=b.some(se=>se.persistentChat&&(!se.chatReady||se.status==="connecting"))?3e3:15e3;S.useEffect(()=>{const se=setInterval(()=>{rt()},Ii);return()=>clearInterval(se)},[Ii,rt]),S.useEffect(()=>{if(!(Ue!=null&&Ue.chatSupported)||!Ue.persistentChat&&!Dt){ge&&D(ve=>({...ve,[ge]:!1}));return}let se=!1;return(async()=>await ja(Ue.id,(pt==null?void 0:pt.sessionId)??null,Ue.defaultSessionId??null))(),()=>{se=!0}},[ja,pt==null?void 0:pt.sessionId,ge,Dt,Ue==null?void 0:Ue.defaultSessionId,Ue==null?void 0:Ue.chatSupported,Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.persistentChat]);const mr=S.useCallback(async()=>{var yr,Ra;const se=Ue,ve=pt,Ce=yn.trim(),Me=fe,Ye=Me.some(rS);if(!(se!=null&&se.chatSupported)||!se.chatReady||it||!ve||!Ce&&!Ye)return;const lt=se.id,Re=ve.stateKey;ye(Re,!0),H(null);let Se=null,_e="",an="",Na="",vl="",Yo=[],ni=[],ha=[];try{ni=await at(Re,Me);const Yt=ni.map(Be=>K5(Be)).filter(Be=>Be!=null),sn=Q5(ni);if(!Ce&&Yt.length===0&&sn.results.length===0)return;an=crypto.randomUUID();const Fn=oS(sn.results),At=[Ce,Fn].filter(Be=>Be.length>0).join(`
1173
-
1174
- `);Na=Ce?At:X5(Yt,sn.results);const vn=Ce?At:"";Yo=Yt,ha=[...Yt.map(Be=>Be.id).filter(Be=>typeof Be=="string"&&Be.length>0),...sn.deliveredDraftIds];const cn=`local:${Re}:${an}:user`;_e=`local:${Re}:${an}:assistant`;const Gn=new Date,ai=Yc(Gn),xl=Zp(Gn);le(Re,Be=>[...Be,{id:cn,turnId:an,role:"user",content:Na,ts:ai,tsRaw:xl,attachments:Yt},{id:_e,turnId:an,role:"assistant",content:"",ts:ai,tsRaw:xl,streaming:!0}]),me(Re,""),ha.length>0&&Xe(Re,ha),Se=new AbortController,N.current.set(Re,Se);const Ko=[...Z5(et,xt,x)],hu=se.id==="prime-agent"?(yr=se.liveSessions)==null?void 0:yr.find(Be=>Be.sessionId===ve.sessionId):void 0,un=await wj(lt,vn,{correlationId:an,signal:Se==null?void 0:Se.signal,sessionId:ve.sessionId??void 0,liveSession:hu,profile:se.profile,persistUserMessage:vn?void 0:Na,attachments:Yt,attachmentImportResults:sn.results,contextEntries:Ko,contextGraphId:xt??void 0,onEvent:Be=>{Be.type==="text_delta"&&(vl+=Be.delta,le(Re,qt=>qt.map(_a=>_a.id===_e?{..._a,content:_a.content+Be.delta}:_a)))}}),Bi=new Date;le(Re,Be=>ex(Be,an,un.turnId).map(qt=>{var _a;return qt.id===_e?{...qt,content:un.text||qt.content,turnId:((_a=un.turnId)==null?void 0:_a.trim())||qt.turnId,streaming:!1,synthesized:!un.text&&!qt.content?!0:qt.synthesized,ts:Yc(Bi),tsRaw:Zp(Bi),toolCalls:un.toolCalls,traceFile:un.traceFile,profile:un.profile,contextGraphId:un.contextGraphId,readOnly:un.readOnly}:qt}));const xn=lt==="prime-agent"?(Ra=un.sessionId)==null?void 0:Ra.trim():void 0;if(xn&&xn!==ve.sessionId&&Oe.current===lt&&Ne.current===ve.sessionId){const Be=am(lt,xn);B(qt=>({...qt,[Be]:Sp(qt[Be]??[],qt[Re]??[])})),D(qt=>({...qt,[Be]:qt[Re]??!0})),Ve(lt,{sessionId:xn}),_(`${se.name} restarted; switched chat to the live session.`)}ke(),e===0&&n()}catch(Yt){const sn=(Yt==null?void 0:Yt.name)==="AbortError",Fn=sn?"Request cancelled.":nL(se,Yt),At=sn?Fn:`Error: ${Fn}`;if(_e){const vn=BL(vl,At);le(Re,ma=>ma.map(cn=>cn.id===_e?{...cn,...vn,streaming:!1}:cn))}!sn&&lt==="hermes"&&_e&&Na&&(async()=>{try{const vn=await bj(lt,{sessionId:ve.sessionId??void 0,correlationId:an||void 0,userMessage:Na,assistantReply:vl,failureReason:Fn,profile:se.profile,attachments:Yo,contextGraphId:xt??void 0});vn.turnId&&le(Re,ma=>ex(ma,an,vn.turnId)),ke()}catch{}})(),ha.length>0&&ni.length>0&&Q(vn=>{const ma=vn[Re]??[],cn=new Set(ma.map(ai=>ai.id)),Gn=ni.filter(ai=>!cn.has(ai.id));return Gn.length===0?vn:{...vn,[Re]:[...Gn,...ma]}}),rt()}finally{ye(Re,!1),N.current.get(Re)===Se&&N.current.delete(Re)}},[xt,n,et,x,ke,yn,it,at,fe,rt,pt,Ue,Xe,me,ye,Ve,e,le]),Ta=S.useCallback(()=>{if(!ge)return;const se=N.current.get(ge);se==null||se.abort()},[ge]),gr=S.useCallback(async se=>{G(se),H(null),_(null);try{const ve=await gj(se);k(Ye=>Nc(Ye,ve.integration)),await rt();const Ce=Nc(b,ve.integration),Me=oI({integrationId:se,selectedSessionId:E,integrations:Ce});Ve(se,{preserveSession:Me,sessionId:ve.integration.defaultSessionId}),ue.current=!0,_(ve.notice??(ve.integration.chatReady?`${ve.integration.name} is connected and chat-ready.`:`${ve.integration.name} attach is in progress. The node will keep checking for a live bridge.`)),r("agents")}catch(ve){await rt(),H(ve.message)}finally{G(null)}},[b,rt,E,Ve]),Pi=S.useCallback(async se=>{H(null),_(null);try{await yj(se),k(ve=>dI(ve,se)),ue.current=!1,Ve(se,{preserveSession:C===se}),_("The local agent was disconnected from this node. Session history remains available here."),r("agents"),await rt()}catch(ve){H(ve.message)}},[rt,C,Ve]),fu=S.useCallback(async se=>{var Ye,lt,Re;if(L===se)return;T(se),H(null),_(null);const ve=Ro({integrationId:se,sessionId:C===se?Ne.current:null,defaultSessionId:(Ye=b.find(Se=>Se.id===se))==null?void 0:Ye.defaultSessionId}),[Ce,Me]=await Promise.allSettled([vj(se),S0(se,100,{sessionId:ve.sessionId??void 0})]);try{if(Ce.status==="fulfilled"?(k(Se=>Nc(Se,Ce.value.integration)),Ce.value.notice&&_(Ce.value.notice)):H(((lt=Ce.reason)==null?void 0:lt.message)??"Failed to refresh integration."),Me.status==="fulfilled"){const Se=Me.value.map(_e=>J1(_e,se));le(ve.stateKey,_e=>Sp(_e,Se)),D(_e=>({..._e,[ve.stateKey]:!0}))}else Ce.status==="fulfilled"&&H(((Re=Me.reason)==null?void 0:Re.message)??"Failed to refresh conversation.")}finally{T(null)}},[b,L,C,le]),Vo=S.useCallback(async se=>{if(!(se!=="local-llm"||F)){V(se),H(null),_(null);try{await nj();const ve=Ro({integrationId:se,sessionId:rr(se)});B(Ce=>({...Ce,[ve.stateKey]:[]})),P(Ce=>({...Ce,[ve.stateKey]:""})),Q(Ce=>({...Ce,[ve.stateKey]:[]})),D(Ce=>({...Ce,[ve.stateKey]:!0})),_("DKG Local LLM session cleared. You can now select a different Context Graph."),await rt()}catch(ve){H((ve==null?void 0:ve.message)??"Failed to clear the local LLM session.")}finally{V(null)}}},[F,rt]),yl=S.useCallback(se=>{Ve(se.integrationId,{sessionId:se.sessionId}),r("agents")},[Ve]),Ui=S.useCallback(se=>{bt(se||null)},[bt]),pu=S.useCallback(se=>{!ge||!xt||Te(ge,se,xt)},[xt,Te,ge]),Wo=S.useCallback(se=>{ge&&Pe(ge,se)},[Pe,ge]);return m.jsxs("div",{className:"v10-panel-right",children:[m.jsxs("div",{className:"v10-agent-mode-tabs",children:[m.jsx("button",{className:`v10-agent-mode-tab ${a==="agents"?"active":""}`,onClick:()=>r("agents"),children:"Agents"}),m.jsx("button",{className:`v10-agent-mode-tab ${a==="network"?"active":""}`,onClick:()=>r("network"),children:"Network"}),m.jsx("button",{className:`v10-agent-mode-tab ${a==="sessions"?"active":""}`,onClick:()=>r("sessions"),children:"Sessions"})]}),a==="agents"&&m.jsx(mI,{integrations:b,selectedIntegrationId:C,selectedIntegration:Ue,selectedSessionId:E,selectedHasConversation:Dt,selectedIntegrationHasAnyConversation:Nt,onSelectIntegration:Ve,onConnectIntegration:gr,onDisconnectIntegration:Pi,onRefreshIntegration:fu,onClearIntegrationSession:Vo,connectBusyId:O,refreshBusyId:L,clearBusyId:F,connectNotice:U,connectError:W,localMessages:Mt,localHistoryLoaded:qn,localChatEndRef:pe,localInput:yn,onLocalInputChange:se=>me(ge,se),onSendLocalMessage:mr,onStopLocalStream:Ta,localSending:it,activeProjectId:xt,availableProjects:et,selectableProjects:yt,projectsLoading:Ot,onSelectProject:Ui,attachments:fe,onAddAttachments:pu,onRemoveAttachment:Wo}),a==="network"&&m.jsx(xI,{peerAgents:u,connections:p,loading:y,onRefresh:Wt}),a==="sessions"&&m.jsx(bI,{sessions:Zt,onOpenSession:yl})]})}function kI(e,n=document){const a=e==="light";n.documentElement.setAttribute("data-theme",e),n.documentElement.classList.toggle("light",a),n.body.classList.toggle("light",a)}function CI(){const{toggleLeft:e,toggleRight:n,toggleBottom:a}=aa();S.useEffect(()=>{const r=o=>{if(o.target instanceof HTMLInputElement||o.target instanceof HTMLTextAreaElement||!(o.metaKey||o.ctrlKey))return;const u=o.key.toLowerCase();if(o.shiftKey&&u==="b"){o.preventDefault(),n();return}if(!o.shiftKey){if(u==="b"){o.preventDefault(),e();return}if(u==="j"){o.preventDefault(),a();return}}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e,n,a])}const Tx={"/observability":{id:"operations",label:"Observability"},"/operations":{id:"operations",label:"Observability"},"/settings":{id:"settings",label:"Settings"}},EI={operations:"/observability",settings:"/settings",dashboard:"/"};function AI(){const{pathname:e}=pa(),n=uh(),a=mn(o=>o.openTab),r=mn(o=>o.activeTabId);S.useEffect(()=>{const o=Tx[e];o&&a({id:o.id,label:o.label,closable:!0})},[e,a]),S.useEffect(()=>{const o=EI[r];if(o){o!==e&&n(o,{replace:!0});return}Tx[e]&&n("/",{replace:!0})},[r,e,n])}function jI(){const[e,n]=S.useState(Hj());return S.useEffect(()=>$j(n),[]),e?m.jsxs("div",{className:"v10-mock-banner",role:"alert","aria-live":"polite",children:[m.jsx("span",{className:"v10-mock-banner-dot","aria-hidden":"true"}),m.jsxs("span",{children:[m.jsx("strong",{children:"Demo data"})," — the node isn’t responding (it may be down, timing out, or returning errors), so the UI is showing example data, not live node state. Check the daemon, then reload."]}),m.jsx("button",{type:"button",className:"v10-mock-banner-reload",onClick:()=>window.location.reload(),children:"Reload"})]}):null}function TI(){const e=yh(n=>n.setNodeStatus);Ho(()=>{Bn.fetchStatus().then(e).catch(()=>{})},1e4)}function Nx(e){const n=S.useRef(null),a=S.useRef(e);return a.current=e,S.useEffect(()=>{const r=n.current;if(!r)return;let o=0;const s=p=>{const f=p.clientX-o;o=p.clientX,a.current(f)},u=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.body.style.cursor="",document.body.style.userSelect="",r.classList.remove("active")},d=p=>{p.preventDefault(),o=p.clientX,document.addEventListener("mousemove",s),document.addEventListener("mouseup",u),document.body.style.cursor="col-resize",document.body.style.userSelect="none",r.classList.add("active")};return r.addEventListener("mousedown",d),()=>r.removeEventListener("mousedown",d)},[]),n}function NI(e){const n=S.useRef(e);n.current=e;const[a,r]=S.useState(null);return S.useEffect(()=>{if(!a)return;let o=0;const s=p=>{const f=p.clientY-o;o=p.clientY,n.current(f)},u=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.body.style.cursor="",document.body.style.userSelect="",a.classList.remove("active")},d=p=>{p.preventDefault(),o=p.clientY,document.addEventListener("mousemove",s),document.addEventListener("mouseup",u),document.body.style.cursor="row-resize",document.body.style.userSelect="none",a.classList.add("active")};return a.addEventListener("mousedown",d),()=>{a.removeEventListener("mousedown",d),u()}},[a]),S.useCallback(o=>r(o),[])}function RI(){TI(),CI(),AI();const{leftCollapsed:e,rightCollapsed:n,bottomCollapsed:a,theme:r,leftWidth:o,rightWidth:s,setLeftWidth:u,setRightWidth:d,setBottomHeight:p}=aa(),[,f]=S.useState(0);S.useEffect(()=>{kI(r)},[r]),S.useEffect(()=>{const j=()=>f(E=>E+1);return window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]),S.useLayoutEffect(()=>{const j=window.requestAnimationFrame(()=>{window.dispatchEvent(new Event("resize"))});return()=>window.cancelAnimationFrame(j)},[e,n]);const y=S.useCallback(j=>{const E=aa.getState().leftWidth;u(Math.max(140,Math.min(400,E+j)))},[u]),g=S.useCallback(j=>{const E=aa.getState().rightWidth;d(Math.max(200,Math.min(500,E-j)))},[d]),x=S.useCallback(j=>{const E=Math.min(aa.getState().bottomHeight,Dc());p(Math.min(E-j,Dc()))},[p]),b=Nx(y),k=Nx(g),C=NI(x);return m.jsxs("div",{className:"v10-app",children:[m.jsx(jI,{}),m.jsx(GN,{}),m.jsxs("div",{className:"v10-app-body",children:[!e&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"v10-panel-left",style:{width:o},children:m.jsx(IR,{})}),m.jsx("div",{className:"v10-resize-handle-h",ref:b})]}),m.jsxs("div",{className:"v10-center-region",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:[m.jsx("div",{style:{flex:1,minHeight:0,overflow:"hidden"},children:m.jsx(_5,{})}),!a&&m.jsx("div",{className:"v10-resize-handle-v",ref:C}),m.jsx(F5,{})]}),!n&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"v10-resize-handle-h",ref:k}),m.jsx("div",{className:"v10-panel-right",style:{width:s},children:m.jsx(SI,{})})]})]})]})}const _I=hn.lazy(()=>nt(()=>import("./Network-BNhbBzOD.js"),[]).then(e=>({default:e.NetworkPage})));function OI(){const e=mn(n=>n.openTab);return S.useLayoutEffect(()=>{e(L4)},[e]),m.jsx(So,{to:"/",replace:!0})}function DI(){return m.jsxs(BC,{children:[m.jsx(Ni,{path:"/network",element:m.jsx(hn.Suspense,{fallback:m.jsx("div",{className:"lazy-spinner",children:"Loading..."}),children:m.jsx(_I,{})})}),m.jsx(Ni,{path:"/context-graph-primer",element:m.jsx(OI,{})}),m.jsx(Ni,{path:"/agent",element:m.jsx(So,{to:"/",replace:!0})}),m.jsx(Ni,{path:"/explorer",element:m.jsx(So,{to:"/",replace:!0})}),m.jsx(Ni,{path:"/messages",element:m.jsx(So,{to:"/",replace:!0})}),m.jsx(Ni,{path:"/apps/*",element:m.jsx(So,{to:"/",replace:!0})}),m.jsx(Ni,{path:"*",element:m.jsx(RI,{})})]})}$2.createRoot(document.getElementById("root")).render(m.jsx(hn.StrictMode,{children:m.jsx(uE,{basename:"/ui",children:m.jsx(DI,{})})}));export{b8 as $,Ib as A,YI as B,x4 as C,X8 as D,x8 as E,v8 as F,n9 as G,gn as H,v4 as I,P8 as J,e9 as K,Gb as L,K8 as M,j0 as N,wh as O,w8 as P,pb as Q,hn as R,Y8 as S,M8 as T,f8 as U,SA as V,cN as W,bh as X,nu as Y,t8 as Z,nt as _,b4 as a,qc as a$,n8 as a0,EA as a1,JI as a2,FI as a3,jA as a4,e8 as a5,AA as a6,x0 as a7,c8 as a8,l8 as a9,fT as aA,hT as aB,e3 as aC,q8 as aD,zA as aE,a4 as aF,Sb as aG,VI as aH,WI as aI,mT as aJ,iR as aK,E8 as aL,T8 as aM,m as aN,qA as aO,U8 as aP,g8 as aQ,GI as aR,d8 as aS,NA as aT,$I as aU,xA as aV,i9 as aW,$R as aX,Tb as aY,$8 as aZ,w4 as a_,o8 as aa,i8 as ab,a8 as ac,r8 as ad,KI as ae,wA as af,s8 as ag,XI as ah,yb as ai,FA as aj,W8 as ak,X4 as al,_8 as am,K0 as an,A4 as ao,j4 as ap,fN as aq,A8 as ar,t9 as as,BR as at,J8 as au,Z8 as av,pN as aw,zI as ax,Po as ay,H8 as az,L4 as b,Pp as b0,S8 as b1,PI as b2,qI as b3,UI as b4,HI as b5,sT as b6,BI as b7,y8 as b8,m8 as b9,k4 as bA,i4 as bB,tT as bC,$c as bD,pl as bE,Eb as bF,Ab as bG,Lp as bH,ca as bI,mn as bJ,O8 as bK,N8 as bL,F4 as bM,p8 as bN,S as ba,h8 as bb,DA as bc,u8 as bd,a9 as be,Q0 as bf,I8 as bg,D8 as bh,k8 as bi,R8 as bj,U4 as bk,t3 as bl,Ih as bm,L8 as bn,z8 as bo,C8 as bp,QI as bq,ZI as br,FR as bs,yh as bt,G8 as bu,Ch as bv,Xf as bw,Mb as bx,V8 as by,aa as bz,LT as c,IT as d,BT as e,j8 as f,Yx as g,YT as h,zb as i,SI as j,mt as k,Q8 as l,F8 as m,Bn as n,S4 as o,OA as p,Vt as q,B8 as r,n4 as s,Mi as t,Xt as u,$1 as v,yT as w,LI as x,$t as y,II as z};