@jyork0828/pi-pilot 0.0.1 → 0.0.3

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.
@@ -1,218 +0,0 @@
1
- var a1=Object.defineProperty;var rf=e=>{throw TypeError(e)};var u1=(e,t,n)=>t in e?a1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qt=(e,t,n)=>u1(e,typeof t!="symbol"?t+"":t,n),na=(e,t,n)=>t.has(e)||rf("Cannot "+n);var C=(e,t,n)=>(na(e,t,"read from private field"),n?n.call(e):t.get(e)),Q=(e,t,n)=>t.has(e)?rf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),D=(e,t,n,r)=>(na(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Y=(e,t,n)=>(na(e,t,"access private method"),n);var cs=(e,t,n,r)=>({set _(i){D(e,t,i,n)},get _(){return C(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Ys=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xh={exports:{}},Tl={},Jh={exports:{}},ee={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its 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 es=Symbol.for("react.element"),c1=Symbol.for("react.portal"),d1=Symbol.for("react.fragment"),f1=Symbol.for("react.strict_mode"),p1=Symbol.for("react.profiler"),h1=Symbol.for("react.provider"),m1=Symbol.for("react.context"),g1=Symbol.for("react.forward_ref"),x1=Symbol.for("react.suspense"),y1=Symbol.for("react.memo"),v1=Symbol.for("react.lazy"),of=Symbol.iterator;function k1(e){return e===null||typeof e!="object"?null:(e=of&&e[of]||e["@@iterator"],typeof e=="function"?e:null)}var Zh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},em=Object.assign,tm={};function Oi(e,t,n){this.props=e,this.context=t,this.refs=tm,this.updater=n||Zh}Oi.prototype.isReactComponent={};Oi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Oi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function nm(){}nm.prototype=Oi.prototype;function Sc(e,t,n){this.props=e,this.context=t,this.refs=tm,this.updater=n||Zh}var Cc=Sc.prototype=new nm;Cc.constructor=Sc;em(Cc,Oi.prototype);Cc.isPureReactComponent=!0;var sf=Array.isArray,rm=Object.prototype.hasOwnProperty,jc={current:null},im={key:!0,ref:!0,__self:!0,__source:!0};function om(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)rm.call(t,r)&&!im.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var a=Array(l),c=0;c<l;c++)a[c]=arguments[c+2];i.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:es,type:e,key:o,ref:s,props:i,_owner:jc.current}}function b1(e,t){return{$$typeof:es,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ec(e){return typeof e=="object"&&e!==null&&e.$$typeof===es}function w1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var lf=/\/+/g;function ra(e,t){return typeof e=="object"&&e!==null&&e.key!=null?w1(""+e.key):t.toString(36)}function As(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case es:case c1:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+ra(s,0):r,sf(i)?(n="",e!=null&&(n=e.replace(lf,"$&/")+"/"),As(i,t,n,"",function(c){return c})):i!=null&&(Ec(i)&&(i=b1(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(lf,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",sf(e))for(var l=0;l<e.length;l++){o=e[l];var a=r+ra(o,l);s+=As(o,t,n,a,i)}else if(a=k1(e),typeof a=="function")for(e=a.call(e),l=0;!(o=e.next()).done;)o=o.value,a=r+ra(o,l++),s+=As(o,t,n,a,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function ds(e,t,n){if(e==null)return e;var r=[],i=0;return As(e,r,"","",function(o){return t.call(n,o,i++)}),r}function S1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var tt={current:null},zs={transition:null},C1={ReactCurrentDispatcher:tt,ReactCurrentBatchConfig:zs,ReactCurrentOwner:jc};function sm(){throw Error("act(...) is not supported in production builds of React.")}ee.Children={map:ds,forEach:function(e,t,n){ds(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ds(e,function(){t++}),t},toArray:function(e){return ds(e,function(t){return t})||[]},only:function(e){if(!Ec(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ee.Component=Oi;ee.Fragment=d1;ee.Profiler=p1;ee.PureComponent=Sc;ee.StrictMode=f1;ee.Suspense=x1;ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=C1;ee.act=sm;ee.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=em({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=jc.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)rm.call(t,a)&&!im.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:es,type:e.type,key:i,ref:o,props:r,_owner:s}};ee.createContext=function(e){return e={$$typeof:m1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:h1,_context:e},e.Consumer=e};ee.createElement=om;ee.createFactory=function(e){var t=om.bind(null,e);return t.type=e,t};ee.createRef=function(){return{current:null}};ee.forwardRef=function(e){return{$$typeof:g1,render:e}};ee.isValidElement=Ec;ee.lazy=function(e){return{$$typeof:v1,_payload:{_status:-1,_result:e},_init:S1}};ee.memo=function(e,t){return{$$typeof:y1,type:e,compare:t===void 0?null:t}};ee.startTransition=function(e){var t=zs.transition;zs.transition={};try{e()}finally{zs.transition=t}};ee.unstable_act=sm;ee.useCallback=function(e,t){return tt.current.useCallback(e,t)};ee.useContext=function(e){return tt.current.useContext(e)};ee.useDebugValue=function(){};ee.useDeferredValue=function(e){return tt.current.useDeferredValue(e)};ee.useEffect=function(e,t){return tt.current.useEffect(e,t)};ee.useId=function(){return tt.current.useId()};ee.useImperativeHandle=function(e,t,n){return tt.current.useImperativeHandle(e,t,n)};ee.useInsertionEffect=function(e,t){return tt.current.useInsertionEffect(e,t)};ee.useLayoutEffect=function(e,t){return tt.current.useLayoutEffect(e,t)};ee.useMemo=function(e,t){return tt.current.useMemo(e,t)};ee.useReducer=function(e,t,n){return tt.current.useReducer(e,t,n)};ee.useRef=function(e){return tt.current.useRef(e)};ee.useState=function(e){return tt.current.useState(e)};ee.useSyncExternalStore=function(e,t,n){return tt.current.useSyncExternalStore(e,t,n)};ee.useTransition=function(){return tt.current.useTransition()};ee.version="18.3.1";Jh.exports=ee;var N=Jh.exports;const fs=wc(N);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its 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 j1=N,E1=Symbol.for("react.element"),N1=Symbol.for("react.fragment"),P1=Object.prototype.hasOwnProperty,T1=j1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,I1={key:!0,ref:!0,__self:!0,__source:!0};function lm(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)P1.call(t,r)&&!I1.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:E1,type:e,key:o,ref:s,props:i,_owner:T1.current}}Tl.Fragment=N1;Tl.jsx=lm;Tl.jsxs=lm;Xh.exports=Tl;var u=Xh.exports,am={exports:{}},Ct={},um={exports:{}},cm={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its 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
- */(function(e){function t(M,H){var k=M.length;M.push(H);e:for(;0<k;){var K=k-1>>>1,te=M[K];if(0<i(te,H))M[K]=H,M[k]=te,k=K;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var H=M[0],k=M.pop();if(k!==H){M[0]=k;e:for(var K=0,te=M.length,w=te>>>1;K<w;){var ke=2*(K+1)-1,rt=M[ke],me=ke+1,qt=M[me];if(0>i(rt,k))me<te&&0>i(qt,rt)?(M[K]=qt,M[me]=k,K=me):(M[K]=rt,M[ke]=k,K=ke);else if(me<te&&0>i(qt,k))M[K]=qt,M[me]=k,K=me;else break e}}return H}function i(M,H){var k=M.sortIndex-H.sortIndex;return k!==0?k:M.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],c=[],f=1,d=null,p=3,h=!1,m=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(M){for(var H=n(c);H!==null;){if(H.callback===null)r(c);else if(H.startTime<=M)r(c),H.sortIndex=H.expirationTime,t(a,H);else break;H=n(c)}}function S(M){if(v=!1,y(M),!m)if(n(a)!==null)m=!0,le(P);else{var H=n(c);H!==null&&oe(S,H.startTime-M)}}function P(M,H){m=!1,v&&(v=!1,g(T),T=-1),h=!0;var k=p;try{for(y(H),d=n(a);d!==null&&(!(d.expirationTime>H)||M&&!A());){var K=d.callback;if(typeof K=="function"){d.callback=null,p=d.priorityLevel;var te=K(d.expirationTime<=H);H=e.unstable_now(),typeof te=="function"?d.callback=te:d===n(a)&&r(a),y(H)}else r(a);d=n(a)}if(d!==null)var w=!0;else{var ke=n(c);ke!==null&&oe(S,ke.startTime-H),w=!1}return w}finally{d=null,p=k,h=!1}}var E=!1,I=null,T=-1,L=5,j=-1;function A(){return!(e.unstable_now()-j<L)}function R(){if(I!==null){var M=e.unstable_now();j=M;var H=!0;try{H=I(!0,M)}finally{H?$():(E=!1,I=null)}}else E=!1}var $;if(typeof x=="function")$=function(){x(R)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,q=U.port2;U.port1.onmessage=R,$=function(){q.postMessage(null)}}else $=function(){b(R,0)};function le(M){I=M,E||(E=!0,$())}function oe(M,H){T=b(function(){M(e.unstable_now())},H)}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(M){M.callback=null},e.unstable_continueExecution=function(){m||h||(m=!0,le(P))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(M){switch(p){case 1:case 2:case 3:var H=3;break;default:H=p}var k=p;p=H;try{return M()}finally{p=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,H){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var k=p;p=M;try{return H()}finally{p=k}},e.unstable_scheduleCallback=function(M,H,k){var K=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?K+k:K):k=K,M){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=k+te,M={id:f++,callback:H,priorityLevel:M,startTime:k,expirationTime:te,sortIndex:-1},k>K?(M.sortIndex=k,t(c,M),n(a)===null&&M===n(c)&&(v?(g(T),T=-1):v=!0,oe(S,k-K))):(M.sortIndex=te,t(a,M),m||h||(m=!0,le(P))),M},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(M){var H=p;return function(){var k=p;p=H;try{return M.apply(this,arguments)}finally{p=k}}}})(cm);um.exports=cm;var _1=um.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its 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 R1=N,St=_1;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var dm=new Set,jo={};function $r(e,t){Ii(e,t),Ii(e+"Capture",t)}function Ii(e,t){for(jo[e]=t,e=0;e<t.length;e++)dm.add(t[e])}var kn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ja=Object.prototype.hasOwnProperty,L1=/^[: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]*$/,af={},uf={};function A1(e){return Ja.call(uf,e)?!0:Ja.call(af,e)?!1:L1.test(e)?uf[e]=!0:(af[e]=!0,!1)}function z1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function F1(e,t,n,r){if(t===null||typeof t>"u"||z1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function nt(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Be[e]=new nt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Be[t]=new nt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Be[e]=new nt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Be[e]=new nt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Be[e]=new nt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Be[e]=new nt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Be[e]=new nt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Be[e]=new nt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Be[e]=new nt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Nc=/[\-:]([a-z])/g;function Pc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Nc,Pc);Be[t]=new nt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Nc,Pc);Be[t]=new nt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Nc,Pc);Be[t]=new nt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Be[e]=new nt(e,1,!1,e.toLowerCase(),null,!1,!1)});Be.xlinkHref=new nt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Be[e]=new nt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Tc(e,t,n,r){var i=Be.hasOwnProperty(t)?Be[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(F1(t,n,i,r)&&(n=null),r||i===null?A1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Cn=R1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ps=Symbol.for("react.element"),Xr=Symbol.for("react.portal"),Jr=Symbol.for("react.fragment"),Ic=Symbol.for("react.strict_mode"),Za=Symbol.for("react.profiler"),fm=Symbol.for("react.provider"),pm=Symbol.for("react.context"),_c=Symbol.for("react.forward_ref"),eu=Symbol.for("react.suspense"),tu=Symbol.for("react.suspense_list"),Rc=Symbol.for("react.memo"),Rn=Symbol.for("react.lazy"),hm=Symbol.for("react.offscreen"),cf=Symbol.iterator;function Gi(e){return e===null||typeof e!="object"?null:(e=cf&&e[cf]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Object.assign,ia;function lo(e){if(ia===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ia=t&&t[1]||""}return`
34
- `+ia+e}var oa=!1;function sa(e,t){if(!e||oa)return"";oa=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
- `),o=r.stack.split(`
36
- `),s=i.length-1,l=o.length-1;1<=s&&0<=l&&i[s]!==o[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==o[l]){if(s!==1||l!==1)do if(s--,l--,0>l||i[s]!==o[l]){var a=`
37
- `+i[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{oa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?lo(e):""}function M1(e){switch(e.tag){case 5:return lo(e.type);case 16:return lo("Lazy");case 13:return lo("Suspense");case 19:return lo("SuspenseList");case 0:case 2:case 15:return e=sa(e.type,!1),e;case 11:return e=sa(e.type.render,!1),e;case 1:return e=sa(e.type,!0),e;default:return""}}function nu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Jr:return"Fragment";case Xr:return"Portal";case Za:return"Profiler";case Ic:return"StrictMode";case eu:return"Suspense";case tu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case pm:return(e.displayName||"Context")+".Consumer";case fm:return(e._context.displayName||"Context")+".Provider";case _c:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Rc:return t=e.displayName||null,t!==null?t:nu(e.type)||"Memo";case Rn:t=e._payload,e=e._init;try{return nu(e(t))}catch{}}return null}function O1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return nu(t);case 8:return t===Ic?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ir(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function mm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function D1(e){var t=mm(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function hs(e){e._valueTracker||(e._valueTracker=D1(e))}function gm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=mm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Xs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ru(e,t){var n=t.checked;return Se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function df(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ir(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function xm(e,t){t=t.checked,t!=null&&Tc(e,"checked",t,!1)}function iu(e,t){xm(e,t);var n=ir(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ou(e,t.type,n):t.hasOwnProperty("defaultValue")&&ou(e,t.type,ir(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ff(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ou(e,t,n){(t!=="number"||Xs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ao=Array.isArray;function ui(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ir(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function su(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(z(91));return Se({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function pf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(z(92));if(ao(n)){if(1<n.length)throw Error(z(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ir(n)}}function ym(e,t){var n=ir(t.value),r=ir(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function hf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function vm(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function lu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?vm(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ms,km=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ms=ms||document.createElement("div"),ms.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ms.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Eo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var po={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$1=["Webkit","ms","Moz","O"];Object.keys(po).forEach(function(e){$1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),po[t]=po[e]})});function bm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||po.hasOwnProperty(e)&&po[e]?(""+t).trim():t+"px"}function wm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=bm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var B1=Se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function au(e,t){if(t){if(B1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function uu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cu=null;function Lc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var du=null,ci=null,di=null;function mf(e){if(e=rs(e)){if(typeof du!="function")throw Error(z(280));var t=e.stateNode;t&&(t=Al(t),du(e.stateNode,e.type,t))}}function Sm(e){ci?di?di.push(e):di=[e]:ci=e}function Cm(){if(ci){var e=ci,t=di;if(di=ci=null,mf(e),t)for(e=0;e<t.length;e++)mf(t[e])}}function jm(e,t){return e(t)}function Em(){}var la=!1;function Nm(e,t,n){if(la)return e(t,n);la=!0;try{return jm(e,t,n)}finally{la=!1,(ci!==null||di!==null)&&(Em(),Cm())}}function No(e,t){var n=e.stateNode;if(n===null)return null;var r=Al(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(z(231,t,typeof n));return n}var fu=!1;if(kn)try{var Yi={};Object.defineProperty(Yi,"passive",{get:function(){fu=!0}}),window.addEventListener("test",Yi,Yi),window.removeEventListener("test",Yi,Yi)}catch{fu=!1}function U1(e,t,n,r,i,o,s,l,a){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(f){this.onError(f)}}var ho=!1,Js=null,Zs=!1,pu=null,H1={onError:function(e){ho=!0,Js=e}};function q1(e,t,n,r,i,o,s,l,a){ho=!1,Js=null,U1.apply(H1,arguments)}function Q1(e,t,n,r,i,o,s,l,a){if(q1.apply(this,arguments),ho){if(ho){var c=Js;ho=!1,Js=null}else throw Error(z(198));Zs||(Zs=!0,pu=c)}}function Br(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Pm(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function gf(e){if(Br(e)!==e)throw Error(z(188))}function V1(e){var t=e.alternate;if(!t){if(t=Br(e),t===null)throw Error(z(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return gf(i),e;if(o===r)return gf(i),t;o=o.sibling}throw Error(z(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(z(189))}}if(n.alternate!==r)throw Error(z(190))}if(n.tag!==3)throw Error(z(188));return n.stateNode.current===n?e:t}function Tm(e){return e=V1(e),e!==null?Im(e):null}function Im(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Im(e);if(t!==null)return t;e=e.sibling}return null}var _m=St.unstable_scheduleCallback,xf=St.unstable_cancelCallback,W1=St.unstable_shouldYield,K1=St.unstable_requestPaint,Ne=St.unstable_now,G1=St.unstable_getCurrentPriorityLevel,Ac=St.unstable_ImmediatePriority,Rm=St.unstable_UserBlockingPriority,el=St.unstable_NormalPriority,Y1=St.unstable_LowPriority,Lm=St.unstable_IdlePriority,Il=null,Zt=null;function X1(e){if(Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(Il,e,void 0,(e.current.flags&128)===128)}catch{}}var $t=Math.clz32?Math.clz32:ev,J1=Math.log,Z1=Math.LN2;function ev(e){return e>>>=0,e===0?32:31-(J1(e)/Z1|0)|0}var gs=64,xs=4194304;function uo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function tl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=uo(l):(o&=s,o!==0&&(r=uo(o)))}else s=n&~i,s!==0?r=uo(s):o!==0&&(r=uo(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-$t(t),i=1<<n,r|=e[n],t&=~i;return r}function tv(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-$t(o),l=1<<s,a=i[s];a===-1?(!(l&n)||l&r)&&(i[s]=tv(l,t)):a<=t&&(e.expiredLanes|=l),o&=~l}}function hu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Am(){var e=gs;return gs<<=1,!(gs&4194240)&&(gs=64),e}function aa(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ts(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$t(t),e[t]=n}function rv(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-$t(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function zc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$t(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ue=0;function zm(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Fm,Fc,Mm,Om,Dm,mu=!1,ys=[],Kn=null,Gn=null,Yn=null,Po=new Map,To=new Map,An=[],iv="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 submit".split(" ");function yf(e,t){switch(e){case"focusin":case"focusout":Kn=null;break;case"dragenter":case"dragleave":Gn=null;break;case"mouseover":case"mouseout":Yn=null;break;case"pointerover":case"pointerout":Po.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":To.delete(t.pointerId)}}function Xi(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=rs(t),t!==null&&Fc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function ov(e,t,n,r,i){switch(t){case"focusin":return Kn=Xi(Kn,e,t,n,r,i),!0;case"dragenter":return Gn=Xi(Gn,e,t,n,r,i),!0;case"mouseover":return Yn=Xi(Yn,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return Po.set(o,Xi(Po.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,To.set(o,Xi(To.get(o)||null,e,t,n,r,i)),!0}return!1}function $m(e){var t=xr(e.target);if(t!==null){var n=Br(t);if(n!==null){if(t=n.tag,t===13){if(t=Pm(n),t!==null){e.blockedOn=t,Dm(e.priority,function(){Mm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cu=r,n.target.dispatchEvent(r),cu=null}else return t=rs(n),t!==null&&Fc(t),e.blockedOn=n,!1;t.shift()}return!0}function vf(e,t,n){Fs(e)&&n.delete(t)}function sv(){mu=!1,Kn!==null&&Fs(Kn)&&(Kn=null),Gn!==null&&Fs(Gn)&&(Gn=null),Yn!==null&&Fs(Yn)&&(Yn=null),Po.forEach(vf),To.forEach(vf)}function Ji(e,t){e.blockedOn===t&&(e.blockedOn=null,mu||(mu=!0,St.unstable_scheduleCallback(St.unstable_NormalPriority,sv)))}function Io(e){function t(i){return Ji(i,e)}if(0<ys.length){Ji(ys[0],e);for(var n=1;n<ys.length;n++){var r=ys[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Kn!==null&&Ji(Kn,e),Gn!==null&&Ji(Gn,e),Yn!==null&&Ji(Yn,e),Po.forEach(t),To.forEach(t),n=0;n<An.length;n++)r=An[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<An.length&&(n=An[0],n.blockedOn===null);)$m(n),n.blockedOn===null&&An.shift()}var fi=Cn.ReactCurrentBatchConfig,nl=!0;function lv(e,t,n,r){var i=ue,o=fi.transition;fi.transition=null;try{ue=1,Mc(e,t,n,r)}finally{ue=i,fi.transition=o}}function av(e,t,n,r){var i=ue,o=fi.transition;fi.transition=null;try{ue=4,Mc(e,t,n,r)}finally{ue=i,fi.transition=o}}function Mc(e,t,n,r){if(nl){var i=gu(e,t,n,r);if(i===null)ya(e,t,r,rl,n),yf(e,r);else if(ov(i,e,t,n,r))r.stopPropagation();else if(yf(e,r),t&4&&-1<iv.indexOf(e)){for(;i!==null;){var o=rs(i);if(o!==null&&Fm(o),o=gu(e,t,n,r),o===null&&ya(e,t,r,rl,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else ya(e,t,r,null,n)}}var rl=null;function gu(e,t,n,r){if(rl=null,e=Lc(r),e=xr(e),e!==null)if(t=Br(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Pm(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return rl=e,null}function Bm(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(G1()){case Ac:return 1;case Rm:return 4;case el:case Y1:return 16;case Lm:return 536870912;default:return 16}default:return 16}}var Qn=null,Oc=null,Ms=null;function Um(){if(Ms)return Ms;var e,t=Oc,n=t.length,r,i="value"in Qn?Qn.value:Qn.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return Ms=i.slice(e,1<r?1-r:void 0)}function Os(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function vs(){return!0}function kf(){return!1}function jt(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?vs:kf,this.isPropagationStopped=kf,this}return Se(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=vs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=vs)},persist:function(){},isPersistent:vs}),t}var Di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dc=jt(Di),ns=Se({},Di,{view:0,detail:0}),uv=jt(ns),ua,ca,Zi,_l=Se({},ns,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$c,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Zi&&(Zi&&e.type==="mousemove"?(ua=e.screenX-Zi.screenX,ca=e.screenY-Zi.screenY):ca=ua=0,Zi=e),ua)},movementY:function(e){return"movementY"in e?e.movementY:ca}}),bf=jt(_l),cv=Se({},_l,{dataTransfer:0}),dv=jt(cv),fv=Se({},ns,{relatedTarget:0}),da=jt(fv),pv=Se({},Di,{animationName:0,elapsedTime:0,pseudoElement:0}),hv=jt(pv),mv=Se({},Di,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),gv=jt(mv),xv=Se({},Di,{data:0}),wf=jt(xv),yv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vv={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"},kv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kv[e])?!!t[e]:!1}function $c(){return bv}var wv=Se({},ns,{key:function(e){if(e.key){var t=yv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Os(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$c,charCode:function(e){return e.type==="keypress"?Os(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Os(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Sv=jt(wv),Cv=Se({},_l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sf=jt(Cv),jv=Se({},ns,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$c}),Ev=jt(jv),Nv=Se({},Di,{propertyName:0,elapsedTime:0,pseudoElement:0}),Pv=jt(Nv),Tv=Se({},_l,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Iv=jt(Tv),_v=[9,13,27,32],Bc=kn&&"CompositionEvent"in window,mo=null;kn&&"documentMode"in document&&(mo=document.documentMode);var Rv=kn&&"TextEvent"in window&&!mo,Hm=kn&&(!Bc||mo&&8<mo&&11>=mo),Cf=" ",jf=!1;function qm(e,t){switch(e){case"keyup":return _v.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zr=!1;function Lv(e,t){switch(e){case"compositionend":return Qm(t);case"keypress":return t.which!==32?null:(jf=!0,Cf);case"textInput":return e=t.data,e===Cf&&jf?null:e;default:return null}}function Av(e,t){if(Zr)return e==="compositionend"||!Bc&&qm(e,t)?(e=Um(),Ms=Oc=Qn=null,Zr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Hm&&t.locale!=="ko"?null:t.data;default:return null}}var zv={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 Ef(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!zv[e.type]:t==="textarea"}function Vm(e,t,n,r){Sm(r),t=il(t,"onChange"),0<t.length&&(n=new Dc("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var go=null,_o=null;function Fv(e){rg(e,0)}function Rl(e){var t=ni(e);if(gm(t))return e}function Mv(e,t){if(e==="change")return t}var Wm=!1;if(kn){var fa;if(kn){var pa="oninput"in document;if(!pa){var Nf=document.createElement("div");Nf.setAttribute("oninput","return;"),pa=typeof Nf.oninput=="function"}fa=pa}else fa=!1;Wm=fa&&(!document.documentMode||9<document.documentMode)}function Pf(){go&&(go.detachEvent("onpropertychange",Km),_o=go=null)}function Km(e){if(e.propertyName==="value"&&Rl(_o)){var t=[];Vm(t,_o,e,Lc(e)),Nm(Fv,t)}}function Ov(e,t,n){e==="focusin"?(Pf(),go=t,_o=n,go.attachEvent("onpropertychange",Km)):e==="focusout"&&Pf()}function Dv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Rl(_o)}function $v(e,t){if(e==="click")return Rl(t)}function Bv(e,t){if(e==="input"||e==="change")return Rl(t)}function Uv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ht=typeof Object.is=="function"?Object.is:Uv;function Ro(e,t){if(Ht(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ja.call(t,i)||!Ht(e[i],t[i]))return!1}return!0}function Tf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function If(e,t){var n=Tf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Tf(n)}}function Gm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ym(){for(var e=window,t=Xs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Xs(e.document)}return t}function Uc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Hv(e){var t=Ym(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Gm(n.ownerDocument.documentElement,n)){if(r!==null&&Uc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=If(n,o);var s=If(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var qv=kn&&"documentMode"in document&&11>=document.documentMode,ei=null,xu=null,xo=null,yu=!1;function _f(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yu||ei==null||ei!==Xs(r)||(r=ei,"selectionStart"in r&&Uc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),xo&&Ro(xo,r)||(xo=r,r=il(xu,"onSelect"),0<r.length&&(t=new Dc("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ei)))}function ks(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ti={animationend:ks("Animation","AnimationEnd"),animationiteration:ks("Animation","AnimationIteration"),animationstart:ks("Animation","AnimationStart"),transitionend:ks("Transition","TransitionEnd")},ha={},Xm={};kn&&(Xm=document.createElement("div").style,"AnimationEvent"in window||(delete ti.animationend.animation,delete ti.animationiteration.animation,delete ti.animationstart.animation),"TransitionEvent"in window||delete ti.transitionend.transition);function Ll(e){if(ha[e])return ha[e];if(!ti[e])return e;var t=ti[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Xm)return ha[e]=t[n];return e}var Jm=Ll("animationend"),Zm=Ll("animationiteration"),eg=Ll("animationstart"),tg=Ll("transitionend"),ng=new Map,Rf="abort auxClick 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(" ");function sr(e,t){ng.set(e,t),$r(t,[e])}for(var ma=0;ma<Rf.length;ma++){var ga=Rf[ma],Qv=ga.toLowerCase(),Vv=ga[0].toUpperCase()+ga.slice(1);sr(Qv,"on"+Vv)}sr(Jm,"onAnimationEnd");sr(Zm,"onAnimationIteration");sr(eg,"onAnimationStart");sr("dblclick","onDoubleClick");sr("focusin","onFocus");sr("focusout","onBlur");sr(tg,"onTransitionEnd");Ii("onMouseEnter",["mouseout","mouseover"]);Ii("onMouseLeave",["mouseout","mouseover"]);Ii("onPointerEnter",["pointerout","pointerover"]);Ii("onPointerLeave",["pointerout","pointerover"]);$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$r("onBeforeInput",["compositionend","keypress","textInput","paste"]);$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var co="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(" "),Wv=new Set("cancel close invalid load scroll toggle".split(" ").concat(co));function Lf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Q1(r,t,void 0,e),e.currentTarget=null}function rg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==o&&i.isPropagationStopped())break e;Lf(i,l,c),o=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,c=l.currentTarget,l=l.listener,a!==o&&i.isPropagationStopped())break e;Lf(i,l,c),o=a}}}if(Zs)throw e=pu,Zs=!1,pu=null,e}function xe(e,t){var n=t[Su];n===void 0&&(n=t[Su]=new Set);var r=e+"__bubble";n.has(r)||(ig(t,e,2,!1),n.add(r))}function xa(e,t,n){var r=0;t&&(r|=4),ig(n,e,r,t)}var bs="_reactListening"+Math.random().toString(36).slice(2);function Lo(e){if(!e[bs]){e[bs]=!0,dm.forEach(function(n){n!=="selectionchange"&&(Wv.has(n)||xa(n,!1,e),xa(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bs]||(t[bs]=!0,xa("selectionchange",!1,t))}}function ig(e,t,n,r){switch(Bm(t)){case 1:var i=lv;break;case 4:i=av;break;default:i=Mc}n=i.bind(null,t,n,e),i=void 0,!fu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function ya(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;s=s.return}for(;l!==null;){if(s=xr(l),s===null)return;if(a=s.tag,a===5||a===6){r=o=s;continue e}l=l.parentNode}}r=r.return}Nm(function(){var c=o,f=Lc(n),d=[];e:{var p=ng.get(e);if(p!==void 0){var h=Dc,m=e;switch(e){case"keypress":if(Os(n)===0)break e;case"keydown":case"keyup":h=Sv;break;case"focusin":m="focus",h=da;break;case"focusout":m="blur",h=da;break;case"beforeblur":case"afterblur":h=da;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=bf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=dv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Ev;break;case Jm:case Zm:case eg:h=hv;break;case tg:h=Pv;break;case"scroll":h=uv;break;case"wheel":h=Iv;break;case"copy":case"cut":case"paste":h=gv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Sf}var v=(t&4)!==0,b=!v&&e==="scroll",g=v?p!==null?p+"Capture":null:p;v=[];for(var x=c,y;x!==null;){y=x;var S=y.stateNode;if(y.tag===5&&S!==null&&(y=S,g!==null&&(S=No(x,g),S!=null&&v.push(Ao(x,S,y)))),b)break;x=x.return}0<v.length&&(p=new h(p,m,null,n,f),d.push({event:p,listeners:v}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==cu&&(m=n.relatedTarget||n.fromElement)&&(xr(m)||m[bn]))break e;if((h||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=c,m=m?xr(m):null,m!==null&&(b=Br(m),m!==b||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=c),h!==m)){if(v=bf,S="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(v=Sf,S="onPointerLeave",g="onPointerEnter",x="pointer"),b=h==null?p:ni(h),y=m==null?p:ni(m),p=new v(S,x+"leave",h,n,f),p.target=b,p.relatedTarget=y,S=null,xr(f)===c&&(v=new v(g,x+"enter",m,n,f),v.target=y,v.relatedTarget=b,S=v),b=S,h&&m)t:{for(v=h,g=m,x=0,y=v;y;y=Wr(y))x++;for(y=0,S=g;S;S=Wr(S))y++;for(;0<x-y;)v=Wr(v),x--;for(;0<y-x;)g=Wr(g),y--;for(;x--;){if(v===g||g!==null&&v===g.alternate)break t;v=Wr(v),g=Wr(g)}v=null}else v=null;h!==null&&Af(d,p,h,v,!1),m!==null&&b!==null&&Af(d,b,m,v,!0)}}e:{if(p=c?ni(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var P=Mv;else if(Ef(p))if(Wm)P=Bv;else{P=Dv;var E=Ov}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(P=$v);if(P&&(P=P(e,c))){Vm(d,P,n,f);break e}E&&E(e,p,c),e==="focusout"&&(E=p._wrapperState)&&E.controlled&&p.type==="number"&&ou(p,"number",p.value)}switch(E=c?ni(c):window,e){case"focusin":(Ef(E)||E.contentEditable==="true")&&(ei=E,xu=c,xo=null);break;case"focusout":xo=xu=ei=null;break;case"mousedown":yu=!0;break;case"contextmenu":case"mouseup":case"dragend":yu=!1,_f(d,n,f);break;case"selectionchange":if(qv)break;case"keydown":case"keyup":_f(d,n,f)}var I;if(Bc)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Zr?qm(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Hm&&n.locale!=="ko"&&(Zr||T!=="onCompositionStart"?T==="onCompositionEnd"&&Zr&&(I=Um()):(Qn=f,Oc="value"in Qn?Qn.value:Qn.textContent,Zr=!0)),E=il(c,T),0<E.length&&(T=new wf(T,e,null,n,f),d.push({event:T,listeners:E}),I?T.data=I:(I=Qm(n),I!==null&&(T.data=I)))),(I=Rv?Lv(e,n):Av(e,n))&&(c=il(c,"onBeforeInput"),0<c.length&&(f=new wf("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:c}),f.data=I))}rg(d,t)})}function Ao(e,t,n){return{instance:e,listener:t,currentTarget:n}}function il(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=No(e,n),o!=null&&r.unshift(Ao(e,o,i)),o=No(e,t),o!=null&&r.push(Ao(e,o,i))),e=e.return}return r}function Wr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Af(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,c=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&c!==null&&(l=c,i?(a=No(n,o),a!=null&&s.unshift(Ao(n,a,l))):i||(a=No(n,o),a!=null&&s.push(Ao(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Kv=/\r\n?/g,Gv=/\u0000|\uFFFD/g;function zf(e){return(typeof e=="string"?e:""+e).replace(Kv,`
38
- `).replace(Gv,"")}function ws(e,t,n){if(t=zf(t),zf(e)!==t&&n)throw Error(z(425))}function ol(){}var vu=null,ku=null;function bu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wu=typeof setTimeout=="function"?setTimeout:void 0,Yv=typeof clearTimeout=="function"?clearTimeout:void 0,Ff=typeof Promise=="function"?Promise:void 0,Xv=typeof queueMicrotask=="function"?queueMicrotask:typeof Ff<"u"?function(e){return Ff.resolve(null).then(e).catch(Jv)}:wu;function Jv(e){setTimeout(function(){throw e})}function va(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Io(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Io(t)}function Xn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Mf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var $i=Math.random().toString(36).slice(2),Jt="__reactFiber$"+$i,zo="__reactProps$"+$i,bn="__reactContainer$"+$i,Su="__reactEvents$"+$i,Zv="__reactListeners$"+$i,e0="__reactHandles$"+$i;function xr(e){var t=e[Jt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[bn]||n[Jt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Mf(e);e!==null;){if(n=e[Jt])return n;e=Mf(e)}return t}e=n,n=e.parentNode}return null}function rs(e){return e=e[Jt]||e[bn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ni(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(z(33))}function Al(e){return e[zo]||null}var Cu=[],ri=-1;function lr(e){return{current:e}}function ye(e){0>ri||(e.current=Cu[ri],Cu[ri]=null,ri--)}function he(e,t){ri++,Cu[ri]=e.current,e.current=t}var or={},We=lr(or),ct=lr(!1),Rr=or;function _i(e,t){var n=e.type.contextTypes;if(!n)return or;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function dt(e){return e=e.childContextTypes,e!=null}function sl(){ye(ct),ye(We)}function Of(e,t,n){if(We.current!==or)throw Error(z(168));he(We,t),he(ct,n)}function og(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(z(108,O1(e)||"Unknown",i));return Se({},n,r)}function ll(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||or,Rr=We.current,he(We,e),he(ct,ct.current),!0}function Df(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=og(e,t,Rr),r.__reactInternalMemoizedMergedChildContext=e,ye(ct),ye(We),he(We,e)):ye(ct),he(ct,n)}var dn=null,zl=!1,ka=!1;function sg(e){dn===null?dn=[e]:dn.push(e)}function t0(e){zl=!0,sg(e)}function ar(){if(!ka&&dn!==null){ka=!0;var e=0,t=ue;try{var n=dn;for(ue=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}dn=null,zl=!1}catch(i){throw dn!==null&&(dn=dn.slice(e+1)),_m(Ac,ar),i}finally{ue=t,ka=!1}}return null}var ii=[],oi=0,al=null,ul=0,Nt=[],Pt=0,Lr=null,gn=1,xn="";function pr(e,t){ii[oi++]=ul,ii[oi++]=al,al=e,ul=t}function lg(e,t,n){Nt[Pt++]=gn,Nt[Pt++]=xn,Nt[Pt++]=Lr,Lr=e;var r=gn;e=xn;var i=32-$t(r)-1;r&=~(1<<i),n+=1;var o=32-$t(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,gn=1<<32-$t(t)+i|n<<i|r,xn=o+e}else gn=1<<o|n<<i|r,xn=e}function Hc(e){e.return!==null&&(pr(e,1),lg(e,1,0))}function qc(e){for(;e===al;)al=ii[--oi],ii[oi]=null,ul=ii[--oi],ii[oi]=null;for(;e===Lr;)Lr=Nt[--Pt],Nt[Pt]=null,xn=Nt[--Pt],Nt[Pt]=null,gn=Nt[--Pt],Nt[Pt]=null}var bt=null,kt=null,ve=!1,Dt=null;function ag(e,t){var n=It(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function $f(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,bt=e,kt=Xn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,bt=e,kt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Lr!==null?{id:gn,overflow:xn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=It(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,bt=e,kt=null,!0):!1;default:return!1}}function ju(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Eu(e){if(ve){var t=kt;if(t){var n=t;if(!$f(e,t)){if(ju(e))throw Error(z(418));t=Xn(n.nextSibling);var r=bt;t&&$f(e,t)?ag(r,n):(e.flags=e.flags&-4097|2,ve=!1,bt=e)}}else{if(ju(e))throw Error(z(418));e.flags=e.flags&-4097|2,ve=!1,bt=e}}}function Bf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;bt=e}function Ss(e){if(e!==bt)return!1;if(!ve)return Bf(e),ve=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!bu(e.type,e.memoizedProps)),t&&(t=kt)){if(ju(e))throw ug(),Error(z(418));for(;t;)ag(e,t),t=Xn(t.nextSibling)}if(Bf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kt=Xn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kt=null}}else kt=bt?Xn(e.stateNode.nextSibling):null;return!0}function ug(){for(var e=kt;e;)e=Xn(e.nextSibling)}function Ri(){kt=bt=null,ve=!1}function Qc(e){Dt===null?Dt=[e]:Dt.push(e)}var n0=Cn.ReactCurrentBatchConfig;function eo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(z(309));var r=n.stateNode}if(!r)throw Error(z(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var l=i.refs;s===null?delete l[o]:l[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(z(284));if(!n._owner)throw Error(z(290,e))}return e}function Cs(e,t){throw e=Object.prototype.toString.call(t),Error(z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Uf(e){var t=e._init;return t(e._payload)}function cg(e){function t(g,x){if(e){var y=g.deletions;y===null?(g.deletions=[x],g.flags|=16):y.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function r(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function i(g,x){return g=tr(g,x),g.index=0,g.sibling=null,g}function o(g,x,y){return g.index=y,e?(y=g.alternate,y!==null?(y=y.index,y<x?(g.flags|=2,x):y):(g.flags|=2,x)):(g.flags|=1048576,x)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,x,y,S){return x===null||x.tag!==6?(x=Na(y,g.mode,S),x.return=g,x):(x=i(x,y),x.return=g,x)}function a(g,x,y,S){var P=y.type;return P===Jr?f(g,x,y.props.children,S,y.key):x!==null&&(x.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Rn&&Uf(P)===x.type)?(S=i(x,y.props),S.ref=eo(g,x,y),S.return=g,S):(S=Qs(y.type,y.key,y.props,null,g.mode,S),S.ref=eo(g,x,y),S.return=g,S)}function c(g,x,y,S){return x===null||x.tag!==4||x.stateNode.containerInfo!==y.containerInfo||x.stateNode.implementation!==y.implementation?(x=Pa(y,g.mode,S),x.return=g,x):(x=i(x,y.children||[]),x.return=g,x)}function f(g,x,y,S,P){return x===null||x.tag!==7?(x=_r(y,g.mode,S,P),x.return=g,x):(x=i(x,y),x.return=g,x)}function d(g,x,y){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Na(""+x,g.mode,y),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case ps:return y=Qs(x.type,x.key,x.props,null,g.mode,y),y.ref=eo(g,null,x),y.return=g,y;case Xr:return x=Pa(x,g.mode,y),x.return=g,x;case Rn:var S=x._init;return d(g,S(x._payload),y)}if(ao(x)||Gi(x))return x=_r(x,g.mode,y,null),x.return=g,x;Cs(g,x)}return null}function p(g,x,y,S){var P=x!==null?x.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return P!==null?null:l(g,x,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ps:return y.key===P?a(g,x,y,S):null;case Xr:return y.key===P?c(g,x,y,S):null;case Rn:return P=y._init,p(g,x,P(y._payload),S)}if(ao(y)||Gi(y))return P!==null?null:f(g,x,y,S,null);Cs(g,y)}return null}function h(g,x,y,S,P){if(typeof S=="string"&&S!==""||typeof S=="number")return g=g.get(y)||null,l(x,g,""+S,P);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ps:return g=g.get(S.key===null?y:S.key)||null,a(x,g,S,P);case Xr:return g=g.get(S.key===null?y:S.key)||null,c(x,g,S,P);case Rn:var E=S._init;return h(g,x,y,E(S._payload),P)}if(ao(S)||Gi(S))return g=g.get(y)||null,f(x,g,S,P,null);Cs(x,S)}return null}function m(g,x,y,S){for(var P=null,E=null,I=x,T=x=0,L=null;I!==null&&T<y.length;T++){I.index>T?(L=I,I=null):L=I.sibling;var j=p(g,I,y[T],S);if(j===null){I===null&&(I=L);break}e&&I&&j.alternate===null&&t(g,I),x=o(j,x,T),E===null?P=j:E.sibling=j,E=j,I=L}if(T===y.length)return n(g,I),ve&&pr(g,T),P;if(I===null){for(;T<y.length;T++)I=d(g,y[T],S),I!==null&&(x=o(I,x,T),E===null?P=I:E.sibling=I,E=I);return ve&&pr(g,T),P}for(I=r(g,I);T<y.length;T++)L=h(I,g,T,y[T],S),L!==null&&(e&&L.alternate!==null&&I.delete(L.key===null?T:L.key),x=o(L,x,T),E===null?P=L:E.sibling=L,E=L);return e&&I.forEach(function(A){return t(g,A)}),ve&&pr(g,T),P}function v(g,x,y,S){var P=Gi(y);if(typeof P!="function")throw Error(z(150));if(y=P.call(y),y==null)throw Error(z(151));for(var E=P=null,I=x,T=x=0,L=null,j=y.next();I!==null&&!j.done;T++,j=y.next()){I.index>T?(L=I,I=null):L=I.sibling;var A=p(g,I,j.value,S);if(A===null){I===null&&(I=L);break}e&&I&&A.alternate===null&&t(g,I),x=o(A,x,T),E===null?P=A:E.sibling=A,E=A,I=L}if(j.done)return n(g,I),ve&&pr(g,T),P;if(I===null){for(;!j.done;T++,j=y.next())j=d(g,j.value,S),j!==null&&(x=o(j,x,T),E===null?P=j:E.sibling=j,E=j);return ve&&pr(g,T),P}for(I=r(g,I);!j.done;T++,j=y.next())j=h(I,g,T,j.value,S),j!==null&&(e&&j.alternate!==null&&I.delete(j.key===null?T:j.key),x=o(j,x,T),E===null?P=j:E.sibling=j,E=j);return e&&I.forEach(function(R){return t(g,R)}),ve&&pr(g,T),P}function b(g,x,y,S){if(typeof y=="object"&&y!==null&&y.type===Jr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ps:e:{for(var P=y.key,E=x;E!==null;){if(E.key===P){if(P=y.type,P===Jr){if(E.tag===7){n(g,E.sibling),x=i(E,y.props.children),x.return=g,g=x;break e}}else if(E.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Rn&&Uf(P)===E.type){n(g,E.sibling),x=i(E,y.props),x.ref=eo(g,E,y),x.return=g,g=x;break e}n(g,E);break}else t(g,E);E=E.sibling}y.type===Jr?(x=_r(y.props.children,g.mode,S,y.key),x.return=g,g=x):(S=Qs(y.type,y.key,y.props,null,g.mode,S),S.ref=eo(g,x,y),S.return=g,g=S)}return s(g);case Xr:e:{for(E=y.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===y.containerInfo&&x.stateNode.implementation===y.implementation){n(g,x.sibling),x=i(x,y.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=Pa(y,g.mode,S),x.return=g,g=x}return s(g);case Rn:return E=y._init,b(g,x,E(y._payload),S)}if(ao(y))return m(g,x,y,S);if(Gi(y))return v(g,x,y,S);Cs(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,x!==null&&x.tag===6?(n(g,x.sibling),x=i(x,y),x.return=g,g=x):(n(g,x),x=Na(y,g.mode,S),x.return=g,g=x),s(g)):n(g,x)}return b}var Li=cg(!0),dg=cg(!1),cl=lr(null),dl=null,si=null,Vc=null;function Wc(){Vc=si=dl=null}function Kc(e){var t=cl.current;ye(cl),e._currentValue=t}function Nu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function pi(e,t){dl=e,Vc=si=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ut=!0),e.firstContext=null)}function Rt(e){var t=e._currentValue;if(Vc!==e)if(e={context:e,memoizedValue:t,next:null},si===null){if(dl===null)throw Error(z(308));si=e,dl.dependencies={lanes:0,firstContext:e}}else si=si.next=e;return t}var yr=null;function Gc(e){yr===null?yr=[e]:yr.push(e)}function fg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Gc(t)):(n.next=i.next,i.next=n),t.interleaved=n,wn(e,r)}function wn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ln=!1;function Yc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function yn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Jn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,se&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,wn(e,n)}return i=r.interleaved,i===null?(t.next=t,Gc(r)):(t.next=i.next,i.next=t),r.interleaved=t,wn(e,n)}function Ds(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zc(e,n)}}function Hf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function fl(e,t,n,r){var i=e.updateQueue;Ln=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,c=a.next;a.next=null,s===null?o=c:s.next=c,s=a;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==s&&(l===null?f.firstBaseUpdate=c:l.next=c,f.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;s=0,f=c=a=null,l=o;do{var p=l.lane,h=l.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,v=l;switch(p=t,h=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){d=m.call(h,d,p);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,p=typeof m=="function"?m.call(h,d,p):m,p==null)break e;d=Se({},d,p);break e;case 2:Ln=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[l]:p.push(l))}else h={eventTime:h,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(c=f=h,a=d):f=f.next=h,s|=p;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;p=l,l=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(a=d),i.baseState=a,i.firstBaseUpdate=c,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);zr|=s,e.lanes=s,e.memoizedState=d}}function qf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(z(191,i));i.call(r)}}}var is={},en=lr(is),Fo=lr(is),Mo=lr(is);function vr(e){if(e===is)throw Error(z(174));return e}function Xc(e,t){switch(he(Mo,t),he(Fo,e),he(en,is),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:lu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=lu(t,e)}ye(en),he(en,t)}function Ai(){ye(en),ye(Fo),ye(Mo)}function hg(e){vr(Mo.current);var t=vr(en.current),n=lu(t,e.type);t!==n&&(he(Fo,e),he(en,n))}function Jc(e){Fo.current===e&&(ye(en),ye(Fo))}var be=lr(0);function pl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ba=[];function Zc(){for(var e=0;e<ba.length;e++)ba[e]._workInProgressVersionPrimary=null;ba.length=0}var $s=Cn.ReactCurrentDispatcher,wa=Cn.ReactCurrentBatchConfig,Ar=0,we=null,_e=null,Fe=null,hl=!1,yo=!1,Oo=0,r0=0;function Ue(){throw Error(z(321))}function ed(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ht(e[n],t[n]))return!1;return!0}function td(e,t,n,r,i,o){if(Ar=o,we=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$s.current=e===null||e.memoizedState===null?l0:a0,e=n(r,i),yo){o=0;do{if(yo=!1,Oo=0,25<=o)throw Error(z(301));o+=1,Fe=_e=null,t.updateQueue=null,$s.current=u0,e=n(r,i)}while(yo)}if($s.current=ml,t=_e!==null&&_e.next!==null,Ar=0,Fe=_e=we=null,hl=!1,t)throw Error(z(300));return e}function nd(){var e=Oo!==0;return Oo=0,e}function Wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?we.memoizedState=Fe=e:Fe=Fe.next=e,Fe}function Lt(){if(_e===null){var e=we.alternate;e=e!==null?e.memoizedState:null}else e=_e.next;var t=Fe===null?we.memoizedState:Fe.next;if(t!==null)Fe=t,_e=e;else{if(e===null)throw Error(z(310));_e=e,e={memoizedState:_e.memoizedState,baseState:_e.baseState,baseQueue:_e.baseQueue,queue:_e.queue,next:null},Fe===null?we.memoizedState=Fe=e:Fe=Fe.next=e}return Fe}function Do(e,t){return typeof t=="function"?t(e):t}function Sa(e){var t=Lt(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=_e,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var l=s=null,a=null,c=o;do{var f=c.lane;if((Ar&f)===f)a!==null&&(a=a.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=d,s=r):a=a.next=d,we.lanes|=f,zr|=f}c=c.next}while(c!==null&&c!==o);a===null?s=r:a.next=l,Ht(r,t.memoizedState)||(ut=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,we.lanes|=o,zr|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ca(e){var t=Lt(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Ht(o,t.memoizedState)||(ut=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function mg(){}function gg(e,t){var n=we,r=Lt(),i=t(),o=!Ht(r.memoizedState,i);if(o&&(r.memoizedState=i,ut=!0),r=r.queue,rd(vg.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Fe!==null&&Fe.memoizedState.tag&1){if(n.flags|=2048,$o(9,yg.bind(null,n,r,i,t),void 0,null),Me===null)throw Error(z(349));Ar&30||xg(n,t,i)}return i}function xg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=we.updateQueue,t===null?(t={lastEffect:null,stores:null},we.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function yg(e,t,n,r){t.value=n,t.getSnapshot=r,kg(t)&&bg(e)}function vg(e,t,n){return n(function(){kg(t)&&bg(e)})}function kg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ht(e,n)}catch{return!0}}function bg(e){var t=wn(e,1);t!==null&&Bt(t,e,1,-1)}function Qf(e){var t=Wt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:e},t.queue=e,e=e.dispatch=s0.bind(null,we,e),[t.memoizedState,e]}function $o(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=we.updateQueue,t===null?(t={lastEffect:null,stores:null},we.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function wg(){return Lt().memoizedState}function Bs(e,t,n,r){var i=Wt();we.flags|=e,i.memoizedState=$o(1|t,n,void 0,r===void 0?null:r)}function Fl(e,t,n,r){var i=Lt();r=r===void 0?null:r;var o=void 0;if(_e!==null){var s=_e.memoizedState;if(o=s.destroy,r!==null&&ed(r,s.deps)){i.memoizedState=$o(t,n,o,r);return}}we.flags|=e,i.memoizedState=$o(1|t,n,o,r)}function Vf(e,t){return Bs(8390656,8,e,t)}function rd(e,t){return Fl(2048,8,e,t)}function Sg(e,t){return Fl(4,2,e,t)}function Cg(e,t){return Fl(4,4,e,t)}function jg(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Eg(e,t,n){return n=n!=null?n.concat([e]):null,Fl(4,4,jg.bind(null,t,e),n)}function id(){}function Ng(e,t){var n=Lt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ed(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Pg(e,t){var n=Lt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ed(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Tg(e,t,n){return Ar&21?(Ht(n,t)||(n=Am(),we.lanes|=n,zr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ut=!0),e.memoizedState=n)}function i0(e,t){var n=ue;ue=n!==0&&4>n?n:4,e(!0);var r=wa.transition;wa.transition={};try{e(!1),t()}finally{ue=n,wa.transition=r}}function Ig(){return Lt().memoizedState}function o0(e,t,n){var r=er(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_g(e))Rg(t,n);else if(n=fg(e,t,n,r),n!==null){var i=et();Bt(n,e,r,i),Lg(n,t,r)}}function s0(e,t,n){var r=er(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_g(e))Rg(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,Ht(l,s)){var a=t.interleaved;a===null?(i.next=i,Gc(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=fg(e,t,i,r),n!==null&&(i=et(),Bt(n,e,r,i),Lg(n,t,r))}}function _g(e){var t=e.alternate;return e===we||t!==null&&t===we}function Rg(e,t){yo=hl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zc(e,n)}}var ml={readContext:Rt,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},l0={readContext:Rt,useCallback:function(e,t){return Wt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:Vf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bs(4194308,4,jg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bs(4,2,e,t)},useMemo:function(e,t){var n=Wt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=o0.bind(null,we,e),[r.memoizedState,e]},useRef:function(e){var t=Wt();return e={current:e},t.memoizedState=e},useState:Qf,useDebugValue:id,useDeferredValue:function(e){return Wt().memoizedState=e},useTransition:function(){var e=Qf(!1),t=e[0];return e=i0.bind(null,e[1]),Wt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=we,i=Wt();if(ve){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Me===null)throw Error(z(349));Ar&30||xg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Vf(vg.bind(null,r,o,e),[e]),r.flags|=2048,$o(9,yg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Wt(),t=Me.identifierPrefix;if(ve){var n=xn,r=gn;n=(r&~(1<<32-$t(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Oo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=r0++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},a0={readContext:Rt,useCallback:Ng,useContext:Rt,useEffect:rd,useImperativeHandle:Eg,useInsertionEffect:Sg,useLayoutEffect:Cg,useMemo:Pg,useReducer:Sa,useRef:wg,useState:function(){return Sa(Do)},useDebugValue:id,useDeferredValue:function(e){var t=Lt();return Tg(t,_e.memoizedState,e)},useTransition:function(){var e=Sa(Do)[0],t=Lt().memoizedState;return[e,t]},useMutableSource:mg,useSyncExternalStore:gg,useId:Ig,unstable_isNewReconciler:!1},u0={readContext:Rt,useCallback:Ng,useContext:Rt,useEffect:rd,useImperativeHandle:Eg,useInsertionEffect:Sg,useLayoutEffect:Cg,useMemo:Pg,useReducer:Ca,useRef:wg,useState:function(){return Ca(Do)},useDebugValue:id,useDeferredValue:function(e){var t=Lt();return _e===null?t.memoizedState=e:Tg(t,_e.memoizedState,e)},useTransition:function(){var e=Ca(Do)[0],t=Lt().memoizedState;return[e,t]},useMutableSource:mg,useSyncExternalStore:gg,useId:Ig,unstable_isNewReconciler:!1};function Ft(e,t){if(e&&e.defaultProps){t=Se({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Pu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Se({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ml={isMounted:function(e){return(e=e._reactInternals)?Br(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=et(),i=er(e),o=yn(r,i);o.payload=t,n!=null&&(o.callback=n),t=Jn(e,o,i),t!==null&&(Bt(t,e,i,r),Ds(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=et(),i=er(e),o=yn(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Jn(e,o,i),t!==null&&(Bt(t,e,i,r),Ds(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=et(),r=er(e),i=yn(n,r);i.tag=2,t!=null&&(i.callback=t),t=Jn(e,i,r),t!==null&&(Bt(t,e,r,n),Ds(t,e,r))}};function Wf(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!Ro(n,r)||!Ro(i,o):!0}function Ag(e,t,n){var r=!1,i=or,o=t.contextType;return typeof o=="object"&&o!==null?o=Rt(o):(i=dt(t)?Rr:We.current,r=t.contextTypes,o=(r=r!=null)?_i(e,i):or),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ml,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Kf(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ml.enqueueReplaceState(t,t.state,null)}function Tu(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Yc(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Rt(o):(o=dt(t)?Rr:We.current,i.context=_i(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Pu(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Ml.enqueueReplaceState(i,i.state,null),fl(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function zi(e,t){try{var n="",r=t;do n+=M1(r),r=r.return;while(r);var i=n}catch(o){i=`
39
- Error generating stack: `+o.message+`
40
- `+o.stack}return{value:e,source:t,stack:i,digest:null}}function ja(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Iu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var c0=typeof WeakMap=="function"?WeakMap:Map;function zg(e,t,n){n=yn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xl||(xl=!0,$u=r),Iu(e,t)},n}function Fg(e,t,n){n=yn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Iu(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Iu(e,t),typeof r!="function"&&(Zn===null?Zn=new Set([this]):Zn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Gf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new c0;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=C0.bind(null,e,t,n),t.then(e,e))}function Yf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Xf(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=yn(-1,1),t.tag=2,Jn(n,t,1))),n.lanes|=1),e)}var d0=Cn.ReactCurrentOwner,ut=!1;function Xe(e,t,n,r){t.child=e===null?dg(t,null,n,r):Li(t,e.child,n,r)}function Jf(e,t,n,r,i){n=n.render;var o=t.ref;return pi(t,i),r=td(e,t,n,r,o,i),n=nd(),e!==null&&!ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Sn(e,t,i)):(ve&&n&&Hc(t),t.flags|=1,Xe(e,t,r,i),t.child)}function Zf(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!fd(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Mg(e,t,o,r,i)):(e=Qs(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ro,n(s,r)&&e.ref===t.ref)return Sn(e,t,i)}return t.flags|=1,e=tr(o,r),e.ref=t.ref,e.return=t,t.child=e}function Mg(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Ro(o,r)&&e.ref===t.ref)if(ut=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(ut=!0);else return t.lanes=e.lanes,Sn(e,t,i)}return _u(e,t,n,r,i)}function Og(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},he(ai,gt),gt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,he(ai,gt),gt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,he(ai,gt),gt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,he(ai,gt),gt|=r;return Xe(e,t,i,n),t.child}function Dg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function _u(e,t,n,r,i){var o=dt(n)?Rr:We.current;return o=_i(t,o),pi(t,i),n=td(e,t,n,r,o,i),r=nd(),e!==null&&!ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Sn(e,t,i)):(ve&&r&&Hc(t),t.flags|=1,Xe(e,t,n,i),t.child)}function ep(e,t,n,r,i){if(dt(n)){var o=!0;ll(t)}else o=!1;if(pi(t,i),t.stateNode===null)Us(e,t),Ag(t,n,r),Tu(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Rt(c):(c=dt(n)?Rr:We.current,c=_i(t,c));var f=n.getDerivedStateFromProps,d=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==c)&&Kf(t,s,r,c),Ln=!1;var p=t.memoizedState;s.state=p,fl(t,r,s,i),a=t.memoizedState,l!==r||p!==a||ct.current||Ln?(typeof f=="function"&&(Pu(t,n,f,r),a=t.memoizedState),(l=Ln||Wf(t,n,l,r,p,a,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=c,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,pg(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Ft(t.type,l),s.props=c,d=t.pendingProps,p=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=Rt(a):(a=dt(n)?Rr:We.current,a=_i(t,a));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||p!==a)&&Kf(t,s,r,a),Ln=!1,p=t.memoizedState,s.state=p,fl(t,r,s,i);var m=t.memoizedState;l!==d||p!==m||ct.current||Ln?(typeof h=="function"&&(Pu(t,n,h,r),m=t.memoizedState),(c=Ln||Wf(t,n,c,r,p,m,a)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=a,r=c):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Ru(e,t,n,r,o,i)}function Ru(e,t,n,r,i,o){Dg(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&Df(t,n,!1),Sn(e,t,o);r=t.stateNode,d0.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Li(t,e.child,null,o),t.child=Li(t,null,l,o)):Xe(e,t,l,o),t.memoizedState=r.state,i&&Df(t,n,!0),t.child}function $g(e){var t=e.stateNode;t.pendingContext?Of(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Of(e,t.context,!1),Xc(e,t.containerInfo)}function tp(e,t,n,r,i){return Ri(),Qc(i),t.flags|=256,Xe(e,t,n,r),t.child}var Lu={dehydrated:null,treeContext:null,retryLane:0};function Au(e){return{baseLanes:e,cachePool:null,transitions:null}}function Bg(e,t,n){var r=t.pendingProps,i=be.current,o=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),he(be,i&1),e===null)return Eu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=$l(s,r,0,null),e=_r(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Au(n),t.memoizedState=Lu,e):od(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return f0(e,t,s,r,l,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,l=i.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=tr(i,a),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?o=tr(l,o):(o=_r(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?Au(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=Lu,r}return o=e.child,e=o.sibling,r=tr(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function od(e,t){return t=$l({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function js(e,t,n,r){return r!==null&&Qc(r),Li(t,e.child,null,n),e=od(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function f0(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=ja(Error(z(422))),js(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=$l({mode:"visible",children:r.children},i,0,null),o=_r(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Li(t,e.child,null,s),t.child.memoizedState=Au(s),t.memoizedState=Lu,o);if(!(t.mode&1))return js(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(z(419)),r=ja(o,r,void 0),js(e,t,s,r)}if(l=(s&e.childLanes)!==0,ut||l){if(r=Me,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,wn(e,i),Bt(r,e,i,-1))}return dd(),r=ja(Error(z(421))),js(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=j0.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,kt=Xn(i.nextSibling),bt=t,ve=!0,Dt=null,e!==null&&(Nt[Pt++]=gn,Nt[Pt++]=xn,Nt[Pt++]=Lr,gn=e.id,xn=e.overflow,Lr=t),t=od(t,r.children),t.flags|=4096,t)}function np(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Nu(e.return,t,n)}function Ea(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Ug(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Xe(e,t,r.children,n),r=be.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&np(e,n,t);else if(e.tag===19)np(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(he(be,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&pl(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ea(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&pl(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ea(t,!0,n,null,o);break;case"together":Ea(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Us(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Sn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),zr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(z(153));if(t.child!==null){for(e=t.child,n=tr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=tr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function p0(e,t,n){switch(t.tag){case 3:$g(t),Ri();break;case 5:hg(t);break;case 1:dt(t.type)&&ll(t);break;case 4:Xc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;he(cl,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(he(be,be.current&1),t.flags|=128,null):n&t.child.childLanes?Bg(e,t,n):(he(be,be.current&1),e=Sn(e,t,n),e!==null?e.sibling:null);he(be,be.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ug(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),he(be,be.current),r)break;return null;case 22:case 23:return t.lanes=0,Og(e,t,n)}return Sn(e,t,n)}var Hg,zu,qg,Qg;Hg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};zu=function(){};qg=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,vr(en.current);var o=null;switch(n){case"input":i=ru(e,i),r=ru(e,r),o=[];break;case"select":i=Se({},i,{value:void 0}),r=Se({},r,{value:void 0}),o=[];break;case"textarea":i=su(e,i),r=su(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ol)}au(n,r);var s;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var l=i[c];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(jo.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var a=r[c];if(l=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&a!==l&&(a!=null||l!=null))if(c==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(o||(o=[]),o.push(c,n)),n=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(o=o||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(jo.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&xe("scroll",e),o||l===a||(o=[])):(o=o||[]).push(c,a))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};Qg=function(e,t,n,r){n!==r&&(t.flags|=4)};function to(e,t){if(!ve)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function h0(e,t,n){var r=t.pendingProps;switch(qc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return dt(t.type)&&sl(),He(t),null;case 3:return r=t.stateNode,Ai(),ye(ct),ye(We),Zc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ss(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dt!==null&&(Hu(Dt),Dt=null))),zu(e,t),He(t),null;case 5:Jc(t);var i=vr(Mo.current);if(n=t.type,e!==null&&t.stateNode!=null)qg(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(z(166));return He(t),null}if(e=vr(en.current),Ss(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Jt]=t,r[zo]=o,e=(t.mode&1)!==0,n){case"dialog":xe("cancel",r),xe("close",r);break;case"iframe":case"object":case"embed":xe("load",r);break;case"video":case"audio":for(i=0;i<co.length;i++)xe(co[i],r);break;case"source":xe("error",r);break;case"img":case"image":case"link":xe("error",r),xe("load",r);break;case"details":xe("toggle",r);break;case"input":df(r,o),xe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},xe("invalid",r);break;case"textarea":pf(r,o),xe("invalid",r)}au(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&ws(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&ws(r.textContent,l,e),i=["children",""+l]):jo.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&xe("scroll",r)}switch(n){case"input":hs(r),ff(r,o,!0);break;case"textarea":hs(r),hf(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ol)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=vm(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Jt]=t,e[zo]=r,Hg(e,t,!1,!1),t.stateNode=e;e:{switch(s=uu(n,r),n){case"dialog":xe("cancel",e),xe("close",e),i=r;break;case"iframe":case"object":case"embed":xe("load",e),i=r;break;case"video":case"audio":for(i=0;i<co.length;i++)xe(co[i],e);i=r;break;case"source":xe("error",e),i=r;break;case"img":case"image":case"link":xe("error",e),xe("load",e),i=r;break;case"details":xe("toggle",e),i=r;break;case"input":df(e,r),i=ru(e,r),xe("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Se({},r,{value:void 0}),xe("invalid",e);break;case"textarea":pf(e,r),i=su(e,r),xe("invalid",e);break;default:i=r}au(n,i),l=i;for(o in l)if(l.hasOwnProperty(o)){var a=l[o];o==="style"?wm(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&km(e,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Eo(e,a):typeof a=="number"&&Eo(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(jo.hasOwnProperty(o)?a!=null&&o==="onScroll"&&xe("scroll",e):a!=null&&Tc(e,o,a,s))}switch(n){case"input":hs(e),ff(e,r,!1);break;case"textarea":hs(e),hf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ir(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?ui(e,!!r.multiple,o,!1):r.defaultValue!=null&&ui(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=ol)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return He(t),null;case 6:if(e&&t.stateNode!=null)Qg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(z(166));if(n=vr(Mo.current),vr(en.current),Ss(t)){if(r=t.stateNode,n=t.memoizedProps,r[Jt]=t,(o=r.nodeValue!==n)&&(e=bt,e!==null))switch(e.tag){case 3:ws(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ws(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Jt]=t,t.stateNode=r}return He(t),null;case 13:if(ye(be),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ve&&kt!==null&&t.mode&1&&!(t.flags&128))ug(),Ri(),t.flags|=98560,o=!1;else if(o=Ss(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(z(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(z(317));o[Jt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;He(t),o=!1}else Dt!==null&&(Hu(Dt),Dt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||be.current&1?Ae===0&&(Ae=3):dd())),t.updateQueue!==null&&(t.flags|=4),He(t),null);case 4:return Ai(),zu(e,t),e===null&&Lo(t.stateNode.containerInfo),He(t),null;case 10:return Kc(t.type._context),He(t),null;case 17:return dt(t.type)&&sl(),He(t),null;case 19:if(ye(be),o=t.memoizedState,o===null)return He(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)to(o,!1);else{if(Ae!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=pl(e),s!==null){for(t.flags|=128,to(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return he(be,be.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ne()>Fi&&(t.flags|=128,r=!0,to(o,!1),t.lanes=4194304)}else{if(!r)if(e=pl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),to(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ve)return He(t),null}else 2*Ne()-o.renderingStartTime>Fi&&n!==1073741824&&(t.flags|=128,r=!0,to(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ne(),t.sibling=null,n=be.current,he(be,r?n&1|2:n&1),t):(He(t),null);case 22:case 23:return cd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?gt&1073741824&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function m0(e,t){switch(qc(t),t.tag){case 1:return dt(t.type)&&sl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ai(),ye(ct),ye(We),Zc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jc(t),null;case 13:if(ye(be),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ye(be),null;case 4:return Ai(),null;case 10:return Kc(t.type._context),null;case 22:case 23:return cd(),null;case 24:return null;default:return null}}var Es=!1,Qe=!1,g0=typeof WeakSet=="function"?WeakSet:Set,B=null;function li(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){je(e,t,r)}else n.current=null}function Fu(e,t,n){try{n()}catch(r){je(e,t,r)}}var rp=!1;function x0(e,t){if(vu=nl,e=Ym(),Uc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,c=0,f=0,d=e,p=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(l=s+i),d!==o||r!==0&&d.nodeType!==3||(a=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++c===i&&(l=s),p===o&&++f===r&&(a=s),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(ku={focusedElem:e,selectionRange:n},nl=!1,B=t;B!==null;)if(t=B,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,b=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ft(t.type,v),b);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(S){je(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return m=rp,rp=!1,m}function vo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Fu(t,n,o)}i=i.next}while(i!==r)}}function Ol(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Mu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Vg(e){var t=e.alternate;t!==null&&(e.alternate=null,Vg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jt],delete t[zo],delete t[Su],delete t[Zv],delete t[e0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Wg(e){return e.tag===5||e.tag===3||e.tag===4}function ip(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ou(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ol));else if(r!==4&&(e=e.child,e!==null))for(Ou(e,t,n),e=e.sibling;e!==null;)Ou(e,t,n),e=e.sibling}function Du(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Du(e,t,n),e=e.sibling;e!==null;)Du(e,t,n),e=e.sibling}var De=null,Ot=!1;function Nn(e,t,n){for(n=n.child;n!==null;)Kg(e,t,n),n=n.sibling}function Kg(e,t,n){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(Il,n)}catch{}switch(n.tag){case 5:Qe||li(n,t);case 6:var r=De,i=Ot;De=null,Nn(e,t,n),De=r,Ot=i,De!==null&&(Ot?(e=De,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):De.removeChild(n.stateNode));break;case 18:De!==null&&(Ot?(e=De,n=n.stateNode,e.nodeType===8?va(e.parentNode,n):e.nodeType===1&&va(e,n),Io(e)):va(De,n.stateNode));break;case 4:r=De,i=Ot,De=n.stateNode.containerInfo,Ot=!0,Nn(e,t,n),De=r,Ot=i;break;case 0:case 11:case 14:case 15:if(!Qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Fu(n,t,s),i=i.next}while(i!==r)}Nn(e,t,n);break;case 1:if(!Qe&&(li(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){je(n,t,l)}Nn(e,t,n);break;case 21:Nn(e,t,n);break;case 22:n.mode&1?(Qe=(r=Qe)||n.memoizedState!==null,Nn(e,t,n),Qe=r):Nn(e,t,n);break;default:Nn(e,t,n)}}function op(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new g0),t.forEach(function(r){var i=E0.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function zt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:De=l.stateNode,Ot=!1;break e;case 3:De=l.stateNode.containerInfo,Ot=!0;break e;case 4:De=l.stateNode.containerInfo,Ot=!0;break e}l=l.return}if(De===null)throw Error(z(160));Kg(o,s,i),De=null,Ot=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(c){je(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Gg(t,e),t=t.sibling}function Gg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(zt(t,e),Vt(e),r&4){try{vo(3,e,e.return),Ol(3,e)}catch(v){je(e,e.return,v)}try{vo(5,e,e.return)}catch(v){je(e,e.return,v)}}break;case 1:zt(t,e),Vt(e),r&512&&n!==null&&li(n,n.return);break;case 5:if(zt(t,e),Vt(e),r&512&&n!==null&&li(n,n.return),e.flags&32){var i=e.stateNode;try{Eo(i,"")}catch(v){je(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&xm(i,o),uu(l,s);var c=uu(l,o);for(s=0;s<a.length;s+=2){var f=a[s],d=a[s+1];f==="style"?wm(i,d):f==="dangerouslySetInnerHTML"?km(i,d):f==="children"?Eo(i,d):Tc(i,f,d,c)}switch(l){case"input":iu(i,o);break;case"textarea":ym(i,o);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?ui(i,!!o.multiple,h,!1):p!==!!o.multiple&&(o.defaultValue!=null?ui(i,!!o.multiple,o.defaultValue,!0):ui(i,!!o.multiple,o.multiple?[]:"",!1))}i[zo]=o}catch(v){je(e,e.return,v)}}break;case 6:if(zt(t,e),Vt(e),r&4){if(e.stateNode===null)throw Error(z(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(v){je(e,e.return,v)}}break;case 3:if(zt(t,e),Vt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Io(t.containerInfo)}catch(v){je(e,e.return,v)}break;case 4:zt(t,e),Vt(e);break;case 13:zt(t,e),Vt(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(ad=Ne())),r&4&&op(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(Qe=(c=Qe)||f,zt(t,e),Qe=c):zt(t,e),Vt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for(B=e,f=e.child;f!==null;){for(d=B=f;B!==null;){switch(p=B,h=p.child,p.tag){case 0:case 11:case 14:case 15:vo(4,p,p.return);break;case 1:li(p,p.return);var m=p.stateNode;if(typeof m.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){je(r,n,v)}}break;case 5:li(p,p.return);break;case 22:if(p.memoizedState!==null){lp(d);continue}}h!==null?(h.return=p,B=h):lp(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{i=d.stateNode,c?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=d.stateNode,a=d.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=bm("display",s))}catch(v){je(e,e.return,v)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(v){je(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:zt(t,e),Vt(e),r&4&&op(e);break;case 21:break;default:zt(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Wg(n)){var r=n;break e}n=n.return}throw Error(z(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Eo(i,""),r.flags&=-33);var o=ip(e);Du(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=ip(e);Ou(e,l,s);break;default:throw Error(z(161))}}catch(a){je(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function y0(e,t,n){B=e,Yg(e)}function Yg(e,t,n){for(var r=(e.mode&1)!==0;B!==null;){var i=B,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Es;if(!s){var l=i.alternate,a=l!==null&&l.memoizedState!==null||Qe;l=Es;var c=Qe;if(Es=s,(Qe=a)&&!c)for(B=i;B!==null;)s=B,a=s.child,s.tag===22&&s.memoizedState!==null?ap(i):a!==null?(a.return=s,B=a):ap(i);for(;o!==null;)B=o,Yg(o),o=o.sibling;B=i,Es=l,Qe=c}sp(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,B=o):sp(e)}}function sp(e){for(;B!==null;){var t=B;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Qe||Ol(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Qe)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Ft(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&qf(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}qf(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var f=c.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&Io(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(z(163))}Qe||t.flags&512&&Mu(t)}catch(p){je(t,t.return,p)}}if(t===e){B=null;break}if(n=t.sibling,n!==null){n.return=t.return,B=n;break}B=t.return}}function lp(e){for(;B!==null;){var t=B;if(t===e){B=null;break}var n=t.sibling;if(n!==null){n.return=t.return,B=n;break}B=t.return}}function ap(e){for(;B!==null;){var t=B;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ol(4,t)}catch(a){je(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(a){je(t,i,a)}}var o=t.return;try{Mu(t)}catch(a){je(t,o,a)}break;case 5:var s=t.return;try{Mu(t)}catch(a){je(t,s,a)}}}catch(a){je(t,t.return,a)}if(t===e){B=null;break}var l=t.sibling;if(l!==null){l.return=t.return,B=l;break}B=t.return}}var v0=Math.ceil,gl=Cn.ReactCurrentDispatcher,sd=Cn.ReactCurrentOwner,_t=Cn.ReactCurrentBatchConfig,se=0,Me=null,Ie=null,$e=0,gt=0,ai=lr(0),Ae=0,Bo=null,zr=0,Dl=0,ld=0,ko=null,at=null,ad=0,Fi=1/0,cn=null,xl=!1,$u=null,Zn=null,Ns=!1,Vn=null,yl=0,bo=0,Bu=null,Hs=-1,qs=0;function et(){return se&6?Ne():Hs!==-1?Hs:Hs=Ne()}function er(e){return e.mode&1?se&2&&$e!==0?$e&-$e:n0.transition!==null?(qs===0&&(qs=Am()),qs):(e=ue,e!==0||(e=window.event,e=e===void 0?16:Bm(e.type)),e):1}function Bt(e,t,n,r){if(50<bo)throw bo=0,Bu=null,Error(z(185));ts(e,n,r),(!(se&2)||e!==Me)&&(e===Me&&(!(se&2)&&(Dl|=n),Ae===4&&zn(e,$e)),ft(e,r),n===1&&se===0&&!(t.mode&1)&&(Fi=Ne()+500,zl&&ar()))}function ft(e,t){var n=e.callbackNode;nv(e,t);var r=tl(e,e===Me?$e:0);if(r===0)n!==null&&xf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&xf(n),t===1)e.tag===0?t0(up.bind(null,e)):sg(up.bind(null,e)),Xv(function(){!(se&6)&&ar()}),n=null;else{switch(zm(r)){case 1:n=Ac;break;case 4:n=Rm;break;case 16:n=el;break;case 536870912:n=Lm;break;default:n=el}n=ix(n,Xg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Xg(e,t){if(Hs=-1,qs=0,se&6)throw Error(z(327));var n=e.callbackNode;if(hi()&&e.callbackNode!==n)return null;var r=tl(e,e===Me?$e:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=vl(e,r);else{t=r;var i=se;se|=2;var o=Zg();(Me!==e||$e!==t)&&(cn=null,Fi=Ne()+500,Ir(e,t));do try{w0();break}catch(l){Jg(e,l)}while(!0);Wc(),gl.current=o,se=i,Ie!==null?t=0:(Me=null,$e=0,t=Ae)}if(t!==0){if(t===2&&(i=hu(e),i!==0&&(r=i,t=Uu(e,i))),t===1)throw n=Bo,Ir(e,0),zn(e,r),ft(e,Ne()),n;if(t===6)zn(e,r);else{if(i=e.current.alternate,!(r&30)&&!k0(i)&&(t=vl(e,r),t===2&&(o=hu(e),o!==0&&(r=o,t=Uu(e,o))),t===1))throw n=Bo,Ir(e,0),zn(e,r),ft(e,Ne()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(z(345));case 2:hr(e,at,cn);break;case 3:if(zn(e,r),(r&130023424)===r&&(t=ad+500-Ne(),10<t)){if(tl(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){et(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=wu(hr.bind(null,e,at,cn),t);break}hr(e,at,cn);break;case 4:if(zn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-$t(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=Ne()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*v0(r/1960))-r,10<r){e.timeoutHandle=wu(hr.bind(null,e,at,cn),r);break}hr(e,at,cn);break;case 5:hr(e,at,cn);break;default:throw Error(z(329))}}}return ft(e,Ne()),e.callbackNode===n?Xg.bind(null,e):null}function Uu(e,t){var n=ko;return e.current.memoizedState.isDehydrated&&(Ir(e,t).flags|=256),e=vl(e,t),e!==2&&(t=at,at=n,t!==null&&Hu(t)),e}function Hu(e){at===null?at=e:at.push.apply(at,e)}function k0(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!Ht(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function zn(e,t){for(t&=~ld,t&=~Dl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-$t(t),r=1<<n;e[n]=-1,t&=~r}}function up(e){if(se&6)throw Error(z(327));hi();var t=tl(e,0);if(!(t&1))return ft(e,Ne()),null;var n=vl(e,t);if(e.tag!==0&&n===2){var r=hu(e);r!==0&&(t=r,n=Uu(e,r))}if(n===1)throw n=Bo,Ir(e,0),zn(e,t),ft(e,Ne()),n;if(n===6)throw Error(z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,hr(e,at,cn),ft(e,Ne()),null}function ud(e,t){var n=se;se|=1;try{return e(t)}finally{se=n,se===0&&(Fi=Ne()+500,zl&&ar())}}function Fr(e){Vn!==null&&Vn.tag===0&&!(se&6)&&hi();var t=se;se|=1;var n=_t.transition,r=ue;try{if(_t.transition=null,ue=1,e)return e()}finally{ue=r,_t.transition=n,se=t,!(se&6)&&ar()}}function cd(){gt=ai.current,ye(ai)}function Ir(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Yv(n)),Ie!==null)for(n=Ie.return;n!==null;){var r=n;switch(qc(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&sl();break;case 3:Ai(),ye(ct),ye(We),Zc();break;case 5:Jc(r);break;case 4:Ai();break;case 13:ye(be);break;case 19:ye(be);break;case 10:Kc(r.type._context);break;case 22:case 23:cd()}n=n.return}if(Me=e,Ie=e=tr(e.current,null),$e=gt=t,Ae=0,Bo=null,ld=Dl=zr=0,at=ko=null,yr!==null){for(t=0;t<yr.length;t++)if(n=yr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}yr=null}return e}function Jg(e,t){do{var n=Ie;try{if(Wc(),$s.current=ml,hl){for(var r=we.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}hl=!1}if(Ar=0,Fe=_e=we=null,yo=!1,Oo=0,sd.current=null,n===null||n.return===null){Ae=1,Bo=t,Ie=null;break}e:{var o=e,s=n.return,l=n,a=t;if(t=$e,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,f=l,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=Yf(s);if(h!==null){h.flags&=-257,Xf(h,s,l,o,t),h.mode&1&&Gf(o,c,t),t=h,a=c;var m=t.updateQueue;if(m===null){var v=new Set;v.add(a),t.updateQueue=v}else m.add(a);break e}else{if(!(t&1)){Gf(o,c,t),dd();break e}a=Error(z(426))}}else if(ve&&l.mode&1){var b=Yf(s);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Xf(b,s,l,o,t),Qc(zi(a,l));break e}}o=a=zi(a,l),Ae!==4&&(Ae=2),ko===null?ko=[o]:ko.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=zg(o,a,t);Hf(o,g);break e;case 1:l=a;var x=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof x.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Zn===null||!Zn.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=Fg(o,l,t);Hf(o,S);break e}}o=o.return}while(o!==null)}tx(n)}catch(P){t=P,Ie===n&&n!==null&&(Ie=n=n.return);continue}break}while(!0)}function Zg(){var e=gl.current;return gl.current=ml,e===null?ml:e}function dd(){(Ae===0||Ae===3||Ae===2)&&(Ae=4),Me===null||!(zr&268435455)&&!(Dl&268435455)||zn(Me,$e)}function vl(e,t){var n=se;se|=2;var r=Zg();(Me!==e||$e!==t)&&(cn=null,Ir(e,t));do try{b0();break}catch(i){Jg(e,i)}while(!0);if(Wc(),se=n,gl.current=r,Ie!==null)throw Error(z(261));return Me=null,$e=0,Ae}function b0(){for(;Ie!==null;)ex(Ie)}function w0(){for(;Ie!==null&&!W1();)ex(Ie)}function ex(e){var t=rx(e.alternate,e,gt);e.memoizedProps=e.pendingProps,t===null?tx(e):Ie=t,sd.current=null}function tx(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=m0(n,t),n!==null){n.flags&=32767,Ie=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ae=6,Ie=null;return}}else if(n=h0(n,t,gt),n!==null){Ie=n;return}if(t=t.sibling,t!==null){Ie=t;return}Ie=t=e}while(t!==null);Ae===0&&(Ae=5)}function hr(e,t,n){var r=ue,i=_t.transition;try{_t.transition=null,ue=1,S0(e,t,n,r)}finally{_t.transition=i,ue=r}return null}function S0(e,t,n,r){do hi();while(Vn!==null);if(se&6)throw Error(z(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(z(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(rv(e,o),e===Me&&(Ie=Me=null,$e=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ns||(Ns=!0,ix(el,function(){return hi(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=_t.transition,_t.transition=null;var s=ue;ue=1;var l=se;se|=4,sd.current=null,x0(e,n),Gg(n,e),Hv(ku),nl=!!vu,ku=vu=null,e.current=n,y0(n),K1(),se=l,ue=s,_t.transition=o}else e.current=n;if(Ns&&(Ns=!1,Vn=e,yl=i),o=e.pendingLanes,o===0&&(Zn=null),X1(n.stateNode),ft(e,Ne()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(xl)throw xl=!1,e=$u,$u=null,e;return yl&1&&e.tag!==0&&hi(),o=e.pendingLanes,o&1?e===Bu?bo++:(bo=0,Bu=e):bo=0,ar(),null}function hi(){if(Vn!==null){var e=zm(yl),t=_t.transition,n=ue;try{if(_t.transition=null,ue=16>e?16:e,Vn===null)var r=!1;else{if(e=Vn,Vn=null,yl=0,se&6)throw Error(z(331));var i=se;for(se|=4,B=e.current;B!==null;){var o=B,s=o.child;if(B.flags&16){var l=o.deletions;if(l!==null){for(var a=0;a<l.length;a++){var c=l[a];for(B=c;B!==null;){var f=B;switch(f.tag){case 0:case 11:case 15:vo(8,f,o)}var d=f.child;if(d!==null)d.return=f,B=d;else for(;B!==null;){f=B;var p=f.sibling,h=f.return;if(Vg(f),f===c){B=null;break}if(p!==null){p.return=h,B=p;break}B=h}}}var m=o.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}B=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,B=s;else e:for(;B!==null;){if(o=B,o.flags&2048)switch(o.tag){case 0:case 11:case 15:vo(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,B=g;break e}B=o.return}}var x=e.current;for(B=x;B!==null;){s=B;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,B=y;else e:for(s=x;B!==null;){if(l=B,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ol(9,l)}}catch(P){je(l,l.return,P)}if(l===s){B=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,B=S;break e}B=l.return}}if(se=i,ar(),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(Il,e)}catch{}r=!0}return r}finally{ue=n,_t.transition=t}}return!1}function cp(e,t,n){t=zi(n,t),t=zg(e,t,1),e=Jn(e,t,1),t=et(),e!==null&&(ts(e,1,t),ft(e,t))}function je(e,t,n){if(e.tag===3)cp(e,e,n);else for(;t!==null;){if(t.tag===3){cp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Zn===null||!Zn.has(r))){e=zi(n,e),e=Fg(t,e,1),t=Jn(t,e,1),e=et(),t!==null&&(ts(t,1,e),ft(t,e));break}}t=t.return}}function C0(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=et(),e.pingedLanes|=e.suspendedLanes&n,Me===e&&($e&n)===n&&(Ae===4||Ae===3&&($e&130023424)===$e&&500>Ne()-ad?Ir(e,0):ld|=n),ft(e,t)}function nx(e,t){t===0&&(e.mode&1?(t=xs,xs<<=1,!(xs&130023424)&&(xs=4194304)):t=1);var n=et();e=wn(e,t),e!==null&&(ts(e,t,n),ft(e,n))}function j0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nx(e,n)}function E0(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),nx(e,n)}var rx;rx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ct.current)ut=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ut=!1,p0(e,t,n);ut=!!(e.flags&131072)}else ut=!1,ve&&t.flags&1048576&&lg(t,ul,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Us(e,t),e=t.pendingProps;var i=_i(t,We.current);pi(t,n),i=td(null,t,r,e,i,n);var o=nd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dt(r)?(o=!0,ll(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Yc(t),i.updater=Ml,t.stateNode=i,i._reactInternals=t,Tu(t,r,e,n),t=Ru(null,t,r,!0,o,n)):(t.tag=0,ve&&o&&Hc(t),Xe(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Us(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=P0(r),e=Ft(r,e),i){case 0:t=_u(null,t,r,e,n);break e;case 1:t=ep(null,t,r,e,n);break e;case 11:t=Jf(null,t,r,e,n);break e;case 14:t=Zf(null,t,r,Ft(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),_u(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),ep(e,t,r,i,n);case 3:e:{if($g(t),e===null)throw Error(z(387));r=t.pendingProps,o=t.memoizedState,i=o.element,pg(e,t),fl(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=zi(Error(z(423)),t),t=tp(e,t,r,n,i);break e}else if(r!==i){i=zi(Error(z(424)),t),t=tp(e,t,r,n,i);break e}else for(kt=Xn(t.stateNode.containerInfo.firstChild),bt=t,ve=!0,Dt=null,n=dg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ri(),r===i){t=Sn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return hg(t),e===null&&Eu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,bu(r,i)?s=null:o!==null&&bu(r,o)&&(t.flags|=32),Dg(e,t),Xe(e,t,s,n),t.child;case 6:return e===null&&Eu(t),null;case 13:return Bg(e,t,n);case 4:return Xc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Li(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),Jf(e,t,r,i,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,he(cl,r._currentValue),r._currentValue=s,o!==null)if(Ht(o.value,s)){if(o.children===i.children&&!ct.current){t=Sn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=yn(-1,n&-n),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?a.next=a:(a.next=f.next,f.next=a),c.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Nu(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(z(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Nu(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Xe(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,pi(t,n),i=Rt(i),r=r(i),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,i=Ft(r,t.pendingProps),i=Ft(r.type,i),Zf(e,t,r,i,n);case 15:return Mg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),Us(e,t),t.tag=1,dt(r)?(e=!0,ll(t)):e=!1,pi(t,n),Ag(t,r,i),Tu(t,r,i,n),Ru(null,t,r,!0,e,n);case 19:return Ug(e,t,n);case 22:return Og(e,t,n)}throw Error(z(156,t.tag))};function ix(e,t){return _m(e,t)}function N0(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function It(e,t,n,r){return new N0(e,t,n,r)}function fd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function P0(e){if(typeof e=="function")return fd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_c)return 11;if(e===Rc)return 14}return 2}function tr(e,t){var n=e.alternate;return n===null?(n=It(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Qs(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")fd(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Jr:return _r(n.children,i,o,t);case Ic:s=8,i|=8;break;case Za:return e=It(12,n,t,i|2),e.elementType=Za,e.lanes=o,e;case eu:return e=It(13,n,t,i),e.elementType=eu,e.lanes=o,e;case tu:return e=It(19,n,t,i),e.elementType=tu,e.lanes=o,e;case hm:return $l(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fm:s=10;break e;case pm:s=9;break e;case _c:s=11;break e;case Rc:s=14;break e;case Rn:s=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=It(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function _r(e,t,n,r){return e=It(7,e,r,t),e.lanes=n,e}function $l(e,t,n,r){return e=It(22,e,r,t),e.elementType=hm,e.lanes=n,e.stateNode={isHidden:!1},e}function Na(e,t,n){return e=It(6,e,null,t),e.lanes=n,e}function Pa(e,t,n){return t=It(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function T0(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=aa(0),this.expirationTimes=aa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=aa(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function pd(e,t,n,r,i,o,s,l,a){return e=new T0(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=It(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yc(o),e}function I0(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ox(e){if(!e)return or;e=e._reactInternals;e:{if(Br(e)!==e||e.tag!==1)throw Error(z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(dt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(z(171))}if(e.tag===1){var n=e.type;if(dt(n))return og(e,n,t)}return t}function sx(e,t,n,r,i,o,s,l,a){return e=pd(n,r,!0,e,i,o,s,l,a),e.context=ox(null),n=e.current,r=et(),i=er(n),o=yn(r,i),o.callback=t??null,Jn(n,o,i),e.current.lanes=i,ts(e,i,r),ft(e,r),e}function Bl(e,t,n,r){var i=t.current,o=et(),s=er(i);return n=ox(n),t.context===null?t.context=n:t.pendingContext=n,t=yn(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Jn(i,t,s),e!==null&&(Bt(e,i,s,o),Ds(e,i,s)),s}function kl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function dp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hd(e,t){dp(e,t),(e=e.alternate)&&dp(e,t)}function _0(){return null}var lx=typeof reportError=="function"?reportError:function(e){console.error(e)};function md(e){this._internalRoot=e}Ul.prototype.render=md.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(z(409));Bl(e,t,null,null)};Ul.prototype.unmount=md.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Fr(function(){Bl(null,e,null,null)}),t[bn]=null}};function Ul(e){this._internalRoot=e}Ul.prototype.unstable_scheduleHydration=function(e){if(e){var t=Om();e={blockedOn:null,target:e,priority:t};for(var n=0;n<An.length&&t!==0&&t<An[n].priority;n++);An.splice(n,0,e),n===0&&$m(e)}};function gd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Hl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function fp(){}function R0(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var c=kl(s);o.call(c)}}var s=sx(t,r,e,0,null,!1,!1,"",fp);return e._reactRootContainer=s,e[bn]=s.current,Lo(e.nodeType===8?e.parentNode:e),Fr(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var c=kl(a);l.call(c)}}var a=pd(e,0,!1,null,null,!1,!1,"",fp);return e._reactRootContainer=a,e[bn]=a.current,Lo(e.nodeType===8?e.parentNode:e),Fr(function(){Bl(t,a,n,r)}),a}function ql(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var l=i;i=function(){var a=kl(s);l.call(a)}}Bl(t,s,e,i)}else s=R0(n,t,e,i,r);return kl(s)}Fm=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=uo(t.pendingLanes);n!==0&&(zc(t,n|1),ft(t,Ne()),!(se&6)&&(Fi=Ne()+500,ar()))}break;case 13:Fr(function(){var r=wn(e,1);if(r!==null){var i=et();Bt(r,e,1,i)}}),hd(e,1)}};Fc=function(e){if(e.tag===13){var t=wn(e,134217728);if(t!==null){var n=et();Bt(t,e,134217728,n)}hd(e,134217728)}};Mm=function(e){if(e.tag===13){var t=er(e),n=wn(e,t);if(n!==null){var r=et();Bt(n,e,t,r)}hd(e,t)}};Om=function(){return ue};Dm=function(e,t){var n=ue;try{return ue=e,t()}finally{ue=n}};du=function(e,t,n){switch(t){case"input":if(iu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Al(r);if(!i)throw Error(z(90));gm(r),iu(r,i)}}}break;case"textarea":ym(e,n);break;case"select":t=n.value,t!=null&&ui(e,!!n.multiple,t,!1)}};jm=ud;Em=Fr;var L0={usingClientEntryPoint:!1,Events:[rs,ni,Al,Sm,Cm,ud]},no={findFiberByHostInstance:xr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},A0={bundleType:no.bundleType,version:no.version,rendererPackageName:no.rendererPackageName,rendererConfig:no.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Cn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Tm(e),e===null?null:e.stateNode},findFiberByHostInstance:no.findFiberByHostInstance||_0,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ps=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ps.isDisabled&&Ps.supportsFiber)try{Il=Ps.inject(A0),Zt=Ps}catch{}}Ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L0;Ct.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!gd(t))throw Error(z(200));return I0(e,t,null,n)};Ct.createRoot=function(e,t){if(!gd(e))throw Error(z(299));var n=!1,r="",i=lx;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=pd(e,1,!1,null,null,n,!1,r,i),e[bn]=t.current,Lo(e.nodeType===8?e.parentNode:e),new md(t)};Ct.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(z(188)):(e=Object.keys(e).join(","),Error(z(268,e)));return e=Tm(t),e=e===null?null:e.stateNode,e};Ct.flushSync=function(e){return Fr(e)};Ct.hydrate=function(e,t,n){if(!Hl(t))throw Error(z(200));return ql(null,e,t,!0,n)};Ct.hydrateRoot=function(e,t,n){if(!gd(e))throw Error(z(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=lx;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=sx(t,null,e,1,n??null,i,!1,o,s),e[bn]=t.current,Lo(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Ul(t)};Ct.render=function(e,t,n){if(!Hl(t))throw Error(z(200));return ql(null,e,t,!1,n)};Ct.unmountComponentAtNode=function(e){if(!Hl(e))throw Error(z(40));return e._reactRootContainer?(Fr(function(){ql(null,null,e,!1,function(){e._reactRootContainer=null,e[bn]=null})}),!0):!1};Ct.unstable_batchedUpdates=ud;Ct.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Hl(n))throw Error(z(200));if(e==null||e._reactInternals===void 0)throw Error(z(38));return ql(e,t,n,!1,r)};Ct.version="18.3.1-next-f1338f8080-20240426";function ax(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ax)}catch(e){console.error(e)}}ax(),am.exports=Ct;var z0=am.exports,ux,pp=z0;ux=pp.createRoot,pp.hydrateRoot;var Bi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},br,Fn,xi,$h,F0=($h=class extends Bi{constructor(){super();Q(this,br);Q(this,Fn);Q(this,xi);D(this,xi,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,Fn)||this.setEventListener(C(this,xi))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,Fn))==null||t.call(this),D(this,Fn,void 0))}setEventListener(t){var n;D(this,xi,t),(n=C(this,Fn))==null||n.call(this),D(this,Fn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,br)!==t&&(D(this,br,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,br)=="boolean"?C(this,br):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},br=new WeakMap,Fn=new WeakMap,xi=new WeakMap,$h),xd=new F0,M0={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Mn,bc,Bh,O0=(Bh=class{constructor(){Q(this,Mn,M0);Q(this,bc,!1)}setTimeoutProvider(e){D(this,Mn,e)}setTimeout(e,t){return C(this,Mn).setTimeout(e,t)}clearTimeout(e){C(this,Mn).clearTimeout(e)}setInterval(e,t){return C(this,Mn).setInterval(e,t)}clearInterval(e){C(this,Mn).clearInterval(e)}},Mn=new WeakMap,bc=new WeakMap,Bh),kr=new O0;function D0(e){setTimeout(e,0)}var $0=typeof window>"u"||"Deno"in globalThis;function Je(){}function B0(e,t){return typeof e=="function"?e(t):e}function qu(e){return typeof e=="number"&&e>=0&&e!==1/0}function cx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function nr(e,t){return typeof e=="function"?e(t):e}function yt(e,t){return typeof e=="function"?e(t):e}function hp(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:l}=e;if(s){if(r){if(t.queryHash!==yd(s,t.options))return!1}else if(!Uo(t.queryKey,s))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function mp(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Mr(t.options.mutationKey)!==Mr(o))return!1}else if(!Uo(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function yd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Mr)(e)}function Mr(e){return JSON.stringify(e,(t,n)=>Qu(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Uo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Uo(e[n],t[n])):!1}var U0=Object.prototype.hasOwnProperty;function dx(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=gp(e)&&gp(t);if(!r&&!(Qu(e)&&Qu(t)))return t;const o=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),l=s.length,a=r?new Array(l):{};let c=0;for(let f=0;f<l;f++){const d=r?f:s[f],p=e[d],h=t[d];if(p===h){a[d]=p,(r?f<o:U0.call(e,d))&&c++;continue}if(p===null||h===null||typeof p!="object"||typeof h!="object"){a[d]=h;continue}const m=dx(p,h,n+1);a[d]=m,m===p&&c++}return o===l&&c===o?e:a}function bl(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function gp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qu(e){if(!xp(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!xp(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function xp(e){return Object.prototype.toString.call(e)==="[object Object]"}function H0(e){return new Promise(t=>{kr.setTimeout(t,e)})}function Vu(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?dx(e,t):t}function q0(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Q0(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var vd=Symbol();function fx(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===vd?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function kd(e,t){return typeof e=="function"?e(...t):!!e}function V0(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Ho=(()=>{let e=()=>$0;return{isServer(){return e()},setIsServer(t){e=t}}})();function Wu(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var W0=D0;function K0(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=W0;const o=l=>{t?e.push(l):i(()=>{n(l)})},s=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||s()}return a},batchCalls:l=>(...a)=>{o(()=>{l(...a)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var Le=K0(),yi,On,vi,Uh,G0=(Uh=class extends Bi{constructor(){super();Q(this,yi,!0);Q(this,On);Q(this,vi);D(this,vi,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){C(this,On)||this.setEventListener(C(this,vi))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,On))==null||t.call(this),D(this,On,void 0))}setEventListener(t){var n;D(this,vi,t),(n=C(this,On))==null||n.call(this),D(this,On,t(this.setOnline.bind(this)))}setOnline(t){C(this,yi)!==t&&(D(this,yi,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return C(this,yi)}},yi=new WeakMap,On=new WeakMap,vi=new WeakMap,Uh),wl=new G0;function Y0(e){return Math.min(1e3*2**e,3e4)}function px(e){return(e??"online")==="online"?wl.isOnline():!0}var Ku=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function hx(e){let t=!1,n=0,r;const i=Wu(),o=()=>i.status!=="pending",s=v=>{var b;if(!o()){const g=new Ku(v);p(g),(b=e.onCancel)==null||b.call(e,g)}},l=()=>{t=!0},a=()=>{t=!1},c=()=>xd.isFocused()&&(e.networkMode==="always"||wl.isOnline())&&e.canRun(),f=()=>px(e.networkMode)&&e.canRun(),d=v=>{o()||(r==null||r(),i.resolve(v))},p=v=>{o()||(r==null||r(),i.reject(v))},h=()=>new Promise(v=>{var b;r=g=>{(o()||c())&&v(g)},(b=e.onPause)==null||b.call(e)}).then(()=>{var v;r=void 0,o()||(v=e.onContinue)==null||v.call(e)}),m=()=>{if(o())return;let v;const b=n===0?e.initialPromise:void 0;try{v=b??e.fn()}catch(g){v=Promise.reject(g)}Promise.resolve(v).then(d).catch(g=>{var E;if(o())return;const x=e.retry??(Ho.isServer()?0:3),y=e.retryDelay??Y0,S=typeof y=="function"?y(n,g):y,P=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,g);if(t||!P){p(g);return}n++,(E=e.onFail)==null||E.call(e,n,g),H0(S).then(()=>c()?void 0:h()).then(()=>{t?p(g):m()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:a,canStart:f,start:()=>(f()?m():h().then(m),i)}}var wr,Hh,mx=(Hh=class{constructor(){Q(this,wr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qu(this.gcTime)&&D(this,wr,kr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ho.isServer()?1/0:5*60*1e3))}clearGcTimeout(){C(this,wr)!==void 0&&(kr.clearTimeout(C(this,wr)),D(this,wr,void 0))}},wr=new WeakMap,Hh);function X0(e){return{onFetch:(t,n)=>{var f,d,p,h,m;const r=t.options,i=(p=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const c=async()=>{let v=!1;const b=y=>{V0(y,()=>t.signal,()=>v=!0)},g=fx(t.options,t.fetchOptions),x=async(y,S,P)=>{if(v)return Promise.reject(t.signal.reason);if(S==null&&y.pages.length)return Promise.resolve(y);const I=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:S,direction:P?"backward":"forward",meta:t.options.meta};return b(A),A})(),T=await g(I),{maxPages:L}=t.options,j=P?Q0:q0;return{pages:j(y.pages,T,L),pageParams:j(y.pageParams,S,L)}};if(i&&o.length){const y=i==="backward",S=y?J0:yp,P={pages:o,pageParams:s},E=S(r,P);l=await x(P,E,y)}else{const y=e??o.length;do{const S=a===0?s[0]??r.initialPageParam:yp(r,l);if(a>0&&S==null)break;l=await x(l,S),a++}while(a<y)}return l};t.options.persister?t.fetchFn=()=>{var v,b;return(b=(v=t.options).persister)==null?void 0:b.call(v,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function yp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function J0(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ki,Sr,bi,Et,Cr,ze,Go,jr,xt,gx,un,qh,Z0=(qh=class extends mx{constructor(t){super();Q(this,xt);Q(this,ki);Q(this,Sr);Q(this,bi);Q(this,Et);Q(this,Cr);Q(this,ze);Q(this,Go);Q(this,jr);D(this,jr,!1),D(this,Go,t.defaultOptions),this.setOptions(t.options),this.observers=[],D(this,Cr,t.client),D(this,Et,C(this,Cr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,D(this,Sr,kp(this.options)),this.state=t.state??C(this,Sr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return C(this,ki)}get promise(){var t;return(t=C(this,ze))==null?void 0:t.promise}setOptions(t){if(this.options={...C(this,Go),...t},t!=null&&t._type&&D(this,ki,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=kp(this.options);n.data!==void 0&&(this.setState(vp(n.data,n.dataUpdatedAt)),D(this,Sr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,Et).remove(this)}setData(t,n){const r=Vu(this.state.data,t,this.options);return Y(this,xt,un).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Y(this,xt,un).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=C(this,ze))==null?void 0:r.promise;return(i=C(this,ze))==null||i.cancel(t),n?n.then(Je).catch(Je):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return C(this,Sr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>yt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===vd||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>nr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!cx(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,ze))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,ze))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,Et).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(C(this,ze)&&(C(this,jr)||Y(this,xt,gx).call(this)?C(this,ze).cancel({revert:!0}):C(this,ze).cancelRetry()),this.scheduleGc()),C(this,Et).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Y(this,xt,un).call(this,{type:"invalidate"})}async fetch(t,n){var c,f,d,p,h,m,v,b,g,x,y;if(this.state.fetchStatus!=="idle"&&((c=C(this,ze))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,ze))return C(this,ze).continueRetry(),C(this,ze).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(P=>P.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,i=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(D(this,jr,!0),r.signal)})},o=()=>{const S=fx(this.options,n),E=(()=>{const I={client:C(this,Cr),queryKey:this.queryKey,meta:this.meta};return i(I),I})();return D(this,jr,!1),this.options.persister?this.options.persister(S,E,this):S(E)},l=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,Cr),state:this.state,fetchFn:o};return i(S),S})(),a=C(this,ki)==="infinite"?X0(this.options.pages):this.options.behavior;a==null||a.onFetch(l,this),D(this,bi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&Y(this,xt,un).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),D(this,ze,hx({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:S=>{S instanceof Ku&&S.revert&&this.setState({...C(this,bi),fetchStatus:"idle"}),r.abort()},onFail:(S,P)=>{Y(this,xt,un).call(this,{type:"failed",failureCount:S,error:P})},onPause:()=>{Y(this,xt,un).call(this,{type:"pause"})},onContinue:()=>{Y(this,xt,un).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const S=await C(this,ze).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(h=(p=C(this,Et).config).onSuccess)==null||h.call(p,S,this),(v=(m=C(this,Et).config).onSettled)==null||v.call(m,S,this.state.error,this),S}catch(S){if(S instanceof Ku){if(S.silent)return C(this,ze).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Y(this,xt,un).call(this,{type:"error",error:S}),(g=(b=C(this,Et).config).onError)==null||g.call(b,S,this),(y=(x=C(this,Et).config).onSettled)==null||y.call(x,this.state.data,S,this),S}finally{this.scheduleGc()}}},ki=new WeakMap,Sr=new WeakMap,bi=new WeakMap,Et=new WeakMap,Cr=new WeakMap,ze=new WeakMap,Go=new WeakMap,jr=new WeakMap,xt=new WeakSet,gx=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},un=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...xx(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...vp(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return D(this,bi,t.manual?i:void 0),i;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Le.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,Et).notify({query:this,type:"updated",action:t})})},qh);function xx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:px(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vp(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function kp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var st,re,Yo,Ge,Er,wi,fn,Dn,Xo,Si,Ci,Nr,Pr,$n,ji,ae,fo,Gu,Yu,Xu,Ju,Zu,ec,tc,yx,Qh,ek=(Qh=class extends Bi{constructor(t,n){super();Q(this,ae);Q(this,st);Q(this,re);Q(this,Yo);Q(this,Ge);Q(this,Er);Q(this,wi);Q(this,fn);Q(this,Dn);Q(this,Xo);Q(this,Si);Q(this,Ci);Q(this,Nr);Q(this,Pr);Q(this,$n);Q(this,ji,new Set);this.options=n,D(this,st,t),D(this,Dn,null),D(this,fn,Wu()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,re).addObserver(this),bp(C(this,re),this.options)?Y(this,ae,fo).call(this):this.updateResult(),Y(this,ae,Ju).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return nc(C(this,re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return nc(C(this,re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Y(this,ae,Zu).call(this),Y(this,ae,ec).call(this),C(this,re).removeObserver(this)}setOptions(t){const n=this.options,r=C(this,re);if(this.options=C(this,st).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof yt(this.options.enabled,C(this,re))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Y(this,ae,tc).call(this),C(this,re).setOptions(this.options),n._defaulted&&!bl(this.options,n)&&C(this,st).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,re),observer:this});const i=this.hasListeners();i&&wp(C(this,re),r,this.options,n)&&Y(this,ae,fo).call(this),this.updateResult(),i&&(C(this,re)!==r||yt(this.options.enabled,C(this,re))!==yt(n.enabled,C(this,re))||nr(this.options.staleTime,C(this,re))!==nr(n.staleTime,C(this,re)))&&Y(this,ae,Gu).call(this);const o=Y(this,ae,Yu).call(this);i&&(C(this,re)!==r||yt(this.options.enabled,C(this,re))!==yt(n.enabled,C(this,re))||o!==C(this,$n))&&Y(this,ae,Xu).call(this,o)}getOptimisticResult(t){const n=C(this,st).getQueryCache().build(C(this,st),t),r=this.createResult(n,t);return nk(this,r)&&(D(this,Ge,r),D(this,wi,this.options),D(this,Er,C(this,re).state)),r}getCurrentResult(){return C(this,Ge)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&C(this,fn).status==="pending"&&C(this,fn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){C(this,ji).add(t)}getCurrentQuery(){return C(this,re)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=C(this,st).defaultQueryOptions(t),r=C(this,st).getQueryCache().build(C(this,st),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Y(this,ae,fo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Ge)))}createResult(t,n){var L;const r=C(this,re),i=this.options,o=C(this,Ge),s=C(this,Er),l=C(this,wi),c=t!==r?t.state:C(this,Yo),{state:f}=t;let d={...f},p=!1,h;if(n._optimisticResults){const j=this.hasListeners(),A=!j&&bp(t,n),R=j&&wp(t,r,n,i);(A||R)&&(d={...d,...xx(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:v,status:b}=d;h=d.data;let g=!1;if(n.placeholderData!==void 0&&h===void 0&&b==="pending"){let j;o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(j=o.data,g=!0):j=typeof n.placeholderData=="function"?n.placeholderData((L=C(this,Ci))==null?void 0:L.state.data,C(this,Ci)):n.placeholderData,j!==void 0&&(b="success",h=Vu(o==null?void 0:o.data,j,n),p=!0)}if(n.select&&h!==void 0&&!g)if(o&&h===(s==null?void 0:s.data)&&n.select===C(this,Xo))h=C(this,Si);else try{D(this,Xo,n.select),h=n.select(h),h=Vu(o==null?void 0:o.data,h,n),D(this,Si,h),D(this,Dn,null)}catch(j){D(this,Dn,j)}C(this,Dn)&&(m=C(this,Dn),h=C(this,Si),v=Date.now(),b="error");const x=d.fetchStatus==="fetching",y=b==="pending",S=b==="error",P=y&&x,E=h!==void 0,T={status:b,fetchStatus:d.fetchStatus,isPending:y,isSuccess:b==="success",isError:S,isInitialLoading:P,isLoading:P,data:h,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!y,isLoadingError:S&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:S&&E,isStale:bd(t,n),refetch:this.refetch,promise:C(this,fn),isEnabled:yt(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const j=T.data!==void 0,A=T.status==="error"&&!j,R=q=>{A?q.reject(T.error):j&&q.resolve(T.data)},$=()=>{const q=D(this,fn,T.promise=Wu());R(q)},U=C(this,fn);switch(U.status){case"pending":t.queryHash===r.queryHash&&R(U);break;case"fulfilled":(A||T.data!==U.value)&&$();break;case"rejected":(!A||T.error!==U.reason)&&$();break}}return T}updateResult(){const t=C(this,Ge),n=this.createResult(C(this,re),this.options);if(D(this,Er,C(this,re).state),D(this,wi,this.options),C(this,Er).data!==void 0&&D(this,Ci,C(this,re)),bl(n,t))return;D(this,Ge,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!C(this,ji).size)return!0;const s=new Set(o??C(this,ji));return this.options.throwOnError&&s.add("error"),Object.keys(C(this,Ge)).some(l=>{const a=l;return C(this,Ge)[a]!==t[a]&&s.has(a)})};Y(this,ae,yx).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Y(this,ae,Ju).call(this)}},st=new WeakMap,re=new WeakMap,Yo=new WeakMap,Ge=new WeakMap,Er=new WeakMap,wi=new WeakMap,fn=new WeakMap,Dn=new WeakMap,Xo=new WeakMap,Si=new WeakMap,Ci=new WeakMap,Nr=new WeakMap,Pr=new WeakMap,$n=new WeakMap,ji=new WeakMap,ae=new WeakSet,fo=function(t){Y(this,ae,tc).call(this);let n=C(this,re).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Je)),n},Gu=function(){Y(this,ae,Zu).call(this);const t=nr(this.options.staleTime,C(this,re));if(Ho.isServer()||C(this,Ge).isStale||!qu(t))return;const r=cx(C(this,Ge).dataUpdatedAt,t)+1;D(this,Nr,kr.setTimeout(()=>{C(this,Ge).isStale||this.updateResult()},r))},Yu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,re)):this.options.refetchInterval)??!1},Xu=function(t){Y(this,ae,ec).call(this),D(this,$n,t),!(Ho.isServer()||yt(this.options.enabled,C(this,re))===!1||!qu(C(this,$n))||C(this,$n)===0)&&D(this,Pr,kr.setInterval(()=>{(this.options.refetchIntervalInBackground||xd.isFocused())&&Y(this,ae,fo).call(this)},C(this,$n)))},Ju=function(){Y(this,ae,Gu).call(this),Y(this,ae,Xu).call(this,Y(this,ae,Yu).call(this))},Zu=function(){C(this,Nr)!==void 0&&(kr.clearTimeout(C(this,Nr)),D(this,Nr,void 0))},ec=function(){C(this,Pr)!==void 0&&(kr.clearInterval(C(this,Pr)),D(this,Pr,void 0))},tc=function(){const t=C(this,st).getQueryCache().build(C(this,st),this.options);if(t===C(this,re))return;const n=C(this,re);D(this,re,t),D(this,Yo,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},yx=function(t){Le.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(C(this,Ge))}),C(this,st).getQueryCache().notify({query:C(this,re),type:"observerResultsUpdated"})})},Qh);function tk(e,t){return yt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&yt(t.retryOnMount,e)===!1)}function bp(e,t){return tk(e,t)||e.state.data!==void 0&&nc(e,t,t.refetchOnMount)}function nc(e,t,n){if(yt(t.enabled,e)!==!1&&nr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&bd(e,t)}return!1}function wp(e,t,n,r){return(e!==t||yt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&bd(e,n)}function bd(e,t){return yt(t.enabled,e)!==!1&&e.isStaleByTime(nr(t.staleTime,e))}function nk(e,t){return!bl(e.getCurrentResult(),t)}var Jo,Gt,qe,Tr,Yt,_n,Vh,rk=(Vh=class extends mx{constructor(t){super();Q(this,Yt);Q(this,Jo);Q(this,Gt);Q(this,qe);Q(this,Tr);D(this,Jo,t.client),this.mutationId=t.mutationId,D(this,qe,t.mutationCache),D(this,Gt,[]),this.state=t.state||vx(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,Gt).includes(t)||(C(this,Gt).push(t),this.clearGcTimeout(),C(this,qe).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){D(this,Gt,C(this,Gt).filter(n=>n!==t)),this.scheduleGc(),C(this,qe).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Gt).length||(this.state.status==="pending"?this.scheduleGc():C(this,qe).remove(this))}continue(){var t;return((t=C(this,Tr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,l,a,c,f,d,p,h,m,v,b,g,x,y,S,P,E,I;const n=()=>{Y(this,Yt,_n).call(this,{type:"continue"})},r={client:C(this,Jo),meta:this.options.meta,mutationKey:this.options.mutationKey};D(this,Tr,hx({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(T,L)=>{Y(this,Yt,_n).call(this,{type:"failed",failureCount:T,error:L})},onPause:()=>{Y(this,Yt,_n).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,qe).canRun(this)}));const i=this.state.status==="pending",o=!C(this,Tr).canStart();try{if(i)n();else{Y(this,Yt,_n).call(this,{type:"pending",variables:t,isPaused:o}),C(this,qe).config.onMutate&&await C(this,qe).config.onMutate(t,this,r);const L=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,t,r));L!==this.state.context&&Y(this,Yt,_n).call(this,{type:"pending",context:L,variables:t,isPaused:o})}const T=await C(this,Tr).start();return await((c=(a=C(this,qe).config).onSuccess)==null?void 0:c.call(a,T,t,this.state.context,this,r)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,T,t,this.state.context,r)),await((h=(p=C(this,qe).config).onSettled)==null?void 0:h.call(p,T,null,this.state.variables,this.state.context,this,r)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,T,null,t,this.state.context,r)),Y(this,Yt,_n).call(this,{type:"success",data:T}),T}catch(T){try{await((g=(b=C(this,qe).config).onError)==null?void 0:g.call(b,T,t,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((y=(x=this.options).onError)==null?void 0:y.call(x,T,t,this.state.context,r))}catch(L){Promise.reject(L)}try{await((P=(S=C(this,qe).config).onSettled)==null?void 0:P.call(S,void 0,T,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((I=(E=this.options).onSettled)==null?void 0:I.call(E,void 0,T,t,this.state.context,r))}catch(L){Promise.reject(L)}throw Y(this,Yt,_n).call(this,{type:"error",error:T}),T}finally{C(this,qe).runNext(this)}}},Jo=new WeakMap,Gt=new WeakMap,qe=new WeakMap,Tr=new WeakMap,Yt=new WeakSet,_n=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Le.batch(()=>{C(this,Gt).forEach(r=>{r.onMutationUpdate(t)}),C(this,qe).notify({mutation:this,type:"updated",action:t})})},Vh);function vx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pn,Mt,Zo,Wh,ik=(Wh=class extends Bi{constructor(t={}){super();Q(this,pn);Q(this,Mt);Q(this,Zo);this.config=t,D(this,pn,new Set),D(this,Mt,new Map),D(this,Zo,0)}build(t,n,r){const i=new rk({client:t,mutationCache:this,mutationId:++cs(this,Zo)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){C(this,pn).add(t);const n=Ts(t);if(typeof n=="string"){const r=C(this,Mt).get(n);r?r.push(t):C(this,Mt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,pn).delete(t)){const n=Ts(t);if(typeof n=="string"){const r=C(this,Mt).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&C(this,Mt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ts(t);if(typeof n=="string"){const r=C(this,Mt).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Ts(t);if(typeof n=="string"){const i=(r=C(this,Mt).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Le.batch(()=>{C(this,pn).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,pn).clear(),C(this,Mt).clear()})}getAll(){return Array.from(C(this,pn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>mp(n,r))}findAll(t={}){return this.getAll().filter(n=>mp(t,n))}notify(t){Le.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Le.batch(()=>Promise.all(t.map(n=>n.continue().catch(Je))))}},pn=new WeakMap,Mt=new WeakMap,Zo=new WeakMap,Wh);function Ts(e){var t;return(t=e.options.scope)==null?void 0:t.id}var hn,Bn,lt,mn,vn,Vs,rc,Kh,ok=(Kh=class extends Bi{constructor(n,r){super();Q(this,vn);Q(this,hn);Q(this,Bn);Q(this,lt);Q(this,mn);D(this,hn,n),this.setOptions(r),this.bindMethods(),Y(this,vn,Vs).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=C(this,hn).defaultMutationOptions(n),bl(this.options,r)||C(this,hn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,lt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Mr(r.mutationKey)!==Mr(this.options.mutationKey)?this.reset():((i=C(this,lt))==null?void 0:i.state.status)==="pending"&&C(this,lt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,lt))==null||n.removeObserver(this)}onMutationUpdate(n){Y(this,vn,Vs).call(this),Y(this,vn,rc).call(this,n)}getCurrentResult(){return C(this,Bn)}reset(){var n;(n=C(this,lt))==null||n.removeObserver(this),D(this,lt,void 0),Y(this,vn,Vs).call(this),Y(this,vn,rc).call(this)}mutate(n,r){var i;return D(this,mn,r),(i=C(this,lt))==null||i.removeObserver(this),D(this,lt,C(this,hn).getMutationCache().build(C(this,hn),this.options)),C(this,lt).addObserver(this),C(this,lt).execute(n)}},hn=new WeakMap,Bn=new WeakMap,lt=new WeakMap,mn=new WeakMap,vn=new WeakSet,Vs=function(){var r;const n=((r=C(this,lt))==null?void 0:r.state)??vx();D(this,Bn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},rc=function(n){Le.batch(()=>{var r,i,o,s,l,a,c,f;if(C(this,mn)&&this.hasListeners()){const d=C(this,Bn).variables,p=C(this,Bn).context,h={client:C(this,hn),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=C(this,mn)).onSuccess)==null||i.call(r,n.data,d,p,h)}catch(m){Promise.reject(m)}try{(s=(o=C(this,mn)).onSettled)==null||s.call(o,n.data,null,d,p,h)}catch(m){Promise.reject(m)}}else if((n==null?void 0:n.type)==="error"){try{(a=(l=C(this,mn)).onError)==null||a.call(l,n.error,d,p,h)}catch(m){Promise.reject(m)}try{(f=(c=C(this,mn)).onSettled)==null||f.call(c,void 0,n.error,d,p,h)}catch(m){Promise.reject(m)}}}this.listeners.forEach(d=>{d(C(this,Bn))})})},Kh),Xt,Gh,sk=(Gh=class extends Bi{constructor(t={}){super();Q(this,Xt);this.config=t,D(this,Xt,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??yd(i,n);let s=this.get(o);return s||(s=new Z0({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){C(this,Xt).has(t.queryHash)||(C(this,Xt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=C(this,Xt).get(t.queryHash);n&&(t.destroy(),n===t&&C(this,Xt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Le.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,Xt).get(t)}getAll(){return[...C(this,Xt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>hp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>hp(t,r)):n}notify(t){Le.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Le.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Le.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xt=new WeakMap,Gh),Ce,Un,Hn,Ei,Ni,qn,Pi,Ti,Yh,lk=(Yh=class{constructor(e={}){Q(this,Ce);Q(this,Un);Q(this,Hn);Q(this,Ei);Q(this,Ni);Q(this,qn);Q(this,Pi);Q(this,Ti);D(this,Ce,e.queryCache||new sk),D(this,Un,e.mutationCache||new ik),D(this,Hn,e.defaultOptions||{}),D(this,Ei,new Map),D(this,Ni,new Map),D(this,qn,0)}mount(){cs(this,qn)._++,C(this,qn)===1&&(D(this,Pi,xd.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,Ce).onFocus())})),D(this,Ti,wl.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,Ce).onOnline())})))}unmount(){var e,t;cs(this,qn)._--,C(this,qn)===0&&((e=C(this,Pi))==null||e.call(this),D(this,Pi,void 0),(t=C(this,Ti))==null||t.call(this),D(this,Ti,void 0))}isFetching(e){return C(this,Ce).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,Un).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,Ce).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=C(this,Ce).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(nr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return C(this,Ce).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=C(this,Ce).get(r.queryHash),o=i==null?void 0:i.state.data,s=B0(t,o);if(s!==void 0)return C(this,Ce).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Le.batch(()=>C(this,Ce).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,Ce).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=C(this,Ce);Le.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=C(this,Ce);return Le.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Le.batch(()=>C(this,Ce).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Je).catch(Je)}invalidateQueries(e,t={}){return Le.batch(()=>(C(this,Ce).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Le.batch(()=>C(this,Ce).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Je)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Je)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=C(this,Ce).build(this,t);return n.isStaleByTime(nr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Je).catch(Je)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Je).catch(Je)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return wl.isOnline()?C(this,Un).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,Ce)}getMutationCache(){return C(this,Un)}getDefaultOptions(){return C(this,Hn)}setDefaultOptions(e){D(this,Hn,e)}setQueryDefaults(e,t){C(this,Ei).set(Mr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,Ei).values()],n={};return t.forEach(r=>{Uo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){C(this,Ni).set(Mr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,Ni).values()],n={};return t.forEach(r=>{Uo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,Hn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=yd(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===vd&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,Hn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,Ce).clear(),C(this,Un).clear()}},Ce=new WeakMap,Un=new WeakMap,Hn=new WeakMap,Ei=new WeakMap,Ni=new WeakMap,qn=new WeakMap,Pi=new WeakMap,Ti=new WeakMap,Yh),kx=N.createContext(void 0),Pe=e=>{const t=N.useContext(kx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ak=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(kx.Provider,{value:e,children:t})),bx=N.createContext(!1),uk=()=>N.useContext(bx);bx.Provider;function ck(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var dk=N.createContext(ck()),fk=()=>N.useContext(dk),pk=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?kd(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},hk=e=>{N.useEffect(()=>{e.clearReset()},[e])},mk=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||kd(n,[e.error,r])),gk=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},xk=(e,t)=>e.isLoading&&e.isFetching&&!t,yk=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Sp=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function vk(e,t,n){var p,h,m,v;const r=uk(),i=fk(),o=Pe(),s=o.defaultQueryOptions(e);(h=(p=o.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||h.call(p,s);const l=o.getQueryCache().get(s.queryHash);s._optimisticResults=r?"isRestoring":"optimistic",gk(s),pk(s,i,l),hk(i);const a=!o.getQueryCache().get(s.queryHash),[c]=N.useState(()=>new t(o,s)),f=c.getOptimisticResult(s),d=!r&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(b=>{const g=d?c.subscribe(Le.batchCalls(b)):Je;return c.updateResult(),g},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),N.useEffect(()=>{c.setOptions(s)},[s,c]),yk(s,f))throw Sp(s,c,i);if(mk({result:f,errorResetBoundary:i,throwOnError:s.throwOnError,query:l,suspense:s.suspense}))throw f.error;if((v=(m=o.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||v.call(m,s,f),s.experimental_prefetchInRender&&!Ho.isServer()&&xk(f,r)){const b=a?Sp(s,c,i):l==null?void 0:l.promise;b==null||b.catch(Je).finally(()=>{c.updateResult()})}return s.notifyOnChangeProps?f:c.trackResult(f)}function nn(e,t){return vk(e,ek)}function Oe(e,t){const n=Pe(),[r]=N.useState(()=>new ok(n,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);const i=N.useSyncExternalStore(N.useCallback(s=>r.subscribe(Le.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=N.useCallback((s,l)=>{r.mutate(s,l).catch(Je)},[r]);if(i.error&&kd(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}class kk{constructor(){Qt(this,"ws");Qt(this,"listeners",new Set);Qt(this,"reconnectListeners",new Set);Qt(this,"reconnectAttempt",0);Qt(this,"shouldRun",!1);Qt(this,"url");Qt(this,"outbox",[]);Qt(this,"lastSubscribe");Qt(this,"_connectionEpoch",0);const t=location.protocol==="https:"?"wss:":"ws:";this.url=`${t}//${location.host}/ws`}start(){this.shouldRun||(this.shouldRun=!0,this.connect())}stop(){var t;this.shouldRun=!1,this.outbox=[],this.lastSubscribe=void 0,this._connectionEpoch=0,(t=this.ws)==null||t.close(),this.ws=void 0}send(t){var n;if(t.type==="subscribe"&&(this.lastSubscribe=t),((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){this.ws.send(JSON.stringify(t));return}this.outbox.push(t),this.shouldRun||this.start()}on(t){return this.listeners.add(t),()=>this.listeners.delete(t)}onReconnect(t){return this.reconnectListeners.add(t),()=>this.reconnectListeners.delete(t)}get readyState(){var t;return((t=this.ws)==null?void 0:t.readyState)??WebSocket.CLOSED}get connectionEpoch(){return this._connectionEpoch}connect(){const t=new WebSocket(this.url);this.ws=t,t.addEventListener("open",()=>{if(this.reconnectAttempt=0,this._connectionEpoch+=1,this._connectionEpoch>1&&this.lastSubscribe&&t.send(JSON.stringify(this.lastSubscribe)),this._connectionEpoch>1)for(const r of this.reconnectListeners)try{r()}catch{}const n=this.outbox;this.outbox=[];for(const r of n)t.send(JSON.stringify(r))}),t.addEventListener("message",n=>{let r;try{r=JSON.parse(n.data)}catch{return}for(const i of this.listeners)i(r)}),t.addEventListener("close",()=>{if(this.ws=void 0,!this.shouldRun)return;const n=Math.min(15e3,500*2**this.reconnectAttempt);this.reconnectAttempt+=1,setTimeout(()=>{this.shouldRun&&this.connect()},n)}),t.addEventListener("error",()=>{})}}const ot=new kk;async function ce(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...(t==null?void 0:t.headers)??{}}});if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(bk(r)??`${n.status} ${n.statusText}${r?`: ${r}`:""}`)}return await n.json()}function bk(e){if(e)try{const t=JSON.parse(e);if(t&&typeof t.error=="string"&&t.error.length>0)return t.error}catch{}}const Ql=e=>["config",e],wk=(e,t)=>["config",e,t??"__none__"];function wx(e,t){return nn({queryKey:wk(e,t),queryFn:()=>{if(!e)throw new Error("workspaceId required");return ce(`/api/workspaces/${encodeURIComponent(e)}/config`)},enabled:!!e})}function Sk(e){const t=Pe();return Oe({mutationFn:n=>ce(`/api/workspaces/${encodeURIComponent(e)}/config/model`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Ql(e)})})}function Ck(e){const t=Pe();return Oe({mutationFn:n=>ce(`/api/workspaces/${encodeURIComponent(e)}/config/thinking-level`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Ql(e)})})}function jk(e){const t=Pe();return Oe({mutationFn:n=>ce(`/api/workspaces/${encodeURIComponent(e)}/config/tools`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Ql(e)})})}function Ek(){const e=Pe();N.useEffect(()=>ot.on(n=>{n.type==="event"&&(n.payload.kind!=="session_info_changed"&&n.payload.kind!=="thinking_level_changed"||e.invalidateQueries({queryKey:Ql(n.workspaceId)}))}),[e])}/**
41
- * @license lucide-react v0.468.0 - ISC
42
- *
43
- * This source code is licensed under the ISC license.
44
- * See the LICENSE file in the root directory of this source tree.
45
- */const Nk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Sx=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46
- * @license lucide-react v0.468.0 - ISC
47
- *
48
- * This source code is licensed under the ISC license.
49
- * See the LICENSE file in the root directory of this source tree.
50
- */var Pk={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
51
- * @license lucide-react v0.468.0 - ISC
52
- *
53
- * This source code is licensed under the ISC license.
54
- * See the LICENSE file in the root directory of this source tree.
55
- */const Tk=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...l},a)=>N.createElement("svg",{ref:a,...Pk,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Sx("lucide",i),...l},[...s.map(([c,f])=>N.createElement(c,f)),...Array.isArray(o)?o:[o]]));/**
56
- * @license lucide-react v0.468.0 - ISC
57
- *
58
- * This source code is licensed under the ISC license.
59
- * See the LICENSE file in the root directory of this source tree.
60
- */const Ee=(e,t)=>{const n=N.forwardRef(({className:r,...i},o)=>N.createElement(Tk,{ref:o,iconNode:t,className:Sx(`lucide-${Nk(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
61
- * @license lucide-react v0.468.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */const Cx=Ee("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
66
- * @license lucide-react v0.468.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */const Ik=Ee("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
71
- * @license lucide-react v0.468.0 - ISC
72
- *
73
- * This source code is licensed under the ISC license.
74
- * See the LICENSE file in the root directory of this source tree.
75
- */const Vl=Ee("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
76
- * @license lucide-react v0.468.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const Ur=Ee("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
81
- * @license lucide-react v0.468.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */const jx=Ee("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
86
- * @license lucide-react v0.468.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const wd=Ee("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
91
- * @license lucide-react v0.468.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const _k=Ee("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
96
- * @license lucide-react v0.468.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const Ex=Ee("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
101
- * @license lucide-react v0.468.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const Rk=Ee("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
106
- * @license lucide-react v0.468.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const Nx=Ee("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
111
- * @license lucide-react v0.468.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const Lk=Ee("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
116
- * @license lucide-react v0.468.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const Ak=Ee("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
121
- * @license lucide-react v0.468.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const tn=Ee("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
126
- * @license lucide-react v0.468.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const ic=Ee("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
131
- * @license lucide-react v0.468.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const Wl=Ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
136
- * @license lucide-react v0.468.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const zk=Ee("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
141
- * @license lucide-react v0.468.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const Fk=Ee("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
146
- * @license lucide-react v0.468.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const Px=Ee("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
151
- * @license lucide-react v0.468.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const Mk=Ee("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
156
- * @license lucide-react v0.468.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const qo=Ee("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
161
- * @license lucide-react v0.468.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const Cp=Ee("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
166
- * @license lucide-react v0.468.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const Ui=Ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ok(e,t,n=!0){return nn({queryKey:["fs","browse",e??"~",t],queryFn:()=>{const r=new URLSearchParams;e!==void 0&&r.set("path",e),t&&r.set("showHidden","1");const i=r.toString();return ce(`/api/fs/browse${i?`?${i}`:""}`)},enabled:n,staleTime:3e4})}function Dk(e,t,n=!0){const r=t.toLowerCase();return nn({queryKey:["fs","search-files",e??"",r],queryFn:()=>{if(!e)throw new Error("workspaceId required");const i=new URLSearchParams;return r&&i.set("q",r),ce(`/api/workspaces/${encodeURIComponent(e)}/files/search${i.toString()?`?${i.toString()}`:""}`)},enabled:n&&!!e,staleTime:5e3})}const ur=e=>["resources",e],Kl=e=>["resources",e,"skill-body"],Gl=e=>["resources",e,"prompt-body"];function rn(e,t=""){return`/api/workspaces/${encodeURIComponent(e)}/resources${t}`}function Tx(e){return nn({queryKey:ur(e),queryFn:()=>{if(!e)throw new Error("workspaceId required");return ce(rn(e))},enabled:!!e})}function $k(e){const t=Pe();return Oe({mutationFn:()=>ce(rn(e,"/reload"),{method:"POST"}),onSuccess:n=>{t.setQueryData(ur(e),n),t.invalidateQueries({queryKey:Kl(e)}),t.invalidateQueries({queryKey:Gl(e)})}})}function Bk(e,t){return nn({queryKey:[...Kl(e),t],queryFn:()=>{if(!t)throw new Error("filePath required");return ce(`${rn(e,"/skill")}?path=${encodeURIComponent(t)}`)},enabled:!!t,refetchOnWindowFocus:!1,staleTime:1/0})}function Uk(e){const t=Pe();return Oe({mutationFn:n=>ce(rn(e,"/skills"),{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(ur(e),n)})}function Hk(e){const t=Pe();return Oe({mutationFn:n=>ce(rn(e,"/skills"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>{t.setQueryData(ur(e),n),t.invalidateQueries({queryKey:Kl(e)})}})}function qk(e){const t=Pe();return Oe({mutationFn:({filePath:n})=>ce(`${rn(e,"/skills")}?path=${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:n=>{t.setQueryData(ur(e),n),t.invalidateQueries({queryKey:Kl(e)})}})}function Qk(e,t){return nn({queryKey:[...Gl(e),t],queryFn:()=>{if(!t)throw new Error("filePath required");return ce(`${rn(e,"/prompt")}?path=${encodeURIComponent(t)}`)},enabled:!!t,refetchOnWindowFocus:!1,staleTime:1/0})}function Vk(e){const t=Pe();return Oe({mutationFn:n=>ce(rn(e,"/prompts"),{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(ur(e),n)})}function Wk(e){const t=Pe();return Oe({mutationFn:n=>ce(rn(e,"/prompts"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>{t.setQueryData(ur(e),n),t.invalidateQueries({queryKey:Gl(e)})}})}function Kk(e){const t=Pe();return Oe({mutationFn:({filePath:n})=>ce(`${rn(e,"/prompts")}?path=${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:n=>{t.setQueryData(ur(e),n),t.invalidateQueries({queryKey:Gl(e)})}})}function Gk(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jk={};function jp(e,t){return(Jk.jsx?Xk:Yk).test(e)}const Zk=/[ \t\n\f\r]/g;function eb(e){return typeof e=="object"?e.type==="text"?Ep(e.value):!1:Ep(e)}function Ep(e){return e.replace(Zk,"")===""}class os{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}os.prototype.normal={};os.prototype.property={};os.prototype.space=void 0;function Ix(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new os(n,r,t)}function oc(e){return e.toLowerCase()}class pt{constructor(t,n){this.attribute=n,this.property=t}}pt.prototype.attribute="";pt.prototype.booleanish=!1;pt.prototype.boolean=!1;pt.prototype.commaOrSpaceSeparated=!1;pt.prototype.commaSeparated=!1;pt.prototype.defined=!1;pt.prototype.mustUseProperty=!1;pt.prototype.number=!1;pt.prototype.overloadedBoolean=!1;pt.prototype.property="";pt.prototype.spaceSeparated=!1;pt.prototype.space=void 0;let tb=0;const J=Hr(),Te=Hr(),sc=Hr(),F=Hr(),pe=Hr(),mi=Hr(),mt=Hr();function Hr(){return 2**++tb}const lc=Object.freeze(Object.defineProperty({__proto__:null,boolean:J,booleanish:Te,commaOrSpaceSeparated:mt,commaSeparated:mi,number:F,overloadedBoolean:sc,spaceSeparated:pe},Symbol.toStringTag,{value:"Module"})),Ta=Object.keys(lc);class Sd extends pt{constructor(t,n,r,i){let o=-1;if(super(t,n),Np(this,"space",i),typeof r=="number")for(;++o<Ta.length;){const s=Ta[o];Np(this,Ta[o],(r&lc[s])===lc[s])}}}Sd.prototype.defined=!0;function Np(e,t,n){n&&(e[t]=n)}function Hi(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Sd(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[oc(r)]=r,n[oc(o.attribute)]=r}return new os(t,n,e.space)}const _x=Hi({properties:{ariaActiveDescendant:null,ariaAtomic:Te,ariaAutoComplete:null,ariaBusy:Te,ariaChecked:Te,ariaColCount:F,ariaColIndex:F,ariaColSpan:F,ariaControls:pe,ariaCurrent:null,ariaDescribedBy:pe,ariaDetails:null,ariaDisabled:Te,ariaDropEffect:pe,ariaErrorMessage:null,ariaExpanded:Te,ariaFlowTo:pe,ariaGrabbed:Te,ariaHasPopup:null,ariaHidden:Te,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pe,ariaLevel:F,ariaLive:null,ariaModal:Te,ariaMultiLine:Te,ariaMultiSelectable:Te,ariaOrientation:null,ariaOwns:pe,ariaPlaceholder:null,ariaPosInSet:F,ariaPressed:Te,ariaReadOnly:Te,ariaRelevant:null,ariaRequired:Te,ariaRoleDescription:pe,ariaRowCount:F,ariaRowIndex:F,ariaRowSpan:F,ariaSelected:Te,ariaSetSize:F,ariaSort:null,ariaValueMax:F,ariaValueMin:F,ariaValueNow:F,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Rx(e,t){return t in e?e[t]:t}function Lx(e,t){return Rx(e,t.toLowerCase())}const nb=Hi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mi,acceptCharset:pe,accessKey:pe,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:pe,autoFocus:J,autoPlay:J,blocking:pe,capture:null,charSet:null,checked:J,cite:null,className:pe,cols:F,colSpan:null,content:null,contentEditable:Te,controls:J,controlsList:pe,coords:F|mi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:sc,draggable:Te,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:pe,height:F,hidden:sc,high:F,href:null,hrefLang:null,htmlFor:pe,httpEquiv:pe,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:pe,itemRef:pe,itemScope:J,itemType:pe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:F,manifest:null,max:null,maxLength:F,media:null,method:null,min:null,minLength:F,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,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:J,optimum:F,pattern:null,ping:pe,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:pe,required:J,reversed:J,rows:F,rowSpan:F,sandbox:pe,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shape:null,size:F,sizes:null,slot:null,span:F,spellCheck:Te,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F,step:null,style:null,tabIndex:F,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:Te,width:F,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pe,axis:null,background:null,bgColor:null,border:F,borderColor:null,bottomMargin:F,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:F,leftMargin:F,link:null,longDesc:null,lowSrc:null,marginHeight:F,marginWidth:F,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:F,rules:null,scheme:null,scrolling:Te,standby:null,summary:null,text:null,topMargin:F,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:J,disableRemotePlayback:J,prefix:null,property:null,results:F,security:null,unselectable:null},space:"html",transform:Lx}),rb=Hi({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:mt,accentHeight:F,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F,amplitude:F,arabicForm:null,ascent:F,attributeName:null,attributeType:null,azimuth:F,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F,by:null,calcMode:null,capHeight:F,className:pe,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:F,diffuseConstant:F,direction:null,display:null,dur:null,divisor:F,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:F,enableBackground:null,end:null,event:null,exponent:F,externalResourcesRequired:null,fill:null,fillOpacity:F,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:mi,g2:mi,glyphName:mi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F,horizOriginX:F,horizOriginY:F,id:null,ideographic:F,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F,k:F,k1:F,k2:F,k3:F,k4:F,kernelMatrix:mt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F,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:F,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:F,overlineThickness:F,paintOrder:null,panose1:null,path:null,pathLength:F,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F,pointsAtY:F,pointsAtZ:F,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mt,rev:mt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mt,requiredFeatures:mt,requiredFonts:mt,requiredFormats:mt,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:F,specularExponent:F,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F,strikethroughThickness:F,string:null,stroke:null,strokeDashArray:mt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F,strokeOpacity:F,strokeWidth:null,style:null,surfaceScale:F,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mt,tabIndex:F,tableValues:null,target:null,targetX:F,targetY:F,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F,underlineThickness:F,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F,values:null,vAlphabetic:F,vMathematical:F,vectorEffect:null,vHanging:F,vIdeographic:F,version:null,vertAdvY:F,vertOriginX:F,vertOriginY:F,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Rx}),Ax=Hi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),zx=Hi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Lx}),Fx=Hi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ib={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"},ob=/[A-Z]/g,Pp=/-[a-z]/g,sb=/^data[-\w.:]+$/i;function lb(e,t){const n=oc(t);let r=t,i=pt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&sb.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Pp,ub);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Pp.test(o)){let s=o.replace(ob,ab);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Sd}return new i(r,t)}function ab(e){return"-"+e.toLowerCase()}function ub(e){return e.charAt(1).toUpperCase()}const cb=Ix([_x,nb,Ax,zx,Fx],"html"),Cd=Ix([_x,rb,Ax,zx,Fx],"svg");function db(e){return e.join(" ").trim()}var jd={},Tp=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,fb=/\n/g,pb=/^\s*/,hb=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,mb=/^:\s*/,gb=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,xb=/^[;\s]*/,yb=/^\s+|\s+$/g,vb=`
171
- `,Ip="/",_p="*",mr="",kb="comment",bb="declaration";function wb(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var v=m.match(fb);v&&(n+=v.length);var b=m.lastIndexOf(vb);r=~b?m.length-b:r+m.length}function o(){var m={line:n,column:r};return function(v){return v.position=new s(m),c(),v}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function l(m){var v=new Error(t.source+":"+n+":"+r+": "+m);if(v.reason=m,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function a(m){var v=m.exec(e);if(v){var b=v[0];return i(b),e=e.slice(b.length),v}}function c(){a(pb)}function f(m){var v;for(m=m||[];v=d();)v!==!1&&m.push(v);return m}function d(){var m=o();if(!(Ip!=e.charAt(0)||_p!=e.charAt(1))){for(var v=2;mr!=e.charAt(v)&&(_p!=e.charAt(v)||Ip!=e.charAt(v+1));)++v;if(v+=2,mr===e.charAt(v-1))return l("End of comment missing");var b=e.slice(2,v-2);return r+=2,i(b),e=e.slice(v),r+=2,m({type:kb,comment:b})}}function p(){var m=o(),v=a(hb);if(v){if(d(),!a(mb))return l("property missing ':'");var b=a(gb),g=m({type:bb,property:Rp(v[0].replace(Tp,mr)),value:b?Rp(b[0].replace(Tp,mr)):mr});return a(xb),g}}function h(){var m=[];f(m);for(var v;v=p();)v!==!1&&(m.push(v),f(m));return m}return c(),h()}function Rp(e){return e?e.replace(yb,mr):mr}var Sb=wb,Cb=Ys&&Ys.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jd,"__esModule",{value:!0});jd.default=Eb;const jb=Cb(Sb);function Eb(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,jb.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:l}=o;i?t(s,l,o):l&&(n=n||{},n[s]=l)}),n}var Yl={};Object.defineProperty(Yl,"__esModule",{value:!0});Yl.camelCase=void 0;var Nb=/^--[a-zA-Z0-9_-]+$/,Pb=/-([a-z])/g,Tb=/^[^-]+$/,Ib=/^-(webkit|moz|ms|o|khtml)-/,_b=/^-(ms)-/,Rb=function(e){return!e||Tb.test(e)||Nb.test(e)},Lb=function(e,t){return t.toUpperCase()},Lp=function(e,t){return"".concat(t,"-")},Ab=function(e,t){return t===void 0&&(t={}),Rb(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(_b,Lp):e=e.replace(Ib,Lp),e.replace(Pb,Lb))};Yl.camelCase=Ab;var zb=Ys&&Ys.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Fb=zb(jd),Mb=Yl;function ac(e,t){var n={};return!e||typeof e!="string"||(0,Fb.default)(e,function(r,i){r&&i&&(n[(0,Mb.camelCase)(r,t)]=i)}),n}ac.default=ac;var Ob=ac;const Db=wc(Ob),Mx=Ox("end"),Ed=Ox("start");function Ox(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function $b(e){const t=Ed(e),n=Mx(e);if(t&&n)return{start:t,end:n}}function wo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ap(e.position):"start"in e||"end"in e?Ap(e):"line"in e||"column"in e?uc(e):""}function uc(e){return zp(e&&e.line)+":"+zp(e&&e.column)}function Ap(e){return uc(e&&e.start)+"-"+uc(e&&e.end)}function zp(e){return e&&typeof e=="number"?e:1}class Ke extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=wo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ke.prototype.file="";Ke.prototype.name="";Ke.prototype.reason="";Ke.prototype.message="";Ke.prototype.stack="";Ke.prototype.column=void 0;Ke.prototype.line=void 0;Ke.prototype.ancestors=void 0;Ke.prototype.cause=void 0;Ke.prototype.fatal=void 0;Ke.prototype.place=void 0;Ke.prototype.ruleId=void 0;Ke.prototype.source=void 0;const Nd={}.hasOwnProperty,Bb=new Map,Ub=/[A-Z]/g,Hb=new Set(["table","tbody","thead","tfoot","tr"]),qb=new Set(["td","th"]),Dx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Qb(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Zb(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Jb(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Cd:cb,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=$x(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function $x(e,t,n){if(t.type==="element")return Vb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Wb(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Gb(e,t,n);if(t.type==="mdxjsEsm")return Kb(e,t);if(t.type==="root")return Yb(e,t,n);if(t.type==="text")return Xb(e,t)}function Vb(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Cd,e.schema=i),e.ancestors.push(t);const o=Ux(e,t.tagName,!1),s=ew(e,t);let l=Td(e,t);return Hb.has(t.tagName)&&(l=l.filter(function(a){return typeof a=="string"?!eb(a):!0})),Bx(e,s,o,t),Pd(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Wb(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Qo(e,t.position)}function Kb(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qo(e,t.position)}function Gb(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Cd,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Ux(e,t.name,!0),s=tw(e,t),l=Td(e,t);return Bx(e,s,o,t),Pd(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Yb(e,t,n){const r={};return Pd(r,Td(e,t)),e.create(t,e.Fragment,r,n)}function Xb(e,t){return t.value}function Bx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Pd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Jb(e,t,n){return r;function r(i,o,s,l){const c=Array.isArray(s.children)?n:t;return l?c(o,s,l):c(o,s)}}function Zb(e,t){return n;function n(r,i,o,s){const l=Array.isArray(o.children),a=Ed(r);return t(i,o,s,l,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function ew(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Nd.call(t.properties,i)){const o=nw(e,i,t.properties[i]);if(o){const[s,l]=o;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&qb.has(t.tagName)?r=l:n[s]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function tw(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Qo(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Qo(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Td(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Bb;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const a=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(a){const c=i.get(a)||0;s=a+"-"+c,i.set(a,c+1)}}const l=$x(e,o,s);l!==void 0&&n.push(l)}return n}function nw(e,t,n){const r=lb(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Gk(n):db(n)),r.property==="style"){let i=typeof n=="object"?n:rw(e,String(n));return e.stylePropertyNameCase==="css"&&(i=iw(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?ib[r.property]||r.property:r.attribute,n]}}function rw(e,t){try{return Db(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ke("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Dx+"#cannot-parse-style-attribute",i}}function Ux(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const l=jp(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}r=s}else r=jp(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Nd.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Qo(e)}function Qo(e,t){const n=new Ke("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Dx+"#cannot-handle-mdx-estrees-without-createevaluater",n}function iw(e){const t={};let n;for(n in e)Nd.call(e,n)&&(t[ow(n)]=e[n]);return t}function ow(e){let t=e.replace(Ub,sw);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function sw(e){return"-"+e.toLowerCase()}const Ia={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"]},lw={};function Id(e,t){const n=lw,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Hx(e,r,i)}function Hx(e,t,n){if(aw(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Fp(e.children,t,n)}return Array.isArray(e)?Fp(e,t,n):""}function Fp(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Hx(e[i],t,n);return r.join("")}function aw(e){return!!(e&&typeof e=="object")}const Mp=document.createElement("i");function _d(e){const t="&"+e+";";Mp.innerHTML=t;const n=Mp.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function wt(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Tt(e,t){return e.length>0?(wt(e,e.length,0,t),e):t}const Op={}.hasOwnProperty;function qx(e){const t={};let n=-1;for(;++n<e.length;)uw(t,e[n]);return t}function uw(e,t){let n;for(n in t){const i=(Op.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Op.call(i,s)||(i[s]=[]);const l=o[s];cw(i[s],Array.isArray(l)?l:l?[l]:[])}}}function cw(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);wt(e,0,0,r)}function Qx(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ut(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ze=cr(/[A-Za-z]/),Ve=cr(/[\dA-Za-z]/),dw=cr(/[#-'*+\--9=?A-Z^-~]/);function Sl(e){return e!==null&&(e<32||e===127)}const cc=cr(/\d/),fw=cr(/[\dA-Fa-f]/),pw=cr(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function fe(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}const Xl=cr(new RegExp("\\p{P}|\\p{S}","u")),Or=cr(/\s/);function cr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qi(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Ve(e.charCodeAt(n+1))&&Ve(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(s=String.fromCharCode(o,l),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ie(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(a){return Z(a)?(e.enter(n),l(a)):t(a)}function l(a){return Z(a)&&o++<i?(e.consume(a),l):(e.exit(n),t(a))}}const hw={tokenize:mw};function mw(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ie(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),o(l)}function o(l){const a=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=a),n=a,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return W(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),s)}}const gw={tokenize:xw},Dp={tokenize:yw};function xw(e){const t=this,n=[];let r=0,i,o,s;return l;function l(y){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,a,c)(y)}return c(y)}function a(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const S=t.events.length;let P=S,E;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){E=t.events[P][1].end;break}g(r);let I=S;for(;I<t.events.length;)t.events[I][1].end={...E},I++;return wt(t.events,P+1,0,t.events.slice(S)),t.events.length=I,c(y)}return l(y)}function c(y){if(r===n.length){if(!i)return p(y);if(i.currentConstruct&&i.currentConstruct.concrete)return m(y);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Dp,f,d)(y)}function f(y){return i&&x(),g(r),p(y)}function d(y){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(y)}function p(y){return t.containerState={},e.attempt(Dp,h,m)(y)}function h(y){return r++,n.push([t.currentConstruct,t.containerState]),p(y)}function m(y){if(y===null){i&&x(),g(0),e.consume(y);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),v(y)}function v(y){if(y===null){b(e.exit("chunkFlow"),!0),g(0),e.consume(y);return}return W(y)?(e.consume(y),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(y),v)}function b(y,S){const P=t.sliceStream(y);if(S&&P.push(null),y.previous=o,o&&(o.next=y),o=y,i.defineSkip(y.start),i.write(P),t.parser.lazy[y.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<s&&(!i.events[E][1].end||i.events[E][1].end.offset>s))return;const I=t.events.length;let T=I,L,j;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(L){j=t.events[T][1].end;break}L=!0}for(g(r),E=I;E<t.events.length;)t.events[E][1].end={...j},E++;wt(t.events,T+1,0,t.events.slice(I)),t.events.length=E}}function g(y){let S=n.length;for(;S-- >y;){const P=n[S];t.containerState=P[1],P[0].exit.call(t,e)}n.length=y}function x(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function yw(e,t,n){return ie(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Mi(e){if(e===null||fe(e)||Or(e))return 1;if(Xl(e))return 2}function Jl(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const dc={name:"attention",resolveAll:vw,tokenize:kw};function vw(e,t){let n=-1,r,i,o,s,l,a,c,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;a=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};$p(d,-a),$p(p,a),s={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Tt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Tt(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=Tt(c,Jl(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Tt(c,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=Tt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,wt(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function kw(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Mi(r);let o;return s;function s(a){return o=a,e.enter("attentionSequence"),l(a)}function l(a){if(a===o)return e.consume(a),l;const c=e.exit("attentionSequence"),f=Mi(a),d=!f||f===2&&i||n.includes(a),p=!i||i===2&&f||n.includes(r);return c._open=!!(o===42?d:d&&(i||!p)),c._close=!!(o===42?p:p&&(f||!d)),t(a)}}function $p(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const bw={name:"autolink",tokenize:ww};function ww(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return Ze(h)?(e.consume(h),s):h===64?n(h):c(h)}function s(h){return h===43||h===45||h===46||Ve(h)?(r=1,l(h)):c(h)}function l(h){return h===58?(e.consume(h),r=0,a):(h===43||h===45||h===46||Ve(h))&&r++<32?(e.consume(h),l):(r=0,c(h))}function a(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Sl(h)?n(h):(e.consume(h),a)}function c(h){return h===64?(e.consume(h),f):dw(h)?(e.consume(h),c):n(h)}function f(h){return Ve(h)?d(h):n(h)}function d(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||Ve(h))&&r++<63){const m=h===45?p:d;return e.consume(h),m}return n(h)}}const ss={partial:!0,tokenize:Sw};function Sw(e,t,n){return r;function r(o){return Z(o)?ie(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||W(o)?t(o):n(o)}}const Vx={continuation:{tokenize:jw},exit:Ew,name:"blockQuote",tokenize:Cw};function Cw(e,t,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Z(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function jw(e,t,n){const r=this;return i;function i(s){return Z(s)?ie(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Vx,t,n)(s)}}function Ew(e){e.exit("blockQuote")}const Wx={name:"characterEscape",tokenize:Nw};function Nw(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return pw(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Kx={name:"characterReference",tokenize:Pw};function Pw(e,t,n){const r=this;let i=0,o,s;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),a}function a(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Ve,f(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=fw,f):(e.enter("characterReferenceValue"),o=7,s=cc,f(d))}function f(d){if(d===59&&i){const p=e.exit("characterReferenceValue");return s===Ve&&!_d(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),f):n(d)}}const Bp={partial:!0,tokenize:Iw},Up={concrete:!0,name:"codeFenced",tokenize:Tw};function Tw(e,t,n){const r=this,i={partial:!0,tokenize:P};let o=0,s=0,l;return a;function a(E){return c(E)}function c(E){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,l=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===l?(s++,e.consume(E),f):s<3?n(E):(e.exit("codeFencedFenceSequence"),Z(E)?ie(e,d,"whitespace")(E):d(E))}function d(E){return E===null||W(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Bp,v,S)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||W(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(E)):Z(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ie(e,h,"whitespace")(E)):E===96&&E===l?n(E):(e.consume(E),p)}function h(E){return E===null||W(E)?d(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||W(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(E)):E===96&&E===l?n(E):(e.consume(E),m)}function v(E){return e.attempt(i,S,b)(E)}function b(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),g}function g(E){return o>0&&Z(E)?ie(e,x,"linePrefix",o+1)(E):x(E)}function x(E){return E===null||W(E)?e.check(Bp,v,S)(E):(e.enter("codeFlowValue"),y(E))}function y(E){return E===null||W(E)?(e.exit("codeFlowValue"),x(E)):(e.consume(E),y)}function S(E){return e.exit("codeFenced"),t(E)}function P(E,I,T){let L=0;return j;function j(q){return E.enter("lineEnding"),E.consume(q),E.exit("lineEnding"),A}function A(q){return E.enter("codeFencedFence"),Z(q)?ie(E,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):R(q)}function R(q){return q===l?(E.enter("codeFencedFenceSequence"),$(q)):T(q)}function $(q){return q===l?(L++,E.consume(q),$):L>=s?(E.exit("codeFencedFenceSequence"),Z(q)?ie(E,U,"whitespace")(q):U(q)):T(q)}function U(q){return q===null||W(q)?(E.exit("codeFencedFence"),I(q)):T(q)}}}function Iw(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const _a={name:"codeIndented",tokenize:Rw},_w={partial:!0,tokenize:Lw};function Rw(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ie(e,o,"linePrefix",5)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?a(c):W(c)?e.attempt(_w,s,a)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||W(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),l)}function a(c){return e.exit("codeIndented"),t(c)}}function Lw(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):W(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ie(e,o,"linePrefix",5)(s)}function o(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):W(s)?i(s):n(s)}}const Aw={name:"codeText",previous:Fw,resolve:zw,tokenize:Mw};function zw(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Fw(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Mw(e,t,n){let r=0,i,o;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),r++,l):(e.exit("codeTextSequence"),a(d))}function a(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),a):d===96?(o=e.enter("codeTextSequence"),i=0,f(d)):W(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),a):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||W(d)?(e.exit("codeTextData"),a(d)):(e.consume(d),c)}function f(d){return d===96?(e.consume(d),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class Ow{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&ro(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ro(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ro(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ro(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ro(this.left,n.reverse())}}}function ro(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Gx(e){const t={};let n=-1,r,i,o,s,l,a,c;const f=new Ow(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(a=r[1]._tokenizer.events,o=0,o<a.length&&a[o][1].type==="lineEndingBlank"&&(o+=2),o<a.length&&a[o][1].type==="content"))for(;++o<a.length&&a[o][1].type!=="content";)a[o][1].type==="chunkText"&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Dw(f,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},l=f.slice(i,n),l.unshift(r),f.splice(i,n-i+1,l))}}return wt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!c}function Dw(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,a=[],c={};let f,d,p=-1,h=n,m=0,v=0;const b=[v];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),d&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<l.length;)l[p][0]==="exit"&&l[p-1][0]==="enter"&&l[p][1].type===l[p-1][1].type&&l[p][1].start.line!==l[p][1].end.line&&(v=p+1,b.push(v),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):b.pop(),p=b.length;p--;){const g=l.slice(b[p],b[p+1]),x=o.pop();a.push([x,x+g.length-1]),e.splice(x,2,g)}for(a.reverse(),p=-1;++p<a.length;)c[m+a[p][0]]=m+a[p][1],m+=a[p][1]-a[p][0]-1;return c}const $w={resolve:Uw,tokenize:Hw},Bw={partial:!0,tokenize:qw};function Uw(e){return Gx(e),e}function Hw(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):W(l)?e.check(Bw,s,o)(l):(e.consume(l),i)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function qw(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ie(e,o,"linePrefix")}function o(s){if(s===null||W(s))return n(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Yx(e,t,n,r,i,o,s,l,a){const c=a||Number.POSITIVE_INFINITY;let f=0;return d;function d(g){return g===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(g),e.exit(o),p):g===null||g===32||g===41||Sl(g)?n(g):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),v(g))}function p(g){return g===62?(e.enter(o),e.consume(g),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(l),p(g)):g===null||g===60||W(g)?n(g):(e.consume(g),g===92?m:h)}function m(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function v(g){return!f&&(g===null||g===41||fe(g))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(g)):f<c&&g===40?(e.consume(g),f++,v):g===41?(e.consume(g),f--,v):g===null||g===32||g===40||Sl(g)?n(g):(e.consume(g),g===92?b:v)}function b(g){return g===40||g===41||g===92?(e.consume(g),v):v(g)}}function Xx(e,t,n,r,i,o){const s=this;let l=0,a;return c;function c(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return l>999||h===null||h===91||h===93&&!a||h===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):W(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||W(h)||l++>999?(e.exit("chunkString"),f(h)):(e.consume(h),a||(a=!Z(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function Jx(e,t,n,r,i,o){let s;return l;function l(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),s=p===40?41:p,a):n(p)}function a(p){return p===s?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===s?(e.exit(o),a(s)):p===null?n(p):W(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),ie(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===s||p===null||W(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?d:f)}function d(p){return p===s||p===92?(e.consume(p),f):f(p)}}function So(e,t){let n;return r;function r(i){return W(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Z(i)?ie(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Qw={name:"definition",tokenize:Ww},Vw={partial:!0,tokenize:Kw};function Ww(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),s(h)}function s(h){return Xx.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return i=Ut(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return fe(h)?So(e,c)(h):c(h)}function c(h){return Yx(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(Vw,d,d)(h)}function d(h){return Z(h)?ie(e,p,"whitespace")(h):p(h)}function p(h){return h===null||W(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function Kw(e,t,n){return r;function r(l){return fe(l)?So(e,i)(l):n(l)}function i(l){return Jx(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return Z(l)?ie(e,s,"whitespace")(l):s(l)}function s(l){return l===null||W(l)?t(l):n(l)}}const Gw={name:"hardBreakEscape",tokenize:Yw};function Yw(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return W(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Xw={name:"headingAtx",resolve:Jw,tokenize:Zw};function Jw(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},wt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Zw(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||fe(f)?(e.exit("atxHeadingSequence"),l(f)):n(f)}function l(f){return f===35?(e.enter("atxHeadingSequence"),a(f)):f===null||W(f)?(e.exit("atxHeading"),t(f)):Z(f)?ie(e,l,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function a(f){return f===35?(e.consume(f),a):(e.exit("atxHeadingSequence"),l(f))}function c(f){return f===null||f===35||fe(f)?(e.exit("atxHeadingText"),l(f)):(e.consume(f),c)}}const eS=["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"],Hp=["pre","script","style","textarea"],tS={concrete:!0,name:"htmlFlow",resolveTo:iS,tokenize:oS},nS={partial:!0,tokenize:lS},rS={partial:!0,tokenize:sS};function iS(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function oS(e,t,n){const r=this;let i,o,s,l,a;return c;function c(w){return f(w)}function f(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),d}function d(w){return w===33?(e.consume(w),p):w===47?(e.consume(w),o=!0,v):w===63?(e.consume(w),i=3,r.interrupt?t:k):Ze(w)?(e.consume(w),s=String.fromCharCode(w),b):n(w)}function p(w){return w===45?(e.consume(w),i=2,h):w===91?(e.consume(w),i=5,l=0,m):Ze(w)?(e.consume(w),i=4,r.interrupt?t:k):n(w)}function h(w){return w===45?(e.consume(w),r.interrupt?t:k):n(w)}function m(w){const ke="CDATA[";return w===ke.charCodeAt(l++)?(e.consume(w),l===ke.length?r.interrupt?t:R:m):n(w)}function v(w){return Ze(w)?(e.consume(w),s=String.fromCharCode(w),b):n(w)}function b(w){if(w===null||w===47||w===62||fe(w)){const ke=w===47,rt=s.toLowerCase();return!ke&&!o&&Hp.includes(rt)?(i=1,r.interrupt?t(w):R(w)):eS.includes(s.toLowerCase())?(i=6,ke?(e.consume(w),g):r.interrupt?t(w):R(w)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(w):o?x(w):y(w))}return w===45||Ve(w)?(e.consume(w),s+=String.fromCharCode(w),b):n(w)}function g(w){return w===62?(e.consume(w),r.interrupt?t:R):n(w)}function x(w){return Z(w)?(e.consume(w),x):j(w)}function y(w){return w===47?(e.consume(w),j):w===58||w===95||Ze(w)?(e.consume(w),S):Z(w)?(e.consume(w),y):j(w)}function S(w){return w===45||w===46||w===58||w===95||Ve(w)?(e.consume(w),S):P(w)}function P(w){return w===61?(e.consume(w),E):Z(w)?(e.consume(w),P):y(w)}function E(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),a=w,I):Z(w)?(e.consume(w),E):T(w)}function I(w){return w===a?(e.consume(w),a=null,L):w===null||W(w)?n(w):(e.consume(w),I)}function T(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||fe(w)?P(w):(e.consume(w),T)}function L(w){return w===47||w===62||Z(w)?y(w):n(w)}function j(w){return w===62?(e.consume(w),A):n(w)}function A(w){return w===null||W(w)?R(w):Z(w)?(e.consume(w),A):n(w)}function R(w){return w===45&&i===2?(e.consume(w),le):w===60&&i===1?(e.consume(w),oe):w===62&&i===4?(e.consume(w),K):w===63&&i===3?(e.consume(w),k):w===93&&i===5?(e.consume(w),H):W(w)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(nS,te,$)(w)):w===null||W(w)?(e.exit("htmlFlowData"),$(w)):(e.consume(w),R)}function $(w){return e.check(rS,U,te)(w)}function U(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),q}function q(w){return w===null||W(w)?$(w):(e.enter("htmlFlowData"),R(w))}function le(w){return w===45?(e.consume(w),k):R(w)}function oe(w){return w===47?(e.consume(w),s="",M):R(w)}function M(w){if(w===62){const ke=s.toLowerCase();return Hp.includes(ke)?(e.consume(w),K):R(w)}return Ze(w)&&s.length<8?(e.consume(w),s+=String.fromCharCode(w),M):R(w)}function H(w){return w===93?(e.consume(w),k):R(w)}function k(w){return w===62?(e.consume(w),K):w===45&&i===2?(e.consume(w),k):R(w)}function K(w){return w===null||W(w)?(e.exit("htmlFlowData"),te(w)):(e.consume(w),K)}function te(w){return e.exit("htmlFlow"),t(w)}}function sS(e,t,n){const r=this;return i;function i(s){return W(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function lS(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ss,t,n)}}const aS={name:"htmlText",tokenize:uS};function uS(e,t,n){const r=this;let i,o,s;return l;function l(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),P):k===63?(e.consume(k),y):Ze(k)?(e.consume(k),T):n(k)}function c(k){return k===45?(e.consume(k),f):k===91?(e.consume(k),o=0,m):Ze(k)?(e.consume(k),x):n(k)}function f(k){return k===45?(e.consume(k),h):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),p):W(k)?(s=d,oe(k)):(e.consume(k),d)}function p(k){return k===45?(e.consume(k),h):d(k)}function h(k){return k===62?le(k):k===45?p(k):d(k)}function m(k){const K="CDATA[";return k===K.charCodeAt(o++)?(e.consume(k),o===K.length?v:m):n(k)}function v(k){return k===null?n(k):k===93?(e.consume(k),b):W(k)?(s=v,oe(k)):(e.consume(k),v)}function b(k){return k===93?(e.consume(k),g):v(k)}function g(k){return k===62?le(k):k===93?(e.consume(k),g):v(k)}function x(k){return k===null||k===62?le(k):W(k)?(s=x,oe(k)):(e.consume(k),x)}function y(k){return k===null?n(k):k===63?(e.consume(k),S):W(k)?(s=y,oe(k)):(e.consume(k),y)}function S(k){return k===62?le(k):y(k)}function P(k){return Ze(k)?(e.consume(k),E):n(k)}function E(k){return k===45||Ve(k)?(e.consume(k),E):I(k)}function I(k){return W(k)?(s=I,oe(k)):Z(k)?(e.consume(k),I):le(k)}function T(k){return k===45||Ve(k)?(e.consume(k),T):k===47||k===62||fe(k)?L(k):n(k)}function L(k){return k===47?(e.consume(k),le):k===58||k===95||Ze(k)?(e.consume(k),j):W(k)?(s=L,oe(k)):Z(k)?(e.consume(k),L):le(k)}function j(k){return k===45||k===46||k===58||k===95||Ve(k)?(e.consume(k),j):A(k)}function A(k){return k===61?(e.consume(k),R):W(k)?(s=A,oe(k)):Z(k)?(e.consume(k),A):L(k)}function R(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,$):W(k)?(s=R,oe(k)):Z(k)?(e.consume(k),R):(e.consume(k),U)}function $(k){return k===i?(e.consume(k),i=void 0,q):k===null?n(k):W(k)?(s=$,oe(k)):(e.consume(k),$)}function U(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||fe(k)?L(k):(e.consume(k),U)}function q(k){return k===47||k===62||fe(k)?L(k):n(k)}function le(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function oe(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),M}function M(k){return Z(k)?ie(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):H(k)}function H(k){return e.enter("htmlTextData"),s(k)}}const Rd={name:"labelEnd",resolveAll:pS,resolveTo:hS,tokenize:mS},cS={tokenize:gS},dS={tokenize:xS},fS={tokenize:yS};function pS(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&wt(e,0,e.length,n),e}function hS(e,t){let n=e.length,r=0,i,o,s,l;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const a={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",a,t],["enter",c,t]],l=Tt(l,e.slice(o+1,o+r+3)),l=Tt(l,[["enter",f,t]]),l=Tt(l,Jl(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),l=Tt(l,[["exit",f,t],e[s-2],e[s-1],["exit",c,t]]),l=Tt(l,e.slice(s+1)),l=Tt(l,[["exit",a,t]]),wt(e,o,e.length,l),e}function mS(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return l;function l(p){return o?o._inactive?d(p):(s=r.parser.defined.includes(Ut(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),a):n(p)}function a(p){return p===40?e.attempt(cS,f,s?f:d)(p):p===91?e.attempt(dS,f,s?c:d)(p):s?f(p):d(p)}function c(p){return e.attempt(fS,f,d)(p)}function f(p){return t(p)}function d(p){return o._balanced=!0,n(p)}}function gS(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return fe(d)?So(e,o)(d):o(d)}function o(d){return d===41?f(d):Yx(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return fe(d)?So(e,a)(d):f(d)}function l(d){return n(d)}function a(d){return d===34||d===39||d===40?Jx(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function c(d){return fe(d)?So(e,f)(d):f(d)}function f(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function xS(e,t,n){const r=this;return i;function i(l){return Xx.call(r,e,o,s,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(Ut(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function yS(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const vS={name:"labelStartImage",resolveAll:Rd.resolveAll,tokenize:kS};function kS(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const bS={name:"labelStartLink",resolveAll:Rd.resolveAll,tokenize:wS};function wS(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Ra={name:"lineEnding",tokenize:SS};function SS(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ie(e,t,"linePrefix")}}const Ws={name:"thematicBreak",tokenize:CS};function CS(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,l(c)}function l(c){return c===i?(e.enter("thematicBreakSequence"),a(c)):r>=3&&(c===null||W(c))?(e.exit("thematicBreak"),t(c)):n(c)}function a(c){return c===i?(e.consume(c),r++,a):(e.exit("thematicBreakSequence"),Z(c)?ie(e,l,"whitespace")(c):l(c))}}const it={continuation:{tokenize:PS},exit:IS,name:"list",tokenize:NS},jS={partial:!0,tokenize:_S},ES={partial:!0,tokenize:TS};function NS(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:cc(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Ws,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return cc(h)&&++s<10?(e.consume(h),a):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(ss,r.interrupt?n:f,e.attempt(jS,p,d))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function d(h){return Z(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function PS(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ss,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ie(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!Z(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ES,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ie(e,e.attempt(it,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function TS(e,t,n){const r=this;return ie(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function IS(e){e.exit(this.containerState.type)}function _S(e,t,n){const r=this;return ie(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Z(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const qp={name:"setextUnderline",resolveTo:RS,tokenize:LS};function RS(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function LS(e,t,n){const r=this;let i;return o;function o(c){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),Z(c)?ie(e,a,"lineSuffix")(c):a(c))}function a(c){return c===null||W(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const AS={tokenize:zS};function zS(e){const t=this,n=e.attempt(ss,r,e.attempt(this.parser.constructs.flowInitial,i,ie(e,e.attempt(this.parser.constructs.flow,i,e.attempt($w,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const FS={resolveAll:ey()},MS=Zx("string"),OS=Zx("text");function Zx(e){return{resolveAll:ey(e==="text"?DS:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,l);return s;function s(f){return c(f)?o(f):l(f)}function l(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),a}function a(f){return c(f)?(n.exit("data"),o(f)):(n.consume(f),a)}function c(f){if(f===null)return!0;const d=i[f];let p=-1;if(d)for(;++p<d.length;){const h=d[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function ey(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function DS(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,l=0,a;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(c===-2)a=!0,l++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const c={type:n===e.length||a||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const $S={42:it,43:it,45:it,48:it,49:it,50:it,51:it,52:it,53:it,54:it,55:it,56:it,57:it,62:Vx},BS={91:Qw},US={[-2]:_a,[-1]:_a,32:_a},HS={35:Xw,42:Ws,45:[qp,Ws],60:tS,61:qp,95:Ws,96:Up,126:Up},qS={38:Kx,92:Wx},QS={[-5]:Ra,[-4]:Ra,[-3]:Ra,33:vS,38:Kx,42:dc,60:[bw,aS],91:bS,92:[Gw,Wx],93:Rd,95:dc,96:Aw},VS={null:[dc,FS]},WS={null:[42,95]},KS={null:[]},GS=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:WS,contentInitial:BS,disable:KS,document:$S,flow:HS,flowInitial:US,insideSpan:VS,string:qS,text:QS},Symbol.toStringTag,{value:"Module"}));function YS(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],l=[];const a={attempt:I(P),check:I(E),consume:x,enter:y,exit:S,interrupt:I(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:v,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:d};let f=t.tokenize.call(c,a);return t.resolveAll&&o.push(t),c;function d(A){return s=Tt(s,A),b(),s[s.length-1]!==null?[]:(T(t,0),c.events=Jl(o,c.events,c),c.events)}function p(A,R){return JS(h(A),R)}function h(A){return XS(s,A)}function m(){const{_bufferIndex:A,_index:R,line:$,column:U,offset:q}=r;return{_bufferIndex:A,_index:R,line:$,column:U,offset:q}}function v(A){i[A.line]=A.column,j()}function b(){let A;for(;r._index<s.length;){const R=s[r._index];if(typeof R=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<R.length;)g(R.charCodeAt(r._bufferIndex));else g(R)}}function g(A){f=f(A)}function x(A){W(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,j()):A!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=A}function y(A,R){const $=R||{};return $.type=A,$.start=m(),c.events.push(["enter",$,c]),l.push($),$}function S(A){const R=l.pop();return R.end=m(),c.events.push(["exit",R,c]),R}function P(A,R){T(A,R.from)}function E(A,R){R.restore()}function I(A,R){return $;function $(U,q,le){let oe,M,H,k;return Array.isArray(U)?te(U):"tokenize"in U?te([U]):K(U);function K(me){return qt;function qt(En){const qr=En!==null&&me[En],Qr=En!==null&&me.null,us=[...Array.isArray(qr)?qr:qr?[qr]:[],...Array.isArray(Qr)?Qr:Qr?[Qr]:[]];return te(us)(En)}}function te(me){return oe=me,M=0,me.length===0?le:w(me[M])}function w(me){return qt;function qt(En){return k=L(),H=me,me.partial||(c.currentConstruct=me),me.name&&c.parser.constructs.disable.null.includes(me.name)?rt():me.tokenize.call(R?Object.assign(Object.create(c),R):c,a,ke,rt)(En)}}function ke(me){return A(H,k),q}function rt(me){return k.restore(),++M<oe.length?w(oe[M]):le}}}function T(A,R){A.resolveAll&&!o.includes(A)&&o.push(A),A.resolve&&wt(c.events,R,c.events.length-R,A.resolve(c.events.slice(R),c)),A.resolveTo&&(c.events=A.resolveTo(c.events,c))}function L(){const A=m(),R=c.previous,$=c.currentConstruct,U=c.events.length,q=Array.from(l);return{from:U,restore:le};function le(){r=A,c.previous=R,c.currentConstruct=$,c.events.length=U,l=q,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function XS(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function JS(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
172
- `;break}case-3:{s=`\r
173
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function ZS(e){const r={constructs:qx([GS,...(e||{}).extensions||[]]),content:i(hw),defined:[],document:i(gw),flow:i(AS),lazy:{},string:i(MS),text:i(OS)};return r;function i(o){return s;function s(l){return YS(r,o,l)}}}function eC(e){for(;!Gx(e););return e}const Qp=/[\0\t\n\r]/g;function tC(){let e=1,t="",n=!0,r;return i;function i(o,s,l){const a=[];let c,f,d,p,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(Qp.lastIndex=d,c=Qp.exec(o),p=c&&c.index!==void 0?c.index:o.length,h=o.charCodeAt(p),!c){t=o.slice(d);break}if(h===10&&d===p&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),d<p&&(a.push(o.slice(d,p)),e+=p-d),h){case 0:{a.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,a.push(-2);e++<f;)a.push(-1);break}case 10:{a.push(-4),e=1;break}default:r=!0,e=1}d=p+1}return l&&(r&&a.push(-5),t&&a.push(t),a.push(null)),a}}const nC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rC(e){return e.replace(nC,iC)}function iC(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Qx(n.slice(o?2:1),o?16:10)}return _d(n)||e}const ty={}.hasOwnProperty;function oC(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),sC(n)(eC(ZS(n).document().write(tC()(e,t,!0))))}function sC(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(tf),autolinkProtocol:L,autolinkEmail:L,atxHeading:o(Jd),blockQuote:o(Qr),characterEscape:L,characterReference:L,codeFenced:o(us),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(us,s),codeText:o(Zy,s),codeTextData:L,data:L,codeFlowValue:L,definition:o(e1),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(t1),hardBreakEscape:o(Zd),hardBreakTrailing:o(Zd),htmlFlow:o(ef,s),htmlFlowData:L,htmlText:o(ef,s),htmlTextData:L,image:o(n1),label:s,link:o(tf),listItem:o(r1),listItemValue:p,listOrdered:o(nf,d),listUnordered:o(nf),paragraph:o(i1),reference:w,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Jd),strong:o(o1),thematicBreak:o(l1)},exit:{atxHeading:a(),atxHeadingSequence:P,autolink:a(),autolinkEmail:qr,autolinkProtocol:En,blockQuote:a(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:rt,characterReferenceMarkerNumeric:rt,characterReferenceValue:me,characterReference:qt,codeFenced:a(b),codeFencedFence:v,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:j,codeIndented:a(g),codeText:a(q),codeTextData:j,data:j,definition:a(),definitionDestinationString:S,definitionLabelString:x,definitionTitleString:y,emphasis:a(),hardBreakEscape:a(R),hardBreakTrailing:a(R),htmlFlow:a($),htmlFlowData:j,htmlText:a(U),htmlTextData:j,image:a(oe),label:H,labelText:M,lineEnding:A,link:a(le),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:ke,resourceDestinationString:k,resourceTitleString:K,resource:te,setextHeading:a(T),setextHeadingLineSequence:I,setextHeadingText:E,strong:a(),thematicBreak:a()}};ny(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(_){let O={type:"root",children:[]};const G={stack:[O],tokenStack:[],config:t,enter:l,exit:c,buffer:s,resume:f,data:n},ne=[];let de=-1;for(;++de<_.length;)if(_[de][1].type==="listOrdered"||_[de][1].type==="listUnordered")if(_[de][0]==="enter")ne.push(de);else{const At=ne.pop();de=i(_,At,de)}for(de=-1;++de<_.length;){const At=t[_[de][0]];ty.call(At,_[de][1].type)&&At[_[de][1].type].call(Object.assign({sliceSerialize:_[de][2].sliceSerialize},G),_[de][1])}if(G.tokenStack.length>0){const At=G.tokenStack[G.tokenStack.length-1];(At[1]||Vp).call(G,void 0,At[0])}for(O.position={start:Pn(_.length>0?_[0][1].start:{line:1,column:1,offset:0}),end:Pn(_.length>0?_[_.length-2][1].end:{line:1,column:1,offset:0})},de=-1;++de<t.transforms.length;)O=t.transforms[de](O)||O;return O}function i(_,O,G){let ne=O-1,de=-1,At=!1,dr,sn,Wi,Ki;for(;++ne<=G;){const ht=_[ne];switch(ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ht[0]==="enter"?de++:de--,Ki=void 0;break}case"lineEndingBlank":{ht[0]==="enter"&&(dr&&!Ki&&!de&&!Wi&&(Wi=ne),Ki=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ki=void 0}if(!de&&ht[0]==="enter"&&ht[1].type==="listItemPrefix"||de===-1&&ht[0]==="exit"&&(ht[1].type==="listUnordered"||ht[1].type==="listOrdered")){if(dr){let Vr=ne;for(sn=void 0;Vr--;){const ln=_[Vr];if(ln[1].type==="lineEnding"||ln[1].type==="lineEndingBlank"){if(ln[0]==="exit")continue;sn&&(_[sn][1].type="lineEndingBlank",At=!0),ln[1].type="lineEnding",sn=Vr}else if(!(ln[1].type==="linePrefix"||ln[1].type==="blockQuotePrefix"||ln[1].type==="blockQuotePrefixWhitespace"||ln[1].type==="blockQuoteMarker"||ln[1].type==="listItemIndent"))break}Wi&&(!sn||Wi<sn)&&(dr._spread=!0),dr.end=Object.assign({},sn?_[sn][1].start:ht[1].end),_.splice(sn||ne,0,["exit",dr,ht[2]]),ne++,G++}if(ht[1].type==="listItemPrefix"){const Vr={type:"listItem",_spread:!1,start:Object.assign({},ht[1].start),end:void 0};dr=Vr,_.splice(ne,0,["enter",Vr,ht[2]]),ne++,G++,Wi=void 0,Ki=!0}}}return _[O][1]._spread=At,G}function o(_,O){return G;function G(ne){l.call(this,_(ne),ne),O&&O.call(this,ne)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(_,O,G){this.stack[this.stack.length-1].children.push(_),this.stack.push(_),this.tokenStack.push([O,G||void 0]),_.position={start:Pn(O.start),end:void 0}}function a(_){return O;function O(G){_&&_.call(this,G),c.call(this,G)}}function c(_,O){const G=this.stack.pop(),ne=this.tokenStack.pop();if(ne)ne[0].type!==_.type&&(O?O.call(this,_,ne[0]):(ne[1]||Vp).call(this,_,ne[0]));else throw new Error("Cannot close `"+_.type+"` ("+wo({start:_.start,end:_.end})+"): it’s not open");G.position.end=Pn(_.end)}function f(){return Id(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(_){if(this.data.expectingFirstListItemValue){const O=this.stack[this.stack.length-2];O.start=Number.parseInt(this.sliceSerialize(_),10),this.data.expectingFirstListItemValue=void 0}}function h(){const _=this.resume(),O=this.stack[this.stack.length-1];O.lang=_}function m(){const _=this.resume(),O=this.stack[this.stack.length-1];O.meta=_}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const _=this.resume(),O=this.stack[this.stack.length-1];O.value=_.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const _=this.resume(),O=this.stack[this.stack.length-1];O.value=_.replace(/(\r?\n|\r)$/g,"")}function x(_){const O=this.resume(),G=this.stack[this.stack.length-1];G.label=O,G.identifier=Ut(this.sliceSerialize(_)).toLowerCase()}function y(){const _=this.resume(),O=this.stack[this.stack.length-1];O.title=_}function S(){const _=this.resume(),O=this.stack[this.stack.length-1];O.url=_}function P(_){const O=this.stack[this.stack.length-1];if(!O.depth){const G=this.sliceSerialize(_).length;O.depth=G}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function I(_){const O=this.stack[this.stack.length-1];O.depth=this.sliceSerialize(_).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function L(_){const G=this.stack[this.stack.length-1].children;let ne=G[G.length-1];(!ne||ne.type!=="text")&&(ne=s1(),ne.position={start:Pn(_.start),end:void 0},G.push(ne)),this.stack.push(ne)}function j(_){const O=this.stack.pop();O.value+=this.sliceSerialize(_),O.position.end=Pn(_.end)}function A(_){const O=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=O.children[O.children.length-1];G.position.end=Pn(_.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(O.type)&&(L.call(this,_),j.call(this,_))}function R(){this.data.atHardBreak=!0}function $(){const _=this.resume(),O=this.stack[this.stack.length-1];O.value=_}function U(){const _=this.resume(),O=this.stack[this.stack.length-1];O.value=_}function q(){const _=this.resume(),O=this.stack[this.stack.length-1];O.value=_}function le(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const O=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=O,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function oe(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const O=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=O,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function M(_){const O=this.sliceSerialize(_),G=this.stack[this.stack.length-2];G.label=rC(O),G.identifier=Ut(O).toLowerCase()}function H(){const _=this.stack[this.stack.length-1],O=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const ne=_.children;G.children=ne}else G.alt=O}function k(){const _=this.resume(),O=this.stack[this.stack.length-1];O.url=_}function K(){const _=this.resume(),O=this.stack[this.stack.length-1];O.title=_}function te(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function ke(_){const O=this.resume(),G=this.stack[this.stack.length-1];G.label=O,G.identifier=Ut(this.sliceSerialize(_)).toLowerCase(),this.data.referenceType="full"}function rt(_){this.data.characterReferenceType=_.type}function me(_){const O=this.sliceSerialize(_),G=this.data.characterReferenceType;let ne;G?(ne=Qx(O,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ne=_d(O);const de=this.stack[this.stack.length-1];de.value+=ne}function qt(_){const O=this.stack.pop();O.position.end=Pn(_.end)}function En(_){j.call(this,_);const O=this.stack[this.stack.length-1];O.url=this.sliceSerialize(_)}function qr(_){j.call(this,_);const O=this.stack[this.stack.length-1];O.url="mailto:"+this.sliceSerialize(_)}function Qr(){return{type:"blockquote",children:[]}}function us(){return{type:"code",lang:null,meta:null,value:""}}function Zy(){return{type:"inlineCode",value:""}}function e1(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function t1(){return{type:"emphasis",children:[]}}function Jd(){return{type:"heading",depth:0,children:[]}}function Zd(){return{type:"break"}}function ef(){return{type:"html",value:""}}function n1(){return{type:"image",title:null,url:"",alt:null}}function tf(){return{type:"link",title:null,url:"",children:[]}}function nf(_){return{type:"list",ordered:_.type==="listOrdered",start:null,spread:_._spread,children:[]}}function r1(_){return{type:"listItem",spread:_._spread,checked:null,children:[]}}function i1(){return{type:"paragraph",children:[]}}function o1(){return{type:"strong",children:[]}}function s1(){return{type:"text",value:""}}function l1(){return{type:"thematicBreak"}}}function Pn(e){return{line:e.line,column:e.column,offset:e.offset}}function ny(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ny(e,r):lC(e,r)}}function lC(e,t){let n;for(n in t)if(ty.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Vp(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+wo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+wo({start:t.start,end:t.end})+") is still open")}function aC(e){const t=this;t.parser=n;function n(r){return oC(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function uC(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function cC(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
174
- `}]}function dC(e,t){const n=t.value?t.value+`
175
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function fC(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pC(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hC(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=qi(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,l+=1,e.footnoteCounts.set(r,l);const a={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,a);const c={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,c),e.applyData(t,c)}function mC(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gC(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ry(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function xC(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ry(e,t);const i={src:qi(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function yC(e,t){const n={src:qi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function vC(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function kC(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ry(e,t);const i={href:qi(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function bC(e,t){const n={href:qi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function wC(e,t,n){const r=e.all(t),i=n?SC(n):iy(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const f=r[l];(i||l!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
176
- `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const a=r[r.length-1];a&&(i||a.type!=="element"||a.tagName!=="p")&&s.push({type:"text",value:`
177
- `});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function SC(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=iy(n[r])}return t}function iy(e){const t=e.spread;return t??e.children.length>1}function CC(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function jC(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EC(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function NC(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PC(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Ed(t.children[1]),a=Mx(t.children[t.children.length-1]);l&&a&&(s.position={start:l,end:a}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function TC(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let a=-1;const c=[];for(;++a<l;){const d=t.children[a],p={},h=s?s[a]:void 0;h&&(p.align=h);let m={type:"element",tagName:o,properties:p,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,f),e.applyData(t,f)}function IC(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Wp=9,Kp=32;function _C(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Gp(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Gp(t.slice(i),i>0,!1)),o.join("")}function Gp(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Wp||o===Kp;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Wp||o===Kp;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function RC(e,t){const n={type:"text",value:_C(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function LC(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const AC={blockquote:uC,break:cC,code:dC,delete:fC,emphasis:pC,footnoteReference:hC,heading:mC,html:gC,imageReference:xC,image:yC,inlineCode:vC,linkReference:kC,link:bC,listItem:wC,list:CC,paragraph:jC,root:EC,strong:NC,table:PC,tableCell:IC,tableRow:TC,text:RC,thematicBreak:LC,toml:Is,yaml:Is,definition:Is,footnoteDefinition:Is};function Is(){}const oy=-1,Zl=0,Co=1,Cl=2,Ld=3,Ad=4,zd=5,Fd=6,sy=7,ly=8,zC=typeof self=="object"?self:globalThis,Yp=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new zC[e](t)},FC=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Zl:case oy:return n(s,i);case Co:{const l=n([],i);for(const a of s)l.push(r(a));return l}case Cl:{const l=n({},i);for(const[a,c]of s)l[r(a)]=r(c);return l}case Ld:return n(new Date(s),i);case Ad:{const{source:l,flags:a}=s;return n(new RegExp(l,a),i)}case zd:{const l=n(new Map,i);for(const[a,c]of s)l.set(r(a),r(c));return l}case Fd:{const l=n(new Set,i);for(const a of s)l.add(r(a));return l}case sy:{const{name:l,message:a}=s;return n(Yp(l,a),i)}case ly:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(Yp(o,s),i)};return r},Xp=e=>FC(new Map,e)(0),Kr="",{toString:MC}={},{keys:OC}=Object,io=e=>{const t=typeof e;if(t!=="object"||!e)return[Zl,t];const n=MC.call(e).slice(8,-1);switch(n){case"Array":return[Co,Kr];case"Object":return[Cl,Kr];case"Date":return[Ld,Kr];case"RegExp":return[Ad,Kr];case"Map":return[zd,Kr];case"Set":return[Fd,Kr];case"DataView":return[Co,n]}return n.includes("Array")?[Co,n]:n.includes("Error")?[sy,n]:[Cl,n]},_s=([e,t])=>e===Zl&&(t==="function"||t==="symbol"),DC=(e,t,n,r)=>{const i=(s,l)=>{const a=r.push(s)-1;return n.set(l,a),a},o=s=>{if(n.has(s))return n.get(s);let[l,a]=io(s);switch(l){case Zl:{let f=s;switch(a){case"bigint":l=ly,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);f=null;break;case"undefined":return i([oy],s)}return i([l,f],s)}case Co:{if(a){let p=s;return a==="DataView"?p=new Uint8Array(s.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(s)),i([a,[...p]],s)}const f=[],d=i([l,f],s);for(const p of s)f.push(o(p));return d}case Cl:{if(a)switch(a){case"BigInt":return i([a,s.toString()],s);case"Boolean":case"Number":case"String":return i([a,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],d=i([l,f],s);for(const p of OC(s))(e||!_s(io(s[p])))&&f.push([o(p),o(s[p])]);return d}case Ld:return i([l,s.toISOString()],s);case Ad:{const{source:f,flags:d}=s;return i([l,{source:f,flags:d}],s)}case zd:{const f=[],d=i([l,f],s);for(const[p,h]of s)(e||!(_s(io(p))||_s(io(h))))&&f.push([o(p),o(h)]);return d}case Fd:{const f=[],d=i([l,f],s);for(const p of s)(e||!_s(io(p)))&&f.push(o(p));return d}}const{message:c}=s;return i([l,{name:a,message:c}],s)};return o},Jp=(e,{json:t,lossy:n}={})=>{const r=[];return DC(!(t||n),!!t,new Map,r)(e),r},jl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Xp(Jp(e,t)):structuredClone(e):(e,t)=>Xp(Jp(e,t));function $C(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function BC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function UC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||$C,r=e.options.footnoteBackLabel||BC,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let a=-1;for(;++a<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[a]);if(!c)continue;const f=e.all(c),d=String(c.identifier).toUpperCase(),p=qi(d.toLowerCase());let h=0;const m=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++h<=v;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(a,h);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,h),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=f[f.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...m)}else f.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(c,g),l.push(g)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...jl(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
178
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
179
- `}]}}const ea=function(e){if(e==null)return VC;if(typeof e=="function")return ta(e);if(typeof e=="object")return Array.isArray(e)?HC(e):qC(e);if(typeof e=="string")return QC(e);throw new Error("Expected function, string, or object as test")};function HC(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ea(e[n]);return ta(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function qC(e){const t=e;return ta(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function QC(e){return ta(t);function t(n){return n&&n.type===e}}function ta(e){return t;function t(n,r,i){return!!(WC(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function VC(){return!0}function WC(e){return e!==null&&typeof e=="object"&&"type"in e}const ay=[],KC=!0,fc=!1,GC="skip";function uy(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=ea(i),s=r?-1:1;l(e,void 0,[])();function l(a,c,f){const d=a&&typeof a=="object"?a:{};if(typeof d.type=="string"){const h=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(a.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=ay,m,v,b;if((!t||o(a,c,f[f.length-1]||void 0))&&(h=YC(n(a,f)),h[0]===fc))return h;if("children"in a&&a.children){const g=a;if(g.children&&h[0]!==GC)for(v=(r?g.children.length:-1)+s,b=f.concat(g);v>-1&&v<g.children.length;){const x=g.children[v];if(m=l(x,v,b)(),m[0]===fc)return m;v=typeof m[1]=="number"?m[1]:v+s}}return h}}}function YC(e){return Array.isArray(e)?e:typeof e=="number"?[KC,e]:e==null?ay:[e]}function Md(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),uy(e,o,l,i);function l(a,c){const f=c[c.length-1],d=f?f.children.indexOf(a):void 0;return s(a,d,f)}}const pc={}.hasOwnProperty,XC={};function JC(e,t){const n=t||XC,r=new Map,i=new Map,o=new Map,s={...AC,...n.handlers},l={all:c,applyData:ej,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:a,options:n,patch:ZC,wrap:nj};return Md(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const d=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();d.has(p)||d.set(p,f)}}),l;function a(f,d){const p=f.type,h=l.handlers[p];if(pc.call(l.handlers,p)&&h)return h(l,f,d);if(l.options.passThrough&&l.options.passThrough.includes(p)){if("children"in f){const{children:v,...b}=f,g=jl(b);return g.children=l.all(f),g}return jl(f)}return(l.options.unknownHandler||tj)(l,f,d)}function c(f){const d=[];if("children"in f){const p=f.children;let h=-1;for(;++h<p.length;){const m=l.one(p[h],f);if(m){if(h&&p[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Zp(m.value)),!Array.isArray(m)&&m.type==="element")){const v=m.children[0];v&&v.type==="text"&&(v.value=Zp(v.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function ZC(e,t){e.position&&(t.position=$b(e))}function ej(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,jl(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function tj(e,t){const n=t.data||{},r="value"in t&&!(pc.call(n,"hProperties")||pc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function nj(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
180
- `});++r<e.length;)r&&n.push({type:"text",value:`
181
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
182
- `}),n}function Zp(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function eh(e,t){const n=JC(e,t),r=n.one(e,void 0),i=UC(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
183
- `},i),o}function rj(e,t){return e&&"run"in e?async function(n,r){const i=eh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return eh(n,{file:r,...e||t})}}function th(e){if(e)throw e}var Ks=Object.prototype.hasOwnProperty,cy=Object.prototype.toString,nh=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,ih=function(t){return typeof Array.isArray=="function"?Array.isArray(t):cy.call(t)==="[object Array]"},oh=function(t){if(!t||cy.call(t)!=="[object Object]")return!1;var n=Ks.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ks.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ks.call(t,i)},sh=function(t,n){nh&&n.name==="__proto__"?nh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},lh=function(t,n){if(n==="__proto__")if(Ks.call(t,n)){if(rh)return rh(t,n).value}else return;return t[n]},ij=function e(){var t,n,r,i,o,s,l=arguments[0],a=1,c=arguments.length,f=!1;for(typeof l=="boolean"&&(f=l,l=arguments[1]||{},a=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});a<c;++a)if(t=arguments[a],t!=null)for(n in t)r=lh(l,n),i=lh(t,n),l!==i&&(f&&i&&(oh(i)||(o=ih(i)))?(o?(o=!1,s=r&&ih(r)?r:[]):s=r&&oh(r)?r:{},sh(l,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&sh(l,{name:n,newValue:i}));return l};const La=wc(ij);function hc(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function oj(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...i);function l(a,...c){const f=e[++o];let d=-1;if(a){s(a);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,f?sj(f,l)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function sj(e,t){let n;return r;function r(...s){const l=e.length>s.length;let a;l&&s.push(i);try{a=e.apply(this,s)}catch(c){const f=c;if(l&&n)throw f;return i(f)}l||(a&&a.then&&typeof a.then=="function"?a.then(o,i):a instanceof Error?i(a):o(a))}function i(s,...l){n||(n=!0,t(s,...l))}function o(s){i(null,s)}}const Kt={basename:lj,dirname:aj,extname:uj,join:cj,sep:"/"};function lj(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ls(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function aj(e){if(ls(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function uj(e){ls(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),l===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function cj(...e){let t=-1,n;for(;++t<e.length;)ls(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":dj(n)}function dj(e){ls(e);const t=e.codePointAt(0)===47;let n=fj(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function fj(e,t){let n="",r=0,i=-1,o=0,s=-1,l,a;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else l===46&&o>-1?o++:o=-1}return n}function ls(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const pj={cwd:hj};function hj(){return"/"}function mc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function mj(e){if(typeof e=="string")e=new URL(e);else if(!mc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return gj(e)}function gj(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Aa=["history","path","basename","stem","extname","dirname"];class dy{constructor(t){let n;t?mc(t)?n={path:t}:typeof t=="string"||xj(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":pj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Aa.length;){const o=Aa[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Aa.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Kt.basename(this.path):void 0}set basename(t){Fa(t,"basename"),za(t,"basename"),this.path=Kt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Kt.dirname(this.path):void 0}set dirname(t){ah(this.basename,"dirname"),this.path=Kt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Kt.extname(this.path):void 0}set extname(t){if(za(t,"extname"),ah(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Kt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){mc(t)&&(t=mj(t)),Fa(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Kt.basename(this.path,this.extname):void 0}set stem(t){Fa(t,"stem"),za(t,"stem"),this.path=Kt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Ke(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function za(e,t){if(e&&e.includes(Kt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Kt.sep+"`")}function Fa(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ah(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function xj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yj=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},vj={}.hasOwnProperty;class Od extends yj{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=oj()}copy(){const t=new Od;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(La(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Da("data",this.frozen),this.namespace[t]=n,this):vj.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Da("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Rs(t),r=this.parser||this.Parser;return Ma("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ma("process",this.parser||this.Parser),Oa("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const l=Rs(t),a=r.parse(l);r.run(a,l,function(f,d,p){if(f||!d||!p)return c(f);const h=d,m=r.stringify(h,p);wj(m)?p.value=m:p.result=m,c(f,p)});function c(f,d){f||!d?s(f):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Ma("processSync",this.parser||this.Parser),Oa("processSync",this.compiler||this.Compiler),this.process(t,i),ch("processSync","process",n),r;function i(o,s){n=!0,th(o),r=s}}run(t,n,r){uh(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,l){const a=Rs(n);i.run(t,a,c);function c(f,d,p){const h=d||t;f?l(f):s?s(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),ch("runSync","run",r),i;function o(s,l){th(s),i=l,r=!0}}stringify(t,n){this.freeze();const r=Rs(n),i=this.compiler||this.Compiler;return Oa("stringify",i),uh(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Da("use",this.frozen),t!=null)if(typeof t=="function")a(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")a(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...d]=c;a(f,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))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");l(c.plugins),c.settings&&(i.settings=La(!0,i.settings,c.settings))}function l(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const d=c[f];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function a(c,f){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===c){p=d;break}if(p===-1)r.push([c,...f]);else if(f.length>0){let[h,...m]=f;const v=r[p][1];hc(v)&&hc(h)&&(h=La(!0,v,h)),r[p]=[c,h,...m]}}}}const kj=new Od().freeze();function Ma(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Oa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Da(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function uh(e){if(!hc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ch(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rs(e){return bj(e)?e:new dy(e)}function bj(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wj(e){return typeof e=="string"||Sj(e)}function Sj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Cj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",dh=[],fh={allowDangerousHtml:!0},jj=/^(https?|ircs?|mailto|xmpp)$/i,Ej=[{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 Nj(e){const t=Pj(e),n=Tj(e);return Ij(t.runSync(t.parse(n),n),e)}function Pj(e){const t=e.rehypePlugins||dh,n=e.remarkPlugins||dh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...fh}:fh;return kj().use(aC).use(n).use(rj,r).use(t)}function Tj(e){const t=e.children||"",n=new dy;return typeof t=="string"&&(n.value=t),n}function Ij(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,a=t.urlTransform||_j;for(const f of Ej)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Cj+f.id,void 0);return Md(e,c),Qb(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function c(f,d,p){if(f.type==="raw"&&p&&typeof d=="number")return s?p.children.splice(d,1):p.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let h;for(h in Ia)if(Object.hasOwn(Ia,h)&&Object.hasOwn(f.properties,h)){const m=f.properties[h],v=Ia[h];(v===null||v.includes(f.tagName))&&(f.properties[h]=a(String(m||""),h,f))}}if(f.type==="element"){let h=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!h&&r&&typeof d=="number"&&(h=!r(f,d,p)),h&&p&&typeof d=="number")return l&&f.children?p.children.splice(d,1,...f.children):p.children.splice(d,1),d}}}function _j(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||jj.test(e.slice(0,t))?e:""}function ph(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Rj(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Lj(e,t,n){const i=ea((n||{}).ignore||[]),o=Aj(t);let s=-1;for(;++s<o.length;)uy(e,"text",l);function l(c,f){let d=-1,p;for(;++d<f.length;){const h=f[d],m=p?p.children:void 0;if(i(h,m?m.indexOf(h):void 0,p))return;p=h}if(p)return a(c,f)}function a(c,f){const d=f[f.length-1],p=o[s][0],h=o[s][1];let m=0;const b=d.children.indexOf(c);let g=!1,x=[];p.lastIndex=0;let y=p.exec(c.value);for(;y;){const S=y.index,P={index:y.index,input:y.input,stack:[...f,c]};let E=h(...y,P);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=S+1:(m!==S&&x.push({type:"text",value:c.value.slice(m,S)}),Array.isArray(E)?x.push(...E):E&&x.push(E),m=S+y[0].length,g=!0),!p.global)break;y=p.exec(c.value)}return g?(m<c.value.length&&x.push({type:"text",value:c.value.slice(m)}),d.children.splice(b,1,...x)):x=[c],b+x.length}}function Aj(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([zj(i[0]),Fj(i[1])])}return t}function zj(e){return typeof e=="string"?new RegExp(Rj(e),"g"):e}function Fj(e){return typeof e=="function"?e:function(){return e}}const $a="phrasing",Ba=["autolink","link","image","label"];function Mj(){return{transforms:[qj],enter:{literalAutolink:Dj,literalAutolinkEmail:Ua,literalAutolinkHttp:Ua,literalAutolinkWww:Ua},exit:{literalAutolink:Hj,literalAutolinkEmail:Uj,literalAutolinkHttp:$j,literalAutolinkWww:Bj}}}function Oj(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$a,notInConstruct:Ba},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$a,notInConstruct:Ba},{character:":",before:"[ps]",after:"\\/",inConstruct:$a,notInConstruct:Ba}]}}function Dj(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ua(e){this.config.enter.autolinkProtocol.call(this,e)}function $j(e){this.config.exit.autolinkProtocol.call(this,e)}function Bj(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Uj(e){this.config.exit.autolinkEmail.call(this,e)}function Hj(e){this.exit(e)}function qj(e){Lj(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Qj],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Vj]],{ignore:["link","linkReference"]})}function Qj(e,t,n,r,i){let o="";if(!fy(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!Wj(n)))return!1;const s=Kj(n+r);if(!s[0])return!1;const l={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[l,{type:"text",value:s[1]}]:l}function Vj(e,t,n,r){return!fy(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Wj(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Kj(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ph(e,"(");let o=ph(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function fy(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Or(n)||Xl(n))&&(!t||n!==47)}py.peek=r2;function Gj(){this.buffer()}function Yj(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Xj(){this.buffer()}function Jj(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Zj(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function e2(e){this.exit(e)}function t2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ut(this.sliceSerialize(e)).toLowerCase(),n.label=t}function n2(e){this.exit(e)}function r2(){return"["}function py(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),l=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),l(),s(),o+=i.move("]"),o}function i2(){return{enter:{gfmFootnoteCallString:Gj,gfmFootnoteCall:Yj,gfmFootnoteDefinitionLabelString:Xj,gfmFootnoteDefinition:Jj},exit:{gfmFootnoteCallString:Zj,gfmFootnoteCall:e2,gfmFootnoteDefinitionLabelString:t2,gfmFootnoteDefinition:n2}}}function o2(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:py},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const l=o.createTracker(s);let a=l.move("[^");const c=o.enter("footnoteDefinition"),f=o.enter("label");return a+=l.move(o.safe(o.associationId(r),{before:a,after:"]"})),f(),a+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),a+=l.move((t?`
184
- `:" ")+o.indentLines(o.containerFlow(r,l.current()),t?hy:s2))),c(),a}}function s2(e,t,n){return t===0?e:hy(e,t,n)}function hy(e,t,n){return(n?"":" ")+e}const l2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];my.peek=f2;function a2(){return{canContainEols:["delete"],enter:{strikethrough:c2},exit:{strikethrough:d2}}}function u2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:l2}],handlers:{delete:my}}}function c2(e){this.enter({type:"delete",children:[]},e)}function d2(e){this.exit(e)}function my(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function f2(){return"~"}function p2(e){return e.length}function h2(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||p2,o=[],s=[],l=[],a=[];let c=0,f=-1;for(;++f<e.length;){const v=[],b=[];let g=-1;for(e[f].length>c&&(c=e[f].length);++g<e[f].length;){const x=m2(e[f][g]);if(n.alignDelimiters!==!1){const y=i(x);b[g]=y,(a[g]===void 0||y>a[g])&&(a[g]=y)}v.push(x)}s[f]=v,l[f]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=hh(r[d]);else{const v=hh(r);for(;++d<c;)o[d]=v}d=-1;const p=[],h=[];for(;++d<c;){const v=o[d];let b="",g="";v===99?(b=":",g=":"):v===108?b=":":v===114&&(g=":");let x=n.alignDelimiters===!1?1:Math.max(1,a[d]-b.length-g.length);const y=b+"-".repeat(x)+g;n.alignDelimiters!==!1&&(x=b.length+x+g.length,x>a[d]&&(a[d]=x),h[d]=x),p[d]=y}s.splice(1,0,p),l.splice(1,0,h),f=-1;const m=[];for(;++f<s.length;){const v=s[f],b=l[f];d=-1;const g=[];for(;++d<c;){const x=v[d]||"";let y="",S="";if(n.alignDelimiters!==!1){const P=a[d]-(b[d]||0),E=o[d];E===114?y=" ".repeat(P):E===99?P%2?(y=" ".repeat(P/2+.5),S=" ".repeat(P/2-.5)):(y=" ".repeat(P/2),S=y):S=" ".repeat(P)}n.delimiterStart!==!1&&!d&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&g.push(" "),n.alignDelimiters!==!1&&g.push(y),g.push(x),n.alignDelimiters!==!1&&g.push(S),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&g.push("|")}m.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return m.join(`
185
- `)}function m2(e){return e==null?"":String(e)}function hh(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function g2(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),x2);return i(),s}function x2(e,t,n){return">"+(n?"":" ")+e}function y2(e,t){return mh(e,t.inConstruct,!0)&&!mh(e,t.notInConstruct,!1)}function mh(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function gh(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
186
- `&&y2(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
187
- `}function v2(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function k2(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function b2(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function w2(e,t,n,r){const i=b2(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(k2(e,n)){const d=n.enter("codeIndented"),p=n.indentLines(o,S2);return d(),p}const l=n.createTracker(r),a=i.repeat(Math.max(v2(o,i)+1,3)),c=n.enter("codeFenced");let f=l.move(a);if(e.lang){const d=n.enter(`codeFencedLang${s}`);f+=l.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${s}`);f+=l.move(" "),f+=l.move(n.safe(e.meta,{before:f,after:`
188
- `,encode:["`"],...l.current()})),d()}return f+=l.move(`
189
- `),o&&(f+=l.move(o+`
190
- `)),f+=l.move(a),c(),f}function S2(e,t,n){return(n?"":" ")+e}function Dd(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function C2(e,t,n,r){const i=Dd(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let l=n.enter("label");const a=n.createTracker(r);let c=a.move("[");return c+=a.move(n.safe(n.associationId(e),{before:c,after:"]",...a.current()})),c+=a.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":`
191
- `,...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),s(),c}function j2(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Vo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function El(e,t,n){const r=Mi(e),i=Mi(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}gy.peek=E2;function gy(e,t,n,r){const i=j2(n),o=n.enter("emphasis"),s=n.createTracker(r),l=s.move(i);let a=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const c=a.charCodeAt(0),f=El(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(a=Vo(c)+a.slice(1));const d=a.charCodeAt(a.length-1),p=El(r.after.charCodeAt(0),d,i);p.inside&&(a=a.slice(0,-1)+Vo(d));const h=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},l+a+h}function E2(e,t,n){return n.options.emphasis||"*"}function N2(e,t){let n=!1;return Md(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,fc}),!!((!e.depth||e.depth<3)&&Id(e)&&(t.options.setext||n))}function P2(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(N2(e,n)){const f=n.enter("headingSetext"),d=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:`
192
- `,after:`
193
- `});return d(),f(),p+`
194
- `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
195
- `))+1))}const s="#".repeat(i),l=n.enter("headingAtx"),a=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
196
- `,...o.current()});return/^[\t ]/.test(c)&&(c=Vo(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),a(),l(),c}xy.peek=T2;function xy(e){return e.value||""}function T2(){return"<"}yy.peek=I2;function yy(e,t,n,r){const i=Dd(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let l=n.enter("label");const a=n.createTracker(r);let c=a.move("![");return c+=a.move(n.safe(e.alt,{before:c,after:"]",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function I2(){return"!"}vy.peek=_2;function vy(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const l=n.createTracker(r);let a=l.move("![");const c=n.safe(e.alt,{before:a,after:"]",...l.current()});a+=l.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:a,after:"]",...l.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==d?a+=l.move(d+"]"):i==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function _2(){return"!"}ky.peek=R2;function ky(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],l=n.compilePattern(s);let a;if(s.atBreak)for(;a=l.exec(r);){let c=a.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(a.index+1)}}return i+r+i}function R2(){return"`"}function by(e,t){const n=Id(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}wy.peek=L2;function wy(e,t,n,r){const i=Dd(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let l,a;if(by(e,n)){const f=n.stack;n.stack=[],l=n.enter("autolink");let d=s.move("<");return d+=s.move(n.containerPhrasing(e,{before:d,after:">",...s.current()})),d+=s.move(">"),l(),n.stack=f,d}l=n.enter("link"),a=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(a=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),a()),c+=s.move(")"),l(),c}function L2(e,t,n){return by(e,n)?"<":"["}Sy.peek=A2;function Sy(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const l=n.createTracker(r);let a=l.move("[");const c=n.containerPhrasing(e,{before:a,after:"]",...l.current()});a+=l.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:a,after:"]",...l.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==d?a+=l.move(d+"]"):i==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function A2(){return"["}function $d(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function z2(e){const t=$d(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function F2(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Cy(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function M2(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?F2(n):$d(n);const l=e.ordered?s==="."?")":".":z2(n);let a=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(a=!0),Cy(n)===s&&f){let d=-1;for(;++d<e.children.length;){const p=e.children[d];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){a=!0;break}}}}a&&(s=l),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function O2(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function D2(e,t,n,r){const i=O2(n);let o=n.bulletCurrent||$d(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const l=n.createTracker(r);l.move(o+" ".repeat(s-o.length)),l.shift(s);const a=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,l.current()),f);return a(),c;function f(d,p,h){return p?(h?"":" ".repeat(s))+d:(h?o:o+" ".repeat(s-o.length))+d}}function $2(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const B2=ea(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function U2(e,t,n,r){return(e.children.some(function(s){return B2(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function H2(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}jy.peek=q2;function jy(e,t,n,r){const i=H2(n),o=n.enter("strong"),s=n.createTracker(r),l=s.move(i+i);let a=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const c=a.charCodeAt(0),f=El(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(a=Vo(c)+a.slice(1));const d=a.charCodeAt(a.length-1),p=El(r.after.charCodeAt(0),d,i);p.inside&&(a=a.slice(0,-1)+Vo(d));const h=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},l+a+h}function q2(e,t,n){return n.options.strong||"*"}function Q2(e,t,n,r){return n.safe(e.value,r)}function V2(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function W2(e,t,n){const r=(Cy(n)+(n.options.ruleSpaces?" ":"")).repeat(V2(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ey={blockquote:g2,break:gh,code:w2,definition:C2,emphasis:gy,hardBreak:gh,heading:P2,html:xy,image:yy,imageReference:vy,inlineCode:ky,link:wy,linkReference:Sy,list:M2,listItem:D2,paragraph:$2,root:U2,strong:jy,text:Q2,thematicBreak:W2};function K2(){return{enter:{table:G2,tableData:xh,tableHeader:xh,tableRow:X2},exit:{codeText:J2,table:Y2,tableData:Ha,tableHeader:Ha,tableRow:Ha}}}function G2(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Y2(e){this.exit(e),this.data.inTable=void 0}function X2(e){this.enter({type:"tableRow",children:[]},e)}function Ha(e){this.exit(e)}function xh(e){this.enter({type:"tableCell",children:[]},e)}function J2(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Z2));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Z2(e,t){return t==="|"?t:e}function eE(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
197
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:a,tableRow:l}};function s(h,m,v,b){return c(f(h,v,b),h.align)}function l(h,m,v,b){const g=d(h,v,b),x=c([g]);return x.slice(0,x.indexOf(`
198
- `))}function a(h,m,v,b){const g=v.enter("tableCell"),x=v.enter("phrasing"),y=v.containerPhrasing(h,{...b,before:o,after:o});return x(),g(),y}function c(h,m){return h2(h,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(h,m,v){const b=h.children;let g=-1;const x=[],y=m.enter("table");for(;++g<b.length;)x[g]=d(b[g],m,v);return y(),x}function d(h,m,v){const b=h.children;let g=-1;const x=[],y=m.enter("tableRow");for(;++g<b.length;)x[g]=a(b[g],h,m,v);return y(),x}function p(h,m,v){let b=Ey.inlineCode(h,m,v);return v.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function tE(){return{exit:{taskListCheckValueChecked:yh,taskListCheckValueUnchecked:yh,paragraph:rE}}}function nE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:iE}}}function yh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function rE(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const l=i[o];if(l.type==="paragraph"){s=l;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function iE(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);o&&l.move(s);let a=Ey.listItem(e,t,n,{...r,...l.current()});return o&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),a;function c(f){return f+s}}function oE(){return[Mj(),i2(),a2(),K2(),tE()]}function sE(e){return{extensions:[Oj(),o2(e),u2(),eE(e),nE()]}}const lE={tokenize:pE,partial:!0},Ny={tokenize:hE,partial:!0},Py={tokenize:mE,partial:!0},Ty={tokenize:gE,partial:!0},aE={tokenize:xE,partial:!0},Iy={name:"wwwAutolink",tokenize:dE,previous:Ry},_y={name:"protocolAutolink",tokenize:fE,previous:Ly},jn={name:"emailAutolink",tokenize:cE,previous:Ay},on={};function uE(){return{text:on}}let fr=48;for(;fr<123;)on[fr]=jn,fr++,fr===58?fr=65:fr===91&&(fr=97);on[43]=jn;on[45]=jn;on[46]=jn;on[95]=jn;on[72]=[jn,_y];on[104]=[jn,_y];on[87]=[jn,Iy];on[119]=[jn,Iy];function cE(e,t,n){const r=this;let i,o;return s;function s(d){return!gc(d)||!Ay.call(r,r.previous)||Bd(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return gc(d)?(e.consume(d),l):d===64?(e.consume(d),a):n(d)}function a(d){return d===46?e.check(aE,f,c)(d):d===45||d===95||Ve(d)?(o=!0,e.consume(d),a):f(d)}function c(d){return e.consume(d),i=!0,a}function f(d){return o&&i&&Ze(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function dE(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Ry.call(r,r.previous)||Bd(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(lE,e.attempt(Ny,e.attempt(Py,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function fE(e,t,n){const r=this;let i="",o=!1;return s;function s(d){return(d===72||d===104)&&Ly.call(r,r.previous)&&!Bd(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),l):n(d)}function l(d){if(Ze(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),l;if(d===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(d),a}return n(d)}function a(d){return d===47?(e.consume(d),o?c:(o=!0,a)):n(d)}function c(d){return d===null||Sl(d)||fe(d)||Or(d)||Xl(d)?n(d):e.attempt(Ny,e.attempt(Py,f),n)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function pE(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function hE(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(Ty,a,l)(c):c===null||fe(c)||Or(c)||c!==45&&Xl(c)?a(c):(o=!0,e.consume(c),s)}function l(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function a(c){return i||r||!o?n(c):t(c)}}function mE(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Ty,t,o)(s):s===null||fe(s)||Or(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function gE(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),o):l===93?(e.consume(l),i):l===60||l===null||fe(l)||Or(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||fe(l)||Or(l)?t(l):r(l)}function o(l){return Ze(l)?s(l):n(l)}function s(l){return l===59?(e.consume(l),r):Ze(l)?(e.consume(l),s):n(l)}}function xE(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Ve(o)?n(o):t(o)}}function Ry(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||fe(e)}function Ly(e){return!Ze(e)}function Ay(e){return!(e===47||gc(e))}function gc(e){return e===43||e===45||e===46||e===95||Ve(e)}function Bd(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const yE={tokenize:EE,partial:!0};function vE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:SE,continuation:{tokenize:CE},exit:jE}},text:{91:{name:"gfmFootnoteCall",tokenize:wE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:kE,resolveTo:bE}}}}function kE(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const a=r.events[i][1];if(a.type==="labelImage"){s=a;break}if(a.type==="gfmFootnoteCall"||a.type==="labelLink"||a.type==="label"||a.type==="image"||a.type==="link")break}return l;function l(a){if(!s||!s._balanced)return n(a);const c=Ut(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(a):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a))}}function bE(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function wE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),a}function a(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(o>999||d===93&&!s||d===null||d===91||fe(d))return n(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(Ut(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return fe(d)||(s=!0),o++,e.consume(d),d===92?f:c}function f(d){return d===91||d===92||d===93?(e.consume(d),o++,c):c(d)}}function SE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,l;return a;function a(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(s>999||m===93&&!l||m===null||m===91||fe(m))return n(m);if(m===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return o=Ut(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return fe(m)||(l=!0),s++,e.consume(m),m===92?d:f}function d(m){return m===91||m===92||m===93?(e.consume(m),s++,f):f(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),ie(e,h,"gfmFootnoteDefinitionWhitespace")):n(m)}function h(m){return t(m)}}function CE(e,t,n){return e.check(ss,t,e.attempt(yE,t,n))}function jE(e){e.exit("gfmFootnoteDefinition")}function EE(e,t,n){const r=this;return ie(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function NE(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,l){let a=-1;for(;++a<s.length;)if(s[a][0]==="enter"&&s[a][1].type==="strikethroughSequenceTemporary"&&s[a][1]._close){let c=a;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[a][1].end.offset-s[a][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[a][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[a][1].end)},d={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[a][1].start)},p=[["enter",f,l],["enter",s[c][1],l],["exit",s[c][1],l],["enter",d,l]],h=l.parser.constructs.insideSpan.null;h&&wt(p,p.length,0,Jl(h,s.slice(c+1,a),l)),wt(p,p.length,0,[["exit",d,l],["enter",s[a][1],l],["exit",s[a][1],l],["exit",f,l]]),wt(s,c-1,a-c+3,p),a=c+p.length-2;break}}for(a=-1;++a<s.length;)s[a][1].type==="strikethroughSequenceTemporary"&&(s[a][1].type="data");return s}function o(s,l,a){const c=this.previous,f=this.events;let d=0;return p;function p(m){return c===126&&f[f.length-1][1].type!=="characterEscape"?a(m):(s.enter("strikethroughSequenceTemporary"),h(m))}function h(m){const v=Mi(c);if(m===126)return d>1?a(m):(s.consume(m),d++,h);if(d<2&&!n)return a(m);const b=s.exit("strikethroughSequenceTemporary"),g=Mi(m);return b._open=!g||g===2&&!!v,b._close=!v||v===2&&!!g,l(m)}}}class PE{constructor(){this.map=[]}add(t,n,r){TE(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function TE(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function IE(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function _E(){return{flow:{null:{name:"table",tokenize:RE,resolveAll:LE}}}}function RE(e,t,n){const r=this;let i=0,o=0,s;return l;function l(j){let A=r.events.length-1;for(;A>-1;){const U=r.events[A][1].type;if(U==="lineEnding"||U==="linePrefix")A--;else break}const R=A>-1?r.events[A][1].type:null,$=R==="tableHead"||R==="tableRow"?E:a;return $===E&&r.parser.lazy[r.now().line]?n(j):$(j)}function a(j){return e.enter("tableHead"),e.enter("tableRow"),c(j)}function c(j){return j===124||(s=!0,o+=1),f(j)}function f(j){return j===null?n(j):W(j)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),h):n(j):Z(j)?ie(e,f,"whitespace")(j):(o+=1,s&&(s=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),d(j)))}function d(j){return j===null||j===124||fe(j)?(e.exit("data"),f(j)):(e.consume(j),j===92?p:d)}function p(j){return j===92||j===124?(e.consume(j),d):d(j)}function h(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),s=!1,Z(j)?ie(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):m(j))}function m(j){return j===45||j===58?b(j):j===124?(s=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),v):P(j)}function v(j){return Z(j)?ie(e,b,"whitespace")(j):b(j)}function b(j){return j===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),g):j===45?(o+=1,g(j)):j===null||W(j)?S(j):P(j)}function g(j){return j===45?(e.enter("tableDelimiterFiller"),x(j)):P(j)}function x(j){return j===45?(e.consume(j),x):j===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(j))}function y(j){return Z(j)?ie(e,S,"whitespace")(j):S(j)}function S(j){return j===124?m(j):j===null||W(j)?!s||i!==o?P(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):P(j)}function P(j){return n(j)}function E(j){return e.enter("tableRow"),I(j)}function I(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),I):j===null||W(j)?(e.exit("tableRow"),t(j)):Z(j)?ie(e,I,"whitespace")(j):(e.enter("data"),T(j))}function T(j){return j===null||j===124||fe(j)?(e.exit("data"),I(j)):(e.consume(j),j===92?L:T)}function L(j){return j===92||j===124?(e.consume(j),T):T(j)}}function LE(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],l=!1,a=0,c,f,d;const p=new PE;for(;++n<e.length;){const h=e[n],m=h[1];h[0]==="enter"?m.type==="tableHead"?(l=!1,a!==0&&(vh(p,t,a,c,f),f=void 0,a=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],s=[0,n+1,0,0],l&&(l=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],d=Ls(p,t,o,i,void 0,d),o=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],d=Ls(p,t,o,i,void 0,d)),o=s,s=[o[1],n,0,0])):m.type==="tableHead"?(l=!0,a=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(a=n,o[1]!==0?(s[0]=s[1],d=Ls(p,t,o,i,n,d)):s[1]!==0&&(d=Ls(p,t,s,i,n,d)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(a!==0&&vh(p,t,a,c,f),p.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=IE(t.events,n))}return e}function Ls(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(o.end=Object.assign({},Yr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const a=Yr(t.events,n[1]);if(o={type:s,start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=Yr(t.events,n[2]),f=Yr(t.events,n[3]),d={type:l,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const p=t.events[n[2]],h=t.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,v=n[3]-n[2]-1;e.add(m,v,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},Yr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function vh(e,t,n,r,i){const o=[],s=Yr(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Yr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const AE={name:"tasklistCheck",tokenize:FE};function zE(){return{text:{91:AE}}}function FE(e,t,n){const r=this;return i;function i(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),o)}function o(a){return fe(a)?(e.enter("taskListCheckValueUnchecked"),e.consume(a),e.exit("taskListCheckValueUnchecked"),s):a===88||a===120?(e.enter("taskListCheckValueChecked"),e.consume(a),e.exit("taskListCheckValueChecked"),s):n(a)}function s(a){return a===93?(e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(a)}function l(a){return W(a)?t(a):Z(a)?e.check({tokenize:ME},t,n)(a):n(a)}}function ME(e,t,n){return ie(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function OE(e){return qx([uE(),vE(),NE(e),_E(),zE()])}const DE={};function $E(e){const t=this,n=e||DE,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(OE(n)),o.push(oE()),s.push(sE(n))}const kh=e=>{let t;const n=new Set,r=(c,f)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const p=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(h=>h(t,p))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>a,subscribe:c=>(n.add(c),()=>n.delete(c))},a=t=e(r,i,l);return l},BE=e=>e?kh(e):kh,UE=e=>e;function HE(e,t=UE){const n=fs.useSyncExternalStore(e.subscribe,fs.useCallback(()=>t(e.getState()),[e,t]),fs.useCallback(()=>t(e.getInitialState()),[e,t]));return fs.useDebugValue(n),n}const bh=e=>{const t=BE(e),n=r=>HE(t,r);return Object.assign(n,t),n},zy=e=>e?bh(e):bh,Dr=zy(e=>({toasts:[],errSeen:0,warnSeen:0,pushToast:t=>e(n=>({toasts:[...n.toasts,t],errSeen:n.errSeen+(t.notifyType==="error"?1:0),warnSeen:n.warnSeen+(t.notifyType==="warning"?1:0)})),dismissToast:t=>e(n=>({toasts:n.toasts.filter(r=>r.id!==t)})),resetCounters:()=>e({errSeen:0,warnSeen:0})}));function Fy(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Fy(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function qE(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Fy(e))&&(r&&(r+=" "),r+=t);return r}const Ud="-",QE=e=>{const t=WE(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const l=s.split(Ud);return l[0]===""&&l.length!==1&&l.shift(),My(l,t)||VE(s)},getConflictingClassGroupIds:(s,l)=>{const a=n[s]||[];return l&&r[s]?[...a,...r[s]]:a}}},My=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?My(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Ud);return(s=t.validators.find(({validator:l})=>l(o)))==null?void 0:s.classGroupId},wh=/^\[(.+)\]$/,VE=e=>{if(wh.test(e)){const t=wh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},WE=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return GE(Object.entries(e.classGroups),n).forEach(([o,s])=>{xc(s,r,o,t)}),r},xc=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Sh(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(KE(i)){xc(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{xc(s,Sh(t,o),n,r)})})},Sh=(e,t)=>{let n=e;return t.split(Ud).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},KE=e=>e.isThemeGetter,GE=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,l])=>[t+s,l])):o);return[n,i]}):e,YE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},Oy="!",XE=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,s=l=>{const a=[];let c=0,f=0,d;for(let b=0;b<l.length;b++){let g=l[b];if(c===0){if(g===i&&(r||l.slice(b,b+o)===t)){a.push(l.slice(f,b)),f=b+o;continue}if(g==="/"){d=b;continue}}g==="["?c++:g==="]"&&c--}const p=a.length===0?l:l.substring(f),h=p.startsWith(Oy),m=h?p.substring(1):p,v=d&&d>f?d-f:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:s}):s},JE=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},ZE=e=>({cache:YE(e.cacheSize),parseClassName:XE(e),...QE(e)}),eN=/\s+/,tN=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(eN);let l="";for(let a=s.length-1;a>=0;a-=1){const c=s[a],{modifiers:f,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(c);let m=!!h,v=r(m?p.substring(0,h):p);if(!v){if(!m){l=c+(l.length>0?" "+l:l);continue}if(v=r(p),!v){l=c+(l.length>0?" "+l:l);continue}m=!1}const b=JE(f).join(":"),g=d?b+Oy:b,x=g+v;if(o.includes(x))continue;o.push(x);const y=i(v,m);for(let S=0;S<y.length;++S){const P=y[S];o.push(g+P)}l=c+(l.length>0?" "+l:l)}return l};function nN(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Dy(t))&&(r&&(r+=" "),r+=n);return r}const Dy=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Dy(e[r]))&&(n&&(n+=" "),n+=t);return n};function rN(e,...t){let n,r,i,o=s;function s(a){const c=t.reduce((f,d)=>d(f),e());return n=ZE(c),r=n.cache.get,i=n.cache.set,o=l,l(a)}function l(a){const c=r(a);if(c)return c;const f=tN(a,n);return i(a,f),f}return function(){return o(nN.apply(null,arguments))}}const ge=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},$y=/^\[(?:([a-z-]+):)?(.+)\]$/i,iN=/^\d+\/\d+$/,oN=new Set(["px","full","screen"]),sN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lN=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,aN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,an=e=>gi(e)||oN.has(e)||iN.test(e),Tn=e=>Qi(e,"length",yN),gi=e=>!!e&&!Number.isNaN(Number(e)),qa=e=>Qi(e,"number",gi),oo=e=>!!e&&Number.isInteger(Number(e)),dN=e=>e.endsWith("%")&&gi(e.slice(0,-1)),X=e=>$y.test(e),In=e=>sN.test(e),fN=new Set(["length","size","percentage"]),pN=e=>Qi(e,fN,By),hN=e=>Qi(e,"position",By),mN=new Set(["image","url"]),gN=e=>Qi(e,mN,kN),xN=e=>Qi(e,"",vN),so=()=>!0,Qi=(e,t,n)=>{const r=$y.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},yN=e=>lN.test(e)&&!aN.test(e),By=()=>!1,vN=e=>uN.test(e),kN=e=>cN.test(e),bN=()=>{const e=ge("colors"),t=ge("spacing"),n=ge("blur"),r=ge("brightness"),i=ge("borderColor"),o=ge("borderRadius"),s=ge("borderSpacing"),l=ge("borderWidth"),a=ge("contrast"),c=ge("grayscale"),f=ge("hueRotate"),d=ge("invert"),p=ge("gap"),h=ge("gradientColorStops"),m=ge("gradientColorStopPositions"),v=ge("inset"),b=ge("margin"),g=ge("opacity"),x=ge("padding"),y=ge("saturate"),S=ge("scale"),P=ge("sepia"),E=ge("skew"),I=ge("space"),T=ge("translate"),L=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",X,t],R=()=>[X,t],$=()=>["",an,Tn],U=()=>["auto",gi,X],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",X],k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[gi,X];return{cacheSize:500,separator:":",theme:{colors:[so],spacing:[an,Tn],blur:["none","",In,X],brightness:K(),borderColor:[e],borderRadius:["none","","full",In,X],borderSpacing:R(),borderWidth:$(),contrast:K(),grayscale:H(),hueRotate:K(),invert:H(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[dN,Tn],inset:A(),margin:A(),opacity:K(),padding:R(),saturate:K(),scale:K(),sepia:H(),skew:K(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",X]}],container:["container"],columns:[{columns:[In]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...q(),X]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",oo,X]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",X]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",oo,X]}],"grid-cols":[{"grid-cols":[so]}],"col-start-end":[{col:["auto",{span:["full",oo,X]},X]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[so]}],"row-start-end":[{row:["auto",{span:[oo,X]},X]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",X]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",X]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",X,t]}],"min-w":[{"min-w":[X,t,"min","max","fit"]}],"max-w":[{"max-w":[X,t,"none","full","min","max","fit","prose",{screen:[In]},In]}],h:[{h:[X,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[X,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[X,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[X,t,"auto","min","max","fit"]}],"font-size":[{text:["base",In,Tn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qa]}],"font-family":[{font:[so]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",X]}],"line-clamp":[{"line-clamp":["none",gi,qa]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",an,X]}],"list-image":[{"list-image":["none",X]}],"list-style-type":[{list:["none","disc","decimal",X]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",an,Tn]}],"underline-offset":[{"underline-offset":["auto",an,X]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",X]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",X]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),hN]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pN]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gN]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...le(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:le()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[an,X]}],"outline-w":[{outline:[an,Tn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[an,Tn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",In,xN]}],"shadow-color":[{shadow:[so]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...oe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",In,X]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",X]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",X]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",X]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[oo,X]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",X]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",X]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",X]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[an,Tn,qa]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},wN=rN(bN);function V(...e){return wN(qE(e))}function Uy({text:e,streaming:t,className:n}){return u.jsxs("div",{className:V("font-sans text-[14px] leading-[1.65] tracking-[-0.005em] text-foreground","[&>p:last-child]:inline","[overflow-wrap:anywhere]",n),children:[u.jsx(Nj,{remarkPlugins:[$E],components:SN,children:e}),t&&u.jsx("span",{className:"ml-1 inline-block h-[14px] w-[7px] translate-y-[2px] rounded-[1px] bg-brand align-baseline",style:{animation:"v2-blink 1s steps(2) infinite"},"aria-hidden":!0})]})}const SN={h1:({children:e})=>u.jsx("h1",{className:"mb-2 mt-5 text-[18px] font-medium tracking-[-0.015em] text-foreground first:mt-0",children:e}),h2:({children:e})=>u.jsx("h2",{className:"mb-2 mt-4 text-[16px] font-medium tracking-[-0.01em] text-foreground first:mt-0",children:e}),h3:({children:e})=>u.jsx("h3",{className:"mb-1.5 mt-3 text-[14.5px] font-medium tracking-[-0.005em] text-foreground first:mt-0",children:e}),h4:({children:e})=>u.jsx("h4",{className:"mb-1.5 mt-3 text-[13.5px] font-medium text-foreground first:mt-0",children:e}),h5:({children:e})=>u.jsx("h5",{className:"mb-1 mt-3 text-[13px] font-medium text-foreground first:mt-0",children:e}),h6:({children:e})=>u.jsx("h6",{className:"mb-1 mt-3 text-[12.5px] font-medium uppercase tracking-[0.04em] text-muted-foreground first:mt-0",children:e}),strong:({children:e})=>u.jsx("strong",{className:"font-medium text-foreground",children:e}),em:({children:e})=>u.jsx("em",{className:"italic text-foreground",children:e}),p:({children:e})=>u.jsx("p",{className:"my-2 first:mt-0 last:mb-0",children:e}),a:({href:e,children:t})=>u.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-brand underline underline-offset-2 transition-colors hover:text-brand-strong",children:t}),hr:()=>u.jsx("hr",{className:"my-3 border-t border-border-soft"}),ul:({children:e})=>u.jsx("ul",{className:"my-2 flex list-none flex-col gap-[3px] pl-5",children:e}),ol:({children:e,start:t})=>u.jsx("ol",{className:"my-2 flex list-decimal flex-col gap-[3px] pl-6 marker:font-mono marker:text-[12px] marker:text-muted-foreground",start:t??void 0,children:e}),li:({children:e,...t})=>{const n=typeof t.className=="string"&&t.className.includes("task-list-item");return u.jsx("li",{className:V("relative",!n&&"pl-3 before:absolute before:left-0 before:top-0 before:text-muted-foreground before:content-['·']"),children:e})},blockquote:({children:e})=>u.jsx("blockquote",{className:"my-2 border-l-2 border-brand/[0.30] pl-3 text-muted-foreground",children:e}),table:({children:e})=>u.jsx("div",{className:"my-3 overflow-x-auto rounded-md border border-border-soft",children:u.jsx("table",{className:"w-full border-collapse text-[12.5px]",children:e})}),thead:({children:e})=>u.jsx("thead",{className:"border-b border-border-soft bg-muted",children:e}),tbody:({children:e})=>u.jsx("tbody",{children:e}),tr:({children:e})=>u.jsx("tr",{className:"border-b border-border-soft/60 last:border-b-0",children:e}),th:({children:e,style:t})=>u.jsx("th",{style:t,className:"px-2.5 py-1.5 text-left text-[11.5px] font-medium text-muted-foreground",children:e}),td:({children:e,style:t})=>u.jsx("td",{style:t,className:"px-2.5 py-1.5 align-top text-foreground",children:e}),img:({src:e,alt:t})=>u.jsx("img",{src:e,alt:t,className:"my-2 max-w-full rounded-md border border-border-soft"}),pre:({children:e})=>u.jsx(CN,{children:e}),code:({className:e,children:t,...n})=>typeof e=="string"&&/\blanguage-/.test(e)?u.jsx("code",{className:e,...n,children:t}):u.jsx("code",{className:"rounded-[5px] border border-border-soft bg-muted px-1.5 py-px font-mono text-[12px] text-foreground",...n,children:t})};function CN({children:e}){const t=N.useRef(null),n=Dr(s=>s.pushToast),[r,i]=N.useState(!1),o=async()=>{var l;const s=((l=t.current)==null?void 0:l.textContent)??"";if(s)try{await navigator.clipboard.writeText(s),i(!0),setTimeout(()=>i(!1),1200)}catch{n({id:`copy-${Date.now()}`,workspaceId:"",message:"Copy failed — clipboard not available",notifyType:"warning"})}};return u.jsxs("div",{className:"group/code relative my-3 overflow-hidden rounded-md border border-border-soft bg-muted",children:[u.jsx("pre",{ref:t,className:"overflow-x-auto px-3 py-2.5 font-mono text-[12px] leading-relaxed text-foreground",children:e}),u.jsx("button",{type:"button",onClick:o,title:"Copy code","aria-label":"Copy code",className:"absolute right-1.5 top-1.5 rounded-md border border-border-soft bg-card p-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover/code:opacity-100 focus-visible:opacity-100",children:r?u.jsx(Vl,{className:"h-3 w-3 text-signal-ok"}):u.jsx(Ex,{className:"h-3 w-3"})})]})}function Hy(e){return["workspace-sessions",e]}function jN(e){return nn({queryKey:Hy(e),enabled:!!e,staleTime:1e4,queryFn:()=>{if(!e)throw new Error("workspaceId required");return ce(`/api/workspaces/${encodeURIComponent(e)}/sessions`).then(t=>t.sessions)}})}function EN(e){const t=Pe();return Oe({mutationFn:n=>{if(!e)throw new Error("workspaceId required");const r=`?path=${encodeURIComponent(n)}`;return ce(`/api/workspaces/${encodeURIComponent(e)}/sessions${r}`,{method:"DELETE"})},onSuccess:()=>t.invalidateQueries({queryKey:Hy(e)})})}function NN(e,t,n){return nn({queryKey:["fork-points",e,t??"__none__"],enabled:!!e&&!!t&&n,staleTime:0,queryFn:()=>{if(!e)throw new Error("workspaceId required");return ce(`/api/workspaces/${encodeURIComponent(e)}/fork-points`).then(r=>r.points)}})}function PN({workspaceId:e,sessionPath:t,disabled:n=!1,onSelect:r,onNewSession:i,onFork:o}){const{data:s,isFetching:l,refetch:a}=jN(e),c=EN(e),[f,d]=N.useState(!1),[p,h]=N.useState("sessions"),{data:m}=NN(e,t,p==="fork"&&f),v=N.useRef(null),b=N.useRef(null),g=N.useRef(null),x=N.useRef(null),y=N.useRef(!1);N.useEffect(()=>{f||h("sessions")},[f]),N.useEffect(()=>{h("sessions")},[t]),N.useEffect(()=>{!e||t===void 0||a()},[e,t,a]),N.useEffect(()=>{if(!f)return;const T=j=>{v.current&&!v.current.contains(j.target)&&d(!1)},L=j=>{var A,R;if(j.key==="Escape"){j.preventDefault(),y.current=!0,p==="fork"?h("sessions"):d(!1);return}if(j.key==="Tab"){(A=b.current)==null||A.focus(),d(!1);return}if(p==="sessions"&&(j.key==="ArrowDown"||j.key==="ArrowUp"||j.key==="Home"||j.key==="End")){const $=g.current;if(!$)return;const U=Array.from($.querySelectorAll('[role="option"]'));if(U.length===0)return;j.preventDefault();const q=U.indexOf(document.activeElement),le=j.key==="ArrowDown"?q<0?0:Math.min(q+1,U.length-1):j.key==="ArrowUp"?q<0?U.length-1:Math.max(q-1,0):j.key==="Home"?0:U.length-1;(R=U[le])==null||R.focus()}};return document.addEventListener("mousedown",T),document.addEventListener("keydown",L),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",L)}},[f,p]),N.useLayoutEffect(()=>{var T,L;if(f&&p==="sessions"){const j=x.current??((T=g.current)==null?void 0:T.querySelector('[role="option"]'));j==null||j.scrollIntoView({block:"nearest"}),j==null||j.focus({preventScroll:!0})}else!f&&y.current&&(y.current=!1,(L=b.current)==null||L.focus())},[f,p]);const S=n||!e,P=c.isPending?c.variables??null:null,E=T=>{if(c.isPending||T===t)return;const L=s==null?void 0:s.find(R=>R.path===T),j=L?Va(L):qy(T);window.confirm(`Delete session "${j}"? This cannot be undone.`)&&c.mutate(T,{onError:R=>{window.alert(`Failed to delete session: ${R.message}`)}})},I=s==null?void 0:s.find(T=>T.path===t);return u.jsxs("div",{ref:v,className:"relative",children:[u.jsxs("button",{ref:b,type:"button",onClick:()=>d(T=>!T),disabled:S,"aria-label":"Session","aria-haspopup":"menu","aria-expanded":f,title:t===void 0?"Session — connecting":t===null?"Session — new":t,className:V("flex items-center gap-1.5 rounded-md px-2 py-1 text-[12.5px] text-muted-foreground transition-colors ring-brand-focus","border border-transparent bg-transparent","hover:bg-muted hover:text-foreground","disabled:cursor-not-allowed disabled:opacity-50",f&&"bg-muted text-foreground"),children:[u.jsx("span",{children:"Session"}),I&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-foreground/40",children:"·"}),u.jsx("span",{className:"font-mono tabular-nums text-foreground",children:TN(I.updatedAt)})]}),t===void 0&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-foreground/40",children:"·"}),u.jsx("span",{className:"text-foreground/60",children:"Connecting…"})]}),t===null&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-foreground/40",children:"·"}),u.jsx("span",{className:"text-foreground/60",children:"New"})]}),typeof t=="string"&&!I&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-foreground/40",children:"·"}),u.jsx("span",{className:"text-foreground/60",children:"…"})]}),u.jsx(Ur,{className:V("h-3 w-3 shrink-0 opacity-50 transition-transform",f&&"rotate-180")})]}),f&&u.jsx("div",{ref:g,role:"menu","aria-label":"Session menu",className:"absolute left-0 top-full z-50 mt-1.5 w-80 overflow-hidden rounded-md border border-border bg-card shadow-menu",children:p==="sessions"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"py-1",children:[u.jsx(Qa,{icon:u.jsx(Wl,{className:"h-3.5 w-3.5"}),onClick:()=>{y.current=!0,d(!1),i()},children:"New session"}),u.jsx(Qa,{icon:u.jsx(Lk,{className:"h-3.5 w-3.5"}),onClick:()=>h("fork"),children:"Fork from message…"}),u.jsx(Qa,{icon:l?u.jsx(tn,{className:"h-3.5 w-3.5 animate-spin"}):u.jsx(Fk,{className:"h-3.5 w-3.5"}),onClick:()=>void a(),disabled:l,children:"Reload"})]}),u.jsxs("div",{className:"flex items-center justify-between border-t border-border bg-muted/60 px-3 py-1.5 text-[11.5px] text-muted-foreground",children:[u.jsx("span",{className:"font-medium text-foreground/80",children:"Session history"}),s&&u.jsx("span",{className:"font-mono tabular-nums",children:s.length})]}),u.jsxs("div",{className:"max-h-72 overflow-y-auto py-1",children:[!s&&u.jsx("div",{className:"px-3 py-3 text-xs text-muted-foreground",children:l?"Loading…":"No sessions."}),s&&s.length===0&&u.jsx("div",{className:"px-3 py-3 text-xs text-muted-foreground",children:"No sessions yet."}),s==null?void 0:s.map(T=>{const L=T.path===t,j=P===T.path;return u.jsxs("div",{className:"group/row relative flex items-stretch px-1.5",children:[u.jsxs("button",{ref:L?x:void 0,type:"button",role:"option","aria-selected":L,onClick:()=>{y.current=!0,d(!1),L||r(T.path)},title:T.path,className:V("flex w-full items-start gap-2.5 rounded-md px-2 py-1.5 pr-9 text-left text-xs transition-colors ring-brand-focus focus:outline-none","text-foreground/90 hover:bg-accent hover:text-foreground focus:bg-accent focus:text-foreground"),children:[u.jsx(Vl,{className:V("mt-0.5 h-3.5 w-3.5 shrink-0",L?"text-brand opacity-100":"opacity-0")}),u.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[u.jsx("span",{className:"truncate font-normal text-foreground",children:Va(T)}),u.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:IN(T.updatedAt)})]})]}),!L&&u.jsx("button",{type:"button",onClick:A=>{A.stopPropagation(),E(T.path)},disabled:c.isPending,"aria-label":`Delete session ${Va(T)}`,title:c.isPending&&!j?"Another delete is in progress":"Delete session",className:V("absolute right-3 top-1/2 -translate-y-1/2 rounded p-1 text-muted-foreground transition-opacity ring-brand-focus","hover:bg-signal-rose/15 hover:text-signal-rose","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted-foreground",j?"opacity-100":"opacity-0 group-hover/row:opacity-100 focus:opacity-100"),children:j?u.jsx(tn,{className:"h-3 w-3 animate-spin"}):u.jsx(qo,{className:"h-3 w-3"})})]},T.path)})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center gap-1 border-b border-border bg-muted/60 px-2 py-1.5",children:[u.jsx("button",{type:"button",onClick:()=>h("sessions"),"aria-label":"Back to sessions",title:"Back",className:"rounded p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground ring-brand-focus",children:u.jsx(jx,{className:"h-3.5 w-3.5"})}),u.jsx("span",{className:"text-[11.5px] font-medium text-foreground/80",children:"Fork from message"})]}),u.jsxs("div",{className:"max-h-72 overflow-y-auto py-1",children:[!m&&u.jsx("div",{className:"px-3 py-3 text-xs text-muted-foreground",children:"Loading…"}),m&&m.length===0&&u.jsx("div",{className:"px-3 py-3 text-xs text-muted-foreground",children:"No messages to fork from."}),m==null?void 0:m.map(T=>u.jsx("button",{type:"button",onClick:()=>{y.current=!0,d(!1),o(T.entryId)},className:"w-full truncate px-3 py-1.5 text-left text-xs text-foreground/90 transition-colors hover:bg-accent hover:text-foreground ring-brand-focus",title:T.text,children:T.text},T.entryId))]})]})})]})}function Qa({icon:e,children:t,onClick:n,disabled:r}){return u.jsxs("button",{type:"button",role:"menuitem",onClick:n,disabled:r,className:V("flex w-full items-center gap-2.5 px-3 py-1.5 text-left text-[12.5px] text-foreground/90 transition-colors ring-brand-focus","hover:bg-accent hover:text-foreground","disabled:cursor-not-allowed disabled:opacity-50"),children:[u.jsx("span",{className:"shrink-0 text-muted-foreground",children:e}),u.jsx("span",{children:t})]})}function Va(e){return e.name??e.preview??qy(e.path)}function qy(e){return e.split("/").at(-1)??e}function TN(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1}).format(t)}function IN(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t)}const _N={online:"bg-signal-ok",streaming:"bg-brand",idle:"bg-muted-foreground/40",error:"bg-signal-error",warning:"bg-signal-warn"};function Nl({state:e}){return u.jsx("span",{className:V("inline-block h-1.5 w-1.5 shrink-0 rounded-full",_N[e],e==="streaming"&&"animate-[v2-halo-brand_2.4s_ease-out_infinite]")})}const RN={default:"text-muted-foreground bg-muted border-border",brand:"text-brand bg-brand/[0.08] border-brand/[0.22]",ok:"text-signal-ok bg-signal-ok/[0.10] border-transparent",warn:"text-signal-warn bg-signal-warn/[0.10] border-transparent",error:"text-signal-error bg-signal-error/[0.10] border-transparent",ghost:"text-muted-foreground bg-transparent border-border-soft"};function rr({tone:e="default",mono:t=!1,className:n,title:r,children:i}){return u.jsx("span",{title:r,className:V("inline-flex items-center gap-1.5 rounded-full border px-[9px] py-[2px] text-[11.5px] font-medium leading-[1.5]",t?"font-mono tracking-normal":"tracking-[-0.005em]",RN[e],n),children:i})}function Wn({children:e,className:t}){return u.jsx("kbd",{className:V("inline-flex min-w-[18px] items-center justify-center rounded-[5px] border border-border bg-card px-1.5 py-px text-[10.5px] font-medium leading-none text-muted-foreground","border-b-[1.5px] border-b-border-hi",t),children:e})}function Wo({active:e,title:t,onClick:n,disabled:r,className:i,children:o,...s}){return u.jsx("button",{type:"button",title:t,onClick:n,disabled:r,"aria-label":s["aria-label"]??t,className:V("inline-flex h-[30px] w-[30px] shrink-0 items-center justify-center rounded-full border text-[13px] transition-colors ring-brand-focus disabled:cursor-not-allowed disabled:opacity-50",e?"border-brand/[0.22] bg-brand/[0.08] text-brand":"border-transparent text-muted-foreground hover:bg-accent/70 hover:text-foreground",i),children:o})}function Hd({tool:e,className:t}){const n="currentColor";switch(e){case"read":return u.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:u.jsx("path",{d:"M2 3h7l3 3v5a1 1 0 0 1-1 1H2zM9 3v3h3"})});case"edit":return u.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:u.jsx("path",{d:"M2 10l7-7 2 2-7 7H2zM8.5 3.5L10.5 5.5"})});case"write":return u.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:u.jsx("path",{d:"M3 2h6l3 3v7H3zM7 2v9M3 7h9"})});case"bash":return u.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:u.jsx("path",{d:"M2 4l3 3-3 3M7 10h5"})});case"grep":case"find":return u.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("circle",{cx:"6",cy:"6",r:"3.5"}),u.jsx("path",{d:"M9 9l3 3"})]});case"ls":return u.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:u.jsx("path",{d:"M2 4h10M2 7h10M2 10h6"})});default:return u.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,children:u.jsx("circle",{cx:"7",cy:"7",r:"3"})})}}function Ch(){const e=new Date,t=n=>String(n).padStart(2,"0");return`${t(e.getUTCHours())}:${t(e.getUTCMinutes())}:${t(e.getUTCSeconds())}Z`}function LN(){const[e,t]=N.useState(Ch);return N.useEffect(()=>{const n=setInterval(()=>t(Ch()),1e3);return()=>clearInterval(n)},[]),e}function Wa(e){return e==null?"—":e<1e3?`${Math.round(e)}ms`:e<1e4?`${(e/1e3).toFixed(1)}s`:`${Math.round(e/1e3)}s`}function AN(e){if(e!=null)return e>=3e3?"text-signal-error":e>=1500?"text-signal-warn":"text-brand"}const Ka={30:"text-zinc-800 dark:text-zinc-200",31:"text-red-600 dark:text-red-400",32:"text-green-600 dark:text-green-400",33:"text-yellow-600 dark:text-yellow-400",34:"text-blue-600 dark:text-blue-400",35:"text-purple-600 dark:text-purple-400",36:"text-cyan-600 dark:text-cyan-400",37:"text-zinc-500 dark:text-zinc-400",90:"text-zinc-500 dark:text-zinc-500",91:"text-red-500 dark:text-red-300",92:"text-green-500 dark:text-green-300",93:"text-yellow-500 dark:text-yellow-300",94:"text-blue-500 dark:text-blue-300",95:"text-purple-500 dark:text-purple-300",96:"text-cyan-500 dark:text-cyan-300",97:"text-zinc-100"};function zN(e){if(e<0||e>255||e<16)return;if(e<232){const n=e-16,r=Math.floor(n/36),i=Math.floor(n%36/6),o=n%6,s=[0,95,135,175,215,255];return`rgb(${s[r]},${s[i]},${s[o]})`}const t=8+(e-232)*10;return`rgb(${t},${t},${t})`}function FN(e,t){const n={...e};for(let r=0;r<t.length;r++){const i=t[r];switch(i){case 0:n.fgClass=void 0,n.fgStyle=void 0,n.bold=!1,n.dim=!1,n.italic=!1,n.underline=!1;break;case 1:n.bold=!0;break;case 2:n.dim=!0;break;case 3:n.italic=!0;break;case 4:n.underline=!0;break;case 22:n.bold=!1,n.dim=!1;break;case 23:n.italic=!1;break;case 24:n.underline=!1;break;case 39:n.fgClass=void 0,n.fgStyle=void 0;break;case 38:{const o=t[r+1];if(o===5){const s=t[r+2];if(typeof s=="number"){const l=zN(s);if(l)n.fgStyle=l,n.fgClass=void 0;else if(s<16){const a=s<8?30+s:90+(s-8);n.fgClass=Ka[a],n.fgStyle=void 0}}r+=2}else if(o===2){const s=t[r+2],l=t[r+3],a=t[r+4];typeof s=="number"&&typeof l=="number"&&typeof a=="number"&&(n.fgStyle=`rgb(${s},${l},${a})`,n.fgClass=void 0),r+=4}break}default:Ka[i]&&(n.fgClass=Ka[i],n.fgStyle=void 0)}}return n}const yc=/\x1b(?:\[([0-9;]*)([a-zA-Z])|\][^\x07\x1b]*(?:\x07|\x1b\\))/g;function MN(e){return e.includes("\r")?e.split(`
199
- `).map(t=>{if(!t.includes("\r"))return t;const n=t.split("\r");return n[n.length-1]??""}).join(`
200
- `):e}function vc(e){const t=MN(e),n=[];let r={},i=0,o=0;const s=a=>{if(!a)return;if(!ON(r)){n.push(a);return}const c=DN(r),f=$N(r);n.push(u.jsx("span",{className:c||void 0,style:f,children:a},o++))};yc.lastIndex=0;let l;for(;(l=yc.exec(t))!==null;){const a=l.index;if(a>i&&s(t.slice(i,a)),l[2]==="m"){const c=l[1]?l[1].split(";").map(f=>f===""?0:Number(f)):[0];r=FN(r,c)}i=a+l[0].length}return i<t.length&&s(t.slice(i)),n}function ON(e){return!!(e.fgClass||e.fgStyle||e.bold||e.dim||e.italic||e.underline)}function DN(e){const t=[];return e.fgClass&&t.push(e.fgClass),e.bold&&t.push("font-bold"),e.dim&&t.push("opacity-60"),e.italic&&t.push("italic"),e.underline&&t.push("underline"),t.join(" ")}function $N(e){return e.fgStyle?{color:e.fgStyle}:void 0}function jh(e){return e.replace(yc,"")}function Qy({item:e}){if(e.kind==="bash")return u.jsx(Eh,{command:e.command,output:e.output,exitCode:e.exitCode,running:!1});const t=XN(e.args),n=e.toolName;return n==="edit"?u.jsx(HN,{item:e,args:t}):n==="write"?u.jsx(qN,{item:e,args:t}):n==="read"?u.jsx(QN,{item:e,args:t}):n==="bash"?u.jsx(Eh,{command:vt(t==null?void 0:t.command)??"",output:e.text,exitCode:void 0,running:e.status==="running",errored:e.status==="error"}):u.jsx(VN,{item:e,args:t})}function BN({items:e}){const[t,n]=N.useState(!1),r=N.useId(),i=UN(e);return u.jsxs("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:[u.jsxs("button",{type:"button","aria-expanded":t,"aria-controls":r,onClick:()=>n(o=>!o),className:"flex w-full items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-accent/40 ring-brand-focus",children:[u.jsx(Ur,{className:V("h-3 w-3 shrink-0 text-muted-foreground transition-transform",t&&"rotate-180")}),u.jsxs("span",{className:"shrink-0 text-[12.5px] font-medium text-foreground",children:[e.length," actions"]}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:i.map(o=>`${o.count} ${o.name}`).join(" · ")}),u.jsx(rr,{tone:"ghost",children:t?"open":"batched"})]}),t&&u.jsx("div",{id:r,className:"flex flex-col gap-2 border-t border-border-soft bg-card p-2",children:e.map(o=>u.jsx(Qy,{item:o},o.id))})]})}function UN(e){const t=new Map;for(const n of e){const r=n.kind==="bash"?"bash":n.toolName;t.set(r,(t.get(r)??0)+1)}return Array.from(t.entries()).sort((n,r)=>r[1]-n[1]).map(([n,r])=>({name:n,count:r}))}function HN({item:e,args:t}){const n=Wd(t),r=JN(t),i=e.status==="error",o=YN(r);return u.jsxs(as,{children:[u.jsx(qd,{name:"edit",verb:"Edited",path:n,status:e.status,stats:o}),r.length>0?u.jsx(GN,{children:u.jsx("div",{className:"flex flex-col gap-2 bg-background p-2",children:r.map((s,l)=>u.jsx(KN,{index:l,edit:s,multi:r.length>1},l))})}):e.text&&u.jsx(Ko,{text:e.text}),e.text&&r.length>0&&i&&u.jsx(Ko,{text:e.text})]})}function qN({item:e,args:t}){const n=Wd(t),r=vt(t==null?void 0:t.content)??"",i=e.status==="error";return u.jsxs(as,{children:[u.jsx(qd,{name:"write",verb:"Wrote",path:n,status:e.status}),r?u.jsx(Vd,{text:r,render:o=>u.jsx("pre",{className:"overflow-auto whitespace-pre font-mono text-[12px] leading-relaxed text-foreground",children:o})}):e.text&&u.jsx(Ko,{text:e.text}),r&&i&&e.text&&u.jsx(Ko,{text:e.text})]})}function QN({item:e,args:t}){const n=Wd(t),r=Ph(t==null?void 0:t.offset),i=Ph(t==null?void 0:t.limit),o=r!==void 0||i!==void 0?`lines ${r??1}–${(r??1)+(i??0)-1}`:void 0;return u.jsxs(as,{children:[u.jsx(qd,{name:"read",verb:"Read",path:n,status:e.status,suffix:o}),e.text&&u.jsx(Vd,{text:e.text,render:s=>u.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words font-mono text-[12px] leading-relaxed text-muted-foreground",children:s})})]})}function Eh({command:e,output:t,exitCode:n,running:r,errored:i}){const s=r?"running":i===!0||n!==void 0&&n!==0?"error":"ok";return u.jsxs(as,{children:[u.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[u.jsx(Hd,{tool:"bash",className:"shrink-0 text-muted-foreground"}),u.jsx("span",{className:"text-[12.5px] text-foreground",children:"Ran"}),u.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11.5px] tracking-[-0.005em] text-muted-foreground",children:e}),n!==void 0&&n!==0&&u.jsxs("span",{className:"font-mono text-[11px] text-signal-error",children:["exit ",n]}),u.jsx(Qd,{status:s})]}),t&&u.jsx(Vd,{text:t,alwaysCollapsible:!0,render:l=>u.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words font-mono text-[12px] leading-relaxed text-foreground",children:vc(l)})})]})}function VN({item:e,args:t}){const n=ZN(e.toolName,t);return u.jsxs(as,{children:[u.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[u.jsx(Hd,{tool:e.toolName,className:"shrink-0 text-muted-foreground"}),u.jsxs("span",{className:"min-w-0 flex-1 truncate text-[12.5px] text-muted-foreground",children:[u.jsx("span",{className:"text-foreground",children:e.toolName}),n&&u.jsx("span",{className:"ml-2 font-mono text-[11.5px]",children:n})]}),u.jsx(Qd,{status:e.status})]}),e.text&&u.jsx(Ko,{text:e.text})]})}function as({children:e}){return u.jsx("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:e})}function qd({name:e,verb:t,path:n,status:r,suffix:i,stats:o}){return u.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[u.jsx(Hd,{tool:e,className:"shrink-0 text-muted-foreground"}),u.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:t}),n?u.jsx(WN,{path:n}):u.jsx("span",{className:"flex-1 text-muted-foreground",children:"…"}),i&&u.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:i}),o&&(o.adds>0||o.dels>0)&&u.jsxs("span",{className:"shrink-0 font-mono text-[11.5px] tabular-nums",children:[o.adds>0&&u.jsxs("span",{className:"text-signal-ok",children:["+",o.adds]}),o.adds>0&&o.dels>0&&" ",o.dels>0&&u.jsxs("span",{className:"text-signal-error",children:["−",o.dels]})]}),u.jsx(Qd,{status:r})]})}function Qd({status:e}){return e==="ok"?u.jsx(rr,{tone:"ok",children:"done"}):e==="error"?u.jsx(rr,{tone:"error",children:"error"}):u.jsx(rr,{tone:"warn",children:"running"})}function WN({path:e}){const t=Dr(s=>s.pushToast),[n,r]=N.useState(!1),i=Gs(e),o=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1200),t({id:`copy-${Date.now()}`,workspaceId:"",message:`Copied: ${e}`,notifyType:"info"})}catch{t({id:`copy-${Date.now()}`,workspaceId:"",message:"Copy failed — clipboard not available",notifyType:"warning"})}};return u.jsxs("button",{type:"button",onClick:o,title:`${e} — click to copy`,className:"group inline-flex min-w-0 flex-1 items-center gap-1 truncate text-left font-mono text-[11.5px] tracking-[-0.005em] text-muted-foreground transition-colors hover:text-foreground",children:[u.jsx("span",{className:"truncate",children:i}),n?u.jsx(Vl,{className:"h-3 w-3 shrink-0 text-signal-ok"}):u.jsx(Ex,{className:"h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60"})]})}function KN({index:e,edit:t,multi:n}){return u.jsxs("div",{className:"overflow-hidden rounded-md border border-border-soft bg-card",children:[n&&u.jsxs("div",{className:"border-b border-border-soft bg-muted px-2.5 py-1 text-[11px] text-muted-foreground",children:["Edit ",e+1]}),u.jsx(Nh,{kind:"del",text:t.oldText}),u.jsx(Nh,{kind:"add",text:t.newText})]})}function Nh({kind:e,text:t}){if(!t)return null;const n=t.split(`
201
- `),r=e==="add"?"bg-signal-ok/[0.08] text-signal-ok":"bg-signal-error/[0.08] text-signal-error",i=e==="add"?"+":"−";return u.jsx("pre",{className:V("overflow-x-auto whitespace-pre font-mono text-[12px] leading-relaxed",r),children:n.map((o,s)=>u.jsxs("div",{className:"flex",children:[u.jsx("span",{className:"select-none px-2 opacity-60",children:i}),u.jsx("span",{className:"flex-1 pr-2",children:o||" "})]},s))})}function GN({children:e}){const[t,n]=N.useState(!1),r=N.useId();return u.jsxs("div",{className:"border-t border-border-soft bg-background",children:[t&&u.jsx("div",{id:r,children:e}),u.jsxs("button",{type:"button","aria-expanded":t,"aria-controls":r,onClick:()=>n(i=>!i),className:V("flex w-full items-center gap-1.5 px-3 py-1.5 text-[11.5px] text-muted-foreground transition-colors hover:text-foreground",t&&"border-t border-border-soft"),children:[u.jsx(Ur,{className:V("h-3 w-3 transition-transform",t&&"rotate-180")}),t?"Collapse":"Show details"]})]})}function Ko({text:e}){const[t,n]=N.useState(!1),r=N.useId(),i=e.split(`
202
- `).length;return i<=3?u.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words border-t border-border-soft bg-background px-3 py-2 font-mono text-[12px] leading-relaxed text-muted-foreground",title:jh(e).slice(0,400),children:vc(e)}):u.jsxs("div",{className:"border-t border-border-soft bg-background",children:[t&&u.jsx("pre",{id:r,className:"max-h-80 overflow-auto whitespace-pre-wrap break-words px-3 py-2 font-mono text-[12px] leading-relaxed text-muted-foreground",title:jh(e).slice(0,400),children:vc(e)}),u.jsxs("button",{type:"button","aria-expanded":t,"aria-controls":r,onClick:()=>n(o=>!o),className:V("flex w-full items-center gap-1.5 px-3 py-1.5 text-[11.5px] text-muted-foreground transition-colors hover:text-foreground",t&&"border-t border-border-soft"),children:[u.jsx(Ur,{className:V("h-3 w-3 transition-transform",t&&"rotate-180")}),t?"Collapse":`Show ${i} line${i===1?"":"s"}`]})]})}function YN(e){let t=0,n=0;for(const r of e)r.oldText&&(n+=r.oldText.split(`
203
- `).filter(i=>i.length>0).length),r.newText&&(t+=r.newText.split(`
204
- `).filter(i=>i.length>0).length);return{adds:t,dels:n}}function Vd({text:e,render:t,alwaysCollapsible:n=!1}){const[r,i]=N.useState(!1),o=N.useId(),s=e.split(`
205
- `).length;return s<=3&&!n?u.jsx("div",{className:"overflow-auto border-t border-border-soft bg-background px-3 py-2",children:t(e)}):u.jsxs("div",{className:"border-t border-border-soft bg-background",children:[r&&u.jsx("div",{id:o,className:"max-h-80 overflow-auto px-3 py-2",children:t(e)}),u.jsxs("button",{type:"button","aria-expanded":r,"aria-controls":o,onClick:()=>i(l=>!l),className:V("flex w-full items-center gap-1.5 px-3 py-1.5 text-[11.5px] text-muted-foreground transition-colors hover:text-foreground",r&&"border-t border-border-soft"),children:[u.jsx(Ur,{className:V("h-3 w-3 transition-transform",r&&"rotate-180")}),r?"Collapse":`Show ${s} line${s===1?"":"s"}`]})]})}function XN(e){return e&&typeof e=="object"?e:void 0}function vt(e){return typeof e=="string"?e:void 0}function Ph(e){return typeof e=="number"?e:void 0}function Wd(e){return vt(e==null?void 0:e.path)??vt(e==null?void 0:e.file_path)}function JN(e){if(!e)return[];if(Array.isArray(e.edits))return e.edits.flatMap(r=>{if(!r||typeof r!="object")return[];const i=r.oldText??r.old_string,o=r.newText??r.new_string;return typeof i=="string"&&typeof o=="string"?[{oldText:i,newText:o}]:[]});const t=vt(e.old_string)??vt(e.oldText),n=vt(e.new_string)??vt(e.newText);return typeof t=="string"&&typeof n=="string"?[{oldText:t,newText:n}]:[]}function Gs(e){const t="/Users/";if(e.startsWith(t)){const n=e.slice(t.length),r=n.indexOf("/");if(r>0)return"~/"+n.slice(r+1)}if(e.length>60){const n=e.split("/").filter(Boolean);if(n.length>2)return".../"+n.slice(-2).join("/")}return e}function ZN(e,t){if(!t)return;if(e==="grep"){const r=vt(t.pattern),i=vt(t.path);if(r)return`/${r}/${i?` in ${Gs(i)}`:""}`}if(e==="find"){const r=vt(t.pattern),i=vt(t.path);if(r)return`${r}${i?` in ${Gs(i)}`:""}`}if(e==="ls"){const r=vt(t.path);return r?Gs(r):"."}const n=Object.keys(t);if(n.length!==0)return`(${n.slice(0,4).join(", ")}${n.length>4?", …":""})`}function e3(e){const t=[];let n=[];const r=()=>{n.length!==0&&(n.length===1?t.push({kind:"single",item:n[0]}):t.push({kind:"group",items:n}),n=[])};for(const i of e)if(i.kind==="tool"||i.kind==="bash")n3(i)?(r(),t.push({kind:"single",item:i})):n.push(i);else{if(t3(i))continue;r(),t.push({kind:"single",item:i})}return r(),t}function t3(e){return e.kind==="assistant"&&!e.streaming&&e.text.length===0&&e.thinking.length===0}function n3(e){return e.kind==="tool"?e.status==="error":e.exitCode!==void 0&&e.exitCode!==0}function Kd({size:e=28,running:t=!1,filled:n,className:r,title:i="pi-pilot"}){const o=n??t;return u.jsx("span",{role:"img","aria-label":i,title:i,className:V("inline-flex shrink-0 items-center justify-center rounded-full",o?"bg-brand text-[hsl(var(--brand-foreground))] border border-brand":"bg-card text-brand border border-border-hi",r),style:{width:e,height:e,fontFamily:'"Instrument Serif", "Times New Roman", serif',fontSize:Math.round(e*.5),fontStyle:"italic",lineHeight:1,letterSpacing:"-0.02em"},children:"π"})}function r3({className:e}){return u.jsx("span",{className:V("font-sans text-[15px] font-medium tracking-[-0.01em] text-foreground",e),children:"pi-pilot"})}let i3=1;const gr=()=>String(i3++),Re=zy(e=>({sessionPath:void 0,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],compaction:void 0,contextUsage:void 0,latency:void 0,reset:()=>e({sessionPath:void 0,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],compaction:void 0,contextUsage:void 0,latency:void 0}),pushUser:t=>e(n=>({items:[...n.items,{id:gr(),kind:"user",text:t}]})),apply:t=>e(n=>o3(n,t)),setSwitching:t=>e({switching:t}),applyHistory:(t,n)=>e({items:t.map(r=>r.kind==="user"?{id:gr(),kind:"user",text:r.text}:r.kind==="assistant"?{id:gr(),kind:"assistant",text:r.text,thinking:r.thinking,streaming:!1,firstTokenMs:void 0,totalMs:void 0}:r.kind==="tool"?{id:gr(),kind:"tool",toolCallId:r.toolCallId,toolName:r.toolName,args:r.args,text:r.text,status:r.isError?"error":"ok"}:{id:gr(),kind:"bash",command:r.command,output:r.output,exitCode:r.exitCode}),running:n})}));function o3(e,t){return t.type==="subscribed"?{sessionPath:t.sessionPath,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],compaction:void 0}:t.type==="error"?e.switching?{switching:!1}:{}:t.type!=="event"?{}:s3(e,t.payload)}function s3(e,t){var n;switch(t.kind){case"agent_start":return{running:!0};case"agent_end":return{running:!1};case"message_start":return t.role!=="assistant"?{}:{items:[...e.items,{id:gr(),kind:"assistant",text:"",thinking:"",streaming:!0,firstTokenMs:void 0,totalMs:void 0}]};case"message_end":{if(t.role!=="assistant")return{};const r=Th(e.items);if(r<0)return{};const i=e.items.slice();return i[r]={...i[r],streaming:!1},{items:i}}case"message_update":{if(t.delta.kind==="other")return{};const r=Th(e.items);if(r<0)return{};const i=e.items[r],o=t.delta.kind==="text"?{...i,text:i.text+t.delta.text}:{...i,thinking:i.thinking+t.delta.text},s=e.items.slice();return s[r]=o,{items:s}}case"tool_execution_start":return{items:[...e.items,{id:gr(),kind:"tool",toolCallId:t.toolCallId,toolName:t.toolName,args:t.args,text:"",status:"running"}]};case"tool_execution_update":return{items:e.items.map(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId?{...r,text:t.partialText??r.text}:r)};case"tool_execution_end":return{items:e.items.map(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId?{...r,text:t.text??r.text,status:t.isError?"error":"ok"}:r)};case"queue_update":return{queueSteering:t.steering,queueFollowUp:t.followUp};case"compaction_start":return{compaction:{reason:t.reason}};case"compaction_end":return{compaction:void 0};case"context_usage":return{contextUsage:{tokens:t.tokens,contextWindow:t.contextWindow,percent:t.percent}};case"assistant_timing":{const r=((n=e.latency)==null?void 0:n.rollingFirstTokenMs)??[],i=t.firstTokenMs==null?r:[...r,t.firstTokenMs].slice(-5),o={lastFirstTokenMs:t.firstTokenMs,lastTotalMs:t.totalMs,rollingFirstTokenMs:i};let s=-1;for(let a=e.items.length-1;a>=0;a--){const c=e.items[a];if(c.kind==="assistant"&&!c.streaming&&c.totalMs===void 0){s=a;break}}if(s<0)return{latency:o};const l=e.items.slice();return l[s]={...l[s],firstTokenMs:t.firstTokenMs,totalMs:t.totalMs},{items:l,latency:o}}default:return{}}}function Th(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="assistant"&&n.streaming)return t}return-1}function l3(e,t){const n=Re(d=>d.apply),r=Re(d=>d.pushUser),i=Re(d=>d.reset),o=Re(d=>d.setSwitching),s=Re(d=>d.applyHistory),l=Re(d=>d.switching),a=N.useRef(null),c=N.useRef(null),f=N.useRef(0);return N.useEffect(()=>(ot.start(),()=>{}),[]),N.useEffect(()=>ot.on(p=>{const h=c.current;if(h&&p.type==="event"&&p.workspaceId===h.expectedWorkspaceId&&p.sessionPath===h.expectedSessionPath){h.buffer.push(p);return}if(p.type==="subscribed"){const m=Re.getState().sessionPath;if(m!==void 0&&m===p.sessionPath)return}n(p)}),[n]),N.useEffect(()=>{if(!e){i();return}t&&o(!0),ot.send({type:"subscribe",workspaceId:e,...t?{sessionPath:t.path}:{}})},[e,t,i,o]),N.useEffect(()=>ot.onReconnect(()=>{a.current=null}),[]),N.useEffect(()=>{const d=h=>{if(h.type!=="subscribed")return;const m=h.workspaceId,v=h.sessionPath,b=a.current;if(b&&b.wsId===m&&b.sp===v)return;const g=c.current;g&&g.controller.abort(),a.current={wsId:m,sp:v};const x=++f.current,y=new AbortController,S={token:x,expectedWorkspaceId:m,expectedSessionPath:v,controller:y,buffer:[]};c.current=S;const P=ot.connectionEpoch,E=v?`?sessionPath=${encodeURIComponent(v)}`:"";ce(`/api/workspaces/${m}/history${E}`,{signal:y.signal}).then(I=>{var j;if(((j=c.current)==null?void 0:j.token)!==x)return;const T=()=>{var A;((A=c.current)==null?void 0:A.token)===x&&(c.current=null)};if(ot.connectionEpoch!==P){T();return}if(Re.getState().sessionPath!==v){T();return}s(I.items,I.isStreaming),Ga(S),c.current=null}).catch(I=>{var T;(I==null?void 0:I.name)!=="AbortError"&&((T=c.current)==null?void 0:T.token)===x&&(console.error("[useSessionStream] history fetch failed:",I),Ga(S),c.current=null)})},p=ot.on(d);return()=>{p();const h=c.current;h&&(h.controller.abort(),c.current=null,Ga(h))}},[s]),N.useMemo(()=>({sendPrompt(d){!e||l||(r(d),ot.send({type:"prompt",message:d}))},abort(){e&&ot.send({type:"abort"})},newSession(){e&&(o(!0),ot.send({type:"new_session",workspaceId:e}))},fork(d){e&&(o(!0),ot.send({type:"fork",workspaceId:e,entryId:d}))}}),[e,r,o,l])}function Ga(e){const{expectedWorkspaceId:t,expectedSessionPath:n,buffer:r}=e;for(const i of r)i.type==="event"&&i.workspaceId===t&&i.sessionPath===n&&Re.getState().apply(i)}function a3({workspaceId:e,rightPanel:t,onToggleConfig:n,onToggleResources:r}){const i=Re(x=>x.items),o=Re(x=>x.running),s=Re(x=>x.switching),l=Re(x=>x.sessionPath),[a,c]=N.useState(void 0),{sendPrompt:f,abort:d,newSession:p,fork:h}=l3(e,a),m=N.useCallback(x=>{c(y=>({path:x,nonce:((y==null?void 0:y.nonce)??0)+1}))},[]),v=N.useRef(null),[b,g]=N.useState(0);return N.useLayoutEffect(()=>{const x=v.current;if(!x)return;g(x.getBoundingClientRect().height);const y=new ResizeObserver(S=>{const P=S[0];P&&g(P.contentRect.height)});return y.observe(x),()=>y.disconnect()},[e]),e?u.jsxs("main",{className:"relative flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-clip bg-background",children:[u.jsx(u3,{workspaceId:e,sessionPath:l,running:o,switching:s,onSelectSession:m,onNewSession:p,onFork:h,rightPanel:t,onToggleConfig:n,onToggleResources:r}),u.jsx(c3,{}),u.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[u.jsx(f3,{items:i,running:o,bottomPad:b}),u.jsx("div",{ref:v,className:"pointer-events-none absolute inset-x-0 bottom-0 z-20 flex flex-col",children:u.jsx(k3,{workspaceId:e,onSend:f,onAbort:d,running:o,disabled:s})})]})]}):u.jsx("main",{className:"relative flex flex-1 items-center justify-center bg-background",children:u.jsx(Vy,{title:"Ready when you are.",tagline:"Pick or add a workspace from the left to begin a session."})})}function u3({workspaceId:e,sessionPath:t,running:n,switching:r,onSelectSession:i,onNewSession:o,onFork:s,rightPanel:l,onToggleConfig:a,onToggleResources:c}){const f=Re(h=>{var m;return(m=h.contextUsage)==null?void 0:m.percent}),{data:d}=wx(e,t),p=f!=null?Math.round(f):null;return u.jsx("header",{className:"relative z-20 shrink-0 border-b border-border bg-popover",children:u.jsxs("div",{className:"flex items-center gap-2 px-4 py-[10px]",children:[u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[u.jsx(PN,{workspaceId:e,sessionPath:t,disabled:n||r,onSelect:i,onNewSession:o,onFork:s}),n&&u.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-[11.5px] text-brand",children:[u.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-brand",style:{animation:"v2-pulse 1.6s ease-in-out infinite"}}),u.jsx("span",{children:"thinking…"})]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[(d==null?void 0:d.currentModel)&&u.jsx(rr,{tone:"ghost",className:"hidden md:inline-flex",title:d.currentModel.modelId,children:u.jsx("span",{className:"max-w-[180px] truncate text-foreground",children:d.currentModel.name})}),(d==null?void 0:d.currentModel)&&p!=null&&u.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),p!=null&&u.jsxs(rr,{tone:"ghost",className:"hidden md:inline-flex",title:`Context · ${p}%`,children:[u.jsx("span",{className:"text-muted-foreground",children:"Context"}),u.jsxs("span",{className:"font-mono text-[11px] tabular-nums text-foreground",children:[p,"%"]}),u.jsx("span",{className:"inline-block h-1 w-[22px] overflow-hidden rounded-full bg-border-soft",children:u.jsx("span",{className:"block h-full bg-brand",style:{width:`${Math.min(100,p)}%`}})})]}),(c||a)&&u.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),c&&u.jsx(Wo,{active:l==="resources",onClick:c,title:"Resources",children:u.jsx(Rk,{className:"h-3.5 w-3.5"})}),a&&u.jsx(Wo,{active:l==="config",onClick:a,title:"Configuration",children:u.jsx(Px,{className:"h-3.5 w-3.5"})})]})]})})}function c3(){const e=Re(n=>n.compaction),t=Re(n=>{var r;return(r=n.contextUsage)==null?void 0:r.percent});return e?u.jsxs("div",{className:"relative z-10 flex shrink-0 items-center gap-3 border-b border-border bg-signal-warn/[0.10] px-4 py-2 text-[12.5px] text-signal-warn",children:[u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{animation:"v2-spin 1.4s linear infinite"},children:u.jsx("circle",{cx:"7",cy:"7",r:"5",stroke:"currentColor",strokeWidth:"1.4",strokeDasharray:"3 3"})}),u.jsx("span",{className:"flex-1",children:d3(e)}),t!=null&&u.jsxs("span",{className:"font-mono text-[11px] tabular-nums",children:["Context ",Math.round(t),"%"]})]}):null}function d3(e){switch(e.reason){case"manual":return"Compacting context (manual)…";case"threshold":return"Compacting context — threshold reached";case"overflow":return"Compacting context (overflow) — will retry the prompt";default:return"Compacting context…"}}function f3({items:e,running:t,bottomPad:n}){const r=N.useRef(null),i=N.useRef(!0),o=N.useCallback(()=>{const l=r.current;l&&(i.current=l.scrollHeight-l.scrollTop-l.clientHeight<30)},[]);N.useEffect(()=>{const l=r.current;!l||!i.current||(l.scrollTop=l.scrollHeight)},[e,t]),N.useEffect(()=>{const l=r.current;!l||!i.current||(l.scrollTop=l.scrollHeight)},[n]);const s=e.length===0&&!t;return u.jsx("div",{ref:r,onScroll:o,className:V("relative z-10 min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain",s?"flex items-center justify-center":"pt-4"),style:s?void 0:{maskImage:"linear-gradient(to bottom, black calc(100% - 56px), transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black calc(100% - 56px), transparent 100%)"},children:s?u.jsx(Vy,{title:"Ready when you are.",tagline:"Send a message to brief your co-pilot. Enter submits, Shift+Enter inserts a newline.",hint:{keys:["⏎"],label:"Send"}}):u.jsx("div",{className:"mx-auto flex w-full max-w-[760px] flex-col gap-[18px] px-6",style:{paddingBottom:n},children:e3(e).flatMap(l=>{if(l.kind==="single")return[u.jsx(p3,{item:l.item},l.item.id)];const a=`group:${l.items[0].id}`;return[u.jsx(h3,{group:l},a)]})})})}function p3({item:e}){return e.kind==="user"?u.jsx(m3,{item:e}):e.kind==="assistant"?u.jsx(g3,{item:e}):e.kind==="tool"||e.kind==="bash"?u.jsx("div",{className:"pl-10",children:u.jsx(Qy,{item:e})}):null}function h3({group:e}){return u.jsx("div",{className:"pl-10",children:u.jsx(BN,{items:e.items})})}function m3({item:e}){return u.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[u.jsx("div",{className:"max-w-[78%] rounded-[14px] rounded-br-[4px] border border-brand/[0.22] bg-brand/[0.08] px-3.5 py-2.5 text-[14px] leading-[1.55] text-foreground [overflow-wrap:anywhere]",children:u.jsx(Uy,{text:e.text})}),u.jsx(kc,{children:"You"})]})}function g3({item:e}){return!e.text&&!e.thinking&&!e.streaming?null:u.jsxs("div",{className:"flex gap-3",children:[u.jsx(Kd,{size:28,filled:!0}),u.jsxs("div",{className:"min-w-0 flex-1 pt-0.5 [overflow-wrap:anywhere]",children:[u.jsxs("div",{className:"mb-1 flex items-baseline gap-2",children:[u.jsx("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Pilot"}),!e.streaming&&typeof e.firstTokenMs=="number"&&u.jsx(kc,{className:V(AN(e.firstTokenMs)),title:e.totalMs!=null?`first token ${Wa(e.firstTokenMs)} · total ${Wa(e.totalMs)}`:void 0,children:Wa(e.firstTokenMs)}),e.streaming&&u.jsx(kc,{className:"text-brand",children:"streaming…"})]}),e.thinking&&u.jsxs("details",{className:"mb-2 text-muted-foreground",children:[u.jsx("summary",{className:"cursor-pointer select-none text-[12px] text-muted-foreground hover:text-foreground",children:"Thinking"}),u.jsx("pre",{className:"mt-1.5 whitespace-pre-wrap rounded-md border border-border-soft bg-muted px-3 py-2 font-mono text-[11.5px] leading-relaxed text-muted-foreground",children:e.thinking})]}),u.jsx(Uy,{text:e.text,streaming:e.streaming})]})]})}function kc({children:e,className:t,title:n}){return u.jsx("span",{title:n,className:V("text-[11px] tracking-[-0.005em] text-muted-foreground",t),children:e})}function Vy({title:e,tagline:t,hint:n}){return u.jsxs("div",{className:"relative z-10 flex max-w-[480px] flex-col items-center px-8 text-center",children:[u.jsx(Kd,{size:56,filled:!0}),u.jsx("h2",{className:"mt-5 font-serif text-[36px] italic font-normal leading-[1.05] tracking-[-0.02em] text-foreground",children:e}),u.jsx("p",{className:"mt-2 text-[14.5px] leading-[1.6] tracking-[-0.005em] text-muted-foreground",children:t}),n&&u.jsxs("div",{className:"mt-6 inline-flex items-center gap-2 rounded-[10px] border border-border bg-card px-3.5 py-2 text-[12.5px] text-muted-foreground",children:[n.keys.map(r=>u.jsx(Wn,{children:r},r)),u.jsx("span",{children:n.label})]})]})}function Ih(e,t){if(t<=0)return null;const n=e.slice(0,t),r=/(?:^|\s)([/@])(\S*)$/.exec(n);if(!r)return null;const i=r[1]??"",o=r[2]??"",s=(r.index??0)+(r[0].length-1-o.length);return{kind:i==="/"?"slash":"at",tokenStart:s,query:o}}function x3(e){const t=[],n=/(^|\s)([/@])(\S+)/g;let r;for(;(r=n.exec(e))!==null;){const i=r[1]??"",o=r[2]??"",s=r[3]??"",l=(r.index??0)+i.length,a=l+1+s.length;t.push({kind:o==="/"?"slash":"at",start:l,end:a,body:e.slice(l,a)})}return t}const _h=50;function y3(e,t){if(!e)return[];const n=t.toLowerCase(),r=[];for(const i of e.skills)n&&!i.name.toLowerCase().includes(n)||r.push({key:`skill:${i.filePath}`,label:`/skill:${i.name}`,description:i.description||void 0,insertText:`/skill:${i.name} `});for(const i of e.prompts)n&&!i.name.toLowerCase().includes(n)||r.push({key:`prompt:${i.filePath}`,label:`/${i.name}`,description:i.argumentHint?`${i.description??"prompt"} · ${i.argumentHint}`:i.description||"prompt",insertText:`/${i.name} `});for(const i of e.extensions)for(const o of i.commands)n&&!o.toLowerCase().includes(n)||r.push({key:`cmd:${i.resolvedPath}:${o}`,label:`/${o}`,description:`extension · ${i.source.label}`,insertText:`/${o} `});return r.length>_h?r.slice(0,_h):r}function v3(e){return e?e.entries.map(t=>({key:t.path,label:t.relPath,insertText:`@${t.relPath} `})):[]}function k3({workspaceId:e,onSend:t,onAbort:n,running:r,disabled:i}){var R;const[o,s]=N.useState(""),[l,a]=N.useState(0),[c,f]=N.useState(!1),[d,p]=N.useState(0),[h,m]=N.useState(null),v=N.useRef(null),b=N.useMemo(()=>Ih(o,l),[o,l]),g=b==null?void 0:b.kind,x=(b==null?void 0:b.query)??"",y=Tx(g==="slash"?e:void 0),S=Dk(e,g==="at"?x:"",g==="at"),P=N.useMemo(()=>g?g==="slash"?y3(y.data,x):v3(S.data):[],[g,x,y.data,S.data]),E=b?`${b.kind}:${b.tokenStart}:${b.query}`:null,I=!!b&&P.length>0&&h!==E;N.useEffect(()=>{p(0)},[E]),N.useEffect(()=>{h&&h!==E&&m(null)},[E,h]),N.useCallback(()=>{const $=v.current;$&&a($.selectionStart??0)},[]);const T=()=>{if(i)return;const $=o.trim();$&&(t($),s(""),a(0))},L=$=>{const U=v.current,q=(U==null?void 0:U.value)??o,le=(U==null?void 0:U.selectionStart)??l,oe=Ih(q,le);if(!oe)return;const M=oe.tokenStart+1+oe.query.length,H=q.slice(0,oe.tokenStart),k=q.slice(M),K=`${H}${$.insertText}${k}`,te=oe.tokenStart+$.insertText.length;s(K),a(te),m(null),requestAnimationFrame(()=>{const w=v.current;w&&(w.focus(),w.setSelectionRange(te,te))})},j=$=>{if(I){if($.key==="ArrowDown"){$.preventDefault(),p(U=>(U+1)%P.length);return}if($.key==="ArrowUp"){$.preventDefault(),p(U=>(U-1+P.length)%P.length);return}if($.key==="Enter"||$.key==="Tab"){$.preventDefault();const U=P[d]??P[0];U&&L(U);return}if($.key==="Escape"){$.preventDefault(),E&&m(E);return}}$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),T())},A=i?"Switching session…":r?"Agent is running…":"Write a message…";return u.jsx("div",{className:"relative shrink-0 pb-5 pt-3",children:u.jsxs("div",{className:"pointer-events-auto mx-auto w-full max-w-[760px] px-6",children:[u.jsxs("div",{className:V("relative rounded-[14px] border bg-card transition-shadow",c?"border-brand/[0.22] shadow-[0_2px_18px_-6px_hsl(var(--brand)/0.18),0_0_0_3px_hsl(var(--brand)/0.08)]":"border-border shadow-[0_2px_14px_-6px_hsl(var(--foreground)/0.10),0_1px_3px_-1px_hsl(var(--foreground)/0.06)]"),children:[I&&b&&u.jsx(C3,{kind:b.kind,query:b.query,items:P,selectedIdx:d,loading:b.kind==="slash"?y.isPending:S.isPending,truncated:b.kind==="at"?!!((R=S.data)!=null&&R.truncated):!1,onPick:L,onHover:p}),u.jsx(b3,{textareaRef:v,text:o,onTextChange:($,U)=>{s($),a(U)},onCaretChange:a,onFocus:()=>f(!0),onBlur:()=>f(!1),onKeyDown:j,disabled:i,placeholder:A}),u.jsx("div",{className:"flex items-center justify-end px-2 pb-2",children:r?u.jsx("button",{type:"button",onClick:n,disabled:i,title:"Stop streaming",className:"inline-flex h-7 w-7 items-center justify-center rounded-full bg-signal-error/[0.12] text-signal-error transition-colors hover:bg-signal-error/[0.18] disabled:opacity-50 ring-brand-focus",children:u.jsx(Mk,{className:"h-3 w-3",fill:"currentColor"})}):u.jsx("button",{type:"button",onClick:T,disabled:i||!o.trim(),title:"Send",className:"inline-flex h-7 w-7 items-center justify-center rounded-full bg-brand text-[hsl(var(--brand-foreground))] transition-colors hover:bg-brand-strong disabled:cursor-not-allowed disabled:bg-border-soft disabled:text-muted-foreground ring-brand-focus",children:u.jsx(Cx,{className:"h-3.5 w-3.5",strokeWidth:2.5})})})]}),u.jsxs("div",{className:"mt-1.5 flex items-center justify-center gap-2 text-[11.5px] text-muted-foreground",children:[u.jsx(Wn,{children:"⏎"}),u.jsx("span",{children:"send"}),u.jsx("span",{className:"text-muted-foreground/50",children:"·"}),u.jsx(Wn,{children:"⇧⏎"}),u.jsx("span",{children:"newline"}),u.jsx("span",{className:"text-muted-foreground/50",children:"·"}),u.jsx(Wn,{children:"/"}),u.jsx("span",{children:"commands"}),u.jsx("span",{className:"text-muted-foreground/50",children:"·"}),u.jsx(Wn,{children:"@"}),u.jsx("span",{children:"files"})]})]})})}const Rh="block max-h-[220px] min-h-[44px] w-full resize-none px-4 pt-3 pb-1 font-sans text-[14px] leading-[1.55] tracking-[-0.005em] whitespace-pre-wrap break-words";function b3({textareaRef:e,text:t,onTextChange:n,onCaretChange:r,onFocus:i,onBlur:o,onKeyDown:s,disabled:l,placeholder:a}){const c=N.useRef(null),[f,d]=N.useState(!1),p=N.useMemo(()=>x3(t),[t]),h=N.useCallback(()=>{const x=e.current;x&&r(x.selectionStart??0)},[e,r]),m=N.useCallback(()=>{const x=e.current,y=c.current;!x||!y||(y.scrollTop=x.scrollTop,y.scrollLeft=x.scrollLeft)},[e,c]);N.useLayoutEffect(()=>{m()},[t,m]);const v=N.useMemo(()=>w3(t,p),[t,p]),g=p.length>0&&!f;return u.jsxs("div",{className:"relative",children:[g&&u.jsxs("div",{ref:c,"aria-hidden":!0,className:V(Rh,"pointer-events-none absolute inset-0 overflow-hidden whitespace-pre-wrap"),children:[v.map((x,y)=>x.kind==="text"?u.jsx("span",{className:"text-foreground",children:x.text},y):u.jsx(S3,{body:x.text},y)),"​"]}),u.jsx("textarea",{ref:e,value:t,onChange:x=>n(x.target.value,x.target.selectionStart??x.target.value.length),onSelect:h,onClick:h,onKeyUp:h,onScroll:m,onCompositionStart:()=>d(!0),onCompositionEnd:()=>d(!1),onFocus:i,onBlur:o,onKeyDown:s,disabled:l,placeholder:a,spellCheck:!1,autoCorrect:"off",rows:1,className:V(Rh,"relative bg-transparent caret-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",g?"text-transparent selection:text-transparent selection:bg-brand/20":"text-foreground")})]})}function w3(e,t){if(t.length===0)return[{kind:"text",text:e}];const n=[];let r=0;for(const i of t)i.start>r&&n.push({kind:"text",text:e.slice(r,i.start)}),n.push({kind:i.kind,text:e.slice(i.start,i.end)}),r=i.end;return r<e.length&&n.push({kind:"text",text:e.slice(r)}),n}function S3({body:e}){return u.jsx("span",{className:"inline rounded-[3px] bg-brand/[0.08] [box-decoration-break:clone] [-webkit-box-decoration-break:clone] text-brand",children:e})}function C3({kind:e,query:t,items:n,selectedIdx:r,loading:i,truncated:o,onPick:s,onHover:l}){const a=N.useRef(null);N.useEffect(()=>{const d=a.current;if(!d)return;const p=d.querySelector(`[data-idx="${r}"]`);p==null||p.scrollIntoView({block:"nearest"})},[r]);const c=e==="slash"?"Commands":"Files",f=t?`"${t}"`:"";return u.jsxs("div",{className:"absolute bottom-full left-0 right-0 z-30 mb-2 overflow-hidden rounded-[10px] border border-border bg-popover shadow-panel",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-border-soft bg-muted px-3 py-2 text-[11.5px] text-muted-foreground",children:[u.jsxs("span",{children:[u.jsx("span",{className:"font-medium text-foreground",children:c}),f&&u.jsx("span",{className:"ml-1.5 font-mono text-muted-foreground",children:f})]}),u.jsx("span",{className:"font-mono text-[10.5px] tabular-nums",children:i?"…":`${n.length}${o?"+":""}`})]}),u.jsx("div",{ref:a,className:"max-h-64 overflow-y-auto py-1",children:n.map((d,p)=>{const h=p===r;return u.jsxs("button",{type:"button","data-idx":p,onMouseDown:m=>{m.preventDefault(),s(d)},onMouseEnter:()=>l(p),className:V("flex w-full flex-col gap-0.5 px-3 py-1.5 text-left text-[12.5px] transition-colors",h?"bg-brand/[0.08] text-foreground":"hover:bg-accent/60"),children:[u.jsx("span",{className:"truncate font-mono text-foreground",children:d.label}),d.description&&u.jsx("span",{className:V("truncate text-[11px]",h?"text-brand-strong":"text-muted-foreground"),children:d.description})]},d.key)})}),u.jsxs("div",{className:"flex items-center gap-2 border-t border-border-soft bg-muted px-3 py-1.5 text-[11px] text-muted-foreground",children:[u.jsx(Wn,{children:"↑↓"}),"nav",u.jsx(Wn,{children:"⏎"}),"insert",u.jsx(Wn,{children:"Esc"}),"dismiss"]})]})}const Vi=["model-configs"];function j3(){return nn({queryKey:Vi,queryFn:()=>ce("/api/model-configs")})}function E3(e){const t=Pe(),n=e?`?workspaceId=${encodeURIComponent(e)}`:"";return Oe({mutationFn:r=>ce(`/api/model-configs/providers${n}`,{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{t.invalidateQueries({queryKey:Vi}),t.invalidateQueries({queryKey:["config"]})}})}function N3(e){const t=Pe(),n=e?`?workspaceId=${encodeURIComponent(e)}`:"";return Oe({mutationFn:r=>ce(`/api/model-configs/providers?name=${encodeURIComponent(r)}${n?"&"+n.slice(1):""}`,{method:"DELETE"}),onSuccess:()=>{t.invalidateQueries({queryKey:Vi}),t.invalidateQueries({queryKey:["config"]})}})}function P3(e){const t=Pe(),n=e?`?workspaceId=${encodeURIComponent(e)}`:"";return Oe({mutationFn:({provider:r,model:i})=>ce(`/api/model-configs/providers/${encodeURIComponent(r)}/models${n}`,{method:"POST",body:JSON.stringify({model:i})}),onSuccess:()=>{t.invalidateQueries({queryKey:Vi}),t.invalidateQueries({queryKey:["config"]})}})}function T3(e){const t=Pe(),n=e?`?workspaceId=${encodeURIComponent(e)}`:"";return Oe({mutationFn:({provider:r,modelId:i,model:o})=>ce(`/api/model-configs/providers/${encodeURIComponent(r)}/models/${encodeURIComponent(i)}${n}`,{method:"PUT",body:JSON.stringify({model:o})}),onSuccess:()=>{t.invalidateQueries({queryKey:Vi}),t.invalidateQueries({queryKey:["config"]})}})}function I3(e){const t=Pe(),n=e?`?workspaceId=${encodeURIComponent(e)}`:"";return Oe({mutationFn:({provider:r,modelId:i})=>ce(`/api/model-configs/providers/${encodeURIComponent(r)}/models/${encodeURIComponent(i)}${n}`,{method:"DELETE"}),onSuccess:()=>{t.invalidateQueries({queryKey:Vi}),t.invalidateQueries({queryKey:["config"]})}})}const Lh=["anthropic-messages","openai-completions","openai-responses","azure-openai-responses","openai-codex-responses","mistral-conversations","bedrock-converse-stream","google-generative-ai","google-vertex"];function _3({workspaceId:e,open:t,onClose:n}){return t?u.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/50",children:u.jsxs("div",{className:"flex max-h-[85vh] w-[600px] max-w-[90vw] flex-col overflow-hidden rounded-md border border-border bg-card shadow-panel",children:[u.jsx(R3,{onClose:n}),u.jsx(L3,{workspaceId:e})]})}):null}function R3({onClose:e}){return u.jsxs("header",{className:"flex items-center justify-between border-b border-border-soft px-4 py-3",children:[u.jsx("span",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.2em] text-brand",children:"Model Configuration"}),u.jsx("button",{type:"button",onClick:e,className:"rounded-[2px] p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":"Close",children:u.jsx(Ui,{className:"h-4 w-4"})})]})}function L3({workspaceId:e}){const{data:t,isLoading:n,error:r}=j3(),[i,o]=N.useState(null),[s,l]=N.useState(!1),[a,c]=N.useState(null),[f,d]=N.useState(null);if(n)return u.jsxs("div",{className:"flex items-center justify-center py-8",children:[u.jsx(tn,{className:"h-4 w-4 animate-spin text-muted-foreground"}),u.jsx("span",{className:"ml-2 font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:"Loading..."})]});if(r||!t)return u.jsx("p",{className:"m-4 border border-signal-rose/40 bg-signal-rose/10 px-3 py-2 text-center font-mono text-[11px] text-signal-rose",children:(r==null?void 0:r.message)??"Failed to load model config"});const p=t.config.providers;return i?u.jsx(Ah,{workspaceId:e,initialName:i.name,initialConfig:i.config,onDone:()=>o(null)}):s?u.jsx(Ah,{workspaceId:e,initialName:"",initialConfig:null,onDone:()=>l(!1)}):a?u.jsx(zh,{workspaceId:e,provider:a.provider,initialModel:a.model,onDone:()=>c(null)}):f?u.jsx(zh,{workspaceId:e,provider:f,initialModel:null,onDone:()=>d(null)}):u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-border/50 px-4 py-2",children:[u.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:["Providers (",Object.keys(p).length,")"]}),u.jsxs("button",{type:"button",onClick:()=>l(!0),className:"flex items-center gap-1 rounded-[2px] px-2 py-1 font-mono text-[10px] uppercase tracking-[0.12em] text-brand transition-colors hover:bg-brand/10",children:[u.jsx(Wl,{className:"h-3 w-3"})," Add Provider"]})]}),Object.keys(p).length===0&&u.jsx("p",{className:"px-4 py-6 text-center font-mono text-[11px] text-muted-foreground",children:'No providers configured. Click "Add Provider" to get started.'}),Object.entries(p).map(([h,m])=>u.jsx(A3,{name:h,config:m,workspaceId:e,onEditProvider:()=>o({name:h,config:m}),onEditModel:v=>c({provider:h,model:v}),onAddModel:()=>d(h)},h))]})}function A3({name:e,config:t,workspaceId:n,onEditProvider:r,onEditModel:i,onAddModel:o}){const[s,l]=N.useState(!0),a=N3(n),c=I3(n);return u.jsxs("div",{className:"border-b border-border/30",children:[u.jsxs("div",{className:"flex items-center gap-1 px-4 py-2",children:[u.jsx("button",{type:"button",onClick:()=>l(f=>!f),className:"p-0.5 text-muted-foreground hover:text-foreground",children:s?u.jsx(Ur,{className:"h-3 w-3"}):u.jsx(wd,{className:"h-3 w-3"})}),u.jsx("span",{className:"flex-1 font-mono text-[12px] font-semibold text-foreground",children:e}),u.jsx("span",{className:"font-mono text-[9px] uppercase text-muted-foreground",children:t.api}),u.jsx("button",{type:"button",onClick:r,className:"rounded-[2px] p-1 text-muted-foreground hover:bg-muted hover:text-foreground",title:"Edit provider",children:u.jsx(ic,{className:"h-3 w-3"})}),u.jsx("button",{type:"button",onClick:()=>{confirm(`Delete provider "${e}" and all its models?`)&&a.mutate(e)},className:"rounded-[2px] p-1 text-muted-foreground hover:bg-signal-rose/10 hover:text-signal-rose",title:"Delete provider",children:u.jsx(qo,{className:"h-3 w-3"})})]}),s&&u.jsxs("div",{className:"pb-2 pl-8 pr-4",children:[u.jsxs("div",{className:"mb-1 font-mono text-[9px] uppercase tracking-[0.12em] text-muted-foreground",children:["Base URL: ",u.jsx("span",{className:"text-foreground/70",children:t.baseUrl})]}),t.models.length===0&&u.jsx("p",{className:"py-1 font-mono text-[10px] text-muted-foreground",children:"No models."}),t.models.map(f=>u.jsxs("div",{className:"flex items-center gap-2 rounded-[2px] px-2 py-1 transition-colors hover:bg-muted/50",children:[u.jsx("span",{className:"flex-1 font-mono text-[11px] text-foreground",children:f.name}),u.jsx("span",{className:"font-mono text-[9px] text-muted-foreground",children:f.id}),f.reasoning&&u.jsx("span",{className:"rounded-sm bg-brand/10 px-1 py-0.5 font-mono text-[8px] uppercase text-brand",children:"reasoning"}),u.jsx("button",{type:"button",onClick:()=>i(f),className:"rounded-[2px] p-0.5 text-muted-foreground hover:text-foreground",title:"Edit model",children:u.jsx(ic,{className:"h-2.5 w-2.5"})}),u.jsx("button",{type:"button",onClick:()=>{confirm(`Delete model "${f.name}"?`)&&c.mutate({provider:e,modelId:f.id})},className:"rounded-[2px] p-0.5 text-muted-foreground hover:text-signal-rose",title:"Delete model",children:u.jsx(qo,{className:"h-2.5 w-2.5"})})]},f.id)),u.jsxs("button",{type:"button",onClick:o,className:"mt-1 flex items-center gap-1 font-mono text-[10px] text-brand/70 transition-colors hover:text-brand",children:[u.jsx(Wl,{className:"h-2.5 w-2.5"})," Add Model"]})]})]})}function Ah({workspaceId:e,initialName:t,initialConfig:n,onDone:r}){var y;const i=!!n,[o,s]=N.useState(t),[l,a]=N.useState((n==null?void 0:n.baseUrl)??""),[c,f]=N.useState(n!=null&&n.api&&!Lh.includes(n.api)?"__custom__":(n==null?void 0:n.api)??"anthropic-messages"),[d,p]=N.useState(n!=null&&n.api&&!Lh.includes(n.api)?n.api:""),[h,m]=N.useState((n==null?void 0:n.apiKey)??""),[v,b]=N.useState(((y=n==null?void 0:n.compat)==null?void 0:y.forceAdaptiveThinking)===!0),g=E3(e),x=S=>{S.preventDefault();const P=c==="__custom__"?d:c;if(!P){alert("API type is required");return}const E={baseUrl:l,api:P,apiKey:h,...v?{compat:{forceAdaptiveThinking:!0}}:{},models:(n==null?void 0:n.models)??[]};g.mutate({name:o,provider:E},{onSuccess:()=>r()})};return u.jsxs("form",{onSubmit:x,className:"flex flex-1 flex-col overflow-y-auto",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-border/50 px-4 py-2",children:[u.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:i?"Edit Provider":"New Provider"}),u.jsx("button",{type:"button",onClick:r,className:"font-mono text-[10px] text-muted-foreground hover:text-foreground",children:"Cancel"})]}),u.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[u.jsx(Ye,{label:"Name",required:!0,children:u.jsx("input",{value:o,onChange:S=>s(S.target.value),placeholder:"e.g. my-provider",disabled:i,className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40 disabled:opacity-50",required:!0})}),u.jsx(Ye,{label:"Base URL",required:!0,children:u.jsx("input",{value:l,onChange:S=>a(S.target.value),placeholder:"https://api.example.com",className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40",required:!0})}),u.jsxs(Ye,{label:"API Type",required:!0,children:[u.jsxs("select",{value:c,onChange:S=>f(S.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40",children:[u.jsx("option",{value:"anthropic-messages",children:"anthropic-messages"}),u.jsx("option",{value:"openai-completions",children:"openai-completions"}),u.jsx("option",{value:"openai-responses",children:"openai-responses"}),u.jsx("option",{value:"azure-openai-responses",children:"azure-openai-responses"}),u.jsx("option",{value:"openai-codex-responses",children:"openai-codex-responses"}),u.jsx("option",{value:"mistral-conversations",children:"mistral-conversations"}),u.jsx("option",{value:"bedrock-converse-stream",children:"bedrock-converse-stream"}),u.jsx("option",{value:"google-generative-ai",children:"google-generative-ai"}),u.jsx("option",{value:"google-vertex",children:"google-vertex"}),u.jsx("option",{value:"__custom__",children:"Custom..."})]}),c==="__custom__"&&u.jsx("input",{value:d,onChange:S=>p(S.target.value),placeholder:"custom-api-type",className:"mt-1.5 w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40",required:!0})]}),u.jsx(Ye,{label:"API Key",required:!0,children:u.jsx("input",{type:"password",value:h,onChange:S=>m(S.target.value),placeholder:"sk-...",className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40",required:!0})}),u.jsxs("label",{className:"flex items-center gap-2",children:[u.jsx("input",{type:"checkbox",checked:v,onChange:S=>b(S.target.checked),className:"h-3 w-3 accent-[hsl(var(--brand))]"}),u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:"Force Adaptive Thinking"})]})]}),u.jsxs("div",{className:"flex justify-end gap-2 border-t border-border/50 px-4 py-3",children:[u.jsx("button",{type:"button",onClick:r,className:"rounded-[2px] border border-border-soft px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground hover:text-foreground",children:"Cancel"}),u.jsx("button",{type:"submit",disabled:g.isPending,className:"rounded-[2px] bg-brand/10 px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.12em] text-brand hover:bg-brand/20 disabled:opacity-50",children:g.isPending?"Saving...":i?"Update":"Create"})]}),g.isError&&u.jsx("p",{className:"mx-4 mb-3 font-mono text-[10px] text-signal-rose",children:g.error.message})]})}function zh({workspaceId:e,provider:t,initialModel:n,onDone:r}){var oe,M,H,k,K,te;const i=!!n,[o,s]=N.useState((n==null?void 0:n.id)??""),[l,a]=N.useState((n==null?void 0:n.name)??""),[c,f]=N.useState((n==null?void 0:n.reasoning)??!0),[d,p]=N.useState(String((n==null?void 0:n.contextWindow)??2e5)),[h,m]=N.useState(String((n==null?void 0:n.maxTokens)??32e3)),[v,b]=N.useState(String(((oe=n==null?void 0:n.cost)==null?void 0:oe.input)??0)),[g,x]=N.useState(String(((M=n==null?void 0:n.cost)==null?void 0:M.output)??0)),[y,S]=N.useState(String(((H=n==null?void 0:n.cost)==null?void 0:H.cacheRead)??0)),[P,E]=N.useState(String(((k=n==null?void 0:n.cost)==null?void 0:k.cacheWrite)??0)),[I,T]=N.useState(((K=n==null?void 0:n.thinkingLevelMap)==null?void 0:K.high)??"high"),[L,j]=N.useState(((te=n==null?void 0:n.thinkingLevelMap)==null?void 0:te.xhigh)??"max"),[A,R]=N.useState(n!=null&&n.headers?JSON.stringify(n.headers,null,2):""),$=P3(e),U=T3(e),q=i?U:$,le=w=>{w.preventDefault();let ke;if(A.trim())try{ke=JSON.parse(A)}catch{alert("Headers must be valid JSON");return}const rt={id:o,name:l,reasoning:c,input:["text"],contextWindow:Number(d),maxTokens:Number(h),cost:{input:Number(v),output:Number(g),cacheRead:Number(y),cacheWrite:Number(P)},...c?{thinkingLevelMap:{high:I,xhigh:L}}:{},...ke?{headers:ke}:{}};i?U.mutate({provider:t,modelId:n.id,model:rt},{onSuccess:()=>r()}):$.mutate({provider:t,model:rt},{onSuccess:()=>r()})};return u.jsxs("form",{onSubmit:le,className:"flex flex-1 flex-col overflow-y-auto",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-border/50 px-4 py-2",children:[u.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:[i?"Edit Model":"New Model"," · ",t]}),u.jsx("button",{type:"button",onClick:r,className:"font-mono text-[10px] text-muted-foreground hover:text-foreground",children:"Cancel"})]}),u.jsxs("div",{className:"flex flex-col gap-3 overflow-y-auto p-4",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(Ye,{label:"Model ID",required:!0,children:u.jsx("input",{value:o,onChange:w=>s(w.target.value),placeholder:"claude-opus-4-7",disabled:i,className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40 disabled:opacity-50",required:!0})}),u.jsx(Ye,{label:"Display Name",required:!0,children:u.jsx("input",{value:l,onChange:w=>a(w.target.value),placeholder:"Claude Opus 4.7",className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40",required:!0})})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(Ye,{label:"Context Window",children:u.jsx("input",{type:"number",value:d,onChange:w=>p(w.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})}),u.jsx(Ye,{label:"Max Tokens",children:u.jsx("input",{type:"number",value:h,onChange:w=>m(w.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})})]}),u.jsxs("label",{className:"flex items-center gap-2",children:[u.jsx("input",{type:"checkbox",checked:c,onChange:w=>f(w.target.checked),className:"h-3 w-3 accent-[hsl(var(--brand))]"}),u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:"Supports Reasoning"})]}),c&&u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(Ye,{label:"Thinking High maps to",children:u.jsx("input",{value:I,onChange:w=>T(w.target.value),placeholder:"high",className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})}),u.jsx(Ye,{label:"Thinking XHigh maps to",children:u.jsx("input",{value:L,onChange:w=>j(w.target.value),placeholder:"max",className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})})]}),u.jsxs("fieldset",{className:"rounded-[2px] border border-border/50 p-3",children:[u.jsx("legend",{className:"px-1 font-mono text-[9px] uppercase tracking-[0.16em] text-muted-foreground",children:"Cost (per million tokens)"}),u.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[u.jsx(Ye,{label:"Input",children:u.jsx("input",{type:"number",step:"0.01",value:v,onChange:w=>b(w.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})}),u.jsx(Ye,{label:"Output",children:u.jsx("input",{type:"number",step:"0.01",value:g,onChange:w=>x(w.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})}),u.jsx(Ye,{label:"Cache Read",children:u.jsx("input",{type:"number",step:"0.01",value:y,onChange:w=>S(w.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})}),u.jsx(Ye,{label:"Cache Write",children:u.jsx("input",{type:"number",step:"0.01",value:P,onChange:w=>E(w.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})})]})]}),u.jsx(Ye,{label:"Custom Headers (JSON)",children:u.jsx("textarea",{value:A,onChange:w=>R(w.target.value),placeholder:'{"User-Agent": "..."}',rows:3,className:"w-full resize-none rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})})]}),u.jsxs("div",{className:"flex justify-end gap-2 border-t border-border/50 px-4 py-3",children:[u.jsx("button",{type:"button",onClick:r,className:"rounded-[2px] border border-border-soft px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground hover:text-foreground",children:"Cancel"}),u.jsx("button",{type:"submit",disabled:q.isPending,className:"rounded-[2px] bg-brand/10 px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.12em] text-brand hover:bg-brand/20 disabled:opacity-50",children:q.isPending?"Saving...":i?"Update":"Create"})]}),q.isError&&u.jsx("p",{className:"mx-4 mb-3 font-mono text-[10px] text-signal-rose",children:q.error.message})]})}function Ye({label:e,required:t,children:n}){return u.jsxs("div",{children:[u.jsxs("label",{className:"mb-1 block font-mono text-[9px] uppercase tracking-[0.16em] text-muted-foreground",children:[e,t&&u.jsx("span",{className:"text-signal-rose",children:" *"})]}),n]})}function z3({workspaceId:e,open:t,onClose:n}){return t?u.jsxs("aside",{className:"flex h-full w-[320px] shrink-0 flex-col border-l border-border bg-popover",children:[u.jsx(F3,{onClose:n}),u.jsx("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-4",children:u.jsx(M3,{workspaceId:e})})]}):null}function F3({onClose:e}){return u.jsxs("header",{className:"flex h-[44px] items-center justify-between border-b border-border-soft px-4",children:[u.jsx("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Configuration"}),u.jsx(Wo,{onClick:e,title:"Close","aria-label":"Close config panel",children:u.jsx(Ui,{className:"h-3.5 w-3.5"})})]})}function M3({workspaceId:e}){const t=Re(s=>s.sessionPath),n=Re(s=>s.running),{data:r,isLoading:i,error:o}=wx(e,t);return i?u.jsxs("div",{className:"flex items-center justify-center py-8 text-[12px] text-muted-foreground",children:[u.jsx(tn,{className:"h-3.5 w-3.5 animate-spin"}),u.jsx("span",{className:"ml-2",children:"Loading config…"})]}):o||!r?u.jsx("p",{className:"rounded-md border border-signal-error/[0.30] bg-signal-error/[0.08] px-3 py-2 text-center text-[12px] text-signal-error",children:(o==null?void 0:o.message)??"Failed to load config"}):u.jsxs(u.Fragment,{children:[n&&u.jsx("p",{className:"rounded-md border border-brand/[0.22] bg-brand/[0.08] px-3 py-1.5 text-center text-[11.5px] text-brand",children:"Read-only · agent running"}),u.jsx(O3,{workspaceId:e,currentModel:r.currentModel,availableModels:r.availableModels,disabled:n}),u.jsx(U3,{workspaceId:e,level:r.thinkingLevel,availableLevels:r.availableThinkingLevels,disabled:n}),u.jsx(H3,{workspaceId:e,activeTools:r.activeTools,allTools:r.allTools,disabled:n})]})}function O3({workspaceId:e,currentModel:t,availableModels:n,disabled:r}){const i=Sk(e),[o,s]=N.useState(!1),l=t?`${t.provider}/${t.modelId}`:"";return u.jsxs("section",{children:[u.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[u.jsx(Pl,{children:"Model"}),u.jsxs("button",{type:"button",onClick:()=>s(!0),className:"inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[11.5px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",title:"Manage model configurations",children:[u.jsx(Px,{className:"h-3 w-3"})," Manage"]})]}),u.jsx(D3,{currentKey:l,availableModels:n,disabled:r||i.isPending,onSelect:(a,c)=>i.mutate({provider:a,modelId:c})}),i.isError&&u.jsx("p",{className:"mt-1.5 text-[11.5px] text-signal-error",children:i.error.message}),u.jsx(_3,{workspaceId:e,open:o,onClose:()=>s(!1)})]})}function D3({currentKey:e,availableModels:t,disabled:n,onSelect:r}){const[i,o]=N.useState(!1),s=N.useRef(null),l=N.useRef(null),a=N.useRef(null),c=N.useRef(null),f=N.useRef(!1);N.useEffect(()=>{if(!i)return;const m=b=>{s.current&&!s.current.contains(b.target)&&o(!1)},v=b=>{var g,x;if(b.key==="Escape"){b.preventDefault(),f.current=!0,o(!1);return}if(b.key==="Tab"){(g=l.current)==null||g.focus(),o(!1);return}if(b.key==="ArrowDown"||b.key==="ArrowUp"||b.key==="Home"||b.key==="End"){const y=a.current;if(!y)return;const S=Array.from(y.querySelectorAll('[role="option"]'));if(S.length===0)return;b.preventDefault();const P=S.indexOf(document.activeElement),E=b.key==="ArrowDown"?P<0?0:Math.min(P+1,S.length-1):b.key==="ArrowUp"?P<0?S.length-1:Math.max(P-1,0):b.key==="Home"?0:S.length-1;(x=S[E])==null||x.focus()}};return document.addEventListener("mousedown",m),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",v)}},[i]),N.useLayoutEffect(()=>{var m,v;if(i){const b=c.current??((m=a.current)==null?void 0:m.querySelector('[role="option"]'));b==null||b.scrollIntoView({block:"nearest"}),b==null||b.focus({preventScroll:!0})}else f.current&&(f.current=!1,(v=l.current)==null||v.focus())},[i]);const d=t.find(m=>`${m.provider}/${m.modelId}`===e),p=(d==null?void 0:d.name)??"Select model",h=(d==null?void 0:d.modelId)??p;return u.jsxs("div",{ref:s,className:"relative",children:[u.jsxs("button",{ref:l,type:"button",onClick:()=>o(m=>!m),disabled:n,"aria-label":"Model","aria-haspopup":"listbox","aria-expanded":i,title:h,className:V("flex w-full items-center gap-1.5 rounded-md border bg-card px-3 py-2 text-[12.5px] text-foreground outline-none ring-brand-focus transition-colors","disabled:cursor-not-allowed disabled:opacity-50",i?"border-brand/[0.30]":"border-border hover:border-border-hi"),children:[u.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:p}),u.jsx(Ur,{className:V("h-3 w-3 shrink-0 text-muted-foreground transition-transform",i&&"rotate-180")})]}),i&&u.jsxs("div",{ref:a,role:"listbox","aria-label":"Available models",className:"absolute left-0 right-0 top-full z-50 mt-1.5 overflow-hidden rounded-md border border-border bg-popover shadow-panel",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-border-soft bg-muted px-3 py-2 text-[11.5px] text-muted-foreground",children:[u.jsx("span",{className:"font-medium text-foreground",children:"Available models"}),t.length>0&&u.jsx("span",{className:"font-mono tabular-nums",children:t.length})]}),u.jsxs("div",{className:"max-h-72 overflow-y-auto py-1",children:[t.length===0&&u.jsx("div",{className:"px-3 py-3 text-[12px] text-muted-foreground",children:"No models available."}),t.map(m=>{const v=`${m.provider}/${m.modelId}`,b=v===e;return u.jsxs("button",{ref:b?c:void 0,type:"button",role:"option","aria-selected":b,onClick:()=>{f.current=!0,o(!1),b||r(m.provider,m.modelId)},title:`${m.provider}/${m.modelId}`,className:V("flex w-full items-start gap-2 px-3 py-1.5 text-left text-[12.5px] transition-colors ring-brand-focus focus:bg-accent/60 focus:outline-none",b?"bg-brand/[0.08] text-brand-strong":"text-foreground hover:bg-accent/60"),children:[u.jsx(Vl,{className:V("mt-0.5 h-3 w-3 shrink-0",b?"opacity-100":"opacity-0")}),u.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[u.jsx("span",{className:"truncate",children:m.name}),u.jsxs("span",{className:V("truncate font-mono text-[11px]",b?"text-brand":"text-muted-foreground"),children:[m.provider,"/",m.modelId]})]})]},v)})]})]})]})}const $3={off:"Off",minimal:"Min",low:"Low",medium:"Med",high:"High",xhigh:"Max"},B3={off:"Off",minimal:"Minimal",low:"Low",medium:"Medium",high:"High",xhigh:"Extra high"};function U3({workspaceId:e,level:t,availableLevels:n,disabled:r}){const i=Ck(e);return n.length===0?u.jsxs("section",{children:[u.jsx(Pl,{children:"Thinking"}),u.jsx("p",{className:"text-[12px] text-muted-foreground",children:"Model has no thinking support."})]}):u.jsxs("section",{children:[u.jsx(Pl,{children:"Thinking"}),u.jsx("div",{className:"flex gap-0.5 rounded-md border border-border bg-card p-1",children:n.map(o=>u.jsx("button",{type:"button",onClick:()=>i.mutate({level:o}),disabled:r||i.isPending,title:B3[o]??o,className:V("min-w-0 flex-1 truncate rounded-[6px] px-1.5 py-1.5 text-[12px] font-medium transition-colors ring-brand-focus",o===t?"bg-brand/[0.08] text-brand-strong":"text-muted-foreground hover:text-foreground",(r||i.isPending)&&"opacity-50"),children:$3[o]??o},o))}),i.isError&&u.jsx("p",{className:"mt-1.5 text-[11.5px] text-signal-error",children:i.error.message})]})}function H3({workspaceId:e,activeTools:t,allTools:n,disabled:r}){const i=jk(e),o=new Set(t),s=(l,a)=>{const c=a?[...t,l]:t.filter(f=>f!==l);i.mutate({tools:c})};return u.jsxs("section",{children:[u.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[u.jsx(Pl,{children:"Tools"}),u.jsx(rr,{tone:"ghost",children:u.jsxs("span",{className:"font-mono text-[10.5px] tabular-nums",children:[t.length,"/",n.length]})})]}),u.jsx("ul",{className:"flex flex-col gap-1.5",children:n.map(l=>u.jsx("li",{children:u.jsxs("label",{className:V("flex cursor-pointer items-start gap-2.5 rounded-md border border-border-soft bg-card px-3 py-2 transition-colors hover:border-border",o.has(l.name)&&"border-brand/[0.22] bg-brand/[0.04]",(r||i.isPending)&&"pointer-events-none opacity-50"),children:[u.jsx("input",{type:"checkbox",checked:o.has(l.name),onChange:a=>s(l.name,a.target.checked),disabled:r||i.isPending,className:"mt-[3px] h-3 w-3 shrink-0 accent-[hsl(var(--brand))]"}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block font-mono text-[12px] text-foreground",children:l.name}),l.description&&u.jsx("span",{className:"mt-0.5 block truncate text-[11.5px] text-muted-foreground",children:l.description})]})]})},l.name))}),i.isError&&u.jsx("p",{className:"mt-1.5 text-[11.5px] text-signal-error",children:i.error.message})]})}function Pl({children:e}){return u.jsx("h3",{className:"mb-1.5 text-[11.5px] font-medium text-muted-foreground",children:e})}let q3=0,Q3=0;function V3(e){const t=Dr(n=>n.pushToast);N.useEffect(()=>ot.on(r=>{if(r.type!=="error")return;const i=r.command?`${r.command}: ${r.message}`:r.message;t({id:`wserr-${++q3}`,workspaceId:e??"",message:i,notifyType:"error"})}),[t,e])}function W3(){const e=Dr(t=>t.pushToast);N.useEffect(()=>ot.on(n=>{if(n.type!=="extension_error")return;const r=G3(n.extensionPath);e({id:`exterr-${++Q3}`,workspaceId:n.workspaceId,message:`${r}: ${n.event}: ${n.message}`,notifyType:"error"})}),[e])}function K3(e){const t=Dr(n=>n.pushToast);N.useEffect(()=>{},[t,e])}function G3(e){if(!e)return"extension";const t=e.replace(/\/+$/,""),n=t.split("/"),r=n.at(-1)||t;return/^(index|extension)\.(ts|js|mjs|cjs)$/.test(r)&&n.length>=2?n[n.length-2]:r.replace(/\.(ts|js|mjs|cjs)$/,"")}function Y3(){const e=Dr(n=>n.toasts),t=Dr(n=>n.dismissToast);return u.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-40 flex w-72 flex-col gap-2",children:e.map(n=>u.jsx(X3,{toast:n,onClose:()=>t(n.id)},n.id))})}function X3({toast:e,onClose:t}){N.useEffect(()=>{const i=e.notifyType==="error"?8e3:4e3,o=setTimeout(t,i);return()=>clearTimeout(o)},[t,e.notifyType]);const n=e.notifyType==="error"||e.notifyType==="warning"?Cp:e.notifyType==="info"?Ak:_k,r=e.notifyType==="error"?"border-l-signal-error text-signal-error":e.notifyType==="warning"?"border-l-signal-warn text-signal-warn":"border-l-brand text-foreground";return u.jsxs("div",{className:V("pointer-events-auto flex items-start gap-2 rounded-[10px] border border-border bg-card p-3 text-[12.5px] shadow-glow-lg","border-l-[3px]",r),children:[u.jsx(n,{className:V("mt-0.5 h-3.5 w-3.5 shrink-0",e.notifyType==="info"&&"text-brand")}),u.jsx("div",{className:"flex-1 whitespace-pre-wrap break-words text-foreground",children:e.message}),u.jsx("button",{type:"button",onClick:t,className:"text-muted-foreground transition-colors hover:text-foreground","aria-label":"Dismiss",children:u.jsx(Ui,{className:"h-3 w-3"})})]})}function J3({workspaceId:e,request:t,onClose:n}){return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onMouseDown:r=>{r.target===r.currentTarget&&n()},children:u.jsxs("div",{className:"flex h-full max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-lg border border-border bg-card shadow-xl",children:[u.jsx(Z3,{kind:t.kind,mode:t.mode,onClose:n}),t.mode==="create"?u.jsx(eP,{workspaceId:e,kind:t.kind,defaultScope:t.defaultScope,onDone:n}):u.jsx(tP,{workspaceId:e,kind:t.kind,filePath:t.filePath,onDone:n})]})})}function Z3({kind:e,mode:t,onClose:n}){const r=t==="create"?e==="skill"?"New skill":"New prompt template":e==="skill"?"Edit skill":"Edit prompt template";return u.jsxs("header",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[u.jsx("h2",{className:"text-sm font-semibold text-foreground",children:r}),u.jsx("button",{type:"button",onClick:n,className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-label":"Close editor",children:u.jsx(Ui,{className:"h-4 w-4"})})]})}function eP({workspaceId:e,kind:t,defaultScope:n,onDone:r}){var E,I;const[i,o]=N.useState(n),[s,l]=N.useState(""),[a,c]=N.useState(""),[f,d]=N.useState(""),[p,h]=N.useState(!1),[m,v]=N.useState(t==="skill"?nP:""),b=Uk(e),g=Vk(e),x=b.isPending||g.isPending,y=((E=b.error)==null?void 0:E.message)??((I=g.error)==null?void 0:I.message),S=async()=>{try{t==="skill"?await b.mutateAsync({scope:i,name:s.trim(),description:a.trim(),body:m,disableModelInvocation:p||void 0}):await g.mutateAsync({scope:i,name:s.trim(),description:a.trim(),argumentHint:f.trim()||void 0,body:m}),r()}catch{}},P=!x&&s.trim().length>0&&a.trim().length>0&&m.length>0;return u.jsx(Wy,{kind:t,scope:i,onScopeChange:o,scopeLocked:!1,name:s,onNameChange:l,description:a,onDescriptionChange:c,argumentHint:f,onArgumentHintChange:d,disableModelInvocation:p,onDisableModelInvocationChange:h,body:m,onBodyChange:v,submitLabel:"Create",canSubmit:P,pending:x,error:y,onSubmit:S,onCancel:r})}function tP({workspaceId:e,kind:t,filePath:n,onDone:r}){var R,$,U;const i=Bk(e,t==="skill"?n:void 0),o=Qk(e,t==="prompt"?n:void 0),s=t==="skill"?i.data:o.data,l=(R=t==="skill"?i.error:o.error)==null?void 0:R.message,a=t==="skill"?i.isLoading:o.isLoading,[c,f]=N.useState(!1),[d]=N.useState(void 0),[p,h]=N.useState(""),[m,v]=N.useState(""),[b,g]=N.useState(""),[x,y]=N.useState(!1),[S,P]=N.useState("");N.useEffect(()=>{!s||c||(h(s.name),v(s.description),g(s.argumentHint??""),y(!!s.disableModelInvocation),P(s.body),f(!0))},[s,c]);const E=Hk(e),I=Wk(e),T=E.isPending||I.isPending,L=(($=E.error)==null?void 0:$.message)??((U=I.error)==null?void 0:U.message),j=async()=>{try{t==="skill"?await E.mutateAsync({filePath:n,name:p.trim(),description:m.trim(),body:S,disableModelInvocation:x||void 0}):await I.mutateAsync({filePath:n,name:p.trim(),description:m.trim(),argumentHint:b.trim()||void 0,body:S}),r()}catch{}};if(a)return u.jsxs("div",{className:"flex flex-1 items-center justify-center text-muted-foreground",children:[u.jsx(tn,{className:"h-4 w-4 animate-spin"}),u.jsx("span",{className:"ml-2 text-xs",children:"Loading file\\u2026"})]});if(l||!s)return u.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-4 text-xs text-signal-rose",children:[u.jsx("p",{children:l??"Failed to load file"}),u.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-input bg-background px-3 py-1.5 text-foreground",children:"Close"})]});const A=c&&!T&&p.trim().length>0&&m.trim().length>0&&S.length>0;return u.jsx(Wy,{kind:t,scope:d??s.scope,onScopeChange:()=>{},scopeLocked:!0,scopeLockedReason:"Move the file on disk to change scope.",name:p,onNameChange:h,description:m,onDescriptionChange:v,argumentHint:b,onArgumentHintChange:g,disableModelInvocation:x,onDisableModelInvocationChange:y,body:S,onBodyChange:P,filePath:s.filePath,submitLabel:"Save",canSubmit:A,pending:T,error:L,onSubmit:j,onCancel:r})}function Wy(e){return u.jsxs("form",{className:"flex min-h-0 flex-1 flex-col",onSubmit:t=>{t.preventDefault(),e.canSubmit&&e.onSubmit()},children:[u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-4",children:[e.filePath&&u.jsx("p",{className:"truncate font-mono text-[10px] text-muted-foreground",title:e.filePath,children:e.filePath}),u.jsxs(Gr,{label:"Scope",children:[u.jsxs("div",{className:"flex gap-1",children:[u.jsx(Fh,{active:e.scope==="project",onClick:()=>e.onScopeChange("project"),disabled:e.scopeLocked,children:"Project"}),u.jsx(Fh,{active:e.scope==="user",onClick:()=>e.onScopeChange("user"),disabled:e.scopeLocked,children:"User"})]}),u.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:e.scopeLocked?e.scopeLockedReason??"Scope is fixed for existing files.":e.scope==="project"?`Lives in <workspace>/.pi/${e.kind==="skill"?"skills":"prompts"}/`:`Lives in ~/.pi/agent/${e.kind==="skill"?"skills":"prompts"}/`})]}),u.jsxs(Gr,{label:e.kind==="skill"?"Name":"Name (becomes /name)",children:[u.jsx("input",{type:"text",value:e.name,onChange:t=>e.onNameChange(t.target.value),placeholder:e.kind==="skill"?"pdf-tools":"review-pr",className:"w-full rounded-md border border-input bg-background px-3 py-1.5 text-sm font-mono outline-none focus:ring-1 focus:ring-ring"}),u.jsxs("p",{className:"mt-1 text-[11px] text-muted-foreground",children:["Lowercase a-z, 0-9, hyphens",e.kind==="prompt"?" or underscores":"","; 1\\u201364 chars."]})]}),u.jsx(Gr,{label:"Description",children:u.jsx("textarea",{value:e.description,onChange:t=>e.onDescriptionChange(t.target.value),rows:2,placeholder:e.kind==="skill"?"What this skill does and when to use it. Be specific.":"What this prompt template does.",className:"w-full resize-y rounded-md border border-input bg-background px-3 py-1.5 text-sm outline-none focus:ring-1 focus:ring-ring"})}),e.kind==="skill"?u.jsx(Gr,{label:"",children:u.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-xs",children:[u.jsx("input",{type:"checkbox",checked:e.disableModelInvocation,onChange:t=>e.onDisableModelInvocationChange(t.target.checked),className:"mt-0.5 accent-primary"}),u.jsxs("span",{children:[u.jsx("span",{className:"font-medium text-foreground",children:"Manual invocation only"}),u.jsxs("span",{className:"block text-muted-foreground",children:["Hide from the system prompt. Users must explicitly run /skill:",e.name||"name","."]})]})]})}):u.jsxs(Gr,{label:"Argument hint (optional)",children:[u.jsx("input",{type:"text",value:e.argumentHint,onChange:t=>e.onArgumentHintChange(t.target.value),placeholder:"<file> [--flag]",className:"w-full rounded-md border border-input bg-background px-3 py-1.5 text-sm font-mono outline-none focus:ring-1 focus:ring-ring"}),u.jsxs("p",{className:"mt-1 text-[11px] text-muted-foreground",children:["Shown in autocomplete, e.g. ",u.jsx("code",{className:"font-mono",children:"<PR-URL>"}),"."]})]}),u.jsxs(Gr,{label:"Body (markdown)",children:[u.jsx("textarea",{value:e.body,onChange:t=>e.onBodyChange(t.target.value),rows:14,spellCheck:!1,className:"w-full resize-y rounded-md border border-input bg-background px-3 py-1.5 font-mono text-xs outline-none focus:ring-1 focus:ring-ring"}),e.kind==="prompt"&&u.jsxs("p",{className:"mt-1 text-[11px] text-muted-foreground",children:["Use ",u.jsx("code",{className:"font-mono",children:"$1"}),", ",u.jsx("code",{className:"font-mono",children:"$2"}),", ",u.jsx("code",{className:"font-mono",children:"$@"}),", ",u.jsxs("code",{className:"font-mono",children:["$","{@:N}"]}),", ",u.jsxs("code",{className:"font-mono",children:["$","{@:N:L}"]})," for arguments."]})]}),e.error&&u.jsx("p",{className:"rounded-md border border-signal-rose/40 bg-signal-rose/10 px-3 py-1.5 text-xs text-signal-rose",children:e.error})]}),u.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-border px-4 py-2",children:[u.jsx("button",{type:"button",onClick:e.onCancel,disabled:e.pending,className:"rounded-md border border-input bg-background px-3 py-1.5 text-sm text-foreground hover:bg-accent disabled:opacity-50",children:"Cancel"}),u.jsxs("button",{type:"submit",disabled:!e.canSubmit,className:"inline-flex items-center gap-1 rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground disabled:opacity-50",children:[e.pending&&u.jsx(tn,{className:"h-3.5 w-3.5 animate-spin"}),e.submitLabel]})]})]})}function Gr({label:e,children:t}){return u.jsxs("div",{children:[e&&u.jsx("label",{className:"mb-1 block text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e}),t]})}function Fh({active:e,disabled:t,onClick:n,children:r}){return u.jsx("button",{type:"button",onClick:n,disabled:t,className:V("rounded-md border px-3 py-1 text-xs transition-colors",e?"border-primary bg-primary text-primary-foreground":"border-input bg-background text-foreground hover:bg-accent",t&&"cursor-not-allowed opacity-60 hover:bg-background"),children:r})}const nP=`# Skill name
206
-
207
- Describe what the skill does, when to use it, and any setup steps.
208
-
209
- ## Usage
210
-
211
- \`\`\`bash
212
- ./scripts/example.sh <input>
213
- \`\`\`
214
- `;function rP({workspaceId:e,open:t,onClose:n}){return t?u.jsx("aside",{className:"flex h-full w-[320px] shrink-0 flex-col border-l border-border bg-popover",children:u.jsx(iP,{workspaceId:e,onClose:n})}):null}function iP({workspaceId:e,onClose:t}){const{data:n,isLoading:r,error:i}=Tx(e),o=$k(e),[s,l]=N.useState("skills"),[a,c]=N.useState(null),f=m=>c({kind:m,mode:"create",defaultScope:"project"}),d=(m,v)=>c({kind:m,mode:"edit",filePath:v}),p={skills:(n==null?void 0:n.skills.length)??0,prompts:(n==null?void 0:n.prompts.length)??0,extensions:(n==null?void 0:n.extensions.length)??0},h=p.skills+p.prompts+p.extensions;return r?u.jsxs(u.Fragment,{children:[u.jsx(Ya,{total:0,onReload:()=>o.mutate(),reloading:o.isPending,onClose:t}),u.jsxs("div",{className:"flex flex-1 items-center justify-center text-[12px] text-muted-foreground",children:[u.jsx(tn,{className:"h-3.5 w-3.5 animate-spin"}),u.jsx("span",{className:"ml-2",children:"Loading resources…"})]})]}):i||!n?u.jsxs(u.Fragment,{children:[u.jsx(Ya,{total:0,onReload:()=>o.mutate(),reloading:o.isPending,onClose:t}),u.jsx("p",{className:"px-4 py-4 text-center text-[12.5px] text-signal-error",children:(i==null?void 0:i.message)??"Failed to load resources"})]}):u.jsxs(u.Fragment,{children:[u.jsx(Ya,{total:h,onReload:()=>o.mutate(),reloading:o.isPending,onClose:t}),o.isError&&u.jsx("p",{className:"border-b border-signal-error/[0.30] bg-signal-error/[0.08] px-4 py-1.5 text-[11.5px] text-signal-error",children:o.error.message}),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex gap-1 border-b border-border-soft px-3 pb-1 pt-2",children:[u.jsx(Xa,{active:s==="skills",onClick:()=>l("skills"),label:"Skills",count:p.skills}),u.jsx(Xa,{active:s==="prompts",onClick:()=>l("prompts"),label:"Prompts",count:p.prompts}),u.jsx(Xa,{active:s==="extensions",onClick:()=>l("extensions"),label:"Extensions",count:p.extensions})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[s==="skills"&&u.jsx(oP,{workspaceId:e,skills:n.skills,onNew:()=>f("skill"),onEdit:m=>d("skill",m.filePath)}),s==="prompts"&&u.jsx(sP,{workspaceId:e,prompts:n.prompts,onNew:()=>f("prompt"),onEdit:m=>d("prompt",m.filePath)}),s==="extensions"&&u.jsx(lP,{extensionsEnabled:n.extensionsEnabled,extensions:n.extensions,errors:n.extensionErrors,disabledExtensions:n.disabledExtensions})]})]}),a&&u.jsx(J3,{workspaceId:e,request:a,onClose:()=>c(null)})]})}function Ya({total:e,onReload:t,reloading:n,onClose:r}){return u.jsxs("header",{className:"flex h-[44px] items-center gap-1 border-b border-border-soft px-4",children:[u.jsxs("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:["Resources",e>0&&u.jsx("span",{className:"ml-1.5 text-muted-foreground/60",children:e})]}),u.jsx("span",{className:"flex-1"}),u.jsx(Wo,{onClick:t,disabled:n,title:"Reload resources","aria-label":"Reload resources",children:u.jsx(zk,{className:V("h-3.5 w-3.5",n&&"animate-spin")})}),u.jsx(Wo,{onClick:r,title:"Close","aria-label":"Close resources panel",children:u.jsx(Ui,{className:"h-3.5 w-3.5"})})]})}function Xa({active:e,onClick:t,label:n,count:r}){return u.jsxs("button",{type:"button",onClick:t,className:V("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors ring-brand-focus",e?"bg-brand/[0.08] text-brand-strong":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:[u.jsx("span",{children:n}),u.jsx("span",{className:"font-mono text-[10.5px] tabular-nums opacity-70",children:r})]})}function oP({workspaceId:e,skills:t,onNew:n,onEdit:r}){const i=qk(e),o=s=>{confirm(`Delete skill "${s.name}"?
215
-
216
- This removes ${s.filePath} and any sibling files in its directory.`)&&i.mutate({filePath:s.filePath})};return u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx(Ky,{label:"New skill",onClick:n}),i.isError&&u.jsx("p",{className:"rounded-md border border-signal-error/[0.30] bg-signal-error/[0.08] px-2.5 py-1.5 text-[11.5px] text-signal-error",children:i.error.message}),t.length===0?u.jsx(Xy,{text:"No skills discovered."}):u.jsx("ul",{className:"flex flex-col gap-2",children:t.map(s=>{var l;return u.jsxs("li",{className:"rounded-[10px] border border-border-soft bg-card px-3 py-2.5 transition-colors hover:border-border",children:[u.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[u.jsx("span",{className:"truncate text-[13px] font-medium text-foreground",children:s.name}),u.jsx(Gd,{source:s.source})]}),s.description&&u.jsx("p",{className:"mt-1 text-[12px] text-muted-foreground",children:s.description}),s.disableModelInvocation&&u.jsxs("p",{className:"mt-1 text-[11.5px] italic text-muted-foreground",children:["Manual invocation only (/skill:",s.name,")"]}),u.jsx(Yd,{path:s.filePath}),s.managed?u.jsx(Yy,{onEdit:()=>r(s),onDelete:()=>o(s),deleting:i.isPending&&((l=i.variables)==null?void 0:l.filePath)===s.filePath}):u.jsx(Gy,{kind:"skill",source:s.source})]},s.filePath)})})]})}function sP({workspaceId:e,prompts:t,onNew:n,onEdit:r}){const i=Kk(e),o=s=>{confirm(`Delete prompt template /${s.name}?
217
-
218
- ${s.filePath}`)&&i.mutate({filePath:s.filePath})};return u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx(Ky,{label:"New prompt",onClick:n}),i.isError&&u.jsx("p",{className:"rounded-md border border-signal-error/[0.30] bg-signal-error/[0.08] px-2.5 py-1.5 text-[11.5px] text-signal-error",children:i.error.message}),t.length===0?u.jsx(Xy,{text:"No prompt templates discovered."}):u.jsx("ul",{className:"flex flex-col gap-2",children:t.map(s=>{var l;return u.jsxs("li",{className:"rounded-[10px] border border-border-soft bg-card px-3 py-2.5 transition-colors hover:border-border",children:[u.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[u.jsxs("span",{className:"truncate text-[13px] font-medium text-foreground",children:["/",s.name,s.argumentHint&&u.jsx("span",{className:"ml-1 font-normal text-muted-foreground",children:s.argumentHint})]}),u.jsx(Gd,{source:s.source})]}),s.description&&u.jsx("p",{className:"mt-1 text-[12px] text-muted-foreground",children:s.description}),u.jsxs("details",{className:"mt-1.5 text-[12px]",children:[u.jsx("summary",{className:"cursor-pointer select-none rounded px-1 -mx-1 text-muted-foreground hover:text-foreground",children:"View template"}),u.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md border border-border-soft bg-muted p-2 font-mono text-[11.5px] leading-relaxed text-foreground",children:s.content})]}),u.jsx(Yd,{path:s.filePath}),s.managed?u.jsx(Yy,{onEdit:()=>r(s),onDelete:()=>o(s),deleting:i.isPending&&((l=i.variables)==null?void 0:l.filePath)===s.filePath}):u.jsx(Gy,{kind:"prompt",source:s.source})]},s.filePath)})})]})}function lP({extensionsEnabled:e,extensions:t,errors:n,disabledExtensions:r}){return e?t.length===0&&n.length===0?u.jsx("div",{className:"flex flex-col gap-3",children:u.jsxs("div",{className:"rounded-[10px] border border-border-soft bg-card px-3 py-3",children:[u.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Extensions enabled, none installed"}),u.jsxs("p",{className:"mt-1.5 text-[12px] leading-relaxed text-muted-foreground",children:[u.jsx("code",{className:"rounded bg-muted px-1 font-mono",children:"PI_PILOT_ENABLE_EXTENSIONS=1"})," is set but no extension modules were discovered under"," ",u.jsx("code",{className:"rounded bg-muted px-1 font-mono",children:"~/.pi/agent/extensions/"})," or"," ",u.jsx("code",{className:"rounded bg-muted px-1 font-mono",children:".pi/extensions/"}),"."]})]})}):u.jsxs("div",{className:"flex flex-col gap-2",children:[n.map(i=>u.jsxs("div",{className:"rounded-[10px] border border-signal-error/[0.30] bg-signal-error/[0.08] px-3 py-2.5 text-[12px] text-signal-error",children:[u.jsx("p",{className:"text-[11.5px] font-medium",children:"Failed to load"}),u.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-signal-error/80",children:i.path}),u.jsx("p",{className:"mt-1 break-words",children:i.error})]},i.path)),t.map(i=>u.jsxs("div",{className:"rounded-[10px] border border-border-soft bg-card px-3 py-2.5 transition-colors hover:border-border",children:[u.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[u.jsx("span",{className:"truncate text-[13px] font-medium text-foreground",children:Mh(i.path)}),u.jsx(Gd,{source:i.source})]}),u.jsx(aP,{ext:i}),u.jsx(Yd,{path:i.resolvedPath})]},i.resolvedPath))]}):u.jsxs("div",{className:"flex flex-col gap-3",children:[u.jsxs("div",{className:"rounded-[10px] border border-border-soft bg-card px-3 py-3",children:[u.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Extensions are not supported"}),u.jsx("p",{className:"mt-1.5 text-[12px] leading-relaxed text-muted-foreground",children:"The pi extension system is built for a terminal UI (custom renderers, ANSI themes, keyboard overlays). These APIs cannot be bridged to the Web in any meaningful way, so pi-pilot disables all extensions by default."}),u.jsx("p",{className:"mt-2 text-[12px] leading-relaxed text-muted-foreground",children:"Skills and prompts work as usual; only extension modules are skipped."})]}),r.length>0&&u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("p",{className:"px-1 text-[12px] font-medium text-muted-foreground",children:"Detected but disabled"}),r.map(i=>u.jsxs("div",{className:"flex items-center gap-2 rounded-[8px] border border-border-soft bg-muted/50 px-2.5 py-1.5",title:i,children:[u.jsx(Ik,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),u.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:Mh(i)})]},i))]})]})}function aP({ext:e}){const t=[{label:"tools",items:e.tools},{label:"commands",items:e.commands.map(n=>`/${n}`)},{label:"flags",items:e.flags.map(n=>`--${n}`)},{label:"shortcuts",items:e.shortcuts}].filter(n=>n.items.length>0);return t.length===0?u.jsx("p",{className:"mt-1.5 text-[11.5px] italic text-muted-foreground",children:"No registrations."}):u.jsx("dl",{className:"mt-1.5 flex flex-col gap-1 text-[11.5px]",children:t.map(n=>u.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[u.jsxs("dt",{className:"shrink-0 text-muted-foreground",children:[n.label,":"]}),u.jsx("dd",{className:"flex flex-wrap gap-1",children:n.items.map(r=>u.jsx("span",{className:"rounded border border-border-soft bg-muted px-1.5 py-px font-mono text-[10.5px] text-foreground",children:r},r))})]},n.label))})}function Ky({label:e,onClick:t}){return u.jsxs("button",{type:"button",onClick:t,className:"group inline-flex items-center justify-center gap-1.5 rounded-md border border-dashed border-border bg-transparent px-2 py-2 text-[12px] font-medium text-muted-foreground transition-colors hover:border-brand/[0.30] hover:text-brand ring-brand-focus",children:[u.jsx(Wl,{className:"h-3 w-3 transition-transform group-hover:rotate-90"}),e]})}function Gy({kind:e,source:t}){return u.jsxs("p",{className:"mt-1.5 text-[11px] text-muted-foreground",children:["Read-only · ",e," from ",t.label]})}function Yy({onEdit:e,onDelete:t,deleting:n}){return u.jsxs("div",{className:"mt-2 flex justify-end gap-1.5",children:[u.jsxs("button",{type:"button",onClick:e,className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1 text-[11.5px] font-medium text-foreground transition-colors hover:border-brand/[0.30] hover:text-brand ring-brand-focus",children:[u.jsx(ic,{className:"h-3 w-3"})," Edit"]}),u.jsxs("button",{type:"button",onClick:t,disabled:n,className:"inline-flex items-center gap-1.5 rounded-md border border-signal-error/[0.30] bg-card px-2.5 py-1 text-[11.5px] font-medium text-signal-error transition-colors hover:bg-signal-error/[0.08] disabled:opacity-50 ring-brand-focus",children:[n?u.jsx(tn,{className:"h-3 w-3 animate-spin"}):u.jsx(qo,{className:"h-3 w-3"})," ","Delete"]})]})}function Gd({source:e}){const t=e.scope==="user"?"default":e.scope==="project"?"brand":"warn";return u.jsx(rr,{tone:t,className:"shrink-0",children:u.jsx("span",{title:e.label,children:e.scope})})}function Yd({path:e}){return u.jsx("p",{className:"mt-1.5 truncate font-mono text-[10.5px] tracking-[-0.005em] text-muted-foreground",title:e,children:e})}function Xy({text:e}){return u.jsx("p",{className:"py-8 text-center text-[12.5px] text-muted-foreground",children:e})}function Mh(e){return e.replace(/\/+$/,"").split("/").at(-1)||e}const Xd=["workspaces"];function uP(){return nn({queryKey:Xd,queryFn:()=>ce("/api/workspaces").then(e=>e.workspaces)})}function cP(){const e=Pe();return Oe({mutationFn:async t=>(await ce("/api/workspaces",{method:"POST",body:JSON.stringify(t)})).workspace,onSuccess:()=>e.invalidateQueries({queryKey:Xd})})}function dP(){const e=Pe();return Oe({mutationFn:t=>ce(`/api/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>e.invalidateQueries({queryKey:Xd})})}function fP({open:e,initialPath:t,onClose:n,onPick:r,error:i,busy:o}){const[s,l]=N.useState(t),[a,c]=N.useState(t??""),[f,d]=N.useState(!1),{data:p,isFetching:h,error:m}=Ok(s,f,e),v=p==null?void 0:p.path;N.useEffect(()=>{v&&v!==s&&(l(v),c(v))},[v,s]),N.useEffect(()=>{e&&(l(t),c(t??""))},[e,t]);const b=N.useRef(n);if(N.useEffect(()=>{b.current=n},[n]),N.useEffect(()=>{if(!e)return;const y=S=>{S.key==="Escape"&&b.current()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[e]),!e)return null;const g=(p==null?void 0:p.path)??s??"",x=i??(m instanceof Error?m.message:void 0);return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onMouseDown:y=>{y.target===y.currentTarget&&n()},children:u.jsxs("div",{className:"flex h-[32rem] w-full max-w-2xl flex-col overflow-hidden rounded-xl border border-border bg-popover shadow-panel",children:[u.jsxs("header",{className:"flex items-center justify-between border-b border-border/70 bg-card/40 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[u.jsx(Nx,{className:"h-4 w-4 text-brand"}),"Add workspace"]}),u.jsx("button",{type:"button",onClick:n,className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground ring-brand-focus","aria-label":"Close",children:u.jsx(Ui,{className:"h-4 w-4"})})]}),u.jsx(pP,{value:a,onChange:c,onSubmit:()=>{const y=a.trim();y&&l(y)}}),u.jsx(hP,{path:g,onJump:l}),u.jsx("div",{className:"flex-1 overflow-y-auto",children:u.jsx(mP,{entries:(p==null?void 0:p.entries)??[],parent:(p==null?void 0:p.parent)??null,loading:h&&!p,error:m instanceof Error&&!p?m.message:void 0,onEnter:l})}),u.jsxs("footer",{className:"border-t border-border/70 bg-card/40 px-4 py-3",children:[u.jsxs("label",{className:"mb-2 flex items-center gap-2 text-xs text-muted-foreground",children:[u.jsx("input",{type:"checkbox",checked:f,onChange:y=>d(y.target.checked),className:"h-3.5 w-3.5 accent-[hsl(var(--brand))]"}),"Show hidden directories"]}),u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("p",{className:"flex-1 truncate font-mono text-xs text-foreground",children:g||"—"}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u.jsx("button",{type:"button",onClick:n,className:"rounded-md px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground ring-brand-focus",children:"Cancel"}),u.jsxs("button",{type:"button",disabled:!g||o,onClick:()=>void r(g),className:V("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ring-brand-focus",!g||o?"bg-muted text-muted-foreground/70 cursor-not-allowed":"bg-brand text-brand-foreground hover:bg-brand-strong shadow-glow-sm"),children:[o&&u.jsx(tn,{className:"h-3 w-3 animate-spin"}),"Add this folder"]})]})]}),x&&u.jsx("p",{className:"mt-2 rounded-md border border-signal-rose/40 bg-signal-rose/10 px-2 py-1 text-xs text-signal-rose",children:x})]})]})})}function pP({value:e,onChange:t,onSubmit:n}){const r=N.useRef(null);return N.useEffect(()=>{var i;(i=r.current)==null||i.focus()},[]),u.jsx("div",{className:"border-b border-border/70 bg-background/30 px-4 py-2",children:u.jsx("input",{ref:r,type:"text",value:e,onChange:i=>t(i.target.value),onKeyDown:i=>{i.key==="Enter"&&(i.preventDefault(),n())},placeholder:"/absolute/path (Enter to jump)",className:"w-full rounded-md border border-input bg-card/60 px-2.5 py-1.5 font-mono text-xs text-foreground outline-none transition-colors focus:border-brand/40 focus:ring-1 focus:ring-brand/40"})})}function hP({path:e,onJump:t}){const n=N.useMemo(()=>gP(e),[e]);return u.jsxs("nav",{className:"flex items-center gap-0.5 overflow-x-auto border-b border-border/70 bg-background/20 px-3 py-1.5 text-xs",children:[n.length===0&&u.jsx("span",{className:"text-muted-foreground",children:"—"}),n.map((r,i)=>u.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[u.jsx("button",{type:"button",onClick:()=>t(r.path),className:"rounded px-1.5 py-0.5 text-foreground/90 transition-colors hover:bg-accent hover:text-foreground",children:r.label}),i<n.length-1&&u.jsx(wd,{className:"h-3 w-3 text-muted-foreground"})]},r.path))]})}function mP({entries:e,parent:t,loading:n,error:r,onEnter:i}){return n?u.jsxs("div",{className:"flex h-full items-center justify-center text-xs text-muted-foreground",children:[u.jsx(tn,{className:"mr-2 h-3 w-3 animate-spin"}),"Loading…"]}):r?u.jsx("div",{className:"p-4 text-xs text-signal-rose",children:r}):u.jsxs("ul",{className:"p-1.5",children:[t&&u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>i(t),className:Oh,children:[u.jsx(Cx,{className:"h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"text-muted-foreground",children:".. (parent)"})]})}),e.length===0&&u.jsx("li",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"(no subdirectories)"}),e.map(o=>u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>i(o.path),className:Oh,children:[u.jsx(Nx,{className:"h-4 w-4 shrink-0 text-brand/70 opacity-80"}),u.jsx("span",{className:"truncate",children:o.name})]})},o.path))]})}const Oh=V("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm","text-foreground/90 transition-colors hover:bg-accent hover:text-foreground");function gP(e){if(!e)return[];const t=e.split("/").filter(Boolean),n=[{label:"/",path:"/"}];let r="";for(const i of t)r+=`/${i}`,n.push({label:i,path:r});return n}function xP({activeId:e,onSelect:t,collapsed:n,onToggleCollapse:r}){const{data:i,isLoading:o}=uP(),s=cP(),l=dP(),[a,c]=N.useState(!1),[f,d]=N.useState(void 0),p=Re(v=>v.running),h=async v=>{d(void 0);try{const b=await s.mutateAsync({path:v});c(!1),t(b.id)}catch(b){d(b instanceof Error?b.message:String(b))}},m=(i==null?void 0:i.length)??0;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative h-full shrink-0",children:[u.jsxs("aside",{className:V("flex h-full flex-col overflow-hidden border-r border-border bg-popover","transition-[width] duration-300 ease-out",n?"w-[56px]":"w-[272px]"),children:[u.jsxs("header",{className:"flex h-[54px] shrink-0 items-center",children:[u.jsx("div",{className:"flex h-full w-[56px] shrink-0 items-center justify-center",children:u.jsx(Kd,{size:28,filled:p})}),u.jsx("div",{className:V("flex min-w-0 flex-1 items-center pr-3 transition-opacity duration-200 ease-out",n?"opacity-0":"opacity-100"),children:u.jsx(r3,{})})]}),u.jsxs("div",{className:V("flex shrink-0 items-center justify-between px-4 pb-2 pt-3 transition-opacity duration-200 ease-out",n?"pointer-events-none opacity-0":"opacity-100"),children:[u.jsxs("h2",{className:"m-0 whitespace-nowrap text-[11.5px] font-medium text-muted-foreground",children:["Workspaces",m>0&&u.jsx("span",{className:"ml-1.5 text-muted-foreground/60",children:m})]}),u.jsxs("button",{type:"button",onClick:()=>{d(void 0),c(!0)},className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[12px] text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground",children:[u.jsx("span",{className:"text-[15px] leading-none text-brand",children:"+"}),u.jsx("span",{children:"Add"})]})]}),u.jsxs("ul",{className:"flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto overflow-x-hidden px-2.5 pb-3",children:[u.jsx(Dh,{show:!!o,collapsed:n,label:"Loading…"}),u.jsx(Dh,{show:!o&&(i==null?void 0:i.length)===0,collapsed:n,label:"No workspaces yet",variant:"dashed"}),i==null?void 0:i.map(v=>{const b=e===v.id;return u.jsx(yP,{name:v.name,path:v.path,active:b,streaming:b&&p,collapsed:n,onSelect:()=>t(v.id),onDelete:()=>{confirm(`Remove "${v.name}" from the list? (Files are not deleted.)`)&&l.mutateAsync(v.id)}},v.id)})]}),u.jsx(vP,{collapsed:n})]}),u.jsx("button",{type:"button",onClick:r,className:"absolute right-0 top-1/2 z-10 -translate-y-1/2 translate-x-1/2 rounded-full border border-border bg-card p-1 text-muted-foreground shadow-glow transition-colors hover:text-foreground","aria-label":n?"Expand sidebar (Ctrl+B)":"Collapse sidebar (Ctrl+B)",title:n?"Expand sidebar (Ctrl+B)":"Collapse sidebar (Ctrl+B)",children:n?u.jsx(wd,{className:"h-3.5 w-3.5"}):u.jsx(jx,{className:"h-3.5 w-3.5"})})]}),u.jsx(fP,{open:a,onClose:()=>c(!1),onPick:h,error:f,busy:s.isPending})]})}function Dh({show:e,collapsed:t,label:n,variant:r}){return e?u.jsx("li",{className:V("overflow-hidden text-center text-[12px] text-muted-foreground","transition-[opacity,max-height,margin,padding] duration-300 ease-out",r==="dashed"&&"rounded-lg border border-dashed border-border-soft bg-background/60",t?"pointer-events-none my-0 max-h-0 py-0 opacity-0":r==="dashed"?"mt-1 max-h-[80px] px-3 py-5 opacity-100":"max-h-[40px] px-3 py-2 opacity-100"),children:n}):null}function yP({name:e,path:t,active:n,streaming:r,collapsed:i,onSelect:o,onDelete:s}){const l=n?r?"streaming":"online":"idle";return u.jsxs("li",{className:"group relative",children:[u.jsxs("button",{type:"button",onClick:o,title:i?e:void 0,"aria-label":e,className:V("relative flex w-full items-start gap-2 overflow-hidden rounded-[10px] border pl-[14px] pr-7 py-[10px] text-left transition-colors",n?"border-border bg-card":"border-transparent bg-transparent hover:bg-accent/40"),children:[n&&u.jsx("span",{"aria-hidden":!0,className:"absolute left-1.5 top-3 bottom-3 w-[2px] rounded-full bg-brand"}),u.jsx("div",{className:V("flex items-center justify-center transition-[width,opacity] duration-200",i?"w-[18px] opacity-100":"w-0 opacity-0"),children:u.jsx(Nl,{state:l})}),u.jsxs("div",{className:V("flex min-w-0 flex-1 flex-col gap-[3px] overflow-hidden transition-[opacity,max-height,padding] duration-300 ease-out",i?"pointer-events-none max-h-0 py-0 opacity-0":"max-h-[80px] opacity-100"),children:[u.jsx("div",{className:"flex items-center gap-2",children:u.jsx("span",{className:V("min-w-0 flex-1 truncate text-[13.5px] tracking-[-0.005em]",n?"font-medium text-foreground":"text-foreground"),children:e})}),u.jsx("div",{className:"truncate font-mono text-[10.5px] tracking-[-0.005em] text-muted-foreground",children:kP(t)})]})]}),u.jsxs("div",{className:V("pointer-events-none absolute right-2 top-[10px] flex flex-col items-end gap-0.5 transition-opacity duration-300 ease-out",i?"opacity-0":"opacity-100"),children:[u.jsx("span",{className:"flex h-[20px] items-center",children:u.jsx(Nl,{state:l})}),u.jsx("button",{type:"button",onClick:a=>{a.stopPropagation(),s()},className:V("pointer-events-none rounded-md p-1 text-muted-foreground transition-opacity duration-150","opacity-0 hover:bg-signal-error/[0.10] hover:text-signal-error",!i&&"group-hover:pointer-events-auto group-hover:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100"),"aria-label":"Remove workspace",title:"Remove workspace",tabIndex:i?-1:0,children:u.jsx(qo,{className:"h-3 w-3"})})]})]})}function vP({collapsed:e}){const t=LN();return u.jsxs("footer",{className:"flex h-[40px] shrink-0 items-center gap-2 border-t border-border-soft px-4",children:[u.jsxs("div",{className:V("flex w-full items-center gap-2 text-[11.5px] text-muted-foreground transition-opacity",e?"opacity-0":"opacity-100"),children:[u.jsx(Nl,{state:"online"}),u.jsx("span",{children:"Online"}),u.jsx("span",{className:"flex-1"}),u.jsx("span",{className:"font-mono text-[10.5px] tracking-[-0.005em] text-muted-foreground",children:t})]}),e&&u.jsx("div",{className:"absolute left-0 right-0 flex justify-center",children:u.jsx(Nl,{state:"online"})})]})}function kP(e){const t=e.match(/^\/(?:Users|home)\/[^/]+/);if(!t)return e;const n=e.slice(t[0].length);return n===""||n.startsWith("/")?"~"+n:e}function bP(){const[e,t]=N.useState(void 0),[n,r]=N.useState(null),[i,o]=N.useState(!1);V3(e),W3(),Ek(),K3(e);const s=a=>r(c=>c===a?null:a),l=N.useCallback(()=>{o(a=>!a)},[]);return N.useEffect(()=>{const a=c=>{(c.ctrlKey||c.metaKey)&&c.key==="b"&&(c.preventDefault(),l())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[l]),u.jsxs("div",{className:"flex h-full",children:[u.jsx(xP,{activeId:e,onSelect:t,collapsed:i,onToggleCollapse:l}),u.jsx(a3,{workspaceId:e,rightPanel:n,onToggleConfig:()=>s("config"),onToggleResources:()=>s("resources")},e??"none"),e&&u.jsxs(u.Fragment,{children:[u.jsx(z3,{workspaceId:e,open:n==="config",onClose:()=>r(null)},`cfg-${e}`),u.jsx(rP,{workspaceId:e,open:n==="resources",onClose:()=>r(null)},`res-${e}`)]}),u.jsx(Y3,{})]})}const wP=new lk({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Jy=document.getElementById("root");if(!Jy)throw new Error("missing #root");ux(Jy).render(u.jsx(N.StrictMode,{children:u.jsx(ak,{client:wP,children:u.jsx(bP,{})})}));