@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.
- package/dist/chain-cursor-stores.d.ts +48 -0
- package/dist/chain-cursor-stores.d.ts.map +1 -1
- package/dist/chain-cursor-stores.js +145 -0
- package/dist/chain-cursor-stores.js.map +1 -1
- package/dist/chain-event-log-store.d.ts +84 -0
- package/dist/chain-event-log-store.d.ts.map +1 -0
- package/dist/chain-event-log-store.js +289 -0
- package/dist/chain-event-log-store.js.map +1 -0
- package/dist/db.d.ts +16 -58
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +125 -144
- package/dist/db.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/protocol-outbox-store.d.ts +67 -0
- package/dist/protocol-outbox-store.d.ts.map +1 -0
- package/dist/protocol-outbox-store.js +199 -0
- package/dist/protocol-outbox-store.js.map +1 -0
- package/dist-ui/assets/{3d-force-graph-bUKbeTGZ.js → 3d-force-graph-DGF2sXeK.js} +1 -1
- package/dist-ui/assets/ActivityFeed-DNatshHL.js +99 -0
- package/dist-ui/assets/{AgentHub-4c4sH_Jd.js → AgentHub-lOm96XuE.js} +1 -1
- package/dist-ui/assets/{AgentProfilePage-ClhUeZxy.js → AgentProfilePage-BRtazufK.js} +1 -1
- package/dist-ui/assets/ApproveWalletsModal-BMtRgndO.js +3 -0
- package/dist-ui/assets/{ContextGraphPrimitives-Bwc2i7EX.js → ContextGraphPrimitives-CBc6kvmp.js} +1 -1
- package/dist-ui/assets/ConvictionDetailView-DOTYSm7p.js +2 -0
- package/dist-ui/assets/{MemoryLayerView-DxL2MjyA.js → MemoryLayerView-DDFI2ngR.js} +2 -2
- package/dist-ui/assets/{MemoryStackView-BLhA3bn0.js → MemoryStackView-Bol2eMyq.js} +1 -1
- package/dist-ui/assets/{Network-BNhbBzOD.js → Network-B49IxpAj.js} +1 -1
- package/dist-ui/assets/{OnChainProvenanceCard-DKyfVEjF.js → OnChainProvenanceCard-BpUoHg4b.js} +1 -1
- package/dist-ui/assets/{Operations-mCPe0E-j.js → Operations-BCQ545Yk.js} +1 -1
- package/dist-ui/assets/{ProjectView-jrGPu5ON.js → ProjectView-BaQQSy8L.js} +20 -20
- package/dist-ui/assets/PublishingConviction-B5nWRsUP.js +2 -0
- package/dist-ui/assets/Settings-DeZKX_Ry.js +1 -0
- package/dist-ui/assets/browserWalletTransaction-B6wyaMOV.js +55 -0
- package/dist-ui/assets/ccip-B_vQl40F.js +1 -0
- package/dist-ui/assets/{index-VYV5TH6q.css → index-BLQUVvVz.css} +1 -1
- package/dist-ui/assets/index-CT-LdpBE.js +1175 -0
- package/dist-ui/assets/{index-UvxrSkC_.js → index-DHd3qhAk.js} +3 -3
- package/dist-ui/assets/{jsonld-32FQRO67-Dl6_9Lk9.js → jsonld-32FQRO67-BYu8pE-5.js} +2 -2
- package/dist-ui/assets/{jsonld-Dj4KMENF.js → jsonld-Crm5iwcE.js} +1 -1
- package/dist-ui/assets/{renderer-3d-2EVDZII7-DfnhcMkF.js → renderer-3d-2EVDZII7-C2z5aUgo.js} +2 -2
- package/dist-ui/assets/{shikiHighlighter-ByXDJnWi.js → shikiHighlighter-DW1fRfBU.js} +1 -1
- package/dist-ui/assets/{useEntityOnChainReceipt-BRK_O_sb.js → useEntityOnChainReceipt-0Ub24t6e.js} +1 -1
- package/dist-ui/assets/{useProjectActivity-OdoQs9mK.js → useProjectActivity-CLza3psq.js} +1 -1
- package/dist-ui/index.html +2 -2
- package/package.json +3 -3
- package/dist-ui/assets/ActivityFeed-CC5S_gk9.js +0 -100
- package/dist-ui/assets/ApproveWalletsModal-CBKp6zQB.js +0 -57
- package/dist-ui/assets/ConvictionDetailView-a3v7xwcm.js +0 -2
- package/dist-ui/assets/PublishingConviction-BGi128uo.js +0 -2
- package/dist-ui/assets/Settings-D1oxLo1Y.js +0 -1
- package/dist-ui/assets/ccip-WHHgwjp-.js +0 -1
- package/dist-ui/assets/index-RLb1kuzE.js +0 -1174
|
@@ -0,0 +1,1175 @@
|
|
|
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-BCQ545Yk.js","assets/string-DtUow4KV.js","assets/Settings-DeZKX_Ry.js","assets/browserWalletTransaction-B6wyaMOV.js","assets/AgentProfilePage-BRtazufK.js","assets/ActivityFeed-DNatshHL.js","assets/useProjectActivity-CLza3psq.js","assets/PublishingConviction-B5nWRsUP.js","assets/ContextGraphPrimitives-CBc6kvmp.js","assets/ApproveWalletsModal-BMtRgndO.js","assets/ConvictionDetailView-DOTYSm7p.js","assets/ProjectView-BaQQSy8L.js","assets/truncate-BaiMkAOo.js","assets/useEntityOnChainReceipt-0Ub24t6e.js","assets/MemoryLayerView-DDFI2ngR.js","assets/MemoryStackView-Bol2eMyq.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var D2=Object.defineProperty;var M2=(e,n,a)=>n in e?D2(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var Gt=(e,n,a)=>M2(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 PI=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 UI(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 Cf={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 qv;function L2(){if(qv)return oo;qv=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 Fv;function z2(){return Fv||(Fv=1,Cf.exports=L2()),Cf.exports}var m=z2(),Ef={exports:{}},Oe={};/**
|
|
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 Gv;function I2(){if(Gv)return Oe;Gv=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(L){return L===null||typeof L!="object"?null:(L=x&&L[x]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,j={};function E(L,X,N){this.props=L,this.context=X,this.refs=j,this.updater=N||k}E.prototype.isReactComponent={},E.prototype.setState=function(L,X){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,X,"setState")},E.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function R(){}R.prototype=E.prototype;function D(L,X,N){this.props=L,this.context=X,this.refs=j,this.updater=N||k}var F=D.prototype=new R;F.constructor=D,C(F,E.prototype),F.isPureReactComponent=!0;var U=Array.isArray;function _(){}var W={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function M(L,X,N){var ue=N.ref;return{$$typeof:e,type:L,key:X,ref:ue!==void 0?ue:null,props:N}}function T(L,X){return M(L.type,X,L.props)}function G(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function Y(L){var X={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(N){return X[N]})}var ie=/\/+/g;function B(L,X){return typeof L=="object"&&L!==null&&L.key!=null?Y(""+L.key):X.toString(36)}function Q(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(_,_):(L.status="pending",L.then(function(X){L.status==="pending"&&(L.status="fulfilled",L.value=X)},function(X){L.status==="pending"&&(L.status="rejected",L.reason=X)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function H(L,X,N,ue,pe){var he=typeof L;(he==="undefined"||he==="boolean")&&(L=null);var Ee=!1;if(L===null)Ee=!0;else switch(he){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(L.$$typeof){case e:case n:Ee=!0;break;case y:return Ee=L._init,H(Ee(L._payload),X,N,ue,pe)}}if(Ee)return pe=pe(L),Ee=ue===""?"."+B(L,0):ue,U(pe)?(N="",Ee!=null&&(N=Ee.replace(ie,"$&/")+"/"),H(pe,X,N,"",function(et){return et})):pe!=null&&(G(pe)&&(pe=T(pe,N+(pe.key==null||L&&L.key===pe.key?"":(""+pe.key).replace(ie,"$&/")+"/")+Ee)),X.push(pe)),1;Ee=0;var Ue=ue===""?".":ue+":";if(U(L))for(var Ne=0;Ne<L.length;Ne++)ue=L[Ne],he=Ue+B(ue,Ne),Ee+=H(ue,X,N,he,pe);else if(Ne=b(L),typeof Ne=="function")for(L=Ne.call(L),Ne=0;!(ue=L.next()).done;)ue=ue.value,he=Ue+B(ue,Ne++),Ee+=H(ue,X,N,he,pe);else if(he==="object"){if(typeof L.then=="function")return H(Q(L),X,N,ue,pe);throw X=String(L),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function ee(L,X,N){if(L==null)return L;var ue=[],pe=0;return H(L,ue,"","",function(he){return X.call(N,he,pe++)}),ue}function ne(L){if(L._status===-1){var X=L._result;X=X(),X.then(function(N){(L._status===0||L._status===-1)&&(L._status=1,L._result=N)},function(N){(L._status===0||L._status===-1)&&(L._status=2,L._result=N)}),L._status===-1&&(L._status=0,L._result=X)}if(L._status===1)return L._result.default;throw L._result}var V=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},O={map:ee,forEach:function(L,X,N){ee(L,function(){X.apply(this,arguments)},N)},count:function(L){var X=0;return ee(L,function(){X++}),X},toArray:function(L){return ee(L,function(X){return X})||[]},only:function(L){if(!G(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Oe.Activity=g,Oe.Children=O,Oe.Component=E,Oe.Fragment=a,Oe.Profiler=o,Oe.PureComponent=D,Oe.StrictMode=r,Oe.Suspense=p,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(L){return W.H.useMemoCache(L)}},Oe.cache=function(L){return function(){return L.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(L,X,N){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ue=C({},L.props),pe=L.key;if(X!=null)for(he in X.key!==void 0&&(pe=""+X.key),X)!P.call(X,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&X.ref===void 0||(ue[he]=X[he]);var he=arguments.length-2;if(he===1)ue.children=N;else if(1<he){for(var Ee=Array(he),Ue=0;Ue<he;Ue++)Ee[Ue]=arguments[Ue+2];ue.children=Ee}return M(L.type,pe,ue)},Oe.createContext=function(L){return L={$$typeof:u,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:s,_context:L},L},Oe.createElement=function(L,X,N){var ue,pe={},he=null;if(X!=null)for(ue in X.key!==void 0&&(he=""+X.key),X)P.call(X,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(pe[ue]=X[ue]);var Ee=arguments.length-2;if(Ee===1)pe.children=N;else if(1<Ee){for(var Ue=Array(Ee),Ne=0;Ne<Ee;Ne++)Ue[Ne]=arguments[Ne+2];pe.children=Ue}if(L&&L.defaultProps)for(ue in Ee=L.defaultProps,Ee)pe[ue]===void 0&&(pe[ue]=Ee[ue]);return M(L,he,pe)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(L){return{$$typeof:d,render:L}},Oe.isValidElement=G,Oe.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ne}},Oe.memo=function(L,X){return{$$typeof:f,type:L,compare:X===void 0?null:X}},Oe.startTransition=function(L){var X=W.T,N={};W.T=N;try{var ue=L(),pe=W.S;pe!==null&&pe(N,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(_,V)}catch(he){V(he)}finally{X!==null&&N.types!==null&&(X.types=N.types),W.T=X}},Oe.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},Oe.use=function(L){return W.H.use(L)},Oe.useActionState=function(L,X,N){return W.H.useActionState(L,X,N)},Oe.useCallback=function(L,X){return W.H.useCallback(L,X)},Oe.useContext=function(L){return W.H.useContext(L)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(L,X){return W.H.useDeferredValue(L,X)},Oe.useEffect=function(L,X){return W.H.useEffect(L,X)},Oe.useEffectEvent=function(L){return W.H.useEffectEvent(L)},Oe.useId=function(){return W.H.useId()},Oe.useImperativeHandle=function(L,X,N){return W.H.useImperativeHandle(L,X,N)},Oe.useInsertionEffect=function(L,X){return W.H.useInsertionEffect(L,X)},Oe.useLayoutEffect=function(L,X){return W.H.useLayoutEffect(L,X)},Oe.useMemo=function(L,X){return W.H.useMemo(L,X)},Oe.useOptimistic=function(L,X){return W.H.useOptimistic(L,X)},Oe.useReducer=function(L,X,N){return W.H.useReducer(L,X,N)},Oe.useRef=function(L){return W.H.useRef(L)},Oe.useState=function(L){return W.H.useState(L)},Oe.useSyncExternalStore=function(L,X,N){return W.H.useSyncExternalStore(L,X,N)},Oe.useTransition=function(){return W.H.useTransition()},Oe.version="19.2.4",Oe}var Vv;function oh(){return Vv||(Vv=1,Ef.exports=I2()),Ef.exports}var S=oh();const hn=Po(S);var Af={exports:{}},so={},jf={exports:{}},Tf={};/**
|
|
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 Wv;function P2(){return Wv||(Wv=1,(function(e){function n(H,ee){var ne=H.length;H.push(ee);e:for(;0<ne;){var V=ne-1>>>1,O=H[V];if(0<o(O,ee))H[V]=ee,H[ne]=O,ne=V;else break e}}function a(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var ee=H[0],ne=H.pop();if(ne!==ee){H[0]=ne;e:for(var V=0,O=H.length,L=O>>>1;V<L;){var X=2*(V+1)-1,N=H[X],ue=X+1,pe=H[ue];if(0>o(N,ne))ue<O&&0>o(pe,N)?(H[V]=pe,H[ue]=ne,V=ue):(H[V]=N,H[X]=ne,V=X);else if(ue<O&&0>o(pe,ne))H[V]=pe,H[ue]=ne,V=ue;else break e}}return ee}function o(H,ee){var ne=H.sortIndex-ee.sortIndex;return ne!==0?ne:H.id-ee.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,D=typeof setImmediate<"u"?setImmediate:null;function F(H){for(var ee=a(f);ee!==null;){if(ee.callback===null)r(f);else if(ee.startTime<=H)r(f),ee.sortIndex=ee.expirationTime,n(p,ee);else break;ee=a(f)}}function U(H){if(C=!1,F(H),!k)if(a(p)!==null)k=!0,_||(_=!0,Y());else{var ee=a(f);ee!==null&&Q(U,ee.startTime-H)}}var _=!1,W=-1,P=5,M=-1;function T(){return j?!0:!(e.unstable_now()-M<P)}function G(){if(j=!1,_){var H=e.unstable_now();M=H;var ee=!0;try{e:{k=!1,C&&(C=!1,R(W),W=-1),b=!0;var ne=x;try{t:{for(F(H),g=a(p);g!==null&&!(g.expirationTime>H&&T());){var V=g.callback;if(typeof V=="function"){g.callback=null,x=g.priorityLevel;var O=V(g.expirationTime<=H);if(H=e.unstable_now(),typeof O=="function"){g.callback=O,F(H),ee=!0;break t}g===a(p)&&r(p),F(H)}else r(p);g=a(p)}if(g!==null)ee=!0;else{var L=a(f);L!==null&&Q(U,L.startTime-H),ee=!1}}break e}finally{g=null,x=ne,b=!1}ee=void 0}}finally{ee?Y():_=!1}}}var Y;if(typeof D=="function")Y=function(){D(G)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,B=ie.port2;ie.port1.onmessage=G,Y=function(){B.postMessage(null)}}else Y=function(){E(G,0)};function Q(H,ee){W=E(function(){H(e.unstable_now())},ee)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(H){switch(x){case 1:case 2:case 3:var ee=3;break;default:ee=x}var ne=x;x=ee;try{return H()}finally{x=ne}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(H,ee){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ne=x;x=H;try{return ee()}finally{x=ne}},e.unstable_scheduleCallback=function(H,ee,ne){var V=e.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?V+ne:V):ne=V,H){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=ne+O,H={id:y++,callback:ee,priorityLevel:H,startTime:ne,expirationTime:O,sortIndex:-1},ne>V?(H.sortIndex=ne,n(f,H),a(p)===null&&H===a(f)&&(C?(R(W),W=-1):C=!0,Q(U,ne-V))):(H.sortIndex=O,n(p,H),k||b||(k=!0,_||(_=!0,Y()))),H},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(H){var ee=x;return function(){var ne=x;x=ee;try{return H.apply(this,arguments)}finally{x=ne}}}})(Tf)),Tf}var Yv;function U2(){return Yv||(Yv=1,jf.exports=P2()),jf.exports}var Nf={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 Kv;function B2(){if(Kv)return rn;Kv=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 Qv;function _x(){if(Qv)return Nf.exports;Qv=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(),Nf.exports=B2(),Nf.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 Xv;function H2(){if(Xv)return so;Xv=1;var e=U2(),n=oh(),a=_x();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"),D=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function Y(t){return t===null||typeof t!="object"?null:(t=G&&t[G]||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 M:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case D:return t.displayName||"Context";case R:return(t._context.displayName||"Context")+".Consumer";case F: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 P:i=t._payload,t=t._init;try{return B(t(i))}catch{}}return null}var Q=Array.isArray,H=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},V=[],O=-1;function L(t){return{current:t}}function X(t){0>O||(t.current=V[O],V[O]=null,O--)}function N(t,i){O++,V[O]=t.current,t.current=i}var ue=L(null),pe=L(null),he=L(null),Ee=L(null);function Ue(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)?fv(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=fv(i),t=pv(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}X(ue),N(ue,t)}function Ne(){X(ue),X(pe),X(he)}function et(t){t.memoizedState!==null&&N(Ee,t);var i=ue.current,l=pv(i,t.type);i!==l&&(N(pe,t),N(ue,l))}function Ot(t){pe.current===t&&(X(ue),X(pe)),Ee.current===t&&(X(Ee),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 Pe(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
|
+
`),J=A.split(`
|
|
46
|
+
`);for(h=c=0;c<z.length&&!z[c].includes("DetermineComponentFrameRoot");)c++;for(;h<J.length&&!J[h].includes("DetermineComponentFrameRoot");)h++;if(c===z.length||h===J.length)for(c=z.length-1,h=J.length-1;1<=c&&0<=h&&z[c]!==J[h];)h--;for(;1<=c&&0<=h;c--,h--)if(z[c]!==J[h]){if(c!==1||h!==1)do if(c--,h--,0>h||z[c]!==J[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 Pe(t.type,!1);case 11:return Pe(t.type.render,!1);case 1:return Pe(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,Ie=null,Xe=null;function Ve(t){if(typeof Te=="function"&&at(t),Xe&&typeof Xe.setStrictMode=="function")try{Xe.setStrictMode(Ie,t)}catch{}}var Se=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 pu(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 hu(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,J=t.hiddenUpdates;for(l=w&~l;0<l;){var re=31-Se(l),ce=1<<re;A[re]=0,z[re]=-1;var te=J[re];if(te!==null)for(J[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-Se(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-Se(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:ke(l),(l&(t.suspendedLanes|i))!==0?0:l}function ke(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 De(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ye(){var t=ee.p;return t!==0?t:(t=window.event,t===void 0?32:zv(t.type))}function lt(t,i){var l=ee.p;try{return ee.p=t,i()}finally{ee.p=l}}var Re=Math.random().toString(36).slice(2),we="__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[we],delete t[_e],delete t[Na],delete t[vl],delete t[Yo]}function Ra(t){var i=t[we];if(i)return i;for(var l=t.parentNode;l;){if(i=l[an]||l[we]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(t=bv(t);t!==null;){if(l=t[we])return l;t=bv(t)}return i}t=l,l=t.parentNode}return null}function Yt(t){if(t=t[we]||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 mu(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(mu(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 gu(t){if(!t._valueTracker){var i=qt(t)?"checked":"value";t._valueTracker=_a(t,i,""+t[i])}}function rm(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 jS=/[\n"\\]/g;function Vn(t){return t.replace(jS,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function yu(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?vu(t,w,Be(i)):l!=null?vu(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 lm(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)){gu(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),gu(t)}function vu(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 om(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 sm(t,i,l,c){if(i==null){if(c!=null){if(l!=null)throw Error(r(92));if(Q(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),gu(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 TS=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 cm(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||TS.has(i)?i==="float"?t.cssFloat=l:t[i]=(""+l).trim():t[i]=l+"px"}function um(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&&cm(t,h,c)}else for(var v in i)i.hasOwnProperty(v)&&cm(t,v,i[v])}function xu(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 NS=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"]]),RS=/^[\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 RS.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Oa(){}var bu=null;function wu(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 dm(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(yu(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));yu(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&&rm(c)}break e;case"textarea":om(t,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&vr(t,!!l.multiple,i,!1)}}}var Su=!1;function fm(t,i,l){if(Su)return t(i,l);Su=!0;try{var c=t(i);return c}finally{if(Su=!1,(br!==null||wr!==null)&&(Ps(),br&&(i=br,t=wr,wr=br=null,dm(i),t)))for(i=0;i<t.length;i++)dm(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"),ku=!1;if(Da)try{var wl={};Object.defineProperty(wl,"passive",{get:function(){ku=!0}}),window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{ku=!1}var ii=null,Cu=null,Zo=null;function pm(){if(Zo)return Zo;var t,i=Cu,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 hm(){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:hm,this.isPropagationStopped=hm,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}),_S=bn(Sl),Eu,Au,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:Tu,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"?(Eu=t.screenX-kl.screenX,Au=t.screenY-kl.screenY):Au=Eu=0,kl=t),Eu)},movementY:function(t){return"movementY"in t?t.movementY:Au}}),mm=bn(ns),OS=g({},ns,{dataTransfer:0}),DS=bn(OS),MS=g({},Sl,{relatedTarget:0}),ju=bn(MS),LS=g({},Hi,{animationName:0,elapsedTime:0,pseudoElement:0}),zS=bn(LS),IS=g({},Hi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),PS=bn(IS),US=g({},Hi,{data:0}),gm=bn(US),BS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},HS={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"},$S={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qS(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=$S[t])?!!i[t]:!1}function Tu(){return qS}var FS=g({},Sl,{key:function(t){if(t.key){var i=BS[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"?HS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tu,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}}),GS=bn(FS),VS=g({},ns,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ym=bn(VS),WS=g({},Sl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tu}),YS=bn(WS),KS=g({},Hi,{propertyName:0,elapsedTime:0,pseudoElement:0}),QS=bn(KS),XS=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}),ZS=bn(XS),JS=g({},Hi,{newState:0,oldState:0}),ek=bn(JS),tk=[9,13,27,32],Nu=Da&&"CompositionEvent"in window,Cl=null;Da&&"documentMode"in document&&(Cl=document.documentMode);var nk=Da&&"TextEvent"in window&&!Cl,vm=Da&&(!Nu||Cl&&8<Cl&&11>=Cl),xm=" ",bm=!1;function wm(t,i){switch(t){case"keyup":return tk.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Sr=!1;function ak(t,i){switch(t){case"compositionend":return Sm(i);case"keypress":return i.which!==32?null:(bm=!0,xm);case"textInput":return t=i.data,t===xm&&bm?null:t;default:return null}}function ik(t,i){if(Sr)return t==="compositionend"||!Nu&&wm(t,i)?(t=pm(),Zo=Cu=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 vm&&i.locale!=="ko"?null:i.data;default:return null}}var rk={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 km(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!rk[t.type]:i==="textarea"}function Cm(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 lk(t){lv(t,0)}function as(t){var i=sn(t);if(rm(i))return t}function Em(t,i){if(t==="change")return i}var Am=!1;if(Da){var Ru;if(Da){var _u="oninput"in document;if(!_u){var jm=document.createElement("div");jm.setAttribute("oninput","return;"),_u=typeof jm.oninput=="function"}Ru=_u}else Ru=!1;Am=Ru&&(!document.documentMode||9<document.documentMode)}function Tm(){El&&(El.detachEvent("onpropertychange",Nm),Al=El=null)}function Nm(t){if(t.propertyName==="value"&&as(Al)){var i=[];Cm(i,Al,t,wu(t)),fm(lk,i)}}function ok(t,i,l){t==="focusin"?(Tm(),El=i,Al=l,El.attachEvent("onpropertychange",Nm)):t==="focusout"&&Tm()}function sk(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return as(Al)}function ck(t,i){if(t==="click")return as(i)}function uk(t,i){if(t==="input"||t==="change")return as(i)}function dk(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Nn=typeof Object.is=="function"?Object.is:dk;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 Rm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function _m(t,i){var l=Rm(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=Rm(l)}}function Om(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Om(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Dm(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 Ou(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 fk=Da&&"documentMode"in document&&11>=document.documentMode,kr=null,Du=null,Tl=null,Mu=!1;function Mm(t,i,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Mu||kr==null||kr!==Qo(c)||(c=kr,"selectionStart"in c&&Ou(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(Du,"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")},Lu={},Lm={};Da&&(Lm=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(Lu[t])return Lu[t];if(!Cr[t])return t;var i=Cr[t],l;for(l in i)if(i.hasOwnProperty(l)&&l in Lm)return Lu[t]=i[l];return t}var zm=qi("animationend"),Im=qi("animationiteration"),Pm=qi("animationstart"),pk=qi("transitionrun"),hk=qi("transitionstart"),mk=qi("transitioncancel"),Um=qi("transitionend"),Bm=new Map,zu="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(" ");zu.push("scrollEnd");function la(t,i){Bm.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,Iu=0;function rs(){for(var t=Er,i=Iu=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&&Hm(l,h,v)}}function ls(t,i,l,c){Wn[Er++]=t,Wn[Er++]=i,Wn[Er++]=l,Wn[Er++]=c,Iu|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Pu(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 Hm(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-Se(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,Wd=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 gk(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 gk(t,i,l,c)}function Uu(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 $m(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")Uu(t)&&(w=1);else if(typeof t=="string")w=w2(t,l,ue.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case M:return t=Rn(31,l,i,h),t.elementType=M,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 D:w=10;break e;case R:w=9;break e;case F:w=11;break e;case W:w=14;break e;case P: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 Bu(t,i,l){return t=Rn(6,t,null,i),t.lanes=l,t}function qm(t){var i=Rn(18,null,null,0);return i.stateNode=t,i}function Hu(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 Fm=new WeakMap;function Yn(t,i){if(typeof t=="object"&&t!==null){var l=Fm.get(t);return l!==void 0?l:(i={value:t,source:i,stack:Dt(i)},Fm.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 Gm(t,i,l){Kn[Qn++]=ga,Kn[Qn++]=ya,Kn[Qn++]=ri,ri=t;var c=ga;t=ya;var h=32-Se(c)-1;c&=~(1<<h),l+=1;var v=32-Se(i)+h;if(30<v){var w=h-h%5;v=(c&(1<<w)-1).toString(32),c>>=w,h-=w,ga=1<<32-Se(i)+h|l<<h|c,ya=v+t}else ga=1<<v|l<<h|c,ya=t}function $u(t){t.return!==null&&(La(t,1),Gm(t,1,0))}function qu(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 Vm(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,Fu=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)),Fu}function Wm(t){var i=t.stateNode,l=t.type,c=t.memoizedProps;switch(i[we]=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),lm(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),sm(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||uv(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 Ym(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 Ym(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")||cf(t.type,t.memoizedProps)),l=!l),l&&wt&&oi(t),Ym(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));wt=xv(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));wt=xv(t)}else i===27?(i=wt,wi(t.type)?(t=hf,hf=null,wt=t):wt=i):wt=Jt?Jn(t.stateNode.nextSibling):null;return!0}function Vi(){wt=Jt=null,We=!1}function Gu(){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 Vu=L(null),Wi=null,za=null;function si(t,i,l){N(Vu,i._currentValue),i._currentValue=l}function Ia(t){t._currentValue=Vu.current,X(Vu)}function Wu(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 Yu(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),Wu(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),Wu(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===Ee.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&&Yu(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 Km(Wi,t)}function ds(t,i){return Wi===null&&Yi(t),Km(t,i)}function Km(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 yk=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()})}},vk=e.unstable_scheduleCallback,xk=e.unstable_NormalPriority,Lt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ku(){return{controller:new yk,data:new Map,refCount:0}}function _l(t){t.refCount--,t.refCount===0&&vk(xk,function(){t.controller.abort()})}var Ol=null,Qu=0,_r=0,Or=null;function bk(t,i){if(Ol===null){var l=Ol=[];Qu=0,_r=Jd(),Or={status:"pending",value:void 0,then:function(c){l.push(c)}}}return Qu++,i.then(Qm,Qm),i}function Qm(){if(--Qu===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 wk(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 Xm=H.S;H.S=function(t,i){My=it(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&bk(t,i),Xm!==null&&Xm(t,i)};var Ki=L(null);function Xu(){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 Zm(){var t=Xu();return t===null?null:{parent:Lt._currentValue,pool:t}}var Dr=Error(r(460)),Zu=Error(r(474)),ps=Error(r(542)),hs={then:function(){}};function Jm(t){return t=t.status,t==="fulfilled"||t==="rejected"}function eg(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,ng(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,ng(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 tg(){if(Xi===null)throw Error(r(459));var t=Xi;return Xi=null,t}function ng(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=[]),eg(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 ag(t){function i(K,q){if(t){var Z=K.deletions;Z===null?(K.deletions=[q],K.flags|=16):Z.push(q)}}function l(K,q){if(!t)return null;for(;q!==null;)i(K,q),q=q.sibling;return null}function c(K){for(var q=new Map;K!==null;)K.key!==null?q.set(K.key,K):q.set(K.index,K),K=K.sibling;return q}function h(K,q){return K=Ma(K,q),K.index=0,K.sibling=null,K}function v(K,q,Z){return K.index=Z,t?(Z=K.alternate,Z!==null?(Z=Z.index,Z<q?(K.flags|=67108866,q):Z):(K.flags|=67108866,q)):(K.flags|=1048576,q)}function w(K){return t&&K.alternate===null&&(K.flags|=67108866),K}function A(K,q,Z,oe){return q===null||q.tag!==6?(q=Bu(Z,K.mode,oe),q.return=K,q):(q=h(q,Z),q.return=K,q)}function z(K,q,Z,oe){var Ce=Z.type;return Ce===C?re(K,q,Z.props.children,oe,Z.key):q!==null&&(q.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===P&&Qi(Ce)===q.type)?(q=h(q,Z.props),Ml(q,Z),q.return=K,q):(q=ss(Z.type,Z.key,Z.props,null,K.mode,oe),Ml(q,Z),q.return=K,q)}function J(K,q,Z,oe){return q===null||q.tag!==4||q.stateNode.containerInfo!==Z.containerInfo||q.stateNode.implementation!==Z.implementation?(q=Hu(Z,K.mode,oe),q.return=K,q):(q=h(q,Z.children||[]),q.return=K,q)}function re(K,q,Z,oe,Ce){return q===null||q.tag!==7?(q=Gi(Z,K.mode,oe,Ce),q.return=K,q):(q=h(q,Z),q.return=K,q)}function ce(K,q,Z){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Bu(""+q,K.mode,Z),q.return=K,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case b:return Z=ss(q.type,q.key,q.props,null,K.mode,Z),Ml(Z,q),Z.return=K,Z;case k:return q=Hu(q,K.mode,Z),q.return=K,q;case P:return q=Qi(q),ce(K,q,Z)}if(Q(q)||Y(q))return q=Gi(q,K.mode,Z,null),q.return=K,q;if(typeof q.then=="function")return ce(K,ms(q),Z);if(q.$$typeof===D)return ce(K,ds(K,q),Z);gs(K,q)}return null}function te(K,q,Z,oe){var Ce=q!==null?q.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Ce!==null?null:A(K,q,""+Z,oe);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===Ce?z(K,q,Z,oe):null;case k:return Z.key===Ce?J(K,q,Z,oe):null;case P:return Z=Qi(Z),te(K,q,Z,oe)}if(Q(Z)||Y(Z))return Ce!==null?null:re(K,q,Z,oe,null);if(typeof Z.then=="function")return te(K,q,ms(Z),oe);if(Z.$$typeof===D)return te(K,q,ds(K,Z),oe);gs(K,Z)}return null}function ae(K,q,Z,oe,Ce){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return K=K.get(Z)||null,A(q,K,""+oe,Ce);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return K=K.get(oe.key===null?Z:oe.key)||null,z(q,K,oe,Ce);case k:return K=K.get(oe.key===null?Z:oe.key)||null,J(q,K,oe,Ce);case P:return oe=Qi(oe),ae(K,q,Z,oe,Ce)}if(Q(oe)||Y(oe))return K=K.get(Z)||null,re(q,K,oe,Ce,null);if(typeof oe.then=="function")return ae(K,q,Z,ms(oe),Ce);if(oe.$$typeof===D)return ae(K,q,Z,ds(q,oe),Ce);gs(q,oe)}return null}function xe(K,q,Z,oe){for(var Ce=null,Ze=null,be=q,Le=q=0,Ge=null;be!==null&&Le<Z.length;Le++){be.index>Le?(Ge=be,be=null):Ge=be.sibling;var Je=te(K,be,Z[Le],oe);if(Je===null){be===null&&(be=Ge);break}t&&be&&Je.alternate===null&&i(K,be),q=v(Je,q,Le),Ze===null?Ce=Je:Ze.sibling=Je,Ze=Je,be=Ge}if(Le===Z.length)return l(K,be),We&&La(K,Le),Ce;if(be===null){for(;Le<Z.length;Le++)be=ce(K,Z[Le],oe),be!==null&&(q=v(be,q,Le),Ze===null?Ce=be:Ze.sibling=be,Ze=be);return We&&La(K,Le),Ce}for(be=c(be);Le<Z.length;Le++)Ge=ae(be,K,Le,Z[Le],oe),Ge!==null&&(t&&Ge.alternate!==null&&be.delete(Ge.key===null?Le:Ge.key),q=v(Ge,q,Le),Ze===null?Ce=Ge:Ze.sibling=Ge,Ze=Ge);return t&&be.forEach(function(Ai){return i(K,Ai)}),We&&La(K,Le),Ce}function je(K,q,Z,oe){if(Z==null)throw Error(r(151));for(var Ce=null,Ze=null,be=q,Le=q=0,Ge=null,Je=Z.next();be!==null&&!Je.done;Le++,Je=Z.next()){be.index>Le?(Ge=be,be=null):Ge=be.sibling;var Ai=te(K,be,Je.value,oe);if(Ai===null){be===null&&(be=Ge);break}t&&be&&Ai.alternate===null&&i(K,be),q=v(Ai,q,Le),Ze===null?Ce=Ai:Ze.sibling=Ai,Ze=Ai,be=Ge}if(Je.done)return l(K,be),We&&La(K,Le),Ce;if(be===null){for(;!Je.done;Le++,Je=Z.next())Je=ce(K,Je.value,oe),Je!==null&&(q=v(Je,q,Le),Ze===null?Ce=Je:Ze.sibling=Je,Ze=Je);return We&&La(K,Le),Ce}for(be=c(be);!Je.done;Le++,Je=Z.next())Je=ae(be,K,Le,Je.value,oe),Je!==null&&(t&&Je.alternate!==null&&be.delete(Je.key===null?Le:Je.key),q=v(Je,q,Le),Ze===null?Ce=Je:Ze.sibling=Je,Ze=Je);return t&&be.forEach(function(O2){return i(K,O2)}),We&&La(K,Le),Ce}function dt(K,q,Z,oe){if(typeof Z=="object"&&Z!==null&&Z.type===C&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var Ce=Z.key;q!==null;){if(q.key===Ce){if(Ce=Z.type,Ce===C){if(q.tag===7){l(K,q.sibling),oe=h(q,Z.props.children),oe.return=K,K=oe;break e}}else if(q.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===P&&Qi(Ce)===q.type){l(K,q.sibling),oe=h(q,Z.props),Ml(oe,Z),oe.return=K,K=oe;break e}l(K,q);break}else i(K,q);q=q.sibling}Z.type===C?(oe=Gi(Z.props.children,K.mode,oe,Z.key),oe.return=K,K=oe):(oe=ss(Z.type,Z.key,Z.props,null,K.mode,oe),Ml(oe,Z),oe.return=K,K=oe)}return w(K);case k:e:{for(Ce=Z.key;q!==null;){if(q.key===Ce)if(q.tag===4&&q.stateNode.containerInfo===Z.containerInfo&&q.stateNode.implementation===Z.implementation){l(K,q.sibling),oe=h(q,Z.children||[]),oe.return=K,K=oe;break e}else{l(K,q);break}else i(K,q);q=q.sibling}oe=Hu(Z,K.mode,oe),oe.return=K,K=oe}return w(K);case P:return Z=Qi(Z),dt(K,q,Z,oe)}if(Q(Z))return xe(K,q,Z,oe);if(Y(Z)){if(Ce=Y(Z),typeof Ce!="function")throw Error(r(150));return Z=Ce.call(Z),je(K,q,Z,oe)}if(typeof Z.then=="function")return dt(K,q,ms(Z),oe);if(Z.$$typeof===D)return dt(K,q,ds(K,Z),oe);gs(K,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,q!==null&&q.tag===6?(l(K,q.sibling),oe=h(q,Z),oe.return=K,K=oe):(l(K,q),oe=Bu(Z,K.mode,oe),oe.return=K,K=oe),w(K)):l(K,q)}return function(K,q,Z,oe){try{Dl=0;var Ce=dt(K,q,Z,oe);return Mr=null,Ce}catch(be){if(be===Dr||be===ps)throw be;var Ze=Rn(29,be,null,K.mode);return Ze.lanes=oe,Ze.return=K,Ze}finally{}}}var Zi=ag(!0),ig=ag(!1),ci=!1;function Ju(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ed(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),Hm(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 td(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 nd=!1;function zl(){if(nd){var t=Or;if(t!==null)throw t}}function Il(t,i,l,c){nd=!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,J=z.next;z.next=null,w===null?v=J:w.next=J,w=z;var re=t.alternate;re!==null&&(re=re.updateQueue,A=re.lastBaseUpdate,A!==w&&(A===null?re.firstBaseUpdate=J:A.next=J,re.lastBaseUpdate=z))}if(v!==null){var ce=h.baseState;w=0,re=J=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&&(nd=!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?(J=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=J,h.lastBaseUpdate=re,v===null&&(h.shared.lanes=0),gi|=w,t.lanes=w,t.memoizedState=ce}}function rg(t,i){if(typeof t!="function")throw Error(r(191,t));t.call(i)}function lg(t,i){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)rg(l[t],i)}var Lr=L(null),ys=L(0);function og(t,i){t=Va,N(ys,t),N(Lr,i),Va=t|i.baseLanes}function ad(){N(ys,Va),N(Lr,Lr.current)}function id(){Va=ys.current,X(Lr),X(ys)}var _n=L(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 rd(t){N(Rt,Rt.current),N(_n,t),Zn===null&&(Zn=t)}function sg(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){X(_n),Zn===t&&(Zn=null),X(Rt)}var Rt=L(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||ff(l)||pf(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,Me=null,ct=null,zt=null,xs=!1,zr=!1,Ji=!1,bs=0,Pl=0,Ir=null,Sk=0;function jt(){throw Error(r(321))}function ld(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 od(t,i,l,c,h,v){return Pa=v,Me=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=t===null||t.memoizedState===null?Gg:Sd,Ji=!1,v=l(c,h),Ji=!1,zr&&(v=ug(i,l,c,h)),cg(t),v}function cg(t){H.H=Hl;var i=ct!==null&&ct.next!==null;if(Pa=0,zt=ct=Me=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 ug(t,i,l,c){Me=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)}H.H=Vg,v=i(l,c)}while(zr);return v}function kk(){var t=H.H,i=t.useState()[0];return i=typeof i.then=="function"?Ul(i):i,t=t.useState()[0],(ct!==null?ct.memoizedState:null)!==t&&(Me.flags|=1024),i}function sd(){var t=bs!==0;return bs=0,t}function cd(t,i,l){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~l}function ud(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=Me=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?Me.memoizedState=zt=t:zt=zt.next=t,zt}function _t(){if(ct===null){var t=Me.alternate;t=t!==null?t.memoizedState:null}else t=ct.next;var i=zt===null?Me.memoizedState:zt.next;if(i!==null)zt=i,ct=t;else{if(t===null)throw Me.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?Me.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=eg(Ir,t,i),i=Me,(zt===null?i.memoizedState:zt.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?Gg:Sd),t}function Ss(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ul(t);if(t.$$typeof===D)return en(t)}throw Error(r(438,String(t)))}function dd(t){var i=null,l=Me.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var c=Me.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(),Me.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 fd(i,ct,t)}function fd(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,J=i,re=!1;do{var ce=J.lane&-536870913;if(ce!==J.lane?(Fe&ce)===ce:(Pa&ce)===ce){var te=J.revertLane;if(te===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ce===_r&&(re=!0);else if((Pa&te)===te){J=J.next,te===_r&&(re=!0);continue}else ce={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},z===null?(A=z=ce,w=v):z=z.next=ce,Me.lanes|=te,gi|=te;ce=J.action,Ji&&l(v,ce),v=J.hasEagerState?J.eagerState:l(v,ce)}else te={lane:ce,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},z===null?(A=z=te,w=v):z=z.next=te,Me.lanes|=ce,gi|=ce;J=J.next}while(J!==null&&J!==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 pd(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 dg(t,i,l){var c=Me,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,gd(hg.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},pg.bind(null,c,h,l,i),null),ht===null)throw Error(r(349));v||(Pa&127)!==0||fg(c,i,l)}return l}function fg(t,i,l){t.flags|=16384,t={getSnapshot:i,value:l},i=Me.updateQueue,i===null?(i=ws(),Me.updateQueue=i,i.stores=[t]):(l=i.stores,l===null?i.stores=[t]:l.push(t))}function pg(t,i,l,c){i.value=l,i.getSnapshot=c,mg(i)&&gg(t)}function hg(t,i,l){return l(function(){mg(i)&&gg(t)})}function mg(t){var i=t.getSnapshot;t=t.value;try{var l=i();return!Nn(t,l)}catch{return!0}}function gg(t){var i=Fi(t,2);i!==null&&En(i,t,2)}function hd(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 yg(t,i,l,c){return t.baseState=l,fd(t,ct,typeof c=="function"?c:Ua)}function Ck(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)}};H.T!==null?l(!0):v.isTransition=!1,c(v),l=i.pending,l===null?(v.next=i.pending=v,vg(i,v)):(v.next=l.next,i.pending=l.next=v)}}function vg(t,i){var l=i.action,c=i.payload,h=t.state;if(i.isTransition){var v=H.T,w={};H.T=w;try{var A=l(h,c),z=H.S;z!==null&&z(w,A),xg(t,i,A)}catch(J){md(t,i,J)}finally{v!==null&&w.types!==null&&(v.types=w.types),H.T=v}}else try{v=l(h,c),xg(t,i,v)}catch(J){md(t,i,J)}}function xg(t,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){bg(t,i,c)},function(c){return md(t,i,c)}):bg(t,i,l)}function bg(t,i,l){i.status="fulfilled",i.value=l,wg(i),t.state=l,i=t.pending,i!==null&&(l=i.next,l===i?t.pending=null:(l=l.next,i.next=l,vg(t,l)))}function md(t,i,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=l,wg(i),i=i.next;while(i!==c)}t.action=null}function wg(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function Sg(t,i){return i}function kg(t,i){if(We){var l=ht.formState;if(l!==null){e:{var c=Me;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:Sg,lastRenderedState:i},l.queue=c,l=$g.bind(null,Me,c),c.dispatch=l,c=hd(!1),v=wd.bind(null,Me,!1,c.queue),c=dn(),h={state:i,dispatch:null,action:t,pending:null},c.queue=h,l=Ck.bind(null,Me,h,v,l),h.dispatch=l,c.memoizedState=t,[i,l,!1]}function Cg(t){var i=_t();return Eg(i,ct,t)}function Eg(t,i,l){if(i=fd(t,i,Sg)[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&&(Me.flags|=2048,Pr(9,{destroy:void 0},Ek.bind(null,h,l),null)),[c,v,t]}function Ek(t,i){t.action=i}function Ag(t){var i=_t(),l=ct;if(l!==null)return Eg(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=Me.updateQueue,i===null&&(i=ws(),Me.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 jg(){return _t().memoizedState}function Cs(t,i,l,c){var h=dn();Me.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&&ld(c,ct.memoizedState.deps)?h.memoizedState=Pr(i,v,l,c):(Me.flags|=t,h.memoizedState=Pr(1|i,v,l,c))}function Tg(t,i){Cs(8390656,8,t,i)}function gd(t,i){Es(2048,8,t,i)}function Ak(t){Me.flags|=4;var i=Me.updateQueue;if(i===null)i=ws(),Me.updateQueue=i,i.events=[t];else{var l=i.events;l===null?i.events=[t]:l.push(t)}}function Ng(t){var i=_t().memoizedState;return Ak({ref:i,nextImpl:t}),function(){if((tt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function Rg(t,i){return Es(4,2,t,i)}function _g(t,i){return Es(4,4,t,i)}function Og(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 Dg(t,i,l){l=l!=null?l.concat([t]):null,Es(4,4,Og.bind(null,i,t),l)}function yd(){}function Mg(t,i){var l=_t();i=i===void 0?null:i;var c=l.memoizedState;return i!==null&&ld(i,c[1])?c[0]:(l.memoizedState=[t,i],t)}function Lg(t,i){var l=_t();i=i===void 0?null:i;var c=l.memoizedState;if(i!==null&&ld(i,c[1]))return c[0];if(c=t(),Ji){Ve(!0);try{t()}finally{Ve(!1)}}return l.memoizedState=[c,i],c}function vd(t,i,l){return l===void 0||(Pa&1073741824)!==0&&(Fe&261930)===0?t.memoizedState=i:(t.memoizedState=l,t=zy(),Me.lanes|=t,gi|=t,l)}function zg(t,i,l,c){return Nn(l,i)?l:Lr.current!==null?(t=vd(t,l,c),Nn(t,i)||(It=!0),t):(Pa&42)===0||(Pa&1073741824)!==0&&(Fe&261930)===0?(It=!0,t.memoizedState=l):(t=zy(),Me.lanes|=t,gi|=t,i)}function Ig(t,i,l,c,h){var v=ee.p;ee.p=v!==0&&8>v?v:8;var w=H.T,A={};H.T=A,wd(t,!1,i,l);try{var z=h(),J=H.S;if(J!==null&&J(A,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var re=wk(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{ee.p=v,w!==null&&A.types!==null&&(w.types=A.types),H.T=w}}function jk(){}function xd(t,i,l,c){if(t.tag!==5)throw Error(r(476));var h=Pg(t).queue;Ig(t,h,i,ne,l===null?jk:function(){return Ug(t),l(c)})}function Pg(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 Ug(t){var i=Pg(t);i.next===null&&(i=t.alternate.memoizedState),Bl(t,i.next.queue,{},Ln())}function bd(){return en(ao)}function Bg(){return _t().memoizedState}function Hg(){return _t().memoizedState}function Tk(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:Ku()},t.payload=i;return}i=i.return}}function Nk(t,i,l){var c=Ln();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},As(t)?qg(i,l):(l=Pu(t,i,l,c),l!==null&&(En(l,t,c),Fg(l,i,c)))}function $g(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))qg(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=Pu(t,i,h,c),l!==null)return En(l,t,c),Fg(l,i,c),!0}return!1}function wd(t,i,l,c){if(c={lane:2,revertLane:Jd(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},As(t)){if(i)throw Error(r(479))}else i=Pu(t,l,c,2),i!==null&&En(i,t,2)}function As(t){var i=t.alternate;return t===Me||i!==null&&i===Me}function qg(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 Fg(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 Gg={readContext:en,use:Ss,useCallback:function(t,i){return dn().memoizedState=[t,i===void 0?null:i],t},useContext:en,useEffect:Tg,useImperativeHandle:function(t,i,l){l=l!=null?l.concat([t]):null,Cs(4194308,4,Og.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=Nk.bind(null,Me,t),[c.memoizedState,t]},useRef:function(t){var i=dn();return t={current:t},i.memoizedState=t},useState:function(t){t=hd(t);var i=t.queue,l=$g.bind(null,Me,i);return i.dispatch=l,[t.memoizedState,l]},useDebugValue:yd,useDeferredValue:function(t,i){var l=dn();return vd(l,t,i)},useTransition:function(){var t=hd(!1);return t=Ig.bind(null,Me,t.queue,!0,!1),dn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,l){var c=Me,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||fg(c,i,l)}h.memoizedState=l;var v={value:l,getSnapshot:i};return h.queue=v,Tg(hg.bind(null,c,v,t),[t]),c.flags|=2048,Pr(9,{destroy:void 0},pg.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-Se(c)-1)).toString(32)+l,i="_"+i+"R_"+l,l=bs++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=Sk++,i="_"+i+"r_"+l.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:bd,useFormState:kg,useActionState:kg,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=wd.bind(null,Me,!0,l),l.dispatch=i,[t,i]},useMemoCache:dd,useCacheRefresh:function(){return dn().memoizedState=Tk.bind(null,Me)},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)}}},Sd={readContext:en,use:Ss,useCallback:Mg,useContext:en,useEffect:gd,useImperativeHandle:Dg,useInsertionEffect:Rg,useLayoutEffect:_g,useMemo:Lg,useReducer:ks,useRef:jg,useState:function(){return ks(Ua)},useDebugValue:yd,useDeferredValue:function(t,i){var l=_t();return zg(l,ct.memoizedState,t,i)},useTransition:function(){var t=ks(Ua)[0],i=_t().memoizedState;return[typeof t=="boolean"?t:Ul(t),i]},useSyncExternalStore:dg,useId:Bg,useHostTransitionStatus:bd,useFormState:Cg,useActionState:Cg,useOptimistic:function(t,i){var l=_t();return yg(l,ct,t,i)},useMemoCache:dd,useCacheRefresh:Hg};Sd.useEffectEvent=Ng;var Vg={readContext:en,use:Ss,useCallback:Mg,useContext:en,useEffect:gd,useImperativeHandle:Dg,useInsertionEffect:Rg,useLayoutEffect:_g,useMemo:Lg,useReducer:pd,useRef:jg,useState:function(){return pd(Ua)},useDebugValue:yd,useDeferredValue:function(t,i){var l=_t();return ct===null?vd(l,t,i):zg(l,ct.memoizedState,t,i)},useTransition:function(){var t=pd(Ua)[0],i=_t().memoizedState;return[typeof t=="boolean"?t:Ul(t),i]},useSyncExternalStore:dg,useId:Bg,useHostTransitionStatus:bd,useFormState:Ag,useActionState:Ag,useOptimistic:function(t,i){var l=_t();return ct!==null?yg(l,ct,t,i):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:dd,useCacheRefresh:Hg};Vg.useEffectEvent=Ng;function kd(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 Cd={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 Wg(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 Yg(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&&Cd.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 Kg(t){is(t)}function Qg(t){console.error(t)}function Xg(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 Zg(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 Ed(t,i,l){return l=ui(l),l.tag=3,l.payload={element:null},l.callback=function(){js(t,i)},l}function Jg(t){return t=ui(t),t.tag=3,t}function ey(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(){Zg(i,l,c)}}var w=l.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(t.callback=function(){Zg(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 Rk(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),Qd(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)),Qd(t,c,h)),!1}throw Error(r(435,l.tag))}return Qd(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!==Fu&&(t=Error(r(422),{cause:c}),Rl(Yn(t,l)))):(c!==Fu&&(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=Ed(t.stateNode,c,h),td(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=Ed(l.stateNode,c,t),td(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=Jg(h),ey(h,t,l,c),td(l,h),!1}l=l.return}while(l!==null);return!1}var Ad=Error(r(461)),It=!1;function tn(t,i,l,c){i.child=t===null?ig(i,null,l,c):Zi(i,t.child,l,c)}function ty(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=od(t,i,l,w,v,h),A=sd(),t!==null&&!It?(cd(t,i,h),Ba(t,i,h)):(We&&A&&$u(i),i.flags|=1,tn(t,i,c,h),i.child)}function ny(t,i,l,c,h){if(t===null){var v=l.type;return typeof v=="function"&&!Uu(v)&&v.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=v,ay(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,!Md(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 ay(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,Md(t,h))(t.flags&131072)!==0&&(It=!0);else return i.lanes=t.lanes,Ba(t,i,h)}return jd(t,i,l,c,h)}function iy(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 ry(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?og(i,v):ad(),sg(i);else return c=i.lanes=536870912,ry(t,i,v!==null?v.baseLanes|l:l,l,c)}else v!==null?(fs(i,v.cachePool),og(i,v),pi(),i.memoizedState=null):(t!==null&&fs(i,null),ad(),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 ry(t,i,l,c,h){var v=Xu();return v=v===null?null:{parent:Lt._currentValue,pool:v},i.memoizedState={baseLanes:l,cachePool:v},t!==null&&fs(i,null),ad(),sg(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 ly(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 _k(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(rd(i),(t=wt)?(t=vv(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=qm(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(rd(i),h)if(i.flags&256)i.flags&=-257,i=ly(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),Ad;Us(),i=ly(t,i,l)}else t=v.treeContext,wt=Jn(w.nextSibling),Jt=i,We=!0,li=null,Xn=!1,t!==null&&Vm(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 jd(t,i,l,c,h){return Yi(i),l=od(t,i,l,c,void 0,h),c=sd(),t!==null&&!It?(cd(t,i,h),Ba(t,i,h)):(We&&c&&$u(i),i.flags|=1,tn(t,i,l,h),i.child)}function oy(t,i,l,c,h,v){return Yi(i),i.updateQueue=null,l=ug(i,c,l,h),cg(t),c=sd(),t!==null&&!It?(cd(t,i,v),Ba(t,i,v)):(We&&c&&$u(i),i.flags|=1,tn(t,i,l,v),i.child)}function sy(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=Cd,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=c,v.state=i.memoizedState,v.refs={},Ju(i),w=l.contextType,v.context=typeof w=="object"&&w!==null?en(w):Ar,v.state=i.memoizedState,w=l.getDerivedStateFromProps,typeof w=="function"&&(kd(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&&Cd.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 J=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||J!==w)&&Yg(i,v,c,w),ci=!1;var te=i.memoizedState;v.state=te,Il(i,c,v,h),zl(),J=i.memoizedState,A||te!==J||ci?(typeof ce=="function"&&(kd(i,l,ce,c),J=i.memoizedState),(z=ci||Wg(i,l,z,c,te,J,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=J),v.props=c,v.state=J,v.context=w,c=z):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{v=i.stateNode,ed(t,i),w=i.memoizedProps,re=er(l,w),v.props=re,ce=i.pendingProps,te=v.context,J=l.contextType,z=Ar,typeof J=="object"&&J!==null&&(z=en(J)),A=l.getDerivedStateFromProps,(J=typeof A=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==ce||te!==z)&&Yg(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"&&(kd(i,l,A,c),ae=i.memoizedState),(re=ci||Wg(i,l,re,c,te,ae,z)||t!==null&&t.dependencies!==null&&us(t.dependencies))?(J||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 cy(t,i,l,c){return Vi(),i.flags|=256,tn(t,i,l,c),i.child}var Td={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nd(t){return{baseLanes:t,cachePool:Zm()}}function Rd(t,i,l){return t=t!==null?t.childLanes&~l:0,i&&(t|=Mn),t}function uy(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=vv(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=qm(t),l.return=i,i.child=l,Jt=i,wt=null)):t=null,t===null)throw oi(i);return pf(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=Nd(l),c.childLanes=Rd(t,w,l),i.memoizedState=Td,$l(null,c)):(fi(i),_d(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=Od(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=Nd(l),c.childLanes=Rd(t,w,l),i.memoizedState=Td,i=$l(null,c));else if(fi(i),pf(A)){if(w=A.nextSibling&&A.nextSibling.dataset,w)var J=w.dgst;w=J,c=Error(r(419)),c.stack="",c.digest=w,Rl({value:c,source:null,stack:null}),i=Od(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),Ad;ff(A)||Us(),i=Od(t,i,l)}else ff(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&&Vm(i,t),i=_d(i,c.children),i.flags|=4096);return i}return h?(pi(),A=c.fallback,h=i.mode,z=t.child,J=z.sibling,c=Ma(z,{mode:"hidden",children:c.children}),c.subtreeFlags=z.subtreeFlags&65011712,J!==null?A=Ma(J,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=Nd(l):(h=A.cachePool,h!==null?(z=Lt._currentValue,h=h.parent!==z?{parent:z,pool:z}:h):h=Zm(),A={baseLanes:A.baseLanes|l,cachePool:h}),c.memoizedState=A,c.childLanes=Rd(t,w,l),i.memoizedState=Td,$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 _d(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 Od(t,i,l){return Zi(i,t.child,null,l),t=_d(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function dy(t,i,l){t.lanes|=i;var c=t.alternate;c!==null&&(c.lanes|=i),Wu(t.return,i,l)}function Dd(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 fy(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&&dy(t,l,i);else if(t.tag===19)dy(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),Dd(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}Dd(i,!0,l,null,v,c);break;case"together":Dd(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 Md(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&us(t)))}function Ok(t,i,l){switch(i.tag){case 3:Ue(i,i.stateNode.containerInfo),si(i,Lt,t.memoizedState.cache),Vi();break;case 27:case 5:et(i);break;case 4:Ue(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,rd(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?uy(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 fy(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,iy(t,i,l,i.pendingProps);case 24:si(i,Lt,t.memoizedState.cache)}return Ba(t,i,l)}function py(t,i,l){if(t!==null)if(t.memoizedProps!==i.pendingProps)It=!0;else{if(!Md(t,l)&&(i.flags&128)===0)return It=!1,Ok(t,i,l);It=(t.flags&131072)!==0}else It=!1,We&&(i.flags&1048576)!==0&&Gm(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")Uu(t)?(c=er(t,c),i.tag=1,i=sy(null,i,t,c,l)):(i.tag=0,i=jd(null,i,t,c,l));else{if(t!=null){var h=t.$$typeof;if(h===F){i.tag=11,i=ty(null,i,t,c,l);break e}else if(h===W){i.tag=14,i=ny(null,i,t,c,l);break e}}throw i=B(t)||t,Error(r(306,i,""))}}return i;case 0:return jd(t,i,i.type,i.pendingProps,l);case 1:return c=i.type,h=er(c,i.pendingProps),sy(t,i,c,h,l);case 3:e:{if(Ue(i,i.stateNode.containerInfo),t===null)throw Error(r(387));c=i.pendingProps;var v=i.memoizedState;h=v.element,ed(t,i),Il(i,c,null,l);var w=i.memoizedState;if(c=w.cache,si(i,Lt,c),c!==v.cache&&Yu(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=cy(t,i,c,l);break e}else if(c!==h){h=Yn(Error(r(424)),i),Rl(h),i=cy(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=ig(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=Cv(i.type,null,i.pendingProps,null))?i.memoizedState=l:We||(l=i.type,t=i.pendingProps,c=Vs(he.current).createElement(l),c[we]=i,c[_e]=t,nn(c,l,t),At(c),i.stateNode=c):i.memoizedState=Cv(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return et(i),t===null&&We&&(c=i.stateNode=wv(i.type,i.pendingProps,he.current),Jt=i,Xn=!0,h=wt,wi(i.type)?(hf=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=s2(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,cf(h,v)?c=null:w!==null&&cf(h,w)&&(i.flags|=32),i.memoizedState!==null&&(h=od(t,i,kk,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=c2(l,i.pendingProps,Xn),l!==null?(i.stateNode=l,Jt=i,wt=null,t=!0):t=!1),t||oi(i)),null;case 13:return uy(t,i,l);case 4:return Ue(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 ty(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 ny(t,i,i.type,i.pendingProps,l);case 15:return ay(t,i,i.type,i.pendingProps,l);case 19:return fy(t,i,l);case 31:return _k(t,i,l);case 22:return iy(t,i,l,i.pendingProps);case 24:return Yi(i),c=en(Lt),t===null?(h=Xu(),h===null&&(h=ht,v=Ku(),h.pooledCache=v,v.refCount++,v!==null&&(h.pooledCacheLanes|=l),h=v),i.memoizedState={parent:c,cache:h},Ju(i),si(i,Lt,h)):((t.lanes&l)!==0&&(ed(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&&Yu(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 Ld(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(By())t.flags|=8192;else throw Xi=hs,Zu}else t.flags&=-16777217}function hy(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Nv(i))if(By())t.flags|=8192;else throw Xi=hs,Zu}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 Dk(t,i,l){var c=i.pendingProps;switch(qu(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,Gu())),St(i),null;case 26:var h=i.type,v=i.memoizedState;return t===null?(Ha(i),v!==null?(St(i),hy(i,v)):(St(i),Ld(i,h,null,c,l))):v?v!==t.memoizedState?(Ha(i),St(i),hy(i,v)):(St(i),i.flags&=-16777217):(t=t.memoizedProps,t!==c&&Ha(i),St(i),Ld(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)?Wm(i):(t=wv(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))Wm(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[we]=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),Ld(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[we]=i,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||uv(t.nodeValue,l)),t||oi(i,!0)}else t=Vs(t).createTextNode(c),t[we]=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[we]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;St(i),t=!1}else l=Gu(),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[we]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;St(i),h=!1}else h=Gu(),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&&af(i.stateNode.containerInfo),St(i),null;case 10:return Ia(i.type),St(i),null;case 19:if(X(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;)$m(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),id(),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&&X(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 Mk(t,i){switch(qu(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 X(Rt),null;case 4:return Ne(),null;case 10:return Ia(i.type),null;case 22:case 23:return On(i),id(),t!==null&&X(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 my(t,i){switch(qu(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:X(Rt);break;case 10:Ia(i.type);break;case 22:case 23:On(i),id(),t!==null&&X(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,J=A;try{J()}catch(re){st(h,z,re)}}}c=c.next}while(c!==v)}}catch(re){st(i,i.return,re)}}function gy(t){var i=t.updateQueue;if(i!==null){var l=t.stateNode;try{lg(i,l)}catch(c){st(t,t.return,c)}}}function yy(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 vy(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 zd(t,i,l){try{var c=t.stateNode;n2(c,t.type,l,i),c[_e]=i}catch(h){st(t,t.return,h)}}function xy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&wi(t.type)||t.tag===4}function Id(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||xy(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 Pd(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(Pd(t,i,l),t=t.sibling;t!==null;)Pd(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 by(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[we]=t,i[_e]=l}catch(v){st(t,t.return,v)}}var $a=!1,Pt=!1,Ud=!1,wy=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function Lk(t,i){if(t=t.containerInfo,of=Js,t=Dm(t),Ou(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,J=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&&++J===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(sf={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)df(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":df(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 Sy(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&&gy(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{lg(t,i)}catch(w){st(l,l.return,w)}}break;case 27:i===null&&c&4&&by(l);case 26:case 5:Fa(t,l),i===null&&c&4&&vy(l),c&512&&Gl(l,l.return);break;case 12:Fa(t,l);break;case 31:Fa(t,l),c&4&&Ey(t,l);break;case 13:Fa(t,l),c&4&&Ay(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Fk.bind(null,l),u2(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 ky(t){var i=t.alternate;i!==null&&(t.alternate=null,ky(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;)Cy(t,i,l),l=l.sibling}function Cy(t,i,l){if(Xe&&typeof Xe.onCommitFiberUnmount=="function")try{Xe.onCommitFiberUnmount(Ie,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,gv(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Qr(t)):gv(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"&&yy(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 Ey(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 Ay(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 zk(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new wy),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new wy),i;default:throw Error(r(435,t.tag))}}function Ds(t,i){var l=zk(t);i.forEach(function(c){if(!l.has(c)){l.add(c);var h=Gk.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));Cy(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;)jy(i,t),i=i.sibling}var oa=null;function jy(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[we]||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[we]=t,At(v),c=v;break e;case"link":var w=jv("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=jv("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[we]=t,At(v),c=v}t.stateNode=c}else Tv(h,t.type,t.stateNode);else t.stateNode=Av(h,c,t.memoizedProps);else v!==c?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,c===null?Tv(h,t.type,t.stateNode):Av(h,c,t.memoizedProps)):c===null&&t.stateNode!==null&&zd(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&&zd(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,zd(t,h,l!==null?l.memoizedProps:h)),c&1024&&(Ud=!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)}Ud&&(Ud=!1,Ty(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,J=$a,re=Pt;if($a=J||h,Pt=re||z,Sn(i,t),Pt=re,$a=J,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?yv(ae,!0):yv(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(xy(c)){l=c;break}c=c.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var h=l.stateNode,v=Id(t);Os(t,v,h);break;case 5:var w=l.stateNode;l.flags&32&&(xr(w,""),l.flags&=-33);var A=Id(t);Os(t,A,w);break;case 3:case 4:var z=l.stateNode.containerInfo,J=Id(t);Pd(t,J,z);break;default:throw Error(r(161))}}catch(re){st(t,t.return,re)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Ty(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Ty(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;)Sy(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"&&yy(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(J){st(c,c.return,J)}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++)rg(z[h],A)}catch(J){st(c,c.return,J)}}l&&w&64&&gy(v),Gl(v,v.return);break;case 27:by(v);case 26:case 5:Ga(h,v,l),l&&c===null&&w&4&&vy(v),Gl(v,v.return);break;case 12:Ga(h,v,l);break;case 31:Ga(h,v,l),l&&w&4&&Ey(h,v);break;case 13:Ga(h,v,l),l&&w&4&&Ay(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 Bd(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 Hd(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;)Ny(t,i,l,c),i=i.sibling}function Ny(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&&Bd(w,i);break;case 24:sa(t,i,l,c),h&2048&&Hd(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,J=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&&J&2048&&Bd(w.alternate,w);break;case 24:Ur(v,w,A,z,h),h&&J&2048&&Hd(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&&Bd(c.alternate,c);break;case 24:Vl(l,c),h&2048&&Hd(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;)Ry(t,i,l),t=t.sibling}function Ry(t,i,l){switch(t.tag){case 26:Br(t,i,l),t.flags&Wl&&t.memoizedState!==null&&S2(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 _y(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,Dy(c,t)}_y(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Oy(t),t=t.sibling}function Oy(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,Dy(c,t)}_y(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 Dy(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(ky(c),c===l){Kt=null;break e}if(h!==null){h.return=v,Kt=h;break e}Kt=v}}}var Ik={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}},Pk=typeof WeakMap=="function"?WeakMap:Map,tt=0,ht=null,He=null,Fe=0,ot=0,Dn=null,mi=!1,Hr=!1,$d=!1,Va=0,Tt=0,gi=0,nr=0,qd=0,Mn=0,$r=0,Kl=null,Cn=null,Fd=!1,Ls=0,My=0,zs=1/0,Is=null,yi=null,Ft=0,vi=null,qr=null,Wa=0,Gd=0,Vd=null,Ly=null,Ql=0,Wd=null;function Ln(){return(tt&2)!==0&&Fe!==0?Fe&-Fe:H.T!==null?Jd():Ye()}function zy(){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 Iy(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?Hk(t,i):Kd(t,i,!0),v=c;do{if(h===0){Hr&&!c&&xi(t,i,0,!1);break}else{if(l=t.current.alternate,v&&!Uk(l)){h=Kd(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=Kd(A,w,!1),w!==2){if($d&&!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=hv(Py.bind(null,c,l,Cn,Is,Fd,i,Mn,nr,$r,mi,v,"Throttled",-0,0),h);break e}Py(c,l,Cn,Is,Fd,i,Mn,nr,$r,mi,v,null,-0,0)}}break}while(!0);xa(t)}function Py(t,i,l,c,h,v,w,A,z,J,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},Ry(i,v,ce);var xe=(v&62914560)===v?Ls-it():(v&4194048)===v?My-it():0;if(xe=k2(ce,xe),xe!==null){Wa=v,t.cancelPendingCommit=xe(Vy.bind(null,t,i,v,l,c,h,w,A,z,re,ce,null,te,ae)),xi(t,v,w,!J);return}}Vy(t,i,v,l,c,h,w,A,z)}function Uk(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&=~qd,i&=~nr,t.suspendedLanes|=i,t.pingedLanes&=~i,c&&(t.warmLanes|=i),c=t.expirationTimes;for(var h=i;0<h;){var v=31-Se(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 Yd(){if(He!==null){if(ot===0)var t=He.return;else t=He,za=Wi=null,ud(t),Mr=null,Dl=0,t=He;for(;t!==null;)my(t.alternate,t),t=t.return;He=null}}function Fr(t,i){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,r2(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Wa=0,Yd(),ht=t,He=l=Ma(t.current,null),Fe=i,ot=0,Dn=null,mi=!1,Hr=Pi(t,i),$d=!1,$r=Mn=qd=nr=gi=Tt=0,Cn=Kl=null,Fd=!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-Se(c),v=1<<h;i|=t[h],c&=~v}return Va=i,rs(),l}function Uy(t,i){Me=null,H.H=Hl,i===Dr||i===ps?(i=tg(),ot=3):i===Zu?(i=tg(),ot=4):ot=i===Ad?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 By(){var t=_n.current;return t===null?!0:(Fe&4194048)===Fe?Zn===null:(Fe&62914560)===Fe||(Fe&536870912)!==0?t===Zn:!1}function Hy(){var t=H.H;return H.H=Hl,t===null?Hl:t}function $y(){var t=H.A;return H.A=Ik,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 Kd(t,i,l){var c=tt;tt|=2;var h=Hy(),v=$y();(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:Yd(),w=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(i=!0);var J=ot;if(ot=0,Dn=null,Gr(t,A,z,J),l&&Hr){w=0;break e}break;default:J=ot,ot=0,Dn=null,Gr(t,A,z,J)}}Bk(),w=Tt;break}catch(re){Uy(t,re)}while(!0);return i&&t.shellSuspendCounter++,za=Wi=null,tt=c,H.H=h,H.A=v,He===null&&(ht=null,Fe=0,rs()),w}function Bk(){for(;He!==null;)qy(He)}function Hk(t,i){var l=tt;tt|=2;var c=Hy(),h=$y();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(Jm(v)){ot=0,Dn=null,Fy(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:Jm(v)?(ot=0,Dn=null,Fy(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?Nv(w):A.stateNode.complete){ot=0,Dn=null;var z=A.sibling;if(z!==null)He=z;else{var J=A.return;J!==null?(He=J,Bs(J)):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:Yd(),Tt=6;break e;default:throw Error(r(462))}}$k();break}catch(re){Uy(t,re)}while(!0);return za=Wi=null,H.H=c,H.A=h,tt=l,He!==null?0:(ht=null,Fe=0,rs(),Tt)}function $k(){for(;He!==null&&!qn();)qy(He)}function qy(t){var i=py(t.alternate,t,Va);t.memoizedProps=t.pendingProps,i===null?Bs(t):He=i}function Fy(t){var i=t,l=i.alternate;switch(i.tag){case 15:case 0:i=oy(l,i,i.pendingProps,i.type,void 0,Fe);break;case 11:i=oy(l,i,i.pendingProps,i.type.render,i.ref,Fe);break;case 5:ud(i);default:my(l,i),i=He=$m(i,Va),i=py(l,i,Va)}t.memoizedProps=t.pendingProps,i===null?Bs(t):He=i}function Gr(t,i,l,c){za=Wi=null,ud(i),Mr=null,Dl=0;var h=i.return;try{if(Rk(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))),Gy(i,t)):Bs(i)}function Bs(t){var i=t;do{if((i.flags&32768)!==0){Gy(i,mi);return}t=i.return;var l=Dk(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 Gy(t,i){do{var l=Mk(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 Vy(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|=Iu,hu(t,l,v,w,A,z),t===ht&&(He=ht=null,Fe=0),qr=i,vi=t,Wa=l,Gd=v,Vd=h,Ly=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Vk(me,function(){return Xy(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=H.T,H.T=null,h=ee.p,ee.p=2,w=tt,tt|=4;try{Lk(t,i,l)}finally{tt=w,ee.p=h,H.T=c}}Ft=1,Wy(),Yy(),Ky()}}function Wy(){if(Ft===1){Ft=0;var t=vi,i=qr,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=H.T,H.T=null;var c=ee.p;ee.p=2;var h=tt;tt|=4;try{jy(i,t);var v=sf,w=Dm(t.containerInfo),A=v.focusedElem,z=v.selectionRange;if(w!==A&&A&&A.ownerDocument&&Om(A.ownerDocument.documentElement,A)){if(z!==null&&Ou(A)){var J=z.start,re=z.end;if(re===void 0&&(re=J),"selectionStart"in A)A.selectionStart=J,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 K=_m(A,je),q=_m(A,dt);if(K&&q&&(ae.rangeCount!==1||ae.anchorNode!==K.node||ae.anchorOffset!==K.offset||ae.focusNode!==q.node||ae.focusOffset!==q.offset)){var Z=ce.createRange();Z.setStart(K.node,K.offset),ae.removeAllRanges(),je>dt?(ae.addRange(Z),ae.extend(q.node,q.offset)):(Z.setEnd(q.node,q.offset),ae.addRange(Z))}}}}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=!!of,sf=of=null}finally{tt=h,ee.p=c,H.T=l}}t.current=i,Ft=2}}function Yy(){if(Ft===2){Ft=0;var t=vi,i=qr,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=H.T,H.T=null;var c=ee.p;ee.p=2;var h=tt;tt|=4;try{Sy(t,i.alternate,i)}finally{tt=h,ee.p=c,H.T=l}}Ft=3}}function Ky(){if(Ft===4||Ft===3){Ft=0,yn();var t=vi,i=qr,l=Wa,c=Ly;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ft=5:(Ft=0,qr=vi=null,Qy(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(yi=null),De(l),i=i.stateNode,Xe&&typeof Xe.onCommitFiberRoot=="function")try{Xe.onCommitFiberRoot(Ie,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=H.T,h=ee.p,ee.p=2,H.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{H.T=i,ee.p=h}}(Wa&3)!==0&&Hs(),xa(t),h=t.pendingLanes,(l&261930)!==0&&(h&42)!==0?t===Wd?Ql++:(Ql=0,Wd=t):Ql=0,Xl(0)}}function Qy(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,_l(i)))}function Hs(){return Wy(),Yy(),Ky(),Xy()}function Xy(){if(Ft!==5)return!1;var t=vi,i=Gd;Gd=0;var l=De(Wa),c=H.T,h=ee.p;try{ee.p=32>l?32:l,H.T=null,l=Vd,Vd=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,Oy(v.current),Ny(v,v.current,w,l),tt=A,Xl(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot=="function")try{Xe.onPostCommitFiberRoot(Ie,v)}catch{}return!0}finally{ee.p=h,H.T=c,Qy(t,i)}}function Zy(t,i,l){i=Yn(l,i),i=Ed(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)Zy(t,t,l);else for(;i!==null;){if(i.tag===3){Zy(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=Jg(2),c=di(i,l,2),c!==null&&(ey(l,c,i,t),Ui(c,2),xa(c));break}}i=i.return}}function Qd(t,i,l){var c=t.pingCache;if(c===null){c=t.pingCache=new Pk;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)||($d=!0,h.add(l),t=qk.bind(null,t,i,l),i.then(t,t))}function qk(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):qd|=l,$r===Fe&&($r=0)),xa(t)}function Jy(t,i){i===0&&(i=Vo()),t=Fi(t,i),t!==null&&(Ui(t,i),xa(t))}function Fk(t){var i=t.memoizedState,l=0;i!==null&&(l=i.retryLane),Jy(t,l)}function Gk(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),Jy(t,l)}function Vk(t,i){return ge(t,i)}var $s=null,Vr=null,Xd=!1,qs=!1,Zd=!1,bi=0;function xa(t){t!==Vr&&t.next===null&&(Vr===null?$s=Vr=t:Vr=Vr.next=t),qs=!0,Xd||(Xd=!0,Yk())}function Xl(t,i){if(!Zd&&qs){Zd=!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-Se(42|t)+1)-1,v&=h&~(w&~A),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,av(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,av(c,v));c=c.next}while(l);Zd=!1}}function Wk(){ev()}function ev(){qs=Xd=!1;var t=0;bi!==0&&i2()&&(t=bi);for(var i=it(),l=null,c=$s;c!==null;){var h=c.next,v=tv(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 tv(t,i){for(var l=t.suspendedLanes,c=t.pingedLanes,h=t.expirationTimes,v=t.pendingLanes&-62914561;0<v;){var w=31-Se(v),A=1<<w,z=h[w];z===-1?((A&l)===0||(A&c)!==0)&&(h[w]=pu(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),De(l)){case 2:case 8:l=le;break;case 32:l=me;break;case 268435456:l=I;break;default:l=me}return c=nv.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 nv(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:(Iy(t,c,i),tv(t,it()),t.callbackNode!=null&&t.callbackNode===l?nv.bind(null,t):null)}function av(t,i){if(Hs())return null;Iy(t,i,!0)}function Yk(){l2(function(){(tt&6)!==0?ge($,Wk):ev()})}function Jd(){if(bi===0){var t=_r;t===0&&(t=ti,ti<<=1,(ti&261888)===0&&(ti=256)),bi=t}return bi}function iv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Xo(""+t)}function rv(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 Kk(t,i,l,c,h){if(i==="submit"&&l&&l.stateNode===h){var v=iv((h[_e]||null).action),w=c.submitter;w&&(i=(i=w[_e]||null)?iv(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?rv(h,w):new FormData(h);xd(l,{pending:!0,data:z,method:h.method,action:v},null,z)}}else typeof v=="function"&&(A.preventDefault(),z=w?rv(h,w):new FormData(h),xd(l,{pending:!0,data:z,method:h.method,action:v},v,z))},currentTarget:h}]})}}for(var ef=0;ef<zu.length;ef++){var tf=zu[ef],Qk=tf.toLowerCase(),Xk=tf[0].toUpperCase()+tf.slice(1);la(Qk,"on"+Xk)}la(zm,"onAnimationEnd"),la(Im,"onAnimationIteration"),la(Pm,"onAnimationStart"),la("dblclick","onDoubleClick"),la("focusin","onFocus"),la("focusout","onBlur"),la(pk,"onTransitionRun"),la(hk,"onTransitionStart"),la(mk,"onTransitionCancel"),la(Um,"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(" "),Zk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zl));function lv(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,J=A.currentTarget;if(A=A.listener,z!==v&&h.isPropagationStopped())break e;v=A,h.currentTarget=J;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,J=A.currentTarget,A=A.listener,z!==v&&h.isPropagationStopped())break e;v=A,h.currentTarget=J;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)||(ov(i,t,2,!1),l.add(c))}function nf(t,i,l){var c=0;i&&(c|=4),ov(l,t,c,i)}var Fs="_reactListening"+Math.random().toString(36).slice(2);function af(t){if(!t[Fs]){t[Fs]=!0,vn.forEach(function(l){l!=="selectionchange"&&(Zk.has(l)||nf(l,!1,t),nf(l,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Fs]||(i[Fs]=!0,nf("selectionchange",!1,i))}}function ov(t,i,l,c){switch(zv(i)){case 2:var h=A2;break;case 8:h=j2;break;default:h=xf}l=h.bind(null,i,l,t),h=void 0,!ku||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 rf(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}fm(function(){var J=v,re=wu(l),ce=[];e:{var te=Bm.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=GS;break;case"focusin":xe="focus",ae=ju;break;case"focusout":xe="blur",ae=ju;break;case"beforeblur":case"afterblur":ae=ju;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=mm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=DS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=YS;break;case zm:case Im:case Pm:ae=zS;break;case Um:ae=QS;break;case"scroll":case"scrollend":ae=_S;break;case"wheel":ae=ZS;break;case"copy":case"cut":case"paste":ae=PS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=ym;break;case"toggle":case"beforetoggle":ae=ek}var je=(i&4)!==0,dt=!je&&(t==="scroll"||t==="scrollend"),K=je?te!==null?te+"Capture":null:te;je=[];for(var q=J,Z;q!==null;){var oe=q;if(Z=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Z===null||K===null||(oe=bl(q,K),oe!=null&&je.push(Jl(q,oe,Z))),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!==bu&&(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=J,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=J),ae!==xe)){if(je=mm,oe="onMouseLeave",K="onMouseEnter",q="mouse",(t==="pointerout"||t==="pointerover")&&(je=ym,oe="onPointerLeave",K="onPointerEnter",q="pointer"),dt=ae==null?te:sn(ae),Z=xe==null?te:sn(xe),te=new je(oe,q+"leave",ae,l,re),te.target=dt,te.relatedTarget=Z,oe=null,Ra(re)===J&&(je=new je(K,q+"enter",xe,l,re),je.target=Z,je.relatedTarget=dt,oe=je),dt=oe,ae&&xe)t:{for(je=Jk,K=ae,q=xe,Z=0,oe=K;oe;oe=je(oe))Z++;oe=0;for(var Ce=q;Ce;Ce=je(Ce))oe++;for(;0<Z-oe;)K=je(K),Z--;for(;0<oe-Z;)q=je(q),oe--;for(;Z--;){if(K===q||q!==null&&K===q.alternate){je=K;break t}K=je(K),q=je(q)}je=null}else je=null;ae!==null&&sv(ce,te,ae,je,!1),xe!==null&&dt!==null&&sv(ce,dt,xe,je,!0)}}e:{if(te=J?sn(J):window,ae=te.nodeName&&te.nodeName.toLowerCase(),ae==="select"||ae==="input"&&te.type==="file")var Ze=Em;else if(km(te))if(Am)Ze=uk;else{Ze=sk;var be=ok}else ae=te.nodeName,!ae||ae.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?J&&xu(J.elementType)&&(Ze=Em):Ze=ck;if(Ze&&(Ze=Ze(t,J))){Cm(ce,Ze,l,re);break e}be&&be(t,te,J),t==="focusout"&&J&&te.type==="number"&&J.memoizedProps.value!=null&&vu(te,"number",te.value)}switch(be=J?sn(J):window,t){case"focusin":(km(be)||be.contentEditable==="true")&&(kr=be,Du=J,Tl=null);break;case"focusout":Tl=Du=kr=null;break;case"mousedown":Mu=!0;break;case"contextmenu":case"mouseup":case"dragend":Mu=!1,Mm(ce,l,re);break;case"selectionchange":if(fk)break;case"keydown":case"keyup":Mm(ce,l,re)}var Le;if(Nu)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?wm(t,l)&&(Ge="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ge="onCompositionStart");Ge&&(vm&&l.locale!=="ko"&&(Sr||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&Sr&&(Le=pm()):(ii=re,Cu="value"in ii?ii.value:ii.textContent,Sr=!0)),be=Gs(J,Ge),0<be.length&&(Ge=new gm(Ge,t,null,l,re),ce.push({event:Ge,listeners:be}),Le?Ge.data=Le:(Le=Sm(l),Le!==null&&(Ge.data=Le)))),(Le=nk?ak(t,l):ik(t,l))&&(Ge=Gs(J,"onBeforeInput"),0<Ge.length&&(be=new gm("onBeforeInput","beforeinput",null,l,re),ce.push({event:be,listeners:Ge}),be.data=Le)),Kk(ce,t,J,l,re)}lv(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 Jk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function sv(t,i,l,c,h){for(var v=i._reactName,w=[];l!==null&&l!==c;){var A=l,z=A.alternate,J=A.stateNode;if(A=A.tag,z!==null&&z===c)break;A!==5&&A!==26&&A!==27||J===null||(z=J,h?(J=bl(l,v),J!=null&&w.unshift(Jl(l,J,z))):h||(J=bl(l,v),J!=null&&w.push(Jl(l,J,z)))),l=l.return}w.length!==0&&t.push({event:i,listeners:w})}var e2=/\r\n?/g,t2=/\u0000|\uFFFD/g;function cv(t){return(typeof t=="string"?t:""+t).replace(e2,`
|
|
50
|
+
`).replace(t2,"")}function uv(t,i){return i=cv(i),cv(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":um(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=NS.get(l)||l,un(t,l,c))}}function lf(t,i,l,c,h,v){switch(l){case"style":um(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,J=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":J=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)}}lm(t,v,A,z,J,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)}sm(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(J in l)if(l.hasOwnProperty(J)&&(c=l[J],c!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:ut(t,i,J,c,l,null)}return;default:if(xu(i)){for(re in l)l.hasOwnProperty(re)&&(c=l[re],c!==void 0&&lf(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 n2(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,J=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":J=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)}}yu(t,w,A,z,J,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)}om(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(J in c)if(te=c[J],ae=l[J],c.hasOwnProperty(J)&&te!==ae&&(te!=null||ae!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,i));break;default:ut(t,i,J,te,c,ae)}return;default:if(xu(i)){for(var dt in l)te=l[dt],l.hasOwnProperty(dt)&&te!==void 0&&!c.hasOwnProperty(dt)&&lf(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||lf(t,i,re,te,c,ae);return}}for(var K in l)te=l[K],l.hasOwnProperty(K)&&te!=null&&!c.hasOwnProperty(K)&&ut(t,i,K,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 dv(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function a2(){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&&dv(w)){for(w=0,A=h.responseEnd,c+=1;c<l.length;c++){var z=l[c],J=z.startTime;if(J>A)break;var re=z.transferSize,ce=z.initiatorType;re&&dv(ce)&&(z=z.responseEnd,w+=re*(z<A?1:(A-J)/(z-J)))}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 of=null,sf=null;function Vs(t){return t.nodeType===9?t:t.ownerDocument}function fv(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 pv(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 cf(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 uf=null;function i2(){var t=window.event;return t&&t.type==="popstate"?t===uf?!1:(uf=t,!0):(uf=null,!1)}var hv=typeof setTimeout=="function"?setTimeout:void 0,r2=typeof clearTimeout=="function"?clearTimeout:void 0,mv=typeof Promise=="function"?Promise:void 0,l2=typeof queueMicrotask=="function"?queueMicrotask:typeof mv<"u"?function(t){return mv.resolve(null).then(t).catch(o2)}:hv;function o2(t){setTimeout(function(){throw t})}function wi(t){return t==="head"}function gv(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 yv(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 df(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":df(l),yr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function s2(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 c2(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 vv(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 ff(t){return t.data==="$?"||t.data==="$~"}function pf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function u2(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 hf=null;function xv(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 bv(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 wv(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,Sv=new Set;function Ws(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ya=ee.d;ee.d={f:d2,r:f2,D:p2,C:h2,L:m2,m:g2,X:v2,S:y2,M:x2};function d2(){var t=Ya.f(),i=Ps();return t||i}function f2(t){var i=Yt(t);i!==null&&i.tag===5&&i.type==="form"?Ug(i):Ya.r(t)}var Wr=typeof document>"u"?null:document;function kv(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+'"]'),Sv.has(h)||(Sv.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 p2(t){Ya.D(t),kv("dns-prefetch",t,null)}function h2(t,i){Ya.C(t,i),kv("preconnect",t,i)}function m2(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 g2(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 y2(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))&&mf(t,l);var z=w=c.createElement("link");At(z),nn(z,"link",t),z._p=new Promise(function(J,re){z.onload=J,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 v2(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))&&gf(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 x2(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))&&gf(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 Cv(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||b2(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 Ev(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function b2(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 Av(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=Ev(l),(h=ea.get(h))&&mf(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),gf(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 mf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function gf(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 jv(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[we]||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 Tv(t,i,l){t=t.ownerDocument||t,t.head.insertBefore(l,i==="title"?t.querySelector("head > title"):null)}function w2(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 Nv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function S2(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=Ev(c),(h=ea.get(h))&&mf(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 yf=0;function k2(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&&yf===0&&(yf=62500*a2());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>yf?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(C2,t),Xs=null,Qs.call(t))}function C2(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:D,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function E2(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 Rv(t,i,l,c,h,v,w,A,z,J,re,ce){return t=new E2(t,i,l,w,z,J,re,ce,A),i=1,v===!0&&(i|=24),v=Rn(3,null,null,i),t.current=v,v.stateNode=t,i=Ku(),i.refCount++,t.pooledCache=i,i.refCount++,v.memoizedState={element:c,isDehydrated:l,cache:i},Ju(v),t}function _v(t){return t?(t=Ar,t):Ar}function Ov(t,i,l,c,h,v){h=_v(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 Dv(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<i?l:i}}function vf(t,i){Dv(t,i),(t=t.alternate)&&Dv(t,i)}function Mv(t){if(t.tag===13||t.tag===31){var i=Fi(t,67108864);i!==null&&En(i,t,67108864),vf(t,67108864)}}function Lv(t){if(t.tag===13||t.tag===31){var i=Ln();i=ke(i);var l=Fi(t,i);l!==null&&En(l,t,i),vf(t,i)}}var Js=!0;function A2(t,i,l,c){var h=H.T;H.T=null;var v=ee.p;try{ee.p=2,xf(t,i,l,c)}finally{ee.p=v,H.T=h}}function j2(t,i,l,c){var h=H.T;H.T=null;var v=ee.p;try{ee.p=8,xf(t,i,l,c)}finally{ee.p=v,H.T=h}}function xf(t,i,l,c){if(Js){var h=bf(c);if(h===null)rf(t,i,c,ec,l),Iv(t,c);else if(N2(h,t,i,l,c))c.stopPropagation();else if(Iv(t,c),i&4&&-1<T2.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-Se(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(),vf(v,2)}if(v=bf(c),v===null&&rf(t,i,c,ec,l),v===h)break;h=v}h!==null&&c.stopPropagation()}else rf(t,i,c,null,l)}}function bf(t){return t=wu(t),wf(t)}var ec=null;function wf(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 zv(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 Sf=!1,Si=null,ki=null,Ci=null,io=new Map,ro=new Map,Ei=[],T2="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 Iv(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&&Mv(i)),t):(t.eventSystemFlags|=c,i=t.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),t)}function N2(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 Pv(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(){Lv(l)});return}}else if(i===31){if(i=d(l),i!==null){t.blockedOn=i,lt(t.priority,function(){Lv(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=bf(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);bu=c,l.target.dispatchEvent(c),bu=null}else return i=Yt(l),i!==null&&Mv(i),t.blockedOn=l,!1;i.shift()}return!0}function Uv(t,i,l){tc(t)&&l.delete(i)}function R2(){Sf=!1,Si!==null&&tc(Si)&&(Si=null),ki!==null&&tc(ki)&&(ki=null),Ci!==null&&tc(Ci)&&(Ci=null),io.forEach(Uv),ro.forEach(Uv)}function nc(t,i){t.blockedOn===i&&(t.blockedOn=null,Sf||(Sf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,R2)))}var ac=null;function Bv(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(wf(c||l)===null)continue;break}var v=Yt(l);v!==null&&(t.splice(i,3),i-=3,xd(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);)Pv(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||Bv(l);else if(w){var A=null;if(v&&v.hasAttribute("formAction")){if(h=v,w=v[_e]||null)A=w.formAction;else if(wf(h)!==null)continue}else A=w.action;typeof A=="function"?l[c+1]=A:(l.splice(c,3),c-=3),Bv(l)}}}function Hv(){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 kf(t){this._internalRoot=t}ic.prototype.render=kf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(r(409));var l=i.current,c=Ln();Ov(l,c,t,i,null,null)},ic.prototype.unmount=kf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;Ov(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&&Pv(t)}};var $v=n.version;if($v!=="19.2.4")throw Error(r(527,$v,"19.2.4"));ee.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 _2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{Ie=rc.inject(_2),Xe=rc}catch{}}return so.createRoot=function(t,i){if(!o(t))throw Error(r(299));var l=!1,c="",h=Kg,v=Qg,w=Xg;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=Rv(t,1,!1,null,null,l,c,null,h,v,w,Hv),t[an]=i.current,af(t),new kf(i)},so.hydrateRoot=function(t,i,l){if(!o(t))throw Error(r(299));var c=!1,h="",v=Kg,w=Qg,A=Xg,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=Rv(t,1,!0,i,l??null,c,h,z,v,w,A,Hv),i.context=_v(null),l=i.current,c=Ln(),c=ke(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,af(t),new ic(i)},so.version="19.2.4",so}var Zv;function $2(){if(Zv)return Af.exports;Zv=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(),Af.exports=H2(),Af.exports}var q2=$2();/**
|
|
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 Jv="popstate";function e0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function F2(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 Rp("",{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 V2(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 G2(){return Math.random().toString(36).substring(2,10)}function t0(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 Rp(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||G2(),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 V2(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=e0(j)?j:Rp(C.location,j,E);f=y()+1;let D=t0(R,f),F=C.createHref(R.mask||R);try{u.pushState(D,"",F)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;o.location.assign(F)}s&&p&&p({action:d,location:C.location,delta:1})}function b(j,E){d="REPLACE";let R=e0(j)?j:Rp(C.location,j,E);f=y();let D=t0(R,f),F=C.createHref(R.mask||R);u.replaceState(D,"",F),s&&p&&p({action:d,location:C.location,delta:0})}function k(j){return W2(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(Jv,g),p=j,()=>{o.removeEventListener(Jv,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 W2(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 Ox(e,n,a="/"){return Y2(e,n,a,!1)}function Y2(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=K2(e),p=null,f=oC(u);for(let y=0;p==null&&y<d.length;++y)p=rC(d[y],f,r);return p}function K2(e){let n=Dx(e);return Q2(n),n}function Dx(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}".`),Dx(u.children,n,x,g,p)),!(u.path==null&&!u.index)&&n.push({path:g,score:aC(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 Mx(u.path))s(u,d,!0,f)}),n}function Mx(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=Mx(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 Q2(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:iC(n.routesMeta.map(r=>r.childrenIndex),a.routesMeta.map(r=>r.childrenIndex)))}var X2=/^:[\w-]+$/,Z2=3,J2=2,eC=1,tC=10,nC=-2,n0=e=>e==="*";function aC(e,n){let a=e.split("/"),r=a.length;return a.some(n0)&&(r+=nC),n&&(r+=J2),a.filter(o=>!n0(o)).reduce((o,s)=>o+(X2.test(s)?Z2:s===""?eC:tC),r)}function iC(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 rC(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:dC(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]=lC(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 lC(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 oC(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 sC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function cC(e,n="/"){let{pathname:a,search:r="",hash:o=""}=typeof e=="string"?sl(e):e,s;return a?(a=Lx(a),a.startsWith("/")?s=a0(a.substring(1),"/"):s=a0(a,n)):s=n,{pathname:s,search:fC(r),hash:pC(o)}}function a0(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 Rf(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 uC(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function sh(e){let n=uC(e);return n.map((a,r)=>r===n.length-1?a.pathname:a.pathnameBase)}function Jc(e,n,a,r=!1){let o;typeof e=="string"?o=sl(e):(o={...e},Et(!o.pathname||!o.pathname.includes("?"),Rf("?","pathname","search",o)),Et(!o.pathname||!o.pathname.includes("#"),Rf("#","pathname","hash",o)),Et(!o.search||!o.search.includes("#"),Rf("#","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=cC(o,d),f=u&&u!=="/"&&u.endsWith("/"),y=(s||u===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(f||y)&&(p.pathname+="/"),p}var Lx=e=>e.replace(/\/\/+/g,"/"),ua=e=>Lx(e.join("/")),_c=e=>e.replace(/\/+$/,""),dC=e=>_c(e).replace(/^\/*/,"/"),fC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,pC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,hC=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 mC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function gC(e){let n=e.map(a=>a.route.path).filter(Boolean);return ua(n)||"/"}var zx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ix(e,n){let a=e;if(typeof a!="string"||!sC.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let r=a,o=!1;if(zx)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 Px=["POST","PUT","PATCH","DELETE"];new Set(Px);var yC=["GET",...Px];new Set(yC);var cl=S.createContext(null);cl.displayName="DataRouter";var eu=S.createContext(null);eu.displayName="DataRouterState";var Ux=S.createContext(!1);function vC(){return S.useContext(Ux)}var Bx=S.createContext({isTransitioning:!1});Bx.displayName="ViewTransition";var xC=S.createContext(new Map);xC.displayName="Fetchers";var bC=S.createContext(null);bC.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 Hx="REACT_ROUTER_ERROR",wC="REDIRECT",SC="ROUTE_ERROR_RESPONSE";function kC(e){if(e.startsWith(`${Hx}:${wC}:{`))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 CC(e){if(e.startsWith(`${Hx}:${SC}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new hC(n.status,n.statusText,n.data)}catch{}}function EC(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 $x="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qx(e){S.useContext($n).static||S.useLayoutEffect(e)}function uh(){let{isDataRoute:e}=S.useContext(Ea);return e?PC():AC()}function AC(){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 qx(()=>{u.current=!0}),S.useCallback((p,f={})=>{if(fa(u.current,$x),!u.current)return;if(typeof p=="number"){a.go(p);return}let y=Jc(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(()=>Jc(e,JSON.parse(o),r,n==="path"),[e,o,r,n])}function jC(e,n){return Fx(e,n)}function Fx(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||"";Vx(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})):Ox(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=OC(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 TC(){let e=IC(),n=mC(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 NC=S.createElement(TC,null),Gx=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=CC(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(RC,{error:e},n):n}};Gx.contextType=Ux;var _f=new WeakMap;function RC({children:e,error:n}){let{basename:a}=S.useContext($n);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let r=kC(n.digest);if(r){let o=_f.get(n);if(o)throw o;let s=Ix(r.location,a);if(zx&&!_f.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 _f.set(n,u),u}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function _C({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 OC(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:gC(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||NC,u&&(d<0&&x===0?(Vx("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 D;return b?D=C:k?D=j:g.route.Component?D=S.createElement(g.route.Component,null):g.route.element?D=g.route.element:D=y,S.createElement(_C,{match:g,routeContext:{outlet:y,matches:E,isDataRoute:r!=null},children:D})};return r&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?S.createElement(Gx,{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 DC(e){let n=S.useContext(cl);return Et(n,dh(e)),n}function MC(e){let n=S.useContext(eu);return Et(n,dh(e)),n}function LC(e){let n=S.useContext(Ea);return Et(n,dh(e)),n}function fh(e){let n=LC(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 zC(){return fh("useRouteId")}function IC(){var r;let e=S.useContext(ch),n=MC("useRouteError"),a=fh("useRouteError");return e!==void 0?e:(r=n.errors)==null?void 0:r[a]}function PC(){let{router:e}=DC("useNavigate"),n=fh("useNavigate"),a=S.useRef(!1);return qx(()=>{a.current=!0}),S.useCallback(async(o,s={})=>{fa(a.current,$x),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...s}))},[e,n])}var i0={};function Vx(e,n,a){!n&&!i0[e]&&(i0[e]=!0,fa(!1,a))}S.memo(UC);function UC({routes:e,manifest:n,future:a,state:r,isStatic:o,onError:s}){return Fx(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=Jc(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 BC({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 HC({children:e,location:n}){return jC(_p(e),n)}function _p(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,_p(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=_p(r.props.children,s)),a.push(u)}),a}var wc="get",Sc="application/x-www-form-urlencoded";function tu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function $C(e){return tu(e)&&e.tagName.toLowerCase()==="button"}function qC(e){return tu(e)&&e.tagName.toLowerCase()==="form"}function FC(e){return tu(e)&&e.tagName.toLowerCase()==="input"}function GC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function VC(e,n){return e.button===0&&(!n||n==="_self")&&!GC(e)}var lc=null;function WC(){if(lc===null)try{new FormData(document.createElement("form"),0),lc=!1}catch{lc=!0}return lc}var YC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Of(e){return e!=null&&!YC.has(e)?(fa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sc}"`),null):e}function KC(e,n){let a,r,o,s,u;if(qC(e)){let d=e.getAttribute("action");r=d?Za(d,n):null,a=e.getAttribute("method")||wc,o=Of(e.getAttribute("enctype"))||Sc,s=new FormData(e)}else if($C(e)||FC(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=Of(e.getAttribute("formenctype"))||Of(d.getAttribute("enctype"))||Sc,s=new FormData(d,e),!WC()){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(tu(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 Wx(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 QC(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 XC(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 ZC(e,n,a){let r=await Promise.all(e.map(async o=>{let s=n.routes[o.route.id];if(s){let u=await QC(s,a);return u.links?u.links():[]}return[]}));return nE(r.flat(1).filter(XC).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function r0(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 JC(e,n,{includeHydrateFallback:a}={}){return eE(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 eE(e){return[...new Set(e)]}function tE(e){let n={},a=Object.keys(e).sort();for(let r of a)n[r]=e[r];return n}function nE(e,n){let a=new Set;return new Set(n),e.reduce((r,o)=>{let s=JSON.stringify(tE(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 aE(){let e=S.useContext(eu);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 iE(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 rE({page:e,...n}){let a=vC(),{router:r}=hh(),o=S.useMemo(()=>Ox(r.routes,e,r.basename),[r.routes,e,r.basename]);return o?a?S.createElement(oE,{page:e,matches:o,...n}):S.createElement(sE,{page:e,matches:o,...n}):null}function lE(e){let{manifest:n,routeModules:a}=gh(),[r,o]=S.useState([]);return S.useEffect(()=>{let s=!1;return ZC(e,n,a).then(u=>{s||o(u)}),()=>{s=!0}},[e,n,a]),r}function oE({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=Wx(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 sE({page:e,matches:n,...a}){let r=pa(),{future:o,manifest:s,routeModules:u}=gh(),{basename:d}=hh(),{loaderData:p,matches:f}=aE(),y=S.useMemo(()=>r0(e,n,f,s,r,"data"),[e,n,f,s,r]),g=S.useMemo(()=>r0(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 F;let D=s.routes[R.route.id];!D||!D.hasLoader||(!y.some(U=>U.route.id===R.route.id)&&R.route.id in p&&((F=u[R.route.id])!=null&&F.shouldRevalidate)||D.hasClientLoader?j=!0:C.add(R.route.id))}),C.size===0)return[];let E=Wx(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(()=>JC(g,s),[g,s]),k=lE(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 cE(...e){return n=>{e.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var uE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{uE&&(window.__reactRouterVersion="7.17.0")}catch{}function dE({basename:e,children:n,useTransitions:a,window:r}){let o=S.useRef();o.current==null&&(o.current=F2({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(BC,{basename:e,children:n,location:u.location,navigationType:u.action,navigator:s,useTransitions:a})}var Yx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kx=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),D=typeof y=="string"&&Yx.test(y),F=Ix(y,j);y=F.to;let U=EC(y,{relative:o}),_=pa(),W=null;if(d){let Q=Jc(d,[],_.mask?_.mask.pathname:"/",!0);j!=="/"&&(Q.pathname=Q.pathname==="/"?j:ua([j,Q.pathname])),W=E.createHref(Q)}let[P,M,T]=iE(r,k),G=mE(y,{replace:u,mask:d,state:p,target:f,preventScrollReset:g,relative:o,viewTransition:x,defaultShouldRevalidate:b,useTransitions:R});function Y(Q){n&&n(Q),Q.defaultPrevented||G(Q)}let ie=!(F.isExternal||s),B=S.createElement("a",{...k,...T,href:(ie?W:void 0)||F.absoluteURL||U,onClick:ie?Y:n,ref:cE(C,M),target:f,"data-discover":!D&&a==="render"?"true":void 0});return P&&!D?S.createElement(S.Fragment,null,B,S.createElement(rE,{page:U})):B});Kx.displayName="Link";var fE=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(eu),{navigator:k,basename:C}=S.useContext($n),j=b!=null&&bE(g)&&d===!0,E=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,R=x.pathname,D=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;a||(R=R.toLowerCase(),D=D?D.toLowerCase():null,E=E.toLowerCase()),D&&C&&(D=Za(D,C)||D);const F=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let U=R===E||!o&&R.startsWith(E)&&R.charAt(F)==="/",_=D!=null&&(D===E||!o&&D.startsWith(E)&&D.charAt(E.length)==="/"),W={isActive:U,isPending:_,isTransitioning:j},P=U?n:void 0,M;typeof r=="function"?M=r(W):M=[r,U?"active":null,_?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let T=typeof s=="function"?s(W):s;return S.createElement(Kx,{...f,"aria-current":P,className:M,ref:y,style:T,to:u,viewTransition:d},typeof p=="function"?p(W):p)});fE.displayName="NavLink";var pE=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=vE(),E=xE(d,{relative:f}),R=u.toLowerCase()==="get"?"get":"post",D=typeof d=="string"&&Yx.test(d),F=U=>{if(p&&p(U),U.defaultPrevented)return;U.preventDefault();let _=U.nativeEvent.submitter,W=(_==null?void 0:_.getAttribute("formmethod"))||u,P=()=>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(()=>P()):P()};return S.createElement("form",{ref:k,method:R,action:E,onSubmit:r?p:F,...b,"data-discover":!D&&e==="render"?"true":void 0})});pE.displayName="Form";function hE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qx(e){let n=S.useContext(cl);return Et(n,hE(e)),n}function mE(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(VC(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 gE=0,yE=()=>`__${String(++gE)}__`;function vE(){let{router:e}=Qx("useSubmit"),{basename:n}=S.useContext($n),a=zC(),r=e.fetch,o=e.navigate;return S.useCallback(async(s,u={})=>{let{action:d,method:p,encType:f,formData:y,body:g}=KC(s,n);if(u.navigate===!1){let x=u.fetcherKey||yE();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 xE(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 bE(e,{relative:n}={}){let a=S.useContext(Bx);Et(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Qx("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 wE=_x();const SE="modulepreload",kE=function(e){return"/ui/"+e},l0={},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=kE(f),f in l0)return;l0[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":SE,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)})},o0=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},CE=(e=>e?o0(e):o0),EE=e=>e;function AE(e,n=EE){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 s0=e=>{const n=CE(e),a=r=>AE(n,r);return Object.assign(a,n),a},ur=(e=>e?s0(e):s0),Xx="dkg-layout",jE=260,ba={leftCollapsed:!1,rightCollapsed:!1,bottomCollapsed:!0,leftSectionMyProjectsOpen:!0,leftSectionIntegrationsOpen:!1,leftWidth:240,rightWidth:360,bottomHeight:jE},Zx=140,Jx=400,eb=200,tb=500,nb=120,Oc=600,TE=240;function NE(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=NE("--header-h",44),n=typeof window<"u"&&window.innerHeight?window.innerHeight:0;if(!n)return Oc;const a=n-e-TE;return Math.max(0,Math.min(Oc,a))}function kc(e,n,a){return Math.max(n,Math.min(a,e))}function Df(e,n,a,r){return typeof e!="number"||!Number.isFinite(e)?n:kc(e,a,r)}function RE(){try{const e=localStorage.getItem(Xx);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:Df(n.leftWidth,ba.leftWidth,Zx,Jx),rightWidth:Df(n.rightWidth,ba.rightWidth,eb,tb),bottomHeight:Df(n.bottomHeight,ba.bottomHeight,nb,Oc)}}catch{return ba}}let oc=null;function Ka(e){oc&&clearTimeout(oc),oc=setTimeout(()=>{oc=null;try{localStorage.setItem(Xx,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=RE(),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,Zx,Jx)}),Ka(Qa(n()))},setRightWidth:a=>{e({rightWidth:kc(a,eb,tb)}),Ka(Qa(n()))},setBottomHeight:a=>{const r=Math.min(nb,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})})),_E=[{id:"dashboard",label:"Dashboard",closable:!1}],mn=ur((e,n)=>({tabs:_E,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 ab(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 OE(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 c0{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}delete(n){return this.entries.delete(n)}clear(){this.entries.clear()}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 DE=256,Op=64*1024,ME=4,LE=2*1024*1024;function zE(){return{small:new c0(DE,e=>e.length<=Op),large:new c0(ME,e=>e.length>Op&&e.length<=LE)}}class IE{constructor(){Gt(this,"tiers",zE())}tierFor(n){return n.length<=Op?"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 PE(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Dp(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||!Dp(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(!PE(p))return null;u=u*16+Number.parseInt(e[d],16)}return Dp(u)?{codePoint:u,rawWidth:2+o}:null}function ib(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 nu(e){return e===95||ib(e)}function UE(e){return nu(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 rb(e,n){return fl(e,n,ib)}function BE(e,n){return fl(e,n,nu)}function Mc(e,n){return fl(e,n,UE)}function Mp(e,n){return fl(e,n,a=>a>=48&&a<=57)}function HE(e){return nu(e)||e>=48&&e<=57}function $E(e){return nu(e)||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}function qE(e,n){return fl(e,n,HE)}function u0(e,n){return fl(e,n,$E)}function FE(e,n){const a=Bt(e,n);if(!a||a.codePoint!==63&&a.codePoint!==36)return null;let r=n+a.rawWidth;const o=qE(e,r);if(!o)return null;r+=o;let s=u0(e,r);for(;s;)r+=s,s=u0(e,r);return r}function GE(e,n,a){const r=Bt(e,n);return(r==null?void 0:r.codePoint)===a?r.rawWidth:0}function VE(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 GE(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 d0(e){return e>32&&e!==60&&e!==62&&e!==34&&e!==123&&e!==125&&e!==124&&e!==94&&e!==96&&e!==92}function WE(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||!Dp(p)||!d0(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(!d0(s.codePoint))return null;o.push(String.fromCodePoint(s.codePoint)),r+=s.rawWidth}return null}function YE(e,n){const a=Bt(e,n);return!a||a.codePoint!==60?null:WE(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 f0(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 lb(e,n){const a=Bt(e,n);if(!a)return 0;if(a.codePoint===37){const s=f0(e,n+a.rawWidth);if(!s)return 0;const u=f0(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 KE(e,n){return BE(e,n)||Mp(e,n)||Oo(e,n,58)||lb(e,n)}function QE(e,n){return Mc(e,n)||Oo(e,n,58)||lb(e,n)}function p0(e,n){let a=n,r=KE(e,a);if(!r)return a;a+=r;let o=a;for(;a<e.length;){if(r=QE(e,a),r){a+=r,o=a;continue}const s=Oo(e,a,46);if(s){a+=s;continue}break}return o}function XE(e,n){const a=rb(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 ZE(e){return/\s/u.test(String.fromCodePoint(e))}function Mf(e,n,a){for(let r=n;r<a;r++)e[r]=" "}function JE(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 Lf(e,n){let a=n,r=0,o=Mp(e,a);for(;o>0;)a+=o,r++,o=Mp(e,a);return{end:a,count:r}}function eA(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=Lf(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=Lf(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=Lf(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=JE(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 tA(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 nA(e,n){return!(n[n.length-1]==="("&&tA(e[e.length-1]))}function aA(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 iA(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 h0(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(ZE(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)),Mf(n,k,u);continue}if(f.codePoint===34||f.codePoint===39){const k=u,C=VE(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)),Mf(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&&nA(r,o)){const k=YE(e,u);if(k!==null){const C=u;u=k.end,a.push(e.slice(C,u)),Mf(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=FE(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=eA(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=p0(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=rb(e,u);if(g){const k=u,C=XE(e,u);let j;if(C)j="prefixed-name",u=p0(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),aA(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:iA(r)}}function m0(e){return{status:"malformed-uchar",source:e,masked:" ".repeat(e.length),materialized:e,tokens:[],unterminated:!1,wordTokens:new Set,prologue:{endTokenIndex:0,declaredPrefixes:[]}}}function rA(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 lA(e){const n=h0(e);if(n===null)return m0(e);if(n.materialized!==e){const a=h0(n.materialized);if(a===null||a.materialized!==n.materialized||!rA(n,a))return m0(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 zf(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 oA(e){const{tokens:n}=e,a=zf(n,"{","}"),r=zf(n,"(",")"),o=zf(n,"[","]");return Object.freeze({braces:a,parentheses:r,brackets:o,balanced:a.balanced&&r.balanced&&o.balanced})}function g0(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 ob(e){return(e==null?void 0:e.kind)==="iri"?e.logicalValue:null}function sA(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=ob(s);u!==null&&n.set(o.logicalValue.slice(0,-1),u),a+=2}return n}function cA(e,n){const{tokens:a}=e,r=[];let o=-1;for(const f of g0(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=g0(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 y0(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 uA(e){const n=oA(e),a=cA(e,n),r=e.tokens[e.prologue.endTokenIndex],o=sA(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=ob(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:y0(e,0,e.tokens.length),whereVariables:a?y0(e,a.openingTokenIndex+1,a.closingTokenIndex):[],prefixes:o,hasDatasetClause:f,hasGraphClause:u.length>0,graphTargets:u,graphVariables:d}}const dA=["SELECT","CONSTRUCT","ASK","DESCRIBE"],sb=["INSERT","DELETE","LOAD","CLEAR","DROP","CREATE","COPY","MOVE","ADD"],fA=[...sb,"WITH"],v0=new IE,pA=new Set(sb),hA=new Set(fA),mA=new Set(dA);function gA(e){const{operation:n}=e;return n===null?"UNKNOWN":cb(n)||ub(n)?n:"UNKNOWN"}function cb(e){return mA.has(e)}function ub(e){return hA.has(e)}function yA(e){return cb(e)?{kind:"read",form:e}:ub(e)?{kind:"update"}:{kind:"unknown"}}function If(e){return{operation:yA(e.form),mutatingKeyword:e.mutatingKeyword}}function x0(e){if(e.status!=="valid")return Object.freeze({facts:Object.freeze({form:"UNKNOWN",mutatingKeyword:null}),largeCacheable:!1});const n=uA(e),a=gA(n),r=e.tokens.find(o=>o.kind==="word"&&pA.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 vA(e){if(typeof e!="string")return If(x0(e).facts);const n=v0.get(e);if(n)return If(n.facts);const a=x0(lA(e));return v0.set(e,a),If(a.facts)}function xA(e){return vA(e).operation}const b0=(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)},BI=e=>Ht("/api/pca",{tokens:e.tokens,primaryNode:e.primaryNode}),HI=(e,n)=>Ht(`/api/pca/${encodeURIComponent(e)}/agent`,{agent:n}),$I=(e,n)=>OE(`/api/pca/${encodeURIComponent(e)}/agent/${encodeURIComponent(n)}`),qI=(e,n)=>Ht(`/api/pca/${encodeURIComponent(e)}/funds`,{tokens:n}),FI=e=>Ht(`/api/pca/${encodeURIComponent(e)}/settle`,{}),GI=e=>dl(`/api/pca/${encodeURIComponent(e)}/agents`),VI=e=>dl(`/api/pca/agent/${encodeURIComponent(e)}`),WI=e=>dl("/api/pca/mine?hydrate=1"),YI=e=>dl(`/api/pca/designatable-nodes${e!=null&&e.fresh?"?fresh=1":""}`),bA=()=>dl("/api/pca/contracts");function db(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 KI(e){return e instanceof gn&&e.status===503&&!db(e)}function QI(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 wA=["PrimaryNodeNotInShardingTable","PrimaryNodeUnchanged","PrimaryNodeChangeRateLimited","ZeroPrimaryNode","InvalidAmount","ZeroAgentAddress","TokenTransferFailed","NotAccountOwner","AgentAlreadyRegistered","AgentNotRegistered","AgentCapReached","AccountExpired","AccountAlreadyFullySettled","UnknownAccount"];function XI(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(db(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=wA.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 w0="did:dkg:context-graph:",fb=6e4;function pb(e){const n=e.trim();return n.startsWith(w0)?n.slice(w0.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 SA=()=>Qe("/api/status"),ZI=()=>Qe("/api/settings/retention"),JI=e=>xh("/api/settings/retention",{retentionDays:e}),e8=()=>Qe("/api/settings/telemetry"),t8=e=>xh("/api/settings/telemetry",{enabled:e}),kA=()=>Qe("/api/connections"),CA=(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()}),EA=(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()}),hb=()=>Qe("/api/agents"),AA=()=>Qe("/api/metrics"),n8=(e,n,a=300)=>Qe(`/api/metrics/history?from=${e}&to=${n}&maxPoints=${a}`),jA=(e={})=>{const n=new URLSearchParams({...e,phases:"1"}).toString();return Qe(`/api/operations?${n}`)},a8=e=>Qe(`/api/operations/${e}`),i8=e=>{const n=e?`?periodMs=${e}`:"";return Qe(`/api/error-hotspots${n}`)},r8=(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:""}`)},l8=e=>Qe(`/api/replication/summary${e?`?periodMs=${e}`:""}`),o8=e=>Qe(`/api/replication/per-cg${e?`?periodMs=${e}`:""}`),s8=(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:""}`)},c8=()=>Qe("/api/replication/cursors"),u8=(e,n=100)=>Qe(`/api/replication/events?cg=${encodeURIComponent(e)}&limit=${n}`),d8=e=>Qe(`/api/success-rates?periodMs=${e}`),f8=(e,n)=>{const a=`periodMs=${e}${n?`&bucketMs=${n}`:""}`;return Qe(`/api/per-type-stats?${a}`)},TA=(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 ab("/api/context-graph/list",fb)).contextGraphs??[]).filter(a=>!a.isSystem)}}const au=()=>Qe("/api/agent/identity");async function NA(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 p8=(e,n)=>Ht(`/api/context-graph/${encodeURIComponent(e)}/remove-participant`,{agentAddress:n}),RA=e=>Qe(`/api/context-graph/${encodeURIComponent(e)}/participants`),_A=e=>Ht(`/api/context-graph/${encodeURIComponent(e)}/sign-join`,{}),OA=(e,n)=>Ht(`/api/context-graph/${encodeURIComponent(e)}/request-join`,n),h8=e=>Qe(`/api/context-graph/${encodeURIComponent(e)}/join-requests`),DA=(e,n)=>Ht(`/api/context-graph/${encodeURIComponent(e)}/approve-join`,{agentAddress:n}),MA=(e,n)=>Ht(`/api/context-graph/${encodeURIComponent(e)}/reject-join`,{agentAddress:n}),LA={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 zA(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 LA[n]}async function IA(e,n,a,r){const o=new FormData;o.append("file",a),o.append("contextGraphId",n);const s=zA(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 PA(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=xA(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 Pf=new Map;function zc(e){const n=JSON.stringify(e),a=Pf.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 PA(await o.json(),String(e.sparql??""))})().finally(()=>{Pf.delete(n)});return Pf.set(n,r),r}const wh=(e,n={})=>zc({sparql:e,...n});async function m8(e){var s;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 u of((s=r==null?void 0:r.result)==null?void 0:s.bindings)??[]){const d=Pc(u.name),p=Pc(u.ual);d&&p&&!o[d]&&(o[d]=p)}return o}const g8=(e,n)=>Ht("/api/profile/query-catalog/write",{contextGraphId:e,quads:n}),y8=e=>Ht("/api/profile/query-catalog/read",{contextGraphId:e}),UA=new Set(["clearAfter","publishEpochs","publisherNodeIdentityIdOverride"]),BA=e=>{if(typeof e=="string"&&/^\d+$/.test(e))return e;throw new Error("publisherNodeIdentityIdOverride must be passed as a decimal string")},HA=(e,n=[])=>{if(!e)return;const a=Object.keys(e).filter(s=>!UA.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=BA(o)),Object.keys(r).length>0?r:void 0};function $A(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 qA=(e,n,a={})=>{const r=$A(a);return Ht(`/api/knowledge-assets/${encodeURIComponent(n)}/swm/share`,{contextGraphId:pb(e),...r.subGraphName?{subGraphName:r.subGraphName}:{},awaitCuratorAck:r.awaitCuratorAck})},FA=(e,n,a={})=>{const r=HA(a,["subGraphName"]);return Ht(`/api/knowledge-assets/${encodeURIComponent(n)}/vm/publish`,{contextGraphId:pb(e),...a.subGraphName?{subGraphName:a.subGraphName}:{},...r?{options:r}:{}})};async function v8(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 FA(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 x8(e,n="wm",a={}){var R,D,F,U,_,W;const r=a.includeQueryCatalog??!1,o=(P,M)=>P!=="meta"||r&&M.startsWith("query-catalog-");if(n==="swm"){const P=`did:dkg:context-graph:${e}/_meta`,M=`did:dkg:context-graph:${e}/`,T=`urn:dkg:assertion:${e}:`,Y=`SELECT ?g ?vm WHERE {
|
|
68
|
+
GRAPH <${P}> {
|
|
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
|
+
}`,ie=await wh(Y,{contextGraphId:e}),B=((R=ie==null?void 0:ie.result)==null?void 0:R.bindings)??[],Q=new Set,H=[];for(const V of B){const O=typeof V.g=="string"?V.g:(D=V.g)==null?void 0:D.value;if(!O)continue;const L=typeof V.vm=="string"?V.vm:(F=V.vm)==null?void 0:F.value;let X,N;if(O.startsWith(M)){const pe=O.slice(M.length).split("/");if(pe.length===3&&pe[0]==="assertion")N=pe[2];else if(pe.length===4&&pe[1]==="assertion")X=pe[0],N=pe[3];else continue}else if(O.startsWith(T)){const pe=O.slice(T.length);let he=/^(0x[0-9a-fA-F]{40}):(.+)$/.exec(pe);he?N=he[2]:(he=/^([^:]+):(0x[0-9a-fA-F]{40}):(.+)$/.exec(pe),he&&(X=he[1],N=he[3]))}else continue;if(!N||!o(X,N))continue;const ue=`${X??""} ${N}`;H.push({key:ue,name:N,subGraph:X,g:O}),L&&Q.add(ue)}const ee=new Set,ne=[];for(const V of H)Q.has(V.key)||ee.has(V.key)||(ee.add(V.key),ne.push({name:V.name,graphUri:V.g,subGraph:V.subGraph}));return ne}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 P of((_=g==null?void 0:g.result)==null?void 0:_.bindings)??[]){const M=Pc(P.g),T=Pc(P.cnt),G=typeof T=="string"?T.match(/^"?(\d+)/):null,Y=G?parseInt(G[1],10):NaN;M&&Number.isFinite(Y)&&b.set(M,Y)}const k=[],C=new Set,j=`urn:dkg:assertion:${e}:`,E=[...x].sort((P,M)=>{var Y,ie;const T=(typeof P.g=="string"?P.g:(Y=P.g)==null?void 0:Y.value)??"",G=(typeof M.g=="string"?M.g:(ie=M.g)==null?void 0:ie.value)??"";return(T.startsWith(u)?0:1)-(G.startsWith(u)?0:1)});for(const P of E){const M=typeof P.g=="string"?P.g:(W=P.g)==null?void 0:W.value;if(!M)continue;let T,G;if(M.startsWith(u)){const B=M.slice(u.length).split("/");if(B.length===3&&B[0]==="assertion")G=B[2];else if(B.length===4&&B[1]==="assertion")T=B[0],G=B[3];else continue}else if(M.startsWith(j)){const B=M.slice(j.length);let Q=/^(0x[0-9a-fA-F]{40}):(.+)$/.exec(B);Q?G=Q[2]:(Q=/^([^:]+):(0x[0-9a-fA-F]{40}):(.+)$/.exec(B),Q&&(T=Q[1],G=Q[3]))}else continue;if(!G||!o(T,G))continue;const Y=`${T??""}\0${G}`;if(C.has(Y))continue;C.add(Y);const ie=b.get(M);k.push({name:G,graphUri:M,tripleCount:ie,subGraph:T})}return k}const b8=(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 qA(e,n,o)};function w8(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 S8(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 k8=(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 GA(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 C8="binding incomplete";function E8(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 VA=(e=20)=>Qe(`/api/memory/sessions?limit=${e}`),WA=(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 mb(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 YA(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(mb(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 KA=()=>Qe("/api/openclaw-channel/health");async function gb(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(mb(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 QA=(e,n={})=>gb("/api/hermes-channel/stream",e,n),XA=()=>Qe("/api/hermes-channel/health"),ZA=(e,n={})=>gb("/api/prime-agent-channel/stream",e,n),JA=()=>Qe("/api/prime-agent-channel/health");function ej(e){return{...e,detected:typeof e.detected=="boolean"?e.detected:e.ready===!0}}const tj=async()=>ej(await Qe("/api/local-llm/health"));async function nj(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 aj(e,n={}){var r;const a=await nj(e,n);return(r=n.onEvent)==null||r.call(n,{type:"final",...a}),a}const ij=()=>Ht("/api/local-llm/session/clear",{});function rj(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=rj(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 iu={"local-llm":{connectSupported:!1,chatSupported:!0,defaultSessionId:()=>"local-llm:dkg-ui",resolveChatContext:()=>({}),fetchHealth:tj,isVisible:({health:e})=>e===null||e.configured!==!1||e.detected===!0,streamChat:aj},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:KA,streamChat:YA},hermes:{connectSupported:!0,chatSupported:!0,defaultSessionId:({integrationId:e,record:n,health:a})=>uj(e,n,a),resolveChatContext:({sessionId:e,profile:n})=>({...e?{sessionId:e}:{},...n?{profile:n}:{}}),fetchHealth:XA,streamChat:QA},"prime-agent":{connectSupported:!0,chatSupported:!0,defaultSessionId:({record:e,health:n})=>fj(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:JA,streamChat:ZA}};function rr(e){var a,r;const n=e.trim().toLowerCase();return((r=(a=iu[n])==null?void 0:a.defaultSessionId)==null?void 0:r.call(a,{integrationId:n}))??null}function lj(e,n){return n!=null&&n.trim()?n.trim():rr(e)}async function oj(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 WA(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 sj(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 cj(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 uj(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:dj(n),d=[o?`profile-${cj(o)}`:null,s?`home-${Sh(s)}`:null,u].filter(p=>p!=null);return d.length?`${e}:dkg-ui:${d.join(":")}`:`${e}:dkg-ui`}function dj(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 fj(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 pj(e){return e?typeof e=="string"?e:[e.provider,e.mode,e.status].filter(Boolean).join(" / ")||null:null}function hj(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 yb(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function S0(e){if(!yb(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 mj(e){if(e.target==="bridge")return{target:"bridge",details:e.bridge};if(e.target==="gateway")return{target:"gateway",details:e.gateway};const n=S0(e.bridge),a=S0(e.gateway);return n<0&&a<0?{}:n>=a?{target:"bridge",details:e.bridge}:{target:"gateway",details:e.gateway}}function gj(e){if(!e)return null;const{target:n,details:a}=mj(e);if(!yb(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 yj(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=pj(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,P,M,T,G,Y,ie,B,Q,H,ee,ne,V,O,L,X,N;const n=String(e.id??"").toLowerCase(),a=iu[n],r=((W=e.capabilities)==null?void 0:W.localChat)===!0&&(a==null?void 0:a.chatSupported)===!0,o=r&&((P=e.capabilities)==null?void 0:P.chatAttachments)===!0,s=((M=e.capabilities)==null?void 0:M.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)?gj(await a.fetchHealth().catch(()=>null)):null;if(((G=a==null?void 0:a.isVisible)==null?void 0:G.call(a,{health:p}))===!1)return null;const f=hj(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"||((Y=e.runtime)==null?void 0:Y.ready)===!0||sj(e)),k=yj(e,p),C=(ie=a==null?void 0:a.defaultSessionId)==null?void 0:ie.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(ue=>typeof(ue==null?void 0:ue.rawSessionId)=="string"&&ue.rawSessionId.trim()&&typeof ue.memorySessionId=="string"&&ue.memorySessionId.trim()).map(ue=>({...ue,sessionId:ue.memorySessionId.trim(),rawSessionId:ue.rawSessionId.trim()})):void 0,R=n==="hermes"?Ic(p==null?void 0:p.profile,(B=e.metadata)==null?void 0:B.profileName,(Q=e.metadata)==null?void 0:Q.profile)??void 0:void 0;let D,F,U;b&&f?(D="degraded",F="Degraded",U=k??(p==null?void 0:p.error)??((H=e.runtime)==null?void 0:H.lastError)??`${e.name} is attached to this node, but one capability is degraded.`):b&&((ee=e.runtime)==null?void 0:ee.status)==="connecting"?(D="connecting",F="Connecting",U=((ne=e.runtime)==null?void 0:ne.lastError)??`${e.name} is registered and still starting up.`):g?(D="chat_ready",F=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?(D="bridge_offline",F="Bridge offline",U=k??(p==null?void 0:p.error)??((V=e.runtime)==null?void 0:V.lastError)??`${e.name} is attached to this node, but it is not responding right now.`):a?(D="available",F=s?"Ready to connect":"Awaiting chat bridge",U=u?`${e.name} is registered, but this panel is waiting for the framework chat bridge.`:((O=e.runtime)==null?void 0:O.lastError)??`Use the node-served skill plus ${e.name} onboarding to attach an existing local agent.`):(D="coming_soon",F=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":D==="connecting"?"Connecting":D==="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||(p==null?void 0:p.detected)===!0||y,persistentChat:b,chatReady:y,bridgeOnline:g,bridgeStatusLabel:_,status:D,statusLabel:F,detail:U,error:y?void 0:(p==null?void 0:p.error)??((L=e.runtime)==null?void 0:L.lastError)??void 0,target:p==null?void 0:p.target,source:u||a?"live":"planned",...typeof((X=e.metadata)==null?void 0:X.sessionCount)=="number"?{sessionCount:e.metadata.sessionCount}:{},...typeof((N=e.metadata)==null?void 0:N.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 ru(){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 vj(e){const n=e.trim().toLowerCase(),a=iu[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 ru()).integrations.find(s=>s.id===n);if(!o)throw new Error(`Missing local agent integration: ${n}`);return{integration:o,notice:r.notice}}async function xj(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 bj(e){const n=e.trim().toLowerCase(),a=await Ht(`/api/local-agent-integrations/${encodeURIComponent(n)}/refresh`,{}),r=a.integration?await kh(a.integration):(await ru()).integrations.find(o=>o.id===n);if(!r)throw new Error(`Missing local agent integration: ${n}`);return{integration:r,notice:a.notice}}async function k0(e,n=50,a={}){if(e.trim().toLowerCase()==="local-llm")return[];const r=lj(e,a.sessionId);return r?oj(r,n):[]}async function wj(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 Sj(e,n){if(e.trim().toLowerCase()==="hermes")return wj(n);throw new Error(`${e} local chat persistence is not available yet.`)}async function kj(e,n,a={}){const r=e.trim().toLowerCase(),o=iu[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.`)}function Pc(e){if(e!=null){if(typeof e=="object"&&"value"in e)return String(e.value);if(typeof e=="string"){let n=e;const a=n.match(/^(".*")\^\^<[^>]+>$/);a&&(n=a[1]);const r=n.match(/^(".*")@[a-z-]+$/i);return r&&(n=r[1]),n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1).replace(/\\"/g,'"').replace(/\\n/g,`
|
|
91
|
+
`).replace(/\\r/g,"\r").replace(/\\t/g," "):e}return String(e)}}const Cj=()=>Qe("/api/economics"),vb=()=>Qe("/api/wallets/balances"),A8=()=>Ht("/api/shutdown",{}),Ej=(e,n)=>Ht("/api/subscribe",{contextGraphId:e,syncMode:(n==null?void 0:n.syncMode)??"on-demand"}),Aj=()=>Qe("/api/notifications"),xb=e=>Ht("/api/notifications/read",e?{ids:e}:{}),jj=e=>ab(`/api/sub-graph/list?contextGraphId=${encodeURIComponent(e)}`,fb),Tj={name:"my-dkg-node",networkName:"DKG Mainnet",connectedPeers:12,synced:!0,version:"10.0.0-rc"},Nj={total_kcs:1842,confirmed_kcs:1623,tentative_kcs:219},Rj={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}]},_j={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"}]},Oj={"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:[]}},Dj={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},Mj={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}]},Lj={agentAddress:"0x1111111111111111111111111111111111111111",agentDid:"did:dkg:agent:0x1111111111111111111111111111111111111111",name:"mock-node-agent",framework:"mock",peerId:"QmMockNodeAgentPeer000000000000000000000000",nodeIdentityId:"mock-node-identity"},zj={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"},Ij={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},Pj={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},Uj={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"}]}]},Bj={"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(Tj),fetchMetrics:()=>zn(Nj),fetchAgents:()=>zn(Rj),fetchContextGraphs:()=>zn(_j),fetchOperationsWithPhases:()=>zn(Dj),fetchEconomics:()=>zn(Mj),fetchWalletsBalances:()=>zn(zj),fetchCurrentAgent:()=>zn(Lj),listParticipants:e=>zn(Oj[e]??{contextGraphId:e,allowedAgents:[]}),fetchSubGraphs:e=>zn(Bj[e]??{contextGraphId:e,subGraphs:[]}),fetchNotificationsFeed:()=>zn(Ij),fetchNodeLog:()=>zn(Pj),fetchMemorySessions:()=>zn(Uj)};let Xa=null,fo=null;const Hj=5e3,C0=2,$j=250,Lp=new Set;function qj(){return Xa===!0}function Fj(e){return Lp.add(e),e(Xa===!0),()=>{Lp.delete(e)}}function Gj(){if(typeof window>"u")return{};const e=window.__DKG_TOKEN__;return e?{Authorization:`Bearer ${e}`}:{}}function Vj(e){return new Promise(n=>setTimeout(n,e))}async function Wj(){for(let e=1;e<=C0;e+=1){try{const n=await fetch("/api/status",{cache:"no-store",headers:Gj(),signal:AbortSignal.timeout(Hj)});if(n.ok||n.status===401)return!1}catch{}e<C0&&await Vj($j)}return!0}async function Yj(){if(Xa!==null)return Xa;if(fo)return fo;fo=(async()=>(Xa=await Wj(),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.")),Lp.forEach(e=>e(Xa)),Xa))();try{return await fo}finally{fo=null}}async function Pn(e,n){return await Yj()?n():e()}const Bn={fetchStatus:()=>Pn(SA,In.fetchStatus),fetchMetrics:()=>Pn(AA,In.fetchMetrics),fetchAgents:()=>Pn(hb,In.fetchAgents),fetchContextGraphs:()=>Pn(bh,In.fetchContextGraphs),fetchOperationsWithPhases:e=>Pn(()=>jA(e),In.fetchOperationsWithPhases),fetchEconomics:()=>Pn(Cj,In.fetchEconomics),fetchWalletsBalances:()=>Pn(vb,In.fetchWalletsBalances),fetchCurrentAgent:()=>Pn(au,In.fetchCurrentAgent),listParticipants:e=>Pn(()=>RA(e),()=>In.listParticipants(e)),fetchSubGraphs:e=>Pn(()=>jj(e),()=>In.fetchSubGraphs(e)),fetchNotificationsFeed:()=>Pn(Aj,In.fetchNotificationsFeed),fetchNodeLog:e=>Pn(()=>TA(e),In.fetchNodeLog),fetchMemorySessions:e=>Pn(()=>VA(e),In.fetchMemorySessions),markNotificationsRead:xb,executeQuery:wh},Kj=6e4;let Di={data:null,loading:!0,error:null},Sa=null,Co=null,ko=0,Oi="";const Uc=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 Uf(){const e=lr();return e!==Oi&&Cc(e),Di}function Ec(){for(const e of Uc)e()}function Bf(e){Di=e,Ec()}function Bc(){const e=ko,n=lr();if((Sa==null?void 0:Sa.authKey)===n)return Sa.promise;n!==Oi?(Cc(n),Ec()):Bf({...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&&Bc();return}Bf({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&&Bc();return}Bf({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 Qj(){Bc(),!Co&&(Co=setInterval(()=>{Bc()},Kj))}function Xj(){Uc.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(Uf);return S.useEffect(()=>{const a=()=>n(Uf());return Uc.add(a),n(Uf()),Qj(),()=>{Uc.delete(a),Xj()}},[]),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 Zj=350;function E0(e){return e==="wm"||e==="swm"||e==="vm"}function Jj(e){const n=e.layers;return Array.isArray(n)?n.filter(E0):E0(e.layer)?[e.layer]:[]}function eT(e,n,a){if(!n||e.contextGraphId!==n)return!1;if(!a||a.length===0)return!0;const r=Jj(e);return r.length===0?!0:a.some(o=>r.includes(o))}function bb(){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(bb,3e3))}}function tT(){Ac&&(clearTimeout(Ac),Ac=null),Qt==null||Qt.close(),Qt=null}function nT(e){return tl.add(e),tl.size===1&&bb(),()=>{tl.delete(e),tl.size===0&&tT()}}function pl(e){const n=S.useRef(e);n.current=e,S.useEffect(()=>nT(a=>n.current(a)),[])}function aT(e,n,a={}){var p;const r=S.useRef(n),o=S.useRef(null);r.current=n;const s=a.debounceMs??Zj,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"&&eT(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 iT="No pending join request found";function rT(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 lT(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 A0(e){return e.filter(n=>n.type!=="join_request"&&n.read===0).map(n=>n.id)}function j0(e){const n=e instanceof Error?e.message:String(e);if(n.includes(iT))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 oT(){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(D=>{u.current=!0,n(D),s(!1),r(D.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(D=>{D.type==="notification"&&f()},[f]));const y=S.useMemo(()=>rT((e==null?void 0:e.notifications)??[]),[e]),g=S.useMemo(()=>lT((e==null?void 0:e.notifications)??[]),[e]),x=(e==null?void 0:e.badgeCount)??0,b=S.useMemo(()=>A0((e==null?void 0:e.notifications)??[]).length>0,[e]),k=S.useCallback(D=>{D.length!==0&&(n(F=>{if(!F)return F;const U=new Set(D.map(String));return{...F,notifications:F.notifications.map(_=>U.has(String(_.id))?{..._,read:1}:_)}}),xb(D).then(d).catch(()=>{}))},[d]),C=S.useCallback(()=>{k(A0((e==null?void 0:e.notifications)??[]))},[e,k]),j=S.useCallback(async(D,F)=>{try{return await DA(D,F),d(),{ok:!0}}catch(U){const _=j0(U);return _.ok&&_.alreadyHandled&&d(),_}},[d]),E=S.useCallback(async(D,F)=>{try{return await MA(D,F),d(),{ok:!0}}catch(U){const _=j0(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 sT="dkg-pca",cT=150;function uT(e){return[String(e.chainId).toLowerCase(),e.nft.toLowerCase(),e.token.toLowerCase()].join(":")}function Ri(e){return e?`${sT}:${e}`:null}const Hf={trackedIds:[],createPending:null,topUpPending:{}};function Eo(e){return typeof e=="string"&&/^\d+$/.test(e)}function dT(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 fT(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 pT(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 wb(e){const n=Ri(e);if(!n)return{...Hf};try{const a=localStorage.getItem(n);if(!a)return{...Hf};const r=JSON.parse(a);return{trackedIds:dT(r.trackedIds),createPending:fT(r.createPending),topUpPending:pT(r.topUpPending)}}catch{return{...Hf}}}let Ca=null;function sc(e,n){e&&(Ca&&clearTimeout(Ca),Ca=setTimeout(()=>{Ca=null;try{localStorage.setItem(e,JSON.stringify(n))}catch{}},cT))}function $f(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=wb(null),zp=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=wb(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=$f(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}})),$f(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})),$f(Ri(n().scopeKey),ar(n()))}}));function qf(e){if(!e)return!1;try{return BigInt(e)>0n}catch{return!1}}function Sb(e,n=Math.floor(Date.now()/1e3)){const{expiresAtTimestamp:a}=e;return typeof a=="number"&&a>0&&n>=a}function kb(e,n){return Sb(e,n)||!!e.fullySwept}function Eh(e){return qf(e.topUpBuffer)?!0:e.remainingAllowance!==void 0?qf(e.remainingAllowance):e.extendedRequested?null:qf(e.baseEpochAllowance)}function hT(e){return Eh(e)===!0}function mT(e){return e.remainingAllowance!==void 0&&Eh(e)===!1}const Cb=90,Eb=10080*60;function gT(e,n=Math.floor(Date.now()/1e3)){const{expiresAtTimestamp:a,fullySwept:r,agentCount:o}=e,s=typeof a=="number"&&a>0;return Sb(e,n)?"expired":r?"swept":mT(e)?"insolvent":typeof o=="number"&&o>=Cb?"cap-near":s&&a-n<=Eb?"expiring":"healthy"}function yT(e,n){return!kb(e,n)&&hT(e)}function vT(e){return(e==null?void 0:e.adapterSupported)===!1?null:(e==null?void 0:e.registered)??null}function xT(e,n){var u;const a=vT(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=kb(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 T0=(e,n)=>!!e&&!!n&&e.toLowerCase()===n.toLowerCase();async function bT(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 b0(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=>b0(e,f,{extended:!0}).then(y=>({wallet:f,registered:xT(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=>T0(f,r.owner))?"owned":s>0?"approved":"unknown";return{accountId:e,snapshot:r,error:null,notFound:!1,classification:p,ownerIsPrimaryWallet:T0(n[0],r.owner),health:gT(r),walletProbes:o,approvedCount:s,walletCount:n.length,probesInconclusive:u}}const nl=new Map;function N0(e){for(const n of e.subs)n()}async function Hc(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,N0(e);return}try{const a=await vb().catch(()=>null),r=(a==null?void 0:a.wallets)??[],o=!a||!!a.error,s=await Promise.all(e.ids.map(u=>bT(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,N0(e))}}function Ff(e){e.timer||e.intervalMs<=0||typeof document<"u"&&document.hidden||(e.timer=setInterval(()=>Hc(e),e.intervalMs))}function Gf(e){e.timer&&(clearInterval(e.timer),e.timer=null)}function wT(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?Gf(u):(Hc(u),Ff(u)))};o.onVisibility=d,typeof document<"u"&&document.addEventListener("visibilitychange",d),Hc(o),Ff(o)}else a<o.intervalMs&&(o.intervalMs=a,Gf(o),Ff(o));return()=>{const u=nl.get(e);u&&(u.subs.delete(r),u.subs.size===0&&(Gf(u),u.onVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",u.onVisibility),nl.delete(e)))}}const ST=[];function Ab(e=3e4,n=[]){var C,j,E;const a=zp(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(()=>wT(s,o,e,u),[s,e]);const d=nl.get(s),p=((C=d==null?void 0:d.data)==null?void 0:C.accounts)??ST,f=d?d.loading:!0,y=(d==null?void 0:d.error)??null,{bestCoveringDiscountBps:g,covered:x}=S.useMemo(()=>{let R=null;for(const D of p){if(!D.snapshot||D.approvedCount<=0||!yT(D.snapshot))continue;const F=D.snapshot.discountBps;typeof F=="number"&&(R==null||F>R)&&(R=F)}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&&Hc(R)},bestCoveringDiscountBps:g,covered:x}}let Vf=null;function jb(){const e=zp(a=>a.scopeKey),n=zp(a=>a.setScope);S.useEffect(()=>{e||Vf||(Vf=bA().then(a=>{n(uT(a))}).catch(()=>{}).finally(()=>{Vf=null}))},[e,n])}function kT(){jb();const{accounts:e}=Ab(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<=Eb&&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>=Cb&&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"})}/**
|
|
92
|
+
* @license lucide-react v1.14.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const Tb=(...e)=>e.filter((n,a,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===a).join(" ").trim();/**
|
|
97
|
+
* @license lucide-react v1.14.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const CT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
102
|
+
* @license lucide-react v1.14.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const ET=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,r)=>r?r.toUpperCase():a.toLowerCase());/**
|
|
107
|
+
* @license lucide-react v1.14.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const R0=e=>{const n=ET(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
|
|
112
|
+
* @license lucide-react v1.14.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/var Wf={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"};/**
|
|
117
|
+
* @license lucide-react v1.14.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const AT=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},jT=S.createContext({}),TT=()=>S.useContext(jT),NT=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=""}=TT()??{},k=r??g?Number(a??y)*24/Number(n??f):a??y;return S.createElement("svg",{ref:p,...Wf,width:n??f??Wf.width,height:n??f??Wf.height,stroke:e??x,strokeWidth:k,className:Tb("lucide",b,o),...!s&&!AT(d)&&{"aria-hidden":"true"},...d},[...u.map(([C,j])=>S.createElement(C,j)),...Array.isArray(s)?s:[s]])});/**
|
|
122
|
+
* @license lucide-react v1.14.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const $t=(e,n)=>{const a=S.forwardRef(({className:r,...o},s)=>S.createElement(NT,{ref:s,iconNode:n,className:Tb(`lucide-${CT(R0(e))}`,`lucide-${e}`,r),...o}));return a.displayName=R0(e),a};/**
|
|
127
|
+
* @license lucide-react v1.14.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const RT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],_T=$t("arrow-down",RT);/**
|
|
132
|
+
* @license lucide-react v1.14.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const OT=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],DT=$t("arrow-up",OT);/**
|
|
137
|
+
* @license lucide-react v1.14.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const MT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],LT=$t("ban",MT);/**
|
|
142
|
+
* @license lucide-react v1.14.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const zT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],IT=$t("check",zT);/**
|
|
147
|
+
* @license lucide-react v1.14.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const PT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],UT=$t("chevron-down",PT);/**
|
|
152
|
+
* @license lucide-react v1.14.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const BT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ip=$t("chevron-right",BT);/**
|
|
157
|
+
* @license lucide-react v1.14.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const HT=[["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"}]],$T=$t("copy",HT);/**
|
|
162
|
+
* @license lucide-react v1.14.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const qT=[["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"}]],FT=$t("ellipsis",qT);/**
|
|
167
|
+
* @license lucide-react v1.14.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const GT=[["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"}]],VT=$t("folder",GT);/**
|
|
172
|
+
* @license lucide-react v1.14.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const WT=[["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"}]],YT=$t("globe",WT);/**
|
|
177
|
+
* @license lucide-react v1.14.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const KT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],QT=$t("loader-circle",KT);/**
|
|
182
|
+
* @license lucide-react v1.14.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const XT=[["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"}]],ZT=$t("lock",XT);/**
|
|
187
|
+
* @license lucide-react v1.14.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const JT=[["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"}]],eN=$t("paperclip",JT);/**
|
|
192
|
+
* @license lucide-react v1.14.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const tN=[["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"}]],_0=$t("share-2",tN);/**
|
|
197
|
+
* @license lucide-react v1.14.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const nN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],aN=$t("square",nN);/**
|
|
202
|
+
* @license lucide-react v1.14.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const iN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],rN=$t("trending-up",iN);/**
|
|
207
|
+
* @license lucide-react v1.14.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const lN=[["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"}]],oN=$t("upload",lN);/**
|
|
212
|
+
* @license lucide-react v1.14.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const sN=[["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"}]],cN=$t("users-round",sN);/**
|
|
217
|
+
* @license lucide-react v1.14.0 - ISC
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the ISC license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const uN=[["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"}]],dN=$t("wallet",uN);/**
|
|
222
|
+
* @license lucide-react v1.14.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const fN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pN=$t("x",fN),Yf={1:"ETH",8453:"ETH",84532:"ETH",11155111:"ETH",31337:"ETH",100:"xDAI",10200:"xDAI",2043:"NEURO",20430:"NEURO"};function Nb(e){var r;if(e==null)return"ETH";const n=String(e);if(Yf[n])return Yf[n];const a=(r=n.match(/(\d+)\s*$/))==null?void 0:r[1];return a&&Yf[a]||"ETH"}const Kf="—";function hN(e,n=2){if(e==null)return Kf;let a;if(typeof e=="number")a=e;else{const s=String(e).trim();if(!/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(s))return Kf;a=Number(s)}if(!Number.isFinite(a))return Kf;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 mN(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 hN(`${r?"-":""}${s}.${u||"0"}`,n)}const gN=new Set(["84532","11155111","31337","10200","20430"]);function j8(e){if(e==null)return!1;const n=String(e),a=n.includes(":")?n.split(":").pop():n;return gN.has(a)}function T8(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 Rb(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 N8({convictionCostCovered:e,className:n=""}){const a=Rb(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 $c=new Map,Pp=new Set;let O0=!1;function yN(){const e=[...$c.values()];for(const n of Pp)n(e)}function vN(e){const n=e.detail;$c.has(n.info.uuid)||($c.set(n.info.uuid,n),yN())}function xN(){O0||typeof window>"u"||(O0=!0,window.addEventListener("eip6963:announceProvider",vN),window.dispatchEvent(new Event("eip6963:requestProvider")))}function bN(e){return Pp.add(e),e([...$c.values()]),()=>{Pp.delete(e)}}function Ah(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 wN(e){return`0x${Ah(e).toString(16)}`}const jh="dkg-node-ui:wallet-provider-rdns";function SN(e){var n;try{(n=globalThis.localStorage)==null||n.setItem(jh,e)}catch{}}function kN(){var e;try{return((e=globalThis.localStorage)==null?void 0:e.getItem(jh))??null}catch{return null}}function D0(){var e;try{(e=globalThis.localStorage)==null||e.removeItem(jh)}catch{}}function CN(e){return(e.walletRpcUrls??[]).filter(n=>/^https?:\/\//i.test(n))}async function EN(e,n){const a=wN(n.chainId);try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})}catch(r){if((r==null?void 0:r.code)!==4902)throw r;const o=Nb(n.chainId),s=CN(n);if(s.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 e.request({method:"wallet_addEthereumChain",params:[{chainId:a,chainName:`chain-${Ah(n.chainId)}`,nativeCurrency:{name:o,symbol:o,decimals:18},rpcUrls:s}]}),await e.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})}}const _b=new Set(["app.phantom"]),AN=300;function jN(e){return e.filter(n=>!_b.has(n.info.rdns))}function TN(e,n){if(!n)return null;const a=e.filter(r=>r.info.rdns===n);return a.length===1?a[0]:null}function R8(e){return e.address!=null&&e.expectedChainId!=null&&e.chainId!==e.expectedChainId}let uc=!1,dc=null,M0=!1;const _8=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){D0();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:Ah(o.chainId)})},initWallet(){if(typeof window>"u"||(xN(),M0))return;M0=!0;const o=kN();bN(s=>{e({discovered:jN(s),unsupported:s.filter(u=>_b.has(u.info.rdns))}),!(!o||uc)&&(dc&&clearTimeout(dc),dc=setTimeout(()=>{if(dc=null,uc)return;const u=TN(n().discovered,o);u&&(uc=!0,r(u))},AN))})},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)}),SN(o.info.rdns),uc=!1},disconnect(){e({provider:null,providerInfo:null,address:null,chainId:null}),D0()},async switchToExpectedChain(){const{provider:o,bootstrap:s}=n();if(!o)throw new Error("Wallet not connected.");if(!s)throw new Error("Chain not bootstrapped.");await EN(o,s)}}});function Th(e,n){return e&&e.trim()?e:n.length>20?`${n.slice(0,16)}…`:n}function L0(e){return e.length>12?`${e.slice(0,6)}…${e.slice(-4)}`:e}function NN({item:e,onApprove:n,onDeny:a,onOpen:r}){var y;const[o,s]=S.useState({kind:"idle"}),u=Th(e.contextGraphName,e.cgId),d=((y=e.agentName)==null?void 0:y.trim())||L0(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:L0(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 RN={created:"+",promoted:"⇡",published:"◉"};function _N(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 ON({item:e,onOpen:n}){var d;const a=Th(e.contextGraphName,e.cgId),r=e.bySelf?"You":((d=e.actorAgentName)==null?void 0:d.trim())||void 0,o=_N(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:RN[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 DN({item:e,onOpen:n}){const a=Th(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 MN({item:e}){var f;const n=Rb(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=mN((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 LN({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,D=a.length>0,F=!E&&!R&&!D;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:[D&&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"&&F?m.jsx("div",{className:"v10-notif-pane-state",role:"status",children:"Loading notifications…"}):p==="error"&&F?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"})]}):F?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(NN,{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(ON,{item:U,onOpen:_=>j(_,U.id)},U.id):U.kind==="pca_cost_covered"?m.jsx(MN,{item:U},U.id):m.jsx(DN,{item:U,onOpen:_=>j(_,U.id)},U.id))}):!y&&m.jsx("div",{className:"v10-notif-section-empty",children:"No recent activity."})]})]})]})]})}const zN=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"})]}),z0="v10-notifications-pane";function IN(){const e=oT(),n=kT(),[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?z0:void 0,children:[zN,x>0&&m.jsx("span",{className:"v10-header-notif-badge",children:x})]}),a&&m.jsx(LN,{id:z0,paneRef:p,feed:e,onOpenContextGraph:y,pcaAlerts:n,onOpenPca:g})]})}function PN(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 ${UN(o)}`),s.join(`
|
|
227
|
+
`)}function UN(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 BN=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"})]})}),HN=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"})]}),$N=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"})}),qN=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"})]}),FN=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"})]}),GN=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"})]}),VN=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"})}),WN=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 YN(){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=PN(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"}),BN]})]}),m.jsx("button",{className:`v10-header-icon-btn ${a?"":"active-toggle"}`,onClick:r,title:"Toggle sidebar",children:qN}),m.jsx("div",{className:"v10-header-sep"}),m.jsxs("div",{className:"v10-header-agent-switcher",title:d?`${d.agentDid}
|
|
228
|
+
${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(IN,{}),m.jsx("button",{className:"v10-header-icon-btn",onClick:()=>p({id:"operations",label:"Observability",closable:!0}),title:"Observability",children:VN}),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:WN}),m.jsx("button",{className:"v10-header-icon-btn",onClick:()=>p({id:"settings",label:"Settings",closable:!0}),title:"Settings",children:GN}),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"?HN:$N}),m.jsx("button",{className:`v10-header-icon-btn ${o?"":"active-toggle"}`,onClick:s,title:"Toggle agent panel",children:FN})]})]})}function KN(){const e=localStorage.getItem("dkg-journey-stage");return e==="1"?1:e==="2"?2:0}const Nh=ur((e,n)=>({stage:KN(),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})}})),QN=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
229
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
230
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
231
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
232
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
233
|
+
@prefix schema: <http://schema.org/> .
|
|
234
|
+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
235
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
236
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
237
|
+
@prefix bibo: <http://purl.org/ontology/bibo/> .
|
|
238
|
+
@prefix fabio: <http://purl.org/spar/fabio/> .
|
|
239
|
+
@prefix cito: <http://purl.org/spar/cito/> .
|
|
240
|
+
@prefix frbr: <http://purl.org/vocab/frbr/core#> .
|
|
241
|
+
|
|
242
|
+
@prefix chat: <http://dkg.io/ontology/chat/> .
|
|
243
|
+
@prefix dkg: <http://dkg.io/ontology/> .
|
|
244
|
+
@prefix : <http://dkg.io/ontology/book-research/> .
|
|
245
|
+
|
|
246
|
+
<http://dkg.io/ontology/book-research/>
|
|
247
|
+
a owl:Ontology ;
|
|
248
|
+
dcterms:title "DKG Book Research Project Ontology (v1)" ;
|
|
249
|
+
dcterms:description """Starter ontology for projects that research and
|
|
250
|
+
write books, papers, or long-form non-fiction. Built on schema.org +
|
|
251
|
+
BIBO + the SPAR family (FaBiO, CiTO) + FRBR + SKOS so it composes with
|
|
252
|
+
existing scholarly publishing infrastructure.""" ;
|
|
253
|
+
owl:versionInfo "1.0.0" ;
|
|
254
|
+
dcterms:created "2026-04-18"^^xsd:date ;
|
|
255
|
+
owl:imports
|
|
256
|
+
<http://schema.org/> , <http://purl.org/dc/terms/> ,
|
|
257
|
+
<http://www.w3.org/ns/prov#> , <http://xmlns.com/foaf/0.1/> ,
|
|
258
|
+
<http://www.w3.org/2004/02/skos/core#> ,
|
|
259
|
+
<http://purl.org/ontology/bibo/> ,
|
|
260
|
+
<http://purl.org/spar/fabio/> ,
|
|
261
|
+
<http://purl.org/spar/cito/> ,
|
|
262
|
+
<http://purl.org/vocab/frbr/core#> .
|
|
263
|
+
|
|
264
|
+
# ─── Universal annotation predicates (shared across all starters) ───
|
|
265
|
+
chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
266
|
+
chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
|
|
267
|
+
chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range owl:Thing .
|
|
268
|
+
chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range owl:Thing .
|
|
269
|
+
chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Finding .
|
|
270
|
+
chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
|
|
271
|
+
|
|
272
|
+
# ─── Universal annotation entities ──────────────────────────────────
|
|
273
|
+
:Concept rdfs:subClassOf skos:Concept .
|
|
274
|
+
:Topic rdfs:subClassOf skos:Concept .
|
|
275
|
+
:Question rdfs:subClassOf schema:Question .
|
|
276
|
+
:Finding rdfs:subClassOf prov:Entity .
|
|
277
|
+
|
|
278
|
+
# ─── Book-research specific ─────────────────────────────────────────
|
|
279
|
+
|
|
280
|
+
:Hypothesis a owl:Class ;
|
|
281
|
+
rdfs:label "Hypothesis" ;
|
|
282
|
+
rdfs:comment "A claim under investigation. Supersedes when refuted; promotes to a Finding when supported." ;
|
|
283
|
+
rdfs:subClassOf prov:Entity .
|
|
284
|
+
|
|
285
|
+
:Argument a owl:Class ;
|
|
286
|
+
rdfs:label "Argument" ;
|
|
287
|
+
rdfs:comment "A reasoned position taken on a Hypothesis or other entity." ;
|
|
288
|
+
rdfs:subClassOf prov:Entity .
|
|
289
|
+
|
|
290
|
+
:Counterexample a owl:Class ;
|
|
291
|
+
rdfs:label "Counterexample" ;
|
|
292
|
+
rdfs:comment "Evidence that refutes a Hypothesis or Argument." ;
|
|
293
|
+
rdfs:subClassOf prov:Entity .
|
|
294
|
+
|
|
295
|
+
:Quote a owl:Class ;
|
|
296
|
+
rdfs:label "Quote" ;
|
|
297
|
+
rdfs:comment "Verbatim passage extracted from a source. Subclass of bibo:Quote so it composes with bibliographic tools." ;
|
|
298
|
+
rdfs:subClassOf bibo:Quote .
|
|
299
|
+
|
|
300
|
+
:supports a owl:ObjectProperty ;
|
|
301
|
+
rdfs:label "supports" ;
|
|
302
|
+
rdfs:comment "An Argument or Quote supports a Hypothesis." ;
|
|
303
|
+
rdfs:subPropertyOf cito:agreesWith .
|
|
304
|
+
|
|
305
|
+
:refutes a owl:ObjectProperty ;
|
|
306
|
+
rdfs:label "refutes" ;
|
|
307
|
+
rdfs:comment "An Argument, Counterexample, or Quote refutes a Hypothesis." ;
|
|
308
|
+
rdfs:subPropertyOf cito:disagreesWith .
|
|
309
|
+
|
|
310
|
+
:cites a owl:ObjectProperty ;
|
|
311
|
+
rdfs:label "cites" ;
|
|
312
|
+
rdfs:subPropertyOf cito:cites ;
|
|
313
|
+
rdfs:range bibo:Document .
|
|
314
|
+
|
|
315
|
+
# ─── URI patterns ───────────────────────────────────────────────────
|
|
316
|
+
:UriPattern rdfs:label "URI minting pattern" .
|
|
317
|
+
|
|
318
|
+
:concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
|
|
319
|
+
:topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
|
|
320
|
+
:question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
|
|
321
|
+
:finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
|
|
322
|
+
:hypothesis-pattern a :UriPattern ; skos:notation "urn:dkg:hypothesis:<slug>" .
|
|
323
|
+
:argument-pattern a :UriPattern ; skos:notation "urn:dkg:argument:<slug>" .
|
|
324
|
+
:quote-pattern a :UriPattern ; skos:notation "urn:dkg:quote:<slug>" .
|
|
325
|
+
:citation-pattern a :UriPattern ; skos:notation "urn:dkg:citation:<slug>" ;
|
|
326
|
+
skos:definition "Bibliographic citation; aligned with bibo:Document via cito:cites." .
|
|
327
|
+
|
|
328
|
+
:slug-normalisation a skos:Note ;
|
|
329
|
+
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." .
|
|
330
|
+
`,XN=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
331
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
332
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
333
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
334
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
335
|
+
@prefix schema: <http://schema.org/> .
|
|
336
|
+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
337
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
338
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
339
|
+
@prefix doap: <http://usefulinc.com/ns/doap#> .
|
|
340
|
+
|
|
341
|
+
# DKG project namespaces — v1 ontology for any "coding project"
|
|
342
|
+
# context graph. Imports widely-adopted Linked Data vocabs first;
|
|
343
|
+
# only declares extensions for genuinely net-new concepts.
|
|
344
|
+
@prefix chat: <http://dkg.io/ontology/chat/> .
|
|
345
|
+
@prefix code: <http://dkg.io/ontology/code/> .
|
|
346
|
+
@prefix github: <http://dkg.io/ontology/github/> .
|
|
347
|
+
@prefix decisions: <http://dkg.io/ontology/decisions/> .
|
|
348
|
+
@prefix tasks: <http://dkg.io/ontology/tasks/> .
|
|
349
|
+
@prefix agent: <http://dkg.io/ontology/agent/> .
|
|
350
|
+
@prefix dkg: <http://dkg.io/ontology/> .
|
|
351
|
+
|
|
352
|
+
@prefix : <http://dkg.io/ontology/coding-project/> .
|
|
353
|
+
|
|
354
|
+
# ─── Ontology header ────────────────────────────────────────────────
|
|
355
|
+
<http://dkg.io/ontology/coding-project/>
|
|
356
|
+
a owl:Ontology ;
|
|
357
|
+
dcterms:title "DKG Coding Project Ontology (v1)" ;
|
|
358
|
+
dcterms:description """The starter ontology for any DKG context graph that
|
|
359
|
+
represents a software project — its decisions, tasks, code structure, GitHub
|
|
360
|
+
activity, agents, and chat. Designed to be \`owl:imports\`-ed by per-project
|
|
361
|
+
ontologies, which add their own extensions on top.
|
|
362
|
+
|
|
363
|
+
Every predicate is either reused from a globally-adopted vocabulary
|
|
364
|
+
(schema.org, DCTerms, PROV-O, FOAF, SKOS, DOAP) or declared here as a
|
|
365
|
+
project-specific extension. Companion document \`agent-guide.md\` translates
|
|
366
|
+
this formal model into operational instructions for AI coding agents.""" ;
|
|
367
|
+
dcterms:creator "branarakic" ;
|
|
368
|
+
owl:versionInfo "1.0.0" ;
|
|
369
|
+
dcterms:created "2026-04-18"^^xsd:date ;
|
|
370
|
+
owl:imports
|
|
371
|
+
<http://schema.org/> ,
|
|
372
|
+
<http://purl.org/dc/terms/> ,
|
|
373
|
+
<http://www.w3.org/ns/prov#> ,
|
|
374
|
+
<http://xmlns.com/foaf/0.1/> ,
|
|
375
|
+
<http://www.w3.org/2004/02/skos/core#> ,
|
|
376
|
+
<http://usefulinc.com/ns/doap#> .
|
|
377
|
+
|
|
378
|
+
# ─── Section 1 — Universal annotation primitives ────────────────────
|
|
379
|
+
# Predicates expressing what each chat turn was ABOUT — written into
|
|
380
|
+
# the project's \`chat\` sub-graph by the capture-chat hook (and later
|
|
381
|
+
# read by \`dkg_query\` / \`dkg_memory_search\`). These predicates apply
|
|
382
|
+
# to ANY project type, not just coding.
|
|
383
|
+
|
|
384
|
+
chat:topic
|
|
385
|
+
a owl:DatatypeProperty ;
|
|
386
|
+
rdfs:label "topic" ;
|
|
387
|
+
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." ;
|
|
388
|
+
rdfs:domain chat:Turn ;
|
|
389
|
+
rdfs:range xsd:string .
|
|
390
|
+
|
|
391
|
+
chat:mentions
|
|
392
|
+
a owl:ObjectProperty ;
|
|
393
|
+
rdfs:label "mentions" ;
|
|
394
|
+
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)." ;
|
|
395
|
+
rdfs:domain chat:Turn ;
|
|
396
|
+
rdfs:range owl:Thing ;
|
|
397
|
+
rdfs:subPropertyOf schema:mentions .
|
|
398
|
+
|
|
399
|
+
chat:examines
|
|
400
|
+
a owl:ObjectProperty ;
|
|
401
|
+
rdfs:label "examines" ;
|
|
402
|
+
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." ;
|
|
403
|
+
rdfs:domain chat:Turn ;
|
|
404
|
+
rdfs:range owl:Thing .
|
|
405
|
+
|
|
406
|
+
chat:proposes
|
|
407
|
+
a owl:ObjectProperty ;
|
|
408
|
+
rdfs:label "proposes" ;
|
|
409
|
+
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." ;
|
|
410
|
+
rdfs:domain chat:Turn ;
|
|
411
|
+
rdfs:range owl:Thing .
|
|
412
|
+
|
|
413
|
+
chat:concludes
|
|
414
|
+
a owl:ObjectProperty ;
|
|
415
|
+
rdfs:label "concludes" ;
|
|
416
|
+
rdfs:comment "A Finding entity the chat turn produced — a claim worth preserving as a first-class node, separate from the turn body." ;
|
|
417
|
+
rdfs:domain chat:Turn ;
|
|
418
|
+
rdfs:range :Finding .
|
|
419
|
+
|
|
420
|
+
chat:asks
|
|
421
|
+
a owl:ObjectProperty ;
|
|
422
|
+
rdfs:label "asks" ;
|
|
423
|
+
rdfs:comment "A Question entity the chat turn left open. Tracking these lets a future query surface 'what did we never resolve?'." ;
|
|
424
|
+
rdfs:domain chat:Turn ;
|
|
425
|
+
rdfs:range :Question .
|
|
426
|
+
|
|
427
|
+
# ─── Section 2 — Universal annotation entity classes ────────────────
|
|
428
|
+
|
|
429
|
+
:Concept
|
|
430
|
+
a owl:Class ;
|
|
431
|
+
rdfs:label "Concept" ;
|
|
432
|
+
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." ;
|
|
433
|
+
rdfs:subClassOf skos:Concept .
|
|
434
|
+
|
|
435
|
+
:Topic
|
|
436
|
+
a owl:Class ;
|
|
437
|
+
rdfs:label "Topic" ;
|
|
438
|
+
rdfs:comment "A broad topical bucket grouping related concepts/turns/entities. URI pattern: urn:dkg:topic:<slug>." ;
|
|
439
|
+
rdfs:subClassOf skos:Concept .
|
|
440
|
+
|
|
441
|
+
:Question
|
|
442
|
+
a owl:Class ;
|
|
443
|
+
rdfs:label "Question" ;
|
|
444
|
+
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." ;
|
|
445
|
+
rdfs:subClassOf schema:Question .
|
|
446
|
+
|
|
447
|
+
:Finding
|
|
448
|
+
a owl:Class ;
|
|
449
|
+
rdfs:label "Finding" ;
|
|
450
|
+
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." ;
|
|
451
|
+
rdfs:subClassOf prov:Entity .
|
|
452
|
+
|
|
453
|
+
:answers
|
|
454
|
+
a owl:ObjectProperty ;
|
|
455
|
+
rdfs:label "answers" ;
|
|
456
|
+
rdfs:comment "Links a Finding (or chat turn) to the Question it resolves." ;
|
|
457
|
+
rdfs:domain owl:Thing ;
|
|
458
|
+
rdfs:range :Question .
|
|
459
|
+
|
|
460
|
+
:supersedes
|
|
461
|
+
a owl:ObjectProperty ;
|
|
462
|
+
rdfs:label "supersedes" ;
|
|
463
|
+
rdfs:comment "This entity replaces an older one (e.g. a revised Finding supersedes an earlier one)." ;
|
|
464
|
+
rdfs:range owl:Thing ;
|
|
465
|
+
owl:inverseOf prov:wasRevisionOf .
|
|
466
|
+
|
|
467
|
+
# ─── Section 3 — Coding-project-specific classes ────────────────────
|
|
468
|
+
# Formalises the predicates already used informally in
|
|
469
|
+
# scripts/lib/ontology.mjs, anchoring them in PROV-O and schema.org.
|
|
470
|
+
|
|
471
|
+
decisions:Decision
|
|
472
|
+
a owl:Class ;
|
|
473
|
+
rdfs:label "Decision" ;
|
|
474
|
+
rdfs:comment "An architectural decision the project made — context, outcome, consequences. Modelled as a prov:Activity because it represents a deliberate act of choosing." ;
|
|
475
|
+
rdfs:subClassOf prov:Activity, schema:Action .
|
|
476
|
+
|
|
477
|
+
decisions:context
|
|
478
|
+
a owl:DatatypeProperty ;
|
|
479
|
+
rdfs:label "context" ;
|
|
480
|
+
rdfs:domain decisions:Decision ;
|
|
481
|
+
rdfs:range xsd:string ;
|
|
482
|
+
rdfs:comment "Why this decision was being made — problem, constraints, alternatives considered." .
|
|
483
|
+
|
|
484
|
+
decisions:outcome
|
|
485
|
+
a owl:DatatypeProperty ;
|
|
486
|
+
rdfs:label "outcome" ;
|
|
487
|
+
rdfs:domain decisions:Decision ;
|
|
488
|
+
rdfs:range xsd:string ;
|
|
489
|
+
rdfs:comment "The chosen direction — the decision itself, in one paragraph." .
|
|
490
|
+
|
|
491
|
+
decisions:consequences
|
|
492
|
+
a owl:DatatypeProperty ;
|
|
493
|
+
rdfs:label "consequences" ;
|
|
494
|
+
rdfs:domain decisions:Decision ;
|
|
495
|
+
rdfs:range xsd:string ;
|
|
496
|
+
rdfs:comment "What this implies going forward — trade-offs, follow-ups." .
|
|
497
|
+
|
|
498
|
+
decisions:status
|
|
499
|
+
a owl:DatatypeProperty ;
|
|
500
|
+
rdfs:label "status" ;
|
|
501
|
+
rdfs:domain decisions:Decision ;
|
|
502
|
+
rdfs:range xsd:string ;
|
|
503
|
+
rdfs:comment "One of: proposed | accepted | rejected | superseded." .
|
|
504
|
+
|
|
505
|
+
tasks:Task
|
|
506
|
+
a owl:Class ;
|
|
507
|
+
rdfs:label "Task" ;
|
|
508
|
+
rdfs:comment "A piece of planned or in-flight work on the project." ;
|
|
509
|
+
rdfs:subClassOf schema:Action .
|
|
510
|
+
|
|
511
|
+
tasks:status
|
|
512
|
+
a owl:DatatypeProperty ;
|
|
513
|
+
rdfs:label "status" ;
|
|
514
|
+
rdfs:domain tasks:Task ;
|
|
515
|
+
rdfs:range xsd:string ;
|
|
516
|
+
rdfs:comment "One of: todo | in_progress | blocked | done | cancelled." .
|
|
517
|
+
|
|
518
|
+
tasks:priority
|
|
519
|
+
a owl:DatatypeProperty ;
|
|
520
|
+
rdfs:label "priority" ;
|
|
521
|
+
rdfs:domain tasks:Task ;
|
|
522
|
+
rdfs:range xsd:string ;
|
|
523
|
+
rdfs:comment "One of: p0 | p1 | p2 | p3." .
|
|
524
|
+
|
|
525
|
+
tasks:relatedDecision
|
|
526
|
+
a owl:ObjectProperty ;
|
|
527
|
+
rdfs:label "related decision" ;
|
|
528
|
+
rdfs:domain tasks:Task ;
|
|
529
|
+
rdfs:range decisions:Decision ;
|
|
530
|
+
rdfs:comment "The Decision this task implements or follows from." .
|
|
531
|
+
|
|
532
|
+
tasks:dependsOn
|
|
533
|
+
a owl:ObjectProperty ;
|
|
534
|
+
rdfs:label "depends on" ;
|
|
535
|
+
rdfs:domain tasks:Task ;
|
|
536
|
+
rdfs:range tasks:Task .
|
|
537
|
+
|
|
538
|
+
tasks:touches
|
|
539
|
+
a owl:ObjectProperty ;
|
|
540
|
+
rdfs:label "touches" ;
|
|
541
|
+
rdfs:domain tasks:Task ;
|
|
542
|
+
rdfs:range owl:Thing ;
|
|
543
|
+
rdfs:comment "A code:File or code:Package this task edits." .
|
|
544
|
+
|
|
545
|
+
# Code structure — aligned with schema:SoftwareSourceCode + DOAP.
|
|
546
|
+
|
|
547
|
+
code:Package
|
|
548
|
+
a owl:Class ;
|
|
549
|
+
rdfs:label "Package" ;
|
|
550
|
+
rdfs:subClassOf doap:Project, schema:SoftwareApplication .
|
|
551
|
+
|
|
552
|
+
code:File
|
|
553
|
+
a owl:Class ;
|
|
554
|
+
rdfs:label "Source file" ;
|
|
555
|
+
rdfs:subClassOf schema:SoftwareSourceCode .
|
|
556
|
+
|
|
557
|
+
code:Function a owl:Class ; rdfs:label "Function" .
|
|
558
|
+
code:Class a owl:Class ; rdfs:label "Class" .
|
|
559
|
+
code:Interface a owl:Class ; rdfs:label "Interface" .
|
|
560
|
+
|
|
561
|
+
# GitHub — minimal aliasing onto schema.org where sensible.
|
|
562
|
+
|
|
563
|
+
github:Repository
|
|
564
|
+
a owl:Class ;
|
|
565
|
+
rdfs:label "GitHub repository" ;
|
|
566
|
+
rdfs:subClassOf schema:SoftwareSourceCode, doap:Project .
|
|
567
|
+
|
|
568
|
+
github:PullRequest
|
|
569
|
+
a owl:Class ;
|
|
570
|
+
rdfs:label "Pull request" ;
|
|
571
|
+
rdfs:subClassOf schema:CreativeWork .
|
|
572
|
+
|
|
573
|
+
github:Issue
|
|
574
|
+
a owl:Class ;
|
|
575
|
+
rdfs:label "GitHub issue" ;
|
|
576
|
+
rdfs:subClassOf schema:Question, schema:CreativeWork .
|
|
577
|
+
|
|
578
|
+
# ─── Section 4 — Chat sub-graph classes ─────────────────────────────
|
|
579
|
+
|
|
580
|
+
chat:Session
|
|
581
|
+
a owl:Class ;
|
|
582
|
+
rdfs:label "Chat session" ;
|
|
583
|
+
rdfs:comment "One conversation between an operator and their coding assistant (Cursor window, Claude Code thread, etc.)." ;
|
|
584
|
+
rdfs:subClassOf schema:Conversation .
|
|
585
|
+
|
|
586
|
+
chat:Turn
|
|
587
|
+
a owl:Class ;
|
|
588
|
+
rdfs:label "Chat turn" ;
|
|
589
|
+
rdfs:comment "One user-prompt + assistant-response pair within a Session. Carries provenance via prov:wasAttributedTo." ;
|
|
590
|
+
rdfs:subClassOf schema:Message, prov:Entity .
|
|
591
|
+
|
|
592
|
+
chat:userPrompt a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
593
|
+
chat:assistantResponse a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
594
|
+
chat:turnIndex a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:integer .
|
|
595
|
+
chat:inSession a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range chat:Session .
|
|
596
|
+
chat:speakerTool a owl:DatatypeProperty ; rdfs:range xsd:string ;
|
|
597
|
+
rdfs:comment "Identifier of the coding assistant that produced the turn (e.g. 'cursor', 'claude-code')." .
|
|
598
|
+
chat:privacy a owl:DatatypeProperty ; rdfs:domain chat:Session ; rdfs:range xsd:string ;
|
|
599
|
+
rdfs:comment "One of: private | team | public. Controls auto-promote behaviour of the capture hook." .
|
|
600
|
+
|
|
601
|
+
# ─── Section 5 — Agent identity ─────────────────────────────────────
|
|
602
|
+
|
|
603
|
+
agent:Agent
|
|
604
|
+
a owl:Class ;
|
|
605
|
+
rdfs:label "Agent" ;
|
|
606
|
+
rdfs:subClassOf prov:Agent, foaf:Agent .
|
|
607
|
+
|
|
608
|
+
agent:HumanAgent rdfs:subClassOf agent:Agent, foaf:Person .
|
|
609
|
+
agent:AIAgent rdfs:subClassOf agent:Agent, schema:SoftwareApplication .
|
|
610
|
+
|
|
611
|
+
agent:framework
|
|
612
|
+
a owl:DatatypeProperty ;
|
|
613
|
+
rdfs:label "framework" ;
|
|
614
|
+
rdfs:domain agent:AIAgent ;
|
|
615
|
+
rdfs:range xsd:string ;
|
|
616
|
+
rdfs:comment "Name of the agent runtime — 'cursor', 'claude-code', 'openclaw', 'hermes', etc." .
|
|
617
|
+
|
|
618
|
+
agent:operator
|
|
619
|
+
a owl:ObjectProperty ;
|
|
620
|
+
rdfs:label "operator" ;
|
|
621
|
+
rdfs:domain agent:AIAgent ;
|
|
622
|
+
rdfs:range agent:HumanAgent ;
|
|
623
|
+
rdfs:comment "The human operator who runs and is responsible for this AI agent." .
|
|
624
|
+
|
|
625
|
+
# ─── Section 6 — URI minting conventions (machine-readable) ─────────
|
|
626
|
+
# These are encoded as SKOS notes so an agent reading the ontology can
|
|
627
|
+
# pull them out programmatically. The agent guide repeats them in
|
|
628
|
+
# prose for human readability.
|
|
629
|
+
|
|
630
|
+
:UriPattern
|
|
631
|
+
a owl:Class ;
|
|
632
|
+
rdfs:label "URI minting pattern" ;
|
|
633
|
+
rdfs:comment "Documents the URI shape the agent should produce when minting a new entity of a given type." .
|
|
634
|
+
|
|
635
|
+
:concept-pattern a :UriPattern ;
|
|
636
|
+
skos:notation "urn:dkg:concept:<slug>" ;
|
|
637
|
+
skos:definition "Free-text concept; aligned with skos:Concept." .
|
|
638
|
+
:topic-pattern a :UriPattern ;
|
|
639
|
+
skos:notation "urn:dkg:topic:<slug>" ;
|
|
640
|
+
skos:definition "Broad topical bucket grouping related entities." .
|
|
641
|
+
:question-pattern a :UriPattern ;
|
|
642
|
+
skos:notation "urn:dkg:question:<slug>" ;
|
|
643
|
+
skos:definition "An open question awaiting an answer." .
|
|
644
|
+
:finding-pattern a :UriPattern ;
|
|
645
|
+
skos:notation "urn:dkg:finding:<slug>" ;
|
|
646
|
+
skos:definition "A claim or observation worth preserving as a first-class node." .
|
|
647
|
+
:decision-pattern a :UriPattern ;
|
|
648
|
+
skos:notation "urn:dkg:decision:<slug>" ;
|
|
649
|
+
skos:definition "An architectural decision (coding-project specific)." .
|
|
650
|
+
:task-pattern a :UriPattern ;
|
|
651
|
+
skos:notation "urn:dkg:task:<slug>" ;
|
|
652
|
+
skos:definition "A piece of planned or in-flight work (coding-project specific)." .
|
|
653
|
+
|
|
654
|
+
# ─── Section 7 — Slug normalisation rule (deterministic) ────────────
|
|
655
|
+
|
|
656
|
+
:slug-normalisation a skos:Note ;
|
|
657
|
+
skos:prefLabel "slug normalisation" ;
|
|
658
|
+
skos:definition """To compute the canonical slug from a free-text label:
|
|
659
|
+
1. Lowercase.
|
|
660
|
+
2. Apply Unicode NFKD then strip combining marks (ASCII fold).
|
|
661
|
+
3. Strip common stopwords (the / a / an / of / for / and / or / to / in / on / with).
|
|
662
|
+
4. Replace any run of non-[a-z0-9] with a single hyphen.
|
|
663
|
+
5. Trim leading/trailing hyphens.
|
|
664
|
+
6. Truncate to 60 characters max.
|
|
665
|
+
|
|
666
|
+
Example: "the Tree-Sitter library", "Tree sitter", "TREE_SITTER" all
|
|
667
|
+
normalise to "tree-sitter". Always apply this BEFORE comparing free-text
|
|
668
|
+
recall results (\`dkg_memory_search\`) in the look-before-mint protocol.""" .
|
|
669
|
+
`,ZN=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
670
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
671
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
672
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
673
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
674
|
+
@prefix schema: <http://schema.org/> .
|
|
675
|
+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
676
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
677
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
678
|
+
@prefix bibo: <http://purl.org/ontology/bibo/> .
|
|
679
|
+
|
|
680
|
+
@prefix chat: <http://dkg.io/ontology/chat/> .
|
|
681
|
+
@prefix : <http://dkg.io/ontology/narrative-writing/> .
|
|
682
|
+
|
|
683
|
+
<http://dkg.io/ontology/narrative-writing/>
|
|
684
|
+
a owl:Ontology ;
|
|
685
|
+
dcterms:title "DKG Narrative Writing Project Ontology (v1)" ;
|
|
686
|
+
dcterms:description """Starter for fiction or narrative non-fiction
|
|
687
|
+
projects: novels, screenplays, biographies. Tracks Characters, Scenes,
|
|
688
|
+
Plot Points, Themes, and the relationships between them.""" ;
|
|
689
|
+
owl:versionInfo "1.0.0" ;
|
|
690
|
+
dcterms:created "2026-04-18"^^xsd:date ;
|
|
691
|
+
owl:imports
|
|
692
|
+
<http://schema.org/> , <http://purl.org/dc/terms/> ,
|
|
693
|
+
<http://xmlns.com/foaf/0.1/> ,
|
|
694
|
+
<http://www.w3.org/2004/02/skos/core#> ,
|
|
695
|
+
<http://purl.org/ontology/bibo/> .
|
|
696
|
+
|
|
697
|
+
# ─── Universal annotation predicates ────────────────────────────────
|
|
698
|
+
chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
699
|
+
chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
|
|
700
|
+
chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
701
|
+
chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
702
|
+
chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Finding .
|
|
703
|
+
chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
|
|
704
|
+
|
|
705
|
+
# ─── Universal annotation entities ──────────────────────────────────
|
|
706
|
+
:Concept rdfs:subClassOf skos:Concept .
|
|
707
|
+
:Topic rdfs:subClassOf skos:Concept .
|
|
708
|
+
:Question rdfs:subClassOf schema:Question .
|
|
709
|
+
:Finding rdfs:subClassOf prov:Entity .
|
|
710
|
+
|
|
711
|
+
# ─── Narrative-writing-specific ─────────────────────────────────────
|
|
712
|
+
|
|
713
|
+
:Character a owl:Class ;
|
|
714
|
+
rdfs:label "Character" ;
|
|
715
|
+
rdfs:comment "A character in the narrative — fictional or historical." ;
|
|
716
|
+
rdfs:subClassOf foaf:Person, schema:Person .
|
|
717
|
+
|
|
718
|
+
:Scene a owl:Class ;
|
|
719
|
+
rdfs:label "Scene" ;
|
|
720
|
+
rdfs:comment "A discrete unit of narrative action — a single place/time/event in the story." ;
|
|
721
|
+
rdfs:subClassOf schema:Event .
|
|
722
|
+
|
|
723
|
+
:PlotPoint a owl:Class ;
|
|
724
|
+
rdfs:label "Plot point" ;
|
|
725
|
+
rdfs:comment "A structural moment in the narrative arc (inciting incident, climax, resolution, etc.)." .
|
|
726
|
+
|
|
727
|
+
:Theme a owl:Class ;
|
|
728
|
+
rdfs:label "Theme" ;
|
|
729
|
+
rdfs:comment "A unifying idea explored across the narrative." ;
|
|
730
|
+
rdfs:subClassOf skos:Concept .
|
|
731
|
+
|
|
732
|
+
:Setting a owl:Class ;
|
|
733
|
+
rdfs:label "Setting" ;
|
|
734
|
+
rdfs:comment "A place + time context within which Scenes occur." .
|
|
735
|
+
|
|
736
|
+
:appearsIn a owl:ObjectProperty ;
|
|
737
|
+
rdfs:label "appears in" ;
|
|
738
|
+
rdfs:domain :Character ;
|
|
739
|
+
rdfs:range :Scene .
|
|
740
|
+
|
|
741
|
+
:setIn a owl:ObjectProperty ;
|
|
742
|
+
rdfs:label "set in" ;
|
|
743
|
+
rdfs:domain :Scene ;
|
|
744
|
+
rdfs:range :Setting .
|
|
745
|
+
|
|
746
|
+
:develops a owl:ObjectProperty ;
|
|
747
|
+
rdfs:label "develops" ;
|
|
748
|
+
rdfs:comment "A Scene or PlotPoint develops a Theme or a Character arc." ;
|
|
749
|
+
rdfs:range owl:Thing .
|
|
750
|
+
|
|
751
|
+
:precedes a owl:ObjectProperty ;
|
|
752
|
+
rdfs:label "precedes" ;
|
|
753
|
+
rdfs:domain :Scene ;
|
|
754
|
+
rdfs:range :Scene .
|
|
755
|
+
|
|
756
|
+
# ─── URI patterns ───────────────────────────────────────────────────
|
|
757
|
+
:UriPattern rdfs:label "URI minting pattern" .
|
|
758
|
+
|
|
759
|
+
:concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
|
|
760
|
+
:topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
|
|
761
|
+
:question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
|
|
762
|
+
:character-pattern a :UriPattern ; skos:notation "urn:dkg:character:<slug>" .
|
|
763
|
+
:scene-pattern a :UriPattern ; skos:notation "urn:dkg:scene:<slug>" .
|
|
764
|
+
:plotpoint-pattern a :UriPattern ; skos:notation "urn:dkg:plotpoint:<slug>" .
|
|
765
|
+
:theme-pattern a :UriPattern ; skos:notation "urn:dkg:theme:<slug>" .
|
|
766
|
+
:setting-pattern a :UriPattern ; skos:notation "urn:dkg:setting:<slug>" .
|
|
767
|
+
|
|
768
|
+
:slug-normalisation a skos:Note ;
|
|
769
|
+
skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
|
|
770
|
+
`,JN=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
771
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
772
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
773
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
774
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
775
|
+
@prefix schema: <http://schema.org/> .
|
|
776
|
+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
777
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
778
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
779
|
+
@prefix time: <http://www.w3.org/2006/time#> .
|
|
780
|
+
|
|
781
|
+
@prefix chat: <http://dkg.io/ontology/chat/> .
|
|
782
|
+
@prefix : <http://dkg.io/ontology/pkm/> .
|
|
783
|
+
|
|
784
|
+
<http://dkg.io/ontology/pkm/>
|
|
785
|
+
a owl:Ontology ;
|
|
786
|
+
dcterms:title "DKG Personal Knowledge Management Ontology (v1)" ;
|
|
787
|
+
dcterms:description """Starter for personal/team knowledge gardens.
|
|
788
|
+
Notes, highlights, questions, insights — the daily-driver vocabulary
|
|
789
|
+
of an Obsidian/Roam-style PKM workflow, but graph-native and shareable
|
|
790
|
+
with teammates' agents.""" ;
|
|
791
|
+
owl:versionInfo "1.0.0" ;
|
|
792
|
+
dcterms:created "2026-04-18"^^xsd:date ;
|
|
793
|
+
owl:imports
|
|
794
|
+
<http://schema.org/> , <http://purl.org/dc/terms/> ,
|
|
795
|
+
<http://xmlns.com/foaf/0.1/> ,
|
|
796
|
+
<http://www.w3.org/2004/02/skos/core#> ,
|
|
797
|
+
<http://www.w3.org/2006/time#> .
|
|
798
|
+
|
|
799
|
+
# ─── Universal annotation predicates ────────────────────────────────
|
|
800
|
+
chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
801
|
+
chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
|
|
802
|
+
chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
803
|
+
chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
804
|
+
chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Insight .
|
|
805
|
+
chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
|
|
806
|
+
|
|
807
|
+
# ─── Universal annotation entities ──────────────────────────────────
|
|
808
|
+
:Concept rdfs:subClassOf skos:Concept .
|
|
809
|
+
:Topic rdfs:subClassOf skos:Concept .
|
|
810
|
+
:Question rdfs:subClassOf schema:Question .
|
|
811
|
+
:Finding rdfs:subClassOf prov:Entity .
|
|
812
|
+
|
|
813
|
+
# ─── PKM-specific ────────────────────────────────────────────────────
|
|
814
|
+
|
|
815
|
+
:Note a owl:Class ;
|
|
816
|
+
rdfs:label "Note" ;
|
|
817
|
+
rdfs:comment "An atomic note — a single self-contained thought worth capturing. The fundamental unit of a PKM graph." ;
|
|
818
|
+
rdfs:subClassOf schema:CreativeWork .
|
|
819
|
+
|
|
820
|
+
:Highlight a owl:Class ;
|
|
821
|
+
rdfs:label "Highlight" ;
|
|
822
|
+
rdfs:comment "A passage of text marked as significant from a source (article, book, transcript). Carries provenance back to the source." ;
|
|
823
|
+
rdfs:subClassOf schema:Quotation .
|
|
824
|
+
|
|
825
|
+
:Insight a owl:Class ;
|
|
826
|
+
rdfs:label "Insight" ;
|
|
827
|
+
rdfs:comment "A connection or realisation that synthesises across multiple Notes/Highlights. Promotes from a chat turn via chat:concludes." ;
|
|
828
|
+
rdfs:subClassOf prov:Entity .
|
|
829
|
+
|
|
830
|
+
:relatedTo a owl:ObjectProperty ;
|
|
831
|
+
rdfs:label "related to" ;
|
|
832
|
+
rdfs:subPropertyOf skos:related .
|
|
833
|
+
|
|
834
|
+
:references a owl:ObjectProperty ;
|
|
835
|
+
rdfs:label "references" ;
|
|
836
|
+
rdfs:subPropertyOf dcterms:references .
|
|
837
|
+
|
|
838
|
+
:source a owl:ObjectProperty ;
|
|
839
|
+
rdfs:label "source" ;
|
|
840
|
+
rdfs:domain :Highlight ;
|
|
841
|
+
rdfs:range schema:CreativeWork ;
|
|
842
|
+
rdfs:comment "Where a Highlight was extracted from." ;
|
|
843
|
+
rdfs:subPropertyOf dcterms:source .
|
|
844
|
+
|
|
845
|
+
# ─── URI patterns ───────────────────────────────────────────────────
|
|
846
|
+
:UriPattern rdfs:label "URI minting pattern" .
|
|
847
|
+
|
|
848
|
+
:concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
|
|
849
|
+
:topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
|
|
850
|
+
:question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
|
|
851
|
+
:finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
|
|
852
|
+
:note-pattern a :UriPattern ; skos:notation "urn:dkg:note:<slug>" .
|
|
853
|
+
:highlight-pattern a :UriPattern ; skos:notation "urn:dkg:highlight:<slug>" .
|
|
854
|
+
:insight-pattern a :UriPattern ; skos:notation "urn:dkg:insight:<slug>" .
|
|
855
|
+
|
|
856
|
+
:slug-normalisation a skos:Note ;
|
|
857
|
+
skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
|
|
858
|
+
`,eR=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
859
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
860
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
861
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
862
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
863
|
+
@prefix schema: <http://schema.org/> .
|
|
864
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
865
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
866
|
+
@prefix dcat: <http://www.w3.org/ns/dcat#> .
|
|
867
|
+
@prefix fabio: <http://purl.org/spar/fabio/> .
|
|
868
|
+
@prefix time: <http://www.w3.org/2006/time#> .
|
|
869
|
+
|
|
870
|
+
@prefix chat: <http://dkg.io/ontology/chat/> .
|
|
871
|
+
@prefix : <http://dkg.io/ontology/scientific-research/> .
|
|
872
|
+
|
|
873
|
+
<http://dkg.io/ontology/scientific-research/>
|
|
874
|
+
a owl:Ontology ;
|
|
875
|
+
dcterms:title "DKG Scientific Research Project Ontology (v1)" ;
|
|
876
|
+
dcterms:description """Starter for empirical scientific research:
|
|
877
|
+
hypotheses → experiments → results → reproducibility chains. Composes
|
|
878
|
+
with FaBiO for scholarly works, DCAT for datasets, PROV-O for
|
|
879
|
+
provenance, OWL Time for sequencing.""" ;
|
|
880
|
+
owl:versionInfo "1.0.0" ;
|
|
881
|
+
dcterms:created "2026-04-18"^^xsd:date ;
|
|
882
|
+
owl:imports
|
|
883
|
+
<http://schema.org/> , <http://purl.org/dc/terms/> ,
|
|
884
|
+
<http://www.w3.org/ns/prov#> ,
|
|
885
|
+
<http://www.w3.org/2004/02/skos/core#> ,
|
|
886
|
+
<http://www.w3.org/ns/dcat#> ,
|
|
887
|
+
<http://purl.org/spar/fabio/> ,
|
|
888
|
+
<http://www.w3.org/2006/time#> .
|
|
889
|
+
|
|
890
|
+
# ─── Universal annotation predicates ────────────────────────────────
|
|
891
|
+
chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
892
|
+
chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
|
|
893
|
+
chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
894
|
+
chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
895
|
+
chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Result .
|
|
896
|
+
chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
|
|
897
|
+
|
|
898
|
+
# ─── Universal annotation entities ──────────────────────────────────
|
|
899
|
+
:Concept rdfs:subClassOf skos:Concept .
|
|
900
|
+
:Topic rdfs:subClassOf skos:Concept .
|
|
901
|
+
:Question rdfs:subClassOf schema:Question .
|
|
902
|
+
:Finding rdfs:subClassOf prov:Entity .
|
|
903
|
+
|
|
904
|
+
# ─── Scientific-research-specific ───────────────────────────────────
|
|
905
|
+
|
|
906
|
+
:Hypothesis a owl:Class ;
|
|
907
|
+
rdfs:label "Hypothesis" ;
|
|
908
|
+
rdfs:comment "A testable claim. Linked to Experiments via :testedBy and to Results via :supportedBy / :refutedBy." ;
|
|
909
|
+
rdfs:subClassOf prov:Entity .
|
|
910
|
+
|
|
911
|
+
:Experiment a owl:Class ;
|
|
912
|
+
rdfs:label "Experiment" ;
|
|
913
|
+
rdfs:comment "A defined procedure executed to test a Hypothesis. Subclass of prov:Activity for full provenance." ;
|
|
914
|
+
rdfs:subClassOf prov:Activity .
|
|
915
|
+
|
|
916
|
+
:Method a owl:Class ;
|
|
917
|
+
rdfs:label "Method" ;
|
|
918
|
+
rdfs:comment "A reusable methodology applied within Experiments." ;
|
|
919
|
+
rdfs:subClassOf prov:Plan .
|
|
920
|
+
|
|
921
|
+
:Result a owl:Class ;
|
|
922
|
+
rdfs:label "Result" ;
|
|
923
|
+
rdfs:comment "An outcome produced by an Experiment — quantitative or qualitative." ;
|
|
924
|
+
rdfs:subClassOf prov:Entity .
|
|
925
|
+
|
|
926
|
+
:Dataset a owl:Class ;
|
|
927
|
+
rdfs:label "Dataset" ;
|
|
928
|
+
rdfs:comment "An input or output dataset for an Experiment. Aligned with DCAT." ;
|
|
929
|
+
rdfs:subClassOf dcat:Dataset .
|
|
930
|
+
|
|
931
|
+
:testedBy a owl:ObjectProperty ;
|
|
932
|
+
rdfs:label "tested by" ;
|
|
933
|
+
rdfs:domain :Hypothesis ;
|
|
934
|
+
rdfs:range :Experiment .
|
|
935
|
+
|
|
936
|
+
:supportedBy a owl:ObjectProperty ;
|
|
937
|
+
rdfs:label "supported by" ;
|
|
938
|
+
rdfs:domain :Hypothesis ;
|
|
939
|
+
rdfs:range :Result .
|
|
940
|
+
|
|
941
|
+
:refutedBy a owl:ObjectProperty ;
|
|
942
|
+
rdfs:label "refuted by" ;
|
|
943
|
+
rdfs:domain :Hypothesis ;
|
|
944
|
+
rdfs:range :Result .
|
|
945
|
+
|
|
946
|
+
:usesDataset a owl:ObjectProperty ;
|
|
947
|
+
rdfs:label "uses dataset" ;
|
|
948
|
+
rdfs:domain :Experiment ;
|
|
949
|
+
rdfs:range :Dataset .
|
|
950
|
+
|
|
951
|
+
:reproducedBy a owl:ObjectProperty ;
|
|
952
|
+
rdfs:label "reproduced by" ;
|
|
953
|
+
rdfs:domain :Experiment ;
|
|
954
|
+
rdfs:range :Experiment ;
|
|
955
|
+
rdfs:comment "An Experiment that successfully reproduced this one's Results." .
|
|
956
|
+
|
|
957
|
+
# ─── URI patterns ───────────────────────────────────────────────────
|
|
958
|
+
:UriPattern rdfs:label "URI minting pattern" .
|
|
959
|
+
|
|
960
|
+
:concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
|
|
961
|
+
:topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
|
|
962
|
+
:question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
|
|
963
|
+
:finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
|
|
964
|
+
:hypothesis-pattern a :UriPattern ; skos:notation "urn:dkg:hypothesis:<slug>" .
|
|
965
|
+
:experiment-pattern a :UriPattern ; skos:notation "urn:dkg:experiment:<slug>" .
|
|
966
|
+
:method-pattern a :UriPattern ; skos:notation "urn:dkg:method:<slug>" .
|
|
967
|
+
:result-pattern a :UriPattern ; skos:notation "urn:dkg:result:<slug>" .
|
|
968
|
+
:dataset-pattern a :UriPattern ; skos:notation "urn:dkg:dataset:<slug>" .
|
|
969
|
+
|
|
970
|
+
:slug-normalisation a skos:Note ;
|
|
971
|
+
skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
|
|
972
|
+
`,tR=`# Book-research agent guide
|
|
973
|
+
|
|
974
|
+
This starter ships an RDF ontology for **book-research projects** —
|
|
975
|
+
research notebooks anchored in scholarly sources (citations, quotes,
|
|
976
|
+
arguments, hypotheses). The formal schema lives in \`ontology.ttl\`
|
|
977
|
+
alongside this guide.
|
|
978
|
+
|
|
979
|
+
For V10 MCP tool usage, see
|
|
980
|
+
[\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
|
|
981
|
+
The tool surface to use against this ontology:
|
|
982
|
+
|
|
983
|
+
- \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
|
|
984
|
+
- \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
|
|
985
|
+
- \`dkg_knowledge_asset_share\` — share with peers (SWM)
|
|
986
|
+
- \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
|
|
987
|
+
- \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
|
|
988
|
+
|
|
989
|
+
The longer per-domain agent-guide walkthrough format will return when
|
|
990
|
+
the V10 ontology endpoint and per-project annotation workflow stabilise.
|
|
991
|
+
`,nR=`# Coding-project agent guide
|
|
992
|
+
|
|
993
|
+
This starter ships an RDF ontology for **coding projects** —
|
|
994
|
+
shared project memory for AI coding agents (decisions, tasks, code
|
|
995
|
+
references, GitHub activity, chat turns). The formal schema lives in
|
|
996
|
+
\`ontology.ttl\` alongside this guide.
|
|
997
|
+
|
|
998
|
+
For V10 MCP tool usage, see
|
|
999
|
+
[\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
|
|
1000
|
+
The tool surface to use against this ontology:
|
|
1001
|
+
|
|
1002
|
+
- \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
|
|
1003
|
+
- \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
|
|
1004
|
+
- \`dkg_knowledge_asset_share\` — share with peers (SWM)
|
|
1005
|
+
- \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
|
|
1006
|
+
- \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
|
|
1007
|
+
|
|
1008
|
+
The longer per-domain agent-guide walkthrough format will return when
|
|
1009
|
+
the V10 ontology endpoint and per-project annotation workflow stabilise.
|
|
1010
|
+
`,aR=`# Narrative-writing agent guide
|
|
1011
|
+
|
|
1012
|
+
This starter ships an RDF ontology for **narrative-writing projects** —
|
|
1013
|
+
the structural elements of long-form narrative (Characters, Scenes,
|
|
1014
|
+
PlotPoints, Themes, Settings) and their relationships. The formal
|
|
1015
|
+
schema lives in \`ontology.ttl\` alongside this guide.
|
|
1016
|
+
|
|
1017
|
+
For V10 MCP tool usage, see
|
|
1018
|
+
[\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
|
|
1019
|
+
The tool surface to use against this ontology:
|
|
1020
|
+
|
|
1021
|
+
- \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
|
|
1022
|
+
- \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
|
|
1023
|
+
- \`dkg_knowledge_asset_share\` — share with peers (SWM)
|
|
1024
|
+
- \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
|
|
1025
|
+
- \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
|
|
1026
|
+
|
|
1027
|
+
The longer per-domain agent-guide walkthrough format will return when
|
|
1028
|
+
the V10 ontology endpoint and per-project annotation workflow stabilise.
|
|
1029
|
+
`,iR=`# PKM agent guide
|
|
1030
|
+
|
|
1031
|
+
This starter ships an RDF ontology for **PKM (Personal Knowledge
|
|
1032
|
+
Management) projects** — Notes, Highlights, Insights, and the links
|
|
1033
|
+
that grow a knowledge garden organically. The formal schema lives in
|
|
1034
|
+
\`ontology.ttl\` alongside this guide.
|
|
1035
|
+
|
|
1036
|
+
For V10 MCP tool usage, see
|
|
1037
|
+
[\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
|
|
1038
|
+
The tool surface to use against this ontology:
|
|
1039
|
+
|
|
1040
|
+
- \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
|
|
1041
|
+
- \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
|
|
1042
|
+
- \`dkg_knowledge_asset_share\` — share with peers (SWM)
|
|
1043
|
+
- \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
|
|
1044
|
+
- \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
|
|
1045
|
+
|
|
1046
|
+
The longer per-domain agent-guide walkthrough format will return when
|
|
1047
|
+
the V10 ontology endpoint and per-project annotation workflow stabilise.
|
|
1048
|
+
`,rR=`# Scientific-research agent guide
|
|
1049
|
+
|
|
1050
|
+
This starter ships an RDF ontology for **scientific-research projects** —
|
|
1051
|
+
the empirical research arc (Hypotheses → Experiments → Results →
|
|
1052
|
+
Reproducibility chains), anchored in PROV-O and FaBiO so the graph
|
|
1053
|
+
composes with existing scholarly publishing infrastructure. The formal
|
|
1054
|
+
schema lives in \`ontology.ttl\` alongside this guide.
|
|
1055
|
+
|
|
1056
|
+
For V10 MCP tool usage, see
|
|
1057
|
+
[\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
|
|
1058
|
+
The tool surface to use against this ontology:
|
|
1059
|
+
|
|
1060
|
+
- \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
|
|
1061
|
+
- \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
|
|
1062
|
+
- \`dkg_knowledge_asset_share\` — share with peers (SWM)
|
|
1063
|
+
- \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
|
|
1064
|
+
- \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
|
|
1065
|
+
|
|
1066
|
+
The longer per-domain agent-guide walkthrough format will return when
|
|
1067
|
+
the V10 ontology endpoint and per-project annotation workflow stabilise.
|
|
1068
|
+
`,lR=/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>"{}|\\^`\x00-\x20]+$/;function oR(e){return e?lR.test(e):!1}function Rh(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}function O8(e){return`"${Rh(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(!oR(e))throw new Error(`Invalid /wm/write IRI object: ${e}`);return e}function ta(e){return`"${Rh(e)}"`}function fc(e,n){return`"${Rh(e)}"^^<${_i(n)}>`}function sR({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 cR=Object.assign({"../../../../mcp-dkg/templates/ontologies/book-research/ontology.ttl":QN,"../../../../mcp-dkg/templates/ontologies/coding-project/ontology.ttl":XN,"../../../../mcp-dkg/templates/ontologies/narrative-writing/ontology.ttl":ZN,"../../../../mcp-dkg/templates/ontologies/pkm/ontology.ttl":JN,"../../../../mcp-dkg/templates/ontologies/scientific-research/ontology.ttl":eR}),uR=Object.assign({"../../../../mcp-dkg/templates/ontologies/book-research/agent-guide.md":tR,"../../../../mcp-dkg/templates/ontologies/coding-project/agent-guide.md":nR,"../../../../mcp-dkg/templates/ontologies/narrative-writing/agent-guide.md":aR,"../../../../mcp-dkg/templates/ontologies/pkm/agent-guide.md":iR,"../../../../mcp-dkg/templates/ontologies/scientific-research/agent-guide.md":rR});function dR(){const e={};for(const[n,a]of Object.entries(cR)){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(uR)){const r=n.match(/ontologies\/([^/]+)\/agent-guide\.md$/);if(!r)continue;const o=r[1];e[o]&&(e[o].guide=a)}return e}const _h=dR(),fR=[{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 pR(){return fR.filter(e=>_h[e.slug])}function hR(e){return _h[e]??null}async function mR(e,n){const a=hR(n);if(!a)throw new Error(`Unknown ontology starter '${n}'. Available: ${Object.keys(_h).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}=sR({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 Oh(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 gR(e,n={}){return Oh(`/api/context-graph/${encodeURIComponent(e)}/manifest/publish`,n)}function yR(e,n){return Oh(`/api/context-graph/${encodeURIComponent(e)}/manifest/plan-install`,n)}function vR(e,n){return Oh(`/api/context-graph/${encodeURIComponent(e)}/manifest/install`,n)}const I0="dkg.wireWorkspace.parentDir",P0="dkg.wireWorkspace.nickname",U0="dkg.wireWorkspace.tools",Qf=[{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 xR(e,n){const a=n.split("/"),r=a[a.length-1]??"";return r||(e??"project").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function bR(e){if(!e)return"";const n=e.hostname.replace(/\.local$/,"").replace(/-/g," ");return`${e.username} @ ${n}`}function B0(e){return e==="both"?["cursor","claude-code"]:[e]}function Ob({contextGraphId:e,projectName:n,defaultAgentNickname:a,onDone:r,onCancel:o,variant:s}){var ie;const u=S.useMemo(()=>xR(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),[D,F]=S.useState(null),[U,_]=S.useState(null),[W,P]=S.useState(null);S.useEffect(()=>{let B=!1;return(async()=>{try{const[Q,H]=await Promise.all([fetch("/api/host/info",{headers:Vt()}).then(V=>V.ok?V.json():null),au().catch(()=>null)]);if(B)return;if(Q){p(Q);const V=typeof window<"u"&&window.localStorage.getItem(I0)||Q.defaultWorkspaceParent;x(`${V}/${u}`)}H&&y(H);const ee=typeof window<"u"&&window.localStorage.getItem(P0);a?k(a):ee?k(ee):Q&&k(bR(Q));const ne=typeof window<"u"&&window.localStorage.getItem(U0);ne&&(ne==="cursor"||ne==="claude-code"||ne==="both")&&j(ne)}catch(Q){B||console.warn("[WireWorkspacePanel] host info / identity fetch failed:",Q)}})(),()=>{B=!0}},[u,a]);function M(B){typeof window>"u"||(window.localStorage.setItem(I0,B),b&&window.localStorage.setItem(P0,b),window.localStorage.setItem(U0,C))}async function T(){R(!0),F(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 Q=await yR(e,{workspaceRoot:B,agentNickname:b.trim(),tools:B0(C)});_(Q);const H=B.lastIndexOf("/");H>0&&M(B.slice(0,H))}catch(B){F((B==null?void 0:B.message)||"Preview failed")}finally{R(!1)}}async function G(){R(!0),F(null);try{const B=g.trim(),Q=await vR(e,{workspaceRoot:B,agentNickname:b.trim(),tools:B0(C)});P(Q)}catch(B){F((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(`
|
|
1069
|
+
`),W.skipped.length?`
|
|
1070
|
+
|
|
1071
|
+
Skipped:
|
|
1072
|
+
`+W.skipped.map(B=>` - ${B}`).join(`
|
|
1073
|
+
`):"",W.warnings.length?`
|
|
1074
|
+
|
|
1075
|
+
Warnings:
|
|
1076
|
+
`+W.warnings.map(B=>` - ${B}`).join(`
|
|
1077
|
+
`):""]}),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:[D&&m.jsx("div",{className:"v10-modal-error",style:{marginBottom:12},children:D}),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),F(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:G,disabled:E,children:E?"Installing…":"Install"})]})]})]});const Y=((ie=Qf.find(B=>B.value===C&&!B.disabled))==null?void 0:ie.description)??Qf[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."]}),D&&m.jsx("div",{className:"v10-modal-error",style:{marginBottom:12},children:D}),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:Qf.map((B,Q)=>m.jsx("option",{value:B.disabled?"__disabled__":B.value,disabled:B.disabled,children:B.label},`${B.label}-${Q}`))}),m.jsx("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:Y})]}),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 H0='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), iframe, [tabindex]:not([tabindex="-1"])';function qc(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(H0),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(H0)).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,wR=/<\/?[a-z][^>]*>/i,SR=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,kR=/[a-z0-9]/i;function CR(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 Db(e){if(typeof e!="string")return"";let n=CR(e);return n=n.replace(/[<>]/g,""),n=n.replace(SR,""),n=n.replace(/\s+/g," "),n=n.trim(),n.length>rl&&(n=n.slice(0,rl)),n}function $0(e){const n=Db(e);return n?kR.test(n)?wR.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 q0(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function ER({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=pR(),[C,j]=S.useState(((it=k[0])==null?void 0:it.slug)??"coding-project"),[E,R]=S.useState(!1),[D,F]=S.useState("off"),[U,_]=S.useState("7d"),[W,P]=S.useState("100k"),[M,T]=S.useState(!1),[G,Y]=S.useState(""),[ie,B]=S.useState(null),[Q,H]=S.useState(null),[ee,ne]=S.useState(null),[V,O]=S.useState(null),[L,X]=S.useState(""),[N,ue]=S.useState(!0),[pe,he]=S.useState(!1),{setContextGraphs:Ee,contextGraphs:Ue,setActiveProject:Ne}=ca(),{openTab:et}=mn(),{setStage:Ot,stage:xt}=Nh(),bt=()=>{ue(!0),he(!1),au().then($=>{ne($.agentAddress),he(!1)}).catch(()=>{ne(null),he(!0)}).finally(()=>ue(!1))};S.useEffect(()=>{e&&(H(null),bt())},[e]);const yt=qc(e&&!V,n),Zt=qc(e&&!!V,()=>{O(null),X(""),H(null),r(""),s(""),n()});if(!e)return null;const Pe=Db(a),pt=q0(Pe),Dt=ee&&pt?`${ee}/${pt}`:pt?`<agent-address>/${pt}`:"",Nt=a?$0(a):null,ge=$=>{r($)},Mt=async()=>{const $=Pe;if(!$||Nt)return;T(!0),B(null),H(null),Y(y?"Registering context graph on the network…":"Creating context graph locally…");const le=q0($);if(!ee){B("Agent identity is still loading. Please wait a moment and try again."),T(!1);return}const me=`${ee}/${le}`;try{const ye=setTimeout(()=>Y(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:ee?[ee]:[],register:y}:{accessPolicy:I,publishPolicy:Te,register:y},Ie=await NA(me,$,o.trim()||void 0,at);if(clearTimeout(ye),y&&Ie.registered===!1){const Se=`On-chain registration failed: ${Ie.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]",Se),H(Se)}if(x==="community"||x==="agent")try{Y(`Installing '${C}' ontology…`),await mR(Ie.created,C)}catch(Se){console.warn("[CreateProjectModal] ontology install failed:",Se),Y(`Context graph created, but ontology install failed: ${(Se==null?void 0:Se.message)??Se}`)}let Xe=!0;try{Y("Publishing context graph manifest…"),await gR(Ie.created,{})}catch(Se){Xe=!1,console.warn("[CreateProjectModal] manifest publish failed:",Se),Y(`Context graph created, but manifest publish failed: ${(Se==null?void 0:Se.message)??Se}`)}Y("Refreshing context graph list…");const{contextGraphs:Ve}=await bh();Ee(Ve??[]),Ne(Ie.created),et({id:`project:${Ie.created}`,label:$,closable:!0}),xt<2&&Ot(2),Xe?(X($),O(Ie.created),Y("")):setTimeout(()=>{r(""),s(""),Y(""),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)),Y("")}finally{T(!1)}},qn=Ue.length===0;function yn(){O(null),X(""),H(null),r(""),s(""),n()}return V?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 ",L]}),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:[Q&&m.jsx("div",{className:"v10-modal-warning",children:Q}),m.jsx(Ob,{contextGraphId:V,projectName:L,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}),Q&&m.jsx("div",{className:"v10-modal-warning",children:Q}),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:D,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()||!!$0(a)||M||!ee||N,children:M?G||"Creating…":ee?"Create Context Graph":pe?"Agent unavailable":"Loading agent…"})]})]})})}function Dh(e){return{agentDid:e.agentDid,peerId:e.peerId}}function Fc(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 lu(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 AR(e,n,a){const r=e.filter(o=>lu(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 jR(e,n){return!(lu(e,n)||Fc(e.accessPolicy)!=="public")}function TR(e){return e.subscribed===!0||e.synced===!0?"project":"catalogue"}function NR(e){return e.alreadyMember===!0||e.autoApproved===!0||e.status==="approved"||e.status==="already-member"}const F0=/^(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|12D3Koo[1-9A-HJ-NP-Za-km-z]{45,53})$/;function RR(e){var b;const n=e.trim().replace(/\\n/g,`
|
|
1078
|
+
`),a=n.split(`
|
|
1079
|
+
`).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&&F0.test(k[1])&&(f=k[1])}else for(const k of[o,...a.slice(1)]){const C=k.trim();if(F0.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 _R(e,n){return!e.hasUnparsedExtra&&n.some(a=>a.id===e.cgId&&Fc(a.accessPolicy)==="public")}function G0(e,n){const a=RR(e);return _R(a,n)?{kind:"publicSubscribe",invite:a,validationError:W0(a,{allowBareContextGraphId:!0}),idleLabel:"Subscribe",sendingLabel:"Subscribing…"}:{kind:"privateJoin",invite:a,validationError:W0(a),idleLabel:"Request to Join",sendingLabel:"Sending request…"}}async function V0(e){if(e.curatorPeerId){await EA(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 CA(e.legacyMultiaddr).catch(()=>{}))}function W0(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 OR(e){if(e instanceof gn&&e.status===502){const n=DR(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(MR),o=r?"Curator rejected this join request.":"Couldn't deliver this join request to the curator.",s=LR(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 DR(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 MR(e){const n=e.replace(/^[^:]+:\s*/,"").trim();return!(!n||/^dial failed\b/i.test(n)||/^not curator$/i.test(n))}function LR(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 zR({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:D}=ca(),{openTab:F}=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=>{D(ne.id),F({id:`project:${ne.id}`,label:ne.name||ne.id,closable:!0})},[D,F]),_=S.useCallback(async(ne,V)=>{const{contextGraphs:O}=await bh(),L=O??[];R(L);const X=L.find(N=>N.id===ne)??V;return X&&U(X),X},[R,U]),W=S.useCallback(async ne=>{u("approved");try{const V=await _(ne);V&&(j(V.name??ne),k(ne))}catch{}},[_]),P=S.useCallback(ne=>{var O;if(!(!f||ne.type!=="join_approved"&&ne.type!=="join_rejected"||((O=ne.data)==null?void 0:O.contextGraphId)!==f)){if(ne.type==="join_rejected"){u("rejected");return}W(f)}},[f,W]);pl(P);const M=qc(e&&!b,n),T=qc(e&&!!b,()=>{k(null),j(""),n()});if(!e)return null;const G=async()=>{const ne=G0(r,E);if(ne.validationError){p(ne.validationError);return}const{cgId:V,curatorPeerId:O}=ne.invite;if(p(null),ne.kind==="publicSubscribe"){u("sending");try{const X=E.find(N=>N.id===V);await V0(ne.invite),await Ej(V,{syncMode:g?"always-on":"on-demand"}),await _(V,X),n()}catch(X){p(X instanceof Error?X.message:"Could not subscribe to this public context graph."),u("idle")}return}const L=E.find(X=>X.id===V);if(L){U(L),n();return}u("sending");try{await V0(ne.invite);const X=await _A(V),N=await au().then(pe=>pe.name).catch(()=>{}),ue=await OA(V,{delegation:X.delegation,agentName:N,curatorPeerId:O??void 0});if(y(V),NR(ue)){await W(V);return}u("pending")}catch(X){p(OR(X)),u("idle")}};function Y(){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:Y,"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(Ob,{contextGraphId:b,projectName:C,variant:"join",onDone:Y})})]})});const ie=s==="sending",B=s==="pending",Q=s==="approved",H=s==="rejected",ee=G0(r,E);return m.jsx("div",{className:"v10-modal-overlay",onClick:M.onBackdropClick,role:"presentation",children:m.jsxs("div",{className:"v10-modal-box",ref:M.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."}),Q&&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…"}),H&&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
|
|
1080
|
+
|
|
1081
|
+
Private: paste the curator invite
|
|
1082
|
+
my-context-graph-abc123
|
|
1083
|
+
12D3KooW...`,value:r,onChange:ne=>o(ne.target.value),autoFocus:!0,rows:3,disabled:ie||B||Q,style:{fontFamily:"var(--font-mono)",fontSize:11},"aria-label":"Context graph invite code",autoComplete:"off",spellCheck:!1})]}),ee.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||Q?"Close":"Cancel"}),m.jsx("button",{className:"v10-modal-btn primary",onClick:G,disabled:!r.trim()||ie||B||Q,children:ie?ee.sendingLabel:B?"Awaiting approval…":Q?"Approved":ee.idleLabel})]})]})})}const Mb="v10:hiddenProjectIds",Up="v10:hidden-projects-change";function Xf(){try{const e=localStorage.getItem(Mb);if(!e)return new Set;const n=JSON.parse(e);return new Set(Array.isArray(n)?n:[])}catch{return new Set}}function Y0(e){try{localStorage.setItem(Mb,JSON.stringify([...e])),window.dispatchEvent(new Event(Up))}catch{}}function Lb(){const[e,n]=S.useState(()=>Xf());S.useEffect(()=>{const o=()=>n(Xf());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(Xf());s.add(o),Y0(s)},[]),r=S.useCallback(()=>{Y0(new Set)},[]);return{hidden:e,hide:a,unhideAll:r}}function K0({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 IR({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 PR(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 UR(){const[e,n]=S.useState([]),[a,r]=S.useState(null),o=S.useCallback(()=>{ru().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:PR(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 BR(){const e=aa(V=>V.leftSectionMyProjectsOpen),n=aa(V=>V.leftSectionIntegrationsOpen),a=aa(V=>V.toggleLeftSectionMyProjects),r=aa(V=>V.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=Nh(V=>V.stage),[C,j]=S.useState("explorer"),{hidden:E,hide:R,unhideAll:D}=Lb(),F=Ch().data,U=F?Dh(F):null,_=f.filter(V=>!E.has(V.id)),W=_.filter(V=>lu(V,U)),P=_.filter(V=>jR(V,U)),M=f.length-_.length,[T,G]=S.useState(!1),[Y,ie]=S.useState(!1),[B,Q]=S.useState(),H=S.useCallback(V=>{Q(V),ie(!0)},[]),ee=S.useCallback(()=>{ie(!1),Q(void 0)},[]),ne=S.useCallback(()=>{g(!0),Bn.fetchContextGraphs().then(({contextGraphs:V})=>y(V??[])).catch(()=>{}).finally(()=>g(!1))},[y,g]);return Ho(ne,6e4),pl(S.useCallback(V=>{(V.type==="join_approved"||V.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:()=>G(!0),children:"+ New Context Graph"}),m.jsx("button",{className:"v10-new-project-btn",onClick:()=>H(),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:()=>G(!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(Ip,{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(V=>m.jsx(K0,{cg:V,isActive:x===V.id,onSelect:()=>{b(V.id),u({id:`project:${V.id}`,label:V.name||V.id.slice(0,16),closable:!0})},onHide:()=>{R(V.id),x===V.id&&b(null)}},V.id))})]}),M>0&&m.jsxs("button",{type:"button",className:"v10-tree-show-hidden",onClick:D,title:"Restore all context graphs dismissed from the sidebar",children:["↺ Show ",M," hidden context graph",M!==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(Ip,{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(UR,{})})]})]}),C==="oracle"&&m.jsxs("div",{className:"v10-tree-content",children:[P.length>0&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"v10-tree-group-label",children:"Context Oracle"}),P.map(V=>{const O=()=>{R(V.id),x===V.id&&b(null)};return TR(V)==="catalogue"?m.jsx(IR,{cg:V,isBrowsing:d===`project:${V.id}`,onBrowse:()=>{b(null),u({id:`project:${V.id}`,label:V.name||V.id.slice(0,16),closable:!0})},onSubscribe:()=>H(V.id),onHide:O},V.id):m.jsx(K0,{cg:V,isActive:x===V.id,onSelect:()=>{b(V.id),u({id:`project:${V.id}`,label:V.name||V.id.slice(0,16),closable:!0})},onHide:O},V.id)})]}),P.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."]}),M>0&&m.jsxs("button",{type:"button",className:"v10-tree-show-hidden",onClick:D,title:"Restore all context graphs dismissed from the sidebar",children:["↺ Show ",M," hidden context graph",M!==1?"s":""]})]}),m.jsx(ER,{open:T,onClose:()=>G(!1)}),m.jsx(zR,{open:Y,onClose:ee,initialContextGraphId:B})]})}const HR=[/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 zb(e,n=0){if(!(!(e instanceof Error)||n>4))return e.name==="ChunkLoadError"||e.code==="CSS_CHUNK_LOAD_FAILED"||HR.some(a=>a.test(e.message))?e:zb(e.cause,n+1)}function $R(){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($R,{})}const r=hn.lazy(async()=>{try{return{default:await e()}}catch(s){const u=zb(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 Zf(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 D8(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 Q0(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 qR(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 X0(e,n=8){return e?e.length<=n*2?e:e.slice(0,n)+"..."+e.slice(-4):"—"}function FR(){const e=ca(g=>g.contextGraphs),n=ca(g=>g.setContextGraphs),{hidden:a}=Lb(),[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(Dh(x))}).catch(()=>{}).finally(()=>{g&&u(!1)}),()=>{g=!1}},[e]),{myCgs:S.useMemo(()=>e.filter(g=>!a.has(g.id)).filter(g=>lu(g,r)),[e,a,r]),identity:r,identityLoading:s,cgsLoading:d}}const Ib=["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 GR(e={}){const n={predicates:[...e.extraPredicates??[],...Ib]};return e.minZoomForLabels!==void 0&&(n.minZoomForLabels=e.minZoomForLabels),n}function Pb(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 Z0="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",VR="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 Pb(e);const n=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=Math.max(n,a);return r>=0?e.slice(r+1):e}function WR(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 YR(e){const n=WR(e).trim();return n?(/^[0-9a-f-]{16,}$/i.test(n)?n.replace(/-/g,"").slice(0,12):n).replace(/[_-]+/g," ").trim():""}function KR(e,n){return e===n&&/^urn:dkg:extraction:[^\s]+$/i.test(n)}function QR(e,n){return e===n&&jc(n)}function XR(e){const n=YR(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 ZR(e){for(const a of Ib){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||!QR(e.label,e.uri))&&!KR(e.label,e.uri)?e.label:XR(e)}const Ub=5e4,Ao=2e4,Bb=2e4;function J0(e,n){const a=`did:dkg:context-graph:${e}`,r=n==="wm"?`(
|
|
1084
|
+
STRSTARTS(STR(?g), "${a}/meta/assertion/") ||
|
|
1085
|
+
STRSTARTS(STR(?g), "${a}/meta/_working_memory/")
|
|
1086
|
+
)`:`STRSTARTS(STR(?g), "${a}/meta/_shared_memory/")`;return`SELECT ?s ?p ?o ?g WHERE {
|
|
1087
|
+
GRAPH ?g {
|
|
1088
|
+
?catalog a <${VR}> .
|
|
1089
|
+
?s ?p ?o
|
|
1090
|
+
}
|
|
1091
|
+
FILTER(${r})
|
|
1092
|
+
} LIMIT ${Ao}`}function JR(e){const n=`did:dkg:context-graph:${e}`;return`SELECT ?s ?p ?o ?g WHERE {
|
|
1093
|
+
GRAPH ?g { ?s ?p ?o }
|
|
1094
|
+
FILTER(
|
|
1095
|
+
STRSTARTS(STR(?g), "${n}/") &&
|
|
1096
|
+
(CONTAINS(STR(?g), "/assertion/") || CONTAINS(STR(?g), "/_working_memory/")) &&
|
|
1097
|
+
STR(?g) != "${n}/meta" &&
|
|
1098
|
+
!CONTAINS(STR(?g), "/meta/") &&
|
|
1099
|
+
!STRENDS(STR(?g), "/_meta")
|
|
1100
|
+
)
|
|
1101
|
+
} LIMIT ${Ub}`}function e4(e){const n=`did:dkg:context-graph:${e}`;return`SELECT ?s ?p ?o ?g WHERE {
|
|
1102
|
+
GRAPH ?g { ?s ?p ?o }
|
|
1103
|
+
FILTER(
|
|
1104
|
+
STRSTARTS(STR(?g), "${n}") &&
|
|
1105
|
+
(STRENDS(STR(?g), "/_shared_memory") || CONTAINS(STR(?g), "/_shared_memory/")) &&
|
|
1106
|
+
STR(?g) != "${n}/meta/_shared_memory" &&
|
|
1107
|
+
!CONTAINS(STR(?g), "/meta/") &&
|
|
1108
|
+
!CONTAINS(STR(?g), "/_shared_memory/staging/") &&
|
|
1109
|
+
?p != <http://dkg.io/ontology/workspaceOwner>
|
|
1110
|
+
)
|
|
1111
|
+
} LIMIT ${Ao}`}function t4(e){const n=`did:dkg:context-graph:${e}`;return`SELECT ?s ?p ?o ?g WHERE {
|
|
1112
|
+
GRAPH ?g { ?s ?p ?o }
|
|
1113
|
+
FILTER(
|
|
1114
|
+
STRSTARTS(STR(?g), "${n}") &&
|
|
1115
|
+
!CONTAINS(STR(?g), "/assertion/") &&
|
|
1116
|
+
!CONTAINS(STR(?g), "/_working_memory") &&
|
|
1117
|
+
!CONTAINS(STR(?g), "/_shared_memory") &&
|
|
1118
|
+
!CONTAINS(STR(?g), "_verifiable_memory_meta") &&
|
|
1119
|
+
!STRENDS(STR(?g), "/_meta") &&
|
|
1120
|
+
STR(?g) != "${n}/meta" &&
|
|
1121
|
+
!CONTAINS(STR(?g), "/meta/") &&
|
|
1122
|
+
!CONTAINS(STR(?g), "/_private") &&
|
|
1123
|
+
!CONTAINS(STR(?g), "/_rules")
|
|
1124
|
+
)
|
|
1125
|
+
} LIMIT ${Bb}`}function n4(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 e1={wm:"loading",swm:"loading",vm:"loading"},a4={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?n4(b,n):void 0}}).filter(x=>x.subject&&x.predicate&&x.object),ok:!0,truncated:y}}catch{return{triples:[],ok:!1,truncated:!1}}}function i4(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===Z0){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(Pb(f.object)),y.properties.set(f.predicate,b)}}}for(const f of n.values())f.label=ZR(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===Z0){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 r4=i4;function l4(e){return e.types.length>0||e.properties.size>0||e.connections.length>0}function o4(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(e1),k=S.useRef(0),C=S.useCallback(async()=>{if(!e)return;const U=++k.current;d(!0),f(null),g(!1),b(e1);try{const _={includeContextGraphPartitions:!0},W={triples:[],ok:!0,truncated:!1},[P,M,T,G,Y]=await Promise.all([po(JR(e),e,{..._,layerLimit:Ub}),po(e4(e),e,{..._,layerLimit:Ao}),po(t4(e),e,{..._,layerLimit:Bb}),r?po(J0(e,"wm"),e,{..._,layerLimit:Ao}):Promise.resolve(W),r?po(J0(e,"swm"),e,{..._,layerLimit:Ao}):Promise.resolve(W)]);if(U!==k.current)return;const ie=[...P.triples.map(V=>({...V,layer:"working"})),...G.triples.map(V=>({...V,layer:"working"})),...M.triples.map(V=>({...V,layer:"shared"})),...Y.triples.map(V=>({...V,layer:"shared"})),...T.triples.map(V=>({...V,layer:"verified"}))],B=P.ok&&G.ok,Q=M.ok&&Y.ok;s(ie),b({wm:B?"ok":"error",swm:Q?"ok":"error",vm:T.ok?"ok":"error"});const H=[{ok:B,truncated:P.truncated||G.truncated},{ok:Q,truncated:M.truncated||Y.truncated},T],ee=H.filter(V=>!V.ok).length,ne=H.some(V=>V.truncated);g(ee>0&&ee<3||ne),f(a&&ee===3?"Failed to load memory data":null)}catch(_){U===k.current&&(f(_.message??"Failed to load memory data"),b(a4))}finally{U===k.current&&d(!1)}},[e,r,a]);aT(e,C),S.useEffect(()=>{C()},[C]);const j=S.useMemo(()=>r4(o),[o]),E=S.useMemo(()=>[...j.values()].filter(l4).sort((U,_)=>{const W={verified:0,shared:1,working:2},P=W[U.trustLevel]-W[_.trustLevel];if(P!==0)return P;const M=U.tripleCount??0,T=_.tripleCount??0;return T!==M?T-M: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:P,subGraph:M})=>({subject:_,predicate:W,object:P,subGraph:M}))},[o]),D=S.useMemo(()=>{const U=new Map;for(const[_,W]of j)U.set(_,W.trustLevel);return U},[j]),F=S.useMemo(()=>{let U=0,_=0,W=0;for(const P of E)P.trustLevel==="verified"?W++:P.trustLevel==="shared"?_++:U++;return{wm:U,swm:_,vm:W,total:E.length}},[E]);return{entities:j,entityList:E,allTriples:o,graphTriples:R,trustMap:D,counts:F,loading:u,error:p,partial:y,layerStatus:x,refresh:C}}const $o="http://dkg.io/viz/",Hb=`${$o}OnChainAnchor`,$b=`${$o}AgentIdentity`,qb=`${$o}anchoredIn`,Fb=`${$o}signedBy`,Gb=`${$o}consensus`,t1="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",n1="http://schema.org/name",a1="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 s4(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 c4(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 u4(e){return`PREFIX dkg: <http://dkg.io/ontology/>
|
|
1126
|
+
PREFIX prov: <http://www.w3.org/ns/prov#>
|
|
1127
|
+
SELECT ?op ?root ?agent ?publishedAt ?g WHERE {
|
|
1128
|
+
GRAPH ?g {
|
|
1129
|
+
?op a dkg:WorkspaceOperation ;
|
|
1130
|
+
dkg:rootEntity ?root ;
|
|
1131
|
+
dkg:publishedAt ?publishedAt ;
|
|
1132
|
+
prov:wasAttributedTo ?agent .
|
|
1133
|
+
}
|
|
1134
|
+
FILTER(
|
|
1135
|
+
STRSTARTS(STR(?g), "${`did:dkg:context-graph:${e}/`}") &&
|
|
1136
|
+
CONTAINS(STR(?g), "_shared_memory_meta")
|
|
1137
|
+
)
|
|
1138
|
+
} ORDER BY ?publishedAt LIMIT 2000`}function d4(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 f4(e){const n=e.lastIndexOf(":");return n>=0?e.slice(n+1):e}function p4(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:t1,object:Hb,subGraph:o.subGraph}),a.push({subject:u,predicate:n1,object:`"${s4(o)}"`,subGraph:o.subGraph}),a.push({subject:u,predicate:a1,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:qb,object:u,subGraph:o.subGraph}),a.push({subject:d,predicate:Gb,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:Fb,object:f,subGraph:o.subGraph}),r.has(f)||(r.add(f),a.push({subject:f,predicate:t1,object:$b,subGraph:o.subGraph}),a.push({subject:f,predicate:n1,object:`"${c4(p)}"`,subGraph:o.subGraph}),a.push({subject:f,predicate:a1,object:`"${p}"`,subGraph:o.subGraph}))}}return a}function M8(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:u4(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 D=ho(R.op),F=ho(R.root),U=ho(R.agent),_=ho(R.publishedAt),W=ho(R.g);if(!D||!F||!U||!_)continue;let P=E.get(D);P||(P={opId:f4(D),opUri:D,agents:[],roots:[],publishedAt:_,subGraph:W?d4(W,e):void 0},E.set(D,P)),P.roots.includes(F)||P.roots.push(F),P.agents.includes(U)||P.agents.push(U)}if(x!==p.current)return;r([...E.values()].sort((R,D)=>D.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(()=>p4(a,y),[a,y]);return{anchors:a,decorationTriples:g,loading:o,error:u}}function L8(e){return e.activeSubGraph?!1:e.activeLayer==="swm"}const z8={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"}},h4="http://www.w3.org/ns/prov#wasAttributedTo",hl="http://dkg.io/ontology/agent/",m4=hl+"createdBy",g4=hl+"promotedBy",y4=hl+"publishedBy",v4=hl+"createdAt",x4=hl+"promotedAt",b4=hl+"publishedAt";function w4(e){for(const n of e.connections)if(n.predicate===h4)return n.targetUri;return null}function I8(e,n){const a=n==="created"?m4:n==="promoted"?g4:y4;for(const r of e.connections)if(r.predicate===a)return r.targetUri;return w4(e)}function P8(e,n){const a=n==="created"?v4:n==="promoted"?x4:b4,r=e.properties.get(a);return(r==null?void 0:r[0])??null}function i1(e){const n=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=Math.max(n,a);return r>=0?e.slice(r+1):e}function U8(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 B8(e,n){var o,s;if(n)for(const u of e.types){const d=n.forType(u),p=i1(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]?i1(e.types[0]):"Entity";return{...Xr[a]??Xr.Thing,type:a}}const Vb={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 H8(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/",S4={[jn+"Package"]:"#a855f7",[jn+"File"]:"#3b82f6",[jn+"Class"]:"#22c55e",[jn+"Interface"]:"#06b6d4",[jn+"Function"]:"#f59e0b",[jn+"TypeAlias"]:"#ec4899",[jn+"Enum"]:"#ef4444",[jn+"ExternalModule"]:"#64748b",[Hb]:"#f5a524",[$b]:"#c084fc"},k4={[jn+"imports"]:"#60a5fa",[jn+"contains"]:"#a855f7",[jn+"definedIn"]:"#3b82f6",[jn+"exports"]:"#f59e0b",[jn+"extends"]:"#22c55e",[jn+"implements"]:"#06b6d4",[qb]:"#f5a524",[Fb]:"#c084fc",[Gb]:"#22c55e"};function C4(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 $8(e,n){const{color:a}=Vb[e],r=e==="vm";return{labelMode:"humanized",renderer:"2d",labels:GR({minZoomForLabels:r?.2:.3}),style:{classColors:S4,predicateColors:k4,namespaceColors:C4(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 q8(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 F8(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 G8(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 Mh(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 V8(e,n){return!n.isRoot&&e.subGraph===n.slug?!0:e.subGraph?!1:n.scopedUris.has(e.subject)?!0:n.requireResourceObject?Mh(e.object)&&n.scopedUris.has(e.object):n.scopedUris.has(e.object)}function Wb(e,n){const a=n.get(Xt(e.subject));return a!==void 0&&a.trustLevel!==e.layer}function Yb(e,n){if(!Mh(e.object))return!1;const a=n.get(Xt(e.object));return a!==void 0&&a.trustLevel!==e.layer}function Kb(e,n){return Wb(e,n)||Yb(e,n)}function Qb(e,n){return Wb(e,n)&&Yb(e,n)}function E4(e,n){const a=new Set,r=[];for(const o of e){if(Qb(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 W8(e){return S.useMemo(()=>{const n=E4(e.allTriples,e.entities);return{triples:n,total:n.length}},[e.allTriples,e.entities])}function A4(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)}`;!Qb(f,e.entities)&&!o.has(y)&&(o.add(y),p++),Kb(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 Y8(e,n){const a=Vb[n].trustLevel;return S.useMemo(()=>{const r=new Set,o=[];for(const s of e.allTriples){if(s.layer!==a||Kb(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 j4="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function T4(e){const n=e.trim();return(n.startsWith("<")&&n.endsWith(">")?n.slice(1,-1):n)===j4}function K8(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))||Mh(s.object)&&!T4(s.predicate)&&!n.has(Xt(s.object))||r.push(s)}return r}const Q8="http://dkg.io/ontology/sourceContentType",X8="http://dkg.io/ontology/markdownForm",Z8="http://dkg.io/ontology/sourceFile",J8="http://dkg.io/ontology/size";function e9(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 t9(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 n9(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 a9(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 N4(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 R4(e){if(!(e==null||e===""))return`Exact balance: ${e} (full precision from chain)`}function _4(e){if(e==null)return"—";const n=e/100;return`${n%1===0?n.toFixed(0):n.toFixed(1)}%`}function O4(){jb();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}=Ab();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?`${_4(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 D4="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 Jf(e){var o;const n=Nb(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 ep({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 r1({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 M4(){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 L4({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 z4({cg:e,identity:n,onReport:a,onOpen:r}){var W,P;const o=o4(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 M=++g.current;Bn.listParticipants(e.id).then(T=>{y.current&&M===g.current&&(u((T.allowedAgents??[]).map(Mi)),p(!1))}).catch(()=>{y.current&&M===g.current&&(u(null),p(!0))})},[e.id]);S.useEffect(()=>{y.current=!0,u(null),p(!1),x();const M=setInterval(x,3e4);return()=>{y.current=!1,clearInterval(M)}},[x]),pl(S.useCallback(M=>{var G,Y;if(M.type!=="join_approved"&&M.type!=="join_rejected"&&M.type!=="project_synced")return;const T=((G=M.data)==null?void 0:G.contextGraphId)??((Y=M.data)==null?void 0:Y.projectId);T&&T!==e.id||x()},[e.id,x]));const b=Fc(e.accessPolicy)==="public",k=S.useMemo(()=>{var Y;if(b)return null;const M=(Y=e.curator)==null?void 0:Y.trim(),T=M?Mi(M):null;if(s===null)return d&&T?[T]:null;const G=new Set(s);return T&&G.add(T),[...G]},[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 M=new Set(o.allTriples.map(T=>T.subject)).size;return{wm:o.counts.wm,swm:o.counts.swm,vm:o.counts.vm,total:M}},[o.error,o.allTriples,o.counts.wm,o.counts.swm,o.counts.vm,C]),E=A4(o),R=S.useMemo(()=>({wm:E.wm,swm:E.swm,vm:E.vm,total:E.canonical}),[E]),D=[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:D})},[e.id,D]);const F=Fc(e.accessPolicy),U=F==="private"?"Curated":F==="public"?"Public":"Unknown",_=!!((W=e.curator)!=null&&W.trim()&&((P=n==null?void 0:n.agentDid)!=null&&P.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:F==="private"?m.jsx(ZT,{size:13,"aria-hidden":"true"}):F==="public"?m.jsx(YT,{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 l1={wm:0,swm:0,vm:0,total:0};function I4(){var _,W;const{data:e}=Zf(Bn.fetchStatus,[],1e4),{data:n}=Zf(Bn.fetchEconomics,[],6e4),{data:a,loading:r,error:o}=Zf(Bn.fetchWalletsBalances,[],3e4),{openTab:s}=mn(),{setActiveProject:u}=ca(),{myCgs:d,identity:p,identityLoading:f,cgsLoading:y}=FR(),g=(f||y)&&d.length===0,[x,b]=S.useState({}),k=S.useCallback((P,M)=>{b(T=>{var G;return((G=T[P])==null?void 0:G.sig)===M.sig?T:{...T,[P]:M}})},[]);S.useEffect(()=>{const P=new Set(d.map(M=>M.id));b(M=>{const T=Object.keys(M);if(T.every(Y=>P.has(Y)))return M;const G={};for(const Y of T)P.has(Y)&&(G[Y]=M[Y]);return G})},[d]);const C=S.useMemo(()=>{const P={...l1},M={...l1},T=new Set;let G=!1,Y=!1,ie=!1,B=!1,Q=!1;for(const ee of d){const ne=x[ee.id];if(!ne){G=!0,Y=!0;continue}ne.sizeLoading&&(G=!0),ne.agentsLoading&&(Y=!0),ne.sizeError&&(ie=!0),ne.sizeFallback&&(Q=!0),(ne.agentsError||ne.agentsUnknown)&&(B=!0);for(const V of["wm","swm","vm","total"])P[V]+=ne.entities[V],M[V]+=ne.triples[V];for(const V of ne.agents)T.add(V)}const H=d.length>0;return{entities:P,triples:M,agentCount:T.size,sizeLoading:H&&G,agentsLoading:H&&Y,sizePartial:ie,agentsPartial:B,triplesUnknown:H&&ie&&M.total===0,sizeApprox:H&&Q,hasCgs:H}},[d,x]),j=S.useMemo(()=>{var G,Y;const P=(G=p==null?void 0:p.agentDid)!=null&&G.trim()?Mi(p.agentDid):null;let M=0,T=0;for(const ie of d)!!(P&&((Y=ie.curator)!=null&&Y.trim())&&Mi(ie.curator)===P)?M++:T++;return{curator:M,joined:T}},[d,p]),E=[{label:"24h",display:"Last 24h"},{label:"7d",display:"Last 7d"},{label:"30d",display:"Last 30d"}],R=P=>{if(P==null||typeof P=="string"&&P.trim()==="")return"—";const M=Number(P);return isFinite(M)?M.toLocaleString(void 0,{maximumFractionDigits:M>=1e3?0:2}):String(P)},D=E.map(P=>{var T;const M=(T=n==null?void 0:n.periods)==null?void 0:T.find(G=>G.label===P.label);return{display:P.display,publishes:M?String(M.publishCount):"—",trac:M?R(M.totalTrac):"—"}});a!=null&&a.symbol;const F=(a==null?void 0:a.balances)??[],U=P=>P.length>12?`${P.slice(0,6)}…${P.slice(-4)}`:P;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?` · ${Jf(a.chainId).name}`:""]})]}),m.jsxs("div",{className:"v10-dash-stats v10-dash-stats-3",children:[m.jsx(ep,{label:"My Context Graphs",className:"v10-stat-tight",icon:m.jsx(_0,{size:13,"aria-hidden":!0}),value:g?m.jsx("span",{className:"v10-stat-loading",children:"loading…"}):d.length,accentColor:"var(--accent-blue)",sub:D4,children:C.hasCgs&&!g?m.jsx(L4,{curator:j.curator,joined:j.joined,refreshing:f}):null}),m.jsxs(ep,{label:"Context Graph Size",icon:m.jsx(rN,{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(r1,{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(r1,{counts:C.triples})]}),m.jsx(M4,{})]}):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(ep,{label:"Collaborating Agents",icon:m.jsx(cN,{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(_0,{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(P=>m.jsx(z4,{cg:P,identity:p,onReport:k,onOpen:M=>{u(M.id),s({id:`project:${M.id}`,label:M.name||M.id.slice(0,12),closable:!0})}},P.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(dN,{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:Jf(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…"}):F.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 (",Jf(a==null?void 0:a.chainId).gas,")"]})]}),F.map(P=>m.jsxs("div",{className:"v10-ws-wrow",children:[m.jsx("span",{className:"v10-ws-addr",title:P.address,children:U(P.address)}),m.jsx("span",{className:"v10-ws-bal",children:R(P.trac)}),m.jsx("span",{className:"v10-ws-bal-sec",title:R4(P.eth),children:N4(P.eth)})]},P.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(P=>m.jsxs("li",{className:"v10-ws-wallet",children:[m.jsx("span",{className:"v10-ws-addr",title:P,children:U(P)}),m.jsx("span",{className:"v10-cg-dim",children:"—"})]},P))}):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)&&(F.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"})]}),D.map(P=>m.jsxs("div",{className:"v10-ws-spend-row",children:[m.jsx("span",{className:"v10-cg-dim",children:P.display}),m.jsx("span",{className:"v10-ws-spend-val",children:P.publishes}),m.jsx("span",{className:"v10-ws-spend-val",children:P.trac})]},P.display))]}),m.jsx(O4,{})]})]})]})}const Lh="context-graph-primer",P4={id:Lh,label:"What is a Context Graph?",closable:!0},U4=[{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 B4(){const e=mn(a=>a.closeTab),n=hn.useCallback(()=>e(Lh),[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:U4.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 zh="doc:";function i9(e,n,a){return`${zh}${e}|${n}|${a}`}function r9(e,n,a){return e?{ref:e,contentType:"text/markdown"}:n?{ref:n,contentType:a}:{ref:void 0,contentType:a}}function H4(e){const n=e.slice(zh.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 $4(e,n){const a=n||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const q4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,F4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,G4={};function o1(e,n){return(G4.jsx?F4:q4).test(e)}const V4=/[ \t\n\f\r]/g;function W4(e){return typeof e=="object"?e.type==="text"?s1(e.value):!1:s1(e)}function s1(e){return e.replace(V4,"")===""}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 Xb(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 Y4=0;const ze=dr(),Ut=dr(),$p=dr(),de=dr(),vt=dr(),il=dr(),Un=dr();function dr(){return 2**++Y4}const qp=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Ut,commaOrSpaceSeparated:Un,commaSeparated:il,number:de,overloadedBoolean:$p,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),tp=Object.keys(qp);class Ih extends Tn{constructor(n,a,r,o){let s=-1;if(super(n,a),c1(this,"space",o),typeof r=="number")for(;++s<tp.length;){const u=tp[s];c1(this,tp[s],(r&qp[u])===qp[u])}}}Ih.prototype.defined=!0;function c1(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 Ih(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 Zb=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 Jb(e,n){return n in e?e[n]:n}function ew(e,n){return Jb(e,n.toLowerCase())}const K4=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:ze,allowPaymentRequest:ze,allowUserMedia:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:vt,autoFocus:ze,autoPlay:ze,blocking:vt,capture:null,charSet:null,checked:ze,cite:null,className:vt,cols:de,colSpan:null,content:null,contentEditable:Ut,controls:ze,controlsList:vt,coords:de|il,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:$p,draggable:Ut,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,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:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:vt,itemRef:vt,itemScope:ze,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,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:ze,optimum:de,pattern:null,ping:vt,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:vt,required:ze,reversed:ze,rows:de,rowSpan:de,sandbox:vt,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootDelegatesFocus:ze,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:ze,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:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,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:ze,disableRemotePlayback:ze,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:ew}),Q4=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:ze,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:Jb}),tw=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()}}),nw=ml({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ew}),aw=ml({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),X4={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"},Z4=/[A-Z]/g,u1=/-[a-z]/g,J4=/^data[-\w.:]+$/i;function e3(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"&&J4.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(u1,n3);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!u1.test(s)){let u=s.replace(Z4,t3);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}o=Ih}return new o(r,n)}function t3(e){return"-"+e.toLowerCase()}function n3(e){return e.charAt(1).toUpperCase()}const a3=Xb([Zb,K4,tw,nw,aw],"html"),Ph=Xb([Zb,Q4,tw,nw,aw],"svg");function i3(e){return e.join(" ").trim()}var Zr={},np,d1;function r3(){if(d1)return np;d1=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=`
|
|
1139
|
+
`,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,D=1;function F(B){var Q=B.match(n);Q&&(R+=Q.length);var H=B.lastIndexOf(p);D=~H?B.length-H:D+B.length}function U(){var B={line:R,column:D};return function(Q){return Q.position=new _(B),M(),Q}}function _(B){this.start=B,this.end={line:R,column:D},this.source=E.source}_.prototype.content=j;function W(B){var Q=new Error(E.source+":"+R+":"+D+": "+B);if(Q.reason=B,Q.filename=E.source,Q.line=R,Q.column=D,Q.source=j,!E.silent)throw Q}function P(B){var Q=B.exec(j);if(Q){var H=Q[0];return F(H),j=j.slice(H.length),Q}}function M(){P(a)}function T(B){var Q;for(B=B||[];Q=G();)Q!==!1&&B.push(Q);return B}function G(){var B=U();if(!(f!=j.charAt(0)||y!=j.charAt(1))){for(var Q=2;g!=j.charAt(Q)&&(y!=j.charAt(Q)||f!=j.charAt(Q+1));)++Q;if(Q+=2,g===j.charAt(Q-1))return W("End of comment missing");var H=j.slice(2,Q-2);return D+=2,F(H),j=j.slice(Q),D+=2,B({type:x,comment:H})}}function Y(){var B=U(),Q=P(r);if(Q){if(G(),!P(o))return W("property missing ':'");var H=P(s),ee=B({type:b,property:C(Q[0].replace(e,g)),value:H?C(H[0].replace(e,g)):g});return P(u),ee}}function ie(){var B=[];T(B);for(var Q;Q=Y();)Q!==!1&&(B.push(Q),T(B));return B}return M(),ie()}function C(j){return j?j.replace(d,g):g}return np=k,np}var f1;function l3(){if(f1)return Zr;f1=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(r3());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={},p1;function o3(){if(p1)return go;p1=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,h1;function s3(){if(h1)return yo;h1=1;var e=yo&&yo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},n=e(l3()),a=o3();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 c3=s3();const u3=Po(c3),iw=rw("end"),Uh=rw("start");function rw(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 d3(e){const n=Uh(e),a=iw(e);if(n&&a)return{start:n,end:a}}function jo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?m1(e.position):"start"in e||"end"in e?m1(e):"line"in e||"column"in e?Fp(e):""}function Fp(e){return g1(e&&e.line)+":"+g1(e&&e.column)}function m1(e){return Fp(e&&e.start)+"-"+Fp(e&&e.end)}function g1(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 Bh={}.hasOwnProperty,f3=new Map,p3=/[A-Z]/g,h3=new Set(["table","tbody","thead","tfoot","tr"]),m3=new Set(["td","th"]),lw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function g3(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=C3(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=k3(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"?Ph:a3,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=ow(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function ow(e,n,a){if(n.type==="element")return y3(e,n,a);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return v3(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return b3(e,n,a);if(n.type==="mdxjsEsm")return x3(e,n);if(n.type==="root")return w3(e,n,a);if(n.type==="text")return S3(e,n)}function y3(e,n,a){const r=e.schema;let o=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Ph,e.schema=o),e.ancestors.push(n);const s=cw(e,n.tagName,!1),u=E3(e,n);let d=$h(e,n);return h3.has(n.tagName)&&(d=d.filter(function(p){return typeof p=="string"?!W4(p):!0})),sw(e,u,s,n),Hh(u,d),e.ancestors.pop(),e.schema=r,e.create(n,s,u,a)}function v3(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 x3(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Lo(e,n.position)}function b3(e,n,a){const r=e.schema;let o=r;n.name==="svg"&&r.space==="html"&&(o=Ph,e.schema=o),e.ancestors.push(n);const s=n.name===null?e.Fragment:cw(e,n.name,!0),u=A3(e,n),d=$h(e,n);return sw(e,u,s,n),Hh(u,d),e.ancestors.pop(),e.schema=r,e.create(n,s,u,a)}function w3(e,n,a){const r={};return Hh(r,$h(e,n)),e.create(n,e.Fragment,r,a)}function S3(e,n){return n.value}function sw(e,n,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(n.node=r)}function Hh(e,n){if(n.length>0){const a=n.length>1?n:n[0];a&&(e.children=a)}}function k3(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 C3(e,n){return a;function a(r,o,s,u){const d=Array.isArray(s.children),p=Uh(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 E3(e,n){const a={};let r,o;for(o in n.properties)if(o!=="children"&&Bh.call(n.properties,o)){const s=j3(e,o,n.properties[o]);if(s){const[u,d]=s;e.tableCellAlignToStyle&&u==="align"&&typeof d=="string"&&m3.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 A3(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 $h(e,n){const a=[];let r=-1;const o=e.passKeys?new Map:f3;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=ow(e,s,u);d!==void 0&&a.push(d)}return a}function j3(e,n,a){const r=e3(e.schema,n);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?$4(a):i3(a)),r.property==="style"){let o=typeof a=="object"?a:T3(e,String(a));return e.stylePropertyNameCase==="css"&&(o=N3(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?X4[r.property]||r.property:r.attribute,a]}}function T3(e,n){try{return u3(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=lw+"#cannot-parse-style-attribute",o}}function cw(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=o1(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=o1(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const o=r.value;return Bh.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=lw+"#cannot-handle-mdx-estrees-without-createevaluater",a}function N3(e){const n={};let a;for(a in e)Bh.call(e,a)&&(n[R3(a)]=e[a]);return n}function R3(e){let n=e.replace(p3,_3);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function _3(e){return"-"+e.toLowerCase()}const ap={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"]},O3={};function qh(e,n){const a=O3,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return uw(e,r,o)}function uw(e,n,a){if(D3(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 y1(e.children,n,a)}return Array.isArray(e)?y1(e,n,a):""}function y1(e,n,a){const r=[];let o=-1;for(;++o<e.length;)r[o]=uw(e[o],n,a);return r.join("")}function D3(e){return!!(e&&typeof e=="object")}const v1=document.createElement("i");function Fh(e){const n="&"+e+";";v1.innerHTML=n;const a=v1.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 x1={}.hasOwnProperty;function dw(e){const n={};let a=-1;for(;++a<e.length;)M3(n,e[a]);return n}function M3(e,n){let a;for(a in n){const o=(x1.call(e,a)?e[a]:void 0)||(e[a]={}),s=n[a];let u;if(s)for(u in s){x1.call(o,u)||(o[u]=[]);const d=s[u];L3(o[u],Array.isArray(d)?d:d?[d]:[])}}}function L3(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 fw(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]/),z3=Li(/[#-'*+\--9=?A-Z^-~]/);function Gc(e){return e!==null&&(e<32||e===127)}const Gp=Li(/\d/),I3=Li(/[\dA-Fa-f]/),P3=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 ou=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 U3={tokenize:B3};function B3(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 H3={tokenize:$3},b1={tokenize:q3};function $3(e){const n=this,a=[];let r=0,o,s,u;return d;function d(D){if(r<a.length){const F=a[r];return n.containerState=F[1],e.attempt(F[0].continuation,p,f)(D)}return f(D)}function p(D){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,o&&R();const F=n.events.length;let U=F,_;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){_=n.events[U][1].end;break}E(r);let W=F;for(;W<n.events.length;)n.events[W][1].end={..._},W++;return Hn(n.events,U+1,0,n.events.slice(F)),n.events.length=W,f(D)}return d(D)}function f(D){if(r===a.length){if(!o)return x(D);if(o.currentConstruct&&o.currentConstruct.concrete)return k(D);n.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(b1,y,g)(D)}function y(D){return o&&R(),E(r),x(D)}function g(D){return n.parser.lazy[n.now().line]=r!==a.length,u=n.now().offset,k(D)}function x(D){return n.containerState={},e.attempt(b1,b,k)(D)}function b(D){return r++,a.push([n.currentConstruct,n.containerState]),x(D)}function k(D){if(D===null){o&&R(),E(0),e.consume(D);return}return o=o||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),C(D)}function C(D){if(D===null){j(e.exit("chunkFlow"),!0),E(0),e.consume(D);return}return Ae(D)?(e.consume(D),j(e.exit("chunkFlow")),r=0,n.interrupt=void 0,d):(e.consume(D),C)}function j(D,F){const U=n.sliceStream(D);if(F&&U.push(null),D.previous=s,s&&(s.next=D),s=D,o.defineSkip(D.start),o.write(U),n.parser.lazy[D.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 P=W,M,T;for(;P--;)if(n.events[P][0]==="exit"&&n.events[P][1].type==="chunkFlow"){if(M){T=n.events[P][1].end;break}M=!0}for(E(r),_=W;_<n.events.length;)n.events[_][1].end={...T},_++;Hn(n.events,P+1,0,n.events.slice(W)),n.events.length=_}}function E(D){let F=a.length;for(;F-- >D;){const U=a[F];n.containerState=U[1],U[0].exit.call(n,e)}a.length=D}function R(){o.write([null]),s=void 0,o=void 0,n.containerState._closeFlow=void 0}}function q3(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(ou(e))return 2}function su(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:F3,tokenize:G3};function F3(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};w1(g,-p),w1(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,su(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 G3(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 w1(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const V3={name:"autolink",tokenize:W3};function W3(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||Gc(b)?a(b):(e.consume(b),p)}function f(b){return b===64?(e.consume(b),y):z3(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:Y3};function Y3(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 pw={continuation:{tokenize:Q3},exit:X3,name:"blockQuote",tokenize:K3};function K3(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 Q3(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(pw,n,a)(u)}}function X3(e){e.exit("blockQuote")}const hw={name:"characterEscape",tokenize:Z3};function Z3(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 P3(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):a(s)}}const mw={name:"characterReference",tokenize:J3};function J3(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=I3,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&&!Fh(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 S1={partial:!0,tokenize:t_},k1={concrete:!0,name:"codeFenced",tokenize:e_};function e_(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(S1,C,F)(_)):(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,F,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(S1,C,F)(_):(e.enter("codeFlowValue"),D(_))}function D(_){return _===null||Ae(_)?(e.exit("codeFlowValue"),R(_)):(e.consume(_),D)}function F(_){return e.exit("codeFenced"),n(_)}function U(_,W,P){let M=0;return T;function T(Q){return _.enter("lineEnding"),_.consume(Q),_.exit("lineEnding"),G}function G(Q){return _.enter("codeFencedFence"),qe(Q)?Ke(_,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):Y(Q)}function Y(Q){return Q===d?(_.enter("codeFencedFenceSequence"),ie(Q)):P(Q)}function ie(Q){return Q===d?(M++,_.consume(Q),ie):M>=u?(_.exit("codeFencedFenceSequence"),qe(Q)?Ke(_,B,"whitespace")(Q):B(Q)):P(Q)}function B(Q){return Q===null||Ae(Q)?(_.exit("codeFencedFence"),W(Q)):P(Q)}}}function t_(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 ip={name:"codeIndented",tokenize:a_},n_={partial:!0,tokenize:i_};function a_(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(n_,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 i_(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 r_={name:"codeText",previous:o_,resolve:l_,tokenize:s_};function l_(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 o_(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function s_(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 c_{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 gw(e){const n={};let a=-1,r,o,s,u,d,p,f;const y=new c_(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,u_(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 u_(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 d_={resolve:p_,tokenize:h_},f_={partial:!0,tokenize:m_};function p_(e){return gw(e),e}function h_(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(f_,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 m_(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 yw(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||Gc(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||Gc(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 vw(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 xw(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 g_={name:"definition",tokenize:v_},y_={partial:!0,tokenize:x_};function v_(e,n,a){const r=this;let o;return s;function s(b){return e.enter("definition"),u(b)}function u(b){return vw.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 yw(e,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function y(b){return e.attempt(y_,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 x_(e,n,a){return r;function r(d){return gt(d)?To(e,o)(d):a(d)}function o(d){return xw(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 b_={name:"hardBreakEscape",tokenize:w_};function w_(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 S_={name:"headingAtx",resolve:k_,tokenize:C_};function k_(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 C_(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 E_=["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"],C1=["pre","script","style","textarea"],A_={concrete:!0,name:"htmlFlow",resolveTo:N_,tokenize:R_},j_={partial:!0,tokenize:O_},T_={partial:!0,tokenize:__};function N_(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 R_(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:O):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:O):a(N)}function b(N){return N===45?(e.consume(N),r.interrupt?n:O):a(N)}function k(N){const ue="CDATA[";return N===ue.charCodeAt(d++)?(e.consume(N),d===ue.length?r.interrupt?n:Y: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&&C1.includes(pe)?(o=1,r.interrupt?n(N):Y(N)):E_.includes(u.toLowerCase())?(o=6,ue?(e.consume(N),E):r.interrupt?n(N):Y(N)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(N):s?R(N):D(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:Y):a(N)}function R(N){return qe(N)?(e.consume(N),R):T(N)}function D(N){return N===47?(e.consume(N),T):N===58||N===95||pn(N)?(e.consume(N),F):qe(N)?(e.consume(N),D):T(N)}function F(N){return N===45||N===46||N===58||N===95||ln(N)?(e.consume(N),F):U(N)}function U(N){return N===61?(e.consume(N),_):qe(N)?(e.consume(N),U):D(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),_):P(N)}function W(N){return N===p?(e.consume(N),p=null,M):N===null||Ae(N)?a(N):(e.consume(N),W)}function P(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),P)}function M(N){return N===47||N===62||qe(N)?D(N):a(N)}function T(N){return N===62?(e.consume(N),G):a(N)}function G(N){return N===null||Ae(N)?Y(N):qe(N)?(e.consume(N),G):a(N)}function Y(N){return N===45&&o===2?(e.consume(N),H):N===60&&o===1?(e.consume(N),ee):N===62&&o===4?(e.consume(N),L):N===63&&o===3?(e.consume(N),O):N===93&&o===5?(e.consume(N),V):Ae(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(j_,X,ie)(N)):N===null||Ae(N)?(e.exit("htmlFlowData"),ie(N)):(e.consume(N),Y)}function ie(N){return e.check(T_,B,X)(N)}function B(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),Q}function Q(N){return N===null||Ae(N)?ie(N):(e.enter("htmlFlowData"),Y(N))}function H(N){return N===45?(e.consume(N),O):Y(N)}function ee(N){return N===47?(e.consume(N),u="",ne):Y(N)}function ne(N){if(N===62){const ue=u.toLowerCase();return C1.includes(ue)?(e.consume(N),L):Y(N)}return pn(N)&&u.length<8?(e.consume(N),u+=String.fromCharCode(N),ne):Y(N)}function V(N){return N===93?(e.consume(N),O):Y(N)}function O(N){return N===62?(e.consume(N),L):N===45&&o===2?(e.consume(N),O):Y(N)}function L(N){return N===null||Ae(N)?(e.exit("htmlFlowData"),X(N)):(e.consume(N),L)}function X(N){return e.exit("htmlFlow"),n(N)}}function __(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 O_(e,n,a){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Fo,n,a)}}const D_={name:"htmlText",tokenize:M_};function M_(e,n,a){const r=this;let o,s,u;return d;function d(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),p}function p(O){return O===33?(e.consume(O),f):O===47?(e.consume(O),U):O===63?(e.consume(O),D):pn(O)?(e.consume(O),P):a(O)}function f(O){return O===45?(e.consume(O),y):O===91?(e.consume(O),s=0,k):pn(O)?(e.consume(O),R):a(O)}function y(O){return O===45?(e.consume(O),b):a(O)}function g(O){return O===null?a(O):O===45?(e.consume(O),x):Ae(O)?(u=g,ee(O)):(e.consume(O),g)}function x(O){return O===45?(e.consume(O),b):g(O)}function b(O){return O===62?H(O):O===45?x(O):g(O)}function k(O){const L="CDATA[";return O===L.charCodeAt(s++)?(e.consume(O),s===L.length?C:k):a(O)}function C(O){return O===null?a(O):O===93?(e.consume(O),j):Ae(O)?(u=C,ee(O)):(e.consume(O),C)}function j(O){return O===93?(e.consume(O),E):C(O)}function E(O){return O===62?H(O):O===93?(e.consume(O),E):C(O)}function R(O){return O===null||O===62?H(O):Ae(O)?(u=R,ee(O)):(e.consume(O),R)}function D(O){return O===null?a(O):O===63?(e.consume(O),F):Ae(O)?(u=D,ee(O)):(e.consume(O),D)}function F(O){return O===62?H(O):D(O)}function U(O){return pn(O)?(e.consume(O),_):a(O)}function _(O){return O===45||ln(O)?(e.consume(O),_):W(O)}function W(O){return Ae(O)?(u=W,ee(O)):qe(O)?(e.consume(O),W):H(O)}function P(O){return O===45||ln(O)?(e.consume(O),P):O===47||O===62||gt(O)?M(O):a(O)}function M(O){return O===47?(e.consume(O),H):O===58||O===95||pn(O)?(e.consume(O),T):Ae(O)?(u=M,ee(O)):qe(O)?(e.consume(O),M):H(O)}function T(O){return O===45||O===46||O===58||O===95||ln(O)?(e.consume(O),T):G(O)}function G(O){return O===61?(e.consume(O),Y):Ae(O)?(u=G,ee(O)):qe(O)?(e.consume(O),G):M(O)}function Y(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),o=O,ie):Ae(O)?(u=Y,ee(O)):qe(O)?(e.consume(O),Y):(e.consume(O),B)}function ie(O){return O===o?(e.consume(O),o=void 0,Q):O===null?a(O):Ae(O)?(u=ie,ee(O)):(e.consume(O),ie)}function B(O){return O===null||O===34||O===39||O===60||O===61||O===96?a(O):O===47||O===62||gt(O)?M(O):(e.consume(O),B)}function Q(O){return O===47||O===62||gt(O)?M(O):a(O)}function H(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),n):a(O)}function ee(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ne}function ne(O){return qe(O)?Ke(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):V(O)}function V(O){return e.enter("htmlTextData"),u(O)}}const Gh={name:"labelEnd",resolveAll:P_,resolveTo:U_,tokenize:B_},L_={tokenize:H_},z_={tokenize:$_},I_={tokenize:q_};function P_(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 U_(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,su(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 B_(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(L_,y,u?y:g)(x):x===91?e.attempt(z_,y,u?f:g)(x):u?y(x):g(x)}function f(x){return e.attempt(I_,y,g)(x)}function y(x){return n(x)}function g(x){return s._balanced=!0,a(x)}}function H_(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):yw(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?xw(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 $_(e,n,a){const r=this;return o;function o(d){return vw.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 q_(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 F_={name:"labelStartImage",resolveAll:Gh.resolveAll,tokenize:G_};function G_(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 V_={name:"labelStartLink",resolveAll:Gh.resolveAll,tokenize:W_};function W_(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 rp={name:"lineEnding",tokenize:Y_};function Y_(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:K_};function K_(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:J_},exit:tO,name:"list",tokenize:Z_},Q_={partial:!0,tokenize:nO},X_={partial:!0,tokenize:eO};function Z_(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(Q_,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 J_(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(X_,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 eO(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 tO(e){e.exit(this.containerState.type)}function nO(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 E1={name:"setextUnderline",resolveTo:aO,tokenize:iO};function aO(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 iO(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 rO={tokenize:lO};function lO(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(d_,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 oO={resolveAll:ww()},sO=bw("string"),cO=bw("text");function bw(e){return{resolveAll:ww(e==="text"?uO: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 ww(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 uO(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 dO={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:pw},fO={91:g_},pO={[-2]:ip,[-1]:ip,32:ip},hO={35:S_,42:Tc,45:[E1,Tc],60:A_,61:E1,95:Tc,96:k1,126:k1},mO={38:mw,92:hw},gO={[-5]:rp,[-4]:rp,[-3]:rp,33:F_,38:mw,42:Vp,60:[V3,D_],91:V_,92:[b_,hw],93:Gh,95:Vp,96:r_},yO={null:[Vp,oO]},vO={null:[42,95]},xO={null:[]},bO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:vO,contentInitial:fO,disable:xO,document:dO,flow:hO,flowInitial:pO,insideSpan:yO,string:mO,text:gO},Symbol.toStringTag,{value:"Module"}));function wO(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:D,exit:F,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(G){return u=na(u,G),j(),u[u.length-1]!==null?[]:(P(n,0),f.events=su(s,f.events,f),f.events)}function x(G,Y){return kO(b(G),Y)}function b(G){return SO(u,G)}function k(){const{_bufferIndex:G,_index:Y,line:ie,column:B,offset:Q}=r;return{_bufferIndex:G,_index:Y,line:ie,column:B,offset:Q}}function C(G){o[G.line]=G.column,T()}function j(){let G;for(;r._index<u.length;){const Y=u[r._index];if(typeof Y=="string")for(G=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===G&&r._bufferIndex<Y.length;)E(Y.charCodeAt(r._bufferIndex));else E(Y)}}function E(G){y=y(G)}function R(G){Ae(G)?(r.line++,r.column=1,r.offset+=G===-3?2:1,T()):G!==-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=G}function D(G,Y){const ie=Y||{};return ie.type=G,ie.start=k(),f.events.push(["enter",ie,f]),d.push(ie),ie}function F(G){const Y=d.pop();return Y.end=k(),f.events.push(["exit",Y,f]),Y}function U(G,Y){P(G,Y.from)}function _(G,Y){Y.restore()}function W(G,Y){return ie;function ie(B,Q,H){let ee,ne,V,O;return Array.isArray(B)?X(B):"tokenize"in B?X([B]):L(B);function L(he){return Ee;function Ee(Ue){const Ne=Ue!==null&&he[Ue],et=Ue!==null&&he.null,Ot=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(et)?et:et?[et]:[]];return X(Ot)(Ue)}}function X(he){return ee=he,ne=0,he.length===0?H:N(he[ne])}function N(he){return Ee;function Ee(Ue){return O=M(),V=he,he.partial||(f.currentConstruct=he),he.name&&f.parser.constructs.disable.null.includes(he.name)?pe():he.tokenize.call(Y?Object.assign(Object.create(f),Y):f,p,ue,pe)(Ue)}}function ue(he){return G(V,O),Q}function pe(he){return O.restore(),++ne<ee.length?N(ee[ne]):H}}}function P(G,Y){G.resolveAll&&!s.includes(G)&&s.push(G),G.resolve&&Hn(f.events,Y,f.events.length-Y,G.resolve(f.events.slice(Y),f)),G.resolveTo&&(f.events=G.resolveTo(f.events,f))}function M(){const G=k(),Y=f.previous,ie=f.currentConstruct,B=f.events.length,Q=Array.from(d);return{from:B,restore:H};function H(){r=G,f.previous=Y,f.currentConstruct=ie,f.events.length=B,d=Q,T()}}function T(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function SO(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 kO(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=`
|
|
1140
|
+
`;break}case-3:{u=`\r
|
|
1141
|
+
`;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 CO(e){const r={constructs:dw([bO,...(e||{}).extensions||[]]),content:o(U3),defined:[],document:o(H3),flow:o(rO),lazy:{},string:o(sO),text:o(cO)};return r;function o(s){return u;function u(d){return wO(r,s,d)}}}function EO(e){for(;!gw(e););return e}const A1=/[\0\t\n\r]/g;function AO(){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(A1.lastIndex=g,f=A1.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 jO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function TO(e){return e.replace(jO,NO)}function NO(e,n,a){if(n)return n;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),s=o===120||o===88;return fw(a.slice(s?2:1),s?16:10)}return Fh(a)||e}const Sw={}.hasOwnProperty;function RO(e,n,a){return n&&typeof n=="object"&&(a=n,n=void 0),_O(a)(EO(CO(a).document().write(AO()(e,n,!0))))}function _O(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Nt),autolinkProtocol:M,autolinkEmail:M,atxHeading:s(Zt),blockQuote:s(et),characterEscape:M,characterReference:M,codeFenced:s(Ot),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(Ot,u),codeText:s(xt,u),codeTextData:M,data:M,codeFlowValue:M,definition:s(bt),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(yt),hardBreakEscape:s(Pe),hardBreakTrailing:s(Pe),htmlFlow:s(pt,u),htmlFlowData:M,htmlText:s(pt,u),htmlTextData:M,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:Ue,blockQuote:p(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:he,characterReference:Ee,codeFenced:p(j),codeFencedFence:C,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:T,codeIndented:p(E),codeText:p(Q),codeTextData:T,data:T,definition:p(),definitionDestinationString:F,definitionLabelString:R,definitionTitleString:D,emphasis:p(),hardBreakEscape:p(Y),hardBreakTrailing:p(Y),htmlFlow:p(ie),htmlFlowData:T,htmlText:p(B),htmlTextData:T,image:p(ee),label:V,labelText:ne,lineEnding:G,link:p(H),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ue,resourceDestinationString:O,resourceTitleString:L,resource:X,setextHeading:p(P),setextHeadingLineSequence:W,setextHeadingText:_,strong:p(),thematicBreak:p()}};kw(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]];Sw.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]||j1).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,Ie,Xe,Ve;for(;++ye<=me;){const Se=$[ye];switch(Se[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Se[0]==="enter"?I++:I--,Ve=void 0;break}case"lineEndingBlank":{Se[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&&Se[0]==="enter"&&Se[1].type==="listItemPrefix"||I===-1&&Se[0]==="exit"&&(Se[1].type==="listUnordered"||Se[1].type==="listOrdered")){if(at){let Wt=ye;for(Ie=void 0;Wt--;){const rt=$[Wt];if(rt[1].type==="lineEnding"||rt[1].type==="lineEndingBlank"){if(rt[0]==="exit")continue;Ie&&($[Ie][1].type="lineEndingBlank",Te=!0),rt[1].type="lineEnding",Ie=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&&(!Ie||Xe<Ie)&&(at._spread=!0),at.end=Object.assign({},Ie?$[Ie][1].start:Se[1].end),$.splice(Ie||ye,0,["exit",at,Se[2]]),ye++,me++}if(Se[1].type==="listItemPrefix"){const Wt={type:"listItem",_spread:!1,start:Object.assign({},Se[1].start),end:void 0};at=Wt,$.splice(ye,0,["enter",Wt,Se[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]||j1).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 qh(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 D(){const $=this.resume(),le=this.stack[this.stack.length-1];le.title=$}function F(){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 P(){this.data.setextHeadingSlurpLineEnding=void 0}function M($){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 G($){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)&&(M.call(this,$),T.call(this,$))}function Y(){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 Q(){const $=this.resume(),le=this.stack[this.stack.length-1];le.value=$}function H(){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 ee(){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=TO(le),me.identifier=da(le).toLowerCase()}function V(){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 O(){const $=this.resume(),le=this.stack[this.stack.length-1];le.url=$}function L(){const $=this.resume(),le=this.stack[this.stack.length-1];le.title=$}function X(){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=fw(le,me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ye=Fh(le);const I=this.stack[this.stack.length-1];I.value+=ye}function Ee($){const le=this.stack.pop();le.position.end=Ti($.end)}function Ue($){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 Pe(){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 kw(e,n){let a=-1;for(;++a<n.length;){const r=n[a];Array.isArray(r)?kw(e,r):OO(e,r)}}function OO(e,n){let a;for(a in n)if(Sw.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 j1(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 DO(e){const n=this;n.parser=a;function a(r){return RO(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function MO(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 LO(e,n){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,a),[e.applyData(n,a),{type:"text",value:`
|
|
1142
|
+
`}]}function zO(e,n){const a=n.value?n.value+`
|
|
1143
|
+
`:"",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 IO(e,n){const a={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function PO(e,n){const a={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function UO(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 BO(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 HO(e,n){if(e.options.allowDangerousHtml){const a={type:"raw",value:n.value};return e.patch(n,a),e.applyData(n,a)}}function Cw(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 $O(e,n){const a=String(n.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Cw(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 qO(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 FO(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 GO(e,n){const a=String(n.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Cw(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 VO(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 WO(e,n,a){const r=e.all(n),o=a?YO(a):Ew(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:`
|
|
1144
|
+
`}),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:`
|
|
1145
|
+
`});const f={type:"element",tagName:"li",properties:s,children:u};return e.patch(n,f),e.applyData(n,f)}function YO(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=Ew(a[r])}return n}function Ew(e){const n=e.spread;return n??e.children.length>1}function KO(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 QO(e,n){const a={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function XO(e,n){const a={type:"root",children:e.wrap(e.all(n))};return e.patch(n,a),e.applyData(n,a)}function ZO(e,n){const a={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function JO(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=Uh(n.children[1]),p=iw(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 eD(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 tD(e,n){const a={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}const T1=9,N1=32;function nD(e){const n=String(e),a=/\r?\n|\r/g;let r=a.exec(n),o=0;const s=[];for(;r;)s.push(R1(n.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=a.exec(n);return s.push(R1(n.slice(o),o>0,!1)),s.join("")}function R1(e,n,a){let r=0,o=e.length;if(n){let s=e.codePointAt(r);for(;s===T1||s===N1;)r++,s=e.codePointAt(r)}if(a){let s=e.codePointAt(o-1);for(;s===T1||s===N1;)o--,s=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function aD(e,n){const a={type:"text",value:nD(String(n.value))};return e.patch(n,a),e.applyData(n,a)}function iD(e,n){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,a),e.applyData(n,a)}const rD={blockquote:MO,break:LO,code:zO,delete:IO,emphasis:PO,footnoteReference:UO,heading:BO,html:HO,imageReference:$O,image:qO,inlineCode:FO,linkReference:GO,link:VO,listItem:WO,list:KO,paragraph:QO,root:XO,strong:ZO,table:JO,tableCell:tD,tableRow:eD,text:aD,thematicBreak:iD,toml:gc,yaml:gc,definition:gc,footnoteDefinition:gc};function gc(){}const Aw=-1,cu=0,No=1,Vc=2,Vh=3,Wh=4,Yh=5,Kh=6,jw=7,Tw=8,lD=typeof self=="object"?self:globalThis,_1=(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 lD[e](n)},oD=(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 cu:case Aw:return a(u,o);case No:{const d=a([],o);for(const p of u)d.push(r(p));return d}case Vc:{const d=a({},o);for(const[p,f]of u)d[r(p)]=r(f);return d}case Vh:return a(new Date(u),o);case Wh:{const{source:d,flags:p}=u;return a(new RegExp(d,p),o)}case Yh:{const d=a(new Map,o);for(const[p,f]of u)d.set(r(p),r(f));return d}case Kh:{const d=a(new Set,o);for(const p of u)d.add(r(p));return d}case jw:{const{name:d,message:p}=u;return a(_1(d,p),o)}case Tw: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(_1(s,u),o)};return r},O1=e=>oD(new Map,e)(0),Jr="",{toString:sD}={},{keys:cD}=Object,xo=e=>{const n=typeof e;if(n!=="object"||!e)return[cu,n];const a=sD.call(e).slice(8,-1);switch(a){case"Array":return[No,Jr];case"Object":return[Vc,Jr];case"Date":return[Vh,Jr];case"RegExp":return[Wh,Jr];case"Map":return[Yh,Jr];case"Set":return[Kh,Jr];case"DataView":return[No,a]}return a.includes("Array")?[No,a]:a.includes("Error")?[jw,a]:[Vc,a]},yc=([e,n])=>e===cu&&(n==="function"||n==="symbol"),uD=(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 cu:{let y=u;switch(p){case"bigint":d=Tw,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return o([Aw],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 Vc:{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 cD(u))(e||!yc(xo(u[x])))&&y.push([s(x),s(u[x])]);return g}case Vh:return o([d,u.toISOString()],u);case Wh:{const{source:y,flags:g}=u;return o([d,{source:y,flags:g}],u)}case Yh:{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 Kh:{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},D1=(e,{json:n,lossy:a}={})=>{const r=[];return uD(!(n||a),!!n,new Map,r)(e),r},Wc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?O1(D1(e,n)):structuredClone(e):(e,n)=>O1(D1(e,n));function dD(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 fD(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function pD(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||dD,r=e.options.footnoteBackLabel||fD,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:{...Wc(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
1146
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
1147
|
+
`}]}}const uu=(function(e){if(e==null)return yD;if(typeof e=="function")return du(e);if(typeof e=="object")return Array.isArray(e)?hD(e):mD(e);if(typeof e=="string")return gD(e);throw new Error("Expected function, string, or object as test")});function hD(e){const n=[];let a=-1;for(;++a<e.length;)n[a]=uu(e[a]);return du(r);function r(...o){let s=-1;for(;++s<n.length;)if(n[s].apply(this,o))return!0;return!1}}function mD(e){const n=e;return du(a);function a(r){const o=r;let s;for(s in e)if(o[s]!==n[s])return!1;return!0}}function gD(e){return du(n);function n(a){return a&&a.type===e}}function du(e){return n;function n(a,r,o){return!!(vD(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function yD(){return!0}function vD(e){return e!==null&&typeof e=="object"&&"type"in e}const Nw=[],xD=!0,Wp=!1,bD="skip";function Rw(e,n,a,r){let o;typeof n=="function"&&typeof a!="function"?(r=a,a=n):o=n;const s=uu(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=Nw,k,C,j;if((!n||s(p,f,y[y.length-1]||void 0))&&(b=wD(a(p,y)),b[0]===Wp))return b;if("children"in p&&p.children){const E=p;if(E.children&&b[0]!==bD)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 wD(e){return Array.isArray(e)?e:typeof e=="number"?[xD,e]:e==null?Nw:[e]}function Qh(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),Rw(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,SD={};function kD(e,n){const a=n||SD,r=new Map,o=new Map,s=new Map,u={...rD,...a.handlers},d={all:f,applyData:ED,definitionById:r,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:u,one:p,options:a,patch:CD,wrap:jD};return Qh(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=Wc(j);return E.children=d.all(y),E}return Wc(y)}return(d.options.unknownHandler||AD)(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=M1(k.value)),!Array.isArray(k)&&k.type==="element")){const C=k.children[0];C&&C.type==="text"&&(C.value=M1(C.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function CD(e,n){e.position&&(n.position=d3(e))}function ED(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,Wc(s)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function AD(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 jD(e,n){const a=[];let r=-1;for(n&&a.push({type:"text",value:`
|
|
1148
|
+
`});++r<e.length;)r&&a.push({type:"text",value:`
|
|
1149
|
+
`}),a.push(e[r]);return n&&e.length>0&&a.push({type:"text",value:`
|
|
1150
|
+
`}),a}function M1(e){let n=0,a=e.charCodeAt(n);for(;a===9||a===32;)n++,a=e.charCodeAt(n);return e.slice(n)}function L1(e,n){const a=kD(e,n),r=a.one(e,void 0),o=pD(a),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
|
1151
|
+
`},o),s}function TD(e,n){return e&&"run"in e?async function(a,r){const o=L1(a,{file:r,...n});await e.run(o,r)}:function(a,r){return L1(a,{file:r,...e||n})}}function z1(e){if(e)throw e}var lp,I1;function ND(){if(I1)return lp;I1=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 lp=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},lp}var RD=ND();const op=Po(RD);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 _D(){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?OD(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 OD(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:DD,dirname:MD,extname:LD,join:zD,sep:"/"};function DD(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 MD(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 LD(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 zD(...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?".":ID(a)}function ID(e){Go(e);const n=e.codePointAt(0)===47;let a=PD(e,!n);return a.length===0&&!n&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),n?"/"+a:a}function PD(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 UD={cwd:BD};function BD(){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 HD(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 $D(e)}function $D(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 sp=["history","path","basename","stem","extname","dirname"];class _w{constructor(n){let a;n?Qp(n)?a={path:n}:typeof n=="string"||qD(n)?a={value:n}:a=n:a={},this.cwd="cwd"in a?"":UD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<sp.length;){const s=sp[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)sp.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?ka.basename(this.path):void 0}set basename(n){up(n,"basename"),cp(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){P1(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(cp(n,"extname"),P1(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=HD(n)),up(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){up(n,"stem"),cp(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 cp(e,n){if(e&&e.includes(ka.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ka.sep+"`")}function up(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function P1(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function qD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FD=(function(e){const r=this.constructor.prototype,o=r[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),GD={}.hasOwnProperty;class Xh extends FD{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=_D()}copy(){const n=new Xh;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];n.use(...r)}return n.data(op(!0,{},this.namespace)),n}data(n,a){return typeof n=="string"?arguments.length===2?(pp("data",this.frozen),this.namespace[n]=a,this):GD.call(this.namespace,n)&&this.namespace[n]||void 0:n?(pp("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 dp("parse",r),r(String(a),a)}process(n,a){const r=this;return this.freeze(),dp("process",this.parser||this.Parser),fp("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);YD(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(),dp("processSync",this.parser||this.Parser),fp("processSync",this.compiler||this.Compiler),this.process(n,o),B1("processSync","process",a),r;function o(s,u){a=!0,z1(s),r=u}}run(n,a,r){U1(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),B1("runSync","run",r),o;function s(u,d){z1(u),o=d,r=!0}}stringify(n,a){this.freeze();const r=vc(a),o=this.compiler||this.Compiler;return fp("stringify",o),U1(n),o(n,r)}use(n,...a){const r=this.attachers,o=this.namespace;if(pp("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=op(!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=op(!0,C,b)),r[x]=[f,b,...k]}}}}const VD=new Xh().freeze();function dp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pp(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 U1(e){if(!Kp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function B1(e,n,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function vc(e){return WD(e)?e:new _w(e)}function WD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function YD(e){return typeof e=="string"||KD(e)}function KD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const QD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",H1=[],$1={allowDangerousHtml:!0},XD=/^(https?|ircs?|mailto|xmpp)$/i,ZD=[{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 JD(e){const n=eM(e),a=tM(e);return nM(n.runSync(n.parse(a),a),e)}function eM(e){const n=e.rehypePlugins||H1,a=e.remarkPlugins||H1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$1}:$1;return VD().use(DO).use(a).use(TD,r).use(n)}function tM(e){const n=e.children||"",a=new _w;return typeof n=="string"&&(a.value=n),a}function nM(e,n){const a=n.allowedElements,r=n.allowElement,o=n.components,s=n.disallowedElements,u=n.skipHtml,d=n.unwrapDisallowed,p=n.urlTransform||aM;for(const y of ZD)Object.hasOwn(n,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+QD+y.id,void 0);return Qh(e,f),g3(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 ap)if(Object.hasOwn(ap,b)&&Object.hasOwn(y.properties,b)){const k=y.properties[b],C=ap[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 aM(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||XD.test(e.slice(0,n))?e:""}function q1(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 iM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ow(e,n,a){const o=uu((a||{}).ignore||[]),s=rM(n);let u=-1;for(;++u<s.length;)Rw(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 D=x.exec(f.value);for(;D;){const F=D.index,U={index:D.index,input:D.input,stack:[...y,f]};let _=b(...D,U);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?x.lastIndex=F+1:(k!==F&&R.push({type:"text",value:f.value.slice(k,F)}),Array.isArray(_)?R.push(..._):_&&R.push(_),k=F+D[0].length,E=!0),!x.global)break;D=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 rM(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([lM(o[0]),oM(o[1])])}return n}function lM(e){return typeof e=="string"?new RegExp(iM(e),"g"):e}function oM(e){return typeof e=="function"?e:function(){return e}}const hp="phrasing",mp=["autolink","link","image","label"];function sM(){return{transforms:[mM],enter:{literalAutolink:uM,literalAutolinkEmail:gp,literalAutolinkHttp:gp,literalAutolinkWww:gp},exit:{literalAutolink:hM,literalAutolinkEmail:pM,literalAutolinkHttp:dM,literalAutolinkWww:fM}}}function cM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:mp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:mp},{character:":",before:"[ps]",after:"\\/",inConstruct:hp,notInConstruct:mp}]}}function uM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gp(e){this.config.enter.autolinkProtocol.call(this,e)}function dM(e){this.config.exit.autolinkProtocol.call(this,e)}function fM(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 pM(e){this.config.exit.autolinkEmail.call(this,e)}function hM(e){this.exit(e)}function mM(e){Ow(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,gM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),yM]],{ignore:["link","linkReference"]})}function gM(e,n,a,r,o){let s="";if(!Dw(o)||(/^w/i.test(n)&&(a=n+a,n="",s="http://"),!vM(a)))return!1;const u=xM(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 yM(e,n,a,r){return!Dw(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+a,children:[{type:"text",value:n+"@"+a}]}}function vM(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 xM(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=q1(e,"(");let s=q1(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 Dw(e,n){const a=e.input.charCodeAt(e.index-1);return(e.index===0||cr(a)||ou(a))&&(!n||a!==47)}Mw.peek=TM;function bM(){this.buffer()}function wM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function SM(){this.buffer()}function kM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function CM(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 EM(e){this.exit(e)}function AM(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 jM(e){this.exit(e)}function TM(){return"["}function Mw(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 NM(){return{enter:{gfmFootnoteCallString:bM,gfmFootnoteCall:wM,gfmFootnoteDefinitionLabelString:SM,gfmFootnoteDefinition:kM},exit:{gfmFootnoteCallString:CM,gfmFootnoteCall:EM,gfmFootnoteDefinitionLabelString:AM,gfmFootnoteDefinition:jM}}}function RM(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:a,footnoteReference:Mw},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?`
|
|
1152
|
+
`:" ")+s.indentLines(s.containerFlow(r,d.current()),n?Lw:_M))),f(),p}}function _M(e,n,a){return n===0?e:Lw(e,n,a)}function Lw(e,n,a){return(a?"":" ")+e}const OM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];zw.peek=IM;function DM(){return{canContainEols:["delete"],enter:{strikethrough:LM},exit:{strikethrough:zM}}}function MM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:OM}],handlers:{delete:zw}}}function LM(e){this.enter({type:"delete",children:[]},e)}function zM(e){this.exit(e)}function zw(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 IM(){return"~"}function PM(e){return e.length}function UM(e,n){const a=n||{},r=(a.align||[]).concat(),o=a.stringLength||PM,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=BM(e[y][E]);if(a.alignDelimiters!==!1){const D=o(R);j[E]=D,(p[E]===void 0||D>p[E])&&(p[E]=D)}C.push(R)}u[y]=C,d[y]=j}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<f;)s[g]=F1(r[g]);else{const C=F1(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 D=j+"-".repeat(R)+E;a.alignDelimiters!==!1&&(R=j.length+R+E.length,R>p[g]&&(p[g]=R),b[g]=R),x[g]=D}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 D="",F="";if(a.alignDelimiters!==!1){const U=p[g]-(j[g]||0),_=s[g];_===114?D=" ".repeat(U):_===99?U%2?(D=" ".repeat(U/2+.5),F=" ".repeat(U/2-.5)):(D=" ".repeat(U/2),F=D):F=" ".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(D),E.push(R),a.alignDelimiters!==!1&&E.push(F),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(`
|
|
1153
|
+
`)}function BM(e){return e==null?"":String(e)}function F1(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 HM(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()),$M);return o(),u}function $M(e,n,a){return">"+(a?"":" ")+e}function qM(e,n){return G1(e,n.inConstruct,!0)&&!G1(e,n.notInConstruct,!1)}function G1(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 V1(e,n,a,r){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
|
|
1154
|
+
`&&qM(a.stack,a.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
1155
|
+
`}function FM(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 GM(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 VM(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 WM(e,n,a,r){const o=VM(a),s=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if(GM(e,a)){const g=a.enter("codeIndented"),x=a.indentLines(s,YM);return g(),x}const d=a.createTracker(r),p=o.repeat(Math.max(FM(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:`
|
|
1156
|
+
`,encode:["`"],...d.current()})),g()}return y+=d.move(`
|
|
1157
|
+
`),s&&(y+=d.move(s+`
|
|
1158
|
+
`)),y+=d.move(p),f(),y}function YM(e,n,a){return(a?"":" ")+e}function Zh(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 KM(e,n,a,r){const o=Zh(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?" ":`
|
|
1159
|
+
`,...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 QM(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 Yc(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}}Iw.peek=XM;function Iw(e,n,a,r){const o=QM(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=Yc(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=Yc(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 XM(e,n,a){return a.options.emphasis||"*"}function ZM(e,n){let a=!1;return Qh(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)&&qh(e)&&(n.options.setext||a))}function JM(e,n,a,r){const o=Math.max(Math.min(6,e.depth||1),1),s=a.createTracker(r);if(ZM(e,a)){const y=a.enter("headingSetext"),g=a.enter("phrasing"),x=a.containerPhrasing(e,{...s.current(),before:`
|
|
1160
|
+
`,after:`
|
|
1161
|
+
`});return g(),y(),x+`
|
|
1162
|
+
`+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
1163
|
+
`))+1))}const u="#".repeat(o),d=a.enter("headingAtx"),p=a.enter("phrasing");s.move(u+" ");let f=a.containerPhrasing(e,{before:"# ",after:`
|
|
1164
|
+
`,...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}Pw.peek=e6;function Pw(e){return e.value||""}function e6(){return"<"}Uw.peek=t6;function Uw(e,n,a,r){const o=Zh(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 t6(){return"!"}Bw.peek=n6;function Bw(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 n6(){return"!"}Hw.peek=a6;function Hw(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 a6(){return"`"}function $w(e,n){const a=qh(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))}qw.peek=i6;function qw(e,n,a,r){const o=Zh(a),s=o==='"'?"Quote":"Apostrophe",u=a.createTracker(r);let d,p;if($w(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 i6(e,n,a){return $w(e,a)?"<":"["}Fw.peek=r6;function Fw(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 r6(){return"["}function Jh(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 l6(e){const n=Jh(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 o6(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 Gw(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 s6(e,n,a,r){const o=a.enter("list"),s=a.bulletCurrent;let u=e.ordered?o6(a):Jh(a);const d=e.ordered?u==="."?")":".":l6(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),Gw(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 c6(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 u6(e,n,a,r){const o=c6(a);let s=a.bulletCurrent||Jh(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 d6(e,n,a,r){const o=a.enter("paragraph"),s=a.enter("phrasing"),u=a.containerPhrasing(e,r);return s(),o(),u}const f6=uu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function p6(e,n,a,r){return(e.children.some(function(u){return f6(u)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function h6(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Vw.peek=m6;function Vw(e,n,a,r){const o=h6(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=Yc(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=Yc(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 m6(e,n,a){return a.options.strong||"*"}function g6(e,n,a,r){return a.safe(e.value,r)}function y6(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 v6(e,n,a){const r=(Gw(a)+(a.options.ruleSpaces?" ":"")).repeat(y6(a));return a.options.ruleSpaces?r.slice(0,-1):r}const Ww={blockquote:HM,break:V1,code:WM,definition:KM,emphasis:Iw,hardBreak:V1,heading:JM,html:Pw,image:Uw,imageReference:Bw,inlineCode:Hw,link:qw,linkReference:Fw,list:s6,listItem:u6,paragraph:d6,root:p6,strong:Vw,text:g6,thematicBreak:v6};function x6(){return{enter:{table:b6,tableData:W1,tableHeader:W1,tableRow:S6},exit:{codeText:k6,table:w6,tableData:yp,tableHeader:yp,tableRow:yp}}}function b6(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 w6(e){this.exit(e),this.data.inTable=void 0}function S6(e){this.enter({type:"tableRow",children:[]},e)}function yp(e){this.exit(e)}function W1(e){this.enter({type:"tableCell",children:[]},e)}function k6(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,C6));const a=this.stack[this.stack.length-1];a.type,a.value=n,this.exit(e)}function C6(e,n){return n==="|"?n:e}function E6(e){const n=e||{},a=n.tableCellPadding,r=n.tablePipeAlign,o=n.stringLength,s=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
1165
|
+
`,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(`
|
|
1166
|
+
`))}function p(b,k,C,j){const E=C.enter("tableCell"),R=C.enter("phrasing"),D=C.containerPhrasing(b,{...j,before:s,after:s});return R(),E(),D}function f(b,k){return UM(b,{align:k,alignDelimiters:r,padding:a,stringLength:o})}function y(b,k,C){const j=b.children;let E=-1;const R=[],D=k.enter("table");for(;++E<j.length;)R[E]=g(j[E],k,C);return D(),R}function g(b,k,C){const j=b.children;let E=-1;const R=[],D=k.enter("tableRow");for(;++E<j.length;)R[E]=p(j[E],b,k,C);return D(),R}function x(b,k,C){let j=Ww.inlineCode(b,k,C);return C.stack.includes("tableCell")&&(j=j.replace(/\|/g,"\\$&")),j}}function A6(){return{exit:{taskListCheckValueChecked:Y1,taskListCheckValueUnchecked:Y1,paragraph:T6}}}function j6(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:N6}}}function Y1(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function T6(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 N6(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=Ww.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 R6(){return[sM(),NM(),DM(),x6(),A6()]}function _6(e){return{extensions:[cM(),RM(e),MM(),E6(e),j6()]}}const O6={tokenize:P6,partial:!0},Yw={tokenize:U6,partial:!0},Kw={tokenize:B6,partial:!0},Qw={tokenize:H6,partial:!0},D6={tokenize:$6,partial:!0},Xw={name:"wwwAutolink",tokenize:z6,previous:Jw},Zw={name:"protocolAutolink",tokenize:I6,previous:eS},ei={name:"emailAutolink",tokenize:L6,previous:tS},Aa={};function M6(){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,Zw];Aa[104]=[ei,Zw];Aa[87]=[ei,Xw];Aa[119]=[ei,Xw];function L6(e,n,a){const r=this;let o,s;return u;function u(g){return!Xp(g)||!tS.call(r,r.previous)||em(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(D6,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 z6(e,n,a){const r=this;return o;function o(u){return u!==87&&u!==119||!Jw.call(r,r.previous)||em(r.events)?a(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(O6,e.attempt(Yw,e.attempt(Kw,s),a),a)(u))}function s(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function I6(e,n,a){const r=this;let o="",s=!1;return u;function u(g){return(g===72||g===104)&&eS.call(r,r.previous)&&!em(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||Gc(g)||gt(g)||cr(g)||ou(g)?a(g):e.attempt(Yw,e.attempt(Kw,y),a)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(g)}}function P6(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 U6(e,n,a){let r,o,s;return u;function u(f){return f===46||f===95?e.check(Qw,p,d)(f):f===null||gt(f)||cr(f)||f!==45&&ou(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 B6(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(Qw,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 H6(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 $6(e,n,a){return r;function r(s){return e.consume(s),o}function o(s){return ln(s)?a(s):n(s)}}function Jw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gt(e)}function eS(e){return!pn(e)}function tS(e){return!(e===47||Xp(e))}function Xp(e){return e===43||e===45||e===46||e===95||ln(e)}function em(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 q6={tokenize:X6,partial:!0};function F6(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Y6,continuation:{tokenize:K6},exit:Q6}},text:{91:{name:"gfmFootnoteCall",tokenize:W6},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:G6,resolveTo:V6}}}}function G6(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 V6(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 W6(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 Y6(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 K6(e,n,a){return e.check(Fo,n,e.attempt(q6,n,a))}function Q6(e){e.exit("gfmFootnoteDefinition")}function X6(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 Z6(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,su(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 J6{constructor(){this.map=[]}add(n,a,r){e5(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 e5(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 t5(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 n5(){return{flow:{null:{name:"table",tokenize:a5,resolveAll:i5}}}}function a5(e,n,a){const r=this;let o=0,s=0,u;return d;function d(T){let G=r.events.length-1;for(;G>-1;){const B=r.events[G][1].type;if(B==="lineEnding"||B==="linePrefix")G--;else break}const Y=G>-1?r.events[G][1].type:null,ie=Y==="tableHead"||Y==="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)?F(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"),D):(e.exit("tableDelimiterFiller"),D(T))}function D(T){return qe(T)?Ke(e,F,"whitespace")(T):F(T)}function F(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"),P(T))}function P(T){return T===null||T===124||gt(T)?(e.exit("data"),W(T)):(e.consume(T),T===92?M:P)}function M(T){return T===92||T===124?(e.consume(T),P):P(T)}}function i5(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 J6;for(;++a<e.length;){const b=e[a],k=b[1];b[0]==="enter"?k.type==="tableHead"?(d=!1,p!==0&&(K1(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&&K1(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=t5(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 K1(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 r5={name:"tasklistCheck",tokenize:o5};function l5(){return{text:{91:r5}}}function o5(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:s5},n,a)(p):a(p)}}function s5(e,n,a){return Ke(e,r,"whitespace");function r(o){return o===null?a(o):n(o)}}function c5(e){return dw([M6(),F6(),Z6(e),n5(),l5()])}const u5={};function d5(e){const n=this,a=e||u5,r=n.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(c5(a)),s.push(R6()),u.push(_6(a))}function f5(e){Ow(e,[/\r?\n|\r/g,p5])}function p5(){return{type:"break"}}function h5(){return function(e){f5(e)}}const nS=[{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"),[])}],aS=Object.freeze(Object.assign({},...nS.map(({aliases:e})=>e)));Object.freeze(Object.keys(aS));function m5(e){if(!e)return null;const n=e.toLowerCase().trim();return aS[n]??null}async function l9(){return(await Promise.all(nS.map(({load:n})=>n()))).flatMap(({default:n})=>n).filter((n,a,r)=>r.findIndex(o=>o.name===n.name)===a)}let bo=null;function g5(){return bo||(bo=nt(()=>import("./shikiHighlighter-DW1fRfBU.js"),[]).then(e=>e.createHighlighter()).catch(e=>{throw bo=null,e}),bo)}function y5({code:e,lang:n}){const a=m5(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 g5().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(IT,{size:14,"aria-hidden":"true"}):m.jsx($T,{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 v5(){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 x5(e){return e?/^https?:\/\//i.test(e)?"http":/^mailto:/i.test(e)?"mailto":"inert":"inert"}function iS({content:e,streaming:n}){return m.jsx("div",{className:"v10-md",children:m.jsx(JD,{remarkPlugins:[d5,h5],rehypePlugins:n?[v5]:[],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=x5(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(y5,{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 b5=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"})]}),w5=Ja(()=>nt(()=>import("./Operations-BCQ545Yk.js"),__vite__mapDeps([3,4])).then(e=>e.OperationsPage),"operations"),S5=Ja(()=>nt(()=>import("./AgentHub-lOm96XuE.js"),[]).then(e=>e.AgentHubPage),"agent hub"),k5=Ja(()=>nt(()=>import("./Settings-DeZKX_Ry.js"),__vite__mapDeps([5,6])).then(e=>e.SettingsPage),"settings"),C5=Ja(()=>nt(()=>import("./AgentProfilePage-BRtazufK.js"),__vite__mapDeps([7,8,9])).then(e=>e.AgentProfilePage),"account"),E5=Ja(()=>nt(()=>import("./PublishingConviction-B5nWRsUP.js"),__vite__mapDeps([10,11,6,12])).then(e=>e.PublishingConvictionPage),"Publisher Conviction"),A5=Ja(()=>nt(()=>import("./ConvictionDetailView-DOTYSm7p.js"),__vite__mapDeps([13,12,6,11])).then(e=>e.ConvictionDetailView),"account"),j5=Ja(()=>nt(()=>import("./ProjectView-BaQQSy8L.js"),__vite__mapDeps([14,8,9,11,15,16])).then(e=>e.ProjectView),"project"),vp=Ja(()=>nt(()=>import("./MemoryLayerView-DDFI2ngR.js"),__vite__mapDeps([17,15])).then(e=>e.MemoryLayerView),({layer:e})=>({wm:"working memory",swm:"shared memory",vm:"verifiable memory"})[e]),T5=Ja(()=>nt(()=>import("./MemoryStackView-Bol2eMyq.js"),__vite__mapDeps([18,9])).then(e=>e.MemoryStackView),"memory stack");function N5(){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:b5})]},o.id))})}const R5=["text/","application/json","application/xml","application/javascript","application/x-yaml"];function _5(e){return R5.some(n=>e.startsWith(n))}function O5({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:"),D=a.find(T=>T.id===r),F=(D==null?void 0:D.label)??"Document",U=()=>{const T=a.find(G=>G.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 G=e.replace("urn:dkg:file:",""),Y=new AbortController;return fetch(GA(G,n||void 0),{headers:Vt(),signal:Y.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),_5(B)){const Q=await ie.text();T||(d(Q),b(!1))}else if(B.startsWith("image/")){const Q=await ie.blob();T||(f(URL.createObjectURL(Q)),b(!1))}else if(B==="application/pdf"){const Q=await ie.blob();T||(f(URL.createObjectURL(Q)),b(!1))}else{const Q=await ie.text();T||(d(Q),b(!1))}}).catch(ie=>{T||(C(ie.message),b(!1))}),()=>{T=!0,Y.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",P=y.startsWith("text/markdown")||n.startsWith("text/markdown"),M=!x&&!k&&R&&P&&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:["📄 ",F]}),M&&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 G=j===T;return m.jsx("button",{type:"button","aria-pressed":G,onClick:()=>E(T),style:{border:"none",borderRadius:4,cursor:"pointer",padding:"3px 12px",fontSize:11,fontWeight:600,fontFamily:"var(--font-sans)",color:G?"var(--text-primary)":"var(--text-secondary)",background:G?"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:F,style:{maxWidth:"100%",borderRadius:8}}),!x&&W&&p&&m.jsx("iframe",{src:p,title:F,style:{width:"100%",height:"100%",border:"none",borderRadius:8}}),u!==null&&!_&&!W&&P&&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(iS,{content:u})}),u!==null&&!_&&!W&&!(P&&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 D5(){const e=mn(n=>n.activeTabId);if(e==="dashboard")return m.jsx(I4,{});if(e==="operations")return m.jsx(w5,{});if(e==="agent-hub")return m.jsx(S5,{});if(e==="settings")return m.jsx(k5,{});if(e==="conviction")return m.jsx(E5,{});if(e==="memory-stack")return m.jsx(T5,{});if(e===Lh)return m.jsx(B4,{});if(e.startsWith("project:")){const n=e.slice(8);return m.jsx(j5,{contextGraphId:n})}if(e.startsWith("conviction:")){const n=e.slice(11);return m.jsx(A5,{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(C5,{contextGraphId:r,agentUri:s})}}if(e.startsWith(zh)){const{docRef:n,contentType:a}=H4(e);return m.jsx(O5,{docRef:n,contentType:a})}return e.startsWith("wm:")?m.jsx(vp,{layer:"wm",contextGraphId:e.slice(3)}):e.startsWith("swm:")?m.jsx(vp,{layer:"swm",contextGraphId:e.slice(4)}):e.startsWith("vm:")?m.jsx(vp,{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 M5(){return m.jsxs("div",{className:"v10-panel-center",children:[m.jsx(N5,{}),m.jsx("div",{className:"v10-center-content",children:m.jsx(D5,{})})]})}const L5=["Node Log","Transactions"],z5=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"})}),I5=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"})]}),P5=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"})]}),U5=/(\x1B\[[0-9;]*[mGKHFJA-Z]|\[[0-9;]*m)/g;function B5(e){return e.replace(U5,"")}function Q1(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 H5={error:"var(--accent-red, #ef4444)",warn:"var(--accent-yellow, #f59e0b)",info:"var(--text-primary)",debug:"var(--text-tertiary)"};function $5(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 q5(){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(B5))).catch(()=>{})},[a]);S.useEffect(()=>{u();const y=setInterval(u,3e3);return()=>clearInterval(y)},[u]);const d=e.filter(y=>o==="all"||Q1(y)===o),p=d.length>0?d[d.length-1]:"",f=$5(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:H5[Q1(y)]},children:y},g)),d.length===0&&m.jsx("div",{className:"v10-log-line",style:{color:"var(--text-tertiary)"},children:"No log output"})]})]})}const F5=new Set(["publish","publishFromSWM","update","ka-update","verify","reconstruct"]),G5={publish:"#22c55e",publishFromSWM:"#16a34a",update:"#14b8a6","ka-update":"#0d9488",verify:"#8b5cf6",reconstruct:"#fb923c"};function V5(){const[e,n]=S.useState([]),[a,r]=S.useState(null),o=S.useCallback(()=>{const s=String(Date.now()-216e5),u=[...F5].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:G5[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:X0(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?Q0(s.duration_ms):"—"}),m.jsx("td",{style:{padding:"7px 12px",color:"var(--text-secondary)"},children:s.started_at?qR(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:X0(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?Q0(f.duration_ms):""]},f.phase))})]})})]},s.operation_id)})})]})})}function W5(){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:[L5.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?P5:I5}),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:z5})})]}),!e&&m.jsxs("div",{className:"v10-bottom-content",children:[u==="Node Log"&&m.jsx(q5,{}),u==="Transactions"&&m.jsx(V5,{})]})]})}function X1(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 Kc(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 Y5(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function K5(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 Q5(e){return e.startsWith("did:dkg:context-graph:")?e:`did:dkg:context-graph:${e}`}function X5(e){return String(e??"").replace(/[\u0000-\u001F\u007F]/g," ").replace(/\s+/g," ").trim()}function rS(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 lS(e){return e.status==="queued"||e.status==="completed"||e.status==="skipped"}function oS(e){return e.name.trim()}function Z5(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:oS(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 J5(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:oS(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 sS(e){return e.length===0?"":e.length===1?`Attachment import result: ${X5(e[0].fileName)}.`:`Attached ${e.length} document import results.`}function eL(e,n){const a=[rS(e),sS(n)].filter(r=>r.length>0).map(r=>r.replace(/\.$/,""));return a.length?`${a.join("; ")}.`:""}function tL(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:Q5(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 nL="https://docs.openclaw.ai/",aL="https://github.com/openclaw/openclaw/releases",sr="__add_agent__",iL=["openclaw"];function rL(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 xp(e,n,a){return e+(n-e)*a}function cS(e){return e-Math.floor(e)}function bp(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 tm(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 lL(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 oL(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 sL=(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=tm(k,g),[j,E,R]=p(C[0]*d,C[1]*d,C[2]*d),D=(R/d+1)/2;y.push({x:j,y:E,z:R,r:.8*f,white:.78,a:.1+.22*D})}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=(cS(j/x+a*.045)*2-1)*.96,R=Math.sqrt(Math.max(0,1-E*E)),D=Math.min(1,(1-Math.abs(E))/.1),F=E*Math.PI*b+C,U=1+.075*Math.sin(E*Math.PI*b*2+C*2+a*.8),_=R*d*U,[W,P,M]=p(Math.cos(F)*_,E*d*U,Math.sin(F)*_),T=(M/d+1)/2;y.push({x:W,y:P,z:M,r:((o.rBase??1.2)+(o.rDepth??1.8)*T)*f,white:.55-.45*T,a:D*(.45+.55*T)})}}zi(e,y,r,o.rMin)};function cL(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 uL(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 dL(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 fL=(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),D=Math.sin(E),F=Math.max(1,Math.round(Math.abs(R)*C));for(let U=0;U<F;U++){const _=U/F*2*Math.PI,[W,P,M]=f(R*Math.cos(_),D,R*Math.sin(_)),T=(M+1)/2,G=lL(_+a*.5,y),Y=Math.exp(-(G*G)/.18)*Math.max(0,M);b.push({x:W,y:P,z:M,r:((o.rBase??.6)+(o.rDepth??1.7)*T+(o.rBoost??1)*Y)*g,white:(o.inkFar??.62)-(o.inkSpan??.54)*T,a:x+(1-x)*Math.min(1,Y)})}}zi(e,b,r,o.rMin)},pL=(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=dL(y),x=cL(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),D=Math.sin(E),F=Math.max(1,Math.round(Math.abs(R)*C));for(let U=0;U<F;U++){const _=U/F*2*Math.PI,[W,P,M,T]=uL([R*Math.cos(_),D,R*Math.sin(_)],g,x),[G,Y,ie]=p(W,P,M),B=(ie+1)/2;b.push({x:G,y:Y,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)},hL=(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),D=Math.max(1,Math.round(Math.abs(C)*x));for(let F=0;F<D;F++){const U=F/D*2*Math.PI,[_,W,P]=p(C*Math.cos(U)*R,j*R,C*Math.sin(U)*R),M=(P/d+1)/2,T=Math.max(0,E);y.push({x:_,y:W,z:P,r:((o.rBase??.6)+(o.rDepth??1.7)*M)*(1+.4*T)*f,white:.66-.56*M-.1*T})}}zi(e,y,r,o.rMin)};function mL(e){return e*e*(3-2*e)}function uS(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 gL=e=>{const n=-Math.PI/2+e*2*Math.PI;return[Math.cos(n)*.24,Math.sin(n)*.24]},yL=uS([[0,-.26],[.24,.16],[-.24,.16]]),vL=uS([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),wp=[gL,yL,vL];function xL(e){return Math.max(6,Math.round(34*e))}const eh=1.4,dS=.9,Sp=eh+dS,bL=(e,n,a,r,o)=>{const s=wp.length,u=a%(Sp*s),d=Math.floor(u/Sp),p=u-d*Sp,f=p>eh?mL((p-eh)/dS):0,y=o.spread??1,g=wp[d],x=wp[(d+1)%s],b=160,k=[];for(let P=0;P<b;P++){const M=P/b,T=g(M),G=x(M);k.push([(T[0]+(G[0]-T[0])*f)*y,(T[1]+(G[1]-T[1])*f)*y])}const C=[];let j=0;for(let P=0;P<b;P++){const M=k[P],T=k[(P+1)%b],G=Math.hypot(T[0]-M[0],T[1]-M[1]);C.push(G),j+=G}const E=xL(o.iconD??1),R=(o.rDot??.021)*1.35*y,D=1+.02*Math.sin(p*3.1),F=[],U=n/2;let _=0,W=0;for(let P=0;P<E;P++){const M=P/E*j;for(;W+C[_]<M&&_<b-1;)W+=C[_],_++;const T=k[_],G=k[(_+1)%b],Y=C[_]?Math.min(1,(M-W)/C[_]):0,ie=(T[0]+(G[0]-T[0])*Y)*D,B=(T[1]+(G[1]-T[1])*Y)*D;F.push({x:U+ie*n,y:U+B*n,z:0,r:Math.max(.35,R*n),white:.1})}zi(e,F,r,o.rMin)},wL=(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),D=C*2*Math.PI,F=Math.acos(2*j-1),U=Math.sin(F)*Math.cos(D),_=Math.cos(F),W=Math.sin(F)*Math.sin(D);let P=-_,M=U;const T=0,G=Math.max(1e-6,Math.sqrt(P*P+M*M));P/=G,M/=G;const Y=_*T-W*M,ie=W*P-U*T,B=U*M-_*P,Q=(.25+.55*E)*(E>.5?1:-1);for(let H=0;H<x;H++){const ee=H/x*2*Math.PI,[ne,V,O]=p((P*Math.cos(ee)+Y*Math.sin(ee))*R,(M*Math.cos(ee)+ie*Math.sin(ee))*R,(T*Math.cos(ee)+B*Math.sin(ee))*R),L=(O/R+1)/2;y.push({x:ne,y:V,z:O,r:(o.ghostR??.9)*f,white:.72,a:(o.ghostA??.5)*(.4+.6*L)})}for(let H=0;H<b;H++){const ee=a*Q+H/b*2*Math.PI+j*6,[ne,V,O]=p((P*Math.cos(ee)+Y*Math.sin(ee))*R,(M*Math.cos(ee)+ie*Math.sin(ee))*R,(T*Math.cos(ee)+B*Math.sin(ee))*R),L=(O/R+1)/2;y.push({x:ne,y:V,z:O,r:((o.partR??1.2)+(o.partRDepth??1.6)*L)*f,white:.3-.22*L})}}zi(e,y,r,o.rMin)},Z1=(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 Q=tm(B,b),[H,ee,ne]=y(Q[0]*d,Q[1]*d,Q[2]*d),V=(ne/d+1)/2;x.push({x:H,y:ee,z:ne,r:.8*g,white:.78,a:.1+.22*V})}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),D=-R*Math.sin(C),F=Math.cos(C),U=j*Math.sin(C),_=E*U-R*F,W=R*D-j*U,P=j*F-E*D,M=.23*(o.wobMul??1),T=o.faceOn?d/(1+.85*M):d,G=o.lanes??5,Y=o.segs??88,ie=Math.max(1,Math.round(G*(o.bandMul??1)));for(let B=0;B<ie;B++){const Q=(B-(ie-1)/2)*.075,H=Math.abs(B-(ie-1)/2)/Math.max(1,(ie-1)/2);for(let ee=0;ee<Y;ee++){const ne=ee/Y*2*Math.PI,V=(.16*Math.sin(ne*3-a*1.7+B*.22)+.07*Math.sin(ne*5+a*1.1))*(o.wobMul??1),O=o.faceOn?1+V:1,L=o.faceOn?Q:Q+V,X=j*Math.cos(ne)+D*Math.sin(ne)+_*L,N=E*Math.cos(ne)+F*Math.sin(ne)+W*L,ue=R*Math.cos(ne)+U*Math.sin(ne)+P*L,pe=Math.sqrt(X*X+N*N+ue*ue),he=T*O,[Ee,Ue,Ne]=y(X/pe*he,N/pe*he,ue/pe*he),et=(Ne/d+1)/2;x.push({x:Ee,y:Ue,z:Ne,r:((o.rBase??1.1)+(o.rDepth??1.7)*et)*(1-.25*H)*g,white:.52-.44*et+.18*H,a:.4+.6*et})}}zi(e,x,r,o.rMin)},SL=(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 D=tm(R,y),F=D[0]+.3*(bp(R*.31+9,a*.24)-.5)*2,U=D[1]+.3*(bp(R*.53+27,a*.21)-.5)*2,_=D[2]+.3*(bp(R*.77+55,a*.27)-.5)*2,W=Math.sqrt(F*F+U*U+_*_);k.push([F/W,U/W,_/W])}const C=[],j=[];for(let R=0;R<y;R++)for(let D=R+1;D<y;D++){const F=k[R][0]-k[D][0],U=k[R][1]-k[D][1],_=k[R][2]-k[D][2],W=Math.sqrt(F*F+U*U+_*_);if(W>=g)continue;const[P,M,T]=p(k[R][0],k[R][1],k[R][2]),[G,Y,ie]=p(k[D][0],k[D][1],k[D][2]),B=((T+ie)/2+1)/2;C.push({x1:P,y1:M,x2:G,y2:Y,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[D,F,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:D,y:F,z:U,r:(x+b*_)*W*f,white:.55-.45*_})}const E=o.signals??5;for(let R=0;R<E;R++){const D=Math.floor(a*.55+R*7.31),F=Math.floor(ia(D,R*3.1+1.7)*y),U=Math.floor(ia(D,R*5.7+4.2)*y);if(F===U)continue;const _=cS(a*.55+R*7.31),W=xp(k[F][0],k[U][0],_),P=xp(k[F][1],k[U][1],_),M=xp(k[F][2],k[U][2],_),T=Math.max(1e-6,Math.sqrt(W*W+P*P+M*M)),[G,Y,ie]=p(W/T,P/T,M/T),B=(ie+1)/2;j.push({x:G,y:Y,z:ie,r:(x*1.5+b*B)*f,white:.05,a:.5+.5*B})}oL(e,C,r),zi(e,j,r,o.rMin)},kL={orbits:wL,globe:fL,rubik:pL,wave:hL,web:SL,braid:sL,ribbon:Z1,ring:Z1,morph:bL},CL=[["latRings","lonDensity"],["rings","lonDensity"],["lanes","segs"]],EL=["orbitN","ghostN","nodeN","strandN","signals"],AL=["iconD"],jL=["rBase","rDepth","rActive","rDot","ghostR","partR","partRDepth","nodeR","nodeRDepth"];function TL(e,n){const a={...e},r=new Set,o=Math.sqrt(n);for(const[s,u]of CL){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 EL){const u=a[s];u!=null&&u!==0&&!r.has(s)&&(a[s]=Math.max(1,Math.round(u*n)))}for(const s of AL){const u=a[s];u!=null&&(a[s]=Math.max(.02,u*n))}return a}function NL(e,n){const a={...e};for(const r of jL){const o=a[r];o!=null&&(a[r]=o*n)}return a.rSizeMul=(a.rSizeMul??1)*n,a}const RL={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}},_L={working:"orbits",searching:"globe",solving:"rubik",listening:"wave",connecting:"web",weaving:"braid",composing:"ribbon",breathing:"ring",shaping:"morph"},OL={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}}}},J1=new Map;function DL(e,n){const a=`${e}-${n}`,r=J1.get(a);if(r)return r;const o=_L[e],s=OL[o][n];let u={...RL[o]};s.count!==1&&(u=TL(u,s.count)),s.size!==1&&(u=NL(u,s.size)),s.extra&&(u={...u,...s.extra});const d={mode:o,speed:s.speed,opts:u};return J1.set(a,d),d}function ML(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 LL(){return typeof matchMedia>"u"||matchMedia("(prefers-color-scheme: dark)").matches}function zL(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=ML(n.current);r(p??LL())};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 IL(){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 PL={working:"Working…",searching:"Searching…",solving:"Solving…",listening:"Listening…",connecting:"Connecting…",weaving:"Weaving…",composing:"Composing…",breathing:"Thinking…",shaping:"Shaping…"};function UL({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=zL(a,p),y=IL();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}=DL(e,n),E=kL[k],R=C*r,D=Y=>{b.setTransform(x,0,0,x,0,0),b.clearRect(0,0,n,n),E(b,n,Y,f,j)};if(y){D(.6);return}let F=0,U=!1;const _=()=>{D(performance.now()/1e3*R),U&&(F=requestAnimationFrame(_))},W=()=>{U||o||(U=!0,F=requestAnimationFrame(_))},P=()=>{U=!1,cancelAnimationFrame(F)};D(performance.now()/1e3*R);let M=!0;const T=typeof IntersectionObserver<"u"?new IntersectionObserver(([Y])=>{M=Y.isIntersecting,M&&document.visibilityState!=="hidden"?W():P()}):null;T==null||T.observe(g);const G=()=>{document.visibilityState==="hidden"?P():M&&W()};return document.addEventListener("visibilitychange",G),T||W(),()=>{P(),T==null||T.disconnect(),document.removeEventListener("visibilitychange",G)}},[e,n,f,r,o,y]),m.jsx("canvas",{ref:p,role:"img","aria-label":u??PL[e],style:{width:n,height:n,display:"block",...s},...d})}let BL=0;function HL(e,n,a){const r=e.trim();return r?r===n?!0:a==="Request cancelled."&&r===a:!1}function $L(e,n,a,r){return e&&HL(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 qL(e,n){return e?{content:e,failureNotice:n,synthesized:!1}:{content:n,synthesized:!0}}function ex(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?$L(e.text,u,o,n):null,p=(d==null?void 0:d.content)??(e.text||rS(e.attachmentRefs??[])),f=!!e.text;return{id:e.uri||`local-history:${++BL}`,uri:e.uri,turnId:e.turnId,role:r,content:p,ts:Kc(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 FL(e){return e.turnId?`turn:${e.turnId}:${e.role}`:e.uri??`${e.role}:${e.ts??""}:${e.content}`}function kp(e,n){const a=new Set,r=[];for(const o of[...n,...e]){const s=FL(o);a.has(s)||(a.add(s),r.push(o))}return r}function tx(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 nx(e){return e.replace(/\r\n/g,`
|
|
1167
|
+
`).replace(/^(?:[ \t]*\n)+/,"").replace(/(?:\n[ \t]*)+$/,"")}function GL(e,n,a,r,o){const s=nx(e),u=o?nx(o):"";if(n==="assistant"&&r&&s.trim()===""&&!u)return m.jsxs("span",{className:"v10-chat-thinking",role:"status","aria-live":"polite",children:[m.jsx(UL,{"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(iS,{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(`
|
|
1168
|
+
|
|
1169
|
+
`);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 VL(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 WL=S.useLayoutEffect,YL=function(n){var a=hn.useRef(n);return WL(function(){a.current=n}),a},ax=function(n,a){if(typeof n=="function"){n(a);return}n.current=a},KL=function(n,a){var r=hn.useRef();return hn.useCallback(function(o){n.current=o,r.current&&ax(r.current,null),r.current=a,a&&ax(a,o)},[a])},ix={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},QL=function(n){Object.keys(ix).forEach(function(a){n.style.setProperty(a,ix[a],"important")})},rx=QL,fn=null,lx=function(n,a){var r=n.scrollHeight;return a.sizingStyle.boxSizing==="border-box"?r+a.borderSize:r-a.paddingSize};function XL(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"),rx(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]}),rx(fn),fn.value=n;var p=lx(fn,e);fn.value=n,p=lx(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 ox=function(){},ZL=function(n,a){return n.reduce(function(r,o){return r[o]=a[o],r},{})},JL=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],ez=!!document.documentElement.currentStyle,tz=function(n){var a=window.getComputedStyle(n);if(a===null)return null;var r=ZL(JL,a),o=r.boxSizing;if(o==="")return null;ez&&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}},nz=tz;function nm(e,n,a){var r=YL(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 az=function(n,a){nm(document.body,"reset",function(r){n.current.form===r.target&&a(r)})},iz=function(n){nm(window,"resize",n)},rz=function(n){nm(document.fonts,"loadingdone",n)},lz=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],oz=function(n,a){var r=n.cacheMeasurements,o=n.maxRows,s=n.minRows,u=n.onChange,d=u===void 0?ox:u,p=n.onHeightChange,f=p===void 0?ox:p,y=VL(n,lz),g=y.value!==void 0,x=S.useRef(null),b=KL(x,a),k=S.useRef(0),C=S.useRef(),j=function(){var D=x.current,F=r&&C.current?C.current:nz(D);if(F){C.current=F;var U=XL(F,D.value||D.placeholder||"x",s,o),_=U[0],W=U[1];k.current!==_&&(k.current=_,D.style.setProperty("height",_+"px","important"),f(_,{rowHeight:W}))}},E=function(D){g||j(),d(D)};return S.useLayoutEffect(j),az(x,function(){if(!g){var R=x.current.value;requestAnimationFrame(function(){var D=x.current;D&&R!==D.value&&j()})}}),iz(j),rz(j),S.createElement("textarea",th({},y,{onChange:E,ref:b}))},sz=S.forwardRef(oz),Cp={exports:{}},Ep,sx;function cz(){if(sx)return Ep;sx=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ep=e,Ep}var Ap,cx;function uz(){if(cx)return Ap;cx=1;var e=cz();function n(){}function a(){}return a.resetWarningCache=n,Ap=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},Ap}var ux;function dz(){return ux||(ux=1,Cp.exports=uz()()),Cp.exports}var fz=dz();const mt=Po(fz);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 pz=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=hz(e),{webkitRelativePath:o}=e,s=typeof n=="string"?n:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&dx(r,"path",s),dx(r,"relativePath",s),r}function hz(e){const{name:n}=e;if(n&&n.lastIndexOf(".")!==-1&&!e.type){const r=n.split(".").pop().toLowerCase(),o=pz.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function dx(e,n,a){Object.defineProperty(e,n,{value:a,writable:!1,configurable:!1,enumerable:!0})}const mz=[".DS_Store","Thumbs.db"];function gz(e){return hr(this,void 0,void 0,function*(){return Qc(e)&&yz(e.dataTransfer)?wz(e.dataTransfer,e.type):vz(e)?xz(e):Array.isArray(e)&&e.every(n=>"getFile"in n&&typeof n.getFile=="function")?bz(e):[]})}function yz(e){return Qc(e)}function vz(e){return Qc(e)&&Qc(e.target)}function Qc(e){return typeof e=="object"&&e!==null}function xz(e){return nh(e.target.files).map(n=>ol(n))}function bz(e){return hr(this,void 0,void 0,function*(){return(yield Promise.all(e.map(a=>a.getFile()))).map(a=>ol(a))})}function wz(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(Sz));return fx(fS(r))}return fx(nh(e.files).map(a=>ol(a)))})}function fx(e){return e.filter(n=>mz.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 Sz(e){if(typeof e.webkitGetAsEntry!="function")return px(e);const n=e.webkitGetAsEntry();return n&&n.isDirectory?pS(n):px(e,n)}function fS(e){return e.reduce((n,a)=>[...n,...Array.isArray(a)?fS(a):[a]],[])}function px(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 kz(e){return hr(this,void 0,void 0,function*(){return e.isDirectory?pS(e):Cz(e)})}function pS(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(kz));o.push(d),s()}else try{const d=yield Promise.all(o);a(d)}catch(d){r(d)}}),u=>{r(u)})}s()})}function Cz(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={},hx;function Ez(){return hx||(hx=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 Az=Ez();const jp=Po(Az);function mx(e){return Nz(e)||Tz(e)||mS(e)||jz()}function jz(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1170
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tz(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nz(e){if(Array.isArray(e))return ah(e)}function gx(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 yx(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?gx(Object(a),!0).forEach(function(r){hS(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):gx(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}function hS(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 Oz(e)||_z(e,n)||mS(e,n)||Rz()}function Rz(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1171
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mS(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 _z(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 Oz(e){if(Array.isArray(e))return e}var Dz=typeof jp=="function"?jp:jp.default,Mz="file-invalid-type",Lz="file-too-large",zz="file-too-small",Iz="too-many-files",Pz=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:Mz,message:"File type must be ".concat(r)}},vx=function(n){return{code:Lz,message:"File is larger than ".concat(n," ").concat(n===1?"byte":"bytes")}},xx=function(n){return{code:zz,message:"File is smaller than ".concat(n," ").concat(n===1?"byte":"bytes")}},Uz={code:Iz,message:"Too many files"};function Bz(e){return e.type===""&&typeof e.getAsFile=="function"}function gS(e,n){var a=e.type==="application/x-moz-file"||Dz(e,n)||Bz(e);return[a,a?null:Pz(n)]}function yS(e,n,a){if(or(e.size))if(or(n)&&or(a)){if(e.size>a)return[!1,vx(a)];if(e.size<n)return[!1,xx(n)]}else{if(or(n)&&e.size<n)return[!1,xx(n)];if(or(a)&&e.size>a)return[!1,vx(a)]}return[!0,null]}function or(e){return e!=null}function Hz(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=gS(p,a),y=Io(f,1),g=y[0],x=yS(p,r,o),b=Io(x,1),k=b[0],C=d?d(p):null;return g&&k&&!C})}function Xc(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 bx(e){e.preventDefault()}function $z(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function qz(e){return e.indexOf("Edge/")!==-1}function Fz(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return $z(e)||qz(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!Xc(r)&&d&&d.apply(void 0,[r].concat(s)),Xc(r)})}}function Gz(){return"showOpenFilePicker"in window}function Vz(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 vS(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(xS))&&(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 yx(yx({},a),{},hS({},s,u))},{});return[{description:"Files",accept:n}]}return e}function Wz(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(mx(n),[o],mx(s))},[]).filter(function(n){return vS(n)||xS(n)}).join(",")}function Yz(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Kz(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function vS(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function xS(e){return/^.*\.[\w]+$/.test(e)}var Qz=["children"],Xz=["open"],Zz=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Jz=["refKey","onChange","onClick"];function wx(e){return nI(e)||tI(e)||bS(e)||eI()}function eI(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1172
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nI(e){if(Array.isArray(e))return ih(e)}function Tp(e,n){return rI(e)||iI(e,n)||bS(e,n)||aI()}function aI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1173
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bS(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 iI(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 rI(e){if(Array.isArray(e))return e}function Sx(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?Sx(Object(a),!0).forEach(function(r){rh(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Sx(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 Zc(e,n){if(e==null)return{};var a=lI(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 lI(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 am=S.forwardRef(function(e,n){var a=e.children,r=Zc(e,Qz),o=SS(r),s=o.open,u=Zc(o,Xz);return S.useImperativeHandle(n,function(){return{open:s}},[s]),hn.createElement(S.Fragment,null,a(kt(kt({},u),{},{open:s})))});am.displayName="Dropzone";var wS={disabled:!1,getFilesFromEvent:gz,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};am.defaultProps=wS;am.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 SS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=kt(kt({},wS),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,D=n.preventDropOnDocument,F=n.noClick,U=n.noKeyboard,_=n.noDrag,W=n.noDragEventsBubbling,P=n.onError,M=n.validator,T=S.useMemo(function(){return Wz(a)},[a]),G=S.useMemo(function(){return Vz(a)},[a]),Y=S.useMemo(function(){return typeof j=="function"?j:kx},[j]),ie=S.useMemo(function(){return typeof C=="function"?C:kx},[C]),B=S.useRef(null),Q=S.useRef(null),H=S.useReducer(oI,lh),ee=Tp(H,2),ne=ee[0],V=ee[1],O=ne.isFocused,L=ne.isFileDialogActive,X=S.useRef(typeof window<"u"&&window.isSecureContext&&E&&Gz()),N=function(){!X.current&&L&&setTimeout(function(){if(Q.current){var $=Q.current.files;$.length||(V({type:"closeDialog"}),ie())}},300)};S.useEffect(function(){return window.addEventListener("focus",N,!1),function(){window.removeEventListener("focus",N,!1)}},[Q,L,ie,X]);var ue=S.useRef([]),pe=S.useRef([]),he=function($){B.current&&B.current.contains($.target)||($.preventDefault(),ue.current=[])};S.useEffect(function(){return D&&(document.addEventListener("dragover",bx,!1),document.addEventListener("drop",he,!1)),function(){D&&(document.removeEventListener("dragover",bx),document.removeEventListener("drop",he))}},[B,D]),S.useEffect(function(){var fe=function(I){pe.current=[].concat(wx(pe.current),[I.target]),wo(I)&&V({isDragGlobal:!0,type:"setDragGlobal"})},$=function(I){pe.current=pe.current.filter(function(Te){return Te!==I.target&&Te!==null}),!(pe.current.length>0)&&V({isDragGlobal:!1,type:"setDragGlobal"})},le=function(){pe.current=[],V({isDragGlobal:!1,type:"setDragGlobal"})},me=function(){pe.current=[],V({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 Ee=S.useCallback(function(fe){P?P(fe):console.error(fe)},[P]),Ue=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Mt(fe),ue.current=[].concat(wx(ue.current),[fe.target]),wo(fe)&&Promise.resolve(o(fe)).then(function($){if(!(Xc(fe)&&!W)){var le=$.length,me=le>0&&Hz({files:$,accept:T,minSize:u,maxSize:s,multiple:d,maxFiles:p,validator:M}),ye=le>0&&!me;V({isDragAccept:me,isDragReject:ye,isDragActive:!0,type:"setDraggedFiles"}),f&&f(fe)}}).catch(function($){return Ee($)})},[o,f,Ee,W,T,u,s,d,p,M]),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)&&(V({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=gS(ye,T),Te=Tp(I,2),at=Te[0],Ie=Te[1],Xe=yS(ye,u,s),Ve=Tp(Xe,2),Se=Ve[0],Wt=Ve[1],rt=M?M(ye):null;if(at&&Se&&!rt)le.push(ye);else{var ja=[Ie,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:[Uz]})}),le.splice(0)),V({acceptedFiles:le,fileRejections:me,type:"setFiles"}),x&&x(le,me,$),me.length>0&&k&&k(me,$),le.length>0&&b&&b(le,$)},[V,d,T,u,s,p,x,b,k,M]),xt=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Mt(fe),ue.current=[],wo(fe)&&Promise.resolve(o(fe)).then(function($){Xc(fe)&&!W||Ot($,fe)}).catch(function($){return Ee($)}),V({type:"reset"})},[o,Ot,Ee,W]),bt=S.useCallback(function(){if(X.current){V({type:"openDialog"}),Y();var fe={multiple:d,types:G};window.showOpenFilePicker(fe).then(function($){return o($)}).then(function($){Ot($,null),V({type:"closeDialog"})}).catch(function($){Yz($)?(ie($),V({type:"closeDialog"})):Kz($)?(X.current=!1,Q.current?(Q.current.value=null,Q.current.click()):Ee(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."))):Ee($)});return}Q.current&&(V({type:"openDialog"}),Y(),Q.current.value=null,Q.current.click())},[V,Y,ie,E,Ot,Ee,G,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(){V({type:"focus"})},[]),Pe=S.useCallback(function(){V({type:"blur"})},[]),pt=S.useCallback(function(){F||(Fz()?setTimeout(bt,0):bt())},[F,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,Ie=fe.onDragEnter,Xe=fe.onDragOver,Ve=fe.onDragLeave,Se=fe.onDrop,Wt=Zc(fe,Zz);return kt(kt(rh({onKeyDown:Nt(wa(ye,yt)),onFocus:Nt(wa(I,Zt)),onBlur:Nt(wa(Te,Pe)),onClick:Dt(wa(at,pt)),onDragEnter:ge(wa(Ie,Ue)),onDragOver:ge(wa(Xe,Ne)),onDragLeave:ge(wa(Ve,et)),onDrop:ge(wa(Se,xt)),role:typeof me=="string"&&me!==""?me:"presentation"},le,B),!r&&!U?{tabIndex:0}:{}),Wt)}},[B,yt,Zt,Pe,pt,Ue,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=Zc(fe,Jz),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,Q);return kt(kt({},Te),I)}},[Q,a,d,xt,r]);return kt(kt({},ne),{},{isFocused:O&&!r,getRootProps:qn,getInputProps:it,rootRef:B,inputRef:Q,open:Dt(bt)})}function oI(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 kx(){}function Cx({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 M=a.findIndex(T=>T.value===e);return M>=0?M:0}),k=S.useRef(null),C=S.useRef(null),j=S.useRef(null),E=a.find(M=>M.value===e),R=(E==null?void 0:E.label)??r,D=S.useCallback(()=>{var M;f(!1),(M=C.current)==null||M.focus()},[]),F=S.useCallback(()=>{const M=C.current;if(!M)return;const T=M.getBoundingClientRect(),G=Math.min(240,a.length*36+16),Y=window.innerHeight-T.bottom,ie=T.top,B=Y<G+16&&ie>Y?"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&&F()},[p,F]),S.useEffect(()=>{if(!p)return;const M=()=>F(),T=()=>F(),G=ie=>{var Q,H;const B=ie.target;(Q=k.current)!=null&&Q.contains(B)||(H=j.current)!=null&&H.contains(B)||f(!1)},Y=ie=>{ie.key==="Escape"&&(ie.preventDefault(),D())};return window.addEventListener("scroll",M,!0),window.addEventListener("resize",T),document.addEventListener("mousedown",G),document.addEventListener("keydown",Y),()=>{window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",T),document.removeEventListener("mousedown",G),document.removeEventListener("keydown",Y)}},[p,D,F]),S.useEffect(()=>{if(p){const M=a.findIndex(T=>T.value===e);b(M>=0?M: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=M=>{o||(M.key==="ArrowDown"||M.key==="Enter"||M.key===" ")&&(M.preventDefault(),f(!0))},_=M=>{var T;if(M.key==="ArrowDown")M.preventDefault(),b(G=>{var Y;for(let ie=1;ie<=a.length;ie++){const B=(G+ie)%a.length;if(!((Y=a[B])!=null&&Y.disabled))return B}return G});else if(M.key==="ArrowUp")M.preventDefault(),b(G=>{var Y;for(let ie=1;ie<=a.length;ie++){const B=(G-ie+a.length)%a.length;if(!((Y=a[B])!=null&&Y.disabled))return B}return G});else if(M.key==="Enter"){M.preventDefault();const G=a[x];G&&!G.disabled&&(n(G.value),D())}else if(M.key==="Home"){M.preventDefault();const G=a.findIndex(Y=>!Y.disabled);G>=0&&b(G)}else if(M.key==="End"){M.preventDefault();let G=-1;for(let Y=a.length-1;Y>=0;Y--)if(!((T=a[Y])!=null&&T.disabled)){G=Y;break}G>=0&&b(G)}},W=["v10-select",s,o?"disabled":"",p?"open":""].filter(Boolean).join(" "),P=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(M=>!M),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(UT,{className:"v10-select-caret",size:12,"aria-hidden":"true"})]}),p&&y&&wE.createPortal(m.jsxs("ul",{ref:j,className:`v10-select-menu v10-select-menu-${y.placement}`,role:"listbox",tabIndex:-1,onKeyDown:_,style:P,children:[a.length===0&&m.jsx("li",{className:"v10-select-option empty","aria-disabled":"true",children:"No options"}),a.map((M,T)=>m.jsx("li",{role:"option","aria-selected":M.value===e,title:M.label,className:["v10-select-option",M.value===e?"selected":"",T===x?"highlighted":"",M.disabled?"disabled":""].filter(Boolean).join(" "),onMouseEnter:()=>b(T),onMouseDown:G=>G.preventDefault(),onClick:()=>{o||M.disabled||(n(M.value),D())},children:M.label},M.value))]}),document.body)]})}function Ex(e){return e.bridgeOnline?"connected":e.status==="connecting"?"known":e.status==="degraded"?"degraded":"offline"}function sI(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 cI(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(FT,{"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 im(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:im(e.integrationId,n)}}function kS(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 CS(e){var a;if(e.selectedSessionId==null)return!1;const n=e.integrations.find(r=>r.id===e.integrationId);return!(((a=kS(e.selectedSessionId,e.integrations))==null?void 0:a.id)!==e.integrationId||n!=null&&n.defaultSessionId&&e.selectedSessionId!==n.defaultSessionId&&dI(e.integrationId,e.selectedSessionId))}function uI(e){return CS(e)}function dI(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 Ax(e,n){const a=e.flatMap(r=>{var d;const o=kS(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 ES(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 AS(e,n,a){const r=im(e,null);return Object.entries(n).some(([o,s])=>s.length>0&&(o===r||o.startsWith(`${e}:`)))||a.some(o=>o.integrationId===e)}function fI(e){const n=[...e.integrations].sort(fu),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?ES(r.id,e.selectedSessionId,e.localMessagesByConversation,e.sessions,r.defaultSessionId):!1,u=r?AS(r.id,e.localMessagesByConversation,e.sessions):!1;return{sortedIntegrations:n,connectedIntegrations:a,selectedIntegration:r,selectedConversation:o,selectedHasConversation:s,selectedIntegrationHasAnyConversation:u}}function pI(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 fu(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(fu)}function hI(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 mI(e){const n=e.selectedItem;return e.selectedIntegrationId===sr||n!=null&&(n.persistentChat||ES(e.selectedIntegrationId,e.selectedSessionId,e.localMessagesByConversation,e.sessionSummaries,n.defaultSessionId)||AS(e.selectedIntegrationId,e.localMessagesByConversation,e.sessionSummaries))}const gI={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 yI(e){return gI[e.trim().toLowerCase()]}function jx({integrationId:e}){const n=yI(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 vI(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:D,localInput:F,onLocalInputChange:U,onSendLocalMessage:_,onStopLocalStream:W,localSending:P,activeProjectId:M,availableProjects:T,projectsLoading:G,onSelectProject:Y,attachments:ie,onAddAttachments:B,onRemoveAttachment:Q}=e,H=e.selectableProjects??T,ee=ie,ne=ee.some(lS),V=[...new Set(ee.map(I=>I.contextGraphId))],O=ee.some(I=>I.status==="uploading"),X=E.some(I=>I.streaming)?"streaming":O?"uploading":"idle",N=ee.length>0&&ee.some(I=>I.contextGraphId!==M),ue=S.useRef(null),pe=S.useRef(null),[he,Ee]=S.useState(null),Ue=S.useCallback(I=>{pe.current=I,Ee(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]),Pe=SS({onDrop:Zt,noClick:!0,noKeyboard:!0}),pt=[...n].sort(fu),Dt=pt.filter(I=>I.persistentChat),Nt=pt.filter(I=>!I.persistentChat),ge=r,{showingSessionHistory:Mt,showingStoredSessions:qn,visibleAgentTabs:yn,showAddFlow:it,shouldShowConversationLoader:fe}=pI({connectedAgents:Dt,selectedIntegration:r,selectedIntegrationId:a,selectedHasConversation:s,selectedIntegrationHasAnyConversation:u,localHistoryLoaded:R,localMessagesCount:E.length}),$=P||!(ge!=null&&ge.chatReady)||ge.busy===!0,le=!$&&!O&&(F.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:CS({integrationId:I.id,selectedSessionId:o,integrations:n}),sessionId:I.defaultSessionId}),role:"tab","aria-selected":Te,children:[m.jsx("span",{className:`v10-agents-stat-dot ${Ex(I)}`}),m.jsx(jx,{integrationId:I.id}),m.jsx("span",{children:I.name})]}),Te&&m.jsx(cI,{integration:I,statusLabel:sI(I,Mt),statusDotClass:Ex(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(jx,{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:nL,target:"_blank",rel:"noreferrer",children:"Docs"}),m.jsx("a",{className:"v10-agent-link-btn",href:aL,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",{...Pe.getRootProps({className:"v10-local-agent-chat-shell"}),children:[m.jsx("input",{...Pe.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(Cx,{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:P||ge.busy===!0})]}),Pe.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(oN,{className:"v10-drop-overlay-icon",size:32,"aria-hidden":"true"}):m.jsx(LT,{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,M)}`: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:Ue,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:GL(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(Ie=>m.jsx("span",{className:"v10-local-agent-attachment-chip",style:{padding:"2px 8px",borderRadius:999,background:"var(--bg-elevated)",fontSize:11},children:Ie.fileName},Ie.id??Ie.assertionUri??Ie.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(Ie=>Ie.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:D}),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(_T,{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:[ee.length>0&&m.jsx("div",{className:"v10-attachment-chips",role:"list","aria-label":"Attached files",children:ee.map(I=>{var Ie,Xe;const Te=((Ie=I.result)==null?void 0:Ie.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:K5(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:Y5(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:()=>Q(I.id),disabled:P,"aria-label":`Remove ${I.file.name}`,title:"Remove attachment",children:m.jsx(pN,{size:12,"aria-hidden":"true"})})]},I.id)})}),N&&m.jsx("div",{className:"v10-local-agent-copy",style:{margin:0,color:"var(--text-tertiary)"},children:V.length>1?"Queued files keep their stored targets and may span multiple projects.":`Queued files keep their stored target (${Jp(T,V[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(sz,{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:F,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"&&F.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(eN,{size:14,"aria-hidden":"true"})}),m.jsx("div",{className:"v10-composer-target",children:m.jsx(Cx,{className:"v10-local-agent-target-select",value:M??"",onChange:Y,options:[...M?[{value:"",label:"No context graph (clear selection)"}]:[],...H.map(I=>({value:I.id,label:I.name}))],placeholder:G?"Loading context graphs…":"Choose a context graph",disabled:G||!M&&H.length===0,ariaLabel:"Active project",prefixIcon:m.jsx(VT,{size:12,"aria-hidden":"true"})})})]}),m.jsx("button",{type:"button",className:`v10-local-agent-inline-send v10-local-agent-inline-send-${X}`,onClick:X==="streaming"?W:_,disabled:X==="streaming"?!1:X==="uploading"?!0:!le,"aria-label":X==="streaming"?"Stop reply":X==="uploading"?"Send message (attachments uploading)":"Send message",title:X==="streaming"?"Stop reply":X==="uploading"?"Send message (attachments uploading)…":"Send message",children:X==="streaming"?m.jsx(aN,{size:12,"aria-hidden":"true"}):X==="uploading"?m.jsx(QT,{className:"v10-local-agent-inline-send-spinner",size:14,"aria-hidden":"true"}):m.jsx(DT,{size:14,"aria-hidden":"true"})})]})]})})]})})]})]})}function Np(e){return e.length>12?e.slice(-8):e}function xI(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 bI(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 wI({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())||Np(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:Np(e.peerId)}),e.connected&&e.openedAt!=null&&m.jsxs("span",{children:["up ",X1(Date.now()-e.openedAt)]}),!e.connected&&e.lastSeen!=null&&m.jsxs("span",{children:[X1(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:xI(g.agentUri)||Np(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 Tx(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(Ip,{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(wI,{peer:u},u.peerId))})]})}function SI(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}=bI(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(Tx,{label:"Connected",peers:f,expanded:s,onToggle:()=>u(b=>!b),emptyMessage:"No peers currently connected."}),m.jsx(Tx,{label:"Recently seen",peers:y,expanded:d,onToggle:()=>p(b=>!b),emptyMessage:"No previously-seen peers."})]})]})}function kI(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?` - ${Kc(r.lastTs)}`:""]})]},r.sessionId))]})})}function CI(){return Ch().data}function EI(){const{stage:e,advance:n}=Nh(),[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=CI(),[b,k]=S.useState([]),[C,j]=S.useState("openclaw"),[E,R]=S.useState(()=>rr("openclaw")),[D,F]=S.useState(null),[U,_]=S.useState(null),[W,P]=S.useState(null),[M,T]=S.useState(null),[G,Y]=S.useState(null),[ie,B]=S.useState({}),[Q,H]=S.useState({}),[ee,ne]=S.useState({}),[V,O]=S.useState({}),[L,X]=S.useState({}),N=S.useRef(new Map),ue=S.useRef(!1),pe=S.useRef(null),he=S.useRef([]),Ee=S.useRef({}),Ue=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(()=>AR(et,x?Dh(x):null,xt),[et,x,xt]),Zt=Ax(o,b),{selectedIntegration:Pe,selectedConversation:pt,selectedHasConversation:Dt,selectedIntegrationHasAnyConversation:Nt}=fI({integrations:b,selectedIntegrationId:C,selectedSessionId:E,localMessagesByConversation:ie,sessions:Zt}),ge=(pt==null?void 0:pt.stateKey)??null,Mt=ge?ie[ge]??[]:[],qn=ge?V[ge]??!1:!1,yn=ge?Q[ge]??"":"",it=ge?ee[ge]??!1:!1,fe=ge?L[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(()=>{Ee.current=ie},[ie]),S.useEffect(()=>{Ue.current=C},[C]),S.useEffect(()=>{Ne.current=E},[E]);const le=S.useCallback((se,ve)=>{B(ke=>({...ke,[se]:ve(ke[se]??[])}))},[]),me=S.useCallback((se,ve)=>{se&&H(ke=>({...ke,[se]:ve}))},[]),ye=S.useCallback((se,ve)=>{ne(ke=>({...ke,[se]:ve}))},[]),I=S.useCallback((se,ve)=>{X(ke=>({...ke,[se]:ve(ke[se]??[])}))},[]),Te=S.useCallback((se,ve,ke)=>{const De=Array.from(ve);if(De.length===0)return;const Ye=new Set((L[se]??[]).map(we=>`${we.contextGraphId}:${we.file.name}:${we.file.size}:${we.file.lastModified}`)),lt=De.filter(we=>{const _e=`${ke}:${we.name}:${we.size}:${we.lastModified}`;return Ye.has(_e)?!1:(Ye.add(_e),!0)});if(lt.length===0)return;const Re=lt.map(we=>({id:`${se}:${we.name}:${we.size}:${we.lastModified}:${crypto.randomUUID()}`,file:we,contextGraphId:ke,assertionName:`${Date.now().toString(36)}-${crypto.randomUUID().slice(0,8)}-${we.name.replace(/[^a-zA-Z0-9._-]/g,"_")}`,status:"queued"}));I(se,we=>[...we,...Re])},[L,I]),at=S.useCallback(async(se,ve)=>{const ke=[];for(const De of ve){if(De.status==="completed"||De.status==="skipped"){ke.push(De);continue}I(se,Ye=>Ye.map(lt=>lt.id===De.id?{...lt,status:"uploading",error:void 0}:lt));try{const Ye=await IA(De.assertionName,De.contextGraphId,De.file),lt=Ye.extraction.status==="completed"?"completed":Ye.extraction.status==="skipped"?"skipped":"error",Re={...De,status:lt,result:Ye,error:Ye.extraction.error};ke.push(Re),I(se,we=>we.map(_e=>_e.id===De.id?Re:_e))}catch(Ye){const lt={...De,status:"error",error:(Ye==null?void 0:Ye.message)??"Upload failed"};ke.push(lt),I(se,Re=>Re.map(we=>we.id===De.id?lt:we))}}return ke},[I]),Ie=S.useCallback((se,ve)=>{I(se,ke=>ke.filter(De=>De.id!==ve))},[I]),Xe=S.useCallback((se,ve)=>{const ke=new Set(ve);I(se,De=>De.filter(Ye=>!ke.has(Ye.id)))},[I]),Ve=S.useCallback((se,ve={})=>{j(se),se!==sr&&(ve.preserveSession||R(ve.sessionId??rr(se)))},[]),Se=S.useCallback(()=>{Bn.fetchMemorySessions(50).then(({sessions:se})=>s(se??[])).catch(()=>{})},[]),Wt=S.useCallback(async()=>{try{const[se,ve]=await Promise.all([hb().catch(()=>({agents:[]})),kA().catch(()=>({total:0,direct:0,relayed:0,connections:[]}))]),ke=(se.agents??[]).filter(De=>De.connectionStatus!=="self");d(ke),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 ru();k(se);const ve=Ax(he.current,se),ke=[...se].sort(fu).filter(_e=>_e.persistentChat),De=Ue.current,Ye=Ne.current,lt=se.find(_e=>_e.id===De)??null,Re=mI({selectedIntegrationId:De,selectedItem:lt,selectedSessionId:Ye,localMessagesByConversation:Ee.current,sessionSummaries:ve});if(!Re){const _e=ke[0];Ve((_e==null?void 0:_e.id)??sr,{sessionId:(_e==null?void 0:_e.defaultSessionId)??null})}const we=ke[0];we&&!ue.current&&De!==sr?(ue.current=!0,Ve(we.id,{sessionId:we.defaultSessionId}),r("agents")):!we&&!Re&&(ue.current=!1,Ve(sr))}catch{}},[Ve]),ja=S.useCallback(async(se,ve=null,ke=null)=>{const De=Ro({integrationId:se,sessionId:ve,defaultSessionId:ke});O(Ye=>({...Ye,[De.stateKey]:!1}));try{const lt=(await k0(se,100,{sessionId:De.sessionId??void 0})).map(Re=>ex(Re,se));le(De.stateKey,Re=>kp(Re,lt))}catch{le(De.stateKey,Ye=>Ye)}finally{O(Ye=>({...Ye,[De.stateKey]:!0})),Se()}},[Se,le]);S.useEffect(()=>{Se(),Wt(),rt()},[Se,Wt,rt]),S.useEffect(()=>{for(const se of iL)ja(se,rr(se))},[]);const ti=S.useCallback(()=>{Se(),Wt()},[Se,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(!(Pe!=null&&Pe.chatSupported)||!Pe.persistentChat&&!Dt){ge&&O(ve=>({...ve,[ge]:!1}));return}let se=!1;return(async()=>await ja(Pe.id,(pt==null?void 0:pt.sessionId)??null,Pe.defaultSessionId??null))(),()=>{se=!0}},[ja,pt==null?void 0:pt.sessionId,ge,Dt,Pe==null?void 0:Pe.defaultSessionId,Pe==null?void 0:Pe.chatSupported,Pe==null?void 0:Pe.id,Pe==null?void 0:Pe.persistentChat]);const mr=S.useCallback(async()=>{var yr,Ra;const se=Pe,ve=pt,ke=yn.trim(),De=fe,Ye=De.some(lS);if(!(se!=null&&se.chatSupported)||!se.chatReady||it||!ve||!ke&&!Ye)return;const lt=se.id,Re=ve.stateKey;ye(Re,!0),P(null);let we=null,_e="",an="",Na="",vl="",Yo=[],ni=[],ha=[];try{ni=await at(Re,De);const Yt=ni.map(Be=>Z5(Be)).filter(Be=>Be!=null),sn=J5(ni);if(!ke&&Yt.length===0&&sn.results.length===0)return;an=crypto.randomUUID();const Fn=sS(sn.results),At=[ke,Fn].filter(Be=>Be.length>0).join(`
|
|
1174
|
+
|
|
1175
|
+
`);Na=ke?At:eL(Yt,sn.results);const vn=ke?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=Kc(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),we=new AbortController,N.current.set(Re,we);const Ko=[...tL(et,xt,x)],mu=se.id==="prime-agent"?(yr=se.liveSessions)==null?void 0:yr.find(Be=>Be.sessionId===ve.sessionId):void 0,un=await kj(lt,vn,{correlationId:an,signal:we==null?void 0:we.signal,sessionId:ve.sessionId??void 0,liveSession:mu,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=>tx(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:Kc(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&&Ue.current===lt&&Ne.current===ve.sessionId){const Be=im(lt,xn);B(qt=>({...qt,[Be]:kp(qt[Be]??[],qt[Re]??[])})),O(qt=>({...qt,[Be]:qt[Re]??!0})),Ve(lt,{sessionId:xn}),_(`${se.name} restarted; switched chat to the live session.`)}Se(),e===0&&n()}catch(Yt){const sn=(Yt==null?void 0:Yt.name)==="AbortError",Fn=sn?"Request cancelled.":rL(se,Yt),At=sn?Fn:`Error: ${Fn}`;if(_e){const vn=qL(vl,At);le(Re,ma=>ma.map(cn=>cn.id===_e?{...cn,...vn,streaming:!1}:cn))}!sn&<==="hermes"&&_e&&Na&&(async()=>{try{const vn=await Sj(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=>tx(ma,an,vn.turnId)),Se()}catch{}})(),ha.length>0&&ni.length>0&&X(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)===we&&N.current.delete(Re)}},[xt,n,et,x,Se,yn,it,at,fe,rt,pt,Pe,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=>{F(se),P(null),_(null);try{const ve=await vj(se);k(Ye=>Nc(Ye,ve.integration)),await rt();const ke=Nc(b,ve.integration),De=uI({integrationId:se,selectedSessionId:E,integrations:ke});Ve(se,{preserveSession:De,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(),P(ve.message)}finally{F(null)}},[b,rt,E,Ve]),Pi=S.useCallback(async se=>{P(null),_(null);try{await xj(se),k(ve=>hI(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){P(ve.message)}},[rt,C,Ve]),pu=S.useCallback(async se=>{var Ye,lt,Re;if(M===se)return;T(se),P(null),_(null);const ve=Ro({integrationId:se,sessionId:C===se?Ne.current:null,defaultSessionId:(Ye=b.find(we=>we.id===se))==null?void 0:Ye.defaultSessionId}),[ke,De]=await Promise.allSettled([bj(se),k0(se,100,{sessionId:ve.sessionId??void 0})]);try{if(ke.status==="fulfilled"?(k(we=>Nc(we,ke.value.integration)),ke.value.notice&&_(ke.value.notice)):P(((lt=ke.reason)==null?void 0:lt.message)??"Failed to refresh integration."),De.status==="fulfilled"){const we=De.value.map(_e=>ex(_e,se));le(ve.stateKey,_e=>kp(_e,we)),O(_e=>({..._e,[ve.stateKey]:!0}))}else ke.status==="fulfilled"&&P(((Re=De.reason)==null?void 0:Re.message)??"Failed to refresh conversation.")}finally{T(null)}},[b,M,C,le]),Vo=S.useCallback(async se=>{if(!(se!=="local-llm"||G)){Y(se),P(null),_(null);try{await ij();const ve=Ro({integrationId:se,sessionId:rr(se)});B(ke=>({...ke,[ve.stateKey]:[]})),H(ke=>({...ke,[ve.stateKey]:""})),X(ke=>({...ke,[ve.stateKey]:[]})),O(ke=>({...ke,[ve.stateKey]:!0})),_("DKG Local LLM session cleared. You can now select a different Context Graph."),await rt()}catch(ve){P((ve==null?void 0:ve.message)??"Failed to clear the local LLM session.")}finally{Y(null)}}},[G,rt]),yl=S.useCallback(se=>{Ve(se.integrationId,{sessionId:se.sessionId}),r("agents")},[Ve]),Ui=S.useCallback(se=>{bt(se||null)},[bt]),hu=S.useCallback(se=>{!ge||!xt||Te(ge,se,xt)},[xt,Te,ge]),Wo=S.useCallback(se=>{ge&&Ie(ge,se)},[Ie,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(vI,{integrations:b,selectedIntegrationId:C,selectedIntegration:Pe,selectedSessionId:E,selectedHasConversation:Dt,selectedIntegrationHasAnyConversation:Nt,onSelectIntegration:Ve,onConnectIntegration:gr,onDisconnectIntegration:Pi,onRefreshIntegration:pu,onClearIntegrationSession:Vo,connectBusyId:D,refreshBusyId:M,clearBusyId:G,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:hu,onRemoveAttachment:Wo}),a==="network"&&m.jsx(SI,{peerAgents:u,connections:p,loading:y,onRefresh:Wt}),a==="sessions"&&m.jsx(kI,{sessions:Zt,onOpenSession:yl})]})}function AI(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 jI(){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 Nx={"/observability":{id:"operations",label:"Observability"},"/operations":{id:"operations",label:"Observability"},"/settings":{id:"settings",label:"Settings"}},TI={operations:"/observability",settings:"/settings",dashboard:"/"};function NI(){const{pathname:e}=pa(),n=uh(),a=mn(o=>o.openTab),r=mn(o=>o.activeTabId);S.useEffect(()=>{const o=Nx[e];o&&a({id:o.id,label:o.label,closable:!0})},[e,a]),S.useEffect(()=>{const o=TI[r];if(o){o!==e&&n(o,{replace:!0});return}Nx[e]&&n("/",{replace:!0})},[r,e,n])}function RI(){const[e,n]=S.useState(qj());return S.useEffect(()=>Fj(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 _I(){const e=yh(n=>n.setNodeStatus);Ho(()=>{Bn.fetchStatus().then(e).catch(()=>{})},1e4)}function Rx(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 OI(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 DI(){_I(),jI(),NI();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(()=>{AI(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=Rx(y),k=Rx(g),C=OI(x);return m.jsxs("div",{className:"v10-app",children:[m.jsx(RI,{}),m.jsx(YN,{}),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(BR,{})}),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(M5,{})}),!a&&m.jsx("div",{className:"v10-resize-handle-v",ref:C}),m.jsx(W5,{})]}),!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(EI,{})})]})]})]})}const MI=hn.lazy(()=>nt(()=>import("./Network-B49IxpAj.js"),[]).then(e=>({default:e.NetworkPage})));function LI(){const e=mn(n=>n.openTab);return S.useLayoutEffect(()=>{e(P4)},[e]),m.jsx(So,{to:"/",replace:!0})}function zI(){return m.jsxs(HC,{children:[m.jsx(Ni,{path:"/network",element:m.jsx(hn.Suspense,{fallback:m.jsx("div",{className:"lazy-spinner",children:"Loading..."}),children:m.jsx(MI,{})})}),m.jsx(Ni,{path:"/context-graph-primer",element:m.jsx(LI,{})}),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(DI,{})})]})}q2.createRoot(document.getElementById("root")).render(m.jsx(hn.StrictMode,{children:m.jsx(dE,{basename:"/ui",children:m.jsx(zI,{})})}));export{k8 as $,Pb as A,XI as B,S4 as C,J8 as D,S8 as E,w8 as F,i9 as G,gn as H,w4 as I,B8 as J,n9 as K,Vb as L,X8 as M,T0 as N,wh as O,C8 as P,hb as Q,hn as R,Q8 as S,z8 as T,m8 as U,kA as V,dN as W,bh as X,au as Y,i8 as Z,nt as _,k4 as a,C4 as a$,r8 as a0,AA as a1,n8 as a2,WI as a3,TA as a4,a8 as a5,jA as a6,b0 as a7,f8 as a8,c8 as a9,q8 as aA,hT as aB,gT as aC,a3 as aD,G8 as aE,IA as aF,l4 as aG,kb as aH,KI as aI,QI as aJ,yT as aK,oR as aL,j8 as aM,R8 as aN,m as aO,FA as aP,H8 as aQ,x8 as aR,YI as aS,h8 as aT,RA as aU,GI as aV,bA as aW,l9 as aX,GR as aY,Nb as aZ,F8 as a_,u8 as aa,o8 as ab,l8 as ac,s8 as ad,ZI as ae,SA as af,d8 as ag,e8 as ah,vb as ai,GA as aj,K8 as ak,e3 as al,D8 as am,Q0 as an,N4 as ao,R4 as ap,hN as aq,T8 as ar,a9 as as,qR as at,t9 as au,e9 as av,mN as aw,Qe as ax,UI as ay,Po as az,P4 as b,Fc as b0,Ah as b1,E8 as b2,HI as b3,VI as b4,$I as b5,FI as b6,uT as b7,qI as b8,lA as b9,Y8 as bA,aa as bB,A4 as bC,o4 as bD,aT as bE,qc as bF,pl as bG,Ab as bH,jb as bI,zp as bJ,ca as bK,mn as bL,M8 as bM,_8 as bN,W4 as bO,g8 as bP,b8 as ba,v8 as bb,S as bc,y8 as bd,MA as be,p8 as bf,r9 as bg,X0 as bh,U8 as bi,L8 as bj,A8 as bk,O8 as bl,$4 as bm,i3 as bn,Ph as bo,EN as bp,I8 as bq,P8 as br,JI as bs,t8 as bt,WR as bu,yh as bv,W8 as bw,Ch as bx,Zf as by,Lb as bz,IT as c,UT as d,$T as e,N8 as f,Kx as g,QT as h,Ib as i,EI as j,mt as k,Z8 as l,V8 as m,Bn as n,E4 as o,DA as p,Vt as q,$8 as r,r4 as s,Mi as t,Xt as u,q1 as v,xT as w,PI as x,$t as y,BI as z};
|