@polderlabs/bizar 4.4.3 → 4.4.4

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.
@@ -0,0 +1,354 @@
1
+ var ag=Object.defineProperty;var ug=(e,t,n)=>t in e?ag(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var nt=(e,t,n)=>ug(e,typeof t!="symbol"?t+"":t,n);(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 l of i)if(l.type==="childList")for(const s of l.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();var El=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xf={exports:{}},as={},vf={exports:{}},oe={};/**
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 Ri=Symbol.for("react.element"),cg=Symbol.for("react.portal"),dg=Symbol.for("react.fragment"),fg=Symbol.for("react.strict_mode"),hg=Symbol.for("react.profiler"),mg=Symbol.for("react.provider"),pg=Symbol.for("react.context"),gg=Symbol.for("react.forward_ref"),yg=Symbol.for("react.suspense"),xg=Symbol.for("react.memo"),vg=Symbol.for("react.lazy"),Yu=Symbol.iterator;function kg(e){return e===null||typeof e!="object"?null:(e=Yu&&e[Yu]||e["@@iterator"],typeof e=="function"?e:null)}var kf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wf=Object.assign,bf={};function Rr(e,t,n){this.props=e,this.context=t,this.refs=bf,this.updater=n||kf}Rr.prototype.isReactComponent={};Rr.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")};Rr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sf(){}Sf.prototype=Rr.prototype;function Aa(e,t,n){this.props=e,this.context=t,this.refs=bf,this.updater=n||kf}var Ma=Aa.prototype=new Sf;Ma.constructor=Aa;wf(Ma,Rr.prototype);Ma.isPureReactComponent=!0;var Ku=Array.isArray,Cf=Object.prototype.hasOwnProperty,La={current:null},jf={key:!0,ref:!0,__self:!0,__source:!0};function Nf(e,t,n){var r,i={},l=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(l=""+t.key),t)Cf.call(t,r)&&!jf.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var u=Array(o),d=0;d<o;d++)u[d]=arguments[d+2];i.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:Ri,type:e,key:l,ref:s,props:i,_owner:La.current}}function wg(e,t){return{$$typeof:Ri,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ra(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ri}function bg(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Gu=/\/+/g;function As(e,t){return typeof e=="object"&&e!==null&&e.key!=null?bg(""+e.key):t.toString(36)}function fl(e,t,n,r,i){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Ri:case cg:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+As(s,0):r,Ku(i)?(n="",e!=null&&(n=e.replace(Gu,"$&/")+"/"),fl(i,t,n,"",function(d){return d})):i!=null&&(Ra(i)&&(i=wg(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(Gu,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",Ku(e))for(var o=0;o<e.length;o++){l=e[o];var u=r+As(l,o);s+=fl(l,t,n,u,i)}else if(u=kg(e),typeof u=="function")for(e=u.call(e),o=0;!(l=e.next()).done;)l=l.value,u=r+As(l,o++),s+=fl(l,t,n,u,i);else if(l==="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 Vi(e,t,n){if(e==null)return e;var r=[],i=0;return fl(e,r,"","",function(l){return t.call(n,l,i++)}),r}function Sg(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 Ze={current:null},hl={transition:null},Cg={ReactCurrentDispatcher:Ze,ReactCurrentBatchConfig:hl,ReactCurrentOwner:La};function Ef(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:Vi,forEach:function(e,t,n){Vi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Vi(e,function(){t++}),t},toArray:function(e){return Vi(e,function(t){return t})||[]},only:function(e){if(!Ra(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=Rr;oe.Fragment=dg;oe.Profiler=hg;oe.PureComponent=Aa;oe.StrictMode=fg;oe.Suspense=yg;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cg;oe.act=Ef;oe.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=wf({},e.props),i=e.key,l=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,s=La.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)Cf.call(t,u)&&!jf.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var d=0;d<u;d++)o[d]=arguments[d+2];r.children=o}return{$$typeof:Ri,type:e.type,key:i,ref:l,props:r,_owner:s}};oe.createContext=function(e){return e={$$typeof:pg,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:mg,_context:e},e.Consumer=e};oe.createElement=Nf;oe.createFactory=function(e){var t=Nf.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:gg,render:e}};oe.isValidElement=Ra;oe.lazy=function(e){return{$$typeof:vg,_payload:{_status:-1,_result:e},_init:Sg}};oe.memo=function(e,t){return{$$typeof:xg,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=hl.transition;hl.transition={};try{e()}finally{hl.transition=t}};oe.unstable_act=Ef;oe.useCallback=function(e,t){return Ze.current.useCallback(e,t)};oe.useContext=function(e){return Ze.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Ze.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Ze.current.useEffect(e,t)};oe.useId=function(){return Ze.current.useId()};oe.useImperativeHandle=function(e,t,n){return Ze.current.useImperativeHandle(e,t,n)};oe.useInsertionEffect=function(e,t){return Ze.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Ze.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Ze.current.useMemo(e,t)};oe.useReducer=function(e,t,n){return Ze.current.useReducer(e,t,n)};oe.useRef=function(e){return Ze.current.useRef(e)};oe.useState=function(e){return Ze.current.useState(e)};oe.useSyncExternalStore=function(e,t,n){return Ze.current.useSyncExternalStore(e,t,n)};oe.useTransition=function(){return Ze.current.useTransition()};oe.version="18.3.1";vf.exports=oe;var b=vf.exports;const Ae=Pa(b);/**
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 jg=b,Ng=Symbol.for("react.element"),Eg=Symbol.for("react.fragment"),Tg=Object.prototype.hasOwnProperty,zg=jg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ig={key:!0,ref:!0,__self:!0,__source:!0};function Tf(e,t,n){var r,i={},l=null,s=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Tg.call(t,r)&&!Ig.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:Ng,type:e,key:l,ref:s,props:i,_owner:zg.current}}as.Fragment=Eg;as.jsx=Tf;as.jsxs=Tf;xf.exports=as;var a=xf.exports,zf={exports:{}},xt={},If={exports:{}},Pf={};/**
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(D,V){var w=D.length;D.push(V);e:for(;0<w;){var ne=w-1>>>1,ae=D[ne];if(0<i(ae,V))D[ne]=V,D[w]=ae,w=ne;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var V=D[0],w=D.pop();if(w!==V){D[0]=w;e:for(var ne=0,ae=D.length,E=ae>>>1;ne<E;){var ye=2*(ne+1)-1,qe=D[ye],fe=ye+1,Ye=D[fe];if(0>i(qe,w))fe<ae&&0>i(Ye,qe)?(D[ne]=Ye,D[fe]=w,ne=fe):(D[ne]=qe,D[ye]=w,ne=ye);else if(fe<ae&&0>i(Ye,w))D[ne]=Ye,D[fe]=w,ne=fe;else break e}}return V}function i(D,V){var w=D.sortIndex-V.sortIndex;return w!==0?w:D.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var u=[],d=[],c=1,f=null,h=3,m=!1,p=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(D){for(var V=n(d);V!==null;){if(V.callback===null)r(d);else if(V.startTime<=D)r(d),V.sortIndex=V.expirationTime,t(u,V);else break;V=n(d)}}function C(D){if(x=!1,v(D),!p)if(n(u)!==null)p=!0,te(z);else{var V=n(d);V!==null&&J(C,V.startTime-D)}}function z(D,V){p=!1,x&&(x=!1,y(M),M=-1),m=!0;var w=h;try{for(v(V),f=n(u);f!==null&&(!(f.expirationTime>V)||D&&!j());){var ne=f.callback;if(typeof ne=="function"){f.callback=null,h=f.priorityLevel;var ae=ne(f.expirationTime<=V);V=e.unstable_now(),typeof ae=="function"?f.callback=ae:f===n(u)&&r(u),v(V)}else r(u);f=n(u)}if(f!==null)var E=!0;else{var ye=n(d);ye!==null&&J(C,ye.startTime-V),E=!1}return E}finally{f=null,h=w,m=!1}}var N=!1,P=null,M=-1,T=5,k=-1;function j(){return!(e.unstable_now()-k<T)}function I(){if(P!==null){var D=e.unstable_now();k=D;var V=!0;try{V=P(!0,D)}finally{V?$():(N=!1,P=null)}}else N=!1}var $;if(typeof g=="function")$=function(){g(I)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,L=H.port2;H.port1.onmessage=I,$=function(){L.postMessage(null)}}else $=function(){S(I,0)};function te(D){P=D,N||(N=!0,$())}function J(D,V){M=S(function(){D(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_continueExecution=function(){p||m||(p=!0,te(z))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(D){switch(h){case 1:case 2:case 3:var V=3;break;default:V=h}var w=h;h=V;try{return D()}finally{h=w}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,V){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var w=h;h=D;try{return V()}finally{h=w}},e.unstable_scheduleCallback=function(D,V,w){var ne=e.unstable_now();switch(typeof w=="object"&&w!==null?(w=w.delay,w=typeof w=="number"&&0<w?ne+w:ne):w=ne,D){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=w+ae,D={id:c++,callback:V,priorityLevel:D,startTime:w,expirationTime:ae,sortIndex:-1},w>ne?(D.sortIndex=w,t(d,D),n(u)===null&&D===n(d)&&(x?(y(M),M=-1):x=!0,J(C,w-ne))):(D.sortIndex=ae,t(u,D),p||m||(p=!0,te(z))),D},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(D){var V=h;return function(){var w=h;h=V;try{return D.apply(this,arguments)}finally{h=w}}}})(Pf);If.exports=Pf;var Pg=If.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 Ag=b,gt=Pg;function _(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 Af=new Set,gi={};function Jn(e,t){Nr(e,t),Nr(e+"Capture",t)}function Nr(e,t){for(gi[e]=t,e=0;e<t.length;e++)Af.add(t[e])}var Jt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bo=Object.prototype.hasOwnProperty,Mg=/^[: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]*$/,Xu={},Zu={};function Lg(e){return bo.call(Zu,e)?!0:bo.call(Xu,e)?!1:Mg.test(e)?Zu[e]=!0:(Xu[e]=!0,!1)}function Rg(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 Dg(e,t,n,r){if(t===null||typeof t>"u"||Rg(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 Je(e,t,n,r,i,l,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=l,this.removeEmptyString=s}var $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new Je(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new Je(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){$e[e]=new Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var Da=/[\-:]([a-z])/g;function _a(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(Da,_a);$e[t]=new Je(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(Da,_a);$e[t]=new Je(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(Da,_a);$e[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function Oa(e,t,n,r){var i=$e.hasOwnProperty(t)?$e[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Dg(t,n,i,r)&&(n=null),r||i===null?Lg(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 rn=Ag.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Wi=Symbol.for("react.element"),sr=Symbol.for("react.portal"),or=Symbol.for("react.fragment"),Fa=Symbol.for("react.strict_mode"),So=Symbol.for("react.profiler"),Mf=Symbol.for("react.provider"),Lf=Symbol.for("react.context"),$a=Symbol.for("react.forward_ref"),Co=Symbol.for("react.suspense"),jo=Symbol.for("react.suspense_list"),Ba=Symbol.for("react.memo"),an=Symbol.for("react.lazy"),Rf=Symbol.for("react.offscreen"),Ju=Symbol.iterator;function Hr(e){return e===null||typeof e!="object"?null:(e=Ju&&e[Ju]||e["@@iterator"],typeof e=="function"?e:null)}var je=Object.assign,Ms;function Jr(e){if(Ms===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ms=t&&t[1]||""}return`
34
+ `+Ms+e}var Ls=!1;function Rs(e,t){if(!e||Ls)return"";Ls=!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(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var i=d.stack.split(`
35
+ `),l=r.stack.split(`
36
+ `),s=i.length-1,o=l.length-1;1<=s&&0<=o&&i[s]!==l[o];)o--;for(;1<=s&&0<=o;s--,o--)if(i[s]!==l[o]){if(s!==1||o!==1)do if(s--,o--,0>o||i[s]!==l[o]){var u=`
37
+ `+i[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=o);break}}}finally{Ls=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Jr(e):""}function _g(e){switch(e.tag){case 5:return Jr(e.type);case 16:return Jr("Lazy");case 13:return Jr("Suspense");case 19:return Jr("SuspenseList");case 0:case 2:case 15:return e=Rs(e.type,!1),e;case 11:return e=Rs(e.type.render,!1),e;case 1:return e=Rs(e.type,!0),e;default:return""}}function No(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 or:return"Fragment";case sr:return"Portal";case So:return"Profiler";case Fa:return"StrictMode";case Co:return"Suspense";case jo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Lf:return(e.displayName||"Context")+".Consumer";case Mf:return(e._context.displayName||"Context")+".Provider";case $a:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ba:return t=e.displayName||null,t!==null?t:No(e.type)||"Memo";case an:t=e._payload,e=e._init;try{return No(e(t))}catch{}}return null}function Og(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 No(t);case 8:return t===Fa?"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 bn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Df(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fg(e){var t=Df(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,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,l.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 Qi(e){e._valueTracker||(e._valueTracker=Fg(e))}function _f(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Df(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Tl(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 Eo(e,t){var n=t.checked;return je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ec(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=bn(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 Of(e,t){t=t.checked,t!=null&&Oa(e,"checked",t,!1)}function To(e,t){Of(e,t);var n=bn(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")?zo(e,t.type,n):t.hasOwnProperty("defaultValue")&&zo(e,t.type,bn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function tc(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 zo(e,t,n){(t!=="number"||Tl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ei=Array.isArray;function vr(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=""+bn(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 Io(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(_(91));return je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function nc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(_(92));if(ei(n)){if(1<n.length)throw Error(_(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:bn(n)}}function Ff(e,t){var n=bn(t.value),r=bn(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 rc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $f(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 Po(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$f(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var qi,Bf=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(qi=qi||document.createElement("div"),qi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=qi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ri={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},$g=["Webkit","ms","Moz","O"];Object.keys(ri).forEach(function(e){$g.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ri[t]=ri[e]})});function Uf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ri.hasOwnProperty(e)&&ri[e]?(""+t).trim():t+"px"}function Hf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Uf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Bg=je({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 Ao(e,t){if(t){if(Bg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function Mo(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 Lo=null;function Ua(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ro=null,kr=null,wr=null;function ic(e){if(e=Oi(e)){if(typeof Ro!="function")throw Error(_(280));var t=e.stateNode;t&&(t=hs(t),Ro(e.stateNode,e.type,t))}}function Vf(e){kr?wr?wr.push(e):wr=[e]:kr=e}function Wf(){if(kr){var e=kr,t=wr;if(wr=kr=null,ic(e),t)for(e=0;e<t.length;e++)ic(t[e])}}function Qf(e,t){return e(t)}function qf(){}var Ds=!1;function Yf(e,t,n){if(Ds)return e(t,n);Ds=!0;try{return Qf(e,t,n)}finally{Ds=!1,(kr!==null||wr!==null)&&(qf(),Wf())}}function xi(e,t){var n=e.stateNode;if(n===null)return null;var r=hs(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(_(231,t,typeof n));return n}var Do=!1;if(Jt)try{var Vr={};Object.defineProperty(Vr,"passive",{get:function(){Do=!0}}),window.addEventListener("test",Vr,Vr),window.removeEventListener("test",Vr,Vr)}catch{Do=!1}function Ug(e,t,n,r,i,l,s,o,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(c){this.onError(c)}}var ii=!1,zl=null,Il=!1,_o=null,Hg={onError:function(e){ii=!0,zl=e}};function Vg(e,t,n,r,i,l,s,o,u){ii=!1,zl=null,Ug.apply(Hg,arguments)}function Wg(e,t,n,r,i,l,s,o,u){if(Vg.apply(this,arguments),ii){if(ii){var d=zl;ii=!1,zl=null}else throw Error(_(198));Il||(Il=!0,_o=d)}}function er(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 Kf(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 lc(e){if(er(e)!==e)throw Error(_(188))}function Qg(e){var t=e.alternate;if(!t){if(t=er(e),t===null)throw Error(_(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var l=i.alternate;if(l===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===l.child){for(l=i.child;l;){if(l===n)return lc(i),e;if(l===r)return lc(i),t;l=l.sibling}throw Error(_(188))}if(n.return!==r.return)n=i,r=l;else{for(var s=!1,o=i.child;o;){if(o===n){s=!0,n=i,r=l;break}if(o===r){s=!0,r=i,n=l;break}o=o.sibling}if(!s){for(o=l.child;o;){if(o===n){s=!0,n=l,r=i;break}if(o===r){s=!0,r=l,n=i;break}o=o.sibling}if(!s)throw Error(_(189))}}if(n.alternate!==r)throw Error(_(190))}if(n.tag!==3)throw Error(_(188));return n.stateNode.current===n?e:t}function Gf(e){return e=Qg(e),e!==null?Xf(e):null}function Xf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xf(e);if(t!==null)return t;e=e.sibling}return null}var Zf=gt.unstable_scheduleCallback,sc=gt.unstable_cancelCallback,qg=gt.unstable_shouldYield,Yg=gt.unstable_requestPaint,Te=gt.unstable_now,Kg=gt.unstable_getCurrentPriorityLevel,Ha=gt.unstable_ImmediatePriority,Jf=gt.unstable_UserBlockingPriority,Pl=gt.unstable_NormalPriority,Gg=gt.unstable_LowPriority,eh=gt.unstable_IdlePriority,us=null,Ht=null;function Xg(e){if(Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(us,e,void 0,(e.current.flags&128)===128)}catch{}}var Mt=Math.clz32?Math.clz32:ey,Zg=Math.log,Jg=Math.LN2;function ey(e){return e>>>=0,e===0?32:31-(Zg(e)/Jg|0)|0}var Yi=64,Ki=4194304;function ti(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 Al(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,s=n&268435455;if(s!==0){var o=s&~i;o!==0?r=ti(o):(l&=s,l!==0&&(r=ti(l)))}else s=n&~i,s!==0?r=ti(s):l!==0&&(r=ti(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&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-Mt(t),i=1<<n,r|=e[n],t&=~i;return r}function ty(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 ny(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,l=e.pendingLanes;0<l;){var s=31-Mt(l),o=1<<s,u=i[s];u===-1?(!(o&n)||o&r)&&(i[s]=ty(o,t)):u<=t&&(e.expiredLanes|=o),l&=~o}}function Oo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function th(){var e=Yi;return Yi<<=1,!(Yi&4194240)&&(Yi=64),e}function _s(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Di(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mt(t),e[t]=n}function ry(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-Mt(n),l=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~l}}function Va(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Mt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var he=0;function nh(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var rh,Wa,ih,lh,sh,Fo=!1,Gi=[],mn=null,pn=null,gn=null,vi=new Map,ki=new Map,cn=[],iy="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 oc(e,t){switch(e){case"focusin":case"focusout":mn=null;break;case"dragenter":case"dragleave":pn=null;break;case"mouseover":case"mouseout":gn=null;break;case"pointerover":case"pointerout":vi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ki.delete(t.pointerId)}}function Wr(e,t,n,r,i,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[i]},t!==null&&(t=Oi(t),t!==null&&Wa(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function ly(e,t,n,r,i){switch(t){case"focusin":return mn=Wr(mn,e,t,n,r,i),!0;case"dragenter":return pn=Wr(pn,e,t,n,r,i),!0;case"mouseover":return gn=Wr(gn,e,t,n,r,i),!0;case"pointerover":var l=i.pointerId;return vi.set(l,Wr(vi.get(l)||null,e,t,n,r,i)),!0;case"gotpointercapture":return l=i.pointerId,ki.set(l,Wr(ki.get(l)||null,e,t,n,r,i)),!0}return!1}function oh(e){var t=On(e.target);if(t!==null){var n=er(t);if(n!==null){if(t=n.tag,t===13){if(t=Kf(n),t!==null){e.blockedOn=t,sh(e.priority,function(){ih(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 ml(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$o(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Lo=r,n.target.dispatchEvent(r),Lo=null}else return t=Oi(n),t!==null&&Wa(t),e.blockedOn=n,!1;t.shift()}return!0}function ac(e,t,n){ml(e)&&n.delete(t)}function sy(){Fo=!1,mn!==null&&ml(mn)&&(mn=null),pn!==null&&ml(pn)&&(pn=null),gn!==null&&ml(gn)&&(gn=null),vi.forEach(ac),ki.forEach(ac)}function Qr(e,t){e.blockedOn===t&&(e.blockedOn=null,Fo||(Fo=!0,gt.unstable_scheduleCallback(gt.unstable_NormalPriority,sy)))}function wi(e){function t(i){return Qr(i,e)}if(0<Gi.length){Qr(Gi[0],e);for(var n=1;n<Gi.length;n++){var r=Gi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(mn!==null&&Qr(mn,e),pn!==null&&Qr(pn,e),gn!==null&&Qr(gn,e),vi.forEach(t),ki.forEach(t),n=0;n<cn.length;n++)r=cn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<cn.length&&(n=cn[0],n.blockedOn===null);)oh(n),n.blockedOn===null&&cn.shift()}var br=rn.ReactCurrentBatchConfig,Ml=!0;function oy(e,t,n,r){var i=he,l=br.transition;br.transition=null;try{he=1,Qa(e,t,n,r)}finally{he=i,br.transition=l}}function ay(e,t,n,r){var i=he,l=br.transition;br.transition=null;try{he=4,Qa(e,t,n,r)}finally{he=i,br.transition=l}}function Qa(e,t,n,r){if(Ml){var i=$o(e,t,n,r);if(i===null)qs(e,t,r,Ll,n),oc(e,r);else if(ly(i,e,t,n,r))r.stopPropagation();else if(oc(e,r),t&4&&-1<iy.indexOf(e)){for(;i!==null;){var l=Oi(i);if(l!==null&&rh(l),l=$o(e,t,n,r),l===null&&qs(e,t,r,Ll,n),l===i)break;i=l}i!==null&&r.stopPropagation()}else qs(e,t,r,null,n)}}var Ll=null;function $o(e,t,n,r){if(Ll=null,e=Ua(r),e=On(e),e!==null)if(t=er(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Kf(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 Ll=e,null}function ah(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(Kg()){case Ha:return 1;case Jf:return 4;case Pl:case Gg:return 16;case eh:return 536870912;default:return 16}default:return 16}}var fn=null,qa=null,pl=null;function uh(){if(pl)return pl;var e,t=qa,n=t.length,r,i="value"in fn?fn.value:fn.textContent,l=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[l-r];r++);return pl=i.slice(e,1<r?1-r:void 0)}function gl(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 Xi(){return!0}function uc(){return!1}function vt(e){function t(n,r,i,l,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=l,this.target=s,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Xi:uc,this.isPropagationStopped=uc,this}return je(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=Xi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xi)},persist:function(){},isPersistent:Xi}),t}var Dr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ya=vt(Dr),_i=je({},Dr,{view:0,detail:0}),uy=vt(_i),Os,Fs,qr,cs=je({},_i,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ka,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!==qr&&(qr&&e.type==="mousemove"?(Os=e.screenX-qr.screenX,Fs=e.screenY-qr.screenY):Fs=Os=0,qr=e),Os)},movementY:function(e){return"movementY"in e?e.movementY:Fs}}),cc=vt(cs),cy=je({},cs,{dataTransfer:0}),dy=vt(cy),fy=je({},_i,{relatedTarget:0}),$s=vt(fy),hy=je({},Dr,{animationName:0,elapsedTime:0,pseudoElement:0}),my=vt(hy),py=je({},Dr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),gy=vt(py),yy=je({},Dr,{data:0}),dc=vt(yy),xy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vy={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"},ky={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ky[e])?!!t[e]:!1}function Ka(){return wy}var by=je({},_i,{key:function(e){if(e.key){var t=xy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=gl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ka,charCode:function(e){return e.type==="keypress"?gl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?gl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Sy=vt(by),Cy=je({},cs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fc=vt(Cy),jy=je({},_i,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ka}),Ny=vt(jy),Ey=je({},Dr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ty=vt(Ey),zy=je({},cs,{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}),Iy=vt(zy),Py=[9,13,27,32],Ga=Jt&&"CompositionEvent"in window,li=null;Jt&&"documentMode"in document&&(li=document.documentMode);var Ay=Jt&&"TextEvent"in window&&!li,ch=Jt&&(!Ga||li&&8<li&&11>=li),hc=" ",mc=!1;function dh(e,t){switch(e){case"keyup":return Py.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ar=!1;function My(e,t){switch(e){case"compositionend":return fh(t);case"keypress":return t.which!==32?null:(mc=!0,hc);case"textInput":return e=t.data,e===hc&&mc?null:e;default:return null}}function Ly(e,t){if(ar)return e==="compositionend"||!Ga&&dh(e,t)?(e=uh(),pl=qa=fn=null,ar=!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 ch&&t.locale!=="ko"?null:t.data;default:return null}}var Ry={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 pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ry[e.type]:t==="textarea"}function hh(e,t,n,r){Vf(r),t=Rl(t,"onChange"),0<t.length&&(n=new Ya("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var si=null,bi=null;function Dy(e){Ch(e,0)}function ds(e){var t=dr(e);if(_f(t))return e}function _y(e,t){if(e==="change")return t}var mh=!1;if(Jt){var Bs;if(Jt){var Us="oninput"in document;if(!Us){var gc=document.createElement("div");gc.setAttribute("oninput","return;"),Us=typeof gc.oninput=="function"}Bs=Us}else Bs=!1;mh=Bs&&(!document.documentMode||9<document.documentMode)}function yc(){si&&(si.detachEvent("onpropertychange",ph),bi=si=null)}function ph(e){if(e.propertyName==="value"&&ds(bi)){var t=[];hh(t,bi,e,Ua(e)),Yf(Dy,t)}}function Oy(e,t,n){e==="focusin"?(yc(),si=t,bi=n,si.attachEvent("onpropertychange",ph)):e==="focusout"&&yc()}function Fy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ds(bi)}function $y(e,t){if(e==="click")return ds(t)}function By(e,t){if(e==="input"||e==="change")return ds(t)}function Uy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:Uy;function Si(e,t){if(Dt(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(!bo.call(t,i)||!Dt(e[i],t[i]))return!1}return!0}function xc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vc(e,t){var n=xc(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=xc(n)}}function gh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yh(){for(var e=window,t=Tl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tl(e.document)}return t}function Xa(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 Hy(e){var t=yh(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&gh(n.ownerDocument.documentElement,n)){if(r!==null&&Xa(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,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=vc(n,l);var s=vc(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(),l>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 Vy=Jt&&"documentMode"in document&&11>=document.documentMode,ur=null,Bo=null,oi=null,Uo=!1;function kc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Uo||ur==null||ur!==Tl(r)||(r=ur,"selectionStart"in r&&Xa(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}),oi&&Si(oi,r)||(oi=r,r=Rl(Bo,"onSelect"),0<r.length&&(t=new Ya("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ur)))}function Zi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var cr={animationend:Zi("Animation","AnimationEnd"),animationiteration:Zi("Animation","AnimationIteration"),animationstart:Zi("Animation","AnimationStart"),transitionend:Zi("Transition","TransitionEnd")},Hs={},xh={};Jt&&(xh=document.createElement("div").style,"AnimationEvent"in window||(delete cr.animationend.animation,delete cr.animationiteration.animation,delete cr.animationstart.animation),"TransitionEvent"in window||delete cr.transitionend.transition);function fs(e){if(Hs[e])return Hs[e];if(!cr[e])return e;var t=cr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in xh)return Hs[e]=t[n];return e}var vh=fs("animationend"),kh=fs("animationiteration"),wh=fs("animationstart"),bh=fs("transitionend"),Sh=new Map,wc="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 Cn(e,t){Sh.set(e,t),Jn(t,[e])}for(var Vs=0;Vs<wc.length;Vs++){var Ws=wc[Vs],Wy=Ws.toLowerCase(),Qy=Ws[0].toUpperCase()+Ws.slice(1);Cn(Wy,"on"+Qy)}Cn(vh,"onAnimationEnd");Cn(kh,"onAnimationIteration");Cn(wh,"onAnimationStart");Cn("dblclick","onDoubleClick");Cn("focusin","onFocus");Cn("focusout","onBlur");Cn(bh,"onTransitionEnd");Nr("onMouseEnter",["mouseout","mouseover"]);Nr("onMouseLeave",["mouseout","mouseover"]);Nr("onPointerEnter",["pointerout","pointerover"]);Nr("onPointerLeave",["pointerout","pointerover"]);Jn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Jn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Jn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Jn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Jn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Jn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ni="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),qy=new Set("cancel close invalid load scroll toggle".split(" ").concat(ni));function bc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Wg(r,t,void 0,e),e.currentTarget=null}function Ch(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 l=void 0;if(t)for(var s=r.length-1;0<=s;s--){var o=r[s],u=o.instance,d=o.currentTarget;if(o=o.listener,u!==l&&i.isPropagationStopped())break e;bc(i,o,d),l=u}else for(s=0;s<r.length;s++){if(o=r[s],u=o.instance,d=o.currentTarget,o=o.listener,u!==l&&i.isPropagationStopped())break e;bc(i,o,d),l=u}}}if(Il)throw e=_o,Il=!1,_o=null,e}function xe(e,t){var n=t[qo];n===void 0&&(n=t[qo]=new Set);var r=e+"__bubble";n.has(r)||(jh(t,e,2,!1),n.add(r))}function Qs(e,t,n){var r=0;t&&(r|=4),jh(n,e,r,t)}var Ji="_reactListening"+Math.random().toString(36).slice(2);function Ci(e){if(!e[Ji]){e[Ji]=!0,Af.forEach(function(n){n!=="selectionchange"&&(qy.has(n)||Qs(n,!1,e),Qs(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ji]||(t[Ji]=!0,Qs("selectionchange",!1,t))}}function jh(e,t,n,r){switch(ah(t)){case 1:var i=oy;break;case 4:i=ay;break;default:i=Qa}n=i.bind(null,t,n,e),i=void 0,!Do||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 qs(e,t,n,r,i){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;s=s.return}for(;o!==null;){if(s=On(o),s===null)return;if(u=s.tag,u===5||u===6){r=l=s;continue e}o=o.parentNode}}r=r.return}Yf(function(){var d=l,c=Ua(n),f=[];e:{var h=Sh.get(e);if(h!==void 0){var m=Ya,p=e;switch(e){case"keypress":if(gl(n)===0)break e;case"keydown":case"keyup":m=Sy;break;case"focusin":p="focus",m=$s;break;case"focusout":p="blur",m=$s;break;case"beforeblur":case"afterblur":m=$s;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=cc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=dy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Ny;break;case vh:case kh:case wh:m=my;break;case bh:m=Ty;break;case"scroll":m=uy;break;case"wheel":m=Iy;break;case"copy":case"cut":case"paste":m=gy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=fc}var x=(t&4)!==0,S=!x&&e==="scroll",y=x?h!==null?h+"Capture":null:h;x=[];for(var g=d,v;g!==null;){v=g;var C=v.stateNode;if(v.tag===5&&C!==null&&(v=C,y!==null&&(C=xi(g,y),C!=null&&x.push(ji(g,C,v)))),S)break;g=g.return}0<x.length&&(h=new m(h,p,null,n,c),f.push({event:h,listeners:x}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Lo&&(p=n.relatedTarget||n.fromElement)&&(On(p)||p[en]))break e;if((m||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,m?(p=n.relatedTarget||n.toElement,m=d,p=p?On(p):null,p!==null&&(S=er(p),p!==S||p.tag!==5&&p.tag!==6)&&(p=null)):(m=null,p=d),m!==p)){if(x=cc,C="onMouseLeave",y="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(x=fc,C="onPointerLeave",y="onPointerEnter",g="pointer"),S=m==null?h:dr(m),v=p==null?h:dr(p),h=new x(C,g+"leave",m,n,c),h.target=S,h.relatedTarget=v,C=null,On(c)===d&&(x=new x(y,g+"enter",p,n,c),x.target=v,x.relatedTarget=S,C=x),S=C,m&&p)t:{for(x=m,y=p,g=0,v=x;v;v=ir(v))g++;for(v=0,C=y;C;C=ir(C))v++;for(;0<g-v;)x=ir(x),g--;for(;0<v-g;)y=ir(y),v--;for(;g--;){if(x===y||y!==null&&x===y.alternate)break t;x=ir(x),y=ir(y)}x=null}else x=null;m!==null&&Sc(f,h,m,x,!1),p!==null&&S!==null&&Sc(f,S,p,x,!0)}}e:{if(h=d?dr(d):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var z=_y;else if(pc(h))if(mh)z=By;else{z=Fy;var N=Oy}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(z=$y);if(z&&(z=z(e,d))){hh(f,z,n,c);break e}N&&N(e,h,d),e==="focusout"&&(N=h._wrapperState)&&N.controlled&&h.type==="number"&&zo(h,"number",h.value)}switch(N=d?dr(d):window,e){case"focusin":(pc(N)||N.contentEditable==="true")&&(ur=N,Bo=d,oi=null);break;case"focusout":oi=Bo=ur=null;break;case"mousedown":Uo=!0;break;case"contextmenu":case"mouseup":case"dragend":Uo=!1,kc(f,n,c);break;case"selectionchange":if(Vy)break;case"keydown":case"keyup":kc(f,n,c)}var P;if(Ga)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else ar?dh(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(ch&&n.locale!=="ko"&&(ar||M!=="onCompositionStart"?M==="onCompositionEnd"&&ar&&(P=uh()):(fn=c,qa="value"in fn?fn.value:fn.textContent,ar=!0)),N=Rl(d,M),0<N.length&&(M=new dc(M,e,null,n,c),f.push({event:M,listeners:N}),P?M.data=P:(P=fh(n),P!==null&&(M.data=P)))),(P=Ay?My(e,n):Ly(e,n))&&(d=Rl(d,"onBeforeInput"),0<d.length&&(c=new dc("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:d}),c.data=P))}Ch(f,t)})}function ji(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Rl(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,l=i.stateNode;i.tag===5&&l!==null&&(i=l,l=xi(e,n),l!=null&&r.unshift(ji(e,l,i)),l=xi(e,t),l!=null&&r.push(ji(e,l,i))),e=e.return}return r}function ir(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Sc(e,t,n,r,i){for(var l=t._reactName,s=[];n!==null&&n!==r;){var o=n,u=o.alternate,d=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&d!==null&&(o=d,i?(u=xi(n,l),u!=null&&s.unshift(ji(n,u,o))):i||(u=xi(n,l),u!=null&&s.push(ji(n,u,o)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Yy=/\r\n?/g,Ky=/\u0000|\uFFFD/g;function Cc(e){return(typeof e=="string"?e:""+e).replace(Yy,`
38
+ `).replace(Ky,"")}function el(e,t,n){if(t=Cc(t),Cc(e)!==t&&n)throw Error(_(425))}function Dl(){}var Ho=null,Vo=null;function Wo(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 Qo=typeof setTimeout=="function"?setTimeout:void 0,Gy=typeof clearTimeout=="function"?clearTimeout:void 0,jc=typeof Promise=="function"?Promise:void 0,Xy=typeof queueMicrotask=="function"?queueMicrotask:typeof jc<"u"?function(e){return jc.resolve(null).then(e).catch(Zy)}:Qo;function Zy(e){setTimeout(function(){throw e})}function Ys(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),wi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);wi(t)}function yn(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 Nc(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 _r=Math.random().toString(36).slice(2),Ut="__reactFiber$"+_r,Ni="__reactProps$"+_r,en="__reactContainer$"+_r,qo="__reactEvents$"+_r,Jy="__reactListeners$"+_r,e1="__reactHandles$"+_r;function On(e){var t=e[Ut];if(t)return t;for(var n=e.parentNode;n;){if(t=n[en]||n[Ut]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Nc(e);e!==null;){if(n=e[Ut])return n;e=Nc(e)}return t}e=n,n=e.parentNode}return null}function Oi(e){return e=e[Ut]||e[en],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function dr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function hs(e){return e[Ni]||null}var Yo=[],fr=-1;function jn(e){return{current:e}}function ve(e){0>fr||(e.current=Yo[fr],Yo[fr]=null,fr--)}function ge(e,t){fr++,Yo[fr]=e.current,e.current=t}var Sn={},We=jn(Sn),st=jn(!1),Wn=Sn;function Er(e,t){var n=e.type.contextTypes;if(!n)return Sn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ot(e){return e=e.childContextTypes,e!=null}function _l(){ve(st),ve(We)}function Ec(e,t,n){if(We.current!==Sn)throw Error(_(168));ge(We,t),ge(st,n)}function Nh(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(_(108,Og(e)||"Unknown",i));return je({},n,r)}function Ol(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Sn,Wn=We.current,ge(We,e),ge(st,st.current),!0}function Tc(e,t,n){var r=e.stateNode;if(!r)throw Error(_(169));n?(e=Nh(e,t,Wn),r.__reactInternalMemoizedMergedChildContext=e,ve(st),ve(We),ge(We,e)):ve(st),ge(st,n)}var Kt=null,ms=!1,Ks=!1;function Eh(e){Kt===null?Kt=[e]:Kt.push(e)}function t1(e){ms=!0,Eh(e)}function Nn(){if(!Ks&&Kt!==null){Ks=!0;var e=0,t=he;try{var n=Kt;for(he=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Kt=null,ms=!1}catch(i){throw Kt!==null&&(Kt=Kt.slice(e+1)),Zf(Ha,Nn),i}finally{he=t,Ks=!1}}return null}var hr=[],mr=0,Fl=null,$l=0,wt=[],bt=0,Qn=null,Gt=1,Xt="";function Ln(e,t){hr[mr++]=$l,hr[mr++]=Fl,Fl=e,$l=t}function Th(e,t,n){wt[bt++]=Gt,wt[bt++]=Xt,wt[bt++]=Qn,Qn=e;var r=Gt;e=Xt;var i=32-Mt(r)-1;r&=~(1<<i),n+=1;var l=32-Mt(t)+i;if(30<l){var s=i-i%5;l=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Gt=1<<32-Mt(t)+i|n<<i|r,Xt=l+e}else Gt=1<<l|n<<i|r,Xt=e}function Za(e){e.return!==null&&(Ln(e,1),Th(e,1,0))}function Ja(e){for(;e===Fl;)Fl=hr[--mr],hr[mr]=null,$l=hr[--mr],hr[mr]=null;for(;e===Qn;)Qn=wt[--bt],wt[bt]=null,Xt=wt[--bt],wt[bt]=null,Gt=wt[--bt],wt[bt]=null}var mt=null,ht=null,we=!1,At=null;function zh(e,t){var n=Ct(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 zc(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,mt=e,ht=yn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,mt=e,ht=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Qn!==null?{id:Gt,overflow:Xt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ct(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,mt=e,ht=null,!0):!1;default:return!1}}function Ko(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Go(e){if(we){var t=ht;if(t){var n=t;if(!zc(e,t)){if(Ko(e))throw Error(_(418));t=yn(n.nextSibling);var r=mt;t&&zc(e,t)?zh(r,n):(e.flags=e.flags&-4097|2,we=!1,mt=e)}}else{if(Ko(e))throw Error(_(418));e.flags=e.flags&-4097|2,we=!1,mt=e}}}function Ic(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;mt=e}function tl(e){if(e!==mt)return!1;if(!we)return Ic(e),we=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Wo(e.type,e.memoizedProps)),t&&(t=ht)){if(Ko(e))throw Ih(),Error(_(418));for(;t;)zh(e,t),t=yn(t.nextSibling)}if(Ic(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ht=yn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ht=null}}else ht=mt?yn(e.stateNode.nextSibling):null;return!0}function Ih(){for(var e=ht;e;)e=yn(e.nextSibling)}function Tr(){ht=mt=null,we=!1}function eu(e){At===null?At=[e]:At.push(e)}var n1=rn.ReactCurrentBatchConfig;function Yr(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(_(309));var r=n.stateNode}if(!r)throw Error(_(147,e));var i=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(s){var o=i.refs;s===null?delete o[l]:o[l]=s},t._stringRef=l,t)}if(typeof e!="string")throw Error(_(284));if(!n._owner)throw Error(_(290,e))}return e}function nl(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Pc(e){var t=e._init;return t(e._payload)}function Ph(e){function t(y,g){if(e){var v=y.deletions;v===null?(y.deletions=[g],y.flags|=16):v.push(g)}}function n(y,g){if(!e)return null;for(;g!==null;)t(y,g),g=g.sibling;return null}function r(y,g){for(y=new Map;g!==null;)g.key!==null?y.set(g.key,g):y.set(g.index,g),g=g.sibling;return y}function i(y,g){return y=wn(y,g),y.index=0,y.sibling=null,y}function l(y,g,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<g?(y.flags|=2,g):v):(y.flags|=2,g)):(y.flags|=1048576,g)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function o(y,g,v,C){return g===null||g.tag!==6?(g=no(v,y.mode,C),g.return=y,g):(g=i(g,v),g.return=y,g)}function u(y,g,v,C){var z=v.type;return z===or?c(y,g,v.props.children,C,v.key):g!==null&&(g.elementType===z||typeof z=="object"&&z!==null&&z.$$typeof===an&&Pc(z)===g.type)?(C=i(g,v.props),C.ref=Yr(y,g,v),C.return=y,C):(C=Sl(v.type,v.key,v.props,null,y.mode,C),C.ref=Yr(y,g,v),C.return=y,C)}function d(y,g,v,C){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=ro(v,y.mode,C),g.return=y,g):(g=i(g,v.children||[]),g.return=y,g)}function c(y,g,v,C,z){return g===null||g.tag!==7?(g=Hn(v,y.mode,C,z),g.return=y,g):(g=i(g,v),g.return=y,g)}function f(y,g,v){if(typeof g=="string"&&g!==""||typeof g=="number")return g=no(""+g,y.mode,v),g.return=y,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Wi:return v=Sl(g.type,g.key,g.props,null,y.mode,v),v.ref=Yr(y,null,g),v.return=y,v;case sr:return g=ro(g,y.mode,v),g.return=y,g;case an:var C=g._init;return f(y,C(g._payload),v)}if(ei(g)||Hr(g))return g=Hn(g,y.mode,v,null),g.return=y,g;nl(y,g)}return null}function h(y,g,v,C){var z=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return z!==null?null:o(y,g,""+v,C);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Wi:return v.key===z?u(y,g,v,C):null;case sr:return v.key===z?d(y,g,v,C):null;case an:return z=v._init,h(y,g,z(v._payload),C)}if(ei(v)||Hr(v))return z!==null?null:c(y,g,v,C,null);nl(y,v)}return null}function m(y,g,v,C,z){if(typeof C=="string"&&C!==""||typeof C=="number")return y=y.get(v)||null,o(g,y,""+C,z);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Wi:return y=y.get(C.key===null?v:C.key)||null,u(g,y,C,z);case sr:return y=y.get(C.key===null?v:C.key)||null,d(g,y,C,z);case an:var N=C._init;return m(y,g,v,N(C._payload),z)}if(ei(C)||Hr(C))return y=y.get(v)||null,c(g,y,C,z,null);nl(g,C)}return null}function p(y,g,v,C){for(var z=null,N=null,P=g,M=g=0,T=null;P!==null&&M<v.length;M++){P.index>M?(T=P,P=null):T=P.sibling;var k=h(y,P,v[M],C);if(k===null){P===null&&(P=T);break}e&&P&&k.alternate===null&&t(y,P),g=l(k,g,M),N===null?z=k:N.sibling=k,N=k,P=T}if(M===v.length)return n(y,P),we&&Ln(y,M),z;if(P===null){for(;M<v.length;M++)P=f(y,v[M],C),P!==null&&(g=l(P,g,M),N===null?z=P:N.sibling=P,N=P);return we&&Ln(y,M),z}for(P=r(y,P);M<v.length;M++)T=m(P,y,M,v[M],C),T!==null&&(e&&T.alternate!==null&&P.delete(T.key===null?M:T.key),g=l(T,g,M),N===null?z=T:N.sibling=T,N=T);return e&&P.forEach(function(j){return t(y,j)}),we&&Ln(y,M),z}function x(y,g,v,C){var z=Hr(v);if(typeof z!="function")throw Error(_(150));if(v=z.call(v),v==null)throw Error(_(151));for(var N=z=null,P=g,M=g=0,T=null,k=v.next();P!==null&&!k.done;M++,k=v.next()){P.index>M?(T=P,P=null):T=P.sibling;var j=h(y,P,k.value,C);if(j===null){P===null&&(P=T);break}e&&P&&j.alternate===null&&t(y,P),g=l(j,g,M),N===null?z=j:N.sibling=j,N=j,P=T}if(k.done)return n(y,P),we&&Ln(y,M),z;if(P===null){for(;!k.done;M++,k=v.next())k=f(y,k.value,C),k!==null&&(g=l(k,g,M),N===null?z=k:N.sibling=k,N=k);return we&&Ln(y,M),z}for(P=r(y,P);!k.done;M++,k=v.next())k=m(P,y,M,k.value,C),k!==null&&(e&&k.alternate!==null&&P.delete(k.key===null?M:k.key),g=l(k,g,M),N===null?z=k:N.sibling=k,N=k);return e&&P.forEach(function(I){return t(y,I)}),we&&Ln(y,M),z}function S(y,g,v,C){if(typeof v=="object"&&v!==null&&v.type===or&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Wi:e:{for(var z=v.key,N=g;N!==null;){if(N.key===z){if(z=v.type,z===or){if(N.tag===7){n(y,N.sibling),g=i(N,v.props.children),g.return=y,y=g;break e}}else if(N.elementType===z||typeof z=="object"&&z!==null&&z.$$typeof===an&&Pc(z)===N.type){n(y,N.sibling),g=i(N,v.props),g.ref=Yr(y,N,v),g.return=y,y=g;break e}n(y,N);break}else t(y,N);N=N.sibling}v.type===or?(g=Hn(v.props.children,y.mode,C,v.key),g.return=y,y=g):(C=Sl(v.type,v.key,v.props,null,y.mode,C),C.ref=Yr(y,g,v),C.return=y,y=C)}return s(y);case sr:e:{for(N=v.key;g!==null;){if(g.key===N)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(y,g.sibling),g=i(g,v.children||[]),g.return=y,y=g;break e}else{n(y,g);break}else t(y,g);g=g.sibling}g=ro(v,y.mode,C),g.return=y,y=g}return s(y);case an:return N=v._init,S(y,g,N(v._payload),C)}if(ei(v))return p(y,g,v,C);if(Hr(v))return x(y,g,v,C);nl(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,g!==null&&g.tag===6?(n(y,g.sibling),g=i(g,v),g.return=y,y=g):(n(y,g),g=no(v,y.mode,C),g.return=y,y=g),s(y)):n(y,g)}return S}var zr=Ph(!0),Ah=Ph(!1),Bl=jn(null),Ul=null,pr=null,tu=null;function nu(){tu=pr=Ul=null}function ru(e){var t=Bl.current;ve(Bl),e._currentValue=t}function Xo(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 Sr(e,t){Ul=e,tu=pr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(lt=!0),e.firstContext=null)}function Nt(e){var t=e._currentValue;if(tu!==e)if(e={context:e,memoizedValue:t,next:null},pr===null){if(Ul===null)throw Error(_(308));pr=e,Ul.dependencies={lanes:0,firstContext:e}}else pr=pr.next=e;return t}var Fn=null;function iu(e){Fn===null?Fn=[e]:Fn.push(e)}function Mh(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,iu(t)):(n.next=i.next,i.next=n),t.interleaved=n,tn(e,r)}function tn(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 un=!1;function lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Lh(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 Zt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,tn(e,n)}return i=r.interleaved,i===null?(t.next=t,iu(r)):(t.next=i.next,i.next=t),r.interleaved=t,tn(e,n)}function yl(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,Va(e,n)}}function Ac(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,l=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};l===null?i=l=s:l=l.next=s,n=n.next}while(n!==null);l===null?i=l=t:l=l.next=t}else i=l=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:l,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 Hl(e,t,n,r){var i=e.updateQueue;un=!1;var l=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var u=o,d=u.next;u.next=null,s===null?l=d:s.next=d,s=u;var c=e.alternate;c!==null&&(c=c.updateQueue,o=c.lastBaseUpdate,o!==s&&(o===null?c.firstBaseUpdate=d:o.next=d,c.lastBaseUpdate=u))}if(l!==null){var f=i.baseState;s=0,c=d=u=null,o=l;do{var h=o.lane,m=o.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,x=o;switch(h=t,m=n,x.tag){case 1:if(p=x.payload,typeof p=="function"){f=p.call(m,f,h);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=x.payload,h=typeof p=="function"?p.call(m,f,h):p,h==null)break e;f=je({},f,h);break e;case 2:un=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[o]:h.push(o))}else m={eventTime:m,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},c===null?(d=c=m,u=f):c=c.next=m,s|=h;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(u=f),i.baseState=u,i.firstBaseUpdate=d,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);Yn|=s,e.lanes=s,e.memoizedState=f}}function Mc(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(_(191,i));i.call(r)}}}var Fi={},Vt=jn(Fi),Ei=jn(Fi),Ti=jn(Fi);function $n(e){if(e===Fi)throw Error(_(174));return e}function su(e,t){switch(ge(Ti,t),ge(Ei,e),ge(Vt,Fi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Po(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Po(t,e)}ve(Vt),ge(Vt,t)}function Ir(){ve(Vt),ve(Ei),ve(Ti)}function Rh(e){$n(Ti.current);var t=$n(Vt.current),n=Po(t,e.type);t!==n&&(ge(Ei,e),ge(Vt,n))}function ou(e){Ei.current===e&&(ve(Vt),ve(Ei))}var Se=jn(0);function Vl(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 Gs=[];function au(){for(var e=0;e<Gs.length;e++)Gs[e]._workInProgressVersionPrimary=null;Gs.length=0}var xl=rn.ReactCurrentDispatcher,Xs=rn.ReactCurrentBatchConfig,qn=0,Ce=null,Me=null,Re=null,Wl=!1,ai=!1,zi=0,r1=0;function Be(){throw Error(_(321))}function uu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dt(e[n],t[n]))return!1;return!0}function cu(e,t,n,r,i,l){if(qn=l,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,xl.current=e===null||e.memoizedState===null?o1:a1,e=n(r,i),ai){l=0;do{if(ai=!1,zi=0,25<=l)throw Error(_(301));l+=1,Re=Me=null,t.updateQueue=null,xl.current=u1,e=n(r,i)}while(ai)}if(xl.current=Ql,t=Me!==null&&Me.next!==null,qn=0,Re=Me=Ce=null,Wl=!1,t)throw Error(_(300));return e}function du(){var e=zi!==0;return zi=0,e}function $t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Re===null?Ce.memoizedState=Re=e:Re=Re.next=e,Re}function Et(){if(Me===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var t=Re===null?Ce.memoizedState:Re.next;if(t!==null)Re=t,Me=e;else{if(e===null)throw Error(_(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},Re===null?Ce.memoizedState=Re=e:Re=Re.next=e}return Re}function Ii(e,t){return typeof t=="function"?t(e):t}function Zs(e){var t=Et(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=Me,i=r.baseQueue,l=n.pending;if(l!==null){if(i!==null){var s=i.next;i.next=l.next,l.next=s}r.baseQueue=i=l,n.pending=null}if(i!==null){l=i.next,r=r.baseState;var o=s=null,u=null,d=l;do{var c=d.lane;if((qn&c)===c)u!==null&&(u=u.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var f={lane:c,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(o=u=f,s=r):u=u.next=f,Ce.lanes|=c,Yn|=c}d=d.next}while(d!==null&&d!==l);u===null?s=r:u.next=o,Dt(r,t.memoizedState)||(lt=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do l=i.lane,Ce.lanes|=l,Yn|=l,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Js(e){var t=Et(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,l=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do l=e(l,s.action),s=s.next;while(s!==i);Dt(l,t.memoizedState)||(lt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function Dh(){}function _h(e,t){var n=Ce,r=Et(),i=t(),l=!Dt(r.memoizedState,i);if(l&&(r.memoizedState=i,lt=!0),r=r.queue,fu($h.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||Re!==null&&Re.memoizedState.tag&1){if(n.flags|=2048,Pi(9,Fh.bind(null,n,r,i,t),void 0,null),De===null)throw Error(_(349));qn&30||Oh(n,t,i)}return i}function Oh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ce.updateQueue,t===null?(t={lastEffect:null,stores:null},Ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Fh(e,t,n,r){t.value=n,t.getSnapshot=r,Bh(t)&&Uh(e)}function $h(e,t,n){return n(function(){Bh(t)&&Uh(e)})}function Bh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dt(e,n)}catch{return!0}}function Uh(e){var t=tn(e,1);t!==null&&Lt(t,e,1,-1)}function Lc(e){var t=$t();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ii,lastRenderedState:e},t.queue=e,e=e.dispatch=s1.bind(null,Ce,e),[t.memoizedState,e]}function Pi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ce.updateQueue,t===null?(t={lastEffect:null,stores:null},Ce.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 Hh(){return Et().memoizedState}function vl(e,t,n,r){var i=$t();Ce.flags|=e,i.memoizedState=Pi(1|t,n,void 0,r===void 0?null:r)}function ps(e,t,n,r){var i=Et();r=r===void 0?null:r;var l=void 0;if(Me!==null){var s=Me.memoizedState;if(l=s.destroy,r!==null&&uu(r,s.deps)){i.memoizedState=Pi(t,n,l,r);return}}Ce.flags|=e,i.memoizedState=Pi(1|t,n,l,r)}function Rc(e,t){return vl(8390656,8,e,t)}function fu(e,t){return ps(2048,8,e,t)}function Vh(e,t){return ps(4,2,e,t)}function Wh(e,t){return ps(4,4,e,t)}function Qh(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 qh(e,t,n){return n=n!=null?n.concat([e]):null,ps(4,4,Qh.bind(null,t,e),n)}function hu(){}function Yh(e,t){var n=Et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&uu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Kh(e,t){var n=Et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&uu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Gh(e,t,n){return qn&21?(Dt(n,t)||(n=th(),Ce.lanes|=n,Yn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,lt=!0),e.memoizedState=n)}function i1(e,t){var n=he;he=n!==0&&4>n?n:4,e(!0);var r=Xs.transition;Xs.transition={};try{e(!1),t()}finally{he=n,Xs.transition=r}}function Xh(){return Et().memoizedState}function l1(e,t,n){var r=kn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Zh(e))Jh(t,n);else if(n=Mh(e,t,n,r),n!==null){var i=Xe();Lt(n,e,r,i),em(n,t,r)}}function s1(e,t,n){var r=kn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zh(e))Jh(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var s=t.lastRenderedState,o=l(s,n);if(i.hasEagerState=!0,i.eagerState=o,Dt(o,s)){var u=t.interleaved;u===null?(i.next=i,iu(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=Mh(e,t,i,r),n!==null&&(i=Xe(),Lt(n,e,r,i),em(n,t,r))}}function Zh(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function Jh(e,t){ai=Wl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function em(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Va(e,n)}}var Ql={readContext:Nt,useCallback:Be,useContext:Be,useEffect:Be,useImperativeHandle:Be,useInsertionEffect:Be,useLayoutEffect:Be,useMemo:Be,useReducer:Be,useRef:Be,useState:Be,useDebugValue:Be,useDeferredValue:Be,useTransition:Be,useMutableSource:Be,useSyncExternalStore:Be,useId:Be,unstable_isNewReconciler:!1},o1={readContext:Nt,useCallback:function(e,t){return $t().memoizedState=[e,t===void 0?null:t],e},useContext:Nt,useEffect:Rc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,vl(4194308,4,Qh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vl(4194308,4,e,t)},useInsertionEffect:function(e,t){return vl(4,2,e,t)},useMemo:function(e,t){var n=$t();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=$t();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=l1.bind(null,Ce,e),[r.memoizedState,e]},useRef:function(e){var t=$t();return e={current:e},t.memoizedState=e},useState:Lc,useDebugValue:hu,useDeferredValue:function(e){return $t().memoizedState=e},useTransition:function(){var e=Lc(!1),t=e[0];return e=i1.bind(null,e[1]),$t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ce,i=$t();if(we){if(n===void 0)throw Error(_(407));n=n()}else{if(n=t(),De===null)throw Error(_(349));qn&30||Oh(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,Rc($h.bind(null,r,l,e),[e]),r.flags|=2048,Pi(9,Fh.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=$t(),t=De.identifierPrefix;if(we){var n=Xt,r=Gt;n=(r&~(1<<32-Mt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=zi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=r1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},a1={readContext:Nt,useCallback:Yh,useContext:Nt,useEffect:fu,useImperativeHandle:qh,useInsertionEffect:Vh,useLayoutEffect:Wh,useMemo:Kh,useReducer:Zs,useRef:Hh,useState:function(){return Zs(Ii)},useDebugValue:hu,useDeferredValue:function(e){var t=Et();return Gh(t,Me.memoizedState,e)},useTransition:function(){var e=Zs(Ii)[0],t=Et().memoizedState;return[e,t]},useMutableSource:Dh,useSyncExternalStore:_h,useId:Xh,unstable_isNewReconciler:!1},u1={readContext:Nt,useCallback:Yh,useContext:Nt,useEffect:fu,useImperativeHandle:qh,useInsertionEffect:Vh,useLayoutEffect:Wh,useMemo:Kh,useReducer:Js,useRef:Hh,useState:function(){return Js(Ii)},useDebugValue:hu,useDeferredValue:function(e){var t=Et();return Me===null?t.memoizedState=e:Gh(t,Me.memoizedState,e)},useTransition:function(){var e=Js(Ii)[0],t=Et().memoizedState;return[e,t]},useMutableSource:Dh,useSyncExternalStore:_h,useId:Xh,unstable_isNewReconciler:!1};function It(e,t){if(e&&e.defaultProps){t=je({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Zo(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var gs={isMounted:function(e){return(e=e._reactInternals)?er(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Xe(),i=kn(e),l=Zt(r,i);l.payload=t,n!=null&&(l.callback=n),t=xn(e,l,i),t!==null&&(Lt(t,e,i,r),yl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Xe(),i=kn(e),l=Zt(r,i);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=xn(e,l,i),t!==null&&(Lt(t,e,i,r),yl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xe(),r=kn(e),i=Zt(n,r);i.tag=2,t!=null&&(i.callback=t),t=xn(e,i,r),t!==null&&(Lt(t,e,r,n),yl(t,e,r))}};function Dc(e,t,n,r,i,l,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,s):t.prototype&&t.prototype.isPureReactComponent?!Si(n,r)||!Si(i,l):!0}function tm(e,t,n){var r=!1,i=Sn,l=t.contextType;return typeof l=="object"&&l!==null?l=Nt(l):(i=ot(t)?Wn:We.current,r=t.contextTypes,l=(r=r!=null)?Er(e,i):Sn),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=gs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=l),t}function _c(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&&gs.enqueueReplaceState(t,t.state,null)}function Jo(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},lu(e);var l=t.contextType;typeof l=="object"&&l!==null?i.context=Nt(l):(l=ot(t)?Wn:We.current,i.context=Er(e,l)),i.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(Zo(e,t,l,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&&gs.enqueueReplaceState(i,i.state,null),Hl(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Pr(e,t){try{var n="",r=t;do n+=_g(r),r=r.return;while(r);var i=n}catch(l){i=`
39
+ Error generating stack: `+l.message+`
40
+ `+l.stack}return{value:e,source:t,stack:i,digest:null}}function eo(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ea(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var c1=typeof WeakMap=="function"?WeakMap:Map;function nm(e,t,n){n=Zt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Yl||(Yl=!0,ca=r),ea(e,t)},n}function rm(e,t,n){n=Zt(-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(){ea(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){ea(e,t),typeof r!="function"&&(vn===null?vn=new Set([this]):vn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Oc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new c1;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=C1.bind(null,e,t,n),t.then(e,e))}function Fc(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 $c(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=Zt(-1,1),t.tag=2,xn(n,t,1))),n.lanes|=1),e)}var d1=rn.ReactCurrentOwner,lt=!1;function Ke(e,t,n,r){t.child=e===null?Ah(t,null,n,r):zr(t,e.child,n,r)}function Bc(e,t,n,r,i){n=n.render;var l=t.ref;return Sr(t,i),r=cu(e,t,n,r,l,i),n=du(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,nn(e,t,i)):(we&&n&&Za(t),t.flags|=1,Ke(e,t,r,i),t.child)}function Uc(e,t,n,r,i){if(e===null){var l=n.type;return typeof l=="function"&&!wu(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,im(e,t,l,r,i)):(e=Sl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&i)){var s=l.memoizedProps;if(n=n.compare,n=n!==null?n:Si,n(s,r)&&e.ref===t.ref)return nn(e,t,i)}return t.flags|=1,e=wn(l,r),e.ref=t.ref,e.return=t,t.child=e}function im(e,t,n,r,i){if(e!==null){var l=e.memoizedProps;if(Si(l,r)&&e.ref===t.ref)if(lt=!1,t.pendingProps=r=l,(e.lanes&i)!==0)e.flags&131072&&(lt=!0);else return t.lanes=e.lanes,nn(e,t,i)}return ta(e,t,n,r,i)}function lm(e,t,n){var r=t.pendingProps,i=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ge(yr,ft),ft|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ge(yr,ft),ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,ge(yr,ft),ft|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,ge(yr,ft),ft|=r;return Ke(e,t,i,n),t.child}function sm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ta(e,t,n,r,i){var l=ot(n)?Wn:We.current;return l=Er(t,l),Sr(t,i),n=cu(e,t,n,r,l,i),r=du(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,nn(e,t,i)):(we&&r&&Za(t),t.flags|=1,Ke(e,t,n,i),t.child)}function Hc(e,t,n,r,i){if(ot(n)){var l=!0;Ol(t)}else l=!1;if(Sr(t,i),t.stateNode===null)kl(e,t),tm(t,n,r),Jo(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,o=t.memoizedProps;s.props=o;var u=s.context,d=n.contextType;typeof d=="object"&&d!==null?d=Nt(d):(d=ot(n)?Wn:We.current,d=Er(t,d));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==r||u!==d)&&_c(t,s,r,d),un=!1;var h=t.memoizedState;s.state=h,Hl(t,r,s,i),u=t.memoizedState,o!==r||h!==u||st.current||un?(typeof c=="function"&&(Zo(t,n,c,r),u=t.memoizedState),(o=un||Dc(t,n,o,r,h,u,d))?(f||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=u),s.props=r,s.state=u,s.context=d,r=o):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Lh(e,t),o=t.memoizedProps,d=t.type===t.elementType?o:It(t.type,o),s.props=d,f=t.pendingProps,h=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=Nt(u):(u=ot(n)?Wn:We.current,u=Er(t,u));var m=n.getDerivedStateFromProps;(c=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==f||h!==u)&&_c(t,s,r,u),un=!1,h=t.memoizedState,s.state=h,Hl(t,r,s,i);var p=t.memoizedState;o!==f||h!==p||st.current||un?(typeof m=="function"&&(Zo(t,n,m,r),p=t.memoizedState),(d=un||Dc(t,n,d,r,h,p,u)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,p,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,p,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),s.props=r,s.state=p,s.context=u,r=d):(typeof s.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return na(e,t,n,r,l,i)}function na(e,t,n,r,i,l){sm(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&Tc(t,n,!1),nn(e,t,l);r=t.stateNode,d1.current=t;var o=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=zr(t,e.child,null,l),t.child=zr(t,null,o,l)):Ke(e,t,o,l),t.memoizedState=r.state,i&&Tc(t,n,!0),t.child}function om(e){var t=e.stateNode;t.pendingContext?Ec(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ec(e,t.context,!1),su(e,t.containerInfo)}function Vc(e,t,n,r,i){return Tr(),eu(i),t.flags|=256,Ke(e,t,n,r),t.child}var ra={dehydrated:null,treeContext:null,retryLane:0};function ia(e){return{baseLanes:e,cachePool:null,transitions:null}}function am(e,t,n){var r=t.pendingProps,i=Se.current,l=!1,s=(t.flags&128)!==0,o;if((o=s)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ge(Se,i&1),e===null)return Go(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,l?(r=t.mode,l=t.child,s={mode:"hidden",children:s},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=s):l=vs(s,r,0,null),e=Hn(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=ia(n),t.memoizedState=ra,e):mu(t,s));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return f1(e,t,s,r,o,i,n);if(l){l=r.fallback,s=t.mode,i=e.child,o=i.sibling;var u={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=wn(i,u),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?l=wn(o,l):(l=Hn(l,s,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,s=e.child.memoizedState,s=s===null?ia(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},l.memoizedState=s,l.childLanes=e.childLanes&~n,t.memoizedState=ra,r}return l=e.child,e=l.sibling,r=wn(l,{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 mu(e,t){return t=vs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rl(e,t,n,r){return r!==null&&eu(r),zr(t,e.child,null,n),e=mu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function f1(e,t,n,r,i,l,s){if(n)return t.flags&256?(t.flags&=-257,r=eo(Error(_(422))),rl(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,i=t.mode,r=vs({mode:"visible",children:r.children},i,0,null),l=Hn(l,i,s,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&zr(t,e.child,null,s),t.child.memoizedState=ia(s),t.memoizedState=ra,l);if(!(t.mode&1))return rl(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,l=Error(_(419)),r=eo(l,r,void 0),rl(e,t,s,r)}if(o=(s&e.childLanes)!==0,lt||o){if(r=De,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!==l.retryLane&&(l.retryLane=i,tn(e,i),Lt(r,e,i,-1))}return ku(),r=eo(Error(_(421))),rl(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=j1.bind(null,e),i._reactRetry=t,null):(e=l.treeContext,ht=yn(i.nextSibling),mt=t,we=!0,At=null,e!==null&&(wt[bt++]=Gt,wt[bt++]=Xt,wt[bt++]=Qn,Gt=e.id,Xt=e.overflow,Qn=t),t=mu(t,r.children),t.flags|=4096,t)}function Wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xo(e.return,t,n)}function to(e,t,n,r,i){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=i)}function um(e,t,n){var r=t.pendingProps,i=r.revealOrder,l=r.tail;if(Ke(e,t,r.children,n),r=Se.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&&Wc(e,n,t);else if(e.tag===19)Wc(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(ge(Se,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&&Vl(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),to(t,!1,i,n,l);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Vl(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}to(t,!0,n,null,l);break;case"together":to(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function kl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function nn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(_(153));if(t.child!==null){for(e=t.child,n=wn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function h1(e,t,n){switch(t.tag){case 3:om(t),Tr();break;case 5:Rh(t);break;case 1:ot(t.type)&&Ol(t);break;case 4:su(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ge(Bl,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ge(Se,Se.current&1),t.flags|=128,null):n&t.child.childLanes?am(e,t,n):(ge(Se,Se.current&1),e=nn(e,t,n),e!==null?e.sibling:null);ge(Se,Se.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return um(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ge(Se,Se.current),r)break;return null;case 22:case 23:return t.lanes=0,lm(e,t,n)}return nn(e,t,n)}var cm,la,dm,fm;cm=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}};la=function(){};dm=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,$n(Vt.current);var l=null;switch(n){case"input":i=Eo(e,i),r=Eo(e,r),l=[];break;case"select":i=je({},i,{value:void 0}),r=je({},r,{value:void 0}),l=[];break;case"textarea":i=Io(e,i),r=Io(e,r),l=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Dl)}Ao(n,r);var s;n=null;for(d in i)if(!r.hasOwnProperty(d)&&i.hasOwnProperty(d)&&i[d]!=null)if(d==="style"){var o=i[d];for(s in o)o.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(gi.hasOwnProperty(d)?l||(l=[]):(l=l||[]).push(d,null));for(d in r){var u=r[d];if(o=i!=null?i[d]:void 0,r.hasOwnProperty(d)&&u!==o&&(u!=null||o!=null))if(d==="style")if(o){for(s in o)!o.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&o[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(l||(l=[]),l.push(d,n)),n=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(l=l||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(l=l||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(gi.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&xe("scroll",e),l||o===u||(l=[])):(l=l||[]).push(d,u))}n&&(l=l||[]).push("style",n);var d=l;(t.updateQueue=d)&&(t.flags|=4)}};fm=function(e,t,n,r){n!==r&&(t.flags|=4)};function Kr(e,t){if(!we)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 Ue(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 m1(e,t,n){var r=t.pendingProps;switch(Ja(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return ot(t.type)&&_l(),Ue(t),null;case 3:return r=t.stateNode,Ir(),ve(st),ve(We),au(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(tl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,At!==null&&(ha(At),At=null))),la(e,t),Ue(t),null;case 5:ou(t);var i=$n(Ti.current);if(n=t.type,e!==null&&t.stateNode!=null)dm(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(_(166));return Ue(t),null}if(e=$n(Vt.current),tl(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Ut]=t,r[Ni]=l,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<ni.length;i++)xe(ni[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":ec(r,l),xe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},xe("invalid",r);break;case"textarea":nc(r,l),xe("invalid",r)}Ao(n,l),i=null;for(var s in l)if(l.hasOwnProperty(s)){var o=l[s];s==="children"?typeof o=="string"?r.textContent!==o&&(l.suppressHydrationWarning!==!0&&el(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(l.suppressHydrationWarning!==!0&&el(r.textContent,o,e),i=["children",""+o]):gi.hasOwnProperty(s)&&o!=null&&s==="onScroll"&&xe("scroll",r)}switch(n){case"input":Qi(r),tc(r,l,!0);break;case"textarea":Qi(r),rc(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Dl)}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=$f(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[Ut]=t,e[Ni]=r,cm(e,t,!1,!1),t.stateNode=e;e:{switch(s=Mo(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<ni.length;i++)xe(ni[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":ec(e,r),i=Eo(e,r),xe("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=je({},r,{value:void 0}),xe("invalid",e);break;case"textarea":nc(e,r),i=Io(e,r),xe("invalid",e);break;default:i=r}Ao(n,i),o=i;for(l in o)if(o.hasOwnProperty(l)){var u=o[l];l==="style"?Hf(e,u):l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Bf(e,u)):l==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&yi(e,u):typeof u=="number"&&yi(e,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(gi.hasOwnProperty(l)?u!=null&&l==="onScroll"&&xe("scroll",e):u!=null&&Oa(e,l,u,s))}switch(n){case"input":Qi(e),tc(e,r,!1);break;case"textarea":Qi(e),rc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+bn(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?vr(e,!!r.multiple,l,!1):r.defaultValue!=null&&vr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Dl)}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 Ue(t),null;case 6:if(e&&t.stateNode!=null)fm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(n=$n(Ti.current),$n(Vt.current),tl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ut]=t,(l=r.nodeValue!==n)&&(e=mt,e!==null))switch(e.tag){case 3:el(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&el(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ut]=t,t.stateNode=r}return Ue(t),null;case 13:if(ve(Se),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(we&&ht!==null&&t.mode&1&&!(t.flags&128))Ih(),Tr(),t.flags|=98560,l=!1;else if(l=tl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(_(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(_(317));l[Ut]=t}else Tr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ue(t),l=!1}else At!==null&&(ha(At),At=null),l=!0;if(!l)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||Se.current&1?Le===0&&(Le=3):ku())),t.updateQueue!==null&&(t.flags|=4),Ue(t),null);case 4:return Ir(),la(e,t),e===null&&Ci(t.stateNode.containerInfo),Ue(t),null;case 10:return ru(t.type._context),Ue(t),null;case 17:return ot(t.type)&&_l(),Ue(t),null;case 19:if(ve(Se),l=t.memoizedState,l===null)return Ue(t),null;if(r=(t.flags&128)!==0,s=l.rendering,s===null)if(r)Kr(l,!1);else{if(Le!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Vl(e),s!==null){for(t.flags|=128,Kr(l,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,s=l.alternate,s===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=s.childLanes,l.lanes=s.lanes,l.child=s.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=s.memoizedProps,l.memoizedState=s.memoizedState,l.updateQueue=s.updateQueue,l.type=s.type,e=s.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ge(Se,Se.current&1|2),t.child}e=e.sibling}l.tail!==null&&Te()>Ar&&(t.flags|=128,r=!0,Kr(l,!1),t.lanes=4194304)}else{if(!r)if(e=Vl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Kr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!we)return Ue(t),null}else 2*Te()-l.renderingStartTime>Ar&&n!==1073741824&&(t.flags|=128,r=!0,Kr(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(n=l.last,n!==null?n.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Te(),t.sibling=null,n=Se.current,ge(Se,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return vu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ft&1073741824&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function p1(e,t){switch(Ja(t),t.tag){case 1:return ot(t.type)&&_l(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ir(),ve(st),ve(We),au(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ou(t),null;case 13:if(ve(Se),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));Tr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ve(Se),null;case 4:return Ir(),null;case 10:return ru(t.type._context),null;case 22:case 23:return vu(),null;case 24:return null;default:return null}}var il=!1,He=!1,g1=typeof WeakSet=="function"?WeakSet:Set,U=null;function gr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ee(e,t,r)}else n.current=null}function sa(e,t,n){try{n()}catch(r){Ee(e,t,r)}}var Qc=!1;function y1(e,t){if(Ho=Ml,e=yh(),Xa(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,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var s=0,o=-1,u=-1,d=0,c=0,f=e,h=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(o=s+i),f!==l||r!==0&&f.nodeType!==3||(u=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++d===i&&(o=s),h===l&&++c===r&&(u=s),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Vo={focusedElem:e,selectionRange:n},Ml=!1,U=t;U!==null;)if(t=U,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,U=e;else for(;U!==null;){t=U;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var x=p.memoizedProps,S=p.memoizedState,y=t.stateNode,g=y.getSnapshotBeforeUpdate(t.elementType===t.type?x:It(t.type,x),S);y.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(C){Ee(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return p=Qc,Qc=!1,p}function ui(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 l=i.destroy;i.destroy=void 0,l!==void 0&&sa(t,n,l)}i=i.next}while(i!==r)}}function ys(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 oa(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 hm(e){var t=e.alternate;t!==null&&(e.alternate=null,hm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ut],delete t[Ni],delete t[qo],delete t[Jy],delete t[e1])),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 mm(e){return e.tag===5||e.tag===3||e.tag===4}function qc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mm(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 aa(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=Dl));else if(r!==4&&(e=e.child,e!==null))for(aa(e,t,n),e=e.sibling;e!==null;)aa(e,t,n),e=e.sibling}function ua(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(ua(e,t,n),e=e.sibling;e!==null;)ua(e,t,n),e=e.sibling}var Oe=null,Pt=!1;function sn(e,t,n){for(n=n.child;n!==null;)pm(e,t,n),n=n.sibling}function pm(e,t,n){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(us,n)}catch{}switch(n.tag){case 5:He||gr(n,t);case 6:var r=Oe,i=Pt;Oe=null,sn(e,t,n),Oe=r,Pt=i,Oe!==null&&(Pt?(e=Oe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Oe.removeChild(n.stateNode));break;case 18:Oe!==null&&(Pt?(e=Oe,n=n.stateNode,e.nodeType===8?Ys(e.parentNode,n):e.nodeType===1&&Ys(e,n),wi(e)):Ys(Oe,n.stateNode));break;case 4:r=Oe,i=Pt,Oe=n.stateNode.containerInfo,Pt=!0,sn(e,t,n),Oe=r,Pt=i;break;case 0:case 11:case 14:case 15:if(!He&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,s=l.destroy;l=l.tag,s!==void 0&&(l&2||l&4)&&sa(n,t,s),i=i.next}while(i!==r)}sn(e,t,n);break;case 1:if(!He&&(gr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Ee(n,t,o)}sn(e,t,n);break;case 21:sn(e,t,n);break;case 22:n.mode&1?(He=(r=He)||n.memoizedState!==null,sn(e,t,n),He=r):sn(e,t,n);break;default:sn(e,t,n)}}function Yc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new g1),t.forEach(function(r){var i=N1.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 l=e,s=t,o=s;e:for(;o!==null;){switch(o.tag){case 5:Oe=o.stateNode,Pt=!1;break e;case 3:Oe=o.stateNode.containerInfo,Pt=!0;break e;case 4:Oe=o.stateNode.containerInfo,Pt=!0;break e}o=o.return}if(Oe===null)throw Error(_(160));pm(l,s,i),Oe=null,Pt=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(d){Ee(i,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)gm(t,e),t=t.sibling}function gm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(zt(t,e),Ft(e),r&4){try{ui(3,e,e.return),ys(3,e)}catch(x){Ee(e,e.return,x)}try{ui(5,e,e.return)}catch(x){Ee(e,e.return,x)}}break;case 1:zt(t,e),Ft(e),r&512&&n!==null&&gr(n,n.return);break;case 5:if(zt(t,e),Ft(e),r&512&&n!==null&&gr(n,n.return),e.flags&32){var i=e.stateNode;try{yi(i,"")}catch(x){Ee(e,e.return,x)}}if(r&4&&(i=e.stateNode,i!=null)){var l=e.memoizedProps,s=n!==null?n.memoizedProps:l,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&l.type==="radio"&&l.name!=null&&Of(i,l),Mo(o,s);var d=Mo(o,l);for(s=0;s<u.length;s+=2){var c=u[s],f=u[s+1];c==="style"?Hf(i,f):c==="dangerouslySetInnerHTML"?Bf(i,f):c==="children"?yi(i,f):Oa(i,c,f,d)}switch(o){case"input":To(i,l);break;case"textarea":Ff(i,l);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!l.multiple;var m=l.value;m!=null?vr(i,!!l.multiple,m,!1):h!==!!l.multiple&&(l.defaultValue!=null?vr(i,!!l.multiple,l.defaultValue,!0):vr(i,!!l.multiple,l.multiple?[]:"",!1))}i[Ni]=l}catch(x){Ee(e,e.return,x)}}break;case 6:if(zt(t,e),Ft(e),r&4){if(e.stateNode===null)throw Error(_(162));i=e.stateNode,l=e.memoizedProps;try{i.nodeValue=l}catch(x){Ee(e,e.return,x)}}break;case 3:if(zt(t,e),Ft(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{wi(t.containerInfo)}catch(x){Ee(e,e.return,x)}break;case 4:zt(t,e),Ft(e);break;case 13:zt(t,e),Ft(e),i=e.child,i.flags&8192&&(l=i.memoizedState!==null,i.stateNode.isHidden=l,!l||i.alternate!==null&&i.alternate.memoizedState!==null||(yu=Te())),r&4&&Yc(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(He=(d=He)||c,zt(t,e),He=d):zt(t,e),Ft(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!c&&e.mode&1)for(U=e,c=e.child;c!==null;){for(f=U=c;U!==null;){switch(h=U,m=h.child,h.tag){case 0:case 11:case 14:case 15:ui(4,h,h.return);break;case 1:gr(h,h.return);var p=h.stateNode;if(typeof p.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(x){Ee(r,n,x)}}break;case 5:gr(h,h.return);break;case 22:if(h.memoizedState!==null){Gc(f);continue}}m!==null?(m.return=h,U=m):Gc(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{i=f.stateNode,d?(l=i.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(o=f.stateNode,u=f.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=Uf("display",s))}catch(x){Ee(e,e.return,x)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(x){Ee(e,e.return,x)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:zt(t,e),Ft(e),r&4&&Yc(e);break;case 21:break;default:zt(t,e),Ft(e)}}function Ft(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(mm(n)){var r=n;break e}n=n.return}throw Error(_(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(yi(i,""),r.flags&=-33);var l=qc(e);ua(e,l,i);break;case 3:case 4:var s=r.stateNode.containerInfo,o=qc(e);aa(e,o,s);break;default:throw Error(_(161))}}catch(u){Ee(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function x1(e,t,n){U=e,ym(e)}function ym(e,t,n){for(var r=(e.mode&1)!==0;U!==null;){var i=U,l=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||il;if(!s){var o=i.alternate,u=o!==null&&o.memoizedState!==null||He;o=il;var d=He;if(il=s,(He=u)&&!d)for(U=i;U!==null;)s=U,u=s.child,s.tag===22&&s.memoizedState!==null?Xc(i):u!==null?(u.return=s,U=u):Xc(i);for(;l!==null;)U=l,ym(l),l=l.sibling;U=i,il=o,He=d}Kc(e)}else i.subtreeFlags&8772&&l!==null?(l.return=i,U=l):Kc(e)}}function Kc(e){for(;U!==null;){var t=U;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:He||ys(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!He)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:It(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Mc(t,l,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}Mc(t,s,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var c=d.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&wi(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}He||t.flags&512&&oa(t)}catch(h){Ee(t,t.return,h)}}if(t===e){U=null;break}if(n=t.sibling,n!==null){n.return=t.return,U=n;break}U=t.return}}function Gc(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var n=t.sibling;if(n!==null){n.return=t.return,U=n;break}U=t.return}}function Xc(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ys(4,t)}catch(u){Ee(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){Ee(t,i,u)}}var l=t.return;try{oa(t)}catch(u){Ee(t,l,u)}break;case 5:var s=t.return;try{oa(t)}catch(u){Ee(t,s,u)}}}catch(u){Ee(t,t.return,u)}if(t===e){U=null;break}var o=t.sibling;if(o!==null){o.return=t.return,U=o;break}U=t.return}}var v1=Math.ceil,ql=rn.ReactCurrentDispatcher,pu=rn.ReactCurrentOwner,jt=rn.ReactCurrentBatchConfig,de=0,De=null,Pe=null,Fe=0,ft=0,yr=jn(0),Le=0,Ai=null,Yn=0,xs=0,gu=0,ci=null,it=null,yu=0,Ar=1/0,Yt=null,Yl=!1,ca=null,vn=null,ll=!1,hn=null,Kl=0,di=0,da=null,wl=-1,bl=0;function Xe(){return de&6?Te():wl!==-1?wl:wl=Te()}function kn(e){return e.mode&1?de&2&&Fe!==0?Fe&-Fe:n1.transition!==null?(bl===0&&(bl=th()),bl):(e=he,e!==0||(e=window.event,e=e===void 0?16:ah(e.type)),e):1}function Lt(e,t,n,r){if(50<di)throw di=0,da=null,Error(_(185));Di(e,n,r),(!(de&2)||e!==De)&&(e===De&&(!(de&2)&&(xs|=n),Le===4&&dn(e,Fe)),at(e,r),n===1&&de===0&&!(t.mode&1)&&(Ar=Te()+500,ms&&Nn()))}function at(e,t){var n=e.callbackNode;ny(e,t);var r=Al(e,e===De?Fe:0);if(r===0)n!==null&&sc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&sc(n),t===1)e.tag===0?t1(Zc.bind(null,e)):Eh(Zc.bind(null,e)),Xy(function(){!(de&6)&&Nn()}),n=null;else{switch(nh(r)){case 1:n=Ha;break;case 4:n=Jf;break;case 16:n=Pl;break;case 536870912:n=eh;break;default:n=Pl}n=jm(n,xm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function xm(e,t){if(wl=-1,bl=0,de&6)throw Error(_(327));var n=e.callbackNode;if(Cr()&&e.callbackNode!==n)return null;var r=Al(e,e===De?Fe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Gl(e,r);else{t=r;var i=de;de|=2;var l=km();(De!==e||Fe!==t)&&(Yt=null,Ar=Te()+500,Un(e,t));do try{b1();break}catch(o){vm(e,o)}while(!0);nu(),ql.current=l,de=i,Pe!==null?t=0:(De=null,Fe=0,t=Le)}if(t!==0){if(t===2&&(i=Oo(e),i!==0&&(r=i,t=fa(e,i))),t===1)throw n=Ai,Un(e,0),dn(e,r),at(e,Te()),n;if(t===6)dn(e,r);else{if(i=e.current.alternate,!(r&30)&&!k1(i)&&(t=Gl(e,r),t===2&&(l=Oo(e),l!==0&&(r=l,t=fa(e,l))),t===1))throw n=Ai,Un(e,0),dn(e,r),at(e,Te()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:Rn(e,it,Yt);break;case 3:if(dn(e,r),(r&130023424)===r&&(t=yu+500-Te(),10<t)){if(Al(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Xe(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Qo(Rn.bind(null,e,it,Yt),t);break}Rn(e,it,Yt);break;case 4:if(dn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-Mt(r);l=1<<s,s=t[s],s>i&&(i=s),r&=~l}if(r=i,r=Te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*v1(r/1960))-r,10<r){e.timeoutHandle=Qo(Rn.bind(null,e,it,Yt),r);break}Rn(e,it,Yt);break;case 5:Rn(e,it,Yt);break;default:throw Error(_(329))}}}return at(e,Te()),e.callbackNode===n?xm.bind(null,e):null}function fa(e,t){var n=ci;return e.current.memoizedState.isDehydrated&&(Un(e,t).flags|=256),e=Gl(e,t),e!==2&&(t=it,it=n,t!==null&&ha(t)),e}function ha(e){it===null?it=e:it.push.apply(it,e)}function k1(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],l=i.getSnapshot;i=i.value;try{if(!Dt(l(),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 dn(e,t){for(t&=~gu,t&=~xs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Mt(t),r=1<<n;e[n]=-1,t&=~r}}function Zc(e){if(de&6)throw Error(_(327));Cr();var t=Al(e,0);if(!(t&1))return at(e,Te()),null;var n=Gl(e,t);if(e.tag!==0&&n===2){var r=Oo(e);r!==0&&(t=r,n=fa(e,r))}if(n===1)throw n=Ai,Un(e,0),dn(e,t),at(e,Te()),n;if(n===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rn(e,it,Yt),at(e,Te()),null}function xu(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(Ar=Te()+500,ms&&Nn())}}function Kn(e){hn!==null&&hn.tag===0&&!(de&6)&&Cr();var t=de;de|=1;var n=jt.transition,r=he;try{if(jt.transition=null,he=1,e)return e()}finally{he=r,jt.transition=n,de=t,!(de&6)&&Nn()}}function vu(){ft=yr.current,ve(yr)}function Un(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Gy(n)),Pe!==null)for(n=Pe.return;n!==null;){var r=n;switch(Ja(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&_l();break;case 3:Ir(),ve(st),ve(We),au();break;case 5:ou(r);break;case 4:Ir();break;case 13:ve(Se);break;case 19:ve(Se);break;case 10:ru(r.type._context);break;case 22:case 23:vu()}n=n.return}if(De=e,Pe=e=wn(e.current,null),Fe=ft=t,Le=0,Ai=null,gu=xs=Yn=0,it=ci=null,Fn!==null){for(t=0;t<Fn.length;t++)if(n=Fn[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,l=n.pending;if(l!==null){var s=l.next;l.next=i,r.next=s}n.pending=r}Fn=null}return e}function vm(e,t){do{var n=Pe;try{if(nu(),xl.current=Ql,Wl){for(var r=Ce.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Wl=!1}if(qn=0,Re=Me=Ce=null,ai=!1,zi=0,pu.current=null,n===null||n.return===null){Le=1,Ai=t,Pe=null;break}e:{var l=e,s=n.return,o=n,u=t;if(t=Fe,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,c=o,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var m=Fc(s);if(m!==null){m.flags&=-257,$c(m,s,o,l,t),m.mode&1&&Oc(l,d,t),t=m,u=d;var p=t.updateQueue;if(p===null){var x=new Set;x.add(u),t.updateQueue=x}else p.add(u);break e}else{if(!(t&1)){Oc(l,d,t),ku();break e}u=Error(_(426))}}else if(we&&o.mode&1){var S=Fc(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),$c(S,s,o,l,t),eu(Pr(u,o));break e}}l=u=Pr(u,o),Le!==4&&(Le=2),ci===null?ci=[l]:ci.push(l),l=s;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var y=nm(l,u,t);Ac(l,y);break e;case 1:o=u;var g=l.type,v=l.stateNode;if(!(l.flags&128)&&(typeof g.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(vn===null||!vn.has(v)))){l.flags|=65536,t&=-t,l.lanes|=t;var C=rm(l,o,t);Ac(l,C);break e}}l=l.return}while(l!==null)}bm(n)}catch(z){t=z,Pe===n&&n!==null&&(Pe=n=n.return);continue}break}while(!0)}function km(){var e=ql.current;return ql.current=Ql,e===null?Ql:e}function ku(){(Le===0||Le===3||Le===2)&&(Le=4),De===null||!(Yn&268435455)&&!(xs&268435455)||dn(De,Fe)}function Gl(e,t){var n=de;de|=2;var r=km();(De!==e||Fe!==t)&&(Yt=null,Un(e,t));do try{w1();break}catch(i){vm(e,i)}while(!0);if(nu(),de=n,ql.current=r,Pe!==null)throw Error(_(261));return De=null,Fe=0,Le}function w1(){for(;Pe!==null;)wm(Pe)}function b1(){for(;Pe!==null&&!qg();)wm(Pe)}function wm(e){var t=Cm(e.alternate,e,ft);e.memoizedProps=e.pendingProps,t===null?bm(e):Pe=t,pu.current=null}function bm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=p1(n,t),n!==null){n.flags&=32767,Pe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Le=6,Pe=null;return}}else if(n=m1(n,t,ft),n!==null){Pe=n;return}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);Le===0&&(Le=5)}function Rn(e,t,n){var r=he,i=jt.transition;try{jt.transition=null,he=1,S1(e,t,n,r)}finally{jt.transition=i,he=r}return null}function S1(e,t,n,r){do Cr();while(hn!==null);if(de&6)throw Error(_(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(_(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(ry(e,l),e===De&&(Pe=De=null,Fe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ll||(ll=!0,jm(Pl,function(){return Cr(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=jt.transition,jt.transition=null;var s=he;he=1;var o=de;de|=4,pu.current=null,y1(e,n),gm(n,e),Hy(Vo),Ml=!!Ho,Vo=Ho=null,e.current=n,x1(n),Yg(),de=o,he=s,jt.transition=l}else e.current=n;if(ll&&(ll=!1,hn=e,Kl=i),l=e.pendingLanes,l===0&&(vn=null),Xg(n.stateNode),at(e,Te()),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(Yl)throw Yl=!1,e=ca,ca=null,e;return Kl&1&&e.tag!==0&&Cr(),l=e.pendingLanes,l&1?e===da?di++:(di=0,da=e):di=0,Nn(),null}function Cr(){if(hn!==null){var e=nh(Kl),t=jt.transition,n=he;try{if(jt.transition=null,he=16>e?16:e,hn===null)var r=!1;else{if(e=hn,hn=null,Kl=0,de&6)throw Error(_(331));var i=de;for(de|=4,U=e.current;U!==null;){var l=U,s=l.child;if(U.flags&16){var o=l.deletions;if(o!==null){for(var u=0;u<o.length;u++){var d=o[u];for(U=d;U!==null;){var c=U;switch(c.tag){case 0:case 11:case 15:ui(8,c,l)}var f=c.child;if(f!==null)f.return=c,U=f;else for(;U!==null;){c=U;var h=c.sibling,m=c.return;if(hm(c),c===d){U=null;break}if(h!==null){h.return=m,U=h;break}U=m}}}var p=l.alternate;if(p!==null){var x=p.child;if(x!==null){p.child=null;do{var S=x.sibling;x.sibling=null,x=S}while(x!==null)}}U=l}}if(l.subtreeFlags&2064&&s!==null)s.return=l,U=s;else e:for(;U!==null;){if(l=U,l.flags&2048)switch(l.tag){case 0:case 11:case 15:ui(9,l,l.return)}var y=l.sibling;if(y!==null){y.return=l.return,U=y;break e}U=l.return}}var g=e.current;for(U=g;U!==null;){s=U;var v=s.child;if(s.subtreeFlags&2064&&v!==null)v.return=s,U=v;else e:for(s=g;U!==null;){if(o=U,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:ys(9,o)}}catch(z){Ee(o,o.return,z)}if(o===s){U=null;break e}var C=o.sibling;if(C!==null){C.return=o.return,U=C;break e}U=o.return}}if(de=i,Nn(),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(us,e)}catch{}r=!0}return r}finally{he=n,jt.transition=t}}return!1}function Jc(e,t,n){t=Pr(n,t),t=nm(e,t,1),e=xn(e,t,1),t=Xe(),e!==null&&(Di(e,1,t),at(e,t))}function Ee(e,t,n){if(e.tag===3)Jc(e,e,n);else for(;t!==null;){if(t.tag===3){Jc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(vn===null||!vn.has(r))){e=Pr(n,e),e=rm(t,e,1),t=xn(t,e,1),e=Xe(),t!==null&&(Di(t,1,e),at(t,e));break}}t=t.return}}function C1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Xe(),e.pingedLanes|=e.suspendedLanes&n,De===e&&(Fe&n)===n&&(Le===4||Le===3&&(Fe&130023424)===Fe&&500>Te()-yu?Un(e,0):gu|=n),at(e,t)}function Sm(e,t){t===0&&(e.mode&1?(t=Ki,Ki<<=1,!(Ki&130023424)&&(Ki=4194304)):t=1);var n=Xe();e=tn(e,t),e!==null&&(Di(e,t,n),at(e,n))}function j1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sm(e,n)}function N1(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(_(314))}r!==null&&r.delete(t),Sm(e,n)}var Cm;Cm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||st.current)lt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return lt=!1,h1(e,t,n);lt=!!(e.flags&131072)}else lt=!1,we&&t.flags&1048576&&Th(t,$l,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;kl(e,t),e=t.pendingProps;var i=Er(t,We.current);Sr(t,n),i=cu(null,t,r,e,i,n);var l=du();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,ot(r)?(l=!0,Ol(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,lu(t),i.updater=gs,t.stateNode=i,i._reactInternals=t,Jo(t,r,e,n),t=na(null,t,r,!0,l,n)):(t.tag=0,we&&l&&Za(t),Ke(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(kl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=T1(r),e=It(r,e),i){case 0:t=ta(null,t,r,e,n);break e;case 1:t=Hc(null,t,r,e,n);break e;case 11:t=Bc(null,t,r,e,n);break e;case 14:t=Uc(null,t,r,It(r.type,e),n);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),ta(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),Hc(e,t,r,i,n);case 3:e:{if(om(t),e===null)throw Error(_(387));r=t.pendingProps,l=t.memoizedState,i=l.element,Lh(e,t),Hl(t,r,null,n);var s=t.memoizedState;if(r=s.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=Pr(Error(_(423)),t),t=Vc(e,t,r,n,i);break e}else if(r!==i){i=Pr(Error(_(424)),t),t=Vc(e,t,r,n,i);break e}else for(ht=yn(t.stateNode.containerInfo.firstChild),mt=t,we=!0,At=null,n=Ah(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Tr(),r===i){t=nn(e,t,n);break e}Ke(e,t,r,n)}t=t.child}return t;case 5:return Rh(t),e===null&&Go(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,s=i.children,Wo(r,i)?s=null:l!==null&&Wo(r,l)&&(t.flags|=32),sm(e,t),Ke(e,t,s,n),t.child;case 6:return e===null&&Go(t),null;case 13:return am(e,t,n);case 4:return su(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zr(t,null,r,n):Ke(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),Bc(e,t,r,i,n);case 7:return Ke(e,t,t.pendingProps,n),t.child;case 8:return Ke(e,t,t.pendingProps.children,n),t.child;case 12:return Ke(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,s=i.value,ge(Bl,r._currentValue),r._currentValue=s,l!==null)if(Dt(l.value,s)){if(l.children===i.children&&!st.current){t=nn(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var o=l.dependencies;if(o!==null){s=l.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=Zt(-1,n&-n),u.tag=2;var d=l.updateQueue;if(d!==null){d=d.shared;var c=d.pending;c===null?u.next=u:(u.next=c.next,c.next=u),d.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),Xo(l.return,n,t),o.lanes|=n;break}u=u.next}}else if(l.tag===10)s=l.type===t.type?null:l.child;else if(l.tag===18){if(s=l.return,s===null)throw Error(_(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Xo(s,n,t),s=l.sibling}else s=l.child;if(s!==null)s.return=l;else for(s=l;s!==null;){if(s===t){s=null;break}if(l=s.sibling,l!==null){l.return=s.return,s=l;break}s=s.return}l=s}Ke(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Sr(t,n),i=Nt(i),r=r(i),t.flags|=1,Ke(e,t,r,n),t.child;case 14:return r=t.type,i=It(r,t.pendingProps),i=It(r.type,i),Uc(e,t,r,i,n);case 15:return im(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),kl(e,t),t.tag=1,ot(r)?(e=!0,Ol(t)):e=!1,Sr(t,n),tm(t,r,i),Jo(t,r,i,n),na(null,t,r,!0,e,n);case 19:return um(e,t,n);case 22:return lm(e,t,n)}throw Error(_(156,t.tag))};function jm(e,t){return Zf(e,t)}function E1(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 Ct(e,t,n,r){return new E1(e,t,n,r)}function wu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function T1(e){if(typeof e=="function")return wu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$a)return 11;if(e===Ba)return 14}return 2}function wn(e,t){var n=e.alternate;return n===null?(n=Ct(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 Sl(e,t,n,r,i,l){var s=2;if(r=e,typeof e=="function")wu(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case or:return Hn(n.children,i,l,t);case Fa:s=8,i|=8;break;case So:return e=Ct(12,n,t,i|2),e.elementType=So,e.lanes=l,e;case Co:return e=Ct(13,n,t,i),e.elementType=Co,e.lanes=l,e;case jo:return e=Ct(19,n,t,i),e.elementType=jo,e.lanes=l,e;case Rf:return vs(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mf:s=10;break e;case Lf:s=9;break e;case $a:s=11;break e;case Ba:s=14;break e;case an:s=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=Ct(s,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function Hn(e,t,n,r){return e=Ct(7,e,r,t),e.lanes=n,e}function vs(e,t,n,r){return e=Ct(22,e,r,t),e.elementType=Rf,e.lanes=n,e.stateNode={isHidden:!1},e}function no(e,t,n){return e=Ct(6,e,null,t),e.lanes=n,e}function ro(e,t,n){return t=Ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function z1(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=_s(0),this.expirationTimes=_s(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_s(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function bu(e,t,n,r,i,l,s,o,u){return e=new z1(e,t,n,o,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=Ct(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},lu(l),e}function I1(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:sr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Nm(e){if(!e)return Sn;e=e._reactInternals;e:{if(er(e)!==e||e.tag!==1)throw Error(_(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ot(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(_(171))}if(e.tag===1){var n=e.type;if(ot(n))return Nh(e,n,t)}return t}function Em(e,t,n,r,i,l,s,o,u){return e=bu(n,r,!0,e,i,l,s,o,u),e.context=Nm(null),n=e.current,r=Xe(),i=kn(n),l=Zt(r,i),l.callback=t??null,xn(n,l,i),e.current.lanes=i,Di(e,i,r),at(e,r),e}function ks(e,t,n,r){var i=t.current,l=Xe(),s=kn(i);return n=Nm(n),t.context===null?t.context=n:t.pendingContext=n,t=Zt(l,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=xn(i,t,s),e!==null&&(Lt(e,i,s,l),yl(e,i,s)),s}function Xl(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 ed(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Su(e,t){ed(e,t),(e=e.alternate)&&ed(e,t)}function P1(){return null}var Tm=typeof reportError=="function"?reportError:function(e){console.error(e)};function Cu(e){this._internalRoot=e}ws.prototype.render=Cu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));ks(e,t,null,null)};ws.prototype.unmount=Cu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Kn(function(){ks(null,e,null,null)}),t[en]=null}};function ws(e){this._internalRoot=e}ws.prototype.unstable_scheduleHydration=function(e){if(e){var t=lh();e={blockedOn:null,target:e,priority:t};for(var n=0;n<cn.length&&t!==0&&t<cn[n].priority;n++);cn.splice(n,0,e),n===0&&oh(e)}};function ju(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function td(){}function A1(e,t,n,r,i){if(i){if(typeof r=="function"){var l=r;r=function(){var d=Xl(s);l.call(d)}}var s=Em(t,r,e,0,null,!1,!1,"",td);return e._reactRootContainer=s,e[en]=s.current,Ci(e.nodeType===8?e.parentNode:e),Kn(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var d=Xl(u);o.call(d)}}var u=bu(e,0,!1,null,null,!1,!1,"",td);return e._reactRootContainer=u,e[en]=u.current,Ci(e.nodeType===8?e.parentNode:e),Kn(function(){ks(t,u,n,r)}),u}function Ss(e,t,n,r,i){var l=n._reactRootContainer;if(l){var s=l;if(typeof i=="function"){var o=i;i=function(){var u=Xl(s);o.call(u)}}ks(t,s,e,i)}else s=A1(n,t,e,i,r);return Xl(s)}rh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ti(t.pendingLanes);n!==0&&(Va(t,n|1),at(t,Te()),!(de&6)&&(Ar=Te()+500,Nn()))}break;case 13:Kn(function(){var r=tn(e,1);if(r!==null){var i=Xe();Lt(r,e,1,i)}}),Su(e,1)}};Wa=function(e){if(e.tag===13){var t=tn(e,134217728);if(t!==null){var n=Xe();Lt(t,e,134217728,n)}Su(e,134217728)}};ih=function(e){if(e.tag===13){var t=kn(e),n=tn(e,t);if(n!==null){var r=Xe();Lt(n,e,t,r)}Su(e,t)}};lh=function(){return he};sh=function(e,t){var n=he;try{return he=e,t()}finally{he=n}};Ro=function(e,t,n){switch(t){case"input":if(To(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=hs(r);if(!i)throw Error(_(90));_f(r),To(r,i)}}}break;case"textarea":Ff(e,n);break;case"select":t=n.value,t!=null&&vr(e,!!n.multiple,t,!1)}};Qf=xu;qf=Kn;var M1={usingClientEntryPoint:!1,Events:[Oi,dr,hs,Vf,Wf,xu]},Gr={findFiberByHostInstance:On,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},L1={bundleType:Gr.bundleType,version:Gr.version,rendererPackageName:Gr.rendererPackageName,rendererConfig:Gr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:rn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Gf(e),e===null?null:e.stateNode},findFiberByHostInstance:Gr.findFiberByHostInstance||P1,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 sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sl.isDisabled&&sl.supportsFiber)try{us=sl.inject(L1),Ht=sl}catch{}}xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M1;xt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ju(t))throw Error(_(200));return I1(e,t,null,n)};xt.createRoot=function(e,t){if(!ju(e))throw Error(_(299));var n=!1,r="",i=Tm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=bu(e,1,!1,null,null,n,!1,r,i),e[en]=t.current,Ci(e.nodeType===8?e.parentNode:e),new Cu(t)};xt.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(_(188)):(e=Object.keys(e).join(","),Error(_(268,e)));return e=Gf(t),e=e===null?null:e.stateNode,e};xt.flushSync=function(e){return Kn(e)};xt.hydrate=function(e,t,n){if(!bs(t))throw Error(_(200));return Ss(null,e,t,!0,n)};xt.hydrateRoot=function(e,t,n){if(!ju(e))throw Error(_(405));var r=n!=null&&n.hydratedSources||null,i=!1,l="",s=Tm;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Em(t,null,e,1,n??null,i,!1,l,s),e[en]=t.current,Ci(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 ws(t)};xt.render=function(e,t,n){if(!bs(t))throw Error(_(200));return Ss(null,e,t,!1,n)};xt.unmountComponentAtNode=function(e){if(!bs(e))throw Error(_(40));return e._reactRootContainer?(Kn(function(){Ss(null,null,e,!1,function(){e._reactRootContainer=null,e[en]=null})}),!0):!1};xt.unstable_batchedUpdates=xu;xt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!bs(n))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return Ss(e,t,n,!1,r)};xt.version="18.3.1-next-f1338f8080-20240426";function zm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(zm)}catch(e){console.error(e)}}zm(),zf.exports=xt;var Im=zf.exports,R1,nd=Im;R1=nd.createRoot,nd.hydrateRoot;/**
41
+ * @license lucide-react v0.460.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 D1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pm=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46
+ * @license lucide-react v0.460.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 _1={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.460.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 O1=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:l,iconNode:s,...o},u)=>b.createElement("svg",{ref:u,..._1,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Pm("lucide",i),...o},[...s.map(([d,c])=>b.createElement(d,c)),...Array.isArray(l)?l:[l]]));/**
56
+ * @license lucide-react v0.460.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 X=(e,t)=>{const n=b.forwardRef(({className:r,...i},l)=>b.createElement(O1,{ref:l,iconNode:t,className:Pm(`lucide-${D1(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
61
+ * @license lucide-react v0.460.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 ma=X("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
66
+ * @license lucide-react v0.460.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 F1=X("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
71
+ * @license lucide-react v0.460.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 rd=X("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
76
+ * @license lucide-react v0.460.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 $1=X("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
81
+ * @license lucide-react v0.460.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 Or=X("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
86
+ * @license lucide-react v0.460.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 B1=X("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
91
+ * @license lucide-react v0.460.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 Cs=X("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
96
+ * @license lucide-react v0.460.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 id=X("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
101
+ * @license lucide-react v0.460.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 U1=X("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
106
+ * @license lucide-react v0.460.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 H1=X("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
111
+ * @license lucide-react v0.460.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 V1=X("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
116
+ * @license lucide-react v0.460.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 pa=X("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
121
+ * @license lucide-react v0.460.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 W1=X("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
126
+ * @license lucide-react v0.460.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 Q1=X("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"}]]);/**
131
+ * @license lucide-react v0.460.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 q1=X("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
136
+ * @license lucide-react v0.460.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 Gn=X("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
141
+ * @license lucide-react v0.460.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 Nu=X("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"}]]);/**
146
+ * @license lucide-react v0.460.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 Y1=X("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
151
+ * @license lucide-react v0.460.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 ga=X("History",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
156
+ * @license lucide-react v0.460.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 K1=X("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
161
+ * @license lucide-react v0.460.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 G1=X("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
166
+ * @license lucide-react v0.460.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 X1=X("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
171
+ * @license lucide-react v0.460.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const Bn=X("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
176
+ * @license lucide-react v0.460.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const Z1=X("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
181
+ * @license lucide-react v0.460.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const J1=X("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
186
+ * @license lucide-react v0.460.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const ld=X("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
191
+ * @license lucide-react v0.460.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const ex=X("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
196
+ * @license lucide-react v0.460.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const Am=X("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"}]]);/**
201
+ * @license lucide-react v0.460.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const tx=X("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/**
206
+ * @license lucide-react v0.460.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const Zl=X("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
211
+ * @license lucide-react v0.460.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const yt=X("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
216
+ * @license lucide-react v0.460.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const Mm=X("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
221
+ * @license lucide-react v0.460.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const nx=X("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
226
+ * @license lucide-react v0.460.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const Ot=X("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"}]]);/**
231
+ * @license lucide-react v0.460.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const rx=X("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"}]]);/**
236
+ * @license lucide-react v0.460.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const ix=X("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
241
+ * @license lucide-react v0.460.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const Lm=X("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
246
+ * @license lucide-react v0.460.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const sd=X("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
251
+ * @license lucide-react v0.460.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const Rm=X("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
256
+ * @license lucide-react v0.460.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const lx=X("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
261
+ * @license lucide-react v0.460.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const Dm=X("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
266
+ * @license lucide-react v0.460.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const Mr=X("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
271
+ * @license lucide-react v0.460.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const sx=X("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
276
+ * @license lucide-react v0.460.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const Jl=X("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
281
+ * @license lucide-react v0.460.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const es=X("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
286
+ * @license lucide-react v0.460.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const od=X("StickyNote",[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]]);/**
291
+ * @license lucide-react v0.460.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const ox=X("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
296
+ * @license lucide-react v0.460.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const ax=X("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
301
+ * @license lucide-react v0.460.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const $i=X("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"}]]);/**
306
+ * @license lucide-react v0.460.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const ux=X("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"}]]);/**
311
+ * @license lucide-react v0.460.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const tr=X("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Eu(...e){return e.filter(Boolean).join(" ")}function jr(e){if(!e&&e!==0)return"";const t=typeof e=="number"?e:new Date(e).getTime();if(Number.isNaN(t))return"";const n=Date.now()-t;return n<0||n<6e4?"just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:n<7*864e5?`${Math.floor(n/864e5)}d ago`:new Date(t).toLocaleDateString()}function cx(e){if(!e)return"";const t=typeof e=="number"?new Date(e):new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString()}function RC(e,t=160){return e?e.length>t?e.slice(0,t)+"…":e:""}function DC(e,t=200){let n=null;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>e(...r),t)}}const dx={low:"var(--text-dim)",normal:"var(--info)",high:"var(--error)"};function _C(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t^e.charCodeAt(n);return(t>>>0).toString(36)}function OC(e,t=!0){const n=(e||"").replace(/\r\n?/g,`
316
+ `).trim();if(!n){if(!t)return"";const s=new Date,o=u=>String(u).padStart(2,"0");return`Untitled task — ${s.getFullYear()}-${o(s.getMonth()+1)}-${o(s.getDate())} ${o(s.getHours())}:${o(s.getMinutes())}`}const r=n.split(`
317
+ `).map(s=>s.replace(/^[\s>#*\-]+/,"").trim()).find(s=>s.length>0)||"";if(!r){if(!t)return"";const s=new Date,o=u=>String(u).padStart(2,"0");return`Untitled task — ${s.getFullYear()}-${o(s.getMonth()+1)}-${o(s.getDate())} ${o(s.getHours())}:${o(s.getMinutes())}`}if(r.length<=60)return r;const i=r.slice(0,60),l=i.lastIndexOf(" ");return(l>20?i.slice(0,l):i).trimEnd()+"…"}const Cl="bizar-auth-token",ad="bizar-loopback-trusted";class ud extends Error{constructor(n,r,i){super(n);nt(this,"status");nt(this,"data");this.name="ApiError",this.status=r,this.data=i}}class fx{constructor(){nt(this,"base","/api")}getToken(){try{return localStorage.getItem(Cl)||""}catch{return""}}setToken(t){try{t?localStorage.setItem(Cl,t):localStorage.removeItem(Cl)}catch{}}urlWithToken(t){const n=this.base+t,r=this.getToken();if(!r)return n;const i=n.includes("?")?"&":"?";return`${n}${i}token=${encodeURIComponent(r)}`}async probeAuthStatus(){try{const t=await this.get("/auth/status");try{localStorage.setItem(ad,t.loopback?"1":"0")}catch{}return t}catch{return{required:!1,loopback:!0,peer:""}}}isLoopbackTrusted(){try{return localStorage.getItem(ad)!=="0"}catch{return!0}}async get(t){return this.req("GET",t)}async post(t,n){return this.req("POST",t,n)}async put(t,n){return this.req("PUT",t,n)}async patch(t,n){return this.req("PATCH",t,n)}async del(t){return this.req("DELETE",t)}async req(t,n,r){const i={"Content-Type":"application/json"},l=this.getToken();l&&(i.Authorization=`Bearer ${l}`);const s={method:t,headers:i};r!=null&&(s.body=typeof r=="string"?r:JSON.stringify(r));const o=await fetch(this.base+n,s);if((o.headers.get("content-type")||"").includes("application/json")){const c=await o.json();if(!o.ok){const f=(c&&typeof c=="object"&&"message"in c?c.message:void 0)||`${t} ${n}: ${o.status}`;throw new ud(f,o.status,c)}return c}const d=await o.text();if(!o.ok)throw new ud(`${t} ${n}: ${o.status} — ${d.slice(0,200)}`,o.status,d);try{return JSON.parse(d)}catch{return d}}}const Q=new fx;async function hx(e){return e}const _m=b.createContext(null),mx=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function px(){const e=b.useContext(_m);return e||{open:()=>"",close:()=>{},isModalOpen:!1}}function FC({children:e}){const[t,n]=b.useState([]),r=b.useCallback(l=>{n(s=>{if(!l)return s.slice(0,-1);const o=s.findIndex(u=>u.id===l);return o===-1||o!==s.length-1?s:s.slice(0,-1)})},[]),i=b.useCallback(l=>{const s=`m${Math.random().toString(36).slice(2,9)}`;return n(o=>[...o,{...l,id:s}]),s},[]);return b.useEffect(()=>{if(t.length===0)return;const l=s=>{s.key==="Escape"&&(s.stopPropagation(),r())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t.length,r]),a.jsxs(_m.Provider,{value:{open:i,close:r,isModalOpen:t.length>0},children:[e,typeof document<"u"&&Im.createPortal(a.jsx("div",{className:"modal-stack","aria-hidden":t.length===0,children:t.map((l,s)=>a.jsx(gx,{modal:l,onClose:()=>{var o;(o=l.onClose)==null||o.call(l),r(l.id)},depth:s},l.id))}),document.body)]})}function gx({modal:e,onClose:t,depth:n}){const r=b.useRef(null),i=b.useRef(null),l=b.useId(),s=()=>{const o=r.current;return o?Array.from(o.querySelectorAll(mx)).filter(u=>!u.hasAttribute("disabled")&&u.tabIndex!==-1):[]};return b.useEffect(()=>{var d;i.current=document.activeElement instanceof HTMLElement?document.activeElement:null,(d=s()[0]??r.current)==null||d.focus();const u=c=>{var x,S,y;if(c.key!=="Tab")return;const f=s();if(f.length===0){c.preventDefault(),(x=r.current)==null||x.focus();return}const h=f[0],m=f[f.length-1],p=document.activeElement instanceof HTMLElement?document.activeElement:null;if(c.shiftKey){(!p||p===h||!((S=r.current)!=null&&S.contains(p)))&&(c.preventDefault(),m.focus());return}(!p||p===m||!((y=r.current)!=null&&y.contains(p)))&&(c.preventDefault(),h.focus())};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u);const c=i.current;c&&c.isConnected&&c.focus()}},[]),a.jsx("div",{className:"modal-backdrop",onClick:o=>{o.stopPropagation(),o.target===o.currentTarget&&t()},style:n>0?{background:"rgba(0,0,0,0.4)"}:void 0,children:a.jsxs("div",{ref:r,className:"modal",role:"dialog","aria-modal":"true","aria-labelledby":e.title?l:void 0,tabIndex:-1,onClick:o=>o.stopPropagation(),style:e.width?{maxWidth:e.width}:void 0,children:[e.title&&a.jsxs("header",{className:"modal-header",children:[a.jsx("h2",{id:l,className:"modal-title",children:e.title}),a.jsx("button",{type:"button",className:"icon-btn","aria-label":"Close",onClick:t,children:a.jsx(tr,{size:16})})]}),a.jsx("div",{className:"modal-body",children:e.children}),e.footer&&a.jsx("footer",{className:"modal-footer",children:e.footer})]})})}const ts=b.forwardRef(function({variant:t="secondary",size:n="md",iconOnly:r=!1,loading:i=!1,disabled:l,className:s,children:o,...u},d){return a.jsxs("button",{ref:d,type:u.type??"button",disabled:l||i,className:Eu("btn",`btn-${t}`,`btn-size-${n}`,r&&"btn-icon",i&&"btn-loading",s),...u,children:[i?a.jsx("span",{className:"btn-spinner","aria-hidden":!0}):null,o]})}),Om=b.createContext(null);function yx(){const e=b.useContext(Om);return e||{show:()=>{},info:()=>{},success:()=>{},error:()=>{},warning:()=>{},dismiss:()=>{},toasts:[]}}const xx={info:G1,success:H1,error:U1,warning:ux};function $C({children:e}){const[t,n]=b.useState([]),r=b.useRef(1),i=b.useRef(new Map),l=b.useCallback(u=>{n(c=>c.filter(f=>f.id!==u));const d=i.current.get(u);d&&(clearTimeout(d),i.current.delete(u))},[]),s=b.useCallback((u,d="info",c=4e3)=>{const f=r.current++;if(n(h=>[...h,{id:f,kind:d,message:u}]),c>0){const h=setTimeout(()=>l(f),c);i.current.set(f,h)}},[l]);b.useEffect(()=>()=>{for(const u of i.current.values())clearTimeout(u);i.current.clear()},[]);const o=b.useMemo(()=>({show:s,info:(u,d)=>s(u,"info",d),success:(u,d)=>s(u,"success",d),error:(u,d)=>s(u,"error",d),warning:(u,d)=>s(u,"warning",d),dismiss:l,toasts:t}),[s,l,t]);return a.jsxs(Om.Provider,{value:o,children:[e,a.jsx(vx,{toasts:t,onDismiss:l})]})}function vx({toasts:e,onDismiss:t}){return a.jsx("div",{className:"toast-stack","aria-live":"polite",children:e.map(n=>a.jsx(kx,{toast:n,onDismiss:t},n.id))})}function kx({toast:e,onDismiss:t}){const n=xx[e.kind];return a.jsxs("div",{className:`toast toast-${e.kind}`,role:"status",children:[a.jsx(n,{size:16,className:"toast-icon"}),a.jsx("span",{className:"toast-message",children:e.message}),a.jsx("button",{type:"button",className:"toast-close","aria-label":"Dismiss",onClick:()=>t(e.id),children:a.jsx(tr,{size:14})})]})}function wx(){if(typeof location>"u")return"ws://localhost/ws";const e=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;let t="";try{t=localStorage.getItem(Cl)||""}catch{}return t?`${e}?token=${encodeURIComponent(t)}`:e}class Fm{constructor(t){nt(this,"urlOverride");nt(this,"handlers",new Set);nt(this,"statusHandlers",new Set);nt(this,"ws",null);nt(this,"reconnectDelay",1e3);nt(this,"maxReconnectDelay",15e3);nt(this,"reconnectTimer",null);nt(this,"_status","connecting");nt(this,"pingTimer",null);nt(this,"closed",!1);this.urlOverride=t,this.connect()}on(t){return this.handlers.add(t),()=>{this.handlers.delete(t)}}onStatus(t){return this.statusHandlers.add(t),t(this._status),()=>{this.statusHandlers.delete(t)}}get status(){return this._status}send(t){return this.ws&&this.ws.readyState===WebSocket.OPEN?(this.ws.send(JSON.stringify(t)),!0):!1}close(){var t;this.closed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null;try{(t=this.ws)==null||t.close()}catch{}this.ws=null,this.setStatus("disconnected")}connect(){if(this.closed)return;this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.setStatus("connecting");const t=this.urlOverride??wx();let n;try{n=new WebSocket(t),this.ws=n}catch(r){console.warn("[ws] construct failed:",r),this.scheduleReconnect();return}n.addEventListener("open",()=>{this.ws!==n||this.closed||(this.reconnectDelay=1e3,this.setStatus("connected"),this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=setInterval(()=>{this._status==="connected"&&this.send({type:"ping"})},3e4))}),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null,this.setStatus("disconnected"),this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=null),this.closed||this.scheduleReconnect())}),n.addEventListener("error",()=>{this.ws===n&&console.warn("[ws] error")}),n.addEventListener("message",r=>{let i;try{i=JSON.parse(r.data)}catch{console.warn("[ws] bad message");return}for(const l of this.handlers)try{l(i)}catch(s){console.error("[ws] handler error:",s)}})}scheduleReconnect(){this.closed||this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*1.6,this.maxReconnectDelay))}setStatus(t){this._status=t;for(const n of this.statusHandlers)try{n(t)}catch(r){console.error("[ws] status handler error:",r)}}}const bx=Object.freeze(Object.defineProperty({__proto__:null,Ws:Fm},Symbol.toStringTag,{value:"Module"}));function ns(e){const t=typeof e=="string"?e:e.mode,n=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark":t==="light"?"light":"dark";return typeof document<"u"&&(n==="light"?document.documentElement.setAttribute("data-theme","light"):document.documentElement.removeAttribute("data-theme")),n}function fi(e){if(typeof document>"u")return;const t=document.documentElement;t.style.setProperty("--accent",e.accent),t.style.setProperty("--success",e.success),t.style.setProperty("--warning",e.warning),t.style.setProperty("--error",e.error),t.style.setProperty("--info",e.info),t.style.setProperty("--accent-bg",cd(e.accent,.12)),t.style.setProperty("--accent-border",cd(e.accent,.4)),e.fontFamily&&t.style.setProperty("--font-sans",`'${e.fontFamily}', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif`),e.fontSize&&t.style.setProperty("--base-font-size",`${e.fontSize}px`),t.dataset.compactMode=e.compactMode?"true":"false",t.dataset.animations=e.animations?"true":"false"}function cd(e,t){const n=/^#?([0-9a-f]{6})$/i.exec(e||"");if(!n)return`rgba(139, 92, 246, ${t})`;const r=parseInt(n[1],16),i=r>>16&255,l=r>>8&255,s=r&255;return`rgba(${i}, ${l}, ${s}, ${t})`}function $m({size:e="md",className:t,label:n}){return a.jsx("span",{className:Eu("spinner",`spinner-${e}`,t),role:"status","aria-label":n||"Loading"})}function Sx({activeProject:e,sessionCount:t,sessionsOpen:n,infoOpen:r,onToggleSessions:i,onToggleInfo:l,onOpenOverview:s}){return a.jsxs("header",{className:"chat-topbar",children:[a.jsxs("button",{type:"button",className:"chat-topbar-project",onClick:s,children:[a.jsx(Nu,{size:14}),a.jsx("span",{className:"chat-topbar-project-name",children:(e==null?void 0:e.name)??"No project"}),a.jsx(Cs,{size:12})]}),a.jsx("div",{className:"chat-topbar-spacer"}),a.jsxs("button",{type:"button",className:`chat-topbar-btn ${n?"active":""}`,onClick:i,"aria-pressed":n,children:["Sessions (",t,")"]}),a.jsx("button",{type:"button",className:`chat-topbar-btn ${r?"active":""}`,onClick:l,"aria-pressed":r,children:"Info"})]})}function Cx({icon:e,title:t,message:n,action:r}){return a.jsxs("div",{className:"chat-empty-state",children:[e&&a.jsx("div",{className:"chat-empty-state-icon",children:e}),a.jsx("h2",{className:"chat-empty-state-title",children:t}),a.jsx("p",{className:"chat-empty-state-message",children:n}),r&&a.jsx("div",{className:"chat-empty-state-action",children:r})]})}function jx({count:e=3}){return a.jsx("div",{className:"chat-loading-skeleton","aria-label":"Loading messages",children:Array.from({length:e}).map((t,n)=>a.jsxs("div",{className:"chat-loading-skeleton-bubble",children:[a.jsx("div",{className:"chat-loading-skeleton-meta"}),a.jsx("div",{className:"chat-loading-skeleton-line"}),a.jsx("div",{className:"chat-loading-skeleton-line short"})]},n))})}function Nx({projectName:e,onPickSuggestion:t}){const n=[{icon:a.jsx(W1,{size:16}),title:e?`Explain ${e}`:"Explain this project",preview:"Give me a tour of the codebase, highlight the architecture, and call out any anti-patterns or hotspots.",prompt:e?`Explain the ${e} project. Give me a tour of the codebase, highlight the architecture, and call out any anti-patterns or hotspots.`:"Explain the current project. Give me a tour of the codebase, highlight the architecture, and call out any anti-patterns or hotspots."},{icon:a.jsx($1,{size:16}),title:"Summarize recent sessions",preview:"Read my last 5 chat sessions and give me a 3-bullet summary of what I worked on and what got stuck.",prompt:"Read my last 5 chat sessions and give me a 3-bullet summary of what I worked on and what got stuck."},{icon:a.jsx(X1,{size:16}),title:"Suggest a refactor",preview:"Look for the largest, most painful files in this project and propose a concrete refactor for the worst one.",prompt:"Look for the largest, most painful files in this project and propose a concrete refactor for the worst one."},{icon:a.jsx(K1,{size:16}),title:"Find visual regressions",preview:"Open the dashboard, screenshot the Chat tab, and flag any layout problems or anti-patterns you see.",prompt:"Open the dashboard, screenshot the Chat tab, and flag any layout problems or anti-patterns you see."}];return a.jsx("div",{className:"chat-suggestions",children:n.map((r,i)=>a.jsxs("button",{type:"button",className:"chat-suggestion",onClick:()=>t(r.prompt),children:[a.jsxs("div",{className:"chat-suggestion-title",children:[r.icon,a.jsx("span",{children:r.title})]}),a.jsx("div",{className:"chat-suggestion-preview",children:r.preview})]},i))})}function dd({variant:e,projectName:t,onPickSuggestion:n}){if(e==="no-project")return a.jsxs("div",{className:"chat-welcome",children:[a.jsx("h1",{className:"chat-welcome-h1",children:a.jsx("span",{className:"chat-greeting-hello",children:"No project selected."})}),a.jsx("p",{className:"chat-welcome-subtitle",children:"Pick a project in Overview to scope chat sessions."})]});const r=t||"there";return a.jsxs("div",{className:"chat-welcome",children:[a.jsxs("h1",{className:"chat-welcome-h1",children:[a.jsx("span",{className:"chat-greeting-hello",children:"Hello, "}),a.jsxs("span",{className:"chat-greeting-name",children:[r,"."]})]}),a.jsx("p",{className:"chat-welcome-subtitle",children:"How can I help you today?"}),a.jsx(Nx,{projectName:t,onPickSuggestion:n})]})}function Ex(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Tx=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zx=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ix={};function fd(e,t){return(Ix.jsx?zx:Tx).test(e)}const Px=/[ \t\n\f\r]/g;function Ax(e){return typeof e=="object"?e.type==="text"?hd(e.value):!1:hd(e)}function hd(e){return e.replace(Px,"")===""}class Bi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Bi.prototype.normal={};Bi.prototype.property={};Bi.prototype.space=void 0;function Bm(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Bi(n,r,t)}function ya(e){return e.toLowerCase()}class ut{constructor(t,n){this.attribute=n,this.property=t}}ut.prototype.attribute="";ut.prototype.booleanish=!1;ut.prototype.boolean=!1;ut.prototype.commaOrSpaceSeparated=!1;ut.prototype.commaSeparated=!1;ut.prototype.defined=!1;ut.prototype.mustUseProperty=!1;ut.prototype.number=!1;ut.prototype.overloadedBoolean=!1;ut.prototype.property="";ut.prototype.spaceSeparated=!1;ut.prototype.space=void 0;let Mx=0;const ee=nr(),Ie=nr(),xa=nr(),O=nr(),me=nr(),Vn=nr(),dt=nr();function nr(){return 2**++Mx}const va=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:Ie,commaOrSpaceSeparated:dt,commaSeparated:Vn,number:O,overloadedBoolean:xa,spaceSeparated:me},Symbol.toStringTag,{value:"Module"})),io=Object.keys(va);class Tu extends ut{constructor(t,n,r,i){let l=-1;if(super(t,n),md(this,"space",i),typeof r=="number")for(;++l<io.length;){const s=io[l];md(this,io[l],(r&va[s])===va[s])}}}Tu.prototype.defined=!0;function md(e,t,n){n&&(e[t]=n)}function Fr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new Tu(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[ya(r)]=r,n[ya(l.attribute)]=r}return new Bi(t,n,e.space)}const Um=Fr({properties:{ariaActiveDescendant:null,ariaAtomic:Ie,ariaAutoComplete:null,ariaBusy:Ie,ariaChecked:Ie,ariaColCount:O,ariaColIndex:O,ariaColSpan:O,ariaControls:me,ariaCurrent:null,ariaDescribedBy:me,ariaDetails:null,ariaDisabled:Ie,ariaDropEffect:me,ariaErrorMessage:null,ariaExpanded:Ie,ariaFlowTo:me,ariaGrabbed:Ie,ariaHasPopup:null,ariaHidden:Ie,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:me,ariaLevel:O,ariaLive:null,ariaModal:Ie,ariaMultiLine:Ie,ariaMultiSelectable:Ie,ariaOrientation:null,ariaOwns:me,ariaPlaceholder:null,ariaPosInSet:O,ariaPressed:Ie,ariaReadOnly:Ie,ariaRelevant:null,ariaRequired:Ie,ariaRoleDescription:me,ariaRowCount:O,ariaRowIndex:O,ariaRowSpan:O,ariaSelected:Ie,ariaSetSize:O,ariaSort:null,ariaValueMax:O,ariaValueMin:O,ariaValueNow:O,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Hm(e,t){return t in e?e[t]:t}function Vm(e,t){return Hm(e,t.toLowerCase())}const Lx=Fr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vn,acceptCharset:me,accessKey:me,action:null,allow:null,allowFullScreen:ee,allowPaymentRequest:ee,allowUserMedia:ee,alpha:ee,alt:null,as:null,async:ee,autoCapitalize:null,autoComplete:me,autoFocus:ee,autoPlay:ee,blocking:me,capture:null,charSet:null,checked:ee,cite:null,className:me,closedBy:null,colorSpace:null,cols:O,colSpan:O,command:null,commandFor:null,content:null,contentEditable:Ie,controls:ee,controlsList:me,coords:O|Vn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ee,defer:ee,dir:null,dirName:null,disabled:ee,download:xa,draggable:Ie,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ee,formTarget:null,headers:me,height:O,hidden:xa,high:O,href:null,hrefLang:null,htmlFor:me,httpEquiv:me,id:null,imageSizes:null,imageSrcSet:null,inert:ee,inputMode:null,integrity:null,is:null,isMap:ee,itemId:null,itemProp:me,itemRef:me,itemScope:ee,itemType:me,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ee,low:O,manifest:null,max:null,maxLength:O,media:null,method:null,min:null,minLength:O,multiple:ee,muted:ee,name:null,nonce:null,noModule:ee,noValidate:ee,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:ee,optimum:O,pattern:null,ping:me,placeholder:null,playsInline:ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ee,referrerPolicy:null,rel:me,required:ee,reversed:ee,rows:O,rowSpan:O,sandbox:me,scope:null,scoped:ee,seamless:ee,selected:ee,shadowRootClonable:ee,shadowRootCustomElementRegistry:ee,shadowRootDelegatesFocus:ee,shadowRootMode:null,shadowRootSerializable:ee,shape:null,size:O,sizes:null,slot:null,span:O,spellCheck:Ie,src:null,srcDoc:null,srcLang:null,srcSet:null,start:O,step:null,style:null,tabIndex:O,target:null,title:null,translate:null,type:null,typeMustMatch:ee,useMap:null,value:Ie,width:O,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:me,axis:null,background:null,bgColor:null,border:O,borderColor:null,bottomMargin:O,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ee,declare:ee,event:null,face:null,frame:null,frameBorder:null,hSpace:O,leftMargin:O,link:null,longDesc:null,lowSrc:null,marginHeight:O,marginWidth:O,noResize:ee,noHref:ee,noShade:ee,noWrap:ee,object:null,profile:null,prompt:null,rev:null,rightMargin:O,rules:null,scheme:null,scrolling:Ie,standby:null,summary:null,text:null,topMargin:O,valueType:null,version:null,vAlign:null,vLink:null,vSpace:O,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ee,disablePictureInPicture:ee,disableRemotePlayback:ee,exportParts:Vn,part:me,prefix:null,property:null,results:O,security:null,unselectable:null},space:"html",transform:Vm}),Rx=Fr({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",maskType:"mask-type",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:dt,accentHeight:O,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:O,amplitude:O,arabicForm:null,ascent:O,attributeName:null,attributeType:null,azimuth:O,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:O,by:null,calcMode:null,capHeight:O,className:me,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:O,diffuseConstant:O,direction:null,display:null,dur:null,divisor:O,dominantBaseline:null,download:ee,dx:null,dy:null,edgeMode:null,editable:null,elevation:O,enableBackground:null,end:null,event:null,exponent:O,externalResourcesRequired:null,fill:null,fillOpacity:O,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:Vn,g2:Vn,glyphName:Vn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:O,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:O,horizOriginX:O,horizOriginY:O,id:null,ideographic:O,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:O,k:O,k1:O,k2:O,k3:O,k4:O,kernelMatrix:dt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:O,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:O,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:O,overlineThickness:O,paintOrder:null,panose1:null,path:null,pathLength:O,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:me,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:O,pointsAtY:O,pointsAtZ:O,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:dt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:dt,rev:dt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:dt,requiredFeatures:dt,requiredFonts:dt,requiredFormats:dt,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:O,specularExponent:O,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:O,strikethroughThickness:O,string:null,stroke:null,strokeDashArray:dt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:O,strokeOpacity:O,strokeWidth:null,style:null,surfaceScale:O,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dt,tabIndex:O,tableValues:null,target:null,targetX:O,targetY:O,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:dt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:O,underlineThickness:O,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:O,values:null,vAlphabetic:O,vMathematical:O,vectorEffect:null,vHanging:O,vIdeographic:O,version:null,vertAdvY:O,vertOriginX:O,vertOriginY:O,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:O,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Hm}),Wm=Fr({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()}}),Qm=Fr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Vm}),qm=Fr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Dx={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"},_x=/[A-Z]/g,pd=/-[a-z]/g,Ox=/^data[-\w.:]+$/i;function Fx(e,t){const n=ya(t);let r=t,i=ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ox.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(pd,Bx);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!pd.test(l)){let s=l.replace(_x,$x);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Tu}return new i(r,t)}function $x(e){return"-"+e.toLowerCase()}function Bx(e){return e.charAt(1).toUpperCase()}const Ux=Bm([Um,Lx,Wm,Qm,qm],"html"),zu=Bm([Um,Rx,Wm,Qm,qm],"svg");function Hx(e){return e.join(" ").trim()}var Iu={},gd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Vx=/\n/g,Wx=/^\s*/,Qx=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,qx=/^:\s*/,Yx=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Kx=/^[;\s]*/,Gx=/^\s+|\s+$/g,Xx=`
318
+ `,yd="/",xd="*",_n="",Zx="comment",Jx="declaration";function ev(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(p){var x=p.match(Vx);x&&(n+=x.length);var S=p.lastIndexOf(Xx);r=~S?p.length-S:r+p.length}function l(){var p={line:n,column:r};return function(x){return x.position=new s(p),d(),x}}function s(p){this.start=p,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function o(p){var x=new Error(t.source+":"+n+":"+r+": "+p);if(x.reason=p,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(p){var x=p.exec(e);if(x){var S=x[0];return i(S),e=e.slice(S.length),x}}function d(){u(Wx)}function c(p){var x;for(p=p||[];x=f();)x!==!1&&p.push(x);return p}function f(){var p=l();if(!(yd!=e.charAt(0)||xd!=e.charAt(1))){for(var x=2;_n!=e.charAt(x)&&(xd!=e.charAt(x)||yd!=e.charAt(x+1));)++x;if(x+=2,_n===e.charAt(x-1))return o("End of comment missing");var S=e.slice(2,x-2);return r+=2,i(S),e=e.slice(x),r+=2,p({type:Zx,comment:S})}}function h(){var p=l(),x=u(Qx);if(x){if(f(),!u(qx))return o("property missing ':'");var S=u(Yx),y=p({type:Jx,property:vd(x[0].replace(gd,_n)),value:S?vd(S[0].replace(gd,_n)):_n});return u(Kx),y}}function m(){var p=[];c(p);for(var x;x=h();)x!==!1&&(p.push(x),c(p));return p}return d(),m()}function vd(e){return e?e.replace(Gx,_n):_n}var tv=ev,nv=El&&El.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Iu,"__esModule",{value:!0});Iu.default=iv;const rv=nv(tv);function iv(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,rv.default)(e),i=typeof t=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:s,value:o}=l;i?t(s,o,l):o&&(n=n||{},n[s]=o)}),n}var js={};Object.defineProperty(js,"__esModule",{value:!0});js.camelCase=void 0;var lv=/^--[a-zA-Z0-9_-]+$/,sv=/-([a-z])/g,ov=/^[^-]+$/,av=/^-(webkit|moz|ms|o|khtml)-/,uv=/^-(ms)-/,cv=function(e){return!e||ov.test(e)||lv.test(e)},dv=function(e,t){return t.toUpperCase()},kd=function(e,t){return"".concat(t,"-")},fv=function(e,t){return t===void 0&&(t={}),cv(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(uv,kd):e=e.replace(av,kd),e.replace(sv,dv))};js.camelCase=fv;var hv=El&&El.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},mv=hv(Iu),pv=js;function ka(e,t){var n={};return!e||typeof e!="string"||(0,mv.default)(e,function(r,i){r&&i&&(n[(0,pv.camelCase)(r,t)]=i)}),n}ka.default=ka;var gv=ka;const yv=Pa(gv),Ym=Km("end"),Pu=Km("start");function Km(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 xv(e){const t=Pu(e),n=Ym(e);if(t&&n)return{start:t,end:n}}function hi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?wd(e.position):"start"in e||"end"in e?wd(e):"line"in e||"column"in e?wa(e):""}function wa(e){return bd(e&&e.line)+":"+bd(e&&e.column)}function wd(e){return wa(e&&e.start)+"-"+wa(e&&e.end)}function bd(e){return e&&typeof e=="number"?e:1}class Qe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},s=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(s=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=hi(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=s&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qe.prototype.file="";Qe.prototype.name="";Qe.prototype.reason="";Qe.prototype.message="";Qe.prototype.stack="";Qe.prototype.column=void 0;Qe.prototype.line=void 0;Qe.prototype.ancestors=void 0;Qe.prototype.cause=void 0;Qe.prototype.fatal=void 0;Qe.prototype.place=void 0;Qe.prototype.ruleId=void 0;Qe.prototype.source=void 0;const Au={}.hasOwnProperty,vv=new Map,kv=/[A-Z]/g,wv=new Set(["table","tbody","thead","tfoot","tr"]),bv=new Set(["td","th"]),Gm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Sv(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=Pv(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=Iv(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"?zu:Ux,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Xm(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Xm(e,t,n){if(t.type==="element")return Cv(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return jv(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ev(e,t,n);if(t.type==="mdxjsEsm")return Nv(e,t);if(t.type==="root")return Tv(e,t,n);if(t.type==="text")return zv(e,t)}function Cv(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=zu,e.schema=i),e.ancestors.push(t);const l=Jm(e,t.tagName,!1),s=Av(e,t);let o=Lu(e,t);return wv.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!Ax(u):!0})),Zm(e,s,l,t),Mu(s,o),e.ancestors.pop(),e.schema=r,e.create(t,l,s,n)}function jv(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)}Mi(e,t.position)}function Nv(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Mi(e,t.position)}function Ev(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=zu,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:Jm(e,t.name,!0),s=Mv(e,t),o=Lu(e,t);return Zm(e,s,l,t),Mu(s,o),e.ancestors.pop(),e.schema=r,e.create(t,l,s,n)}function Tv(e,t,n){const r={};return Mu(r,Lu(e,t)),e.create(t,e.Fragment,r,n)}function zv(e,t){return t.value}function Zm(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Mu(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Iv(e,t,n){return r;function r(i,l,s,o){const d=Array.isArray(s.children)?n:t;return o?d(l,s,o):d(l,s)}}function Pv(e,t){return n;function n(r,i,l,s){const o=Array.isArray(l.children),u=Pu(r);return t(i,l,s,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Av(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Au.call(t.properties,i)){const l=Lv(e,i,t.properties[i]);if(l){const[s,o]=l;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&bv.has(t.tagName)?r=o:n[s]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Mv(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const s=l.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Mi(e,t.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else Mi(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Lu(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:vv;for(;++r<t.children.length;){const l=t.children[r];let s;if(e.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const d=i.get(u)||0;s=u+"-"+d,i.set(u,d+1)}}const o=Xm(e,l,s);o!==void 0&&n.push(o)}return n}function Lv(e,t,n){const r=Fx(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ex(n):Hx(n)),r.property==="style"){let i=typeof n=="object"?n:Rv(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Dv(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Dx[r.property]||r.property:r.attribute,n]}}function Rv(e,t){try{return yv(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Qe("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=Gm+"#cannot-parse-style-attribute",i}}function Jm(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,s;for(;++l<i.length;){const o=fd(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=s}else r=fd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Au.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Mi(e)}function Mi(e,t){const n=new Qe("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=Gm+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Dv(e){const t={};let n;for(n in e)Au.call(e,n)&&(t[_v(n)]=e[n]);return t}function _v(e){let t=e.replace(kv,Ov);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ov(e){return"-"+e.toLowerCase()}const lo={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"]},Fv={};function Ru(e,t){const n=Fv,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ep(e,r,i)}function ep(e,t,n){if($v(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 Sd(e.children,t,n)}return Array.isArray(e)?Sd(e,t,n):""}function Sd(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ep(e[i],t,n);return r.join("")}function $v(e){return!!(e&&typeof e=="object")}const Cd=document.createElement("i");function Du(e){const t="&"+e+";";Cd.innerHTML=t;const n=Cd.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function pt(e,t,n,r){const i=e.length;let l=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);l<r.length;)s=r.slice(l,l+1e4),s.unshift(t,0),e.splice(...s),l+=1e4,t+=1e4}function St(e,t){return e.length>0?(pt(e,e.length,0,t),e):t}const jd={}.hasOwnProperty;function tp(e){const t={};let n=-1;for(;++n<e.length;)Bv(t,e[n]);return t}function Bv(e,t){let n;for(n in t){const i=(jd.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let s;if(l)for(s in l){jd.call(i,s)||(i[s]=[]);const o=l[s];Uv(i[s],Array.isArray(o)?o:o?[o]:[])}}}function Uv(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);pt(e,0,0,r)}function np(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 Rt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ge=En(/[A-Za-z]/),Ve=En(/[\dA-Za-z]/),Hv=En(/[#-'*+\--9=?A-Z^-~]/);function rs(e){return e!==null&&(e<32||e===127)}const ba=En(/\d/),Vv=En(/[\dA-Fa-f]/),Wv=En(/[!-/:-@[-`{-~]/);function G(e){return e!==null&&e<-2}function pe(e){return e!==null&&(e<0||e===32)}function se(e){return e===-2||e===-1||e===32}const Ns=En(new RegExp("\\p{P}|\\p{S}","u")),Xn=En(/\s/);function En(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function $r(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let s="";if(l===37&&Ve(e.charCodeAt(n+1))&&Ve(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(s=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(s=String.fromCharCode(l,o),i=1):s="�"}else s=String.fromCharCode(l);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 ce(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return s;function s(u){return se(u)?(e.enter(n),o(u)):t(u)}function o(u){return se(u)&&l++<i?(e.consume(u),o):(e.exit(n),t(u))}}const Qv={tokenize:qv};function qv(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ce(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),l(o)}function l(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return G(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),s)}}const Yv={tokenize:Kv},Nd={tokenize:Gv};function Kv(e){const t=this,n=[];let r=0,i,l,s;return o;function o(v){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,u,d)(v)}return d(v)}function u(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&g();const C=t.events.length;let z=C,N;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){N=t.events[z][1].end;break}y(r);let P=C;for(;P<t.events.length;)t.events[P][1].end={...N},P++;return pt(t.events,z+1,0,t.events.slice(C)),t.events.length=P,d(v)}return o(v)}function d(v){if(r===n.length){if(!i)return h(v);if(i.currentConstruct&&i.currentConstruct.concrete)return p(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Nd,c,f)(v)}function c(v){return i&&g(),y(r),h(v)}function f(v){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,p(v)}function h(v){return t.containerState={},e.attempt(Nd,m,p)(v)}function m(v){return r++,n.push([t.currentConstruct,t.containerState]),h(v)}function p(v){if(v===null){i&&g(),y(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),x(v)}function x(v){if(v===null){S(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return G(v)?(e.consume(v),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(v),x)}function S(v,C){const z=t.sliceStream(v);if(C&&z.push(null),v.previous=l,l&&(l.next=v),l=v,i.defineSkip(v.start),i.write(z),t.parser.lazy[v.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<s&&(!i.events[N][1].end||i.events[N][1].end.offset>s))return;const P=t.events.length;let M=P,T,k;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(T){k=t.events[M][1].end;break}T=!0}for(y(r),N=P;N<t.events.length;)t.events[N][1].end={...k},N++;pt(t.events,M+1,0,t.events.slice(P)),t.events.length=N}}function y(v){let C=n.length;for(;C-- >v;){const z=n[C];t.containerState=z[1],z[0].exit.call(t,e)}n.length=v}function g(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Gv(e,t,n){return ce(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Lr(e){if(e===null||pe(e)||Xn(e))return 1;if(Ns(e))return 2}function Es(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Sa={name:"attention",resolveAll:Xv,tokenize:Zv};function Xv(e,t){let n=-1,r,i,l,s,o,u,d,c;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;u=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 f={...e[r][1].end},h={...e[n][1].start};Ed(f,-u),Ed(h,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},l={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},e[r][1].end={...s.start},e[n][1].start={...o.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=St(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=St(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",l,t]]),d=St(d,Es(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=St(d,[["exit",l,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,d=St(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,pt(e,r-1,n-r+3,d),n=r+d.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Zv(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Lr(r);let l;return s;function s(u){return l=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===l)return e.consume(u),o;const d=e.exit("attentionSequence"),c=Lr(u),f=!c||c===2&&i||n.includes(u),h=!i||i===2&&c||n.includes(r);return d._open=!!(l===42?f:f&&(i||!h)),d._close=!!(l===42?h:h&&(c||!f)),t(u)}}function Ed(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Jv={name:"autolink",tokenize:ek};function ek(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(m){return Ge(m)?(e.consume(m),s):m===64?n(m):d(m)}function s(m){return m===43||m===45||m===46||Ve(m)?(r=1,o(m)):d(m)}function o(m){return m===58?(e.consume(m),r=0,u):(m===43||m===45||m===46||Ve(m))&&r++<32?(e.consume(m),o):(r=0,d(m))}function u(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||rs(m)?n(m):(e.consume(m),u)}function d(m){return m===64?(e.consume(m),c):Hv(m)?(e.consume(m),d):n(m)}function c(m){return Ve(m)?f(m):n(m)}function f(m){return m===46?(e.consume(m),r=0,c):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||Ve(m))&&r++<63){const p=m===45?h:f;return e.consume(m),p}return n(m)}}const Ui={partial:!0,tokenize:tk};function tk(e,t,n){return r;function r(l){return se(l)?ce(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||G(l)?t(l):n(l)}}const rp={continuation:{tokenize:rk},exit:ik,name:"blockQuote",tokenize:nk};function nk(e,t,n){const r=this;return i;function i(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),l}return n(s)}function l(s){return se(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function rk(e,t,n){const r=this;return i;function i(s){return se(s)?ce(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):l(s)}function l(s){return e.attempt(rp,t,n)(s)}}function ik(e){e.exit("blockQuote")}const ip={name:"characterEscape",tokenize:lk};function lk(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return Wv(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const lp={name:"characterReference",tokenize:sk};function sk(e,t,n){const r=this;let i=0,l,s;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),l=31,s=Ve,c(f))}function d(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,s=Vv,c):(e.enter("characterReferenceValue"),l=7,s=ba,c(f))}function c(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return s===Ve&&!Du(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<l?(e.consume(f),c):n(f)}}const Td={partial:!0,tokenize:ak},zd={concrete:!0,name:"codeFenced",tokenize:ok};function ok(e,t,n){const r=this,i={partial:!0,tokenize:z};let l=0,s=0,o;return u;function u(N){return d(N)}function d(N){const P=r.events[r.events.length-1];return l=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,o=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(N)}function c(N){return N===o?(s++,e.consume(N),c):s<3?n(N):(e.exit("codeFencedFenceSequence"),se(N)?ce(e,f,"whitespace")(N):f(N))}function f(N){return N===null||G(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(Td,x,C)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(N))}function h(N){return N===null||G(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(N)):se(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ce(e,m,"whitespace")(N)):N===96&&N===o?n(N):(e.consume(N),h)}function m(N){return N===null||G(N)?f(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(N))}function p(N){return N===null||G(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(N)):N===96&&N===o?n(N):(e.consume(N),p)}function x(N){return e.attempt(i,C,S)(N)}function S(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),y}function y(N){return l>0&&se(N)?ce(e,g,"linePrefix",l+1)(N):g(N)}function g(N){return N===null||G(N)?e.check(Td,x,C)(N):(e.enter("codeFlowValue"),v(N))}function v(N){return N===null||G(N)?(e.exit("codeFlowValue"),g(N)):(e.consume(N),v)}function C(N){return e.exit("codeFenced"),t(N)}function z(N,P,M){let T=0;return k;function k(L){return N.enter("lineEnding"),N.consume(L),N.exit("lineEnding"),j}function j(L){return N.enter("codeFencedFence"),se(L)?ce(N,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return L===o?(N.enter("codeFencedFenceSequence"),$(L)):M(L)}function $(L){return L===o?(T++,N.consume(L),$):T>=s?(N.exit("codeFencedFenceSequence"),se(L)?ce(N,H,"whitespace")(L):H(L)):M(L)}function H(L){return L===null||G(L)?(N.exit("codeFencedFence"),P(L)):M(L)}}}function ak(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"),l)}function l(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const so={name:"codeIndented",tokenize:ck},uk={partial:!0,tokenize:dk};function ck(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),ce(e,l,"linePrefix",5)(d)}function l(d){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?u(d):G(d)?e.attempt(uk,s,u)(d):(e.enter("codeFlowValue"),o(d))}function o(d){return d===null||G(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),o)}function u(d){return e.exit("codeIndented"),t(d)}}function dk(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):G(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ce(e,l,"linePrefix",5)(s)}function l(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):G(s)?i(s):n(s)}}const fk={name:"codeText",previous:mk,resolve:hk,tokenize:pk};function hk(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 mk(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function pk(e,t,n){let r=0,i,l;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(l=e.enter("codeTextSequence"),i=0,c(f)):G(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(f))}function d(f){return f===null||f===32||f===96||G(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),d)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(l.type="codeTextData",d(f))}}class gk{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 l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Xr(this.left,r),l.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),Xr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Xr(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);Xr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Xr(this.left,n.reverse())}}}function Xr(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 sp(e){const t={};let n=-1,r,i,l,s,o,u,d;const c=new gk(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,yk(c,n)),n=t[n],d=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(s=c.get(l),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=l);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},o=c.slice(i,n),o.unshift(r),c.splice(i,n-i+1,o))}}return pt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!d}function yk(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,u=[],d={};let c,f,h=-1,m=n,p=0,x=0;const S=[x];for(;m;){for(;e.get(++i)[1]!==m;);l.push(i),m._tokenizer||(c=r.sliceStream(m),m.next||c.push(null),f&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=m,m=m.next}for(m=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(x=h+1,S.push(x),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):S.pop(),h=S.length;h--;){const y=o.slice(S[h],S[h+1]),g=l.pop();u.push([g,g+y.length-1]),e.splice(g,2,y)}for(u.reverse(),h=-1;++h<u.length;)d[p+u[h][0]]=p+u[h][1],p+=u[h][1]-u[h][0]-1;return d}const xk={resolve:kk,tokenize:wk},vk={partial:!0,tokenize:bk};function kk(e){return sp(e),e}function wk(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?l(o):G(o)?e.check(vk,s,l)(o):(e.consume(o),i)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function bk(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ce(e,l,"linePrefix")}function l(s){if(s===null||G(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function op(e,t,n,r,i,l,s,o,u){const d=u||Number.POSITIVE_INFINITY;let c=0;return f;function f(y){return y===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(y),e.exit(l),h):y===null||y===32||y===41||rs(y)?n(y):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),x(y))}function h(y){return y===62?(e.enter(l),e.consume(y),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(o),h(y)):y===null||y===60||G(y)?n(y):(e.consume(y),y===92?p:m)}function p(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function x(y){return!c&&(y===null||y===41||pe(y))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(y)):c<d&&y===40?(e.consume(y),c++,x):y===41?(e.consume(y),c--,x):y===null||y===32||y===40||rs(y)?n(y):(e.consume(y),y===92?S:x)}function S(y){return y===40||y===41||y===92?(e.consume(y),x):x(y)}}function ap(e,t,n,r,i,l){const s=this;let o=0,u;return d;function d(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(l),c}function c(m){return o>999||m===null||m===91||m===93&&!u||m===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(l),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):G(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||G(m)||o++>999?(e.exit("chunkString"),c(m)):(e.consume(m),u||(u=!se(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),o++,f):f(m)}}function up(e,t,n,r,i,l){let s;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,u):n(h)}function u(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(l),d(h))}function d(h){return h===s?(e.exit(l),u(s)):h===null?n(h):G(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ce(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===s||h===null||G(h)?(e.exit("chunkString"),d(h)):(e.consume(h),h===92?f:c)}function f(h){return h===s||h===92?(e.consume(h),c):c(h)}}function mi(e,t){let n;return r;function r(i){return G(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):se(i)?ce(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Sk={name:"definition",tokenize:jk},Ck={partial:!0,tokenize:Nk};function jk(e,t,n){const r=this;let i;return l;function l(m){return e.enter("definition"),s(m)}function s(m){return ap.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=Rt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return pe(m)?mi(e,d)(m):d(m)}function d(m){return op(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function c(m){return e.attempt(Ck,f,f)(m)}function f(m){return se(m)?ce(e,h,"whitespace")(m):h(m)}function h(m){return m===null||G(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function Nk(e,t,n){return r;function r(o){return pe(o)?mi(e,i)(o):n(o)}function i(o){return up(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return se(o)?ce(e,s,"whitespace")(o):s(o)}function s(o){return o===null||G(o)?t(o):n(o)}}const Ek={name:"hardBreakEscape",tokenize:Tk};function Tk(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return G(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const zk={name:"headingAtx",resolve:Ik,tokenize:Pk};function Ik(e,t){let n=e.length-2,r=3,i,l;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},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},pt(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function Pk(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),l(c)}function l(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||pe(c)?(e.exit("atxHeadingSequence"),o(c)):n(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||G(c)?(e.exit("atxHeading"),t(c)):se(c)?ce(e,o,"whitespace")(c):(e.enter("atxHeadingText"),d(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),o(c))}function d(c){return c===null||c===35||pe(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),d)}}const Ak=["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"],Id=["pre","script","style","textarea"],Mk={concrete:!0,name:"htmlFlow",resolveTo:Dk,tokenize:_k},Lk={partial:!0,tokenize:Fk},Rk={partial:!0,tokenize:Ok};function Dk(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 _k(e,t,n){const r=this;let i,l,s,o,u;return d;function d(E){return c(E)}function c(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),f}function f(E){return E===33?(e.consume(E),h):E===47?(e.consume(E),l=!0,x):E===63?(e.consume(E),i=3,r.interrupt?t:w):Ge(E)?(e.consume(E),s=String.fromCharCode(E),S):n(E)}function h(E){return E===45?(e.consume(E),i=2,m):E===91?(e.consume(E),i=5,o=0,p):Ge(E)?(e.consume(E),i=4,r.interrupt?t:w):n(E)}function m(E){return E===45?(e.consume(E),r.interrupt?t:w):n(E)}function p(E){const ye="CDATA[";return E===ye.charCodeAt(o++)?(e.consume(E),o===ye.length?r.interrupt?t:I:p):n(E)}function x(E){return Ge(E)?(e.consume(E),s=String.fromCharCode(E),S):n(E)}function S(E){if(E===null||E===47||E===62||pe(E)){const ye=E===47,qe=s.toLowerCase();return!ye&&!l&&Id.includes(qe)?(i=1,r.interrupt?t(E):I(E)):Ak.includes(s.toLowerCase())?(i=6,ye?(e.consume(E),y):r.interrupt?t(E):I(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):l?g(E):v(E))}return E===45||Ve(E)?(e.consume(E),s+=String.fromCharCode(E),S):n(E)}function y(E){return E===62?(e.consume(E),r.interrupt?t:I):n(E)}function g(E){return se(E)?(e.consume(E),g):k(E)}function v(E){return E===47?(e.consume(E),k):E===58||E===95||Ge(E)?(e.consume(E),C):se(E)?(e.consume(E),v):k(E)}function C(E){return E===45||E===46||E===58||E===95||Ve(E)?(e.consume(E),C):z(E)}function z(E){return E===61?(e.consume(E),N):se(E)?(e.consume(E),z):v(E)}function N(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),u=E,P):se(E)?(e.consume(E),N):M(E)}function P(E){return E===u?(e.consume(E),u=null,T):E===null||G(E)?n(E):(e.consume(E),P)}function M(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||pe(E)?z(E):(e.consume(E),M)}function T(E){return E===47||E===62||se(E)?v(E):n(E)}function k(E){return E===62?(e.consume(E),j):n(E)}function j(E){return E===null||G(E)?I(E):se(E)?(e.consume(E),j):n(E)}function I(E){return E===45&&i===2?(e.consume(E),te):E===60&&i===1?(e.consume(E),J):E===62&&i===4?(e.consume(E),ne):E===63&&i===3?(e.consume(E),w):E===93&&i===5?(e.consume(E),V):G(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Lk,ae,$)(E)):E===null||G(E)?(e.exit("htmlFlowData"),$(E)):(e.consume(E),I)}function $(E){return e.check(Rk,H,ae)(E)}function H(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),L}function L(E){return E===null||G(E)?$(E):(e.enter("htmlFlowData"),I(E))}function te(E){return E===45?(e.consume(E),w):I(E)}function J(E){return E===47?(e.consume(E),s="",D):I(E)}function D(E){if(E===62){const ye=s.toLowerCase();return Id.includes(ye)?(e.consume(E),ne):I(E)}return Ge(E)&&s.length<8?(e.consume(E),s+=String.fromCharCode(E),D):I(E)}function V(E){return E===93?(e.consume(E),w):I(E)}function w(E){return E===62?(e.consume(E),ne):E===45&&i===2?(e.consume(E),w):I(E)}function ne(E){return E===null||G(E)?(e.exit("htmlFlowData"),ae(E)):(e.consume(E),ne)}function ae(E){return e.exit("htmlFlow"),t(E)}}function Ok(e,t,n){const r=this;return i;function i(s){return G(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),l):n(s)}function l(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Fk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ui,t,n)}}const $k={name:"htmlText",tokenize:Bk};function Bk(e,t,n){const r=this;let i,l,s;return o;function o(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),u}function u(w){return w===33?(e.consume(w),d):w===47?(e.consume(w),z):w===63?(e.consume(w),v):Ge(w)?(e.consume(w),M):n(w)}function d(w){return w===45?(e.consume(w),c):w===91?(e.consume(w),l=0,p):Ge(w)?(e.consume(w),g):n(w)}function c(w){return w===45?(e.consume(w),m):n(w)}function f(w){return w===null?n(w):w===45?(e.consume(w),h):G(w)?(s=f,J(w)):(e.consume(w),f)}function h(w){return w===45?(e.consume(w),m):f(w)}function m(w){return w===62?te(w):w===45?h(w):f(w)}function p(w){const ne="CDATA[";return w===ne.charCodeAt(l++)?(e.consume(w),l===ne.length?x:p):n(w)}function x(w){return w===null?n(w):w===93?(e.consume(w),S):G(w)?(s=x,J(w)):(e.consume(w),x)}function S(w){return w===93?(e.consume(w),y):x(w)}function y(w){return w===62?te(w):w===93?(e.consume(w),y):x(w)}function g(w){return w===null||w===62?te(w):G(w)?(s=g,J(w)):(e.consume(w),g)}function v(w){return w===null?n(w):w===63?(e.consume(w),C):G(w)?(s=v,J(w)):(e.consume(w),v)}function C(w){return w===62?te(w):v(w)}function z(w){return Ge(w)?(e.consume(w),N):n(w)}function N(w){return w===45||Ve(w)?(e.consume(w),N):P(w)}function P(w){return G(w)?(s=P,J(w)):se(w)?(e.consume(w),P):te(w)}function M(w){return w===45||Ve(w)?(e.consume(w),M):w===47||w===62||pe(w)?T(w):n(w)}function T(w){return w===47?(e.consume(w),te):w===58||w===95||Ge(w)?(e.consume(w),k):G(w)?(s=T,J(w)):se(w)?(e.consume(w),T):te(w)}function k(w){return w===45||w===46||w===58||w===95||Ve(w)?(e.consume(w),k):j(w)}function j(w){return w===61?(e.consume(w),I):G(w)?(s=j,J(w)):se(w)?(e.consume(w),j):T(w)}function I(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),i=w,$):G(w)?(s=I,J(w)):se(w)?(e.consume(w),I):(e.consume(w),H)}function $(w){return w===i?(e.consume(w),i=void 0,L):w===null?n(w):G(w)?(s=$,J(w)):(e.consume(w),$)}function H(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||pe(w)?T(w):(e.consume(w),H)}function L(w){return w===47||w===62||pe(w)?T(w):n(w)}function te(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function J(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),D}function D(w){return se(w)?ce(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):V(w)}function V(w){return e.enter("htmlTextData"),s(w)}}const _u={name:"labelEnd",resolveAll:Wk,resolveTo:Qk,tokenize:qk},Uk={tokenize:Yk},Hk={tokenize:Kk},Vk={tokenize:Gk};function Wk(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&&pt(e,0,e.length,n),e}function Qk(e,t){let n=e.length,r=0,i,l,s,o;for(;n--;)if(i=e[n][1],l){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&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[s-2][1].start}};return o=[["enter",u,t],["enter",d,t]],o=St(o,e.slice(l+1,l+r+3)),o=St(o,[["enter",c,t]]),o=St(o,Es(t.parser.constructs.insideSpan.null,e.slice(l+r+4,s-3),t)),o=St(o,[["exit",c,t],e[s-2],e[s-1],["exit",d,t]]),o=St(o,e.slice(s+1)),o=St(o,[["exit",u,t]]),pt(e,l,e.length,o),e}function qk(e,t,n){const r=this;let i=r.events.length,l,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return o;function o(h){return l?l._inactive?f(h):(s=r.parser.defined.includes(Rt(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(Uk,c,s?c:f)(h):h===91?e.attempt(Hk,c,s?d:f)(h):s?c(h):f(h)}function d(h){return e.attempt(Vk,c,f)(h)}function c(h){return t(h)}function f(h){return l._balanced=!0,n(h)}}function Yk(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return pe(f)?mi(e,l)(f):l(f)}function l(f){return f===41?c(f):op(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return pe(f)?mi(e,u)(f):c(f)}function o(f){return n(f)}function u(f){return f===34||f===39||f===40?up(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function d(f){return pe(f)?mi(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Kk(e,t,n){const r=this;return i;function i(o){return ap.call(r,e,l,s,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(Rt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function Gk(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const Xk={name:"labelStartImage",resolveAll:_u.resolveAll,tokenize:Zk};function Zk(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),l}function l(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Jk={name:"labelStartLink",resolveAll:_u.resolveAll,tokenize:e0};function e0(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"),l}function l(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const oo={name:"lineEnding",tokenize:t0};function t0(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ce(e,t,"linePrefix")}}const jl={name:"thematicBreak",tokenize:n0};function n0(e,t,n){let r=0,i;return l;function l(d){return e.enter("thematicBreak"),s(d)}function s(d){return i=d,o(d)}function o(d){return d===i?(e.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||G(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===i?(e.consume(d),r++,u):(e.exit("thematicBreakSequence"),se(d)?ce(e,o,"whitespace")(d):o(d))}}const rt={continuation:{tokenize:s0},exit:a0,name:"list",tokenize:l0},r0={partial:!0,tokenize:u0},i0={partial:!0,tokenize:o0};function l0(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(m){const p=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:ba(m)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(jl,n,d)(m):d(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return ba(m)&&++s<10?(e.consume(m),u):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),d(m)):n(m)}function d(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Ui,r.interrupt?n:c,e.attempt(r0,h,f))}function c(m){return r.containerState.initialBlankLine=!0,l++,h(m)}function f(m){return se(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function s0(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ui,i,l);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ce(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!se(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(i0,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ce(e,e.attempt(rt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function o0(e,t,n){const r=this;return ce(e,i,"listItemIndent",r.containerState.size+1);function i(l){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(l):n(l)}}function a0(e){e.exit(this.containerState.type)}function u0(e,t,n){const r=this;return ce(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const s=r.events[r.events.length-1];return!se(l)&&s&&s[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Pd={name:"setextUnderline",resolveTo:c0,tokenize:d0};function c0(e,t){let n=e.length,r,i,l;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),!l&&e[n][1].type==="definition"&&(l=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",s,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function d0(e,t,n){const r=this;let i;return l;function l(d){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),o(d)}function o(d){return d===i?(e.consume(d),o):(e.exit("setextHeadingLineSequence"),se(d)?ce(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||G(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const f0={tokenize:h0};function h0(e){const t=this,n=e.attempt(Ui,r,e.attempt(this.parser.constructs.flowInitial,i,ce(e,e.attempt(this.parser.constructs.flow,i,e.attempt(xk,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const m0={resolveAll:dp()},p0=cp("string"),g0=cp("text");function cp(e){return{resolveAll:dp(e==="text"?y0:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,s,o);return s;function s(c){return d(c)?l(c):o(c)}function o(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),u}function u(c){return d(c)?(n.exit("data"),l(c)):(n.consume(c),u)}function d(c){if(c===null)return!0;const f=i[c];let h=-1;if(f)for(;++h<f.length;){const m=f[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function dp(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function y0(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 l=i.length,s=-1,o=0,u;for(;l--;){const d=i[l];if(typeof d=="string"){for(s=d.length;d.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(d===-2)u=!0,o++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const d={type:n===e.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:r.start._bufferIndex+s,_index:r.start._index+l,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const x0={42:rt,43:rt,45:rt,48:rt,49:rt,50:rt,51:rt,52:rt,53:rt,54:rt,55:rt,56:rt,57:rt,62:rp},v0={91:Sk},k0={[-2]:so,[-1]:so,32:so},w0={35:zk,42:jl,45:[Pd,jl],60:Mk,61:Pd,95:jl,96:zd,126:zd},b0={38:lp,92:ip},S0={[-5]:oo,[-4]:oo,[-3]:oo,33:Xk,38:lp,42:Sa,60:[Jv,$k],91:Jk,92:[Ek,ip],93:_u,95:Sa,96:fk},C0={null:[Sa,m0]},j0={null:[42,95]},N0={null:[]},E0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:j0,contentInitial:v0,disable:N0,document:x0,flow:w0,flowInitial:k0,insideSpan:C0,string:b0,text:S0},Symbol.toStringTag,{value:"Module"}));function T0(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={},l=[];let s=[],o=[];const u={attempt:P(z),check:P(N),consume:g,enter:v,exit:C,interrupt:P(N,{interrupt:!0})},d={code:null,containerState:{},defineSkip:x,events:[],now:p,parser:e,previous:null,sliceSerialize:h,sliceStream:m,write:f};let c=t.tokenize.call(d,u);return t.resolveAll&&l.push(t),d;function f(j){return s=St(s,j),S(),s[s.length-1]!==null?[]:(M(t,0),d.events=Es(l,d.events,d),d.events)}function h(j,I){return I0(m(j),I)}function m(j){return z0(s,j)}function p(){const{_bufferIndex:j,_index:I,line:$,column:H,offset:L}=r;return{_bufferIndex:j,_index:I,line:$,column:H,offset:L}}function x(j){i[j.line]=j.column,k()}function S(){let j;for(;r._index<s.length;){const I=s[r._index];if(typeof I=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<I.length;)y(I.charCodeAt(r._bufferIndex));else y(I)}}function y(j){c=c(j)}function g(j){G(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,k()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=j}function v(j,I){const $=I||{};return $.type=j,$.start=p(),d.events.push(["enter",$,d]),o.push($),$}function C(j){const I=o.pop();return I.end=p(),d.events.push(["exit",I,d]),I}function z(j,I){M(j,I.from)}function N(j,I){I.restore()}function P(j,I){return $;function $(H,L,te){let J,D,V,w;return Array.isArray(H)?ae(H):"tokenize"in H?ae([H]):ne(H);function ne(fe){return Ye;function Ye(B){const ie=B!==null&&fe[B],re=B!==null&&fe.null,be=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(re)?re:re?[re]:[]];return ae(be)(B)}}function ae(fe){return J=fe,D=0,fe.length===0?te:E(fe[D])}function E(fe){return Ye;function Ye(B){return w=T(),V=fe,fe.partial||(d.currentConstruct=fe),fe.name&&d.parser.constructs.disable.null.includes(fe.name)?qe():fe.tokenize.call(I?Object.assign(Object.create(d),I):d,u,ye,qe)(B)}}function ye(fe){return j(V,w),L}function qe(fe){return w.restore(),++D<J.length?E(J[D]):te}}}function M(j,I){j.resolveAll&&!l.includes(j)&&l.push(j),j.resolve&&pt(d.events,I,d.events.length-I,j.resolve(d.events.slice(I),d)),j.resolveTo&&(d.events=j.resolveTo(d.events,d))}function T(){const j=p(),I=d.previous,$=d.currentConstruct,H=d.events.length,L=Array.from(o);return{from:H,restore:te};function te(){r=j,d.previous=I,d.currentConstruct=$,d.events.length=H,o=L,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function z0(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,l)];else{if(s=e.slice(n,i),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}l>0&&s.push(e[i].slice(0,l))}return s}function I0(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let s;if(typeof l=="string")s=l;else switch(l){case-5:{s="\r";break}case-4:{s=`
319
+ `;break}case-3:{s=`\r
320
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(l)}i=l===-2,r.push(s)}return r.join("")}function P0(e){const r={constructs:tp([E0,...(e||{}).extensions||[]]),content:i(Qv),defined:[],document:i(Yv),flow:i(f0),lazy:{},string:i(p0),text:i(g0)};return r;function i(l){return s;function s(o){return T0(r,l,o)}}}function A0(e){for(;!sp(e););return e}const Ad=/[\0\t\n\r]/g;function M0(){let e=1,t="",n=!0,r;return i;function i(l,s,o){const u=[];let d,c,f,h,m;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(s||void 0).decode(l)),f=0,t="",n&&(l.charCodeAt(0)===65279&&f++,n=void 0);f<l.length;){if(Ad.lastIndex=f,d=Ad.exec(l),h=d&&d.index!==void 0?d.index:l.length,m=l.charCodeAt(h),!d){t=l.slice(f);break}if(m===10&&f===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),f<h&&(u.push(l.slice(f,h)),e+=h-f),m){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const L0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function R0(e){return e.replace(L0,D0)}function D0(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return np(n.slice(l?2:1),l?16:10)}return Du(n)||e}const fp={}.hasOwnProperty;function _0(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),O0(n)(A0(P0(n).document().write(M0()(e,t,!0))))}function O0(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(ke),autolinkProtocol:T,autolinkEmail:T,atxHeading:l(F),blockQuote:l(re),characterEscape:T,characterReference:T,codeFenced:l(be),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:l(be,s),codeText:l(zn,s),codeTextData:T,data:T,codeFlowValue:T,definition:l(In),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:l(Ps),hardBreakEscape:l(K),hardBreakTrailing:l(K),htmlFlow:l(q,s),htmlFlowData:T,htmlText:l(q,s),htmlTextData:T,image:l(Z),label:s,link:l(ke),listItem:l(Pn),listItemValue:h,listOrdered:l(_e,f),listUnordered:l(_e),paragraph:l(Tt),reference:E,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:l(F),strong:l(et),thematicBreak:l(kt)},exit:{atxHeading:u(),atxHeadingSequence:z,autolink:u(),autolinkEmail:ie,autolinkProtocol:B,blockQuote:u(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:qe,characterReferenceMarkerNumeric:qe,characterReferenceValue:fe,characterReference:Ye,codeFenced:u(S),codeFencedFence:x,codeFencedFenceInfo:m,codeFencedFenceMeta:p,codeFlowValue:k,codeIndented:u(y),codeText:u(L),codeTextData:k,data:k,definition:u(),definitionDestinationString:C,definitionLabelString:g,definitionTitleString:v,emphasis:u(),hardBreakEscape:u(I),hardBreakTrailing:u(I),htmlFlow:u($),htmlFlowData:k,htmlText:u(H),htmlTextData:k,image:u(J),label:V,labelText:D,lineEnding:j,link:u(te),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ye,resourceDestinationString:w,resourceTitleString:ne,resource:ae,setextHeading:u(M),setextHeadingLineSequence:P,setextHeadingText:N,strong:u(),thematicBreak:u()}};hp(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(A){let R={type:"root",children:[]};const W={stack:[R],tokenStack:[],config:t,enter:o,exit:d,buffer:s,resume:c,data:n},Y=[];let ue=-1;for(;++ue<A.length;)if(A[ue][1].type==="listOrdered"||A[ue][1].type==="listUnordered")if(A[ue][0]==="enter")Y.push(ue);else{const ze=Y.pop();ue=i(A,ze,ue)}for(ue=-1;++ue<A.length;){const ze=t[A[ue][0]];fp.call(ze,A[ue][1].type)&&ze[A[ue][1].type].call(Object.assign({sliceSerialize:A[ue][2].sliceSerialize},W),A[ue][1])}if(W.tokenStack.length>0){const ze=W.tokenStack[W.tokenStack.length-1];(ze[1]||Md).call(W,void 0,ze[0])}for(R.position={start:on(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:on(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},ue=-1;++ue<t.transforms.length;)R=t.transforms[ue](R)||R;return R}function i(A,R,W){let Y=R-1,ue=-1,ze=!1,An,Qt,Br,Ur;for(;++Y<=W;){const ct=A[Y];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?ue++:ue--,Ur=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&(An&&!Ur&&!ue&&!Br&&(Br=Y),Ur=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ur=void 0}if(!ue&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||ue===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if(An){let rr=Y;for(Qt=void 0;rr--;){const qt=A[rr];if(qt[1].type==="lineEnding"||qt[1].type==="lineEndingBlank"){if(qt[0]==="exit")continue;Qt&&(A[Qt][1].type="lineEndingBlank",ze=!0),qt[1].type="lineEnding",Qt=rr}else if(!(qt[1].type==="linePrefix"||qt[1].type==="blockQuotePrefix"||qt[1].type==="blockQuotePrefixWhitespace"||qt[1].type==="blockQuoteMarker"||qt[1].type==="listItemIndent"))break}Br&&(!Qt||Br<Qt)&&(An._spread=!0),An.end=Object.assign({},Qt?A[Qt][1].start:ct[1].end),A.splice(Qt||Y,0,["exit",An,ct[2]]),Y++,W++}if(ct[1].type==="listItemPrefix"){const rr={type:"listItem",_spread:!1,start:Object.assign({},ct[1].start),end:void 0};An=rr,A.splice(Y,0,["enter",rr,ct[2]]),Y++,W++,Br=void 0,Ur=!0}}}return A[R][1]._spread=ze,W}function l(A,R){return W;function W(Y){o.call(this,A(Y),Y),R&&R.call(this,Y)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(A,R,W){this.stack[this.stack.length-1].children.push(A),this.stack.push(A),this.tokenStack.push([R,W||void 0]),A.position={start:on(R.start),end:void 0}}function u(A){return R;function R(W){A&&A.call(this,W),d.call(this,W)}}function d(A,R){const W=this.stack.pop(),Y=this.tokenStack.pop();if(Y)Y[0].type!==A.type&&(R?R.call(this,A,Y[0]):(Y[1]||Md).call(this,A,Y[0]));else throw new Error("Cannot close `"+A.type+"` ("+hi({start:A.start,end:A.end})+"): it’s not open");W.position.end=on(A.end)}function c(){return Ru(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(A){if(this.data.expectingFirstListItemValue){const R=this.stack[this.stack.length-2];R.start=Number.parseInt(this.sliceSerialize(A),10),this.data.expectingFirstListItemValue=void 0}}function m(){const A=this.resume(),R=this.stack[this.stack.length-1];R.lang=A}function p(){const A=this.resume(),R=this.stack[this.stack.length-1];R.meta=A}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const A=this.resume(),R=this.stack[this.stack.length-1];R.value=A.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const A=this.resume(),R=this.stack[this.stack.length-1];R.value=A.replace(/(\r?\n|\r)$/g,"")}function g(A){const R=this.resume(),W=this.stack[this.stack.length-1];W.label=R,W.identifier=Rt(this.sliceSerialize(A)).toLowerCase()}function v(){const A=this.resume(),R=this.stack[this.stack.length-1];R.title=A}function C(){const A=this.resume(),R=this.stack[this.stack.length-1];R.url=A}function z(A){const R=this.stack[this.stack.length-1];if(!R.depth){const W=this.sliceSerialize(A).length;R.depth=W}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function P(A){const R=this.stack[this.stack.length-1];R.depth=this.sliceSerialize(A).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function T(A){const W=this.stack[this.stack.length-1].children;let Y=W[W.length-1];(!Y||Y.type!=="text")&&(Y=tt(),Y.position={start:on(A.start),end:void 0},W.push(Y)),this.stack.push(Y)}function k(A){const R=this.stack.pop();R.value+=this.sliceSerialize(A),R.position.end=on(A.end)}function j(A){const R=this.stack[this.stack.length-1];if(this.data.atHardBreak){const W=R.children[R.children.length-1];W.position.end=on(A.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(R.type)&&(T.call(this,A),k.call(this,A))}function I(){this.data.atHardBreak=!0}function $(){const A=this.resume(),R=this.stack[this.stack.length-1];R.value=A}function H(){const A=this.resume(),R=this.stack[this.stack.length-1];R.value=A}function L(){const A=this.resume(),R=this.stack[this.stack.length-1];R.value=A}function te(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const R=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=R,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function J(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const R=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=R,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function D(A){const R=this.sliceSerialize(A),W=this.stack[this.stack.length-2];W.label=R0(R),W.identifier=Rt(R).toLowerCase()}function V(){const A=this.stack[this.stack.length-1],R=this.resume(),W=this.stack[this.stack.length-1];if(this.data.inReference=!0,W.type==="link"){const Y=A.children;W.children=Y}else W.alt=R}function w(){const A=this.resume(),R=this.stack[this.stack.length-1];R.url=A}function ne(){const A=this.resume(),R=this.stack[this.stack.length-1];R.title=A}function ae(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function ye(A){const R=this.resume(),W=this.stack[this.stack.length-1];W.label=R,W.identifier=Rt(this.sliceSerialize(A)).toLowerCase(),this.data.referenceType="full"}function qe(A){this.data.characterReferenceType=A.type}function fe(A){const R=this.sliceSerialize(A),W=this.data.characterReferenceType;let Y;W?(Y=np(R,W==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Y=Du(R);const ue=this.stack[this.stack.length-1];ue.value+=Y}function Ye(A){const R=this.stack.pop();R.position.end=on(A.end)}function B(A){k.call(this,A);const R=this.stack[this.stack.length-1];R.url=this.sliceSerialize(A)}function ie(A){k.call(this,A);const R=this.stack[this.stack.length-1];R.url="mailto:"+this.sliceSerialize(A)}function re(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function zn(){return{type:"inlineCode",value:""}}function In(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ps(){return{type:"emphasis",children:[]}}function F(){return{type:"heading",depth:0,children:[]}}function K(){return{type:"break"}}function q(){return{type:"html",value:""}}function Z(){return{type:"image",title:null,url:"",alt:null}}function ke(){return{type:"link",title:null,url:"",children:[]}}function _e(A){return{type:"list",ordered:A.type==="listOrdered",start:null,spread:A._spread,children:[]}}function Pn(A){return{type:"listItem",spread:A._spread,checked:null,children:[]}}function Tt(){return{type:"paragraph",children:[]}}function et(){return{type:"strong",children:[]}}function tt(){return{type:"text",value:""}}function kt(){return{type:"thematicBreak"}}}function on(e){return{line:e.line,column:e.column,offset:e.offset}}function hp(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?hp(e,r):F0(e,r)}}function F0(e,t){let n;for(n in t)if(fp.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 Md(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hi({start:t.start,end:t.end})+") is still open")}function $0(e){const t=this;t.parser=n;function n(r){return _0(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function B0(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 U0(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
321
+ `}]}function H0(e,t){const n=t.value?t.value+`
322
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function V0(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function W0(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Q0(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=$r(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let s,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=l+1,o+=1,e.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,d),e.applyData(t,d)}function q0(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 Y0(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function mp(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),l=i[0];l&&l.type==="text"?l.value="["+l.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 K0(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mp(e,t);const i={src:$r(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function G0(e,t){const n={src:$r(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 X0(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 Z0(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mp(e,t);const i={href:$r(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function J0(e,t){const n={href:$r(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 ew(e,t,n){const r=e.all(t),i=n?tw(n):pp(t),l={},s=[];if(typeof t.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const c=r[o];(i||o!==0||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
323
+ `}),c.type==="element"&&c.tagName==="p"&&!i?s.push(...c.children):s.push(c)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
324
+ `});const d={type:"element",tagName:"li",properties:l,children:s};return e.patch(t,d),e.applyData(t,d)}function tw(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=pp(n[r])}return t}function pp(e){const t=e.spread;return t??e.children.length>1}function nw(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 l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function rw(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iw(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function lw(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sw(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)},o=Pu(t.children[1]),u=Ym(t.children[t.children.length-1]);o&&u&&(s.position={start:o,end:u}),i.push(s)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function ow(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,o=s?s.length:t.children.length;let u=-1;const d=[];for(;++u<o;){const f=t.children[u],h={},m=s?s[u]:void 0;m&&(h.align=m);let p={type:"element",tagName:l,properties:h,children:[]};f&&(p.children=e.all(f),e.patch(f,p),p=e.applyData(f,p)),d.push(p)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,c),e.applyData(t,c)}function aw(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ld=9,Rd=32;function uw(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(Dd(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(Dd(t.slice(i),i>0,!1)),l.join("")}function Dd(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===Ld||l===Rd;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===Ld||l===Rd;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function cw(e,t){const n={type:"text",value:uw(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function dw(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const fw={blockquote:B0,break:U0,code:H0,delete:V0,emphasis:W0,footnoteReference:Q0,heading:q0,html:Y0,imageReference:K0,image:G0,inlineCode:X0,linkReference:Z0,link:J0,listItem:ew,list:nw,paragraph:rw,root:iw,strong:lw,table:sw,tableCell:aw,tableRow:ow,text:cw,thematicBreak:dw,toml:ol,yaml:ol,definition:ol,footnoteDefinition:ol};function ol(){}const gp=-1,Ts=0,pi=1,is=2,Ou=3,Fu=4,$u=5,Bu=6,yp=7,xp=8,hw=typeof self=="object"?self:globalThis,_d=(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 hw[e](t)},mw=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,s]=t[i];switch(l){case Ts:case gp:return n(s,i);case pi:{const o=n([],i);for(const u of s)o.push(r(u));return o}case is:{const o=n({},i);for(const[u,d]of s)o[r(u)]=r(d);return o}case Ou:return n(new Date(s),i);case Fu:{const{source:o,flags:u}=s;return n(new RegExp(o,u),i)}case $u:{const o=n(new Map,i);for(const[u,d]of s)o.set(r(u),r(d));return o}case Bu:{const o=n(new Set,i);for(const u of s)o.add(r(u));return o}case yp:{const{name:o,message:u}=s;return n(_d(o,u),i)}case xp: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:o}=new Uint8Array(s);return n(new DataView(o),s)}}return n(_d(l,s),i)};return r},Od=e=>mw(new Map,e)(0),Dn="",{toString:pw}={},{keys:gw}=Object,Zr=e=>{const t=typeof e;if(t!=="object"||!e)return[Ts,t];const n=pw.call(e).slice(8,-1);switch(n){case"Array":return[pi,Dn];case"Object":return[is,Dn];case"Date":return[Ou,Dn];case"RegExp":return[Fu,Dn];case"Map":return[$u,Dn];case"Set":return[Bu,Dn];case"DataView":return[pi,n]}return n.includes("Array")?[pi,n]:n.includes("Error")?[yp,n]:[is,n]},al=([e,t])=>e===Ts&&(t==="function"||t==="symbol"),yw=(e,t,n,r)=>{const i=(s,o)=>{const u=r.push(s)-1;return n.set(o,u),u},l=s=>{if(n.has(s))return n.get(s);let[o,u]=Zr(s);switch(o){case Ts:{let c=s;switch(u){case"bigint":o=xp,c=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([gp],s)}return i([o,c],s)}case pi:{if(u){let h=s;return u==="DataView"?h=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(s)),i([u,[...h]],s)}const c=[],f=i([o,c],s);for(const h of s)c.push(l(h));return f}case is:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return l(s.toJSON());const c=[],f=i([o,c],s);for(const h of gw(s))(e||!al(Zr(s[h])))&&c.push([l(h),l(s[h])]);return f}case Ou:return i([o,isNaN(s.getTime())?Dn:s.toISOString()],s);case Fu:{const{source:c,flags:f}=s;return i([o,{source:c,flags:f}],s)}case $u:{const c=[],f=i([o,c],s);for(const[h,m]of s)(e||!(al(Zr(h))||al(Zr(m))))&&c.push([l(h),l(m)]);return f}case Bu:{const c=[],f=i([o,c],s);for(const h of s)(e||!al(Zr(h)))&&c.push(l(h));return f}}const{message:d}=s;return i([o,{name:u,message:d}],s)};return l},Fd=(e,{json:t,lossy:n}={})=>{const r=[];return yw(!(t||n),!!t,new Map,r)(e),r},ls=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Od(Fd(e,t)):structuredClone(e):(e,t)=>Od(Fd(e,t));function xw(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 vw(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function kw(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||xw,r=e.options.footnoteBackLabel||vw,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[u]);if(!d)continue;const c=e.all(d),f=String(d.identifier).toUpperCase(),h=$r(f.toLowerCase());let m=0;const p=[],x=e.footnoteCounts.get(f);for(;x!==void 0&&++m<=x;){p.length>0&&p.push({type:"text",value:" "});let g=typeof n=="string"?n:n(u,m);typeof g=="string"&&(g={type:"text",value:g}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(g)?g:[g]})}const S=c[c.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const g=S.children[S.children.length-1];g&&g.type==="text"?g.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...p)}else c.push(...p);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(c,!0)};e.patch(d,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...ls(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
325
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
326
+ `}]}}const zs=function(e){if(e==null)return Cw;if(typeof e=="function")return Is(e);if(typeof e=="object")return Array.isArray(e)?ww(e):bw(e);if(typeof e=="string")return Sw(e);throw new Error("Expected function, string, or object as test")};function ww(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zs(e[n]);return Is(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function bw(e){const t=e;return Is(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function Sw(e){return Is(t);function t(n){return n&&n.type===e}}function Is(e){return t;function t(n,r,i){return!!(jw(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Cw(){return!0}function jw(e){return e!==null&&typeof e=="object"&&"type"in e}const vp=[],Nw=!0,Ca=!1,Ew="skip";function kp(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const l=zs(i),s=r?-1:1;o(e,void 0,[])();function o(u,d,c){const f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){const m=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=vp,p,x,S;if((!t||l(u,d,c[c.length-1]||void 0))&&(m=Tw(n(u,c)),m[0]===Ca))return m;if("children"in u&&u.children){const y=u;if(y.children&&m[0]!==Ew)for(x=(r?y.children.length:-1)+s,S=c.concat(y);x>-1&&x<y.children.length;){const g=y.children[x];if(p=o(g,x,S)(),p[0]===Ca)return p;x=typeof p[1]=="number"?p[1]:x+s}}return m}}}function Tw(e){return Array.isArray(e)?e:typeof e=="number"?[Nw,e]:e==null?vp:[e]}function Uu(e,t,n,r){let i,l,s;typeof t=="function"&&typeof n!="function"?(l=void 0,s=t,i=n):(l=t,s=n,i=r),kp(e,l,o,i);function o(u,d){const c=d[d.length-1],f=c?c.children.indexOf(u):void 0;return s(u,f,c)}}const ja={}.hasOwnProperty,zw={};function Iw(e,t){const n=t||zw,r=new Map,i=new Map,l=new Map,s={...fw,...n.handlers},o={all:d,applyData:Aw,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:s,one:u,options:n,patch:Pw,wrap:Lw};return Uu(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const f=c.type==="definition"?r:i,h=String(c.identifier).toUpperCase();f.has(h)||f.set(h,c)}}),o;function u(c,f){const h=c.type,m=o.handlers[h];if(ja.call(o.handlers,h)&&m)return m(o,c,f);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in c){const{children:x,...S}=c,y=ls(S);return y.children=o.all(c),y}return ls(c)}return(o.options.unknownHandler||Mw)(o,c,f)}function d(c){const f=[];if("children"in c){const h=c.children;let m=-1;for(;++m<h.length;){const p=o.one(h[m],c);if(p){if(m&&h[m-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=$d(p.value)),!Array.isArray(p)&&p.type==="element")){const x=p.children[0];x&&x.type==="text"&&(x.value=$d(x.value))}Array.isArray(p)?f.push(...p):f.push(p)}}}return f}}function Pw(e,t){e.position&&(t.position=xv(e))}function Aw(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=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"&&l&&Object.assign(n.properties,ls(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Mw(e,t){const n=t.data||{},r="value"in t&&!(ja.call(n,"hProperties")||ja.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 Lw(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
327
+ `});++r<e.length;)r&&n.push({type:"text",value:`
328
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
329
+ `}),n}function $d(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Bd(e,t){const n=Iw(e,t),r=n.one(e,void 0),i=kw(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
330
+ `},i),l}function Rw(e,t){return e&&"run"in e?async function(n,r){const i=Bd(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Bd(n,{file:r,...e||t})}}function Ud(e){if(e)throw e}var Nl=Object.prototype.hasOwnProperty,wp=Object.prototype.toString,Hd=Object.defineProperty,Vd=Object.getOwnPropertyDescriptor,Wd=function(t){return typeof Array.isArray=="function"?Array.isArray(t):wp.call(t)==="[object Array]"},Qd=function(t){if(!t||wp.call(t)!=="[object Object]")return!1;var n=Nl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Nl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Nl.call(t,i)},qd=function(t,n){Hd&&n.name==="__proto__"?Hd(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Yd=function(t,n){if(n==="__proto__")if(Nl.call(t,n)){if(Vd)return Vd(t,n).value}else return;return t[n]},Dw=function e(){var t,n,r,i,l,s,o=arguments[0],u=1,d=arguments.length,c=!1;for(typeof o=="boolean"&&(c=o,o=arguments[1]||{},u=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});u<d;++u)if(t=arguments[u],t!=null)for(n in t)r=Yd(o,n),i=Yd(t,n),o!==i&&(c&&i&&(Qd(i)||(l=Wd(i)))?(l?(l=!1,s=r&&Wd(r)?r:[]):s=r&&Qd(r)?r:{},qd(o,{name:n,newValue:e(c,s,i)})):typeof i<"u"&&qd(o,{name:n,newValue:i}));return o};const ao=Pa(Dw);function Na(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 _w(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...i);function o(u,...d){const c=e[++l];let f=-1;if(u){s(u);return}for(;++f<i.length;)(d[f]===null||d[f]===void 0)&&(d[f]=i[f]);i=d,c?Ow(c,o)(...d):s(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Ow(e,t){let n;return r;function r(...s){const o=e.length>s.length;let u;o&&s.push(i);try{u=e.apply(this,s)}catch(d){const c=d;if(o&&n)throw c;return i(c)}o||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(s,...o){n||(n=!0,t(s,...o))}function l(s){i(null,s)}}const Bt={basename:Fw,dirname:$w,extname:Bw,join:Uw,sep:"/"};function Fw(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hi(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else s<0&&(l=!0,s=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function $w(e){if(Hi(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 Bw(e){Hi(e);let t=e.length,n=-1,r=0,i=-1,l=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),o===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Uw(...e){let t=-1,n;for(;++t<e.length;)Hi(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Hw(n)}function Hw(e){Hi(e);const t=e.codePointAt(0)===47;let n=Vw(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Vw(e,t){let n="",r=0,i=-1,l=0,s=-1,o,u;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||l===1))if(i!==s-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,l=0;continue}}else if(n.length>0){n="",r=0,i=s,l=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,l=0}else o===46&&l>-1?l++:l=-1}return n}function Hi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ww={cwd:Qw};function Qw(){return"/"}function Ea(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function qw(e){if(typeof e=="string")e=new URL(e);else if(!Ea(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 Yw(e)}function Yw(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 uo=["history","path","basename","stem","extname","dirname"];class bp{constructor(t){let n;t?Ea(t)?n={path:t}:typeof t=="string"||Kw(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Ww.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<uo.length;){const l=uo[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)uo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Bt.basename(this.path):void 0}set basename(t){fo(t,"basename"),co(t,"basename"),this.path=Bt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Bt.dirname(this.path):void 0}set dirname(t){Kd(this.basename,"dirname"),this.path=Bt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Bt.extname(this.path):void 0}set extname(t){if(co(t,"extname"),Kd(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=Bt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ea(t)&&(t=qw(t)),fo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Bt.basename(this.path,this.extname):void 0}set stem(t){fo(t,"stem"),co(t,"stem"),this.path=Bt.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 Qe(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 co(e,t){if(e&&e.includes(Bt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Bt.sep+"`")}function fo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Kd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Kw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Gw=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},Xw={}.hasOwnProperty;class Hu extends Gw{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=_w()}copy(){const t=new Hu;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ao(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(po("data",this.frozen),this.namespace[t]=n,this):Xw.call(this.namespace,t)&&this.namespace[t]||void 0:t?(po("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=ul(t),r=this.parser||this.Parser;return ho("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ho("process",this.parser||this.Parser),mo("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,s){const o=ul(t),u=r.parse(o);r.run(u,o,function(c,f,h){if(c||!f||!h)return d(c);const m=f,p=r.stringify(m,h);eb(p)?h.value=p:h.result=p,d(c,h)});function d(c,f){c||!f?s(c):l?l(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),ho("processSync",this.parser||this.Parser),mo("processSync",this.compiler||this.Compiler),this.process(t,i),Xd("processSync","process",n),r;function i(l,s){n=!0,Ud(l),r=s}}run(t,n,r){Gd(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(s,o){const u=ul(n);i.run(t,u,d);function d(c,f,h){const m=f||t;c?o(c):s?s(m):r(void 0,m,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),Xd("runSync","run",r),i;function l(s,o){Ud(s),i=o,r=!0}}stringify(t,n){this.freeze();const r=ul(n),i=this.compiler||this.Compiler;return mo("stringify",i),Gd(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(po("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[c,...f]=d;u(c,f)}else s(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function s(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(d.plugins),d.settings&&(i.settings=ao(!0,i.settings,d.settings))}function o(d){let c=-1;if(d!=null)if(Array.isArray(d))for(;++c<d.length;){const f=d[c];l(f)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,c){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===d){h=f;break}if(h===-1)r.push([d,...c]);else if(c.length>0){let[m,...p]=c;const x=r[h][1];Na(x)&&Na(m)&&(m=ao(!0,x,m)),r[h]=[d,m,...p]}}}}const Zw=new Hu().freeze();function ho(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function mo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function po(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 Gd(e){if(!Na(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Xd(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ul(e){return Jw(e)?e:new bp(e)}function Jw(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function eb(e){return typeof e=="string"||tb(e)}function tb(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nb="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Zd=[],Jd={allowDangerousHtml:!0},rb=/^(https?|ircs?|mailto|xmpp)$/i,ib=[{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:"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 lb(e){const t=sb(e),n=ob(e);return ab(t.runSync(t.parse(n),n),e)}function sb(e){const t=e.rehypePlugins||Zd,n=e.remarkPlugins||Zd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Jd}:Jd;return Zw().use($0).use(n).use(Rw,r).use(t)}function ob(e){const t=e.children||"",n=new bp;return typeof t=="string"&&(n.value=t),n}function ab(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,l=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,u=t.urlTransform||ub;for(const c of ib)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+nb+c.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Uu(e,d),Sv(e,{Fragment:a.Fragment,components:i,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function d(c,f,h){if(c.type==="raw"&&h&&typeof f=="number")return s?h.children.splice(f,1):h.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let m;for(m in lo)if(Object.hasOwn(lo,m)&&Object.hasOwn(c.properties,m)){const p=c.properties[m],x=lo[m];(x===null||x.includes(c.tagName))&&(c.properties[m]=u(String(p||""),m,c))}}if(c.type==="element"){let m=n?!n.includes(c.tagName):l?l.includes(c.tagName):!1;if(!m&&r&&typeof f=="number"&&(m=!r(c,f,h)),m&&h&&typeof f=="number")return o&&c.children?h.children.splice(f,1,...c.children):h.children.splice(f,1),f}}}function ub(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||rb.test(e.slice(0,t))?e:""}function ef(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 cb(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function db(e,t,n){const i=zs((n||{}).ignore||[]),l=fb(t);let s=-1;for(;++s<l.length;)kp(e,"text",o);function o(d,c){let f=-1,h;for(;++f<c.length;){const m=c[f],p=h?h.children:void 0;if(i(m,p?p.indexOf(m):void 0,h))return;h=m}if(h)return u(d,c)}function u(d,c){const f=c[c.length-1],h=l[s][0],m=l[s][1];let p=0;const S=f.children.indexOf(d);let y=!1,g=[];h.lastIndex=0;let v=h.exec(d.value);for(;v;){const C=v.index,z={index:v.index,input:v.input,stack:[...c,d]};let N=m(...v,z);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?h.lastIndex=C+1:(p!==C&&g.push({type:"text",value:d.value.slice(p,C)}),Array.isArray(N)?g.push(...N):N&&g.push(N),p=C+v[0].length,y=!0),!h.global)break;v=h.exec(d.value)}return y?(p<d.value.length&&g.push({type:"text",value:d.value.slice(p)}),f.children.splice(S,1,...g)):g=[d],S+g.length}}function fb(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([hb(i[0]),mb(i[1])])}return t}function hb(e){return typeof e=="string"?new RegExp(cb(e),"g"):e}function mb(e){return typeof e=="function"?e:function(){return e}}const go="phrasing",yo=["autolink","link","image","label"];function pb(){return{transforms:[bb],enter:{literalAutolink:yb,literalAutolinkEmail:xo,literalAutolinkHttp:xo,literalAutolinkWww:xo},exit:{literalAutolink:wb,literalAutolinkEmail:kb,literalAutolinkHttp:xb,literalAutolinkWww:vb}}}function gb(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:go,notInConstruct:yo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:go,notInConstruct:yo},{character:":",before:"[ps]",after:"\\/",inConstruct:go,notInConstruct:yo}]}}function yb(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xo(e){this.config.enter.autolinkProtocol.call(this,e)}function xb(e){this.config.exit.autolinkProtocol.call(this,e)}function vb(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 kb(e){this.config.exit.autolinkEmail.call(this,e)}function wb(e){this.exit(e)}function bb(e){db(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Sb],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Cb]],{ignore:["link","linkReference"]})}function Sb(e,t,n,r,i){let l="";if(!Sp(i)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!jb(n)))return!1;const s=Nb(n+r);if(!s[0])return!1;const o={type:"link",title:null,url:l+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function Cb(e,t,n,r){return!Sp(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function jb(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 Nb(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=ef(e,"(");let l=ef(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function Sp(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Xn(n)||Ns(n))&&(!t||n!==47)}Cp.peek=Rb;function Eb(){this.buffer()}function Tb(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function zb(){this.buffer()}function Ib(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Pb(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Rt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ab(e){this.exit(e)}function Mb(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Rt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Lb(e){this.exit(e)}function Rb(){return"["}function Cp(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const s=n.enter("footnoteReference"),o=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),s(),l+=i.move("]"),l}function Db(){return{enter:{gfmFootnoteCallString:Eb,gfmFootnoteCall:Tb,gfmFootnoteDefinitionLabelString:zb,gfmFootnoteDefinition:Ib},exit:{gfmFootnoteCallString:Pb,gfmFootnoteCall:Ab,gfmFootnoteDefinitionLabelString:Mb,gfmFootnoteDefinition:Lb}}}function _b(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Cp},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,s){const o=l.createTracker(s);let u=o.move("[^");const d=l.enter("footnoteDefinition"),c=l.enter("label");return u+=o.move(l.safe(l.associationId(r),{before:u,after:"]"})),c(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((t?`
331
+ `:" ")+l.indentLines(l.containerFlow(r,o.current()),t?jp:Ob))),d(),u}}function Ob(e,t,n){return t===0?e:jp(e,t,n)}function jp(e,t,n){return(n?"":" ")+e}const Fb=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Np.peek=Vb;function $b(){return{canContainEols:["delete"],enter:{strikethrough:Ub},exit:{strikethrough:Hb}}}function Bb(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Fb}],handlers:{delete:Np}}}function Ub(e){this.enter({type:"delete",children:[]},e)}function Hb(e){this.exit(e)}function Np(e,t,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),l(),s}function Vb(){return"~"}function Wb(e){return e.length}function Qb(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Wb,l=[],s=[],o=[],u=[];let d=0,c=-1;for(;++c<e.length;){const x=[],S=[];let y=-1;for(e[c].length>d&&(d=e[c].length);++y<e[c].length;){const g=qb(e[c][y]);if(n.alignDelimiters!==!1){const v=i(g);S[y]=v,(u[y]===void 0||v>u[y])&&(u[y]=v)}x.push(g)}s[c]=x,o[c]=S}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<d;)l[f]=tf(r[f]);else{const x=tf(r);for(;++f<d;)l[f]=x}f=-1;const h=[],m=[];for(;++f<d;){const x=l[f];let S="",y="";x===99?(S=":",y=":"):x===108?S=":":x===114&&(y=":");let g=n.alignDelimiters===!1?1:Math.max(1,u[f]-S.length-y.length);const v=S+"-".repeat(g)+y;n.alignDelimiters!==!1&&(g=S.length+g+y.length,g>u[f]&&(u[f]=g),m[f]=g),h[f]=v}s.splice(1,0,h),o.splice(1,0,m),c=-1;const p=[];for(;++c<s.length;){const x=s[c],S=o[c];f=-1;const y=[];for(;++f<d;){const g=x[f]||"";let v="",C="";if(n.alignDelimiters!==!1){const z=u[f]-(S[f]||0),N=l[f];N===114?v=" ".repeat(z):N===99?z%2?(v=" ".repeat(z/2+.5),C=" ".repeat(z/2-.5)):(v=" ".repeat(z/2),C=v):C=" ".repeat(z)}n.delimiterStart!==!1&&!f&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&g==="")&&(n.delimiterStart!==!1||f)&&y.push(" "),n.alignDelimiters!==!1&&y.push(v),y.push(g),n.alignDelimiters!==!1&&y.push(C),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||f!==d-1)&&y.push("|")}p.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return p.join(`
332
+ `)}function qb(e){return e==null?"":String(e)}function tf(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 Yb(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const s=n.indentLines(n.containerFlow(e,l.current()),Kb);return i(),s}function Kb(e,t,n){return">"+(n?"":" ")+e}function Gb(e,t){return nf(e,t.inConstruct,!0)&&!nf(e,t.notInConstruct,!1)}function nf(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 rf(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
333
+ `&&Gb(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
334
+ `}function Xb(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>s&&(s=l):l=1,i=r+t.length,r=n.indexOf(t,i);return s}function Zb(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 Jb(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 eS(e,t,n,r){const i=Jb(n),l=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(Zb(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(l,tS);return f(),h}const o=n.createTracker(r),u=i.repeat(Math.max(Xb(l,i)+1,3)),d=n.enter("codeFenced");let c=o.move(u);if(e.lang){const f=n.enter(`codeFencedLang${s}`);c+=o.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${s}`);c+=o.move(" "),c+=o.move(n.safe(e.meta,{before:c,after:`
335
+ `,encode:["`"],...o.current()})),f()}return c+=o.move(`
336
+ `),l&&(c+=o.move(l+`
337
+ `)),c+=o.move(u),d(),c}function tS(e,t,n){return(n?"":" ")+e}function Vu(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 nS(e,t,n,r){const i=Vu(n),l=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(o=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":`
338
+ `,...u.current()}))),o(),e.title&&(o=n.enter(`title${l}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),o()),s(),d}function rS(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 Li(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ss(e,t,n){const r=Lr(e),i=Lr(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}}Ep.peek=iS;function Ep(e,t,n,r){const i=rS(n),l=n.enter("emphasis"),s=n.createTracker(r),o=s.move(i);let u=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const d=u.charCodeAt(0),c=ss(r.before.charCodeAt(r.before.length-1),d,i);c.inside&&(u=Li(d)+u.slice(1));const f=u.charCodeAt(u.length-1),h=ss(r.after.charCodeAt(0),f,i);h.inside&&(u=u.slice(0,-1)+Li(f));const m=s.move(i);return l(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},o+u+m}function iS(e,t,n){return n.options.emphasis||"*"}function lS(e,t){let n=!1;return Uu(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ca}),!!((!e.depth||e.depth<3)&&Ru(e)&&(t.options.setext||n))}function sS(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(lS(e,n)){const c=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...l.current(),before:`
339
+ `,after:`
340
+ `});return f(),c(),h+`
341
+ `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
342
+ `))+1))}const s="#".repeat(i),o=n.enter("headingAtx"),u=n.enter("phrasing");l.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
343
+ `,...l.current()});return/^[\t ]/.test(d)&&(d=Li(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),u(),o(),d}Tp.peek=oS;function Tp(e){return e.value||""}function oS(){return"<"}zp.peek=aS;function zp(e,t,n,r){const i=Vu(n),l=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(o=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=n.enter(`title${l}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),o()),d+=u.move(")"),s(),d}function aS(){return"!"}Ip.peek=uS;function Ip(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const d=n.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(d+"]["),s();const c=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return s(),n.stack=c,l(),i==="full"||!d||d!==f?u+=o.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function uS(){return"!"}Pp.peek=cS;function Pp(e,t,n){let r=e.value||"",i="`",l=-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+" ");++l<n.unsafe.length;){const s=n.unsafe[l],o=n.compilePattern(s);let u;if(s.atBreak)for(;u=o.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return i+r+i}function cS(){return"`"}function Ap(e,t){const n=Ru(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))}Mp.peek=dS;function Mp(e,t,n,r){const i=Vu(n),l=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let o,u;if(Ap(e,n)){const c=n.stack;n.stack=[],o=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),o(),n.stack=c,f}o=n.enter("link"),u=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(u=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${l}`),d+=s.move(" "+i),d+=s.move(n.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),u()),d+=s.move(")"),o(),d}function dS(e,t,n){return Ap(e,n)?"<":"["}Lp.peek=fS;function Lp(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const d=n.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(d+"]["),s();const c=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return s(),n.stack=c,l(),i==="full"||!d||d!==f?u+=o.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function fS(){return"["}function Wu(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 hS(e){const t=Wu(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 mS(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 Rp(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 pS(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let s=e.ordered?mS(n):Wu(n);const o=e.ordered?s==="."?")":".":hS(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const c=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.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&&(u=!0),Rp(n)===s&&c){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=o),n.bulletCurrent=s;const d=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=l,i(),d}function gS(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 yS(e,t,n,r){const i=gS(n);let l=n.bulletCurrent||Wu(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let s=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(s-l.length)),o.shift(s);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,o.current()),c);return u(),d;function c(f,h,m){return h?(m?"":" ".repeat(s))+f:(m?l:l+" ".repeat(s-l.length))+f}}function xS(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),s=n.containerPhrasing(e,r);return l(),i(),s}const vS=zs(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function kS(e,t,n,r){return(e.children.some(function(s){return vS(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function wS(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Dp.peek=bS;function Dp(e,t,n,r){const i=wS(n),l=n.enter("strong"),s=n.createTracker(r),o=s.move(i+i);let u=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const d=u.charCodeAt(0),c=ss(r.before.charCodeAt(r.before.length-1),d,i);c.inside&&(u=Li(d)+u.slice(1));const f=u.charCodeAt(u.length-1),h=ss(r.after.charCodeAt(0),f,i);h.inside&&(u=u.slice(0,-1)+Li(f));const m=s.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},o+u+m}function bS(e,t,n){return n.options.strong||"*"}function SS(e,t,n,r){return n.safe(e.value,r)}function CS(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 jS(e,t,n){const r=(Rp(n)+(n.options.ruleSpaces?" ":"")).repeat(CS(n));return n.options.ruleSpaces?r.slice(0,-1):r}const _p={blockquote:Yb,break:rf,code:eS,definition:nS,emphasis:Ep,hardBreak:rf,heading:sS,html:Tp,image:zp,imageReference:Ip,inlineCode:Pp,link:Mp,linkReference:Lp,list:pS,listItem:yS,paragraph:xS,root:kS,strong:Dp,text:SS,thematicBreak:jS};function NS(){return{enter:{table:ES,tableData:lf,tableHeader:lf,tableRow:zS},exit:{codeText:IS,table:TS,tableData:vo,tableHeader:vo,tableRow:vo}}}function ES(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 TS(e){this.exit(e),this.data.inTable=void 0}function zS(e){this.enter({type:"tableRow",children:[]},e)}function vo(e){this.exit(e)}function lf(e){this.enter({type:"tableCell",children:[]},e)}function IS(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,PS));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function PS(e,t){return t==="|"?t:e}function AS(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
344
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:u,tableRow:o}};function s(m,p,x,S){return d(c(m,x,S),m.align)}function o(m,p,x,S){const y=f(m,x,S),g=d([y]);return g.slice(0,g.indexOf(`
345
+ `))}function u(m,p,x,S){const y=x.enter("tableCell"),g=x.enter("phrasing"),v=x.containerPhrasing(m,{...S,before:l,after:l});return g(),y(),v}function d(m,p){return Qb(m,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function c(m,p,x){const S=m.children;let y=-1;const g=[],v=p.enter("table");for(;++y<S.length;)g[y]=f(S[y],p,x);return v(),g}function f(m,p,x){const S=m.children;let y=-1;const g=[],v=p.enter("tableRow");for(;++y<S.length;)g[y]=u(S[y],m,p,x);return v(),g}function h(m,p,x){let S=_p.inlineCode(m,p,x);return x.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function MS(){return{exit:{taskListCheckValueChecked:sf,taskListCheckValueUnchecked:sf,paragraph:RS}}}function LS(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:DS}}}function sf(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function RS(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 l=-1,s;for(;++l<i.length;){const o=i[l];if(o.type==="paragraph"){s=o;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 DS(e,t,n,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);l&&o.move(s);let u=_p.listItem(e,t,n,{...r,...o.current()});return l&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(c){return c+s}}function _S(){return[pb(),Db(),$b(),NS(),MS()]}function OS(e){return{extensions:[gb(),_b(e),Bb(),AS(e),LS()]}}const FS={tokenize:WS,partial:!0},Op={tokenize:QS,partial:!0},Fp={tokenize:qS,partial:!0},$p={tokenize:YS,partial:!0},$S={tokenize:KS,partial:!0},Bp={name:"wwwAutolink",tokenize:HS,previous:Hp},Up={name:"protocolAutolink",tokenize:VS,previous:Vp},ln={name:"emailAutolink",tokenize:US,previous:Wp},Wt={};function BS(){return{text:Wt}}let Mn=48;for(;Mn<123;)Wt[Mn]=ln,Mn++,Mn===58?Mn=65:Mn===91&&(Mn=97);Wt[43]=ln;Wt[45]=ln;Wt[46]=ln;Wt[95]=ln;Wt[72]=[ln,Up];Wt[104]=[ln,Up];Wt[87]=[ln,Bp];Wt[119]=[ln,Bp];function US(e,t,n){const r=this;let i,l;return s;function s(f){return!Ta(f)||!Wp.call(r,r.previous)||Qu(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Ta(f)?(e.consume(f),o):f===64?(e.consume(f),u):n(f)}function u(f){return f===46?e.check($S,c,d)(f):f===45||f===95||Ve(f)?(l=!0,e.consume(f),u):c(f)}function d(f){return e.consume(f),i=!0,u}function c(f){return l&&i&&Ge(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function HS(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Hp.call(r,r.previous)||Qu(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(FS,e.attempt(Op,e.attempt(Fp,l),n),n)(s))}function l(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function VS(e,t,n){const r=this;let i="",l=!1;return s;function s(f){return(f===72||f===104)&&Vp.call(r,r.previous)&&!Qu(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(Ge(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),u}return n(f)}function u(f){return f===47?(e.consume(f),l?d:(l=!0,u)):n(f)}function d(f){return f===null||rs(f)||pe(f)||Xn(f)||Ns(f)?n(f):e.attempt(Op,e.attempt(Fp,c),n)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function WS(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),l):n(s)}function l(s){return s===null?n(s):t(s)}}function QS(e,t,n){let r,i,l;return s;function s(d){return d===46||d===95?e.check($p,u,o)(d):d===null||pe(d)||Xn(d)||d!==45&&Ns(d)?u(d):(l=!0,e.consume(d),s)}function o(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),s}function u(d){return i||r||!l?n(d):t(d)}}function qS(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?l(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($p,t,l)(s):s===null||pe(s)||Xn(s)?t(s):(e.consume(s),i)}function l(s){return s===41&&r++,e.consume(s),i}}function YS(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),l):o===93?(e.consume(o),i):o===60||o===null||pe(o)||Xn(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||pe(o)||Xn(o)?t(o):r(o)}function l(o){return Ge(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):Ge(o)?(e.consume(o),s):n(o)}}function KS(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return Ve(l)?n(l):t(l)}}function Hp(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||pe(e)}function Vp(e){return!Ge(e)}function Wp(e){return!(e===47||Ta(e))}function Ta(e){return e===43||e===45||e===46||e===95||Ve(e)}function Qu(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 GS={tokenize:i2,partial:!0};function XS(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:t2,continuation:{tokenize:n2},exit:r2}},text:{91:{name:"gfmFootnoteCall",tokenize:e2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ZS,resolveTo:JS}}}}function ZS(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!s||!s._balanced)return n(u);const d=Rt(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!l.includes(d.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function JS(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 l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",s,t],["exit",s,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function e2(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,s;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(f){if(l>999||f===93&&!s||f===null||f===91||pe(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Rt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return pe(f)||(s=!0),l++,e.consume(f),f===92?c:d}function c(f){return f===91||f===92||f===93?(e.consume(f),l++,d):d(f)}}function t2(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,s=0,o;return u;function u(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(p)}function c(p){if(s>999||p===93&&!o||p===null||p===91||pe(p))return n(p);if(p===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return l=Rt(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return pe(p)||(o=!0),s++,e.consume(p),p===92?f:c}function f(p){return p===91||p===92||p===93?(e.consume(p),s++,c):c(p)}function h(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(l)||i.push(l),ce(e,m,"gfmFootnoteDefinitionWhitespace")):n(p)}function m(p){return t(p)}}function n2(e,t,n){return e.check(Ui,t,e.attempt(GS,t,n))}function r2(e){e.exit("gfmFootnoteDefinition")}function i2(e,t,n){const r=this;return ce(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(l):n(l)}}function l2(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,o){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let d=u;for(;d--;)if(s[d][0]==="exit"&&s[d][1].type==="strikethroughSequenceTemporary"&&s[d][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[d][1].end.offset-s[d][1].start.offset){s[u][1].type="strikethroughSequence",s[d][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},s[d][1].start),end:Object.assign({},s[u][1].end)},f={type:"strikethroughText",start:Object.assign({},s[d][1].end),end:Object.assign({},s[u][1].start)},h=[["enter",c,o],["enter",s[d][1],o],["exit",s[d][1],o],["enter",f,o]],m=o.parser.constructs.insideSpan.null;m&&pt(h,h.length,0,Es(m,s.slice(d+1,u),o)),pt(h,h.length,0,[["exit",f,o],["enter",s[u][1],o],["exit",s[u][1],o],["exit",c,o]]),pt(s,d-1,u-d+3,h),u=d+h.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function l(s,o,u){const d=this.previous,c=this.events;let f=0;return h;function h(p){return d===126&&c[c.length-1][1].type!=="characterEscape"?u(p):(s.enter("strikethroughSequenceTemporary"),m(p))}function m(p){const x=Lr(d);if(p===126)return f>1?u(p):(s.consume(p),f++,m);if(f<2&&!n)return u(p);const S=s.exit("strikethroughSequenceTemporary"),y=Lr(p);return S._open=!y||y===2&&!!x,S._close=!x||x===2&&!!y,o(p)}}}class s2{constructor(){this.map=[]}add(t,n,r){o2(this,t,n,r)}consume(t){if(this.map.sort(function(l,s){return l[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 l of i)t.push(l);i=r.pop()}this.map.length=0}}function o2(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 a2(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 l=r.length-1;r[l]=r[l]==="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 u2(){return{flow:{null:{name:"table",tokenize:c2,resolveAll:d2}}}}function c2(e,t,n){const r=this;let i=0,l=0,s;return o;function o(k){let j=r.events.length-1;for(;j>-1;){const H=r.events[j][1].type;if(H==="lineEnding"||H==="linePrefix")j--;else break}const I=j>-1?r.events[j][1].type:null,$=I==="tableHead"||I==="tableRow"?N:u;return $===N&&r.parser.lazy[r.now().line]?n(k):$(k)}function u(k){return e.enter("tableHead"),e.enter("tableRow"),d(k)}function d(k){return k===124||(s=!0,l+=1),c(k)}function c(k){return k===null?n(k):G(k)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),m):n(k):se(k)?ce(e,c,"whitespace")(k):(l+=1,s&&(s=!1,i+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),s=!0,c):(e.enter("data"),f(k)))}function f(k){return k===null||k===124||pe(k)?(e.exit("data"),c(k)):(e.consume(k),k===92?h:f)}function h(k){return k===92||k===124?(e.consume(k),f):f(k)}function m(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(k):(e.enter("tableDelimiterRow"),s=!1,se(k)?ce(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):p(k))}function p(k){return k===45||k===58?S(k):k===124?(s=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),x):z(k)}function x(k){return se(k)?ce(e,S,"whitespace")(k):S(k)}function S(k){return k===58?(l+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),y):k===45?(l+=1,y(k)):k===null||G(k)?C(k):z(k)}function y(k){return k===45?(e.enter("tableDelimiterFiller"),g(k)):z(k)}function g(k){return k===45?(e.consume(k),g):k===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(k))}function v(k){return se(k)?ce(e,C,"whitespace")(k):C(k)}function C(k){return k===124?p(k):k===null||G(k)?!s||i!==l?z(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):z(k)}function z(k){return n(k)}function N(k){return e.enter("tableRow"),P(k)}function P(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),P):k===null||G(k)?(e.exit("tableRow"),t(k)):se(k)?ce(e,P,"whitespace")(k):(e.enter("data"),M(k))}function M(k){return k===null||k===124||pe(k)?(e.exit("data"),P(k)):(e.consume(k),k===92?T:M)}function T(k){return k===92||k===124?(e.consume(k),M):M(k)}}function d2(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],s=[0,0,0,0],o=!1,u=0,d,c,f;const h=new s2;for(;++n<e.length;){const m=e[n],p=m[1];m[0]==="enter"?p.type==="tableHead"?(o=!1,u!==0&&(of(h,t,u,d,c),c=void 0,u=0),d={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",d,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,f=void 0,l=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,c={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",c,t]])),i=p.type==="tableDelimiterRow"?2:c?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(l[1]!==0&&(s[0]=s[1],f=cl(h,t,l,i,void 0,f),l=[0,0,0,0]),s[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(s[0]=s[1],f=cl(h,t,l,i,void 0,f)),l=s,s=[l[1],n,0,0])):p.type==="tableHead"?(o=!0,u=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(u=n,l[1]!==0?(s[0]=s[1],f=cl(h,t,l,i,n,f)):s[1]!==0&&(f=cl(h,t,s,i,n,f)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&of(h,t,u,d,c),h.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=a2(t.events,n))}return e}function cl(e,t,n,r,i,l){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(l.end=Object.assign({},lr(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const u=lr(t.events,n[1]);if(l={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const d=lr(t.events,n[2]),c=lr(t.events,n[3]),f={type:o,start:Object.assign({},d),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],m=t.events[n[3]];if(h[1].end=Object.assign({},m[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,x=n[3]-n[2]-1;e.add(p,x,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(l.end=Object.assign({},lr(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function of(e,t,n,r,i){const l=[],s=lr(t.events,n);i&&(i.end=Object.assign({},s),l.push(["exit",i,t])),r.end=Object.assign({},s),l.push(["exit",r,t]),e.add(n+1,0,l)}function lr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const f2={name:"tasklistCheck",tokenize:m2};function h2(){return{text:{91:f2}}}function m2(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),l)}function l(u){return pe(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return G(u)?t(u):se(u)?e.check({tokenize:p2},t,n)(u):n(u)}}function p2(e,t,n){return ce(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function g2(e){return tp([BS(),XS(),l2(e),u2(),h2()])}const y2={};function x2(e){const t=this,n=e||y2,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(g2(n)),l.push(_S()),s.push(OS(n))}function v2({message:e,pinned:t,onCopy:n,onDelete:r,onTogglePin:i,onRegenerate:l}){const s=(e.role||"assistant").toLowerCase(),o=e.ts?cx(e.ts):"",u=e.content||e.message||"",d=s==="user";return a.jsxs("article",{className:`chat-message ${d?"chat-message-user":"chat-message-assistant"} ${t?"chat-message-pinned":""}`,children:[a.jsxs("header",{className:"chat-message-meta",children:[a.jsx("span",{className:"chat-message-role",children:s}),e.agent&&a.jsxs("span",{className:"chat-message-agent",children:["@",e.agent]}),o&&a.jsx("time",{className:"chat-message-time",children:o}),t&&a.jsx("span",{className:"chat-message-pin",children:"pinned"}),a.jsxs("div",{className:"chat-message-actions",children:[a.jsx("button",{type:"button",className:"chat-msg-action-btn",onClick:n,title:"Copy","aria-label":"Copy",children:a.jsx(Q1,{size:12})}),!d&&a.jsx("button",{type:"button",className:"chat-msg-action-btn",onClick:l,title:"Regenerate","aria-label":"Regenerate",children:a.jsx(Ot,{size:12})}),a.jsx("button",{type:"button",className:"chat-msg-action-btn",onClick:i,title:"Pin","aria-label":"Pin",children:a.jsx(tx,{size:12})}),a.jsx("button",{type:"button",className:"chat-msg-action-btn chat-msg-action-btn-danger",onClick:r,title:"Delete","aria-label":"Delete",children:a.jsx($i,{size:12})})]})]}),a.jsx("div",{className:"chat-message-content markdown-body",children:a.jsx(lb,{remarkPlugins:[x2],children:u})})]})}function k2({messages:e,loading:t,activeProject:n,sessionId:r,pinned:i,onPickSuggestion:l,onCopy:s,onDelete:o,onTogglePin:u,onRegenerate:d}){const c=b.useRef(null);return b.useEffect(()=>{const f=c.current;if(!f)return;f.scrollHeight>f.clientHeight&&f.matches(":scope");let h=f.parentElement,m=!1;for(;h;){if(h.classList.contains("chat-thread-scroll")){m=!0;break}h=h.parentElement}m||(f.scrollTop=f.scrollHeight)},[e]),t?a.jsx("div",{className:"chat-thread legacy",ref:c,children:a.jsx(jx,{count:3})}):n?e.length===0?a.jsx("div",{className:"chat-thread legacy",ref:c,children:a.jsx(dd,{variant:"empty",projectName:n.name,onPickSuggestion:l})}):a.jsx("div",{className:"chat-thread legacy",ref:c,children:e.map((f,h)=>a.jsx(v2,{message:f,pinned:i.has(h),onCopy:()=>s(f),onDelete:()=>o(h),onTogglePin:()=>u(h),onRegenerate:()=>d(String(f.ts??h))},`${h}-${f.ts??""}`))}):a.jsx("div",{className:"chat-thread legacy",ref:c,children:a.jsx(dd,{variant:"no-project",projectName:"",onPickSuggestion:l})})}function w2({agent:e,setAgent:t,agents:n}){const[r,i]=b.useState(!1),l=b.useRef(null);b.useEffect(()=>{if(!r)return;const u=d=>{l.current&&!l.current.contains(d.target)&&i(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[r]);const s=e||"no agent",o=s.startsWith("@")?s.slice(1):s;return a.jsxs("div",{className:"chat-agent-chip",ref:l,children:[a.jsxs("button",{type:"button",className:"chat-agent-chip-btn",onClick:()=>i(u=>!u),"aria-haspopup":"listbox","aria-expanded":r,children:[a.jsx(Or,{size:14}),a.jsx("span",{children:o}),a.jsx(Cs,{size:12,className:r?"rotated":""})]}),r&&a.jsxs("div",{className:"chat-agent-chip-menu",role:"listbox",children:[a.jsx("button",{type:"button",role:"option","aria-selected":!e,onClick:()=>{t(""),i(!1)},children:a.jsx("span",{children:"no agent"})}),n.map(u=>a.jsx("button",{type:"button",role:"option","aria-selected":e===u.name,onClick:()=>{t(u.name),i(!1)},children:a.jsxs("span",{children:["@",u.name]})},u.name))]})]})}function b2(e,t,n=240){b.useLayoutEffect(()=>{const r=e.current;if(!r)return;r.style.height="auto";const i=Math.min(r.scrollHeight,n);r.style.height=`${i}px`,r.style.overflowY=r.scrollHeight>n?"auto":"hidden"},[e,t,n])}function S2({agent:e,setAgent:t,model:n,setModel:r,text:i,setText:l,sending:s,onSend:o,attachments:u,setAttachments:d,suggestions:c,onPickSuggestion:f,agents:h,onAttach:m}){const p=b.useRef(null),x=b.useRef(null);b2(p,i,200);const S=g=>{if(g.key==="Enter"&&(g.metaKey||g.ctrlKey))g.preventDefault(),o();else if(g.key==="Enter"&&!g.shiftKey)g.preventDefault(),o();else if(g.key==="Tab"&&c.length){g.preventDefault();const v=c[0].cmd.split(" ")[0];l(`${v} `)}},y=g=>{const v=g.target.files;if(!v)return;const C=[];for(let z=0;z<v.length;z++)C.push(v[z].name);d(z=>[...z,...C]),g.target.value=""};return a.jsxs("div",{className:"chat-composer",children:[c.length>0&&a.jsx("div",{className:"chat-composer-suggestions",children:c.map(g=>a.jsxs("button",{type:"button",className:"chat-composer-suggestion",onClick:()=>{var C;const v=g.cmd.split(" ")[0];l(`${v} `),(C=p.current)==null||C.focus()},children:[a.jsx("span",{className:"mono",children:g.cmd}),a.jsx("span",{children:g.desc})]},g.cmd))}),u.length>0&&a.jsx("div",{className:"chat-composer-attachments",children:u.map((g,v)=>a.jsxs("span",{className:"chat-composer-attachment-tag",children:[a.jsx(ld,{size:10})," ",g,a.jsx("button",{type:"button",className:"chat-composer-attachment-remove",onClick:()=>d(C=>C.filter((z,N)=>N!==v)),"aria-label":`Remove ${g}`,children:a.jsx(tr,{size:10})})]},v))}),a.jsxs("div",{className:"chat-composer-input",children:[a.jsx(w2,{agent:e,setAgent:t,agents:h}),a.jsx("textarea",{ref:p,className:"chat-composer-textarea",placeholder:s?"Sending…":"Send a message…",rows:1,value:i,onChange:g=>l(g.target.value),onKeyDown:S,disabled:s,"aria-label":"Message"}),a.jsx("input",{ref:x,type:"file",multiple:!0,style:{display:"none"},onChange:y}),a.jsx("button",{type:"button",className:"chat-attach-btn",onClick:m,title:"Attach files","aria-label":"Attach files",children:a.jsx(ld,{size:14})}),a.jsx("button",{type:"button",className:"chat-attach-btn",onClick:async()=>{if(!i.trim())return;const g=await hx(i);g!==i&&l(g)},title:"Enhance prompt with AI","aria-label":"Enhance prompt",children:a.jsx(Jl,{size:14})}),a.jsx("button",{type:"button",className:"chat-send-btn",onClick:o,disabled:s||!i.trim(),title:"Send (Enter)","aria-label":"Send message",children:a.jsx(Rm,{size:16})})]})]})}const C2="modulepreload",j2=function(e){return"/"+e},af={},N2=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=j2(u),u in af)return;af[u]=!0;const d=u.endsWith(".css"),c=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${c}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":C2,d||(f.as="script"),f.crossOrigin="",f.href=u,o&&f.setAttribute("nonce",o),document.head.appendChild(f),d)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&l(o.reason);return t().catch(l)})};function E2(e,t,n){const[r,i]=b.useState([]),[l,s]=b.useState([]),[o,u]=b.useState([]),[d,c]=b.useState(""),[f,h]=b.useState(!0),[m,p]=b.useState(!1),[x,S]=b.useState(new Set),[y,g]=b.useState([]),[v,C]=b.useState(null),[z,N]=b.useState(null),P=b.useRef(null),[M,T]=b.useState({}),[k,j]=b.useState(!0),[I,$]=b.useState(0),H=b.useRef(null),L=b.useRef(null);b.useEffect(()=>{H.current&&(k?H.current.scrollTop=H.current.scrollHeight:$(F=>F+1))},[r,y]);const te=b.useCallback((F,K)=>{T(q=>{const Z=q[F]??{state:"idle",unread:0,pinned:!1};return{...q,[F]:{...Z,...K}}})},[]),J=b.useCallback((F,K)=>{te(F,{state:K?"streaming":"idle"})},[te]),D=b.useCallback(async F=>{var K;try{const q=F?`/chat?session=${encodeURIComponent(F)}`:"/chat?limit=200",Z=await Q.get(q);i(Z.messages||[]),s(Z.sessions||[])}catch(q){(K=L.current)==null||K.error(`Chat load failed: ${q.message}`)}finally{h(!1)}},[]),V=b.useCallback(async F=>{var K;h(!0);try{const q=await Q.get(`/tasks/${encodeURIComponent(F)}/chat`);i(q.messages||[]),c(q.sessionId||F)}catch(q){(K=L.current)==null||K.error(`Task chat load failed: ${q.message}`)}finally{h(!1)}},[]),w=b.useCallback(async()=>{try{const F=await Q.get("/chat/sessions");s(F.sessions||[])}catch{}},[]),ne=b.useCallback(async()=>{try{const K=((await Q.get("/opencode-sessions")).sessions||[]).map(q=>({...q,source:"opencode",opencodeUrl:`/opencode/session/${q.id}`,title:q.title||q.id}));u(K)}catch{}},[]),ae=b.useCallback(async F=>{var kt,A;(kt=P.current)==null||kt.close(),P.current=null;try{const R=await Q.get(`/opencode-sessions/${encodeURIComponent(F)}/messages`);g(R.messages||[])}catch(R){(A=L.current)==null||A.error(`Opencode session load failed: ${R.message}`),g([])}N(F),C("opencode");const K=Q.getToken(),q=K?`/api/opencode-sessions/${encodeURIComponent(F)}/stream?token=${encodeURIComponent(K)}`:`/api/opencode-sessions/${encodeURIComponent(F)}/stream`,Z=new EventSource(q);P.current=Z;const ke=R=>{g(W=>R.id&&W.some(Y=>Y.id===R.id)?W:[...W,R])},_e=R=>{if(!R)return null;try{return JSON.parse(R)}catch{return R}},Pn=["message.user.created","message.user.updated"];for(const R of Pn)Z.addEventListener(R,W=>{var ze;const Y=_e(W.data),ue=((ze=Y==null?void 0:Y.data)==null?void 0:ze.content)??"";ke({id:Y==null?void 0:Y.messageID,role:"user",content:ue,ts:new Date().toISOString()})});const Tt=["message.assistant.created","message.assistant.updated"];for(const R of Tt)Z.addEventListener(R,W=>{var ze;const Y=_e(W.data),ue=((ze=Y==null?void 0:Y.data)==null?void 0:ze.content)??"";ke({id:Y==null?void 0:Y.messageID,role:"assistant",content:ue,ts:new Date().toISOString()}),J(F,!0)});Z.addEventListener("message.part.updated",R=>{var ue,ze;const W=_e(R.data),Y=((ze=(ue=W==null?void 0:W.data)==null?void 0:ue.part)==null?void 0:ze.text)??"";Y&&ke({id:(W==null?void 0:W.id)??(W==null?void 0:W.messageID),role:"assistant",content:Y,ts:new Date().toISOString()})});const et=["session.idle","message.assistant.completed","session.completed"];for(const R of et)Z.addEventListener(R,()=>{J(F,!1)});const tt=["session.awaiting","session.awaiting_input","message.assistant.awaiting"];for(const R of tt)Z.addEventListener(R,()=>{te(F,{state:"awaiting"})});Z.onerror=()=>{try{Z.close()}catch{}P.current=null}},[J,te]),E=b.useCallback(()=>{var F;(F=P.current)==null||F.close(),P.current=null,g([]),N(null),C("bizar")},[]),ye=b.useCallback(F=>{E(),c(F),C("bizar"),D(F),te(F,{unread:0})},[E,D,te]),qe=b.useCallback(async()=>{var F,K;if(!e.activeProject){(F=L.current)==null||F.error("Pick a project in Overview to scope chat sessions.");return}try{const q=await Q.post("/chat/sessions",{});c(q.id),i([]),S(new Set),te(q.id,{state:"idle",unread:0}),await D(q.id),w().catch(()=>{})}catch(q){(K=L.current)==null||K.error(`Create failed: ${q.message}`)}},[e.activeProject,D,w,te]),fe=b.useCallback(async(F,K,q,Z)=>{var ke,_e,Pn;if(v==="opencode"&&z){const Tt=`msg_${Date.now()}_${Math.random().toString(36).slice(2)}`,et={id:Tt,role:"user",content:F,agent:K,ts:new Date().toISOString()};g(tt=>[...tt,et]),p(!0);try{const tt=await Q.post(`/opencode-sessions/${encodeURIComponent(z)}/send`,{message:F,agent:K});J(z,!0)}catch(tt){g(kt=>kt.filter(A=>A.id!==Tt)),(ke=L.current)==null||ke.error(`Send failed: ${tt.message}`)}finally{p(!1)}}else{const Tt={role:"user",content:F,agent:K,ts:new Date().toISOString()};i(et=>[...et,Tt]),p(!0),J(d,!0);try{const et=await Q.post("/chat",{message:F,agent:K,model:q,attachments:Z||[]});if(et!=null&&et.messages)for(const tt of et.messages)tt.role==="assistant"&&i(kt=>kt.some(R=>R.ts===tt.ts)?kt:[...kt,tt]);else(_e=L.current)==null||_e.info("Still processing… the response will appear shortly.")}catch(et){i(tt=>tt.filter(kt=>kt!==Tt)),(Pn=L.current)==null||Pn.error(`Send failed: ${et.message}`)}finally{p(!1),J(d,!1)}}},[v,z,d,J]),Ye=b.useCallback(async F=>{var K,q;if(!d){(K=L.current)==null||K.error("No active session to regenerate.");return}try{await Q.post("/chat/regenerate",{sessionId:d,messageId:F}),await D(d)}catch(Z){(q=L.current)==null||q.error(`Regenerate failed: ${Z.message}`)}},[d,D]),B=b.useCallback(F=>{v==="opencode"?g(K=>K.filter((q,Z)=>Z!==F)):i(K=>K.filter((q,Z)=>Z!==F))},[v]),ie=b.useCallback(F=>{S(K=>{const q=new Set(K);return q.has(F)?q.delete(F):q.add(F),q})},[]),re=b.useCallback(F=>{var q;const K=F.content||F.message||"";(q=navigator.clipboard)==null||q.writeText(K).then(()=>{var Z;return(Z=L.current)==null?void 0:Z.success("Copied.")},()=>{var Z;return(Z=L.current)==null?void 0:Z.error("Copy failed.")})},[]),be=b.useCallback(()=>{const F=H.current;if(!F)return;const q=F.scrollHeight-F.scrollTop-F.clientHeight<32;j(q),q&&$(0)},[]),zn=b.useCallback(()=>{const F=H.current;F&&(F.scrollTop=F.scrollHeight,j(!0),$(0))},[]),In=b.useCallback(async(F,K)=>{var q,Z;try{await Q.post(`/chat/sessions/${encodeURIComponent(F)}/rename`,{title:K}),s(ke=>ke.map(_e=>_e.id===F?{..._e,title:K}:_e)),(q=L.current)==null||q.success("Renamed.")}catch(ke){(Z=L.current)==null||Z.error(`Rename failed: ${ke.message}`)}},[]),Ps=b.useCallback(async F=>{var K,q;try{await Q.del(`/chat/sessions/${encodeURIComponent(F)}`),s(Z=>Z.filter(ke=>ke.id!==F)),T(Z=>{const ke={...Z};return delete ke[F],ke}),d===F&&(c(""),i([])),(K=L.current)==null||K.success("Session deleted.")}catch(Z){(q=L.current)==null||q.error(`Delete failed: ${Z.message}`)}},[d]);return b.useEffect(()=>()=>{var F;(F=P.current)==null||F.close(),P.current=null},[]),b.useEffect(()=>{n?V(n):D(),ne()},[]),b.useEffect(()=>{const F=K=>{var Z;const q=(Z=K.detail)==null?void 0:Z.taskId;q&&V(q)};return window.addEventListener("bizar:setChatTask",F),()=>window.removeEventListener("bizar:setChatTask",F)},[V]),b.useEffect(()=>{let F=!1;return N2(async()=>{const{Ws:K}=await Promise.resolve().then(()=>bx);return{Ws:K}},void 0).then(({Ws:K})=>{if(F)return;new K().on(Z=>{if(Z.type!=="chat:message")return;const ke=Z.message;i(_e=>_e.some(Tt=>Tt.ts===ke.ts)?_e:[..._e,ke])})}),()=>{F=!0}},[]),{messages:v==="opencode"?y:r,bizarMessages:r,opencodeMessages:y,sessions:l,opencodeSessions:o,sessionId:d,setSessionId:c,loading:f,sending:m,pinned:x,listRef:H,activeSource:v,activeOpencodeSessionId:z,sessionStates:M,getSessionDisplay:F=>{var K,q,Z,ke;return{...F,state:((K=M[F.id])==null?void 0:K.state)??"idle",unread:((q=M[F.id])==null?void 0:q.unread)??0,pinned:((Z=M[F.id])==null?void 0:Z.pinned)??!1,tree:(ke=M[F.id])==null?void 0:ke.tree}},stickToBottom:k,newMessageCount:I,handleScroll:be,jumpToLatest:zn,setToast:F=>{L.current=F},loadChat:D,loadTaskChat:V,refreshSessions:w,refreshOpencodeSessions:ne,loadOpencodeSession:ae,closeOpencodeSession:E,selectBizarSession:ye,onCreateSession:qe,onSend:fe,onRegenerate:Ye,deleteMessage:B,togglePin:ie,copyMessage:re,renameSession:In,deleteSession:Ps}}const T2=[{cmd:"/visual-plan [on|off|status]",desc:"Toggle or view visual plan mode"},{cmd:"/plan new <slug> [template]",desc:"Create a new plan"},{cmd:"/plan list",desc:"List all plans"},{cmd:"/plan open <slug>",desc:"Open a plan in the viewer"},{cmd:"/plan status <slug> <status>",desc:"Set plan status"},{cmd:"/plan get <slug>",desc:"Fetch plan canvas"},{cmd:"/plan add <slug> --title T --type kind",desc:"Add element to a plan"},{cmd:"/plan update <slug> <id>",desc:"Update a plan element"},{cmd:"/plan delete <slug> <id>",desc:"Delete a plan element"},{cmd:'/plan comment <slug> [id] "text"',desc:"Add a comment"},{cmd:"/plan comments <slug> [id]",desc:"Read plan comments"},{cmd:"/bizar",desc:"Launch Bizar dashboard"},{cmd:"/bizar <args>",desc:"Route via Bizar menu"},{cmd:"/audit",desc:"Run security audit"},{cmd:"/explain <q>",desc:"Read-only code Q&A"},{cmd:"/init",desc:"Initialize .bizar/ in this project"},{cmd:"/learn",desc:"Extract patterns from session"},{cmd:"/pr-review",desc:"PR review"},{cmd:"/help | /commands",desc:"Show all Bizar commands"}];function z2(e){const[t,n]=b.useState(""),r=b.useMemo(()=>[...T2,...(e.mods||[]).flatMap(l=>{var s;return(s=l.entry)!=null&&s.command?[{cmd:`/${l.id}`,desc:l.description||l.name,mod:l.id}]:[]})],[e.mods]),i=b.useMemo(()=>{if(!t.startsWith("/")||t.includes(" "))return[];const l=t.toLowerCase();return r.filter(s=>s.cmd.toLowerCase().startsWith(l)).slice(0,6)},[t,r]);return{allCommands:r,suggestions:i,setQuery:n}}var I2=Object.defineProperty,os=Object.getOwnPropertySymbols,Qp=Object.prototype.hasOwnProperty,qp=Object.prototype.propertyIsEnumerable,uf=(e,t,n)=>t in e?I2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,za=(e,t)=>{for(var n in t||(t={}))Qp.call(t,n)&&uf(e,n,t[n]);if(os)for(var n of os(t))qp.call(t,n)&&uf(e,n,t[n]);return e},Ia=(e,t)=>{var n={};for(var r in e)Qp.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&os)for(var r of os(e))t.indexOf(r)<0&&qp.call(e,r)&&(n[r]=e[r]);return n};/**
346
+ * @license QR Code generator library (TypeScript)
347
+ * Copyright (c) Project Nayuki.
348
+ * SPDX-License-Identifier: MIT
349
+ */var Zn;(e=>{const t=class le{constructor(u,d,c,f){if(this.version=u,this.errorCorrectionLevel=d,this.modules=[],this.isFunction=[],u<le.MIN_VERSION||u>le.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=u*4+17;let h=[];for(let p=0;p<this.size;p++)h.push(!1);for(let p=0;p<this.size;p++)this.modules.push(h.slice()),this.isFunction.push(h.slice());this.drawFunctionPatterns();const m=this.addEccAndInterleave(c);if(this.drawCodewords(m),f==-1){let p=1e9;for(let x=0;x<8;x++){this.applyMask(x),this.drawFormatBits(x);const S=this.getPenaltyScore();S<p&&(f=x,p=S),this.applyMask(x)}}i(0<=f&&f<=7),this.mask=f,this.applyMask(f),this.drawFormatBits(f),this.isFunction=[]}static encodeText(u,d){const c=e.QrSegment.makeSegments(u);return le.encodeSegments(c,d)}static encodeBinary(u,d){const c=e.QrSegment.makeBytes(u);return le.encodeSegments([c],d)}static encodeSegments(u,d,c=1,f=40,h=-1,m=!0){if(!(le.MIN_VERSION<=c&&c<=f&&f<=le.MAX_VERSION)||h<-1||h>7)throw new RangeError("Invalid value");let p,x;for(p=c;;p++){const v=le.getNumDataCodewords(p,d)*8,C=s.getTotalBits(u,p);if(C<=v){x=C;break}if(p>=f)throw new RangeError("Data too long")}for(const v of[le.Ecc.MEDIUM,le.Ecc.QUARTILE,le.Ecc.HIGH])m&&x<=le.getNumDataCodewords(p,v)*8&&(d=v);let S=[];for(const v of u){n(v.mode.modeBits,4,S),n(v.numChars,v.mode.numCharCountBits(p),S);for(const C of v.getData())S.push(C)}i(S.length==x);const y=le.getNumDataCodewords(p,d)*8;i(S.length<=y),n(0,Math.min(4,y-S.length),S),n(0,(8-S.length%8)%8,S),i(S.length%8==0);for(let v=236;S.length<y;v^=253)n(v,8,S);let g=[];for(;g.length*8<S.length;)g.push(0);return S.forEach((v,C)=>g[C>>>3]|=v<<7-(C&7)),new le(p,d,g,h)}getModule(u,d){return 0<=u&&u<this.size&&0<=d&&d<this.size&&this.modules[d][u]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const u=this.getAlignmentPatternPositions(),d=u.length;for(let c=0;c<d;c++)for(let f=0;f<d;f++)c==0&&f==0||c==0&&f==d-1||c==d-1&&f==0||this.drawAlignmentPattern(u[c],u[f]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(u){const d=this.errorCorrectionLevel.formatBits<<3|u;let c=d;for(let h=0;h<10;h++)c=c<<1^(c>>>9)*1335;const f=(d<<10|c)^21522;i(f>>>15==0);for(let h=0;h<=5;h++)this.setFunctionModule(8,h,r(f,h));this.setFunctionModule(8,7,r(f,6)),this.setFunctionModule(8,8,r(f,7)),this.setFunctionModule(7,8,r(f,8));for(let h=9;h<15;h++)this.setFunctionModule(14-h,8,r(f,h));for(let h=0;h<8;h++)this.setFunctionModule(this.size-1-h,8,r(f,h));for(let h=8;h<15;h++)this.setFunctionModule(8,this.size-15+h,r(f,h));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let u=this.version;for(let c=0;c<12;c++)u=u<<1^(u>>>11)*7973;const d=this.version<<12|u;i(d>>>18==0);for(let c=0;c<18;c++){const f=r(d,c),h=this.size-11+c%3,m=Math.floor(c/3);this.setFunctionModule(h,m,f),this.setFunctionModule(m,h,f)}}drawFinderPattern(u,d){for(let c=-4;c<=4;c++)for(let f=-4;f<=4;f++){const h=Math.max(Math.abs(f),Math.abs(c)),m=u+f,p=d+c;0<=m&&m<this.size&&0<=p&&p<this.size&&this.setFunctionModule(m,p,h!=2&&h!=4)}}drawAlignmentPattern(u,d){for(let c=-2;c<=2;c++)for(let f=-2;f<=2;f++)this.setFunctionModule(u+f,d+c,Math.max(Math.abs(f),Math.abs(c))!=1)}setFunctionModule(u,d,c){this.modules[d][u]=c,this.isFunction[d][u]=!0}addEccAndInterleave(u){const d=this.version,c=this.errorCorrectionLevel;if(u.length!=le.getNumDataCodewords(d,c))throw new RangeError("Invalid argument");const f=le.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][d],h=le.ECC_CODEWORDS_PER_BLOCK[c.ordinal][d],m=Math.floor(le.getNumRawDataModules(d)/8),p=f-m%f,x=Math.floor(m/f);let S=[];const y=le.reedSolomonComputeDivisor(h);for(let v=0,C=0;v<f;v++){let z=u.slice(C,C+x-h+(v<p?0:1));C+=z.length;const N=le.reedSolomonComputeRemainder(z,y);v<p&&z.push(0),S.push(z.concat(N))}let g=[];for(let v=0;v<S[0].length;v++)S.forEach((C,z)=>{(v!=x-h||z>=p)&&g.push(C[v])});return i(g.length==m),g}drawCodewords(u){if(u.length!=Math.floor(le.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let d=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let f=0;f<this.size;f++)for(let h=0;h<2;h++){const m=c-h,x=(c+1&2)==0?this.size-1-f:f;!this.isFunction[x][m]&&d<u.length*8&&(this.modules[x][m]=r(u[d>>>3],7-(d&7)),d++)}}i(d==u.length*8)}applyMask(u){if(u<0||u>7)throw new RangeError("Mask value out of range");for(let d=0;d<this.size;d++)for(let c=0;c<this.size;c++){let f;switch(u){case 0:f=(c+d)%2==0;break;case 1:f=d%2==0;break;case 2:f=c%3==0;break;case 3:f=(c+d)%3==0;break;case 4:f=(Math.floor(c/3)+Math.floor(d/2))%2==0;break;case 5:f=c*d%2+c*d%3==0;break;case 6:f=(c*d%2+c*d%3)%2==0;break;case 7:f=((c+d)%2+c*d%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[d][c]&&f&&(this.modules[d][c]=!this.modules[d][c])}}getPenaltyScore(){let u=0;for(let h=0;h<this.size;h++){let m=!1,p=0,x=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[h][S]==m?(p++,p==5?u+=le.PENALTY_N1:p>5&&u++):(this.finderPenaltyAddHistory(p,x),m||(u+=this.finderPenaltyCountPatterns(x)*le.PENALTY_N3),m=this.modules[h][S],p=1);u+=this.finderPenaltyTerminateAndCount(m,p,x)*le.PENALTY_N3}for(let h=0;h<this.size;h++){let m=!1,p=0,x=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[S][h]==m?(p++,p==5?u+=le.PENALTY_N1:p>5&&u++):(this.finderPenaltyAddHistory(p,x),m||(u+=this.finderPenaltyCountPatterns(x)*le.PENALTY_N3),m=this.modules[S][h],p=1);u+=this.finderPenaltyTerminateAndCount(m,p,x)*le.PENALTY_N3}for(let h=0;h<this.size-1;h++)for(let m=0;m<this.size-1;m++){const p=this.modules[h][m];p==this.modules[h][m+1]&&p==this.modules[h+1][m]&&p==this.modules[h+1][m+1]&&(u+=le.PENALTY_N2)}let d=0;for(const h of this.modules)d=h.reduce((m,p)=>m+(p?1:0),d);const c=this.size*this.size,f=Math.ceil(Math.abs(d*20-c*10)/c)-1;return i(0<=f&&f<=9),u+=f*le.PENALTY_N4,i(0<=u&&u<=2568888),u}getAlignmentPatternPositions(){if(this.version==1)return[];{const u=Math.floor(this.version/7)+2,d=this.version==32?26:Math.ceil((this.version*4+4)/(u*2-2))*2;let c=[6];for(let f=this.size-7;c.length<u;f-=d)c.splice(1,0,f);return c}}static getNumRawDataModules(u){if(u<le.MIN_VERSION||u>le.MAX_VERSION)throw new RangeError("Version number out of range");let d=(16*u+128)*u+64;if(u>=2){const c=Math.floor(u/7)+2;d-=(25*c-10)*c-55,u>=7&&(d-=36)}return i(208<=d&&d<=29648),d}static getNumDataCodewords(u,d){return Math.floor(le.getNumRawDataModules(u)/8)-le.ECC_CODEWORDS_PER_BLOCK[d.ordinal][u]*le.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][u]}static reedSolomonComputeDivisor(u){if(u<1||u>255)throw new RangeError("Degree out of range");let d=[];for(let f=0;f<u-1;f++)d.push(0);d.push(1);let c=1;for(let f=0;f<u;f++){for(let h=0;h<d.length;h++)d[h]=le.reedSolomonMultiply(d[h],c),h+1<d.length&&(d[h]^=d[h+1]);c=le.reedSolomonMultiply(c,2)}return d}static reedSolomonComputeRemainder(u,d){let c=d.map(f=>0);for(const f of u){const h=f^c.shift();c.push(0),d.forEach((m,p)=>c[p]^=le.reedSolomonMultiply(m,h))}return c}static reedSolomonMultiply(u,d){if(u>>>8||d>>>8)throw new RangeError("Byte out of range");let c=0;for(let f=7;f>=0;f--)c=c<<1^(c>>>7)*285,c^=(d>>>f&1)*u;return i(c>>>8==0),c}finderPenaltyCountPatterns(u){const d=u[1];i(d<=this.size*3);const c=d>0&&u[2]==d&&u[3]==d*3&&u[4]==d&&u[5]==d;return(c&&u[0]>=d*4&&u[6]>=d?1:0)+(c&&u[6]>=d*4&&u[0]>=d?1:0)}finderPenaltyTerminateAndCount(u,d,c){return u&&(this.finderPenaltyAddHistory(d,c),d=0),d+=this.size,this.finderPenaltyAddHistory(d,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(u,d){d[0]==0&&(u+=this.size),d.pop(),d.unshift(u)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(o,u,d){if(u<0||u>31||o>>>u)throw new RangeError("Value out of range");for(let c=u-1;c>=0;c--)d.push(o>>>c&1)}function r(o,u){return(o>>>u&1)!=0}function i(o){if(!o)throw new Error("Assertion error")}const l=class Ne{constructor(u,d,c){if(this.mode=u,this.numChars=d,this.bitData=c,d<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(u){let d=[];for(const c of u)n(c,8,d);return new Ne(Ne.Mode.BYTE,u.length,d)}static makeNumeric(u){if(!Ne.isNumeric(u))throw new RangeError("String contains non-numeric characters");let d=[];for(let c=0;c<u.length;){const f=Math.min(u.length-c,3);n(parseInt(u.substring(c,c+f),10),f*3+1,d),c+=f}return new Ne(Ne.Mode.NUMERIC,u.length,d)}static makeAlphanumeric(u){if(!Ne.isAlphanumeric(u))throw new RangeError("String contains unencodable characters in alphanumeric mode");let d=[],c;for(c=0;c+2<=u.length;c+=2){let f=Ne.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c))*45;f+=Ne.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c+1)),n(f,11,d)}return c<u.length&&n(Ne.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c)),6,d),new Ne(Ne.Mode.ALPHANUMERIC,u.length,d)}static makeSegments(u){return u==""?[]:Ne.isNumeric(u)?[Ne.makeNumeric(u)]:Ne.isAlphanumeric(u)?[Ne.makeAlphanumeric(u)]:[Ne.makeBytes(Ne.toUtf8ByteArray(u))]}static makeEci(u){let d=[];if(u<0)throw new RangeError("ECI assignment value out of range");if(u<128)n(u,8,d);else if(u<16384)n(2,2,d),n(u,14,d);else if(u<1e6)n(6,3,d),n(u,21,d);else throw new RangeError("ECI assignment value out of range");return new Ne(Ne.Mode.ECI,0,d)}static isNumeric(u){return Ne.NUMERIC_REGEX.test(u)}static isAlphanumeric(u){return Ne.ALPHANUMERIC_REGEX.test(u)}getData(){return this.bitData.slice()}static getTotalBits(u,d){let c=0;for(const f of u){const h=f.mode.numCharCountBits(d);if(f.numChars>=1<<h)return 1/0;c+=4+h+f.bitData.length}return c}static toUtf8ByteArray(u){u=encodeURI(u);let d=[];for(let c=0;c<u.length;c++)u.charAt(c)!="%"?d.push(u.charCodeAt(c)):(d.push(parseInt(u.substring(c+1,c+3),16)),c+=2);return d}};l.NUMERIC_REGEX=/^[0-9]*$/,l.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,l.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let s=l;e.QrSegment=l})(Zn||(Zn={}));(e=>{(t=>{const n=class{constructor(i,l){this.ordinal=i,this.formatBits=l}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(Zn||(Zn={}));(e=>{(t=>{const n=class{constructor(i,l){this.modeBits=i,this.numBitsCharCount=l}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Zn||(Zn={}));var xr=Zn;/**
350
+ * @license qrcode.react
351
+ * Copyright (c) Paul O'Shannessy
352
+ * SPDX-License-Identifier: ISC
353
+ */var P2={L:xr.QrCode.Ecc.LOW,M:xr.QrCode.Ecc.MEDIUM,Q:xr.QrCode.Ecc.QUARTILE,H:xr.QrCode.Ecc.HIGH},Yp=128,Kp="L",Gp="#FFFFFF",Xp="#000000",Zp=!1,Jp=1,A2=4,M2=0,L2=.1;function eg(e,t=0){const n=[];return e.forEach(function(r,i){let l=null;r.forEach(function(s,o){if(!s&&l!==null){n.push(`M${l+t} ${i+t}h${o-l}v1H${l+t}z`),l=null;return}if(o===r.length-1){if(!s)return;l===null?n.push(`M${o+t},${i+t} h1v1H${o+t}z`):n.push(`M${l+t},${i+t} h${o+1-l}v1H${l+t}z`);return}s&&l===null&&(l=o)})}),n.join("")}function tg(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((i,l)=>l<t.x||l>=t.x+t.w?i:!1))}function R2(e,t,n,r){if(r==null)return null;const i=e.length+n*2,l=Math.floor(t*L2),s=i/t,o=(r.width||l)*s,u=(r.height||l)*s,d=r.x==null?e.length/2-o/2:r.x*s,c=r.y==null?e.length/2-u/2:r.y*s,f=r.opacity==null?1:r.opacity;let h=null;if(r.excavate){let p=Math.floor(d),x=Math.floor(c),S=Math.ceil(o+d-p),y=Math.ceil(u+c-x);h={x:p,y:x,w:S,h:y}}const m=r.crossOrigin;return{x:d,y:c,h:u,w:o,excavation:h,opacity:f,crossOrigin:m}}function D2(e,t){return t!=null?Math.max(Math.floor(t),0):e?A2:M2}function ng({value:e,level:t,minVersion:n,includeMargin:r,marginSize:i,imageSettings:l,size:s,boostLevel:o}){let u=Ae.useMemo(()=>{const p=(Array.isArray(e)?e:[e]).reduce((x,S)=>(x.push(...xr.QrSegment.makeSegments(S)),x),[]);return xr.QrCode.encodeSegments(p,P2[t],n,void 0,void 0,o)},[e,t,n,o]);const{cells:d,margin:c,numCells:f,calculatedImageSettings:h}=Ae.useMemo(()=>{let m=u.getModules();const p=D2(r,i),x=m.length+p*2,S=R2(m,s,p,l);return{cells:m,margin:p,numCells:x,calculatedImageSettings:S}},[u,s,l,r,i]);return{qrcode:u,margin:c,cells:d,numCells:f,calculatedImageSettings:h}}var _2=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),O2=Ae.forwardRef(function(t,n){const r=t,{value:i,size:l=Yp,level:s=Kp,bgColor:o=Gp,fgColor:u=Xp,includeMargin:d=Zp,minVersion:c=Jp,boostLevel:f,marginSize:h,imageSettings:m}=r,x=Ia(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:S}=x,y=Ia(x,["style"]),g=m==null?void 0:m.src,v=Ae.useRef(null),C=Ae.useRef(null),z=Ae.useCallback(H=>{v.current=H,typeof n=="function"?n(H):n&&(n.current=H)},[n]),[N,P]=Ae.useState(!1),{margin:M,cells:T,numCells:k,calculatedImageSettings:j}=ng({value:i,level:s,minVersion:c,boostLevel:f,includeMargin:d,marginSize:h,imageSettings:m,size:l});Ae.useEffect(()=>{if(v.current!=null){const H=v.current,L=H.getContext("2d");if(!L)return;let te=T;const J=C.current,D=j!=null&&J!==null&&J.complete&&J.naturalHeight!==0&&J.naturalWidth!==0;D&&j.excavation!=null&&(te=tg(T,j.excavation));const V=window.devicePixelRatio||1;H.height=H.width=l*V;const w=l/k*V;L.scale(w,w),L.fillStyle=o,L.fillRect(0,0,k,k),L.fillStyle=u,_2?L.fill(new Path2D(eg(te,M))):T.forEach(function(ne,ae){ne.forEach(function(E,ye){E&&L.fillRect(ye+M,ae+M,1,1)})}),j&&(L.globalAlpha=j.opacity),D&&L.drawImage(J,j.x+M,j.y+M,j.w,j.h)}}),Ae.useEffect(()=>{P(!1)},[g]);const I=za({height:l,width:l},S);let $=null;return g!=null&&($=Ae.createElement("img",{src:g,key:g,style:{display:"none"},onLoad:()=>{P(!0)},ref:C,crossOrigin:j==null?void 0:j.crossOrigin})),Ae.createElement(Ae.Fragment,null,Ae.createElement("canvas",za({style:I,height:l,width:l,ref:z,role:"img"},y)),$)});O2.displayName="QRCodeCanvas";var rg=Ae.forwardRef(function(t,n){const r=t,{value:i,size:l=Yp,level:s=Kp,bgColor:o=Gp,fgColor:u=Xp,includeMargin:d=Zp,minVersion:c=Jp,boostLevel:f,title:h,marginSize:m,imageSettings:p}=r,x=Ia(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:S,cells:y,numCells:g,calculatedImageSettings:v}=ng({value:i,level:s,minVersion:c,boostLevel:f,includeMargin:d,marginSize:m,imageSettings:p,size:l});let C=y,z=null;p!=null&&v!=null&&(v.excavation!=null&&(C=tg(y,v.excavation)),z=Ae.createElement("image",{href:p.src,height:v.h,width:v.w,x:v.x+S,y:v.y+S,preserveAspectRatio:"none",opacity:v.opacity,crossOrigin:v.crossOrigin}));const N=eg(C,S);return Ae.createElement("svg",za({height:l,width:l,viewBox:`0 0 ${g} ${g}`,ref:n,role:"img"},x),!!h&&Ae.createElement("title",null,h),Ae.createElement("path",{fill:o,d:`M0,0 h${g}v${g}H0z`,shapeRendering:"crispEdges"}),Ae.createElement("path",{fill:u,d:N,shapeRendering:"crispEdges"}),z)});rg.displayName="QRCodeSVG";function F2({tabs:e,activeTab:t,onChange:n}){return a.jsx("nav",{className:"mobile-bottom-nav",role:"navigation","aria-label":"Mobile navigation",children:e.map(r=>{const i=r.icon;return a.jsxs("button",{type:"button",className:Eu("mobile-nav-btn",t===r.id&&"mobile-nav-btn-active"),onClick:()=>n(r.id),"aria-label":r.label,"aria-current":t===r.id?"page":void 0,children:[a.jsx(i,{size:22}),a.jsx("span",{className:"mobile-nav-label",children:r.label})]},r.id)})})}function _t({open:e,onClose:t,title:n,children:r,actions:i,maxHeight:l="85vh"}){const s=b.useRef(null),o=b.useRef(null),u=b.useId(),d=b.useRef(null),c=b.useRef(null),f=b.useRef(0),h=b.useRef(0),m=()=>{var y;return((y=s.current)==null?void 0:y.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]};if(b.useEffect(()=>{if(!e)return;d.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const y=g=>{var P;if(g.key==="Escape"&&t(),g.key!=="Tab")return;const v=Array.from(m());if(v.length===0){g.preventDefault(),(P=s.current)==null||P.focus();return}const C=v[0],z=v[v.length-1],N=document.activeElement;if(g.shiftKey){(!N||N===C||N===s.current)&&(g.preventDefault(),z==null||z.focus());return}N===z&&(g.preventDefault(),C==null||C.focus())};return window.addEventListener("keydown",y),requestAnimationFrame(()=>{var g,v;((g=o.current)==null?void 0:g.focus())??((v=s.current)==null||v.focus())}),()=>{var g;window.removeEventListener("keydown",y),(g=d.current)==null||g.focus()}},[e,t]),b.useEffect(()=>(e?(h.current=window.scrollY,document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${h.current}px`,document.body.style.left="0",document.body.style.right="0",document.body.style.width="100%"):(document.documentElement.style.overflow="",document.body.style.overflow="",document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",document.body.style.width=""),()=>{document.documentElement.style.overflow="",document.body.style.overflow="",document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",document.body.style.width="",window.scrollTo(0,h.current)}),[e]),!e)return null;const p=y=>{var g;y.isPrimary&&(c.current=y.clientY,f.current=0,(g=s.current)==null||g.setPointerCapture(y.pointerId))},x=y=>{if(c.current==null||!s.current)return;const g=Math.max(0,y.clientY-c.current);f.current=g,s.current.style.transform=`translateY(${g}px)`},S=y=>{if(!s.current)return;y&&s.current.hasPointerCapture(y.pointerId)&&s.current.releasePointerCapture(y.pointerId);const g=f.current;s.current.style.transform="",c.current=null,f.current=0,g>72&&t()};return a.jsx("div",{className:"mobile-sheet-overlay",onClick:t,children:a.jsxs("div",{ref:s,className:"mobile-sheet",style:{maxHeight:l},onClick:y=>y.stopPropagation(),role:"dialog","aria-modal":!0,"aria-label":n?void 0:"Sheet","aria-labelledby":n?u:void 0,tabIndex:-1,children:[a.jsx("div",{className:"mobile-sheet-handle",onPointerDown:p,onPointerMove:x,onPointerUp:S,onPointerCancel:S,"aria-hidden":"true"}),a.jsxs("div",{className:"mobile-sheet-header",children:[n?a.jsx("h3",{id:u,className:"mobile-sheet-title",children:n}):a.jsx("div",{}),a.jsx("button",{ref:o,type:"button",className:"mobile-icon-btn",onClick:t,"aria-label":"Close",children:a.jsx(tr,{size:18})})]}),a.jsx("div",{className:"mobile-sheet-content",children:r}),i&&a.jsx("div",{className:"mobile-sheet-actions",children:i})]})})}function $2(e){switch(e){case"success":return"✓";case"error":return"✗";case"warning":return"⚠";default:return"ℹ"}}function B2(e){const t=new Date(e),r=Date.now()-t.getTime();return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:t.toLocaleDateString()}function U2({onSelect:e}){const[t,n]=b.useState(!1),[r,i]=b.useState([]),[l,s]=b.useState(0),o=async()=>{var c;try{const f=await Q.get("/notifications");i(f.notifications||[]),s(((c=f.stats)==null?void 0:c.unread)||0)}catch{}};b.useEffect(()=>{o()},[]),b.useEffect(()=>{t&&o()},[t]);const u=async()=>{try{await Q.post("/notifications/read-all"),i(c=>c.map(f=>({...f,read:!0}))),s(0)}catch{}},d=async c=>{try{await Q.post(`/notifications/${encodeURIComponent(c)}/read`),i(f=>f.map(h=>h.id===c?{...h,read:!0}:h)),s(f=>Math.max(0,f-1))}catch{}};return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"mobile-icon-btn mobile-notif-btn",onClick:()=>n(!0),"aria-label":`Notifications${l>0?` (${l} unread)`:""}`,children:[a.jsx(rd,{size:20}),l>0&&a.jsx("span",{className:"mobile-notif-badge",children:l>9?"9+":l})]}),a.jsx(_t,{open:t,onClose:()=>n(!1),title:"Notifications",actions:l>0?a.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",style:{width:"100%"},onClick:u,children:[a.jsx(B1,{size:14})," Mark all read"]}):void 0,children:a.jsxs("div",{className:"mobile-notif-list",children:[r.length===0&&a.jsxs("div",{className:"mobile-empty",children:[a.jsx(rd,{size:32}),a.jsx("p",{children:"No notifications"})]}),r.map(c=>a.jsxs("button",{type:"button",className:`mobile-notif-item ${c.read?"read":"unread"}`,onClick:()=>{c.read||d(c.id),e(c),n(!1)},children:[a.jsx("span",{className:`mobile-notif-icon severity-${c.severity}`,children:$2(c.severity)}),a.jsxs("div",{className:"mobile-notif-body",children:[a.jsx("span",{className:"mobile-notif-title",children:c.title||c.message}),c.message&&c.title&&a.jsx("span",{className:"mobile-notif-text",children:c.message}),a.jsx("span",{className:"mobile-notif-time",children:B2(c.ts)})]}),!c.read&&a.jsx("span",{className:"mobile-notif-dot"})]},c.id))]})})]})}const H2={activity:"Activity",chat:"Chat",tasks:"Tasks",settings:"Settings",more:"More",plans:"Plans",agents:"Agents",skills:"Skills",mods:"Mods",schedules:"Schedules",history:"History",config:"Config","plan-detail":"Plan","agent-detail":"Agent","task-detail":"Task"};function V2({activeTab:e,snapshot:t,onSearch:n,onNavigate:r}){const[i,l]=b.useState(!1),s=async o=>{try{await Q.post(`/projects/${encodeURIComponent(o)}/activate`),l(!1),window.location.reload()}catch{}};return a.jsxs("header",{className:"mobile-topbar",children:[a.jsxs("div",{className:"mobile-topbar-left",children:[a.jsx("span",{className:"mobile-logo",children:"ᛒ"}),(t==null?void 0:t.activeProject)&&a.jsxs("button",{type:"button",className:"mobile-project-btn",onClick:()=>l(!0),"aria-label":"Select project",children:[a.jsx("span",{className:"mobile-project-name",children:t.activeProject.name}),a.jsx(Cs,{size:14})]}),a.jsx("span",{className:"mobile-title",children:H2[e]||"Bizar"})]}),a.jsxs("div",{className:"mobile-topbar-right",children:[a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:n,"aria-label":"Search",children:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"11",cy:"11",r:"8"}),a.jsx("path",{d:"m21 21-4.35-4.35"})]})}),a.jsx(U2,{onSelect:o=>{r("notification",o.link||"",o.meta??null)}}),(t==null?void 0:t.activeProject)&&a.jsx(_t,{open:i,onClose:()=>l(!1),title:"Projects",children:a.jsx("div",{className:"mobile-project-list",children:(t.projects||[]).map(o=>{var u,d;return a.jsxs("button",{type:"button",className:`mobile-project-item ${o.id===((u=t.activeProject)==null?void 0:u.id)?"active":""}`,onClick:()=>s(o.id),children:[a.jsx("div",{className:"mobile-project-status","data-status":o.status}),a.jsxs("div",{className:"mobile-project-info",children:[a.jsx("span",{className:"mobile-project-item-name",children:o.name}),a.jsx("span",{className:"mobile-project-item-path",children:o.path})]}),o.id===((d=t.activeProject)==null?void 0:d.id)&&a.jsx("span",{className:"mobile-active-badge",children:"active"})]},o.id)})})})]})]})}const W2=["all","tasks","agents","bg","artifacts","mods"],ko={all:"All",tasks:"Tasks",agents:"Agents",bg:"Background",artifacts:"Plans",mods:"Mods"};function Q2({snapshot:e,onRefresh:t}){var M;const[n,r]=b.useState(((M=e.overview)==null?void 0:M.recentActivity)||[]),[i,l]=b.useState(!0),[s,o]=b.useState("all"),[u,d]=b.useState(!1),[c,f]=b.useState(null),[h,m]=b.useState(""),[p,x]=b.useState(!1);b.useEffect(()=>{var T;(T=e.overview)!=null&&T.recentActivity?(r(e.overview.recentActivity),l(!1)):S()},[e.overview]);const S=async()=>{var T;try{const k=await Q.get("/snapshot");r(((T=k.overview)==null?void 0:T.recentActivity)||[])}catch{}finally{l(!1)}},y=s==="all"?n:n.filter(T=>{var k,j,I,$,H,L;return s==="tasks"?(k=T.kind)==null?void 0:k.startsWith("task"):s==="agents"?(j=T.kind)==null?void 0:j.startsWith("agent"):s==="bg"?((I=T.kind)==null?void 0:I.includes("bg"))||(($=T.kind)==null?void 0:$.includes("schedule")):s==="artifacts"?(H=T.kind)==null?void 0:H.includes("artifacts"):s==="mods"?(L=T.kind)==null?void 0:L.includes("mod"):!0}),g=e.agents||[],v=e.tasks||[],C=v.filter(T=>T.status==="doing"||T.status==="queued"),z=v.filter(T=>T.status==="done"),N=async()=>{if(!(!h.trim()||p)){x(!0);try{await Q.post("/chat",{message:h.trim(),agent:"odin"}),m(""),await t().catch(()=>{}),await S()}catch{}finally{x(!1)}}},P=async()=>{await t().catch(()=>{}),await S()};return a.jsxs("div",{className:"mobile-view",children:[a.jsxs("div",{className:"mobile-submit-hero",children:[a.jsx("textarea",{className:"mobile-submit-input",placeholder:"What needs to be done? Describe a task, bug, or refactor for Odin to artifacts…",value:h,onChange:T=>m(T.target.value),rows:2}),a.jsxs("div",{className:"mobile-submit-actions",children:[a.jsx("div",{className:"mobile-submit-chips",children:["Implement feature","Fix bug","Refactor","Investigate","Write tests"].map(T=>a.jsx("button",{type:"button",className:"mobile-submit-chip",onClick:()=>m(k=>k?`${k} ${T}`:T),children:T},T))}),a.jsxs("button",{type:"button",className:"mobile-btn",disabled:!h.trim()||p,onClick:N,children:[a.jsx(Rm,{size:14})," Submit to Odin"]})]})]}),a.jsxs("div",{className:"mobile-stats",children:[a.jsxs("div",{className:"mobile-stat",children:[a.jsx("div",{className:"mobile-stat-value",children:g.length}),a.jsx("div",{className:"mobile-stat-label",children:"Agents"})]}),a.jsxs("div",{className:"mobile-stat",children:[a.jsx("div",{className:"mobile-stat-value",children:C.length}),a.jsx("div",{className:"mobile-stat-label",children:"Active"})]}),a.jsxs("div",{className:"mobile-stat",children:[a.jsx("div",{className:"mobile-stat-value",children:z.length}),a.jsx("div",{className:"mobile-stat-label",children:"Done"})]}),a.jsxs("div",{className:"mobile-stat",children:[a.jsx("div",{className:"mobile-stat-value",children:e.artifacts.length||0}),a.jsx("div",{className:"mobile-stat-label",children:"Plans"})]})]}),i&&n.length===0&&a.jsx("div",{className:"mobile-loading mobile-loading-inline",children:a.jsx("p",{children:"Loading activity…"})}),a.jsxs("div",{className:"mobile-activity-header",children:[a.jsx("h3",{className:"mobile-section-title",style:{margin:0},children:"Recent Activity"}),a.jsxs("div",{style:{display:"flex",gap:4},children:[a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>d(T=>!T),"aria-label":u?"Resume":"Pause",children:u?a.jsx(Zl,{size:14}):a.jsx(ex,{size:14})}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:P,"aria-label":"Refresh",children:a.jsx(Ot,{size:14})})]})]}),a.jsx("div",{className:"mobile-search-scopes",children:W2.map(T=>a.jsx("button",{type:"button",className:`mobile-scope-chip ${s===T?"active":""}`,onClick:()=>o(T),children:ko[T]},T))}),g.length>0&&a.jsxs("section",{className:"mobile-section",children:[a.jsxs("h3",{className:"mobile-section-title",children:[a.jsx(Or,{size:14})," Agents"]}),a.jsx("div",{className:"mobile-card-list",children:g.slice(0,6).map(T=>a.jsxs("div",{className:"mobile-agent-card",children:[a.jsx("div",{className:"mobile-agent-dot","data-status":T.status||"idle"}),a.jsxs("div",{className:"mobile-agent-info",children:[a.jsx("span",{className:"mobile-agent-name",children:T.name}),a.jsx("span",{className:"mobile-agent-meta",children:T.status||"idle"})]})]},T.name))})]}),!u&&y.length>0&&a.jsx("section",{className:"mobile-section",children:a.jsx("div",{className:"mobile-card-list",children:y.slice(0,30).map((T,k)=>a.jsxs("button",{type:"button",className:"mobile-event-item",onClick:()=>f(T),children:[a.jsx("span",{className:"mobile-event-kind","data-kind":T.kind,children:ko[T.kind]||T.kind}),a.jsx("span",{className:"mobile-event-msg",children:q2(T)}),a.jsx("span",{className:"mobile-event-time",children:jr(T.ts)})]},`${T.ts}-${T.kind}-${k}`))})}),!u&&y.length===0&&n.length>0&&a.jsxs("div",{className:"mobile-empty",children:[a.jsx(ma,{size:40}),a.jsx("p",{children:"No matching activity."}),a.jsx("p",{className:"muted",children:"Try a different filter."})]}),c&&a.jsx(_t,{open:!0,onClose:()=>f(null),title:ko[c.kind]||c.kind,children:a.jsxs("div",{className:"mobile-agent-detail-meta",children:[a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Kind"}),a.jsx("span",{children:c.kind})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Time"}),a.jsx("span",{children:new Date(c.ts).toLocaleString()})]}),Object.entries(c).filter(([T])=>!["ts","kind"].includes(T)).map(([T,k])=>a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:T}),a.jsx("span",{style:{fontSize:12,maxWidth:200,wordBreak:"break-all"},children:typeof k=="object"?JSON.stringify(k):String(k)})]},T))]})}),g.length===0&&C.length===0&&a.jsxs("div",{className:"mobile-empty",children:[a.jsx(ma,{size:40}),a.jsx("p",{children:"No activity yet."}),a.jsx("p",{className:"muted",children:"Start a task or chat to see things here."})]})]})}function q2(e){const t=e.kind||"";return t.includes("task")?`Task: ${e.title||e.id||"updated"}`:t.includes("agent")?`Agent: ${e.name||"status changed"}`:t.includes("artifacts")?`Plan: ${e.slug||"changed"}`:t.includes("mod")?`Mod: ${e.name||"changed"}`:t.includes("schedule")?`Schedule: ${e.name||"triggered"}`:JSON.stringify(e).slice(0,80)}function Tn({open:e,onClose:t,title:n,children:r,actions:i}){const l=b.useRef(null),s=b.useRef(null),o=b.useRef(null),u=b.useId(),d=b.useRef(0);return b.useEffect(()=>{if(!e)return;o.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const c='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',f=h=>{var y,g;if(h.key==="Escape"&&t(),h.key!=="Tab")return;const m=Array.from(((y=l.current)==null?void 0:y.querySelectorAll(c))??[]);if(m.length===0){h.preventDefault(),(g=l.current)==null||g.focus();return}const p=m[0],x=m[m.length-1],S=document.activeElement;if(h.shiftKey){(!S||S===p||S===l.current)&&(h.preventDefault(),x==null||x.focus());return}S===x&&(h.preventDefault(),p==null||p.focus())};return window.addEventListener("keydown",f),d.current=window.scrollY,document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${d.current}px`,document.body.style.left="0",document.body.style.right="0",document.body.style.width="100%",requestAnimationFrame(()=>{var h,m;((h=s.current)==null?void 0:h.focus())??((m=l.current)==null||m.focus())}),()=>{var h;window.removeEventListener("keydown",f),document.documentElement.style.overflow="",document.body.style.overflow="",document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",document.body.style.width="",window.scrollTo(0,d.current),(h=o.current)==null||h.focus()}},[e,t]),e?a.jsx("div",{className:"mobile-modal-overlay",onClick:c=>{c.target===c.currentTarget&&t()},children:a.jsxs("div",{ref:l,className:"mobile-modal",onClick:c=>c.stopPropagation(),role:"dialog","aria-modal":!0,"aria-label":n?void 0:"Modal","aria-labelledby":n?u:void 0,tabIndex:-1,children:[a.jsxs("div",{className:"mobile-modal-header",children:[n?a.jsx("h2",{id:u,className:"mobile-modal-title",children:n}):a.jsx("div",{}),a.jsx("button",{ref:s,type:"button",className:"mobile-icon-btn",onClick:t,"aria-label":"Close",children:a.jsx(tr,{size:20})})]}),a.jsx("div",{className:"mobile-modal-content",children:r}),i&&a.jsx("div",{className:"mobile-modal-actions",children:i})]})}):null}const ig=["reasoning","code","design","planning","gitops","analysis"],cf={reasoning:"var(--accent)",code:"var(--info)",design:"var(--success)",planning:"var(--warning)",gitops:"var(--error)",analysis:"var(--text-dim)"};function df({snapshot:e,onBack:t,onOpenAgent:n,selectedAgent:r,onRefresh:i}){const[l,s]=b.useState(e.agents||[]),[o,u]=b.useState(!e.agents),[d,c]=b.useState(""),[f,h]=b.useState(""),[m,p]=b.useState(null),[x,S]=b.useState(!1),[y,g]=b.useState(""),[v,C]=b.useState(!1);b.useEffect(()=>{if(r){const j=l.find(I=>I.name===r);j&&p(j)}},[r,l]);const z=async()=>{try{const j=await Q.get("/agents");s(j.agents||[])}catch{}finally{u(!1)}},N=l.filter(j=>{if(d&&j.category!==d)return!1;if(f){const I=f.toLowerCase();if(!j.name.toLowerCase().includes(I)&&!(j.description||"").toLowerCase().includes(I))return!1}return!0}),P=async(j,I)=>{try{await Q.post(`/agents/${encodeURIComponent(j)}/invoke`,{prompt:I}),C(!1),g("")}catch{}},M=async j=>{try{await Q.post(`/agents/${encodeURIComponent(j)}/restart`),await z()}catch{}},T=async j=>{if(confirm(`Delete agent "${j}"?`))try{await Q.del(`/agents/${encodeURIComponent(j)}`),s(I=>I.filter($=>$.name!==j)),p(null),i==null||i()}catch{}},k=async j=>{try{const I=await Q.post("/agents",j);s($=>[...$,I]),S(!1),i==null||i()}catch{}};return a.jsxs("div",{className:"mobile-view",children:[a.jsxs("div",{className:"mobile-tasks-toolbar",children:[a.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search agents…",value:f,onChange:j=>h(j.target.value),style:{flex:1}}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>z(),"aria-label":"Refresh",children:a.jsx(Ot,{size:16})}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>S(!0),"aria-label":"New agent",children:a.jsx(yt,{size:16})})]}),a.jsxs("div",{className:"mobile-search-scopes",children:[a.jsx("button",{type:"button",className:`mobile-scope-chip ${d?"":"active"}`,onClick:()=>c(""),children:"All"}),ig.map(j=>a.jsx("button",{type:"button",className:`mobile-scope-chip ${d===j?"active":""}`,onClick:()=>c(j),children:j},j))]}),o?a.jsx("div",{className:"mobile-loading",children:a.jsx("p",{children:"Loading…"})}):N.length===0?a.jsxs("div",{className:"mobile-empty",children:[a.jsx(Or,{size:40}),a.jsx("p",{children:"No agents found."})]}):a.jsx("div",{className:"mobile-card-list",children:N.map(j=>a.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>{p(j),n(j.name)},children:[a.jsx("div",{className:"mobile-agent-dot","data-status":j.status||"idle"}),a.jsxs("div",{className:"mobile-list-content",children:[a.jsx("span",{className:"mobile-list-title",children:j.name}),a.jsx("span",{className:"mobile-list-meta",children:j.model||j.mode||"—"})]}),j.category&&a.jsx("span",{className:"mobile-list-badge",style:{color:cf[j.category]||"var(--text-dim)"},children:j.category}),a.jsx("span",{className:"mobile-list-badge","data-status":j.status||"idle",children:j.status||"idle"})]},j.name))}),m&&a.jsx(_t,{open:!0,onClose:()=>p(null),title:m.name,actions:a.jsxs("div",{className:"mobile-task-detail-actions",children:[a.jsxs("button",{type:"button",className:"mobile-btn",onClick:()=>{g(""),C(!0)},children:[a.jsx(Zl,{size:14})," Invoke"]}),(m.isStuck||m.status==="error"||m.status==="working")&&a.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",onClick:()=>M(m.name),children:[a.jsx(ix,{size:14})," Restart"]}),a.jsx("button",{type:"button",className:"mobile-btn mobile-btn-danger",onClick:()=>T(m.name),children:a.jsx($i,{size:14})})]}),children:a.jsxs("div",{className:"mobile-agent-detail",children:[a.jsxs("div",{className:"mobile-agent-detail-status",children:[a.jsx("span",{className:"mobile-agent-dot","data-status":m.status||"idle"}),a.jsx("span",{className:"mobile-agent-detail-status-text",children:m.status||"idle"}),m.category&&a.jsx("span",{className:"mobile-list-badge",style:{color:cf[m.category]},children:m.category})]}),a.jsx("p",{className:"mobile-agent-detail-desc",children:m.description||"No description."}),a.jsxs("div",{className:"mobile-agent-detail-meta",children:[a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Model"}),a.jsx("span",{className:"mono",children:m.model||"—"})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Mode"}),a.jsx("span",{children:m.mode||"subagent"})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Path"}),a.jsx("span",{className:"mono",style:{fontSize:11},children:m.path})]}),m.lastError&&a.jsxs("div",{className:"mobile-task-detail-row",style:{color:"var(--error)"},children:[a.jsx("span",{children:"Last error"}),a.jsx("span",{children:m.lastError.message})]}),m.tasksTotal!=null&&m.tasksTotal>0&&a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Success rate"}),a.jsxs("span",{children:[Math.round((m.successRate||0)*100),"%"]})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Last modified"}),a.jsx("span",{children:jr(m.mtime)})]})]})]})}),a.jsxs(Tn,{open:v,onClose:()=>C(!1),title:`Invoke ${m==null?void 0:m.name}`,actions:a.jsxs("button",{type:"button",className:"mobile-btn",style:{width:"100%"},disabled:!y.trim(),onClick:()=>{m&&P(m.name,y.trim())},children:[a.jsx(Zl,{size:14})," Invoke"]}),children:[a.jsxs("p",{className:"muted",style:{marginBottom:12},children:["Model: ",a.jsx("span",{className:"mono",children:(m==null?void 0:m.model)||"—"})]}),a.jsx("textarea",{className:"mobile-input",rows:5,placeholder:"What should this agent do?",value:y,onChange:j=>g(j.target.value),autoFocus:!0})]}),a.jsx(Y2,{open:x,onClose:()=>S(!1),onCreate:k})]})}function Y2({open:e,onClose:t,onCreate:n}){const[r,i]=b.useState(""),[l,s]=b.useState(""),[o,u]=b.useState(""),[d,c]=b.useState("subagent"),[f,h]=b.useState("#8b5cf6"),[m,p]=b.useState(""),[x,S]=b.useState(""),[y,g]=b.useState(""),v=C=>{C.preventDefault(),r.trim()&&(n({name:r.trim(),description:l.trim(),model:o,mode:d,color:f,tools:[],tags:x.split(",").map(z=>z.trim()).filter(Boolean),category:m,prompt:y}),i(""),s(""),u(""),c("subagent"),h("#8b5cf6"),p(""),S(""),g(""))};return a.jsx(Tn,{open:e,onClose:t,title:"New Agent",actions:a.jsxs("button",{type:"submit",form:"new-agent-form",className:"mobile-btn",style:{width:"100%"},children:[a.jsx(yt,{size:14})," Create"]}),children:a.jsxs("form",{id:"new-agent-form",onSubmit:v,className:"mobile-task-form",children:[a.jsx("label",{className:"mobile-field-label",children:"Name *"}),a.jsx("input",{className:"mobile-input",type:"text",placeholder:"my-agent",pattern:"[a-z0-9][a-z0-9-]{0,63}",value:r,onChange:C=>i(C.target.value),autoFocus:!0,required:!0}),a.jsx("label",{className:"mobile-field-label",children:"Description"}),a.jsx("input",{className:"mobile-input",type:"text",placeholder:"What does this agent do?",value:l,onChange:C=>s(C.target.value)}),a.jsx("label",{className:"mobile-field-label",children:"Model"}),a.jsx("input",{className:"mobile-input",type:"text",placeholder:"(provider default)",value:o,onChange:C=>u(C.target.value)}),a.jsx("label",{className:"mobile-field-label",children:"Category"}),a.jsxs("select",{className:"mobile-input",value:m,onChange:C=>p(C.target.value),children:[a.jsx("option",{value:"",children:"None"}),ig.map(C=>a.jsx("option",{value:C,children:C},C))]}),a.jsx("label",{className:"mobile-field-label",children:"Tags (comma-separated)"}),a.jsx("input",{className:"mobile-input",type:"text",placeholder:"tag1, tag2",value:x,onChange:C=>S(C.target.value)})]})})}function K2({sessions:e,opencodeSessions:t,activeSessionId:n,activeOpencodeSessionId:r,activeProject:i,creating:l,onCreateSession:s,onSelectSession:o,onSelectOpencodeSession:u}){const[d,c]=b.useState("all"),[f,h]=b.useState(!1),m=30,p=d==="all"?[...e,...t].sort((g,v)=>Number(v.mtime)-Number(g.mtime)):e,x=f?p:p.slice(0,m),S=t.length,y=g=>{if(g.source==="opencode"){u(g);return}o(g.id)};return a.jsxs("div",{className:"chat-sessions",children:[a.jsxs("div",{className:"chat-sessions-header",children:[a.jsx("span",{className:"chat-sessions-header-title",children:"Sessions"}),a.jsx("span",{className:"chat-sessions-count",children:x.length})]}),S>0&&a.jsxs("div",{className:"chat-sessions-toggle",children:[a.jsx("button",{type:"button",className:`chat-sessions-toggle-btn ${d==="bizar"?"active":""}`,onClick:()=>c("bizar"),children:"Bizar"}),a.jsxs("button",{type:"button",className:`chat-sessions-toggle-btn ${d==="all"?"active":""}`,onClick:()=>c("all"),children:["All (",S," opencode)"]})]}),a.jsxs("button",{type:"button",className:"chat-sessions-new",onClick:s,disabled:l||!i,title:i?"Create new session":"Pick a project first","aria-label":"Create new session",children:[l?a.jsx($m,{size:"sm"}):a.jsx(yt,{size:14}),a.jsx("span",{children:l?"Creating…":"New session"})]}),e.length===0?a.jsx("div",{className:"chat-sessions-empty",children:a.jsx(Cx,{icon:a.jsx(Jl,{size:20}),title:i?"No sessions yet":"No project",message:i?"Create your first session to start chatting.":"Pick a project in Overview to scope chat sessions.",action:i?a.jsxs(ts,{variant:"primary",size:"sm",onClick:s,loading:l,children:[a.jsx(yt,{size:12})," New session"]}):a.jsxs(ts,{variant:"secondary",size:"sm",onClick:()=>{window.location.hash="#overview"},children:[a.jsx(Nu,{size:12})," Open Overview"]})})}):a.jsx("ul",{className:"chat-sessions-list",children:x.map(g=>{const v=g.source==="opencode",C=v?r===g.id:n===g.id;return a.jsxs("li",{className:`chat-sessions-item ${C?"active":""} ${v?"chat-sessions-item-opencode":""}`,onClick:()=>y(g),title:v?`Open in dashboard: ${g.title||g.id}`:g.id,children:[v&&a.jsx(q1,{size:10,className:"chat-sessions-item-icon"}),a.jsx("span",{className:"chat-sessions-item-id",children:g.title||g.id}),a.jsx("span",{className:"chat-sessions-item-meta",children:new Date(Number(g.mtime)).toLocaleDateString()})]},v?`oc-${g.id}`:g.id)})}),p.length>m&&a.jsx("button",{type:"button",className:"chat-sessions-show-more",onClick:()=>h(g=>!g),children:f?`Show less (${p.length-m} hidden)`:`Show all ${p.length} sessions`})]})}function G2(e){return a.jsx("div",{className:"chat-composer-wrap",children:a.jsx("div",{className:"chat-composer-pill",children:a.jsx(S2,{...e})})})}function X2({sessionId:e,messages:t,pinned:n,agent:r,model:i,agents:l,mcps:s,allCommands:o}){const[u,d]=b.useState(!1),[c,f]=b.useState(!1),h=u?l:l.slice(0,4),m=c?o:o.slice(0,4);return a.jsxs("div",{className:"chat-info",children:[a.jsxs("div",{className:"chat-info-card",children:[a.jsxs("div",{className:"chat-info-card-title",children:[a.jsx(Bn,{size:14})," Session"]}),a.jsxs("dl",{className:"env-table",children:[a.jsx("dt",{children:"id"}),a.jsx("dd",{className:"mono",children:e||"Live"}),a.jsx("dt",{children:"Messages"}),a.jsx("dd",{className:"mono",children:t.length}),a.jsx("dt",{children:"Pinned"}),a.jsx("dd",{className:"mono",children:n.size}),a.jsx("dt",{children:"Agent"}),a.jsx("dd",{className:"mono",children:r||"—"}),a.jsx("dt",{children:"Model"}),a.jsx("dd",{className:"mono ellipsis",title:i,children:i||"—"})]})]}),a.jsxs("div",{className:"chat-info-card",children:[a.jsxs("div",{className:"chat-info-card-title",children:[a.jsx(Or,{size:14})," Agents",a.jsx("span",{className:"chat-info-card-count",children:l.length})]}),a.jsx("ul",{className:"mod-mini-list",children:h.map(p=>a.jsxs("li",{className:"mod-mini",children:[a.jsxs("span",{className:"mod-mini-name",children:["@",p.name]}),a.jsx("span",{className:"mod-mini-meta",children:p.model||p.mode||""})]},p.name))}),l.length>4&&a.jsx("button",{type:"button",className:"chat-info-card-toggle",onClick:()=>d(p=>!p),children:u?"− Show fewer":`+ ${l.length-4} more`})]}),a.jsxs("div",{className:"chat-info-card",children:[a.jsxs("div",{className:"chat-info-card-title",children:[a.jsx(lx,{size:14})," MCPs",a.jsx("span",{className:"chat-info-card-count",children:s.length})]}),a.jsxs("ul",{className:"mod-mini-list",children:[s.length===0?a.jsx("li",{className:"muted",children:"No MCPs configured."}):null,s.map(p=>a.jsxs("li",{className:"mod-mini",children:[a.jsx("span",{className:"mod-mini-name",children:p.id}),a.jsx("span",{className:`mod-mini-pill ${p.enabled?"on":"off"}`,children:p.enabled?"on":"off"})]},p.id))]})]}),a.jsxs("div",{className:"chat-info-card",children:[a.jsxs("button",{type:"button",className:"chat-info-card-title chat-info-card-title-button",onClick:()=>f(p=>!p),"aria-expanded":c,children:[a.jsx(ax,{size:14})," Slash commands",a.jsx("span",{className:"chat-info-card-count",children:o.length}),a.jsx(Cs,{size:12,className:`chat-info-card-chevron ${c?"open":""}`})]}),c&&a.jsx("ul",{className:"mod-mini-list",children:m.map(p=>a.jsxs("li",{children:[a.jsx("code",{children:p.cmd}),a.jsx("span",{className:"muted",children:p.desc})]},p.cmd))})]})]})}function Z2({snapshot:e,settings:t,setActiveTab:n,initialTaskId:r,onClearTaskId:i}){const l=yx(),s=px(),o=E2(e,t,r??""),[u,d]=b.useState(""),[c,f]=b.useState(t.defaultAgent||"odin"),[h,m]=b.useState(t.defaultModel||""),[p,x]=b.useState([]),[S,y]=b.useState(!1),[g,v]=b.useState(!1),[C,z]=b.useState(!1),N=b.useRef(null),{allCommands:P,suggestions:M,setQuery:T}=z2(e);b.useEffect(()=>{T(u)},[u,T]);const k=()=>{var L;return(L=N.current)==null?void 0:L.click()},j=L=>{const te=L.target.files;if(!te)return;const J=[];for(let D=0;D<te.length;D++)J.push(te[D].name);x(D=>{const V=J.filter(w=>!D.includes(w));return[...D,...V]}),N.current&&(N.current.value="")},I=()=>{const L=u.trim();L&&(d(""),T(""),o.onSend(L,c,h,p))},$=async()=>{if(!S){if(!e.activeProject){l.warning("Pick a project in Overview to scope chat sessions.",4e3);return}y(!0);try{const L=await fetch("/chat/sessions",{method:"POST"}).then(te=>te.json());o.loadChat(L.id),l.success(`Session ${L.id} created.`)}catch(L){l.error(`Create failed: ${L.message}`)}finally{y(!1)}}},H=L=>{s.open({title:"Delete message?",children:a.jsx("p",{style:{margin:0},children:"This action cannot be undone."}),footer:a.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[a.jsx(ts,{variant:"secondary",size:"sm",onClick:()=>s.close(),children:"Cancel"}),a.jsx(ts,{variant:"danger",size:"sm",onClick:()=>{s.close(),o.deleteMessage(L)},children:"Delete"})]})})};return a.jsxs("div",{className:"chat-shell",children:[a.jsx(Sx,{activeProject:e.activeProject,sessionCount:o.sessions.length,sessionsOpen:g,infoOpen:C,onToggleSessions:()=>v(L=>!L),onToggleInfo:()=>z(L=>!L),onOpenOverview:()=>n==null?void 0:n("overview")}),a.jsxs("div",{className:"chat-body",children:[a.jsx("aside",{className:`chat-sessions ${g?"":"chat-sessions-hidden"}`,children:a.jsx(K2,{sessions:o.sessions,opencodeSessions:o.opencodeSessions,activeSessionId:o.sessionId,activeOpencodeSessionId:o.activeOpencodeSessionId,activeProject:e.activeProject,onCreateSession:$,onSelectSession:o.selectBizarSession,onSelectOpencodeSession:L=>o.loadOpencodeSession(L.id),creating:S})}),a.jsxs("main",{className:"chat-main",children:[a.jsx(k2,{messages:o.activeSource==="opencode"?o.opencodeMessages:o.bizarMessages,loading:o.loading,activeProject:e.activeProject,sessionId:o.activeSource==="opencode"?o.activeOpencodeSessionId??o.sessionId:o.sessionId,pinned:o.pinned,onPickSuggestion:L=>d(L),onCopy:L=>o.copyMessage(L),onDelete:H,onTogglePin:o.togglePin,onRegenerate:o.onRegenerate}),a.jsx(G2,{agent:c,setAgent:f,model:h,setModel:m,text:u,setText:d,sending:o.sending,onSend:I,attachments:p,setAttachments:x,suggestions:M,onPickSuggestion:L=>d(`${L.split(" ")[0]} `),agents:e.agents||[],onAttach:k,sessionsOpen:g,infoOpen:C}),a.jsx("input",{ref:N,type:"file",multiple:!0,style:{display:"none"},onChange:j})]}),a.jsx("aside",{className:`chat-info ${C?"":"chat-info-hidden"}`,children:a.jsx(X2,{sessionId:o.activeSource==="opencode"?o.activeOpencodeSessionId??o.sessionId:o.sessionId,messages:o.activeSource==="opencode"?o.opencodeMessages:o.bizarMessages,pinned:o.pinned,agent:c,model:h,agents:e.agents||[],mcps:e.mcps||[],allCommands:P})})]})]})}function J2({onBack:e}){const[t,n]=b.useState([]),[r,i]=b.useState(!0),[l,s]=b.useState({}),[o,u]=b.useState(!1),d=async()=>{try{const x=await Q.get("/config"),S=Object.entries(x).map(([y,g])=>({key:y,value:g,type:c(g)}));n(S),s(Object.fromEntries(Object.entries(x).map(([y,g])=>[y,g])))}catch{}finally{i(!1)}};b.useEffect(()=>{d()},[]);const c=x=>typeof x=="boolean"?"boolean":typeof x=="number"?"number":typeof x=="string"?"string":Array.isArray(x)?"array":x&&typeof x=="object"?"object":"unknown",f=(x,S)=>{s(y=>({...y,[x]:S}))},h=async()=>{u(!0);try{await Q.patch("/config",l),await d()}catch{}finally{u(!1)}},m=(x,S)=>{s(y=>({...y,[x]:S}))},p=x=>{const S=l[x.key];switch(x.type){case"boolean":return a.jsxs("label",{className:"mobile-toggle",children:[a.jsx("input",{type:"checkbox",checked:!!S,onChange:y=>f(x.key,y.target.checked)}),a.jsx("span",{className:"mobile-toggle-slider"})]});case"number":return a.jsx("input",{className:"mobile-input mobile-input-sm",type:"number",inputMode:"numeric",value:String(S??""),onChange:y=>f(x.key,Number(y.target.value))});case"string":return a.jsx("input",{className:"mobile-input mobile-input-sm",type:"text",value:String(S??""),onChange:y=>f(x.key,y.target.value)});case"object":case"array":return a.jsx("textarea",{className:"mobile-input mobile-input-sm",rows:2,value:JSON.stringify(S??null,null,2),onChange:y=>{try{f(x.key,JSON.parse(y.target.value))}catch{}}});default:return a.jsx("span",{className:"mobile-setting-value mono",children:String(S??"null")})}};return a.jsxs("div",{className:"mobile-view",children:[a.jsxs("div",{className:"mobile-tasks-toolbar",children:[a.jsxs("span",{style:{fontSize:14,color:"var(--text-muted)",flex:1},children:[t.length," config entries"]}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>d(),"aria-label":"Refresh",children:a.jsx(Ot,{size:16})}),a.jsxs("button",{type:"button",className:"mobile-btn",disabled:o,onClick:()=>h(),children:[a.jsx(Lm,{size:14})," ",o?"Saving…":"Save all"]})]}),r?a.jsx("div",{className:"mobile-loading",children:a.jsx("p",{children:"Loading…"})}):t.length===0?a.jsxs("div",{className:"mobile-empty",children:[a.jsx(Mr,{size:40}),a.jsx("p",{children:"No config entries."})]}):a.jsx("div",{className:"mobile-config-list",children:t.map(x=>a.jsxs("div",{className:"mobile-config-row",children:[a.jsxs("div",{className:"mobile-config-key",children:[a.jsx("span",{className:"mono",children:x.key}),a.jsx("span",{className:"mobile-config-type",children:x.type})]}),a.jsx("div",{className:"mobile-config-value",children:p(x)}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>m(x.key,x.defaultValue),"aria-label":"Reset to default",title:"Reset",children:a.jsx(rx,{size:14})})]},x.key))})]})}function eC({onBack:e}){const[t,n]=b.useState([]),[r,i]=b.useState(!0),[l,s]=b.useState(null),[o,u]=b.useState(""),d=async()=>{try{const m=await Q.get("/history");if(Array.isArray(m.history)){n(m.history);return}if(Array.isArray(m.projects)){const p=new Map;for(const x of m.events||[]){const S=x.projectId;if(!S)continue;const y=p.get(S);(!y||new Date(x.ts).getTime()>new Date(y.ts).getTime())&&p.set(S,x)}n(m.projects.map(x=>{const S=p.get(x.id);return{id:x.id,ts:x.lastAccessed||(S==null?void 0:S.ts)||new Date(0).toISOString(),agent:x.name,taskCount:x.tasks.total,summary:`${x.path} · ${x.tasks.done}/${x.tasks.total} done · ${x.plans} plan${x.plans===1?"":"s"}`,output:S?`${S.kind}${S.text?` — ${S.text}`:""}`:"No recent events."}}));return}n([])}catch{}finally{i(!1)}};b.useEffect(()=>{d()},[]);const c=m=>{if(!m)return"—";const p=Math.floor(m/1e3);if(p<60)return`${p}s`;const x=Math.floor(p/60),S=p%60;return`${x}m ${S}s`},f=m=>new Date(m).toLocaleString(),h=o.trim()?t.filter(m=>{const p=o.toLowerCase();return(m.agent||"session").toLowerCase().includes(p)||(m.summary||"").toLowerCase().includes(p)||(m.output||"").toLowerCase().includes(p)}):t;return a.jsxs("div",{className:"mobile-view",children:[a.jsxs("div",{className:"mobile-tasks-toolbar",children:[a.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search history…",value:o,onChange:m=>u(m.target.value),style:{flex:1}}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>d(),"aria-label":"Refresh",children:a.jsx(Ot,{size:16})})]}),r?a.jsx("div",{className:"mobile-loading",children:a.jsx("p",{children:"Loading…"})}):h.length===0?a.jsxs("div",{className:"mobile-empty",children:[a.jsx(ga,{size:40}),a.jsx("p",{children:t.length===0?"No history yet.":"No matching sessions."})]}):a.jsx("div",{className:"mobile-card-list",children:h.map(m=>a.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>s(m),children:[a.jsx("div",{className:"mobile-list-icon",children:a.jsx(ga,{size:16})}),a.jsxs("div",{className:"mobile-list-content",children:[a.jsx("span",{className:"mobile-list-title",children:m.agent||"Session"}),a.jsxs("span",{className:"mobile-list-meta",children:[f(m.ts),m.duration?` · ${c(m.duration)}`:"",m.taskCount?` · ${m.taskCount} tasks`:""]})]})]},m.id))}),l&&a.jsxs(_t,{open:!0,onClose:()=>s(null),title:"Session Detail",children:[a.jsxs("div",{className:"mobile-agent-detail-meta",children:[a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Agent"}),a.jsx("span",{children:l.agent||"—"})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Started"}),a.jsx("span",{children:f(l.ts)})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Duration"}),a.jsx("span",{children:c(l.duration)})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Tasks"}),a.jsx("span",{children:l.taskCount||0})]})]}),l.summary&&a.jsxs("div",{style:{marginTop:12},children:[a.jsx("h4",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:4},children:"Summary"}),a.jsx("p",{style:{fontSize:13},children:l.summary})]}),l.output&&a.jsxs("div",{style:{marginTop:12},children:[a.jsx("h4",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:4},children:"Output"}),a.jsxs("pre",{className:"mono",style:{fontSize:11,whiteSpace:"pre-wrap",wordBreak:"break-all",background:"var(--bg-elev-2)",padding:8,borderRadius:6},children:[l.output.slice(0,1e3),l.output.length>1e3?"…":""]})]})]})]})}function tC({snapshot:e,onBack:t}){const[n,r]=b.useState(e.mods||[]),[i,l]=b.useState(!e.mods),[s,o]=b.useState(""),[u,d]=b.useState("all"),[c,f]=b.useState(null),h=async()=>{try{const x=await Q.get("/mods");r(x.mods||[])}catch{}finally{l(!1)}};b.useEffect(()=>{e.mods?(r(e.mods),l(!1)):h()},[e.mods]);const m=async(x,S)=>{try{await Q.patch(`/mods/${encodeURIComponent(x)}`,{enabled:S}),r(y=>y.map(g=>g.id===x?{...g,enabled:S}:g)),(c==null?void 0:c.id)===x&&f(y=>y&&{...y,enabled:S})}catch{}},p=n.filter(x=>{if(u==="enabled"&&!x.enabled||u==="disabled"&&x.enabled)return!1;if(s){const S=s.toLowerCase();return x.name.toLowerCase().includes(S)||x.description.toLowerCase().includes(S)}return!0});return a.jsxs("div",{className:"mobile-view",children:[a.jsxs("div",{className:"mobile-tasks-toolbar",children:[a.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search mods…",value:s,onChange:x=>o(x.target.value),style:{flex:1}}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>h(),"aria-label":"Refresh",children:a.jsx(Ot,{size:16})})]}),a.jsx("div",{className:"mobile-search-scopes",children:["all","enabled","disabled"].map(x=>a.jsx("button",{type:"button",className:`mobile-scope-chip ${u===x?"active":""}`,onClick:()=>d(x),children:x.charAt(0).toUpperCase()+x.slice(1)},x))}),i?a.jsx("div",{className:"mobile-loading",children:a.jsx("p",{children:"Loading…"})}):p.length===0?a.jsxs("div",{className:"mobile-empty",children:[a.jsx(Mr,{size:40}),a.jsx("p",{children:"No mods found."})]}):a.jsx("div",{className:"mobile-card-list",children:p.map(x=>a.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>f(x),children:[a.jsx("div",{className:"mobile-list-icon",children:a.jsx(Mr,{size:16})}),a.jsxs("div",{className:"mobile-list-content",children:[a.jsx("span",{className:"mobile-list-title",children:x.name}),a.jsxs("span",{className:"mobile-list-meta",children:["v",x.version," · ",x.author]})]}),a.jsx("span",{className:`mobile-list-badge ${x.enabled?"badge-on":"badge-off"}`,children:x.enabled?"on":"off"})]},x.id))}),c&&a.jsx(_t,{open:!0,onClose:()=>f(null),title:c.name,actions:a.jsx("div",{className:"mobile-task-detail-actions",children:a.jsxs("button",{type:"button",className:"mobile-btn",style:{flex:1},onClick:()=>{c&&m(c.id,!c.enabled)},children:[a.jsx(Mm,{size:14})," ",c.enabled?"Disable":"Enable"]})}),children:a.jsxs("div",{className:"mobile-agent-detail",children:[a.jsx("p",{className:"mobile-agent-detail-desc",children:c.description||"No description."}),a.jsxs("div",{className:"mobile-agent-detail-meta",children:[a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Version"}),a.jsx("span",{className:"mono",children:c.version})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Author"}),a.jsx("span",{children:c.author})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Bizar"}),a.jsx("span",{className:"mono",children:c.bizar})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Type"}),a.jsx("span",{children:c.type})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Permissions"}),a.jsx("span",{children:c.permissions.length})]}),c.installedAt&&a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Installed"}),a.jsx("span",{children:new Date(c.installedAt).toLocaleDateString()})]})]})]})})]})}function nC({snapshot:e,onNavigate:t}){var s,o,u;const[n,r]=b.useState(""),i=[{id:"artifacts",icon:Gn,label:"Plans",count:e.artifacts.length||0,desc:"Visual artifacts with elements & comments"},{id:"agents",icon:Or,label:"Agents",count:((s=e.agents)==null?void 0:s.length)||0,desc:"The Norse pantheon"},{id:"skills",icon:Mr,label:"Skills",count:null,desc:"Agent capabilities & tools"},{id:"mods",icon:Mr,label:"Mods",count:((o=e.mods)==null?void 0:o.length)||0,desc:"Installed modifications"},{id:"schedules",icon:pa,label:"Schedules",count:((u=e.schedules)==null?void 0:u.length)||0,desc:"Cron jobs & automated tasks"},{id:"history",icon:ga,label:"History",count:null,desc:"Past sessions & outputs"},{id:"config",icon:Dm,label:"Config",count:null,desc:"Key-value configuration editor"}],l=n.trim()?i.filter(d=>d.label.toLowerCase().includes(n.toLowerCase())||d.desc.toLowerCase().includes(n.toLowerCase())):i;return a.jsxs("div",{className:"mobile-view",children:[a.jsx("div",{className:"mobile-tasks-toolbar",children:a.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search…",value:n,onChange:d=>r(d.target.value),style:{flex:1}})}),a.jsx("div",{className:"mobile-card-list",children:l.map(d=>{const c=d.icon;return a.jsxs("button",{type:"button",className:"mobile-more-nav-item",onClick:()=>t(d.id),children:[a.jsx("div",{className:"mobile-more-nav-icon",children:a.jsx(c,{size:20})}),a.jsxs("div",{className:"mobile-more-nav-content",children:[a.jsxs("span",{className:"mobile-more-nav-label",children:[d.label,d.count!=null&&a.jsx("span",{className:"mobile-more-nav-count",children:d.count})]}),a.jsx("span",{className:"mobile-more-nav-desc",children:d.desc})]}),a.jsx(id,{size:16,className:"mobile-more-nav-arrow"})]},d.id)})}),a.jsx("div",{className:"mobile-more-footer",children:a.jsxs("a",{href:"/?desktop=1",className:"mobile-more-link",children:["Switch to Desktop ",a.jsx(id,{size:14})]})})]})}const qu=[{id:"task",label:"Task",color:"var(--info)"},{id:"note",label:"Note",color:"var(--text-dim)"},{id:"decision",label:"Decision",color:"var(--accent)"},{id:"question",label:"Question",color:"var(--warning)"}];function wo(e){var t;return((t=qu.find(n=>n.id===e))==null?void 0:t.color)||"var(--text-dim)"}function rC({type:e,size:t=12}){switch(e){case"task":return a.jsx(es,{size:t,style:{color:"var(--info)"}});case"note":return a.jsx(od,{size:t,style:{color:"var(--text-dim)"}});case"decision":return a.jsx(es,{size:t,style:{color:"var(--accent)"}});case"question":return a.jsx(V1,{size:t,style:{color:"var(--warning)"}});default:return a.jsx(od,{size:t})}}function iC({slug:e,onBack:t}){const[n,r]=b.useState(null),[i,l]=b.useState(null),[s,o]=b.useState(!0),[u,d]=b.useState(!1),[c,f]=b.useState(null),[h,m]=b.useState(!1),[p,x]=b.useState(!1),[S,y]=b.useState(!1),[g,v]=b.useState(""),C=async()=>{o(!0);try{const T=await Q.get(`/plans/${encodeURIComponent(e)}`);r(T.canvas),l(T.meta)}catch{}finally{o(!1)}};b.useEffect(()=>{C()},[e]);const z=async(T,k,j)=>{try{const I=((n==null?void 0:n.elements)||[]).reduce((H,L)=>Math.max(H,L.x||0),40),$=((n==null?void 0:n.elements)||[]).reduce((H,L)=>Math.max(H,L.y||0),40);await Q.post(`/plans/${encodeURIComponent(e)}/elements`,{type:T,title:k,content:j,x:20+I,y:20+$,width:240,height:120}),await C(),x(!1)}catch{}},N=async(T,k)=>{try{await Q.put(`/plans/${encodeURIComponent(e)}/elements/${encodeURIComponent(T)}`,k),await C(),f(null)}catch{}},P=async T=>{if(confirm("Delete this element?"))try{await Q.del(`/plans/${encodeURIComponent(e)}/elements/${encodeURIComponent(T)}`),f(null),await C()}catch{}},M=async(T,k)=>{try{const j=k?`/plans/${encodeURIComponent(e)}/elements/${encodeURIComponent(k)}/comments`:`/plans/${encodeURIComponent(e)}/comments`;await Q.post(j,{text:T,elementId:k}),await C(),v(""),y(!1)}catch{}};return s||!n||!i?a.jsx("div",{className:"mobile-view",children:a.jsx("div",{className:"mobile-loading",children:a.jsx("p",{children:"Loading canvas…"})})}):a.jsxs("div",{className:"mobile-view mobile-view-canvas",children:[a.jsxs("div",{className:"mobile-canvas-bar",children:[a.jsxs("div",{className:"mobile-canvas-meta",children:[a.jsx("span",{className:"mobile-canvas-title",children:i.title||e}),a.jsx("span",{className:"mobile-canvas-status","data-status":i.status,children:i.status})]}),a.jsxs("div",{className:"mobile-canvas-actions",children:[a.jsx("button",{type:"button",className:`mobile-icon-btn ${u?"active":""}`,onClick:()=>d(T=>!T),"aria-label":u?"Done editing":"Edit",children:a.jsx(Am,{size:16})}),a.jsxs("button",{type:"button",className:"mobile-icon-btn",onClick:()=>m(T=>!T),"aria-label":"Comments",children:[a.jsx(Bn,{size:16}),n.comments.length>0&&a.jsx("span",{className:"mobile-canvas-comment-count",children:n.comments.length})]}),u&&a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>x(!0),"aria-label":"Add element",children:a.jsx(yt,{size:16})})]})]}),a.jsxs("div",{className:"mobile-canvas-elements",children:[n.elements.length===0&&a.jsxs("div",{className:"mobile-empty",children:[a.jsx("p",{children:"No elements yet."}),u&&a.jsxs("button",{type:"button",className:"mobile-btn",onClick:()=>x(!0),children:[a.jsx(yt,{size:14})," Add Element"]})]}),n.elements.map(T=>a.jsxs("button",{type:"button",className:`mobile-canvas-element ${(c==null?void 0:c.id)===T.id?"selected":""}`,style:{borderColor:wo(T.type)},onClick:()=>{u&&f(T)},"aria-pressed":(c==null?void 0:c.id)===T.id,children:[a.jsxs("div",{className:"mobile-canvas-el-header",style:{background:`${wo(T.type)}18`},children:[a.jsx(rC,{type:T.type,size:12}),a.jsx("span",{className:"mobile-canvas-el-type",style:{color:wo(T.type)},children:T.type}),T.status&&T.status!=="open"&&a.jsx("span",{className:"mobile-canvas-el-status",children:T.status})]}),a.jsx("div",{className:"mobile-canvas-el-title",children:T.title||"Untitled"}),T.content&&a.jsxs("div",{className:"mobile-canvas-el-content",children:[T.content.slice(0,120),T.content.length>120?"…":""]}),a.jsxs("div",{className:"mobile-canvas-el-comments",children:[a.jsx(Bn,{size:10}),n.comments.filter(k=>k.elementId===T.id).length]})]},T.id))]}),h&&a.jsxs("div",{className:"mobile-canvas-comments",children:[a.jsxs("div",{className:"mobile-canvas-comments-header",children:[a.jsxs("h4",{children:["Comments (",n.comments.length,")"]}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>m(!1),children:a.jsx(tr,{size:16})})]}),a.jsxs("div",{className:"mobile-canvas-comment-list",children:[n.comments.length===0&&a.jsx("p",{className:"mobile-empty-inline",children:"No comments yet."}),n.comments.map(T=>a.jsxs("div",{className:"mobile-canvas-comment",children:[a.jsxs("div",{className:"mobile-canvas-comment-head",children:[a.jsx("span",{className:"mono",children:T.author}),a.jsx("span",{className:"muted",children:jr(T.created)})]}),a.jsx("div",{className:"mobile-canvas-comment-text",children:T.text})]},T.id))]}),a.jsxs("div",{className:"mobile-canvas-comment-input",children:[a.jsx("textarea",{className:"mobile-input",rows:2,placeholder:"Add a comment…",value:g,onChange:T=>v(T.target.value)}),a.jsx("button",{type:"button",className:"mobile-btn",disabled:!g.trim(),onClick:()=>{M(g.trim(),null)},children:"Post"})]})]}),c&&a.jsx(_t,{open:!0,onClose:()=>f(null),title:`Edit ${c.title||c.type}`,actions:a.jsxs("div",{className:"mobile-task-detail-actions",children:[a.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-danger",onClick:()=>P(c.id),children:[a.jsx($i,{size:14})," Delete"]}),a.jsxs("button",{type:"button",className:"mobile-btn",onClick:()=>y(!0),children:[a.jsx(Bn,{size:14})," Comment"]})]}),children:a.jsx(lC,{element:c,onSave:T=>N(c.id,T),onClose:()=>f(null)})}),a.jsx(sC,{open:p,onClose:()=>x(!1),onAdd:z}),a.jsx(Tn,{open:S,onClose:()=>y(!1),title:"Add Comment",actions:a.jsxs("button",{type:"button",className:"mobile-btn",style:{width:"100%"},disabled:!g.trim(),onClick:()=>{M(g.trim(),(c==null?void 0:c.id)||null),y(!1)},children:[a.jsx(Bn,{size:14})," Post"]}),children:a.jsx("textarea",{className:"mobile-input",rows:3,placeholder:"Your comment…",value:g,onChange:T=>v(T.target.value),autoFocus:!0})})]})}function lC({element:e,onSave:t,onClose:n}){const[r,i]=b.useState(e.type),[l,s]=b.useState(e.title||""),[o,u]=b.useState(e.content||""),[d,c]=b.useState(e.status||"open");return a.jsxs("form",{className:"mobile-task-form",onSubmit:f=>{f.preventDefault(),t({type:r,title:l,content:o,status:d}),n()},children:[a.jsx("label",{className:"mobile-field-label",children:"Type"}),a.jsx("select",{className:"mobile-input",value:r,onChange:f=>i(f.target.value),children:qu.map(f=>a.jsx("option",{value:f.id,children:f.label},f.id))}),a.jsx("label",{className:"mobile-field-label",children:"Title"}),a.jsx("input",{className:"mobile-input",type:"text",value:l,onChange:f=>s(f.target.value)}),a.jsx("label",{className:"mobile-field-label",children:"Status"}),a.jsx("input",{className:"mobile-input",type:"text",value:d,onChange:f=>c(f.target.value),placeholder:"open / done / blocked"}),a.jsx("label",{className:"mobile-field-label",children:"Content (markdown)"}),a.jsx("textarea",{className:"mobile-input",rows:4,value:o,onChange:f=>u(f.target.value)}),a.jsx("button",{type:"submit",className:"mobile-btn",style:{width:"100%",marginTop:8},children:"Save"})]})}function sC({open:e,onClose:t,onAdd:n}){const[r,i]=b.useState("task"),[l,s]=b.useState(""),[o,u]=b.useState(""),d=c=>{c.preventDefault(),l.trim()&&(n(r,l.trim(),o.trim()),s(""),u(""))};return a.jsx(Tn,{open:e,onClose:t,title:"Add Element",actions:a.jsxs("button",{type:"submit",form:"add-el-form",className:"mobile-btn",style:{width:"100%"},children:[a.jsx(yt,{size:14})," Add"]}),children:a.jsxs("form",{id:"add-el-form",onSubmit:d,className:"mobile-task-form",children:[a.jsx("label",{className:"mobile-field-label",children:"Type"}),a.jsx("select",{className:"mobile-input",value:r,onChange:c=>i(c.target.value),children:qu.map(c=>a.jsx("option",{value:c.id,children:c.label},c.id))}),a.jsx("label",{className:"mobile-field-label",children:"Title *"}),a.jsx("input",{className:"mobile-input",type:"text",placeholder:"Element title",value:l,onChange:c=>s(c.target.value),autoFocus:!0,required:!0}),a.jsx("label",{className:"mobile-field-label",children:"Content (markdown)"}),a.jsx("textarea",{className:"mobile-input",rows:3,placeholder:"Description…",value:o,onChange:c=>u(c.target.value)})]})})}function oC({snapshot:e,onBack:t,onOpenArtifact:n}){const[r,i]=b.useState(e.artifacts||[]),[l,s]=b.useState(!e.artifacts),[o,u]=b.useState(""),[d,c]=b.useState(!1),[f,h]=b.useState(""),[m,p]=b.useState(""),x=async()=>{try{const g=await Q.get("/artifacts");i(g.artifacts||[])}catch{}finally{s(!1)}},S=async()=>{if(f.trim())try{const g=await Q.post("/artifacts",{slug:f.trim(),title:m.trim()||void 0});c(!1),h(""),p(""),n(g.slug)}catch{}},y=o.trim()?r.filter(g=>(g.title||g.slug||"").toLowerCase().includes(o.toLowerCase())):r;return a.jsxs("div",{className:"mobile-view",children:[a.jsxs("div",{className:"mobile-tasks-toolbar",children:[a.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search artifacts…",value:o,onChange:g=>u(g.target.value),style:{flex:1}}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>x(),"aria-label":"Refresh",children:a.jsx(Ot,{size:16})})]}),a.jsx("div",{style:{marginBottom:12},children:a.jsxs("button",{type:"button",className:"mobile-btn",style:{width:"100%"},onClick:()=>c(!0),children:[a.jsx(yt,{size:14})," New Artifact"]})}),l?a.jsx("div",{className:"mobile-loading",children:a.jsx("p",{children:"Loading…"})}):y.length===0?a.jsxs("div",{className:"mobile-empty",children:[a.jsx(Gn,{size:40}),a.jsx("p",{children:"No artifacts yet."})]}):a.jsx("div",{className:"mobile-card-list",children:y.map(g=>a.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>n(g.slug),children:[a.jsx("div",{className:"mobile-list-icon",children:a.jsx(Gn,{size:16})}),a.jsxs("div",{className:"mobile-list-content",children:[a.jsx("span",{className:"mobile-list-title",children:g.title||g.slug}),a.jsxs("span",{className:"mobile-list-meta",children:[g.status," · ",g.source,g.elementCount!=null?` · ${g.elementCount} elements`:"",g.commentCount!=null?` · ${g.commentCount} comments`:""]})]}),a.jsx("span",{className:"mobile-list-badge","data-status":g.status,children:g.status})]},g.slug))}),a.jsx(Tn,{open:d,onClose:()=>c(!1),title:"New Artifact",actions:a.jsxs("button",{type:"submit",form:"new-plan-form",className:"mobile-btn",style:{width:"100%"},children:[a.jsx(yt,{size:14})," Create"]}),children:a.jsxs("form",{id:"new-plan-form",onSubmit:g=>{g.preventDefault(),S()},className:"mobile-task-form",children:[a.jsx("label",{className:"mobile-field-label",children:"Slug *"}),a.jsx("input",{className:"mobile-input",type:"text",placeholder:"my-plan",pattern:"[a-z0-9][a-z0-9-]{0,63}",value:f,onChange:g=>h(g.target.value),autoFocus:!0,required:!0}),a.jsx("label",{className:"mobile-field-label",children:"Title (optional)"}),a.jsx("input",{className:"mobile-input",type:"text",placeholder:"My Artifact",value:m,onChange:g=>p(g.target.value)})]})})]})}const aC=["cron","interval","once"],uC=["command","agent","webhook"],ff=["UTC","America/New_York","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo"],lg=Array.from({length:24},(e,t)=>({value:t,label:t===0?"12 AM":t<12?`${t} AM`:t===12?"12 PM":`${t-12} PM`})),cC=Array.from({length:12},(e,t)=>t*5),sg=[{value:"*",label:"Every day"},{value:"0",label:"Sun"},{value:"1",label:"Mon"},{value:"2",label:"Tue"},{value:"3",label:"Wed"},{value:"4",label:"Thu"},{value:"5",label:"Fri"},{value:"6",label:"Sat"}],dC=[{value:"s",label:"sec"},{value:"m",label:"min"},{value:"h",label:"hr"},{value:"d",label:"day"}];function fC({snapshot:e}){var S;const[t,n]=b.useState(e.schedules||[]),[r,i]=b.useState(!e.schedules),[l,s]=b.useState(""),[o,u]=b.useState(null),[d,c]=b.useState({open:!1}),f=async()=>{try{const y=await Q.get("/schedules");n(y.schedules||[])}catch{}finally{i(!1)}};b.useEffect(()=>{e.schedules?(n(e.schedules),i(!1)):f()},[e.schedules]);const h=async(y,g)=>{try{await Q.patch(`/schedules/${encodeURIComponent(y)}`,{enabled:g}),n(v=>v.map(C=>C.id===y?{...C,enabled:g}:C)),(o==null?void 0:o.id)===y&&u(v=>v&&{...v,enabled:g})}catch{}},m=async y=>{if(confirm("Delete this schedule?"))try{await Q.del(`/schedules/${encodeURIComponent(y)}`),n(g=>g.filter(v=>v.id!==y)),(o==null?void 0:o.id)===y&&u(null)}catch{}},p=async y=>{try{await Q.post(`/schedules/${encodeURIComponent(y)}/trigger`)}catch{}},x=l.trim()?t.filter(y=>y.name.toLowerCase().includes(l.toLowerCase())):t;return a.jsxs("div",{className:"mobile-view",children:[a.jsxs("div",{className:"mobile-tasks-toolbar",children:[a.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search schedules…",value:l,onChange:y=>s(y.target.value),style:{flex:1}}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>f(),"aria-label":"Refresh",children:a.jsx(Ot,{size:16})}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>c({open:!0}),"aria-label":"New schedule",children:a.jsx(yt,{size:16})})]}),r?a.jsx("div",{className:"mobile-loading",children:a.jsx("p",{children:"Loading…"})}):x.length===0?a.jsxs("div",{className:"mobile-empty",children:[a.jsx(pa,{size:40}),a.jsx("p",{children:"No schedules found."})]}):a.jsx("div",{className:"mobile-card-list",children:x.map(y=>a.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>u(y),children:[a.jsx("div",{className:"mobile-list-icon",children:a.jsx(pa,{size:16})}),a.jsxs("div",{className:"mobile-list-content",children:[a.jsx("span",{className:"mobile-list-title",children:y.name}),a.jsxs("span",{className:"mobile-list-meta",children:[pf(y)," ·"," ",y.nextRun?`next ${mf(y.nextRun,y.timezone)}`:"no next run"]})]}),a.jsx("span",{className:`mobile-list-badge ${y.enabled?"badge-on":"badge-off"}`,children:y.enabled?"on":"off"})]},y.id))}),o&&a.jsx(_t,{open:!0,onClose:()=>u(null),title:o.name,actions:a.jsxs("div",{className:"mobile-task-detail-actions",children:[a.jsxs("button",{type:"button",className:"mobile-btn",onClick:()=>{o&&p(o.id)},children:[a.jsx(Zl,{size:14})," Trigger now"]}),a.jsx("button",{type:"button",className:`mobile-btn ${o.enabled?"mobile-btn-secondary":""}`,onClick:()=>{o&&h(o.id,!o.enabled)},children:o.enabled?"Disable":"Enable"}),a.jsxs("button",{type:"button",className:"mobile-btn",onClick:()=>{o&&(c({open:!0,initial:o}),u(null))},children:[a.jsx(Am,{size:14})," Edit"]}),a.jsx("button",{type:"button",className:"mobile-btn mobile-btn-danger",onClick:()=>{o&&m(o.id)},children:a.jsx($i,{size:14})})]}),children:a.jsx("div",{className:"mobile-agent-detail",children:a.jsxs("div",{className:"mobile-agent-detail-meta",children:[a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Type"}),a.jsx("span",{children:o.type})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Schedule"}),a.jsx("span",{className:"mono",children:pf(o)||o.schedule})]}),o.timezone&&a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Timezone"}),a.jsx("span",{className:"mono",children:o.timezone})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Action"}),a.jsxs("span",{children:[o.action.type,": ",o.action.target]})]}),o.action.type==="agent"&&o.action.prompt&&a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Prompt"}),a.jsx("span",{style:{fontSize:12},children:o.action.prompt})]}),((S=o.budgetCheck)==null?void 0:S.skipIfBudgetLow)&&a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Budget gate"}),a.jsxs("span",{children:["skip if ≥ ",o.budgetCheck.maxConcurrent??6," concurrent"]})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Next run"}),a.jsx("span",{children:o.nextRun?mf(o.nextRun,o.timezone):"—"})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Last run"}),a.jsx("span",{children:o.lastRun?pC(o.lastRun):"—"})]}),o.lastResult&&a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Last result"}),a.jsx("span",{style:{fontSize:12},children:o.lastResult})]}),o.lastError&&a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Last error"}),a.jsx("span",{style:{fontSize:12},children:o.lastError})]})]})})}),a.jsx(mC,{open:d.open,initial:d.initial,onClose:()=>c({open:!1}),onSaved:()=>{c({open:!1}),f()}})]})}function hf(e){var r,i;if(!e)return{name:"",type:"cron",cronMinute:0,cronHour:13,cronDow:"0",intervalN:30,intervalUnit:"m",onceAt:"",timezone:"UTC",actionType:"agent",actionTarget:"",actionPrompt:"",skipIfBudgetLow:!1,maxConcurrent:6,enabled:!0};const t=e.type==="cron"?og(e.schedule):null,n=e.type==="interval"?gC(e.schedule):null;return{name:e.name||"",type:e.type,cronMinute:(t==null?void 0:t.minute)??0,cronHour:(t==null?void 0:t.hour)??9,cronDow:(t==null?void 0:t.dow)??"*",intervalN:(n==null?void 0:n.n)??30,intervalUnit:(n==null?void 0:n.unit)??"m",onceAt:e.type==="once"?yC(e.schedule):"",timezone:e.timezone||"UTC",actionType:e.action.type,actionTarget:e.action.target||"",actionPrompt:e.action.prompt||"",skipIfBudgetLow:!!((r=e.budgetCheck)!=null&&r.skipIfBudgetLow),maxConcurrent:Number.isFinite((i=e.budgetCheck)==null?void 0:i.maxConcurrent)?e.budgetCheck.maxConcurrent:6,enabled:e.enabled!==!1}}function hC(e){if(e.type==="cron")return`${e.cronMinute} ${e.cronHour} * * ${e.cronDow}`;if(e.type==="interval")return`${e.intervalN}${e.intervalUnit}`;if(!e.onceAt)return"";try{return new Date(e.onceAt).toISOString()}catch{return e.onceAt}}function mC({open:e,initial:t,onClose:n,onSaved:r}){const[i,l]=b.useState(()=>hf(t)),[s,o]=b.useState(!1);b.useEffect(()=>{e&&l(hf(t))},[e,t]);const u=(c,f)=>{l(h=>({...h,[c]:f}))},d=async c=>{if(c.preventDefault(),!i.name.trim())return;const f=hC(i);if(f){o(!0);try{const h={name:i.name.trim(),type:i.type,schedule:f,timezone:i.timezone,action:{type:i.actionType,target:i.actionTarget.trim(),...i.actionType==="agent"&&i.actionPrompt.trim()?{prompt:i.actionPrompt.trim()}:{}},budgetCheck:{maxConcurrent:i.maxConcurrent,skipIfBudgetLow:i.skipIfBudgetLow},enabled:i.enabled};t?await Q.put(`/schedules/${encodeURIComponent(t.id)}`,h):await Q.post("/schedules",h),r()}catch{}finally{o(!1)}}};return a.jsx(Tn,{open:e,onClose:n,title:t?`Edit ${t.name}`:"New schedule",actions:a.jsxs("button",{type:"submit",form:"mobile-schedule-form",className:"mobile-btn",style:{width:"100%"},disabled:s,children:[a.jsx(yt,{size:14})," ",t?"Save":"Create"]}),children:a.jsxs("form",{id:"mobile-schedule-form",onSubmit:d,className:"mobile-task-form",children:[a.jsx("label",{className:"mobile-field-label",children:"Name *"}),a.jsx("input",{className:"mobile-input",type:"text",placeholder:"Weekly review",value:i.name,onChange:c=>u("name",c.target.value),autoFocus:!0,required:!0}),a.jsx("label",{className:"mobile-field-label",children:"Type"}),a.jsx("select",{className:"mobile-input",value:i.type,onChange:c=>u("type",c.target.value),children:aC.map(c=>a.jsx("option",{value:c,children:c},c))}),i.type==="cron"&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"mobile-field-label",children:"Day of week"}),a.jsx("select",{className:"mobile-input",value:i.cronDow,onChange:c=>u("cronDow",c.target.value),children:sg.map(c=>a.jsx("option",{value:c.value,children:c.label},c.value))}),a.jsxs("div",{className:"mobile-form-row",children:[a.jsxs("div",{style:{flex:1},children:[a.jsx("label",{className:"mobile-field-label",children:"Hour"}),a.jsx("select",{className:"mobile-input",value:String(i.cronHour),onChange:c=>u("cronHour",parseInt(c.target.value,10)),children:lg.map(c=>a.jsx("option",{value:String(c.value),children:c.label},c.value))})]}),a.jsxs("div",{style:{flex:1},children:[a.jsx("label",{className:"mobile-field-label",children:"Minute"}),a.jsx("select",{className:"mobile-input",value:String(i.cronMinute),onChange:c=>u("cronMinute",parseInt(c.target.value,10)),children:cC.map(c=>a.jsx("option",{value:String(c),children:String(c).padStart(2,"0")},c))})]})]})]}),i.type==="interval"&&a.jsxs("div",{className:"mobile-form-row",children:[a.jsxs("div",{style:{flex:1},children:[a.jsx("label",{className:"mobile-field-label",children:"Every"}),a.jsx("input",{className:"mobile-input",type:"number",min:1,value:i.intervalN,onChange:c=>u("intervalN",parseInt(c.target.value,10)||1)})]}),a.jsxs("div",{style:{flex:1},children:[a.jsx("label",{className:"mobile-field-label",children:"Unit"}),a.jsx("select",{className:"mobile-input",value:i.intervalUnit,onChange:c=>u("intervalUnit",c.target.value),children:dC.map(c=>a.jsx("option",{value:c.value,children:c.label},c.value))})]})]}),i.type==="once"&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"mobile-field-label",children:"Run at"}),a.jsx("input",{className:"mobile-input",type:"datetime-local",value:i.onceAt,onChange:c=>u("onceAt",c.target.value)})]}),a.jsx("label",{className:"mobile-field-label",children:"Timezone"}),a.jsx("select",{className:"mobile-input",value:ff.includes(i.timezone)?i.timezone:"UTC",onChange:c=>u("timezone",c.target.value),children:ff.map(c=>a.jsx("option",{value:c,children:c},c))}),a.jsx("label",{className:"mobile-field-label",children:"Action type"}),a.jsx("select",{className:"mobile-input",value:i.actionType,onChange:c=>u("actionType",c.target.value),children:uC.map(c=>a.jsx("option",{value:c,children:c},c))}),a.jsx("label",{className:"mobile-field-label",children:"Target"}),a.jsx("input",{className:"mobile-input",type:"text",placeholder:i.actionType==="webhook"?"https://...":i.actionType==="agent"?"agent or task ref":"echo hello",value:i.actionTarget,onChange:c=>u("actionTarget",c.target.value)}),i.actionType==="agent"&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"mobile-field-label",children:"Prompt"}),a.jsx("textarea",{className:"mobile-input",rows:3,placeholder:"What should the agent do?",value:i.actionPrompt,onChange:c=>u("actionPrompt",c.target.value)})]}),a.jsxs("fieldset",{className:"mobile-budget-card",children:[a.jsx("legend",{children:"Budget pre-flight"}),a.jsxs("label",{className:"mobile-checkbox-row",children:[a.jsx("input",{type:"checkbox",checked:i.skipIfBudgetLow,onChange:c=>u("skipIfBudgetLow",c.target.checked)}),a.jsx("span",{children:"Skip if too many bg tasks are running"})]}),a.jsx("label",{className:"mobile-field-label",children:"Cap"}),a.jsx("input",{className:"mobile-input",type:"number",min:1,max:64,value:i.maxConcurrent,onChange:c=>u("maxConcurrent",parseInt(c.target.value,10)||6),disabled:!i.skipIfBudgetLow})]}),a.jsxs("label",{className:"mobile-checkbox-row",children:[a.jsx("input",{type:"checkbox",checked:i.enabled,onChange:c=>u("enabled",c.target.checked)}),a.jsx("span",{children:"Enabled"})]})]})})}function pC(e){const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:new Date(e).toLocaleDateString()}function mf(e,t){try{return new Date(e).toLocaleString(void 0,{timeZone:t||void 0,weekday:"short",hour:"numeric",minute:"2-digit",month:"short",day:"numeric"})}catch{return new Date(e).toLocaleString()}}function og(e){if(typeof e!="string")return null;const t=e.trim().split(/\s+/);if(t.length!==5)return null;const[n,r,,,i]=t,l=parseInt(n,10),s=parseInt(r,10);return!Number.isFinite(l)||!Number.isFinite(s)||n!==String(l)||r!==String(s)?null:{minute:l,hour:s,dow:i==="*"?"*":Number.isFinite(parseInt(i,10))?i:"*"}}function gC(e){if(typeof e!="string")return null;const t=/^(\d+)([smhd])$/i.exec(e.trim());return t?{n:parseInt(t[1],10),unit:t[2].toLowerCase()}:null}function yC(e){if(!e)return"";try{const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}catch{return""}}function pf(e){var l,s;if(e.type!=="cron")return e.schedule;const t=og(e.schedule);if(!t)return e.schedule;const n=((l=sg.find(o=>o.value===t.dow))==null?void 0:l.label)||t.dow,r=((s=lg.find(o=>o.value===t.hour))==null?void 0:s.label)||`${t.hour}`,i=String(t.minute).padStart(2,"0");return n==="Every day"?`Every day ${r} :${i}`:`Every ${n} ${r} :${i}`}const xC=["all","tasks","agents","artifacts","projects","settings"],vC={tasks:es,agents:Or,plans:Gn,projects:Nu,settings:Mr};function kC({open:e,onClose:t,onNavigate:n}){const[r,i]=b.useState(""),[l,s]=b.useState("all"),[o,u]=b.useState([]),[d,c]=b.useState(!1),f=b.useRef(null);b.useEffect(()=>{e&&(i(""),u([]),requestAnimationFrame(()=>{var p;return(p=f.current)==null?void 0:p.focus()}))},[e]),b.useEffect(()=>{if(!r.trim()){u([]);return}const p=setTimeout(async()=>{c(!0);try{const x=await Q.get(`/search?q=${encodeURIComponent(r)}&scope=${l}`);u(x.results||[])}catch{u([])}finally{c(!1)}},250);return()=>clearTimeout(p)},[r,l]);const h=p=>{const x=p.item,S=x.id||x.slug||x.name||"";n(p.type,S),t()},m=o.reduce((p,x)=>(p[x.type]||(p[x.type]=[]),p[x.type].push(x),p),{});return a.jsx(Tn,{open:e,onClose:t,title:"Search",children:a.jsxs("div",{className:"mobile-search-container",children:[a.jsxs("div",{className:"mobile-search-input-row",children:[a.jsx(sd,{size:16,style:{color:"var(--text-muted)",flexShrink:0}}),a.jsx("input",{ref:f,className:"mobile-search-field",type:"text",placeholder:"Search…",value:r,onChange:p=>i(p.target.value),enterKeyHint:"search",onKeyDown:p=>{p.key==="Escape"&&t(),p.key==="Enter"&&o.length>0&&h(o[0])}}),r&&a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>i(""),"aria-label":"Clear",children:a.jsx(tr,{size:16})})]}),a.jsx("div",{className:"mobile-search-scopes",children:xC.map(p=>a.jsx("button",{type:"button",className:`mobile-scope-chip ${l===p?"active":""}`,onClick:()=>s(p),children:p==="all"?"All":p.charAt(0).toUpperCase()+p.slice(1)},p))}),a.jsxs("div",{className:"mobile-search-results",children:[d&&a.jsx("div",{className:"mobile-search-loading",children:"Searching…"}),!d&&r&&o.length===0&&a.jsxs("div",{className:"mobile-empty",children:[a.jsx(sd,{size:32}),a.jsx("p",{children:"No results found"})]}),!d&&!r&&a.jsx("div",{className:"mobile-empty",children:a.jsx("p",{children:"Type to search across tasks, agents, plans, and more."})}),Object.entries(m).map(([p,x])=>{const S=vC[p]||Gn;return a.jsxs("div",{className:"mobile-search-group",children:[a.jsxs("h4",{className:"mobile-search-group-title",children:[a.jsx(S,{size:12})," ",p.charAt(0).toUpperCase()+p.slice(1)," (",x.length,")"]}),x.map((y,g)=>{const v=y.item;return a.jsxs("button",{type:"button",className:"mobile-search-result-item",onClick:()=>h(y),children:[a.jsx("span",{className:"mobile-search-result-title",children:v.title||v.name||v.slug||"(unnamed)"}),v.description&&a.jsx("span",{className:"mobile-search-result-meta",children:v.description.slice(0,80)})]},g)})]},p)})]})]})})}const wC=[{id:"dark",label:"Dark",Icon:J1},{id:"light",label:"Light",Icon:ox},{id:"system",label:"System",Icon:Z1}],bC=[{name:"Purple",accent:"#8b5cf6"},{name:"Blue",accent:"#3b82f6"},{name:"Green",accent:"#10b981"},{name:"Orange",accent:"#f97316"},{name:"Red",accent:"#ef4444"},{name:"Pink",accent:"#ec4899"},{name:"Cyan",accent:"#06b6d4"},{name:"Mono",accent:"#6b7280"}];function SC(e){if(e<=0)return"expired";const t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,"0")}`}function CC({settings:e,snapshot:t,onRefresh:n}){var z,N,P,M,T,k;const[r,i]=b.useState(e),[l,s]=b.useState(!1),[o,u]=b.useState(!1),[d,c]=b.useState(null),[f,h]=b.useState(!1),[m,p]=b.useState(Date.now());b.useEffect(()=>{i(e),s(!1),e.theme&&fi(e.theme)},[e]),b.useEffect(()=>{if(!d)return;const j=setInterval(()=>p(Date.now()),1e3);return()=>clearInterval(j)},[d]);const x=j=>{i(I=>{const $={...I,theme:{...I.theme,...j}};return ns($.theme),fi($.theme),$}),s(!0)},S=(j,I)=>{i($=>({...$,[j]:I})),s(!0)},y=async()=>{u(!0);try{const j=await Q.put("/settings",r);i(j.data),s(!1),ns(j.data.theme),fi(j.data.theme),n()}catch{}finally{u(!1)}},g=async()=>{h(!0);try{const j=await Q.post("/pair/start");c(j)}catch{}finally{h(!1)}},v=d?d.expiresAt-m:0,C=d!=null&&v<=0;return a.jsxs("div",{className:"mobile-view",children:[l&&a.jsxs("div",{className:"mobile-settings-save-bar",children:[a.jsx("span",{children:"Unsaved changes"}),a.jsxs("button",{type:"button",className:"mobile-btn",disabled:o,onClick:y,children:[a.jsx(Lm,{size:14})," ",o?"Saving…":"Save"]})]}),a.jsxs("section",{className:"mobile-section",children:[a.jsx("h3",{className:"mobile-section-title",children:"Appearance"}),a.jsxs("div",{className:"mobile-card",children:[a.jsxs("div",{className:"mobile-setting-row",children:[a.jsx("span",{className:"mobile-setting-label",children:"Theme"}),a.jsx("div",{className:"mobile-theme-btns",children:wC.map(({id:j,label:I,Icon:$})=>a.jsxs("button",{type:"button",className:`mobile-theme-btn ${r.theme.mode===j?"active":""}`,onClick:()=>x({mode:j}),children:[a.jsx($,{size:14})," ",I]},j))})]}),a.jsxs("div",{className:"mobile-setting-row",style:{flexDirection:"column",alignItems:"flex-start",gap:8},children:[a.jsx("span",{className:"mobile-setting-label",children:"Accent color"}),a.jsx("div",{className:"mobile-accent-swatches",children:bC.map(j=>a.jsx("button",{type:"button",className:`mobile-accent-swatch ${r.theme.accent===j.accent?"active":""}`,style:{background:j.accent},onClick:()=>x({accent:j.accent}),title:j.name},j.name))})]}),a.jsxs("div",{className:"mobile-setting-row",style:{flexDirection:"column",alignItems:"flex-start",gap:8},children:[a.jsxs("span",{className:"mobile-setting-label",children:["Font size: ",r.theme.fontSize,"px"]}),a.jsx("input",{type:"range",min:12,max:20,value:r.theme.fontSize,onChange:j=>x({fontSize:Number(j.target.value)}),style:{width:"100%"}})]}),a.jsxs("div",{className:"mobile-setting-row",children:[a.jsx("span",{className:"mobile-setting-label",children:"Compact mode"}),a.jsxs("label",{className:"mobile-toggle",children:[a.jsx("input",{type:"checkbox",checked:r.theme.compactMode,onChange:j=>x({compactMode:j.target.checked})}),a.jsx("span",{className:"mobile-toggle-slider"})]})]}),a.jsxs("div",{className:"mobile-setting-row",children:[a.jsx("span",{className:"mobile-setting-label",children:"Animations"}),a.jsxs("label",{className:"mobile-toggle",children:[a.jsx("input",{type:"checkbox",checked:r.theme.animations,onChange:j=>x({animations:j.target.checked})}),a.jsx("span",{className:"mobile-toggle-slider"})]})]})]})]}),a.jsxs("section",{className:"mobile-section",children:[a.jsx("h3",{className:"mobile-section-title",children:"Chat Defaults"}),a.jsxs("div",{className:"mobile-card",children:[a.jsx("label",{className:"mobile-field-label",children:"Default Agent"}),a.jsx("select",{className:"mobile-input",value:r.defaultAgent||"odin",onChange:j=>S("defaultAgent",j.target.value),children:((t==null?void 0:t.agents)||[]).map(j=>a.jsxs("option",{value:j.name,children:["@",j.name]},j.name))}),a.jsx("label",{className:"mobile-field-label",style:{marginTop:8},children:"Default Model"}),a.jsx("input",{className:"mobile-input",type:"text",placeholder:"(auto)",value:r.defaultModel||"",onChange:j=>S("defaultModel",j.target.value)})]})]}),a.jsxs("section",{className:"mobile-section",children:[a.jsx("h3",{className:"mobile-section-title",children:"Notifications"}),a.jsxs("div",{className:"mobile-card",children:[a.jsxs("div",{className:"mobile-setting-row",children:[a.jsx("span",{className:"mobile-setting-label",children:"Agent completion"}),a.jsxs("label",{className:"mobile-toggle",children:[a.jsx("input",{type:"checkbox",checked:!!r.notifications.onAgentComplete,onChange:j=>{i(I=>({...I,notifications:{...I.notifications,onAgentComplete:j.target.checked}})),s(!0)}}),a.jsx("span",{className:"mobile-toggle-slider"})]})]}),a.jsxs("div",{className:"mobile-setting-row",children:[a.jsx("span",{className:"mobile-setting-label",children:"Plan approval"}),a.jsxs("label",{className:"mobile-toggle",children:[a.jsx("input",{type:"checkbox",checked:!!r.notifications.onPlanApproval,onChange:j=>{i(I=>({...I,notifications:{...I.notifications,onPlanApproval:j.target.checked}})),s(!0)}}),a.jsx("span",{className:"mobile-toggle-slider"})]})]})]})]}),a.jsxs("section",{className:"mobile-section",children:[a.jsx("h3",{className:"mobile-section-title",children:"Agent Behavior"}),a.jsxs("div",{className:"mobile-card",children:[a.jsx("label",{className:"mobile-field-label",children:"Max parallel agents"}),a.jsx("input",{className:"mobile-input",type:"number",inputMode:"numeric",min:1,max:20,value:((z=r.agents)==null?void 0:z.maxParallel)??6,onChange:j=>{i(I=>({...I,agents:{...I.agents,maxParallel:Math.max(1,Math.min(20,parseInt(j.target.value,10)||6))}})),s(!0)}}),a.jsx("label",{className:"mobile-field-label",style:{marginTop:8},children:"Stuck threshold (ms)"}),a.jsx("input",{className:"mobile-input",type:"number",inputMode:"numeric",min:6e4,max:36e5,step:6e4,value:((N=r.agents)==null?void 0:N.stuckThresholdMs)??6e5,onChange:j=>{i(I=>({...I,agents:{...I.agents,stuckThresholdMs:Math.max(6e4,parseInt(j.target.value,10)||6e5)}})),s(!0)}}),a.jsxs("div",{className:"mobile-setting-row",style:{marginTop:8},children:[a.jsx("span",{className:"mobile-setting-label",children:"Auto-restart stuck agents"}),a.jsxs("label",{className:"mobile-toggle",children:[a.jsx("input",{type:"checkbox",checked:!!((P=r.agents)!=null&&P.autoRestart),onChange:j=>{i(I=>({...I,agents:{...I.agents,autoRestart:j.target.checked}})),s(!0)}}),a.jsx("span",{className:"mobile-toggle-slider"})]})]})]})]}),a.jsxs("section",{className:"mobile-section",children:[a.jsx("h3",{className:"mobile-section-title",children:"Tailscale Serve"}),a.jsx("div",{className:"mobile-card",children:a.jsxs("p",{className:"muted",style:{fontSize:13},children:["Use ",a.jsx("code",{children:"bizar service"})," commands in the terminal to configure Tailscale serve."]})})]}),a.jsxs("section",{className:"mobile-section",children:[a.jsxs("h3",{className:"mobile-section-title",children:[a.jsx(sx,{size:14})," Companion App"]}),a.jsxs("div",{className:"mobile-card",children:[!d&&a.jsxs("button",{type:"button",className:"mobile-btn",onClick:g,disabled:f,style:{width:"100%"},children:[a.jsx(nx,{size:14})," ",f?"Generating…":"Generate QR Code"]}),d&&!C&&a.jsxs("div",{style:{textAlign:"center"},children:[a.jsx("div",{style:{background:"#fff",padding:12,borderRadius:12,display:"inline-block"},children:a.jsx(rg,{value:d.qrPayload,size:180,level:"M"})}),a.jsxs("div",{style:{marginTop:8,fontSize:12},children:["Expires in ",a.jsx("strong",{children:SC(v)})]}),a.jsx("div",{className:"mono",style:{fontSize:10,wordBreak:"break-all",marginTop:4},children:d.publicUrl})]}),d&&C&&a.jsxs("button",{type:"button",className:"mobile-btn",onClick:g,style:{width:"100%"},children:[a.jsx(Ot,{size:14})," Generate new QR"]})]})]}),a.jsxs("section",{className:"mobile-section",children:[a.jsx("h3",{className:"mobile-section-title",children:"About"}),a.jsxs("div",{className:"mobile-card",children:[a.jsxs("div",{className:"mobile-setting-row",children:[a.jsx("span",{className:"mobile-setting-label",children:"Version"}),a.jsx("span",{className:"mobile-setting-value mono",children:((M=r.about)==null?void 0:M.version)||"—"})]}),a.jsxs("div",{className:"mobile-setting-row",children:[a.jsx("span",{className:"mobile-setting-label",children:"Agents"}),a.jsx("span",{className:"mobile-setting-value",children:((T=t==null?void 0:t.agents)==null?void 0:T.length)||0})]}),a.jsxs("div",{className:"mobile-setting-row",children:[a.jsx("span",{className:"mobile-setting-label",children:"Tasks"}),a.jsx("span",{className:"mobile-setting-value",children:((k=t==null?void 0:t.tasks)==null?void 0:k.length)||0})]}),a.jsxs("div",{className:"mobile-setting-row",children:[a.jsx("span",{className:"mobile-setting-label",children:"Plans"}),a.jsx("span",{className:"mobile-setting-value",children:(t==null?void 0:t.artifacts.length)||0})]})]})]}),a.jsx("div",{className:"mobile-view-footer",children:a.jsx("a",{href:"/?desktop=1",className:"mobile-btn mobile-btn-secondary",children:"Switch to Desktop"})})]})}const jC=["languages","framework","design","testing","devops","data","security","integration"];function NC({snapshot:e,onBack:t}){const[n,r]=b.useState([]),[i,l]=b.useState(!0),[s,o]=b.useState(""),[u,d]=b.useState(""),[c,f]=b.useState(null),h=async()=>{try{const x=await Q.get("/skills");r(x.skills||[])}catch{}finally{l(!1)}};b.useEffect(()=>{h()},[]);const m=async(x,S)=>{try{await Q.patch(`/skills/${encodeURIComponent(x)}`,{enabled:S}),r(y=>y.map(g=>g.id===x?{...g,enabled:S}:g)),(c==null?void 0:c.id)===x&&f(y=>y&&{...y,enabled:S})}catch{}},p=n.filter(x=>{if(u&&x.category!==u)return!1;if(s){const S=s.toLowerCase();return x.name.toLowerCase().includes(S)||x.description.toLowerCase().includes(S)}return!0});return a.jsxs("div",{className:"mobile-view",children:[a.jsxs("div",{className:"mobile-tasks-toolbar",children:[a.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search skills…",value:s,onChange:x=>o(x.target.value),style:{flex:1}}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>h(),"aria-label":"Refresh",children:a.jsx(Ot,{size:16})})]}),a.jsxs("div",{className:"mobile-search-scopes",children:[a.jsx("button",{type:"button",className:`mobile-scope-chip ${u?"":"active"}`,onClick:()=>d(""),children:"All"}),jC.map(x=>a.jsx("button",{type:"button",className:`mobile-scope-chip ${u===x?"active":""}`,onClick:()=>d(x),children:x},x))]}),i?a.jsx("div",{className:"mobile-loading",children:a.jsx("p",{children:"Loading…"})}):p.length===0?a.jsxs("div",{className:"mobile-empty",children:[a.jsx(Jl,{size:40}),a.jsx("p",{children:"No skills found."})]}):a.jsx("div",{className:"mobile-card-list",children:p.map(x=>a.jsxs("button",{type:"button",className:"mobile-list-item mobile-list-item-interactive",onClick:()=>f(x),children:[a.jsx("div",{className:"mobile-list-icon",children:a.jsx(Jl,{size:16})}),a.jsxs("div",{className:"mobile-list-content",children:[a.jsx("span",{className:"mobile-list-title",children:x.name}),a.jsxs("span",{className:"mobile-list-meta",children:[x.category," · v",x.version]})]}),a.jsx("span",{className:`mobile-list-badge ${x.enabled?"badge-on":"badge-off"}`,children:x.enabled?"on":"off"})]},x.id))}),c&&a.jsx(_t,{open:!0,onClose:()=>f(null),title:c.name,actions:a.jsxs("button",{type:"button",className:`mobile-btn ${c.enabled?"mobile-btn-secondary":""}`,style:{width:"100%"},onClick:()=>{c&&m(c.id,!c.enabled)},children:[a.jsx(Mm,{size:14})," ",c.enabled?"Disable":"Enable"]}),children:a.jsxs("div",{className:"mobile-agent-detail",children:[a.jsx("p",{className:"mobile-agent-detail-desc",children:c.description||"No description."}),a.jsxs("div",{className:"mobile-agent-detail-meta",children:[a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Category"}),a.jsx("span",{children:c.category})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Version"}),a.jsx("span",{className:"mono",children:c.version})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Source"}),a.jsx("span",{children:c.source})]}),c.tags.length>0&&a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Tags"}),a.jsx("span",{children:c.tags.join(", ")})]})]})]})})]})}const EC=["queued","doing","blocked","done"],dl={queued:"Queued",doing:"Doing",blocked:"Blocked",done:"Done"},gf={queued:"doing",doing:"done",blocked:"queued",done:"queued"};function TC(e){const t=e.metadata??{};return!!(t.sessionId||t.bgInstanceId)}function zC(e){var n;const t=e.metadata??{};return!!((n=t.artifactIds)!=null&&n.length||t.artifactId)}function yf({snapshot:e,onRefresh:t,selectedTaskId:n,onCloseDetail:r,onOpenChat:i,onOpenArtifact:l}){var fe,Ye;const[s,o]=b.useState(e.tasks||[]),[u,d]=b.useState(!e.tasks),[c,f]=b.useState(""),[h,m]=b.useState("queued"),[p,x]=b.useState(null),[S,y]=b.useState(!1),[g,v]=b.useState(null),[C,z]=b.useState([]),[N,P]=b.useState(""),[M,T]=b.useState(null),[k,j]=b.useState(!1),[I,$]=b.useState(""),[H,L]=b.useState("updated");b.useEffect(()=>{var B;if(e.tasks&&(o(e.tasks),d(!1)),n){const ie=(B=e.tasks)==null?void 0:B.find(re=>re.id===n);ie&&x(ie)}},[e.tasks,n]),b.useEffect(()=>{if(n){const B=s.find(ie=>ie.id===n);B&&x(B)}},[n,s]);const te=async()=>{try{const B=await Q.get("/tasks");o(Array.isArray(B)?B:[])}catch{}finally{d(!1)}},J=async(B,ie)=>{o(re=>re.map(be=>be.id===B?{...be,status:ie}:be)),(p==null?void 0:p.id)===B&&x(re=>re&&{...re,status:ie});try{await Q.patch(`/tasks/${encodeURIComponent(B)}/status`,{status:ie})}catch{await te()}},D=async B=>{if(confirm("Delete this task?"))try{await Q.del(`/tasks/${encodeURIComponent(B)}`),o(ie=>ie.filter(re=>re.id!==B)),(p==null?void 0:p.id)===B&&x(null)}catch{await te()}},V=async B=>{try{await Q.post(`/tasks/${encodeURIComponent(B)}/archive`),o(ie=>ie.filter(re=>re.id!==B)),(p==null?void 0:p.id)===B&&x(null)}catch{}},ne=[...s.filter(B=>{var ie,re;if(c.trim()){const be=c.toLowerCase();if(!(B.title||"").toLowerCase().includes(be)&&!(B.description||"").toLowerCase().includes(be))return!1}if(I.trim()){const be=I==="mine"?((re=(ie=e.settings)==null?void 0:ie.data)==null?void 0:re.defaultAgent)||IC(e):I.replace(/^@/,"");if((B.assignee||"").toLowerCase()!==be.toLowerCase())return!1}return!0})].sort((B,ie)=>{switch(H){case"priority":{const re={high:0,normal:1,low:2};return(re[B.priority]??1)-(re[ie.priority]??1)}case"created":return new Date(ie.createdAt).getTime()-new Date(B.createdAt).getTime();case"updated":default:return new Date(ie.updatedAt).getTime()-new Date(B.updatedAt).getTime()}}),ae=ne.filter(B=>B.status===h),E=e.agents||[],ye=async(B,ie,re,be)=>{try{const zn=await Q.post("/tasks",{title:B,description:ie,assignee:re||null,priority:be});o(In=>[zn,...In]),y(!1)}catch{}},qe=async B=>{j(!0),P(""),T(null),v(B);try{const re=((await Q.get(`/tasks/${encodeURIComponent(B)}/artifacts`)).artifacts||[]).map(be=>be.id);if(z(re),re.length>0){const[be,zn]=await Promise.all([Q.get(`/artifacts/${encodeURIComponent(re[0])}`),fetch(Q.urlWithToken(`/artifacts/${encodeURIComponent(re[0])}/content`)).then(In=>In.text())]);T(be),P(zn)}}catch{}finally{j(!1)}};return u?a.jsx("div",{className:"mobile-loading",children:a.jsx("p",{children:"Loading…"})}):a.jsxs("div",{className:"mobile-view mobile-view-tasks",children:[a.jsxs("div",{className:"mobile-tasks-toolbar",children:[a.jsx("input",{className:"mobile-search-input",type:"text",placeholder:"Search tasks…",value:c,onChange:B=>f(B.target.value),style:{flex:1}}),a.jsx("button",{type:"button",className:"mobile-icon-btn",onClick:()=>te(),"aria-label":"Refresh",children:a.jsx(Ot,{size:16})})]}),a.jsxs("div",{className:"mobile-tasks-filters",children:[a.jsxs("select",{className:"mobile-filter-select",value:I,onChange:B=>$(B.target.value),children:[a.jsx("option",{value:"",children:"All"}),a.jsx("option",{value:"mine",children:"Mine"}),E.map(B=>a.jsxs("option",{value:`@${B.name}`,children:["@",B.name]},B.name))]}),a.jsxs("select",{className:"mobile-filter-select",value:H,onChange:B=>L(B.target.value),children:[a.jsx("option",{value:"updated",children:"Updated"}),a.jsx("option",{value:"created",children:"Created"}),a.jsx("option",{value:"priority",children:"Priority"})]})]}),a.jsx("div",{className:"mobile-kanban-tabs",children:EC.map(B=>{const ie=ne.filter(re=>re.status===B).length;return a.jsxs("button",{type:"button",className:`mobile-kanban-tab ${h===B?"active":""}`,onClick:()=>m(B),children:[dl[B]," (",ie,")"]},B)})}),a.jsxs("div",{className:"mobile-card-list",children:[ae.length===0&&a.jsxs("div",{className:"mobile-empty mobile-empty-compact",children:[a.jsxs("p",{children:["No ",dl[h].toLowerCase()," tasks."]}),a.jsx("p",{className:"muted",children:"Create one or switch columns."})]}),ae.map(B=>{var ie;return a.jsxs("button",{type:"button",className:"mobile-task-card",onClick:()=>x(B),children:[a.jsx("div",{className:"priority-dot",style:{background:dx[B.priority]||"var(--info)"}}),a.jsxs("div",{className:"task-content",children:[a.jsx("div",{className:"task-title",children:B.title}),a.jsxs("div",{className:"task-meta",children:[B.assignee?`@${B.assignee}`:"unassigned"," · ",jr(B.updatedAt||B.createdAt),(ie=B.dependencies)!=null&&ie.length?` · ${B.dependencies.length} deps`:""]})]})]},B.id)})]}),a.jsx("button",{type:"button",className:"mobile-fab",onClick:()=>y(!0),"aria-label":"Add task",children:a.jsx(yt,{size:24})}),a.jsx(_t,{open:!!p,onClose:()=>{x(null),r==null||r()},title:"Task Detail",actions:p&&a.jsxs("div",{className:"mobile-task-detail-actions",children:[p.status!=="done"&&a.jsxs("button",{type:"button",className:"mobile-btn",style:{flex:1},onClick:()=>{p&&J(p.id,gf[p.status])},children:["Move to ",dl[gf[p.status]||"queued"]]}),a.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",onClick:()=>{p&&V(p.id)},children:[a.jsx(F1,{size:14})," Archive"]}),TC(p)&&a.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",onClick:()=>{i==null||i(p.id)},children:[a.jsx(Bn,{size:14})," Chat"]}),zC(p)&&a.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",onClick:()=>{qe(p.id)},children:[a.jsx(Gn,{size:14})," Artifact"]}),a.jsx("button",{type:"button",className:"mobile-btn mobile-btn-danger",onClick:()=>{p&&D(p.id)},children:a.jsx($i,{size:14})})]}),children:p&&a.jsxs("div",{className:"mobile-task-detail",children:[a.jsxs("div",{className:"mobile-task-detail-header",children:[a.jsx("span",{className:`mobile-task-status-badge status-${p.status}`,children:dl[p.status]||p.status}),a.jsx("span",{className:`mobile-task-priority priority-${p.priority}`,children:p.priority})]}),a.jsx("h3",{className:"mobile-task-detail-title",children:p.title}),p.description&&a.jsx("p",{className:"mobile-task-detail-desc",children:p.description}),a.jsxs("div",{className:"mobile-task-detail-meta",children:[p.assignee&&a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Assignee"}),a.jsxs("span",{children:["@",p.assignee]})]}),p.dueDate&&a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Due"}),a.jsx("span",{children:new Date(p.dueDate).toLocaleDateString()})]}),p.timeSpent!=null&&a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Time spent"}),a.jsxs("span",{children:[Math.round(p.timeSpent/6e4),"min"]})]}),(fe=p.dependencies)!=null&&fe.length?a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Dependencies"}),a.jsx("span",{children:p.dependencies.length})]}):null,(Ye=p.comments)!=null&&Ye.length?a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Comments"}),a.jsx("span",{children:p.comments.length})]}):null,a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Created"}),a.jsx("span",{children:jr(p.createdAt)})]}),a.jsxs("div",{className:"mobile-task-detail-row",children:[a.jsx("span",{children:"Updated"}),a.jsx("span",{children:jr(p.updatedAt)})]})]})]})}),a.jsx(PC,{open:S,onClose:()=>y(!1),onCreate:ye,agents:E}),a.jsx(_t,{open:!!g,onClose:()=>{v(null),P(""),T(null)},title:(M==null?void 0:M.name)||"Artifact",actions:C.length>1?a.jsx("div",{className:"mobile-task-detail-actions",children:C.map((B,ie)=>a.jsxs("button",{type:"button",className:"mobile-btn mobile-btn-secondary",style:{flex:1},onClick:()=>{j(!0),Promise.all([Q.get(`/artifacts/${encodeURIComponent(B)}`),fetch(Q.urlWithToken(`/artifacts/${encodeURIComponent(B)}/content`)).then(re=>re.text())]).then(([re,be])=>{T(re),P(be),j(!1)}).catch(()=>j(!1))},children:["Artifact ",ie+1]},B))}):null,children:a.jsx("div",{className:"mobile-artifact-viewer",children:k?a.jsx("div",{className:"mobile-loading",children:a.jsx("p",{children:"Loading artifact…"})}):N?a.jsx("iframe",{srcDoc:N,className:"mobile-artifact-iframe",sandbox:"allow-scripts allow-forms allow-popups allow-same-origin",title:(M==null?void 0:M.name)||"Artifact",loading:"lazy"}):a.jsxs("div",{className:"mobile-empty",children:[a.jsx(Gn,{size:32}),a.jsx("p",{className:"muted",children:"No artifact content available."})]})})})]})}function IC(e){var t,n;return((n=(t=e.settings)==null?void 0:t.data)==null?void 0:n.defaultAgent)||"odin"}function PC({open:e,onClose:t,onCreate:n,agents:r}){const[i,l]=b.useState(""),[s,o]=b.useState(""),[u,d]=b.useState(""),[c,f]=b.useState("normal"),h=m=>{m.preventDefault(),i.trim()&&(n(i.trim(),s.trim(),u,c),l(""),o(""),d(""),f("normal"))};return a.jsx(Tn,{open:e,onClose:t,title:"New Task",actions:a.jsxs("button",{type:"submit",form:"new-task-form",className:"mobile-btn",style:{width:"100%"},children:[a.jsx(yt,{size:14})," Create Task"]}),children:a.jsxs("form",{id:"new-task-form",onSubmit:h,className:"mobile-task-form",children:[a.jsx("label",{className:"mobile-field-label",children:"Title *"}),a.jsx("input",{className:"mobile-input",type:"text",placeholder:"Task title",value:i,onChange:m=>l(m.target.value),autoFocus:!0,required:!0}),a.jsx("label",{className:"mobile-field-label",children:"Description"}),a.jsx("textarea",{className:"mobile-input",rows:3,placeholder:"Optional description",value:s,onChange:m=>o(m.target.value)}),a.jsx("label",{className:"mobile-field-label",children:"Assignee"}),a.jsxs("select",{className:"mobile-input",value:u,onChange:m=>d(m.target.value),children:[a.jsx("option",{value:"",children:"Unassigned"}),r.map(m=>a.jsxs("option",{value:m.name,children:["@",m.name]},m.name))]}),a.jsx("label",{className:"mobile-field-label",children:"Priority"}),a.jsxs("select",{className:"mobile-input",value:c,onChange:m=>f(m.target.value),children:[a.jsx("option",{value:"low",children:"Low"}),a.jsx("option",{value:"normal",children:"Normal"}),a.jsx("option",{value:"high",children:"High"})]})]})})}const AC=[{id:"activity",label:"Activity",icon:ma},{id:"chat",label:"Chat",icon:Bn},{id:"tasks",label:"Tasks",icon:es},{id:"settings",label:"Settings",icon:Dm},{id:"more",label:"More",icon:Y1}];function MC(e){const t=e.meta??{},n=typeof t.taskId=="string"?t.taskId:null,r=typeof t.slug=="string"?t.slug:null,i=typeof t.agent=="string"?t.agent:null;if(n)return{id:"task-detail",taskId:n};if(r)return{id:"artifacts?-detail",slug:r};if(i)return{id:"agent-detail",name:i};const l=e.link??"";return l.startsWith("/artifacts?/")?{id:"artifacts?-detail",slug:decodeURIComponent(l.slice(12))}:l.startsWith("/tasks/")?{id:"task-detail",taskId:decodeURIComponent(l.slice(7))}:l.startsWith("/agents/")?{id:"agent-detail",name:decodeURIComponent(l.slice(8))}:null}function HC(){const[e,t]=b.useState("activity"),[n,r]=b.useState([]),[i,l]=b.useState(!1),[s,o]=b.useState(null),[u,d]=b.useState(null),[c,f]=b.useState(null),[h,m]=b.useState(null),[p,x]=b.useState(!0),[S,y]=b.useState(0),g=b.useMemo(()=>n[n.length-1]??{id:e},[e,n]),v=b.useCallback(k=>{r(j=>[...j,k])},[]),C=b.useCallback(()=>{r(k=>k.slice(0,-1))},[]),z=b.useCallback(k=>{r([]),t(k)},[]),N=b.useCallback(async()=>{var k;try{const j=await Q.get("/snapshot");d(j),(k=j.settings)!=null&&k.data&&f(j.settings.data),m(null)}catch(j){throw m(j.message||"Dashboard server unreachable."),j}},[]);b.useEffect(()=>{let k=!1;return Promise.all([Q.get("/snapshot").catch(()=>null),Q.get("/settings").catch(()=>null),Q.probeAuthStatus().catch(()=>null)]).then(([j,I])=>{var H;if(k)return;const $=(I==null?void 0:I.data)??((H=j==null?void 0:j.settings)==null?void 0:H.data)??null;j&&d(j),$&&f($),m(!j&&!$?"Dashboard server unreachable.":null)}).catch(j=>{k||m(j.message||"Dashboard server unreachable.")}).finally(()=>{k||x(!1)}),()=>{k=!0}},[]),b.useEffect(()=>{c!=null&&c.theme&&(ns(c.theme),fi(c.theme))},[c==null?void 0:c.theme]),b.useEffect(()=>{var I;if(((I=c==null?void 0:c.theme)==null?void 0:I.mode)!=="system")return;const k=window.matchMedia("(prefers-color-scheme: light)"),j=()=>{c!=null&&c.theme&&(ns(c.theme),fi(c.theme))};return k.addEventListener("change",j),()=>k.removeEventListener("change",j)},[c==null?void 0:c.theme]),b.useEffect(()=>{const k=()=>{y(I=>I+1),N().catch(()=>{})},j=()=>{document.visibilityState==="visible"&&k()};return window.addEventListener("online",k),window.addEventListener("pageshow",k),document.addEventListener("visibilitychange",j),()=>{window.removeEventListener("online",k),window.removeEventListener("pageshow",k),document.removeEventListener("visibilitychange",j)}},[N]),b.useEffect(()=>{const k=new Fm,j=k.on(I=>{if(I.type==="snapshot"&&"data"in I&&I.data)d($=>({...$??{},...I.data}));else if(I.type==="change")N().catch(()=>{});else if(I.type==="tasks:change"){const $=I.task;d(H=>{if(!H)return H;const L=(H.tasks||[]).map(J=>J.id===$.id?$:J),te=L.some(J=>J.id===$.id);return{...H,tasks:te?L:[$,...L]}})}else I.type==="tasks:delete"?d($=>$&&{...$,tasks:($.tasks||[]).filter(H=>H.id!==I.id)}):I.type==="settings:change"?I.settings&&f(I.settings):I.type==="project:change"||I.type==="agents:change"||I.type==="schedules:change"||I.type==="artifact:change"?N().catch(()=>{}):(I.type==="agent:status"||I.type==="agent:restarted")&&d($=>{if(!$)return $;const H=($.agents||[]).map(L=>L.name===I.agent.name?I.agent:L);return{...$,agents:H}})});return()=>{j(),k.close()}},[N,S]);const P=b.useCallback(k=>{(k==="activity"||k==="chat"||k==="tasks"||k==="settings"||k==="more")&&z(k)},[z]),M=b.useCallback((k,j,I)=>{if(k==="notification"){const $=MC({link:j||null,meta:I??null});$&&v($);return}if(k==="task"&&j){v({id:"task-detail",taskId:j});return}if(k==="artifacts?"&&j){v({id:"artifacts?-detail",slug:j});return}if(k==="agent"&&j){v({id:"agent-detail",name:j});return}if(k==="project"){z("activity");return}k==="setting"&&z("settings")},[z,v]),T=()=>{if(!u||!c)return null;if(n.length>0){const k=n[n.length-1];switch(k.id){case"artifacts?":return a.jsx(oC,{snapshot:u,onBack:C,onOpenArtifact:j=>v({id:"artifacts?-detail",slug:j})});case"agents":return a.jsx(df,{snapshot:u,onBack:C,onOpenAgent:j=>v({id:"agent-detail",name:j}),onRefresh:N});case"skills":return a.jsx(NC,{snapshot:u,onBack:C});case"mods":return a.jsx(tC,{snapshot:u,onBack:C});case"schedules":return a.jsx(fC,{snapshot:u,onBack:C});case"history":return a.jsx(eC,{onBack:C});case"config":return a.jsx(J2,{onBack:C});case"artifacts?-detail":return a.jsx(iC,{slug:k.slug,onBack:C});case"agent-detail":return a.jsx(df,{snapshot:u,onBack:C,onOpenAgent:()=>{},onRefresh:N,selectedAgent:k.name});case"task-detail":return a.jsx(yf,{snapshot:u,onRefresh:N,selectedTaskId:k.taskId,onCloseDetail:C,onOpenChat:j=>{o(j),z("chat")}});default:return null}}switch(e){case"activity":return a.jsx(Q2,{snapshot:u,onRefresh:N});case"chat":return a.jsx(Z2,{snapshot:u,settings:c,initialTaskId:s,onClearTaskId:()=>o(null)});case"tasks":return a.jsx(yf,{snapshot:u,onRefresh:N,onOpenChat:k=>{o(k),z("chat")}});case"settings":return a.jsx(CC,{settings:c,snapshot:u,onRefresh:N});case"more":return a.jsx(nC,{snapshot:u,onNavigate:k=>{(k==="artifacts?"||k==="agents"||k==="skills"||k==="mods"||k==="schedules"||k==="history"||k==="config")&&v({id:k})}});default:return null}};return p?a.jsxs("div",{className:"mobile-loading",children:[a.jsx($m,{size:"lg"}),a.jsx("p",{children:"Loading Bizar…"})]}):h||!u||!c?a.jsxs("div",{className:"mobile-loading",children:[a.jsx("h2",{children:"Dashboard unavailable"}),a.jsx("p",{children:h||"Dashboard server unreachable."}),a.jsx("p",{className:"muted",children:"Make sure the Bizar dashboard server is running."})]}):a.jsxs("div",{className:"mobile-app",children:[a.jsx(V2,{activeTab:g.id,snapshot:u,onSearch:()=>l(!0),onNavigate:M}),a.jsx("main",{className:"mobile-content",children:T()}),n.length===0&&a.jsx(F2,{tabs:AC,activeTab:e,onChange:P}),n.length>0&&a.jsx("button",{type:"button",className:"mobile-back-btn",onClick:C,"aria-label":"Go back",children:"← Back"}),a.jsx(kC,{open:i,onClose:()=>l(!1),onNavigate:M})]})}export{hx as $,ma as A,Or as B,U1 as C,ax as D,Cx as E,Nu as F,E2 as G,ga as H,G1 as I,z2 as J,Sx as K,k2 as L,Bn as M,Lm as N,RC as O,yt as P,Zl as Q,Ot as R,es as S,ux as T,Am as U,ix as V,od as W,tr as X,lb as Y,x2 as Z,F1 as _,Q as a,OC as a0,dx as a1,ld as a2,Gn as a3,ex as a4,_C as a5,DC as a6,fi as a7,rx as a8,J1 as a9,ox as aa,Z1 as ab,Q1 as ac,ns as ad,Fm as ae,sx as af,rg as ag,nx as ah,$1 as ai,N2 as aj,W1 as ak,$C as al,FC as am,R1 as an,HC as ao,Cs as b,X as c,id as d,Jl as e,pa as f,Mr as g,sd as h,Eu as i,a as j,ts as k,yx as l,rd as m,H1 as n,jr as o,$m as p,Rm as q,b as r,cx as s,$i as t,px as u,Mm as v,Im as w,q1 as x,S2 as y,lx as z};
354
+ //# sourceMappingURL=mobile-CaZ0gEeJ.js.map