palmier 0.8.8 → 0.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +26 -17
  2. package/dist/commands/init.js +6 -11
  3. package/dist/commands/pair.js +3 -0
  4. package/dist/pwa/assets/index-1gs4vwFo.js +120 -0
  5. package/dist/pwa/assets/{index-UaZFu6XL.css → index-DQJHVyP6.css} +1 -1
  6. package/dist/pwa/assets/{web-DYwZE4qa.js → web-BqVsIFtP.js} +1 -1
  7. package/dist/pwa/assets/web-DrSNtZ3i.js +1 -0
  8. package/dist/pwa/assets/{web-nSzKzI8x.js → web-lefgO9YR.js} +1 -1
  9. package/dist/pwa/index.html +2 -2
  10. package/dist/pwa/service-worker.js +1 -1
  11. package/dist/transports/http-transport.js +42 -27
  12. package/dist/types.d.ts +0 -2
  13. package/package.json +1 -1
  14. package/palmier-server/CLAUDE.md +4 -0
  15. package/palmier-server/PRODUCTION.md +1 -1
  16. package/palmier-server/README.md +1 -1
  17. package/palmier-server/pnpm-lock.yaml +12 -0
  18. package/palmier-server/pwa/package.json +1 -0
  19. package/palmier-server/pwa/src/App.css +61 -0
  20. package/palmier-server/pwa/src/components/CapabilityToggles.tsx +1 -1
  21. package/palmier-server/pwa/src/components/ConnectionStatusIcon.tsx +69 -0
  22. package/palmier-server/pwa/src/components/HostMenu.tsx +5 -4
  23. package/palmier-server/pwa/src/constants.ts +1 -1
  24. package/palmier-server/pwa/src/contexts/HostConnectionContext.tsx +156 -66
  25. package/palmier-server/pwa/src/pages/Dashboard.tsx +2 -0
  26. package/palmier-server/pwa/src/pages/PairHost.tsx +9 -9
  27. package/palmier-server/pwa/src/types.ts +3 -1
  28. package/palmier-server/spec.md +21 -19
  29. package/src/commands/init.ts +7 -12
  30. package/src/commands/pair.ts +3 -0
  31. package/src/transports/http-transport.ts +34 -29
  32. package/src/types.ts +0 -2
  33. package/dist/pwa/assets/index-BiAE5qeC.js +0 -120
@@ -0,0 +1,120 @@
1
+ var Vw=Object.defineProperty;var Jw=(e,n,r)=>n in e?Vw(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var C=(e,n,r)=>Jw(e,typeof n!="symbol"?n+"":n,r);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function r(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(l){if(l.ep)return;l.ep=!0;const u=r(l);fetch(l.href,u)}})();function zb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oh={exports:{}},pl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var $y;function Xw(){if($y)return pl;$y=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(s,l,u){var c=null;if(u!==void 0&&(c=""+u),l.key!==void 0&&(c=""+l.key),"key"in l){u={};for(var f in l)f!=="key"&&(u[f]=l[f])}else u=l;return l=u.ref,{$$typeof:e,type:s,key:c,ref:l!==void 0?l:null,props:u}}return pl.Fragment=n,pl.jsx=r,pl.jsxs=r,pl}var Yy;function Kw(){return Yy||(Yy=1,oh.exports=Xw()),oh.exports}var b=Kw(),uh={exports:{}},Ie={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Gy;function Qw(){if(Gy)return Ie;Gy=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function w(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,B={};function L(M,W,A){this.props=M,this.context=W,this.refs=B,this.updater=A||k}L.prototype.isReactComponent={},L.prototype.setState=function(M,W){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,W,"setState")},L.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function $(){}$.prototype=L.prototype;function T(M,W,A){this.props=M,this.context=W,this.refs=B,this.updater=A||k}var te=T.prototype=new $;te.constructor=T,D(te,L.prototype),te.isPureReactComponent=!0;var P=Array.isArray;function z(){}var X={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function H(M,W,A){var we=A.ref;return{$$typeof:e,type:M,key:W,ref:we!==void 0?we:null,props:A}}function O(M,W){return H(M.type,W,M.props)}function K(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function J(M){var W={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(A){return W[A]})}var se=/\/+/g;function ie(M,W){return typeof M=="object"&&M!==null&&M.key!=null?J(""+M.key):W.toString(36)}function F(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(z,z):(M.status="pending",M.then(function(W){M.status==="pending"&&(M.status="fulfilled",M.value=W)},function(W){M.status==="pending"&&(M.status="rejected",M.reason=W)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function q(M,W,A,we,Ae){var Te=typeof M;(Te==="undefined"||Te==="boolean")&&(M=null);var Me=!1;if(M===null)Me=!0;else switch(Te){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(M.$$typeof){case e:case n:Me=!0;break;case y:return Me=M._init,q(Me(M._payload),W,A,we,Ae)}}if(Me)return Ae=Ae(M),Me=we===""?"."+ie(M,0):we,P(Ae)?(A="",Me!=null&&(A=Me.replace(se,"$&/")+"/"),q(Ae,W,A,"",function(De){return De})):Ae!=null&&(K(Ae)&&(Ae=O(Ae,A+(Ae.key==null||M&&M.key===Ae.key?"":(""+Ae.key).replace(se,"$&/")+"/")+Me)),W.push(Ae)),1;Me=0;var He=we===""?".":we+":";if(P(M))for(var be=0;be<M.length;be++)we=M[be],Te=He+ie(we,be),Me+=q(we,W,A,Te,Ae);else if(be=w(M),typeof be=="function")for(M=be.call(M),be=0;!(we=M.next()).done;)we=we.value,Te=He+ie(we,be++),Me+=q(we,W,A,Te,Ae);else if(Te==="object"){if(typeof M.then=="function")return q(F(M),W,A,we,Ae);throw W=String(M),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return Me}function V(M,W,A){if(M==null)return M;var we=[],Ae=0;return q(M,we,"","",function(Te){return W.call(A,Te,Ae++)}),we}function ue(M){if(M._status===-1){var W=M._result;W=W(),W.then(function(A){(M._status===0||M._status===-1)&&(M._status=1,M._result=A)},function(A){(M._status===0||M._status===-1)&&(M._status=2,M._result=A)}),M._status===-1&&(M._status=0,M._result=W)}if(M._status===1)return M._result.default;throw M._result}var xe=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},S={map:V,forEach:function(M,W,A){V(M,function(){W.apply(this,arguments)},A)},count:function(M){var W=0;return V(M,function(){W++}),W},toArray:function(M){return V(M,function(W){return W})||[]},only:function(M){if(!K(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Ie.Activity=g,Ie.Children=S,Ie.Component=L,Ie.Fragment=r,Ie.Profiler=l,Ie.PureComponent=T,Ie.StrictMode=s,Ie.Suspense=m,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(M){return X.H.useMemoCache(M)}},Ie.cache=function(M){return function(){return M.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(M,W,A){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var we=D({},M.props),Ae=M.key;if(W!=null)for(Te in W.key!==void 0&&(Ae=""+W.key),W)!Z.call(W,Te)||Te==="key"||Te==="__self"||Te==="__source"||Te==="ref"&&W.ref===void 0||(we[Te]=W[Te]);var Te=arguments.length-2;if(Te===1)we.children=A;else if(1<Te){for(var Me=Array(Te),He=0;He<Te;He++)Me[He]=arguments[He+2];we.children=Me}return H(M.type,Ae,we)},Ie.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:u,_context:M},M},Ie.createElement=function(M,W,A){var we,Ae={},Te=null;if(W!=null)for(we in W.key!==void 0&&(Te=""+W.key),W)Z.call(W,we)&&we!=="key"&&we!=="__self"&&we!=="__source"&&(Ae[we]=W[we]);var Me=arguments.length-2;if(Me===1)Ae.children=A;else if(1<Me){for(var He=Array(Me),be=0;be<Me;be++)He[be]=arguments[be+2];Ae.children=He}if(M&&M.defaultProps)for(we in Me=M.defaultProps,Me)Ae[we]===void 0&&(Ae[we]=Me[we]);return H(M,Te,Ae)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(M){return{$$typeof:f,render:M}},Ie.isValidElement=K,Ie.lazy=function(M){return{$$typeof:y,_payload:{_status:-1,_result:M},_init:ue}},Ie.memo=function(M,W){return{$$typeof:d,type:M,compare:W===void 0?null:W}},Ie.startTransition=function(M){var W=X.T,A={};X.T=A;try{var we=M(),Ae=X.S;Ae!==null&&Ae(A,we),typeof we=="object"&&we!==null&&typeof we.then=="function"&&we.then(z,xe)}catch(Te){xe(Te)}finally{W!==null&&A.types!==null&&(W.types=A.types),X.T=W}},Ie.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},Ie.use=function(M){return X.H.use(M)},Ie.useActionState=function(M,W,A){return X.H.useActionState(M,W,A)},Ie.useCallback=function(M,W){return X.H.useCallback(M,W)},Ie.useContext=function(M){return X.H.useContext(M)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(M,W){return X.H.useDeferredValue(M,W)},Ie.useEffect=function(M,W){return X.H.useEffect(M,W)},Ie.useEffectEvent=function(M){return X.H.useEffectEvent(M)},Ie.useId=function(){return X.H.useId()},Ie.useImperativeHandle=function(M,W,A){return X.H.useImperativeHandle(M,W,A)},Ie.useInsertionEffect=function(M,W){return X.H.useInsertionEffect(M,W)},Ie.useLayoutEffect=function(M,W){return X.H.useLayoutEffect(M,W)},Ie.useMemo=function(M,W){return X.H.useMemo(M,W)},Ie.useOptimistic=function(M,W){return X.H.useOptimistic(M,W)},Ie.useReducer=function(M,W,A){return X.H.useReducer(M,W,A)},Ie.useRef=function(M){return X.H.useRef(M)},Ie.useState=function(M){return X.H.useState(M)},Ie.useSyncExternalStore=function(M,W,A){return X.H.useSyncExternalStore(M,W,A)},Ie.useTransition=function(){return X.H.useTransition()},Ie.version="19.2.4",Ie}var Vy;function Ed(){return Vy||(Vy=1,uh.exports=Qw()),uh.exports}var N=Ed(),ch={exports:{}},gl={},fh={exports:{}},hh={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Jy;function Zw(){return Jy||(Jy=1,(function(e){function n(q,V){var ue=q.length;q.push(V);e:for(;0<ue;){var xe=ue-1>>>1,S=q[xe];if(0<l(S,V))q[xe]=V,q[ue]=S,ue=xe;else break e}}function r(q){return q.length===0?null:q[0]}function s(q){if(q.length===0)return null;var V=q[0],ue=q.pop();if(ue!==V){q[0]=ue;e:for(var xe=0,S=q.length,M=S>>>1;xe<M;){var W=2*(xe+1)-1,A=q[W],we=W+1,Ae=q[we];if(0>l(A,ue))we<S&&0>l(Ae,A)?(q[xe]=Ae,q[we]=ue,xe=we):(q[xe]=A,q[W]=ue,xe=W);else if(we<S&&0>l(Ae,ue))q[xe]=Ae,q[we]=ue,xe=we;else break e}}return V}function l(q,V){var ue=q.sortIndex-V.sortIndex;return ue!==0?ue:q.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var m=[],d=[],y=1,g=null,x=3,w=!1,k=!1,D=!1,B=!1,L=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function te(q){for(var V=r(d);V!==null;){if(V.callback===null)s(d);else if(V.startTime<=q)s(d),V.sortIndex=V.expirationTime,n(m,V);else break;V=r(d)}}function P(q){if(D=!1,te(q),!k)if(r(m)!==null)k=!0,z||(z=!0,J());else{var V=r(d);V!==null&&F(P,V.startTime-q)}}var z=!1,X=-1,Z=5,H=-1;function O(){return B?!0:!(e.unstable_now()-H<Z)}function K(){if(B=!1,z){var q=e.unstable_now();H=q;var V=!0;try{e:{k=!1,D&&(D=!1,$(X),X=-1),w=!0;var ue=x;try{t:{for(te(q),g=r(m);g!==null&&!(g.expirationTime>q&&O());){var xe=g.callback;if(typeof xe=="function"){g.callback=null,x=g.priorityLevel;var S=xe(g.expirationTime<=q);if(q=e.unstable_now(),typeof S=="function"){g.callback=S,te(q),V=!0;break t}g===r(m)&&s(m),te(q)}else s(m);g=r(m)}if(g!==null)V=!0;else{var M=r(d);M!==null&&F(P,M.startTime-q),V=!1}}break e}finally{g=null,x=ue,w=!1}V=void 0}}finally{V?J():z=!1}}}var J;if(typeof T=="function")J=function(){T(K)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ie=se.port2;se.port1.onmessage=K,J=function(){ie.postMessage(null)}}else J=function(){L(K,0)};function F(q,V){X=L(function(){q(e.unstable_now())},V)}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(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(q){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var ue=x;x=V;try{return q()}finally{x=ue}},e.unstable_requestPaint=function(){B=!0},e.unstable_runWithPriority=function(q,V){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var ue=x;x=q;try{return V()}finally{x=ue}},e.unstable_scheduleCallback=function(q,V,ue){var xe=e.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?xe+ue:xe):ue=xe,q){case 1:var S=-1;break;case 2:S=250;break;case 5:S=1073741823;break;case 4:S=1e4;break;default:S=5e3}return S=ue+S,q={id:y++,callback:V,priorityLevel:q,startTime:ue,expirationTime:S,sortIndex:-1},ue>xe?(q.sortIndex=ue,n(d,q),r(m)===null&&q===r(d)&&(D?($(X),X=-1):D=!0,F(P,ue-xe))):(q.sortIndex=S,n(m,q),k||w||(k=!0,z||(z=!0,J()))),q},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(q){var V=x;return function(){var ue=x;x=V;try{return q.apply(this,arguments)}finally{x=ue}}}})(hh)),hh}var Xy;function Ww(){return Xy||(Xy=1,fh.exports=Zw()),fh.exports}var dh={exports:{}},un={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Ky;function eS(){if(Ky)return un;Ky=1;var e=Ed();function n(m){var d="https://react.dev/errors/"+m;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)d+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(m,d,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:m,containerInfo:d,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,d){if(m==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return un.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,un.createPortal=function(m,d){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return u(m,d,null,y)},un.flushSync=function(m){var d=c.T,y=s.p;try{if(c.T=null,s.p=2,m)return m()}finally{c.T=d,s.p=y,s.d.f()}},un.preconnect=function(m,d){typeof m=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,s.d.C(m,d))},un.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},un.preinit=function(m,d){if(typeof m=="string"&&d&&typeof d.as=="string"){var y=d.as,g=f(y,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,w=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;y==="style"?s.d.S(m,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:w}):y==="script"&&s.d.X(m,{crossOrigin:g,integrity:x,fetchPriority:w,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},un.preinitModule=function(m,d){if(typeof m=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var y=f(d.as,d.crossOrigin);s.d.M(m,{crossOrigin:y,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&s.d.M(m)},un.preload=function(m,d){if(typeof m=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var y=d.as,g=f(y,d.crossOrigin);s.d.L(m,y,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},un.preloadModule=function(m,d){if(typeof m=="string")if(d){var y=f(d.as,d.crossOrigin);s.d.m(m,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:y,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else s.d.m(m)},un.requestFormReset=function(m){s.d.r(m)},un.unstable_batchedUpdates=function(m,d){return m(d)},un.useFormState=function(m,d,y){return c.H.useFormState(m,d,y)},un.useFormStatus=function(){return c.H.useHostTransitionStatus()},un.version="19.2.4",un}var Qy;function Ub(){if(Qy)return dh.exports;Qy=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(),dh.exports=eS(),dh.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Zy;function tS(){if(Zy)return gl;Zy=1;var e=Ww(),n=Ed(),r=Ub();function s(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a])}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 l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var i=t,a=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(a=i.return),t=i.return;while(t)}return i.tag===3?a:null}function c(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 f(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 m(t){if(u(t)!==t)throw Error(s(188))}function d(t){var i=t.alternate;if(!i){if(i=u(t),i===null)throw Error(s(188));return i!==t?null:t}for(var a=t,o=i;;){var h=a.return;if(h===null)break;var p=h.alternate;if(p===null){if(o=h.return,o!==null){a=o;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===a)return m(h),t;if(p===o)return m(h),i;p=p.sibling}throw Error(s(188))}if(a.return!==o.return)a=h,o=p;else{for(var v=!1,_=h.child;_;){if(_===a){v=!0,a=h,o=p;break}if(_===o){v=!0,o=h,a=p;break}_=_.sibling}if(!v){for(_=p.child;_;){if(_===a){v=!0,a=p,o=h;break}if(_===o){v=!0,o=p,a=h;break}_=_.sibling}if(!v)throw Error(s(189))}}if(a.alternate!==o)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?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"),w=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),T=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function J(t){return t===null||typeof t!="object"?null:(t=K&&t[K]||t["@@iterator"],typeof t=="function"?t:null)}var se=Symbol.for("react.client.reference");function ie(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===se?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case D:return"Fragment";case L:return"Profiler";case B:return"StrictMode";case P:return"Suspense";case z:return"SuspenseList";case H:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case T:return t.displayName||"Context";case $:return(t._context.displayName||"Context")+".Consumer";case te:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case X:return i=t.displayName||null,i!==null?i:ie(t.type)||"Memo";case Z:i=t._payload,t=t._init;try{return ie(t(i))}catch{}}return null}var F=Array.isArray,q=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},xe=[],S=-1;function M(t){return{current:t}}function W(t){0>S||(t.current=xe[S],xe[S]=null,S--)}function A(t,i){S++,xe[S]=t.current,t.current=i}var we=M(null),Ae=M(null),Te=M(null),Me=M(null);function He(t,i){switch(A(Te,i),A(Ae,t),A(we,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?dy(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=dy(i),t=my(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}W(we),A(we,t)}function be(){W(we),W(Ae),W(Te)}function De(t){t.memoizedState!==null&&A(Me,t);var i=we.current,a=my(i,t.type);i!==a&&(A(Ae,t),A(we,a))}function Ze(t){Ae.current===t&&(W(we),W(Ae)),Me.current===t&&(W(Me),fl._currentValue=ue)}var dt,lt;function ct(t){if(dt===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);dt=i&&i[1]||"",lt=-1<a.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+dt+t+lt}var Fe=!1;function Ue(t,i){if(!t||Fe)return"";Fe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(i){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(oe){var ae=oe}Reflect.construct(t,[],pe)}else{try{pe.call()}catch(oe){ae=oe}t.call(pe.prototype)}}else{try{throw Error()}catch(oe){ae=oe}(pe=t())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(oe){if(oe&&ae&&typeof oe.stack=="string")return[oe.stack,ae.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=o.DetermineComponentFrameRoot(),v=p[0],_=p[1];if(v&&_){var I=v.split(`
44
+ `),re=_.split(`
45
+ `);for(h=o=0;o<I.length&&!I[o].includes("DetermineComponentFrameRoot");)o++;for(;h<re.length&&!re[h].includes("DetermineComponentFrameRoot");)h++;if(o===I.length||h===re.length)for(o=I.length-1,h=re.length-1;1<=o&&0<=h&&I[o]!==re[h];)h--;for(;1<=o&&0<=h;o--,h--)if(I[o]!==re[h]){if(o!==1||h!==1)do if(o--,h--,0>h||I[o]!==re[h]){var ce=`
46
+ `+I[o].replace(" at new "," at ");return t.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",t.displayName)),ce}while(1<=o&&0<=h);break}}}finally{Fe=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?ct(a):""}function tt(t,i){switch(t.tag){case 26:case 27:case 5:return ct(t.type);case 16:return ct("Lazy");case 13:return t.child!==i&&i!==null?ct("Suspense Fallback"):ct("Suspense");case 19:return ct("SuspenseList");case 0:case 15:return Ue(t.type,!1);case 11:return Ue(t.type.render,!1);case 1:return Ue(t.type,!0);case 31:return ct("Activity");default:return""}}function mt(t){try{var i="",a=null;do i+=tt(t,a),a=t,t=t.return;while(t);return i}catch(o){return`
47
+ Error generating stack: `+o.message+`
48
+ `+o.stack}}var st=Object.prototype.hasOwnProperty,Mt=e.unstable_scheduleCallback,yt=e.unstable_cancelCallback,Yn=e.unstable_shouldYield,gr=e.unstable_requestPaint,vt=e.unstable_now,An=e.unstable_getCurrentPriorityLevel,fe=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,Be=e.unstable_NormalPriority,$e=e.unstable_LowPriority,rt=e.unstable_IdlePriority,nn=e.log,bn=e.unstable_setDisableYieldValue,Yt=null,ge=null;function ze(t){if(typeof nn=="function"&&bn(t),ge&&typeof ge.setStrictMode=="function")try{ge.setStrictMode(Yt,t)}catch{}}var _e=Math.clz32?Math.clz32:Tn,ft=Math.log,pt=Math.LN2;function Tn(t){return t>>>=0,t===0?32:31-(ft(t)/pt|0)|0}var ri=256,Nr=262144,ii=4194304;function ar(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 Ii(t,i,a){var o=t.pendingLanes;if(o===0)return 0;var h=0,p=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var _=o&134217727;return _!==0?(o=_&~p,o!==0?h=ar(o):(v&=_,v!==0?h=ar(v):a||(a=_&~t,a!==0&&(h=ar(a))))):(_=o&~p,_!==0?h=ar(_):v!==0?h=ar(v):a||(a=o&~t,a!==0&&(h=ar(a)))),h===0?0:i!==0&&i!==h&&(i&p)===0&&(p=h&-h,a=i&-i,p>=a||p===32&&(a&4194048)!==0)?i:h}function Fi(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function ka(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 gs(){var t=ii;return ii<<=1,(ii&62914560)===0&&(ii=4194304),t}function si(t){for(var i=[],a=0;31>a;a++)i.push(t);return i}function lr(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ai(t,i,a,o,h,p){var v=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var _=t.entanglements,I=t.expirationTimes,re=t.hiddenUpdates;for(a=v&~a;0<a;){var ce=31-_e(a),pe=1<<ce;_[ce]=0,I[ce]=-1;var ae=re[ce];if(ae!==null)for(re[ce]=null,ce=0;ce<ae.length;ce++){var oe=ae[ce];oe!==null&&(oe.lane&=-536870913)}a&=~pe}o!==0&&li(t,o,0),p!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=p&~(v&~i))}function li(t,i,a){t.pendingLanes|=i,t.suspendedLanes&=~i;var o=31-_e(i);t.entangledLanes|=i,t.entanglements[o]=t.entanglements[o]|1073741824|a&261930}function $i(t,i){var a=t.entangledLanes|=i;for(t=t.entanglements;a;){var o=31-_e(a),h=1<<o;h&i|t[o]&i&&(t[o]|=i),a&=~h}}function oi(t,i){var a=i&-i;return a=(a&42)!==0?1:Or(a),(a&(t.suspendedLanes|i))!==0?0:a}function Or(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 Yi(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ca(){var t=V.p;return t!==0?t:(t=window.event,t===void 0?32:Uy(t.type))}function Xl(t,i){var a=V.p;try{return V.p=t,i()}finally{V.p=a}}var yr=Math.random().toString(36).slice(2),Ct="__reactFiber$"+yr,Pt="__reactProps$"+yr,jn="__reactContainer$"+yr,Gi="__reactEvents$"+yr,Aa="__reactListeners$"+yr,Kl="__reactHandles$"+yr,Ql="__reactResources$"+yr,Qt="__reactMarker$"+yr;function ys(t){delete t[Ct],delete t[Pt],delete t[Gi],delete t[Aa],delete t[Kl]}function E(t){var i=t[Ct];if(i)return i;for(var a=t.parentNode;a;){if(i=a[jn]||a[Ct]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(t=wy(t);t!==null;){if(a=t[Ct])return a;t=wy(t)}return i}t=a,a=t.parentNode}return null}function R(t){if(t=t[Ct]||t[jn]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function j(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(s(33))}function U(t){var i=t[Ql];return i||(i=t[Ql]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Y(t){t[Qt]=!0}var ee=new Set,me={};function ye(t,i){le(t,i),le(t+"Capture",i)}function le(t,i){for(me[t]=i,t=0;t<i.length;t++)ee.add(i[t])}var de=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]*$"),Ne={},Je={};function Nt(t){return st.call(Je,t)?!0:st.call(Ne,t)?!1:de.test(t)?Je[t]=!0:(Ne[t]=!0,!1)}function on(t,i,a){if(Nt(i))if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var o=i.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+a)}}function or(t,i,a){if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+a)}}function Rr(t,i,a,o){if(o===null)t.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(i,a,""+o)}}function Gn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function sm(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function q1(t,i,a){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,p=o.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return h.call(this)},set:function(v){a=""+v,p.call(this,v)}}),Object.defineProperty(t,i,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(v){a=""+v},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function ec(t){if(!t._valueTracker){var i=sm(t)?"checked":"value";t._valueTracker=q1(t,i,""+t[i])}}function am(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var a=i.getValue(),o="";return t&&(o=sm(t)?t.checked?"true":"false":t.value),t=o,t!==a?(i.setValue(t),!0):!1}function Zl(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 H1=/[\n"\\]/g;function Vn(t){return t.replace(H1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function tc(t,i,a,o,h,p,v,_){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),i!=null?v==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Gn(i)):t.value!==""+Gn(i)&&(t.value=""+Gn(i)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),i!=null?nc(t,v,Gn(i)):a!=null?nc(t,v,Gn(a)):o!=null&&t.removeAttribute("value"),h==null&&p!=null&&(t.defaultChecked=!!p),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?t.name=""+Gn(_):t.removeAttribute("name")}function lm(t,i,a,o,h,p,v,_){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.type=p),i!=null||a!=null){if(!(p!=="submit"&&p!=="reset"||i!=null)){ec(t);return}a=a!=null?""+Gn(a):"",i=i!=null?""+Gn(i):a,_||i===t.value||(t.value=i),t.defaultValue=i}o=o??h,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=_?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),ec(t)}function nc(t,i,a){i==="number"&&Zl(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function bs(t,i,a,o){if(t=t.options,i){i={};for(var h=0;h<a.length;h++)i["$"+a[h]]=!0;for(a=0;a<t.length;a++)h=i.hasOwnProperty("$"+t[a].value),t[a].selected!==h&&(t[a].selected=h),h&&o&&(t[a].defaultSelected=!0)}else{for(a=""+Gn(a),i=null,h=0;h<t.length;h++){if(t[h].value===a){t[h].selected=!0,o&&(t[h].defaultSelected=!0);return}i!==null||t[h].disabled||(i=t[h])}i!==null&&(i.selected=!0)}}function om(t,i,a){if(i!=null&&(i=""+Gn(i),i!==t.value&&(t.value=i),a==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=a!=null?""+Gn(a):""}function um(t,i,a,o){if(i==null){if(o!=null){if(a!=null)throw Error(s(92));if(F(o)){if(1<o.length)throw Error(s(93));o=o[0]}a=o}a==null&&(a=""),i=a}a=Gn(i),t.defaultValue=a,o=t.textContent,o===a&&o!==""&&o!==null&&(t.value=o),ec(t)}function xs(t,i){if(i){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=i;return}}t.textContent=i}var I1=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,a){var o=i.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":o?t.setProperty(i,a):typeof a!="number"||a===0||I1.has(i)?i==="float"?t.cssFloat=a:t[i]=(""+a).trim():t[i]=a+"px"}function fm(t,i,a){if(i!=null&&typeof i!="object")throw Error(s(62));if(t=t.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||i!=null&&i.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var h in i)o=i[h],i.hasOwnProperty(h)&&a[h]!==o&&cm(t,h,o)}else for(var p in i)i.hasOwnProperty(p)&&cm(t,p,i[p])}function rc(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 F1=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"]]),$1=/^[\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 Wl(t){return $1.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Mr(){}var ic=null;function sc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var vs=null,ws=null;function hm(t){var i=R(t);if(i&&(t=i.stateNode)){var a=t[Pt]||null;e:switch(t=i.stateNode,i.type){case"input":if(tc(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),i=a.name,a.type==="radio"&&i!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Vn(""+i)+'"][type="radio"]'),i=0;i<a.length;i++){var o=a[i];if(o!==t&&o.form===t.form){var h=o[Pt]||null;if(!h)throw Error(s(90));tc(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<a.length;i++)o=a[i],o.form===t.form&&am(o)}break e;case"textarea":om(t,a.value,a.defaultValue);break e;case"select":i=a.value,i!=null&&bs(t,!!a.multiple,i,!1)}}}var ac=!1;function dm(t,i,a){if(ac)return t(i,a);ac=!0;try{var o=t(i);return o}finally{if(ac=!1,(vs!==null||ws!==null)&&(Ho(),vs&&(i=vs,t=ws,ws=vs=null,hm(i),t)))for(i=0;i<t.length;i++)hm(t[i])}}function Ta(t,i){var a=t.stateNode;if(a===null)return null;var o=a[Pt]||null;if(o===null)return null;a=o[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":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,i,typeof a));return a}var Dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lc=!1;if(Dr)try{var ja={};Object.defineProperty(ja,"passive",{get:function(){lc=!0}}),window.addEventListener("test",ja,ja),window.removeEventListener("test",ja,ja)}catch{lc=!1}var ui=null,oc=null,eo=null;function mm(){if(eo)return eo;var t,i=oc,a=i.length,o,h="value"in ui?ui.value:ui.textContent,p=h.length;for(t=0;t<a&&i[t]===h[t];t++);var v=a-t;for(o=1;o<=v&&i[a-o]===h[p-o];o++);return eo=h.slice(t,1<o?1-o:void 0)}function to(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 no(){return!0}function pm(){return!1}function xn(t){function i(a,o,h,p,v){this._reactName=a,this._targetInst=h,this.type=o,this.nativeEvent=p,this.target=v,this.currentTarget=null;for(var _ in t)t.hasOwnProperty(_)&&(a=t[_],this[_]=a?a(p):p[_]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?no:pm,this.isPropagationStopped=pm,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=no)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=no)},persist:function(){},isPersistent:no}),i}var Vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ro=xn(Vi),Na=g({},Vi,{view:0,detail:0}),Y1=xn(Na),uc,cc,Oa,io=g({},Na,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hc,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!==Oa&&(Oa&&t.type==="mousemove"?(uc=t.screenX-Oa.screenX,cc=t.screenY-Oa.screenY):cc=uc=0,Oa=t),uc)},movementY:function(t){return"movementY"in t?t.movementY:cc}}),gm=xn(io),G1=g({},io,{dataTransfer:0}),V1=xn(G1),J1=g({},Na,{relatedTarget:0}),fc=xn(J1),X1=g({},Vi,{animationName:0,elapsedTime:0,pseudoElement:0}),K1=xn(X1),Q1=g({},Vi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Z1=xn(Q1),W1=g({},Vi,{data:0}),ym=xn(W1),ev={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tv={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"},nv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rv(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=nv[t])?!!i[t]:!1}function hc(){return rv}var iv=g({},Na,{key:function(t){if(t.key){var i=ev[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=to(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?tv[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hc,charCode:function(t){return t.type==="keypress"?to(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?to(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),sv=xn(iv),av=g({},io,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bm=xn(av),lv=g({},Na,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hc}),ov=xn(lv),uv=g({},Vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),cv=xn(uv),fv=g({},io,{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}),hv=xn(fv),dv=g({},Vi,{newState:0,oldState:0}),mv=xn(dv),pv=[9,13,27,32],dc=Dr&&"CompositionEvent"in window,Ra=null;Dr&&"documentMode"in document&&(Ra=document.documentMode);var gv=Dr&&"TextEvent"in window&&!Ra,xm=Dr&&(!dc||Ra&&8<Ra&&11>=Ra),vm=" ",wm=!1;function Sm(t,i){switch(t){case"keyup":return pv.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _m(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ss=!1;function yv(t,i){switch(t){case"compositionend":return _m(i);case"keypress":return i.which!==32?null:(wm=!0,vm);case"textInput":return t=i.data,t===vm&&wm?null:t;default:return null}}function bv(t,i){if(Ss)return t==="compositionend"||!dc&&Sm(t,i)?(t=mm(),eo=oc=ui=null,Ss=!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 xm&&i.locale!=="ko"?null:i.data;default:return null}}var xv={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 Em(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!xv[t.type]:i==="textarea"}function km(t,i,a,o){vs?ws?ws.push(o):ws=[o]:vs=o,i=Jo(i,"onChange"),0<i.length&&(a=new ro("onChange","change",null,a,o),t.push({event:a,listeners:i}))}var Ma=null,Da=null;function vv(t){ly(t,0)}function so(t){var i=j(t);if(am(i))return t}function Cm(t,i){if(t==="change")return i}var Am=!1;if(Dr){var mc;if(Dr){var pc="oninput"in document;if(!pc){var Tm=document.createElement("div");Tm.setAttribute("oninput","return;"),pc=typeof Tm.oninput=="function"}mc=pc}else mc=!1;Am=mc&&(!document.documentMode||9<document.documentMode)}function jm(){Ma&&(Ma.detachEvent("onpropertychange",Nm),Da=Ma=null)}function Nm(t){if(t.propertyName==="value"&&so(Da)){var i=[];km(i,Da,t,sc(t)),dm(vv,i)}}function wv(t,i,a){t==="focusin"?(jm(),Ma=i,Da=a,Ma.attachEvent("onpropertychange",Nm)):t==="focusout"&&jm()}function Sv(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return so(Da)}function _v(t,i){if(t==="click")return so(i)}function Ev(t,i){if(t==="input"||t==="change")return so(i)}function kv(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Nn=typeof Object.is=="function"?Object.is:kv;function La(t,i){if(Nn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var a=Object.keys(t),o=Object.keys(i);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var h=a[o];if(!st.call(i,h)||!Nn(t[h],i[h]))return!1}return!0}function Om(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Rm(t,i){var a=Om(t);t=0;for(var o;a;){if(a.nodeType===3){if(o=t+a.textContent.length,t<=i&&o>=i)return{node:a,offset:i-t};t=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Om(a)}}function Mm(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Mm(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=Zl(t.document);i instanceof t.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)t=i.contentWindow;else break;i=Zl(t.document)}return i}function gc(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 Cv=Dr&&"documentMode"in document&&11>=document.documentMode,_s=null,yc=null,za=null,bc=!1;function Lm(t,i,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;bc||_s==null||_s!==Zl(o)||(o=_s,"selectionStart"in o&&gc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),za&&La(za,o)||(za=o,o=Jo(yc,"onSelect"),0<o.length&&(i=new ro("onSelect","select",null,i,a),t.push({event:i,listeners:o}),i.target=_s)))}function Ji(t,i){var a={};return a[t.toLowerCase()]=i.toLowerCase(),a["Webkit"+t]="webkit"+i,a["Moz"+t]="moz"+i,a}var Es={animationend:Ji("Animation","AnimationEnd"),animationiteration:Ji("Animation","AnimationIteration"),animationstart:Ji("Animation","AnimationStart"),transitionrun:Ji("Transition","TransitionRun"),transitionstart:Ji("Transition","TransitionStart"),transitioncancel:Ji("Transition","TransitionCancel"),transitionend:Ji("Transition","TransitionEnd")},xc={},zm={};Dr&&(zm=document.createElement("div").style,"AnimationEvent"in window||(delete Es.animationend.animation,delete Es.animationiteration.animation,delete Es.animationstart.animation),"TransitionEvent"in window||delete Es.transitionend.transition);function Xi(t){if(xc[t])return xc[t];if(!Es[t])return t;var i=Es[t],a;for(a in i)if(i.hasOwnProperty(a)&&a in zm)return xc[t]=i[a];return t}var Um=Xi("animationend"),Bm=Xi("animationiteration"),Pm=Xi("animationstart"),Av=Xi("transitionrun"),Tv=Xi("transitionstart"),jv=Xi("transitioncancel"),qm=Xi("transitionend"),Hm=new Map,vc="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(" ");vc.push("scrollEnd");function ur(t,i){Hm.set(t,i),ye(i,[t])}var ao=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)},Jn=[],ks=0,wc=0;function lo(){for(var t=ks,i=wc=ks=0;i<t;){var a=Jn[i];Jn[i++]=null;var o=Jn[i];Jn[i++]=null;var h=Jn[i];Jn[i++]=null;var p=Jn[i];if(Jn[i++]=null,o!==null&&h!==null){var v=o.pending;v===null?h.next=h:(h.next=v.next,v.next=h),o.pending=h}p!==0&&Im(a,h,p)}}function oo(t,i,a,o){Jn[ks++]=t,Jn[ks++]=i,Jn[ks++]=a,Jn[ks++]=o,wc|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Sc(t,i,a,o){return oo(t,i,a,o),uo(t)}function Ki(t,i){return oo(t,null,null,i),uo(t)}function Im(t,i,a){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a);for(var h=!1,p=t.return;p!==null;)p.childLanes|=a,o=p.alternate,o!==null&&(o.childLanes|=a),p.tag===22&&(t=p.stateNode,t===null||t._visibility&1||(h=!0)),t=p,p=p.return;return t.tag===3?(p=t.stateNode,h&&i!==null&&(h=31-_e(a),t=p.hiddenUpdates,o=t[h],o===null?t[h]=[i]:o.push(i),i.lane=a|536870912),p):null}function uo(t){if(50<il)throw il=0,Rf=null,Error(s(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var Cs={};function Nv(t,i,a,o){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(t,i,a,o){return new Nv(t,i,a,o)}function _c(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Lr(t,i){var a=t.alternate;return a===null?(a=On(t.tag,i,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=i,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,i=t.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Fm(t,i){t.flags&=65011714;var a=t.alternate;return a===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=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,i=a.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function co(t,i,a,o,h,p){var v=0;if(o=t,typeof t=="function")_c(t)&&(v=1);else if(typeof t=="string")v=Lw(t,a,we.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case H:return t=On(31,a,i,h),t.elementType=H,t.lanes=p,t;case D:return Qi(a.children,h,p,i);case B:v=8,h|=24;break;case L:return t=On(12,a,i,h|2),t.elementType=L,t.lanes=p,t;case P:return t=On(13,a,i,h),t.elementType=P,t.lanes=p,t;case z:return t=On(19,a,i,h),t.elementType=z,t.lanes=p,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case T:v=10;break e;case $:v=9;break e;case te:v=11;break e;case X:v=14;break e;case Z:v=16,o=null;break e}v=29,a=Error(s(130,t===null?"null":typeof t,"")),o=null}return i=On(v,a,i,h),i.elementType=t,i.type=o,i.lanes=p,i}function Qi(t,i,a,o){return t=On(7,t,o,i),t.lanes=a,t}function Ec(t,i,a){return t=On(6,t,null,i),t.lanes=a,t}function $m(t){var i=On(18,null,null,0);return i.stateNode=t,i}function kc(t,i,a){return i=On(4,t.children!==null?t.children:[],t.key,i),i.lanes=a,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var Ym=new WeakMap;function Xn(t,i){if(typeof t=="object"&&t!==null){var a=Ym.get(t);return a!==void 0?a:(i={value:t,source:i,stack:mt(i)},Ym.set(t,i),i)}return{value:t,source:i,stack:mt(i)}}var As=[],Ts=0,fo=null,Ua=0,Kn=[],Qn=0,ci=null,br=1,xr="";function zr(t,i){As[Ts++]=Ua,As[Ts++]=fo,fo=t,Ua=i}function Gm(t,i,a){Kn[Qn++]=br,Kn[Qn++]=xr,Kn[Qn++]=ci,ci=t;var o=br;t=xr;var h=32-_e(o)-1;o&=~(1<<h),a+=1;var p=32-_e(i)+h;if(30<p){var v=h-h%5;p=(o&(1<<v)-1).toString(32),o>>=v,h-=v,br=1<<32-_e(i)+h|a<<h|o,xr=p+t}else br=1<<p|a<<h|o,xr=t}function Cc(t){t.return!==null&&(zr(t,1),Gm(t,1,0))}function Ac(t){for(;t===fo;)fo=As[--Ts],As[Ts]=null,Ua=As[--Ts],As[Ts]=null;for(;t===ci;)ci=Kn[--Qn],Kn[Qn]=null,xr=Kn[--Qn],Kn[Qn]=null,br=Kn[--Qn],Kn[Qn]=null}function Vm(t,i){Kn[Qn++]=br,Kn[Qn++]=xr,Kn[Qn++]=ci,br=i.id,xr=i.overflow,ci=t}var rn=null,Ot=null,nt=!1,fi=null,Zn=!1,Tc=Error(s(519));function hi(t){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ba(Xn(i,t)),Tc}function Jm(t){var i=t.stateNode,a=t.type,o=t.memoizedProps;switch(i[Ct]=t,i[Pt]=o,a){case"dialog":Ke("cancel",i),Ke("close",i);break;case"iframe":case"object":case"embed":Ke("load",i);break;case"video":case"audio":for(a=0;a<al.length;a++)Ke(al[a],i);break;case"source":Ke("error",i);break;case"img":case"image":case"link":Ke("error",i),Ke("load",i);break;case"details":Ke("toggle",i);break;case"input":Ke("invalid",i),lm(i,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Ke("invalid",i);break;case"textarea":Ke("invalid",i),um(i,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||i.textContent===""+a||o.suppressHydrationWarning===!0||fy(i.textContent,a)?(o.popover!=null&&(Ke("beforetoggle",i),Ke("toggle",i)),o.onScroll!=null&&Ke("scroll",i),o.onScrollEnd!=null&&Ke("scrollend",i),o.onClick!=null&&(i.onclick=Mr),i=!0):i=!1,i||hi(t,!0)}function Xm(t){for(rn=t.return;rn;)switch(rn.tag){case 5:case 31:case 13:Zn=!1;return;case 27:case 3:Zn=!0;return;default:rn=rn.return}}function js(t){if(t!==rn)return!1;if(!nt)return Xm(t),nt=!0,!1;var i=t.tag,a;if((a=i!==3&&i!==27)&&((a=i===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Vf(t.type,t.memoizedProps)),a=!a),a&&Ot&&hi(t),Xm(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Ot=vy(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Ot=vy(t)}else i===27?(i=Ot,Ci(t.type)?(t=Zf,Zf=null,Ot=t):Ot=i):Ot=rn?er(t.stateNode.nextSibling):null;return!0}function Zi(){Ot=rn=null,nt=!1}function jc(){var t=fi;return t!==null&&(_n===null?_n=t:_n.push.apply(_n,t),fi=null),t}function Ba(t){fi===null?fi=[t]:fi.push(t)}var Nc=M(null),Wi=null,Ur=null;function di(t,i,a){A(Nc,i._currentValue),i._currentValue=a}function Br(t){t._currentValue=Nc.current,W(Nc)}function Oc(t,i,a){for(;t!==null;){var o=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,o!==null&&(o.childLanes|=i)):o!==null&&(o.childLanes&i)!==i&&(o.childLanes|=i),t===a)break;t=t.return}}function Rc(t,i,a,o){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var p=h.dependencies;if(p!==null){var v=h.child;p=p.firstContext;e:for(;p!==null;){var _=p;p=h;for(var I=0;I<i.length;I++)if(_.context===i[I]){p.lanes|=a,_=p.alternate,_!==null&&(_.lanes|=a),Oc(p.return,a,t),o||(v=null);break e}p=_.next}}else if(h.tag===18){if(v=h.return,v===null)throw Error(s(341));v.lanes|=a,p=v.alternate,p!==null&&(p.lanes|=a),Oc(v,a,t),v=null}else v=h.child;if(v!==null)v.return=h;else for(v=h;v!==null;){if(v===t){v=null;break}if(h=v.sibling,h!==null){h.return=v.return,v=h;break}v=v.return}h=v}}function Ns(t,i,a,o){t=null;for(var h=i,p=!1;h!==null;){if(!p){if((h.flags&524288)!==0)p=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var v=h.alternate;if(v===null)throw Error(s(387));if(v=v.memoizedProps,v!==null){var _=h.type;Nn(h.pendingProps.value,v.value)||(t!==null?t.push(_):t=[_])}}else if(h===Me.current){if(v=h.alternate,v===null)throw Error(s(387));v.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(fl):t=[fl])}h=h.return}t!==null&&Rc(i,t,a,o),i.flags|=262144}function ho(t){for(t=t.firstContext;t!==null;){if(!Nn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function es(t){Wi=t,Ur=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function sn(t){return Km(Wi,t)}function mo(t,i){return Wi===null&&es(t),Km(t,i)}function Km(t,i){var a=i._currentValue;if(i={context:i,memoizedValue:a,next:null},Ur===null){if(t===null)throw Error(s(308));Ur=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else Ur=Ur.next=i;return a}var Ov=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(a,o){t.push(o)}};this.abort=function(){i.aborted=!0,t.forEach(function(a){return a()})}},Rv=e.unstable_scheduleCallback,Mv=e.unstable_NormalPriority,Gt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mc(){return{controller:new Ov,data:new Map,refCount:0}}function Pa(t){t.refCount--,t.refCount===0&&Rv(Mv,function(){t.controller.abort()})}var qa=null,Dc=0,Os=0,Rs=null;function Dv(t,i){if(qa===null){var a=qa=[];Dc=0,Os=Bf(),Rs={status:"pending",value:void 0,then:function(o){a.push(o)}}}return Dc++,i.then(Qm,Qm),i}function Qm(){if(--Dc===0&&qa!==null){Rs!==null&&(Rs.status="fulfilled");var t=qa;qa=null,Os=0,Rs=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function Lv(t,i){var a=[],o={status:"pending",value:null,reason:null,then:function(h){a.push(h)}};return t.then(function(){o.status="fulfilled",o.value=i;for(var h=0;h<a.length;h++)(0,a[h])(i)},function(h){for(o.status="rejected",o.reason=h,h=0;h<a.length;h++)(0,a[h])(void 0)}),o}var Zm=q.S;q.S=function(t,i){Lg=vt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Dv(t,i),Zm!==null&&Zm(t,i)};var ts=M(null);function Lc(){var t=ts.current;return t!==null?t:At.pooledCache}function po(t,i){i===null?A(ts,ts.current):A(ts,i.pool)}function Wm(){var t=Lc();return t===null?null:{parent:Gt._currentValue,pool:t}}var Ms=Error(s(460)),zc=Error(s(474)),go=Error(s(542)),yo={then:function(){}};function ep(t){return t=t.status,t==="fulfilled"||t==="rejected"}function tp(t,i,a){switch(a=t[a],a===void 0?t.push(i):a!==i&&(i.then(Mr,Mr),i=a),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,rp(t),t;default:if(typeof i.status=="string")i.then(Mr,Mr);else{if(t=At,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=i,t.status="pending",t.then(function(o){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=o}},function(o){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=o}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,rp(t),t}throw rs=i,Ms}}function ns(t){try{var i=t._init;return i(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(rs=a,Ms):a}}var rs=null;function np(){if(rs===null)throw Error(s(459));var t=rs;return rs=null,t}function rp(t){if(t===Ms||t===go)throw Error(s(483))}var Ds=null,Ha=0;function bo(t){var i=Ha;return Ha+=1,Ds===null&&(Ds=[]),tp(Ds,t,i)}function Ia(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function xo(t,i){throw i.$$typeof===x?Error(s(525)):(t=Object.prototype.toString.call(i),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function ip(t){function i(Q,G){if(t){var ne=Q.deletions;ne===null?(Q.deletions=[G],Q.flags|=16):ne.push(G)}}function a(Q,G){if(!t)return null;for(;G!==null;)i(Q,G),G=G.sibling;return null}function o(Q){for(var G=new Map;Q!==null;)Q.key!==null?G.set(Q.key,Q):G.set(Q.index,Q),Q=Q.sibling;return G}function h(Q,G){return Q=Lr(Q,G),Q.index=0,Q.sibling=null,Q}function p(Q,G,ne){return Q.index=ne,t?(ne=Q.alternate,ne!==null?(ne=ne.index,ne<G?(Q.flags|=67108866,G):ne):(Q.flags|=67108866,G)):(Q.flags|=1048576,G)}function v(Q){return t&&Q.alternate===null&&(Q.flags|=67108866),Q}function _(Q,G,ne,he){return G===null||G.tag!==6?(G=Ec(ne,Q.mode,he),G.return=Q,G):(G=h(G,ne),G.return=Q,G)}function I(Q,G,ne,he){var Le=ne.type;return Le===D?ce(Q,G,ne.props.children,he,ne.key):G!==null&&(G.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===Z&&ns(Le)===G.type)?(G=h(G,ne.props),Ia(G,ne),G.return=Q,G):(G=co(ne.type,ne.key,ne.props,null,Q.mode,he),Ia(G,ne),G.return=Q,G)}function re(Q,G,ne,he){return G===null||G.tag!==4||G.stateNode.containerInfo!==ne.containerInfo||G.stateNode.implementation!==ne.implementation?(G=kc(ne,Q.mode,he),G.return=Q,G):(G=h(G,ne.children||[]),G.return=Q,G)}function ce(Q,G,ne,he,Le){return G===null||G.tag!==7?(G=Qi(ne,Q.mode,he,Le),G.return=Q,G):(G=h(G,ne),G.return=Q,G)}function pe(Q,G,ne){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Ec(""+G,Q.mode,ne),G.return=Q,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case w:return ne=co(G.type,G.key,G.props,null,Q.mode,ne),Ia(ne,G),ne.return=Q,ne;case k:return G=kc(G,Q.mode,ne),G.return=Q,G;case Z:return G=ns(G),pe(Q,G,ne)}if(F(G)||J(G))return G=Qi(G,Q.mode,ne,null),G.return=Q,G;if(typeof G.then=="function")return pe(Q,bo(G),ne);if(G.$$typeof===T)return pe(Q,mo(Q,G),ne);xo(Q,G)}return null}function ae(Q,G,ne,he){var Le=G!==null?G.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Le!==null?null:_(Q,G,""+ne,he);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:return ne.key===Le?I(Q,G,ne,he):null;case k:return ne.key===Le?re(Q,G,ne,he):null;case Z:return ne=ns(ne),ae(Q,G,ne,he)}if(F(ne)||J(ne))return Le!==null?null:ce(Q,G,ne,he,null);if(typeof ne.then=="function")return ae(Q,G,bo(ne),he);if(ne.$$typeof===T)return ae(Q,G,mo(Q,ne),he);xo(Q,ne)}return null}function oe(Q,G,ne,he,Le){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Q=Q.get(ne)||null,_(G,Q,""+he,Le);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case w:return Q=Q.get(he.key===null?ne:he.key)||null,I(G,Q,he,Le);case k:return Q=Q.get(he.key===null?ne:he.key)||null,re(G,Q,he,Le);case Z:return he=ns(he),oe(Q,G,ne,he,Le)}if(F(he)||J(he))return Q=Q.get(ne)||null,ce(G,Q,he,Le,null);if(typeof he.then=="function")return oe(Q,G,ne,bo(he),Le);if(he.$$typeof===T)return oe(Q,G,ne,mo(G,he),Le);xo(G,he)}return null}function Oe(Q,G,ne,he){for(var Le=null,ot=null,Re=G,Ge=G=0,et=null;Re!==null&&Ge<ne.length;Ge++){Re.index>Ge?(et=Re,Re=null):et=Re.sibling;var ut=ae(Q,Re,ne[Ge],he);if(ut===null){Re===null&&(Re=et);break}t&&Re&&ut.alternate===null&&i(Q,Re),G=p(ut,G,Ge),ot===null?Le=ut:ot.sibling=ut,ot=ut,Re=et}if(Ge===ne.length)return a(Q,Re),nt&&zr(Q,Ge),Le;if(Re===null){for(;Ge<ne.length;Ge++)Re=pe(Q,ne[Ge],he),Re!==null&&(G=p(Re,G,Ge),ot===null?Le=Re:ot.sibling=Re,ot=Re);return nt&&zr(Q,Ge),Le}for(Re=o(Re);Ge<ne.length;Ge++)et=oe(Re,Q,Ge,ne[Ge],he),et!==null&&(t&&et.alternate!==null&&Re.delete(et.key===null?Ge:et.key),G=p(et,G,Ge),ot===null?Le=et:ot.sibling=et,ot=et);return t&&Re.forEach(function(Oi){return i(Q,Oi)}),nt&&zr(Q,Ge),Le}function qe(Q,G,ne,he){if(ne==null)throw Error(s(151));for(var Le=null,ot=null,Re=G,Ge=G=0,et=null,ut=ne.next();Re!==null&&!ut.done;Ge++,ut=ne.next()){Re.index>Ge?(et=Re,Re=null):et=Re.sibling;var Oi=ae(Q,Re,ut.value,he);if(Oi===null){Re===null&&(Re=et);break}t&&Re&&Oi.alternate===null&&i(Q,Re),G=p(Oi,G,Ge),ot===null?Le=Oi:ot.sibling=Oi,ot=Oi,Re=et}if(ut.done)return a(Q,Re),nt&&zr(Q,Ge),Le;if(Re===null){for(;!ut.done;Ge++,ut=ne.next())ut=pe(Q,ut.value,he),ut!==null&&(G=p(ut,G,Ge),ot===null?Le=ut:ot.sibling=ut,ot=ut);return nt&&zr(Q,Ge),Le}for(Re=o(Re);!ut.done;Ge++,ut=ne.next())ut=oe(Re,Q,Ge,ut.value,he),ut!==null&&(t&&ut.alternate!==null&&Re.delete(ut.key===null?Ge:ut.key),G=p(ut,G,Ge),ot===null?Le=ut:ot.sibling=ut,ot=ut);return t&&Re.forEach(function(Gw){return i(Q,Gw)}),nt&&zr(Q,Ge),Le}function _t(Q,G,ne,he){if(typeof ne=="object"&&ne!==null&&ne.type===D&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:e:{for(var Le=ne.key;G!==null;){if(G.key===Le){if(Le=ne.type,Le===D){if(G.tag===7){a(Q,G.sibling),he=h(G,ne.props.children),he.return=Q,Q=he;break e}}else if(G.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===Z&&ns(Le)===G.type){a(Q,G.sibling),he=h(G,ne.props),Ia(he,ne),he.return=Q,Q=he;break e}a(Q,G);break}else i(Q,G);G=G.sibling}ne.type===D?(he=Qi(ne.props.children,Q.mode,he,ne.key),he.return=Q,Q=he):(he=co(ne.type,ne.key,ne.props,null,Q.mode,he),Ia(he,ne),he.return=Q,Q=he)}return v(Q);case k:e:{for(Le=ne.key;G!==null;){if(G.key===Le)if(G.tag===4&&G.stateNode.containerInfo===ne.containerInfo&&G.stateNode.implementation===ne.implementation){a(Q,G.sibling),he=h(G,ne.children||[]),he.return=Q,Q=he;break e}else{a(Q,G);break}else i(Q,G);G=G.sibling}he=kc(ne,Q.mode,he),he.return=Q,Q=he}return v(Q);case Z:return ne=ns(ne),_t(Q,G,ne,he)}if(F(ne))return Oe(Q,G,ne,he);if(J(ne)){if(Le=J(ne),typeof Le!="function")throw Error(s(150));return ne=Le.call(ne),qe(Q,G,ne,he)}if(typeof ne.then=="function")return _t(Q,G,bo(ne),he);if(ne.$$typeof===T)return _t(Q,G,mo(Q,ne),he);xo(Q,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,G!==null&&G.tag===6?(a(Q,G.sibling),he=h(G,ne),he.return=Q,Q=he):(a(Q,G),he=Ec(ne,Q.mode,he),he.return=Q,Q=he),v(Q)):a(Q,G)}return function(Q,G,ne,he){try{Ha=0;var Le=_t(Q,G,ne,he);return Ds=null,Le}catch(Re){if(Re===Ms||Re===go)throw Re;var ot=On(29,Re,null,Q.mode);return ot.lanes=he,ot.return=Q,ot}finally{}}}var is=ip(!0),sp=ip(!1),mi=!1;function Uc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bc(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 pi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function gi(t,i,a){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(ht&2)!==0){var h=o.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),o.pending=i,i=uo(t),Im(t,null,a),i}return oo(t,o,i,a),uo(t)}function Fa(t,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194048)!==0)){var o=i.lanes;o&=t.pendingLanes,a|=o,i.lanes=a,$i(t,a)}}function Pc(t,i){var a=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var h=null,p=null;if(a=a.firstBaseUpdate,a!==null){do{var v={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};p===null?h=p=v:p=p.next=v,a=a.next}while(a!==null);p===null?h=p=i:p=p.next=i}else h=p=i;a={baseState:o.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:o.shared,callbacks:o.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=i:t.next=i,a.lastBaseUpdate=i}var qc=!1;function $a(){if(qc){var t=Rs;if(t!==null)throw t}}function Ya(t,i,a,o){qc=!1;var h=t.updateQueue;mi=!1;var p=h.firstBaseUpdate,v=h.lastBaseUpdate,_=h.shared.pending;if(_!==null){h.shared.pending=null;var I=_,re=I.next;I.next=null,v===null?p=re:v.next=re,v=I;var ce=t.alternate;ce!==null&&(ce=ce.updateQueue,_=ce.lastBaseUpdate,_!==v&&(_===null?ce.firstBaseUpdate=re:_.next=re,ce.lastBaseUpdate=I))}if(p!==null){var pe=h.baseState;v=0,ce=re=I=null,_=p;do{var ae=_.lane&-536870913,oe=ae!==_.lane;if(oe?(We&ae)===ae:(o&ae)===ae){ae!==0&&ae===Os&&(qc=!0),ce!==null&&(ce=ce.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Oe=t,qe=_;ae=i;var _t=a;switch(qe.tag){case 1:if(Oe=qe.payload,typeof Oe=="function"){pe=Oe.call(_t,pe,ae);break e}pe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=qe.payload,ae=typeof Oe=="function"?Oe.call(_t,pe,ae):Oe,ae==null)break e;pe=g({},pe,ae);break e;case 2:mi=!0}}ae=_.callback,ae!==null&&(t.flags|=64,oe&&(t.flags|=8192),oe=h.callbacks,oe===null?h.callbacks=[ae]:oe.push(ae))}else oe={lane:ae,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ce===null?(re=ce=oe,I=pe):ce=ce.next=oe,v|=ae;if(_=_.next,_===null){if(_=h.shared.pending,_===null)break;oe=_,_=oe.next,oe.next=null,h.lastBaseUpdate=oe,h.shared.pending=null}}while(!0);ce===null&&(I=pe),h.baseState=I,h.firstBaseUpdate=re,h.lastBaseUpdate=ce,p===null&&(h.shared.lanes=0),wi|=v,t.lanes=v,t.memoizedState=pe}}function ap(t,i){if(typeof t!="function")throw Error(s(191,t));t.call(i)}function lp(t,i){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)ap(a[t],i)}var Ls=M(null),vo=M(0);function op(t,i){t=Vr,A(vo,t),A(Ls,i),Vr=t|i.baseLanes}function Hc(){A(vo,Vr),A(Ls,Ls.current)}function Ic(){Vr=vo.current,W(Ls),W(vo)}var Rn=M(null),Wn=null;function yi(t){var i=t.alternate;A(It,It.current&1),A(Rn,t),Wn===null&&(i===null||Ls.current!==null||i.memoizedState!==null)&&(Wn=t)}function Fc(t){A(It,It.current),A(Rn,t),Wn===null&&(Wn=t)}function up(t){t.tag===22?(A(It,It.current),A(Rn,t),Wn===null&&(Wn=t)):bi()}function bi(){A(It,It.current),A(Rn,Rn.current)}function Mn(t){W(Rn),Wn===t&&(Wn=null),W(It)}var It=M(0);function wo(t){for(var i=t;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Kf(a)||Qf(a)))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 Pr=0,Ye=null,wt=null,Vt=null,So=!1,zs=!1,ss=!1,_o=0,Ga=0,Us=null,zv=0;function qt(){throw Error(s(321))}function $c(t,i){if(i===null)return!1;for(var a=0;a<i.length&&a<t.length;a++)if(!Nn(t[a],i[a]))return!1;return!0}function Yc(t,i,a,o,h,p){return Pr=p,Ye=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,q.H=t===null||t.memoizedState===null?Gp:lf,ss=!1,p=a(o,h),ss=!1,zs&&(p=fp(i,a,o,h)),cp(t),p}function cp(t){q.H=Xa;var i=wt!==null&&wt.next!==null;if(Pr=0,Vt=wt=Ye=null,So=!1,Ga=0,Us=null,i)throw Error(s(300));t===null||Jt||(t=t.dependencies,t!==null&&ho(t)&&(Jt=!0))}function fp(t,i,a,o){Ye=t;var h=0;do{if(zs&&(Us=null),Ga=0,zs=!1,25<=h)throw Error(s(301));if(h+=1,Vt=wt=null,t.updateQueue!=null){var p=t.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}q.H=Vp,p=i(a,o)}while(zs);return p}function Uv(){var t=q.H,i=t.useState()[0];return i=typeof i.then=="function"?Va(i):i,t=t.useState()[0],(wt!==null?wt.memoizedState:null)!==t&&(Ye.flags|=1024),i}function Gc(){var t=_o!==0;return _o=0,t}function Vc(t,i,a){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~a}function Jc(t){if(So){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}So=!1}Pr=0,Vt=wt=Ye=null,zs=!1,Ga=_o=0,Us=null}function hn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?Ye.memoizedState=Vt=t:Vt=Vt.next=t,Vt}function Ft(){if(wt===null){var t=Ye.alternate;t=t!==null?t.memoizedState:null}else t=wt.next;var i=Vt===null?Ye.memoizedState:Vt.next;if(i!==null)Vt=i,wt=t;else{if(t===null)throw Ye.alternate===null?Error(s(467)):Error(s(310));wt=t,t={memoizedState:wt.memoizedState,baseState:wt.baseState,baseQueue:wt.baseQueue,queue:wt.queue,next:null},Vt===null?Ye.memoizedState=Vt=t:Vt=Vt.next=t}return Vt}function Eo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Va(t){var i=Ga;return Ga+=1,Us===null&&(Us=[]),t=tp(Us,t,i),i=Ye,(Vt===null?i.memoizedState:Vt.next)===null&&(i=i.alternate,q.H=i===null||i.memoizedState===null?Gp:lf),t}function ko(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Va(t);if(t.$$typeof===T)return sn(t)}throw Error(s(438,String(t)))}function Xc(t){var i=null,a=Ye.updateQueue;if(a!==null&&(i=a.memoCache),i==null){var o=Ye.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(i={data:o.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),a===null&&(a=Eo(),Ye.updateQueue=a),a.memoCache=i,a=i.data[i.index],a===void 0)for(a=i.data[i.index]=Array(t),o=0;o<t;o++)a[o]=O;return i.index++,a}function qr(t,i){return typeof i=="function"?i(t):i}function Co(t){var i=Ft();return Kc(i,wt,t)}function Kc(t,i,a){var o=t.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=a;var h=t.baseQueue,p=o.pending;if(p!==null){if(h!==null){var v=h.next;h.next=p.next,p.next=v}i.baseQueue=h=p,o.pending=null}if(p=t.baseState,h===null)t.memoizedState=p;else{i=h.next;var _=v=null,I=null,re=i,ce=!1;do{var pe=re.lane&-536870913;if(pe!==re.lane?(We&pe)===pe:(Pr&pe)===pe){var ae=re.revertLane;if(ae===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),pe===Os&&(ce=!0);else if((Pr&ae)===ae){re=re.next,ae===Os&&(ce=!0);continue}else pe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},I===null?(_=I=pe,v=p):I=I.next=pe,Ye.lanes|=ae,wi|=ae;pe=re.action,ss&&a(p,pe),p=re.hasEagerState?re.eagerState:a(p,pe)}else ae={lane:pe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},I===null?(_=I=ae,v=p):I=I.next=ae,Ye.lanes|=pe,wi|=pe;re=re.next}while(re!==null&&re!==i);if(I===null?v=p:I.next=_,!Nn(p,t.memoizedState)&&(Jt=!0,ce&&(a=Rs,a!==null)))throw a;t.memoizedState=p,t.baseState=v,t.baseQueue=I,o.lastRenderedState=p}return h===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Qc(t){var i=Ft(),a=i.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var o=a.dispatch,h=a.pending,p=i.memoizedState;if(h!==null){a.pending=null;var v=h=h.next;do p=t(p,v.action),v=v.next;while(v!==h);Nn(p,i.memoizedState)||(Jt=!0),i.memoizedState=p,i.baseQueue===null&&(i.baseState=p),a.lastRenderedState=p}return[p,o]}function hp(t,i,a){var o=Ye,h=Ft(),p=nt;if(p){if(a===void 0)throw Error(s(407));a=a()}else a=i();var v=!Nn((wt||h).memoizedState,a);if(v&&(h.memoizedState=a,Jt=!0),h=h.queue,ef(pp.bind(null,o,h,t),[t]),h.getSnapshot!==i||v||Vt!==null&&Vt.memoizedState.tag&1){if(o.flags|=2048,Bs(9,{destroy:void 0},mp.bind(null,o,h,a,i),null),At===null)throw Error(s(349));p||(Pr&127)!==0||dp(o,i,a)}return a}function dp(t,i,a){t.flags|=16384,t={getSnapshot:i,value:a},i=Ye.updateQueue,i===null?(i=Eo(),Ye.updateQueue=i,i.stores=[t]):(a=i.stores,a===null?i.stores=[t]:a.push(t))}function mp(t,i,a,o){i.value=a,i.getSnapshot=o,gp(i)&&yp(t)}function pp(t,i,a){return a(function(){gp(i)&&yp(t)})}function gp(t){var i=t.getSnapshot;t=t.value;try{var a=i();return!Nn(t,a)}catch{return!0}}function yp(t){var i=Ki(t,2);i!==null&&En(i,t,2)}function Zc(t){var i=hn();if(typeof t=="function"){var a=t;if(t=a(),ss){ze(!0);try{a()}finally{ze(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:t},i}function bp(t,i,a,o){return t.baseState=a,Kc(t,wt,typeof o=="function"?o:qr)}function Bv(t,i,a,o,h){if(jo(t))throw Error(s(485));if(t=i.action,t!==null){var p={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){p.listeners.push(v)}};q.T!==null?a(!0):p.isTransition=!1,o(p),a=i.pending,a===null?(p.next=i.pending=p,xp(i,p)):(p.next=a.next,i.pending=a.next=p)}}function xp(t,i){var a=i.action,o=i.payload,h=t.state;if(i.isTransition){var p=q.T,v={};q.T=v;try{var _=a(h,o),I=q.S;I!==null&&I(v,_),vp(t,i,_)}catch(re){Wc(t,i,re)}finally{p!==null&&v.types!==null&&(p.types=v.types),q.T=p}}else try{p=a(h,o),vp(t,i,p)}catch(re){Wc(t,i,re)}}function vp(t,i,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){wp(t,i,o)},function(o){return Wc(t,i,o)}):wp(t,i,a)}function wp(t,i,a){i.status="fulfilled",i.value=a,Sp(i),t.state=a,i=t.pending,i!==null&&(a=i.next,a===i?t.pending=null:(a=a.next,i.next=a,xp(t,a)))}function Wc(t,i,a){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do i.status="rejected",i.reason=a,Sp(i),i=i.next;while(i!==o)}t.action=null}function Sp(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function _p(t,i){return i}function Ep(t,i){if(nt){var a=At.formState;if(a!==null){e:{var o=Ye;if(nt){if(Ot){t:{for(var h=Ot,p=Zn;h.nodeType!==8;){if(!p){h=null;break t}if(h=er(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){Ot=er(h.nextSibling),o=h.data==="F!";break e}}hi(o)}o=!1}o&&(i=a[0])}}return a=hn(),a.memoizedState=a.baseState=i,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_p,lastRenderedState:i},a.queue=o,a=Fp.bind(null,Ye,o),o.dispatch=a,o=Zc(!1),p=af.bind(null,Ye,!1,o.queue),o=hn(),h={state:i,dispatch:null,action:t,pending:null},o.queue=h,a=Bv.bind(null,Ye,h,p,a),h.dispatch=a,o.memoizedState=t,[i,a,!1]}function kp(t){var i=Ft();return Cp(i,wt,t)}function Cp(t,i,a){if(i=Kc(t,i,_p)[0],t=Co(qr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var o=Va(i)}catch(v){throw v===Ms?go:v}else o=i;i=Ft();var h=i.queue,p=h.dispatch;return a!==i.memoizedState&&(Ye.flags|=2048,Bs(9,{destroy:void 0},Pv.bind(null,h,a),null)),[o,p,t]}function Pv(t,i){t.action=i}function Ap(t){var i=Ft(),a=wt;if(a!==null)return Cp(i,a,t);Ft(),i=i.memoizedState,a=Ft();var o=a.queue.dispatch;return a.memoizedState=t,[i,o,!1]}function Bs(t,i,a,o){return t={tag:t,create:a,deps:o,inst:i,next:null},i=Ye.updateQueue,i===null&&(i=Eo(),Ye.updateQueue=i),a=i.lastEffect,a===null?i.lastEffect=t.next=t:(o=a.next,a.next=t,t.next=o,i.lastEffect=t),t}function Tp(){return Ft().memoizedState}function Ao(t,i,a,o){var h=hn();Ye.flags|=t,h.memoizedState=Bs(1|i,{destroy:void 0},a,o===void 0?null:o)}function To(t,i,a,o){var h=Ft();o=o===void 0?null:o;var p=h.memoizedState.inst;wt!==null&&o!==null&&$c(o,wt.memoizedState.deps)?h.memoizedState=Bs(i,p,a,o):(Ye.flags|=t,h.memoizedState=Bs(1|i,p,a,o))}function jp(t,i){Ao(8390656,8,t,i)}function ef(t,i){To(2048,8,t,i)}function qv(t){Ye.flags|=4;var i=Ye.updateQueue;if(i===null)i=Eo(),Ye.updateQueue=i,i.events=[t];else{var a=i.events;a===null?i.events=[t]:a.push(t)}}function Np(t){var i=Ft().memoizedState;return qv({ref:i,nextImpl:t}),function(){if((ht&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function Op(t,i){return To(4,2,t,i)}function Rp(t,i){return To(4,4,t,i)}function Mp(t,i){if(typeof i=="function"){t=t();var a=i(t);return function(){typeof a=="function"?a():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function Dp(t,i,a){a=a!=null?a.concat([t]):null,To(4,4,Mp.bind(null,i,t),a)}function tf(){}function Lp(t,i){var a=Ft();i=i===void 0?null:i;var o=a.memoizedState;return i!==null&&$c(i,o[1])?o[0]:(a.memoizedState=[t,i],t)}function zp(t,i){var a=Ft();i=i===void 0?null:i;var o=a.memoizedState;if(i!==null&&$c(i,o[1]))return o[0];if(o=t(),ss){ze(!0);try{t()}finally{ze(!1)}}return a.memoizedState=[o,i],o}function nf(t,i,a){return a===void 0||(Pr&1073741824)!==0&&(We&261930)===0?t.memoizedState=i:(t.memoizedState=a,t=Ug(),Ye.lanes|=t,wi|=t,a)}function Up(t,i,a,o){return Nn(a,i)?a:Ls.current!==null?(t=nf(t,a,o),Nn(t,i)||(Jt=!0),t):(Pr&42)===0||(Pr&1073741824)!==0&&(We&261930)===0?(Jt=!0,t.memoizedState=a):(t=Ug(),Ye.lanes|=t,wi|=t,i)}function Bp(t,i,a,o,h){var p=V.p;V.p=p!==0&&8>p?p:8;var v=q.T,_={};q.T=_,af(t,!1,i,a);try{var I=h(),re=q.S;if(re!==null&&re(_,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ce=Lv(I,o);Ja(t,i,ce,zn(t))}else Ja(t,i,o,zn(t))}catch(pe){Ja(t,i,{then:function(){},status:"rejected",reason:pe},zn())}finally{V.p=p,v!==null&&_.types!==null&&(v.types=_.types),q.T=v}}function Hv(){}function rf(t,i,a,o){if(t.tag!==5)throw Error(s(476));var h=Pp(t).queue;Bp(t,h,i,ue,a===null?Hv:function(){return qp(t),a(o)})}function Pp(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:ue},next:null};var a={};return i.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:a},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function qp(t){var i=Pp(t);i.next===null&&(i=t.alternate.memoizedState),Ja(t,i.next.queue,{},zn())}function sf(){return sn(fl)}function Hp(){return Ft().memoizedState}function Ip(){return Ft().memoizedState}function Iv(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var a=zn();t=pi(a);var o=gi(i,t,a);o!==null&&(En(o,i,a),Fa(o,i,a)),i={cache:Mc()},t.payload=i;return}i=i.return}}function Fv(t,i,a){var o=zn();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},jo(t)?$p(i,a):(a=Sc(t,i,a,o),a!==null&&(En(a,t,o),Yp(a,i,o)))}function Fp(t,i,a){var o=zn();Ja(t,i,a,o)}function Ja(t,i,a,o){var h={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(jo(t))$p(i,h);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=i.lastRenderedReducer,p!==null))try{var v=i.lastRenderedState,_=p(v,a);if(h.hasEagerState=!0,h.eagerState=_,Nn(_,v))return oo(t,i,h,0),At===null&&lo(),!1}catch{}finally{}if(a=Sc(t,i,h,o),a!==null)return En(a,t,o),Yp(a,i,o),!0}return!1}function af(t,i,a,o){if(o={lane:2,revertLane:Bf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},jo(t)){if(i)throw Error(s(479))}else i=Sc(t,a,o,2),i!==null&&En(i,t,2)}function jo(t){var i=t.alternate;return t===Ye||i!==null&&i===Ye}function $p(t,i){zs=So=!0;var a=t.pending;a===null?i.next=i:(i.next=a.next,a.next=i),t.pending=i}function Yp(t,i,a){if((a&4194048)!==0){var o=i.lanes;o&=t.pendingLanes,a|=o,i.lanes=a,$i(t,a)}}var Xa={readContext:sn,use:ko,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useLayoutEffect:qt,useInsertionEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useSyncExternalStore:qt,useId:qt,useHostTransitionStatus:qt,useFormState:qt,useActionState:qt,useOptimistic:qt,useMemoCache:qt,useCacheRefresh:qt};Xa.useEffectEvent=qt;var Gp={readContext:sn,use:ko,useCallback:function(t,i){return hn().memoizedState=[t,i===void 0?null:i],t},useContext:sn,useEffect:jp,useImperativeHandle:function(t,i,a){a=a!=null?a.concat([t]):null,Ao(4194308,4,Mp.bind(null,i,t),a)},useLayoutEffect:function(t,i){return Ao(4194308,4,t,i)},useInsertionEffect:function(t,i){Ao(4,2,t,i)},useMemo:function(t,i){var a=hn();i=i===void 0?null:i;var o=t();if(ss){ze(!0);try{t()}finally{ze(!1)}}return a.memoizedState=[o,i],o},useReducer:function(t,i,a){var o=hn();if(a!==void 0){var h=a(i);if(ss){ze(!0);try{a(i)}finally{ze(!1)}}}else h=i;return o.memoizedState=o.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},o.queue=t,t=t.dispatch=Fv.bind(null,Ye,t),[o.memoizedState,t]},useRef:function(t){var i=hn();return t={current:t},i.memoizedState=t},useState:function(t){t=Zc(t);var i=t.queue,a=Fp.bind(null,Ye,i);return i.dispatch=a,[t.memoizedState,a]},useDebugValue:tf,useDeferredValue:function(t,i){var a=hn();return nf(a,t,i)},useTransition:function(){var t=Zc(!1);return t=Bp.bind(null,Ye,t.queue,!0,!1),hn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,a){var o=Ye,h=hn();if(nt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=i(),At===null)throw Error(s(349));(We&127)!==0||dp(o,i,a)}h.memoizedState=a;var p={value:a,getSnapshot:i};return h.queue=p,jp(pp.bind(null,o,p,t),[t]),o.flags|=2048,Bs(9,{destroy:void 0},mp.bind(null,o,p,a,i),null),a},useId:function(){var t=hn(),i=At.identifierPrefix;if(nt){var a=xr,o=br;a=(o&~(1<<32-_e(o)-1)).toString(32)+a,i="_"+i+"R_"+a,a=_o++,0<a&&(i+="H"+a.toString(32)),i+="_"}else a=zv++,i="_"+i+"r_"+a.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:sf,useFormState:Ep,useActionState:Ep,useOptimistic:function(t){var i=hn();i.memoizedState=i.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=a,i=af.bind(null,Ye,!0,a),a.dispatch=i,[t,i]},useMemoCache:Xc,useCacheRefresh:function(){return hn().memoizedState=Iv.bind(null,Ye)},useEffectEvent:function(t){var i=hn(),a={impl:t};return i.memoizedState=a,function(){if((ht&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},lf={readContext:sn,use:ko,useCallback:Lp,useContext:sn,useEffect:ef,useImperativeHandle:Dp,useInsertionEffect:Op,useLayoutEffect:Rp,useMemo:zp,useReducer:Co,useRef:Tp,useState:function(){return Co(qr)},useDebugValue:tf,useDeferredValue:function(t,i){var a=Ft();return Up(a,wt.memoizedState,t,i)},useTransition:function(){var t=Co(qr)[0],i=Ft().memoizedState;return[typeof t=="boolean"?t:Va(t),i]},useSyncExternalStore:hp,useId:Hp,useHostTransitionStatus:sf,useFormState:kp,useActionState:kp,useOptimistic:function(t,i){var a=Ft();return bp(a,wt,t,i)},useMemoCache:Xc,useCacheRefresh:Ip};lf.useEffectEvent=Np;var Vp={readContext:sn,use:ko,useCallback:Lp,useContext:sn,useEffect:ef,useImperativeHandle:Dp,useInsertionEffect:Op,useLayoutEffect:Rp,useMemo:zp,useReducer:Qc,useRef:Tp,useState:function(){return Qc(qr)},useDebugValue:tf,useDeferredValue:function(t,i){var a=Ft();return wt===null?nf(a,t,i):Up(a,wt.memoizedState,t,i)},useTransition:function(){var t=Qc(qr)[0],i=Ft().memoizedState;return[typeof t=="boolean"?t:Va(t),i]},useSyncExternalStore:hp,useId:Hp,useHostTransitionStatus:sf,useFormState:Ap,useActionState:Ap,useOptimistic:function(t,i){var a=Ft();return wt!==null?bp(a,wt,t,i):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Xc,useCacheRefresh:Ip};Vp.useEffectEvent=Np;function of(t,i,a,o){i=t.memoizedState,a=a(o,i),a=a==null?i:g({},i,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var uf={enqueueSetState:function(t,i,a){t=t._reactInternals;var o=zn(),h=pi(o);h.payload=i,a!=null&&(h.callback=a),i=gi(t,h,o),i!==null&&(En(i,t,o),Fa(i,t,o))},enqueueReplaceState:function(t,i,a){t=t._reactInternals;var o=zn(),h=pi(o);h.tag=1,h.payload=i,a!=null&&(h.callback=a),i=gi(t,h,o),i!==null&&(En(i,t,o),Fa(i,t,o))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var a=zn(),o=pi(a);o.tag=2,i!=null&&(o.callback=i),i=gi(t,o,a),i!==null&&(En(i,t,a),Fa(i,t,a))}};function Jp(t,i,a,o,h,p,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,p,v):i.prototype&&i.prototype.isPureReactComponent?!La(a,o)||!La(h,p):!0}function Xp(t,i,a,o){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,o),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,o),i.state!==t&&uf.enqueueReplaceState(i,i.state,null)}function as(t,i){var a=i;if("ref"in i){a={};for(var o in i)o!=="ref"&&(a[o]=i[o])}if(t=t.defaultProps){a===i&&(a=g({},a));for(var h in t)a[h]===void 0&&(a[h]=t[h])}return a}function Kp(t){ao(t)}function Qp(t){console.error(t)}function Zp(t){ao(t)}function No(t,i){try{var a=t.onUncaughtError;a(i.value,{componentStack:i.stack})}catch(o){setTimeout(function(){throw o})}}function Wp(t,i,a){try{var o=t.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function cf(t,i,a){return a=pi(a),a.tag=3,a.payload={element:null},a.callback=function(){No(t,i)},a}function eg(t){return t=pi(t),t.tag=3,t}function tg(t,i,a,o){var h=a.type.getDerivedStateFromError;if(typeof h=="function"){var p=o.value;t.payload=function(){return h(p)},t.callback=function(){Wp(i,a,o)}}var v=a.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Wp(i,a,o),typeof h!="function"&&(Si===null?Si=new Set([this]):Si.add(this));var _=o.stack;this.componentDidCatch(o.value,{componentStack:_!==null?_:""})})}function $v(t,i,a,o,h){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(i=a.alternate,i!==null&&Ns(i,a,h,!0),a=Rn.current,a!==null){switch(a.tag){case 31:case 13:return Wn===null?Io():a.alternate===null&&Ht===0&&(Ht=3),a.flags&=-257,a.flags|=65536,a.lanes=h,o===yo?a.flags|=16384:(i=a.updateQueue,i===null?a.updateQueue=new Set([o]):i.add(o),Lf(t,o,h)),!1;case 22:return a.flags|=65536,o===yo?a.flags|=16384:(i=a.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=i):(a=i.retryQueue,a===null?i.retryQueue=new Set([o]):a.add(o)),Lf(t,o,h)),!1}throw Error(s(435,a.tag))}return Lf(t,o,h),Io(),!1}if(nt)return i=Rn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,o!==Tc&&(t=Error(s(422),{cause:o}),Ba(Xn(t,a)))):(o!==Tc&&(i=Error(s(423),{cause:o}),Ba(Xn(i,a))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,o=Xn(o,a),h=cf(t.stateNode,o,h),Pc(t,h),Ht!==4&&(Ht=2)),!1;var p=Error(s(520),{cause:o});if(p=Xn(p,a),rl===null?rl=[p]:rl.push(p),Ht!==4&&(Ht=2),i===null)return!0;o=Xn(o,a),a=i;do{switch(a.tag){case 3:return a.flags|=65536,t=h&-h,a.lanes|=t,t=cf(a.stateNode,o,t),Pc(a,t),!1;case 1:if(i=a.type,p=a.stateNode,(a.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Si===null||!Si.has(p))))return a.flags|=65536,h&=-h,a.lanes|=h,h=eg(h),tg(h,t,a,o),Pc(a,h),!1}a=a.return}while(a!==null);return!1}var ff=Error(s(461)),Jt=!1;function an(t,i,a,o){i.child=t===null?sp(i,null,a,o):is(i,t.child,a,o)}function ng(t,i,a,o,h){a=a.render;var p=i.ref;if("ref"in o){var v={};for(var _ in o)_!=="ref"&&(v[_]=o[_])}else v=o;return es(i),o=Yc(t,i,a,v,p,h),_=Gc(),t!==null&&!Jt?(Vc(t,i,h),Hr(t,i,h)):(nt&&_&&Cc(i),i.flags|=1,an(t,i,o,h),i.child)}function rg(t,i,a,o,h){if(t===null){var p=a.type;return typeof p=="function"&&!_c(p)&&p.defaultProps===void 0&&a.compare===null?(i.tag=15,i.type=p,ig(t,i,p,o,h)):(t=co(a.type,null,o,i,i.mode,h),t.ref=i.ref,t.return=i,i.child=t)}if(p=t.child,!xf(t,h)){var v=p.memoizedProps;if(a=a.compare,a=a!==null?a:La,a(v,o)&&t.ref===i.ref)return Hr(t,i,h)}return i.flags|=1,t=Lr(p,o),t.ref=i.ref,t.return=i,i.child=t}function ig(t,i,a,o,h){if(t!==null){var p=t.memoizedProps;if(La(p,o)&&t.ref===i.ref)if(Jt=!1,i.pendingProps=o=p,xf(t,h))(t.flags&131072)!==0&&(Jt=!0);else return i.lanes=t.lanes,Hr(t,i,h)}return hf(t,i,a,o,h)}function sg(t,i,a,o){var h=o.children,p=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((i.flags&128)!==0){if(p=p!==null?p.baseLanes|a:a,t!==null){for(o=i.child=t.child,h=0;o!==null;)h=h|o.lanes|o.childLanes,o=o.sibling;o=h&~p}else o=0,i.child=null;return ag(t,i,p,a,o)}if((a&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&po(i,p!==null?p.cachePool:null),p!==null?op(i,p):Hc(),up(i);else return o=i.lanes=536870912,ag(t,i,p!==null?p.baseLanes|a:a,a,o)}else p!==null?(po(i,p.cachePool),op(i,p),bi(),i.memoizedState=null):(t!==null&&po(i,null),Hc(),bi());return an(t,i,h,a),i.child}function Ka(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function ag(t,i,a,o,h){var p=Lc();return p=p===null?null:{parent:Gt._currentValue,pool:p},i.memoizedState={baseLanes:a,cachePool:p},t!==null&&po(i,null),Hc(),up(i),t!==null&&Ns(t,i,o,!0),i.childLanes=h,null}function Oo(t,i){return i=Mo({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function lg(t,i,a){return is(i,t.child,null,a),t=Oo(i,i.pendingProps),t.flags|=2,Mn(i),i.memoizedState=null,t}function Yv(t,i,a){var o=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(nt){if(o.mode==="hidden")return t=Oo(i,o),i.lanes=536870912,Ka(null,t);if(Fc(i),(t=Ot)?(t=xy(t,Zn),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ci!==null?{id:br,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},a=$m(t),a.return=i,i.child=a,rn=i,Ot=null)):t=null,t===null)throw hi(i);return i.lanes=536870912,null}return Oo(i,o)}var p=t.memoizedState;if(p!==null){var v=p.dehydrated;if(Fc(i),h)if(i.flags&256)i.flags&=-257,i=lg(t,i,a);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(s(558));else if(Jt||Ns(t,i,a,!1),h=(a&t.childLanes)!==0,Jt||h){if(o=At,o!==null&&(v=oi(o,a),v!==0&&v!==p.retryLane))throw p.retryLane=v,Ki(t,v),En(o,t,v),ff;Io(),i=lg(t,i,a)}else t=p.treeContext,Ot=er(v.nextSibling),rn=i,nt=!0,fi=null,Zn=!1,t!==null&&Vm(i,t),i=Oo(i,o),i.flags|=4096;return i}return t=Lr(t.child,{mode:o.mode,children:o.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Ro(t,i){var a=i.ref;if(a===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(i.flags|=4194816)}}function hf(t,i,a,o,h){return es(i),a=Yc(t,i,a,o,void 0,h),o=Gc(),t!==null&&!Jt?(Vc(t,i,h),Hr(t,i,h)):(nt&&o&&Cc(i),i.flags|=1,an(t,i,a,h),i.child)}function og(t,i,a,o,h,p){return es(i),i.updateQueue=null,a=fp(i,o,a,h),cp(t),o=Gc(),t!==null&&!Jt?(Vc(t,i,p),Hr(t,i,p)):(nt&&o&&Cc(i),i.flags|=1,an(t,i,a,p),i.child)}function ug(t,i,a,o,h){if(es(i),i.stateNode===null){var p=Cs,v=a.contextType;typeof v=="object"&&v!==null&&(p=sn(v)),p=new a(o,p),i.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=uf,i.stateNode=p,p._reactInternals=i,p=i.stateNode,p.props=o,p.state=i.memoizedState,p.refs={},Uc(i),v=a.contextType,p.context=typeof v=="object"&&v!==null?sn(v):Cs,p.state=i.memoizedState,v=a.getDerivedStateFromProps,typeof v=="function"&&(of(i,a,v,o),p.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(v=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),v!==p.state&&uf.enqueueReplaceState(p,p.state,null),Ya(i,o,p,h),$a(),p.state=i.memoizedState),typeof p.componentDidMount=="function"&&(i.flags|=4194308),o=!0}else if(t===null){p=i.stateNode;var _=i.memoizedProps,I=as(a,_);p.props=I;var re=p.context,ce=a.contextType;v=Cs,typeof ce=="object"&&ce!==null&&(v=sn(ce));var pe=a.getDerivedStateFromProps;ce=typeof pe=="function"||typeof p.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,ce||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(_||re!==v)&&Xp(i,p,o,v),mi=!1;var ae=i.memoizedState;p.state=ae,Ya(i,o,p,h),$a(),re=i.memoizedState,_||ae!==re||mi?(typeof pe=="function"&&(of(i,a,pe,o),re=i.memoizedState),(I=mi||Jp(i,a,I,o,ae,re,v))?(ce||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(i.flags|=4194308)):(typeof p.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=o,i.memoizedState=re),p.props=o,p.state=re,p.context=v,o=I):(typeof p.componentDidMount=="function"&&(i.flags|=4194308),o=!1)}else{p=i.stateNode,Bc(t,i),v=i.memoizedProps,ce=as(a,v),p.props=ce,pe=i.pendingProps,ae=p.context,re=a.contextType,I=Cs,typeof re=="object"&&re!==null&&(I=sn(re)),_=a.getDerivedStateFromProps,(re=typeof _=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(v!==pe||ae!==I)&&Xp(i,p,o,I),mi=!1,ae=i.memoizedState,p.state=ae,Ya(i,o,p,h),$a();var oe=i.memoizedState;v!==pe||ae!==oe||mi||t!==null&&t.dependencies!==null&&ho(t.dependencies)?(typeof _=="function"&&(of(i,a,_,o),oe=i.memoizedState),(ce=mi||Jp(i,a,ce,o,ae,oe,I)||t!==null&&t.dependencies!==null&&ho(t.dependencies))?(re||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(o,oe,I),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(o,oe,I)),typeof p.componentDidUpdate=="function"&&(i.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof p.componentDidUpdate!="function"||v===t.memoizedProps&&ae===t.memoizedState||(i.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&ae===t.memoizedState||(i.flags|=1024),i.memoizedProps=o,i.memoizedState=oe),p.props=o,p.state=oe,p.context=I,o=ce):(typeof p.componentDidUpdate!="function"||v===t.memoizedProps&&ae===t.memoizedState||(i.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&ae===t.memoizedState||(i.flags|=1024),o=!1)}return p=o,Ro(t,i),o=(i.flags&128)!==0,p||o?(p=i.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:p.render(),i.flags|=1,t!==null&&o?(i.child=is(i,t.child,null,h),i.child=is(i,null,a,h)):an(t,i,a,h),i.memoizedState=p.state,t=i.child):t=Hr(t,i,h),t}function cg(t,i,a,o){return Zi(),i.flags|=256,an(t,i,a,o),i.child}var df={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mf(t){return{baseLanes:t,cachePool:Wm()}}function pf(t,i,a){return t=t!==null?t.childLanes&~a:0,i&&(t|=Ln),t}function fg(t,i,a){var o=i.pendingProps,h=!1,p=(i.flags&128)!==0,v;if((v=p)||(v=t!==null&&t.memoizedState===null?!1:(It.current&2)!==0),v&&(h=!0,i.flags&=-129),v=(i.flags&32)!==0,i.flags&=-33,t===null){if(nt){if(h?yi(i):bi(),(t=Ot)?(t=xy(t,Zn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ci!==null?{id:br,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},a=$m(t),a.return=i,i.child=a,rn=i,Ot=null)):t=null,t===null)throw hi(i);return Qf(t)?i.lanes=32:i.lanes=536870912,null}var _=o.children;return o=o.fallback,h?(bi(),h=i.mode,_=Mo({mode:"hidden",children:_},h),o=Qi(o,h,a,null),_.return=i,o.return=i,_.sibling=o,i.child=_,o=i.child,o.memoizedState=mf(a),o.childLanes=pf(t,v,a),i.memoizedState=df,Ka(null,o)):(yi(i),gf(i,_))}var I=t.memoizedState;if(I!==null&&(_=I.dehydrated,_!==null)){if(p)i.flags&256?(yi(i),i.flags&=-257,i=yf(t,i,a)):i.memoizedState!==null?(bi(),i.child=t.child,i.flags|=128,i=null):(bi(),_=o.fallback,h=i.mode,o=Mo({mode:"visible",children:o.children},h),_=Qi(_,h,a,null),_.flags|=2,o.return=i,_.return=i,o.sibling=_,i.child=o,is(i,t.child,null,a),o=i.child,o.memoizedState=mf(a),o.childLanes=pf(t,v,a),i.memoizedState=df,i=Ka(null,o));else if(yi(i),Qf(_)){if(v=_.nextSibling&&_.nextSibling.dataset,v)var re=v.dgst;v=re,o=Error(s(419)),o.stack="",o.digest=v,Ba({value:o,source:null,stack:null}),i=yf(t,i,a)}else if(Jt||Ns(t,i,a,!1),v=(a&t.childLanes)!==0,Jt||v){if(v=At,v!==null&&(o=oi(v,a),o!==0&&o!==I.retryLane))throw I.retryLane=o,Ki(t,o),En(v,t,o),ff;Kf(_)||Io(),i=yf(t,i,a)}else Kf(_)?(i.flags|=192,i.child=t.child,i=null):(t=I.treeContext,Ot=er(_.nextSibling),rn=i,nt=!0,fi=null,Zn=!1,t!==null&&Vm(i,t),i=gf(i,o.children),i.flags|=4096);return i}return h?(bi(),_=o.fallback,h=i.mode,I=t.child,re=I.sibling,o=Lr(I,{mode:"hidden",children:o.children}),o.subtreeFlags=I.subtreeFlags&65011712,re!==null?_=Lr(re,_):(_=Qi(_,h,a,null),_.flags|=2),_.return=i,o.return=i,o.sibling=_,i.child=o,Ka(null,o),o=i.child,_=t.child.memoizedState,_===null?_=mf(a):(h=_.cachePool,h!==null?(I=Gt._currentValue,h=h.parent!==I?{parent:I,pool:I}:h):h=Wm(),_={baseLanes:_.baseLanes|a,cachePool:h}),o.memoizedState=_,o.childLanes=pf(t,v,a),i.memoizedState=df,Ka(t.child,o)):(yi(i),a=t.child,t=a.sibling,a=Lr(a,{mode:"visible",children:o.children}),a.return=i,a.sibling=null,t!==null&&(v=i.deletions,v===null?(i.deletions=[t],i.flags|=16):v.push(t)),i.child=a,i.memoizedState=null,a)}function gf(t,i){return i=Mo({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Mo(t,i){return t=On(22,t,null,i),t.lanes=0,t}function yf(t,i,a){return is(i,t.child,null,a),t=gf(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function hg(t,i,a){t.lanes|=i;var o=t.alternate;o!==null&&(o.lanes|=i),Oc(t.return,i,a)}function bf(t,i,a,o,h,p){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:h,treeForkCount:p}:(v.isBackwards=i,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=a,v.tailMode=h,v.treeForkCount=p)}function dg(t,i,a){var o=i.pendingProps,h=o.revealOrder,p=o.tail;o=o.children;var v=It.current,_=(v&2)!==0;if(_?(v=v&1|2,i.flags|=128):v&=1,A(It,v),an(t,i,o,a),o=nt?Ua:0,!_&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&hg(t,a,i);else if(t.tag===19)hg(t,a,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(a=i.child,h=null;a!==null;)t=a.alternate,t!==null&&wo(t)===null&&(h=a),a=a.sibling;a=h,a===null?(h=i.child,i.child=null):(h=a.sibling,a.sibling=null),bf(i,!1,h,a,p,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,h=i.child,i.child=null;h!==null;){if(t=h.alternate,t!==null&&wo(t)===null){i.child=h;break}t=h.sibling,h.sibling=a,a=h,h=t}bf(i,!0,a,null,p,o);break;case"together":bf(i,!1,null,null,void 0,o);break;default:i.memoizedState=null}return i.child}function Hr(t,i,a){if(t!==null&&(i.dependencies=t.dependencies),wi|=i.lanes,(a&i.childLanes)===0)if(t!==null){if(Ns(t,i,a,!1),(a&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(s(153));if(i.child!==null){for(t=i.child,a=Lr(t,t.pendingProps),i.child=a,a.return=i;t.sibling!==null;)t=t.sibling,a=a.sibling=Lr(t,t.pendingProps),a.return=i;a.sibling=null}return i.child}function xf(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&ho(t)))}function Gv(t,i,a){switch(i.tag){case 3:He(i,i.stateNode.containerInfo),di(i,Gt,t.memoizedState.cache),Zi();break;case 27:case 5:De(i);break;case 4:He(i,i.stateNode.containerInfo);break;case 10:di(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Fc(i),null;break;case 13:var o=i.memoizedState;if(o!==null)return o.dehydrated!==null?(yi(i),i.flags|=128,null):(a&i.child.childLanes)!==0?fg(t,i,a):(yi(i),t=Hr(t,i,a),t!==null?t.sibling:null);yi(i);break;case 19:var h=(t.flags&128)!==0;if(o=(a&i.childLanes)!==0,o||(Ns(t,i,a,!1),o=(a&i.childLanes)!==0),h){if(o)return dg(t,i,a);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),A(It,It.current),o)break;return null;case 22:return i.lanes=0,sg(t,i,a,i.pendingProps);case 24:di(i,Gt,t.memoizedState.cache)}return Hr(t,i,a)}function mg(t,i,a){if(t!==null)if(t.memoizedProps!==i.pendingProps)Jt=!0;else{if(!xf(t,a)&&(i.flags&128)===0)return Jt=!1,Gv(t,i,a);Jt=(t.flags&131072)!==0}else Jt=!1,nt&&(i.flags&1048576)!==0&&Gm(i,Ua,i.index);switch(i.lanes=0,i.tag){case 16:e:{var o=i.pendingProps;if(t=ns(i.elementType),i.type=t,typeof t=="function")_c(t)?(o=as(t,o),i.tag=1,i=ug(null,i,t,o,a)):(i.tag=0,i=hf(null,i,t,o,a));else{if(t!=null){var h=t.$$typeof;if(h===te){i.tag=11,i=ng(null,i,t,o,a);break e}else if(h===X){i.tag=14,i=rg(null,i,t,o,a);break e}}throw i=ie(t)||t,Error(s(306,i,""))}}return i;case 0:return hf(t,i,i.type,i.pendingProps,a);case 1:return o=i.type,h=as(o,i.pendingProps),ug(t,i,o,h,a);case 3:e:{if(He(i,i.stateNode.containerInfo),t===null)throw Error(s(387));o=i.pendingProps;var p=i.memoizedState;h=p.element,Bc(t,i),Ya(i,o,null,a);var v=i.memoizedState;if(o=v.cache,di(i,Gt,o),o!==p.cache&&Rc(i,[Gt],a,!0),$a(),o=v.element,p.isDehydrated)if(p={element:o,isDehydrated:!1,cache:v.cache},i.updateQueue.baseState=p,i.memoizedState=p,i.flags&256){i=cg(t,i,o,a);break e}else if(o!==h){h=Xn(Error(s(424)),i),Ba(h),i=cg(t,i,o,a);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(Ot=er(t.firstChild),rn=i,nt=!0,fi=null,Zn=!0,a=sp(i,null,o,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Zi(),o===h){i=Hr(t,i,a);break e}an(t,i,o,a)}i=i.child}return i;case 26:return Ro(t,i),t===null?(a=ky(i.type,null,i.pendingProps,null))?i.memoizedState=a:nt||(a=i.type,t=i.pendingProps,o=Xo(Te.current).createElement(a),o[Ct]=i,o[Pt]=t,ln(o,a,t),Y(o),i.stateNode=o):i.memoizedState=ky(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return De(i),t===null&&nt&&(o=i.stateNode=Sy(i.type,i.pendingProps,Te.current),rn=i,Zn=!0,h=Ot,Ci(i.type)?(Zf=h,Ot=er(o.firstChild)):Ot=h),an(t,i,i.pendingProps.children,a),Ro(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&nt&&((h=o=Ot)&&(o=Sw(o,i.type,i.pendingProps,Zn),o!==null?(i.stateNode=o,rn=i,Ot=er(o.firstChild),Zn=!1,h=!0):h=!1),h||hi(i)),De(i),h=i.type,p=i.pendingProps,v=t!==null?t.memoizedProps:null,o=p.children,Vf(h,p)?o=null:v!==null&&Vf(h,v)&&(i.flags|=32),i.memoizedState!==null&&(h=Yc(t,i,Uv,null,null,a),fl._currentValue=h),Ro(t,i),an(t,i,o,a),i.child;case 6:return t===null&&nt&&((t=a=Ot)&&(a=_w(a,i.pendingProps,Zn),a!==null?(i.stateNode=a,rn=i,Ot=null,t=!0):t=!1),t||hi(i)),null;case 13:return fg(t,i,a);case 4:return He(i,i.stateNode.containerInfo),o=i.pendingProps,t===null?i.child=is(i,null,o,a):an(t,i,o,a),i.child;case 11:return ng(t,i,i.type,i.pendingProps,a);case 7:return an(t,i,i.pendingProps,a),i.child;case 8:return an(t,i,i.pendingProps.children,a),i.child;case 12:return an(t,i,i.pendingProps.children,a),i.child;case 10:return o=i.pendingProps,di(i,i.type,o.value),an(t,i,o.children,a),i.child;case 9:return h=i.type._context,o=i.pendingProps.children,es(i),h=sn(h),o=o(h),i.flags|=1,an(t,i,o,a),i.child;case 14:return rg(t,i,i.type,i.pendingProps,a);case 15:return ig(t,i,i.type,i.pendingProps,a);case 19:return dg(t,i,a);case 31:return Yv(t,i,a);case 22:return sg(t,i,a,i.pendingProps);case 24:return es(i),o=sn(Gt),t===null?(h=Lc(),h===null&&(h=At,p=Mc(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=a),h=p),i.memoizedState={parent:o,cache:h},Uc(i),di(i,Gt,h)):((t.lanes&a)!==0&&(Bc(t,i),Ya(i,null,null,a),$a()),h=t.memoizedState,p=i.memoizedState,h.parent!==o?(h={parent:o,cache:o},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),di(i,Gt,o)):(o=p.cache,di(i,Gt,o),o!==h.cache&&Rc(i,[Gt],a,!0))),an(t,i,i.pendingProps.children,a),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function Ir(t){t.flags|=4}function vf(t,i,a,o,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(Hg())t.flags|=8192;else throw rs=yo,zc}else t.flags&=-16777217}function pg(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Ny(i))if(Hg())t.flags|=8192;else throw rs=yo,zc}function Do(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?gs():536870912,t.lanes|=i,Is|=i)}function Qa(t,i){if(!nt)switch(t.tailMode){case"hidden":i=t.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function Rt(t){var i=t.alternate!==null&&t.alternate.child===t.child,a=0,o=0;if(i)for(var h=t.child;h!==null;)a|=h.lanes|h.childLanes,o|=h.subtreeFlags&65011712,o|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)a|=h.lanes|h.childLanes,o|=h.subtreeFlags,o|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=o,t.childLanes=a,i}function Vv(t,i,a){var o=i.pendingProps;switch(Ac(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(i),null;case 1:return Rt(i),null;case 3:return a=i.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),Br(Gt),be(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(js(i)?Ir(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,jc())),Rt(i),null;case 26:var h=i.type,p=i.memoizedState;return t===null?(Ir(i),p!==null?(Rt(i),pg(i,p)):(Rt(i),vf(i,h,null,o,a))):p?p!==t.memoizedState?(Ir(i),Rt(i),pg(i,p)):(Rt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==o&&Ir(i),Rt(i),vf(i,h,t,o,a)),null;case 27:if(Ze(i),a=Te.current,h=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==o&&Ir(i);else{if(!o){if(i.stateNode===null)throw Error(s(166));return Rt(i),null}t=we.current,js(i)?Jm(i):(t=Sy(h,o,a),i.stateNode=t,Ir(i))}return Rt(i),null;case 5:if(Ze(i),h=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==o&&Ir(i);else{if(!o){if(i.stateNode===null)throw Error(s(166));return Rt(i),null}if(p=we.current,js(i))Jm(i);else{var v=Xo(Te.current);switch(p){case 1:p=v.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:p=v.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":p=v.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":p=v.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":p=v.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?p.multiple=!0:o.size&&(p.size=o.size);break;default:p=typeof o.is=="string"?v.createElement(h,{is:o.is}):v.createElement(h)}}p[Ct]=i,p[Pt]=o;e:for(v=i.child;v!==null;){if(v.tag===5||v.tag===6)p.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===i)break e;for(;v.sibling===null;){if(v.return===null||v.return===i)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}i.stateNode=p;e:switch(ln(p,h,o),h){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Ir(i)}}return Rt(i),vf(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,a),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==o&&Ir(i);else{if(typeof o!="string"&&i.stateNode===null)throw Error(s(166));if(t=Te.current,js(i)){if(t=i.stateNode,a=i.memoizedProps,o=null,h=rn,h!==null)switch(h.tag){case 27:case 5:o=h.memoizedProps}t[Ct]=i,t=!!(t.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||fy(t.nodeValue,a)),t||hi(i,!0)}else t=Xo(t).createTextNode(o),t[Ct]=i,i.stateNode=t}return Rt(i),null;case 31:if(a=i.memoizedState,t===null||t.memoizedState!==null){if(o=js(i),a!==null){if(t===null){if(!o)throw Error(s(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[Ct]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Rt(i),t=!1}else a=jc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return i.flags&256?(Mn(i),i):(Mn(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Rt(i),null;case 13:if(o=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=js(i),o!==null&&o.dehydrated!==null){if(t===null){if(!h)throw Error(s(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(s(317));h[Ct]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Rt(i),h=!1}else h=jc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(Mn(i),i):(Mn(i),null)}return Mn(i),(i.flags&128)!==0?(i.lanes=a,i):(a=o!==null,t=t!==null&&t.memoizedState!==null,a&&(o=i.child,h=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(h=o.alternate.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==h&&(o.flags|=2048)),a!==t&&a&&(i.child.flags|=8192),Do(i,i.updateQueue),Rt(i),null);case 4:return be(),t===null&&If(i.stateNode.containerInfo),Rt(i),null;case 10:return Br(i.type),Rt(i),null;case 19:if(W(It),o=i.memoizedState,o===null)return Rt(i),null;if(h=(i.flags&128)!==0,p=o.rendering,p===null)if(h)Qa(o,!1);else{if(Ht!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(p=wo(t),p!==null){for(i.flags|=128,Qa(o,!1),t=p.updateQueue,i.updateQueue=t,Do(i,t),i.subtreeFlags=0,t=a,a=i.child;a!==null;)Fm(a,t),a=a.sibling;return A(It,It.current&1|2),nt&&zr(i,o.treeForkCount),i.child}t=t.sibling}o.tail!==null&&vt()>Po&&(i.flags|=128,h=!0,Qa(o,!1),i.lanes=4194304)}else{if(!h)if(t=wo(p),t!==null){if(i.flags|=128,h=!0,t=t.updateQueue,i.updateQueue=t,Do(i,t),Qa(o,!0),o.tail===null&&o.tailMode==="hidden"&&!p.alternate&&!nt)return Rt(i),null}else 2*vt()-o.renderingStartTime>Po&&a!==536870912&&(i.flags|=128,h=!0,Qa(o,!1),i.lanes=4194304);o.isBackwards?(p.sibling=i.child,i.child=p):(t=o.last,t!==null?t.sibling=p:i.child=p,o.last=p)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=vt(),t.sibling=null,a=It.current,A(It,h?a&1|2:a&1),nt&&zr(i,o.treeForkCount),t):(Rt(i),null);case 22:case 23:return Mn(i),Ic(),o=i.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(i.flags|=8192):o&&(i.flags|=8192),o?(a&536870912)!==0&&(i.flags&128)===0&&(Rt(i),i.subtreeFlags&6&&(i.flags|=8192)):Rt(i),a=i.updateQueue,a!==null&&Do(i,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==a&&(i.flags|=2048),t!==null&&W(ts),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),Br(Gt),Rt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function Jv(t,i){switch(Ac(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return Br(Gt),be(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Ze(i),null;case 31:if(i.memoizedState!==null){if(Mn(i),i.alternate===null)throw Error(s(340));Zi()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(Mn(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(s(340));Zi()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return W(It),null;case 4:return be(),null;case 10:return Br(i.type),null;case 22:case 23:return Mn(i),Ic(),t!==null&&W(ts),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return Br(Gt),null;case 25:return null;default:return null}}function gg(t,i){switch(Ac(i),i.tag){case 3:Br(Gt),be();break;case 26:case 27:case 5:Ze(i);break;case 4:be();break;case 31:i.memoizedState!==null&&Mn(i);break;case 13:Mn(i);break;case 19:W(It);break;case 10:Br(i.type);break;case 22:case 23:Mn(i),Ic(),t!==null&&W(ts);break;case 24:Br(Gt)}}function Za(t,i){try{var a=i.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var h=o.next;a=h;do{if((a.tag&t)===t){o=void 0;var p=a.create,v=a.inst;o=p(),v.destroy=o}a=a.next}while(a!==h)}}catch(_){xt(i,i.return,_)}}function xi(t,i,a){try{var o=i.updateQueue,h=o!==null?o.lastEffect:null;if(h!==null){var p=h.next;o=p;do{if((o.tag&t)===t){var v=o.inst,_=v.destroy;if(_!==void 0){v.destroy=void 0,h=i;var I=a,re=_;try{re()}catch(ce){xt(h,I,ce)}}}o=o.next}while(o!==p)}}catch(ce){xt(i,i.return,ce)}}function yg(t){var i=t.updateQueue;if(i!==null){var a=t.stateNode;try{lp(i,a)}catch(o){xt(t,t.return,o)}}}function bg(t,i,a){a.props=as(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(o){xt(t,i,o)}}function Wa(t,i){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof a=="function"?t.refCleanup=a(o):a.current=o}}catch(h){xt(t,i,h)}}function vr(t,i){var a=t.ref,o=t.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(h){xt(t,i,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(h){xt(t,i,h)}else a.current=null}function xg(t){var i=t.type,a=t.memoizedProps,o=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(h){xt(t,t.return,h)}}function wf(t,i,a){try{var o=t.stateNode;gw(o,t.type,a,i),o[Pt]=i}catch(h){xt(t,t.return,h)}}function vg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ci(t.type)||t.tag===4}function Sf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||vg(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&&Ci(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 _f(t,i,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,i?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,i):(i=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,i.appendChild(t),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=Mr));else if(o!==4&&(o===27&&Ci(t.type)&&(a=t.stateNode,i=null),t=t.child,t!==null))for(_f(t,i,a),t=t.sibling;t!==null;)_f(t,i,a),t=t.sibling}function Lo(t,i,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,i?a.insertBefore(t,i):a.appendChild(t);else if(o!==4&&(o===27&&Ci(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Lo(t,i,a),t=t.sibling;t!==null;)Lo(t,i,a),t=t.sibling}function wg(t){var i=t.stateNode,a=t.memoizedProps;try{for(var o=t.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);ln(i,o,a),i[Ct]=t,i[Pt]=a}catch(p){xt(t,t.return,p)}}var Fr=!1,Xt=!1,Ef=!1,Sg=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function Xv(t,i){if(t=t.containerInfo,Yf=nu,t=Dm(t),gc(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var h=o.anchorOffset,p=o.focusNode;o=o.focusOffset;try{a.nodeType,p.nodeType}catch{a=null;break e}var v=0,_=-1,I=-1,re=0,ce=0,pe=t,ae=null;t:for(;;){for(var oe;pe!==a||h!==0&&pe.nodeType!==3||(_=v+h),pe!==p||o!==0&&pe.nodeType!==3||(I=v+o),pe.nodeType===3&&(v+=pe.nodeValue.length),(oe=pe.firstChild)!==null;)ae=pe,pe=oe;for(;;){if(pe===t)break t;if(ae===a&&++re===h&&(_=v),ae===p&&++ce===o&&(I=v),(oe=pe.nextSibling)!==null)break;pe=ae,ae=pe.parentNode}pe=oe}a=_===-1||I===-1?null:{start:_,end:I}}else a=null}a=a||{start:0,end:0}}else a=null;for(Gf={focusedElem:t,selectionRange:a},nu=!1,Wt=i;Wt!==null;)if(i=Wt,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Wt=t;else for(;Wt!==null;){switch(i=Wt,p=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(a=0;a<t.length;a++)h=t[a],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&p!==null){t=void 0,a=i,h=p.memoizedProps,p=p.memoizedState,o=a.stateNode;try{var Oe=as(a.type,h);t=o.getSnapshotBeforeUpdate(Oe,p),o.__reactInternalSnapshotBeforeUpdate=t}catch(qe){xt(a,a.return,qe)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,a=t.nodeType,a===9)Xf(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Xf(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(s(163))}if(t=i.sibling,t!==null){t.return=i.return,Wt=t;break}Wt=i.return}}function _g(t,i,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:Yr(t,a),o&4&&Za(5,a);break;case 1:if(Yr(t,a),o&4)if(t=a.stateNode,i===null)try{t.componentDidMount()}catch(v){xt(a,a.return,v)}else{var h=as(a.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(h,i,t.__reactInternalSnapshotBeforeUpdate)}catch(v){xt(a,a.return,v)}}o&64&&yg(a),o&512&&Wa(a,a.return);break;case 3:if(Yr(t,a),o&64&&(t=a.updateQueue,t!==null)){if(i=null,a.child!==null)switch(a.child.tag){case 27:case 5:i=a.child.stateNode;break;case 1:i=a.child.stateNode}try{lp(t,i)}catch(v){xt(a,a.return,v)}}break;case 27:i===null&&o&4&&wg(a);case 26:case 5:Yr(t,a),i===null&&o&4&&xg(a),o&512&&Wa(a,a.return);break;case 12:Yr(t,a);break;case 31:Yr(t,a),o&4&&Cg(t,a);break;case 13:Yr(t,a),o&4&&Ag(t,a),o&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=iw.bind(null,a),Ew(t,a))));break;case 22:if(o=a.memoizedState!==null||Fr,!o){i=i!==null&&i.memoizedState!==null||Xt,h=Fr;var p=Xt;Fr=o,(Xt=i)&&!p?Gr(t,a,(a.subtreeFlags&8772)!==0):Yr(t,a),Fr=h,Xt=p}break;case 30:break;default:Yr(t,a)}}function Eg(t){var i=t.alternate;i!==null&&(t.alternate=null,Eg(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&ys(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 Dt=null,vn=!1;function $r(t,i,a){for(a=a.child;a!==null;)kg(t,i,a),a=a.sibling}function kg(t,i,a){if(ge&&typeof ge.onCommitFiberUnmount=="function")try{ge.onCommitFiberUnmount(Yt,a)}catch{}switch(a.tag){case 26:Xt||vr(a,i),$r(t,i,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Xt||vr(a,i);var o=Dt,h=vn;Ci(a.type)&&(Dt=a.stateNode,vn=!1),$r(t,i,a),ol(a.stateNode),Dt=o,vn=h;break;case 5:Xt||vr(a,i);case 6:if(o=Dt,h=vn,Dt=null,$r(t,i,a),Dt=o,vn=h,Dt!==null)if(vn)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(a.stateNode)}catch(p){xt(a,i,p)}else try{Dt.removeChild(a.stateNode)}catch(p){xt(a,i,p)}break;case 18:Dt!==null&&(vn?(t=Dt,yy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Ks(t)):yy(Dt,a.stateNode));break;case 4:o=Dt,h=vn,Dt=a.stateNode.containerInfo,vn=!0,$r(t,i,a),Dt=o,vn=h;break;case 0:case 11:case 14:case 15:xi(2,a,i),Xt||xi(4,a,i),$r(t,i,a);break;case 1:Xt||(vr(a,i),o=a.stateNode,typeof o.componentWillUnmount=="function"&&bg(a,i,o)),$r(t,i,a);break;case 21:$r(t,i,a);break;case 22:Xt=(o=Xt)||a.memoizedState!==null,$r(t,i,a),Xt=o;break;default:$r(t,i,a)}}function Cg(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ks(t)}catch(a){xt(i,i.return,a)}}}function Ag(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ks(t)}catch(a){xt(i,i.return,a)}}function Kv(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Sg),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Sg),i;default:throw Error(s(435,t.tag))}}function zo(t,i){var a=Kv(t);i.forEach(function(o){if(!a.has(o)){a.add(o);var h=sw.bind(null,t,o);o.then(h,h)}})}function wn(t,i){var a=i.deletions;if(a!==null)for(var o=0;o<a.length;o++){var h=a[o],p=t,v=i,_=v;e:for(;_!==null;){switch(_.tag){case 27:if(Ci(_.type)){Dt=_.stateNode,vn=!1;break e}break;case 5:Dt=_.stateNode,vn=!1;break e;case 3:case 4:Dt=_.stateNode.containerInfo,vn=!0;break e}_=_.return}if(Dt===null)throw Error(s(160));kg(p,v,h),Dt=null,vn=!1,p=h.alternate,p!==null&&(p.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Tg(i,t),i=i.sibling}var cr=null;function Tg(t,i){var a=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:wn(i,t),Sn(t),o&4&&(xi(3,t,t.return),Za(3,t),xi(5,t,t.return));break;case 1:wn(i,t),Sn(t),o&512&&(Xt||a===null||vr(a,a.return)),o&64&&Fr&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var h=cr;if(wn(i,t),Sn(t),o&512&&(Xt||a===null||vr(a,a.return)),o&4){var p=a!==null?a.memoizedState:null;if(o=t.memoizedState,a===null)if(o===null)if(t.stateNode===null){e:{o=t.type,a=t.memoizedProps,h=h.ownerDocument||h;t:switch(o){case"title":p=h.getElementsByTagName("title")[0],(!p||p[Qt]||p[Ct]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=h.createElement(o),h.head.insertBefore(p,h.querySelector("head > title"))),ln(p,o,a),p[Ct]=t,Y(p),o=p;break e;case"link":var v=Ty("link","href",h).get(o+(a.href||""));if(v){for(var _=0;_<v.length;_++)if(p=v[_],p.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&p.getAttribute("rel")===(a.rel==null?null:a.rel)&&p.getAttribute("title")===(a.title==null?null:a.title)&&p.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){v.splice(_,1);break t}}p=h.createElement(o),ln(p,o,a),h.head.appendChild(p);break;case"meta":if(v=Ty("meta","content",h).get(o+(a.content||""))){for(_=0;_<v.length;_++)if(p=v[_],p.getAttribute("content")===(a.content==null?null:""+a.content)&&p.getAttribute("name")===(a.name==null?null:a.name)&&p.getAttribute("property")===(a.property==null?null:a.property)&&p.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&p.getAttribute("charset")===(a.charSet==null?null:a.charSet)){v.splice(_,1);break t}}p=h.createElement(o),ln(p,o,a),h.head.appendChild(p);break;default:throw Error(s(468,o))}p[Ct]=t,Y(p),o=p}t.stateNode=o}else jy(h,t.type,t.stateNode);else t.stateNode=Ay(h,o,t.memoizedProps);else p!==o?(p===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):p.count--,o===null?jy(h,t.type,t.stateNode):Ay(h,o,t.memoizedProps)):o===null&&t.stateNode!==null&&wf(t,t.memoizedProps,a.memoizedProps)}break;case 27:wn(i,t),Sn(t),o&512&&(Xt||a===null||vr(a,a.return)),a!==null&&o&4&&wf(t,t.memoizedProps,a.memoizedProps);break;case 5:if(wn(i,t),Sn(t),o&512&&(Xt||a===null||vr(a,a.return)),t.flags&32){h=t.stateNode;try{xs(h,"")}catch(Oe){xt(t,t.return,Oe)}}o&4&&t.stateNode!=null&&(h=t.memoizedProps,wf(t,h,a!==null?a.memoizedProps:h)),o&1024&&(Ef=!0);break;case 6:if(wn(i,t),Sn(t),o&4){if(t.stateNode===null)throw Error(s(162));o=t.memoizedProps,a=t.stateNode;try{a.nodeValue=o}catch(Oe){xt(t,t.return,Oe)}}break;case 3:if(Zo=null,h=cr,cr=Ko(i.containerInfo),wn(i,t),cr=h,Sn(t),o&4&&a!==null&&a.memoizedState.isDehydrated)try{Ks(i.containerInfo)}catch(Oe){xt(t,t.return,Oe)}Ef&&(Ef=!1,jg(t));break;case 4:o=cr,cr=Ko(t.stateNode.containerInfo),wn(i,t),Sn(t),cr=o;break;case 12:wn(i,t),Sn(t);break;case 31:wn(i,t),Sn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,zo(t,o)));break;case 13:wn(i,t),Sn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Bo=vt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,zo(t,o)));break;case 22:h=t.memoizedState!==null;var I=a!==null&&a.memoizedState!==null,re=Fr,ce=Xt;if(Fr=re||h,Xt=ce||I,wn(i,t),Xt=ce,Fr=re,Sn(t),o&8192)e:for(i=t.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(a===null||I||Fr||Xt||ls(t)),a=null,i=t;;){if(i.tag===5||i.tag===26){if(a===null){I=a=i;try{if(p=I.stateNode,h)v=p.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{_=I.stateNode;var pe=I.memoizedProps.style,ae=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;_.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Oe){xt(I,I.return,Oe)}}}else if(i.tag===6){if(a===null){I=i;try{I.stateNode.nodeValue=h?"":I.memoizedProps}catch(Oe){xt(I,I.return,Oe)}}}else if(i.tag===18){if(a===null){I=i;try{var oe=I.stateNode;h?by(oe,!0):by(I.stateNode,!1)}catch(Oe){xt(I,I.return,Oe)}}}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;a===i&&(a=null),i=i.return}a===i&&(a=null),i.sibling.return=i.return,i=i.sibling}o&4&&(o=t.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,zo(t,a))));break;case 19:wn(i,t),Sn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,zo(t,o)));break;case 30:break;case 21:break;default:wn(i,t),Sn(t)}}function Sn(t){var i=t.flags;if(i&2){try{for(var a,o=t.return;o!==null;){if(vg(o)){a=o;break}o=o.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var h=a.stateNode,p=Sf(t);Lo(t,p,h);break;case 5:var v=a.stateNode;a.flags&32&&(xs(v,""),a.flags&=-33);var _=Sf(t);Lo(t,_,v);break;case 3:case 4:var I=a.stateNode.containerInfo,re=Sf(t);_f(t,re,I);break;default:throw Error(s(161))}}catch(ce){xt(t,t.return,ce)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function jg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;jg(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Yr(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)_g(t,i.alternate,i),i=i.sibling}function ls(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:xi(4,i,i.return),ls(i);break;case 1:vr(i,i.return);var a=i.stateNode;typeof a.componentWillUnmount=="function"&&bg(i,i.return,a),ls(i);break;case 27:ol(i.stateNode);case 26:case 5:vr(i,i.return),ls(i);break;case 22:i.memoizedState===null&&ls(i);break;case 30:ls(i);break;default:ls(i)}t=t.sibling}}function Gr(t,i,a){for(a=a&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var o=i.alternate,h=t,p=i,v=p.flags;switch(p.tag){case 0:case 11:case 15:Gr(h,p,a),Za(4,p);break;case 1:if(Gr(h,p,a),o=p,h=o.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(re){xt(o,o.return,re)}if(o=p,h=o.updateQueue,h!==null){var _=o.stateNode;try{var I=h.shared.hiddenCallbacks;if(I!==null)for(h.shared.hiddenCallbacks=null,h=0;h<I.length;h++)ap(I[h],_)}catch(re){xt(o,o.return,re)}}a&&v&64&&yg(p),Wa(p,p.return);break;case 27:wg(p);case 26:case 5:Gr(h,p,a),a&&o===null&&v&4&&xg(p),Wa(p,p.return);break;case 12:Gr(h,p,a);break;case 31:Gr(h,p,a),a&&v&4&&Cg(h,p);break;case 13:Gr(h,p,a),a&&v&4&&Ag(h,p);break;case 22:p.memoizedState===null&&Gr(h,p,a),Wa(p,p.return);break;case 30:break;default:Gr(h,p,a)}i=i.sibling}}function kf(t,i){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Pa(a))}function Cf(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Pa(t))}function fr(t,i,a,o){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ng(t,i,a,o),i=i.sibling}function Ng(t,i,a,o){var h=i.flags;switch(i.tag){case 0:case 11:case 15:fr(t,i,a,o),h&2048&&Za(9,i);break;case 1:fr(t,i,a,o);break;case 3:fr(t,i,a,o),h&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Pa(t)));break;case 12:if(h&2048){fr(t,i,a,o),t=i.stateNode;try{var p=i.memoizedProps,v=p.id,_=p.onPostCommit;typeof _=="function"&&_(v,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){xt(i,i.return,I)}}else fr(t,i,a,o);break;case 31:fr(t,i,a,o);break;case 13:fr(t,i,a,o);break;case 23:break;case 22:p=i.stateNode,v=i.alternate,i.memoizedState!==null?p._visibility&2?fr(t,i,a,o):el(t,i):p._visibility&2?fr(t,i,a,o):(p._visibility|=2,Ps(t,i,a,o,(i.subtreeFlags&10256)!==0||!1)),h&2048&&kf(v,i);break;case 24:fr(t,i,a,o),h&2048&&Cf(i.alternate,i);break;default:fr(t,i,a,o)}}function Ps(t,i,a,o,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var p=t,v=i,_=a,I=o,re=v.flags;switch(v.tag){case 0:case 11:case 15:Ps(p,v,_,I,h),Za(8,v);break;case 23:break;case 22:var ce=v.stateNode;v.memoizedState!==null?ce._visibility&2?Ps(p,v,_,I,h):el(p,v):(ce._visibility|=2,Ps(p,v,_,I,h)),h&&re&2048&&kf(v.alternate,v);break;case 24:Ps(p,v,_,I,h),h&&re&2048&&Cf(v.alternate,v);break;default:Ps(p,v,_,I,h)}i=i.sibling}}function el(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var a=t,o=i,h=o.flags;switch(o.tag){case 22:el(a,o),h&2048&&kf(o.alternate,o);break;case 24:el(a,o),h&2048&&Cf(o.alternate,o);break;default:el(a,o)}i=i.sibling}}var tl=8192;function qs(t,i,a){if(t.subtreeFlags&tl)for(t=t.child;t!==null;)Og(t,i,a),t=t.sibling}function Og(t,i,a){switch(t.tag){case 26:qs(t,i,a),t.flags&tl&&t.memoizedState!==null&&zw(a,cr,t.memoizedState,t.memoizedProps);break;case 5:qs(t,i,a);break;case 3:case 4:var o=cr;cr=Ko(t.stateNode.containerInfo),qs(t,i,a),cr=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=tl,tl=16777216,qs(t,i,a),tl=o):qs(t,i,a));break;default:qs(t,i,a)}}function Rg(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 nl(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var o=i[a];Wt=o,Dg(o,t)}Rg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Mg(t),t=t.sibling}function Mg(t){switch(t.tag){case 0:case 11:case 15:nl(t),t.flags&2048&&xi(9,t,t.return);break;case 3:nl(t);break;case 12:nl(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Uo(t)):nl(t);break;default:nl(t)}}function Uo(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var o=i[a];Wt=o,Dg(o,t)}Rg(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:xi(8,i,i.return),Uo(i);break;case 22:a=i.stateNode,a._visibility&2&&(a._visibility&=-3,Uo(i));break;default:Uo(i)}t=t.sibling}}function Dg(t,i){for(;Wt!==null;){var a=Wt;switch(a.tag){case 0:case 11:case 15:xi(8,a,i);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Pa(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,Wt=o;else e:for(a=t;Wt!==null;){o=Wt;var h=o.sibling,p=o.return;if(Eg(o),o===a){Wt=null;break e}if(h!==null){h.return=p,Wt=h;break e}Wt=p}}}var Qv={getCacheForType:function(t){var i=sn(Gt),a=i.data.get(t);return a===void 0&&(a=t(),i.data.set(t,a)),a},cacheSignal:function(){return sn(Gt).controller.signal}},Zv=typeof WeakMap=="function"?WeakMap:Map,ht=0,At=null,Xe=null,We=0,bt=0,Dn=null,vi=!1,Hs=!1,Af=!1,Vr=0,Ht=0,wi=0,os=0,Tf=0,Ln=0,Is=0,rl=null,_n=null,jf=!1,Bo=0,Lg=0,Po=1/0,qo=null,Si=null,Zt=0,_i=null,Fs=null,Jr=0,Nf=0,Of=null,zg=null,il=0,Rf=null;function zn(){return(ht&2)!==0&&We!==0?We&-We:q.T!==null?Bf():Ca()}function Ug(){if(Ln===0)if((We&536870912)===0||nt){var t=Nr;Nr<<=1,(Nr&3932160)===0&&(Nr=262144),Ln=t}else Ln=536870912;return t=Rn.current,t!==null&&(t.flags|=32),Ln}function En(t,i,a){(t===At&&(bt===2||bt===9)||t.cancelPendingCommit!==null)&&($s(t,0),Ei(t,We,Ln,!1)),lr(t,a),((ht&2)===0||t!==At)&&(t===At&&((ht&2)===0&&(os|=a),Ht===4&&Ei(t,We,Ln,!1)),wr(t))}function Bg(t,i,a){if((ht&6)!==0)throw Error(s(327));var o=!a&&(i&127)===0&&(i&t.expiredLanes)===0||Fi(t,i),h=o?tw(t,i):Df(t,i,!0),p=o;do{if(h===0){Hs&&!o&&Ei(t,i,0,!1);break}else{if(a=t.current.alternate,p&&!Wv(a)){h=Df(t,i,!1),p=!1;continue}if(h===2){if(p=i,t.errorRecoveryDisabledLanes&p)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){i=v;e:{var _=t;h=rl;var I=_.current.memoizedState.isDehydrated;if(I&&($s(_,v).flags|=256),v=Df(_,v,!1),v!==2){if(Af&&!I){_.errorRecoveryDisabledLanes|=p,os|=p,h=4;break e}p=_n,_n=h,p!==null&&(_n===null?_n=p:_n.push.apply(_n,p))}h=v}if(p=!1,h!==2)continue}}if(h===1){$s(t,0),Ei(t,i,0,!0);break}e:{switch(o=t,p=h,p){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:Ei(o,i,Ln,!vi);break e;case 2:_n=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(h=Bo+300-vt(),10<h)){if(Ei(o,i,Ln,!vi),Ii(o,0,!0)!==0)break e;Jr=i,o.timeoutHandle=py(Pg.bind(null,o,a,_n,qo,jf,i,Ln,os,Is,vi,p,"Throttled",-0,0),h);break e}Pg(o,a,_n,qo,jf,i,Ln,os,Is,vi,p,null,-0,0)}}break}while(!0);wr(t)}function Pg(t,i,a,o,h,p,v,_,I,re,ce,pe,ae,oe){if(t.timeoutHandle=-1,pe=i.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Mr},Og(i,p,pe);var Oe=(p&62914560)===p?Bo-vt():(p&4194048)===p?Lg-vt():0;if(Oe=Uw(pe,Oe),Oe!==null){Jr=p,t.cancelPendingCommit=Oe(Vg.bind(null,t,i,p,a,o,h,v,_,I,ce,pe,null,ae,oe)),Ei(t,p,v,!re);return}}Vg(t,i,p,a,o,h,v,_,I)}function Wv(t){for(var i=t;;){var a=i.tag;if((a===0||a===11||a===15)&&i.flags&16384&&(a=i.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var h=a[o],p=h.getSnapshot;h=h.value;try{if(!Nn(p(),h))return!1}catch{return!1}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;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 Ei(t,i,a,o){i&=~Tf,i&=~os,t.suspendedLanes|=i,t.pingedLanes&=~i,o&&(t.warmLanes|=i),o=t.expirationTimes;for(var h=i;0<h;){var p=31-_e(h),v=1<<p;o[p]=-1,h&=~v}a!==0&&li(t,a,i)}function Ho(){return(ht&6)===0?(sl(0),!1):!0}function Mf(){if(Xe!==null){if(bt===0)var t=Xe.return;else t=Xe,Ur=Wi=null,Jc(t),Ds=null,Ha=0,t=Xe;for(;t!==null;)gg(t.alternate,t),t=t.return;Xe=null}}function $s(t,i){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,xw(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Jr=0,Mf(),At=t,Xe=a=Lr(t.current,null),We=i,bt=0,Dn=null,vi=!1,Hs=Fi(t,i),Af=!1,Is=Ln=Tf=os=wi=Ht=0,_n=rl=null,jf=!1,(i&8)!==0&&(i|=i&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=i;0<o;){var h=31-_e(o),p=1<<h;i|=t[h],o&=~p}return Vr=i,lo(),a}function qg(t,i){Ye=null,q.H=Xa,i===Ms||i===go?(i=np(),bt=3):i===zc?(i=np(),bt=4):bt=i===ff?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Dn=i,Xe===null&&(Ht=1,No(t,Xn(i,t.current)))}function Hg(){var t=Rn.current;return t===null?!0:(We&4194048)===We?Wn===null:(We&62914560)===We||(We&536870912)!==0?t===Wn:!1}function Ig(){var t=q.H;return q.H=Xa,t===null?Xa:t}function Fg(){var t=q.A;return q.A=Qv,t}function Io(){Ht=4,vi||(We&4194048)!==We&&Rn.current!==null||(Hs=!0),(wi&134217727)===0&&(os&134217727)===0||At===null||Ei(At,We,Ln,!1)}function Df(t,i,a){var o=ht;ht|=2;var h=Ig(),p=Fg();(At!==t||We!==i)&&(qo=null,$s(t,i)),i=!1;var v=Ht;e:do try{if(bt!==0&&Xe!==null){var _=Xe,I=Dn;switch(bt){case 8:Mf(),v=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(i=!0);var re=bt;if(bt=0,Dn=null,Ys(t,_,I,re),a&&Hs){v=0;break e}break;default:re=bt,bt=0,Dn=null,Ys(t,_,I,re)}}ew(),v=Ht;break}catch(ce){qg(t,ce)}while(!0);return i&&t.shellSuspendCounter++,Ur=Wi=null,ht=o,q.H=h,q.A=p,Xe===null&&(At=null,We=0,lo()),v}function ew(){for(;Xe!==null;)$g(Xe)}function tw(t,i){var a=ht;ht|=2;var o=Ig(),h=Fg();At!==t||We!==i?(qo=null,Po=vt()+500,$s(t,i)):Hs=Fi(t,i);e:do try{if(bt!==0&&Xe!==null){i=Xe;var p=Dn;t:switch(bt){case 1:bt=0,Dn=null,Ys(t,i,p,1);break;case 2:case 9:if(ep(p)){bt=0,Dn=null,Yg(i);break}i=function(){bt!==2&&bt!==9||At!==t||(bt=7),wr(t)},p.then(i,i);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:ep(p)?(bt=0,Dn=null,Yg(i)):(bt=0,Dn=null,Ys(t,i,p,7));break;case 5:var v=null;switch(Xe.tag){case 26:v=Xe.memoizedState;case 5:case 27:var _=Xe;if(v?Ny(v):_.stateNode.complete){bt=0,Dn=null;var I=_.sibling;if(I!==null)Xe=I;else{var re=_.return;re!==null?(Xe=re,Fo(re)):Xe=null}break t}}bt=0,Dn=null,Ys(t,i,p,5);break;case 6:bt=0,Dn=null,Ys(t,i,p,6);break;case 8:Mf(),Ht=6;break e;default:throw Error(s(462))}}nw();break}catch(ce){qg(t,ce)}while(!0);return Ur=Wi=null,q.H=o,q.A=h,ht=a,Xe!==null?0:(At=null,We=0,lo(),Ht)}function nw(){for(;Xe!==null&&!Yn();)$g(Xe)}function $g(t){var i=mg(t.alternate,t,Vr);t.memoizedProps=t.pendingProps,i===null?Fo(t):Xe=i}function Yg(t){var i=t,a=i.alternate;switch(i.tag){case 15:case 0:i=og(a,i,i.pendingProps,i.type,void 0,We);break;case 11:i=og(a,i,i.pendingProps,i.type.render,i.ref,We);break;case 5:Jc(i);default:gg(a,i),i=Xe=Fm(i,Vr),i=mg(a,i,Vr)}t.memoizedProps=t.pendingProps,i===null?Fo(t):Xe=i}function Ys(t,i,a,o){Ur=Wi=null,Jc(i),Ds=null,Ha=0;var h=i.return;try{if($v(t,h,i,a,We)){Ht=1,No(t,Xn(a,t.current)),Xe=null;return}}catch(p){if(h!==null)throw Xe=h,p;Ht=1,No(t,Xn(a,t.current)),Xe=null;return}i.flags&32768?(nt||o===1?t=!0:Hs||(We&536870912)!==0?t=!1:(vi=t=!0,(o===2||o===9||o===3||o===6)&&(o=Rn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Gg(i,t)):Fo(i)}function Fo(t){var i=t;do{if((i.flags&32768)!==0){Gg(i,vi);return}t=i.return;var a=Vv(i.alternate,i,Vr);if(a!==null){Xe=a;return}if(i=i.sibling,i!==null){Xe=i;return}Xe=i=t}while(i!==null);Ht===0&&(Ht=5)}function Gg(t,i){do{var a=Jv(t.alternate,t);if(a!==null){a.flags&=32767,Xe=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!i&&(t=t.sibling,t!==null)){Xe=t;return}Xe=t=a}while(t!==null);Ht=6,Xe=null}function Vg(t,i,a,o,h,p,v,_,I){t.cancelPendingCommit=null;do $o();while(Zt!==0);if((ht&6)!==0)throw Error(s(327));if(i!==null){if(i===t.current)throw Error(s(177));if(p=i.lanes|i.childLanes,p|=wc,ai(t,a,p,v,_,I),t===At&&(Xe=At=null,We=0),Fs=i,_i=t,Jr=a,Nf=p,Of=h,zg=o,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,aw(Be,function(){return Zg(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||o){o=q.T,q.T=null,h=V.p,V.p=2,v=ht,ht|=4;try{Xv(t,i,a)}finally{ht=v,V.p=h,q.T=o}}Zt=1,Jg(),Xg(),Kg()}}function Jg(){if(Zt===1){Zt=0;var t=_i,i=Fs,a=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||a){a=q.T,q.T=null;var o=V.p;V.p=2;var h=ht;ht|=4;try{Tg(i,t);var p=Gf,v=Dm(t.containerInfo),_=p.focusedElem,I=p.selectionRange;if(v!==_&&_&&_.ownerDocument&&Mm(_.ownerDocument.documentElement,_)){if(I!==null&&gc(_)){var re=I.start,ce=I.end;if(ce===void 0&&(ce=re),"selectionStart"in _)_.selectionStart=re,_.selectionEnd=Math.min(ce,_.value.length);else{var pe=_.ownerDocument||document,ae=pe&&pe.defaultView||window;if(ae.getSelection){var oe=ae.getSelection(),Oe=_.textContent.length,qe=Math.min(I.start,Oe),_t=I.end===void 0?qe:Math.min(I.end,Oe);!oe.extend&&qe>_t&&(v=_t,_t=qe,qe=v);var Q=Rm(_,qe),G=Rm(_,_t);if(Q&&G&&(oe.rangeCount!==1||oe.anchorNode!==Q.node||oe.anchorOffset!==Q.offset||oe.focusNode!==G.node||oe.focusOffset!==G.offset)){var ne=pe.createRange();ne.setStart(Q.node,Q.offset),oe.removeAllRanges(),qe>_t?(oe.addRange(ne),oe.extend(G.node,G.offset)):(ne.setEnd(G.node,G.offset),oe.addRange(ne))}}}}for(pe=[],oe=_;oe=oe.parentNode;)oe.nodeType===1&&pe.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<pe.length;_++){var he=pe[_];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}nu=!!Yf,Gf=Yf=null}finally{ht=h,V.p=o,q.T=a}}t.current=i,Zt=2}}function Xg(){if(Zt===2){Zt=0;var t=_i,i=Fs,a=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||a){a=q.T,q.T=null;var o=V.p;V.p=2;var h=ht;ht|=4;try{_g(t,i.alternate,i)}finally{ht=h,V.p=o,q.T=a}}Zt=3}}function Kg(){if(Zt===4||Zt===3){Zt=0,gr();var t=_i,i=Fs,a=Jr,o=zg;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Zt=5:(Zt=0,Fs=_i=null,Qg(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(Si=null),Yi(a),i=i.stateNode,ge&&typeof ge.onCommitFiberRoot=="function")try{ge.onCommitFiberRoot(Yt,i,void 0,(i.current.flags&128)===128)}catch{}if(o!==null){i=q.T,h=V.p,V.p=2,q.T=null;try{for(var p=t.onRecoverableError,v=0;v<o.length;v++){var _=o[v];p(_.value,{componentStack:_.stack})}}finally{q.T=i,V.p=h}}(Jr&3)!==0&&$o(),wr(t),h=t.pendingLanes,(a&261930)!==0&&(h&42)!==0?t===Rf?il++:(il=0,Rf=t):il=0,sl(0)}}function Qg(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Pa(i)))}function $o(){return Jg(),Xg(),Kg(),Zg()}function Zg(){if(Zt!==5)return!1;var t=_i,i=Nf;Nf=0;var a=Yi(Jr),o=q.T,h=V.p;try{V.p=32>a?32:a,q.T=null,a=Of,Of=null;var p=_i,v=Jr;if(Zt=0,Fs=_i=null,Jr=0,(ht&6)!==0)throw Error(s(331));var _=ht;if(ht|=4,Mg(p.current),Ng(p,p.current,v,a),ht=_,sl(0,!1),ge&&typeof ge.onPostCommitFiberRoot=="function")try{ge.onPostCommitFiberRoot(Yt,p)}catch{}return!0}finally{V.p=h,q.T=o,Qg(t,i)}}function Wg(t,i,a){i=Xn(a,i),i=cf(t.stateNode,i,2),t=gi(t,i,2),t!==null&&(lr(t,2),wr(t))}function xt(t,i,a){if(t.tag===3)Wg(t,t,a);else for(;i!==null;){if(i.tag===3){Wg(i,t,a);break}else if(i.tag===1){var o=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Si===null||!Si.has(o))){t=Xn(a,t),a=eg(2),o=gi(i,a,2),o!==null&&(tg(a,o,i,t),lr(o,2),wr(o));break}}i=i.return}}function Lf(t,i,a){var o=t.pingCache;if(o===null){o=t.pingCache=new Zv;var h=new Set;o.set(i,h)}else h=o.get(i),h===void 0&&(h=new Set,o.set(i,h));h.has(a)||(Af=!0,h.add(a),t=rw.bind(null,t,i,a),i.then(t,t))}function rw(t,i,a){var o=t.pingCache;o!==null&&o.delete(i),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,At===t&&(We&a)===a&&(Ht===4||Ht===3&&(We&62914560)===We&&300>vt()-Bo?(ht&2)===0&&$s(t,0):Tf|=a,Is===We&&(Is=0)),wr(t)}function ey(t,i){i===0&&(i=gs()),t=Ki(t,i),t!==null&&(lr(t,i),wr(t))}function iw(t){var i=t.memoizedState,a=0;i!==null&&(a=i.retryLane),ey(t,a)}function sw(t,i){var a=0;switch(t.tag){case 31:case 13:var o=t.stateNode,h=t.memoizedState;h!==null&&(a=h.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(i),ey(t,a)}function aw(t,i){return Mt(t,i)}var Yo=null,Gs=null,zf=!1,Go=!1,Uf=!1,ki=0;function wr(t){t!==Gs&&t.next===null&&(Gs===null?Yo=Gs=t:Gs=Gs.next=t),Go=!0,zf||(zf=!0,ow())}function sl(t,i){if(!Uf&&Go){Uf=!0;do for(var a=!1,o=Yo;o!==null;){if(t!==0){var h=o.pendingLanes;if(h===0)var p=0;else{var v=o.suspendedLanes,_=o.pingedLanes;p=(1<<31-_e(42|t)+1)-1,p&=h&~(v&~_),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(a=!0,iy(o,p))}else p=We,p=Ii(o,o===At?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(p&3)===0||Fi(o,p)||(a=!0,iy(o,p));o=o.next}while(a);Uf=!1}}function lw(){ty()}function ty(){Go=zf=!1;var t=0;ki!==0&&bw()&&(t=ki);for(var i=vt(),a=null,o=Yo;o!==null;){var h=o.next,p=ny(o,i);p===0?(o.next=null,a===null?Yo=h:a.next=h,h===null&&(Gs=a)):(a=o,(t!==0||(p&3)!==0)&&(Go=!0)),o=h}Zt!==0&&Zt!==5||sl(t),ki!==0&&(ki=0)}function ny(t,i){for(var a=t.suspendedLanes,o=t.pingedLanes,h=t.expirationTimes,p=t.pendingLanes&-62914561;0<p;){var v=31-_e(p),_=1<<v,I=h[v];I===-1?((_&a)===0||(_&o)!==0)&&(h[v]=ka(_,i)):I<=i&&(t.expiredLanes|=_),p&=~_}if(i=At,a=We,a=Ii(t,t===i?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,a===0||t===i&&(bt===2||bt===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&yt(o),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Fi(t,a)){if(i=a&-a,i===t.callbackPriority)return i;switch(o!==null&&yt(o),Yi(a)){case 2:case 8:a=Se;break;case 32:a=Be;break;case 268435456:a=rt;break;default:a=Be}return o=ry.bind(null,t),a=Mt(a,o),t.callbackPriority=i,t.callbackNode=a,i}return o!==null&&o!==null&&yt(o),t.callbackPriority=2,t.callbackNode=null,2}function ry(t,i){if(Zt!==0&&Zt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if($o()&&t.callbackNode!==a)return null;var o=We;return o=Ii(t,t===At?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(Bg(t,o,i),ny(t,vt()),t.callbackNode!=null&&t.callbackNode===a?ry.bind(null,t):null)}function iy(t,i){if($o())return null;Bg(t,i,!0)}function ow(){vw(function(){(ht&6)!==0?Mt(fe,lw):ty()})}function Bf(){if(ki===0){var t=Os;t===0&&(t=ri,ri<<=1,(ri&261888)===0&&(ri=256)),ki=t}return ki}function sy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Wl(""+t)}function ay(t,i){var a=i.ownerDocument.createElement("input");return a.name=i.name,a.value=i.value,t.id&&a.setAttribute("form",t.id),i.parentNode.insertBefore(a,i),t=new FormData(t),a.parentNode.removeChild(a),t}function uw(t,i,a,o,h){if(i==="submit"&&a&&a.stateNode===h){var p=sy((h[Pt]||null).action),v=o.submitter;v&&(i=(i=v[Pt]||null)?sy(i.formAction):v.getAttribute("formAction"),i!==null&&(p=i,v=null));var _=new ro("action","action",null,o,h);t.push({event:_,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(ki!==0){var I=v?ay(h,v):new FormData(h);rf(a,{pending:!0,data:I,method:h.method,action:p},null,I)}}else typeof p=="function"&&(_.preventDefault(),I=v?ay(h,v):new FormData(h),rf(a,{pending:!0,data:I,method:h.method,action:p},p,I))},currentTarget:h}]})}}for(var Pf=0;Pf<vc.length;Pf++){var qf=vc[Pf],cw=qf.toLowerCase(),fw=qf[0].toUpperCase()+qf.slice(1);ur(cw,"on"+fw)}ur(Um,"onAnimationEnd"),ur(Bm,"onAnimationIteration"),ur(Pm,"onAnimationStart"),ur("dblclick","onDoubleClick"),ur("focusin","onFocus"),ur("focusout","onBlur"),ur(Av,"onTransitionRun"),ur(Tv,"onTransitionStart"),ur(jv,"onTransitionCancel"),ur(qm,"onTransitionEnd"),le("onMouseEnter",["mouseout","mouseover"]),le("onMouseLeave",["mouseout","mouseover"]),le("onPointerEnter",["pointerout","pointerover"]),le("onPointerLeave",["pointerout","pointerover"]),ye("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ye("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ye("onBeforeInput",["compositionend","keypress","textInput","paste"]),ye("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ye("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ye("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var al="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(" "),hw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(al));function ly(t,i){i=(i&4)!==0;for(var a=0;a<t.length;a++){var o=t[a],h=o.event;o=o.listeners;e:{var p=void 0;if(i)for(var v=o.length-1;0<=v;v--){var _=o[v],I=_.instance,re=_.currentTarget;if(_=_.listener,I!==p&&h.isPropagationStopped())break e;p=_,h.currentTarget=re;try{p(h)}catch(ce){ao(ce)}h.currentTarget=null,p=I}else for(v=0;v<o.length;v++){if(_=o[v],I=_.instance,re=_.currentTarget,_=_.listener,I!==p&&h.isPropagationStopped())break e;p=_,h.currentTarget=re;try{p(h)}catch(ce){ao(ce)}h.currentTarget=null,p=I}}}}function Ke(t,i){var a=i[Gi];a===void 0&&(a=i[Gi]=new Set);var o=t+"__bubble";a.has(o)||(oy(i,t,2,!1),a.add(o))}function Hf(t,i,a){var o=0;i&&(o|=4),oy(a,t,o,i)}var Vo="_reactListening"+Math.random().toString(36).slice(2);function If(t){if(!t[Vo]){t[Vo]=!0,ee.forEach(function(a){a!=="selectionchange"&&(hw.has(a)||Hf(a,!1,t),Hf(a,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Vo]||(i[Vo]=!0,Hf("selectionchange",!1,i))}}function oy(t,i,a,o){switch(Uy(i)){case 2:var h=qw;break;case 8:h=Hw;break;default:h=rh}a=h.bind(null,i,a,t),h=void 0,!lc||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),o?h!==void 0?t.addEventListener(i,a,{capture:!0,passive:h}):t.addEventListener(i,a,!0):h!==void 0?t.addEventListener(i,a,{passive:h}):t.addEventListener(i,a,!1)}function Ff(t,i,a,o,h){var p=o;if((i&1)===0&&(i&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var _=o.stateNode.containerInfo;if(_===h)break;if(v===4)for(v=o.return;v!==null;){var I=v.tag;if((I===3||I===4)&&v.stateNode.containerInfo===h)return;v=v.return}for(;_!==null;){if(v=E(_),v===null)return;if(I=v.tag,I===5||I===6||I===26||I===27){o=p=v;continue e}_=_.parentNode}}o=o.return}dm(function(){var re=p,ce=sc(a),pe=[];e:{var ae=Hm.get(t);if(ae!==void 0){var oe=ro,Oe=t;switch(t){case"keypress":if(to(a)===0)break e;case"keydown":case"keyup":oe=sv;break;case"focusin":Oe="focus",oe=fc;break;case"focusout":Oe="blur",oe=fc;break;case"beforeblur":case"afterblur":oe=fc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=gm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=V1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=ov;break;case Um:case Bm:case Pm:oe=K1;break;case qm:oe=cv;break;case"scroll":case"scrollend":oe=Y1;break;case"wheel":oe=hv;break;case"copy":case"cut":case"paste":oe=Z1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=bm;break;case"toggle":case"beforetoggle":oe=mv}var qe=(i&4)!==0,_t=!qe&&(t==="scroll"||t==="scrollend"),Q=qe?ae!==null?ae+"Capture":null:ae;qe=[];for(var G=re,ne;G!==null;){var he=G;if(ne=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ne===null||Q===null||(he=Ta(G,Q),he!=null&&qe.push(ll(G,he,ne))),_t)break;G=G.return}0<qe.length&&(ae=new oe(ae,Oe,null,a,ce),pe.push({event:ae,listeners:qe}))}}if((i&7)===0){e:{if(ae=t==="mouseover"||t==="pointerover",oe=t==="mouseout"||t==="pointerout",ae&&a!==ic&&(Oe=a.relatedTarget||a.fromElement)&&(E(Oe)||Oe[jn]))break e;if((oe||ae)&&(ae=ce.window===ce?ce:(ae=ce.ownerDocument)?ae.defaultView||ae.parentWindow:window,oe?(Oe=a.relatedTarget||a.toElement,oe=re,Oe=Oe?E(Oe):null,Oe!==null&&(_t=u(Oe),qe=Oe.tag,Oe!==_t||qe!==5&&qe!==27&&qe!==6)&&(Oe=null)):(oe=null,Oe=re),oe!==Oe)){if(qe=gm,he="onMouseLeave",Q="onMouseEnter",G="mouse",(t==="pointerout"||t==="pointerover")&&(qe=bm,he="onPointerLeave",Q="onPointerEnter",G="pointer"),_t=oe==null?ae:j(oe),ne=Oe==null?ae:j(Oe),ae=new qe(he,G+"leave",oe,a,ce),ae.target=_t,ae.relatedTarget=ne,he=null,E(ce)===re&&(qe=new qe(Q,G+"enter",Oe,a,ce),qe.target=ne,qe.relatedTarget=_t,he=qe),_t=he,oe&&Oe)t:{for(qe=dw,Q=oe,G=Oe,ne=0,he=Q;he;he=qe(he))ne++;he=0;for(var Le=G;Le;Le=qe(Le))he++;for(;0<ne-he;)Q=qe(Q),ne--;for(;0<he-ne;)G=qe(G),he--;for(;ne--;){if(Q===G||G!==null&&Q===G.alternate){qe=Q;break t}Q=qe(Q),G=qe(G)}qe=null}else qe=null;oe!==null&&uy(pe,ae,oe,qe,!1),Oe!==null&&_t!==null&&uy(pe,_t,Oe,qe,!0)}}e:{if(ae=re?j(re):window,oe=ae.nodeName&&ae.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ae.type==="file")var ot=Cm;else if(Em(ae))if(Am)ot=Ev;else{ot=Sv;var Re=wv}else oe=ae.nodeName,!oe||oe.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?re&&rc(re.elementType)&&(ot=Cm):ot=_v;if(ot&&(ot=ot(t,re))){km(pe,ot,a,ce);break e}Re&&Re(t,ae,re),t==="focusout"&&re&&ae.type==="number"&&re.memoizedProps.value!=null&&nc(ae,"number",ae.value)}switch(Re=re?j(re):window,t){case"focusin":(Em(Re)||Re.contentEditable==="true")&&(_s=Re,yc=re,za=null);break;case"focusout":za=yc=_s=null;break;case"mousedown":bc=!0;break;case"contextmenu":case"mouseup":case"dragend":bc=!1,Lm(pe,a,ce);break;case"selectionchange":if(Cv)break;case"keydown":case"keyup":Lm(pe,a,ce)}var Ge;if(dc)e:{switch(t){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else Ss?Sm(t,a)&&(et="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(et="onCompositionStart");et&&(xm&&a.locale!=="ko"&&(Ss||et!=="onCompositionStart"?et==="onCompositionEnd"&&Ss&&(Ge=mm()):(ui=ce,oc="value"in ui?ui.value:ui.textContent,Ss=!0)),Re=Jo(re,et),0<Re.length&&(et=new ym(et,t,null,a,ce),pe.push({event:et,listeners:Re}),Ge?et.data=Ge:(Ge=_m(a),Ge!==null&&(et.data=Ge)))),(Ge=gv?yv(t,a):bv(t,a))&&(et=Jo(re,"onBeforeInput"),0<et.length&&(Re=new ym("onBeforeInput","beforeinput",null,a,ce),pe.push({event:Re,listeners:et}),Re.data=Ge)),uw(pe,t,re,a,ce)}ly(pe,i)})}function ll(t,i,a){return{instance:t,listener:i,currentTarget:a}}function Jo(t,i){for(var a=i+"Capture",o=[];t!==null;){var h=t,p=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=Ta(t,a),h!=null&&o.unshift(ll(t,h,p)),h=Ta(t,i),h!=null&&o.push(ll(t,h,p))),t.tag===3)return o;t=t.return}return[]}function dw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function uy(t,i,a,o,h){for(var p=i._reactName,v=[];a!==null&&a!==o;){var _=a,I=_.alternate,re=_.stateNode;if(_=_.tag,I!==null&&I===o)break;_!==5&&_!==26&&_!==27||re===null||(I=re,h?(re=Ta(a,p),re!=null&&v.unshift(ll(a,re,I))):h||(re=Ta(a,p),re!=null&&v.push(ll(a,re,I)))),a=a.return}v.length!==0&&t.push({event:i,listeners:v})}var mw=/\r\n?/g,pw=/\u0000|\uFFFD/g;function cy(t){return(typeof t=="string"?t:""+t).replace(mw,`
49
+ `).replace(pw,"")}function fy(t,i){return i=cy(i),cy(t)===i}function St(t,i,a,o,h,p){switch(a){case"children":typeof o=="string"?i==="body"||i==="textarea"&&o===""||xs(t,o):(typeof o=="number"||typeof o=="bigint")&&i!=="body"&&xs(t,""+o);break;case"className":or(t,"class",o);break;case"tabIndex":or(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":or(t,a,o);break;case"style":fm(t,o,p);break;case"data":if(i!=="object"){or(t,"data",o);break}case"src":case"href":if(o===""&&(i!=="a"||a!=="href")){t.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=Wl(""+o),t.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(a==="formAction"?(i!=="input"&&St(t,i,"name",h.name,h,null),St(t,i,"formEncType",h.formEncType,h,null),St(t,i,"formMethod",h.formMethod,h,null),St(t,i,"formTarget",h.formTarget,h,null)):(St(t,i,"encType",h.encType,h,null),St(t,i,"method",h.method,h,null),St(t,i,"target",h.target,h,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=Wl(""+o),t.setAttribute(a,o);break;case"onClick":o!=null&&(t.onclick=Mr);break;case"onScroll":o!=null&&Ke("scroll",t);break;case"onScrollEnd":o!=null&&Ke("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}a=Wl(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,""+o):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":o===!0?t.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,o):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(a,o):t.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(a):t.setAttribute(a,o);break;case"popover":Ke("beforetoggle",t),Ke("toggle",t),on(t,"popover",o);break;case"xlinkActuate":Rr(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Rr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Rr(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Rr(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Rr(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Rr(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Rr(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Rr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Rr(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":on(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=F1.get(a)||a,on(t,a,o))}}function $f(t,i,a,o,h,p){switch(a){case"style":fm(t,o,p);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof o=="string"?xs(t,o):(typeof o=="number"||typeof o=="bigint")&&xs(t,""+o);break;case"onScroll":o!=null&&Ke("scroll",t);break;case"onScrollEnd":o!=null&&Ke("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Mr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!me.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(h=a.endsWith("Capture"),i=a.slice(2,h?a.length-7:void 0),p=t[Pt]||null,p=p!=null?p[a]:null,typeof p=="function"&&t.removeEventListener(i,p,h),typeof o=="function")){typeof p!="function"&&p!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(i,o,h);break e}a in t?t[a]=o:o===!0?t.setAttribute(a,""):on(t,a,o)}}}function ln(t,i,a){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ke("error",t),Ke("load",t);var o=!1,h=!1,p;for(p in a)if(a.hasOwnProperty(p)){var v=a[p];if(v!=null)switch(p){case"src":o=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:St(t,i,p,v,a,null)}}h&&St(t,i,"srcSet",a.srcSet,a,null),o&&St(t,i,"src",a.src,a,null);return;case"input":Ke("invalid",t);var _=p=v=h=null,I=null,re=null;for(o in a)if(a.hasOwnProperty(o)){var ce=a[o];if(ce!=null)switch(o){case"name":h=ce;break;case"type":v=ce;break;case"checked":I=ce;break;case"defaultChecked":re=ce;break;case"value":p=ce;break;case"defaultValue":_=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,i));break;default:St(t,i,o,ce,a,null)}}lm(t,p,_,I,re,v,h,!1);return;case"select":Ke("invalid",t),o=v=p=null;for(h in a)if(a.hasOwnProperty(h)&&(_=a[h],_!=null))switch(h){case"value":p=_;break;case"defaultValue":v=_;break;case"multiple":o=_;default:St(t,i,h,_,a,null)}i=p,a=v,t.multiple=!!o,i!=null?bs(t,!!o,i,!1):a!=null&&bs(t,!!o,a,!0);return;case"textarea":Ke("invalid",t),p=h=o=null;for(v in a)if(a.hasOwnProperty(v)&&(_=a[v],_!=null))switch(v){case"value":o=_;break;case"defaultValue":h=_;break;case"children":p=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(s(91));break;default:St(t,i,v,_,a,null)}um(t,o,h,p);return;case"option":for(I in a)if(a.hasOwnProperty(I)&&(o=a[I],o!=null))switch(I){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:St(t,i,I,o,a,null)}return;case"dialog":Ke("beforetoggle",t),Ke("toggle",t),Ke("cancel",t),Ke("close",t);break;case"iframe":case"object":Ke("load",t);break;case"video":case"audio":for(o=0;o<al.length;o++)Ke(al[o],t);break;case"image":Ke("error",t),Ke("load",t);break;case"details":Ke("toggle",t);break;case"embed":case"source":case"link":Ke("error",t),Ke("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(re in a)if(a.hasOwnProperty(re)&&(o=a[re],o!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:St(t,i,re,o,a,null)}return;default:if(rc(i)){for(ce in a)a.hasOwnProperty(ce)&&(o=a[ce],o!==void 0&&$f(t,i,ce,o,a,void 0));return}}for(_ in a)a.hasOwnProperty(_)&&(o=a[_],o!=null&&St(t,i,_,o,a,null))}function gw(t,i,a,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,p=null,v=null,_=null,I=null,re=null,ce=null;for(oe in a){var pe=a[oe];if(a.hasOwnProperty(oe)&&pe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":I=pe;default:o.hasOwnProperty(oe)||St(t,i,oe,null,o,pe)}}for(var ae in o){var oe=o[ae];if(pe=a[ae],o.hasOwnProperty(ae)&&(oe!=null||pe!=null))switch(ae){case"type":p=oe;break;case"name":h=oe;break;case"checked":re=oe;break;case"defaultChecked":ce=oe;break;case"value":v=oe;break;case"defaultValue":_=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(s(137,i));break;default:oe!==pe&&St(t,i,ae,oe,o,pe)}}tc(t,v,_,I,re,ce,p,h);return;case"select":oe=v=_=ae=null;for(p in a)if(I=a[p],a.hasOwnProperty(p)&&I!=null)switch(p){case"value":break;case"multiple":oe=I;default:o.hasOwnProperty(p)||St(t,i,p,null,o,I)}for(h in o)if(p=o[h],I=a[h],o.hasOwnProperty(h)&&(p!=null||I!=null))switch(h){case"value":ae=p;break;case"defaultValue":_=p;break;case"multiple":v=p;default:p!==I&&St(t,i,h,p,o,I)}i=_,a=v,o=oe,ae!=null?bs(t,!!a,ae,!1):!!o!=!!a&&(i!=null?bs(t,!!a,i,!0):bs(t,!!a,a?[]:"",!1));return;case"textarea":oe=ae=null;for(_ in a)if(h=a[_],a.hasOwnProperty(_)&&h!=null&&!o.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:St(t,i,_,null,o,h)}for(v in o)if(h=o[v],p=a[v],o.hasOwnProperty(v)&&(h!=null||p!=null))switch(v){case"value":ae=h;break;case"defaultValue":oe=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(s(91));break;default:h!==p&&St(t,i,v,h,o,p)}om(t,ae,oe);return;case"option":for(var Oe in a)if(ae=a[Oe],a.hasOwnProperty(Oe)&&ae!=null&&!o.hasOwnProperty(Oe))switch(Oe){case"selected":t.selected=!1;break;default:St(t,i,Oe,null,o,ae)}for(I in o)if(ae=o[I],oe=a[I],o.hasOwnProperty(I)&&ae!==oe&&(ae!=null||oe!=null))switch(I){case"selected":t.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:St(t,i,I,ae,o,oe)}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 qe in a)ae=a[qe],a.hasOwnProperty(qe)&&ae!=null&&!o.hasOwnProperty(qe)&&St(t,i,qe,null,o,ae);for(re in o)if(ae=o[re],oe=a[re],o.hasOwnProperty(re)&&ae!==oe&&(ae!=null||oe!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,i));break;default:St(t,i,re,ae,o,oe)}return;default:if(rc(i)){for(var _t in a)ae=a[_t],a.hasOwnProperty(_t)&&ae!==void 0&&!o.hasOwnProperty(_t)&&$f(t,i,_t,void 0,o,ae);for(ce in o)ae=o[ce],oe=a[ce],!o.hasOwnProperty(ce)||ae===oe||ae===void 0&&oe===void 0||$f(t,i,ce,ae,o,oe);return}}for(var Q in a)ae=a[Q],a.hasOwnProperty(Q)&&ae!=null&&!o.hasOwnProperty(Q)&&St(t,i,Q,null,o,ae);for(pe in o)ae=o[pe],oe=a[pe],!o.hasOwnProperty(pe)||ae===oe||ae==null&&oe==null||St(t,i,pe,ae,o,oe)}function hy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yw(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var h=a[o],p=h.transferSize,v=h.initiatorType,_=h.duration;if(p&&_&&hy(v)){for(v=0,_=h.responseEnd,o+=1;o<a.length;o++){var I=a[o],re=I.startTime;if(re>_)break;var ce=I.transferSize,pe=I.initiatorType;ce&&hy(pe)&&(I=I.responseEnd,v+=ce*(I<_?1:(_-re)/(I-re)))}if(--o,i+=8*(p+v)/(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 Yf=null,Gf=null;function Xo(t){return t.nodeType===9?t:t.ownerDocument}function dy(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 my(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 Vf(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 Jf=null;function bw(){var t=window.event;return t&&t.type==="popstate"?t===Jf?!1:(Jf=t,!0):(Jf=null,!1)}var py=typeof setTimeout=="function"?setTimeout:void 0,xw=typeof clearTimeout=="function"?clearTimeout:void 0,gy=typeof Promise=="function"?Promise:void 0,vw=typeof queueMicrotask=="function"?queueMicrotask:typeof gy<"u"?function(t){return gy.resolve(null).then(t).catch(ww)}:py;function ww(t){setTimeout(function(){throw t})}function Ci(t){return t==="head"}function yy(t,i){var a=i,o=0;do{var h=a.nextSibling;if(t.removeChild(a),h&&h.nodeType===8)if(a=h.data,a==="/$"||a==="/&"){if(o===0){t.removeChild(h),Ks(i);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")ol(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,ol(a);for(var p=a.firstChild;p;){var v=p.nextSibling,_=p.nodeName;p[Qt]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&p.rel.toLowerCase()==="stylesheet"||a.removeChild(p),p=v}}else a==="body"&&ol(t.ownerDocument.body);a=h}while(a);Ks(i)}function by(t,i){var a=t;t=0;do{var o=a.nextSibling;if(a.nodeType===1?i?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(i?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=o}while(a)}function Xf(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var a=i;switch(i=i.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Xf(a),ys(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function Sw(t,i,a,o){for(;t.nodeType===1;){var h=a;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[Qt])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(p=t.getAttribute("rel"),p==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(p!==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(p=t.getAttribute("src"),(p!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&p&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var p=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===p)return t}else return t;if(t=er(t.nextSibling),t===null)break}return null}function _w(t,i,a){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=er(t.nextSibling),t===null))return null;return t}function xy(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=er(t.nextSibling),t===null))return null;return t}function Kf(t){return t.data==="$?"||t.data==="$~"}function Qf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Ew(t,i){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||a.readyState!=="loading")i();else{var o=function(){i(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function er(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 Zf=null;function vy(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(i===0)return er(t.nextSibling);i--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||i++}t=t.nextSibling}return null}function wy(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(i===0)return t;i--}else a!=="/$"&&a!=="/&"||i++}t=t.previousSibling}return null}function Sy(t,i,a){switch(i=Xo(a),t){case"html":if(t=i.documentElement,!t)throw Error(s(452));return t;case"head":if(t=i.head,!t)throw Error(s(453));return t;case"body":if(t=i.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function ol(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ys(t)}var tr=new Map,_y=new Set;function Ko(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Xr=V.d;V.d={f:kw,r:Cw,D:Aw,C:Tw,L:jw,m:Nw,X:Rw,S:Ow,M:Mw};function kw(){var t=Xr.f(),i=Ho();return t||i}function Cw(t){var i=R(t);i!==null&&i.tag===5&&i.type==="form"?qp(i):Xr.r(t)}var Vs=typeof document>"u"?null:document;function Ey(t,i,a){var o=Vs;if(o&&typeof i=="string"&&i){var h=Vn(i);h='link[rel="'+t+'"][href="'+h+'"]',typeof a=="string"&&(h+='[crossorigin="'+a+'"]'),_y.has(h)||(_y.add(h),t={rel:t,crossOrigin:a,href:i},o.querySelector(h)===null&&(i=o.createElement("link"),ln(i,"link",t),Y(i),o.head.appendChild(i)))}}function Aw(t){Xr.D(t),Ey("dns-prefetch",t,null)}function Tw(t,i){Xr.C(t,i),Ey("preconnect",t,i)}function jw(t,i,a){Xr.L(t,i,a);var o=Vs;if(o&&t&&i){var h='link[rel="preload"][as="'+Vn(i)+'"]';i==="image"&&a&&a.imageSrcSet?(h+='[imagesrcset="'+Vn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(h+='[imagesizes="'+Vn(a.imageSizes)+'"]')):h+='[href="'+Vn(t)+'"]';var p=h;switch(i){case"style":p=Js(t);break;case"script":p=Xs(t)}tr.has(p)||(t=g({rel:"preload",href:i==="image"&&a&&a.imageSrcSet?void 0:t,as:i},a),tr.set(p,t),o.querySelector(h)!==null||i==="style"&&o.querySelector(ul(p))||i==="script"&&o.querySelector(cl(p))||(i=o.createElement("link"),ln(i,"link",t),Y(i),o.head.appendChild(i)))}}function Nw(t,i){Xr.m(t,i);var a=Vs;if(a&&t){var o=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Vn(o)+'"][href="'+Vn(t)+'"]',p=h;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Xs(t)}if(!tr.has(p)&&(t=g({rel:"modulepreload",href:t},i),tr.set(p,t),a.querySelector(h)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(cl(p)))return}o=a.createElement("link"),ln(o,"link",t),Y(o),a.head.appendChild(o)}}}function Ow(t,i,a){Xr.S(t,i,a);var o=Vs;if(o&&t){var h=U(o).hoistableStyles,p=Js(t);i=i||"default";var v=h.get(p);if(!v){var _={loading:0,preload:null};if(v=o.querySelector(ul(p)))_.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":i},a),(a=tr.get(p))&&Wf(t,a);var I=v=o.createElement("link");Y(I),ln(I,"link",t),I._p=new Promise(function(re,ce){I.onload=re,I.onerror=ce}),I.addEventListener("load",function(){_.loading|=1}),I.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Qo(v,i,o)}v={type:"stylesheet",instance:v,count:1,state:_},h.set(p,v)}}}function Rw(t,i){Xr.X(t,i);var a=Vs;if(a&&t){var o=U(a).hoistableScripts,h=Xs(t),p=o.get(h);p||(p=a.querySelector(cl(h)),p||(t=g({src:t,async:!0},i),(i=tr.get(h))&&eh(t,i),p=a.createElement("script"),Y(p),ln(p,"link",t),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(h,p))}}function Mw(t,i){Xr.M(t,i);var a=Vs;if(a&&t){var o=U(a).hoistableScripts,h=Xs(t),p=o.get(h);p||(p=a.querySelector(cl(h)),p||(t=g({src:t,async:!0,type:"module"},i),(i=tr.get(h))&&eh(t,i),p=a.createElement("script"),Y(p),ln(p,"link",t),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(h,p))}}function ky(t,i,a,o){var h=(h=Te.current)?Ko(h):null;if(!h)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(i=Js(a.href),a=U(h).hoistableStyles,o=a.get(i),o||(o={type:"style",instance:null,count:0,state:null},a.set(i,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Js(a.href);var p=U(h).hoistableStyles,v=p.get(t);if(v||(h=h.ownerDocument||h,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(t,v),(p=h.querySelector(ul(t)))&&!p._p&&(v.instance=p,v.state.loading=5),tr.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},tr.set(t,a),p||Dw(h,t,a,v.state))),i&&o===null)throw Error(s(528,""));return v}if(i&&o!==null)throw Error(s(529,""));return null;case"script":return i=a.async,a=a.src,typeof a=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Xs(a),a=U(h).hoistableScripts,o=a.get(i),o||(o={type:"script",instance:null,count:0,state:null},a.set(i,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Js(t){return'href="'+Vn(t)+'"'}function ul(t){return'link[rel="stylesheet"]['+t+"]"}function Cy(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function Dw(t,i,a,o){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?o.loading=1:(i=t.createElement("link"),o.preload=i,i.addEventListener("load",function(){return o.loading|=1}),i.addEventListener("error",function(){return o.loading|=2}),ln(i,"link",a),Y(i),t.head.appendChild(i))}function Xs(t){return'[src="'+Vn(t)+'"]'}function cl(t){return"script[async]"+t}function Ay(t,i,a){if(i.count++,i.instance===null)switch(i.type){case"style":var o=t.querySelector('style[data-href~="'+Vn(a.href)+'"]');if(o)return i.instance=o,Y(o),o;var h=g({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Y(o),ln(o,"style",h),Qo(o,a.precedence,t),i.instance=o;case"stylesheet":h=Js(a.href);var p=t.querySelector(ul(h));if(p)return i.state.loading|=4,i.instance=p,Y(p),p;o=Cy(a),(h=tr.get(h))&&Wf(o,h),p=(t.ownerDocument||t).createElement("link"),Y(p);var v=p;return v._p=new Promise(function(_,I){v.onload=_,v.onerror=I}),ln(p,"link",o),i.state.loading|=4,Qo(p,a.precedence,t),i.instance=p;case"script":return p=Xs(a.src),(h=t.querySelector(cl(p)))?(i.instance=h,Y(h),h):(o=a,(h=tr.get(p))&&(o=g({},a),eh(o,h)),t=t.ownerDocument||t,h=t.createElement("script"),Y(h),ln(h,"link",o),t.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(o=i.instance,i.state.loading|=4,Qo(o,a.precedence,t));return i.instance}function Qo(t,i,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=o.length?o[o.length-1]:null,p=h,v=0;v<o.length;v++){var _=o[v];if(_.dataset.precedence===i)p=_;else if(p!==h)break}p?p.parentNode.insertBefore(t,p.nextSibling):(i=a.nodeType===9?a.head:a,i.insertBefore(t,i.firstChild))}function Wf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function eh(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var Zo=null;function Ty(t,i,a){if(Zo===null){var o=new Map,h=Zo=new Map;h.set(a,o)}else h=Zo,o=h.get(a),o||(o=new Map,h.set(a,o));if(o.has(t))return o;for(o.set(t,null),a=a.getElementsByTagName(t),h=0;h<a.length;h++){var p=a[h];if(!(p[Qt]||p[Ct]||t==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var v=p.getAttribute(i)||"";v=t+v;var _=o.get(v);_?_.push(p):o.set(v,[p])}}return o}function jy(t,i,a){t=t.ownerDocument||t,t.head.insertBefore(a,i==="title"?t.querySelector("head > title"):null)}function Lw(t,i,a){if(a===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 Ny(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function zw(t,i,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var h=Js(o.href),p=i.querySelector(ul(h));if(p){i=p._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=Wo.bind(t),i.then(t,t)),a.state.loading|=4,a.instance=p,Y(p);return}p=i.ownerDocument||i,o=Cy(o),(h=tr.get(h))&&Wf(o,h),p=p.createElement("link"),Y(p);var v=p;v._p=new Promise(function(_,I){v.onload=_,v.onerror=I}),ln(p,"link",o),a.instance=p}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,i),(i=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=Wo.bind(t),i.addEventListener("load",a),i.addEventListener("error",a))}}var th=0;function Uw(t,i){return t.stylesheets&&t.count===0&&tu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var o=setTimeout(function(){if(t.stylesheets&&tu(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+i);0<t.imgBytes&&th===0&&(th=62500*yw());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&tu(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>th?50:800)+i);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(h)}}:null}function Wo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var eu=null;function tu(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,eu=new Map,i.forEach(Bw,t),eu=null,Wo.call(t))}function Bw(t,i){if(!(i.state.loading&4)){var a=eu.get(t);if(a)var o=a.get(null);else{a=new Map,eu.set(t,a);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<h.length;p++){var v=h[p];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(a.set(v.dataset.precedence,v),o=v)}o&&a.set(null,o)}h=i.instance,v=h.getAttribute("data-precedence"),p=a.get(v)||o,p===o&&a.set(null,h),a.set(v,h),this.count++,o=Wo.bind(this),h.addEventListener("load",o),h.addEventListener("error",o),p?p.parentNode.insertBefore(h,p.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),i.state.loading|=4}}var fl={$$typeof:T,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function Pw(t,i,a,o,h,p,v,_,I){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=si(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=si(0),this.hiddenUpdates=si(null),this.identifierPrefix=o,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function Oy(t,i,a,o,h,p,v,_,I,re,ce,pe){return t=new Pw(t,i,a,v,I,re,ce,pe,_),i=1,p===!0&&(i|=24),p=On(3,null,null,i),t.current=p,p.stateNode=t,i=Mc(),i.refCount++,t.pooledCache=i,i.refCount++,p.memoizedState={element:o,isDehydrated:a,cache:i},Uc(p),t}function Ry(t){return t?(t=Cs,t):Cs}function My(t,i,a,o,h,p){h=Ry(h),o.context===null?o.context=h:o.pendingContext=h,o=pi(i),o.payload={element:a},p=p===void 0?null:p,p!==null&&(o.callback=p),a=gi(t,o,i),a!==null&&(En(a,t,i),Fa(a,t,i))}function Dy(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<i?a:i}}function nh(t,i){Dy(t,i),(t=t.alternate)&&Dy(t,i)}function Ly(t){if(t.tag===13||t.tag===31){var i=Ki(t,67108864);i!==null&&En(i,t,67108864),nh(t,67108864)}}function zy(t){if(t.tag===13||t.tag===31){var i=zn();i=Or(i);var a=Ki(t,i);a!==null&&En(a,t,i),nh(t,i)}}var nu=!0;function qw(t,i,a,o){var h=q.T;q.T=null;var p=V.p;try{V.p=2,rh(t,i,a,o)}finally{V.p=p,q.T=h}}function Hw(t,i,a,o){var h=q.T;q.T=null;var p=V.p;try{V.p=8,rh(t,i,a,o)}finally{V.p=p,q.T=h}}function rh(t,i,a,o){if(nu){var h=ih(o);if(h===null)Ff(t,i,o,ru,a),By(t,o);else if(Fw(h,t,i,a,o))o.stopPropagation();else if(By(t,o),i&4&&-1<Iw.indexOf(t)){for(;h!==null;){var p=R(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var v=ar(p.pendingLanes);if(v!==0){var _=p;for(_.pendingLanes|=2,_.entangledLanes|=2;v;){var I=1<<31-_e(v);_.entanglements[1]|=I,v&=~I}wr(p),(ht&6)===0&&(Po=vt()+500,sl(0))}}break;case 31:case 13:_=Ki(p,2),_!==null&&En(_,p,2),Ho(),nh(p,2)}if(p=ih(o),p===null&&Ff(t,i,o,ru,a),p===h)break;h=p}h!==null&&o.stopPropagation()}else Ff(t,i,o,null,a)}}function ih(t){return t=sc(t),sh(t)}var ru=null;function sh(t){if(ru=null,t=E(t),t!==null){var i=u(t);if(i===null)t=null;else{var a=i.tag;if(a===13){if(t=c(i),t!==null)return t;t=null}else if(a===31){if(t=f(i),t!==null)return t;t=null}else if(a===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return ru=t,null}function Uy(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(An()){case fe:return 2;case Se:return 8;case Be:case $e:return 32;case rt:return 268435456;default:return 32}default:return 32}}var ah=!1,Ai=null,Ti=null,ji=null,hl=new Map,dl=new Map,Ni=[],Iw="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 By(t,i){switch(t){case"focusin":case"focusout":Ai=null;break;case"dragenter":case"dragleave":Ti=null;break;case"mouseover":case"mouseout":ji=null;break;case"pointerover":case"pointerout":hl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":dl.delete(i.pointerId)}}function ml(t,i,a,o,h,p){return t===null||t.nativeEvent!==p?(t={blockedOn:i,domEventName:a,eventSystemFlags:o,nativeEvent:p,targetContainers:[h]},i!==null&&(i=R(i),i!==null&&Ly(i)),t):(t.eventSystemFlags|=o,i=t.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),t)}function Fw(t,i,a,o,h){switch(i){case"focusin":return Ai=ml(Ai,t,i,a,o,h),!0;case"dragenter":return Ti=ml(Ti,t,i,a,o,h),!0;case"mouseover":return ji=ml(ji,t,i,a,o,h),!0;case"pointerover":var p=h.pointerId;return hl.set(p,ml(hl.get(p)||null,t,i,a,o,h)),!0;case"gotpointercapture":return p=h.pointerId,dl.set(p,ml(dl.get(p)||null,t,i,a,o,h)),!0}return!1}function Py(t){var i=E(t.target);if(i!==null){var a=u(i);if(a!==null){if(i=a.tag,i===13){if(i=c(a),i!==null){t.blockedOn=i,Xl(t.priority,function(){zy(a)});return}}else if(i===31){if(i=f(a),i!==null){t.blockedOn=i,Xl(t.priority,function(){zy(a)});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function iu(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var a=ih(t.nativeEvent);if(a===null){a=t.nativeEvent;var o=new a.constructor(a.type,a);ic=o,a.target.dispatchEvent(o),ic=null}else return i=R(a),i!==null&&Ly(i),t.blockedOn=a,!1;i.shift()}return!0}function qy(t,i,a){iu(t)&&a.delete(i)}function $w(){ah=!1,Ai!==null&&iu(Ai)&&(Ai=null),Ti!==null&&iu(Ti)&&(Ti=null),ji!==null&&iu(ji)&&(ji=null),hl.forEach(qy),dl.forEach(qy)}function su(t,i){t.blockedOn===i&&(t.blockedOn=null,ah||(ah=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,$w)))}var au=null;function Hy(t){au!==t&&(au=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){au===t&&(au=null);for(var i=0;i<t.length;i+=3){var a=t[i],o=t[i+1],h=t[i+2];if(typeof o!="function"){if(sh(o||a)===null)continue;break}var p=R(a);p!==null&&(t.splice(i,3),i-=3,rf(p,{pending:!0,data:h,method:a.method,action:o},o,h))}}))}function Ks(t){function i(I){return su(I,t)}Ai!==null&&su(Ai,t),Ti!==null&&su(Ti,t),ji!==null&&su(ji,t),hl.forEach(i),dl.forEach(i);for(var a=0;a<Ni.length;a++){var o=Ni[a];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Ni.length&&(a=Ni[0],a.blockedOn===null);)Py(a),a.blockedOn===null&&Ni.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var h=a[o],p=a[o+1],v=h[Pt]||null;if(typeof p=="function")v||Hy(a);else if(v){var _=null;if(p&&p.hasAttribute("formAction")){if(h=p,v=p[Pt]||null)_=v.formAction;else if(sh(h)!==null)continue}else _=v.action;typeof _=="function"?a[o+1]=_:(a.splice(o,3),o-=3),Hy(a)}}}function Iy(){function t(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(v){return h=v})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function lh(t){this._internalRoot=t}lu.prototype.render=lh.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(s(409));var a=i.current,o=zn();My(a,o,t,i,null,null)},lu.prototype.unmount=lh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;My(t.current,2,null,t,null,null),Ho(),i[jn]=null}};function lu(t){this._internalRoot=t}lu.prototype.unstable_scheduleHydration=function(t){if(t){var i=Ca();t={blockedOn:null,target:t,priority:i};for(var a=0;a<Ni.length&&i!==0&&i<Ni[a].priority;a++);Ni.splice(a,0,t),a===0&&Py(t)}};var Fy=n.version;if(Fy!=="19.2.4")throw Error(s(527,Fy,"19.2.4"));V.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=d(i),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var Yw={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ou.isDisabled&&ou.supportsFiber)try{Yt=ou.inject(Yw),ge=ou}catch{}}return gl.createRoot=function(t,i){if(!l(t))throw Error(s(299));var a=!1,o="",h=Kp,p=Qp,v=Zp;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(p=i.onCaughtError),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),i=Oy(t,1,!1,null,null,a,o,null,h,p,v,Iy),t[jn]=i.current,If(t),new lh(i)},gl.hydrateRoot=function(t,i,a){if(!l(t))throw Error(s(299));var o=!1,h="",p=Kp,v=Qp,_=Zp,I=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(_=a.onRecoverableError),a.formState!==void 0&&(I=a.formState)),i=Oy(t,1,!0,i,a??null,o,h,I,p,v,_,Iy),i.context=Ry(null),a=i.current,o=zn(),o=Or(o),h=pi(o),h.callback=null,gi(a,h,o),a=o,i.current.lanes=a,lr(i,a),wr(i),t[jn]=i.current,If(t),new lu(i)},gl.version="19.2.4",gl}var Wy;function nS(){if(Wy)return ch.exports;Wy=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(),ch.exports=tS(),ch.exports}var rS=nS();/**
50
+ * react-router v7.13.1
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var e0="popstate";function t0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function iS(e={}){function n(s,l){var d;let u=(d=l.state)==null?void 0:d.masked,{pathname:c,search:f,hash:m}=u||s.location;return Xh("",{pathname:c,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",u?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function r(s,l){return typeof l=="string"?l:Dl(l)}return aS(n,r,null,e)}function Bt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Cr(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function sS(){return Math.random().toString(36).substring(2,10)}function n0(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Xh(e,n,r=null,s,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?ba(n):n,state:r,key:n&&n.key||s||sS(),unstable_mask:l}}function Dl({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ba(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let s=e.indexOf("?");s>=0&&(n.search=e.substring(s),e=e.substring(0,s)),e&&(n.pathname=e)}return n}function aS(e,n,r,s={}){let{window:l=document.defaultView,v5Compat:u=!1}=s,c=l.history,f="POP",m=null,d=y();d==null&&(d=0,c.replaceState({...c.state,idx:d},""));function y(){return(c.state||{idx:null}).idx}function g(){f="POP";let B=y(),L=B==null?null:B-d;d=B,m&&m({action:f,location:D.location,delta:L})}function x(B,L){f="PUSH";let $=t0(B)?B:Xh(D.location,B,L);d=y()+1;let T=n0($,d),te=D.createHref($.unstable_mask||$);try{c.pushState(T,"",te)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;l.location.assign(te)}u&&m&&m({action:f,location:D.location,delta:1})}function w(B,L){f="REPLACE";let $=t0(B)?B:Xh(D.location,B,L);d=y();let T=n0($,d),te=D.createHref($.unstable_mask||$);c.replaceState(T,"",te),u&&m&&m({action:f,location:D.location,delta:0})}function k(B){return lS(B)}let D={get action(){return f},get location(){return e(l,c)},listen(B){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(e0,g),m=B,()=>{l.removeEventListener(e0,g),m=null}},createHref(B){return n(l,B)},createURL:k,encodeLocation(B){let L=k(B);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:x,replace:w,go(B){return c.go(B)}};return D}function lS(e,n=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),Bt(r,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Dl(e);return s=s.replace(/ $/,"%20"),!n&&s.startsWith("//")&&(s=r+s),new URL(s,r)}function Bb(e,n,r="/"){return oS(e,n,r,!1)}function oS(e,n,r,s){let l=typeof n=="string"?ba(n):n,u=Wr(l.pathname||"/",r);if(u==null)return null;let c=Pb(e);uS(c);let f=null;for(let m=0;f==null&&m<c.length;++m){let d=vS(u);f=bS(c[m],d,s)}return f}function Pb(e,n=[],r=[],s="",l=!1){let u=(c,f,m=l,d)=>{let y={relativePath:d===void 0?c.path||"":d,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(s)&&m)return;Bt(y.relativePath.startsWith(s),`Absolute route path "${y.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(s.length)}let g=kr([s,y.relativePath]),x=r.concat(y);c.children&&c.children.length>0&&(Bt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Pb(c.children,n,x,g,m)),!(c.path==null&&!c.index)&&n.push({path:g,score:gS(g,c.index),routesMeta:x})};return e.forEach((c,f)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))u(c,f);else for(let d of qb(c.path))u(c,f,!0,d)}),n}function qb(e){let n=e.split("/");if(n.length===0)return[];let[r,...s]=n,l=r.endsWith("?"),u=r.replace(/\?$/,"");if(s.length===0)return l?[u,""]:[u];let c=qb(s.join("/")),f=[];return f.push(...c.map(m=>m===""?u:[u,m].join("/"))),l&&f.push(...c),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function uS(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:yS(n.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}var cS=/^:[\w-]+$/,fS=3,hS=2,dS=1,mS=10,pS=-2,r0=e=>e==="*";function gS(e,n){let r=e.split("/"),s=r.length;return r.some(r0)&&(s+=pS),n&&(s+=hS),r.filter(l=>!r0(l)).reduce((l,u)=>l+(cS.test(u)?fS:u===""?dS:mS),s)}function yS(e,n){return e.length===n.length&&e.slice(0,-1).every((s,l)=>s===n[l])?e[e.length-1]-n[n.length-1]:0}function bS(e,n,r=!1){let{routesMeta:s}=e,l={},u="/",c=[];for(let f=0;f<s.length;++f){let m=s[f],d=f===s.length-1,y=u==="/"?n:n.slice(u.length)||"/",g=ku({path:m.relativePath,caseSensitive:m.caseSensitive,end:d},y),x=m.route;if(!g&&d&&r&&!s[s.length-1].route.index&&(g=ku({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),c.push({params:l,pathname:kr([u,g.pathname]),pathnameBase:ES(kr([u,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(u=kr([u,g.pathnameBase]))}return c}function ku(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,s]=xS(e.path,e.caseSensitive,e.end),l=n.match(r);if(!l)return null;let u=l[0],c=u.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:s.reduce((d,{paramName:y,isOptional:g},x)=>{if(y==="*"){let k=f[x]||"";c=u.slice(0,u.length-k.length).replace(/(.)\/+$/,"$1")}const w=f[x];return g&&!w?d[y]=void 0:d[y]=(w||"").replace(/%2F/g,"/"),d},{}),pathname:u,pathnameBase:c,pattern:e}}function xS(e,n=!1,r=!0){Cr(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 s=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,m,d,y)=>{if(s.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(d+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),s]}function vS(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Cr(!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 Wr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,s=e.charAt(r);return s&&s!=="/"?null:e.slice(r)||"/"}var wS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function SS(e,n="/"){let{pathname:r,search:s="",hash:l=""}=typeof e=="string"?ba(e):e,u;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?u=i0(r.substring(1),"/"):u=i0(r,n)):u=n,{pathname:u,search:kS(s),hash:CS(l)}}function i0(e,n){let r=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?r.length>1&&r.pop():l!=="."&&r.push(l)}),r.length>1?r.join("/"):"/"}function mh(e,n,r,s){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _S(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function Hb(e){let n=_S(e);return n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase)}function kd(e,n,r,s=!1){let l;typeof e=="string"?l=ba(e):(l={...e},Bt(!l.pathname||!l.pathname.includes("?"),mh("?","pathname","search",l)),Bt(!l.pathname||!l.pathname.includes("#"),mh("#","pathname","hash",l)),Bt(!l.search||!l.search.includes("#"),mh("#","search","hash",l)));let u=e===""||l.pathname==="",c=u?"/":l.pathname,f;if(c==null)f=r;else{let g=n.length-1;if(!s&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;l.pathname=x.join("/")}f=g>=0?n[g]:"/"}let m=SS(l,f),d=c&&c!=="/"&&c.endsWith("/"),y=(u||c===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(d||y)&&(m.pathname+="/"),m}var kr=e=>e.join("/").replace(/\/\/+/g,"/"),ES=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),kS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,CS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,AS=class{constructor(e,n,r,s=!1){this.status=e,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function TS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function jS(e){return e.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ib=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Fb(e,n){let r=e;if(typeof r!="string"||!wS.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let s=r,l=!1;if(Ib)try{let u=new URL(window.location.href),c=r.startsWith("//")?new URL(u.protocol+r):new URL(r),f=Wr(c.pathname,n);c.origin===u.origin&&f!=null?r=f+c.search+c.hash:l=!0}catch{Cr(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:l,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var $b=["POST","PUT","PATCH","DELETE"];new Set($b);var NS=["GET",...$b];new Set(NS);var xa=N.createContext(null);xa.displayName="DataRouter";var Iu=N.createContext(null);Iu.displayName="DataRouterState";var OS=N.createContext(!1),Yb=N.createContext({isTransitioning:!1});Yb.displayName="ViewTransition";var RS=N.createContext(new Map);RS.displayName="Fetchers";var MS=N.createContext(null);MS.displayName="Await";var sr=N.createContext(null);sr.displayName="Navigation";var Hl=N.createContext(null);Hl.displayName="Location";var Ar=N.createContext({outlet:null,matches:[],isDataRoute:!1});Ar.displayName="Route";var Cd=N.createContext(null);Cd.displayName="RouteError";var Gb="REACT_ROUTER_ERROR",DS="REDIRECT",LS="ROUTE_ERROR_RESPONSE";function zS(e){if(e.startsWith(`${Gb}:${DS}:{`))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 US(e){if(e.startsWith(`${Gb}:${LS}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new AS(n.status,n.statusText,n.data)}catch{}}function BS(e,{relative:n}={}){Bt(Il(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:s}=N.useContext(sr),{hash:l,pathname:u,search:c}=Fl(e,{relative:n}),f=u;return r!=="/"&&(f=u==="/"?r:kr([r,u])),s.createHref({pathname:f,search:c,hash:l})}function Il(){return N.useContext(Hl)!=null}function Tr(){return Bt(Il(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(Hl).location}var Vb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jb(e){N.useContext(sr).static||N.useLayoutEffect(e)}function ti(){let{isDataRoute:e}=N.useContext(Ar);return e?ZS():PS()}function PS(){Bt(Il(),"useNavigate() may be used only in the context of a <Router> component.");let e=N.useContext(xa),{basename:n,navigator:r}=N.useContext(sr),{matches:s}=N.useContext(Ar),{pathname:l}=Tr(),u=JSON.stringify(Hb(s)),c=N.useRef(!1);return Jb(()=>{c.current=!0}),N.useCallback((m,d={})=>{if(Cr(c.current,Vb),!c.current)return;if(typeof m=="number"){r.go(m);return}let y=kd(m,JSON.parse(u),l,d.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:kr([n,y.pathname])),(d.replace?r.replace:r.push)(y,d.state,d)},[n,r,u,l,e])}N.createContext(null);function qS(){let{matches:e}=N.useContext(Ar),n=e[e.length-1];return n?n.params:{}}function Fl(e,{relative:n}={}){let{matches:r}=N.useContext(Ar),{pathname:s}=Tr(),l=JSON.stringify(Hb(r));return N.useMemo(()=>kd(e,JSON.parse(l),s,n==="path"),[e,l,s,n])}function HS(e,n){return Xb(e,n)}function Xb(e,n,r){var B;Bt(Il(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=N.useContext(sr),{matches:l}=N.useContext(Ar),u=l[l.length-1],c=u?u.params:{},f=u?u.pathname:"/",m=u?u.pathnameBase:"/",d=u&&u.route;{let L=d&&d.path||"";Qb(f,!d||L.endsWith("*")||L.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${L}">) 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.
59
+
60
+ Please change the parent <Route path="${L}"> to <Route path="${L==="/"?"*":`${L}/*`}">.`)}let y=Tr(),g;if(n){let L=typeof n=="string"?ba(n):n;Bt(m==="/"||((B=L.pathname)==null?void 0:B.startsWith(m)),`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 "${m}" but pathname "${L.pathname}" was given in the \`location\` prop.`),g=L}else g=y;let x=g.pathname||"/",w=x;if(m!=="/"){let L=m.replace(/^\//,"").split("/");w="/"+x.replace(/^\//,"").split("/").slice(L.length).join("/")}let k=Bb(e,{pathname:w});Cr(d||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Cr(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 D=GS(k&&k.map(L=>Object.assign({},L,{params:Object.assign({},c,L.params),pathname:kr([m,s.encodeLocation?s.encodeLocation(L.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:L.pathname]),pathnameBase:L.pathnameBase==="/"?m:kr([m,s.encodeLocation?s.encodeLocation(L.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:L.pathnameBase])})),l,r);return n&&D?N.createElement(Hl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},D):D}function IS(){let e=QS(),n=TS(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:u},"ErrorBoundary")," or"," ",N.createElement("code",{style:u},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},n),r?N.createElement("pre",{style:l},r):null,c)}var FS=N.createElement(IS,null),Kb=class extends N.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 r=US(e.digest);r&&(e=r)}let n=e!==void 0?N.createElement(Ar.Provider,{value:this.props.routeContext},N.createElement(Cd.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?N.createElement($S,{error:e},n):n}};Kb.contextType=OS;var ph=new WeakMap;function $S({children:e,error:n}){let{basename:r}=N.useContext(sr);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=zS(n.digest);if(s){let l=ph.get(n);if(l)throw l;let u=Fb(s.location,r);if(Ib&&!ph.get(n))if(u.isExternal||s.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:s.replace}));throw ph.set(n,c),c}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function YS({routeContext:e,match:n,children:r}){let s=N.useContext(xa);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),N.createElement(Ar.Provider,{value:e},r)}function GS(e,n=[],r){let s=r==null?void 0:r.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(n.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let l=e,u=s==null?void 0:s.errors;if(u!=null){let y=l.findIndex(g=>g.route.id&&(u==null?void 0:u[g.route.id])!==void 0);Bt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let c=!1,f=-1;if(r&&s){c=s.renderFallback;for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:x,errors:w}=s,k=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||k){r.isStatic&&(c=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=r==null?void 0:r.onError,d=s&&m?(y,g)=>{var x,w;m(y,{location:s.location,params:((w=(x=s.matches)==null?void 0:x[0])==null?void 0:w.params)??{},unstable_pattern:jS(s.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,x)=>{let w,k=!1,D=null,B=null;s&&(w=u&&g.route.id?u[g.route.id]:void 0,D=g.route.errorElement||FS,c&&(f<0&&x===0?(Qb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,B=null):f===x&&(k=!0,B=g.route.hydrateFallbackElement||null)));let L=n.concat(l.slice(0,x+1)),$=()=>{let T;return w?T=D:k?T=B:g.route.Component?T=N.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=y,N.createElement(YS,{match:g,routeContext:{outlet:y,matches:L,isDataRoute:s!=null},children:T})};return s&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?N.createElement(Kb,{location:s.location,revalidation:s.revalidation,component:D,error:w,children:$(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:d}):$()},null)}function Ad(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function VS(e){let n=N.useContext(xa);return Bt(n,Ad(e)),n}function JS(e){let n=N.useContext(Iu);return Bt(n,Ad(e)),n}function XS(e){let n=N.useContext(Ar);return Bt(n,Ad(e)),n}function Td(e){let n=XS(e),r=n.matches[n.matches.length-1];return Bt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function KS(){return Td("useRouteId")}function QS(){var s;let e=N.useContext(Cd),n=JS("useRouteError"),r=Td("useRouteError");return e!==void 0?e:(s=n.errors)==null?void 0:s[r]}function ZS(){let{router:e}=VS("useNavigate"),n=Td("useNavigate"),r=N.useRef(!1);return Jb(()=>{r.current=!0}),N.useCallback(async(l,u={})=>{Cr(r.current,Vb),r.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:n,...u}))},[e,n])}var s0={};function Qb(e,n,r){!n&&!s0[e]&&(s0[e]=!0,Cr(!1,r))}N.memo(WS);function WS({routes:e,future:n,state:r,isStatic:s,onError:l}){return Xb(e,void 0,{state:r,isStatic:s,onError:l})}function Mi(e){Bt(!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 e_({basename:e="/",children:n=null,location:r,navigationType:s="POP",navigator:l,static:u=!1,unstable_useTransitions:c}){Bt(!Il(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=N.useMemo(()=>({basename:f,navigator:l,static:u,unstable_useTransitions:c,future:{}}),[f,l,u,c]);typeof r=="string"&&(r=ba(r));let{pathname:d="/",search:y="",hash:g="",state:x=null,key:w="default",unstable_mask:k}=r,D=N.useMemo(()=>{let B=Wr(d,f);return B==null?null:{location:{pathname:B,search:y,hash:g,state:x,key:w,unstable_mask:k},navigationType:s}},[f,d,y,g,x,w,s,k]);return Cr(D!=null,`<Router basename="${f}"> is not able to match the URL "${d}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),D==null?null:N.createElement(sr.Provider,{value:m},N.createElement(Hl.Provider,{children:n,value:D}))}function t_({children:e,location:n}){return HS(Kh(e),n)}function Kh(e,n=[]){let r=[];return N.Children.forEach(e,(s,l)=>{if(!N.isValidElement(s))return;let u=[...n,l];if(s.type===N.Fragment){r.push.apply(r,Kh(s.props.children,u));return}Bt(s.type===Mi,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Bt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let c={id:s.props.id||u.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(c.children=Kh(s.props.children,u)),r.push(c)}),r}var vu="get",wu="application/x-www-form-urlencoded";function Fu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function n_(e){return Fu(e)&&e.tagName.toLowerCase()==="button"}function r_(e){return Fu(e)&&e.tagName.toLowerCase()==="form"}function i_(e){return Fu(e)&&e.tagName.toLowerCase()==="input"}function s_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function a_(e,n){return e.button===0&&(!n||n==="_self")&&!s_(e)}var uu=null;function l_(){if(uu===null)try{new FormData(document.createElement("form"),0),uu=!1}catch{uu=!0}return uu}var o_=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function gh(e){return e!=null&&!o_.has(e)?(Cr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wu}"`),null):e}function u_(e,n){let r,s,l,u,c;if(r_(e)){let f=e.getAttribute("action");s=f?Wr(f,n):null,r=e.getAttribute("method")||vu,l=gh(e.getAttribute("enctype"))||wu,u=new FormData(e)}else if(n_(e)||i_(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(s=m?Wr(m,n):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||vu,l=gh(e.getAttribute("formenctype"))||gh(f.getAttribute("enctype"))||wu,u=new FormData(f,e),!l_()){let{name:d,type:y,value:g}=e;if(y==="image"){let x=d?`${d}.`:"";u.append(`${x}x`,"0"),u.append(`${x}y`,"0")}else d&&u.append(d,g)}}else{if(Fu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=vu,s=null,l=wu,c=e}return u&&l==="text/plain"&&(c=u,u=void 0),{action:s,method:r.toLowerCase(),encType:l,formData:u,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function jd(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function c_(e,n,r,s){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${s}`:l.pathname=`${l.pathname}.${s}`:l.pathname==="/"?l.pathname=`_root.${s}`:n&&Wr(l.pathname,n)==="/"?l.pathname=`${n.replace(/\/$/,"")}/_root.${s}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${s}`,l}async function f_(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function h_(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 d_(e,n,r){let s=await Promise.all(e.map(async l=>{let u=n.routes[l.route.id];if(u){let c=await f_(u,r);return c.links?c.links():[]}return[]}));return y_(s.flat(1).filter(h_).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function a0(e,n,r,s,l,u){let c=(m,d)=>r[d]?m.route.id!==r[d].route.id:!0,f=(m,d)=>{var y;return r[d].pathname!==m.pathname||((y=r[d].route.path)==null?void 0:y.endsWith("*"))&&r[d].params["*"]!==m.params["*"]};return u==="assets"?n.filter((m,d)=>c(m,d)||f(m,d)):u==="data"?n.filter((m,d)=>{var g;let y=s.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(c(m,d)||f(m,d))return!0;if(m.route.shouldRevalidate){let x=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((g=r[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function m_(e,n,{includeHydrateFallback:r}={}){return p_(e.map(s=>{let l=n.routes[s.route.id];if(!l)return[];let u=[l.module];return l.clientActionModule&&(u=u.concat(l.clientActionModule)),l.clientLoaderModule&&(u=u.concat(l.clientLoaderModule)),r&&l.hydrateFallbackModule&&(u=u.concat(l.hydrateFallbackModule)),l.imports&&(u=u.concat(l.imports)),u}).flat(1))}function p_(e){return[...new Set(e)]}function g_(e){let n={},r=Object.keys(e).sort();for(let s of r)n[s]=e[s];return n}function y_(e,n){let r=new Set;return new Set(n),e.reduce((s,l)=>{let u=JSON.stringify(g_(l));return r.has(u)||(r.add(u),s.push({key:u,link:l})),s},[])}function Zb(){let e=N.useContext(xa);return jd(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function b_(){let e=N.useContext(Iu);return jd(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Nd=N.createContext(void 0);Nd.displayName="FrameworkContext";function Wb(){let e=N.useContext(Nd);return jd(e,"You must render this element inside a <HydratedRouter> element"),e}function x_(e,n){let r=N.useContext(Nd),[s,l]=N.useState(!1),[u,c]=N.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:d,onMouseLeave:y,onTouchStart:g}=n,x=N.useRef(null);N.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let D=L=>{L.forEach($=>{c($.isIntersecting)})},B=new IntersectionObserver(D,{threshold:.5});return x.current&&B.observe(x.current),()=>{B.disconnect()}}},[e]),N.useEffect(()=>{if(s){let D=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(D)}}},[s]);let w=()=>{l(!0)},k=()=>{l(!1),c(!1)};return r?e!=="intent"?[u,x,{}]:[u,x,{onFocus:yl(f,w),onBlur:yl(m,k),onMouseEnter:yl(d,w),onMouseLeave:yl(y,k),onTouchStart:yl(g,w)}]:[!1,x,{}]}function yl(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function v_({page:e,...n}){let{router:r}=Zb(),s=N.useMemo(()=>Bb(r.routes,e,r.basename),[r.routes,e,r.basename]);return s?N.createElement(S_,{page:e,matches:s,...n}):null}function w_(e){let{manifest:n,routeModules:r}=Wb(),[s,l]=N.useState([]);return N.useEffect(()=>{let u=!1;return d_(e,n,r).then(c=>{u||l(c)}),()=>{u=!0}},[e,n,r]),s}function S_({page:e,matches:n,...r}){let s=Tr(),{future:l,manifest:u,routeModules:c}=Wb(),{basename:f}=Zb(),{loaderData:m,matches:d}=b_(),y=N.useMemo(()=>a0(e,n,d,u,s,"data"),[e,n,d,u,s]),g=N.useMemo(()=>a0(e,n,d,u,s,"assets"),[e,n,d,u,s]),x=N.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let D=new Set,B=!1;if(n.forEach($=>{var te;let T=u.routes[$.route.id];!T||!T.hasLoader||(!y.some(P=>P.route.id===$.route.id)&&$.route.id in m&&((te=c[$.route.id])!=null&&te.shouldRevalidate)||T.hasClientLoader?B=!0:D.add($.route.id))}),D.size===0)return[];let L=c_(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return B&&D.size>0&&L.searchParams.set("_routes",n.filter($=>D.has($.route.id)).map($=>$.route.id).join(",")),[L.pathname+L.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,s,u,y,n,e,c]),w=N.useMemo(()=>m_(g,u),[g,u]),k=w_(g);return N.createElement(N.Fragment,null,x.map(D=>N.createElement("link",{key:D,rel:"prefetch",as:"fetch",href:D,...r})),w.map(D=>N.createElement("link",{key:D,rel:"modulepreload",href:D,...r})),k.map(({key:D,link:B})=>N.createElement("link",{key:D,nonce:r.nonce,...B,crossOrigin:B.crossOrigin??r.crossOrigin})))}function __(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var E_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{E_&&(window.__reactRouterVersion="7.13.1")}catch{}function k_({basename:e,children:n,unstable_useTransitions:r,window:s}){let l=N.useRef();l.current==null&&(l.current=iS({window:s,v5Compat:!0}));let u=l.current,[c,f]=N.useState({action:u.action,location:u.location}),m=N.useCallback(d=>{r===!1?f(d):N.startTransition(()=>f(d))},[r]);return N.useLayoutEffect(()=>u.listen(m),[u,m]),N.createElement(e_,{basename:e,children:n,location:c.location,navigationType:c.action,navigator:u,unstable_useTransitions:r})}var ex=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tx=N.forwardRef(function({onClick:n,discover:r="render",prefetch:s="none",relative:l,reloadDocument:u,replace:c,unstable_mask:f,state:m,target:d,to:y,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:w,...k},D){let{basename:B,navigator:L,unstable_useTransitions:$}=N.useContext(sr),T=typeof y=="string"&&ex.test(y),te=Fb(y,B);y=te.to;let P=BS(y,{relative:l}),z=Tr(),X=null;if(f){let F=kd(f,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);B!=="/"&&(F.pathname=F.pathname==="/"?B:kr([B,F.pathname])),X=L.createHref(F)}let[Z,H,O]=x_(s,k),K=j_(y,{replace:c,unstable_mask:f,state:m,target:d,preventScrollReset:g,relative:l,viewTransition:x,unstable_defaultShouldRevalidate:w,unstable_useTransitions:$});function J(F){n&&n(F),F.defaultPrevented||K(F)}let se=!(te.isExternal||u),ie=N.createElement("a",{...k,...O,href:(se?X:void 0)||te.absoluteURL||P,onClick:se?J:n,ref:__(D,H),target:d,"data-discover":!T&&r==="render"?"true":void 0});return Z&&!T?N.createElement(N.Fragment,null,ie,N.createElement(v_,{page:P})):ie});tx.displayName="Link";var C_=N.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:s="",end:l=!1,style:u,to:c,viewTransition:f,children:m,...d},y){let g=Fl(c,{relative:d.relative}),x=Tr(),w=N.useContext(Iu),{navigator:k,basename:D}=N.useContext(sr),B=w!=null&&D_(g)&&f===!0,L=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,$=x.pathname,T=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;r||($=$.toLowerCase(),T=T?T.toLowerCase():null,L=L.toLowerCase()),T&&D&&(T=Wr(T,D)||T);const te=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let P=$===L||!l&&$.startsWith(L)&&$.charAt(te)==="/",z=T!=null&&(T===L||!l&&T.startsWith(L)&&T.charAt(L.length)==="/"),X={isActive:P,isPending:z,isTransitioning:B},Z=P?n:void 0,H;typeof s=="function"?H=s(X):H=[s,P?"active":null,z?"pending":null,B?"transitioning":null].filter(Boolean).join(" ");let O=typeof u=="function"?u(X):u;return N.createElement(tx,{...d,"aria-current":Z,className:H,ref:y,style:O,to:c,viewTransition:f},typeof m=="function"?m(X):m)});C_.displayName="NavLink";var A_=N.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:s,replace:l,state:u,method:c=vu,action:f,onSubmit:m,relative:d,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x,...w},k)=>{let{unstable_useTransitions:D}=N.useContext(sr),B=R_(),L=M_(f,{relative:d}),$=c.toLowerCase()==="get"?"get":"post",T=typeof f=="string"&&ex.test(f),te=P=>{if(m&&m(P),P.defaultPrevented)return;P.preventDefault();let z=P.nativeEvent.submitter,X=(z==null?void 0:z.getAttribute("formmethod"))||c,Z=()=>B(z||P.currentTarget,{fetcherKey:n,method:X,navigate:r,replace:l,state:u,relative:d,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x});D&&r!==!1?N.startTransition(()=>Z()):Z()};return N.createElement("form",{ref:k,method:$,action:L,onSubmit:s?m:te,...w,"data-discover":!T&&e==="render"?"true":void 0})});A_.displayName="Form";function T_(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nx(e){let n=N.useContext(xa);return Bt(n,T_(e)),n}function j_(e,{target:n,replace:r,unstable_mask:s,state:l,preventScrollReset:u,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:d}={}){let y=ti(),g=Tr(),x=Fl(e,{relative:c});return N.useCallback(w=>{if(a_(w,n)){w.preventDefault();let k=r!==void 0?r:Dl(g)===Dl(x),D=()=>y(e,{replace:k,unstable_mask:s,state:l,preventScrollReset:u,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m});d?N.startTransition(()=>D()):D()}},[g,y,x,r,s,l,n,e,u,c,f,m,d])}var N_=0,O_=()=>`__${String(++N_)}__`;function R_(){let{router:e}=nx("useSubmit"),{basename:n}=N.useContext(sr),r=KS(),s=e.fetch,l=e.navigate;return N.useCallback(async(u,c={})=>{let{action:f,method:m,encType:d,formData:y,body:g}=u_(u,n);if(c.navigate===!1){let x=c.fetcherKey||O_();await s(x,r,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||d,flushSync:c.flushSync})}else await l(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||d,replace:c.replace,state:c.state,fromRouteId:r,flushSync:c.flushSync,viewTransition:c.viewTransition})},[s,l,n,r])}function M_(e,{relative:n}={}){let{basename:r}=N.useContext(sr),s=N.useContext(Ar);Bt(s,"useFormAction must be used inside a RouteContext");let[l]=s.matches.slice(-1),u={...Fl(e||".",{relative:n})},c=Tr();if(e==null){u.search=c.search;let f=new URLSearchParams(u.search),m=f.getAll("index");if(m.some(y=>y==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();u.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(u.pathname=u.pathname==="/"?r:kr([r,u.pathname])),Dl(u)}function D_(e,{relative:n}={}){let r=N.useContext(Yb);Bt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=nx("useViewTransitionState"),l=Fl(e,{relative:n});if(!r.isTransitioning)return!1;let u=Wr(r.currentLocation.pathname,s)||r.currentLocation.pathname,c=Wr(r.nextLocation.pathname,s)||r.nextLocation.pathname;return ku(l.pathname,c)!=null||ku(l.pathname,u)!=null}var ha=Ub();const rx=N.createContext(null),ix="palmier_paired_hosts",Qh="palmier_active_host";function yh(){try{const e=localStorage.getItem(ix);if(e)return JSON.parse(e)}catch{}return[]}function L_(e){localStorage.setItem(ix,JSON.stringify(e))}function z_(){return localStorage.getItem(Qh)}function U_(e){e?localStorage.setItem(Qh,e):localStorage.removeItem(Qh)}const B_=!!window.__PALMIER_SERVE__&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function P_({children:e}){const[n,r]=N.useState(yh),[s,l]=N.useState(()=>{const y=z_(),g=yh();return y&&g.some(x=>x.hostId===y)?y:g.length>0?g[0].hostId:null});N.useEffect(()=>{if(!B_)return;const y="local";if(!yh().find(x=>x.hostId===y)){const x={hostId:y,clientToken:"",directUrl:window.location.origin};r(w=>[...w.filter(k=>k.hostId!==y),x]),l(y)}},[]),N.useEffect(()=>{L_(n)},[n]),N.useEffect(()=>{U_(s)},[s]);const u=N.useCallback(y=>{r(g=>[...g.filter(w=>w.hostId!==y.hostId),y]),l(y.hostId)},[]),c=N.useCallback(y=>{r(g=>g.filter(x=>x.hostId!==y)),l(g=>g!==y?g:null)},[]);N.useEffect(()=>{var y;s!==null&&!n.find(g=>g.hostId===s)?l(((y=n[0])==null?void 0:y.hostId)??null):s===null&&n.length>0&&l(n[0].hostId)},[n,s]);const f=N.useCallback((y,g)=>{r(x=>x.map(w=>w.hostId===y?{...w,name:g}:w))},[]),m=N.useCallback(y=>{l(y)},[]),d=N.useCallback(()=>n.find(y=>y.hostId===s)??null,[n,s]);return b.jsx(rx.Provider,{value:{pairedHosts:n,activeHostId:s,addPairedHost:u,removePairedHost:c,renamePairedHost:f,setActiveHostId:m,getActiveHost:d},children:e})}function va(){const e=N.useContext(rx);if(!e)throw new Error("useHostStore must be used within HostStoreProvider");return e}const Fn=new Uint8Array(0),qi=new TextEncoder,qn=new TextDecoder;function q_(...e){let n=0;for(let l=0;l<e.length;l++)n+=e[l].length;const r=new Uint8Array(n);let s=0;for(let l=0;l<e.length;l++)r.set(e[l],s),s+=e[l].length;return r}function Al(...e){const n=[];for(let r=0;r<e.length;r++)n.push(qi.encode(e[r]));return n.length===0?Fn:n.length===1?n[0]:q_(...n)}function l0(e){return!e||e.length===0?"":qn.decode(e)}const o0="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",u0=36,H_=0xcfd41b9100000,c0=33,I_=333,f0=22;function F_(e){for(let n=0;n<e.length;n++)e[n]=Math.floor(Math.random()*255)}function $_(e){var n;(n=globalThis==null?void 0:globalThis.crypto)!=null&&n.getRandomValues?globalThis.crypto.getRandomValues(e):F_(e)}class Y_{constructor(){C(this,"buf");C(this,"seq");C(this,"inc");C(this,"inited");this.buf=new Uint8Array(f0),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){this.seq=Math.floor(Math.random()*H_),this.inc=Math.floor(Math.random()*(I_-c0)+c0)}setPre(){const n=new Uint8Array(12);$_(n);for(let r=0;r<12;r++){const s=n[r]%36;this.buf[r]=o0.charCodeAt(s)}}fillSeq(){let n=this.seq;for(let r=f0-1;r>=12;r--)this.buf[r]=o0.charCodeAt(n%u0),n=Math.floor(n/u0)}next(){return this.inited||this.init(),this.seq+=this.inc,this.seq>0xcfd41b9100000&&(this.setPre(),this.initSeqAndInc()),this.fillSeq(),String.fromCharCode.apply(String,this.buf)}reset(){this.init()}}const Bi=new Y_;var Kr;(function(e){e.Disconnect="disconnect",e.Reconnect="reconnect",e.Update="update",e.LDM="ldm",e.Error="error"})(Kr||(Kr={}));var sa;(function(e){e.Reconnecting="reconnecting",e.PingTimer="pingTimer",e.StaleConnection="staleConnection",e.ClientInitiatedReconnect="client initiated reconnect"})(sa||(sa={}));var Ee;(function(e){e.ApiError="BAD API",e.BadAuthentication="BAD_AUTHENTICATION",e.BadCreds="BAD_CREDS",e.BadHeader="BAD_HEADER",e.BadJson="BAD_JSON",e.BadPayload="BAD_PAYLOAD",e.BadSubject="BAD_SUBJECT",e.Cancelled="CANCELLED",e.ConnectionClosed="CONNECTION_CLOSED",e.ConnectionDraining="CONNECTION_DRAINING",e.ConnectionRefused="CONNECTION_REFUSED",e.ConnectionTimeout="CONNECTION_TIMEOUT",e.Disconnect="DISCONNECT",e.InvalidOption="INVALID_OPTION",e.InvalidPayload="INVALID_PAYLOAD",e.MaxPayloadExceeded="MAX_PAYLOAD_EXCEEDED",e.NoResponders="503",e.NotFunction="NOT_FUNC",e.RequestError="REQUEST_ERROR",e.ServerOptionNotAvailable="SERVER_OPT_NA",e.SubClosed="SUB_CLOSED",e.SubDraining="SUB_DRAINING",e.Timeout="TIMEOUT",e.Tls="TLS",e.Unknown="UNKNOWN_ERROR",e.WssRequired="WSS_REQUIRED",e.JetStreamInvalidAck="JESTREAM_INVALID_ACK",e.JetStream404NoMessages="404",e.JetStream408RequestTimeout="408",e.JetStream409MaxAckPendingExceeded="409",e.JetStream409="409",e.JetStreamNotEnabled="503",e.JetStreamIdleHeartBeat="IDLE_HEARTBEAT",e.AuthorizationViolation="AUTHORIZATION_VIOLATION",e.AuthenticationExpired="AUTHENTICATION_EXPIRED",e.ProtocolError="NATS_PROTOCOL_ERR",e.PermissionsViolation="PERMISSIONS_VIOLATION",e.AuthenticationTimeout="AUTHENTICATION_TIMEOUT",e.AccountExpired="ACCOUNT_EXPIRED"})(Ee||(Ee={}));function G_(e){return typeof e.code=="string"}class sx{constructor(){C(this,"messages");this.messages=new Map,this.messages.set(Ee.InvalidPayload,"Invalid payload type - payloads can be 'binary', 'string', or 'json'"),this.messages.set(Ee.BadJson,"Bad JSON"),this.messages.set(Ee.WssRequired,"TLS is required, therefore a secure websocket connection is also required")}static getMessage(n){return V_.getMessage(n)}getMessage(n){return this.messages.get(n)||n}}const V_=new sx;class je extends Error{constructor(r,s,l){super(r);C(this,"name");C(this,"message");C(this,"code");C(this,"permissionContext");C(this,"chainedError");C(this,"api_error");this.name="NatsError",this.message=r,this.code=s,this.chainedError=l}static errorForCode(r,s){const l=sx.getMessage(r);return new je(l,r,s)}isAuthError(){return this.code===Ee.AuthenticationExpired||this.code===Ee.AuthorizationViolation||this.code===Ee.AccountExpired}isAuthTimeout(){return this.code===Ee.AuthenticationTimeout}isPermissionError(){return this.code===Ee.PermissionsViolation}isProtocolError(){return this.code===Ee.ProtocolError}isJetStreamError(){return this.api_error!==void 0}jsError(){return this.api_error?this.api_error:null}}var Bn;(function(e){e[e.Exact=0]="Exact",e[e.CanonicalMIME=1]="CanonicalMIME",e[e.IgnoreCase=2]="IgnoreCase"})(Bn||(Bn={}));var dr;(function(e){e.Timer="timer",e.Count="count",e.JitterTimer="jitterTimer",e.SentinelMsg="sentinelMsg"})(dr||(dr={}));var Tl;(function(e){e.STATS="io.nats.micro.v1.stats_response",e.INFO="io.nats.micro.v1.info_response",e.PING="io.nats.micro.v1.ping_response"})(Tl||(Tl={}));const Cu="Nats-Service-Error",Au="Nats-Service-Error-Code";class Tu extends Error{constructor(r,s){super(s);C(this,"code");this.code=r}static isServiceError(r){return Tu.toServiceError(r)!==null}static toServiceError(r){var l,u;const s=((l=r==null?void 0:r.headers)==null?void 0:l.get(Au))||"";if(s!==""){const c=parseInt(s)||400,f=((u=r==null?void 0:r.headers)==null?void 0:u.get(Cu))||"";return new Tu(c,f.length?f:s)}return null}}function Zr(e=""){if(e=e||"_INBOX",typeof e!="string")throw new Error("prefix must be a string");return e.split(".").forEach(n=>{if(n==="*"||n===">")throw new Error(`inbox prefixes cannot have wildcards '${e}'`)}),`${e}.${Bi.next()}`}const Zh="127.0.0.1";var Li;(function(e){e.PING="PING",e.STATS="STATS",e.INFO="INFO"})(Li||(Li={}));function $u(e,...n){for(let r=0;r<n.length;r++){const s=n[r];Object.keys(s).forEach(function(l){e[l]=s[l]})}return e}function cu(e){return qn.decode(e).replace(/\n/g,"␊").replace(/\r/g,"␍")}function da(e,n=!0){const r=n?je.errorForCode(Ee.Timeout):null;let s,l;const u=new Promise((c,f)=>{s={cancel:()=>{l&&clearTimeout(l)}},l=setTimeout(()=>{f(r===null?je.errorForCode(Ee.Timeout):r)},e)});return Object.assign(u,s)}function wa(e=0){let n;const r=new Promise(s=>{const l=setTimeout(()=>{s()},e);n={cancel:()=>{l&&clearTimeout(l)}}});return Object.assign(r,n)}function zt(){let e={};const n=new Promise((r,s)=>{e={resolve:r,reject:s}});return Object.assign(n,e)}function ax(e){for(let n=e.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[e[n],e[r]]=[e[r],e[n]]}return e}function J_(e){return e===0?0:Math.floor(e/2+Math.random()*e)}function Od(e=[0,250,250,500,500,3e3,5e3]){Array.isArray(e)||(e=[0,250,250,500,500,3e3,5e3]);const n=e.length-1;return{backoff(r){return J_(r>n?e[n]:e[r])}}}function Lt(e){return e*1e6}function Rd(e){return Math.floor(e/1e6)}function h0(e){let s=!0;const l=new Array(e.length);for(let u=0;u<e.length;u++){let c=e.charCodeAt(u);if(c===58||c<33||c>126)throw new je(`'${e[u]}' is not a valid character for a header key`,Ee.BadHeader);s&&97<=c&&c<=122?c-=32:!s&&65<=c&&c<=90&&(c+=32),l[u]=c,s=c==45}return String.fromCharCode(...l)}function ei(e=0,n=""){if(e===0&&n!==""||e>0&&n==="")throw new Error("setting status requires both code and description");return new zi(e,n)}const bh="NATS/1.0";class zi{constructor(n=0,r=""){C(this,"_code");C(this,"headers");C(this,"_description");this._code=n,this._description=r,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals(n){if(n&&this.headers.size===n.headers.size&&this._code===n._code){for(const[r,s]of this.headers){const l=n.values(r);if(s.length!==l.length)return!1;const u=[...s].sort(),c=[...l].sort();for(let f=0;f<u.length;f++)if(u[f]!==c[f])return!1}return!0}return!1}static decode(n){const r=new zi,l=qn.decode(n).split(`\r
61
+ `),u=l[0];if(u!==bh){let c=u.replace(bh,"").trim();if(c.length>0){r._code=parseInt(c,10),isNaN(r._code)&&(r._code=0);const f=r._code.toString();c=c.replace(f,""),r._description=c.trim()}}return l.length>=1&&l.slice(1).map(c=>{if(c){const f=c.indexOf(":");if(f>-1){const m=c.slice(0,f),d=c.slice(f+1).trim();r.append(m,d)}}}),r}toString(){if(this.headers.size===0&&this._code===0)return"";let n=bh;this._code>0&&this._description!==""&&(n+=` ${this._code} ${this._description}`);for(const[r,s]of this.headers)for(let l=0;l<s.length;l++)n=`${n}\r
62
+ ${r}: ${s[l]}`;return`${n}\r
63
+ \r
64
+ `}encode(){return qi.encode(this.toString())}static validHeaderValue(n){if(/[\r\n]/.test(n))throw new je("invalid header value - \\r and \\n are not allowed.",Ee.BadHeader);return n.trim()}keys(){const n=[];for(const r of this.headers.keys())n.push(r);return n}findKeys(n,r=Bn.Exact){const s=this.keys();switch(r){case Bn.Exact:return s.filter(l=>l===n);case Bn.CanonicalMIME:return n=h0(n),s.filter(l=>l===n);default:{const l=n.toLowerCase();return s.filter(u=>l===u.toLowerCase())}}}get(n,r=Bn.Exact){const s=this.findKeys(n,r);if(s.length){const l=this.headers.get(s[0]);if(l)return Array.isArray(l)?l[0]:l}return""}last(n,r=Bn.Exact){const s=this.findKeys(n,r);if(s.length){const l=this.headers.get(s[0]);if(l)return Array.isArray(l)?l[l.length-1]:l}return""}has(n,r=Bn.Exact){return this.findKeys(n,r).length>0}set(n,r,s=Bn.Exact){this.delete(n,s),this.append(n,r,s)}append(n,r,s=Bn.Exact){const l=h0(n);s===Bn.CanonicalMIME&&(n=l);const u=this.findKeys(n,s);n=u.length>0?u[0]:n;const c=zi.validHeaderValue(r);let f=this.headers.get(n);f||(f=[],this.headers.set(n,f)),f.push(c)}values(n,r=Bn.Exact){const s=[];return this.findKeys(n,r).forEach(u=>{const c=this.headers.get(u);c&&s.push(...c)}),s}delete(n,r=Bn.Exact){this.findKeys(n,r).forEach(l=>{this.headers.delete(l)})}get hasError(){return this._code>=300}get status(){return`${this._code} ${this._description}`.trim()}toRecord(){const n={};return this.keys().forEach(r=>{n[r]=this.values(r)}),n}get code(){return this._code}get description(){return this._description}static fromRecord(n){const r=new zi;for(const s in n)r.headers.set(s,n[s]);return r}}function ju(){return{encode(e){return qi.encode(e)},decode(e){return qn.decode(e)}}}function mr(e){return{encode(n){try{return n===void 0&&(n=null),qi.encode(JSON.stringify(n))}catch(r){throw je.errorForCode(Ee.BadJson,r)}},decode(n){try{return JSON.parse(qn.decode(n),e)}catch(r){throw je.errorForCode(Ee.BadJson,r)}}}}function lx(e){var n;return e&&e.data.length===0&&((n=e.headers)==null?void 0:n.code)===503?je.errorForCode(Ee.NoResponders):null}class Md{constructor(n,r,s){C(this,"_headers");C(this,"_msg");C(this,"_rdata");C(this,"_reply");C(this,"_subject");C(this,"publisher");this._msg=n,this._rdata=r,this.publisher=s}get subject(){return this._subject?this._subject:(this._subject=qn.decode(this._msg.subject),this._subject)}get reply(){return this._reply?this._reply:(this._reply=qn.decode(this._msg.reply),this._reply)}get sid(){return this._msg.sid}get headers(){if(this._msg.hdr>-1&&!this._headers){const n=this._rdata.subarray(0,this._msg.hdr);this._headers=zi.decode(n)}return this._headers}get data(){return this._rdata?this._msg.hdr>-1?this._rdata.subarray(this._msg.hdr):this._rdata:new Uint8Array(0)}respond(n=Fn,r){return this.reply?(this.publisher.publish(this.reply,n,r),!0):!1}size(){var l;const n=this._msg.subject.length,r=((l=this._msg.reply)==null?void 0:l.length)||0,s=this._msg.size===-1?0:this._msg.size;return n+r+s}json(n){return mr(n).decode(this.data)}string(){return qn.decode(this.data)}requestInfo(){var r;const n=(r=this.headers)==null?void 0:r.get("Nats-Request-Info");return n?JSON.parse(n,function(s,l){return(s==="start"||s==="stop")&&l!==""?new Date(Date.parse(l)):l}):null}}C(Md,"jc");function aa(e){return Yu("durable",e)}function dn(e){return Yu("stream",e)}function Yu(e,n=""){if(n==="")throw Error(`${e} name required`);return[".","*",">","/","\\"," "," ",`
65
+ `,"\r"].forEach(s=>{if(n.indexOf(s)!==-1){switch(s){case`
66
+ `:s="\\n";break;case"\r":s="\\r";break;case" ":s="\\t";break}throw Error(`invalid ${e} name - ${e} name cannot contain '${s}'`)}}),""}function kl(e,n=""){if(n==="")throw Error(`${e} name required`);const r=X_(n);if(r.length)throw new Error(`invalid ${e} name - ${e} name ${r}`)}function X_(e=""){if(e==="")throw Error("name required");const n=/^[-\w]+$/g;if(e.match(n)===null){for(const s of e.split(""))if(s.match(n)===null)return`cannot contain '${s}'`}return""}function Wh(e){if(e.data.length>0)return!1;const n=e.headers;return n?n.code>=100&&n.code<200:!1}function ed(e){var n;return Wh(e)&&((n=e.headers)==null?void 0:n.description)==="Idle Heartbeat"}function K_(e,n,r){const s=ei(e,n),l={hdr:1,sid:0,size:0},u=new Md(l,Fn,{});return u._headers=s,u._subject=r,u}function la(e){if(e.data.length!==0)return null;const n=e.headers;return n?ox(n.code,n.description):null}var rr;(function(e){e.MaxBatchExceeded="exceeded maxrequestbatch of",e.MaxExpiresExceeded="exceeded maxrequestexpires of",e.MaxBytesExceeded="exceeded maxrequestmaxbytes of",e.MaxMessageSizeExceeded="message size exceeds maxbytes",e.PushConsumer="consumer is push based",e.MaxWaitingExceeded="exceeded maxwaiting",e.IdleHeartbeatMissed="idle heartbeats missed",e.ConsumerDeleted="consumer deleted"})(rr||(rr={}));function Q_(e){return e.code!==Ee.JetStream409?!1:[rr.MaxBatchExceeded,rr.MaxExpiresExceeded,rr.MaxBytesExceeded,rr.MaxMessageSizeExceeded,rr.PushConsumer,rr.IdleHeartbeatMissed,rr.ConsumerDeleted].find(r=>e.message.indexOf(r)!==-1)!==void 0}function ox(e,n=""){if(e<300)return null;switch(n=n.toLowerCase(),e){case 404:return new je(n,Ee.JetStream404NoMessages);case 408:return new je(n,Ee.JetStream408RequestTimeout);case 409:{const r=n.startsWith(rr.IdleHeartbeatMissed)?Ee.JetStreamIdleHeartBeat:Ee.JetStream409;return new je(n,r)}case 503:return je.errorForCode(Ee.JetStreamNotEnabled,new Error(n));default:return n===""&&(n=Ee.Unknown),new je(n,`${e}`)}}class tn{constructor(){C(this,"inflight");C(this,"processed");C(this,"received");C(this,"noIterator");C(this,"iterClosed");C(this,"done");C(this,"signal");C(this,"yields");C(this,"filtered");C(this,"pendingFiltered");C(this,"ingestionFilterFn");C(this,"protocolFilterFn");C(this,"dispatchedFn");C(this,"ctx");C(this,"_data");C(this,"err");C(this,"time");C(this,"yielding");this.inflight=0,this.filtered=0,this.pendingFiltered=0,this.processed=0,this.received=0,this.noIterator=!1,this.done=!1,this.signal=zt(),this.yields=[],this.iterClosed=zt(),this.time=0,this.yielding=!1}[Symbol.asyncIterator](){return this.iterate()}push(n){if(this.done)return;if(typeof n=="function"){this.yields.push(n),this.signal.resolve();return}const{ingest:r,protocol:s}=this.ingestionFilterFn?this.ingestionFilterFn(n,this.ctx||this):{ingest:!0,protocol:!1};r&&(s&&(this.filtered++,this.pendingFiltered++),this.yields.push(n),this.signal.resolve())}async*iterate(){if(this.noIterator)throw new je("unsupported iterator",Ee.ApiError);if(this.yielding)throw new je("already yielding",Ee.ApiError);this.yielding=!0;try{for(;;){if(this.yields.length===0&&await this.signal,this.err)throw this.err;const n=this.yields;this.inflight=n.length,this.yields=[];for(let r=0;r<n.length;r++){if(typeof n[r]=="function"){const l=n[r];try{l()}catch(u){throw u}if(this.err)throw this.err;continue}if(this.protocolFilterFn?this.protocolFilterFn(n[r]):!0){this.processed++;const l=Date.now();yield n[r],this.time=Date.now()-l,this.dispatchedFn&&n[r]&&this.dispatchedFn(n[r])}else this.pendingFiltered--;this.inflight--}if(this.done)break;this.yields.length===0&&(n.length=0,this.yields=n,this.signal=zt())}}finally{this.stop()}}stop(n){this.done||(this.err=n,this.done=!0,this.signal.resolve(),this.iterClosed.resolve(n))}getProcessed(){return this.noIterator?this.received:this.processed}getPending(){return this.yields.length+this.inflight-this.pendingFiltered}getReceived(){return this.received-this.filtered}}class Dd{constructor(n,r,s={maxOut:2}){C(this,"interval");C(this,"maxOut");C(this,"cancelAfter");C(this,"timer");C(this,"autoCancelTimer");C(this,"last");C(this,"missed");C(this,"count");C(this,"callback");this.interval=n,this.maxOut=(s==null?void 0:s.maxOut)||2,this.cancelAfter=(s==null?void 0:s.cancelAfter)||0,this.last=Date.now(),this.missed=0,this.count=0,this.callback=r,this._schedule()}cancel(){this.autoCancelTimer&&clearTimeout(this.autoCancelTimer),this.timer&&clearInterval(this.timer),this.timer=0,this.autoCancelTimer=0,this.missed=0}work(){this.last=Date.now(),this.missed=0}_change(n,r=0,s=2){this.interval=n,this.maxOut=s,this.cancelAfter=r,this.restart()}restart(){this.cancel(),this._schedule()}_schedule(){this.cancelAfter>0&&(this.autoCancelTimer=setTimeout(()=>{this.cancel()},this.cancelAfter)),this.timer=setInterval(()=>{if(this.count++,Date.now()-this.last>this.interval&&this.missed++,this.missed>=this.maxOut)try{this.callback(this.missed)===!0&&this.cancel()}catch(n){console.log(n)}},this.interval)}}var td;(function(e){e.Limits="limits",e.Interest="interest",e.Workqueue="workqueue"})(td||(td={}));var Ll;(function(e){e.Old="old",e.New="new"})(Ll||(Ll={}));var nd;(function(e){e.File="file",e.Memory="memory"})(nd||(nd={}));var $t;(function(e){e.All="all",e.Last="last",e.New="new",e.StartSequence="by_start_sequence",e.StartTime="by_start_time",e.LastPerSubject="last_per_subject"})($t||($t={}));var en;(function(e){e.None="none",e.All="all",e.Explicit="explicit",e.NotSet=""})(en||(en={}));var ma;(function(e){e.Instant="instant",e.Original="original"})(ma||(ma={}));var Pi;(function(e){e.None="none",e.S2="s2"})(Pi||(Pi={}));var Nu;(function(e){e.CreateOrUpdate="",e.Update="update",e.Create="create"})(Nu||(Nu={}));function Z_(e,n={}){return Object.assign({name:e,deliver_policy:$t.All,ack_policy:en.Explicit,ack_wait:Lt(30*1e3),replay_policy:ma.Instant},n)}var d0;(function(e){e.API="api_audit",e.StreamAction="stream_action",e.ConsumerAction="consumer_action",e.SnapshotCreate="snapshot_create",e.SnapshotComplete="snapshot_complete",e.RestoreCreate="restore_create",e.RestoreComplete="restore_complete",e.MaxDeliver="max_deliver",e.Terminated="terminated",e.Ack="consumer_ack",e.StreamLeaderElected="stream_leader_elected",e.StreamQuorumLost="stream_quorum_lost",e.ConsumerLeaderElected="consumer_leader_elected",e.ConsumerQuorumLost="consumer_quorum_lost"})(d0||(d0={}));var yn;(function(e){e.StreamSourceHdr="Nats-Stream-Source",e.LastConsumerSeqHdr="Nats-Last-Consumer",e.LastStreamSeqHdr="Nats-Last-Stream",e.ConsumerStalledHdr="Nats-Consumer-Stalled",e.MessageSizeHdr="Nats-Msg-Size",e.RollupHdr="Nats-Rollup",e.RollupValueSubject="sub",e.RollupValueAll="all",e.PendingMessagesHdr="Nats-Pending-Messages",e.PendingBytesHdr="Nats-Pending-Bytes"})(yn||(yn={}));var hr;(function(e){e.LastValue="",e.AllHistory="history",e.UpdatesOnly="updates"})(hr||(hr={}));var ra;(function(e){e.Stream="Nats-Stream",e.Sequence="Nats-Sequence",e.TimeStamp="Nats-Time-Stamp",e.Subject="Nats-Subject"})(ra||(ra={}));var m0;(function(e){e.Stream="Nats-Stream",e.Subject="Nats-Subject",e.Sequence="Nats-Sequence",e.LastSequence="Nats-Last-Sequence",e.Size="Nats-Msg-Size"})(m0||(m0={}));const Pn="KV_";class W_{constructor(n){C(this,"config");C(this,"ordered");C(this,"mack");C(this,"stream");C(this,"callbackFn");C(this,"max");C(this,"qname");C(this,"isBind");C(this,"filters");this.stream="",this.mack=!1,this.ordered=!1,this.config=Z_("",n||{})}getOpts(){var r;const n={};if(n.config=Object.assign({},this.config),n.config.filter_subject&&(this.filterSubject(n.config.filter_subject),n.config.filter_subject=void 0),n.config.filter_subjects&&((r=n.config.filter_subjects)==null||r.forEach(s=>{this.filterSubject(s)}),n.config.filter_subjects=void 0),n.mack=this.mack,n.stream=this.stream,n.callbackFn=this.callbackFn,n.max=this.max,n.queue=this.qname,n.ordered=this.ordered,n.config.ack_policy=n.ordered?en.None:n.config.ack_policy,n.isBind=n.isBind||!1,this.filters)switch(this.filters.length){case 0:break;case 1:n.config.filter_subject=this.filters[0];break;default:n.config.filter_subjects=this.filters}return n}description(n){return this.config.description=n,this}deliverTo(n){return this.config.deliver_subject=n,this}durable(n){return aa(n),this.config.durable_name=n,this}startSequence(n){if(n<=0)throw new Error("sequence must be greater than 0");return this.config.deliver_policy=$t.StartSequence,this.config.opt_start_seq=n,this}startTime(n){return this.config.deliver_policy=$t.StartTime,this.config.opt_start_time=n.toISOString(),this}deliverAll(){return this.config.deliver_policy=$t.All,this}deliverLastPerSubject(){return this.config.deliver_policy=$t.LastPerSubject,this}deliverLast(){return this.config.deliver_policy=$t.Last,this}deliverNew(){return this.config.deliver_policy=$t.New,this}startAtTimeDelta(n){return this.startTime(new Date(Date.now()-n)),this}headersOnly(){return this.config.headers_only=!0,this}ackNone(){return this.config.ack_policy=en.None,this}ackAll(){return this.config.ack_policy=en.All,this}ackExplicit(){return this.config.ack_policy=en.Explicit,this}ackWait(n){return this.config.ack_wait=Lt(n),this}maxDeliver(n){return this.config.max_deliver=n,this}filterSubject(n){return this.filters=this.filters||[],this.filters.push(n),this}replayInstantly(){return this.config.replay_policy=ma.Instant,this}replayOriginal(){return this.config.replay_policy=ma.Original,this}sample(n){if(n=Math.trunc(n),n<0||n>100)throw new Error("value must be between 0-100");return this.config.sample_freq=`${n}%`,this}limit(n){return this.config.rate_limit_bps=n,this}maxWaiting(n){return this.config.max_waiting=n,this}maxAckPending(n){return this.config.max_ack_pending=n,this}idleHeartbeat(n){return this.config.idle_heartbeat=Lt(n),this}flowControl(){return this.config.flow_control=!0,this}deliverGroup(n){return this.queue(n),this}manualAck(){return this.mack=!0,this}maxMessages(n){return this.max=n,this}callback(n){return this.callbackFn=n,this}queue(n){return this.qname=n,this.config.deliver_group=n,this}orderedConsumer(){return this.ordered=!0,this}bind(n,r){return this.stream=n,this.config.durable_name=r,this.isBind=!0,this}bindStream(n){return this.stream=n,this}inactiveEphemeralThreshold(n){return this.config.inactive_threshold=Lt(n),this}maxPullBatch(n){return this.config.max_batch=n,this}maxPullRequestExpires(n){return this.config.max_expires=Lt(n),this}memory(){return this.config.mem_storage=!0,this}numReplicas(n){return this.config.num_replicas=n,this}consumerName(n){return this.config.name=n,this}}function Ui(e){return new W_(e)}function p0(e){return typeof e.getOpts=="function"}class e2{static encode(n){if(typeof n=="string")return btoa(n);const r=Array.from(n);return btoa(String.fromCharCode(...r))}static decode(n,r=!1){const s=atob(n);return r?Uint8Array.from(s,l=>l.charCodeAt(0)):s}}class oa{static encode(n){return oa.toB64URLEncoding(e2.encode(n))}static decode(n,r=!1){return oa.decode(oa.fromB64URLEncoding(n),r)}static toB64URLEncoding(n){return n.replace(/\+/g,"-").replace(/\//g,"_")}static fromB64URLEncoding(n){return n.replace(/_/g,"/").replace(/-/g,"+")}}class pa{constructor(){C(this,"buffers");C(this,"byteLength");this.buffers=[],this.byteLength=0}static concat(...n){let r=0;for(let u=0;u<n.length;u++)r+=n[u].length;const s=new Uint8Array(r);let l=0;for(let u=0;u<n.length;u++)s.set(n[u],l),l+=n[u].length;return s}static fromAscii(n){return n||(n=""),qi.encode(n)}static toAscii(n){return qn.decode(n)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){const n=new Uint8Array(this.byteLength);let r=0;for(let s=0;s<this.buffers.length;s++)n.set(this.buffers[s],r),r+=this.buffers[s].length;this.buffers.length=0,this.buffers.push(n)}}shift(){if(this.buffers.length){const n=this.buffers.shift();if(n)return this.byteLength-=n.length,n}return new Uint8Array(0)}drain(n){if(this.buffers.length){this.pack();const r=this.buffers.pop();if(r){const s=this.byteLength;(n===void 0||n>s)&&(n=s);const l=r.subarray(0,n);return s>n&&this.buffers.push(r.subarray(n)),this.byteLength=s-n,l}}return new Uint8Array(0)}fill(n,...r){n&&(this.buffers.push(n),this.byteLength+=n.length);for(let s=0;s<r.length;s++)r[s]&&r[s].length&&(this.buffers.push(r[s]),this.byteLength+=r[s].length)}peek(){return this.buffers.length?(this.pack(),this.buffers[0]):new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}}function t2(e,n){return n.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(s){if(s!=="default"&&!(s in e)){var l=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:function(){return r[s]}})}})}),Object.freeze(e)}var n2=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},bl=n2.performance||{};bl.now||bl.mozNow||bl.msNow||bl.oNow||bl.webkitNow;var g0={versions:{}},r2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function i2(e){if(e.__esModule)return e;var n=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var xh,Gu={exports:{}},y0={},b0=i2(t2({__proto__:null,default:y0},[y0]));xh=Gu,(function(){var e="input is invalid type",n=typeof window=="object",r=n?window:{};r.JS_SHA256_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",l=!r.JS_SHA256_NO_NODE_JS&&g0.versions&&g0.versions.node;l?r=r2:s&&(r=self);var u=!r.JS_SHA256_NO_COMMON_JS&&xh.exports,c=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",f="0123456789abcdef".split(""),m=[-2147483648,8388608,32768,128],d=[24,16,8,0],y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=["hex","array","digest","arrayBuffer"],x=[];!r.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(P){return Object.prototype.toString.call(P)==="[object Array]"}),!c||!r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(P){return typeof P=="object"&&P.buffer&&P.buffer.constructor===ArrayBuffer});var w=function(P,z){return function(X){return new $(z,!0).update(X)[P]()}},k=function(P){var z=w("hex",P);l&&(z=D(z,P)),z.create=function(){return new $(P)},z.update=function(H){return z.create().update(H)};for(var X=0;X<g.length;++X){var Z=g[X];z[Z]=w(Z,P)}return z},D=function(P,z){var X,Z=b0,H=b0.Buffer,O=z?"sha224":"sha256";return X=H.from&&!r.JS_SHA256_NO_BUFFER_FROM?H.from:function(K){return new H(K)},function(K){if(typeof K=="string")return Z.createHash(O).update(K,"utf8").digest("hex");if(K==null)throw new Error(e);return K.constructor===ArrayBuffer&&(K=new Uint8Array(K)),Array.isArray(K)||ArrayBuffer.isView(K)||K.constructor===H?Z.createHash(O).update(X(K)).digest("hex"):P(K)}},B=function(P,z){return function(X,Z){return new T(X,z,!0).update(Z)[P]()}},L=function(P){var z=B("hex",P);z.create=function(H){return new T(H,P)},z.update=function(H,O){return z.create(H).update(O)};for(var X=0;X<g.length;++X){var Z=g[X];z[Z]=B(Z,P)}return z};function $(P,z){z?(x[0]=x[16]=x[1]=x[2]=x[3]=x[4]=x[5]=x[6]=x[7]=x[8]=x[9]=x[10]=x[11]=x[12]=x[13]=x[14]=x[15]=0,this.blocks=x):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],P?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=P}function T(P,z,X){var Z,H=typeof P;if(H==="string"){var O,K=[],J=P.length,se=0;for(Z=0;Z<J;++Z)(O=P.charCodeAt(Z))<128?K[se++]=O:O<2048?(K[se++]=192|O>>>6,K[se++]=128|63&O):O<55296||O>=57344?(K[se++]=224|O>>>12,K[se++]=128|O>>>6&63,K[se++]=128|63&O):(O=65536+((1023&O)<<10|1023&P.charCodeAt(++Z)),K[se++]=240|O>>>18,K[se++]=128|O>>>12&63,K[se++]=128|O>>>6&63,K[se++]=128|63&O);P=K}else{if(H!=="object")throw new Error(e);if(P===null)throw new Error(e);if(c&&P.constructor===ArrayBuffer)P=new Uint8Array(P);else if(!(Array.isArray(P)||c&&ArrayBuffer.isView(P)))throw new Error(e)}P.length>64&&(P=new $(z,!0).update(P).array());var ie=[],F=[];for(Z=0;Z<64;++Z){var q=P[Z]||0;ie[Z]=92^q,F[Z]=54^q}$.call(this,z,X),this.update(F),this.oKeyPad=ie,this.inner=!0,this.sharedMemory=X}$.prototype.update=function(P){if(!this.finalized){var z,X=typeof P;if(X!=="string"){if(X!=="object")throw new Error(e);if(P===null)throw new Error(e);if(c&&P.constructor===ArrayBuffer)P=new Uint8Array(P);else if(!(Array.isArray(P)||c&&ArrayBuffer.isView(P)))throw new Error(e);z=!0}for(var Z,H,O=0,K=P.length,J=this.blocks;O<K;){if(this.hashed&&(this.hashed=!1,J[0]=this.block,this.block=J[16]=J[1]=J[2]=J[3]=J[4]=J[5]=J[6]=J[7]=J[8]=J[9]=J[10]=J[11]=J[12]=J[13]=J[14]=J[15]=0),z)for(H=this.start;O<K&&H<64;++O)J[H>>>2]|=P[O]<<d[3&H++];else for(H=this.start;O<K&&H<64;++O)(Z=P.charCodeAt(O))<128?J[H>>>2]|=Z<<d[3&H++]:Z<2048?(J[H>>>2]|=(192|Z>>>6)<<d[3&H++],J[H>>>2]|=(128|63&Z)<<d[3&H++]):Z<55296||Z>=57344?(J[H>>>2]|=(224|Z>>>12)<<d[3&H++],J[H>>>2]|=(128|Z>>>6&63)<<d[3&H++],J[H>>>2]|=(128|63&Z)<<d[3&H++]):(Z=65536+((1023&Z)<<10|1023&P.charCodeAt(++O)),J[H>>>2]|=(240|Z>>>18)<<d[3&H++],J[H>>>2]|=(128|Z>>>12&63)<<d[3&H++],J[H>>>2]|=(128|Z>>>6&63)<<d[3&H++],J[H>>>2]|=(128|63&Z)<<d[3&H++]);this.lastByteIndex=H,this.bytes+=H-this.start,H>=64?(this.block=J[16],this.start=H-64,this.hash(),this.hashed=!0):this.start=H}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},$.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var P=this.blocks,z=this.lastByteIndex;P[16]=this.block,P[z>>>2]|=m[3&z],this.block=P[16],z>=56&&(this.hashed||this.hash(),P[0]=this.block,P[16]=P[1]=P[2]=P[3]=P[4]=P[5]=P[6]=P[7]=P[8]=P[9]=P[10]=P[11]=P[12]=P[13]=P[14]=P[15]=0),P[14]=this.hBytes<<3|this.bytes>>>29,P[15]=this.bytes<<3,this.hash()}},$.prototype.hash=function(){var P,z,X,Z,H,O,K,J,se,ie=this.h0,F=this.h1,q=this.h2,V=this.h3,ue=this.h4,xe=this.h5,S=this.h6,M=this.h7,W=this.blocks;for(P=16;P<64;++P)z=((H=W[P-15])>>>7|H<<25)^(H>>>18|H<<14)^H>>>3,X=((H=W[P-2])>>>17|H<<15)^(H>>>19|H<<13)^H>>>10,W[P]=W[P-16]+z+W[P-7]+X|0;for(se=F&q,P=0;P<64;P+=4)this.first?(this.is224?(O=300032,M=(H=W[0]-1413257819)-150054599|0,V=H+24177077|0):(O=704751109,M=(H=W[0]-210244248)-1521486534|0,V=H+143694565|0),this.first=!1):(z=(ie>>>2|ie<<30)^(ie>>>13|ie<<19)^(ie>>>22|ie<<10),Z=(O=ie&F)^ie&q^se,M=V+(H=M+(X=(ue>>>6|ue<<26)^(ue>>>11|ue<<21)^(ue>>>25|ue<<7))+(ue&xe^~ue&S)+y[P]+W[P])|0,V=H+(z+Z)|0),z=(V>>>2|V<<30)^(V>>>13|V<<19)^(V>>>22|V<<10),Z=(K=V&ie)^V&F^O,S=q+(H=S+(X=(M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))+(M&ue^~M&xe)+y[P+1]+W[P+1])|0,z=((q=H+(z+Z)|0)>>>2|q<<30)^(q>>>13|q<<19)^(q>>>22|q<<10),Z=(J=q&V)^q&ie^K,xe=F+(H=xe+(X=(S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7))+(S&M^~S&ue)+y[P+2]+W[P+2])|0,z=((F=H+(z+Z)|0)>>>2|F<<30)^(F>>>13|F<<19)^(F>>>22|F<<10),Z=(se=F&q)^F&V^J,ue=ie+(H=ue+(X=(xe>>>6|xe<<26)^(xe>>>11|xe<<21)^(xe>>>25|xe<<7))+(xe&S^~xe&M)+y[P+3]+W[P+3])|0,ie=H+(z+Z)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+ie|0,this.h1=this.h1+F|0,this.h2=this.h2+q|0,this.h3=this.h3+V|0,this.h4=this.h4+ue|0,this.h5=this.h5+xe|0,this.h6=this.h6+S|0,this.h7=this.h7+M|0},$.prototype.hex=function(){this.finalize();var P=this.h0,z=this.h1,X=this.h2,Z=this.h3,H=this.h4,O=this.h5,K=this.h6,J=this.h7,se=f[P>>>28&15]+f[P>>>24&15]+f[P>>>20&15]+f[P>>>16&15]+f[P>>>12&15]+f[P>>>8&15]+f[P>>>4&15]+f[15&P]+f[z>>>28&15]+f[z>>>24&15]+f[z>>>20&15]+f[z>>>16&15]+f[z>>>12&15]+f[z>>>8&15]+f[z>>>4&15]+f[15&z]+f[X>>>28&15]+f[X>>>24&15]+f[X>>>20&15]+f[X>>>16&15]+f[X>>>12&15]+f[X>>>8&15]+f[X>>>4&15]+f[15&X]+f[Z>>>28&15]+f[Z>>>24&15]+f[Z>>>20&15]+f[Z>>>16&15]+f[Z>>>12&15]+f[Z>>>8&15]+f[Z>>>4&15]+f[15&Z]+f[H>>>28&15]+f[H>>>24&15]+f[H>>>20&15]+f[H>>>16&15]+f[H>>>12&15]+f[H>>>8&15]+f[H>>>4&15]+f[15&H]+f[O>>>28&15]+f[O>>>24&15]+f[O>>>20&15]+f[O>>>16&15]+f[O>>>12&15]+f[O>>>8&15]+f[O>>>4&15]+f[15&O]+f[K>>>28&15]+f[K>>>24&15]+f[K>>>20&15]+f[K>>>16&15]+f[K>>>12&15]+f[K>>>8&15]+f[K>>>4&15]+f[15&K];return this.is224||(se+=f[J>>>28&15]+f[J>>>24&15]+f[J>>>20&15]+f[J>>>16&15]+f[J>>>12&15]+f[J>>>8&15]+f[J>>>4&15]+f[15&J]),se},$.prototype.toString=$.prototype.hex,$.prototype.digest=function(){this.finalize();var P=this.h0,z=this.h1,X=this.h2,Z=this.h3,H=this.h4,O=this.h5,K=this.h6,J=this.h7,se=[P>>>24&255,P>>>16&255,P>>>8&255,255&P,z>>>24&255,z>>>16&255,z>>>8&255,255&z,X>>>24&255,X>>>16&255,X>>>8&255,255&X,Z>>>24&255,Z>>>16&255,Z>>>8&255,255&Z,H>>>24&255,H>>>16&255,H>>>8&255,255&H,O>>>24&255,O>>>16&255,O>>>8&255,255&O,K>>>24&255,K>>>16&255,K>>>8&255,255&K];return this.is224||se.push(J>>>24&255,J>>>16&255,J>>>8&255,255&J),se},$.prototype.array=$.prototype.digest,$.prototype.arrayBuffer=function(){this.finalize();var P=new ArrayBuffer(this.is224?28:32),z=new DataView(P);return z.setUint32(0,this.h0),z.setUint32(4,this.h1),z.setUint32(8,this.h2),z.setUint32(12,this.h3),z.setUint32(16,this.h4),z.setUint32(20,this.h5),z.setUint32(24,this.h6),this.is224||z.setUint32(28,this.h7),P},T.prototype=new $,T.prototype.finalize=function(){if($.prototype.finalize.call(this),this.inner){this.inner=!1;var P=this.array();$.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(P),$.prototype.finalize.call(this)}};var te=k();te.sha256=te,te.sha224=k(!0),te.sha256.hmac=L(),te.sha224.hmac=L(!0),u?xh.exports=te:(r.sha256=te.sha256,r.sha224=te.sha224)})();Gu.exports;Gu.exports.sha224;var x0=Gu.exports.sha256;function rd(e){return c2(e)}function s2(e){if(!/^[0-9A-Fa-f]+$/.test(e))return!1;const r=/^[0-9A-F]+$/.test(e),s=/^[0-9a-f]+$/.test(e);return r||s?e.length%2===0:!1}function a2(e){return/^[A-Za-z0-9\-_]*(={0,2})?$/.test(e)||/^[A-Za-z0-9+/]*(={0,2})?$/.test(e)}function l2(e){return s2(e)?"hex":a2(e)?"b64":""}function o2(e){if(e.length%2!==0)throw new Error("hex string must have an even length");const n=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)n[r/2]=parseInt(e.substring(r,r+2),16);return n}function u2(e){e=e.replace(/-/g,"+"),e=e.replace(/_/g,"/");const n=atob(e);return Uint8Array.from(n,r=>r.charCodeAt(0))}function c2(e){switch(l2(e)){case"hex":return o2(e);case"b64":return u2(e)}return null}function f2(e,n){const r=typeof e=="string"?rd(e):e,s=typeof n=="string"?rd(n):n;if(r===null||s===null||r.length!==s.length)return!1;for(let l=0;l<r.length;l++)if(r[l]!==s[l])return!1;return!0}class ux{constructor(n,r,s=!0){C(this,"token");C(this,"received");C(this,"ctx");C(this,"requestSubject");C(this,"mux");this.mux=n,this.requestSubject=r,this.received=0,this.token=Bi.next(),s&&(this.ctx=new Error)}}class h2 extends ux{constructor(r,s,l={maxWait:1e3}){super(r,s);C(this,"callback");C(this,"done");C(this,"timer");C(this,"max");C(this,"opts");if(this.opts=l,typeof this.opts.callback!="function")throw new Error("callback is required");this.callback=this.opts.callback,this.max=typeof l.maxMessages=="number"&&l.maxMessages>0?l.maxMessages:-1,this.done=zt(),this.done.then(()=>{this.callback(null,null)}),this.timer=setTimeout(()=>{this.cancel()},l.maxWait)}cancel(r){r&&this.callback(r,null),clearTimeout(this.timer),this.mux.cancel(this),this.done.resolve()}resolver(r,s){r?(this.ctx&&(r.stack+=`
67
+
68
+ ${this.ctx.stack}`),this.cancel(r)):(this.callback(null,s),this.opts.strategy===dr.Count&&(this.max--,this.max===0&&this.cancel()),this.opts.strategy===dr.JitterTimer&&(clearTimeout(this.timer),this.timer=setTimeout(()=>{this.cancel()},this.opts.jitter||300)),this.opts.strategy===dr.SentinelMsg&&s&&s.data.length===0&&this.cancel())}}class cx extends ux{constructor(r,s,l={timeout:1e3},u=!0){super(r,s,u);C(this,"deferred");C(this,"timer");this.deferred=zt(),this.timer=da(l.timeout,u)}resolver(r,s){this.timer&&this.timer.cancel(),r?(this.ctx&&(r.stack+=`
69
+
70
+ ${this.ctx.stack}`),this.deferred.reject(r)):this.deferred.resolve(s),this.cancel()}cancel(r){this.timer&&this.timer.cancel(),this.mux.cancel(this),this.deferred.reject(r||je.errorForCode(Ee.Cancelled))}}const d2="$JS.API";function m2(e){return e=e||{},e.domain&&(e.apiPrefix=`$JS.${e.domain}.API`,delete e.domain),$u({apiPrefix:d2,timeout:5e3},e)}class $l{constructor(n,r){C(this,"nc");C(this,"opts");C(this,"prefix");C(this,"timeout");C(this,"jc");this.nc=n,this.opts=m2(r),this._parseOpts(),this.prefix=this.opts.apiPrefix,this.timeout=this.opts.timeout,this.jc=mr()}getOptions(){return Object.assign({},this.opts)}_parseOpts(){let n=this.opts.apiPrefix;if(!n||n.length===0)throw new Error("invalid empty prefix");n[n.length-1]==="."&&(n=n.substr(0,n.length-1)),this.opts.apiPrefix=n}async _request(n,r=null,s){s=s||{},s.timeout=this.timeout;let l=Fn;r&&(l=this.jc.encode(r));let{retries:u}=s;u=u||1,u=u===-1?Number.MAX_SAFE_INTEGER:u;const c=Od();for(let f=0;f<u;f++)try{const m=await this.nc.request(n,l,s);return this.parseJsResponse(m)}catch(m){const d=m;if((d.code==="503"||d.code===Ee.Timeout)&&f+1<u)await wa(c.backoff(f));else throw m}}async findStream(n){const r={subject:n},l=await this._request(`${this.prefix}.STREAM.NAMES`,r);if(!l.streams||l.streams.length!==1)throw new Error("no stream matches subject");return l.streams[0]}getConnection(){return this.nc}parseJsResponse(n){const r=this.jc.decode(n.data),s=r;if(s.error){const l=ox(s.error.code,s.error.description);if(l!==null)throw l.api_error=s.error,l}return r}}class Cl{constructor(n,r,s,l){C(this,"err");C(this,"offset");C(this,"pageInfo");C(this,"subject");C(this,"jsm");C(this,"filter");C(this,"payload");if(!n)throw new Error("subject is required");this.subject=n,this.jsm=s,this.offset=0,this.pageInfo={},this.filter=r,this.payload=l||{}}async next(){if(this.err)return[];if(this.pageInfo&&this.offset>=this.pageInfo.total)return[];const n={offset:this.offset};this.payload&&Object.assign(n,this.payload);try{const r=await this.jsm._request(this.subject,n,{timeout:this.jsm.timeout});this.pageInfo=r;const s=this.countResponse(r);return s===0?[]:(this.offset+=s,this.filter(r))}catch(r){throw this.err=r,r}}countResponse(n){var r,s,l;switch(n==null?void 0:n.type){case"io.nats.jetstream.api.v1.stream_names_response":case"io.nats.jetstream.api.v1.stream_list_response":return((r=n.streams)==null?void 0:r.length)||0;case"io.nats.jetstream.api.v1.consumer_list_response":return((s=n.consumers)==null?void 0:s.length)||0;default:return console.error(`jslister.ts: unknown API response for paged output: ${n==null?void 0:n.type}`),((l=n.streams)==null?void 0:l.length)||0}return 0}async*[Symbol.asyncIterator](){let n=await this.next();for(;n.length>0;){for(const r of n)yield r;n=await this.next()}}}function fs(e=""){const n=e.match(/(\d+).(\d+).(\d+)/);if(n)return{major:parseInt(n[1]),minor:parseInt(n[2]),micro:parseInt(n[3])};throw new Error(`'${e}' is not a semver value`)}function id(e,n){return e.major<n.major?-1:e.major>n.major?1:e.minor<n.minor?-1:e.minor>n.minor?1:e.micro<n.micro?-1:e.micro>n.micro?1:0}var at;(function(e){e.JS_KV="js_kv",e.JS_OBJECTSTORE="js_objectstore",e.JS_PULL_MAX_BYTES="js_pull_max_bytes",e.JS_NEW_CONSUMER_CREATE_API="js_new_consumer_create",e.JS_ALLOW_DIRECT="js_allow_direct",e.JS_MULTIPLE_CONSUMER_FILTER="js_multiple_consumer_filter",e.JS_SIMPLIFICATION="js_simplification",e.JS_STREAM_CONSUMER_METADATA="js_stream_consumer_metadata",e.JS_CONSUMER_FILTER_SUBJECTS="js_consumer_filter_subjects",e.JS_STREAM_FIRST_SEQ="js_stream_first_seq",e.JS_STREAM_SUBJECT_TRANSFORM="js_stream_subject_transform",e.JS_STREAM_SOURCE_SUBJECT_TRANSFORM="js_stream_source_subject_transform",e.JS_STREAM_COMPRESSION="js_stream_compression",e.JS_DEFAULT_CONSUMER_LIMITS="js_default_consumer_limits",e.JS_BATCH_DIRECT_GET="js_batch_direct_get"})(at||(at={}));class p2{constructor(n){C(this,"server");C(this,"features");C(this,"disabled");this.features=new Map,this.disabled=[],this.update(n)}resetDisabled(){this.disabled.length=0,this.update(this.server)}disable(n){this.disabled.push(n),this.update(this.server)}isDisabled(n){return this.disabled.indexOf(n)!==-1}update(n){typeof n=="string"&&(n=fs(n)),this.server=n,this.set(at.JS_KV,"2.6.2"),this.set(at.JS_OBJECTSTORE,"2.6.3"),this.set(at.JS_PULL_MAX_BYTES,"2.8.3"),this.set(at.JS_NEW_CONSUMER_CREATE_API,"2.9.0"),this.set(at.JS_ALLOW_DIRECT,"2.9.0"),this.set(at.JS_MULTIPLE_CONSUMER_FILTER,"2.10.0"),this.set(at.JS_SIMPLIFICATION,"2.9.4"),this.set(at.JS_STREAM_CONSUMER_METADATA,"2.10.0"),this.set(at.JS_CONSUMER_FILTER_SUBJECTS,"2.10.0"),this.set(at.JS_STREAM_FIRST_SEQ,"2.10.0"),this.set(at.JS_STREAM_SUBJECT_TRANSFORM,"2.10.0"),this.set(at.JS_STREAM_SOURCE_SUBJECT_TRANSFORM,"2.10.0"),this.set(at.JS_STREAM_COMPRESSION,"2.10.0"),this.set(at.JS_DEFAULT_CONSUMER_LIMITS,"2.10.0"),this.set(at.JS_BATCH_DIRECT_GET,"2.11.0"),this.disabled.forEach(r=>{this.features.delete(r)})}set(n,r){this.features.set(n,{min:r,ok:id(this.server,fs(r))>=0})}get(n){return this.features.get(n)||{min:"unknown",ok:!1}}supports(n){var r;return((r=this.get(n))==null?void 0:r.ok)||!1}require(n){return typeof n=="string"&&(n=fs(n)),id(this.server,n)>=0}}class Ou extends $l{constructor(n,r){super(n,r)}async add(n,r,s=Nu.Create){if(dn(n),r.deliver_group&&r.flow_control)throw new Error("jetstream flow control is not supported with queue groups");if(r.deliver_group&&r.idle_heartbeat)throw new Error("jetstream idle heartbeat is not supported with queue groups");const l={};l.config=r,l.stream_name=n,l.action=s,l.config.durable_name&&aa(l.config.durable_name);const u=this.nc;let{min:c,ok:f}=u.features.get(at.JS_NEW_CONSUMER_CREATE_API);const m=r.name===""?void 0:r.name;if(m&&!f)throw new Error(`consumer 'name' requires server ${c}`);if(m)try{Yu("name",m)}catch(x){const w=x.message,k=w.indexOf("cannot contain");throw k!==-1?new Error(`consumer 'name' ${w.substring(k)}`):x}let d,y="";if(Array.isArray(r.filter_subjects)){const{min:x,ok:w}=u.features.get(at.JS_MULTIPLE_CONSUMER_FILTER);if(!w)throw new Error(`consumer 'filter_subjects' requires server ${x}`);f=!1}if(r.metadata){const{min:x,ok:w}=u.features.get(at.JS_STREAM_CONSUMER_METADATA);if(!w)throw new Error(`consumer 'metadata' requires server ${x}`)}if(f&&(y=r.name??r.durable_name??""),y!==""){let x=r.filter_subject??void 0;x===">"&&(x=void 0),d=x!==void 0?`${this.prefix}.CONSUMER.CREATE.${n}.${y}.${x}`:`${this.prefix}.CONSUMER.CREATE.${n}.${y}`}else d=r.durable_name?`${this.prefix}.CONSUMER.DURABLE.CREATE.${n}.${r.durable_name}`:`${this.prefix}.CONSUMER.CREATE.${n}`;return await this._request(d,l)}async update(n,r,s){const l=await this.info(n,r),u=s;return this.add(n,Object.assign(l.config,u),Nu.Update)}async info(n,r){return dn(n),aa(r),await this._request(`${this.prefix}.CONSUMER.INFO.${n}.${r}`)}async delete(n,r){return dn(n),aa(r),(await this._request(`${this.prefix}.CONSUMER.DELETE.${n}.${r}`)).success}list(n){dn(n);const r=l=>l.consumers,s=`${this.prefix}.CONSUMER.LIST.${n}`;return new Cl(s,r,this)}pause(n,r,s){const l=`${this.prefix}.CONSUMER.PAUSE.${n}.${r}`,u={pause_until:s.toISOString()};return this._request(l,u)}resume(n,r){return this.pause(n,r,new Date(0))}}function Qs(e,n,r=!1){if(r===!0&&!e)throw je.errorForCode(Ee.ApiError,new Error(`${n} is not a function`));if(e&&typeof e!="function")throw je.errorForCode(Ee.ApiError,new Error(`${n} is not a function`))}class g2 extends tn{constructor(r,s,l){super();C(this,"sub");C(this,"adapter");C(this,"subIterDone");Qs(l.adapter,"adapter",!0),this.adapter=l.adapter,l.callback&&Qs(l.callback,"callback"),this.noIterator=typeof l.callback=="function",l.ingestionFilterFn&&(Qs(l.ingestionFilterFn,"ingestionFilterFn"),this.ingestionFilterFn=l.ingestionFilterFn),l.protocolFilterFn&&(Qs(l.protocolFilterFn,"protocolFilterFn"),this.protocolFilterFn=l.protocolFilterFn),l.dispatchedFn&&(Qs(l.dispatchedFn,"dispatchedFn"),this.dispatchedFn=l.dispatchedFn),l.cleanupFn&&Qs(l.cleanupFn,"cleanupFn");let u=(y,g)=>{this.callback(y,g)};if(l.callback){const y=l.callback;u=(g,x)=>{const[w,k]=this.adapter(g,x);if(w){y(w,null);return}const{ingest:D}=this.ingestionFilterFn?this.ingestionFilterFn(k,this):{ingest:!0};D&&(!this.protocolFilterFn||this.protocolFilterFn(k))&&(y(w,k),this.dispatchedFn&&k&&this.dispatchedFn(k))}}const{max:c,queue:f,timeout:m}=l,d={queue:f,timeout:m,callback:u};c&&c>0&&(d.max=c),this.sub=r.subscribe(s,d),l.cleanupFn&&(this.sub.cleanupFn=l.cleanupFn),this.noIterator||this.iterClosed.then(()=>{this.unsubscribe()}),this.subIterDone=zt(),Promise.all([this.sub.closed,this.iterClosed]).then(()=>{this.subIterDone.resolve()}).catch(()=>{this.subIterDone.resolve()}),(async y=>{await y.closed,this.stop()})(this.sub).then().catch()}unsubscribe(r){this.sub.unsubscribe(r)}drain(){return this.sub.drain()}isDraining(){return this.sub.isDraining()}isClosed(){return this.sub.isClosed()}callback(r,s){this.sub.cancelTimeout();const[l,u]=this.adapter(r,s);l&&this.stop(l),u&&this.push(u)}getSubject(){return this.sub.getSubject()}getReceived(){return this.sub.getReceived()}getProcessed(){return this.sub.getProcessed()}getPending(){return this.sub.getPending()}getID(){return this.sub.getID()}getMax(){return this.sub.getMax()}get closed(){return this.sub.closed}}let Hn;function y2(e){Hn=e}function fx(){return Hn!==void 0&&Hn.defaultPort!==void 0?Hn.defaultPort:4222}function vh(){return Hn!==void 0&&Hn.urlParseFn?Hn.urlParseFn:void 0}function b2(){if(!Hn||typeof Hn.factory!="function")throw new Error("transport fn is not set");return Hn.factory()}function sd(){return Hn!==void 0&&Hn.dnsResolveFn?Hn.dnsResolveFn:void 0}const Su=`\r
71
+ `,Ru=pa.fromAscii(Su),x2=new Uint8Array(Ru)[0],v2=new Uint8Array(Ru)[1];function w2(e){for(let n=0;n<e.length;n++){const r=n+1;if(e.byteLength>r&&e[n]===x2&&e[r]===v2)return r+1}return 0}function S2(e){const n=w2(e);if(n>0){const s=new Uint8Array(e).slice(0,n);return qn.decode(s)}return""}const _2=4,hx=48,E2=65,k2=97;function C2(e,n,r,s){const l=new Uint8Array(16);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((c,f)=>{l[f]=c}),l[12]=e,l[13]=n,l[14]=r,l[15]=s,l}function ad(e){return A2(e)!==void 0}function A2(e){for(let n=0;n<e.length;n++)switch(e[n]){case".":return dx(e);case":":return T2(e)}}function dx(e){const n=new Uint8Array(4);for(let r=0;r<4;r++){if(e.length===0)return;if(r>0){if(e[0]!==".")return;e=e.substring(1)}const{n:s,c:l,ok:u}=j2(e);if(!u||s>255)return;e=e.substring(l),n[r]=s}return C2(n[0],n[1],n[2],n[3])}function T2(e){const n=new Uint8Array(16);let r=-1;if(e.length>=2&&e[0]===":"&&e[1]===":"&&(r=0,e=e.substring(2),e.length===0))return n;let s=0;for(;s<16;){const{n:l,c:u,ok:c}=N2(e);if(!c||l>65535)return;if(u<e.length&&e[u]==="."){if(r<0&&s!=12||s+4>16)return;const f=dx(e);if(f===void 0)return;n[s]=f[12],n[s+1]=f[13],n[s+2]=f[14],n[s+3]=f[15],e="",s+=_2;break}if(n[s]=l>>8,n[s+1]=l,s+=2,e=e.substring(u),e.length===0)break;if(e[0]!==":"||e.length==1)return;if(e=e.substring(1),e[0]===":"){if(r>=0)return;if(r=s,e=e.substring(1),e.length===0)break}}if(e.length===0){if(s<16){if(r<0)return;const l=16-s;for(let u=s-1;u>=r;u--)n[u+l]=n[u];for(let u=r+l-1;u>=r;u--)n[u]=0}else if(r>=0)return;return n}}function j2(e){let n=0,r=0;for(n=0;n<e.length&&48<=e.charCodeAt(n)&&e.charCodeAt(n)<=57;n++)if(r=r*10+(e.charCodeAt(n)-hx),r>=16777215)return{n:16777215,c:n,ok:!1};return n===0?{n:0,c:0,ok:!1}:{n:r,c:n,ok:!0}}function N2(e){let n=0,r=0;for(r=0;r<e.length;r++){if(48<=e.charCodeAt(r)&&e.charCodeAt(r)<=57)n*=16,n+=e.charCodeAt(r)-hx;else if(97<=e.charCodeAt(r)&&e.charCodeAt(r)<=102)n*=16,n+=e.charCodeAt(r)-k2+10;else if(65<=e.charCodeAt(r)&&e.charCodeAt(r)<=70)n*=16,n+=e.charCodeAt(r)-E2+10;else break;if(n>=16777215)return{n:0,c:r,ok:!1}}return r===0?{n:0,c:r,ok:!1}:{n,c:r,ok:!0}}function O2(e){return e.indexOf("[")!==-1||e.indexOf("::")!==-1?!1:e.indexOf(".")!==-1||e.split(":").length<=2}function ld(e){return!O2(e)}function R2(e){const n="::FFFF:",r=e.toUpperCase().indexOf(n);if(r!==-1&&e.indexOf(".")!==-1){let s=e.substring(r+n.length);return s=s.replace("[",""),s.replace("]","")}return e}function M2(e){e=e.trim(),e.match(/^(.*:\/\/)(.*)/m)&&(e=e.replace(/^(.*:\/\/)(.*)/gm,"$2")),e=R2(e),ld(e)&&e.indexOf("[")===-1&&(e=`[${e}]`);const n=ld(e)?e.match(/(]:)(\d+)/):e.match(/(:)(\d+)/),r=n&&n.length===3&&n[1]&&n[2]?parseInt(n[2]):4222,s=r===80?"https":"http",l=new URL(`${s}://${e}`);l.port=`${r}`;let u=l.hostname;return u.charAt(0)==="["&&(u=u.substring(1,u.length-1)),{listen:l.host,hostname:u,port:r}}class jl{constructor(n,r=!1){C(this,"src");C(this,"listen");C(this,"hostname");C(this,"port");C(this,"didConnect");C(this,"reconnects");C(this,"lastConnect");C(this,"gossiped");C(this,"tlsName");C(this,"resolves");this.src=n,this.tlsName="";const s=M2(n);this.listen=s.listen,this.hostname=s.hostname,this.port=s.port,this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=r}toString(){return this.listen}async resolve(n){if(!n.fn||n.resolve===!1)return[this];const r=[];if(ad(this.hostname))return[this];{const s=await n.fn(this.hostname);n.debug&&console.log(`resolve ${this.hostname} = ${s.join(",")}`);for(const l of s){const u=this.port===80?"https":"http",c=new URL(`${u}://${ld(l)?"["+l+"]":l}`);c.port=`${this.port}`;const f=new jl(c.host,!1);f.tlsName=this.hostname,r.push(f)}}return n.randomize&&ax(r),this.resolves=r,r}}class D2{constructor(n=[],r={}){C(this,"firstSelect");C(this,"servers");C(this,"currentServer");C(this,"tlsName");C(this,"randomize");this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=r.randomize||!1;const s=vh();n&&(n.forEach(l=>{l=s?s(l):l,this.servers.push(new jl(l))}),this.randomize&&(this.servers=ax(this.servers))),this.servers.length===0&&this.addServer(`${Zh}:${fx()}`,!1),this.currentServer=this.servers[0]}clear(){this.servers.length=0}updateTLSName(){const n=this.getCurrentServer();ad(n.hostname)||(this.tlsName=n.hostname,this.servers.forEach(r=>{r.gossiped&&(r.tlsName=this.tlsName)}))}getCurrentServer(){return this.currentServer}addServer(n,r=!1){const s=vh();n=s?s(n):n;const l=new jl(n,r);ad(l.hostname)&&(l.tlsName=this.tlsName),this.servers.push(l)}selectServer(){if(this.firstSelect)return this.firstSelect=!1,this.currentServer;const n=this.servers.shift();return n&&(this.servers.push(n),this.currentServer=n),n}removeCurrentServer(){this.removeServer(this.currentServer)}removeServer(n){if(n){const r=this.servers.indexOf(n);this.servers.splice(r,1)}}length(){return this.servers.length}next(){return this.servers.length?this.servers[0]:void 0}getServers(){return this.servers}update(n,r){const s=[];let l=[];const u=vh(),c=new Map;n.connect_urls&&n.connect_urls.length>0&&n.connect_urls.forEach(m=>{m=u?u(m,r):m;const d=new jl(m,!0);c.set(m,d)});const f=[];return this.servers.forEach((m,d)=>{const y=m.listen;m.gossiped&&this.currentServer.listen!==y&&c.get(y)===void 0&&f.push(d),c.delete(y)}),f.reverse(),f.forEach(m=>{const d=this.servers.splice(m,1);l=l.concat(d[0].listen)}),c.forEach((m,d)=>{this.servers.push(m),s.push(d)}),{added:s,deleted:l}}}class L2{constructor(){C(this,"baseInbox");C(this,"reqs");this.reqs=new Map}size(){return this.reqs.size}init(n){return this.baseInbox=`${Zr(n)}.`,this.baseInbox}add(n){isNaN(n.received)||(n.received=0),this.reqs.set(n.token,n)}get(n){return this.reqs.get(n)}cancel(n){this.reqs.delete(n.token)}getToken(n){const r=n.subject||"";return r.indexOf(this.baseInbox)===0?r.substring(this.baseInbox.length):null}all(){return Array.from(this.reqs.values())}handleError(n,r){if(r&&r.permissionContext){if(n)return this.all().forEach(l=>{l.resolver(r,{})}),!0;const s=r.permissionContext;if(s.operation==="publish"){const l=this.all().find(u=>u.requestSubject===s.subject);if(l)return l.resolver(r,{}),!0}}return!1}dispatcher(){return(n,r)=>{const s=this.getToken(r);if(s){const l=this.get(s);l&&(n===null&&r.headers&&(n=lx(r)),l.resolver(n,r))}}}close(){const n=je.errorForCode(Ee.Timeout);this.reqs.forEach(r=>{r.resolver(n,{})})}}class z2{constructor(n,r,s){C(this,"ph");C(this,"interval");C(this,"maxOut");C(this,"timer");C(this,"pendings");this.ph=n,this.interval=r,this.maxOut=s,this.pendings=[]}start(){this.cancel(),this._schedule()}cancel(n){this.timer&&(clearTimeout(this.timer),this.timer=void 0),this._reset(),n&&this.ph.disconnect()}_schedule(){this.timer=setTimeout(()=>{if(this.ph.dispatchStatus({type:sa.PingTimer,data:`${this.pendings.length+1}`}),this.pendings.length===this.maxOut){this.cancel(!0);return}const n=zt();this.ph.flush(n).then(()=>{this._reset()}).catch(()=>{this.cancel()}),this.pendings.push(n),this._schedule()},this.interval)}_reset(){this.pendings=this.pendings.filter(n=>(n.resolve(),!1))}}class U2 extends Error{constructor(n){super(n),this.name="AssertionError"}}function B2(e,n="Assertion failed."){if(!e)throw new U2(n)}const v0=32*1024,wh=2**32-2;function fu(e,n,r=0){const s=n.byteLength-r;return e.byteLength>s&&(e=e.subarray(0,s)),n.set(e,r),e.byteLength}class Sh{constructor(n){C(this,"_buf");C(this,"_off");if(this._off=0,n==null){this._buf=new Uint8Array(0);return}this._buf=new Uint8Array(n)}bytes(n={copy:!0}){return n.copy===!1?this._buf.subarray(this._off):this._buf.slice(this._off)}empty(){return this._buf.byteLength<=this._off}get length(){return this._buf.byteLength-this._off}get capacity(){return this._buf.buffer.byteLength}truncate(n){if(n===0){this.reset();return}if(n<0||n>this.length)throw Error("bytes.Buffer: truncation out of range");this._reslice(this._off+n)}reset(){this._reslice(0),this._off=0}_tryGrowByReslice(n){const r=this._buf.byteLength;return n<=this.capacity-r?(this._reslice(r+n),r):-1}_reslice(n){B2(n<=this._buf.buffer.byteLength),this._buf=new Uint8Array(this._buf.buffer,0,n)}readByte(){const n=new Uint8Array(1);return this.read(n)?n[0]:null}read(n){if(this.empty())return this.reset(),n.byteLength===0?0:null;const r=fu(this._buf.subarray(this._off),n);return this._off+=r,r}writeByte(n){return this.write(Uint8Array.of(n))}writeString(n){return this.write(qi.encode(n))}write(n){const r=this._grow(n.byteLength);return fu(n,this._buf,r)}_grow(n){const r=this.length;r===0&&this._off!==0&&this.reset();const s=this._tryGrowByReslice(n);if(s>=0)return s;const l=this.capacity;if(n<=Math.floor(l/2)-r)fu(this._buf.subarray(this._off),this._buf);else{if(l+n>wh)throw new Error("The buffer cannot be grown beyond the maximum size.");{const u=new Uint8Array(Math.min(2*l+n,wh));fu(this._buf.subarray(this._off),u),this._buf=u}}return this._off=0,this._reslice(Math.min(r+n,wh)),r}grow(n){if(n<0)throw Error("Buffer._grow: negative count");const r=this._grow(n);this._reslice(r)}readFrom(n){let r=0;const s=new Uint8Array(v0);for(;;){const l=this.capacity-this.length<v0,u=l?s:new Uint8Array(this._buf.buffer,this.length),c=n.read(u);if(c===null)return r;l?this.write(u.subarray(0,c)):this._reslice(this.length+c),r+=c}}}var mn;(function(e){e[e.OK=0]="OK",e[e.ERR=1]="ERR",e[e.MSG=2]="MSG",e[e.INFO=3]="INFO",e[e.PING=4]="PING",e[e.PONG=5]="PONG"})(mn||(mn={}));function w0(){const e={};return e.sid=-1,e.hdr=-1,e.size=-1,e}const P2=48;class S0{constructor(n){C(this,"dispatcher");C(this,"state");C(this,"as");C(this,"drop");C(this,"hdr");C(this,"ma");C(this,"argBuf");C(this,"msgBuf");this.dispatcher=n,this.state=ke.OP_START,this.as=0,this.drop=0,this.hdr=0}parse(n){let r;for(r=0;r<n.length;r++){const s=n[r];switch(this.state){case ke.OP_START:switch(s){case Ce.M:case Ce.m:this.state=ke.OP_M,this.hdr=-1,this.ma=w0();break;case Ce.H:case Ce.h:this.state=ke.OP_H,this.hdr=0,this.ma=w0();break;case Ce.P:case Ce.p:this.state=ke.OP_P;break;case Ce.PLUS:this.state=ke.OP_PLUS;break;case Ce.MINUS:this.state=ke.OP_MINUS;break;case Ce.I:case Ce.i:this.state=ke.OP_I;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_H:switch(s){case Ce.M:case Ce.m:this.state=ke.OP_M;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_M:switch(s){case Ce.S:case Ce.s:this.state=ke.OP_MS;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_MS:switch(s){case Ce.G:case Ce.g:this.state=ke.OP_MSG;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_MSG:switch(s){case Ce.SPACE:case Ce.TAB:this.state=ke.OP_MSG_SPC;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_MSG_SPC:switch(s){case Ce.SPACE:case Ce.TAB:continue;default:this.state=ke.MSG_ARG,this.as=r}break;case ke.MSG_ARG:switch(s){case Ce.CR:this.drop=1;break;case Ce.NL:{const l=this.argBuf?this.argBuf.bytes():n.subarray(this.as,r-this.drop);this.processMsgArgs(l),this.drop=0,this.as=r+1,this.state=ke.MSG_PAYLOAD,r=this.as+this.ma.size-1;break}default:this.argBuf&&this.argBuf.writeByte(s)}break;case ke.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){const l=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:mn.MSG,msg:this.ma,data:l}),this.argBuf=void 0,this.msgBuf=void 0,this.state=ke.MSG_END}else{let l=this.ma.size-this.msgBuf.length;const u=n.length-r;u<l&&(l=u),l>0?(this.msgBuf.write(n.subarray(r,r+l)),r=r+l-1):this.msgBuf.writeByte(s)}else r-this.as>=this.ma.size&&(this.dispatcher.push({kind:mn.MSG,msg:this.ma,data:n.subarray(this.as,r)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=ke.MSG_END);break;case ke.MSG_END:switch(s){case Ce.NL:this.drop=0,this.as=r+1,this.state=ke.OP_START;break;default:continue}break;case ke.OP_PLUS:switch(s){case Ce.O:case Ce.o:this.state=ke.OP_PLUS_O;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_PLUS_O:switch(s){case Ce.K:case Ce.k:this.state=ke.OP_PLUS_OK;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_PLUS_OK:switch(s){case Ce.NL:this.dispatcher.push({kind:mn.OK}),this.drop=0,this.state=ke.OP_START;break}break;case ke.OP_MINUS:switch(s){case Ce.E:case Ce.e:this.state=ke.OP_MINUS_E;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_MINUS_E:switch(s){case Ce.R:case Ce.r:this.state=ke.OP_MINUS_ER;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_MINUS_ER:switch(s){case Ce.R:case Ce.r:this.state=ke.OP_MINUS_ERR;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_MINUS_ERR:switch(s){case Ce.SPACE:case Ce.TAB:this.state=ke.OP_MINUS_ERR_SPC;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_MINUS_ERR_SPC:switch(s){case Ce.SPACE:case Ce.TAB:continue;default:this.state=ke.MINUS_ERR_ARG,this.as=r}break;case ke.MINUS_ERR_ARG:switch(s){case Ce.CR:this.drop=1;break;case Ce.NL:{let l;this.argBuf?(l=this.argBuf.bytes(),this.argBuf=void 0):l=n.subarray(this.as,r-this.drop),this.dispatcher.push({kind:mn.ERR,data:l}),this.drop=0,this.as=r+1,this.state=ke.OP_START;break}default:this.argBuf&&this.argBuf.write(Uint8Array.of(s))}break;case ke.OP_P:switch(s){case Ce.I:case Ce.i:this.state=ke.OP_PI;break;case Ce.O:case Ce.o:this.state=ke.OP_PO;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_PO:switch(s){case Ce.N:case Ce.n:this.state=ke.OP_PON;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_PON:switch(s){case Ce.G:case Ce.g:this.state=ke.OP_PONG;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_PONG:switch(s){case Ce.NL:this.dispatcher.push({kind:mn.PONG}),this.drop=0,this.state=ke.OP_START;break}break;case ke.OP_PI:switch(s){case Ce.N:case Ce.n:this.state=ke.OP_PIN;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_PIN:switch(s){case Ce.G:case Ce.g:this.state=ke.OP_PING;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_PING:switch(s){case Ce.NL:this.dispatcher.push({kind:mn.PING}),this.drop=0,this.state=ke.OP_START;break}break;case ke.OP_I:switch(s){case Ce.N:case Ce.n:this.state=ke.OP_IN;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_IN:switch(s){case Ce.F:case Ce.f:this.state=ke.OP_INF;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_INF:switch(s){case Ce.O:case Ce.o:this.state=ke.OP_INFO;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_INFO:switch(s){case Ce.SPACE:case Ce.TAB:this.state=ke.OP_INFO_SPC;break;default:throw this.fail(n.subarray(r))}break;case ke.OP_INFO_SPC:switch(s){case Ce.SPACE:case Ce.TAB:continue;default:this.state=ke.INFO_ARG,this.as=r}break;case ke.INFO_ARG:switch(s){case Ce.CR:this.drop=1;break;case Ce.NL:{let l;this.argBuf?(l=this.argBuf.bytes(),this.argBuf=void 0):l=n.subarray(this.as,r-this.drop),this.dispatcher.push({kind:mn.INFO,data:l}),this.drop=0,this.as=r+1,this.state=ke.OP_START;break}default:this.argBuf&&this.argBuf.writeByte(s)}break;default:throw this.fail(n.subarray(r))}}(this.state===ke.MSG_ARG||this.state===ke.MINUS_ERR_ARG||this.state===ke.INFO_ARG)&&!this.argBuf&&(this.argBuf=new Sh(n.subarray(this.as,r-this.drop))),this.state===ke.MSG_PAYLOAD&&!this.msgBuf&&(this.argBuf||this.cloneMsgArg(),this.msgBuf=new Sh(n.subarray(this.as)))}cloneMsgArg(){const n=this.ma.subject.length,r=this.ma.reply?this.ma.reply.length:0,s=new Uint8Array(n+r);s.set(this.ma.subject),this.ma.reply&&s.set(this.ma.reply,n),this.argBuf=new Sh(s),this.ma.subject=s.subarray(0,n),this.ma.reply&&(this.ma.reply=s.subarray(n))}processMsgArgs(n){if(this.hdr>=0)return this.processHeaderMsgArgs(n);const r=[];let s=-1;for(let l=0;l<n.length;l++)switch(n[l]){case Ce.SPACE:case Ce.TAB:case Ce.CR:case Ce.NL:s>=0&&(r.push(n.subarray(s,l)),s=-1);break;default:s<0&&(s=l)}switch(s>=0&&r.push(n.subarray(s)),r.length){case 3:this.ma.subject=r[0],this.ma.sid=this.protoParseInt(r[1]),this.ma.reply=void 0,this.ma.size=this.protoParseInt(r[2]);break;case 4:this.ma.subject=r[0],this.ma.sid=this.protoParseInt(r[1]),this.ma.reply=r[2],this.ma.size=this.protoParseInt(r[3]);break;default:throw this.fail(n,"processMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(n,"processMsgArgs Bad or Missing Sid Error");if(this.ma.size<0)throw this.fail(n,"processMsgArgs Bad or Missing Size Error")}fail(n,r=""){return r?r=`${r} [${this.state}]`:r=`parse error [${this.state}]`,new Error(`${r}: ${qn.decode(n)}`)}processHeaderMsgArgs(n){const r=[];let s=-1;for(let l=0;l<n.length;l++)switch(n[l]){case Ce.SPACE:case Ce.TAB:case Ce.CR:case Ce.NL:s>=0&&(r.push(n.subarray(s,l)),s=-1);break;default:s<0&&(s=l)}switch(s>=0&&r.push(n.subarray(s)),r.length){case 4:this.ma.subject=r[0],this.ma.sid=this.protoParseInt(r[1]),this.ma.reply=void 0,this.ma.hdr=this.protoParseInt(r[2]),this.ma.size=this.protoParseInt(r[3]);break;case 5:this.ma.subject=r[0],this.ma.sid=this.protoParseInt(r[1]),this.ma.reply=r[2],this.ma.hdr=this.protoParseInt(r[3]),this.ma.size=this.protoParseInt(r[4]);break;default:throw this.fail(n,"processHeaderMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(n,"processHeaderMsgArgs Bad or Missing Sid Error");if(this.ma.hdr<0||this.ma.hdr>this.ma.size)throw this.fail(n,"processHeaderMsgArgs Bad or Missing Header Size Error");if(this.ma.size<0)throw this.fail(n,"processHeaderMsgArgs Bad or Missing Size Error")}protoParseInt(n){if(n.length===0)return-1;let r=0;for(let s=0;s<n.length;s++){if(n[s]<48||n[s]>57)return-1;r=r*10+(n[s]-P2)}return r}}var ke;(function(e){e[e.OP_START=0]="OP_START",e[e.OP_PLUS=1]="OP_PLUS",e[e.OP_PLUS_O=2]="OP_PLUS_O",e[e.OP_PLUS_OK=3]="OP_PLUS_OK",e[e.OP_MINUS=4]="OP_MINUS",e[e.OP_MINUS_E=5]="OP_MINUS_E",e[e.OP_MINUS_ER=6]="OP_MINUS_ER",e[e.OP_MINUS_ERR=7]="OP_MINUS_ERR",e[e.OP_MINUS_ERR_SPC=8]="OP_MINUS_ERR_SPC",e[e.MINUS_ERR_ARG=9]="MINUS_ERR_ARG",e[e.OP_M=10]="OP_M",e[e.OP_MS=11]="OP_MS",e[e.OP_MSG=12]="OP_MSG",e[e.OP_MSG_SPC=13]="OP_MSG_SPC",e[e.MSG_ARG=14]="MSG_ARG",e[e.MSG_PAYLOAD=15]="MSG_PAYLOAD",e[e.MSG_END=16]="MSG_END",e[e.OP_H=17]="OP_H",e[e.OP_P=18]="OP_P",e[e.OP_PI=19]="OP_PI",e[e.OP_PIN=20]="OP_PIN",e[e.OP_PING=21]="OP_PING",e[e.OP_PO=22]="OP_PO",e[e.OP_PON=23]="OP_PON",e[e.OP_PONG=24]="OP_PONG",e[e.OP_I=25]="OP_I",e[e.OP_IN=26]="OP_IN",e[e.OP_INF=27]="OP_INF",e[e.OP_INFO=28]="OP_INFO",e[e.OP_INFO_SPC=29]="OP_INFO_SPC",e[e.INFO_ARG=30]="INFO_ARG"})(ke||(ke={}));var Ce;(function(e){e[e.CR=13]="CR",e[e.E=69]="E",e[e.e=101]="e",e[e.F=70]="F",e[e.f=102]="f",e[e.G=71]="G",e[e.g=103]="g",e[e.H=72]="H",e[e.h=104]="h",e[e.I=73]="I",e[e.i=105]="i",e[e.K=75]="K",e[e.k=107]="k",e[e.M=77]="M",e[e.m=109]="m",e[e.MINUS=45]="MINUS",e[e.N=78]="N",e[e.n=110]="n",e[e.NL=10]="NL",e[e.O=79]="O",e[e.o=111]="o",e[e.P=80]="P",e[e.p=112]="p",e[e.PLUS=43]="PLUS",e[e.R=82]="R",e[e.r=114]="r",e[e.S=83]="S",e[e.s=115]="s",e[e.SPACE=32]="SPACE",e[e.TAB=9]="TAB"})(Ce||(Ce={}));(function(e){var n=function(E,R){this.hi=E|0,this.lo=R|0},r=function(E){var R,j=new Float64Array(16);if(E)for(R=0;R<E.length;R++)j[R]=E[R];return j},s=function(){throw new Error("no PRNG")},l=new Uint8Array(16),u=new Uint8Array(32);u[0]=9;var c=r(),f=r([1]),m=r([56129,1]),d=r([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=r([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=r([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),x=r([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),w=r([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function k(E,R){return E<<R|E>>>32-R}function D(E,R){var j=E[R+3]&255;return j=j<<8|E[R+2]&255,j=j<<8|E[R+1]&255,j<<8|E[R+0]&255}function B(E,R){var j=E[R]<<24|E[R+1]<<16|E[R+2]<<8|E[R+3],U=E[R+4]<<24|E[R+5]<<16|E[R+6]<<8|E[R+7];return new n(j,U)}function L(E,R,j){var U;for(U=0;U<4;U++)E[R+U]=j&255,j>>>=8}function $(E,R,j){E[R]=j.hi>>24&255,E[R+1]=j.hi>>16&255,E[R+2]=j.hi>>8&255,E[R+3]=j.hi&255,E[R+4]=j.lo>>24&255,E[R+5]=j.lo>>16&255,E[R+6]=j.lo>>8&255,E[R+7]=j.lo&255}function T(E,R,j,U,Y){var ee,me=0;for(ee=0;ee<Y;ee++)me|=E[R+ee]^j[U+ee];return(1&me-1>>>8)-1}function te(E,R,j,U){return T(E,R,j,U,16)}function P(E,R,j,U){return T(E,R,j,U,32)}function z(E,R,j,U,Y){var ee=new Uint32Array(16),me=new Uint32Array(16),ye=new Uint32Array(16),le=new Uint32Array(4),de,Ne,Je;for(de=0;de<4;de++)me[5*de]=D(U,4*de),me[1+de]=D(j,4*de),me[6+de]=D(R,4*de),me[11+de]=D(j,16+4*de);for(de=0;de<16;de++)ye[de]=me[de];for(de=0;de<20;de++){for(Ne=0;Ne<4;Ne++){for(Je=0;Je<4;Je++)le[Je]=me[(5*Ne+4*Je)%16];for(le[1]^=k(le[0]+le[3]|0,7),le[2]^=k(le[1]+le[0]|0,9),le[3]^=k(le[2]+le[1]|0,13),le[0]^=k(le[3]+le[2]|0,18),Je=0;Je<4;Je++)ee[4*Ne+(Ne+Je)%4]=le[Je]}for(Je=0;Je<16;Je++)me[Je]=ee[Je]}if(Y){for(de=0;de<16;de++)me[de]=me[de]+ye[de]|0;for(de=0;de<4;de++)me[5*de]=me[5*de]-D(U,4*de)|0,me[6+de]=me[6+de]-D(R,4*de)|0;for(de=0;de<4;de++)L(E,4*de,me[5*de]),L(E,16+4*de,me[6+de])}else for(de=0;de<16;de++)L(E,4*de,me[de]+ye[de]|0)}function X(E,R,j,U){return z(E,R,j,U,!1),0}function Z(E,R,j,U){return z(E,R,j,U,!0),0}var H=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function O(E,R,j,U,Y,ee,me){var ye=new Uint8Array(16),le=new Uint8Array(64),de,Ne;if(!Y)return 0;for(Ne=0;Ne<16;Ne++)ye[Ne]=0;for(Ne=0;Ne<8;Ne++)ye[Ne]=ee[Ne];for(;Y>=64;){for(X(le,ye,me,H),Ne=0;Ne<64;Ne++)E[R+Ne]=(j?j[U+Ne]:0)^le[Ne];for(de=1,Ne=8;Ne<16;Ne++)de=de+(ye[Ne]&255)|0,ye[Ne]=de&255,de>>>=8;Y-=64,R+=64,j&&(U+=64)}if(Y>0)for(X(le,ye,me,H),Ne=0;Ne<Y;Ne++)E[R+Ne]=(j?j[U+Ne]:0)^le[Ne];return 0}function K(E,R,j,U,Y){return O(E,R,null,0,j,U,Y)}function J(E,R,j,U,Y){var ee=new Uint8Array(32);return Z(ee,U,Y,H),K(E,R,j,U.subarray(16),ee)}function se(E,R,j,U,Y,ee,me){var ye=new Uint8Array(32);return Z(ye,ee,me,H),O(E,R,j,U,Y,ee.subarray(16),ye)}function ie(E,R){var j,U=0;for(j=0;j<17;j++)U=U+(E[j]+R[j]|0)|0,E[j]=U&255,U>>>=8}var F=new Uint32Array([5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252]);function q(E,R,j,U,Y,ee){var me,ye,le,de,Ne=new Uint32Array(17),Je=new Uint32Array(17),Nt=new Uint32Array(17),on=new Uint32Array(17),or=new Uint32Array(17);for(le=0;le<17;le++)Je[le]=Nt[le]=0;for(le=0;le<16;le++)Je[le]=ee[le];for(Je[3]&=15,Je[4]&=252,Je[7]&=15,Je[8]&=252,Je[11]&=15,Je[12]&=252,Je[15]&=15;Y>0;){for(le=0;le<17;le++)on[le]=0;for(le=0;le<16&&le<Y;++le)on[le]=j[U+le];for(on[le]=1,U+=le,Y-=le,ie(Nt,on),ye=0;ye<17;ye++)for(Ne[ye]=0,le=0;le<17;le++)Ne[ye]=Ne[ye]+Nt[le]*(le<=ye?Je[ye-le]:320*Je[ye+17-le]|0)|0|0;for(ye=0;ye<17;ye++)Nt[ye]=Ne[ye];for(de=0,le=0;le<16;le++)de=de+Nt[le]|0,Nt[le]=de&255,de>>>=8;for(de=de+Nt[16]|0,Nt[16]=de&3,de=5*(de>>>2)|0,le=0;le<16;le++)de=de+Nt[le]|0,Nt[le]=de&255,de>>>=8;de=de+Nt[16]|0,Nt[16]=de}for(le=0;le<17;le++)or[le]=Nt[le];for(ie(Nt,F),me=-(Nt[16]>>>7)|0,le=0;le<17;le++)Nt[le]^=me&(or[le]^Nt[le]);for(le=0;le<16;le++)on[le]=ee[le+16];for(on[16]=0,ie(Nt,on),le=0;le<16;le++)E[R+le]=Nt[le];return 0}function V(E,R,j,U,Y,ee){var me=new Uint8Array(16);return q(me,0,j,U,Y,ee),te(E,R,me,0)}function ue(E,R,j,U,Y){var ee;if(j<32)return-1;for(se(E,0,R,0,j,U,Y),q(E,16,E,32,j-32,E),ee=0;ee<16;ee++)E[ee]=0;return 0}function xe(E,R,j,U,Y){var ee,me=new Uint8Array(32);if(j<32||(J(me,0,32,U,Y),V(R,16,R,32,j-32,me)!==0))return-1;for(se(E,0,R,0,j,U,Y),ee=0;ee<32;ee++)E[ee]=0;return 0}function S(E,R){var j;for(j=0;j<16;j++)E[j]=R[j]|0}function M(E){var R,j;for(j=0;j<16;j++)E[j]+=65536,R=Math.floor(E[j]/65536),E[(j+1)*(j<15?1:0)]+=R-1+37*(R-1)*(j===15?1:0),E[j]-=R*65536}function W(E,R,j){for(var U,Y=~(j-1),ee=0;ee<16;ee++)U=Y&(E[ee]^R[ee]),E[ee]^=U,R[ee]^=U}function A(E,R){var j,U,Y,ee=r(),me=r();for(j=0;j<16;j++)me[j]=R[j];for(M(me),M(me),M(me),U=0;U<2;U++){for(ee[0]=me[0]-65517,j=1;j<15;j++)ee[j]=me[j]-65535-(ee[j-1]>>16&1),ee[j-1]&=65535;ee[15]=me[15]-32767-(ee[14]>>16&1),Y=ee[15]>>16&1,ee[14]&=65535,W(me,ee,1-Y)}for(j=0;j<16;j++)E[2*j]=me[j]&255,E[2*j+1]=me[j]>>8}function we(E,R){var j=new Uint8Array(32),U=new Uint8Array(32);return A(j,E),A(U,R),P(j,0,U,0)}function Ae(E){var R=new Uint8Array(32);return A(R,E),R[0]&1}function Te(E,R){var j;for(j=0;j<16;j++)E[j]=R[2*j]+(R[2*j+1]<<8);E[15]&=32767}function Me(E,R,j){var U;for(U=0;U<16;U++)E[U]=R[U]+j[U]|0}function He(E,R,j){var U;for(U=0;U<16;U++)E[U]=R[U]-j[U]|0}function be(E,R,j){var U,Y,ee=new Float64Array(31);for(U=0;U<31;U++)ee[U]=0;for(U=0;U<16;U++)for(Y=0;Y<16;Y++)ee[U+Y]+=R[U]*j[Y];for(U=0;U<15;U++)ee[U]+=38*ee[U+16];for(U=0;U<16;U++)E[U]=ee[U];M(E),M(E)}function De(E,R){be(E,R,R)}function Ze(E,R){var j=r(),U;for(U=0;U<16;U++)j[U]=R[U];for(U=253;U>=0;U--)De(j,j),U!==2&&U!==4&&be(j,j,R);for(U=0;U<16;U++)E[U]=j[U]}function dt(E,R){var j=r(),U;for(U=0;U<16;U++)j[U]=R[U];for(U=250;U>=0;U--)De(j,j),U!==1&&be(j,j,R);for(U=0;U<16;U++)E[U]=j[U]}function lt(E,R,j){var U=new Uint8Array(32),Y=new Float64Array(80),ee,me,ye=r(),le=r(),de=r(),Ne=r(),Je=r(),Nt=r();for(me=0;me<31;me++)U[me]=R[me];for(U[31]=R[31]&127|64,U[0]&=248,Te(Y,j),me=0;me<16;me++)le[me]=Y[me],Ne[me]=ye[me]=de[me]=0;for(ye[0]=Ne[0]=1,me=254;me>=0;--me)ee=U[me>>>3]>>>(me&7)&1,W(ye,le,ee),W(de,Ne,ee),Me(Je,ye,de),He(ye,ye,de),Me(de,le,Ne),He(le,le,Ne),De(Ne,Je),De(Nt,ye),be(ye,de,ye),be(de,le,Je),Me(Je,ye,de),He(ye,ye,de),De(le,ye),He(de,Ne,Nt),be(ye,de,m),Me(ye,ye,Ne),be(de,de,ye),be(ye,Ne,Nt),be(Ne,le,Y),De(le,Je),W(ye,le,ee),W(de,Ne,ee);for(me=0;me<16;me++)Y[me+16]=ye[me],Y[me+32]=de[me],Y[me+48]=le[me],Y[me+64]=Ne[me];var on=Y.subarray(32),or=Y.subarray(16);return Ze(on,on),be(or,or,on),A(E,or),0}function ct(E,R){return lt(E,R,u)}function Fe(E,R){return s(R,32),ct(E,R)}function Ue(E,R,j){var U=new Uint8Array(32);return lt(U,j,R),Z(E,l,U,H)}var tt=ue,mt=xe;function st(E,R,j,U,Y,ee){var me=new Uint8Array(32);return Ue(me,Y,ee),tt(E,R,j,U,me)}function Mt(E,R,j,U,Y,ee){var me=new Uint8Array(32);return Ue(me,Y,ee),mt(E,R,j,U,me)}function yt(){var E=0,R=0,j=0,U=0,Y=65535,ee,me,ye;for(ye=0;ye<arguments.length;ye++)ee=arguments[ye].lo,me=arguments[ye].hi,E+=ee&Y,R+=ee>>>16,j+=me&Y,U+=me>>>16;return R+=E>>>16,j+=R>>>16,U+=j>>>16,new n(j&Y|U<<16,E&Y|R<<16)}function Yn(E,R){return new n(E.hi>>>R,E.lo>>>R|E.hi<<32-R)}function gr(){var E=0,R=0,j;for(j=0;j<arguments.length;j++)E^=arguments[j].lo,R^=arguments[j].hi;return new n(R,E)}function vt(E,R){var j,U,Y=32-R;return R<32?(j=E.hi>>>R|E.lo<<Y,U=E.lo>>>R|E.hi<<Y):R<64&&(j=E.lo>>>R|E.hi<<Y,U=E.hi>>>R|E.lo<<Y),new n(j,U)}function An(E,R,j){var U=E.hi&R.hi^~E.hi&j.hi,Y=E.lo&R.lo^~E.lo&j.lo;return new n(U,Y)}function fe(E,R,j){var U=E.hi&R.hi^E.hi&j.hi^R.hi&j.hi,Y=E.lo&R.lo^E.lo&j.lo^R.lo&j.lo;return new n(U,Y)}function Se(E){return gr(vt(E,28),vt(E,34),vt(E,39))}function Be(E){return gr(vt(E,14),vt(E,18),vt(E,41))}function $e(E){return gr(vt(E,1),vt(E,8),Yn(E,7))}function rt(E){return gr(vt(E,19),vt(E,61),Yn(E,6))}var nn=[new n(1116352408,3609767458),new n(1899447441,602891725),new n(3049323471,3964484399),new n(3921009573,2173295548),new n(961987163,4081628472),new n(1508970993,3053834265),new n(2453635748,2937671579),new n(2870763221,3664609560),new n(3624381080,2734883394),new n(310598401,1164996542),new n(607225278,1323610764),new n(1426881987,3590304994),new n(1925078388,4068182383),new n(2162078206,991336113),new n(2614888103,633803317),new n(3248222580,3479774868),new n(3835390401,2666613458),new n(4022224774,944711139),new n(264347078,2341262773),new n(604807628,2007800933),new n(770255983,1495990901),new n(1249150122,1856431235),new n(1555081692,3175218132),new n(1996064986,2198950837),new n(2554220882,3999719339),new n(2821834349,766784016),new n(2952996808,2566594879),new n(3210313671,3203337956),new n(3336571891,1034457026),new n(3584528711,2466948901),new n(113926993,3758326383),new n(338241895,168717936),new n(666307205,1188179964),new n(773529912,1546045734),new n(1294757372,1522805485),new n(1396182291,2643833823),new n(1695183700,2343527390),new n(1986661051,1014477480),new n(2177026350,1206759142),new n(2456956037,344077627),new n(2730485921,1290863460),new n(2820302411,3158454273),new n(3259730800,3505952657),new n(3345764771,106217008),new n(3516065817,3606008344),new n(3600352804,1432725776),new n(4094571909,1467031594),new n(275423344,851169720),new n(430227734,3100823752),new n(506948616,1363258195),new n(659060556,3750685593),new n(883997877,3785050280),new n(958139571,3318307427),new n(1322822218,3812723403),new n(1537002063,2003034995),new n(1747873779,3602036899),new n(1955562222,1575990012),new n(2024104815,1125592928),new n(2227730452,2716904306),new n(2361852424,442776044),new n(2428436474,593698344),new n(2756734187,3733110249),new n(3204031479,2999351573),new n(3329325298,3815920427),new n(3391569614,3928383900),new n(3515267271,566280711),new n(3940187606,3454069534),new n(4118630271,4000239992),new n(116418474,1914138554),new n(174292421,2731055270),new n(289380356,3203993006),new n(460393269,320620315),new n(685471733,587496836),new n(852142971,1086792851),new n(1017036298,365543100),new n(1126000580,2618297676),new n(1288033470,3409855158),new n(1501505948,4234509866),new n(1607167915,987167468),new n(1816402316,1246189591)];function bn(E,R,j){var U=[],Y=[],ee=[],me=[],ye,le,de;for(le=0;le<8;le++)U[le]=ee[le]=B(E,8*le);for(var Ne=0;j>=128;){for(le=0;le<16;le++)me[le]=B(R,8*le+Ne);for(le=0;le<80;le++){for(de=0;de<8;de++)Y[de]=ee[de];for(ye=yt(ee[7],Be(ee[4]),An(ee[4],ee[5],ee[6]),nn[le],me[le%16]),Y[7]=yt(ye,Se(ee[0]),fe(ee[0],ee[1],ee[2])),Y[3]=yt(Y[3],ye),de=0;de<8;de++)ee[(de+1)%8]=Y[de];if(le%16===15)for(de=0;de<16;de++)me[de]=yt(me[de],me[(de+9)%16],$e(me[(de+1)%16]),rt(me[(de+14)%16]))}for(le=0;le<8;le++)ee[le]=yt(ee[le],U[le]),U[le]=ee[le];Ne+=128,j-=128}for(le=0;le<8;le++)$(E,8*le,U[le]);return j}var Yt=new Uint8Array([106,9,230,103,243,188,201,8,187,103,174,133,132,202,167,59,60,110,243,114,254,148,248,43,165,79,245,58,95,29,54,241,81,14,82,127,173,230,130,209,155,5,104,140,43,62,108,31,31,131,217,171,251,65,189,107,91,224,205,25,19,126,33,121]);function ge(E,R,j){var U=new Uint8Array(64),Y=new Uint8Array(256),ee,me=j;for(ee=0;ee<64;ee++)U[ee]=Yt[ee];for(bn(U,R,j),j%=128,ee=0;ee<256;ee++)Y[ee]=0;for(ee=0;ee<j;ee++)Y[ee]=R[me-j+ee];for(Y[j]=128,j=256-128*(j<112?1:0),Y[j-9]=0,$(Y,j-8,new n(me/536870912|0,me<<3)),bn(U,Y,j),ee=0;ee<64;ee++)E[ee]=U[ee];return 0}function ze(E,R){var j=r(),U=r(),Y=r(),ee=r(),me=r(),ye=r(),le=r(),de=r(),Ne=r();He(j,E[1],E[0]),He(Ne,R[1],R[0]),be(j,j,Ne),Me(U,E[0],E[1]),Me(Ne,R[0],R[1]),be(U,U,Ne),be(Y,E[3],R[3]),be(Y,Y,y),be(ee,E[2],R[2]),Me(ee,ee,ee),He(me,U,j),He(ye,ee,Y),Me(le,ee,Y),Me(de,U,j),be(E[0],me,ye),be(E[1],de,le),be(E[2],le,ye),be(E[3],me,de)}function _e(E,R,j){var U;for(U=0;U<4;U++)W(E[U],R[U],j)}function ft(E,R){var j=r(),U=r(),Y=r();Ze(Y,R[2]),be(j,R[0],Y),be(U,R[1],Y),A(E,U),E[31]^=Ae(j)<<7}function pt(E,R,j){var U,Y;for(S(E[0],c),S(E[1],f),S(E[2],f),S(E[3],c),Y=255;Y>=0;--Y)U=j[Y/8|0]>>(Y&7)&1,_e(E,R,U),ze(R,E),ze(E,E),_e(E,R,U)}function Tn(E,R){var j=[r(),r(),r(),r()];S(j[0],g),S(j[1],x),S(j[2],f),be(j[3],g,x),pt(E,j,R)}function ri(E,R,j){var U=new Uint8Array(64),Y=[r(),r(),r(),r()],ee;for(j||s(R,32),ge(U,R,32),U[0]&=248,U[31]&=127,U[31]|=64,Tn(Y,U),ft(E,Y),ee=0;ee<32;ee++)R[ee+32]=E[ee];return 0}var Nr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ii(E,R){var j,U,Y,ee;for(U=63;U>=32;--U){for(j=0,Y=U-32,ee=U-12;Y<ee;++Y)R[Y]+=j-16*R[U]*Nr[Y-(U-32)],j=Math.floor((R[Y]+128)/256),R[Y]-=j*256;R[Y]+=j,R[U]=0}for(j=0,Y=0;Y<32;Y++)R[Y]+=j-(R[31]>>4)*Nr[Y],j=R[Y]>>8,R[Y]&=255;for(Y=0;Y<32;Y++)R[Y]-=j*Nr[Y];for(U=0;U<32;U++)R[U+1]+=R[U]>>8,E[U]=R[U]&255}function ar(E){var R=new Float64Array(64),j;for(j=0;j<64;j++)R[j]=E[j];for(j=0;j<64;j++)E[j]=0;ii(E,R)}function Ii(E,R,j,U){var Y=new Uint8Array(64),ee=new Uint8Array(64),me=new Uint8Array(64),ye,le,de=new Float64Array(64),Ne=[r(),r(),r(),r()];ge(Y,U,32),Y[0]&=248,Y[31]&=127,Y[31]|=64;var Je=j+64;for(ye=0;ye<j;ye++)E[64+ye]=R[ye];for(ye=0;ye<32;ye++)E[32+ye]=Y[32+ye];for(ge(me,E.subarray(32),j+32),ar(me),Tn(Ne,me),ft(E,Ne),ye=32;ye<64;ye++)E[ye]=U[ye];for(ge(ee,E,j+64),ar(ee),ye=0;ye<64;ye++)de[ye]=0;for(ye=0;ye<32;ye++)de[ye]=me[ye];for(ye=0;ye<32;ye++)for(le=0;le<32;le++)de[ye+le]+=ee[ye]*Y[le];return ii(E.subarray(32),de),Je}function Fi(E,R){var j=r(),U=r(),Y=r(),ee=r(),me=r(),ye=r(),le=r();return S(E[2],f),Te(E[1],R),De(Y,E[1]),be(ee,Y,d),He(Y,Y,E[2]),Me(ee,E[2],ee),De(me,ee),De(ye,me),be(le,ye,me),be(j,le,Y),be(j,j,ee),dt(j,j),be(j,j,Y),be(j,j,ee),be(j,j,ee),be(E[0],j,ee),De(U,E[0]),be(U,U,ee),we(U,Y)&&be(E[0],E[0],w),De(U,E[0]),be(U,U,ee),we(U,Y)?-1:(Ae(E[0])===R[31]>>7&&He(E[0],c,E[0]),be(E[3],E[0],E[1]),0)}function ka(E,R,j,U){var Y,ee=new Uint8Array(32),me=new Uint8Array(64),ye=[r(),r(),r(),r()],le=[r(),r(),r(),r()];if(j<64||Fi(le,U))return-1;for(Y=0;Y<j;Y++)E[Y]=R[Y];for(Y=0;Y<32;Y++)E[Y+32]=U[Y];if(ge(me,E,j),ar(me),pt(ye,le,me),Tn(le,R.subarray(32)),ze(ye,le),ft(ee,ye),j-=64,P(R,0,ee,0)){for(Y=0;Y<j;Y++)E[Y]=0;return-1}for(Y=0;Y<j;Y++)E[Y]=R[Y+64];return j}var gs=32,si=24,lr=32,ai=16,li=32,$i=32,oi=32,Or=32,Yi=32,Ca=si,Xl=lr,yr=ai,Ct=64,Pt=32,jn=64,Gi=32,Aa=64;e.lowlevel={crypto_core_hsalsa20:Z,crypto_stream_xor:se,crypto_stream:J,crypto_stream_salsa20_xor:O,crypto_stream_salsa20:K,crypto_onetimeauth:q,crypto_onetimeauth_verify:V,crypto_verify_16:te,crypto_verify_32:P,crypto_secretbox:ue,crypto_secretbox_open:xe,crypto_scalarmult:lt,crypto_scalarmult_base:ct,crypto_box_beforenm:Ue,crypto_box_afternm:tt,crypto_box:st,crypto_box_open:Mt,crypto_box_keypair:Fe,crypto_hash:ge,crypto_sign:Ii,crypto_sign_keypair:ri,crypto_sign_open:ka,crypto_secretbox_KEYBYTES:gs,crypto_secretbox_NONCEBYTES:si,crypto_secretbox_ZEROBYTES:lr,crypto_secretbox_BOXZEROBYTES:ai,crypto_scalarmult_BYTES:li,crypto_scalarmult_SCALARBYTES:$i,crypto_box_PUBLICKEYBYTES:oi,crypto_box_SECRETKEYBYTES:Or,crypto_box_BEFORENMBYTES:Yi,crypto_box_NONCEBYTES:Ca,crypto_box_ZEROBYTES:Xl,crypto_box_BOXZEROBYTES:yr,crypto_sign_BYTES:Ct,crypto_sign_PUBLICKEYBYTES:Pt,crypto_sign_SECRETKEYBYTES:jn,crypto_sign_SEEDBYTES:Gi,crypto_hash_BYTES:Aa,gf:r,D:d,L:Nr,pack25519:A,unpack25519:Te,M:be,A:Me,S:De,Z:He,pow2523:dt,add:ze,set25519:S,modL:ii,scalarmult:pt,scalarbase:Tn};function Kl(E,R){if(E.length!==gs)throw new Error("bad key size");if(R.length!==si)throw new Error("bad nonce size")}function Ql(E,R){if(E.length!==oi)throw new Error("bad public key size");if(R.length!==Or)throw new Error("bad secret key size")}function Qt(){for(var E=0;E<arguments.length;E++)if(!(arguments[E]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function ys(E){for(var R=0;R<E.length;R++)E[R]=0}e.randomBytes=function(E){var R=new Uint8Array(E);return s(R,E),R},e.secretbox=function(E,R,j){Qt(E,R,j),Kl(j,R);for(var U=new Uint8Array(lr+E.length),Y=new Uint8Array(U.length),ee=0;ee<E.length;ee++)U[ee+lr]=E[ee];return ue(Y,U,U.length,R,j),Y.subarray(ai)},e.secretbox.open=function(E,R,j){Qt(E,R,j),Kl(j,R);for(var U=new Uint8Array(ai+E.length),Y=new Uint8Array(U.length),ee=0;ee<E.length;ee++)U[ee+ai]=E[ee];return U.length<32||xe(Y,U,U.length,R,j)!==0?null:Y.subarray(lr)},e.secretbox.keyLength=gs,e.secretbox.nonceLength=si,e.secretbox.overheadLength=ai,e.scalarMult=function(E,R){if(Qt(E,R),E.length!==$i)throw new Error("bad n size");if(R.length!==li)throw new Error("bad p size");var j=new Uint8Array(li);return lt(j,E,R),j},e.scalarMult.base=function(E){if(Qt(E),E.length!==$i)throw new Error("bad n size");var R=new Uint8Array(li);return ct(R,E),R},e.scalarMult.scalarLength=$i,e.scalarMult.groupElementLength=li,e.box=function(E,R,j,U){var Y=e.box.before(j,U);return e.secretbox(E,R,Y)},e.box.before=function(E,R){Qt(E,R),Ql(E,R);var j=new Uint8Array(Yi);return Ue(j,E,R),j},e.box.after=e.secretbox,e.box.open=function(E,R,j,U){var Y=e.box.before(j,U);return e.secretbox.open(E,R,Y)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var E=new Uint8Array(oi),R=new Uint8Array(Or);return Fe(E,R),{publicKey:E,secretKey:R}},e.box.keyPair.fromSecretKey=function(E){if(Qt(E),E.length!==Or)throw new Error("bad secret key size");var R=new Uint8Array(oi);return ct(R,E),{publicKey:R,secretKey:new Uint8Array(E)}},e.box.publicKeyLength=oi,e.box.secretKeyLength=Or,e.box.sharedKeyLength=Yi,e.box.nonceLength=Ca,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(E,R){if(Qt(E,R),R.length!==jn)throw new Error("bad secret key size");var j=new Uint8Array(Ct+E.length);return Ii(j,E,E.length,R),j},e.sign.open=function(E,R){if(Qt(E,R),R.length!==Pt)throw new Error("bad public key size");var j=new Uint8Array(E.length),U=ka(j,E,E.length,R);if(U<0)return null;for(var Y=new Uint8Array(U),ee=0;ee<Y.length;ee++)Y[ee]=j[ee];return Y},e.sign.detached=function(E,R){for(var j=e.sign(E,R),U=new Uint8Array(Ct),Y=0;Y<U.length;Y++)U[Y]=j[Y];return U},e.sign.detached.verify=function(E,R,j){if(Qt(E,R,j),R.length!==Ct)throw new Error("bad signature size");if(j.length!==Pt)throw new Error("bad public key size");var U=new Uint8Array(Ct+E.length),Y=new Uint8Array(Ct+E.length),ee;for(ee=0;ee<Ct;ee++)U[ee]=R[ee];for(ee=0;ee<E.length;ee++)U[ee+Ct]=E[ee];return ka(Y,U,U.length,j)>=0},e.sign.keyPair=function(){var E=new Uint8Array(Pt),R=new Uint8Array(jn);return ri(E,R),{publicKey:E,secretKey:R}},e.sign.keyPair.fromSecretKey=function(E){if(Qt(E),E.length!==jn)throw new Error("bad secret key size");for(var R=new Uint8Array(Pt),j=0;j<R.length;j++)R[j]=E[32+j];return{publicKey:R,secretKey:new Uint8Array(E)}},e.sign.keyPair.fromSeed=function(E){if(Qt(E),E.length!==Gi)throw new Error("bad seed size");for(var R=new Uint8Array(Pt),j=new Uint8Array(jn),U=0;U<32;U++)j[U]=E[U];return ri(R,j,!0),{publicKey:R,secretKey:j}},e.sign.publicKeyLength=Pt,e.sign.secretKeyLength=jn,e.sign.seedLength=Gi,e.sign.signatureLength=Ct,e.hash=function(E){Qt(E);var R=new Uint8Array(Aa);return ge(R,E,E.length),R},e.hash.hashLength=Aa,e.verify=function(E,R){return Qt(E,R),E.length===0||R.length===0||E.length!==R.length?!1:T(E,0,R,0,E.length)===0},e.setPRNG=function(E){s=E},(function(){var E=typeof globalThis<"u"?globalThis.crypto||globalThis.msCrypto:null;if(E&&E.getRandomValues){var R=65536;e.setPRNG(function(j,U){var Y,ee=new Uint8Array(U);for(Y=0;Y<U;Y+=R)E.getRandomValues(ee.subarray(Y,Y+Math.min(U-Y,R)));for(Y=0;Y<U;Y++)j[Y]=ee[Y];ys(ee)})}else typeof require<"u"&&(E=require("crypto"),E&&E.randomBytes&&e.setPRNG(function(j,U){var Y,ee=E.randomBytes(U);for(Y=0;Y<U;Y++)j[Y]=ee[Y];ys(ee)}))})()})(typeof module<"u"&&module.exports?module.exports:globalThis.nacl=globalThis.nacl||{});const hu=typeof module<"u"&&module.exports?module.exports:globalThis.nacl,q2={fromSeed:hu.sign.keyPair.fromSeed,sign:hu.sign.detached,verify:hu.sign.detached.verify,randomBytes:hu.randomBytes};let mx;function H2(e){mx=e}function Di(){return mx}const I2=new Uint16Array([0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920]);class Mu{static checksum(n){let r=0;for(let s=0;s<n.byteLength;s++){let l=n[s];r=r<<8&65535^I2[(r>>8^l)&255]}return r}static validate(n,r){return Mu.checksum(n)==r}}const _h="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";class _0{static encode(n){let r=0,s=0,l=new Uint8Array(n),u=new Uint8Array(n.byteLength*2),c=0;for(let f=0;f<l.byteLength;f++)for(s=s<<8|l[f],r+=8;r>=5;){let m=s>>>r-5&31;u[c++]=_h.charAt(m).charCodeAt(0),r-=5}if(r>0){let f=s<<5-r&31;u[c++]=_h.charAt(f).charCodeAt(0)}return u.slice(0,c)}static decode(n){let r=0,s=0,l=0,u=new Uint8Array(n),c=new Uint8Array(u.byteLength*5/8|0);for(let f=0;f<u.byteLength;f++){let m=String.fromCharCode(u[f]),d=_h.indexOf(m);if(d===-1)throw new Error("Illegal Base32 character: "+u[f]);s=s<<5|d,r+=5,r>=8&&(c[l++]=s>>>r-8&255,r-=8)}return c.slice(0,l)}}class kt extends Error{constructor(r,s){super(r);C(this,"name");C(this,"code");C(this,"chainedError");this.name="NKeysError",this.code=r,this.chainedError=s}}function F2(){return Vu(Et.Operator)}function $2(){return Vu(Et.Account)}function Y2(){return Vu(Et.User)}var gt;(function(e){e.InvalidPrefixByte="nkeys: invalid prefix byte",e.InvalidKey="nkeys: invalid key",e.InvalidPublicKey="nkeys: invalid public key",e.InvalidSeedLen="nkeys: invalid seed length",e.InvalidSeed="nkeys: invalid seed",e.InvalidEncoding="nkeys: invalid encoded key",e.InvalidSignature="nkeys: signature verification failed",e.CannotSign="nkeys: cannot sign, no private key available",e.PublicKeyOnly="nkeys: no seed or private key available",e.InvalidChecksum="nkeys: invalid checksum",e.SerializationError="nkeys: serialization error",e.ApiError="nkeys: api error",e.ClearedPair="nkeys: pair is cleared"})(gt||(gt={}));var Et;(function(e){e[e.Seed=144]="Seed",e[e.Private=120]="Private",e[e.Operator=112]="Operator",e[e.Server=104]="Server",e[e.Cluster=16]="Cluster",e[e.Account=0]="Account",e[e.User=160]="User"})(Et||(Et={}));class ia{static isValidPublicPrefix(n){return n==Et.Server||n==Et.Operator||n==Et.Cluster||n==Et.Account||n==Et.User}static startsWithValidPrefix(n){let r=n[0];return r=="S"||r=="P"||r=="O"||r=="N"||r=="C"||r=="A"||r=="U"}static isValidPrefix(n){return this.parsePrefix(n)!=-1}static parsePrefix(n){switch(n){case Et.Seed:return Et.Seed;case Et.Private:return Et.Private;case Et.Operator:return Et.Operator;case Et.Server:return Et.Server;case Et.Cluster:return Et.Cluster;case Et.Account:return Et.Account;case Et.User:return Et.User;default:return-1}}}class pn{static encode(n,r){if(!r||!(r instanceof Uint8Array))throw new kt(gt.SerializationError);if(!ia.isValidPrefix(n))throw new kt(gt.InvalidPrefixByte);return pn._encode(!1,n,r)}static encodeSeed(n,r){if(!r)throw new kt(gt.ApiError);if(!ia.isValidPublicPrefix(n))throw new kt(gt.InvalidPrefixByte);if(r.byteLength!==32)throw new kt(gt.InvalidSeedLen);return pn._encode(!0,n,r)}static decode(n,r){if(!ia.isValidPrefix(n))throw new kt(gt.InvalidPrefixByte);const s=pn._decode(r);if(s[0]!==n)throw new kt(gt.InvalidPrefixByte);return s.slice(1)}static decodeSeed(n){const r=pn._decode(n),s=pn._decodePrefix(r);if(s[0]!=Et.Seed)throw new kt(gt.InvalidSeed);if(!ia.isValidPublicPrefix(s[1]))throw new kt(gt.InvalidPrefixByte);return{buf:r.slice(2),prefix:s[1]}}static _encode(n,r,s){const l=n?2:1,u=s.byteLength,c=l+u+2,f=l+u,m=new Uint8Array(c);if(n){const g=pn._encodePrefix(Et.Seed,r);m.set(g)}else m[0]=r;m.set(s,l);const d=Mu.checksum(m.slice(0,f));return new DataView(m.buffer).setUint16(f,d,!0),_0.encode(m)}static _decode(n){if(n.byteLength<4)throw new kt(gt.InvalidEncoding);let r;try{r=_0.decode(n)}catch(f){throw new kt(gt.InvalidEncoding,f)}const s=r.byteLength-2,u=new DataView(r.buffer).getUint16(s,!0),c=r.slice(0,s);if(!Mu.validate(c,u))throw new kt(gt.InvalidChecksum);return c}static _encodePrefix(n,r){const s=n|r>>5,l=(r&31)<<3;return new Uint8Array([s,l])}static _decodePrefix(n){const r=n[0]&248,s=(n[0]&7)<<5|(n[1]&248)>>3;return new Uint8Array([r,s])}}class px{constructor(n){C(this,"seed");this.seed=n}getRawSeed(){if(!this.seed)throw new kt(gt.ClearedPair);return pn.decodeSeed(this.seed).buf}getSeed(){if(!this.seed)throw new kt(gt.ClearedPair);return this.seed}getPublicKey(){if(!this.seed)throw new kt(gt.ClearedPair);const n=pn.decodeSeed(this.seed),r=Di().fromSeed(this.getRawSeed()),s=pn.encode(n.prefix,r.publicKey);return new TextDecoder().decode(s)}getPrivateKey(){if(!this.seed)throw new kt(gt.ClearedPair);const n=Di().fromSeed(this.getRawSeed());return pn.encode(Et.Private,n.secretKey)}sign(n){if(!this.seed)throw new kt(gt.ClearedPair);const r=Di().fromSeed(this.getRawSeed());return Di().sign(n,r.secretKey)}verify(n,r){if(!this.seed)throw new kt(gt.ClearedPair);const s=Di().fromSeed(this.getRawSeed());return Di().verify(n,r,s.publicKey)}clear(){this.seed&&(this.seed.fill(0),this.seed=void 0)}}function Vu(e){const n=Di().randomBytes(32);let r=pn.encodeSeed(e,new Uint8Array(n));return new px(r)}class G2{constructor(n){C(this,"publicKey");this.publicKey=n}getPublicKey(){if(!this.publicKey)throw new kt(gt.ClearedPair);return new TextDecoder().decode(this.publicKey)}getPrivateKey(){throw this.publicKey?new kt(gt.PublicKeyOnly):new kt(gt.ClearedPair)}getSeed(){throw this.publicKey?new kt(gt.PublicKeyOnly):new kt(gt.ClearedPair)}sign(n){throw this.publicKey?new kt(gt.CannotSign):new kt(gt.ClearedPair)}verify(n,r){if(!this.publicKey)throw new kt(gt.ClearedPair);let s=pn._decode(this.publicKey);return Di().verify(n,r,s.slice(1))}clear(){this.publicKey&&(this.publicKey.fill(0),this.publicKey=void 0)}}function V2(e){const n=new TextEncoder().encode(e),r=pn._decode(n),s=ia.parsePrefix(r[0]);if(ia.isValidPublicPrefix(s))return new G2(n);throw new kt(gt.InvalidPublicKey)}function J2(e){return pn.decodeSeed(e),new px(e)}function X2(e){return btoa(String.fromCharCode(...e))}function K2(e){const n=atob(e),r=new Uint8Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r}H2(q2);const E0={createAccount:$2,createOperator:F2,createPair:Vu,createUser:Y2,fromPublic:V2,fromSeed:J2,NKeysError:kt,NKeysErrorCode:gt,Prefix:Et,decode:K2,encode:X2};function Q2(e){return n=>{let r={};return e.forEach(s=>{const l=s(n)||{};r=Object.assign(r,l)}),r}}function Z2(){return()=>{}}function W2(e,n){return()=>{const r=typeof e=="function"?e():e,s=typeof n=="function"?n():n;return{user:r,pass:s}}}function eE(e){return()=>({auth_token:typeof e=="function"?e():e})}function tE(e){return n=>{const r=typeof e=="function"?e():e,s=r?E0.fromSeed(r):void 0,l=s?s.getPublicKey():"",u=qi.encode(n||""),c=s!==void 0&&n?s.sign(u):void 0,f=c?E0.encode(c):"";return{nkey:l,sig:f}}}function gx(e,n){return r=>{const s=typeof e=="function"?e():e,l=tE(n),{nkey:u,sig:c}=l(r);return{jwt:s,nkey:u,sig:c}}}const yx=120*1e3,nE=2,bx=2*1e3;function rE(){return{maxPingOut:2,maxReconnectAttempts:10,noRandomize:!1,pedantic:!1,pingInterval:yx,reconnect:!0,reconnectJitter:100,reconnectJitterTLS:1e3,reconnectTimeWait:bx,tls:void 0,verbose:!1,waitOnFirstConnect:!1,ignoreAuthErrorAbort:!1}}function iE(e){const n=[];return typeof e.authenticator=="function"&&n.push(e.authenticator),Array.isArray(e.authenticator)&&n.push(...e.authenticator),e.token&&n.push(eE(e.token)),e.user&&n.push(W2(e.user,e.pass)),n.length===0?Z2():Q2(n)}function sE(e){const n=`${Zh}:${fx()}`;if(e=e||{servers:[n]},e.servers=e.servers||[],typeof e.servers=="string"&&(e.servers=[e.servers]),e.servers.length>0&&e.port)throw new je("port and servers options are mutually exclusive",Ee.InvalidOption);e.servers.length===0&&e.port&&(e.servers=[`${Zh}:${e.port}`]),e.servers&&e.servers.length===0&&(e.servers=[n]);const r=$u(rE(),e);if(r.authenticator=iE(r),["reconnectDelayHandler","authenticator"].forEach(s=>{if(r[s]&&typeof r[s]!="function")throw new je(`${s} option should be a function`,Ee.NotFunction)}),r.reconnectDelayHandler||(r.reconnectDelayHandler=()=>{let s=r.tls?r.reconnectJitterTLS:r.reconnectJitter;return s&&(s++,s=Math.floor(Math.random()*s)),r.reconnectTimeWait+s}),r.inboxPrefix)try{Zr(r.inboxPrefix)}catch(s){throw new je(s.message,Ee.ApiError)}if(r.resolve===void 0&&(r.resolve=typeof sd()=="function"),r.resolve&&typeof sd()!="function")throw new je("'resolve' is not supported on this client",Ee.InvalidOption);return r}function aE(e,n){const{proto:r,tls_required:s,tls_available:l}=e;if((r===void 0||r<1)&&n.noEcho)throw new je("noEcho",Ee.ServerOptionNotAvailable);const u=s||l||!1;if(n.tls&&!u)throw new je("tls",Ee.ServerOptionNotAvailable)}const lE=1024*32,oE=/^INFO\s+([^\r\n]+)\r\n/i,uE=Al(`PONG\r
72
+ `),k0=Al(`PING\r
73
+ `);class cE{constructor(n,r,s){C(this,"echo");C(this,"no_responders");C(this,"protocol");C(this,"verbose");C(this,"pedantic");C(this,"jwt");C(this,"nkey");C(this,"sig");C(this,"user");C(this,"pass");C(this,"auth_token");C(this,"tls_required");C(this,"name");C(this,"lang");C(this,"version");C(this,"headers");this.protocol=1,this.version=n.version,this.lang=n.lang,this.echo=r.noEcho?!1:void 0,this.verbose=r.verbose,this.pedantic=r.pedantic,this.tls_required=r.tls?!0:void 0,this.name=r.name;const l=(r&&typeof r.authenticator=="function"?r.authenticator(s):{})||{};$u(this,l)}}class xx extends tn{constructor(r,s,l={}){var c;super();C(this,"sid");C(this,"queue");C(this,"draining");C(this,"max");C(this,"subject");C(this,"drained");C(this,"protocol");C(this,"timer");C(this,"info");C(this,"cleanupFn");C(this,"closed");C(this,"requestSubject");$u(this,l),this.protocol=r,this.subject=s,this.draining=!1,this.noIterator=typeof l.callback=="function",this.closed=zt();const u=!((c=r.options)!=null&&c.noAsyncTraces);l.timeout&&(this.timer=da(l.timeout,u),this.timer.then(()=>{this.timer=void 0}).catch(f=>{this.stop(f),this.noIterator&&this.callback(f,{})})),this.noIterator||this.iterClosed.then(()=>{this.closed.resolve(),this.unsubscribe()})}setPrePostHandlers(r){if(this.noIterator){const s=this.callback,l=r.ingestionFilterFn?r.ingestionFilterFn:()=>({ingest:!0,protocol:!1}),u=r.protocolFilterFn?r.protocolFilterFn:()=>!0,c=r.dispatchedFn?r.dispatchedFn:()=>{};this.callback=(f,m)=>{const{ingest:d}=l(m);d&&u(m)&&(s(f,m),c(m))}}else this.protocolFilterFn=r.protocolFilterFn,this.dispatchedFn=r.dispatchedFn}callback(r,s){this.cancelTimeout(),r?this.stop(r):this.push(s)}close(){if(!this.isClosed()){this.cancelTimeout();const r=()=>{if(this.stop(),this.cleanupFn)try{this.cleanupFn(this,this.info)}catch{}this.closed.resolve()};this.noIterator?r():this.push(r)}}unsubscribe(r){this.protocol.unsubscribe(this,r)}cancelTimeout(){this.timer&&(this.timer.cancel(),this.timer=void 0)}drain(){return this.protocol.isClosed()?Promise.reject(je.errorForCode(Ee.ConnectionClosed)):this.isClosed()?Promise.reject(je.errorForCode(Ee.SubClosed)):(this.drained||(this.draining=!0,this.protocol.unsub(this),this.drained=this.protocol.flush(zt()).then(()=>{this.protocol.subscriptions.cancel(this)}).catch(()=>{this.protocol.subscriptions.cancel(this)})),this.drained)}isDraining(){return this.draining}isClosed(){return this.done}getSubject(){return this.subject}getMax(){return this.max}getID(){return this.sid}}class fE{constructor(){C(this,"mux");C(this,"subs");C(this,"sidCounter");this.sidCounter=0,this.mux=null,this.subs=new Map}size(){return this.subs.size}add(n){return this.sidCounter++,n.sid=this.sidCounter,this.subs.set(n.sid,n),n}setMux(n){return this.mux=n,n}getMux(){return this.mux}get(n){return this.subs.get(n)}resub(n){return this.sidCounter++,this.subs.delete(n.sid),n.sid=this.sidCounter,this.subs.set(n.sid,n),n}all(){return Array.from(this.subs.values())}cancel(n){n&&(n.close(),this.subs.delete(n.sid))}handleError(n){if(n&&n.permissionContext){const r=n.permissionContext,s=this.all();let l;if(r.operation==="subscription"&&(l=s.find(u=>u.subject===r.subject&&u.queue===r.queue)),r.operation==="publish"&&(l=s.find(u=>u.requestSubject===r.subject)),l)return l.callback(n,{}),l.close(),this.subs.delete(l.sid),l!==this.mux}return!1}close(){this.subs.forEach(n=>{n.close()})}}class Du{constructor(n,r){C(this,"connected");C(this,"connectedOnce");C(this,"infoReceived");C(this,"info");C(this,"muxSubscriptions");C(this,"options");C(this,"outbound");C(this,"pongs");C(this,"subscriptions");C(this,"transport");C(this,"noMorePublishing");C(this,"connectError");C(this,"publisher");C(this,"_closed");C(this,"closed");C(this,"listeners");C(this,"heartbeats");C(this,"parser");C(this,"outMsgs");C(this,"inMsgs");C(this,"outBytes");C(this,"inBytes");C(this,"pendingLimit");C(this,"lastError");C(this,"abortReconnect");C(this,"whyClosed");C(this,"servers");C(this,"server");C(this,"features");C(this,"connectPromise");this._closed=!1,this.connected=!1,this.connectedOnce=!1,this.infoReceived=!1,this.noMorePublishing=!1,this.abortReconnect=!1,this.listeners=[],this.pendingLimit=lE,this.outMsgs=0,this.inMsgs=0,this.outBytes=0,this.inBytes=0,this.options=n,this.publisher=r,this.subscriptions=new fE,this.muxSubscriptions=new L2,this.outbound=new pa,this.pongs=[],this.whyClosed="",this.pendingLimit=n.pendingLimit||this.pendingLimit,this.features=new p2({major:0,minor:0,micro:0}),this.connectPromise=null;const s=typeof n.servers=="string"?[n.servers]:n.servers;this.servers=new D2(s,{randomize:!n.noRandomize}),this.closed=zt(),this.parser=new S0(this),this.heartbeats=new z2(this,this.options.pingInterval||yx,this.options.maxPingOut||nE)}resetOutbound(){this.outbound.reset();const n=this.pongs;this.pongs=[];const r=je.errorForCode(Ee.Disconnect);r.stack="",n.forEach(s=>{s.reject(r)}),this.parser=new S0(this),this.infoReceived=!1}dispatchStatus(n){this.listeners.forEach(r=>{r.push(n)})}status(){const n=new tn;return this.listeners.push(n),n}prepare(){this.transport&&this.transport.discard(),this.info=void 0,this.resetOutbound();const n=zt();return n.catch(()=>{}),this.pongs.unshift(n),this.connectError=r=>{n.reject(r)},this.transport=b2(),this.transport.closed().then(async r=>{if(this.connected=!1,!this.isClosed()){await this.disconnected(this.transport.closeError||this.lastError);return}}),n}disconnect(){this.dispatchStatus({type:sa.StaleConnection,data:""}),this.transport.disconnect()}reconnect(){return this.connected&&(this.dispatchStatus({type:sa.ClientInitiatedReconnect,data:""}),this.transport.disconnect()),Promise.resolve()}async disconnected(n){this.dispatchStatus({type:Kr.Disconnect,data:this.servers.getCurrentServer().toString()}),this.options.reconnect?await this.dialLoop().then(()=>{var r;this.dispatchStatus({type:Kr.Reconnect,data:this.servers.getCurrentServer().toString()}),((r=this.lastError)==null?void 0:r.code)===Ee.AuthenticationExpired&&(this.lastError=void 0)}).catch(r=>{this._close(r)}):await this._close(n)}async dial(n){const r=this.prepare();let s;try{s=da(this.options.timeout||2e4);const l=this.transport.connect(n,this.options);await Promise.race([l,s]),(async()=>{try{for await(const u of this.transport)this.parser.parse(u)}catch(u){console.log("reader closed",u)}})().then()}catch(l){r.reject(l)}try{await Promise.race([s,r]),s&&s.cancel(),this.connected=!0,this.connectError=void 0,this.sendSubscriptions(),this.connectedOnce=!0,this.server.didConnect=!0,this.server.reconnects=0,this.flushPending(),this.heartbeats.start()}catch(l){throw s&&s.cancel(),await this.transport.close(l),l}}async _doDial(n){const{resolve:r}=this.options,s=await n.resolve({fn:sd(),debug:this.options.debug,randomize:!this.options.noRandomize,resolve:r});let l=null;for(const u of s)try{l=null,this.dispatchStatus({type:sa.Reconnecting,data:u.toString()}),await this.dial(u);return}catch(c){l=c}throw l}dialLoop(){return this.connectPromise===null&&(this.connectPromise=this.dodialLoop(),this.connectPromise.then(()=>{}).catch(()=>{}).finally(()=>{this.connectPromise=null})),this.connectPromise}async dodialLoop(){let n;for(;;){this._closed&&this.servers.clear();const r=this.options.reconnectDelayHandler?this.options.reconnectDelayHandler():bx;let s=r;const l=this.selectServer();if(!l||this.abortReconnect)throw n||(this.lastError?this.lastError:je.errorForCode(Ee.ConnectionRefused));const u=Date.now();if(l.lastConnect===0||l.lastConnect+r<=u){l.lastConnect=Date.now();try{await this._doDial(l);break}catch(c){if(n=c,!this.connectedOnce){if(this.options.waitOnFirstConnect)continue;this.servers.removeCurrentServer()}l.reconnects++;const f=this.options.maxReconnectAttempts||0;f!==-1&&l.reconnects>=f&&this.servers.removeCurrentServer()}}else s=Math.min(s,l.lastConnect+r-u),await wa(s)}}static async connect(n,r){const s=new Du(n,r);return await s.dialLoop(),s}static toError(n){const r=n?n.toLowerCase():"";if(r.indexOf("permissions violation")!==-1){const s=new je(n,Ee.PermissionsViolation),l=n.match(/(Publish|Subscription) to "(\S+)"/);if(l){s.permissionContext={operation:l[1].toLowerCase(),subject:l[2],queue:void 0};const u=n.match(/using queue "(\S+)"/);u&&(s.permissionContext.queue=u[1])}return s}else return r.indexOf("authorization violation")!==-1?new je(n,Ee.AuthorizationViolation):r.indexOf("user authentication expired")!==-1?new je(n,Ee.AuthenticationExpired):r.indexOf("account authentication expired")!=-1?new je(n,Ee.AccountExpired):r.indexOf("authentication timeout")!==-1?new je(n,Ee.AuthenticationTimeout):new je(n,Ee.ProtocolError)}processMsg(n,r){if(this.inMsgs++,this.inBytes+=r.length,!this.subscriptions.sidCounter)return;const s=this.subscriptions.get(n.sid);s&&(s.received+=1,s.callback&&s.callback(null,new Md(n,r,this)),s.max!==void 0&&s.received>=s.max&&s.unsubscribe())}processError(n){const r=l0(n),s=Du.toError(r),l={type:Kr.Error,data:s.code};if(s.isPermissionError()){let u=!1;if(s.permissionContext){l.permissionContext=s.permissionContext;const c=this.subscriptions.getMux();u=(c==null?void 0:c.subject)===s.permissionContext.subject}this.subscriptions.handleError(s),this.muxSubscriptions.handleError(u,s),u&&this.subscriptions.setMux(null)}this.dispatchStatus(l),this.handleError(s)}handleError(n){n.isAuthError()?this.handleAuthError(n):n.isProtocolError()?this.lastError=n:n.isAuthTimeout()&&(this.lastError=n),n.isPermissionError()||(this.lastError=n)}handleAuthError(n){this.lastError&&n.code===this.lastError.code&&this.options.ignoreAuthErrorAbort===!1&&(this.abortReconnect=!0),this.connectError?this.connectError(n):this.disconnect()}processPing(){this.transport.send(uE)}processPong(){const n=this.pongs.shift();n&&n.resolve()}processInfo(n){const r=JSON.parse(l0(n));this.info=r;const s=this.options&&this.options.ignoreClusterUpdates?void 0:this.servers.update(r,this.transport.isEncrypted());if(!this.infoReceived){this.features.update(fs(r.version)),this.infoReceived=!0,this.transport.isEncrypted()&&this.servers.updateTLSName();const{version:u,lang:c}=this.transport;try{const f=new cE({version:u,lang:c},this.options,r.nonce);r.headers&&(f.headers=!0,f.no_responders=!0);const m=JSON.stringify(f);this.transport.send(Al(`CONNECT ${m}${Su}`)),this.transport.send(k0)}catch(f){this._close(f)}}s&&this.dispatchStatus({type:Kr.Update,data:s}),(r.ldm!==void 0?r.ldm:!1)&&this.dispatchStatus({type:Kr.LDM,data:this.servers.getCurrentServer().toString()})}push(n){switch(n.kind){case mn.MSG:{const{msg:r,data:s}=n;this.processMsg(r,s);break}case mn.OK:break;case mn.ERR:this.processError(n.data);break;case mn.PING:this.processPing();break;case mn.PONG:this.processPong();break;case mn.INFO:this.processInfo(n.data);break}}sendCommand(n,...r){const s=this.outbound.length();let l;typeof n=="string"?l=Al(n):l=n,this.outbound.fill(l,...r),s===0?queueMicrotask(()=>{this.flushPending()}):this.outbound.size()>=this.pendingLimit&&this.flushPending()}publish(n,r=Fn,s){let l;if(r instanceof Uint8Array)l=r;else if(typeof r=="string")l=qi.encode(r);else throw je.errorForCode(Ee.BadPayload);let u=l.length;s=s||{},s.reply=s.reply||"";let c=Fn,f=0;if(s.headers){if(this.info&&!this.info.headers)throw new je("headers",Ee.ServerOptionNotAvailable);c=s.headers.encode(),f=c.length,u=l.length+f}if(this.info&&u>this.info.max_payload)throw je.errorForCode(Ee.MaxPayloadExceeded);this.outBytes+=u,this.outMsgs++;let m;s.headers?(s.reply?m=`HPUB ${n} ${s.reply} ${f} ${u}\r
74
+ `:m=`HPUB ${n} ${f} ${u}\r
75
+ `,this.sendCommand(m,c,l,Ru)):(s.reply?m=`PUB ${n} ${s.reply} ${u}\r
76
+ `:m=`PUB ${n} ${u}\r
77
+ `,this.sendCommand(m,l,Ru))}request(n){return this.initMux(),this.muxSubscriptions.add(n),n}subscribe(n){return this.subscriptions.add(n),this._subunsub(n),n}_sub(n){n.queue?this.sendCommand(`SUB ${n.subject} ${n.queue} ${n.sid}\r
78
+ `):this.sendCommand(`SUB ${n.subject} ${n.sid}\r
79
+ `)}_subunsub(n){return this._sub(n),n.max&&this.unsubscribe(n,n.max),n}unsubscribe(n,r){this.unsub(n,r),(n.max===void 0||n.received>=n.max)&&this.subscriptions.cancel(n)}unsub(n,r){!n||this.isClosed()||(r?this.sendCommand(`UNSUB ${n.sid} ${r}\r
80
+ `):this.sendCommand(`UNSUB ${n.sid}\r
81
+ `),n.max=r)}resub(n,r){!n||this.isClosed()||(this.unsub(n),n.subject=r,this.subscriptions.resub(n),this._sub(n))}flush(n){return n||(n=zt()),this.pongs.push(n),this.outbound.fill(k0),this.flushPending(),n}sendSubscriptions(){const n=[];this.subscriptions.all().forEach(r=>{const s=r;s.queue?n.push(`SUB ${s.subject} ${s.queue} ${s.sid}${Su}`):n.push(`SUB ${s.subject} ${s.sid}${Su}`)}),n.length&&this.transport.send(Al(n.join("")))}async _close(n){this._closed||(this.whyClosed=new Error("close trace").stack||"",this.heartbeats.cancel(),this.connectError&&(this.connectError(n),this.connectError=void 0),this.muxSubscriptions.close(),this.subscriptions.close(),this.listeners.forEach(r=>{r.stop()}),this._closed=!0,await this.transport.close(n),await this.closed.resolve(n))}close(){return this._close()}isClosed(){return this._closed}drain(){const n=this.subscriptions.all(),r=[];return n.forEach(s=>{r.push(s.drain())}),Promise.all(r).then(async()=>(this.noMorePublishing=!0,await this.flush(),this.close())).catch(()=>{})}flushPending(){if(!(!this.infoReceived||!this.connected)&&this.outbound.size()){const n=this.outbound.drain();this.transport.send(n)}}initMux(){if(!this.subscriptions.getMux()){const r=this.muxSubscriptions.init(this.options.inboxPrefix),s=new xx(this,`${r}*`);s.callback=this.muxSubscriptions.dispatcher(),this.subscriptions.setMux(s),this.subscribe(s)}}selectServer(){const n=this.servers.selectServer();if(n!==void 0)return this.server=n,this.server}getServer(){return this.server}}const hE="$SRV";class C0{constructor(n){C(this,"msg");this.msg=n}get data(){return this.msg.data}get sid(){return this.msg.sid}get subject(){return this.msg.subject}get reply(){return this.msg.reply||""}get headers(){return this.msg.headers}respond(n,r){return this.msg.respond(n,r)}respondError(n,r,s,l){var u,c;return l=l||{},l.headers=l.headers||ei(),(u=l.headers)==null||u.set(Au,`${n}`),(c=l.headers)==null||c.set(Cu,r),this.msg.respond(s,l)}json(n){return this.msg.json(n)}string(){return this.msg.string()}}class zl{constructor(n,r="",s=""){C(this,"subject");C(this,"queue");C(this,"srv");r!==""&&mE("service group",r);let l="";if(n instanceof Yl)this.srv=n,l="";else if(n instanceof zl){const u=n;this.srv=u.srv,s===""&&u.queue!==""&&(s=u.queue),l=u.subject}else throw new Error("unknown ServiceGroup type");this.subject=this.calcSubject(l,r),this.queue=s}calcSubject(n,r=""){return r===""?n:n!==""?`${n}.${r}`:r}addEndpoint(n="",r){r=r||{subject:n};const s=typeof r=="function"?{handler:r,subject:n}:r;kl("endpoint",n);let{subject:l,handler:u,metadata:c,queue:f}=s;l=l||n,f=f||this.queue,dE("endpoint subject",l),l=this.calcSubject(this.subject,l);const m={name:n,subject:l,queue:f,handler:u,metadata:c};return this.srv._addEndpoint(m)}addGroup(n="",r=""){return new zl(this,n,r)}}function dE(e,n){if(n==="")throw new Error(`${e} cannot be empty`);if(n.indexOf(" ")!==-1)throw new Error(`${e} cannot contain spaces: '${n}'`);const r=n.split(".");r.forEach((s,l)=>{if(s===">"&&l!==r.length-1)throw new Error(`${e} cannot have internal '>': '${n}'`)})}function mE(e,n){if(n.indexOf(" ")!==-1)throw new Error(`${e} cannot contain spaces: '${n}'`);n.split(".").forEach(s=>{if(s===">")throw new Error(`${e} name cannot contain internal '>': '${n}'`)})}class Yl{constructor(n,r={name:"",version:""}){C(this,"nc");C(this,"_id");C(this,"config");C(this,"handlers");C(this,"internal");C(this,"_stopped");C(this,"_done");C(this,"started");this.nc=n,this.config=Object.assign({},r),this.config.queue||(this.config.queue="q"),kl("name",this.config.name),kl("queue",this.config.queue),fs(this.config.version),this._id=Bi.next(),this.internal=[],this._done=zt(),this._stopped=!1,this.handlers=[],this.started=new Date().toISOString(),this.reset(),this.nc.closed().then(()=>{this.close().catch()}).catch(s=>{this.close(s).catch()})}static controlSubject(n,r="",s="",l){const u=l??hE;return r===""&&s===""?`${u}.${n}`:(kl("control subject name",r),s!==""?(kl("control subject id",s),`${u}.${n}.${r}.${s}`):`${u}.${n}.${r}`)}get subjects(){return this.handlers.filter(n=>n.internal===!1).map(n=>n.subject)}get id(){return this._id}get name(){return this.config.name}get description(){return this.config.description??""}get version(){return this.config.version}get metadata(){return this.config.metadata}errorToHeader(n){const r=ei();if(n instanceof Tu){const s=n;r.set(Cu,s.message),r.set(Au,`${s.code}`)}else r.set(Cu,n.message),r.set(Au,"500");return r}setupHandler(n,r=!1){const s=r?"":n.queue?n.queue:this.config.queue,{name:l,subject:u,handler:c}=n,f=n;f.internal=r,r&&this.internal.push(f),f.stats=new pE(l,u,s),f.queue=s;const m=c?(d,y)=>{if(d){this.close(d);return}const g=Date.now();try{c(d,new C0(y))}catch(x){f.stats.countError(x),y==null||y.respond(Fn,{headers:this.errorToHeader(x)})}finally{f.stats.countLatency(g)}}:void 0;return f.sub=this.nc.subscribe(u,{callback:m,queue:s}),f.sub.closed.then(()=>{this._stopped||this.close(new Error(`required subscription ${n.subject} stopped`)).catch()}).catch(d=>{if(!this._stopped){const y=new Error(`required subscription ${n.subject} errored: ${d.message}`);y.stack=d.stack,this.close(y).catch()}}),f}info(){return{type:Tl.INFO,name:this.name,id:this.id,version:this.version,description:this.description,metadata:this.metadata,endpoints:this.endpoints()}}endpoints(){return this.handlers.map(n=>{const{subject:r,metadata:s,name:l,queue:u}=n;return{subject:r,metadata:s,name:l,queue_group:u}})}async stats(){const n=[];for(const r of this.handlers){if(typeof this.config.statsHandler=="function")try{r.stats.data=await this.config.statsHandler(r)}catch(s){r.stats.countError(s)}n.push(r.stats.stats(r.qi))}return{type:Tl.STATS,name:this.name,id:this.id,version:this.version,started:this.started,metadata:this.metadata,endpoints:n}}addInternalHandler(n,r){const s=`${n}`.toUpperCase();this._doAddInternalHandler(`${s}-all`,n,r),this._doAddInternalHandler(`${s}-kind`,n,r,this.name),this._doAddInternalHandler(`${s}`,n,r,this.name,this.id)}_doAddInternalHandler(n,r,s,l="",u=""){const c={};c.name=n,c.subject=Yl.controlSubject(r,l,u),c.handler=s,this.setupHandler(c,!0)}start(){const n=mr(),r=(c,f)=>c?(this.close(c),Promise.reject(c)):this.stats().then(m=>(f==null||f.respond(n.encode(m)),Promise.resolve())),s=(c,f)=>c?(this.close(c),Promise.reject(c)):(f==null||f.respond(n.encode(this.info())),Promise.resolve()),l=n.encode(this.ping()),u=(c,f)=>c?(this.close(c).then().catch(),Promise.reject(c)):(f.respond(l),Promise.resolve());return this.addInternalHandler(Li.PING,u),this.addInternalHandler(Li.STATS,r),this.addInternalHandler(Li.INFO,s),this.handlers.forEach(c=>{const{subject:f}=c;typeof f=="string"&&c.handler!==null&&this.setupHandler(c)}),Promise.resolve(this)}close(n){if(this._stopped)return this._done;this._stopped=!0;let r=[];return this.nc.isClosed()||(r=this.handlers.concat(this.internal).map(s=>s.sub.drain())),Promise.allSettled(r).then(()=>{this._done.resolve(n||null)}),this._done}get stopped(){return this._done}get isStopped(){return this._stopped}stop(n){return this.close(n)}ping(){return{type:Tl.PING,name:this.name,id:this.id,version:this.version,metadata:this.metadata}}reset(){if(this.started=new Date().toISOString(),this.handlers)for(const n of this.handlers)n.stats.reset(n.qi)}addGroup(n,r){return new zl(this,n,r)}addEndpoint(n,r){return new zl(this).addEndpoint(n,r)}_addEndpoint(n){const r=new tn;r.noIterator=typeof n.handler=="function",r.noIterator||(n.handler=(l,u)=>{l?this.stop(l).catch():r.push(new C0(u))},r.iterClosed.then(()=>{this.close().catch()}));const s=this.setupHandler(n,!1);return s.qi=r,this.handlers.push(s),r}}class pE{constructor(n,r,s=""){C(this,"name");C(this,"subject");C(this,"average_processing_time");C(this,"num_requests");C(this,"processing_time");C(this,"num_errors");C(this,"last_error");C(this,"data");C(this,"metadata");C(this,"queue");this.name=n,this.subject=r,this.average_processing_time=0,this.num_errors=0,this.num_requests=0,this.processing_time=0,this.queue=s}reset(n){this.num_requests=0,this.processing_time=0,this.average_processing_time=0,this.num_errors=0,this.last_error=void 0,this.data=void 0;const r=n;r&&(r.time=0,r.processed=0)}countLatency(n){this.num_requests++,this.processing_time+=Lt(Date.now()-n),this.average_processing_time=Math.round(this.processing_time/this.num_requests)}countError(n){this.num_errors++,this.last_error=n.message}_stats(){const{name:n,subject:r,average_processing_time:s,num_errors:l,num_requests:u,processing_time:c,last_error:f,data:m,queue:d}=this;return{name:n,subject:r,average_processing_time:s,num_errors:l,num_requests:u,processing_time:c,last_error:f,data:m,queue_group:d}}stats(n){const r=n;return(r==null?void 0:r.noIterator)===!1&&(this.processing_time=Lt(r.time),this.num_requests=r.processed,this.average_processing_time=this.processing_time>0&&this.num_requests>0?this.processing_time/this.num_requests:0),this._stats()}}class gE{constructor(n,r={strategy:dr.JitterTimer,maxWait:2e3},s){C(this,"nc");C(this,"prefix");C(this,"opts");this.nc=n,this.prefix=s,this.opts=r}ping(n="",r=""){return this.q(Li.PING,n,r)}stats(n="",r=""){return this.q(Li.STATS,n,r)}info(n="",r=""){return this.q(Li.INFO,n,r)}async q(n,r="",s=""){const l=new tn,u=mr(),c=Yl.controlSubject(n,r,s,this.prefix),f=await this.nc.requestMany(c,Fn,this.opts);return(async()=>{for await(const m of f)try{const d=u.decode(m.data);l.push(d)}catch(d){l.push(()=>{l.stop(d)})}l.push(()=>{l.stop()})})().catch(m=>{l.stop(m)}),l}}function vx(){return{key:{encode(e){return e},decode(e){return e}},value:{encode(e){return e},decode(e){return e}}}}function yE(){return{replicas:1,history:1,timeout:2e3,max_bytes:-1,maxValueSize:-1,codec:vx(),storage:nd.File}}const Lu="KV-Operation",A0="$KV",bE=/^[-/=.\w]+$/,xE=/^[-/=.>*\w]+$/,vE=/^[-\w]+$/;function wE(e){if(e.startsWith(".")||e.endsWith(".")||!bE.test(e))throw new Error(`invalid key: ${e}`)}function SE(e){if(e.startsWith(".")||e.endsWith(".")||!xE.test(e))throw new Error(`invalid key: ${e}`)}function _E(e){if(e.startsWith(".")||e.endsWith("."))throw new Error(`invalid key: ${e}`);const n=e.split(".");let r=!1;for(let s=0;s<n.length;s++)switch(n[s]){case"*":r=!0;break;case">":if(s!==n.length-1)throw new Error(`invalid key: ${e}`);r=!0;break}return r}function _u(e){if(!vE.test(e))throw new Error(`invalid bucket name: ${e}`)}var _r;(function(e){e.MsgIdHdr="Nats-Msg-Id",e.ExpectedStreamHdr="Nats-Expected-Stream",e.ExpectedLastSeqHdr="Nats-Expected-Last-Sequence",e.ExpectedLastMsgIdHdr="Nats-Expected-Last-Msg-Id",e.ExpectedLastSubjectSequenceHdr="Nats-Expected-Last-Subject-Sequence"})(_r||(_r={}));class Ul{constructor(n,r,s){C(this,"js");C(this,"jsm");C(this,"stream");C(this,"bucket");C(this,"direct");C(this,"codec");C(this,"prefix");C(this,"editPrefix");C(this,"useJsPrefix");C(this,"_prefixLen");C(this,"validateKey",wE);C(this,"validateSearchKey",SE);C(this,"hasWildcards",_E);_u(n),this.js=r,this.jsm=s,this.bucket=n,this.prefix=A0,this.editPrefix="",this.useJsPrefix=!1,this._prefixLen=0}static async create(n,r,s={}){_u(r);const l=await n.jetstreamManager(),u=new Ul(r,n,l);return await u.init(s),u}static async bind(n,r,s={}){const l=await n.jetstreamManager(),u={config:{allow_direct:s.allow_direct}};_u(r);const c=new Ul(r,n,l);return u.config.name=s.streamName??c.bucketName(),Object.assign(c,u),c.stream=u.config.name,c.codec=s.codec||vx(),c.direct=u.config.allow_direct??!1,c.initializePrefixes(u),c}async init(n={}){const r=Object.assign(yE(),n);this.codec=r.codec;const s={};this.stream=s.name=n.streamName??this.bucketName(),s.retention=td.Limits,s.max_msgs_per_subject=r.history,r.maxBucketSize&&(r.max_bytes=r.maxBucketSize),r.max_bytes&&(s.max_bytes=r.max_bytes),s.max_msg_size=r.maxValueSize,s.storage=r.storage;const l=n.placementCluster??"";if(l&&(n.placement={},n.placement.cluster=l,n.placement.tags=[]),n.placement&&(s.placement=n.placement),n.republish&&(s.republish=n.republish),n.description&&(s.description=n.description),n.mirror){const g=Object.assign({},n.mirror);g.name.startsWith(Pn)||(g.name=`${Pn}${g.name}`),s.mirror=g,s.mirror_direct=!0}else if(n.sources){const g=n.sources.map(x=>{const w=Object.assign({},x),k=w.name.startsWith(Pn)?w.name.substring(Pn.length):w.name;return w.name.startsWith(Pn)||(w.name=`${Pn}${w.name}`),!x.external&&k!==this.bucket&&(w.subject_transforms=[{src:`$KV.${k}.>`,dest:`$KV.${this.bucket}.>`}]),w});s.sources=g,s.subjects=[this.subjectForBucket()]}else s.subjects=[this.subjectForBucket()];n.metadata&&(s.metadata=n.metadata),typeof n.compression=="boolean"&&(s.compression=n.compression?Pi.S2:Pi.None);const u=this.js.nc,c=u.getServerVersion(),f=c?id(c,fs("2.7.2"))>=0:!1;s.discard=f?Ll.New:Ll.Old;const{ok:m,min:d}=u.features.get(at.JS_ALLOW_DIRECT);if(!m&&n.allow_direct===!0){const g=c?`${c.major}.${c.minor}.${c.micro}`:"unknown";return Promise.reject(new Error(`allow_direct is not available on server version ${g} - requires ${d}`))}n.allow_direct=typeof n.allow_direct=="boolean"?n.allow_direct:m,s.allow_direct=n.allow_direct,this.direct=s.allow_direct,s.num_replicas=r.replicas,r.ttl&&(s.max_age=Lt(r.ttl)),s.allow_rollup_hdrs=!0;let y;try{y=await this.jsm.streams.info(s.name),!y.config.allow_direct&&this.direct===!0&&(this.direct=!1)}catch(g){if(g.message==="stream not found")y=await this.jsm.streams.add(s);else throw g}this.initializePrefixes(y)}initializePrefixes(n){this._prefixLen=0,this.prefix=`$KV.${this.bucket}`,this.useJsPrefix=this.js.apiPrefix!=="$JS.API";const{mirror:r}=n.config;if(r){let s=r.name;if(s.startsWith(Pn)&&(s=s.substring(Pn.length)),r.external&&r.external.api!==""){const l=r.name.substring(Pn.length);this.useJsPrefix=!1,this.prefix=`$KV.${l}`,this.editPrefix=`${r.external.api}.$KV.${s}`}else this.editPrefix=this.prefix}}bucketName(){return this.stream??`${Pn}${this.bucket}`}subjectForBucket(){return`${this.prefix}.${this.bucket}.>`}subjectForKey(n,r=!1){const s=[];return r?(this.useJsPrefix&&s.push(this.js.apiPrefix),this.editPrefix!==""?s.push(this.editPrefix):s.push(this.prefix)):this.prefix&&s.push(this.prefix),s.push(n),s.join(".")}fullKeyName(n){return this.prefix!==""?`${this.prefix}.${n}`:`${A0}.${this.bucket}.${n}`}get prefixLen(){return this._prefixLen===0&&(this._prefixLen=this.prefix.length+1),this._prefixLen}encodeKey(n){const r=[];for(const s of n.split("."))switch(s){case">":case"*":r.push(s);break;default:r.push(this.codec.key.encode(s));break}return r.join(".")}decodeKey(n){const r=[];for(const s of n.split("."))switch(s){case">":case"*":r.push(s);break;default:r.push(this.codec.key.decode(s));break}return r.join(".")}close(){return Promise.resolve()}dataLen(n,r){const s=r&&r.get(yn.MessageSizeHdr)||"";return s!==""?parseInt(s,10):n.length}smToEntry(n){return new BE(this.bucket,this.prefixLen,n)}jmToEntry(n){const r=this.decodeKey(n.subject.substring(this.prefixLen));return new PE(this.bucket,r,n)}async create(n,r){var u;let s;try{const c=await this.put(n,r,{previousSeq:0});return Promise.resolve(c)}catch(c){if(s=c,((u=c==null?void 0:c.api_error)==null?void 0:u.err_code)!==10071)return Promise.reject(c)}let l=0;try{const c=await this.get(n);return(c==null?void 0:c.operation)==="DEL"||(c==null?void 0:c.operation)==="PURGE"?(l=c!==null?c.revision:0,this.update(n,r,l)):Promise.reject(s)}catch(c){return Promise.reject(c)}}update(n,r,s){if(s<=0)throw new Error("version must be greater than 0");return this.put(n,r,{previousSeq:s})}async put(n,r,s={}){var c,f;const l=this.encodeKey(n);this.validateKey(l);const u={};if(s.previousSeq!==void 0){const m=ei();u.headers=m,m.set(_r.ExpectedLastSubjectSequenceHdr,`${s.previousSeq}`)}try{return(await this.js.publish(this.subjectForKey(l,!0),r,u)).seq}catch(m){const d=m;return d.isJetStreamError()?(d.message=(c=d.api_error)==null?void 0:c.description,d.code=`${(f=d.api_error)==null?void 0:f.code}`,Promise.reject(d)):Promise.reject(m)}}async get(n,r){const s=this.encodeKey(n);this.validateKey(s);let l={last_by_subj:this.subjectForKey(s)};r&&r.revision>0&&(l={seq:r.revision});let u;try{this.direct?u=await this.jsm.direct.getMessage(this.bucketName(),l):u=await this.jsm.streams.getMessage(this.bucketName(),l);const c=this.smToEntry(u);return c.key!==s?null:c}catch(c){if(c.code===Ee.JetStream404NoMessages)return null;throw c}}purge(n,r){return this._deleteOrPurge(n,"PURGE",r)}delete(n,r){return this._deleteOrPurge(n,"DEL",r)}async purgeDeletes(n=1800*1e3){const r=zt(),s=[],l=await this.watch({key:">",initializedFn:()=>{r.resolve()}});(async()=>{for await(const m of l)(m.operation==="DEL"||m.operation==="PURGE")&&s.push(m)})().then(),await r,l.stop();const u=Date.now()-n,c=s.map(m=>{const d=this.subjectForKey(m.key);return m.created.getTime()>=u?this.jsm.streams.purge(this.stream,{filter:d,keep:1}):this.jsm.streams.purge(this.stream,{filter:d,keep:0})}),f=await Promise.all(c);return f.unshift({success:!0,purged:0}),f.reduce((m,d)=>(m.purged+=d.purged,m))}async _deleteOrPurge(n,r,s){if(!this.hasWildcards(n))return this._doDeleteOrPurge(n,r,s);const l=await this.keys(n),u=[];for await(const c of l)u.push(this._doDeleteOrPurge(c,r)),u.length===100&&(await Promise.all(u),u.length=0);u.length>0&&await Promise.all(u)}async _doDeleteOrPurge(n,r,s){const l=this.encodeKey(n);this.validateKey(l);const u=ei();u.set(Lu,r),r==="PURGE"&&u.set(yn.RollupHdr,yn.RollupValueSubject),s!=null&&s.previousSeq&&u.set(_r.ExpectedLastSubjectSequenceHdr,`${s.previousSeq}`),await this.js.publish(this.subjectForKey(l,!0),Fn,{headers:u})}_buildCC(n,r,s={}){let u=(Array.isArray(n)?n:[n]).map(m=>{const d=this.encodeKey(m);return this.validateSearchKey(m),this.fullKeyName(d)}),c=$t.LastPerSubject;r===hr.AllHistory&&(c=$t.All),r===hr.UpdatesOnly&&(c=$t.New);let f;return u.length===1&&(f=u[0],u=void 0),Object.assign({deliver_policy:c,ack_policy:en.None,filter_subjects:u,filter_subject:f,flow_control:!0,idle_heartbeat:Lt(5*1e3)},s)}remove(n){return this.purge(n)}async history(n={}){const r=n.key??">",s=new tn,l={};l.headers_only=n.headers_only||!1;let u;u=()=>{s.stop()};let c=0;const f=this._buildCC(r,hr.AllHistory,l),m=f.filter_subject,d=Ui(f);d.bindStream(this.stream),d.orderedConsumer(),d.callback((g,x)=>{if(g){s.stop(g);return}if(x){const w=this.jmToEntry(x);s.push(w),s.received++,(u&&c>0&&s.received>=c||x.info.pending===0)&&(s.push(u),u=void 0)}});const y=await this.js.subscribe(m,d);if(u){const{info:{last:g}}=y,x=g.num_pending+g.delivered.consumer_seq;if(x===0||s.received>=x)try{u()}catch(w){s.stop(w)}finally{u=void 0}else c=x}return s._data=y,s.iterClosed.then(()=>{y.unsubscribe()}),y.closed.then(()=>{s.stop()}).catch(g=>{s.stop(g)}),s}canSetWatcherName(){const r=this.js.nc,{ok:s}=r.features.get(at.JS_NEW_CONSUMER_CREATE_API);return s}async watch(n={}){const r=n.key??">",s=new tn,l={};l.headers_only=n.headers_only||!1;let u=hr.LastValue;n.include===hr.AllHistory?u=hr.AllHistory:n.include===hr.UpdatesOnly&&(u=hr.UpdatesOnly);const c=n.ignoreDeletes===!0;let f=n.initializedFn,m=0;const d=this._buildCC(r,u,l),y=d.filter_subject,g=Ui(d);this.canSetWatcherName()&&g.consumerName(Bi.next()),g.bindStream(this.stream),n.resumeFromRevision&&n.resumeFromRevision>0&&g.startSequence(n.resumeFromRevision),g.orderedConsumer(),g.callback((w,k)=>{if(w){s.stop(w);return}if(k){const D=this.jmToEntry(k);if(c&&D.operation==="DEL")return;s.push(D),s.received++,f&&(m>0&&s.received>=m||k.info.pending===0)&&(s.push(f),f=void 0)}});const x=await this.js.subscribe(y,g);if(f){const{info:{last:w}}=x,k=w.num_pending+w.delivered.consumer_seq;if(k===0||s.received>=k)try{f()}catch(D){s.stop(D)}finally{f=void 0}else m=k}return s._data=x,s.iterClosed.then(()=>{x.unsubscribe()}),x.closed.then(()=>{s.stop()}).catch(w=>{s.stop(w)}),s}async keys(n=">"){const r=new tn,s=this._buildCC(n,hr.LastValue,{headers_only:!0}),l=Array.isArray(n)?">":s.filter_subject,u=Ui(s);u.bindStream(this.stream),u.orderedConsumer();const c=await this.js.subscribe(l,u);return(async()=>{var m;for await(const d of c){const y=(m=d.headers)==null?void 0:m.get(Lu);if(y!=="DEL"&&y!=="PURGE"){const g=this.decodeKey(d.subject.substring(this.prefixLen));r.push(g)}d.info.pending===0&&c.unsubscribe()}})().then(()=>{r.stop()}).catch(m=>{r.stop(m)}),c.info.last.num_pending===0&&c.unsubscribe(),r}purgeBucket(n){return this.jsm.streams.purge(this.bucketName(),n)}destroy(){return this.jsm.streams.delete(this.bucketName())}async status(){var u;const r=((u=this.js.nc.info)==null?void 0:u.cluster)??"",s=this.bucketName(),l=await this.jsm.streams.info(s);return new wx(l,r)}}class wx{constructor(n,r=""){C(this,"si");C(this,"cluster");this.si=n,this.cluster=r}get bucket(){return this.si.config.name.startsWith(Pn)?this.si.config.name.substring(Pn.length):this.si.config.name}get values(){return this.si.state.messages}get history(){return this.si.config.max_msgs_per_subject}get ttl(){return Rd(this.si.config.max_age)}get bucket_location(){return this.cluster}get backingStore(){return this.si.config.storage}get storage(){return this.si.config.storage}get replicas(){return this.si.config.num_replicas}get description(){return this.si.config.description??""}get maxBucketSize(){return this.si.config.max_bytes}get maxValueSize(){return this.si.config.max_msg_size}get max_bytes(){return this.si.config.max_bytes}get placement(){return this.si.config.placement||{cluster:"",tags:[]}}get placementCluster(){var n;return((n=this.si.config.placement)==null?void 0:n.cluster)??""}get republish(){return this.si.config.republish??{src:"",dest:""}}get streamInfo(){return this.si}get size(){return this.si.state.bytes}get metadata(){return this.si.config.metadata??{}}get compression(){return this.si.config.compression?this.si.config.compression!==Pi.None:!1}}const Ld="OBJ_",T0="SHA-256=";function EE(e){return _u(e),`${Ld}${e}`}function kE(e){return e.startsWith(Ld)?e.substring(4):e}class od{constructor(n){C(this,"si");C(this,"backingStore");this.si=n,this.backingStore="JetStream"}get bucket(){return kE(this.si.config.name)}get description(){return this.si.config.description??""}get ttl(){return this.si.config.max_age}get storage(){return this.si.config.storage}get replicas(){return this.si.config.num_replicas}get sealed(){return this.si.config.sealed}get size(){return this.si.state.bytes}get streamInfo(){return this.si}get metadata(){return this.si.config.metadata}get compression(){return this.si.config.compression?this.si.config.compression!==Pi.None:!1}}function du(e){if(e===void 0)return;const{domain:n}=e;if(n===void 0)return e;const r=Object.assign({},e);if(delete r.domain,n==="")return r;if(r.external)throw new Error("domain and external are both set");return r.external={api:`$JS.${n}.API`},r}var nr;(function(e){e[e.Unset=-1]="Unset",e[e.Consume=0]="Consume",e[e.Fetch=1]="Fetch"})(nr||(nr={}));var Er;(function(e){e.HeartbeatsMissed="heartbeats_missed",e.ConsumerNotFound="consumer_not_found",e.StreamNotFound="stream_not_found",e.ConsumerDeleted="consumer_deleted",e.OrderedConsumerRecreated="ordered_consumer_recreated",e.NoResponders="no_responders"})(Er||(Er={}));var ua;(function(e){e.DebugEvent="debug",e.Discard="discard",e.Reset="reset",e.Next="next"})(ua||(ua={}));const j0=Uint8Array.of(43,65,67,75),CE=Uint8Array.of(45,78,65,75),xl=Uint8Array.of(43,87,80,73),AE=Uint8Array.of(43,78,88,84),TE=Uint8Array.of(43,84,69,82,77),jE=Uint8Array.of(32);function Bl(e,n=5e3){return new GE(e,n)}class Eh extends tn{constructor(r,s,l=!1){super();C(this,"consumer");C(this,"opts");C(this,"sub");C(this,"monitor");C(this,"pending");C(this,"inbox");C(this,"refilling");C(this,"pong");C(this,"callback");C(this,"timeout");C(this,"cleanupHandler");C(this,"listeners");C(this,"statusIterator");C(this,"forOrderedConsumer");C(this,"resetHandler");C(this,"abortOnMissingResource");C(this,"bind");C(this,"inBackOff");this.consumer=r;const u=s;this.opts=this.parseOptions(s,l),this.callback=u.callback||null,this.noIterator=typeof this.callback=="function",this.monitor=null,this.pong=null,this.pending={msgs:0,bytes:0,requests:0},this.refilling=l,this.timeout=null,this.inbox=Zr(r.api.nc.options.inboxPrefix),this.listeners=[],this.forOrderedConsumer=!1,this.abortOnMissingResource=u.abort_on_missing_resource===!0,this.bind=u.bind===!0,this.inBackOff=!1,this.start()}start(){const{max_messages:r,max_bytes:s,idle_heartbeat:l,threshold_bytes:u,threshold_messages:c}=this.opts;this.closed().then(m=>{if(this.cleanupHandler)try{this.cleanupHandler(m)}catch{}});const{sub:f}=this;f&&f.unsubscribe(),this.sub=this.consumer.api.nc.subscribe(this.inbox,{callback:(m,d)=>{var g,x,w,k;if(m){this.stop(m);return}if((g=this.monitor)==null||g.work(),d.subject===this.inbox){if(ed(d))return;const D=(x=d.headers)==null?void 0:x.code,B=((k=(w=d.headers)==null?void 0:w.description)==null?void 0:k.toLowerCase())||"unknown",{msgsLeft:L,bytesLeft:$}=this.parseDiscard(d.headers);if(L>0||$>0)this.pending.msgs-=L,this.pending.bytes-=$,this.pending.requests--,this.notify(ua.Discard,{msgsLeft:L,bytesLeft:$});else if(D===400){this.stop(new je(B,`${D}`));return}else if(D===409&&B==="consumer deleted"){if(this.notify(Er.ConsumerDeleted,`${D} ${B}`),!this.refilling||this.abortOnMissingResource){const T=new je(B,`${D}`);this.stop(T);return}}else if(D===503){if(this.notify(Er.NoResponders,`${D} No Responders`),!this.refilling||this.abortOnMissingResource){const T=new je("no responders",`${D}`);this.stop(T);return}}else this.notify(ua.DebugEvent,`${D} ${B}`)}else this._push(Bl(d,this.consumer.api.timeout)),this.received++,this.pending.msgs&&this.pending.msgs--,this.pending.bytes&&(this.pending.bytes-=d.size());if(this.pending.msgs===0&&this.pending.bytes===0&&(this.pending.requests=0),this.refilling){if(r&&this.pending.msgs<=c||s&&this.pending.bytes<=u){const D=this.pullOptions();this.pull(D)}}else this.pending.requests===0&&this._push(()=>{this.stop()})}}),this.sub.closed.then(()=>{this.sub.draining&&this._push(()=>{this.stop()})}),l&&(this.monitor=new Dd(l,m=>(this.notify(Er.HeartbeatsMissed,m),this.resetPending().then(()=>{}).catch(()=>{}),!1),{maxOut:2})),(async()=>{var d;const m=this.consumer.api.nc.status();this.statusIterator=m;for await(const y of m)switch(y.type){case Kr.Disconnect:(d=this.monitor)==null||d.cancel();break;case Kr.Reconnect:this.resetPending().then(g=>{var x;g&&((x=this.monitor)==null||x.restart())}).catch(()=>{});break}})(),this.pull(this.pullOptions())}_push(r){if(!this.callback)super.push(r);else{const s=typeof r=="function"?r:null;try{s?s():this.callback(r)}catch(l){this.stop(l)}}}notify(r,s){this.listeners.length>0&&this.listeners.forEach(l=>{l.done||l.push({type:r,data:s})})}resetPending(){return this.bind?this.resetPendingNoInfo():this.resetPendingWithInfo()}resetPendingNoInfo(){return this.pending.msgs=0,this.pending.bytes=0,this.pending.requests=0,this.pull(this.pullOptions()),Promise.resolve(!0)}async resetPendingWithInfo(){if(this.inBackOff)return!1;let r=0,s=0;const l=Od([this.opts.expires]);let u=0;for(;;){if(this.done)return!1;if(this.consumer.api.nc.isClosed())return console.error("aborting resetPending - connection is closed"),!1;try{return await this.consumer.info(),this.inBackOff=!1,r=0,this.pending.msgs=0,this.pending.bytes=0,this.pending.requests=0,this.pull(this.pullOptions()),!0}catch(c){if(c.message==="stream not found"){if(s++,this.notify(Er.StreamNotFound,s),!this.refilling||this.abortOnMissingResource)return this.stop(c),!1}else if(c.message==="consumer not found"){if(r++,this.notify(Er.ConsumerNotFound,r),this.resetHandler)try{this.resetHandler()}catch{}if(!this.refilling||this.abortOnMissingResource)return this.stop(c),!1;if(this.forOrderedConsumer)return!1}else r=0,s=0;this.inBackOff=!0;const f=l.backoff(u),m=wa(f);await Promise.race([m,this.consumer.api.nc.closed()]),m.cancel(),u++}}}pull(r){this.pending.bytes+=r.max_bytes??0,this.pending.msgs+=r.batch??0,this.pending.requests++;const s=this.consumer.api.nc;this._push(()=>{s.publish(`${this.consumer.api.prefix}.CONSUMER.MSG.NEXT.${this.consumer.stream}.${this.consumer.name}`,this.consumer.api.jc.encode(r),{reply:this.inbox}),this.notify(ua.Next,r)})}pullOptions(){const r=this.opts.max_messages-this.pending.msgs,s=this.opts.max_bytes-this.pending.bytes,l=Lt(this.opts.idle_heartbeat),u=Lt(this.opts.expires);return{batch:r,max_bytes:s,idle_heartbeat:l,expires:u}}parseDiscard(r){const s={msgsLeft:0,bytesLeft:0},l=r==null?void 0:r.get(yn.PendingMessagesHdr);l&&(s.msgsLeft=parseInt(l));const u=r==null?void 0:r.get(yn.PendingBytesHdr);return u&&(s.bytesLeft=parseInt(u)),s}trackTimeout(r){this.timeout=r}close(){return this.stop(),this.iterClosed}closed(){return this.iterClosed}clearTimers(){var r,s;(r=this.monitor)==null||r.cancel(),this.monitor=null,(s=this.timeout)==null||s.cancel(),this.timeout=null}setCleanupHandler(r){this.cleanupHandler=r}stop(r){var s,l;this.done||((s=this.sub)==null||s.unsubscribe(),this.clearTimers(),(l=this.statusIterator)==null||l.stop(),this._push(()=>{super.stop(r),this.listeners.forEach(u=>{u.stop()})}))}parseOptions(r,s=!1){const l=r||{};if(l.max_messages=l.max_messages||0,l.max_bytes=l.max_bytes||0,l.max_messages!==0&&l.max_bytes!==0)throw new Error("only specify one of max_messages or max_bytes");if(l.max_messages===0&&(l.max_messages=100),l.expires=l.expires||3e4,l.expires<1e3)throw new Error("expires should be at least 1000ms");if(l.idle_heartbeat=l.idle_heartbeat||l.expires/2,l.idle_heartbeat=l.idle_heartbeat>3e4?3e4:l.idle_heartbeat,s){const u=Math.round(l.max_messages*.75)||1;l.threshold_messages=l.threshold_messages||u;const c=Math.round(l.max_bytes*.75)||1;l.threshold_bytes=l.threshold_bytes||c}return l}status(){const r=new tn;return this.listeners.push(r),Promise.resolve(r)}}class NE extends tn{constructor(){super();C(this,"src");C(this,"listeners");this.listeners=[]}setSource(r){this.src&&(this.src.resetHandler=void 0,this.src.setCleanupHandler(),this.src.stop()),this.src=r,this.src.setCleanupHandler(s=>{this.stop(s||void 0)}),(async()=>{const s=await this.src.status();for await(const l of s)this.notify(l.type,l.data)})().catch(()=>{})}notify(r,s){this.listeners.length>0&&this.listeners.forEach(l=>{l.done||l.push({type:r,data:s})})}stop(r){var s;this.done||((s=this.src)==null||s.stop(r),super.stop(r),this.listeners.forEach(l=>{l.stop()}))}close(){return this.stop(),this.iterClosed}closed(){return this.iterClosed}status(){const r=new tn;return this.listeners.push(r),Promise.resolve(r)}}class ud{constructor(n,r){C(this,"api");C(this,"_info");C(this,"stream");C(this,"name");this.api=n,this._info=r,this.stream=r.stream_name,this.name=r.name}consume(n={max_messages:100,expires:3e4}){return Promise.resolve(new Eh(this,n,!0))}fetch(n={max_messages:100,expires:3e4}){const r=new Eh(this,n,!1),s=Math.round(r.opts.expires*1.05),l=da(s);return r.closed().catch(()=>{}).finally(()=>{l.cancel()}),l.catch(()=>{r.close().catch()}),r.trackTimeout(l),Promise.resolve(r)}next(n={expires:3e4}){const r=zt(),s=n;s.max_messages=1;const l=new Eh(this,s,!1),u=Math.round(l.opts.expires*1.05);u>=6e4&&(async()=>{for await(const f of await l.status())if(f.type===Er.HeartbeatsMissed&&f.data>=2){r.reject(new Error("consumer missed heartbeats"));break}})().catch(),(async()=>{for await(const f of l){r.resolve(f);break}})().catch(()=>{});const c=da(u);return l.closed().then(f=>{f?r.reject(f):r.resolve(null)}).catch(f=>{r.reject(f)}).finally(()=>{c.cancel()}),c.catch(f=>{r.resolve(null),l.close().catch()}),l.trackTimeout(c),r}delete(){const{stream_name:n,name:r}=this._info;return this.api.delete(n,r)}info(n=!1){if(n)return Promise.resolve(this._info);const{stream_name:r,name:s}=this._info;return this.api.info(r,s).then(l=>(this._info=l,this._info))}}class OE{constructor(n,r,s={}){C(this,"api");C(this,"consumerOpts");C(this,"consumer");C(this,"opts");C(this,"cursor");C(this,"stream");C(this,"namePrefix");C(this,"serial");C(this,"currentConsumer");C(this,"userCallback");C(this,"iter");C(this,"type");C(this,"startSeq");C(this,"maxInitialReset");this.api=n,this.stream=r,this.cursor={stream_seq:1,deliver_seq:0},this.namePrefix=Bi.next(),typeof s.name_prefix=="string"&&(Yu("name_prefix",s.name_prefix),this.namePrefix=s.name_prefix+this.namePrefix),this.serial=0,this.currentConsumer=null,this.userCallback=null,this.iter=null,this.type=nr.Unset,this.consumerOpts=s,this.maxInitialReset=30,this.startSeq=this.consumerOpts.opt_start_seq||0,this.cursor.stream_seq=this.startSeq>0?this.startSeq-1:0}getConsumerOpts(n){this.serial++;const r=`${this.namePrefix}_${this.serial}`;n=n===0?1:n;const s={name:r,deliver_policy:$t.StartSequence,opt_start_seq:n,ack_policy:en.None,inactive_threshold:Lt(300*1e3),num_replicas:1};return this.consumerOpts.headers_only===!0&&(s.headers_only=!0),Array.isArray(this.consumerOpts.filterSubjects)&&(s.filter_subjects=this.consumerOpts.filterSubjects),typeof this.consumerOpts.filterSubjects=="string"&&(s.filter_subject=this.consumerOpts.filterSubjects),this.consumerOpts.replay_policy&&(s.replay_policy=this.consumerOpts.replay_policy),n===this.startSeq+1&&(s.deliver_policy=this.consumerOpts.deliver_policy||$t.StartSequence,(this.consumerOpts.deliver_policy===$t.LastPerSubject||this.consumerOpts.deliver_policy===$t.New||this.consumerOpts.deliver_policy===$t.Last)&&(delete s.opt_start_seq,s.deliver_policy=this.consumerOpts.deliver_policy),s.deliver_policy===$t.LastPerSubject&&typeof s.filter_subjects>"u"&&typeof s.filter_subject>"u"&&(s.filter_subject=">"),this.consumerOpts.opt_start_time&&(delete s.opt_start_seq,s.deliver_policy=$t.StartTime,s.opt_start_time=this.consumerOpts.opt_start_time),this.consumerOpts.inactive_threshold&&(s.inactive_threshold=Lt(this.consumerOpts.inactive_threshold))),s}async resetConsumer(n=0){var c,f,m,d,y;Bi.next();const r=this.serial===0;(c=this.consumer)==null||c.delete().catch(()=>{}),n=n===0?1:n,this.cursor.deliver_seq=0;const s=this.getConsumerOpts(n);s.max_deliver=1,s.mem_storage=!0;const l=Od([((f=this.opts)==null?void 0:f.expires)||3e4]);let u;for(let g=0;;g++)try{u=await this.api.add(this.stream,s),(m=this.iter)==null||m.notify(Er.OrderedConsumerRecreated,u.name);break}catch(x){if(x.message==="stream not found"&&((d=this.iter)==null||d.notify(Er.StreamNotFound,g),this.type===nr.Fetch||this.opts.abort_on_missing_resource===!0))return(y=this.iter)==null||y.stop(x),Promise.reject(x);if(r&&g>=this.maxInitialReset)throw x;await wa(l.backoff(g+1))}return u}internalHandler(n){return r=>{var l;if(this.serial!==n)return;const s=r.info.deliverySequence;if(s!==this.cursor.deliver_seq+1){this.notifyOrderedResetAndReset();return}this.cursor.deliver_seq=s,this.cursor.stream_seq=r.info.streamSequence,this.userCallback?this.userCallback(r):(l=this.iter)==null||l.push(r)}}async reset(n={max_messages:100,expires:3e4},r){var m,d;r=r||{};const s=r.fromFetch||!1,l=r.orderedReset||!1;if(this.type===nr.Fetch&&l){(m=this.iter)==null||m.src.stop(),await((d=this.iter)==null?void 0:d.closed()),this.currentConsumer=null;return}(this.currentConsumer===null||l)&&(this.currentConsumer=await this.resetConsumer(this.cursor.stream_seq+1)),(this.iter===null||s)&&(this.iter=new NE),this.consumer=new ud(this.api,this.currentConsumer);const u=n;u.callback=this.internalHandler(this.serial);let c=null;this.type===nr.Fetch&&s?c=await this.consumer.fetch(n):this.type===nr.Consume&&(c=await this.consumer.consume(n));const f=c;f.forOrderedConsumer=!0,f.resetHandler=()=>{this.notifyOrderedResetAndReset()},this.iter.setSource(f)}notifyOrderedResetAndReset(){var n;(n=this.iter)==null||n.notify(ua.Reset,""),this.reset(this.opts,{orderedReset:!0})}async consume(n={max_messages:100,expires:3e4}){if(n.bind)return Promise.reject(new Error("bind is not supported"));if(this.type===nr.Fetch)return Promise.reject(new Error("ordered consumer initialized as fetch"));if(this.type===nr.Consume)return Promise.reject(new Error("ordered consumer doesn't support concurrent consume"));const{callback:s}=n;return s&&(this.userCallback=s),this.type=nr.Consume,this.opts=n,await this.reset(n),this.iter}async fetch(n={max_messages:100,expires:3e4}){var l;if(n.bind)return Promise.reject(new Error("bind is not supported"));if(this.type===nr.Consume)return Promise.reject(new Error("ordered consumer already initialized as consume"));if(((l=this.iter)==null?void 0:l.done)===!1)return Promise.reject(new Error("ordered consumer doesn't support concurrent fetch"));const{callback:s}=n;return s&&(this.userCallback=s),this.type=nr.Fetch,this.opts=n,await this.reset(n,{fromFetch:!0}),this.iter}async next(n={expires:3e4}){const r=n;if(r.bind)return Promise.reject(new Error("bind is not supported"));r.max_messages=1;const s=zt();return r.callback=u=>{this.userCallback=null,s.resolve(u)},(await this.fetch(r)).iterClosed.then(u=>{u&&s.reject(u),s.resolve(null)}).catch(u=>{s.reject(u)}),s}delete(){return this.currentConsumer?this.api.delete(this.stream,this.currentConsumer.name).then(n=>Promise.resolve(n)).catch(n=>Promise.reject(n)).finally(()=>{this.currentConsumer=null}):Promise.resolve(!1)}async info(n){return this.currentConsumer==null?(this.currentConsumer=await this.resetConsumer(this.startSeq),Promise.resolve(this.currentConsumer)):n&&this.currentConsumer?Promise.resolve(this.currentConsumer):this.api.info(this.stream,this.currentConsumer.name)}}class cd{constructor(n){C(this,"api");C(this,"notified");this.api=n,this.notified=!1}checkVersion(){const n=this.api.nc.features.get(at.JS_SIMPLIFICATION);return n.ok?Promise.resolve():Promise.reject(new Error(`consumers framework is only supported on servers ${n.min} or better`))}getPullConsumerFor(n){if(n.config.deliver_subject!==void 0)throw new Error("push consumer not supported");return new ud(this.api,n)}async get(n,r={}){return typeof r=="object"?this.ordered(n,r):(await this.checkVersion(),this.api.info(n,r).then(s=>s.config.deliver_subject!==void 0?Promise.reject(new Error("push consumer not supported")):new ud(this.api,s)).catch(s=>Promise.reject(s)))}async ordered(n,r){await this.checkVersion();const s=this.api;return new zd(s.nc,s.opts).info(n).then(u=>Promise.resolve(new OE(this.api,n,r))).catch(u=>Promise.reject(u))}}class Ju{constructor(n,r){C(this,"api");C(this,"_info");this.api=n,this._info=r}get name(){return this._info.config.name}alternates(){return this.info().then(n=>n.alternates?n.alternates:[])}async best(){if(await this.info(),this._info.alternates){const n=await this.api.info(this._info.alternates[0].name);return new Ju(this.api,n)}else return this}info(n=!1,r){return n?Promise.resolve(this._info):this.api.info(this.name,r).then(s=>(this._info=s,this._info))}getConsumerFromInfo(n){return new cd(new Ou(this.api.nc,this.api.opts)).getPullConsumerFor(n)}getConsumer(n){return new cd(new Ou(this.api.nc,this.api.opts)).get(this.name,n)}getMessage(n){return this.api.getMessage(this.name,n)}deleteMessage(n,r){return this.api.deleteMessage(this.name,n,r)}}class zd extends $l{constructor(n,r){super(n,r)}checkStreamConfigVersions(n){const r=this.nc;if(n.metadata){const{min:l,ok:u}=r.features.get(at.JS_STREAM_CONSUMER_METADATA);if(!u)throw new Error(`stream 'metadata' requires server ${l}`)}if(n.first_seq){const{min:l,ok:u}=r.features.get(at.JS_STREAM_FIRST_SEQ);if(!u)throw new Error(`stream 'first_seq' requires server ${l}`)}if(n.subject_transform){const{min:l,ok:u}=r.features.get(at.JS_STREAM_SUBJECT_TRANSFORM);if(!u)throw new Error(`stream 'subject_transform' requires server ${l}`)}if(n.compression){const{min:l,ok:u}=r.features.get(at.JS_STREAM_COMPRESSION);if(!u)throw new Error(`stream 'compression' requires server ${l}`)}if(n.consumer_limits){const{min:l,ok:u}=r.features.get(at.JS_DEFAULT_CONSUMER_LIMITS);if(!u)throw new Error(`stream 'consumer_limits' requires server ${l}`)}function s(l,u){var f;if((((f=u==null?void 0:u.subject_transforms)==null?void 0:f.length)||0)>0){const{min:m,ok:d}=r.features.get(at.JS_STREAM_SOURCE_SUBJECT_TRANSFORM);if(!d)throw new Error(`${l} 'subject_transforms' requires server ${m}`)}}n.sources&&n.sources.forEach(l=>{s("stream sources",l)}),n.mirror&&s("stream mirror",n.mirror)}async add(n={}){var l;this.checkStreamConfigVersions(n),dn(n.name),n.mirror=du(n.mirror),n.sources=(l=n.sources)==null?void 0:l.map(du);const s=await this._request(`${this.prefix}.STREAM.CREATE.${n.name}`,n);return this._fixInfo(s),s}async delete(n){return dn(n),(await this._request(`${this.prefix}.STREAM.DELETE.${n}`)).success}async update(n,r={}){var f;if(typeof n=="object"){const m=n;n=m.name,r=m,console.trace("\x1B[33m >> streams.update(config: StreamConfig) api changed to streams.update(name: string, config: StreamUpdateConfig) - this shim will be removed - update your code. \x1B[0m")}this.checkStreamConfigVersions(r),dn(n);const s=await this.info(n),l=Object.assign(s.config,r);l.mirror=du(l.mirror),l.sources=(f=l.sources)==null?void 0:f.map(du);const c=await this._request(`${this.prefix}.STREAM.UPDATE.${n}`,l);return this._fixInfo(c),c}async info(n,r){dn(n);const s=`${this.prefix}.STREAM.INFO.${n}`;let u=await this._request(s,r),{total:c,limit:f}=u,m=u.state.subjects?Object.getOwnPropertyNames(u.state.subjects).length:1;if(c&&c>m){const d=[u],y=r||{};let g=0;for(;c>m;){g++,y.offset=f*g;const w=await this._request(s,y);c=w.total,d.push(w);const k=Object.getOwnPropertyNames(w.state.subjects).length;if(m+=k,k<f)break}let x={};for(let w=0;w<d.length;w++)u=d[w],u.state.subjects&&(x=Object.assign(x,u.state.subjects));u.offset=0,u.total=0,u.limit=0,u.state.subjects=x}return this._fixInfo(u),u}list(n=""){const r=n!=null&&n.length?{subject:n}:{},s=u=>{const c=u;return c.streams.forEach(f=>{this._fixInfo(f)}),c.streams},l=`${this.prefix}.STREAM.LIST`;return new Cl(l,s,this,r)}_fixInfo(n){n.config.sealed=n.config.sealed||!1,n.config.deny_delete=n.config.deny_delete||!1,n.config.deny_purge=n.config.deny_purge||!1,n.config.allow_rollup_hdrs=n.config.allow_rollup_hdrs||!1}async purge(n,r){if(r){const{keep:l,seq:u}=r;if(typeof l=="number"&&typeof u=="number")throw new Error("can specify one of keep or seq")}return dn(n),await this._request(`${this.prefix}.STREAM.PURGE.${n}`,r)}async deleteMessage(n,r,s=!0){dn(n);const l={seq:r};return s||(l.no_erase=!0),(await this._request(`${this.prefix}.STREAM.MSG.DELETE.${n}`,l)).success}async getMessage(n,r){dn(n);const l=await this._request(`${this.prefix}.STREAM.MSG.GET.${n}`,r);return new Sx(l)}find(n){return this.findStream(n)}listKvs(){const n=s=>{var m;const u=s.streams.filter(d=>d.config.name.startsWith(Pn));u.forEach(d=>{this._fixInfo(d)});let c="";return u.length&&(c=((m=this.nc.info)==null?void 0:m.cluster)??""),u.map(d=>new wx(d,c))},r=`${this.prefix}.STREAM.LIST`;return new Cl(r,n,this)}listObjectStores(){const n=s=>{const u=s.streams.filter(f=>f.config.name.startsWith(Ld));return u.forEach(f=>{this._fixInfo(f)}),u.map(f=>new od(f))},r=`${this.prefix}.STREAM.LIST`;return new Cl(r,n,this)}names(n=""){const r=n!=null&&n.length?{subject:n}:{},s=u=>u.streams,l=`${this.prefix}.STREAM.NAMES`;return new Cl(l,s,this,r)}async get(n){const r=await this.info(n);return Promise.resolve(new Ju(this,r))}}class RE extends $l{constructor(n,r){super(n,r)}async getMessage(n,r){dn(n);let s=r;const{last_by_subj:l}=s;l&&(s=null);const u=s?this.jc.encode(s):Fn,c=this.opts.apiPrefix||"$JS.API",f=l?`${c}.DIRECT.GET.${n}.${l}`:`${c}.DIRECT.GET.${n}`,m=await this.nc.request(f,u,{timeout:this.timeout}),d=la(m);if(d)return Promise.reject(d);const y=new fd(m);return Promise.resolve(y)}async getBatch(n,r){dn(n);const l=`${this.opts.apiPrefix||"$JS.API"}.DIRECT.GET.${n}`;if(!Array.isArray(r.multi_last)||r.multi_last.length===0)return Promise.reject("multi_last is required");const u=JSON.stringify(r,(m,d)=>m==="up_to_time"&&d instanceof Date?d.toISOString():d),c=new tn,f=await this.nc.requestMany(l,u,{strategy:dr.SentinelMsg});return(async()=>{var g,x,w;let m=!1,d=!1,y;for await(const k of f){if(!m){m=!0;const D=((g=k.headers)==null?void 0:g.code)||0;if(D!==0&&D<200||D>299){y=(x=k.headers)==null?void 0:x.description.toLowerCase();break}if(((w=k.headers)==null?void 0:w.get("Nats-Num-Pending"))===""){d=!0;break}}if(k.data.length===0)break;c.push(new fd(k))}c.push(()=>{if(d)throw new Error("batch direct get not supported by the server");if(y)throw new Error(`bad request: ${y}`);c.stop()})})(),Promise.resolve(c)}}class fd{constructor(n){C(this,"data");C(this,"header");if(!n.headers)throw new Error("headers expected");this.data=n.data,this.header=n.headers}get subject(){return this.header.last(ra.Subject)}get seq(){const n=this.header.last(ra.Sequence);return typeof n=="string"?parseInt(n):0}get time(){return new Date(Date.parse(this.timestamp))}get timestamp(){return this.header.last(ra.TimeStamp)}get stream(){return this.header.last(ra.Stream)}json(n){return mr(n).decode(this.data)}string(){return qn.decode(this.data)}}C(fd,"jc");class ME extends $l{constructor(r,s){super(r,s);C(this,"streams");C(this,"consumers");C(this,"direct");this.streams=new zd(r,s),this.consumers=new Ou(r,s),this.direct=new RE(r,s)}async getAccountInfo(){return await this._request(`${this.prefix}.INFO`)}jetstream(){return this.nc.jetstream(this.getOptions())}advisories(){const r=new tn;return this.nc.subscribe("$JS.EVENT.ADVISORY.>",{callback:(s,l)=>{if(s)throw s;try{const u=this.parseJsResponse(l),c=u.type.split("."),f=c[c.length-1];r.push({kind:f,data:u})}catch(u){r.stop(u)}}}),r}}class Sx{constructor(n){C(this,"_header");C(this,"smr");this.smr=n}get subject(){return this.smr.message.subject}get seq(){return this.smr.message.seq}get timestamp(){return this.smr.message.time}get time(){return new Date(Date.parse(this.timestamp))}get data(){return this.smr.message.data?this._parse(this.smr.message.data):Fn}get header(){if(!this._header)if(this.smr.message.hdrs){const n=this._parse(this.smr.message.hdrs);this._header=zi.decode(n)}else this._header=ei();return this._header}_parse(n){const r=atob(n),s=r.length,l=new Uint8Array(s);for(let u=0;u<s;u++)l[u]=r.charCodeAt(u);return l}json(n){return mr(n).decode(this.data)}string(){return qn.decode(this.data)}}C(Sx,"jc");class DE{constructor(n){C(this,"api");this.api=n}get(n){return this.api.info(n).then(r=>new Ju(this.api,r))}}class kh{constructor(n){C(this,"info");C(this,"hdrs");this.info=n}get name(){return this.info.name}get description(){return this.info.description??""}get headers(){return this.hdrs||(this.hdrs=zi.fromRecord(this.info.headers||{})),this.hdrs}get options(){return this.info.options}get bucket(){return this.info.bucket}get chunks(){return this.info.chunks}get deleted(){return this.info.deleted??!1}get digest(){return this.info.digest}get mtime(){return this.info.mtime}get nuid(){return this.info.nuid}get size(){return this.info.size}get revision(){return this.info.revision}get metadata(){return this.info.metadata||{}}isLink(){var n,r;return((n=this.info.options)==null?void 0:n.link)!==void 0&&((r=this.info.options)==null?void 0:r.link)!==null}}function N0(e){const n={name:e.name,description:e.description??"",options:e.options,metadata:e.metadata};if(e.headers){const r=e.headers;n.headers=r.toRecord()}return n}function LE(){return new ReadableStream({pull(e){e.enqueue(new Uint8Array(0)),e.close()}})}class Nl{constructor(n,r,s){C(this,"jsm");C(this,"js");C(this,"stream");C(this,"name");this.name=n,this.jsm=r,this.js=s}_checkNotEmpty(n){return!n||n.length===0?{name:n,error:new Error("name cannot be empty")}:{name:n}}async info(n){const r=await this.rawInfo(n);return r?new kh(r):null}async list(){const n=[],r=await this.watch({ignoreDeletes:!0,includeHistory:!0});for await(const s of r){if(s===null)break;n.push(s)}return Promise.resolve(n)}async rawInfo(n){const{name:r,error:s}=this._checkNotEmpty(n);if(s)return Promise.reject(s);const l=this._metaSubject(r);try{const u=await this.jsm.streams.getMessage(this.stream,{last_by_subj:l}),f=mr().decode(u.data);return f.revision=u.seq,f}catch(u){return u.code==="404"?null:Promise.reject(u)}}async _si(n){try{return await this.jsm.streams.info(this.stream,n)}catch(r){return r.code==="404"?null:Promise.reject(r)}}async seal(){let n=await this._si();return n===null?Promise.reject(new Error("object store not found")):(n.config.sealed=!0,n=await this.jsm.streams.update(this.stream,n.config),Promise.resolve(new od(n)))}async status(n){const r=await this._si(n);return r===null?Promise.reject(new Error("object store not found")):Promise.resolve(new od(r))}destroy(){return this.jsm.streams.delete(this.stream)}async _put(n,r,s){var te;const l=this.js.getOptions();s=s||{timeout:l.timeout},s.timeout=s.timeout||l.timeout,s.previousRevision=s.previousRevision??void 0;const{timeout:u,previousRevision:c}=s,f=this.js.nc.info,m=(f==null?void 0:f.max_payload)||1024;n=n||{},n.options=n.options||{};let d=((te=n.options)==null?void 0:te.max_chunk_size)||128*1024;d=d>m?m:d,n.options.max_chunk_size=d;const y=await this.info(n.name),{name:g,error:x}=this._checkNotEmpty(n.name);if(x)return Promise.reject(x);const w=Bi.next(),k=this._chunkSubject(w),D=this._metaSubject(g),B=Object.assign({bucket:this.name,nuid:w,size:0,chunks:0},N0(n)),L=zt(),$=[],T=new pa;try{const P=r?r.getReader():null,z=x0.create();for(;;){const{done:X,value:Z}=P?await P.read():{done:!0,value:void 0};if(X){if(T.size()>0){const J=T.drain();z.update(J),B.chunks++,B.size+=J.length,$.push(this.js.publish(k,J,{timeout:u}))}await Promise.all($),$.length=0,B.mtime=new Date().toISOString();const H=oa.encode(z.digest());B.digest=`${T0}${H}`,B.deleted=!1;const O=ei();typeof c=="number"&&O.set(_r.ExpectedLastSubjectSequenceHdr,`${c}`),O.set(yn.RollupHdr,yn.RollupValueSubject);const K=await this.js.publish(D,mr().encode(B),{headers:O,timeout:u});if(B.revision=K.seq,y)try{await this.jsm.streams.purge(this.stream,{filter:`$O.${this.name}.C.${y.nuid}`})}catch{}L.resolve(new kh(B));break}if(Z)for(T.fill(Z);T.size()>d;){B.chunks++,B.size+=d;const H=T.drain(n.options.max_chunk_size);z.update(H),$.push(this.js.publish(k,H,{timeout:u}))}}}catch(P){await this.jsm.streams.purge(this.stream,{filter:k}),L.reject(P)}return L}putBlob(n,r,s){function l(u){return new ReadableStream({pull(c){c.enqueue(u),c.close()}})}return r===null&&(r=new Uint8Array(0)),this.put(n,l(r),s)}put(n,r,s){var l;return(l=n==null?void 0:n.options)!=null&&l.link?Promise.reject(new Error("link cannot be set when putting the object in bucket")):this._put(n,r,s)}async getBlob(n){async function r(u){const c=new pa,f=u.getReader();for(;;){const{done:m,value:d}=await f.read();if(m)return c.drain();d&&d.length&&c.fill(d)}}const s=await this.get(n);if(s===null)return Promise.resolve(null);const l=await Promise.all([s.error,r(s.data)]);return l[0]?Promise.reject(l[0]):Promise.resolve(l[1])}async get(n){const r=await this.rawInfo(n);if(r===null||r.deleted)return Promise.resolve(null);if(r.options&&r.options.link){const g=r.options.link.name||"";if(g==="")throw new Error("link is a bucket");return(r.options.link.bucket!==this.name?await Nl.create(this.js,r.options.link.bucket):this).get(g)}if(!r.digest.startsWith(T0))return Promise.reject(new Error(`unknown digest type: ${r.digest}`));const s=rd(r.digest.substring(8));if(s===null)return Promise.reject(new Error(`unable to parse digest: ${r.digest}`));const l=zt(),u={info:new kh(r),error:l};if(r.size===0)return u.data=LE(),l.resolve(null),Promise.resolve(u);let c;const f=Ui();f.orderedConsumer();const m=x0.create(),d=`$O.${this.name}.C.${r.nuid}`,y=await this.js.subscribe(d,f);return(async()=>{for await(const g of y)g.data.length>0&&(m.update(g.data),c.enqueue(g.data)),g.info.pending===0&&(f2(s,m.digest())?c.close():c.error(new Error(`received a corrupt object, digests do not match received: ${r.digest} calculated ${s}`)),y.unsubscribe())})().then(()=>{l.resolve()}).catch(g=>{c.error(g),l.reject(g)}),u.data=new ReadableStream({start(g){c=g},cancel(){y.unsubscribe()}}),u}linkStore(n,r){if(!(r instanceof Nl))return Promise.reject("bucket required");const s=r,{name:l,error:u}=this._checkNotEmpty(n);if(u)return Promise.reject(u);const c={name:l,options:{link:{bucket:s.name}}};return this._put(c,null)}async link(n,r){const{name:s,error:l}=this._checkNotEmpty(n);if(l)return Promise.reject(l);if(r.deleted)return Promise.reject(new Error("src object is deleted"));if(r.isLink())return Promise.reject(new Error("src object is a link"));const u=await this.rawInfo(n);if(u!==null&&!u.deleted)return Promise.reject(new Error("an object already exists with that name"));const c={bucket:r.bucket,name:r.name},f={name:s,bucket:r.bucket,options:{link:c}};await this.js.publish(this._metaSubject(n),JSON.stringify(f));const m=await this.info(n);return Promise.resolve(m)}async delete(n){const r=await this.rawInfo(n);if(r===null)return Promise.resolve({purged:0,success:!1});r.deleted=!0,r.size=0,r.chunks=0,r.digest="";const s=mr(),l=ei();return l.set(yn.RollupHdr,yn.RollupValueSubject),await this.js.publish(this._metaSubject(r.name),s.encode(r),{headers:l}),this.jsm.streams.purge(this.stream,{filter:this._chunkSubject(r.nuid)})}async update(n,r={}){const s=await this.rawInfo(n);if(s===null)return Promise.reject(new Error("object not found"));if(s.deleted)return Promise.reject(new Error("cannot update meta for a deleted object"));r.name=r.name??s.name;const{name:l,error:u}=this._checkNotEmpty(r.name);if(u)return Promise.reject(u);if(n!==r.name){const m=await this.info(r.name);if(m&&!m.deleted)return Promise.reject(new Error("an object already exists with that name"))}r.name=l;const c=Object.assign({},s,N0(r)),f=await this.js.publish(this._metaSubject(c.name),JSON.stringify(c));return n!==r.name&&await this.jsm.streams.purge(this.stream,{filter:this._metaSubject(n)}),Promise.resolve(f)}async watch(n={}){n.includeHistory=n.includeHistory??!1,n.ignoreDeletes=n.ignoreDeletes??!1;let r=!1;const s=new tn,l=this._metaSubjectAll();try{await this.jsm.streams.getMessage(this.stream,{last_by_subj:l})}catch(m){m.code==="404"?(s.push(null),r=!0):s.stop(m)}const u=mr(),c=Ui();c.orderedConsumer(),n.includeHistory?c.deliverLastPerSubject():(r=!0,c.deliverNew()),c.callback((m,d)=>{var y;if(m){s.stop(m);return}if(d!==null){const g=u.decode(d.data);g.deleted&&n.ignoreDeletes===!0||s.push(g),((y=d.info)==null?void 0:y.pending)===0&&!r&&(r=!0,s.push(null))}});const f=await this.js.subscribe(l,c);return s._data=f,s.iterClosed.then(()=>{f.unsubscribe()}),f.closed.then(()=>{s.stop()}).catch(m=>{s.stop(m)}),s}_chunkSubject(n){return`$O.${this.name}.C.${n}`}_metaSubject(n){return`$O.${this.name}.M.${oa.encode(n)}`}_metaSubjectAll(){return`$O.${this.name}.M.>`}async init(n={}){try{this.stream=EE(this.name)}catch(l){return Promise.reject(l)}const r=(n==null?void 0:n.ttl)||0;delete n.ttl;const s=Object.assign({max_age:r},n);s.name=this.stream,s.num_replicas=n.replicas??1,s.allow_direct=!0,s.allow_rollup_hdrs=!0,s.discard=Ll.New,s.subjects=[`$O.${this.name}.C.>`,`$O.${this.name}.M.>`],n.placement&&(s.placement=n.placement),n.metadata&&(s.metadata=n.metadata),typeof n.compression=="boolean"&&(s.compression=n.compression?Pi.S2:Pi.None);try{await this.jsm.streams.info(s.name)}catch(l){l.message==="stream not found"&&await this.jsm.streams.add(s)}}static async create(n,r,s={}){const l=await n.jetstreamManager(),u=new Nl(r,l,n);return await u.init(s),Promise.resolve(u)}}class zE{constructor(n){C(this,"js");this.js=n}kv(n,r={}){const s=this.js,{ok:l,min:u}=s.nc.features.get(at.JS_KV);return l?r.bindOnly?Ul.bind(this.js,n,r):Ul.create(this.js,n,r):Promise.reject(new Error(`kv is only supported on servers ${u} or better`))}os(n,r={}){var c;if(typeof((c=crypto==null?void 0:crypto.subtle)==null?void 0:c.digest)!="function")return Promise.reject(new Error("objectstore: unable to calculate hashes - crypto.subtle.digest with sha256 support is required"));const s=this.js,{ok:l,min:u}=s.nc.features.get(at.JS_OBJECTSTORE);return l?Nl.create(this.js,n,r):Promise.reject(new Error(`objectstore is only supported on servers ${u} or better`))}}class Ud extends $l{constructor(r,s){super(r,s);C(this,"consumers");C(this,"streams");C(this,"consumerAPI");C(this,"streamAPI");this.consumerAPI=new Ou(r,s),this.streamAPI=new zd(r,s),this.consumers=new cd(this.consumerAPI),this.streams=new DE(this.streamAPI)}jetstreamManager(r){r===void 0&&(r=this.opts.checkAPI);const s=Object.assign({},this.opts,{checkAPI:r});return this.nc.jetstreamManager(s)}get apiPrefix(){return this.prefix}get views(){return new zE(this)}async publish(r,s=Fn,l){l=l||{},l.expect=l.expect||{};const u=(l==null?void 0:l.headers)||ei();l&&(l.msgID&&u.set(_r.MsgIdHdr,l.msgID),l.expect.lastMsgID&&u.set(_r.ExpectedLastMsgIdHdr,l.expect.lastMsgID),l.expect.streamName&&u.set(_r.ExpectedStreamHdr,l.expect.streamName),typeof l.expect.lastSequence=="number"&&u.set(_r.ExpectedLastSeqHdr,`${l.expect.lastSequence}`),typeof l.expect.lastSubjectSequence=="number"&&u.set(_r.ExpectedLastSubjectSequenceHdr,`${l.expect.lastSubjectSequence}`));const c=l.timeout||this.timeout,f={};c&&(f.timeout=c),l&&(f.headers=u);let{retries:m,retry_delay:d}=l;m=m||1,d=d||250;let y;for(let x=0;x<m;x++)try{y=await this.nc.request(r,s,f);break}catch(w){if(w.code==="503"&&x+1<m)await wa(d);else throw w}const g=this.parseJsResponse(y);if(g.stream==="")throw je.errorForCode(Ee.JetStreamInvalidAck);return g.duplicate=g.duplicate?g.duplicate:!1,g}async pull(r,s,l=0){dn(r),aa(s);let u=this.timeout;l>u&&(u=l),l=l<0?0:Lt(l);const c={batch:1,no_wait:l===0,expires:l},f=await this.nc.request(`${this.prefix}.CONSUMER.MSG.NEXT.${r}.${s}`,this.jc.encode(c),{noMux:!0,timeout:u}),m=la(f);if(m)throw m;return Bl(f,this.timeout)}fetch(r,s,l={}){dn(r),aa(s);let u=null;const c=(l.max_bytes??0)>0;let f=0;const m=c?l.max_bytes:0;let d=null;const y={};if(y.batch=l.batch||1,m){const $=this.nc.features.get(at.JS_PULL_MAX_BYTES);if(!$.ok)throw new Error(`max_bytes is only supported on servers ${$.min} or better`);y.max_bytes=m}y.no_wait=l.no_wait||!1,y.no_wait&&y.expires&&(y.expires=0);const g=l.expires||0;if(g&&(y.expires=Lt(g)),g===0&&y.no_wait===!1)throw new Error("expires or no_wait is required");const x=l.idle_heartbeat||0;x&&(y.idle_heartbeat=Lt(x),l.delay_heartbeat===!0&&(y.idle_heartbeat=Lt(x*4)));const w=new tn,k=y.batch;let D=0;w.protocolFilterFn=($,T=!1)=>ed($.msg)?(d==null||d.work(),!1):!0,w.dispatchedFn=$=>{if($){if(c&&(f+=$.data.length),D++,u&&$.info.pending===0)return;(w.getPending()===1&&$.info.pending===0||k===D||m>0&&f>=m)&&w.stop()}};const B=Zr(this.nc.options.inboxPrefix),L=this.nc.subscribe(B,{max:l.batch,callback:($,T)=>{$===null&&($=la(T)),$!==null?(u&&(u.cancel(),u=null),G_($)?w.stop(Ex($)===null?void 0:$):w.stop($)):(d==null||d.work(),w.received++,w.push(Bl(T,this.timeout)))}});return g&&(u=da(g),u.catch(()=>{L.isClosed()||(L.drain().catch(()=>{}),u=null),d&&d.cancel()})),(async()=>{try{x&&(d=new Dd(x,$=>(w.push(()=>{w.err=new je(`${rr.IdleHeartbeatMissed}: ${$}`,Ee.JetStreamIdleHeartBeat)}),!0)))}catch{}await L.closed,u!==null&&(u.cancel(),u=null),d&&d.cancel(),w.stop()})().catch(),this.nc.publish(`${this.prefix}.CONSUMER.MSG.NEXT.${r}.${s}`,this.jc.encode(y),{reply:B}),w}async pullSubscribe(r,s=Ui()){const l=await this._processOptions(r,s);if(l.ordered)throw new Error("pull subscribers cannot be be ordered");if(l.config.deliver_subject)throw new Error("consumer info specifies deliver_subject - pull consumers cannot have deliver_subject set");const u=l.config.ack_policy;if(u===en.None||u===en.All)throw new Error("ack policy for pull consumers must be explicit");const c=this._buildTypedSubscriptionOpts(l),f=new qE(this,l.deliver,c);f.info=l;try{await this._maybeCreateConsumer(l)}catch(m){throw f.unsubscribe(),m}return f}async subscribe(r,s=Ui()){const l=await this._processOptions(r,s);if(!l.isBind&&!l.config.deliver_subject)throw new Error("push consumer requires deliver_subject");const u=this._buildTypedSubscriptionOpts(l),c=new _x(this,l.deliver,u);c.info=l;try{await this._maybeCreateConsumer(l)}catch(f){throw c.unsubscribe(),f}return c._maybeSetupHbMonitoring(),c}async _processOptions(r,s=Ui()){const l=p0(s)?s.getOpts():s;if(l.isBind=p0(s)?s.isBind:!1,l.flow_control={heartbeat_count:0,fc_count:0,consumer_restarts:0},l.ordered){if(l.ordered_consumer_sequence={stream_seq:0,delivery_seq:0},l.config.ack_policy!==en.NotSet&&l.config.ack_policy!==en.None)throw new je("ordered consumer: ack_policy can only be set to 'none'",Ee.ApiError);if(l.config.durable_name&&l.config.durable_name.length>0)throw new je("ordered consumer: durable_name cannot be set",Ee.ApiError);if(l.config.deliver_subject&&l.config.deliver_subject.length>0)throw new je("ordered consumer: deliver_subject cannot be set",Ee.ApiError);if(l.config.max_deliver!==void 0&&l.config.max_deliver>1)throw new je("ordered consumer: max_deliver cannot be set",Ee.ApiError);if(l.config.deliver_group&&l.config.deliver_group.length>0)throw new je("ordered consumer: deliver_group cannot be set",Ee.ApiError);l.config.deliver_subject=Zr(this.nc.options.inboxPrefix),l.config.ack_policy=en.None,l.config.max_deliver=1,l.config.flow_control=!0,l.config.idle_heartbeat=l.config.idle_heartbeat||Lt(5e3),l.config.ack_wait=Lt(1320*60*1e3),l.config.mem_storage=!0,l.config.num_replicas=1}if(l.config.ack_policy===en.NotSet&&(l.config.ack_policy=en.All),l.api=this,l.config=l.config||{},l.stream=l.stream?l.stream:await this.findStream(r),l.attached=!1,l.config.durable_name)try{const u=await this.consumerAPI.info(l.stream,l.config.durable_name);if(u){if(u.config.filter_subject&&u.config.filter_subject!==r)throw new Error("subject does not match consumer");const c=l.config.deliver_group??"";if(c===""&&u.push_bound===!0)throw new Error("duplicate subscription");const f=u.config.deliver_group??"";if(c!==f)throw f===""?new Error("durable requires no queue group"):new Error(`durable requires queue group '${f}'`);l.last=u,l.config=u.config,l.attached=!0,l.config.durable_name||(l.name=u.name)}}catch(u){if(u.code!=="404")throw u}return!l.attached&&l.config.filter_subject===void 0&&l.config.filter_subjects===void 0&&(l.config.filter_subject=r),l.deliver=l.config.deliver_subject||Zr(this.nc.options.inboxPrefix),l}_buildTypedSubscriptionOpts(r){const s={};return s.adapter=HE(r.callbackFn===void 0,this.timeout),s.ingestionFilterFn=Ud.ingestionFn(r.ordered),s.protocolFilterFn=(l,u=!1)=>{const c=l;return Wh(c.msg)?(u||c.msg.respond(),!1):!0},!r.mack&&r.config.ack_policy!==en.None&&(s.dispatchedFn=$E),r.callbackFn&&(s.callback=r.callbackFn),s.max=r.max||0,s.queue=r.queue,s}async _maybeCreateConsumer(r){if(r.attached)return;if(r.isBind)throw new Error(`unable to bind - durable consumer ${r.config.durable_name} doesn't exist in ${r.stream}`);r.config=Object.assign({deliver_policy:$t.All,ack_policy:en.Explicit,ack_wait:Lt(30*1e3),replay_policy:ma.Instant},r.config);const s=await this.consumerAPI.add(r.stream,r.config);if(Array.isArray(r.config.filter_subjects&&!Array.isArray(s.config.filter_subjects)))throw new Error("jetstream server doesn't support consumers with multiple filter subjects");r.name=s.name,r.config=s.config,r.last=s}static ingestionFn(r){return(s,l)=>{var m;const u=l;if(!s)return{ingest:!1,protocol:!1};const c=s;if(la(c.msg)||(m=u.monitor)==null||m.work(),ed(c.msg)){const d=r?u._checkHbOrderConsumer(c.msg):!0;return r||u.info.flow_control.heartbeat_count++,{ingest:d,protocol:!0}}else if(Wh(c.msg))return u.info.flow_control.fc_count++,{ingest:!0,protocol:!0};return{ingest:r?u._checkOrderedConsumer(s):!0,protocol:!1}}}}class Bd{constructor(n){C(this,"options");C(this,"protocol");C(this,"draining");C(this,"listeners");C(this,"_services");this.draining=!1,this.options=sE(n),this.listeners=[]}static connect(n={}){return new Promise((r,s)=>{const l=new Bd(n);Du.connect(l.options,l).then(u=>{l.protocol=u,(async function(){for await(const c of u.status())l.listeners.forEach(f=>{f.push(c)})})(),r(l)}).catch(u=>{s(u)})})}closed(){return this.protocol.closed}async close(){await this.protocol.close()}_check(n,r,s){if(this.isClosed())throw je.errorForCode(Ee.ConnectionClosed);if(r&&this.isDraining()||s&&this.protocol.noMorePublishing)throw je.errorForCode(Ee.ConnectionDraining);if(n=n||"",n.length===0)throw je.errorForCode(Ee.BadSubject)}publish(n,r,s){this._check(n,!1,!0),this.protocol.publish(n,r,s)}publishMessage(n){return this.publish(n.subject,n.data,{reply:n.reply,headers:n.headers})}respondMessage(n){return n.reply?(this.publish(n.reply,n.data,{reply:n.reply,headers:n.headers}),!0):!1}subscribe(n,r={}){this._check(n,!0,!1);const s=new xx(this.protocol,n,r);return this.protocol.subscribe(s),s}_resub(n,r,s){this._check(r,!0,!1);const l=n;l.max=s,s&&(l.max=s+l.received),this.protocol.resub(l,r)}requestMany(n,r=Fn,s={maxWait:1e3,maxMessages:-1}){const l=!this.protocol.options.noAsyncTraces;try{this._check(n,!0,!0)}catch(m){return Promise.reject(m)}if(s.strategy=s.strategy||dr.Timer,s.maxWait=s.maxWait||1e3,s.maxWait<1)return Promise.reject(new je("timeout",Ee.InvalidOption));const u=new tn;function c(m){u.push(()=>{u.stop(m)})}function f(m,d){m||d===null?c(m===null?void 0:m):u.push(d)}if(s.noMux){const m=l?new Error().stack:null;let d=typeof s.maxMessages=="number"&&s.maxMessages>0?s.maxMessages:-1;const y=this.subscribe(Zr(this.options.inboxPrefix),{callback:(k,D)=>{var B,L;if(((B=D==null?void 0:D.data)==null?void 0:B.length)===0&&((L=D==null?void 0:D.headers)==null?void 0:L.status)===Ee.NoResponders&&(k=je.errorForCode(Ee.NoResponders)),k){m&&(k.stack+=`
82
+
83
+ ${m}`),g(k);return}f(null,D),s.strategy===dr.Count&&(d--,d===0&&g()),s.strategy===dr.JitterTimer&&(w(),x=setTimeout(()=>{g()},300)),s.strategy===dr.SentinelMsg&&D&&D.data.length===0&&g()}});y.requestSubject=n,y.closed.then(()=>{c()}).catch(k=>{u.stop(k)});const g=k=>{k&&u.push(()=>{throw k}),w(),y.drain().then(()=>{c()}).catch(D=>{c()})};u.iterClosed.then(()=>{w(),y==null||y.unsubscribe()}).catch(k=>{w(),y==null||y.unsubscribe()});try{this.publish(n,r,{reply:y.getSubject()})}catch(k){g(k)}let x=setTimeout(()=>{g()},s.maxWait);const w=()=>{x&&clearTimeout(x)}}else{const m=s;m.callback=f,u.iterClosed.then(()=>{d.cancel()}).catch(y=>{d.cancel(y)});const d=new h2(this.protocol.muxSubscriptions,n,m);this.protocol.request(d);try{this.publish(n,r,{reply:`${this.protocol.muxSubscriptions.baseInbox}${d.token}`,headers:s.headers})}catch(y){d.cancel(y)}}return Promise.resolve(u)}request(n,r,s={timeout:1e3,noMux:!1}){try{this._check(n,!0,!0)}catch(u){return Promise.reject(u)}const l=!this.protocol.options.noAsyncTraces;if(s.timeout=s.timeout||1e3,s.timeout<1)return Promise.reject(new je("timeout",Ee.InvalidOption));if(!s.noMux&&s.reply)return Promise.reject(new je("reply can only be used with noMux",Ee.InvalidOption));if(s.noMux){const u=s.reply?s.reply:Zr(this.options.inboxPrefix),c=zt(),f=l?new Error:null,m=this.subscribe(u,{max:1,timeout:s.timeout,callback:(d,y)=>{d?(f&&d.code!==Ee.Timeout&&(d.stack+=`
84
+
85
+ ${f.stack}`),m.unsubscribe(),c.reject(d)):(d=lx(y),d?(f&&(d.stack+=`
86
+
87
+ ${f.stack}`),c.reject(d)):c.resolve(y))}});return m.requestSubject=n,this.protocol.publish(n,r,{reply:u,headers:s.headers}),c}else{const u=new cx(this.protocol.muxSubscriptions,n,s,l);this.protocol.request(u);try{this.publish(n,r,{reply:`${this.protocol.muxSubscriptions.baseInbox}${u.token}`,headers:s.headers})}catch(f){u.cancel(f)}const c=Promise.race([u.timer,u.deferred]);return c.catch(()=>{u.cancel()}),c}}flush(){return this.isClosed()?Promise.reject(je.errorForCode(Ee.ConnectionClosed)):this.protocol.flush()}drain(){return this.isClosed()?Promise.reject(je.errorForCode(Ee.ConnectionClosed)):this.isDraining()?Promise.reject(je.errorForCode(Ee.ConnectionDraining)):(this.draining=!0,this.protocol.drain())}isClosed(){return this.protocol.isClosed()}isDraining(){return this.draining}getServer(){const n=this.protocol.getServer();return n?n.listen:""}status(){const n=new tn;return n.iterClosed.then(()=>{const r=this.listeners.indexOf(n);this.listeners.splice(r,1)}),this.listeners.push(n),n}get info(){return this.protocol.isClosed()?void 0:this.protocol.info}async context(){return(await this.request("$SYS.REQ.USER.INFO")).json((r,s)=>r==="time"?new Date(Date.parse(s)):s)}stats(){return{inBytes:this.protocol.inBytes,outBytes:this.protocol.outBytes,inMsgs:this.protocol.inMsgs,outMsgs:this.protocol.outMsgs}}async jetstreamManager(n={}){const r=new ME(this,n);if(n.checkAPI!==!1)try{await r.getAccountInfo()}catch(s){const l=s;throw l.code===Ee.NoResponders&&(l.code=Ee.JetStreamNotEnabled),l}return r}jetstream(n={}){return new Ud(this,n)}getServerVersion(){const n=this.info;return n?fs(n.version):void 0}async rtt(){if(!this.protocol._closed&&!this.protocol.connected)throw je.errorForCode(Ee.Disconnect);const n=Date.now();return await this.flush(),Date.now()-n}get features(){return this.protocol.features}get services(){return this._services||(this._services=new UE(this)),this._services}reconnect(){return this.isClosed()?Promise.reject(je.errorForCode(Ee.ConnectionClosed)):this.isDraining()?Promise.reject(je.errorForCode(Ee.ConnectionDraining)):this.protocol.reconnect()}}class UE{constructor(n){C(this,"nc");this.nc=n}add(n){try{return new Yl(this.nc,n).start()}catch(r){return Promise.reject(r)}}client(n,r){return new gE(this.nc,n,r)}}class BE{constructor(n,r,s){C(this,"bucket");C(this,"sm");C(this,"prefixLen");this.bucket=n,this.prefixLen=r,this.sm=s}get key(){return this.sm.subject.substring(this.prefixLen)}get value(){return this.sm.data}get delta(){return 0}get created(){return this.sm.time}get revision(){return this.sm.seq}get operation(){return this.sm.header.get(Lu)||"PUT"}get length(){const n=this.sm.header.get(yn.MessageSizeHdr)||"";return n!==""?parseInt(n,10):this.sm.data.length}json(){return this.sm.json()}string(){return this.sm.string()}}class PE{constructor(n,r,s){C(this,"bucket");C(this,"key");C(this,"sm");this.bucket=n,this.key=r,this.sm=s}get value(){return this.sm.data}get created(){return new Date(Rd(this.sm.info.timestampNanos))}get revision(){return this.sm.seq}get operation(){var n;return((n=this.sm.headers)==null?void 0:n.get(Lu))||"PUT"}get delta(){return this.sm.info.pending}get length(){var r;const n=((r=this.sm.headers)==null?void 0:r.get(yn.MessageSizeHdr))||"";return n!==""?parseInt(n,10):this.sm.data.length}json(){return this.sm.json()}string(){return this.sm.string()}}class _x extends g2{constructor(r,s,l){super(r.nc,s,l);C(this,"js");C(this,"monitor");this.js=r,this.monitor=null,this.sub.closed.then(()=>{this.monitor&&this.monitor.cancel()})}set info(r){this.sub.info=r}get info(){return this.sub.info}_resetOrderedConsumer(r){if(this.info===null||this.sub.isClosed())return;const s=Zr(this.js.nc.options.inboxPrefix);this.js.nc._resub(this.sub,s);const u=this.info;u.config.name=Bi.next(),u.ordered_consumer_sequence.delivery_seq=0,u.flow_control.heartbeat_count=0,u.flow_control.fc_count=0,u.flow_control.consumer_restarts++,u.deliver=s,u.config.deliver_subject=s,u.config.deliver_policy=$t.StartSequence,u.config.opt_start_seq=r;const c={};c.stream_name=this.info.stream,c.config=u.config;const f=`${u.api.prefix}.CONSUMER.CREATE.${u.stream}`;this.js._request(f,c,{retries:-1}).then(m=>{const d=m,y=this.sub.info;y.last=d,this.info.config=d.config,this.info.name=d.name}).catch(m=>{const d=new je(`unable to recreate ordered consumer ${u.stream} at seq ${r}`,Ee.RequestError,m);this.sub.callback(d,{})})}_maybeSetupHbMonitoring(){var s,l;const r=((l=(s=this.info)==null?void 0:s.config)==null?void 0:l.idle_heartbeat)||0;r&&this._setupHbMonitoring(Rd(r))}_setupHbMonitoring(r,s=0){const l={cancelAfter:0,maxOut:2};s&&(l.cancelAfter=s);const u=this.sub,c=f=>{var y,g,x,w;const m=K_(409,`${rr.IdleHeartbeatMissed}: ${f}`,this.sub.subject);if(!((y=this.info)==null?void 0:y.ordered))this.sub.callback(null,m);else{if(!this.js.nc.protocol.connected)return!1;const k=((x=(g=this.info)==null?void 0:g.ordered_consumer_sequence)==null?void 0:x.stream_seq)||0;return this._resetOrderedConsumer(k+1),(w=this.monitor)==null||w.restart(),!1}return!u.noIterator};this.monitor=new Dd(r,c,l)}_checkHbOrderConsumer(r){const s=r.headers.get(yn.ConsumerStalledHdr);s!==""&&this.js.nc.publish(s);const l=parseInt(r.headers.get(yn.LastConsumerSeqHdr),10),u=this.info.ordered_consumer_sequence;return this.info.flow_control.heartbeat_count++,l!==u.delivery_seq&&this._resetOrderedConsumer(u.stream_seq+1),!1}_checkOrderedConsumer(r){const s=this.info.ordered_consumer_sequence,l=r.info.streamSequence,u=r.info.deliverySequence;return u!=s.delivery_seq+1?(this._resetOrderedConsumer(s.stream_seq+1),!1):(s.delivery_seq=u,s.stream_seq=l,!0)}async destroy(){this.isClosed()||await this.drain();const r=this.sub.info,s=r.config.durable_name||r.name,l=`${r.api.prefix}.CONSUMER.DELETE.${r.stream}.${s}`;await r.api._request(l)}async consumerInfo(){const r=this.sub.info,s=r.config.durable_name||r.name,l=`${r.api.prefix}.CONSUMER.INFO.${r.stream}.${s}`,u=await r.api._request(l);return r.last=u,u}}class qE extends _x{constructor(n,r,s){super(n,r,s)}pull(n={batch:1}){const{stream:r,config:s,name:l}=this.sub.info,u=s.durable_name??l,c={};if(c.batch=n.batch||1,c.no_wait=n.no_wait||!1,(n.max_bytes??0)>0){const d=this.js.nc.features.get(at.JS_PULL_MAX_BYTES);if(!d.ok)throw new Error(`max_bytes is only supported on servers ${d.min} or better`);c.max_bytes=n.max_bytes}let f=0;n.expires&&n.expires>0&&(f=n.expires,c.expires=Lt(f));let m=0;if(n.idle_heartbeat&&n.idle_heartbeat>0&&(m=n.idle_heartbeat,c.idle_heartbeat=Lt(m)),m&&f===0)throw new Error("idle_heartbeat requires expires");if(m>f)throw new Error("expires must be greater than idle_heartbeat");if(this.info){this.monitor&&this.monitor.cancel(),f&&m&&(this.monitor?this.monitor._change(m,f):this._setupHbMonitoring(m,f));const d=this.info.api,y=`${d.prefix}.CONSUMER.MSG.NEXT.${r}.${u}`,g=this.sub.subject;d.nc.publish(y,d.jc.encode(c),{reply:g})}}}function HE(e,n){return e?FE(n):IE(n)}function IE(e){return(n,r)=>n?[n,null]:(n=la(r),n?[n,null]:[null,Bl(r,e)])}function FE(e){return(n,r)=>{if(n)return[n,null];const s=la(r);return s!==null?[Ex(s),null]:[null,Bl(r,e)]}}function Ex(e){if(e!==null)switch(e.code){case Ee.JetStream404NoMessages:case Ee.JetStream408RequestTimeout:return null;case Ee.JetStream409:return Q_(e)?e:null;default:return e}return null}function $E(e){e&&e.ack()}function YE(e){const n=e.split(".");if(n.length===9&&n.splice(2,0,"_",""),n.length<11||n[0]!=="$JS"||n[1]!=="ACK")throw new Error("not js message");const r={};return r.domain=n[2]==="_"?"":n[2],r.account_hash=n[3],r.stream=n[4],r.consumer=n[5],r.deliveryCount=parseInt(n[6],10),r.redeliveryCount=r.deliveryCount,r.redelivered=r.deliveryCount>1,r.streamSequence=parseInt(n[7],10),r.deliverySequence=parseInt(n[8],10),r.timestampNanos=parseInt(n[9],10),r.pending=parseInt(n[10],10),r}class GE{constructor(n,r){C(this,"msg");C(this,"di");C(this,"didAck");C(this,"timeout");this.msg=n,this.didAck=!1,this.timeout=r}get subject(){return this.msg.subject}get sid(){return this.msg.sid}get data(){return this.msg.data}get headers(){return this.msg.headers}get info(){return this.di||(this.di=YE(this.reply)),this.di}get redelivered(){return this.info.deliveryCount>1}get reply(){return this.msg.reply||""}get seq(){return this.info.streamSequence}doAck(n){this.didAck||(this.didAck=!this.isWIP(n),this.msg.respond(n))}isWIP(n){return n.length===4&&n[0]===xl[0]&&n[1]===xl[1]&&n[2]===xl[2]&&n[3]===xl[3]}async ackAck(n){var s;n=n||{},n.timeout=n.timeout||this.timeout;const r=zt();if(this.didAck)r.resolve(!1);else if(this.didAck=!0,this.msg.reply){const u=this.msg.publisher,c=!((s=u.options)!=null&&s.noAsyncTraces),f=new cx(u.muxSubscriptions,this.msg.reply,{timeout:n.timeout},c);u.request(f);try{u.publish(this.msg.reply,j0,{reply:`${u.muxSubscriptions.baseInbox}${f.token}`})}catch(m){f.cancel(m)}try{await Promise.race([f.timer,f.deferred]),r.resolve(!0)}catch(m){f.cancel(m),r.reject(m)}}else r.resolve(!1);return r}ack(){this.doAck(j0)}nak(n){let r=CE;n&&(r=ju().encode(`-NAK ${JSON.stringify({delay:Lt(n)})}`)),this.doAck(r)}working(){this.doAck(xl)}next(n,r={batch:1}){const s={};s.batch=r.batch||1,s.no_wait=r.no_wait||!1,r.expires&&r.expires>0&&(s.expires=Lt(r.expires));const l=mr().encode(s),u=pa.concat(AE,jE,l),c=n?{reply:n}:void 0;this.msg.respond(u,c)}term(n=""){let r=TE;(n==null?void 0:n.length)>0&&(r=ju().encode(`+TERM ${n}`)),this.doAck(r)}json(){return this.msg.json()}string(){return this.msg.string()}}const VE="1.30.3",JE="nats.ws";class XE{constructor(){C(this,"version");C(this,"lang");C(this,"closeError");C(this,"connected");C(this,"done");C(this,"socket");C(this,"options");C(this,"socketClosed");C(this,"encrypted");C(this,"peeked");C(this,"yields");C(this,"signal");C(this,"closedNotification");this.version=VE,this.lang=JE,this.connected=!1,this.done=!1,this.socketClosed=!1,this.encrypted=!1,this.peeked=!1,this.yields=[],this.signal=zt(),this.closedNotification=zt()}async connect(n,r){const s=zt();if(r.tls)return s.reject(new je("tls",Ee.InvalidOption)),s;this.options=r;const l=n.src;if(r.wsFactory){const{socket:u,encrypted:c}=await r.wsFactory(n.src,r);this.socket=u,this.encrypted=c}else this.encrypted=l.indexOf("wss://")===0,this.socket=new WebSocket(l);return this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{this.isDiscarded()},this.socket.onmessage=u=>{if(this.isDiscarded())return;if(this.yields.push(new Uint8Array(u.data)),this.peeked){this.signal.resolve();return}const c=pa.concat(...this.yields),f=S2(c);if(f!==""){const m=oE.exec(f);if(!m){r.debug&&console.error("!!!",cu(c)),s.reject(new Error("unexpected response from server"));return}try{const d=JSON.parse(m[1]);aE(d,this.options),this.peeked=!0,this.connected=!0,this.signal.resolve(),s.resolve()}catch(d){s.reject(d);return}}},this.socket.onclose=u=>{if(this.isDiscarded())return;this.socketClosed=!0;let c;this.done||(u.wasClean||(c=new Error(u.reason)),this._closed(c))},this.socket.onerror=u=>{if(this.isDiscarded())return;const c=u,f=new je(c.message,Ee.Unknown,new Error(c.error));s.reject(f)},s}disconnect(){this._closed(void 0,!0)}async _closed(n,r=!0){if(!this.isDiscarded()&&this.connected&&!this.done){if(this.closeError=n,!n)for(;!this.socketClosed&&this.socket.bufferedAmount>0;)await wa(100);this.done=!0;try{this.socket.close(n?1002:1e3,n?n.message:void 0)}catch{}r&&this.closedNotification.resolve(n)}}get isClosed(){return this.done}[Symbol.asyncIterator](){return this.iterate()}async*iterate(){for(;;){if(this.isDiscarded())return;this.yields.length===0&&await this.signal;const n=this.yields;this.yields=[];for(let r=0;r<n.length;r++)this.options.debug&&console.info(`> ${cu(n[r])}`),yield n[r];if(this.done)break;this.yields.length===0&&(n.length=0,this.yields=n,this.signal=zt())}}isEncrypted(){return this.connected&&this.encrypted}send(n){if(!this.isDiscarded())try{this.socket.send(n.buffer),this.options.debug&&console.info(`< ${cu(n)}`);return}catch(r){this.options.debug&&console.error(`!!! ${cu(n)}: ${r}`)}}close(n){return this._closed(n,!1)}closed(){return this.closedNotification}isDiscarded(){return this.done?(this.discard(),!0):!1}discard(){var n;this.done=!0;try{(n=this.socket)==null||n.close()}catch{}}}function KE(e,n){/^(.*:\/\/)(.*)/.test(e)||(typeof n=="boolean"?e=`${n===!0?"https":"http"}://${e}`:e=`https://${e}`);let s=new URL(e);const l=s.protocol.toLowerCase();l==="ws:"&&(n=!1),l==="wss:"&&(n=!0),l!=="https:"&&l!=="http"&&(e=e.replace(/^(.*:\/\/)(.*)/gm,"$2"),s=new URL(`http://${e}`));let u,c;const f=s.hostname,m=s.pathname,d=s.search||"";switch(l){case"http:":case"ws:":case"nats:":c=s.port||"80",u="ws:";break;case"https:":case"wss:":case"tls:":c=s.port||"443",u="wss:";break;default:c=s.port||n===!0?"443":"80",u=n===!0?"wss:":"ws:";break}return`${u}//${f}:${c}${m}${d}`}function kx(e={}){return y2({defaultPort:443,urlParseFn:KE,factory:()=>new XE}),Bd.connect(e)}/*! Capacitor: https://capacitorjs.com/ - MIT License */var ga;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(ga||(ga={}));class Ch extends Error{constructor(n,r,s){super(n),this.message=n,this.code=r,this.data=s}}const QE=e=>{var n,r;return e!=null&&e.androidBridge?"android":!((r=(n=e==null?void 0:e.webkit)===null||n===void 0?void 0:n.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},ZE=e=>{const n=e.CapacitorCustomPlatform||null,r=e.Capacitor||{},s=r.Plugins=r.Plugins||{},l=()=>n!==null?n.name:QE(e),u=()=>l()!=="web",c=g=>{const x=d.get(g);return!!(x!=null&&x.platforms.has(l())||f(g))},f=g=>{var x;return(x=r.PluginHeaders)===null||x===void 0?void 0:x.find(w=>w.name===g)},m=g=>e.console.error(g),d=new Map,y=(g,x={})=>{const w=d.get(g);if(w)return console.warn(`Capacitor plugin "${g}" already registered. Cannot register plugins twice.`),w.proxy;const k=l(),D=f(g);let B;const L=async()=>(!B&&k in x?B=typeof x[k]=="function"?B=await x[k]():B=x[k]:n!==null&&!B&&"web"in x&&(B=typeof x.web=="function"?B=await x.web():B=x.web),B),$=(Z,H)=>{var O,K;if(D){const J=D==null?void 0:D.methods.find(se=>H===se.name);if(J)return J.rtype==="promise"?se=>r.nativePromise(g,H.toString(),se):(se,ie)=>r.nativeCallback(g,H.toString(),se,ie);if(Z)return(O=Z[H])===null||O===void 0?void 0:O.bind(Z)}else{if(Z)return(K=Z[H])===null||K===void 0?void 0:K.bind(Z);throw new Ch(`"${g}" plugin is not implemented on ${k}`,ga.Unimplemented)}},T=Z=>{let H;const O=(...K)=>{const J=L().then(se=>{const ie=$(se,Z);if(ie){const F=ie(...K);return H=F==null?void 0:F.remove,F}else throw new Ch(`"${g}.${Z}()" is not implemented on ${k}`,ga.Unimplemented)});return Z==="addListener"&&(J.remove=async()=>H()),J};return O.toString=()=>`${Z.toString()}() { [capacitor code] }`,Object.defineProperty(O,"name",{value:Z,writable:!1,configurable:!1}),O},te=T("addListener"),P=T("removeListener"),z=(Z,H)=>{const O=te({eventName:Z},H),K=async()=>{const se=await O;P({eventName:Z,callbackId:se},H)},J=new Promise(se=>O.then(()=>se({remove:K})));return J.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await K()},J},X=new Proxy({},{get(Z,H){switch(H){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return D?z:te;case"removeListener":return P;default:return T(H)}}});return s[g]=X,d.set(g,{name:g,proxy:X,platforms:new Set([...Object.keys(x),...D?[k]:[]])}),X};return r.convertFileSrc||(r.convertFileSrc=g=>g),r.getPlatform=l,r.handleError=m,r.isNativePlatform=u,r.isPluginAvailable=c,r.registerPlugin=y,r.Exception=Ch,r.DEBUG=!!r.DEBUG,r.isLoggingEnabled=!!r.isLoggingEnabled,r},WE=e=>e.Capacitor=ZE(e),$n=WE(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),ms=$n.registerPlugin;class Pd{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(n,r){let s=!1;this.listeners[n]||(this.listeners[n]=[],s=!0),this.listeners[n].push(r);const u=this.windowListeners[n];u&&!u.registered&&this.addWindowListener(u),s&&this.sendRetainedArgumentsForEvent(n);const c=async()=>this.removeListener(n,r);return Promise.resolve({remove:c})}async removeAllListeners(){this.listeners={};for(const n in this.windowListeners)this.removeWindowListener(this.windowListeners[n]);this.windowListeners={}}notifyListeners(n,r,s){const l=this.listeners[n];if(!l){if(s){let u=this.retainedEventArguments[n];u||(u=[]),u.push(r),this.retainedEventArguments[n]=u}return}l.forEach(u=>u(r))}hasListeners(n){var r;return!!(!((r=this.listeners[n])===null||r===void 0)&&r.length)}registerWindowListener(n,r){this.windowListeners[r]={registered:!1,windowEventName:n,pluginEventName:r,handler:s=>{this.notifyListeners(r,s)}}}unimplemented(n="not implemented"){return new $n.Exception(n,ga.Unimplemented)}unavailable(n="not available"){return new $n.Exception(n,ga.Unavailable)}async removeListener(n,r){const s=this.listeners[n];if(!s)return;const l=s.indexOf(r);this.listeners[n].splice(l,1),this.listeners[n].length||this.removeWindowListener(this.windowListeners[n])}addWindowListener(n){window.addEventListener(n.windowEventName,n.handler),n.registered=!0}removeWindowListener(n){n&&(window.removeEventListener(n.windowEventName,n.handler),n.registered=!1)}sendRetainedArgumentsForEvent(n){const r=this.retainedEventArguments[n];r&&(delete this.retainedEventArguments[n],r.forEach(s=>{this.notifyListeners(n,s)}))}}const O0=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),R0=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ek extends Pd{async getCookies(){const n=document.cookie,r={};return n.split(";").forEach(s=>{if(s.length<=0)return;let[l,u]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");l=R0(l).trim(),u=R0(u).trim(),r[l]=u}),r}async setCookie(n){try{const r=O0(n.key),s=O0(n.value),l=n.expires?`; expires=${n.expires.replace("expires=","")}`:"",u=(n.path||"/").replace("path=",""),c=n.url!=null&&n.url.length>0?`domain=${n.url}`:"";document.cookie=`${r}=${s||""}${l}; path=${u}; ${c};`}catch(r){return Promise.reject(r)}}async deleteCookie(n){try{document.cookie=`${n.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const n=document.cookie.split(";")||[];for(const r of n)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(n){return Promise.reject(n)}}async clearAllCookies(){try{await this.clearCookies()}catch(n){return Promise.reject(n)}}}ms("CapacitorCookies",{web:()=>new ek});const tk=async e=>new Promise((n,r)=>{const s=new FileReader;s.onload=()=>{const l=s.result;n(l.indexOf(",")>=0?l.split(",")[1]:l)},s.onerror=l=>r(l),s.readAsDataURL(e)}),nk=(e={})=>{const n=Object.keys(e);return Object.keys(e).map(l=>l.toLocaleLowerCase()).reduce((l,u,c)=>(l[u]=e[n[c]],l),{})},rk=(e,n=!0)=>e?Object.entries(e).reduce((s,l)=>{const[u,c]=l;let f,m;return Array.isArray(c)?(m="",c.forEach(d=>{f=n?encodeURIComponent(d):d,m+=`${u}=${f}&`}),m.slice(0,-1)):(f=n?encodeURIComponent(c):c,m=`${u}=${f}`),`${s}&${m}`},"").substr(1):null,ik=(e,n={})=>{const r=Object.assign({method:e.method||"GET",headers:e.headers},n),l=nk(e.headers)["content-type"]||"";if(typeof e.data=="string")r.body=e.data;else if(l.includes("application/x-www-form-urlencoded")){const u=new URLSearchParams;for(const[c,f]of Object.entries(e.data||{}))u.set(c,f);r.body=u.toString()}else if(l.includes("multipart/form-data")||e.data instanceof FormData){const u=new FormData;if(e.data instanceof FormData)e.data.forEach((f,m)=>{u.append(m,f)});else for(const f of Object.keys(e.data))u.append(f,e.data[f]);r.body=u;const c=new Headers(r.headers);c.delete("content-type"),r.headers=c}else(l.includes("application/json")||typeof e.data=="object")&&(r.body=JSON.stringify(e.data));return r};class sk extends Pd{async request(n){const r=ik(n,n.webFetchExtra),s=rk(n.params,n.shouldEncodeUrlParams),l=s?`${n.url}?${s}`:n.url,u=await fetch(l,r),c=u.headers.get("content-type")||"";let{responseType:f="text"}=u.ok?n:{};c.includes("application/json")&&(f="json");let m,d;switch(f){case"arraybuffer":case"blob":d=await u.blob(),m=await tk(d);break;case"json":m=await u.json();break;case"document":case"text":default:m=await u.text()}const y={};return u.headers.forEach((g,x)=>{y[x]=g}),{data:m,headers:y,status:u.status,url:u.url}}async get(n){return this.request(Object.assign(Object.assign({},n),{method:"GET"}))}async post(n){return this.request(Object.assign(Object.assign({},n),{method:"POST"}))}async put(n){return this.request(Object.assign(Object.assign({},n),{method:"PUT"}))}async patch(n){return this.request(Object.assign(Object.assign({},n),{method:"PATCH"}))}async delete(n){return this.request(Object.assign(Object.assign({},n),{method:"DELETE"}))}}ms("CapacitorHttp",{web:()=>new sk});var M0;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(M0||(M0={}));var D0;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(D0||(D0={}));class ak extends Pd{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}ms("SystemBars",{web:()=>new ak});const lk="modulepreload",ok=function(e){return"/"+e},L0={},qd=function(n,r,s){let l=Promise.resolve();if(r&&r.length>0){let c=function(d){return Promise.all(d.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));l=c(r.map(d=>{if(d=ok(d),d in L0)return;L0[d]=!0;const y=d.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${g}`))return;const x=document.createElement("link");if(x.rel=y?"stylesheet":lk,y||(x.as="script"),x.crossOrigin="",x.href=d,m&&x.setAttribute("nonce",m),document.head.appendChild(x),y)return new Promise((w,k)=>{x.addEventListener("load",w),x.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${d}`)))})}))}function u(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return l.then(c=>{for(const f of c||[])f.status==="rejected"&&u(f.reason);return n().catch(u)})},Cx=ms("App",{web:()=>qd(()=>import("./web-lefgO9YR.js"),[]).then(e=>new e.AppWeb)}),uk=ms("Network",{web:()=>qd(()=>import("./web-DrSNtZ3i.js"),[]).then(e=>new e.NetworkWeb)}),zu=$n.isNativePlatform()?"https://app.palmier.me":"";async function Ax(e,n,r,s){const l=`${zu}${n}`;console.log(`[API] ${e} ${l}`);const c=await fetch(l,{method:e,headers:{"Content-Type":"application/json"},body:r!=null?JSON.stringify(r):void 0});if(!c.ok){const f=await c.text();let m;try{const d=JSON.parse(f);m=d.error??d.message??f}catch{m=f}throw console.error(`[API] ${e} ${n} failed:`,c.status,m),new Error(m||`Request failed with status ${c.status}`)}return console.log(`[API] ${e} ${n} ->`,c.status),c.json()}function ck(e,n,r){return Ax("POST",e,n)}function fk(e,n){return Ax("GET",e,void 0)}const z0=$n.isNativePlatform(),Tx=N.createContext({connected:!1,mode:"connecting",nc:null,request(){return Promise.reject(new Error("No host connection"))},subscribeEvents(){return()=>{}},activeHost:null,unauthorized:!1}),hk=2e3,Ah=6e3,dk=1500,mk=6e4;function pk({children:e}){const{getActiveHost:n}=va(),r=n(),[s,l]=N.useState(null),[u,c]=N.useState(!1),f=N.useRef(null),[m,d]=N.useState(!1),[y,g]=N.useState(!1),[x,w]=N.useState(!1),[k,D]=N.useState(!1),B=N.useRef(ju()),L=N.useRef(new Set),$=N.useRef(0),T=r!=null&&!!r.directUrl,te=z0&&!T&&!!(r!=null&&r.lanUrl)&&k,P=y||x?"disconnected":r?T?m?"direct":"connecting":u?te?"lan":"nats":"connecting":"connecting",z=P!=="connecting"&&P!=="disconnected";N.useEffect(()=>{g(!1),w(!1)},[r==null?void 0:r.hostId,r==null?void 0:r.clientToken]),N.useEffect(()=>{if(!z0||T||!(r!=null&&r.lanUrl)){D(!1);return}let H=!1;const O=r.lanUrl,K=r.hostId;async function J(){try{const q=await fetch(`${O}/health`,{signal:AbortSignal.timeout(dk)});if(H)return;if(!q.ok){D(!1);return}const ue=(await q.json()).hostId===K;D(ue),ue&&console.log("[HOST/LAN] reachable:",O)}catch{H||D(!1)}}J();const se=window.setInterval(J,mk),ie=Cx.addListener("appStateChange",q=>{q.isActive&&J()}),F=uk.addListener("networkStatusChange",()=>J());return()=>{H=!0,clearInterval(se),ie.then(q=>q.remove()),F.then(q=>q.remove())}},[r==null?void 0:r.hostId,r==null?void 0:r.lanUrl,T]),N.useEffect(()=>{if(T){f.current&&(f.current.close().catch(()=>{}),f.current=null,l(null),c(!1));return}if(!r)return;let H=!1,O=1e3;const K=3e4;async function J(){for(;!H;)try{const se=await fetch(`${zu}/api/nats-credentials/${r.hostId}`);if(H)return;if(se.status===401||se.status===403||se.status===404){console.error("[NATS] Host not found or rejected by relay:",se.status),w(!0);return}if(!se.ok)throw new Error(`credentials fetch ${se.status}`);const ie=await se.json();if(!ie.natsWsUrl){console.error("[NATS] Relay returned empty natsWsUrl — treating as terminal"),w(!0);return}if(H)return;console.log("[NATS] Connecting to",ie.natsWsUrl);const F=await kx({servers:ie.natsWsUrl,authenticator:gx(ie.natsJwt,new TextEncoder().encode(ie.natsNkeySeed))});if(H){F.close().catch(()=>{});return}if(console.log("[NATS] Connected"),f.current=F,l(F),c(!0),O=1e3,await F.closed(),H)return;console.log("[NATS] Connection closed, will reconnect"),f.current=null,l(null),c(!1)}catch(se){if(H)return;console.warn(`[NATS] Connect failed, retrying in ${O}ms:`,se),c(!1),await new Promise(ie=>setTimeout(ie,O)),O=Math.min(O*2,K)}}return J(),()=>{H=!0,f.current&&(f.current.close().catch(()=>{}),f.current=null,l(null),c(!1))}},[T,r]),N.useEffect(()=>{if(!r||!T){d(!1);return}const H=new AbortController;async function O(){var ie;const J=new AbortController,se=setTimeout(()=>J.abort(),hk);H.signal.addEventListener("abort",()=>J.abort());try{const F=await fetch(`${r.directUrl}/events`,{headers:{Authorization:`Bearer ${r.clientToken}`},signal:J.signal});return clearTimeout(se),F.ok?((ie=F.body)==null?void 0:ie.getReader())??null:null}catch{return clearTimeout(se),null}}async function K(J){d(!0),console.log("[HOST] SSE connected to",r.directUrl),$.current=Date.now();function se(){setTimeout(()=>{H.signal.aborted||Date.now()-$.current<Ah||(console.log("[HOST] Heartbeat timeout — no data for",Ah/1e3,"s"),H.abort(),d(!1),console.log("[HOST] Direct host unreachable"))},Ah)}se();const ie=new TextDecoder;let F="";try{for(;;){const{done:q,value:V}=await J.read();if(q)break;F+=ie.decode(V,{stream:!0}),$.current=Date.now(),se();const ue=F.split(`
88
+ `);F=ue.pop()??"";for(const xe of ue)if(xe.startsWith("data: ")){const S=xe.slice(6);try{const M=JSON.parse(S);if(M.task_id&&M.event_type){const W=`host-event.${r.hostId}.${M.task_id}`;for(const A of L.current)A({subject:W,data:B.current.encode(S)})}}catch{}}}}catch{}}return(async()=>{const J=await O();J&&await K(J)})(),()=>{H.abort(),d(!1)}},[r,T]);const X=N.useCallback(async(H,O,K)=>{if(!r)throw new Error("No active host");function J(F){F&&typeof F=="object"&&F.error==="Unauthorized"&&g(!0)}async function se(F,q){console.log(`[HOST/${q}] → ${H}`,O??"");const V=await fetch(`${F}/rpc/${H}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r.clientToken}`},body:O!=null?JSON.stringify(O):void 0,signal:K!=null&&K.timeout?AbortSignal.timeout(K.timeout):void 0});if(V.status===401)throw g(!0),new Error("Unauthorized");const ue=await V.json();return J(ue),console.log(`[HOST/${q}] ← ${H}`,ue),ue}async function ie(){if(!f.current)throw new Error("Not connected");const F=`host.${r.hostId}.rpc.${H}`,q={...O??{},clientToken:r.clientToken},V=B.current.encode(JSON.stringify(q));console.log(`[HOST/NATS] → ${H}`,O??"");const ue=await f.current.request(F,V,{timeout:(K==null?void 0:K.timeout)??1e4}),xe=JSON.parse(B.current.decode(ue.data));return J(xe),console.log(`[HOST/NATS] ← ${H}`,xe),xe}if(T)return se(r.directUrl,"HTTP");if(te&&r.lanUrl)try{return await se(r.lanUrl,"LAN")}catch(F){if(F instanceof Error&&F.message==="Unauthorized")throw F;console.log("[HOST/LAN] failed, falling back to NATS:",F),D(!1)}return ie()},[r,T,te]),Z=N.useCallback((H,O)=>{if(T)return L.current.add(O),()=>{L.current.delete(O)};if(f.current){const K=f.current.subscribe(`host-event.${H}.>`);let J=!1;return(async()=>{try{for await(const se of K){if(J)break;O({subject:se.subject,data:se.data})}}catch{}})(),()=>{J=!0,K.unsubscribe()}}return()=>{}},[r,T]);return b.jsx(Tx.Provider,{value:{connected:z,mode:P,nc:s,request:X,subscribeEvents:Z,activeHost:r,unauthorized:y},children:e})}function Sa(){return N.useContext(Tx)}const Ut=$n.isNativePlatform()?ms("Device"):null;function Uu(e){const n=new Date(e),r=new Date,s=n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});return n.toDateString()===r.toDateString()?s:`${n.toLocaleDateString(void 0,{month:"short",day:"numeric"})} ${s}`}const jx={};function gk(e){for(const n of e)jx[n.key]=n.label}function hd(e){return jx[e]??e}const yk=()=>window.matchMedia("(max-width: 600px)").matches;function bk({task:e,lastEvent:n,onEdit:r,onDelete:s,onViewRun:l}){var se;const{request:u}=Sa(),[c,f]=N.useState(!1),[m,d]=N.useState(!1),[y,g]=N.useState(!1),x=N.useRef(null),w=(n==null?void 0:n.running_state)==="started",k=(((se=e.schedule_values)==null?void 0:se.length)??0)>0,D=e.schedule_type==="on_new_notification"||e.schedule_type==="on_new_sms",L=!!e.schedule_enabled&&!!e.schedule_type&&(k||D)?w?"var(--color-success)":(n==null?void 0:n.running_state)==="failed"?"var(--color-error)":"var(--color-success)":"var(--color-text-secondary)";N.useEffect(()=>{if(!m)return;function ie(F){x.current&&!x.current.contains(F.target)&&d(!1)}return document.addEventListener("mousedown",ie),()=>document.removeEventListener("mousedown",ie)},[m]);function $(){yk()?g(!0):d(ie=>!ie)}function T(){d(!1),g(!1)}async function te(){if(T(),!!confirm("Abort this task?")){f(!0);try{await u("task.abort",{id:e.id})}catch(ie){console.error("Abort failed:",ie)}finally{f(!1)}}}async function P(){T();try{const ie=await u("task.run",{id:e.id});l(e.id,ie.run_id)}catch(ie){console.error("Run failed:",ie)}}async function z(){if(T(),!!confirm("Delete this task? Results and reports will be kept."))try{await u("task.delete",{id:e.id}),s(e.id)}catch(ie){console.error("Delete failed:",ie)}}const X={started:"Started",finished:"Finished",aborted:"Aborted",failed:"Failed"};function Z(ie,F){if(ie==="specific_times"){const we=new Date(F);return{kind:"specific_times",detail:isNaN(we.getTime())?F:`${we.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})} at ${we.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`}}const q=F.split(" ");if(q.length!==5)return{kind:"unknown",detail:F};const[V,ue,xe,,S]=q,M=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];if(ue==="*")return{kind:"hourly",detail:""};const W=new Date;W.setHours(Number(ue),Number(V),0,0);const A=W.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});return S!=="*"?{kind:"weekly",detail:`${M[Number(S)]??S} at ${A}`}:xe!=="*"?{kind:"monthly",detail:`day ${xe} at ${A}`}:{kind:"daily",detail:A}}function H(ie,F){const q=Z(ie,F);return q.kind==="hourly"?"Every hour":q.kind==="specific_times"?`Once on ${q.detail}`:`${q.kind.charAt(0).toUpperCase()+q.kind.slice(1)}: ${q.detail}`}function O(ie,F){if(!ie)return"";if(ie==="on_new_notification")return"On new notification";if(ie==="on_new_sms")return"On new SMS";if(!F||F.length===0)return"";if(F.length===1)return H(ie,F[0]);const q=F.map(ue=>Z(ie,ue));if(new Set(q.map(ue=>ue.kind)).size===1){const ue=q[0].kind;if(ue==="hourly")return"Every hour";const xe=q.map(S=>S.detail);return`${ue.charAt(0).toUpperCase()+ue.slice(1)}: ${xe.join(", ")}`}return F.map(ue=>H(ie,ue)).join(", ")}const K=O(e.schedule_type,e.schedule_values),J=b.jsxs(b.Fragment,{children:[b.jsxs("button",{onClick:()=>{T(),r(e)},children:[b.jsx("span",{className:"menu-icon",children:"✎"}),"Edit"]}),b.jsxs("button",{onClick:()=>{T(),l(e.id)},children:[b.jsx("span",{className:"menu-icon",children:"📄"}),"View All Runs"]}),w?b.jsxs("button",{className:"menu-item-danger",onClick:te,disabled:c,children:[b.jsx("span",{className:"menu-icon",children:"◼"}),"Abort"]}):b.jsxs(b.Fragment,{children:[b.jsxs("button",{onClick:P,children:[b.jsx("span",{className:"menu-icon",children:"▶"}),"Run Now"]}),b.jsxs("button",{className:"menu-item-danger",onClick:z,children:[b.jsx("span",{className:"menu-icon",children:"🗑"}),"Delete"]})]})]});return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"task-card",onClick:()=>l(e.id,"latest"),children:[b.jsxs("div",{className:"task-card-header",children:[b.jsxs("div",{className:"task-card-title-row",children:[w?b.jsx("span",{className:"status-spinner",children:b.jsx("span",{})}):b.jsx("span",{className:"status-dot",style:{backgroundColor:L}}),b.jsx("h3",{className:"task-card-name",children:e.name||e.user_prompt})]}),b.jsx("div",{className:"task-card-actions",onClick:ie=>ie.stopPropagation(),children:b.jsxs("div",{className:"task-card-menu",ref:x,children:[b.jsx("button",{className:"task-card-menu-btn",onClick:$,"aria-label":"Task actions",children:"⋮"}),m&&b.jsx("div",{className:"task-card-menu-dropdown",children:J})]})})]}),b.jsxs("div",{className:"task-card-meta",children:[e.agent&&b.jsx("span",{className:"task-card-agent",children:hd(e.agent)}),n&&X[n.running_state]&&b.jsxs("span",{className:"task-card-last-event",children:[X[n.running_state]," ",Uu(n.time_stamp)]}),e.schedule_type&&(k||D)&&b.jsx("span",{className:"task-card-triggers",children:e.schedule_enabled?K:"Schedule disabled"})]})]}),y&&ha.createPortal(b.jsx("div",{className:"bottom-sheet-overlay",onClick:()=>g(!1),children:b.jsxs("div",{className:"bottom-sheet",onClick:ie=>ie.stopPropagation(),children:[b.jsx("div",{className:"bottom-sheet-handle"}),b.jsx("div",{className:"bottom-sheet-title",children:e.name||e.user_prompt}),b.jsx("div",{className:"bottom-sheet-actions",children:J})]})}),document.body)]})}function xk({permissions:e}){return b.jsxs("div",{className:"plan-dialog",children:[b.jsx("h2",{children:"Granted Permissions"}),b.jsx("div",{className:"plan-dialog-scroll",children:e&&e.length>0?b.jsx("div",{className:"permissions-section",children:b.jsx("ul",{className:"permissions-list",children:e.map((n,r)=>b.jsxs("li",{className:"permission-item",children:[b.jsx("span",{className:"permission-tool",children:n.name}),b.jsx("span",{className:"permission-desc",children:n.description})]},r))})}):b.jsx("p",{className:"plan-empty",children:"No permissions have been granted for this task."})}),b.jsx("div",{className:"plan-dialog-actions",children:b.jsx("button",{className:"btn btn-secondary",onClick:()=>history.back(),children:"Back"})})]})}const ta=[];function vk(){const e=ta.pop();e&&(e.pushed.current=!1,e.close())}let U0=!1;function wk(){U0||(U0=!0,window.addEventListener("popstate",vk))}function B0(e,n){const r=N.useRef(!1),s=N.useRef(n);s.current=n;const l=N.useCallback(()=>s.current(),[]),u=N.useRef({close:l,pushed:r});u.current.close=l,N.useEffect(()=>{if(e&&!r.current)wk(),history.pushState({modal:!0},""),ta.push(u.current),r.current=!0;else if(!e&&r.current){r.current=!1;const c=ta.indexOf(u.current);c!==-1&&ta.splice(c,1),history.back()}},[e,l]),N.useEffect(()=>{const c=u.current;return()=>{if(r.current){r.current=!1;const f=ta.indexOf(c);f!==-1&&ta.splice(f,1),history.back()}}},[])}const Sk=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_k=["specific_times","hourly","daily","weekly","monthly"];function mu(e){return _k.includes(e)}function Ek(e){return e==="on_new_notification"||e==="on_new_sms"}function Qr(e="daily"){return{schedule:e,time:"00:00",dayOfWeek:"1",dayOfMonth:"1",onceDate:"",onceTime:"00:00"}}function kk(e){const n=e.split(" ");if(n.length!==5)return Qr();const[r,s,l,,u]=n;if(s==="*")return Qr("hourly");const c=`${s.padStart(2,"0")}:${r.padStart(2,"0")}`;return u!=="*"?{...Qr("weekly"),time:c,dayOfWeek:u}:l!=="*"?{...Qr("monthly"),time:c,dayOfMonth:l}:{...Qr("daily"),time:c}}function Nx(e,n){if(e==="specific_times"){const[r,s]=n.split("T");return{...Qr("specific_times"),onceDate:r??"",onceTime:(s??"09:00").slice(0,5)}}return kk(n)}function Ck(e){const[n,r]=e.time.split(":").map(Number);switch(e.schedule){case"hourly":return"0 * * * *";case"daily":return`${r} ${n} * * *`;case"weekly":return`${r} ${n} * * ${e.dayOfWeek}`;case"monthly":return`${r} ${n} ${e.dayOfMonth} * *`;default:return"0 * * * *"}}function Ak(e){return e.schedule==="specific_times"?e.onceDate?`${e.onceDate}T${e.onceTime}`:null:Ck(e)}function Th(e){return e==="specific_times"?"specific_times":e==="on_new_notification"?"on_new_notification":e==="on_new_sms"?"on_new_sms":"crons"}function jh(e){var s;if(!e)return"daily";if(e.command)return"command";const n=e.schedule_type;if(n==="on_new_notification"||n==="on_new_sms")return n;if(n!=="crons"&&n!=="specific_times")return"ondemand";const r=(s=e.schedule_values)==null?void 0:s[0];return r?Nx(n,r).schedule:"ondemand"}function Tk({initial:e,agents:n,hostPlatform:r,isNotificationListener:s,onSaved:l,onRun:u,onCancel:c}){var Yt;const{request:f}=Sa(),m=()=>{var _e;const ge=localStorage.getItem("palmier:lastAgent"),ze=n.map(ft=>ft.key);return ge&&ze.includes(ge)?ge:((_e=n[0])==null?void 0:_e.key)??""},[d,y]=N.useState((e==null?void 0:e.user_prompt)??""),[g,x]=N.useState((e==null?void 0:e.agent)??m()),w=!!((Yt=e==null?void 0:e.permissions)!=null&&Yt.length),[k,D]=N.useState(!1),B=N.useCallback(()=>D(!1),[]);B0(k,B);const[L,$]=N.useState(null),[T,te]=N.useState(()=>jh(e)),[P,z]=N.useState(()=>{const ge=e==null?void 0:e.schedule_type,ze=e==null?void 0:e.schedule_values;if(ze&&(ge==="crons"||ge==="specific_times"))return ze.map(ft=>Nx(ge,ft));const _e=jh(e);return mu(_e)?[Qr(_e)]:[]}),[X,Z]=N.useState((e==null?void 0:e.requires_confirmation)??!1),[H,O]=N.useState((e==null?void 0:e.schedule_enabled)??!0),[K,J]=N.useState((e==null?void 0:e.yolo_mode)??!1),[se,ie]=N.useState((e==null?void 0:e.foreground_mode)??!1),[F,q]=N.useState((e==null?void 0:e.command)??""),[V,ue]=N.useState(!1),xe=(e==null?void 0:e.schedule_type)==="on_new_notification"&&e.schedule_values&&e.schedule_values.length>0?e.schedule_values[0]:"",[S,M]=N.useState(xe),[W,A]=N.useState([]),[we,Ae]=N.useState(!1),[Te,Me]=N.useState(!1),[He,be]=N.useState(""),De=N.useCallback(()=>Me(!1),[]);B0(Te,De),N.useEffect(()=>{if(T!=="on_new_notification"||!s||!$n.isNativePlatform()||!Ut)return;let ge=!1;return Ae(!0),Ut.getInstalledApps().then(({apps:ze})=>{if(ge)return;const _e="com.palmier.app",ft=ze.filter(pt=>pt.packageName!==_e).sort((pt,Tn)=>(pt.appName||pt.packageName).localeCompare(Tn.appName||Tn.packageName));A(ft)}).catch(()=>{}).finally(()=>{ge||Ae(!1)}),()=>{ge=!0}},[T,s]);const Ze=(e==null?void 0:e.schedule_type)==="on_new_sms"&&e.schedule_values&&e.schedule_values.length>0?e.schedule_values[0]:"",[dt,lt]=N.useState(Ze),ct=N.useRef(null),Fe=mu(T),Ue=T==="command",tt=Ek(T),mt=n.find(ge=>ge.key===g),st=!!(mt!=null&&mt.supportsYolo);N.useEffect(()=>{!st&&K&&J(!1)},[st,K]);const Mt=!!e,yt=jh(e),Yn=!Mt||d!==((e==null?void 0:e.user_prompt)??"")||g!==((e==null?void 0:e.agent)??"")||T!==yt||X!==((e==null?void 0:e.requires_confirmation)??!1)||H!==((e==null?void 0:e.schedule_enabled)??!0)||K!==((e==null?void 0:e.yolo_mode)??!1)||se!==((e==null?void 0:e.foreground_mode)??!1)||Ue&&F!==((e==null?void 0:e.command)??"")||Fe&&(JSON.stringify($e())!==JSON.stringify((e==null?void 0:e.schedule_values)??[])||Th(T)!==((e==null?void 0:e.schedule_type)??void 0))||tt&&T!==(e==null?void 0:e.schedule_type)||T==="on_new_notification"&&S.trim()!==xe.trim()||T==="on_new_sms"&&dt.trim()!==Ze.trim(),gr=Fe&&P.some(ge=>ge.schedule==="specific_times"&&(!ge.onceDate||new Date(`${ge.onceDate}T${ge.onceTime}`)<=new Date)),vt=Yn&&!!d.trim()&&!gr&&(!Ue||!!F.trim())&&(!Fe||P.length>0);function An(ge,ze){z(_e=>_e.map((ft,pt)=>pt===ge?{...ft,...ze}:ft))}function fe(ge){z(ze=>ze.filter((_e,ft)=>ft!==ge))}function Se(){mu(T)&&z(ge=>[...ge,ge.length>0?{...ge[ge.length-1]}:Qr(T)])}function Be(ge){te(ge),mu(ge)?z([Qr(ge)]):(z([]),Z(!1)),ge==="command"?setTimeout(()=>{var ze;return(ze=ct.current)==null?void 0:ze.focus()},0):q(""),ge!=="on_new_notification"&&M(xe),ge!=="on_new_sms"&&lt(Ze)}function $e(){return P.flatMap(ge=>{const ze=Ak(ge);return ze?[ze]:[]})}function rt(){return K?confirm(`Yolo mode is enabled. The agent will auto-approve all tool calls — it can read, write, delete files, run arbitrary commands, and access the network without asking for permission.
89
+
90
+ Are you sure you want to continue?`):!0}async function nn(){ue(!0),$(null);try{const ge=Fe?$e():T==="on_new_notification"&&S.trim()?[S.trim()]:T==="on_new_sms"&&dt.trim()?[dt.trim()]:[],ze=Fe||tt?Th(T):null,_e={user_prompt:d,agent:g,schedule_type:ze,schedule_values:ge.length>0?ge:null,schedule_enabled:T!=="ondemand"&&H,requires_confirmation:Fe?X:!1,yolo_mode:K,foreground_mode:se,command:Ue?F:""};Mt&&(_e.id=e.id);const pt=await f(Mt?"task.update":"task.create",_e,{timeout:45e3});if(pt.error){$(pt.error);return}if(Mt||localStorage.setItem("palmier:lastAgent",g),Ue&&!Mt){l(pt);try{const Tn=await f("task.run",{id:pt.id});Tn.run_id?u(pt.id,Tn.run_id):Tn.error||u(pt.id)}catch{}return}l(pt)}catch(ge){$(ge instanceof Error?ge.message:String(ge))}finally{ue(!1)}}const bn=Mt?"Save":Ue?"Run":(Fe||tt)&&H?"Schedule":"Save";return b.jsxs("div",{className:"task-form-overlay",children:[b.jsx("div",{className:"task-form",children:k?b.jsx(xk,{permissions:e==null?void 0:e.permissions}):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"task-form-header",children:b.jsx("h2",{children:e?"Edit Task":"New Task"})}),L&&b.jsx("div",{className:"form-error",children:L}),b.jsx("textarea",{autoFocus:!e,className:"form-textarea",value:d,onChange:ge=>y(ge.target.value),placeholder:Ue?"If the input email contains an event, create a calendar entry for it.":"Research today's top AI news and write a summary.",rows:4,disabled:V}),b.jsxs("div",{className:"plan-actions",children:[b.jsxs("div",{className:"agent-picker-section-inline",children:[b.jsx("span",{className:"agent-picker-label",children:"Run with"}),b.jsx("select",{className:"form-select form-select-sm",value:g,onChange:ge=>x(ge.target.value),disabled:V,children:n.map(ge=>b.jsx("option",{value:ge.key,children:ge.label},ge.key))})]}),st&&b.jsxs("label",{className:"yolo-inline",style:{marginLeft:"auto"},children:[b.jsx("input",{type:"checkbox",checked:K,onChange:ge=>J(ge.target.checked),disabled:V}),"Yolo"]}),st&&K&&b.jsx("p",{className:"yolo-warning",children:"The agent will auto-approve all tool calls without asking for permission."}),w&&b.jsx("div",{className:"granted-permissions-row",children:b.jsx("button",{className:"btn btn-link",onClick:()=>D(!0),children:"Granted Permissions"})})]}),b.jsx("div",{className:"toggles-group",children:b.jsxs("div",{className:"schedule-section",children:[b.jsx("h3",{className:"schedule-section-title",children:"Schedule"}),b.jsxs("select",{className:"form-select",value:T,onChange:ge=>Be(ge.target.value),disabled:V,children:[b.jsx("option",{value:"ondemand",children:"On Demand"}),b.jsx("option",{value:"specific_times",children:"Specific Times"}),b.jsx("option",{value:"hourly",children:"Hourly"}),b.jsx("option",{value:"daily",children:"Daily"}),b.jsx("option",{value:"weekly",children:"Weekly"}),b.jsx("option",{value:"monthly",children:"Monthly"}),b.jsx("option",{value:"on_new_notification",children:"On New Notification"}),b.jsx("option",{value:"on_new_sms",children:"On New SMS"}),b.jsx("option",{value:"command",children:"Command-triggered"})]}),tt&&b.jsxs("div",{className:"schedule-reactive",children:[b.jsxs("p",{className:"command-help-text",children:[T==="on_new_notification"?"Runs each time a new push notification arrives on the paired Android device.":"Runs each time a new SMS arrives on the paired Android device."," ","The triggering payload is spliced into your task prompt — reference it as “the new ",T==="on_new_notification"?"notification":"SMS","”."]}),T==="on_new_notification"&&(()=>{const ge=W.find(_e=>_e.packageName===S),ze=(ge==null?void 0:ge.appName)||S;return b.jsxs(b.Fragment,{children:[s?S.trim()?b.jsxs("div",{className:"app-filter-selected",children:[b.jsx("span",{className:"app-filter-selected-name",children:ze}),(ge==null?void 0:ge.appName)&&b.jsx("span",{className:"app-filter-selected-pkg",children:ge.packageName}),b.jsx("button",{type:"button",className:"app-filter-selected-clear",onClick:()=>M(""),"aria-label":"Clear app filter",disabled:V,children:"✕"})]}):b.jsx("button",{type:"button",className:"btn btn-link app-filter-trigger",onClick:()=>{be(""),Me(!0)},disabled:V,children:"Select app"}):b.jsx("input",{className:"form-input",type:"text",value:S,onChange:_e=>M(_e.target.value),placeholder:"App (optional), e.g. com.google.android.gm",disabled:V}),b.jsx("p",{className:"command-help-text app-filter-help",children:S.trim()?`Only notifications from ${ze} will trigger this task.`:"Every notification from your device triggers this task."})]})})(),T==="on_new_sms"&&b.jsxs(b.Fragment,{children:[b.jsx("input",{className:"form-input",type:"text",value:dt,onChange:ge=>lt(ge.target.value),placeholder:"From (optional), e.g. +1 555-1234)",disabled:V}),b.jsx("p",{className:"command-help-text app-filter-help",children:dt.trim()?`Only SMS from ${dt.trim()} will trigger this task. Formatting (spaces, dashes, parens) is ignored.`:"Every SMS that arrives on your device triggers this task."})]})]}),Ue&&b.jsxs("div",{className:"schedule-reactive",children:[b.jsx("p",{className:"command-help-text",children:"Runs a command and invokes the task for each line of output. Use “the input” in your task description to reference each line."}),b.jsx("input",{ref:ct,className:"form-input form-input-mono",type:"text",value:F,onChange:ge=>q(ge.target.value),placeholder:"gws gmail +watch --project my-project",disabled:V})]}),Fe&&T!=="hourly"&&b.jsxs(b.Fragment,{children:[P.map((ge,ze)=>b.jsxs("div",{className:"trigger-row-card",children:[b.jsxs("div",{className:"trigger-row-content",children:[T==="daily"&&b.jsx("input",{className:"form-input",type:"time",value:ge.time,onChange:_e=>An(ze,{time:_e.target.value})}),T==="weekly"&&b.jsxs("div",{className:"trigger-row-top",children:[b.jsx("select",{className:"form-select",value:ge.dayOfWeek,onChange:_e=>An(ze,{dayOfWeek:_e.target.value}),children:Sk.map((_e,ft)=>b.jsx("option",{value:String(ft),children:_e},ft))}),b.jsx("input",{className:"form-input",type:"time",value:ge.time,onChange:_e=>An(ze,{time:_e.target.value})})]}),T==="monthly"&&b.jsxs("div",{className:"trigger-row-top",children:[b.jsx("select",{className:"form-select",value:ge.dayOfMonth,onChange:_e=>An(ze,{dayOfMonth:_e.target.value}),children:Array.from({length:28},(_e,ft)=>ft+1).map(_e=>b.jsxs("option",{value:String(_e),children:["Day ",_e]},_e))}),b.jsx("input",{className:"form-input",type:"time",value:ge.time,onChange:_e=>An(ze,{time:_e.target.value})})]}),T==="specific_times"&&b.jsxs("div",{className:"trigger-row-top",children:[b.jsx("input",{className:"form-input",type:"date",value:ge.onceDate,min:new Date().toISOString().split("T")[0],onChange:_e=>An(ze,{onceDate:_e.target.value})}),b.jsx("input",{className:"form-input",type:"time",value:ge.onceTime,min:ge.onceDate===new Date().toISOString().split("T")[0]?new Date().toTimeString().slice(0,5):void 0,onChange:_e=>An(ze,{onceTime:_e.target.value})})]})]}),P.length>1&&b.jsx("button",{className:"trigger-remove-btn",onClick:()=>fe(ze),title:"Remove trigger",children:"×"})]},ze)),b.jsx("button",{className:"trigger-add-btn",onClick:Se,children:"+ Add"})]}),r==="win32"&&b.jsxs("label",{className:"toggle-label",children:[b.jsx("input",{type:"checkbox",checked:se,onChange:ge=>ie(ge.target.checked),disabled:V}),"Run in the foreground (host must login to Windows)"]}),Fe&&b.jsxs("label",{className:"toggle-label",children:[b.jsx("input",{type:"checkbox",checked:X,onChange:ge=>Z(ge.target.checked),disabled:V}),"Confirm before each run"]}),T!=="ondemand"&&b.jsxs("label",{className:"toggle-label",children:[b.jsx("input",{type:"checkbox",checked:H,onChange:ge=>O(ge.target.checked),disabled:V}),"Enabled"]})]})}),!K&&mt&&!mt.supportsPermissions&&b.jsxs("div",{className:"form-warning",children:["Palmier does not support runtime permission granting for ",mt.label,". The task may fail if required permissions are not pre-configured."]}),b.jsxs("div",{className:"form-actions",children:[b.jsxs("button",{className:"btn btn-primary",onClick:()=>rt()&&nn(),disabled:!vt||V,children:[V&&b.jsx("span",{className:"btn-spinner"}),bn]}),b.jsx("button",{className:"btn btn-secondary",onClick:()=>{Yn&&d.trim()&&!confirm("You have unsaved changes. Discard?")||c()},style:{marginLeft:"auto"},children:"Cancel"})]})]})}),Te&&(()=>{const ge=He.trim().toLowerCase(),ze=ge?W.filter(_e=>_e.packageName.toLowerCase().includes(ge)||_e.appName.toLowerCase().includes(ge)):W;return b.jsx("div",{className:"app-filter-overlay",onClick:De,children:b.jsxs("div",{className:"app-filter-dialog",onClick:_e=>_e.stopPropagation(),children:[b.jsxs("div",{className:"app-filter-header",children:[b.jsx("h2",{children:"Select app"}),b.jsx("button",{className:"app-filter-close",onClick:De,"aria-label":"Close",children:b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:b.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),b.jsx("input",{className:"form-input app-filter-search",type:"text",value:He,onChange:_e=>be(_e.target.value),onKeyDown:_e=>{_e.key==="Enter"&&He.trim()&&(M(He.trim()),De())},placeholder:"Search or type a package name",autoFocus:!0}),b.jsxs("ul",{className:"app-filter-list",children:[we&&W.length===0?Array.from({length:6}).map((_e,ft)=>b.jsx("li",{className:"app-filter-row app-filter-skeleton",children:b.jsx("div",{className:"app-filter-skeleton-bar"})},`sk-${ft}`)):ze.length===0&&!He.trim()?b.jsx("li",{className:"app-filter-empty",children:"No apps"}):ze.map(_e=>b.jsx("li",{className:"app-filter-row",onClick:()=>{M(_e.packageName),De()},children:b.jsxs("div",{className:"app-filter-row-labels",children:[b.jsx("div",{className:"app-filter-row-name",children:_e.appName||_e.packageName}),_e.appName&&b.jsx("div",{className:"app-filter-row-pkg",children:_e.packageName})]})},_e.packageName)),He.trim()&&b.jsx("li",{className:"app-filter-row",onClick:()=>{M(He.trim()),De()},children:b.jsx("div",{className:"app-filter-row-labels",children:b.jsx("div",{className:"app-filter-row-name",children:He.trim()})})})]})]})})})()]})}function Ox({pullDistance:e,refreshing:n,threshold:r}){const s=e>0||n,l=e>=r;return b.jsx("div",{className:"pull-to-refresh",style:{transform:`translateY(${e}px)`,opacity:s?Math.min(1,e/30):0},"aria-hidden":!s,children:b.jsx("div",{className:"pull-to-refresh-badge",children:n?b.jsx("div",{className:"spinner"}):b.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s"},children:[b.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),b.jsx("polyline",{points:"19 12 12 19 5 12"})]})})})}function Rx({onRefresh:e,threshold:n=70,maxPull:r=110,enabled:s=!0}){const[l,u]=N.useState(0),[c,f]=N.useState(!1),m=N.useRef(null),d=N.useRef(!1),y=N.useRef(0),g=N.useRef(!1),x=N.useRef(e);return N.useEffect(()=>{x.current=e}),N.useEffect(()=>{if(!s)return;const w=B=>{if(g.current||window.scrollY>0){m.current=null;return}m.current=B.touches[0].clientY,d.current=!1,y.current=0},k=B=>{if(g.current||m.current==null)return;const L=B.touches[0].clientY-m.current;if(L<=0){d.current=!1,y.current=0,u(0);return}d.current=!0;const $=Math.min(r,L*.5);y.current=$,u($),B.cancelable&&B.preventDefault()},D=()=>{if(!d.current){m.current=null,u(0);return}const B=y.current;m.current=null,d.current=!1,y.current=0,B>=n?(g.current=!0,f(!0),u(n),Promise.resolve(x.current()).catch(()=>{}).finally(()=>{g.current=!1,f(!1),u(0)})):u(0)};return window.addEventListener("touchstart",w,{passive:!0}),window.addEventListener("touchmove",k,{passive:!1}),window.addEventListener("touchend",D,{passive:!0}),window.addEventListener("touchcancel",D,{passive:!0}),()=>{window.removeEventListener("touchstart",w),window.removeEventListener("touchmove",k),window.removeEventListener("touchend",D),window.removeEventListener("touchcancel",D)}},[s,n,r]),{pullDistance:l,refreshing:c,threshold:n}}function jk({connected:e,hostId:n,request:r,subscribeEvents:s,agents:l,hostPlatform:u,isNotificationListener:c,onViewRun:f}){const[m,d]=N.useState([]),[y,g]=N.useState(!1),[x,w]=N.useState(null),[k,D]=N.useState(new Map),[B,L]=N.useState(!1),[$,T]=N.useState(void 0),te=N.useCallback(()=>{L(!1),T(void 0)},[]),P=N.useCallback(async()=>{if(e){g(!0),w(null);try{const O=(await r("task.list")).tasks??[],K=new Map;for(const J of O)J.status&&K.set(J.id,J.status);D(K),d(O)}catch(H){const O=H instanceof Error?H.message:String(H);O==="Not connected"||O.includes("503")||O.toLowerCase().includes("no responders")?w(null):w(O),d([])}finally{g(!1)}}},[e,n,r]);N.useEffect(()=>{e?P():(d([]),g(!1))},[e,n,P]);const z=Rx({onRefresh:P,enabled:e});N.useEffect(()=>!e||!n?void 0:s(n,async O=>{const K=O.subject.split(".");if(K.length<3)return;const J=K.slice(2).join(".");let se={};try{se=JSON.parse(new TextDecoder().decode(O.data))}catch{return}const ie=se.event_type;if(!(ie!=="running-state"&&ie!=="permission-resolved"))try{const F=await r("task.status",{id:J},{timeout:5e3});if(F.error)return;D(q=>{const V=new Map(q);return V.set(J,F),V})}catch{}}),[e,n,s,r]);function X(H){d(O=>{const K=O.findIndex(J=>J.id===H.id);if(K>=0){const J=[...O];return J[K]=H,J}return[H,...O]}),L(!1),T(void 0)}function Z(H){d(O=>O.filter(K=>K.id!==H)),D(O=>{const K=new Map(O);return K.delete(H),K})}return b.jsxs(b.Fragment,{children:[b.jsx(Ox,{pullDistance:z.pullDistance,refreshing:z.refreshing,threshold:z.threshold}),x&&b.jsxs("div",{className:"form-error",children:[x,x.toLowerCase().includes("failed to fetch")&&b.jsxs(b.Fragment,{children:[" ",b.jsx("a",{href:"#",onClick:H=>{H.preventDefault(),window.location.reload()},children:"Reload"})]})]}),y&&!m.length?b.jsx("div",{className:"task-list",children:[0,1,2].map(H=>b.jsxs("div",{className:"task-card",style:{pointerEvents:"none"},children:[b.jsx("div",{className:"task-card-header",children:b.jsxs("div",{className:"task-card-title-row",children:[b.jsx("div",{className:"skeleton-line",style:{width:10,height:10,borderRadius:"50%"}}),b.jsx("div",{className:"skeleton-line",style:{width:`${60+H*12}%`}})]})}),b.jsxs("div",{className:"task-card-meta",children:[b.jsx("div",{className:"skeleton-line",style:{width:"30%"}}),b.jsx("div",{className:"skeleton-line",style:{width:"25%"}})]})]},H))}):m.length===0?b.jsxs("div",{className:"empty-state",children:[b.jsx("p",{className:"empty-state-text",children:"No tasks yet"}),b.jsx("p",{className:"empty-state-hint",children:"Tap the + button to create your first task."})]}):b.jsx("div",{className:"task-list",children:m.map(H=>b.jsx(bk,{task:H,lastEvent:k.get(H.id),onEdit:async O=>{try{const K=await r("task.get",{id:O.id});T(K.error?O:K)}catch{T(O)}L(!0)},onDelete:Z,onViewRun:f},H.id))}),b.jsx("button",{className:"fab",onClick:()=>{T(void 0),L(!0)},"aria-label":"New task",title:"New task",children:b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),b.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),B&&b.jsx(Tk,{initial:$,agents:l,hostPlatform:u,isNotificationListener:c,onSaved:X,onRun:f,onCancel:te})]})}let ca=null;function P0(e){ca&&(e.preventDefault(),e.returnValue="")}function Nh(e){const n=!!ca;ca=e;const r=!!ca;r&&!n?window.addEventListener("beforeunload",P0):!r&&n&&window.removeEventListener("beforeunload",P0)}function hs(){return ca?window.confirm(ca):!0}function Nk(){const e=ti(),r=Tr().pathname.startsWith("/tasks"),s=!r;function l(u){hs()&&e(u)}return b.jsxs(b.Fragment,{children:[b.jsxs("button",{className:`tab-btn ${s?"tab-btn-active":""}`,onClick:()=>l("/"),children:[b.jsx("svg",{className:"tab-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:b.jsx("path",{d:"M2 8H4.5L6 4L8 12L10 6L11.5 8H14"})}),"Sessions"]}),b.jsxs("button",{className:`tab-btn ${r?"tab-btn-active":""}`,onClick:()=>l("/tasks"),children:[b.jsxs("svg",{className:"tab-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),b.jsx("path",{d:"M5.5 8L7 9.5L10.5 6"})]}),"Tasks"]})]})}function Mx(e){const[n,r]=N.useState(()=>window.matchMedia(e).matches);return N.useEffect(()=>{const s=window.matchMedia(e),l=u=>r(u.matches);return s.addEventListener("change",l),r(s.matches),()=>s.removeEventListener("change",l)},[e]),n}const pu=$n.isNativePlatform(),Ok=["Device","Data","Messaging"],Oh=[{capability:"sms-read",label:"Read SMS",group:"Messaging",permission:"smsRead"},{capability:"sms-send",label:"Send SMS",group:"Messaging",permission:"smsSend"},{capability:"send-email",label:"Send Email",group:"Messaging",permission:"postNotifications"},{capability:"notifications",label:"Notifications from Other Apps",group:"Data",permission:"notificationListener"},{capability:"contacts",label:"Manage Contacts",group:"Data",permission:"contacts"},{capability:"calendar",label:"Manage Calendar",group:"Data",permission:"calendar"},{capability:"location",label:"Get Location",group:"Device",permission:"location",enableMethod:"device.location.enable",disableMethod:"device.location.disable",enableParams:e=>({fcmToken:e}),disableParams:()=>({})},{capability:"battery",label:"Read Battery Status",group:"Device"},{capability:"dnd",label:"Set Ringer Mode",group:"Device",permission:"dnd"},{capability:"alarm",label:"Trigger Alarms",group:"Device",needsFullScreenIntent:!0}];function Dx({capabilityTokens:e,activeClientToken:n,request:r,onCapabilityTokensChange:s}){const[l,u]=N.useState(null),[c,f]=N.useState(null),[m,d]=N.useState(null),[y,g]=N.useState(null);N.useEffect(()=>{if(!pu||!Ut){g(new Set);return}Ut.getSupportedPermissions().then(({types:T})=>g(new Set(T))).catch(()=>g(new Set))},[]);function x(T){return!!(n&&(e==null?void 0:e[T])===n)}function w(T){return y?y.size===0?!0:!(T.permission&&!y.has(T.permission)||T.needsFullScreenIntent&&!y.has("fullScreenIntent")):!1}function k(T,te){const P={};for(const[z,X]of Object.entries(e??{}))P[z]=X??null;P[T]=te?n??null:null,s(P)}N.useEffect(()=>{if(!pu||!Ut||!x("location"))return;function te(){Ut.checkPermission({type:"location"}).then(({granted:z})=>{z||r("device.location.disable").then(()=>{k("location",!1)}).catch(()=>{})})}te();const P=Cx.addListener("resume",te);return()=>{P.then(z=>z.remove())}},[e,n]),N.useEffect(()=>{if(!pu||!Ut)return;const T=Oh.map(te=>te.capability).filter(te=>(e==null?void 0:e[te])===n);Ut.setEnabledCapabilities({capabilities:T}).catch(()=>{})},[e,n]);async function D(T,te=!1){var X,Z;const P=x(T.capability);if(P&&!te){d(T);return}if(!P&&!!(e!=null&&e[T.capability])&&e[T.capability]!==n&&!te){f(T);return}u(T.capability);try{if(P){const se=T.disableMethod??"device.capability.disable",ie=((X=T.disableParams)==null?void 0:X.call(T))??{capability:T.capability};await r(se,ie),k(T.capability,!1);return}if(Ut&&T.capability==="send-email")try{const se=await Ut.hasEmailClient();if(se.supported&&!se.available){alert("No email app is installed on this device. Install one (e.g. Gmail) before enabling Sending Email.");return}}catch{}if(Ut&&T.permission){const se=await Ut.checkPermission({type:T.permission});if(!se.supported){console.warn(`Native build does not support permission '${T.permission}'`);return}if(!se.granted&&!(await Ut.requestPermission({type:T.permission})).granted)return}if(Ut&&T.needsFullScreenIntent){const se=await Ut.checkPermission({type:"fullScreenIntent"});if(!se.supported){console.warn("Native build does not support fullScreenIntent");return}if(!se.granted&&!(await Ut.requestPermission({type:"fullScreenIntent"})).granted)return}if(!Ut)return;const{token:H}=await Ut.getFcmToken();if(!H){console.warn("No FCM token available");return}const O=Oh.map(se=>se.capability).filter(se=>se===T.capability||(e==null?void 0:e[se])===n);await Ut.setEnabledCapabilities({capabilities:O});const K=T.enableMethod??"device.capability.enable",J=((Z=T.enableParams)==null?void 0:Z.call(T,H))??{capability:T.capability,fcmToken:H};await r(K,J),k(T.capability,!0)}catch(H){console.error(`Failed to toggle ${T.capability}:`,H)}finally{u(null)}}const B=Ok.map(T=>({group:T,items:Oh.filter(te=>te.group===T&&w(te))})).filter(T=>T.items.length>0);if(!pu||B.length===0)return null;const L=c&&ha.createPortal(b.jsx("div",{className:"confirm-modal-overlay",onClick:()=>f(null),children:b.jsxs("div",{className:"confirm-modal",onClick:T=>T.stopPropagation(),children:[b.jsxs("h2",{className:"confirm-modal-title",children:["Switch ",c.label," to this device?"]}),b.jsxs("p",{className:"confirm-modal-message",children:[c.label," is currently enabled on another device. Switching will make this device the one the host uses for ",c.label,", and it will be disabled on the other device."]}),b.jsxs("div",{className:"confirm-modal-actions",children:[b.jsx("button",{className:"btn btn-secondary",onClick:()=>f(null),children:"Cancel"}),b.jsx("button",{className:"btn btn-primary",onClick:()=>{const T=c;f(null),D(T,!0)},children:"Switch"})]})]})}),document.body),$=m&&ha.createPortal(b.jsx("div",{className:"confirm-modal-overlay",onClick:()=>d(null),children:b.jsxs("div",{className:"confirm-modal",onClick:T=>T.stopPropagation(),children:[b.jsxs("h2",{className:"confirm-modal-title",children:["Disable ",m.label,"?"]}),b.jsxs("p",{className:"confirm-modal-message",children:["Agents running on the host will no longer be able to use ",m.label," until it is re-enabled on a device."]}),b.jsxs("div",{className:"confirm-modal-actions",children:[b.jsx("button",{className:"btn btn-secondary",onClick:()=>d(null),children:"Cancel"}),b.jsx("button",{className:"btn btn-danger",onClick:()=>{const T=m;d(null),D(T,!0)},children:"Disable"})]})]})}),document.body);return b.jsxs(b.Fragment,{children:[B.map(({group:T,items:te},P)=>b.jsx("div",{className:P>0?"drawer-toggle-group drawer-toggle-group-divided":"drawer-toggle-group",children:te.map(z=>{const X=x(z.capability);return b.jsxs("label",{className:"drawer-toggle",children:[b.jsx("span",{className:"drawer-toggle-label",children:z.label}),b.jsx("button",{className:`toggle-switch ${X?"toggle-switch-on":""}`,onClick:()=>D(z),disabled:l===z.capability,role:"switch","aria-checked":X,children:b.jsx("span",{className:"toggle-switch-thumb"})})]},z.capability)})},T)),L,$]})}const q0=!!window.__PALMIER_SERVE__&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),Rk=$n.isNativePlatform();function H0({daemonVersion:e,capabilityTokens:n,activeClientToken:r,request:s,onCapabilityTokensChange:l}){var q;const{pairedHosts:u,activeHostId:c,setActiveHostId:f,removePairedHost:m,renamePairedHost:d}=va(),y=ti(),g=Mx("(min-width: 768px)"),[x,w]=N.useState(!1),[k,D]=N.useState(!1),[B,L]=N.useState(null),[$,T]=N.useState(""),[te,P]=N.useState(null),z=N.useRef(null),X=N.useRef(null),Z=N.useCallback(()=>{D(!0)},[]);function H(){k&&(w(!1),D(!1))}function O(){D(!1),w(!0)}function K(V,ue){L(V),T(ue)}function J(){B&&$.trim()&&d(B,$.trim()),L(null),T("")}function se(){L(null),T("")}N.useEffect(()=>{B&&X.current&&(X.current.focus(),X.current.select())},[B]),N.useEffect(()=>{if(!x||k)return;function V(ue){ue.key==="Escape"&&Z()}return document.addEventListener("keydown",V),()=>{document.removeEventListener("keydown",V)}},[x,k,Z]);const ie=b.jsxs(b.Fragment,{children:[!g&&b.jsx("button",{className:"drawer-close-btn",onClick:Z,"aria-label":"Close menu",children:b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:b.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),!q0&&u.length>0&&b.jsxs("div",{className:"drawer-section",children:[b.jsx("h3",{className:"drawer-section-label",children:"Hosts"}),b.jsx("div",{className:"host-picker-inline",children:b.jsx("div",{className:"host-picker-list",role:"listbox",children:u.map(V=>{const ue=V.hostId===c,xe=B===V.hostId,S=V.name||V.hostId.slice(0,8);return b.jsx("div",{className:"host-picker-item-wrapper",children:b.jsxs("div",{className:`host-picker-item ${ue?"host-picker-item-active":""}`,onClick:()=>{if(!xe&&!ue){if(!hs())return;f(V.hostId),g||Z()}},role:"option","aria-selected":ue,children:[xe?b.jsx("input",{ref:X,className:"form-input host-picker-rename-input",type:"text",value:$,onChange:M=>T(M.target.value),onKeyDown:M=>{M.key==="Enter"&&J(),M.key==="Escape"&&se()},onBlur:J,onClick:M=>M.stopPropagation()}):b.jsx("span",{className:"host-picker-item-name",children:S}),b.jsxs("div",{className:"host-picker-item-actions",children:[ue&&!xe&&b.jsx("button",{className:"host-picker-edit-btn",onClick:M=>{M.stopPropagation(),K(V.hostId,S)},"aria-label":"Rename host",children:b.jsx("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",children:b.jsx("path",{d:"M9.5 1.5L11.5 3.5M1.5 11.5L2 9L9 2L11 4L4 11L1.5 11.5Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}),!ue&&b.jsx("button",{className:"host-picker-delete-btn",onClick:M=>{M.stopPropagation(),P(V.hostId)},"aria-label":`Unpair ${S}`,children:b.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:b.jsx("path",{d:"M4 5.5V11C4 11.2761 4.22386 11.5 4.5 11.5H9.5C9.77614 11.5 10 11.2761 10 11V5.5M3 4H11M5.5 4V3C5.5 2.72386 5.72386 2.5 6 2.5H8C8.27614 2.5 8.5 2.72386 8.5 3V4M6.5 6.5V9.5M7.5 6.5V9.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]})},V.hostId)})})})]}),!q0&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"drawer-divider"}),b.jsx("div",{className:"drawer-section",children:b.jsx("button",{className:"btn btn-primary btn-full",onClick:()=>{hs()&&(y("/pair"),g||Z())},children:"Pair New Host"})})]}),Rk&&s&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"drawer-divider"}),b.jsxs("div",{className:"drawer-section",children:[b.jsx("h3",{className:"drawer-section-label",children:"Host capabilities on this device"}),b.jsx(Dx,{capabilityTokens:n,activeClientToken:r,request:s,onCapabilityTokensChange:V=>l==null?void 0:l(V)})]})]}),b.jsxs("div",{className:"drawer-footer",children:[e&&b.jsxs("div",{className:"drawer-version",children:["Palmier v",e]}),b.jsxs("div",{className:"drawer-legal",children:[b.jsx("a",{href:"https://www.palmier.me/terms",target:"_blank",rel:"noopener noreferrer",children:"Terms"}),b.jsx("span",{className:"drawer-legal-sep",children:"·"}),b.jsx("a",{href:"https://www.palmier.me/privacy",target:"_blank",rel:"noopener noreferrer",children:"Privacy"})]})]})]}),F=te&&ha.createPortal(b.jsx("div",{className:"confirm-modal-overlay",onClick:()=>P(null),children:b.jsxs("div",{className:"confirm-modal",onClick:V=>V.stopPropagation(),children:[b.jsx("h2",{className:"confirm-modal-title",children:"Delete host?"}),b.jsxs("p",{className:"confirm-modal-message",children:['"',((q=u.find(V=>V.hostId===te))==null?void 0:q.name)||te.slice(0,8),'" will be unpaired from this device.']}),b.jsxs("div",{className:"confirm-modal-actions",children:[b.jsx("button",{className:"btn btn-secondary",onClick:()=>P(null),children:"Cancel"}),b.jsx("button",{className:"btn btn-danger",onClick:()=>{m(te),P(null)},children:"Delete"})]})]})}),document.body);return g?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"drawer-panel drawer-panel-desktop",ref:z,children:ie}),F]}):b.jsxs(b.Fragment,{children:[b.jsx("button",{className:"hamburger-btn",onClick:O,"aria-label":"Open menu",children:b.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:b.jsx("path",{d:"M3 5H17M3 10H17M3 15H17",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),x&&ha.createPortal(b.jsx("div",{className:`drawer-overlay ${k?"drawer-overlay-closing":""}`,onClick:Z,onAnimationEnd:H,children:b.jsx("div",{className:`drawer-panel ${k?"drawer-panel-closing":""}`,ref:z,onClick:V=>V.stopPropagation(),children:ie})}),document.body),F]})}const Mk=$n.isNativePlatform();function Dk(){const{mode:e}=Sa(),[n,r]=N.useState(!1),s=N.useRef(null);if(N.useEffect(()=>{if(!n)return;function f(m){var d;(d=s.current)!=null&&d.contains(m.target)||r(!1)}return document.addEventListener("pointerdown",f),()=>document.removeEventListener("pointerdown",f)},[n]),e==="direct")return null;let l,u,c;switch(e){case"lan":l="📶",u="Connected via LAN",c="lan";break;case"nats":l="🌐",u=Mk?"Connected via relay":"Connected",c="relay";break;case"disconnected":l="⚠️",u="Disconnected",c="disconnected";break;case"connecting":default:l="🌐",u="Connecting…",c="connecting";break}return b.jsxs("div",{ref:s,className:`conn-status conn-status--${c}`,children:[b.jsx("button",{type:"button",className:"conn-status-btn","aria-label":u,title:u,onClick:()=>r(f=>!f),children:b.jsx("span",{"aria-hidden":"true",children:l})}),b.jsx("div",{className:`conn-status-popover ${n?"conn-status-popover--open":""}`,role:"tooltip",children:u})]})}function I0(e){var s;const n=localStorage.getItem("palmier:lastAgent"),r=e.map(l=>l.key);return n&&r.includes(n)?n:((s=e[0])==null?void 0:s.key)??""}function Lk({agents:e,hostPlatform:n,onStarted:r}){const{request:s}=Sa(),[l,u]=N.useState(""),[c,f]=N.useState(()=>I0(e)),[m,d]=N.useState(!1),[y,g]=N.useState(!1),[x,w]=N.useState(null);N.useEffect(()=>{e.length&&(e.find(te=>te.key===c)||f(I0(e)))},[e,c]),N.useEffect(()=>{const te=l.trim().length>0;return Nh(te?"Your session draft will be lost. Continue?":null),()=>Nh(null)},[l]);const k=e.find(te=>te.key===c),D=!!(k!=null&&k.supportsYolo);N.useEffect(()=>{!D&&m&&d(!1)},[D,m]);const B=!!l.trim()&&!!c&&!y;function L(){return m?confirm(`Yolo mode is enabled. The agent will auto-approve all tool calls — it can read, write, delete files, run arbitrary commands, and access the network without asking for permission.
91
+
92
+ Are you sure you want to continue?`):!0}async function $(){if(!(!B||!L())){g(!0),w(null);try{const te=await s("task.run_oneoff",{user_prompt:l,agent:c,yolo_mode:m,...n==="win32"?{foreground_mode:!0}:{}});if(te.error){w(te.error);return}localStorage.setItem("palmier:lastAgent",c),u(""),Nh(null),te.task_id&&r(te.task_id,te.run_id)}catch(te){w(te instanceof Error?te.message:String(te))}finally{g(!1)}}}function T(te){te.key==="Enter"&&(te.metaKey||te.ctrlKey)&&(te.preventDefault(),$())}return b.jsxs("div",{className:"session-composer",children:[x&&b.jsx("div",{className:"form-error",children:x}),b.jsx("textarea",{className:"session-composer-textarea",value:l,onChange:te=>u(te.target.value),onKeyDown:T,placeholder:"What can I do for you?",rows:3,disabled:y}),b.jsxs("div",{className:"session-composer-controls",children:[b.jsxs("div",{className:"agent-picker-section-inline",children:[b.jsx("span",{className:"agent-picker-label",children:"Run with"}),b.jsx("select",{className:"form-select form-select-sm",value:c,onChange:te=>f(te.target.value),disabled:y||!e.length,children:e.map(te=>b.jsx("option",{value:te.key,children:te.label},te.key))})]}),D&&b.jsxs("label",{className:"session-composer-yolo",children:[b.jsx("input",{type:"checkbox",checked:m,onChange:te=>d(te.target.checked),disabled:y}),"Yolo"]}),b.jsx("button",{className:"btn btn-primary chat-send-btn",onClick:$,disabled:!B,"aria-label":"Run session",title:"Run session",children:y?b.jsx("span",{className:"btn-spinner"}):b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),b.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),D&&m&&b.jsx("p",{className:"command-help-text",children:"The agent will auto-approve all tool calls without asking for permission."})]})}const us=88,F0=6;function zk({id:e,revealedId:n,setRevealedId:r,onDelete:s,onClick:l,children:u,actionLabel:c="Delete"}){const f=n===e,[m,d]=N.useState(0),[y,g]=N.useState(!1),x=N.useRef(0),w=N.useRef(0),k=N.useRef(null),D=N.useRef(0),B=N.useRef(!1),L=N.useRef(null);N.useEffect(()=>{f||d(0)},[f]),N.useEffect(()=>{if(!f)return;function X(Z){var H;(H=L.current)!=null&&H.contains(Z.target)||r(null)}return document.addEventListener("pointerdown",X),()=>document.removeEventListener("pointerdown",X)},[f,r]);function $(X){X.button!==void 0&&X.button!==0||(x.current=X.clientX,w.current=X.clientY,k.current=null,D.current=f?-us:0,B.current=!1)}function T(X){if(X.pointerType==="mouse"&&X.buttons===0)return;const Z=X.clientX-x.current,H=X.clientY-w.current;if(k.current===null){if(Math.abs(Z)<F0&&Math.abs(H)<F0)return;if(k.current=Math.abs(Z)>Math.abs(H)?"x":"y",k.current==="x")try{X.currentTarget.setPointerCapture(X.pointerId)}catch{}}if(k.current!=="x")return;B.current=!0,y||g(!0);let O=D.current+Z;O>0&&(O=O/4),O<-us&&(O=-us+(O+us)/4),d(O)}function te(){if(k.current!=="x"){g(!1);return}k.current=null,g(!1),m<=-44?(d(-us),r(e)):(d(0),f&&r(null))}function P(X){if(B.current){B.current=!1,X.stopPropagation(),X.preventDefault();return}f&&(X.stopPropagation(),X.preventDefault(),r(null))}const z=m!==0?m:f?-us:0;return b.jsxs("div",{ref:L,className:"swipe-row",children:[b.jsx("button",{type:"button",className:"swipe-row-action",style:{width:us},onClick:X=>{X.stopPropagation(),s()},tabIndex:f?0:-1,"aria-hidden":!f,children:c}),b.jsx("div",{className:`swipe-row-content ${y?"swipe-row-content-dragging":""}`,style:{transform:`translateX(${z}px)`},onPointerDown:$,onPointerMove:T,onPointerUp:te,onPointerCancel:te,onClickCapture:P,onClick:l,children:u})]})}const Uk=10;function Bk({connected:e,hostId:n,request:r,subscribeEvents:s,agents:l,hostPlatform:u,filterTaskId:c,onClearFilter:f}){const[m,d]=N.useState([]),[y,g]=N.useState(0),[x,w]=N.useState(!1),[k,D]=N.useState(!1),[B,L]=N.useState(null),$=ti();async function T(F){const q=`${F.task_id}:${F.run_id}`;d(V=>V.filter(ue=>`${ue.task_id}:${ue.run_id}`!==q)),g(V=>Math.max(0,V-1)),L(null);try{await r("taskrun.delete",{task_id:F.task_id,run_id:F.run_id})}catch(V){console.error("Failed to delete run:",V),d(ue=>[F,...ue]),g(ue=>ue+1)}}const te=N.useRef(null),P=N.useCallback(F=>{const q={offset:F,limit:Uk};return c&&(q.task_id=c),q},[c]),z=N.useCallback(async(F,q)=>{if(e){q?D(!0):w(!0);try{const V=await r("taskrun.list",P(F)),ue=V.entries??[];g(V.total??0),d(q?xe=>{const S=new Set(xe.map(W=>`${W.task_id}:${W.run_id}`)),M=ue.filter(W=>!S.has(`${W.task_id}:${W.run_id}`));return[...xe,...M]}:ue)}catch(V){V instanceof Error&&V.message==="Not connected"||console.error("Failed to load runs:",V)}finally{w(!1),D(!1)}}},[e,r,P]);N.useEffect(()=>{e?(d([]),g(0),z(0,!1)):(d([]),g(0))},[e,n,z,c]);const X=Rx({onRefresh:()=>z(0,!1),enabled:e});N.useEffect(()=>!e||!n?void 0:s(n,async q=>{try{const V=JSON.parse(new TextDecoder().decode(q.data));if(V.event_type==="running-state"&&V.running_state&&["monitoring","started","finished","failed","aborted"].includes(V.running_state)){const ue=await r("taskrun.list",P(0)),xe=ue.entries??[];g(ue.total??0),d(S=>{const M=new Map(xe.map(Ae=>[`${Ae.task_id}:${Ae.run_id}`,Ae])),W=S.map(Ae=>{const Te=`${Ae.task_id}:${Ae.run_id}`;return M.get(Te)??Ae}),A=new Set(W.map(Ae=>`${Ae.task_id}:${Ae.run_id}`));return[...xe.filter(Ae=>!A.has(`${Ae.task_id}:${Ae.run_id}`)),...W]})}}catch{}}),[e,n,s,r]),N.useEffect(()=>{const F=te.current;if(!F)return;const q=new IntersectionObserver(V=>{V[0].isIntersecting&&!k&&m.length<y&&z(m.length,!0)},{threshold:.1});return q.observe(F),()=>q.disconnect()},[m.length,y,k,z]);function Z(F,q){if(!F||!q)return"";const V=Math.round((q-F)/1e3);if(V<60)return`${V}s`;const ue=Math.floor(V/60),xe=V%60;return`${ue}m ${xe}s`}const H={monitoring:"Monitoring",started:"Running",finished:"Finished",failed:"Failed",aborted:"Aborted"};function O(F,q){hs()&&$(`/runs/${F}/${encodeURIComponent(q)}`)}const K=!c&&b.jsx(Lk,{agents:l,hostPlatform:u,onStarted:(F,q)=>{$(q?`/runs/${encodeURIComponent(F)}/${encodeURIComponent(q)}`:`/runs/${encodeURIComponent(F)}`)}}),J=b.jsx(Ox,{pullDistance:X.pullDistance,refreshing:X.refreshing,threshold:X.threshold}),se=c&&f&&b.jsx("div",{style:{marginBottom:"var(--space-sm)"},children:b.jsxs("span",{className:"sessions-filter-chip",children:["Filtered by task",b.jsx("button",{onClick:f,"aria-label":"Clear filter",children:"×"})]})});function ie(F){if(F==="failed")return"var(--color-error)";if(F==="aborted")return"var(--color-warning, #d97706)"}return x&&m.length===0&&e?b.jsxs(b.Fragment,{children:[J,K,b.jsx("div",{className:"task-list",children:[0,1,2].map(F=>b.jsxs("div",{className:"task-card",style:{pointerEvents:"none"},children:[b.jsx("div",{className:"task-card-header",children:b.jsx("div",{className:"task-card-title-row",children:b.jsx("div",{className:"skeleton-line",style:{width:`${70+F*10}%`}})})}),b.jsx("div",{className:"task-card-meta",children:b.jsx("div",{className:"skeleton-line",style:{width:"45%"}})})]},F))})]}):!e||x&&m.length===0?b.jsxs(b.Fragment,{children:[J,K,b.jsx("div",{className:"sessions-view",children:b.jsxs("div",{className:"empty-state",children:[b.jsx("p",{className:"empty-state-text",children:"Sessions"}),b.jsx("p",{className:"empty-state-hint",children:"Your sessions will appear here"})]})})]}):m.length===0?b.jsxs(b.Fragment,{children:[J,K,se,b.jsx("div",{className:"sessions-view",children:b.jsxs("div",{className:"empty-state",children:[b.jsx("p",{className:"empty-state-text",children:"No sessions yet"}),b.jsx("p",{className:"empty-state-hint",children:c?"This task hasn't been executed yet. Run it from the task menu or wait for its next trigger.":"Your sessions will appear here."})]})})]}):b.jsxs(b.Fragment,{children:[J,K,se,b.jsxs("div",{className:"task-list",children:[m.map((F,q)=>{const V=`${F.task_id}:${F.run_id}`;return b.jsx(zk,{id:V,revealedId:B,setRevealedId:L,onDelete:()=>T(F),onClick:()=>!F.error&&O(F.task_id,F.run_id),children:b.jsxs("div",{className:"sessions-card",children:[b.jsxs("div",{className:"sessions-card-body",children:[b.jsx("h3",{className:"sessions-card-name",children:F.task_name||F.task_id}),b.jsxs("div",{className:"sessions-card-meta",children:[F.running_state==="started"?b.jsx("span",{className:"status-spinner","aria-label":"Running",children:b.jsx("span",{})}):b.jsx("span",{style:{color:ie(F.running_state)},children:H[F.running_state??""]??F.running_state}),F.end_time&&b.jsx("span",{children:Uu(F.end_time)}),F.start_time&&F.end_time&&b.jsx("span",{style:{color:"var(--color-muted)"},children:Z(F.start_time,F.end_time)}),F.error&&b.jsx("span",{style:{color:"var(--color-muted)"},children:F.error})]})]}),b.jsx("span",{className:"sessions-card-chevron",children:"›"})]})},`${V}-${q}`)}),b.jsx("div",{ref:te,style:{height:1}}),k&&b.jsx("div",{className:"loading-state",style:{padding:"var(--space-md)"},children:b.jsx("div",{className:"spinner"})})]})]})}function Pk(e,n){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const qk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ik={};function $0(e,n){return(Ik.jsx?Hk:qk).test(e)}const Fk=/[ \t\n\f\r]/g;function $k(e){return typeof e=="object"?e.type==="text"?Y0(e.value):!1:Y0(e)}function Y0(e){return e.replace(Fk,"")===""}class Gl{constructor(n,r,s){this.normal=r,this.property=n,s&&(this.space=s)}}Gl.prototype.normal={};Gl.prototype.property={};Gl.prototype.space=void 0;function Lx(e,n){const r={},s={};for(const l of e)Object.assign(r,l.property),Object.assign(s,l.normal);return new Gl(r,s,n)}function dd(e){return e.toLowerCase()}class Cn{constructor(n,r){this.attribute=r,this.property=n}}Cn.prototype.attribute="";Cn.prototype.booleanish=!1;Cn.prototype.boolean=!1;Cn.prototype.commaOrSpaceSeparated=!1;Cn.prototype.commaSeparated=!1;Cn.prototype.defined=!1;Cn.prototype.mustUseProperty=!1;Cn.prototype.number=!1;Cn.prototype.overloadedBoolean=!1;Cn.prototype.property="";Cn.prototype.spaceSeparated=!1;Cn.prototype.space=void 0;let Yk=0;const Ve=ps(),Kt=ps(),md=ps(),ve=ps(),jt=ps(),fa=ps(),Un=ps();function ps(){return 2**++Yk}const pd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Kt,commaOrSpaceSeparated:Un,commaSeparated:fa,number:ve,overloadedBoolean:md,spaceSeparated:jt},Symbol.toStringTag,{value:"Module"})),Rh=Object.keys(pd);class Hd extends Cn{constructor(n,r,s,l){let u=-1;if(super(n,r),G0(this,"space",l),typeof s=="number")for(;++u<Rh.length;){const c=Rh[u];G0(this,Rh[u],(s&pd[c])===pd[c])}}}Hd.prototype.defined=!0;function G0(e,n,r){r&&(e[n]=r)}function _a(e){const n={},r={};for(const[s,l]of Object.entries(e.properties)){const u=new Hd(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),n[s]=u,r[dd(s)]=s,r[dd(u.attribute)]=s}return new Gl(n,r,e.space)}const zx=_a({properties:{ariaActiveDescendant:null,ariaAtomic:Kt,ariaAutoComplete:null,ariaBusy:Kt,ariaChecked:Kt,ariaColCount:ve,ariaColIndex:ve,ariaColSpan:ve,ariaControls:jt,ariaCurrent:null,ariaDescribedBy:jt,ariaDetails:null,ariaDisabled:Kt,ariaDropEffect:jt,ariaErrorMessage:null,ariaExpanded:Kt,ariaFlowTo:jt,ariaGrabbed:Kt,ariaHasPopup:null,ariaHidden:Kt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jt,ariaLevel:ve,ariaLive:null,ariaModal:Kt,ariaMultiLine:Kt,ariaMultiSelectable:Kt,ariaOrientation:null,ariaOwns:jt,ariaPlaceholder:null,ariaPosInSet:ve,ariaPressed:Kt,ariaReadOnly:Kt,ariaRelevant:null,ariaRequired:Kt,ariaRoleDescription:jt,ariaRowCount:ve,ariaRowIndex:ve,ariaRowSpan:ve,ariaSelected:Kt,ariaSetSize:ve,ariaSort:null,ariaValueMax:ve,ariaValueMin:ve,ariaValueNow:ve,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Ux(e,n){return n in e?e[n]:n}function Bx(e,n){return Ux(e,n.toLowerCase())}const Gk=_a({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fa,acceptCharset:jt,accessKey:jt,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:jt,autoFocus:Ve,autoPlay:Ve,blocking:jt,capture:null,charSet:null,checked:Ve,cite:null,className:jt,cols:ve,colSpan:null,content:null,contentEditable:Kt,controls:Ve,controlsList:jt,coords:ve|fa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:md,draggable:Kt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:jt,height:ve,hidden:md,high:ve,href:null,hrefLang:null,htmlFor:jt,httpEquiv:jt,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:jt,itemRef:jt,itemScope:Ve,itemType:jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:ve,manifest:null,max:null,maxLength:ve,media:null,method:null,min:null,minLength:ve,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,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:Ve,optimum:ve,pattern:null,ping:jt,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:jt,required:Ve,reversed:Ve,rows:ve,rowSpan:ve,sandbox:jt,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:ve,sizes:null,slot:null,span:ve,spellCheck:Kt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ve,step:null,style:null,tabIndex:ve,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Kt,width:ve,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jt,axis:null,background:null,bgColor:null,border:ve,borderColor:null,bottomMargin:ve,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:ve,leftMargin:ve,link:null,longDesc:null,lowSrc:null,marginHeight:ve,marginWidth:ve,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:ve,rules:null,scheme:null,scrolling:Kt,standby:null,summary:null,text:null,topMargin:ve,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ve,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:ve,security:null,unselectable:null},space:"html",transform:Bx}),Vk=_a({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:ve,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ve,amplitude:ve,arabicForm:null,ascent:ve,attributeName:null,attributeType:null,azimuth:ve,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ve,by:null,calcMode:null,capHeight:ve,className:jt,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:ve,diffuseConstant:ve,direction:null,display:null,dur:null,divisor:ve,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:ve,enableBackground:null,end:null,event:null,exponent:ve,externalResourcesRequired:null,fill:null,fillOpacity:ve,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:fa,g2:fa,glyphName:fa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ve,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ve,horizOriginX:ve,horizOriginY:ve,id:null,ideographic:ve,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ve,k:ve,k1:ve,k2:ve,k3:ve,k4:ve,kernelMatrix:Un,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ve,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:ve,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:ve,overlineThickness:ve,paintOrder:null,panose1:null,path:null,pathLength:ve,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ve,pointsAtY:ve,pointsAtZ:ve,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:ve,specularExponent:ve,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ve,strikethroughThickness:ve,string:null,stroke:null,strokeDashArray:Un,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ve,strokeOpacity:ve,strokeWidth:null,style:null,surfaceScale:ve,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Un,tabIndex:ve,tableValues:null,target:null,targetX:ve,targetY:ve,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:ve,underlineThickness:ve,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ve,values:null,vAlphabetic:ve,vMathematical:ve,vectorEffect:null,vHanging:ve,vIdeographic:ve,version:null,vertAdvY:ve,vertOriginX:ve,vertOriginY:ve,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ve,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ux}),Px=_a({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()}}),qx=_a({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Bx}),Hx=_a({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Jk={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"},Xk=/[A-Z]/g,V0=/-[a-z]/g,Kk=/^data[-\w.:]+$/i;function Qk(e,n){const r=dd(n);let s=n,l=Cn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Kk.test(n)){if(n.charAt(4)==="-"){const u=n.slice(5).replace(V0,Wk);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=n.slice(4);if(!V0.test(u)){let c=u.replace(Xk,Zk);c.charAt(0)!=="-"&&(c="-"+c),n="data"+c}}l=Hd}return new l(s,n)}function Zk(e){return"-"+e.toLowerCase()}function Wk(e){return e.charAt(1).toUpperCase()}const eC=Lx([zx,Gk,Px,qx,Hx],"html"),Id=Lx([zx,Vk,Px,qx,Hx],"svg");function tC(e){return e.join(" ").trim()}var Zs={},Mh,J0;function nC(){if(J0)return Mh;J0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
93
+ `,d="/",y="*",g="",x="comment",w="declaration";function k(B,L){if(typeof B!="string")throw new TypeError("First argument must be a string");if(!B)return[];L=L||{};var $=1,T=1;function te(ie){var F=ie.match(n);F&&($+=F.length);var q=ie.lastIndexOf(m);T=~q?ie.length-q:T+ie.length}function P(){var ie={line:$,column:T};return function(F){return F.position=new z(ie),H(),F}}function z(ie){this.start=ie,this.end={line:$,column:T},this.source=L.source}z.prototype.content=B;function X(ie){var F=new Error(L.source+":"+$+":"+T+": "+ie);if(F.reason=ie,F.filename=L.source,F.line=$,F.column=T,F.source=B,!L.silent)throw F}function Z(ie){var F=ie.exec(B);if(F){var q=F[0];return te(q),B=B.slice(q.length),F}}function H(){Z(r)}function O(ie){var F;for(ie=ie||[];F=K();)F!==!1&&ie.push(F);return ie}function K(){var ie=P();if(!(d!=B.charAt(0)||y!=B.charAt(1))){for(var F=2;g!=B.charAt(F)&&(y!=B.charAt(F)||d!=B.charAt(F+1));)++F;if(F+=2,g===B.charAt(F-1))return X("End of comment missing");var q=B.slice(2,F-2);return T+=2,te(q),B=B.slice(F),T+=2,ie({type:x,comment:q})}}function J(){var ie=P(),F=Z(s);if(F){if(K(),!Z(l))return X("property missing ':'");var q=Z(u),V=ie({type:w,property:D(F[0].replace(e,g)),value:q?D(q[0].replace(e,g)):g});return Z(c),V}}function se(){var ie=[];O(ie);for(var F;F=J();)F!==!1&&(ie.push(F),O(ie));return ie}return H(),se()}function D(B){return B?B.replace(f,g):g}return Mh=k,Mh}var X0;function rC(){if(X0)return Zs;X0=1;var e=Zs&&Zs.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.default=r;const n=e(nC());function r(s,l){let u=null;if(!s||typeof s!="string")return u;const c=(0,n.default)(s),f=typeof l=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:d,value:y}=m;f?l(d,y,m):y&&(u=u||{},u[d]=y)}),u}return Zs}var vl={},K0;function iC(){if(K0)return vl;K0=1,Object.defineProperty(vl,"__esModule",{value:!0}),vl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,u=function(d){return!d||r.test(d)||e.test(d)},c=function(d,y){return y.toUpperCase()},f=function(d,y){return"".concat(y,"-")},m=function(d,y){return y===void 0&&(y={}),u(d)?d:(d=d.toLowerCase(),y.reactCompat?d=d.replace(l,f):d=d.replace(s,f),d.replace(n,c))};return vl.camelCase=m,vl}var wl,Q0;function sC(){if(Q0)return wl;Q0=1;var e=wl&&wl.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},n=e(rC()),r=iC();function s(l,u){var c={};return!l||typeof l!="string"||(0,n.default)(l,function(f,m){f&&m&&(c[(0,r.camelCase)(f,u)]=m)}),c}return s.default=s,wl=s,wl}var aC=sC();const lC=zb(aC),Ix=Fx("end"),Fd=Fx("start");function Fx(e){return n;function n(r){const s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function oC(e){const n=Fd(e),r=Ix(e);if(n&&r)return{start:n,end:r}}function Ol(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Z0(e.position):"start"in e||"end"in e?Z0(e):"line"in e||"column"in e?gd(e):""}function gd(e){return W0(e&&e.line)+":"+W0(e&&e.column)}function Z0(e){return gd(e&&e.start)+"-"+gd(e&&e.end)}function W0(e){return e&&typeof e=="number"?e:1}class fn extends Error{constructor(n,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let l="",u={},c=!1;if(r&&("line"in r&&"column"in r?u={place:r}:"start"in r&&"end"in r?u={place:r}:"type"in r?u={ancestors:[r],place:r.position}:u={...r}),typeof n=="string"?l=n:!u.cause&&n&&(c=!0,l=n.message,u.cause=n),!u.ruleId&&!u.source&&typeof s=="string"){const m=s.indexOf(":");m===-1?u.ruleId=s:(u.source=s.slice(0,m),u.ruleId=s.slice(m+1))}if(!u.place&&u.ancestors&&u.ancestors){const m=u.ancestors[u.ancestors.length-1];m&&(u.place=m.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=Ol(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=c&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fn.prototype.file="";fn.prototype.name="";fn.prototype.reason="";fn.prototype.message="";fn.prototype.stack="";fn.prototype.column=void 0;fn.prototype.line=void 0;fn.prototype.ancestors=void 0;fn.prototype.cause=void 0;fn.prototype.fatal=void 0;fn.prototype.place=void 0;fn.prototype.ruleId=void 0;fn.prototype.source=void 0;const $d={}.hasOwnProperty,uC=new Map,cC=/[A-Z]/g,fC=new Set(["table","tbody","thead","tfoot","tr"]),hC=new Set(["td","th"]),$x="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function dC(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=n.filePath||void 0;let s;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=wC(r,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");s=vC(r,n.jsx,n.jsxs)}const l={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:s,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Id:eC,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},u=Yx(l,e,void 0);return u&&typeof u!="string"?u:l.create(e,l.Fragment,{children:u||void 0},void 0)}function Yx(e,n,r){if(n.type==="element")return mC(e,n,r);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return pC(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return yC(e,n,r);if(n.type==="mdxjsEsm")return gC(e,n);if(n.type==="root")return bC(e,n,r);if(n.type==="text")return xC(e,n)}function mC(e,n,r){const s=e.schema;let l=s;n.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=Id,e.schema=l),e.ancestors.push(n);const u=Vx(e,n.tagName,!1),c=SC(e,n);let f=Gd(e,n);return fC.has(n.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!$k(m):!0})),Gx(e,c,u,n),Yd(c,f),e.ancestors.pop(),e.schema=s,e.create(n,u,c,r)}function pC(e,n){if(n.data&&n.data.estree&&e.evaluater){const s=n.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Pl(e,n.position)}function gC(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Pl(e,n.position)}function yC(e,n,r){const s=e.schema;let l=s;n.name==="svg"&&s.space==="html"&&(l=Id,e.schema=l),e.ancestors.push(n);const u=n.name===null?e.Fragment:Vx(e,n.name,!0),c=_C(e,n),f=Gd(e,n);return Gx(e,c,u,n),Yd(c,f),e.ancestors.pop(),e.schema=s,e.create(n,u,c,r)}function bC(e,n,r){const s={};return Yd(s,Gd(e,n)),e.create(n,e.Fragment,s,r)}function xC(e,n){return n.value}function Gx(e,n,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(n.node=s)}function Yd(e,n){if(n.length>0){const r=n.length>1?n:n[0];r&&(e.children=r)}}function vC(e,n,r){return s;function s(l,u,c,f){const d=Array.isArray(c.children)?r:n;return f?d(u,c,f):d(u,c)}}function wC(e,n){return r;function r(s,l,u,c){const f=Array.isArray(u.children),m=Fd(s);return n(l,u,c,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function SC(e,n){const r={};let s,l;for(l in n.properties)if(l!=="children"&&$d.call(n.properties,l)){const u=EC(e,l,n.properties[l]);if(u){const[c,f]=u;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&hC.has(n.tagName)?s=f:r[c]=f}}if(s){const u=r.style||(r.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function _C(e,n){const r={};for(const s of n.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const u=s.data.estree.body[0];u.type;const c=u.expression;c.type;const f=c.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else Pl(e,n.position);else{const l=s.name;let u;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const f=s.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else Pl(e,n.position);else u=s.value===null?!0:s.value;r[l]=u}return r}function Gd(e,n){const r=[];let s=-1;const l=e.passKeys?new Map:uC;for(;++s<n.children.length;){const u=n.children[s];let c;if(e.passKeys){const m=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(m){const d=l.get(m)||0;c=m+"-"+d,l.set(m,d+1)}}const f=Yx(e,u,c);f!==void 0&&r.push(f)}return r}function EC(e,n,r){const s=Qk(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?Pk(r):tC(r)),s.property==="style"){let l=typeof r=="object"?r:kC(e,String(r));return e.stylePropertyNameCase==="css"&&(l=CC(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?Jk[s.property]||s.property:s.attribute,r]}}function kC(e,n){try{return lC(n,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const s=r,l=new fn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=$x+"#cannot-parse-style-attribute",l}}function Vx(e,n,r){let s;if(!r)s={type:"Literal",value:n};else if(n.includes(".")){const l=n.split(".");let u=-1,c;for(;++u<l.length;){const f=$0(l[u])?{type:"Identifier",name:l[u]}:{type:"Literal",value:l[u]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}s=c}else s=$0(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(s.type==="Literal"){const l=s.value;return $d.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);Pl(e)}function Pl(e,n){const r=new fn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=$x+"#cannot-handle-mdx-estrees-without-createevaluater",r}function CC(e){const n={};let r;for(r in e)$d.call(e,r)&&(n[AC(r)]=e[r]);return n}function AC(e){let n=e.replace(cC,TC);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function TC(e){return"-"+e.toLowerCase()}const Dh={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"]},jC={};function Vd(e,n){const r=jC,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,l=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Jx(e,s,l)}function Jx(e,n,r){if(NC(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eb(e.children,n,r)}return Array.isArray(e)?eb(e,n,r):""}function eb(e,n,r){const s=[];let l=-1;for(;++l<e.length;)s[l]=Jx(e[l],n,r);return s.join("")}function NC(e){return!!(e&&typeof e=="object")}const tb=document.createElement("i");function Jd(e){const n="&"+e+";";tb.innerHTML=n;const r=tb.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===n?!1:r}function In(e,n,r,s){const l=e.length;let u=0,c;if(n<0?n=-n>l?0:l+n:n=n>l?l:n,r=r>0?r:0,s.length<1e4)c=Array.from(s),c.unshift(n,r),e.splice(...c);else for(r&&e.splice(n,r);u<s.length;)c=s.slice(u,u+1e4),c.unshift(n,0),e.splice(...c),u+=1e4,n+=1e4}function ir(e,n){return e.length>0?(In(e,e.length,0,n),e):n}const nb={}.hasOwnProperty;function Xx(e){const n={};let r=-1;for(;++r<e.length;)OC(n,e[r]);return n}function OC(e,n){let r;for(r in n){const l=(nb.call(e,r)?e[r]:void 0)||(e[r]={}),u=n[r];let c;if(u)for(c in u){nb.call(l,c)||(l[c]=[]);const f=u[c];RC(l[c],Array.isArray(f)?f:f?[f]:[])}}}function RC(e,n){let r=-1;const s=[];for(;++r<n.length;)(n[r].add==="after"?e:s).push(n[r]);In(e,0,0,s)}function Kx(e,n){const r=Number.parseInt(e,n);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function pr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const gn=Hi(/[A-Za-z]/),cn=Hi(/[\dA-Za-z]/),MC=Hi(/[#-'*+\--9=?A-Z^-~]/);function Bu(e){return e!==null&&(e<32||e===127)}const yd=Hi(/\d/),DC=Hi(/[\dA-Fa-f]/),LC=Hi(/[!-/:-@[-`{-~]/);function Pe(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function Qe(e){return e===-2||e===-1||e===32}const Xu=Hi(new RegExp("\\p{P}|\\p{S}","u")),ds=Hi(/\s/);function Hi(e){return n;function n(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Ea(e){const n=[];let r=-1,s=0,l=0;for(;++r<e.length;){const u=e.charCodeAt(r);let c="";if(u===37&&cn(e.charCodeAt(r+1))&&cn(e.charCodeAt(r+2)))l=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(c=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(r+1);u<56320&&f>56319&&f<57344?(c=String.fromCharCode(u,f),l=1):c="�"}else c=String.fromCharCode(u);c&&(n.push(e.slice(s,r),encodeURIComponent(c)),s=r+l+1,c=""),l&&(r+=l,l=0)}return n.join("")+e.slice(s)}function it(e,n,r,s){const l=s?s-1:Number.POSITIVE_INFINITY;let u=0;return c;function c(m){return Qe(m)?(e.enter(r),f(m)):n(m)}function f(m){return Qe(m)&&u++<l?(e.consume(m),f):(e.exit(r),n(m))}}const zC={tokenize:UC};function UC(e){const n=e.attempt(this.parser.constructs.contentInitial,s,l);let r;return n;function s(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),it(e,n,"linePrefix")}function l(f){return e.enter("paragraph"),u(f)}function u(f){const m=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=m),r=m,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Pe(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),c)}}const BC={tokenize:PC},rb={tokenize:qC};function PC(e){const n=this,r=[];let s=0,l,u,c;return f;function f(T){if(s<r.length){const te=r[s];return n.containerState=te[1],e.attempt(te[0].continuation,m,d)(T)}return d(T)}function m(T){if(s++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,l&&$();const te=n.events.length;let P=te,z;for(;P--;)if(n.events[P][0]==="exit"&&n.events[P][1].type==="chunkFlow"){z=n.events[P][1].end;break}L(s);let X=te;for(;X<n.events.length;)n.events[X][1].end={...z},X++;return In(n.events,P+1,0,n.events.slice(te)),n.events.length=X,d(T)}return f(T)}function d(T){if(s===r.length){if(!l)return x(T);if(l.currentConstruct&&l.currentConstruct.concrete)return k(T);n.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(rb,y,g)(T)}function y(T){return l&&$(),L(s),x(T)}function g(T){return n.parser.lazy[n.now().line]=s!==r.length,c=n.now().offset,k(T)}function x(T){return n.containerState={},e.attempt(rb,w,k)(T)}function w(T){return s++,r.push([n.currentConstruct,n.containerState]),x(T)}function k(T){if(T===null){l&&$(),L(0),e.consume(T);return}return l=l||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:u}),D(T)}function D(T){if(T===null){B(e.exit("chunkFlow"),!0),L(0),e.consume(T);return}return Pe(T)?(e.consume(T),B(e.exit("chunkFlow")),s=0,n.interrupt=void 0,f):(e.consume(T),D)}function B(T,te){const P=n.sliceStream(T);if(te&&P.push(null),T.previous=u,u&&(u.next=T),u=T,l.defineSkip(T.start),l.write(P),n.parser.lazy[T.start.line]){let z=l.events.length;for(;z--;)if(l.events[z][1].start.offset<c&&(!l.events[z][1].end||l.events[z][1].end.offset>c))return;const X=n.events.length;let Z=X,H,O;for(;Z--;)if(n.events[Z][0]==="exit"&&n.events[Z][1].type==="chunkFlow"){if(H){O=n.events[Z][1].end;break}H=!0}for(L(s),z=X;z<n.events.length;)n.events[z][1].end={...O},z++;In(n.events,Z+1,0,n.events.slice(X)),n.events.length=z}}function L(T){let te=r.length;for(;te-- >T;){const P=r[te];n.containerState=P[1],P[0].exit.call(n,e)}r.length=T}function $(){l.write([null]),u=void 0,l=void 0,n.containerState._closeFlow=void 0}}function qC(e,n,r){return it(e,e.attempt(this.parser.constructs.document,n,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ya(e){if(e===null||Tt(e)||ds(e))return 1;if(Xu(e))return 2}function Ku(e,n,r){const s=[];let l=-1;for(;++l<e.length;){const u=e[l].resolveAll;u&&!s.includes(u)&&(n=u(n,r),s.push(u))}return n}const bd={name:"attention",resolveAll:HC,tokenize:IC};function HC(e,n){let r=-1,s,l,u,c,f,m,d,y;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(s=r;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&n.sliceSerialize(e[s][1]).charCodeAt(0)===n.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[s][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;m=e[s][1].end.offset-e[s][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[s][1].end},x={...e[r][1].start};ib(g,-m),ib(x,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[s][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:x},u={type:m>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[r][1].start}},l={type:m>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[s][1].end={...c.start},e[r][1].start={...f.end},d=[],e[s][1].end.offset-e[s][1].start.offset&&(d=ir(d,[["enter",e[s][1],n],["exit",e[s][1],n]])),d=ir(d,[["enter",l,n],["enter",c,n],["exit",c,n],["enter",u,n]]),d=ir(d,Ku(n.parser.constructs.insideSpan.null,e.slice(s+1,r),n)),d=ir(d,[["exit",u,n],["enter",f,n],["exit",f,n],["exit",l,n]]),e[r][1].end.offset-e[r][1].start.offset?(y=2,d=ir(d,[["enter",e[r][1],n],["exit",e[r][1],n]])):y=0,In(e,s-1,r-s+3,d),r=s+d.length-y-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function IC(e,n){const r=this.parser.constructs.attentionMarkers.null,s=this.previous,l=ya(s);let u;return c;function c(m){return u=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===u)return e.consume(m),f;const d=e.exit("attentionSequence"),y=ya(m),g=!y||y===2&&l||r.includes(m),x=!l||l===2&&y||r.includes(s);return d._open=!!(u===42?g:g&&(l||!x)),d._close=!!(u===42?x:x&&(y||!g)),n(m)}}function ib(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const FC={name:"autolink",tokenize:$C};function $C(e,n,r){let s=0;return l;function l(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(w){return gn(w)?(e.consume(w),c):w===64?r(w):d(w)}function c(w){return w===43||w===45||w===46||cn(w)?(s=1,f(w)):d(w)}function f(w){return w===58?(e.consume(w),s=0,m):(w===43||w===45||w===46||cn(w))&&s++<32?(e.consume(w),f):(s=0,d(w))}function m(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),n):w===null||w===32||w===60||Bu(w)?r(w):(e.consume(w),m)}function d(w){return w===64?(e.consume(w),y):MC(w)?(e.consume(w),d):r(w)}function y(w){return cn(w)?g(w):r(w)}function g(w){return w===46?(e.consume(w),s=0,y):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),n):x(w)}function x(w){if((w===45||cn(w))&&s++<63){const k=w===45?x:g;return e.consume(w),k}return r(w)}}const Vl={partial:!0,tokenize:YC};function YC(e,n,r){return s;function s(u){return Qe(u)?it(e,l,"linePrefix")(u):l(u)}function l(u){return u===null||Pe(u)?n(u):r(u)}}const Qx={continuation:{tokenize:VC},exit:JC,name:"blockQuote",tokenize:GC};function GC(e,n,r){const s=this;return l;function l(c){if(c===62){const f=s.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),u}return r(c)}function u(c){return Qe(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(c))}}function VC(e,n,r){const s=this;return l;function l(c){return Qe(c)?it(e,u,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):u(c)}function u(c){return e.attempt(Qx,n,r)(c)}}function JC(e){e.exit("blockQuote")}const Zx={name:"characterEscape",tokenize:XC};function XC(e,n,r){return s;function s(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),l}function l(u){return LC(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):r(u)}}const Wx={name:"characterReference",tokenize:KC};function KC(e,n,r){const s=this;let l=0,u,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),u=31,c=cn,y(g))}function d(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,c=DC,y):(e.enter("characterReferenceValue"),u=7,c=yd,y(g))}function y(g){if(g===59&&l){const x=e.exit("characterReferenceValue");return c===cn&&!Jd(s.sliceSerialize(x))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return c(g)&&l++<u?(e.consume(g),y):r(g)}}const sb={partial:!0,tokenize:ZC},ab={concrete:!0,name:"codeFenced",tokenize:QC};function QC(e,n,r){const s=this,l={partial:!0,tokenize:P};let u=0,c=0,f;return m;function m(z){return d(z)}function d(z){const X=s.events[s.events.length-1];return u=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,f=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(z)}function y(z){return z===f?(c++,e.consume(z),y):c<3?r(z):(e.exit("codeFencedFenceSequence"),Qe(z)?it(e,g,"whitespace")(z):g(z))}function g(z){return z===null||Pe(z)?(e.exit("codeFencedFence"),s.interrupt?n(z):e.check(sb,D,te)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(z))}function x(z){return z===null||Pe(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(z)):Qe(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,w,"whitespace")(z)):z===96&&z===f?r(z):(e.consume(z),x)}function w(z){return z===null||Pe(z)?g(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(z))}function k(z){return z===null||Pe(z)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(z)):z===96&&z===f?r(z):(e.consume(z),k)}function D(z){return e.attempt(l,te,B)(z)}function B(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),L}function L(z){return u>0&&Qe(z)?it(e,$,"linePrefix",u+1)(z):$(z)}function $(z){return z===null||Pe(z)?e.check(sb,D,te)(z):(e.enter("codeFlowValue"),T(z))}function T(z){return z===null||Pe(z)?(e.exit("codeFlowValue"),$(z)):(e.consume(z),T)}function te(z){return e.exit("codeFenced"),n(z)}function P(z,X,Z){let H=0;return O;function O(F){return z.enter("lineEnding"),z.consume(F),z.exit("lineEnding"),K}function K(F){return z.enter("codeFencedFence"),Qe(F)?it(z,J,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):J(F)}function J(F){return F===f?(z.enter("codeFencedFenceSequence"),se(F)):Z(F)}function se(F){return F===f?(H++,z.consume(F),se):H>=c?(z.exit("codeFencedFenceSequence"),Qe(F)?it(z,ie,"whitespace")(F):ie(F)):Z(F)}function ie(F){return F===null||Pe(F)?(z.exit("codeFencedFence"),X(F)):Z(F)}}}function ZC(e,n,r){const s=this;return l;function l(c){return c===null?r(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u)}function u(c){return s.parser.lazy[s.now().line]?r(c):n(c)}}const Lh={name:"codeIndented",tokenize:eA},WC={partial:!0,tokenize:tA};function eA(e,n,r){const s=this;return l;function l(d){return e.enter("codeIndented"),it(e,u,"linePrefix",5)(d)}function u(d){const y=s.events[s.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(d):r(d)}function c(d){return d===null?m(d):Pe(d)?e.attempt(WC,c,m)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Pe(d)?(e.exit("codeFlowValue"),c(d)):(e.consume(d),f)}function m(d){return e.exit("codeIndented"),n(d)}}function tA(e,n,r){const s=this;return l;function l(c){return s.parser.lazy[s.now().line]?r(c):Pe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):it(e,u,"linePrefix",5)(c)}function u(c){const f=s.events[s.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(c):Pe(c)?l(c):r(c)}}const nA={name:"codeText",previous:iA,resolve:rA,tokenize:sA};function rA(e){let n=e.length-4,r=3,s,l;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(s=r;++s<n;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[n][1].type="codeTextPadding",r+=2,n-=2;break}}for(s=r-1,n++;++s<=n;)l===void 0?s!==n&&e[s][1].type!=="lineEnding"&&(l=s):(s===n||e[s][1].type==="lineEnding")&&(e[l][1].type="codeTextData",s!==l+2&&(e[l][1].end=e[s-1][1].end,e.splice(l+2,s-l-2),n-=s-l-2,s=l+2),l=void 0);return e}function iA(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function sA(e,n,r){let s=0,l,u;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),s++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(u=e.enter("codeTextSequence"),l=0,y(g)):Pe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),d(g))}function d(g){return g===null||g===32||g===96||Pe(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),d)}function y(g){return g===96?(e.consume(g),l++,y):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),n(g)):(u.type="codeTextData",d(g))}}class aA{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,r){const s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(n,s):n>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(n,r,s){const l=r||0;this.setCursor(Math.trunc(n));const u=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&Sl(this.left,s),u.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),Sl(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Sl(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 r=this.left.splice(n,Number.POSITIVE_INFINITY);Sl(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Sl(this.left,r.reverse())}}}function Sl(e,n){let r=0;if(n.length<1e4)e.push(...n);else for(;r<n.length;)e.push(...n.slice(r,r+1e4)),r+=1e4}function e1(e){const n={};let r=-1,s,l,u,c,f,m,d;const y=new aA(e);for(;++r<y.length;){for(;r in n;)r=n[r];if(s=y.get(r),r&&s[1].type==="chunkFlow"&&y.get(r-1)[1].type==="listItemPrefix"&&(m=s[1]._tokenizer.events,u=0,u<m.length&&m[u][1].type==="lineEndingBlank"&&(u+=2),u<m.length&&m[u][1].type==="content"))for(;++u<m.length&&m[u][1].type!=="content";)m[u][1].type==="chunkText"&&(m[u][1]._isInFirstContentOfListItem=!0,u++);if(s[0]==="enter")s[1].contentType&&(Object.assign(n,lA(y,r)),r=n[r],d=!0);else if(s[1]._container){for(u=r,l=void 0;u--;)if(c=y.get(u),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=u);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(s[1].end={...y.get(l)[1].start},f=y.slice(l,r),f.unshift(s),y.splice(l,r-l+1,f))}}return In(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!d}function lA(e,n){const r=e.get(n)[1],s=e.get(n)[2];let l=n-1;const u=[];let c=r._tokenizer;c||(c=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,m=[],d={};let y,g,x=-1,w=r,k=0,D=0;const B=[D];for(;w;){for(;e.get(++l)[1]!==w;);u.push(l),w._tokenizer||(y=s.sliceStream(w),w.next||y.push(null),g&&c.defineSkip(w.start),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=r;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(D=x+1,B.push(D),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(c.events=[],w?(w._tokenizer=void 0,w.previous=void 0):B.pop(),x=B.length;x--;){const L=f.slice(B[x],B[x+1]),$=u.pop();m.push([$,$+L.length-1]),e.splice($,2,L)}for(m.reverse(),x=-1;++x<m.length;)d[k+m[x][0]]=k+m[x][1],k+=m[x][1]-m[x][0]-1;return d}const oA={resolve:cA,tokenize:fA},uA={partial:!0,tokenize:hA};function cA(e){return e1(e),e}function fA(e,n){let r;return s;function s(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?u(f):Pe(f)?e.check(uA,c,u)(f):(e.consume(f),l)}function u(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function c(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,l}}function hA(e,n,r){const s=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),it(e,u,"linePrefix")}function u(c){if(c===null||Pe(c))return r(c);const f=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(c):e.interrupt(s.parser.constructs.flow,r,n)(c)}}function t1(e,n,r,s,l,u,c,f,m){const d=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(L){return L===60?(e.enter(s),e.enter(l),e.enter(u),e.consume(L),e.exit(u),x):L===null||L===32||L===41||Bu(L)?r(L):(e.enter(s),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),D(L))}function x(L){return L===62?(e.enter(u),e.consume(L),e.exit(u),e.exit(l),e.exit(s),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),w(L))}function w(L){return L===62?(e.exit("chunkString"),e.exit(f),x(L)):L===null||L===60||Pe(L)?r(L):(e.consume(L),L===92?k:w)}function k(L){return L===60||L===62||L===92?(e.consume(L),w):w(L)}function D(L){return!y&&(L===null||L===41||Tt(L))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(s),n(L)):y<d&&L===40?(e.consume(L),y++,D):L===41?(e.consume(L),y--,D):L===null||L===32||L===40||Bu(L)?r(L):(e.consume(L),L===92?B:D)}function B(L){return L===40||L===41||L===92?(e.consume(L),D):D(L)}}function n1(e,n,r,s,l,u){const c=this;let f=0,m;return d;function d(w){return e.enter(s),e.enter(l),e.consume(w),e.exit(l),e.enter(u),y}function y(w){return f>999||w===null||w===91||w===93&&!m||w===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?r(w):w===93?(e.exit(u),e.enter(l),e.consume(w),e.exit(l),e.exit(s),n):Pe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||w===91||w===93||Pe(w)||f++>999?(e.exit("chunkString"),y(w)):(e.consume(w),m||(m=!Qe(w)),w===92?x:g)}function x(w){return w===91||w===92||w===93?(e.consume(w),f++,g):g(w)}}function r1(e,n,r,s,l,u){let c;return f;function f(x){return x===34||x===39||x===40?(e.enter(s),e.enter(l),e.consume(x),e.exit(l),c=x===40?41:x,m):r(x)}function m(x){return x===c?(e.enter(l),e.consume(x),e.exit(l),e.exit(s),n):(e.enter(u),d(x))}function d(x){return x===c?(e.exit(u),m(c)):x===null?r(x):Pe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),it(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===c||x===null||Pe(x)?(e.exit("chunkString"),d(x)):(e.consume(x),x===92?g:y)}function g(x){return x===c||x===92?(e.consume(x),y):y(x)}}function Rl(e,n){let r;return s;function s(l){return Pe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r=!0,s):Qe(l)?it(e,s,r?"linePrefix":"lineSuffix")(l):n(l)}}const dA={name:"definition",tokenize:pA},mA={partial:!0,tokenize:gA};function pA(e,n,r){const s=this;let l;return u;function u(w){return e.enter("definition"),c(w)}function c(w){return n1.call(s,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function f(w){return l=pr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),m):r(w)}function m(w){return Tt(w)?Rl(e,d)(w):d(w)}function d(w){return t1(e,y,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function y(w){return e.attempt(mA,g,g)(w)}function g(w){return Qe(w)?it(e,x,"whitespace")(w):x(w)}function x(w){return w===null||Pe(w)?(e.exit("definition"),s.parser.defined.push(l),n(w)):r(w)}}function gA(e,n,r){return s;function s(f){return Tt(f)?Rl(e,l)(f):r(f)}function l(f){return r1(e,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return Qe(f)?it(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Pe(f)?n(f):r(f)}}const yA={name:"hardBreakEscape",tokenize:bA};function bA(e,n,r){return s;function s(u){return e.enter("hardBreakEscape"),e.consume(u),l}function l(u){return Pe(u)?(e.exit("hardBreakEscape"),n(u)):r(u)}}const xA={name:"headingAtx",resolve:vA,tokenize:wA};function vA(e,n){let r=e.length-2,s=3,l,u;return e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(l={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},u={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"},In(e,s,r-s+1,[["enter",l,n],["enter",u,n],["exit",u,n],["exit",l,n]])),e}function wA(e,n,r){let s=0;return l;function l(y){return e.enter("atxHeading"),u(y)}function u(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&s++<6?(e.consume(y),c):y===null||Tt(y)?(e.exit("atxHeadingSequence"),f(y)):r(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||Pe(y)?(e.exit("atxHeading"),n(y)):Qe(y)?it(e,f,"whitespace")(y):(e.enter("atxHeadingText"),d(y))}function m(y){return y===35?(e.consume(y),m):(e.exit("atxHeadingSequence"),f(y))}function d(y){return y===null||y===35||Tt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),d)}}const SA=["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"],lb=["pre","script","style","textarea"],_A={concrete:!0,name:"htmlFlow",resolveTo:CA,tokenize:AA},EA={partial:!0,tokenize:jA},kA={partial:!0,tokenize:TA};function CA(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 AA(e,n,r){const s=this;let l,u,c,f,m;return d;function d(A){return y(A)}function y(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),g}function g(A){return A===33?(e.consume(A),x):A===47?(e.consume(A),u=!0,D):A===63?(e.consume(A),l=3,s.interrupt?n:S):gn(A)?(e.consume(A),c=String.fromCharCode(A),B):r(A)}function x(A){return A===45?(e.consume(A),l=2,w):A===91?(e.consume(A),l=5,f=0,k):gn(A)?(e.consume(A),l=4,s.interrupt?n:S):r(A)}function w(A){return A===45?(e.consume(A),s.interrupt?n:S):r(A)}function k(A){const we="CDATA[";return A===we.charCodeAt(f++)?(e.consume(A),f===we.length?s.interrupt?n:J:k):r(A)}function D(A){return gn(A)?(e.consume(A),c=String.fromCharCode(A),B):r(A)}function B(A){if(A===null||A===47||A===62||Tt(A)){const we=A===47,Ae=c.toLowerCase();return!we&&!u&&lb.includes(Ae)?(l=1,s.interrupt?n(A):J(A)):SA.includes(c.toLowerCase())?(l=6,we?(e.consume(A),L):s.interrupt?n(A):J(A)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(A):u?$(A):T(A))}return A===45||cn(A)?(e.consume(A),c+=String.fromCharCode(A),B):r(A)}function L(A){return A===62?(e.consume(A),s.interrupt?n:J):r(A)}function $(A){return Qe(A)?(e.consume(A),$):O(A)}function T(A){return A===47?(e.consume(A),O):A===58||A===95||gn(A)?(e.consume(A),te):Qe(A)?(e.consume(A),T):O(A)}function te(A){return A===45||A===46||A===58||A===95||cn(A)?(e.consume(A),te):P(A)}function P(A){return A===61?(e.consume(A),z):Qe(A)?(e.consume(A),P):T(A)}function z(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),m=A,X):Qe(A)?(e.consume(A),z):Z(A)}function X(A){return A===m?(e.consume(A),m=null,H):A===null||Pe(A)?r(A):(e.consume(A),X)}function Z(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Tt(A)?P(A):(e.consume(A),Z)}function H(A){return A===47||A===62||Qe(A)?T(A):r(A)}function O(A){return A===62?(e.consume(A),K):r(A)}function K(A){return A===null||Pe(A)?J(A):Qe(A)?(e.consume(A),K):r(A)}function J(A){return A===45&&l===2?(e.consume(A),q):A===60&&l===1?(e.consume(A),V):A===62&&l===4?(e.consume(A),M):A===63&&l===3?(e.consume(A),S):A===93&&l===5?(e.consume(A),xe):Pe(A)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(EA,W,se)(A)):A===null||Pe(A)?(e.exit("htmlFlowData"),se(A)):(e.consume(A),J)}function se(A){return e.check(kA,ie,W)(A)}function ie(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return A===null||Pe(A)?se(A):(e.enter("htmlFlowData"),J(A))}function q(A){return A===45?(e.consume(A),S):J(A)}function V(A){return A===47?(e.consume(A),c="",ue):J(A)}function ue(A){if(A===62){const we=c.toLowerCase();return lb.includes(we)?(e.consume(A),M):J(A)}return gn(A)&&c.length<8?(e.consume(A),c+=String.fromCharCode(A),ue):J(A)}function xe(A){return A===93?(e.consume(A),S):J(A)}function S(A){return A===62?(e.consume(A),M):A===45&&l===2?(e.consume(A),S):J(A)}function M(A){return A===null||Pe(A)?(e.exit("htmlFlowData"),W(A)):(e.consume(A),M)}function W(A){return e.exit("htmlFlow"),n(A)}}function TA(e,n,r){const s=this;return l;function l(c){return Pe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):r(c)}function u(c){return s.parser.lazy[s.now().line]?r(c):n(c)}}function jA(e,n,r){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Vl,n,r)}}const NA={name:"htmlText",tokenize:OA};function OA(e,n,r){const s=this;let l,u,c;return f;function f(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),m}function m(S){return S===33?(e.consume(S),d):S===47?(e.consume(S),P):S===63?(e.consume(S),T):gn(S)?(e.consume(S),Z):r(S)}function d(S){return S===45?(e.consume(S),y):S===91?(e.consume(S),u=0,k):gn(S)?(e.consume(S),$):r(S)}function y(S){return S===45?(e.consume(S),w):r(S)}function g(S){return S===null?r(S):S===45?(e.consume(S),x):Pe(S)?(c=g,V(S)):(e.consume(S),g)}function x(S){return S===45?(e.consume(S),w):g(S)}function w(S){return S===62?q(S):S===45?x(S):g(S)}function k(S){const M="CDATA[";return S===M.charCodeAt(u++)?(e.consume(S),u===M.length?D:k):r(S)}function D(S){return S===null?r(S):S===93?(e.consume(S),B):Pe(S)?(c=D,V(S)):(e.consume(S),D)}function B(S){return S===93?(e.consume(S),L):D(S)}function L(S){return S===62?q(S):S===93?(e.consume(S),L):D(S)}function $(S){return S===null||S===62?q(S):Pe(S)?(c=$,V(S)):(e.consume(S),$)}function T(S){return S===null?r(S):S===63?(e.consume(S),te):Pe(S)?(c=T,V(S)):(e.consume(S),T)}function te(S){return S===62?q(S):T(S)}function P(S){return gn(S)?(e.consume(S),z):r(S)}function z(S){return S===45||cn(S)?(e.consume(S),z):X(S)}function X(S){return Pe(S)?(c=X,V(S)):Qe(S)?(e.consume(S),X):q(S)}function Z(S){return S===45||cn(S)?(e.consume(S),Z):S===47||S===62||Tt(S)?H(S):r(S)}function H(S){return S===47?(e.consume(S),q):S===58||S===95||gn(S)?(e.consume(S),O):Pe(S)?(c=H,V(S)):Qe(S)?(e.consume(S),H):q(S)}function O(S){return S===45||S===46||S===58||S===95||cn(S)?(e.consume(S),O):K(S)}function K(S){return S===61?(e.consume(S),J):Pe(S)?(c=K,V(S)):Qe(S)?(e.consume(S),K):H(S)}function J(S){return S===null||S===60||S===61||S===62||S===96?r(S):S===34||S===39?(e.consume(S),l=S,se):Pe(S)?(c=J,V(S)):Qe(S)?(e.consume(S),J):(e.consume(S),ie)}function se(S){return S===l?(e.consume(S),l=void 0,F):S===null?r(S):Pe(S)?(c=se,V(S)):(e.consume(S),se)}function ie(S){return S===null||S===34||S===39||S===60||S===61||S===96?r(S):S===47||S===62||Tt(S)?H(S):(e.consume(S),ie)}function F(S){return S===47||S===62||Tt(S)?H(S):r(S)}function q(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),n):r(S)}function V(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),ue}function ue(S){return Qe(S)?it(e,xe,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):xe(S)}function xe(S){return e.enter("htmlTextData"),c(S)}}const Xd={name:"labelEnd",resolveAll:LA,resolveTo:zA,tokenize:UA},RA={tokenize:BA},MA={tokenize:PA},DA={tokenize:qA};function LA(e){let n=-1;const r=[];for(;++n<e.length;){const s=e[n][1];if(r.push(e[n]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const l=s.type==="labelImage"?4:2;s.type="data",n+=l}}return e.length!==r.length&&In(e,0,e.length,r),e}function zA(e,n){let r=e.length,s=0,l,u,c,f;for(;r--;)if(l=e[r][1],u){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[r][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[r][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(u=r,l.type!=="labelLink")){s=2;break}}else l.type==="labelEnd"&&(c=r);const m={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[u][1].start},end:{...e[c][1].end}},y={type:"labelText",start:{...e[u+s+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",m,n],["enter",d,n]],f=ir(f,e.slice(u+1,u+s+3)),f=ir(f,[["enter",y,n]]),f=ir(f,Ku(n.parser.constructs.insideSpan.null,e.slice(u+s+4,c-3),n)),f=ir(f,[["exit",y,n],e[c-2],e[c-1],["exit",d,n]]),f=ir(f,e.slice(c+1)),f=ir(f,[["exit",m,n]]),In(e,u,e.length,f),e}function UA(e,n,r){const s=this;let l=s.events.length,u,c;for(;l--;)if((s.events[l][1].type==="labelImage"||s.events[l][1].type==="labelLink")&&!s.events[l][1]._balanced){u=s.events[l][1];break}return f;function f(x){return u?u._inactive?g(x):(c=s.parser.defined.includes(pr(s.sliceSerialize({start:u.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),m):r(x)}function m(x){return x===40?e.attempt(RA,y,c?y:g)(x):x===91?e.attempt(MA,y,c?d:g)(x):c?y(x):g(x)}function d(x){return e.attempt(DA,y,g)(x)}function y(x){return n(x)}function g(x){return u._balanced=!0,r(x)}}function BA(e,n,r){return s;function s(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return Tt(g)?Rl(e,u)(g):u(g)}function u(g){return g===41?y(g):t1(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return Tt(g)?Rl(e,m)(g):y(g)}function f(g){return r(g)}function m(g){return g===34||g===39||g===40?r1(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function d(g){return Tt(g)?Rl(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),n):r(g)}}function PA(e,n,r){const s=this;return l;function l(f){return n1.call(s,e,u,c,"reference","referenceMarker","referenceString")(f)}function u(f){return s.parser.defined.includes(pr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?n(f):r(f)}function c(f){return r(f)}}function qA(e,n,r){return s;function s(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),l}function l(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),n):r(u)}}const HA={name:"labelStartImage",resolveAll:Xd.resolveAll,tokenize:IA};function IA(e,n,r){const s=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):r(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(f):n(f)}}const FA={name:"labelStartLink",resolveAll:Xd.resolveAll,tokenize:$A};function $A(e,n,r){const s=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),u}function u(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(c):n(c)}}const zh={name:"lineEnding",tokenize:YA};function YA(e,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),it(e,n,"linePrefix")}}const Eu={name:"thematicBreak",tokenize:GA};function GA(e,n,r){let s=0,l;return u;function u(d){return e.enter("thematicBreak"),c(d)}function c(d){return l=d,f(d)}function f(d){return d===l?(e.enter("thematicBreakSequence"),m(d)):s>=3&&(d===null||Pe(d))?(e.exit("thematicBreak"),n(d)):r(d)}function m(d){return d===l?(e.consume(d),s++,m):(e.exit("thematicBreakSequence"),Qe(d)?it(e,f,"whitespace")(d):f(d))}}const kn={continuation:{tokenize:KA},exit:ZA,name:"list",tokenize:XA},VA={partial:!0,tokenize:WA},JA={partial:!0,tokenize:QA};function XA(e,n,r){const s=this,l=s.events[s.events.length-1];let u=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(w){const k=s.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!s.containerState.marker||w===s.containerState.marker:yd(w)){if(s.containerState.type||(s.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Eu,r,d)(w):d(w);if(!s.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(w)}return r(w)}function m(w){return yd(w)&&++c<10?(e.consume(w),m):(!s.interrupt||c<2)&&(s.containerState.marker?w===s.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),d(w)):r(w)}function d(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||w,e.check(Vl,s.interrupt?r:y,e.attempt(VA,x,g))}function y(w){return s.containerState.initialBlankLine=!0,u++,x(w)}function g(w){return Qe(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),x):r(w)}function x(w){return s.containerState.size=u+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(w)}}function KA(e,n,r){const s=this;return s.containerState._closeFlow=void 0,e.check(Vl,l,u);function l(f){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,it(e,n,"listItemIndent",s.containerState.size+1)(f)}function u(f){return s.containerState.furtherBlankLines||!Qe(f)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(f)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(JA,n,c)(f))}function c(f){return s.containerState._closeFlow=!0,s.interrupt=void 0,it(e,e.attempt(kn,n,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function QA(e,n,r){const s=this;return it(e,l,"listItemIndent",s.containerState.size+1);function l(u){const c=s.events[s.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===s.containerState.size?n(u):r(u)}}function ZA(e){e.exit(this.containerState.type)}function WA(e,n,r){const s=this;return it(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(u){const c=s.events[s.events.length-1];return!Qe(u)&&c&&c[1].type==="listItemPrefixWhitespace"?n(u):r(u)}}const ob={name:"setextUnderline",resolveTo:eT,tokenize:tT};function eT(e,n){let r=e.length,s,l,u;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){s=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&e.splice(r,1),!u&&e[r][1].type==="definition"&&(u=r);const c={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",u?(e.splice(l,0,["enter",c,n]),e.splice(u+1,0,["exit",e[s][1],n]),e[s][1].end={...e[u][1].end}):e[s][1]=c,e.push(["exit",c,n]),e}function tT(e,n,r){const s=this;let l;return u;function u(d){let y=s.events.length,g;for(;y--;)if(s.events[y][1].type!=="lineEnding"&&s.events[y][1].type!=="linePrefix"&&s.events[y][1].type!=="content"){g=s.events[y][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||g)?(e.enter("setextHeadingLine"),l=d,c(d)):r(d)}function c(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===l?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),Qe(d)?it(e,m,"lineSuffix")(d):m(d))}function m(d){return d===null||Pe(d)?(e.exit("setextHeadingLine"),n(d)):r(d)}}const nT={tokenize:rT};function rT(e){const n=this,r=e.attempt(Vl,s,e.attempt(this.parser.constructs.flowInitial,l,it(e,e.attempt(this.parser.constructs.flow,l,e.attempt(oA,l)),"linePrefix")));return r;function s(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),n.currentConstruct=void 0,r}function l(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),n.currentConstruct=void 0,r}}const iT={resolveAll:s1()},sT=i1("string"),aT=i1("text");function i1(e){return{resolveAll:s1(e==="text"?lT:void 0),tokenize:n};function n(r){const s=this,l=this.parser.constructs[e],u=r.attempt(l,c,f);return c;function c(y){return d(y)?u(y):f(y)}function f(y){if(y===null){r.consume(y);return}return r.enter("data"),r.consume(y),m}function m(y){return d(y)?(r.exit("data"),u(y)):(r.consume(y),m)}function d(y){if(y===null)return!0;const g=l[y];let x=-1;if(g)for(;++x<g.length;){const w=g[x];if(!w.previous||w.previous.call(s,s.previous))return!0}return!1}}}function s1(e){return n;function n(r,s){let l=-1,u;for(;++l<=r.length;)u===void 0?r[l]&&r[l][1].type==="data"&&(u=l,l++):(!r[l]||r[l][1].type!=="data")&&(l!==u+2&&(r[u][1].end=r[l-1][1].end,r.splice(u+2,l-u-2),l=u+2),u=void 0);return e?e(r,s):r}}function lT(e,n){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const s=e[r-1][1],l=n.sliceStream(s);let u=l.length,c=-1,f=0,m;for(;u--;){const d=l[u];if(typeof d=="string"){for(c=d.length;d.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(d===-2)m=!0,f++;else if(d!==-1){u++;break}}if(n._contentTypeTextTrailing&&r===e.length&&(f=0),f){const d={type:r===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?c:s.start._bufferIndex+c,_index:s.start._index+u,line:s.end.line,column:s.end.column-f,offset:s.end.offset-f},end:{...s.end}};s.end={...d.start},s.start.offset===s.end.offset?Object.assign(s,d):(e.splice(r,0,["enter",d,n],["exit",d,n]),r+=2)}r++}return e}const oT={42:kn,43:kn,45:kn,48:kn,49:kn,50:kn,51:kn,52:kn,53:kn,54:kn,55:kn,56:kn,57:kn,62:Qx},uT={91:dA},cT={[-2]:Lh,[-1]:Lh,32:Lh},fT={35:xA,42:Eu,45:[ob,Eu],60:_A,61:ob,95:Eu,96:ab,126:ab},hT={38:Wx,92:Zx},dT={[-5]:zh,[-4]:zh,[-3]:zh,33:HA,38:Wx,42:bd,60:[FC,NA],91:FA,92:[yA,Zx],93:Xd,95:bd,96:nA},mT={null:[bd,iT]},pT={null:[42,95]},gT={null:[]},yT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:pT,contentInitial:uT,disable:gT,document:oT,flow:fT,flowInitial:cT,insideSpan:mT,string:hT,text:dT},Symbol.toStringTag,{value:"Module"}));function bT(e,n,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const l={},u=[];let c=[],f=[];const m={attempt:X(P),check:X(z),consume:$,enter:T,exit:te,interrupt:X(z,{interrupt:!0})},d={code:null,containerState:{},defineSkip:D,events:[],now:k,parser:e,previous:null,sliceSerialize:x,sliceStream:w,write:g};let y=n.tokenize.call(d,m);return n.resolveAll&&u.push(n),d;function g(K){return c=ir(c,K),B(),c[c.length-1]!==null?[]:(Z(n,0),d.events=Ku(u,d.events,d),d.events)}function x(K,J){return vT(w(K),J)}function w(K){return xT(c,K)}function k(){const{_bufferIndex:K,_index:J,line:se,column:ie,offset:F}=s;return{_bufferIndex:K,_index:J,line:se,column:ie,offset:F}}function D(K){l[K.line]=K.column,O()}function B(){let K;for(;s._index<c.length;){const J=c[s._index];if(typeof J=="string")for(K=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===K&&s._bufferIndex<J.length;)L(J.charCodeAt(s._bufferIndex));else L(J)}}function L(K){y=y(K)}function $(K){Pe(K)?(s.line++,s.column=1,s.offset+=K===-3?2:1,O()):K!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===c[s._index].length&&(s._bufferIndex=-1,s._index++)),d.previous=K}function T(K,J){const se=J||{};return se.type=K,se.start=k(),d.events.push(["enter",se,d]),f.push(se),se}function te(K){const J=f.pop();return J.end=k(),d.events.push(["exit",J,d]),J}function P(K,J){Z(K,J.from)}function z(K,J){J.restore()}function X(K,J){return se;function se(ie,F,q){let V,ue,xe,S;return Array.isArray(ie)?W(ie):"tokenize"in ie?W([ie]):M(ie);function M(Te){return Me;function Me(He){const be=He!==null&&Te[He],De=He!==null&&Te.null,Ze=[...Array.isArray(be)?be:be?[be]:[],...Array.isArray(De)?De:De?[De]:[]];return W(Ze)(He)}}function W(Te){return V=Te,ue=0,Te.length===0?q:A(Te[ue])}function A(Te){return Me;function Me(He){return S=H(),xe=Te,Te.partial||(d.currentConstruct=Te),Te.name&&d.parser.constructs.disable.null.includes(Te.name)?Ae():Te.tokenize.call(J?Object.assign(Object.create(d),J):d,m,we,Ae)(He)}}function we(Te){return K(xe,S),F}function Ae(Te){return S.restore(),++ue<V.length?A(V[ue]):q}}}function Z(K,J){K.resolveAll&&!u.includes(K)&&u.push(K),K.resolve&&In(d.events,J,d.events.length-J,K.resolve(d.events.slice(J),d)),K.resolveTo&&(d.events=K.resolveTo(d.events,d))}function H(){const K=k(),J=d.previous,se=d.currentConstruct,ie=d.events.length,F=Array.from(f);return{from:ie,restore:q};function q(){s=K,d.previous=J,d.currentConstruct=se,d.events.length=ie,f=F,O()}}function O(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function xT(e,n){const r=n.start._index,s=n.start._bufferIndex,l=n.end._index,u=n.end._bufferIndex;let c;if(r===l)c=[e[r].slice(s,u)];else{if(c=e.slice(r,l),s>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(s):c.shift()}u>0&&c.push(e[l].slice(0,u))}return c}function vT(e,n){let r=-1;const s=[];let l;for(;++r<e.length;){const u=e[r];let c;if(typeof u=="string")c=u;else switch(u){case-5:{c="\r";break}case-4:{c=`
94
+ `;break}case-3:{c=`\r
95
+ `;break}case-2:{c=n?" ":" ";break}case-1:{if(!n&&l)continue;c=" ";break}default:c=String.fromCharCode(u)}l=u===-2,s.push(c)}return s.join("")}function wT(e){const s={constructs:Xx([yT,...(e||{}).extensions||[]]),content:l(zC),defined:[],document:l(BC),flow:l(nT),lazy:{},string:l(sT),text:l(aT)};return s;function l(u){return c;function c(f){return bT(s,u,f)}}}function ST(e){for(;!e1(e););return e}const ub=/[\0\t\n\r]/g;function _T(){let e=1,n="",r=!0,s;return l;function l(u,c,f){const m=[];let d,y,g,x,w;for(u=n+(typeof u=="string"?u.toString():new TextDecoder(c||void 0).decode(u)),g=0,n="",r&&(u.charCodeAt(0)===65279&&g++,r=void 0);g<u.length;){if(ub.lastIndex=g,d=ub.exec(u),x=d&&d.index!==void 0?d.index:u.length,w=u.charCodeAt(x),!d){n=u.slice(g);break}if(w===10&&g===x&&s)m.push(-3),s=void 0;else switch(s&&(m.push(-5),s=void 0),g<x&&(m.push(u.slice(g,x)),e+=x-g),w){case 0:{m.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,m.push(-2);e++<y;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:s=!0,e=1}g=x+1}return f&&(s&&m.push(-5),n&&m.push(n),m.push(null)),m}}const ET=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function kT(e){return e.replace(ET,CT)}function CT(e,n,r){if(n)return n;if(r.charCodeAt(0)===35){const l=r.charCodeAt(1),u=l===120||l===88;return Kx(r.slice(u?2:1),u?16:10)}return Jd(r)||e}const a1={}.hasOwnProperty;function AT(e,n,r){return n&&typeof n=="object"&&(r=n,n=void 0),TT(r)(ST(wT(r).document().write(_T()(e,n,!0))))}function TT(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(st),autolinkProtocol:H,autolinkEmail:H,atxHeading:u(Fe),blockQuote:u(De),characterEscape:H,characterReference:H,codeFenced:u(Ze),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:u(Ze,c),codeText:u(dt,c),codeTextData:H,data:H,codeFlowValue:H,definition:u(lt),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:u(ct),hardBreakEscape:u(Ue),hardBreakTrailing:u(Ue),htmlFlow:u(tt,c),htmlFlowData:H,htmlText:u(tt,c),htmlTextData:H,image:u(mt),label:c,link:u(st),listItem:u(yt),listItemValue:x,listOrdered:u(Mt,g),listUnordered:u(Mt),paragraph:u(Yn),reference:A,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:u(Fe),strong:u(gr),thematicBreak:u(An)},exit:{atxHeading:m(),atxHeadingSequence:P,autolink:m(),autolinkEmail:be,autolinkProtocol:He,blockQuote:m(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:Ae,characterReferenceMarkerNumeric:Ae,characterReferenceValue:Te,characterReference:Me,codeFenced:m(B),codeFencedFence:D,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:O,codeIndented:m(L),codeText:m(F),codeTextData:O,data:O,definition:m(),definitionDestinationString:te,definitionLabelString:$,definitionTitleString:T,emphasis:m(),hardBreakEscape:m(J),hardBreakTrailing:m(J),htmlFlow:m(se),htmlFlowData:O,htmlText:m(ie),htmlTextData:O,image:m(V),label:xe,labelText:ue,lineEnding:K,link:m(q),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:we,resourceDestinationString:S,resourceTitleString:M,resource:W,setextHeading:m(Z),setextHeadingLineSequence:X,setextHeadingText:z,strong:m(),thematicBreak:m()}};l1(n,(e||{}).mdastExtensions||[]);const r={};return s;function s(fe){let Se={type:"root",children:[]};const Be={stack:[Se],tokenStack:[],config:n,enter:f,exit:d,buffer:c,resume:y,data:r},$e=[];let rt=-1;for(;++rt<fe.length;)if(fe[rt][1].type==="listOrdered"||fe[rt][1].type==="listUnordered")if(fe[rt][0]==="enter")$e.push(rt);else{const nn=$e.pop();rt=l(fe,nn,rt)}for(rt=-1;++rt<fe.length;){const nn=n[fe[rt][0]];a1.call(nn,fe[rt][1].type)&&nn[fe[rt][1].type].call(Object.assign({sliceSerialize:fe[rt][2].sliceSerialize},Be),fe[rt][1])}if(Be.tokenStack.length>0){const nn=Be.tokenStack[Be.tokenStack.length-1];(nn[1]||cb).call(Be,void 0,nn[0])}for(Se.position={start:Ri(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:Ri(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<n.transforms.length;)Se=n.transforms[rt](Se)||Se;return Se}function l(fe,Se,Be){let $e=Se-1,rt=-1,nn=!1,bn,Yt,ge,ze;for(;++$e<=Be;){const _e=fe[$e];switch(_e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{_e[0]==="enter"?rt++:rt--,ze=void 0;break}case"lineEndingBlank":{_e[0]==="enter"&&(bn&&!ze&&!rt&&!ge&&(ge=$e),ze=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ze=void 0}if(!rt&&_e[0]==="enter"&&_e[1].type==="listItemPrefix"||rt===-1&&_e[0]==="exit"&&(_e[1].type==="listUnordered"||_e[1].type==="listOrdered")){if(bn){let ft=$e;for(Yt=void 0;ft--;){const pt=fe[ft];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;Yt&&(fe[Yt][1].type="lineEndingBlank",nn=!0),pt[1].type="lineEnding",Yt=ft}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarker"||pt[1].type==="listItemIndent"))break}ge&&(!Yt||ge<Yt)&&(bn._spread=!0),bn.end=Object.assign({},Yt?fe[Yt][1].start:_e[1].end),fe.splice(Yt||$e,0,["exit",bn,_e[2]]),$e++,Be++}if(_e[1].type==="listItemPrefix"){const ft={type:"listItem",_spread:!1,start:Object.assign({},_e[1].start),end:void 0};bn=ft,fe.splice($e,0,["enter",ft,_e[2]]),$e++,Be++,ge=void 0,ze=!0}}}return fe[Se][1]._spread=nn,Be}function u(fe,Se){return Be;function Be($e){f.call(this,fe($e),$e),Se&&Se.call(this,$e)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(fe,Se,Be){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([Se,Be||void 0]),fe.position={start:Ri(Se.start),end:void 0}}function m(fe){return Se;function Se(Be){fe&&fe.call(this,Be),d.call(this,Be)}}function d(fe,Se){const Be=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==fe.type&&(Se?Se.call(this,fe,$e[0]):($e[1]||cb).call(this,fe,$e[0]));else throw new Error("Cannot close `"+fe.type+"` ("+Ol({start:fe.start,end:fe.end})+"): it’s not open");Be.position.end=Ri(fe.end)}function y(){return Vd(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(fe){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=fe}function k(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=fe}function D(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function B(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function L(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe.replace(/(\r?\n|\r)$/g,"")}function $(fe){const Se=this.resume(),Be=this.stack[this.stack.length-1];Be.label=Se,Be.identifier=pr(this.sliceSerialize(fe)).toLowerCase()}function T(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=fe}function te(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=fe}function P(fe){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Be=this.sliceSerialize(fe).length;Se.depth=Be}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function X(fe){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function H(fe){const Be=this.stack[this.stack.length-1].children;let $e=Be[Be.length-1];(!$e||$e.type!=="text")&&($e=vt(),$e.position={start:Ri(fe.start),end:void 0},Be.push($e)),this.stack.push($e)}function O(fe){const Se=this.stack.pop();Se.value+=this.sliceSerialize(fe),Se.position.end=Ri(fe.end)}function K(fe){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Be=Se.children[Se.children.length-1];Be.position.end=Ri(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(Se.type)&&(H.call(this,fe),O.call(this,fe))}function J(){this.data.atHardBreak=!0}function se(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function ie(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function F(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function q(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Se,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function V(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Se,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function ue(fe){const Se=this.sliceSerialize(fe),Be=this.stack[this.stack.length-2];Be.label=kT(Se),Be.identifier=pr(Se).toLowerCase()}function xe(){const fe=this.stack[this.stack.length-1],Se=this.resume(),Be=this.stack[this.stack.length-1];if(this.data.inReference=!0,Be.type==="link"){const $e=fe.children;Be.children=$e}else Be.alt=Se}function S(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=fe}function M(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=fe}function W(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function we(fe){const Se=this.resume(),Be=this.stack[this.stack.length-1];Be.label=Se,Be.identifier=pr(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function Ae(fe){this.data.characterReferenceType=fe.type}function Te(fe){const Se=this.sliceSerialize(fe),Be=this.data.characterReferenceType;let $e;Be?($e=Kx(Se,Be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=Jd(Se);const rt=this.stack[this.stack.length-1];rt.value+=$e}function Me(fe){const Se=this.stack.pop();Se.position.end=Ri(fe.end)}function He(fe){O.call(this,fe);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(fe)}function be(fe){O.call(this,fe);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(fe)}function De(){return{type:"blockquote",children:[]}}function Ze(){return{type:"code",lang:null,meta:null,value:""}}function dt(){return{type:"inlineCode",value:""}}function lt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ct(){return{type:"emphasis",children:[]}}function Fe(){return{type:"heading",depth:0,children:[]}}function Ue(){return{type:"break"}}function tt(){return{type:"html",value:""}}function mt(){return{type:"image",title:null,url:"",alt:null}}function st(){return{type:"link",title:null,url:"",children:[]}}function Mt(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function yt(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function Yn(){return{type:"paragraph",children:[]}}function gr(){return{type:"strong",children:[]}}function vt(){return{type:"text",value:""}}function An(){return{type:"thematicBreak"}}}function Ri(e){return{line:e.line,column:e.column,offset:e.offset}}function l1(e,n){let r=-1;for(;++r<n.length;){const s=n[r];Array.isArray(s)?l1(e,s):jT(e,s)}}function jT(e,n){let r;for(r in n)if(a1.call(n,r))switch(r){case"canContainEols":{const s=n[r];s&&e[r].push(...s);break}case"transforms":{const s=n[r];s&&e[r].push(...s);break}case"enter":case"exit":{const s=n[r];s&&Object.assign(e[r],s);break}}}function cb(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Ol({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Ol({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Ol({start:n.start,end:n.end})+") is still open")}function NT(e){const n=this;n.parser=r;function r(s){return AT(s,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function OT(e,n){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,r),e.applyData(n,r)}function RT(e,n){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,r),[e.applyData(n,r),{type:"text",value:`
96
+ `}]}function MT(e,n){const r=n.value?n.value+`
97
+ `:"",s={},l=n.lang?n.lang.split(/\s+/):[];l.length>0&&(s.className=["language-"+l[0]]);let u={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return n.meta&&(u.data={meta:n.meta}),e.patch(n,u),u=e.applyData(n,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(n,u),u}function DT(e,n){const r={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function LT(e,n){const r={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function zT(e,n){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(n.identifier).toUpperCase(),l=Ea(s.toLowerCase()),u=e.footnoteOrder.indexOf(s);let c,f=e.footnoteCounts.get(s);f===void 0?(f=0,e.footnoteOrder.push(s),c=e.footnoteOrder.length):c=u+1,f+=1,e.footnoteCounts.set(s,f);const m={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(n,m);const d={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(n,d),e.applyData(n,d)}function UT(e,n){const r={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function BT(e,n){if(e.options.allowDangerousHtml){const r={type:"raw",value:n.value};return e.patch(n,r),e.applyData(n,r)}}function o1(e,n){const r=n.referenceType;let s="]";if(r==="collapsed"?s+="[]":r==="full"&&(s+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+s}];const l=e.all(n),u=l[0];u&&u.type==="text"?u.value="["+u.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=s:l.push({type:"text",value:s}),l}function PT(e,n){const r=String(n.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return o1(e,n);const l={src:Ea(s.url||""),alt:n.alt};s.title!==null&&s.title!==void 0&&(l.title=s.title);const u={type:"element",tagName:"img",properties:l,children:[]};return e.patch(n,u),e.applyData(n,u)}function qT(e,n){const r={src:Ea(n.url)};n.alt!==null&&n.alt!==void 0&&(r.alt=n.alt),n.title!==null&&n.title!==void 0&&(r.title=n.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(n,s),e.applyData(n,s)}function HT(e,n){const r={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,r);const s={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(n,s),e.applyData(n,s)}function IT(e,n){const r=String(n.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return o1(e,n);const l={href:Ea(s.url||"")};s.title!==null&&s.title!==void 0&&(l.title=s.title);const u={type:"element",tagName:"a",properties:l,children:e.all(n)};return e.patch(n,u),e.applyData(n,u)}function FT(e,n){const r={href:Ea(n.url)};n.title!==null&&n.title!==void 0&&(r.title=n.title);const s={type:"element",tagName:"a",properties:r,children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function $T(e,n,r){const s=e.all(n),l=r?YT(r):u1(n),u={},c=[];if(typeof n.checked=="boolean"){const y=s[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},s.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:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<s.length;){const y=s[f];(l||f!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
98
+ `}),y.type==="element"&&y.tagName==="p"&&!l?c.push(...y.children):c.push(y)}const m=s[s.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
99
+ `});const d={type:"element",tagName:"li",properties:u,children:c};return e.patch(n,d),e.applyData(n,d)}function YT(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const r=e.children;let s=-1;for(;!n&&++s<r.length;)n=u1(r[s])}return n}function u1(e){const n=e.spread;return n??e.children.length>1}function GT(e,n){const r={},s=e.all(n);let l=-1;for(typeof n.start=="number"&&n.start!==1&&(r.start=n.start);++l<s.length;){const c=s[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const u={type:"element",tagName:n.ordered?"ol":"ul",properties:r,children:e.wrap(s,!0)};return e.patch(n,u),e.applyData(n,u)}function VT(e,n){const r={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function JT(e,n){const r={type:"root",children:e.wrap(e.all(n))};return e.patch(n,r),e.applyData(n,r)}function XT(e,n){const r={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function KT(e,n){const r=e.all(n),s=r.shift(),l=[];if(s){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(n.children[0],c),l.push(c)}if(r.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Fd(n.children[1]),m=Ix(n.children[n.children.length-1]);f&&m&&(c.position={start:f,end:m}),l.push(c)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(n,u),e.applyData(n,u)}function QT(e,n,r){const s=r?r.children:void 0,u=(s?s.indexOf(n):1)===0?"th":"td",c=r&&r.type==="table"?r.align:void 0,f=c?c.length:n.children.length;let m=-1;const d=[];for(;++m<f;){const g=n.children[m],x={},w=c?c[m]:void 0;w&&(x.align=w);let k={type:"element",tagName:u,properties:x,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),d.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(n,y),e.applyData(n,y)}function ZT(e,n){const r={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}const fb=9,hb=32;function WT(e){const n=String(e),r=/\r?\n|\r/g;let s=r.exec(n),l=0;const u=[];for(;s;)u.push(db(n.slice(l,s.index),l>0,!0),s[0]),l=s.index+s[0].length,s=r.exec(n);return u.push(db(n.slice(l),l>0,!1)),u.join("")}function db(e,n,r){let s=0,l=e.length;if(n){let u=e.codePointAt(s);for(;u===fb||u===hb;)s++,u=e.codePointAt(s)}if(r){let u=e.codePointAt(l-1);for(;u===fb||u===hb;)l--,u=e.codePointAt(l-1)}return l>s?e.slice(s,l):""}function ej(e,n){const r={type:"text",value:WT(String(n.value))};return e.patch(n,r),e.applyData(n,r)}function tj(e,n){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,r),e.applyData(n,r)}const nj={blockquote:OT,break:RT,code:MT,delete:DT,emphasis:LT,footnoteReference:zT,heading:UT,html:BT,imageReference:PT,image:qT,inlineCode:HT,linkReference:IT,link:FT,listItem:$T,list:GT,paragraph:VT,root:JT,strong:XT,table:KT,tableCell:ZT,tableRow:QT,text:ej,thematicBreak:tj,toml:gu,yaml:gu,definition:gu,footnoteDefinition:gu};function gu(){}const c1=-1,Qu=0,Ml=1,Pu=2,Kd=3,Qd=4,Zd=5,Wd=6,f1=7,h1=8,mb=typeof self=="object"?self:globalThis,rj=(e,n)=>{const r=(l,u)=>(e.set(u,l),l),s=l=>{if(e.has(l))return e.get(l);const[u,c]=n[l];switch(u){case Qu:case c1:return r(c,l);case Ml:{const f=r([],l);for(const m of c)f.push(s(m));return f}case Pu:{const f=r({},l);for(const[m,d]of c)f[s(m)]=s(d);return f}case Kd:return r(new Date(c),l);case Qd:{const{source:f,flags:m}=c;return r(new RegExp(f,m),l)}case Zd:{const f=r(new Map,l);for(const[m,d]of c)f.set(s(m),s(d));return f}case Wd:{const f=r(new Set,l);for(const m of c)f.add(s(m));return f}case f1:{const{name:f,message:m}=c;return r(new mb[f](m),l)}case h1:return r(BigInt(c),l);case"BigInt":return r(Object(BigInt(c)),l);case"ArrayBuffer":return r(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return r(new DataView(f),c)}}return r(new mb[u](c),l)};return s},pb=e=>rj(new Map,e)(0),Ws="",{toString:ij}={},{keys:sj}=Object,_l=e=>{const n=typeof e;if(n!=="object"||!e)return[Qu,n];const r=ij.call(e).slice(8,-1);switch(r){case"Array":return[Ml,Ws];case"Object":return[Pu,Ws];case"Date":return[Kd,Ws];case"RegExp":return[Qd,Ws];case"Map":return[Zd,Ws];case"Set":return[Wd,Ws];case"DataView":return[Ml,r]}return r.includes("Array")?[Ml,r]:r.includes("Error")?[f1,r]:[Pu,r]},yu=([e,n])=>e===Qu&&(n==="function"||n==="symbol"),aj=(e,n,r,s)=>{const l=(c,f)=>{const m=s.push(c)-1;return r.set(f,m),m},u=c=>{if(r.has(c))return r.get(c);let[f,m]=_l(c);switch(f){case Qu:{let y=c;switch(m){case"bigint":f=h1,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([c1],c)}return l([f,y],c)}case Ml:{if(m){let x=c;return m==="DataView"?x=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(x=new Uint8Array(c)),l([m,[...x]],c)}const y=[],g=l([f,y],c);for(const x of c)y.push(u(x));return g}case Pu:{if(m)switch(m){case"BigInt":return l([m,c.toString()],c);case"Boolean":case"Number":case"String":return l([m,c.valueOf()],c)}if(n&&"toJSON"in c)return u(c.toJSON());const y=[],g=l([f,y],c);for(const x of sj(c))(e||!yu(_l(c[x])))&&y.push([u(x),u(c[x])]);return g}case Kd:return l([f,c.toISOString()],c);case Qd:{const{source:y,flags:g}=c;return l([f,{source:y,flags:g}],c)}case Zd:{const y=[],g=l([f,y],c);for(const[x,w]of c)(e||!(yu(_l(x))||yu(_l(w))))&&y.push([u(x),u(w)]);return g}case Wd:{const y=[],g=l([f,y],c);for(const x of c)(e||!yu(_l(x)))&&y.push(u(x));return g}}const{message:d}=c;return l([f,{name:m,message:d}],c)};return u},gb=(e,{json:n,lossy:r}={})=>{const s=[];return aj(!(n||r),!!n,new Map,s)(e),s},qu=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?pb(gb(e,n)):structuredClone(e):(e,n)=>pb(gb(e,n));function lj(e,n){const r=[{type:"text",value:"↩"}];return n>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),r}function oj(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function uj(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||lj,s=e.options.footnoteBackLabel||oj,l=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[m]);if(!d)continue;const y=e.all(d),g=String(d.identifier).toUpperCase(),x=Ea(g.toLowerCase());let w=0;const k=[],D=e.footnoteCounts.get(g);for(;D!==void 0&&++w<=D;){k.length>0&&k.push({type:"text",value:" "});let $=typeof r=="string"?r:r(m,w);typeof $=="string"&&($={type:"text",value:$}),k.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(m,w),className:["data-footnote-backref"]},children:Array.isArray($)?$:[$]})}const B=y[y.length-1];if(B&&B.type==="element"&&B.tagName==="p"){const $=B.children[B.children.length-1];$&&$.type==="text"?$.value+=" ":B.children.push({type:"text",value:" "}),B.children.push(...k)}else y.push(...k);const L={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(y,!0)};e.patch(d,L),f.push(L)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...qu(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
100
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
101
+ `}]}}const Zu=(function(e){if(e==null)return dj;if(typeof e=="function")return Wu(e);if(typeof e=="object")return Array.isArray(e)?cj(e):fj(e);if(typeof e=="string")return hj(e);throw new Error("Expected function, string, or object as test")});function cj(e){const n=[];let r=-1;for(;++r<e.length;)n[r]=Zu(e[r]);return Wu(s);function s(...l){let u=-1;for(;++u<n.length;)if(n[u].apply(this,l))return!0;return!1}}function fj(e){const n=e;return Wu(r);function r(s){const l=s;let u;for(u in e)if(l[u]!==n[u])return!1;return!0}}function hj(e){return Wu(n);function n(r){return r&&r.type===e}}function Wu(e){return n;function n(r,s,l){return!!(mj(r)&&e.call(this,r,typeof s=="number"?s:void 0,l||void 0))}}function dj(){return!0}function mj(e){return e!==null&&typeof e=="object"&&"type"in e}const d1=[],pj=!0,xd=!1,gj="skip";function m1(e,n,r,s){let l;typeof n=="function"&&typeof r!="function"?(s=r,r=n):l=n;const u=Zu(l),c=s?-1:1;f(e,void 0,[])();function f(m,d,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const w=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(m.type+(w?"<"+w+">":""))+")"})}return x;function x(){let w=d1,k,D,B;if((!n||u(m,d,y[y.length-1]||void 0))&&(w=yj(r(m,y)),w[0]===xd))return w;if("children"in m&&m.children){const L=m;if(L.children&&w[0]!==gj)for(D=(s?L.children.length:-1)+c,B=y.concat(L);D>-1&&D<L.children.length;){const $=L.children[D];if(k=f($,D,B)(),k[0]===xd)return k;D=typeof k[1]=="number"?k[1]:D+c}}return w}}}function yj(e){return Array.isArray(e)?e:typeof e=="number"?[pj,e]:e==null?d1:[e]}function em(e,n,r,s){let l,u,c;typeof n=="function"&&typeof r!="function"?(u=void 0,c=n,l=r):(u=n,c=r,l=s),m1(e,u,f,l);function f(m,d){const y=d[d.length-1],g=y?y.children.indexOf(m):void 0;return c(m,g,y)}}const vd={}.hasOwnProperty,bj={};function xj(e,n){const r=n||bj,s=new Map,l=new Map,u=new Map,c={...nj,...r.handlers},f={all:d,applyData:wj,definitionById:s,footnoteById:l,footnoteCounts:u,footnoteOrder:[],handlers:c,one:m,options:r,patch:vj,wrap:_j};return em(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?s:l,x=String(y.identifier).toUpperCase();g.has(x)||g.set(x,y)}}),f;function m(y,g){const x=y.type,w=f.handlers[x];if(vd.call(f.handlers,x)&&w)return w(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in y){const{children:D,...B}=y,L=qu(B);return L.children=f.all(y),L}return qu(y)}return(f.options.unknownHandler||Sj)(f,y,g)}function d(y){const g=[];if("children"in y){const x=y.children;let w=-1;for(;++w<x.length;){const k=f.one(x[w],y);if(k){if(w&&x[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=yb(k.value)),!Array.isArray(k)&&k.type==="element")){const D=k.children[0];D&&D.type==="text"&&(D.value=yb(D.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function vj(e,n){e.position&&(n.position=oC(e))}function wj(e,n){let r=n;if(e&&e.data){const s=e.data.hName,l=e.data.hChildren,u=e.data.hProperties;if(typeof s=="string")if(r.type==="element")r.tagName=s;else{const c="children"in r?r.children:[r];r={type:"element",tagName:s,properties:{},children:c}}r.type==="element"&&u&&Object.assign(r.properties,qu(u)),"children"in r&&r.children&&l!==null&&l!==void 0&&(r.children=l)}return r}function Sj(e,n){const r=n.data||{},s="value"in n&&!(vd.call(r,"hProperties")||vd.call(r,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function _j(e,n){const r=[];let s=-1;for(n&&r.push({type:"text",value:`
102
+ `});++s<e.length;)s&&r.push({type:"text",value:`
103
+ `}),r.push(e[s]);return n&&e.length>0&&r.push({type:"text",value:`
104
+ `}),r}function yb(e){let n=0,r=e.charCodeAt(n);for(;r===9||r===32;)n++,r=e.charCodeAt(n);return e.slice(n)}function bb(e,n){const r=xj(e,n),s=r.one(e,void 0),l=uj(r),u=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&u.children.push({type:"text",value:`
105
+ `},l),u}function Ej(e,n){return e&&"run"in e?async function(r,s){const l=bb(r,{file:s,...n});await e.run(l,s)}:function(r,s){return bb(r,{file:s,...e||n})}}function xb(e){if(e)throw e}var Uh,vb;function kj(){if(vb)return Uh;vb=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=function(d){return typeof Array.isArray=="function"?Array.isArray(d):n.call(d)==="[object Array]"},u=function(d){if(!d||n.call(d)!=="[object Object]")return!1;var y=e.call(d,"constructor"),g=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!y&&!g)return!1;var x;for(x in d);return typeof x>"u"||e.call(d,x)},c=function(d,y){r&&y.name==="__proto__"?r(d,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):d[y.name]=y.newValue},f=function(d,y){if(y==="__proto__")if(e.call(d,y)){if(s)return s(d,y).value}else return;return d[y]};return Uh=function m(){var d,y,g,x,w,k,D=arguments[0],B=1,L=arguments.length,$=!1;for(typeof D=="boolean"&&($=D,D=arguments[1]||{},B=2),(D==null||typeof D!="object"&&typeof D!="function")&&(D={});B<L;++B)if(d=arguments[B],d!=null)for(y in d)g=f(D,y),x=f(d,y),D!==x&&($&&x&&(u(x)||(w=l(x)))?(w?(w=!1,k=g&&l(g)?g:[]):k=g&&u(g)?g:{},c(D,{name:y,newValue:m($,k,x)})):typeof x<"u"&&c(D,{name:y,newValue:x}));return D},Uh}var Cj=kj();const Bh=zb(Cj);function wd(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 Aj(){const e=[],n={run:r,use:s};return n;function r(...l){let u=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(m,...d){const y=e[++u];let g=-1;if(m){c(m);return}for(;++g<l.length;)(d[g]===null||d[g]===void 0)&&(d[g]=l[g]);l=d,y?Tj(y,f)(...d):c(null,...d)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),n}}function Tj(e,n){let r;return s;function s(...c){const f=e.length>c.length;let m;f&&c.push(l);try{m=e.apply(this,c)}catch(d){const y=d;if(f&&r)throw y;return l(y)}f||(m&&m.then&&typeof m.then=="function"?m.then(u,l):m instanceof Error?l(m):u(m))}function l(c,...f){r||(r=!0,n(c,...f))}function u(c){l(null,c)}}const Sr={basename:jj,dirname:Nj,extname:Oj,join:Rj,sep:"/"};function jj(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Jl(e);let r=0,s=-1,l=e.length,u;if(n===void 0||n.length===0||n.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(u){r=l+1;break}}else s<0&&(u=!0,s=l+1);return s<0?"":e.slice(r,s)}if(n===e)return"";let c=-1,f=n.length-1;for(;l--;)if(e.codePointAt(l)===47){if(u){r=l+1;break}}else c<0&&(u=!0,c=l+1),f>-1&&(e.codePointAt(l)===n.codePointAt(f--)?f<0&&(s=l):(f=-1,s=c));return r===s?s=c:s<0&&(s=e.length),e.slice(r,s)}function Nj(e){if(Jl(e),e.length===0)return".";let n=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){n=r;break}}else s||(s=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Oj(e){Jl(e);let n=e.length,r=-1,s=0,l=-1,u=0,c;for(;n--;){const f=e.codePointAt(n);if(f===47){if(c){s=n+1;break}continue}r<0&&(c=!0,r=n+1),f===46?l<0?l=n:u!==1&&(u=1):l>-1&&(u=-1)}return l<0||r<0||u===0||u===1&&l===r-1&&l===s+1?"":e.slice(l,r)}function Rj(...e){let n=-1,r;for(;++n<e.length;)Jl(e[n]),e[n]&&(r=r===void 0?e[n]:r+"/"+e[n]);return r===void 0?".":Mj(r)}function Mj(e){Jl(e);const n=e.codePointAt(0)===47;let r=Dj(e,!n);return r.length===0&&!n&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),n?"/"+r:r}function Dj(e,n){let r="",s=0,l=-1,u=0,c=-1,f,m;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||u===1))if(l!==c-1&&u===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(m=r.lastIndexOf("/"),m!==r.length-1){m<0?(r="",s=0):(r=r.slice(0,m),s=r.length-1-r.lastIndexOf("/")),l=c,u=0;continue}}else if(r.length>0){r="",s=0,l=c,u=0;continue}}n&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(l+1,c):r=e.slice(l+1,c),s=c-l-1;l=c,u=0}else f===46&&u>-1?u++:u=-1}return r}function Jl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Lj={cwd:zj};function zj(){return"/"}function Sd(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Uj(e){if(typeof e=="string")e=new URL(e);else if(!Sd(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 Bj(e)}function Bj(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const n=e.pathname;let r=-1;for(;++r<n.length;)if(n.codePointAt(r)===37&&n.codePointAt(r+1)===50){const s=n.codePointAt(r+2);if(s===70||s===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(n)}const Ph=["history","path","basename","stem","extname","dirname"];class p1{constructor(n){let r;n?Sd(n)?r={path:n}:typeof n=="string"||Pj(n)?r={value:n}:r=n:r={},this.cwd="cwd"in r?"":Lj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Ph.length;){const u=Ph[s];u in r&&r[u]!==void 0&&r[u]!==null&&(this[u]=u==="history"?[...r[u]]:r[u])}let l;for(l in r)Ph.includes(l)||(this[l]=r[l])}get basename(){return typeof this.path=="string"?Sr.basename(this.path):void 0}set basename(n){Hh(n,"basename"),qh(n,"basename"),this.path=Sr.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Sr.dirname(this.path):void 0}set dirname(n){wb(this.basename,"dirname"),this.path=Sr.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Sr.extname(this.path):void 0}set extname(n){if(qh(n,"extname"),wb(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=Sr.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Sd(n)&&(n=Uj(n)),Hh(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Sr.basename(this.path,this.extname):void 0}set stem(n){Hh(n,"stem"),qh(n,"stem"),this.path=Sr.join(this.dirname||"",n+(this.extname||""))}fail(n,r,s){const l=this.message(n,r,s);throw l.fatal=!0,l}info(n,r,s){const l=this.message(n,r,s);return l.fatal=void 0,l}message(n,r,s){const l=new fn(n,r,s);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function qh(e,n){if(e&&e.includes(Sr.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Sr.sep+"`")}function Hh(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function wb(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function Pj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const qj=(function(e){const s=this.constructor.prototype,l=s[e],u=function(){return l.apply(u,arguments)};return Object.setPrototypeOf(u,s),u}),Hj={}.hasOwnProperty;class tm extends qj{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=Aj()}copy(){const n=new tm;let r=-1;for(;++r<this.attachers.length;){const s=this.attachers[r];n.use(...s)}return n.data(Bh(!0,{},this.namespace)),n}data(n,r){return typeof n=="string"?arguments.length===2?($h("data",this.frozen),this.namespace[n]=r,this):Hj.call(this.namespace,n)&&this.namespace[n]||void 0:n?($h("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[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const l=r.call(n,...s);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const r=bu(n),s=this.parser||this.Parser;return Ih("parse",s),s(String(r),r)}process(n,r){const s=this;return this.freeze(),Ih("process",this.parser||this.Parser),Fh("process",this.compiler||this.Compiler),r?l(void 0,r):new Promise(l);function l(u,c){const f=bu(n),m=s.parse(f);s.run(m,f,function(y,g,x){if(y||!g||!x)return d(y);const w=g,k=s.stringify(w,x);$j(k)?x.value=k:x.result=k,d(y,x)});function d(y,g){y||!g?c(y):u?u(g):r(void 0,g)}}}processSync(n){let r=!1,s;return this.freeze(),Ih("processSync",this.parser||this.Parser),Fh("processSync",this.compiler||this.Compiler),this.process(n,l),_b("processSync","process",r),s;function l(u,c){r=!0,xb(u),s=c}}run(n,r,s){Sb(n),this.freeze();const l=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?u(void 0,s):new Promise(u);function u(c,f){const m=bu(r);l.run(n,m,d);function d(y,g,x){const w=g||n;y?f(y):c?c(w):s(void 0,w,x)}}}runSync(n,r){let s=!1,l;return this.run(n,r,u),_b("runSync","run",s),l;function u(c,f){xb(c),l=f,s=!0}}stringify(n,r){this.freeze();const s=bu(r),l=this.compiler||this.Compiler;return Fh("stringify",l),Sb(n),l(n,s)}use(n,...r){const s=this.attachers,l=this.namespace;if($h("use",this.frozen),n!=null)if(typeof n=="function")m(n,r);else if(typeof n=="object")Array.isArray(n)?f(n):c(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function u(d){if(typeof d=="function")m(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[y,...g]=d;m(y,g)}else c(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function c(d){if(!("plugins"in d)&&!("settings"in d))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");f(d.plugins),d.settings&&(l.settings=Bh(!0,l.settings,d.settings))}function f(d){let y=-1;if(d!=null)if(Array.isArray(d))for(;++y<d.length;){const g=d[y];u(g)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function m(d,y){let g=-1,x=-1;for(;++g<s.length;)if(s[g][0]===d){x=g;break}if(x===-1)s.push([d,...y]);else if(y.length>0){let[w,...k]=y;const D=s[x][1];wd(D)&&wd(w)&&(w=Bh(!0,D,w)),s[x]=[d,w,...k]}}}}const Ij=new tm().freeze();function Ih(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Fh(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $h(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 Sb(e){if(!wd(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function _b(e,n,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function bu(e){return Fj(e)?e:new p1(e)}function Fj(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $j(e){return typeof e=="string"||Yj(e)}function Yj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Gj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Eb=[],kb={allowDangerousHtml:!0},Vj=/^(https?|ircs?|mailto|xmpp)$/i,Jj=[{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 Cb(e){const n=Xj(e),r=Kj(e);return Qj(n.runSync(n.parse(r),r),e)}function Xj(e){const n=e.rehypePlugins||Eb,r=e.remarkPlugins||Eb,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...kb}:kb;return Ij().use(NT).use(r).use(Ej,s).use(n)}function Kj(e){const n=e.children||"",r=new p1;return typeof n=="string"&&(r.value=n),r}function Qj(e,n){const r=n.allowedElements,s=n.allowElement,l=n.components,u=n.disallowedElements,c=n.skipHtml,f=n.unwrapDisallowed,m=n.urlTransform||Zj;for(const y of Jj)Object.hasOwn(n,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+Gj+y.id,void 0);return em(e,d),dC(e,{Fragment:b.Fragment,components:l,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function d(y,g,x){if(y.type==="raw"&&x&&typeof g=="number")return c?x.children.splice(g,1):x.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let w;for(w in Dh)if(Object.hasOwn(Dh,w)&&Object.hasOwn(y.properties,w)){const k=y.properties[w],D=Dh[w];(D===null||D.includes(y.tagName))&&(y.properties[w]=m(String(k||""),w,y))}}if(y.type==="element"){let w=r?!r.includes(y.tagName):u?u.includes(y.tagName):!1;if(!w&&s&&typeof g=="number"&&(w=!s(y,g,x)),w&&x&&typeof g=="number")return f&&y.children?x.children.splice(g,1,...y.children):x.children.splice(g,1),g}}}function Zj(e){const n=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),l=e.indexOf("/");return n===-1||l!==-1&&n>l||r!==-1&&n>r||s!==-1&&n>s||Vj.test(e.slice(0,n))?e:""}function Ab(e,n){const r=String(e);if(typeof n!="string")throw new TypeError("Expected character");let s=0,l=r.indexOf(n);for(;l!==-1;)s++,l=r.indexOf(n,l+n.length);return s}function Wj(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function g1(e,n,r){const l=Zu((r||{}).ignore||[]),u=eN(n);let c=-1;for(;++c<u.length;)m1(e,"text",f);function f(d,y){let g=-1,x;for(;++g<y.length;){const w=y[g],k=x?x.children:void 0;if(l(w,k?k.indexOf(w):void 0,x))return;x=w}if(x)return m(d,y)}function m(d,y){const g=y[y.length-1],x=u[c][0],w=u[c][1];let k=0;const B=g.children.indexOf(d);let L=!1,$=[];x.lastIndex=0;let T=x.exec(d.value);for(;T;){const te=T.index,P={index:T.index,input:T.input,stack:[...y,d]};let z=w(...T,P);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?x.lastIndex=te+1:(k!==te&&$.push({type:"text",value:d.value.slice(k,te)}),Array.isArray(z)?$.push(...z):z&&$.push(z),k=te+T[0].length,L=!0),!x.global)break;T=x.exec(d.value)}return L?(k<d.value.length&&$.push({type:"text",value:d.value.slice(k)}),g.children.splice(B,1,...$)):$=[d],B+$.length}}function eN(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<r.length;){const l=r[s];n.push([tN(l[0]),nN(l[1])])}return n}function tN(e){return typeof e=="string"?new RegExp(Wj(e),"g"):e}function nN(e){return typeof e=="function"?e:function(){return e}}const Yh="phrasing",Gh=["autolink","link","image","label"];function rN(){return{transforms:[cN],enter:{literalAutolink:sN,literalAutolinkEmail:Vh,literalAutolinkHttp:Vh,literalAutolinkWww:Vh},exit:{literalAutolink:uN,literalAutolinkEmail:oN,literalAutolinkHttp:aN,literalAutolinkWww:lN}}}function iN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Yh,notInConstruct:Gh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Yh,notInConstruct:Gh},{character:":",before:"[ps]",after:"\\/",inConstruct:Yh,notInConstruct:Gh}]}}function sN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Vh(e){this.config.enter.autolinkProtocol.call(this,e)}function aN(e){this.config.exit.autolinkProtocol.call(this,e)}function lN(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 oN(e){this.config.exit.autolinkEmail.call(this,e)}function uN(e){this.exit(e)}function cN(e){g1(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fN],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),hN]],{ignore:["link","linkReference"]})}function fN(e,n,r,s,l){let u="";if(!y1(l)||(/^w/i.test(n)&&(r=n+r,n="",u="http://"),!dN(r)))return!1;const c=mN(r+s);if(!c[0])return!1;const f={type:"link",title:null,url:u+n+c[0],children:[{type:"text",value:n+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function hN(e,n,r,s){return!y1(s,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+r,children:[{type:"text",value:n+"@"+r}]}}function dN(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 mN(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let r=n[0],s=r.indexOf(")");const l=Ab(e,"(");let u=Ab(e,")");for(;s!==-1&&l>u;)e+=r.slice(0,s+1),r=r.slice(s+1),s=r.indexOf(")"),u++;return[e,r]}function y1(e,n){const r=e.input.charCodeAt(e.index-1);return(e.index===0||ds(r)||Xu(r))&&(!n||r!==47)}b1.peek=_N;function pN(){this.buffer()}function gN(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function yN(){this.buffer()}function bN(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function xN(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=pr(this.sliceSerialize(e)).toLowerCase(),r.label=n}function vN(e){this.exit(e)}function wN(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=pr(this.sliceSerialize(e)).toLowerCase(),r.label=n}function SN(e){this.exit(e)}function _N(){return"["}function b1(e,n,r,s){const l=r.createTracker(s);let u=l.move("[^");const c=r.enter("footnoteReference"),f=r.enter("reference");return u+=l.move(r.safe(r.associationId(e),{after:"]",before:u})),f(),c(),u+=l.move("]"),u}function EN(){return{enter:{gfmFootnoteCallString:pN,gfmFootnoteCall:gN,gfmFootnoteDefinitionLabelString:yN,gfmFootnoteDefinition:bN},exit:{gfmFootnoteCallString:xN,gfmFootnoteCall:vN,gfmFootnoteDefinitionLabelString:wN,gfmFootnoteDefinition:SN}}}function kN(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:r,footnoteReference:b1},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(s,l,u,c){const f=u.createTracker(c);let m=f.move("[^");const d=u.enter("footnoteDefinition"),y=u.enter("label");return m+=f.move(u.safe(u.associationId(s),{before:m,after:"]"})),y(),m+=f.move("]:"),s.children&&s.children.length>0&&(f.shift(4),m+=f.move((n?`
106
+ `:" ")+u.indentLines(u.containerFlow(s,f.current()),n?x1:CN))),d(),m}}function CN(e,n,r){return n===0?e:x1(e,n,r)}function x1(e,n,r){return(r?"":" ")+e}const AN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];v1.peek=RN;function TN(){return{canContainEols:["delete"],enter:{strikethrough:NN},exit:{strikethrough:ON}}}function jN(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:AN}],handlers:{delete:v1}}}function NN(e){this.enter({type:"delete",children:[]},e)}function ON(e){this.exit(e)}function v1(e,n,r,s){const l=r.createTracker(s),u=r.enter("strikethrough");let c=l.move("~~");return c+=r.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),u(),c}function RN(){return"~"}function MN(e){return e.length}function DN(e,n){const r=n||{},s=(r.align||[]).concat(),l=r.stringLength||MN,u=[],c=[],f=[],m=[];let d=0,y=-1;for(;++y<e.length;){const D=[],B=[];let L=-1;for(e[y].length>d&&(d=e[y].length);++L<e[y].length;){const $=LN(e[y][L]);if(r.alignDelimiters!==!1){const T=l($);B[L]=T,(m[L]===void 0||T>m[L])&&(m[L]=T)}D.push($)}c[y]=D,f[y]=B}let g=-1;if(typeof s=="object"&&"length"in s)for(;++g<d;)u[g]=Tb(s[g]);else{const D=Tb(s);for(;++g<d;)u[g]=D}g=-1;const x=[],w=[];for(;++g<d;){const D=u[g];let B="",L="";D===99?(B=":",L=":"):D===108?B=":":D===114&&(L=":");let $=r.alignDelimiters===!1?1:Math.max(1,m[g]-B.length-L.length);const T=B+"-".repeat($)+L;r.alignDelimiters!==!1&&($=B.length+$+L.length,$>m[g]&&(m[g]=$),w[g]=$),x[g]=T}c.splice(1,0,x),f.splice(1,0,w),y=-1;const k=[];for(;++y<c.length;){const D=c[y],B=f[y];g=-1;const L=[];for(;++g<d;){const $=D[g]||"";let T="",te="";if(r.alignDelimiters!==!1){const P=m[g]-(B[g]||0),z=u[g];z===114?T=" ".repeat(P):z===99?P%2?(T=" ".repeat(P/2+.5),te=" ".repeat(P/2-.5)):(T=" ".repeat(P/2),te=T):te=" ".repeat(P)}r.delimiterStart!==!1&&!g&&L.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&$==="")&&(r.delimiterStart!==!1||g)&&L.push(" "),r.alignDelimiters!==!1&&L.push(T),L.push($),r.alignDelimiters!==!1&&L.push(te),r.padding!==!1&&L.push(" "),(r.delimiterEnd!==!1||g!==d-1)&&L.push("|")}k.push(r.delimiterEnd===!1?L.join("").replace(/ +$/,""):L.join(""))}return k.join(`
107
+ `)}function LN(e){return e==null?"":String(e)}function Tb(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 zN(e,n,r,s){const l=r.enter("blockquote"),u=r.createTracker(s);u.move("> "),u.shift(2);const c=r.indentLines(r.containerFlow(e,u.current()),UN);return l(),c}function UN(e,n,r){return">"+(r?"":" ")+e}function BN(e,n){return jb(e,n.inConstruct,!0)&&!jb(e,n.notInConstruct,!1)}function jb(e,n,r){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return r;let s=-1;for(;++s<n.length;)if(e.includes(n[s]))return!0;return!1}function Nb(e,n,r,s){let l=-1;for(;++l<r.unsafe.length;)if(r.unsafe[l].character===`
108
+ `&&BN(r.stack,r.unsafe[l]))return/[ \t]/.test(s.before)?"":" ";return`\\
109
+ `}function PN(e,n){const r=String(e);let s=r.indexOf(n),l=s,u=0,c=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===l?++u>c&&(c=u):u=1,l=s+n.length,s=r.indexOf(n,l);return c}function qN(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 HN(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 IN(e,n,r,s){const l=HN(r),u=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(qN(e,r)){const g=r.enter("codeIndented"),x=r.indentLines(u,FN);return g(),x}const f=r.createTracker(s),m=l.repeat(Math.max(PN(u,l)+1,3)),d=r.enter("codeFenced");let y=f.move(m);if(e.lang){const g=r.enter(`codeFencedLang${c}`);y+=f.move(r.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=r.enter(`codeFencedMeta${c}`);y+=f.move(" "),y+=f.move(r.safe(e.meta,{before:y,after:`
110
+ `,encode:["`"],...f.current()})),g()}return y+=f.move(`
111
+ `),u&&(y+=f.move(u+`
112
+ `)),y+=f.move(m),d(),y}function FN(e,n,r){return(r?"":" ")+e}function nm(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 $N(e,n,r,s){const l=nm(r),u=l==='"'?"Quote":"Apostrophe",c=r.enter("definition");let f=r.enter("label");const m=r.createTracker(s);let d=m.move("[");return d+=m.move(r.safe(r.associationId(e),{before:d,after:"]",...m.current()})),d+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),d+=m.move("<"),d+=m.move(r.safe(e.url,{before:d,after:">",...m.current()})),d+=m.move(">")):(f=r.enter("destinationRaw"),d+=m.move(r.safe(e.url,{before:d,after:e.title?" ":`
113
+ `,...m.current()}))),f(),e.title&&(f=r.enter(`title${u}`),d+=m.move(" "+l),d+=m.move(r.safe(e.title,{before:d,after:l,...m.current()})),d+=m.move(l),f()),c(),d}function YN(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 ql(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Hu(e,n,r){const s=ya(e),l=ya(n);return s===void 0?l===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}w1.peek=GN;function w1(e,n,r,s){const l=YN(r),u=r.enter("emphasis"),c=r.createTracker(s),f=c.move(l);let m=c.move(r.containerPhrasing(e,{after:l,before:f,...c.current()}));const d=m.charCodeAt(0),y=Hu(s.before.charCodeAt(s.before.length-1),d,l);y.inside&&(m=ql(d)+m.slice(1));const g=m.charCodeAt(m.length-1),x=Hu(s.after.charCodeAt(0),g,l);x.inside&&(m=m.slice(0,-1)+ql(g));const w=c.move(l);return u(),r.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},f+m+w}function GN(e,n,r){return r.options.emphasis||"*"}function VN(e,n){let r=!1;return em(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return r=!0,xd}),!!((!e.depth||e.depth<3)&&Vd(e)&&(n.options.setext||r))}function JN(e,n,r,s){const l=Math.max(Math.min(6,e.depth||1),1),u=r.createTracker(s);if(VN(e,r)){const y=r.enter("headingSetext"),g=r.enter("phrasing"),x=r.containerPhrasing(e,{...u.current(),before:`
114
+ `,after:`
115
+ `});return g(),y(),x+`
116
+ `+(l===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
117
+ `))+1))}const c="#".repeat(l),f=r.enter("headingAtx"),m=r.enter("phrasing");u.move(c+" ");let d=r.containerPhrasing(e,{before:"# ",after:`
118
+ `,...u.current()});return/^[\t ]/.test(d)&&(d=ql(d.charCodeAt(0))+d.slice(1)),d=d?c+" "+d:c,r.options.closeAtx&&(d+=" "+c),m(),f(),d}S1.peek=XN;function S1(e){return e.value||""}function XN(){return"<"}_1.peek=KN;function _1(e,n,r,s){const l=nm(r),u=l==='"'?"Quote":"Apostrophe",c=r.enter("image");let f=r.enter("label");const m=r.createTracker(s);let d=m.move("![");return d+=m.move(r.safe(e.alt,{before:d,after:"]",...m.current()})),d+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),d+=m.move("<"),d+=m.move(r.safe(e.url,{before:d,after:">",...m.current()})),d+=m.move(">")):(f=r.enter("destinationRaw"),d+=m.move(r.safe(e.url,{before:d,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=r.enter(`title${u}`),d+=m.move(" "+l),d+=m.move(r.safe(e.title,{before:d,after:l,...m.current()})),d+=m.move(l),f()),d+=m.move(")"),c(),d}function KN(){return"!"}E1.peek=QN;function E1(e,n,r,s){const l=e.referenceType,u=r.enter("imageReference");let c=r.enter("label");const f=r.createTracker(s);let m=f.move("![");const d=r.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(d+"]["),c();const y=r.stack;r.stack=[],c=r.enter("reference");const g=r.safe(r.associationId(e),{before:m,after:"]",...f.current()});return c(),r.stack=y,u(),l==="full"||!d||d!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function QN(){return"!"}k1.peek=ZN;function k1(e,n,r){let s=e.value||"",l="`",u=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(s);)l+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++u<r.unsafe.length;){const c=r.unsafe[u],f=r.compilePattern(c);let m;if(c.atBreak)for(;m=f.exec(s);){let d=m.index;s.charCodeAt(d)===10&&s.charCodeAt(d-1)===13&&d--,s=s.slice(0,d)+" "+s.slice(m.index+1)}}return l+s+l}function ZN(){return"`"}function C1(e,n){const r=Vd(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}A1.peek=WN;function A1(e,n,r,s){const l=nm(r),u=l==='"'?"Quote":"Apostrophe",c=r.createTracker(s);let f,m;if(C1(e,r)){const y=r.stack;r.stack=[],f=r.enter("autolink");let g=c.move("<");return g+=c.move(r.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),f(),r.stack=y,g}f=r.enter("link"),m=r.enter("label");let d=c.move("[");return d+=c.move(r.containerPhrasing(e,{before:d,after:"](",...c.current()})),d+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=r.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(r.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(m=r.enter("destinationRaw"),d+=c.move(r.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=r.enter(`title${u}`),d+=c.move(" "+l),d+=c.move(r.safe(e.title,{before:d,after:l,...c.current()})),d+=c.move(l),m()),d+=c.move(")"),f(),d}function WN(e,n,r){return C1(e,r)?"<":"["}T1.peek=e3;function T1(e,n,r,s){const l=e.referenceType,u=r.enter("linkReference");let c=r.enter("label");const f=r.createTracker(s);let m=f.move("[");const d=r.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(d+"]["),c();const y=r.stack;r.stack=[],c=r.enter("reference");const g=r.safe(r.associationId(e),{before:m,after:"]",...f.current()});return c(),r.stack=y,u(),l==="full"||!d||d!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function e3(){return"["}function rm(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 t3(e){const n=rm(e),r=e.options.bulletOther;if(!r)return n==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+r+"`) to be different");return r}function n3(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 j1(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 r3(e,n,r,s){const l=r.enter("list"),u=r.bulletCurrent;let c=e.ordered?n3(r):rm(r);const f=e.ordered?c==="."?")":".":t3(r);let m=n&&r.bulletLastUsed?c===r.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&y&&(!y.children||!y.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(m=!0),j1(r)===c&&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"){m=!0;break}}}}m&&(c=f),r.bulletCurrent=c;const d=r.containerFlow(e,s);return r.bulletLastUsed=c,r.bulletCurrent=u,l(),d}function i3(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 s3(e,n,r,s){const l=i3(r);let u=r.bulletCurrent||rm(r);n&&n.type==="list"&&n.ordered&&(u=(typeof n.start=="number"&&n.start>-1?n.start:1)+(r.options.incrementListMarker===!1?0:n.children.indexOf(e))+u);let c=u.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=r.createTracker(s);f.move(u+" ".repeat(c-u.length)),f.shift(c);const m=r.enter("listItem"),d=r.indentLines(r.containerFlow(e,f.current()),y);return m(),d;function y(g,x,w){return x?(w?"":" ".repeat(c))+g:(w?u:u+" ".repeat(c-u.length))+g}}function a3(e,n,r,s){const l=r.enter("paragraph"),u=r.enter("phrasing"),c=r.containerPhrasing(e,s);return u(),l(),c}const l3=Zu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function o3(e,n,r,s){return(e.children.some(function(c){return l3(c)})?r.containerPhrasing:r.containerFlow).call(r,e,s)}function u3(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}N1.peek=c3;function N1(e,n,r,s){const l=u3(r),u=r.enter("strong"),c=r.createTracker(s),f=c.move(l+l);let m=c.move(r.containerPhrasing(e,{after:l,before:f,...c.current()}));const d=m.charCodeAt(0),y=Hu(s.before.charCodeAt(s.before.length-1),d,l);y.inside&&(m=ql(d)+m.slice(1));const g=m.charCodeAt(m.length-1),x=Hu(s.after.charCodeAt(0),g,l);x.inside&&(m=m.slice(0,-1)+ql(g));const w=c.move(l+l);return u(),r.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},f+m+w}function c3(e,n,r){return r.options.strong||"*"}function f3(e,n,r,s){return r.safe(e.value,s)}function h3(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 d3(e,n,r){const s=(j1(r)+(r.options.ruleSpaces?" ":"")).repeat(h3(r));return r.options.ruleSpaces?s.slice(0,-1):s}const O1={blockquote:zN,break:Nb,code:IN,definition:$N,emphasis:w1,hardBreak:Nb,heading:JN,html:S1,image:_1,imageReference:E1,inlineCode:k1,link:A1,linkReference:T1,list:r3,listItem:s3,paragraph:a3,root:o3,strong:N1,text:f3,thematicBreak:d3};function m3(){return{enter:{table:p3,tableData:Ob,tableHeader:Ob,tableRow:y3},exit:{codeText:b3,table:g3,tableData:Jh,tableHeader:Jh,tableRow:Jh}}}function p3(e){const n=e._align;this.enter({type:"table",align:n.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function g3(e){this.exit(e),this.data.inTable=void 0}function y3(e){this.enter({type:"tableRow",children:[]},e)}function Jh(e){this.exit(e)}function Ob(e){this.enter({type:"tableCell",children:[]},e)}function b3(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,x3));const r=this.stack[this.stack.length-1];r.type,r.value=n,this.exit(e)}function x3(e,n){return n==="|"?n:e}function v3(e){const n=e||{},r=n.tableCellPadding,s=n.tablePipeAlign,l=n.stringLength,u=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
119
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:c,tableCell:m,tableRow:f}};function c(w,k,D,B){return d(y(w,D,B),w.align)}function f(w,k,D,B){const L=g(w,D,B),$=d([L]);return $.slice(0,$.indexOf(`
120
+ `))}function m(w,k,D,B){const L=D.enter("tableCell"),$=D.enter("phrasing"),T=D.containerPhrasing(w,{...B,before:u,after:u});return $(),L(),T}function d(w,k){return DN(w,{align:k,alignDelimiters:s,padding:r,stringLength:l})}function y(w,k,D){const B=w.children;let L=-1;const $=[],T=k.enter("table");for(;++L<B.length;)$[L]=g(B[L],k,D);return T(),$}function g(w,k,D){const B=w.children;let L=-1;const $=[],T=k.enter("tableRow");for(;++L<B.length;)$[L]=m(B[L],w,k,D);return T(),$}function x(w,k,D){let B=O1.inlineCode(w,k,D);return D.stack.includes("tableCell")&&(B=B.replace(/\|/g,"\\$&")),B}}function w3(){return{exit:{taskListCheckValueChecked:Rb,taskListCheckValueUnchecked:Rb,paragraph:_3}}}function S3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:E3}}}function Rb(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function _3(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const s=r.children[0];if(s&&s.type==="text"){const l=n.children;let u=-1,c;for(;++u<l.length;){const f=l[u];if(f.type==="paragraph"){c=f;break}}c===r&&(s.value=s.value.slice(1),s.value.length===0?r.children.shift():r.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,r.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function E3(e,n,r,s){const l=e.children[0],u=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=r.createTracker(s);u&&f.move(c);let m=O1.listItem(e,n,r,{...s,...f.current()});return u&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),m;function d(y){return y+c}}function k3(){return[rN(),EN(),TN(),m3(),w3()]}function C3(e){return{extensions:[iN(),kN(e),jN(),v3(e),S3()]}}const A3={tokenize:M3,partial:!0},R1={tokenize:D3,partial:!0},M1={tokenize:L3,partial:!0},D1={tokenize:z3,partial:!0},T3={tokenize:U3,partial:!0},L1={name:"wwwAutolink",tokenize:O3,previous:U1},z1={name:"protocolAutolink",tokenize:R3,previous:B1},ni={name:"emailAutolink",tokenize:N3,previous:P1},jr={};function j3(){return{text:jr}}let cs=48;for(;cs<123;)jr[cs]=ni,cs++,cs===58?cs=65:cs===91&&(cs=97);jr[43]=ni;jr[45]=ni;jr[46]=ni;jr[95]=ni;jr[72]=[ni,z1];jr[104]=[ni,z1];jr[87]=[ni,L1];jr[119]=[ni,L1];function N3(e,n,r){const s=this;let l,u;return c;function c(g){return!_d(g)||!P1.call(s,s.previous)||im(s.events)?r(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return _d(g)?(e.consume(g),f):g===64?(e.consume(g),m):r(g)}function m(g){return g===46?e.check(T3,y,d)(g):g===45||g===95||cn(g)?(u=!0,e.consume(g),m):y(g)}function d(g){return e.consume(g),l=!0,m}function y(g){return u&&l&&gn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(g)):r(g)}}function O3(e,n,r){const s=this;return l;function l(c){return c!==87&&c!==119||!U1.call(s,s.previous)||im(s.events)?r(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(A3,e.attempt(R1,e.attempt(M1,u),r),r)(c))}function u(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(c)}}function R3(e,n,r){const s=this;let l="",u=!1;return c;function c(g){return(g===72||g===104)&&B1.call(s,s.previous)&&!im(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):r(g)}function f(g){if(gn(g)&&l.length<5)return l+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const x=l.toLowerCase();if(x==="http"||x==="https")return e.consume(g),m}return r(g)}function m(g){return g===47?(e.consume(g),u?d:(u=!0,m)):r(g)}function d(g){return g===null||Bu(g)||Tt(g)||ds(g)||Xu(g)?r(g):e.attempt(R1,e.attempt(M1,y),r)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(g)}}function M3(e,n,r){let s=0;return l;function l(c){return(c===87||c===119)&&s<3?(s++,e.consume(c),l):c===46&&s===3?(e.consume(c),u):r(c)}function u(c){return c===null?r(c):n(c)}}function D3(e,n,r){let s,l,u;return c;function c(d){return d===46||d===95?e.check(D1,m,f)(d):d===null||Tt(d)||ds(d)||d!==45&&Xu(d)?m(d):(u=!0,e.consume(d),c)}function f(d){return d===95?s=!0:(l=s,s=void 0),e.consume(d),c}function m(d){return l||s||!u?r(d):n(d)}}function L3(e,n){let r=0,s=0;return l;function l(c){return c===40?(r++,e.consume(c),l):c===41&&s<r?u(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(D1,n,u)(c):c===null||Tt(c)||ds(c)?n(c):(e.consume(c),l)}function u(c){return c===41&&s++,e.consume(c),l}}function z3(e,n,r){return s;function s(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),s):f===38?(e.consume(f),u):f===93?(e.consume(f),l):f===60||f===null||Tt(f)||ds(f)?n(f):r(f)}function l(f){return f===null||f===40||f===91||Tt(f)||ds(f)?n(f):s(f)}function u(f){return gn(f)?c(f):r(f)}function c(f){return f===59?(e.consume(f),s):gn(f)?(e.consume(f),c):r(f)}}function U3(e,n,r){return s;function s(u){return e.consume(u),l}function l(u){return cn(u)?r(u):n(u)}}function U1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Tt(e)}function B1(e){return!gn(e)}function P1(e){return!(e===47||_d(e))}function _d(e){return e===43||e===45||e===46||e===95||cn(e)}function im(e){let n=e.length,r=!1;for(;n--;){const s=e[n][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){r=!0;break}if(s._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const B3={tokenize:G3,partial:!0};function P3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:F3,continuation:{tokenize:$3},exit:Y3}},text:{91:{name:"gfmFootnoteCall",tokenize:I3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:q3,resolveTo:H3}}}}function q3(e,n,r){const s=this;let l=s.events.length;const u=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c;for(;l--;){const m=s.events[l][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!c||!c._balanced)return r(m);const d=pr(s.sliceSerialize({start:c.end,end:s.now()}));return d.codePointAt(0)!==94||!u.includes(d.slice(1))?r(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),n(m))}}function H3(e,n){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[r+1],e[r+2],["enter",s,n],e[r+3],e[r+4],["enter",l,n],["exit",l,n],["enter",u,n],["enter",c,n],["exit",c,n],["exit",u,n],e[e.length-2],e[e.length-1],["exit",s,n]];return e.splice(r,e.length-r+1,...f),e}function I3(e,n,r){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u=0,c;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?r(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(g){if(u>999||g===93&&!c||g===null||g===91||Tt(g))return r(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return l.includes(pr(s.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):r(g)}return Tt(g)||(c=!0),u++,e.consume(g),g===92?y:d}function y(g){return g===91||g===92||g===93?(e.consume(g),u++,d):d(g)}}function F3(e,n,r){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u,c=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):r(k)}function y(k){if(c>999||k===93&&!f||k===null||k===91||Tt(k))return r(k);if(k===93){e.exit("chunkString");const D=e.exit("gfmFootnoteDefinitionLabelString");return u=pr(s.sliceSerialize(D)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return Tt(k)||(f=!0),c++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),c++,y):y(k)}function x(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(u)||l.push(u),it(e,w,"gfmFootnoteDefinitionWhitespace")):r(k)}function w(k){return n(k)}}function $3(e,n,r){return e.check(Vl,n,e.attempt(B3,n,r))}function Y3(e){e.exit("gfmFootnoteDefinition")}function G3(e,n,r){const s=this;return it(e,l,"gfmFootnoteDefinitionIndent",5);function l(u){const c=s.events[s.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?n(u):r(u)}}function V3(e){let r=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:u,resolveAll:l};return r==null&&(r=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function l(c,f){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let d=m;for(;d--;)if(c[d][0]==="exit"&&c[d][1].type==="strikethroughSequenceTemporary"&&c[d][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[d][1].end.offset-c[d][1].start.offset){c[m][1].type="strikethroughSequence",c[d][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},c[d][1].start),end:Object.assign({},c[m][1].end)},g={type:"strikethroughText",start:Object.assign({},c[d][1].end),end:Object.assign({},c[m][1].start)},x=[["enter",y,f],["enter",c[d][1],f],["exit",c[d][1],f],["enter",g,f]],w=f.parser.constructs.insideSpan.null;w&&In(x,x.length,0,Ku(w,c.slice(d+1,m),f)),In(x,x.length,0,[["exit",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",y,f]]),In(c,d-1,m-d+3,x),m=d+x.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function u(c,f,m){const d=this.previous,y=this.events;let g=0;return x;function x(k){return d===126&&y[y.length-1][1].type!=="characterEscape"?m(k):(c.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const D=ya(d);if(k===126)return g>1?m(k):(c.consume(k),g++,w);if(g<2&&!r)return m(k);const B=c.exit("strikethroughSequenceTemporary"),L=ya(k);return B._open=!L||L===2&&!!D,B._close=!D||D===2&&!!L,f(k)}}}class J3{constructor(){this.map=[]}add(n,r,s){X3(this,n,r,s)}consume(n){if(this.map.sort(function(u,c){return u[0]-c[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(n.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),n.length=this.map[r][0];s.push(n.slice()),n.length=0;let l=s.pop();for(;l;){for(const u of l)n.push(u);l=s.pop()}this.map.length=0}}function X3(e,n,r,s){let l=0;if(!(r===0&&s.length===0)){for(;l<e.map.length;){if(e.map[l][0]===n){e.map[l][1]+=r,e.map[l][2].push(...s);return}l+=1}e.map.push([n,r,s])}}function K3(e,n){let r=!1;const s=[];for(;n<e.length;){const l=e[n];if(r){if(l[0]==="enter")l[1].type==="tableContent"&&s.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const u=s.length-1;s[u]=s[u]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(r=!0);n+=1}return s}function Q3(){return{flow:{null:{name:"table",tokenize:Z3,resolveAll:W3}}}}function Z3(e,n,r){const s=this;let l=0,u=0,c;return f;function f(O){let K=s.events.length-1;for(;K>-1;){const ie=s.events[K][1].type;if(ie==="lineEnding"||ie==="linePrefix")K--;else break}const J=K>-1?s.events[K][1].type:null,se=J==="tableHead"||J==="tableRow"?z:m;return se===z&&s.parser.lazy[s.now().line]?r(O):se(O)}function m(O){return e.enter("tableHead"),e.enter("tableRow"),d(O)}function d(O){return O===124||(c=!0,u+=1),y(O)}function y(O){return O===null?r(O):Pe(O)?u>1?(u=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),w):r(O):Qe(O)?it(e,y,"whitespace")(O):(u+=1,c&&(c=!1,l+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),c=!0,y):(e.enter("data"),g(O)))}function g(O){return O===null||O===124||Tt(O)?(e.exit("data"),y(O)):(e.consume(O),O===92?x:g)}function x(O){return O===92||O===124?(e.consume(O),g):g(O)}function w(O){return s.interrupt=!1,s.parser.lazy[s.now().line]?r(O):(e.enter("tableDelimiterRow"),c=!1,Qe(O)?it(e,k,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):k(O))}function k(O){return O===45||O===58?B(O):O===124?(c=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),D):P(O)}function D(O){return Qe(O)?it(e,B,"whitespace")(O):B(O)}function B(O){return O===58?(u+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),L):O===45?(u+=1,L(O)):O===null||Pe(O)?te(O):P(O)}function L(O){return O===45?(e.enter("tableDelimiterFiller"),$(O)):P(O)}function $(O){return O===45?(e.consume(O),$):O===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(O))}function T(O){return Qe(O)?it(e,te,"whitespace")(O):te(O)}function te(O){return O===124?k(O):O===null||Pe(O)?!c||l!==u?P(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):P(O)}function P(O){return r(O)}function z(O){return e.enter("tableRow"),X(O)}function X(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),X):O===null||Pe(O)?(e.exit("tableRow"),n(O)):Qe(O)?it(e,X,"whitespace")(O):(e.enter("data"),Z(O))}function Z(O){return O===null||O===124||Tt(O)?(e.exit("data"),X(O)):(e.consume(O),O===92?H:Z)}function H(O){return O===92||O===124?(e.consume(O),Z):Z(O)}}function W3(e,n){let r=-1,s=!0,l=0,u=[0,0,0,0],c=[0,0,0,0],f=!1,m=0,d,y,g;const x=new J3;for(;++r<e.length;){const w=e[r],k=w[1];w[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(Mb(x,n,m,d,y),y=void 0,m=0),d={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.add(r,0,[["enter",d,n]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(s=!0,g=void 0,u=[0,0,0,0],c=[0,r+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.add(r,0,[["enter",y,n]])),l=k.type==="tableDelimiterRow"?2:y?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(s=!1,c[2]===0&&(u[1]!==0&&(c[0]=c[1],g=xu(x,n,u,l,void 0,g),u=[0,0,0,0]),c[2]=r)):k.type==="tableCellDivider"&&(s?s=!1:(u[1]!==0&&(c[0]=c[1],g=xu(x,n,u,l,void 0,g)),u=c,c=[u[1],r,0,0])):k.type==="tableHead"?(f=!0,m=r):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=r,u[1]!==0?(c[0]=c[1],g=xu(x,n,u,l,r,g)):c[1]!==0&&(g=xu(x,n,c,l,r,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=r)}for(m!==0&&Mb(x,n,m,d,y),x.consume(n.events),r=-1;++r<n.events.length;){const w=n.events[r];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=K3(n.events,r))}return e}function xu(e,n,r,s,l,u){const c=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",f="tableContent";r[0]!==0&&(u.end=Object.assign({},na(n.events,r[0])),e.add(r[0],0,[["exit",u,n]]));const m=na(n.events,r[1]);if(u={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(r[1],0,[["enter",u,n]]),r[2]!==0){const d=na(n.events,r[2]),y=na(n.events,r[3]),g={type:f,start:Object.assign({},d),end:Object.assign({},y)};if(e.add(r[2],0,[["enter",g,n]]),s!==2){const x=n.events[r[2]],w=n.events[r[3]];if(x[1].end=Object.assign({},w[1].end),x[1].type="chunkText",x[1].contentType="text",r[3]>r[2]+1){const k=r[2]+1,D=r[3]-r[2]-1;e.add(k,D,[])}}e.add(r[3]+1,0,[["exit",g,n]])}return l!==void 0&&(u.end=Object.assign({},na(n.events,l)),e.add(l,0,[["exit",u,n]]),u=void 0),u}function Mb(e,n,r,s,l){const u=[],c=na(n.events,r);l&&(l.end=Object.assign({},c),u.push(["exit",l,n])),s.end=Object.assign({},c),u.push(["exit",s,n]),e.add(r+1,0,u)}function na(e,n){const r=e[n],s=r[0]==="enter"?"start":"end";return r[1][s]}const eO={name:"tasklistCheck",tokenize:nO};function tO(){return{text:{91:eO}}}function nO(e,n,r){const s=this;return l;function l(m){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?r(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),u)}function u(m){return Tt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):r(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):r(m)}function f(m){return Pe(m)?n(m):Qe(m)?e.check({tokenize:rO},n,r)(m):r(m)}}function rO(e,n,r){return it(e,s,"whitespace");function s(l){return l===null?r(l):n(l)}}function iO(e){return Xx([j3(),P3(),V3(e),Q3(),tO()])}const sO={};function Db(e){const n=this,r=e||sO,s=n.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),u=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),c=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push(iO(r)),u.push(k3()),c.push(C3(r))}function aO(e){g1(e,[/\r?\n|\r/g,lO])}function lO(){return{type:"break"}}function Lb(){return function(e){aO(e)}}function oO({connected:e,hostId:n,request:r,subscribeEvents:s,taskId:l,runId:u}){const c=ti(),[f,m]=N.useState(!0),[d,y]=N.useState([]),[g,x]=N.useState(),[w,k]=N.useState(),D=g==="started"||g==="monitoring",B=g==="followup",L=g==="started"||g==="followup",[$,T]=N.useState(null),[te,P]=N.useState(!1),[z,X]=N.useState(""),[Z,H]=N.useState(!1),O=N.useRef(null),K=N.useRef(null),J=N.useRef(null),[se,ie]=N.useState(u==="latest"?void 0:u),F=u==="latest"&&se===null;N.useEffect(()=>{if(u!=="latest"){ie(u);return}e&&(ie(void 0),r("taskrun.list",{task_id:l,limit:1}).then(S=>{var M,W;return ie(((W=(M=S.entries)==null?void 0:M[0])==null?void 0:W.run_id)??null)}).catch(()=>ie(null)))},[u,l,e,r]);async function q(){if(se)try{const S=await r("task.result",{id:l,run_id:se});if(S.error){console.error("No result:",S.error),c("/runs",{replace:!0});return}y(S.messages??[]),x(S.running_state),k(S.agent)}catch(S){console.error("Failed to load result:",S),c("/runs",{replace:!0})}finally{m(!1)}}async function V(S){var M;if(se)try{const A=(M=(await r("task.reports",{id:l,run_id:se,report_files:[S]})).reports)==null?void 0:M[0];A!=null&&A.data_url?T({file:S,data_url:A.data_url}):T({file:S,content:(A==null?void 0:A.content)??"Report not found."})}catch{T({file:S,content:"Failed to load report."})}}N.useEffect(()=>{!e||!se||(m(!0),q())},[e,l,se]),N.useEffect(()=>!e||!n||!se?void 0:s(n,async M=>{try{const W=JSON.parse(new TextDecoder().decode(M.data));if(W.event_type!=="running-state"&&W.event_type!=="result-updated"||M.subject.split(".").pop()!==l||W.event_type==="result-updated"&&W.run_id&&W.run_id!==se)return;q()}catch{}}),[e,n,l,se,s,r]),N.useEffect(()=>{O.current&&(O.current.scrollTop=O.current.scrollHeight)},[d]),N.useEffect(()=>{f||F||!se||J.current!==se&&(J.current=se,requestAnimationFrame(()=>{O.current&&(O.current.scrollTop=O.current.scrollHeight),window.scrollTo({top:document.documentElement.scrollHeight,behavior:"auto"})}))},[f,F,se]);function ue(S){if(S==="input")return"User Input";if(S==="permission")return"Permission";if(S==="confirmation")return"Confirmation"}function xe(S){return S==="started"?"Task started":S==="finished"?"Task finished":S==="failed"?"Task failed":S==="error"?"Command failed":S==="aborted"?"Task aborted":S==="confirmation"?"Task confirmed":S==="stopped"?"Follow-up stopped":S??""}return b.jsxs("div",{className:"run-detail",children:[b.jsxs("button",{className:"run-detail-back",onClick:()=>c(-1),children:[b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:b.jsx("path",{d:"M15 18l-6-6 6-6"})}),"Back"]}),F?b.jsxs("div",{className:"empty-state",children:[b.jsx("p",{className:"empty-state-text",children:"No runs yet"}),b.jsx("p",{className:"empty-state-hint",children:"This task hasn't been executed yet. Run it from the task menu or wait for its next trigger."})]}):f?b.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-sm)",padding:"var(--space-sm) 0"},children:[b.jsx("div",{className:"skeleton-line",style:{width:"40%"}}),b.jsx("div",{className:"skeleton-line",style:{width:"55%"}}),b.jsx("div",{className:"skeleton-line",style:{width:"100%",height:"8rem",marginTop:"var(--space-sm)"}})]}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"chat-thread",ref:O,children:[d.map((S,M)=>{const W=L&&S.role==="assistant"&&!d.slice(M+1).some(A=>A.role==="assistant"||A.role==="user");return S.role==="status"&&S.type==="monitoring"?null:S.role==="status"?b.jsxs("div",{className:`chat-status${S.type==="error"?" chat-status--error":""}`,children:[b.jsxs("div",{children:[xe(S.type),S.time>0&&b.jsx("span",{className:"chat-status-time",children:Uu(S.time)})]}),S.content&&b.jsx("pre",{className:"chat-status-detail",children:S.content})]},M):b.jsxs("div",{className:`chat-message chat-message--${S.role}`,children:[S.role==="assistant"&&w&&b.jsx("div",{className:"chat-message-agent",children:hd(w)}),b.jsxs("div",{className:"chat-message-content",children:[b.jsx(Cb,{remarkPlugins:[Db,Lb],children:S.content}),W&&b.jsxs("div",{className:"chat-typing-indicator",children:[b.jsx("span",{}),b.jsx("span",{}),b.jsx("span",{})]})]}),S.attachments&&S.attachments.length>0&&b.jsx("div",{className:"chat-message-attachments",children:S.attachments.map(A=>b.jsx("button",{className:"chat-attachment-chip",onClick:()=>V(A),children:A},A))}),b.jsxs("div",{className:"chat-message-meta",children:[ue(S.type)&&b.jsx("span",{className:"chat-message-type",children:ue(S.type)}),S.time>0&&b.jsx("span",{children:Uu(S.time)})]})]},M)}),L&&(()=>{const S=d.filter(M=>M.role!=="status");return S.length===0||S[S.length-1].role!=="assistant"})()&&b.jsxs("div",{className:"chat-message chat-message--assistant",children:[w&&b.jsx("div",{className:"chat-message-agent",children:hd(w)}),b.jsxs("div",{className:"chat-typing-indicator",children:[b.jsx("span",{}),b.jsx("span",{}),b.jsx("span",{})]})]}),g==="monitoring"&&b.jsxs("div",{className:"chat-monitoring-indicator",children:[b.jsx("span",{className:"chat-monitoring-dot"}),"Monitoring command output"]})]}),D?b.jsx("div",{className:"chat-abort-bar",children:b.jsx("button",{className:"btn btn-secondary chat-abort-btn",disabled:te,onClick:async()=>{if(confirm("Abort this task?")){P(!0);try{await r("task.abort",{id:l})}catch(S){console.error("Abort failed:",S)}finally{P(!1)}}},children:te?"Aborting...":"Abort Task"})}):B?b.jsx("div",{className:"chat-input-bar",children:b.jsx("button",{className:"btn btn-secondary chat-stop-btn",disabled:te,onClick:async()=>{P(!0);try{await r("task.stop_followup",{id:l,run_id:se})}catch(S){console.error("Stop failed:",S)}finally{P(!1)}},children:b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:b.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})})}):b.jsxs("form",{className:"chat-input-bar",onSubmit:async S=>{S.preventDefault();const M=z.trim();if(!(!M||Z)){H(!0);try{await r("task.followup",{id:l,run_id:se,message:M}),X("")}catch(W){console.error("Follow-up failed:",W)}finally{H(!1)}}},children:[b.jsx("input",{ref:K,className:"chat-input",type:"text",placeholder:"Follow-up message",value:z,onChange:S=>X(S.target.value),disabled:Z}),b.jsx("button",{className:"btn btn-primary chat-send-btn",type:"submit",disabled:!z.trim()||Z,children:b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),b.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})]}),$&&b.jsx("div",{className:"report-dialog-overlay",onClick:()=>T(null),children:b.jsxs("div",{className:"report-dialog",onClick:S=>S.stopPropagation(),children:[b.jsxs("div",{className:"report-dialog-header",children:[b.jsx("span",{className:"report-dialog-title",children:$.file}),b.jsx("button",{className:"report-dialog-close",onClick:()=>T(null),"aria-label":"Close",children:b.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),b.jsx("div",{className:"report-dialog-body",children:$.data_url?b.jsx("img",{src:$.data_url,alt:$.file,style:{maxWidth:"100%",height:"auto"}}):b.jsx(Cb,{remarkPlugins:[Db,Lb],components:{a:({...S})=>b.jsx("a",{...S,target:"_blank",rel:"noopener noreferrer"})},children:$.content??""})})]})})]})}function uO(){const{getActiveHost:e}=va(),n=e(),r=N.useRef(null);N.useEffect(()=>{if($n.isNativePlatform()||!n||n.directUrl||r.current===n.hostId)return;async function s(){var l;try{if(!("serviceWorker"in navigator)||!("PushManager"in window)){console.warn("[Push] Push notifications not supported");return}const u=await navigator.serviceWorker.ready;(l=u.active)==null||l.postMessage({type:"set-host-id",hostId:n.hostId});let c=await u.pushManager.getSubscription();if(!c){const{publicKey:m}=await fk("/api/push/vapid-key");if(!m){console.warn("[Push] No VAPID public key configured on server");return}if(await Notification.requestPermission()!=="granted"){console.log("[Push] Permission denied");return}c=await u.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:m})}const f=c.toJSON();await ck("/api/push/subscribe",{hostId:n.hostId,endpoint:f.endpoint,keys:{p256dh:f.keys.p256dh,auth:f.keys.auth}}),r.current=n.hostId}catch(u){console.error("[Push] Subscription failed:",u)}}s()},[n])}const cO="0.8.8";function fO(e,n){if(e.includes("-"))return!1;const r=e.split(".").map(Number),s=n.split(".").map(Number);for(let l=0;l<3;l++){if((r[l]??0)<(s[l]??0))return!0;if((r[l]??0)>(s[l]??0))return!1}return!1}function El(){var He;const{pairedHosts:e,activeHostId:n,removePairedHost:r}=va(),{connected:s,request:l,subscribeEvents:u,unauthorized:c}=Sa(),f=ti(),m=Tr(),d=qS(),y=Mx("(min-width: 768px)"),g=m.pathname.startsWith("/tasks"),x=d.runId?void 0:d.taskId,w=!!(d.taskId&&d.runId),[k,D]=N.useState(!1),[B,L]=N.useState(!1),[$,T]=N.useState(null),[te,P]=N.useState(null),[z,X]=N.useState({}),[Z,H]=N.useState([]),[O,K]=N.useState(),[J,se]=N.useState(new Map),[ie,F]=N.useState(new Map),[q,V]=N.useState(new Map),[ue,xe]=N.useState(new Map);uO(),N.useEffect(()=>{window.scrollTo(0,0)},[n]),N.useEffect(()=>{s&&l("host.info").then(be=>{var Fe,Ue,tt,mt,st,Mt;H(be.agents??[]),K(be.host_platform),X(be.capability_tokens??{}),gk(be.agents??[]);const De=be.version??null;P(De),D(!!De&&fO(De,cO));const Ze=new Map,dt=new Map,lt=new Map,ct=new Map;for(const yt of be.pending_prompts??[])if(yt.type==="confirmation")Ze.set(yt.key,{description:((Fe=yt.meta)==null?void 0:Fe.description)??"",sessionName:(Ue=yt.meta)==null?void 0:Ue.session_name});else if(yt.type==="permission")dt.set(yt.key,{permissions:yt.params??[],sessionName:(tt=yt.meta)==null?void 0:tt.session_name});else if(yt.type==="input"){const Yn=yt.params??((mt=yt.meta)==null?void 0:mt.input_questions)??[];lt.set(yt.key,{questions:Yn,description:(st=yt.meta)==null?void 0:st.description,sessionName:(Mt=yt.meta)==null?void 0:Mt.session_name}),ct.set(yt.key,new Array(Yn.length).fill(""))}se(Ze),F(dt),V(lt),xe(ct)}).catch(()=>{})},[s,n,l]),N.useEffect(()=>!s||!n?void 0:u(n,De=>{const Ze=De.subject.split(".");if(Ze.length<3)return;const dt=Ze.slice(2).join(".");let lt={};try{lt=JSON.parse(new TextDecoder().decode(De.data))}catch{return}const ct=lt.event_type,Fe=lt.session_id;if(ct==="input-request"&&Fe){const Ue=lt.input_questions,tt=lt.session_name,mt=lt.description;Ue!=null&&Ue.length&&(V(st=>{if(st.has(Fe))return st;const Mt=new Map(st);return Mt.set(Fe,{questions:Ue,description:mt,sessionName:tt}),Mt}),xe(st=>{if(st.has(Fe))return st;const Mt=new Map(st);return Mt.set(Fe,new Array(Ue.length).fill("")),Mt}));return}if(ct==="input-resolved"&&Fe){V(Ue=>{if(!Ue.has(Fe))return Ue;const tt=new Map(Ue);return tt.delete(Fe),tt}),xe(Ue=>{const tt=new Map(Ue);return tt.delete(Fe),tt});return}if(ct==="confirm-request"&&Fe){const Ue=lt.description,tt=lt.session_name;Ue&&se(mt=>{if(mt.has(Fe))return mt;const st=new Map(mt);return st.set(Fe,{description:Ue,sessionName:tt}),st});return}if(ct==="confirm-resolved"&&Fe){se(Ue=>{if(!Ue.has(Fe))return Ue;const tt=new Map(Ue);return tt.delete(Fe),tt});return}if(ct==="permission-request"){const Ue=lt.required_permissions,tt=lt.session_name;Ue!=null&&Ue.length&&F(mt=>{if(mt.has(dt))return mt;const st=new Map(mt);return st.set(dt,{permissions:Ue,sessionName:tt}),st});return}if(ct==="permission-resolved"){F(Ue=>{if(!Ue.has(dt))return Ue;const tt=new Map(Ue);return tt.delete(dt),tt});return}}),[s,n,u]);async function S(be,De){try{await l("task.user_input",{id:be,value:[De]})}catch(Ze){console.error("[Dashboard] Failed to respond to confirmation:",Ze)}}async function M(be,De){try{await l("task.user_input",{id:be,value:[De]})}catch(Ze){console.error("[Dashboard] Failed to respond to permission request:",Ze)}}async function W(be,De){try{await l("task.user_input",{id:be,value:De})}catch(Ze){console.error("[Dashboard] Failed to respond to input request:",Ze)}}function A(be,De){hs()&&f(De?`/runs/${encodeURIComponent(be)}/${encodeURIComponent(De)}`:`/runs/${encodeURIComponent(be)}`)}async function we(){L(!0),T(null);try{const be=await l("host.update");if(be.error){T(be.error),L(!1);return}}catch{}setTimeout(()=>window.location.reload(),15e3)}const Ae=e.length>0,Te=Ae&&s&&n&&!c,Me=((He=e.find(be=>be.hostId===n))==null?void 0:He.clientToken)??null;return b.jsxs("div",{className:"dashboard",children:[y&&b.jsx(H0,{daemonVersion:te,capabilityTokens:z,activeClientToken:Me,request:l,onCapabilityTokensChange:X}),b.jsxs("div",{className:"dashboard-content",children:[b.jsxs("header",{className:"app-header",children:[b.jsxs("div",{className:"app-title-bar",children:[!y&&b.jsx(H0,{daemonVersion:te,capabilityTokens:z,activeClientToken:Me,request:l,onCapabilityTokensChange:X}),b.jsx("h1",{className:"app-title",children:"Palmier"}),b.jsx(Dk,{})]}),b.jsx("div",{className:"tab-bar",children:b.jsx(Nk,{})})]}),b.jsx("main",{className:"dashboard-main",children:c?b.jsxs("div",{className:"revoked-state",children:[b.jsx("div",{className:"revoked-icon",children:b.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),b.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}),b.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"18"})]})}),b.jsx("h2",{className:"revoked-title",children:"Client Revoked"}),b.jsx("p",{className:"revoked-description",children:"This client was revoked by the host. To reconnect, generate a new pairing code on the host machine."}),b.jsx("div",{className:"revoked-command",children:b.jsx("code",{children:"palmier pair"})}),b.jsxs("div",{className:"revoked-actions",children:[b.jsx("button",{className:"btn btn-primary",onClick:()=>{hs()&&f("/pair")},children:"Re-pair Device"}),b.jsx("button",{className:"btn btn-secondary",onClick:()=>{n&&r(n)},children:"Remove Host"})]})]}):Te?b.jsxs(b.Fragment,{children:[g&&!w&&b.jsx(jk,{connected:s,hostId:n,request:l,subscribeEvents:u,agents:Z,hostPlatform:O,isNotificationListener:!!Me&&z.notifications===Me,onViewRun:A}),w?b.jsx(oO,{connected:s,hostId:n,request:l,subscribeEvents:u,taskId:d.taskId,runId:decodeURIComponent(d.runId)}):g?null:b.jsx(Bk,{connected:s,hostId:n,request:l,subscribeEvents:u,agents:Z,hostPlatform:O,filterTaskId:x,onClearFilter:()=>{hs()&&f("/")}})]}):b.jsxs("div",{className:"empty-state",children:[b.jsx("p",{children:Ae?"Connecting to host...":"No host computer paired yet."}),!Ae&&b.jsx("button",{className:"btn btn-primary",onClick:()=>f("/pair"),children:"Pair Host"})]})}),k&&!B&&!$&&b.jsx("div",{className:"confirm-modal-overlay",children:b.jsxs("div",{className:"confirm-modal",children:[b.jsx("h2",{className:"confirm-modal-title",children:"Update Required"}),b.jsxs("p",{className:"confirm-modal-message",children:["Your Palmier host",te?` (v${te})`:""," is too old for this version of the app. Please update to continue."]}),b.jsx("div",{className:"confirm-modal-actions",children:b.jsx("button",{className:"btn btn-primary",onClick:we,children:"Update Now"})})]})}),B&&b.jsx("div",{className:"confirm-modal-overlay",children:b.jsxs("div",{className:"confirm-modal",children:[b.jsx("h2",{className:"confirm-modal-title",children:"Updating..."}),b.jsx("p",{className:"confirm-modal-message",children:"Installing update and restarting daemon. Please wait..."})]})}),$&&b.jsx("div",{className:"confirm-modal-overlay",children:b.jsxs("div",{className:"confirm-modal",children:[b.jsx("h2",{className:"confirm-modal-title",children:"Update Failed"}),b.jsx("p",{className:"confirm-modal-message",style:{whiteSpace:"pre-line"},children:$}),b.jsx("div",{className:"confirm-modal-actions",children:b.jsx("button",{className:"btn btn-secondary",onClick:()=>{T(null)},children:"Retry"})})]})})]}),ha.createPortal(b.jsxs(b.Fragment,{children:[[...J.entries()].map(([be,{description:De,sessionName:Ze}])=>b.jsx("div",{className:"confirm-modal-overlay",children:b.jsxs("div",{className:"confirm-modal",children:[b.jsx("h2",{className:"confirm-modal-title",children:"Confirmation Required"}),Ze&&b.jsx("p",{className:"confirm-modal-subtitle",children:Ze}),b.jsx("p",{className:"confirm-modal-message",children:De}),b.jsxs("div",{className:"confirm-modal-actions",children:[b.jsx("button",{className:"btn btn-primary",onClick:()=>S(be,"confirmed"),children:"Confirm"}),b.jsx("button",{className:"btn btn-secondary",onClick:()=>S(be,"aborted"),children:"Abort"})]})]})},be)),[...ie.entries()].map(([be,{permissions:De,sessionName:Ze}])=>b.jsx("div",{className:"confirm-modal-overlay",children:b.jsxs("div",{className:"confirm-modal permission-modal",children:[b.jsx("h2",{className:"confirm-modal-title",children:"Permission Required"}),b.jsx("p",{className:"confirm-modal-message",children:b.jsx("strong",{children:Ze||be})}),b.jsx("div",{className:"permission-list",children:De.map((dt,lt)=>b.jsxs("div",{className:"permission-item",children:[b.jsx("span",{className:"permission-name",children:dt.name}),dt.description&&b.jsx("span",{className:"permission-desc",children:dt.description})]},lt))}),b.jsxs("div",{className:"permission-actions",children:[b.jsx("button",{className:"btn btn-primary",onClick:()=>M(be,"granted"),children:"Allow Once"}),b.jsx("button",{className:"btn btn-secondary",onClick:()=>M(be,"granted_all"),children:"Allow Always"})]}),b.jsx("button",{className:"permission-abort-link",onClick:()=>M(be,"aborted"),children:"Deny & Abort Task"})]})},be)),[...q.entries()].map(([be,{questions:De,description:Ze,sessionName:dt}])=>{const lt=ue.get(be)??new Array(De.length).fill("");return b.jsx("div",{className:"confirm-modal-overlay",children:b.jsxs("div",{className:"confirm-modal input-modal",children:[b.jsx("h2",{className:"confirm-modal-title",children:"Input Required"}),dt&&b.jsx("p",{className:"confirm-modal-subtitle",children:dt}),Ze&&b.jsx("p",{className:"confirm-modal-message",children:Ze}),b.jsx("div",{className:"input-list",children:De.map((ct,Fe)=>b.jsxs("div",{className:"input-item",children:[b.jsx("label",{className:"input-label",children:ct}),b.jsx("input",{type:"text",className:"input-field",value:lt[Fe]??"",onChange:Ue=>{xe(tt=>{const mt=new Map(tt),st=[...mt.get(be)??[]];return st[Fe]=Ue.target.value,mt.set(be,st),mt})},autoFocus:Fe===0})]},Fe))}),b.jsx("div",{className:"input-actions",children:b.jsx("button",{className:"btn btn-primary",disabled:lt.some(ct=>!ct.trim()),onClick:()=>W(be,lt),children:"Submit"})}),b.jsx("button",{className:"permission-abort-link",onClick:()=>W(be,["aborted"]),children:"Cancel"})]})},be)})]}),document.body)]})}const hO=ms("Preferences",{web:()=>qd(()=>import("./web-BqVsIFtP.js"),[]).then(e=>new e.PreferencesWeb)}),ea=!!window.__PALMIER_SERVE__&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function dO(){const[e,n]=N.useState(""),[r,s]=N.useState(!1),[l,u]=N.useState(null),{addPairedHost:c}=va(),f=ti();async function m(){const d=e.trim().toUpperCase();if(!d){u("Enter a pairing code.");return}s(!0),u(null);try{let y;if(ea){const x=await fetch("/pair",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:d,label:navigator.userAgent})});if(!x.ok){const w=await x.json().catch(()=>({error:"Connection failed"}));throw new Error(w.error||`HTTP ${x.status}`)}y=await x.json()}else{const x=await fetch(`${zu}/api/config`);if(!x.ok)throw new Error("Failed to fetch server config");const w=await x.json();if(!w.natsWsUrl)throw new Error("Server has no NATS WebSocket URL configured");const k=await kx({servers:w.natsWsUrl,authenticator:gx(w.natsJwt,new TextEncoder().encode(w.natsNkeySeed))}),D=ju(),B=`pair.${d}`,L=await k.request(B,D.encode(JSON.stringify({label:navigator.userAgent})),{timeout:1e4});y=JSON.parse(D.decode(L.data)),await k.close()}const g={hostId:y.hostId,clientToken:y.clientToken,directUrl:ea?window.location.origin:void 0,lanUrl:ea?void 0:y.directUrl,...y.hostName?{name:y.hostName}:{}};if(c(g),$n.isNativePlatform()&&Ut){await hO.set({key:"hostId",value:y.hostId});try{const{token:x}=await Ut.getFcmToken();await fetch(`${zu}/api/fcm/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hostId:y.hostId,fcmToken:x})})}catch(x){console.warn("FCM token registration failed:",x)}}f($n.isNativePlatform()?"/pair/setup":"/")}catch(y){const g=y instanceof Error?y.message:String(y);g.includes("timeout")||g.includes("TIMEOUT")||g.includes("503")||g.toLowerCase().includes("no responders")?u("Code not found or expired. Check the code and try again."):u(g)}finally{s(!1)}}return b.jsx("div",{className:"pair-page",children:b.jsxs("div",{className:"pair-card",children:[b.jsxs("div",{className:"pair-header",children:[b.jsx("h1",{className:"pair-title",children:ea?"Pair":"Pair with Host"}),b.jsx("p",{className:"pair-subtitle",children:ea?"Enter the pairing code shown in your terminal.":"Connect this device to a Palmier host"})]}),!ea&&b.jsxs("div",{className:"pair-instructions",children:[b.jsxs("div",{className:"pair-instruction-block",children:[b.jsx("h3",{className:"pair-instruction-heading",children:"Setting up a new host?"}),b.jsxs("ol",{className:"pair-steps",children:[b.jsxs("li",{children:["Install at least one agent CLI (e.g., ",b.jsx("a",{href:"https://www.palmier.me/agents",target:"_blank",rel:"noopener noreferrer",children:"Claude Code, Gemini CLI, Codex CLI"}),")"]}),b.jsxs("li",{children:["Install Palmier on your host machine:",b.jsx("code",{className:"pair-command",children:"npm install -g palmier"})]}),b.jsxs("li",{children:["Run the setup wizard:",b.jsx("code",{className:"pair-command",children:"palmier init"})]}),b.jsx("li",{children:"A pairing code will display automatically"})]})]}),b.jsx("div",{className:"pair-instruction-divider"}),b.jsxs("div",{className:"pair-instruction-block",children:[b.jsx("h3",{className:"pair-instruction-heading",children:"Pairing an existing host?"}),b.jsxs("ol",{className:"pair-steps",children:[b.jsxs("li",{children:["Run ",b.jsx("code",{children:"palmier pair"})," on the host machine"]}),b.jsx("li",{children:"Enter the 6-character code below"})]})]})]}),b.jsxs("div",{className:"pair-form",children:[b.jsxs("label",{className:"form-label",htmlFor:"pair-code",children:["Pairing code",b.jsx("input",{id:"pair-code",type:"text",maxLength:6,value:e,onChange:d=>n(d.target.value.toUpperCase()),placeholder:"A7K9M2",className:"form-input form-input-mono pair-code-input",autoFocus:!0,autoComplete:"off",disabled:r})]}),l&&b.jsx("p",{className:"pair-error",children:l}),b.jsxs("button",{className:"btn btn-primary btn-full",onClick:m,disabled:r||!e.trim(),children:[r&&b.jsx("span",{className:"btn-spinner"}),r?"Pairing...":"Pair"]}),b.jsx("button",{className:"btn btn-secondary btn-full",onClick:()=>f("/"),disabled:r,children:"Cancel"}),b.jsxs("p",{className:"pair-consent",children:["By pairing, you agree to our"," ",b.jsx("a",{href:"https://www.palmier.me/terms",target:"_blank",rel:"noopener noreferrer",children:"Terms of Service"})," and"," ",b.jsx("a",{href:"https://www.palmier.me/privacy",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}),"."]})]})]})})}function mO(){const e=ti(),{connected:n,request:r}=Sa(),{getActiveHost:s}=va(),l=s(),u=(l==null?void 0:l.clientToken)??null,[c,f]=N.useState({}),[m,d]=N.useState(!1);return N.useEffect(()=>{l||e("/",{replace:!0})},[l,e]),N.useEffect(()=>{if(!n||!l)return;let y=!1;return r("host.info").then(g=>{y||(f(g.capability_tokens??{}),d(!0))}).catch(()=>{y||d(!0)}),()=>{y=!0}},[n,l,r]),b.jsx("div",{className:"pair-setup",children:b.jsxs("div",{className:"pair-setup-inner",children:[b.jsx("h1",{className:"pair-setup-title",children:"What capabilities of this device do you want your host computer to have?"}),b.jsx("p",{className:"pair-setup-description",children:"You can change these later from the menu."}),m?b.jsx(Dx,{capabilityTokens:c,activeClientToken:u,request:r,onCapabilityTokensChange:f}):b.jsx("div",{className:"pair-setup-loading",children:"Connecting to host…"}),b.jsx("div",{className:"pair-setup-actions",children:b.jsx("button",{className:"btn btn-primary btn-full",onClick:()=>e("/",{replace:!0}),children:"Finish"})})]})})}function pO(){const e=ti();return N.useEffect(()=>{if(!Ut)return;const n=Ut.addListener("deepLink",({path:r})=>e(r));return()=>{n.then(r=>r.remove())}},[e]),null}function gO(){return b.jsx(P_,{children:b.jsxs(pk,{children:[b.jsx(pO,{}),b.jsxs(t_,{children:[b.jsx(Mi,{path:"/",element:b.jsx(El,{})}),b.jsx(Mi,{path:"/tasks",element:b.jsx(El,{})}),b.jsx(Mi,{path:"/runs",element:b.jsx(El,{})}),b.jsx(Mi,{path:"/runs/:taskId",element:b.jsx(El,{})}),b.jsx(Mi,{path:"/runs/:taskId/:runId",element:b.jsx(El,{})}),b.jsx(Mi,{path:"/pair",element:b.jsx(dO,{})}),b.jsx(Mi,{path:"/pair/setup",element:b.jsx(mO,{})})]})]})})}rS.createRoot(document.getElementById("root")).render(b.jsx(N.StrictMode,{children:b.jsx(k_,{children:b.jsx(gO,{})})}));export{Pd as W};