@idl3/claude-control 0.1.13 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/answer.js +64 -33
- package/lib/sessions.js +45 -2
- package/lib/tmux.js +5 -5
- package/lib/transcript.js +33 -4
- package/lib/tui.js +11 -4
- package/package.json +1 -1
- package/server.js +107 -3
- package/web/dist/apple-touch-icon.png +0 -0
- package/web/dist/assets/{core-BtNQjjpA.js → core-BP70UsO-.js} +1 -1
- package/web/dist/assets/index-D2hrAUsb.js +78 -0
- package/web/dist/assets/index-DM_QgpOD.css +1 -0
- package/web/dist/icon-192.png +0 -0
- package/web/dist/icon-512.png +0 -0
- package/web/dist/icon.svg +12 -0
- package/web/dist/index.html +3 -3
- package/web/dist/manifest.webmanifest +2 -2
- package/web/dist/assets/index-BaAkOPA8.css +0 -1
- package/web/dist/assets/index-DRMuP6dA.js +0 -77
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
var Zw=Object.defineProperty;var eS=(e,t,n)=>t in e?Zw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _=(e,t,n)=>eS(e,typeof t!="symbol"?t+"":t,n);function tS(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(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 s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var So=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ys(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zp={exports:{}},la={},em={exports:{}},ne={};/**
|
|
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 vs=Symbol.for("react.element"),nS=Symbol.for("react.portal"),rS=Symbol.for("react.fragment"),iS=Symbol.for("react.strict_mode"),sS=Symbol.for("react.profiler"),oS=Symbol.for("react.provider"),aS=Symbol.for("react.context"),lS=Symbol.for("react.forward_ref"),uS=Symbol.for("react.suspense"),cS=Symbol.for("react.memo"),dS=Symbol.for("react.lazy"),Fd=Symbol.iterator;function fS(e){return e===null||typeof e!="object"?null:(e=Fd&&e[Fd]||e["@@iterator"],typeof e=="function"?e:null)}var tm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nm=Object.assign,rm={};function si(e,t,n){this.props=e,this.context=t,this.refs=rm,this.updater=n||tm}si.prototype.isReactComponent={};si.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")};si.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function im(){}im.prototype=si.prototype;function Xu(e,t,n){this.props=e,this.context=t,this.refs=rm,this.updater=n||tm}var Zu=Xu.prototype=new im;Zu.constructor=Xu;nm(Zu,si.prototype);Zu.isPureReactComponent=!0;var Bd=Array.isArray,sm=Object.prototype.hasOwnProperty,ec={current:null},om={key:!0,ref:!0,__self:!0,__source:!0};function am(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)sm.call(t,r)&&!om.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:vs,type:e,key:s,ref:o,props:i,_owner:ec.current}}function hS(e,t){return{$$typeof:vs,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function tc(e){return typeof e=="object"&&e!==null&&e.$$typeof===vs}function pS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ud=/\/+/g;function La(e,t){return typeof e=="object"&&e!==null&&e.key!=null?pS(""+e.key):t.toString(36)}function ro(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case vs:case nS:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+La(o,0):r,Bd(i)?(n="",e!=null&&(n=e.replace(Ud,"$&/")+"/"),ro(i,t,n,"",function(u){return u})):i!=null&&(tc(i)&&(i=hS(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Ud,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",Bd(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+La(s,a);o+=ro(s,t,n,l,i)}else if(l=fS(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+La(s,a++),o+=ro(s,t,n,l,i);else if(s==="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 o}function Ps(e,t,n){if(e==null)return e;var r=[],i=0;return ro(e,r,"","",function(s){return t.call(n,s,i++)}),r}function mS(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 Ye={current:null},io={transition:null},gS={ReactCurrentDispatcher:Ye,ReactCurrentBatchConfig:io,ReactCurrentOwner:ec};function lm(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:Ps,forEach:function(e,t,n){Ps(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ps(e,function(){t++}),t},toArray:function(e){return Ps(e,function(t){return t})||[]},only:function(e){if(!tc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=si;ne.Fragment=rS;ne.Profiler=sS;ne.PureComponent=Xu;ne.StrictMode=iS;ne.Suspense=uS;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gS;ne.act=lm;ne.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=nm({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=ec.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)sm.call(t,l)&&!om.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:vs,type:e.type,key:i,ref:s,props:r,_owner:o}};ne.createContext=function(e){return e={$$typeof:aS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:oS,_context:e},e.Consumer=e};ne.createElement=am;ne.createFactory=function(e){var t=am.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:lS,render:e}};ne.isValidElement=tc;ne.lazy=function(e){return{$$typeof:dS,_payload:{_status:-1,_result:e},_init:mS}};ne.memo=function(e,t){return{$$typeof:cS,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=io.transition;io.transition={};try{e()}finally{io.transition=t}};ne.unstable_act=lm;ne.useCallback=function(e,t){return Ye.current.useCallback(e,t)};ne.useContext=function(e){return Ye.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return Ye.current.useDeferredValue(e)};ne.useEffect=function(e,t){return Ye.current.useEffect(e,t)};ne.useId=function(){return Ye.current.useId()};ne.useImperativeHandle=function(e,t,n){return Ye.current.useImperativeHandle(e,t,n)};ne.useInsertionEffect=function(e,t){return Ye.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return Ye.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return Ye.current.useMemo(e,t)};ne.useReducer=function(e,t,n){return Ye.current.useReducer(e,t,n)};ne.useRef=function(e){return Ye.current.useRef(e)};ne.useState=function(e){return Ye.current.useState(e)};ne.useSyncExternalStore=function(e,t,n){return Ye.current.useSyncExternalStore(e,t,n)};ne.useTransition=function(){return Ye.current.useTransition()};ne.version="18.3.1";em.exports=ne;var g=em.exports;const rt=ys(g),yS=tS({__proto__:null,default:rt},[g]);/**
|
|
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 vS=g,xS=Symbol.for("react.element"),wS=Symbol.for("react.fragment"),SS=Object.prototype.hasOwnProperty,bS=vS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,kS={key:!0,ref:!0,__self:!0,__source:!0};function um(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)SS.call(t,r)&&!kS.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:xS,type:e,key:s,ref:o,props:i,_owner:bS.current}}la.Fragment=wS;la.jsx=um;la.jsxs=um;Zp.exports=la;var p=Zp.exports,cm={exports:{}},vt={},dm={exports:{}},fm={};/**
|
|
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(P,A){var S=P.length;P.push(A);e:for(;0<S;){var V=S-1>>>1,q=P[V];if(0<i(q,A))P[V]=A,P[S]=q,S=V;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var A=P[0],S=P.pop();if(S!==A){P[0]=S;e:for(var V=0,q=P.length,b=q>>>1;V<b;){var Se=2*(V+1)-1,Xe=P[Se],ce=Se+1,Ze=P[ce];if(0>i(Xe,S))ce<q&&0>i(Ze,Xe)?(P[V]=Ze,P[ce]=S,V=ce):(P[V]=Xe,P[Se]=S,V=Se);else if(ce<q&&0>i(Ze,S))P[V]=Ze,P[ce]=S,V=ce;else break e}}return A}function i(P,A){var S=P.sortIndex-A.sortIndex;return S!==0?S:P.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,c=null,f=3,h=!1,m=!1,x=!1,E=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(P){for(var A=n(u);A!==null;){if(A.callback===null)r(u);else if(A.startTime<=P)r(u),A.sortIndex=A.expirationTime,t(l,A);else break;A=n(u)}}function C(P){if(x=!1,w(P),!m)if(n(l)!==null)m=!0,W(I);else{var A=n(u);A!==null&&Z(C,A.startTime-P)}}function I(P,A){m=!1,x&&(x=!1,y(D),D=-1),h=!0;var S=f;try{for(w(A),c=n(l);c!==null&&(!(c.expirationTime>A)||P&&!L());){var V=c.callback;if(typeof V=="function"){c.callback=null,f=c.priorityLevel;var q=V(c.expirationTime<=A);A=e.unstable_now(),typeof q=="function"?c.callback=q:c===n(l)&&r(l),w(A)}else r(l);c=n(l)}if(c!==null)var b=!0;else{var Se=n(u);Se!==null&&Z(C,Se.startTime-A),b=!1}return b}finally{c=null,f=S,h=!1}}var k=!1,M=null,D=-1,$=5,T=-1;function L(){return!(e.unstable_now()-T<$)}function z(){if(M!==null){var P=e.unstable_now();T=P;var A=!0;try{A=M(!0,P)}finally{A?Q():(k=!1,M=null)}}else k=!1}var Q;if(typeof v=="function")Q=function(){v(z)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,Y=ae.port2;ae.port1.onmessage=z,Q=function(){Y.postMessage(null)}}else Q=function(){E(z,0)};function W(P){M=P,k||(k=!0,Q())}function Z(P,A){D=E(function(){P(e.unstable_now())},A)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_continueExecution=function(){m||h||(m=!0,W(I))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(P){switch(f){case 1:case 2:case 3:var A=3;break;default:A=f}var S=f;f=A;try{return P()}finally{f=S}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,A){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var S=f;f=P;try{return A()}finally{f=S}},e.unstable_scheduleCallback=function(P,A,S){var V=e.unstable_now();switch(typeof S=="object"&&S!==null?(S=S.delay,S=typeof S=="number"&&0<S?V+S:V):S=V,P){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=S+q,P={id:d++,callback:A,priorityLevel:P,startTime:S,expirationTime:q,sortIndex:-1},S>V?(P.sortIndex=S,t(u,P),n(l)===null&&P===n(u)&&(x?(y(D),D=-1):x=!0,Z(C,S-V))):(P.sortIndex=q,t(l,P),m||h||(m=!0,W(I))),P},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(P){var A=f;return function(){var S=f;f=A;try{return P.apply(this,arguments)}finally{f=S}}}})(fm);dm.exports=fm;var _S=dm.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 CS=g,gt=_S;function N(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 hm=new Set,Qi={};function pr(e,t){qr(e,t),qr(e+"Capture",t)}function qr(e,t){for(Qi[e]=t,e=0;e<t.length;e++)hm.add(t[e])}var cn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jl=Object.prototype.hasOwnProperty,ES=/^[: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]*$/,$d={},Vd={};function TS(e){return jl.call(Vd,e)?!0:jl.call($d,e)?!1:ES.test(e)?Vd[e]=!0:($d[e]=!0,!1)}function IS(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 RS(e,t,n,r){if(t===null||typeof t>"u"||IS(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,s,o){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=s,this.removeEmptyString=o}var ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ze[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];ze[t]=new Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ze[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ze[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){ze[e]=new Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ze[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ze[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ze[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ze[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var nc=/[\-:]([a-z])/g;function rc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(nc,rc);ze[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(nc,rc);ze[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(nc,rc);ze[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ze[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});ze.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ze[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function ic(e,t,n,r){var i=ze.hasOwnProperty(t)?ze[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(RS(t,n,i,r)&&(n=null),r||i===null?TS(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 pn=CS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,As=Symbol.for("react.element"),Er=Symbol.for("react.portal"),Tr=Symbol.for("react.fragment"),sc=Symbol.for("react.strict_mode"),Dl=Symbol.for("react.profiler"),pm=Symbol.for("react.provider"),mm=Symbol.for("react.context"),oc=Symbol.for("react.forward_ref"),Ol=Symbol.for("react.suspense"),Ll=Symbol.for("react.suspense_list"),ac=Symbol.for("react.memo"),Sn=Symbol.for("react.lazy"),gm=Symbol.for("react.offscreen"),Hd=Symbol.iterator;function gi(e){return e===null||typeof e!="object"?null:(e=Hd&&e[Hd]||e["@@iterator"],typeof e=="function"?e:null)}var we=Object.assign,za;function Ti(e){if(za===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);za=t&&t[1]||""}return`
|
|
34
|
-
`+za+e}var Fa=!1;function Ba(e,t){if(!e||Fa)return"";Fa=!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(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
35
|
-
`),s=r.stack.split(`
|
|
36
|
-
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
|
|
37
|
-
`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Fa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ti(e):""}function PS(e){switch(e.tag){case 5:return Ti(e.type);case 16:return Ti("Lazy");case 13:return Ti("Suspense");case 19:return Ti("SuspenseList");case 0:case 2:case 15:return e=Ba(e.type,!1),e;case 11:return e=Ba(e.type.render,!1),e;case 1:return e=Ba(e.type,!0),e;default:return""}}function zl(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 Tr:return"Fragment";case Er:return"Portal";case Dl:return"Profiler";case sc:return"StrictMode";case Ol:return"Suspense";case Ll:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case mm:return(e.displayName||"Context")+".Consumer";case pm:return(e._context.displayName||"Context")+".Provider";case oc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ac:return t=e.displayName||null,t!==null?t:zl(e.type)||"Memo";case Sn:t=e._payload,e=e._init;try{return zl(e(t))}catch{}}return null}function AS(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 zl(t);case 8:return t===sc?"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 Ln(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ym(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function MS(e){var t=ym(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,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ms(e){e._valueTracker||(e._valueTracker=MS(e))}function vm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ym(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function bo(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 Fl(e,t){var n=t.checked;return we({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Wd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ln(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function xm(e,t){t=t.checked,t!=null&&ic(e,"checked",t,!1)}function Bl(e,t){xm(e,t);var n=Ln(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")?Ul(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ul(e,t.type,Ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function qd(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 Ul(e,t,n){(t!=="number"||bo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ii=Array.isArray;function zr(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=""+Ln(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 $l(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(N(91));return we({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Kd(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(N(92));if(Ii(n)){if(1<n.length)throw Error(N(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ln(n)}}function wm(e,t){var n=Ln(t.value),r=Ln(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 Qd(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Sm(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 Vl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Sm(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ns,bm=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(Ns=Ns||document.createElement("div"),Ns.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ns.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Gi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ai={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},NS=["Webkit","ms","Moz","O"];Object.keys(Ai).forEach(function(e){NS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ai[t]=Ai[e]})});function km(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ai.hasOwnProperty(e)&&Ai[e]?(""+t).trim():t+"px"}function _m(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=km(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var jS=we({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 Hl(e,t){if(t){if(jS[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function Wl(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 ql=null;function lc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kl=null,Fr=null,Br=null;function Gd(e){if(e=Ss(e)){if(typeof Kl!="function")throw Error(N(280));var t=e.stateNode;t&&(t=ha(t),Kl(e.stateNode,e.type,t))}}function Cm(e){Fr?Br?Br.push(e):Br=[e]:Fr=e}function Em(){if(Fr){var e=Fr,t=Br;if(Br=Fr=null,Gd(e),t)for(e=0;e<t.length;e++)Gd(t[e])}}function Tm(e,t){return e(t)}function Im(){}var Ua=!1;function Rm(e,t,n){if(Ua)return e(t,n);Ua=!0;try{return Tm(e,t,n)}finally{Ua=!1,(Fr!==null||Br!==null)&&(Im(),Em())}}function Yi(e,t){var n=e.stateNode;if(n===null)return null;var r=ha(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(N(231,t,typeof n));return n}var Ql=!1;if(cn)try{var yi={};Object.defineProperty(yi,"passive",{get:function(){Ql=!0}}),window.addEventListener("test",yi,yi),window.removeEventListener("test",yi,yi)}catch{Ql=!1}function DS(e,t,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Mi=!1,ko=null,_o=!1,Gl=null,OS={onError:function(e){Mi=!0,ko=e}};function LS(e,t,n,r,i,s,o,a,l){Mi=!1,ko=null,DS.apply(OS,arguments)}function zS(e,t,n,r,i,s,o,a,l){if(LS.apply(this,arguments),Mi){if(Mi){var u=ko;Mi=!1,ko=null}else throw Error(N(198));_o||(_o=!0,Gl=u)}}function mr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Pm(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Yd(e){if(mr(e)!==e)throw Error(N(188))}function FS(e){var t=e.alternate;if(!t){if(t=mr(e),t===null)throw Error(N(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Yd(i),e;if(s===r)return Yd(i),t;s=s.sibling}throw Error(N(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(N(189))}}if(n.alternate!==r)throw Error(N(190))}if(n.tag!==3)throw Error(N(188));return n.stateNode.current===n?e:t}function Am(e){return e=FS(e),e!==null?Mm(e):null}function Mm(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Mm(e);if(t!==null)return t;e=e.sibling}return null}var Nm=gt.unstable_scheduleCallback,Jd=gt.unstable_cancelCallback,BS=gt.unstable_shouldYield,US=gt.unstable_requestPaint,_e=gt.unstable_now,$S=gt.unstable_getCurrentPriorityLevel,uc=gt.unstable_ImmediatePriority,jm=gt.unstable_UserBlockingPriority,Co=gt.unstable_NormalPriority,VS=gt.unstable_LowPriority,Dm=gt.unstable_IdlePriority,ua=null,Gt=null;function HS(e){if(Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(ua,e,void 0,(e.current.flags&128)===128)}catch{}}var Lt=Math.clz32?Math.clz32:KS,WS=Math.log,qS=Math.LN2;function KS(e){return e>>>=0,e===0?32:31-(WS(e)/qS|0)|0}var js=64,Ds=4194304;function Ri(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 Eo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Ri(a):(s&=o,s!==0&&(r=Ri(s)))}else o=n&~i,o!==0?r=Ri(o):s!==0&&(r=Ri(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&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-Lt(t),i=1<<n,r|=e[n],t&=~i;return r}function QS(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 GS(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Lt(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=QS(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Yl(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Om(){var e=js;return js<<=1,!(js&4194240)&&(js=64),e}function $a(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xs(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lt(t),e[t]=n}function YS(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-Lt(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function cc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Lt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ue=0;function Lm(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zm,dc,Fm,Bm,Um,Jl=!1,Os=[],In=null,Rn=null,Pn=null,Ji=new Map,Xi=new Map,_n=[],JS="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 Xd(e,t){switch(e){case"focusin":case"focusout":In=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Pn=null;break;case"pointerover":case"pointerout":Ji.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xi.delete(t.pointerId)}}function vi(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Ss(t),t!==null&&dc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function XS(e,t,n,r,i){switch(t){case"focusin":return In=vi(In,e,t,n,r,i),!0;case"dragenter":return Rn=vi(Rn,e,t,n,r,i),!0;case"mouseover":return Pn=vi(Pn,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Ji.set(s,vi(Ji.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Xi.set(s,vi(Xi.get(s)||null,e,t,n,r,i)),!0}return!1}function $m(e){var t=Zn(e.target);if(t!==null){var n=mr(t);if(n!==null){if(t=n.tag,t===13){if(t=Pm(n),t!==null){e.blockedOn=t,Um(e.priority,function(){Fm(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 so(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ql=r,n.target.dispatchEvent(r),ql=null}else return t=Ss(n),t!==null&&dc(t),e.blockedOn=n,!1;t.shift()}return!0}function Zd(e,t,n){so(e)&&n.delete(t)}function ZS(){Jl=!1,In!==null&&so(In)&&(In=null),Rn!==null&&so(Rn)&&(Rn=null),Pn!==null&&so(Pn)&&(Pn=null),Ji.forEach(Zd),Xi.forEach(Zd)}function xi(e,t){e.blockedOn===t&&(e.blockedOn=null,Jl||(Jl=!0,gt.unstable_scheduleCallback(gt.unstable_NormalPriority,ZS)))}function Zi(e){function t(i){return xi(i,e)}if(0<Os.length){xi(Os[0],e);for(var n=1;n<Os.length;n++){var r=Os[n];r.blockedOn===e&&(r.blockedOn=null)}}for(In!==null&&xi(In,e),Rn!==null&&xi(Rn,e),Pn!==null&&xi(Pn,e),Ji.forEach(t),Xi.forEach(t),n=0;n<_n.length;n++)r=_n[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<_n.length&&(n=_n[0],n.blockedOn===null);)$m(n),n.blockedOn===null&&_n.shift()}var Ur=pn.ReactCurrentBatchConfig,To=!0;function eb(e,t,n,r){var i=ue,s=Ur.transition;Ur.transition=null;try{ue=1,fc(e,t,n,r)}finally{ue=i,Ur.transition=s}}function tb(e,t,n,r){var i=ue,s=Ur.transition;Ur.transition=null;try{ue=4,fc(e,t,n,r)}finally{ue=i,Ur.transition=s}}function fc(e,t,n,r){if(To){var i=Xl(e,t,n,r);if(i===null)Xa(e,t,r,Io,n),Xd(e,r);else if(XS(i,e,t,n,r))r.stopPropagation();else if(Xd(e,r),t&4&&-1<JS.indexOf(e)){for(;i!==null;){var s=Ss(i);if(s!==null&&zm(s),s=Xl(e,t,n,r),s===null&&Xa(e,t,r,Io,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Xa(e,t,r,null,n)}}var Io=null;function Xl(e,t,n,r){if(Io=null,e=lc(r),e=Zn(e),e!==null)if(t=mr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Pm(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Io=e,null}function Vm(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($S()){case uc:return 1;case jm:return 4;case Co:case VS:return 16;case Dm:return 536870912;default:return 16}default:return 16}}var En=null,hc=null,oo=null;function Hm(){if(oo)return oo;var e,t=hc,n=t.length,r,i="value"in En?En.value:En.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return oo=i.slice(e,1<r?1-r:void 0)}function ao(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 Ls(){return!0}function ef(){return!1}function xt(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Ls:ef,this.isPropagationStopped=ef,this}return we(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=Ls)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ls)},persist:function(){},isPersistent:Ls}),t}var oi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pc=xt(oi),ws=we({},oi,{view:0,detail:0}),nb=xt(ws),Va,Ha,wi,ca=we({},ws,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mc,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!==wi&&(wi&&e.type==="mousemove"?(Va=e.screenX-wi.screenX,Ha=e.screenY-wi.screenY):Ha=Va=0,wi=e),Va)},movementY:function(e){return"movementY"in e?e.movementY:Ha}}),tf=xt(ca),rb=we({},ca,{dataTransfer:0}),ib=xt(rb),sb=we({},ws,{relatedTarget:0}),Wa=xt(sb),ob=we({},oi,{animationName:0,elapsedTime:0,pseudoElement:0}),ab=xt(ob),lb=we({},oi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ub=xt(lb),cb=we({},oi,{data:0}),nf=xt(cb),db={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fb={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"},hb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hb[e])?!!t[e]:!1}function mc(){return pb}var mb=we({},ws,{key:function(e){if(e.key){var t=db[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ao(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mc,charCode:function(e){return e.type==="keypress"?ao(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ao(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gb=xt(mb),yb=we({},ca,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rf=xt(yb),vb=we({},ws,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mc}),xb=xt(vb),wb=we({},oi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sb=xt(wb),bb=we({},ca,{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}),kb=xt(bb),_b=[9,13,27,32],gc=cn&&"CompositionEvent"in window,Ni=null;cn&&"documentMode"in document&&(Ni=document.documentMode);var Cb=cn&&"TextEvent"in window&&!Ni,Wm=cn&&(!gc||Ni&&8<Ni&&11>=Ni),sf=" ",of=!1;function qm(e,t){switch(e){case"keyup":return _b.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Km(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ir=!1;function Eb(e,t){switch(e){case"compositionend":return Km(t);case"keypress":return t.which!==32?null:(of=!0,sf);case"textInput":return e=t.data,e===sf&&of?null:e;default:return null}}function Tb(e,t){if(Ir)return e==="compositionend"||!gc&&qm(e,t)?(e=Hm(),oo=hc=En=null,Ir=!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 Wm&&t.locale!=="ko"?null:t.data;default:return null}}var Ib={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 af(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ib[e.type]:t==="textarea"}function Qm(e,t,n,r){Cm(r),t=Ro(t,"onChange"),0<t.length&&(n=new pc("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ji=null,es=null;function Rb(e){sg(e,0)}function da(e){var t=Ar(e);if(vm(t))return e}function Pb(e,t){if(e==="change")return t}var Gm=!1;if(cn){var qa;if(cn){var Ka="oninput"in document;if(!Ka){var lf=document.createElement("div");lf.setAttribute("oninput","return;"),Ka=typeof lf.oninput=="function"}qa=Ka}else qa=!1;Gm=qa&&(!document.documentMode||9<document.documentMode)}function uf(){ji&&(ji.detachEvent("onpropertychange",Ym),es=ji=null)}function Ym(e){if(e.propertyName==="value"&&da(es)){var t=[];Qm(t,es,e,lc(e)),Rm(Rb,t)}}function Ab(e,t,n){e==="focusin"?(uf(),ji=t,es=n,ji.attachEvent("onpropertychange",Ym)):e==="focusout"&&uf()}function Mb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return da(es)}function Nb(e,t){if(e==="click")return da(t)}function jb(e,t){if(e==="input"||e==="change")return da(t)}function Db(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bt=typeof Object.is=="function"?Object.is:Db;function ts(e,t){if(Bt(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(!jl.call(t,i)||!Bt(e[i],t[i]))return!1}return!0}function cf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function df(e,t){var n=cf(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=cf(n)}}function Jm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xm(){for(var e=window,t=bo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=bo(e.document)}return t}function yc(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 Ob(e){var t=Xm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Jm(n.ownerDocument.documentElement,n)){if(r!==null&&yc(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,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=df(n,s);var o=df(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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 Lb=cn&&"documentMode"in document&&11>=document.documentMode,Rr=null,Zl=null,Di=null,eu=!1;function ff(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;eu||Rr==null||Rr!==bo(r)||(r=Rr,"selectionStart"in r&&yc(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}),Di&&ts(Di,r)||(Di=r,r=Ro(Zl,"onSelect"),0<r.length&&(t=new pc("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Rr)))}function zs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Pr={animationend:zs("Animation","AnimationEnd"),animationiteration:zs("Animation","AnimationIteration"),animationstart:zs("Animation","AnimationStart"),transitionend:zs("Transition","TransitionEnd")},Qa={},Zm={};cn&&(Zm=document.createElement("div").style,"AnimationEvent"in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),"TransitionEvent"in window||delete Pr.transitionend.transition);function fa(e){if(Qa[e])return Qa[e];if(!Pr[e])return e;var t=Pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zm)return Qa[e]=t[n];return e}var eg=fa("animationend"),tg=fa("animationiteration"),ng=fa("animationstart"),rg=fa("transitionend"),ig=new Map,hf="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 Un(e,t){ig.set(e,t),pr(t,[e])}for(var Ga=0;Ga<hf.length;Ga++){var Ya=hf[Ga],zb=Ya.toLowerCase(),Fb=Ya[0].toUpperCase()+Ya.slice(1);Un(zb,"on"+Fb)}Un(eg,"onAnimationEnd");Un(tg,"onAnimationIteration");Un(ng,"onAnimationStart");Un("dblclick","onDoubleClick");Un("focusin","onFocus");Un("focusout","onBlur");Un(rg,"onTransitionEnd");qr("onMouseEnter",["mouseout","mouseover"]);qr("onMouseLeave",["mouseout","mouseover"]);qr("onPointerEnter",["pointerout","pointerover"]);qr("onPointerLeave",["pointerout","pointerover"]);pr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));pr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));pr("onBeforeInput",["compositionend","keypress","textInput","paste"]);pr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));pr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));pr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pi="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(" "),Bb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pi));function pf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,zS(r,t,void 0,e),e.currentTarget=null}function sg(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 s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;pf(i,a,u),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;pf(i,a,u),s=l}}}if(_o)throw e=Gl,_o=!1,Gl=null,e}function me(e,t){var n=t[su];n===void 0&&(n=t[su]=new Set);var r=e+"__bubble";n.has(r)||(og(t,e,2,!1),n.add(r))}function Ja(e,t,n){var r=0;t&&(r|=4),og(n,e,r,t)}var Fs="_reactListening"+Math.random().toString(36).slice(2);function ns(e){if(!e[Fs]){e[Fs]=!0,hm.forEach(function(n){n!=="selectionchange"&&(Bb.has(n)||Ja(n,!1,e),Ja(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fs]||(t[Fs]=!0,Ja("selectionchange",!1,t))}}function og(e,t,n,r){switch(Vm(t)){case 1:var i=eb;break;case 4:i=tb;break;default:i=fc}n=i.bind(null,t,n,e),i=void 0,!Ql||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 Xa(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Zn(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}Rm(function(){var u=s,d=lc(n),c=[];e:{var f=ig.get(e);if(f!==void 0){var h=pc,m=e;switch(e){case"keypress":if(ao(n)===0)break e;case"keydown":case"keyup":h=gb;break;case"focusin":m="focus",h=Wa;break;case"focusout":m="blur",h=Wa;break;case"beforeblur":case"afterblur":h=Wa;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=tf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=ib;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=xb;break;case eg:case tg:case ng:h=ab;break;case rg:h=Sb;break;case"scroll":h=nb;break;case"wheel":h=kb;break;case"copy":case"cut":case"paste":h=ub;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=rf}var x=(t&4)!==0,E=!x&&e==="scroll",y=x?f!==null?f+"Capture":null:f;x=[];for(var v=u,w;v!==null;){w=v;var C=w.stateNode;if(w.tag===5&&C!==null&&(w=C,y!==null&&(C=Yi(v,y),C!=null&&x.push(rs(v,C,w)))),E)break;v=v.return}0<x.length&&(f=new h(f,m,null,n,d),c.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==ql&&(m=n.relatedTarget||n.fromElement)&&(Zn(m)||m[dn]))break e;if((h||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=u,m=m?Zn(m):null,m!==null&&(E=mr(m),m!==E||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=u),h!==m)){if(x=tf,C="onMouseLeave",y="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(x=rf,C="onPointerLeave",y="onPointerEnter",v="pointer"),E=h==null?f:Ar(h),w=m==null?f:Ar(m),f=new x(C,v+"leave",h,n,d),f.target=E,f.relatedTarget=w,C=null,Zn(d)===u&&(x=new x(y,v+"enter",m,n,d),x.target=w,x.relatedTarget=E,C=x),E=C,h&&m)t:{for(x=h,y=m,v=0,w=x;w;w=kr(w))v++;for(w=0,C=y;C;C=kr(C))w++;for(;0<v-w;)x=kr(x),v--;for(;0<w-v;)y=kr(y),w--;for(;v--;){if(x===y||y!==null&&x===y.alternate)break t;x=kr(x),y=kr(y)}x=null}else x=null;h!==null&&mf(c,f,h,x,!1),m!==null&&E!==null&&mf(c,E,m,x,!0)}}e:{if(f=u?Ar(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var I=Pb;else if(af(f))if(Gm)I=jb;else{I=Mb;var k=Ab}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(I=Nb);if(I&&(I=I(e,u))){Qm(c,I,n,d);break e}k&&k(e,f,u),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Ul(f,"number",f.value)}switch(k=u?Ar(u):window,e){case"focusin":(af(k)||k.contentEditable==="true")&&(Rr=k,Zl=u,Di=null);break;case"focusout":Di=Zl=Rr=null;break;case"mousedown":eu=!0;break;case"contextmenu":case"mouseup":case"dragend":eu=!1,ff(c,n,d);break;case"selectionchange":if(Lb)break;case"keydown":case"keyup":ff(c,n,d)}var M;if(gc)e:{switch(e){case"compositionstart":var D="onCompositionStart";break e;case"compositionend":D="onCompositionEnd";break e;case"compositionupdate":D="onCompositionUpdate";break e}D=void 0}else Ir?qm(e,n)&&(D="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(D="onCompositionStart");D&&(Wm&&n.locale!=="ko"&&(Ir||D!=="onCompositionStart"?D==="onCompositionEnd"&&Ir&&(M=Hm()):(En=d,hc="value"in En?En.value:En.textContent,Ir=!0)),k=Ro(u,D),0<k.length&&(D=new nf(D,e,null,n,d),c.push({event:D,listeners:k}),M?D.data=M:(M=Km(n),M!==null&&(D.data=M)))),(M=Cb?Eb(e,n):Tb(e,n))&&(u=Ro(u,"onBeforeInput"),0<u.length&&(d=new nf("onBeforeInput","beforeinput",null,n,d),c.push({event:d,listeners:u}),d.data=M))}sg(c,t)})}function rs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ro(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Yi(e,n),s!=null&&r.unshift(rs(e,s,i)),s=Yi(e,t),s!=null&&r.push(rs(e,s,i))),e=e.return}return r}function kr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function mf(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=Yi(n,s),l!=null&&o.unshift(rs(n,l,a))):i||(l=Yi(n,s),l!=null&&o.push(rs(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ub=/\r\n?/g,$b=/\u0000|\uFFFD/g;function gf(e){return(typeof e=="string"?e:""+e).replace(Ub,`
|
|
38
|
-
`).replace($b,"")}function Bs(e,t,n){if(t=gf(t),gf(e)!==t&&n)throw Error(N(425))}function Po(){}var tu=null,nu=null;function ru(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 iu=typeof setTimeout=="function"?setTimeout:void 0,Vb=typeof clearTimeout=="function"?clearTimeout:void 0,yf=typeof Promise=="function"?Promise:void 0,Hb=typeof queueMicrotask=="function"?queueMicrotask:typeof yf<"u"?function(e){return yf.resolve(null).then(e).catch(Wb)}:iu;function Wb(e){setTimeout(function(){throw e})}function Za(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),Zi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Zi(t)}function An(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 vf(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 ai=Math.random().toString(36).slice(2),Kt="__reactFiber$"+ai,is="__reactProps$"+ai,dn="__reactContainer$"+ai,su="__reactEvents$"+ai,qb="__reactListeners$"+ai,Kb="__reactHandles$"+ai;function Zn(e){var t=e[Kt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dn]||n[Kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vf(e);e!==null;){if(n=e[Kt])return n;e=vf(e)}return t}e=n,n=e.parentNode}return null}function Ss(e){return e=e[Kt]||e[dn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ar(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(N(33))}function ha(e){return e[is]||null}var ou=[],Mr=-1;function $n(e){return{current:e}}function ge(e){0>Mr||(e.current=ou[Mr],ou[Mr]=null,Mr--)}function pe(e,t){Mr++,ou[Mr]=e.current,e.current=t}var zn={},He=$n(zn),st=$n(!1),or=zn;function Kr(e,t){var n=e.type.contextTypes;if(!n)return zn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ot(e){return e=e.childContextTypes,e!=null}function Ao(){ge(st),ge(He)}function xf(e,t,n){if(He.current!==zn)throw Error(N(168));pe(He,t),pe(st,n)}function ag(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(N(108,AS(e)||"Unknown",i));return we({},n,r)}function Mo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zn,or=He.current,pe(He,e),pe(st,st.current),!0}function wf(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=ag(e,t,or),r.__reactInternalMemoizedMergedChildContext=e,ge(st),ge(He),pe(He,e)):ge(st),pe(st,n)}var sn=null,pa=!1,el=!1;function lg(e){sn===null?sn=[e]:sn.push(e)}function Qb(e){pa=!0,lg(e)}function Vn(){if(!el&&sn!==null){el=!0;var e=0,t=ue;try{var n=sn;for(ue=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}sn=null,pa=!1}catch(i){throw sn!==null&&(sn=sn.slice(e+1)),Nm(uc,Vn),i}finally{ue=t,el=!1}}return null}var Nr=[],jr=0,No=null,jo=0,St=[],bt=0,ar=null,on=1,an="";function Yn(e,t){Nr[jr++]=jo,Nr[jr++]=No,No=e,jo=t}function ug(e,t,n){St[bt++]=on,St[bt++]=an,St[bt++]=ar,ar=e;var r=on;e=an;var i=32-Lt(r)-1;r&=~(1<<i),n+=1;var s=32-Lt(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,on=1<<32-Lt(t)+i|n<<i|r,an=s+e}else on=1<<s|n<<i|r,an=e}function vc(e){e.return!==null&&(Yn(e,1),ug(e,1,0))}function xc(e){for(;e===No;)No=Nr[--jr],Nr[jr]=null,jo=Nr[--jr],Nr[jr]=null;for(;e===ar;)ar=St[--bt],St[bt]=null,an=St[--bt],St[bt]=null,on=St[--bt],St[bt]=null}var pt=null,ht=null,ye=!1,jt=null;function cg(e,t){var n=_t(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 Sf(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,pt=e,ht=An(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,pt=e,ht=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ar!==null?{id:on,overflow:an}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=_t(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,pt=e,ht=null,!0):!1;default:return!1}}function au(e){return(e.mode&1)!==0&&(e.flags&128)===0}function lu(e){if(ye){var t=ht;if(t){var n=t;if(!Sf(e,t)){if(au(e))throw Error(N(418));t=An(n.nextSibling);var r=pt;t&&Sf(e,t)?cg(r,n):(e.flags=e.flags&-4097|2,ye=!1,pt=e)}}else{if(au(e))throw Error(N(418));e.flags=e.flags&-4097|2,ye=!1,pt=e}}}function bf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;pt=e}function Us(e){if(e!==pt)return!1;if(!ye)return bf(e),ye=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ru(e.type,e.memoizedProps)),t&&(t=ht)){if(au(e))throw dg(),Error(N(418));for(;t;)cg(e,t),t=An(t.nextSibling)}if(bf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(N(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ht=An(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ht=null}}else ht=pt?An(e.stateNode.nextSibling):null;return!0}function dg(){for(var e=ht;e;)e=An(e.nextSibling)}function Qr(){ht=pt=null,ye=!1}function wc(e){jt===null?jt=[e]:jt.push(e)}var Gb=pn.ReactCurrentBatchConfig;function Si(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(N(309));var r=n.stateNode}if(!r)throw Error(N(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(N(284));if(!n._owner)throw Error(N(290,e))}return e}function $s(e,t){throw e=Object.prototype.toString.call(t),Error(N(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function kf(e){var t=e._init;return t(e._payload)}function fg(e){function t(y,v){if(e){var w=y.deletions;w===null?(y.deletions=[v],y.flags|=16):w.push(v)}}function n(y,v){if(!e)return null;for(;v!==null;)t(y,v),v=v.sibling;return null}function r(y,v){for(y=new Map;v!==null;)v.key!==null?y.set(v.key,v):y.set(v.index,v),v=v.sibling;return y}function i(y,v){return y=Dn(y,v),y.index=0,y.sibling=null,y}function s(y,v,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<v?(y.flags|=2,v):w):(y.flags|=2,v)):(y.flags|=1048576,v)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,v,w,C){return v===null||v.tag!==6?(v=al(w,y.mode,C),v.return=y,v):(v=i(v,w),v.return=y,v)}function l(y,v,w,C){var I=w.type;return I===Tr?d(y,v,w.props.children,C,w.key):v!==null&&(v.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Sn&&kf(I)===v.type)?(C=i(v,w.props),C.ref=Si(y,v,w),C.return=y,C):(C=mo(w.type,w.key,w.props,null,y.mode,C),C.ref=Si(y,v,w),C.return=y,C)}function u(y,v,w,C){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=ll(w,y.mode,C),v.return=y,v):(v=i(v,w.children||[]),v.return=y,v)}function d(y,v,w,C,I){return v===null||v.tag!==7?(v=rr(w,y.mode,C,I),v.return=y,v):(v=i(v,w),v.return=y,v)}function c(y,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=al(""+v,y.mode,w),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case As:return w=mo(v.type,v.key,v.props,null,y.mode,w),w.ref=Si(y,null,v),w.return=y,w;case Er:return v=ll(v,y.mode,w),v.return=y,v;case Sn:var C=v._init;return c(y,C(v._payload),w)}if(Ii(v)||gi(v))return v=rr(v,y.mode,w,null),v.return=y,v;$s(y,v)}return null}function f(y,v,w,C){var I=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return I!==null?null:a(y,v,""+w,C);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case As:return w.key===I?l(y,v,w,C):null;case Er:return w.key===I?u(y,v,w,C):null;case Sn:return I=w._init,f(y,v,I(w._payload),C)}if(Ii(w)||gi(w))return I!==null?null:d(y,v,w,C,null);$s(y,w)}return null}function h(y,v,w,C,I){if(typeof C=="string"&&C!==""||typeof C=="number")return y=y.get(w)||null,a(v,y,""+C,I);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case As:return y=y.get(C.key===null?w:C.key)||null,l(v,y,C,I);case Er:return y=y.get(C.key===null?w:C.key)||null,u(v,y,C,I);case Sn:var k=C._init;return h(y,v,w,k(C._payload),I)}if(Ii(C)||gi(C))return y=y.get(w)||null,d(v,y,C,I,null);$s(v,C)}return null}function m(y,v,w,C){for(var I=null,k=null,M=v,D=v=0,$=null;M!==null&&D<w.length;D++){M.index>D?($=M,M=null):$=M.sibling;var T=f(y,M,w[D],C);if(T===null){M===null&&(M=$);break}e&&M&&T.alternate===null&&t(y,M),v=s(T,v,D),k===null?I=T:k.sibling=T,k=T,M=$}if(D===w.length)return n(y,M),ye&&Yn(y,D),I;if(M===null){for(;D<w.length;D++)M=c(y,w[D],C),M!==null&&(v=s(M,v,D),k===null?I=M:k.sibling=M,k=M);return ye&&Yn(y,D),I}for(M=r(y,M);D<w.length;D++)$=h(M,y,D,w[D],C),$!==null&&(e&&$.alternate!==null&&M.delete($.key===null?D:$.key),v=s($,v,D),k===null?I=$:k.sibling=$,k=$);return e&&M.forEach(function(L){return t(y,L)}),ye&&Yn(y,D),I}function x(y,v,w,C){var I=gi(w);if(typeof I!="function")throw Error(N(150));if(w=I.call(w),w==null)throw Error(N(151));for(var k=I=null,M=v,D=v=0,$=null,T=w.next();M!==null&&!T.done;D++,T=w.next()){M.index>D?($=M,M=null):$=M.sibling;var L=f(y,M,T.value,C);if(L===null){M===null&&(M=$);break}e&&M&&L.alternate===null&&t(y,M),v=s(L,v,D),k===null?I=L:k.sibling=L,k=L,M=$}if(T.done)return n(y,M),ye&&Yn(y,D),I;if(M===null){for(;!T.done;D++,T=w.next())T=c(y,T.value,C),T!==null&&(v=s(T,v,D),k===null?I=T:k.sibling=T,k=T);return ye&&Yn(y,D),I}for(M=r(y,M);!T.done;D++,T=w.next())T=h(M,y,D,T.value,C),T!==null&&(e&&T.alternate!==null&&M.delete(T.key===null?D:T.key),v=s(T,v,D),k===null?I=T:k.sibling=T,k=T);return e&&M.forEach(function(z){return t(y,z)}),ye&&Yn(y,D),I}function E(y,v,w,C){if(typeof w=="object"&&w!==null&&w.type===Tr&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case As:e:{for(var I=w.key,k=v;k!==null;){if(k.key===I){if(I=w.type,I===Tr){if(k.tag===7){n(y,k.sibling),v=i(k,w.props.children),v.return=y,y=v;break e}}else if(k.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Sn&&kf(I)===k.type){n(y,k.sibling),v=i(k,w.props),v.ref=Si(y,k,w),v.return=y,y=v;break e}n(y,k);break}else t(y,k);k=k.sibling}w.type===Tr?(v=rr(w.props.children,y.mode,C,w.key),v.return=y,y=v):(C=mo(w.type,w.key,w.props,null,y.mode,C),C.ref=Si(y,v,w),C.return=y,y=C)}return o(y);case Er:e:{for(k=w.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(y,v.sibling),v=i(v,w.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else t(y,v);v=v.sibling}v=ll(w,y.mode,C),v.return=y,y=v}return o(y);case Sn:return k=w._init,E(y,v,k(w._payload),C)}if(Ii(w))return m(y,v,w,C);if(gi(w))return x(y,v,w,C);$s(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(y,v.sibling),v=i(v,w),v.return=y,y=v):(n(y,v),v=al(w,y.mode,C),v.return=y,y=v),o(y)):n(y,v)}return E}var Gr=fg(!0),hg=fg(!1),Do=$n(null),Oo=null,Dr=null,Sc=null;function bc(){Sc=Dr=Oo=null}function kc(e){var t=Do.current;ge(Do),e._currentValue=t}function uu(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 $r(e,t){Oo=e,Sc=Dr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(it=!0),e.firstContext=null)}function Tt(e){var t=e._currentValue;if(Sc!==e)if(e={context:e,memoizedValue:t,next:null},Dr===null){if(Oo===null)throw Error(N(308));Dr=e,Oo.dependencies={lanes:0,firstContext:e}}else Dr=Dr.next=e;return t}var er=null;function _c(e){er===null?er=[e]:er.push(e)}function pg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,_c(t)):(n.next=i.next,i.next=n),t.interleaved=n,fn(e,r)}function fn(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 bn=!1;function Cc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mg(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 un(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Mn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,le&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,fn(e,n)}return i=r.interleaved,i===null?(t.next=t,_c(r)):(t.next=i.next,i.next=t),r.interleaved=t,fn(e,n)}function lo(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,cc(e,n)}}function _f(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 Lo(e,t,n,r){var i=e.updateQueue;bn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(s!==null){var c=i.baseState;o=0,d=u=l=null,a=s;do{var f=a.lane,h=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,x=a;switch(f=t,h=n,x.tag){case 1:if(m=x.payload,typeof m=="function"){c=m.call(h,c,f);break e}c=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=x.payload,f=typeof m=="function"?m.call(h,c,f):m,f==null)break e;c=we({},c,f);break e;case 2:bn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=h,l=c):d=d.next=h,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);ur|=o,e.lanes=o,e.memoizedState=c}}function Cf(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(N(191,i));i.call(r)}}}var bs={},Yt=$n(bs),ss=$n(bs),os=$n(bs);function tr(e){if(e===bs)throw Error(N(174));return e}function Ec(e,t){switch(pe(os,t),pe(ss,e),pe(Yt,bs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Vl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Vl(t,e)}ge(Yt),pe(Yt,t)}function Yr(){ge(Yt),ge(ss),ge(os)}function gg(e){tr(os.current);var t=tr(Yt.current),n=Vl(t,e.type);t!==n&&(pe(ss,e),pe(Yt,n))}function Tc(e){ss.current===e&&(ge(Yt),ge(ss))}var ve=$n(0);function zo(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 tl=[];function Ic(){for(var e=0;e<tl.length;e++)tl[e]._workInProgressVersionPrimary=null;tl.length=0}var uo=pn.ReactCurrentDispatcher,nl=pn.ReactCurrentBatchConfig,lr=0,xe=null,Re=null,Me=null,Fo=!1,Oi=!1,as=0,Yb=0;function Fe(){throw Error(N(321))}function Rc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Bt(e[n],t[n]))return!1;return!0}function Pc(e,t,n,r,i,s){if(lr=s,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,uo.current=e===null||e.memoizedState===null?ek:tk,e=n(r,i),Oi){s=0;do{if(Oi=!1,as=0,25<=s)throw Error(N(301));s+=1,Me=Re=null,t.updateQueue=null,uo.current=nk,e=n(r,i)}while(Oi)}if(uo.current=Bo,t=Re!==null&&Re.next!==null,lr=0,Me=Re=xe=null,Fo=!1,t)throw Error(N(300));return e}function Ac(){var e=as!==0;return as=0,e}function Wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Me===null?xe.memoizedState=Me=e:Me=Me.next=e,Me}function It(){if(Re===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=Me===null?xe.memoizedState:Me.next;if(t!==null)Me=t,Re=e;else{if(e===null)throw Error(N(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Me===null?xe.memoizedState=Me=e:Me=Me.next=e}return Me}function ls(e,t){return typeof t=="function"?t(e):t}function rl(e){var t=It(),n=t.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=e;var r=Re,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var d=u.lane;if((lr&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=c,o=r):l=l.next=c,xe.lanes|=d,ur|=d}u=u.next}while(u!==null&&u!==s);l===null?o=r:l.next=a,Bt(r,t.memoizedState)||(it=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,xe.lanes|=s,ur|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function il(e){var t=It(),n=t.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Bt(s,t.memoizedState)||(it=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function yg(){}function vg(e,t){var n=xe,r=It(),i=t(),s=!Bt(r.memoizedState,i);if(s&&(r.memoizedState=i,it=!0),r=r.queue,Mc(Sg.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Me!==null&&Me.memoizedState.tag&1){if(n.flags|=2048,us(9,wg.bind(null,n,r,i,t),void 0,null),je===null)throw Error(N(349));lr&30||xg(n,t,i)}return i}function xg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xe.updateQueue,t===null?(t={lastEffect:null,stores:null},xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function wg(e,t,n,r){t.value=n,t.getSnapshot=r,bg(t)&&kg(e)}function Sg(e,t,n){return n(function(){bg(t)&&kg(e)})}function bg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Bt(e,n)}catch{return!0}}function kg(e){var t=fn(e,1);t!==null&&zt(t,e,1,-1)}function Ef(e){var t=Wt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t.queue=e,e=e.dispatch=Zb.bind(null,xe,e),[t.memoizedState,e]}function us(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=xe.updateQueue,t===null?(t={lastEffect:null,stores:null},xe.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 _g(){return It().memoizedState}function co(e,t,n,r){var i=Wt();xe.flags|=e,i.memoizedState=us(1|t,n,void 0,r===void 0?null:r)}function ma(e,t,n,r){var i=It();r=r===void 0?null:r;var s=void 0;if(Re!==null){var o=Re.memoizedState;if(s=o.destroy,r!==null&&Rc(r,o.deps)){i.memoizedState=us(t,n,s,r);return}}xe.flags|=e,i.memoizedState=us(1|t,n,s,r)}function Tf(e,t){return co(8390656,8,e,t)}function Mc(e,t){return ma(2048,8,e,t)}function Cg(e,t){return ma(4,2,e,t)}function Eg(e,t){return ma(4,4,e,t)}function Tg(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 Ig(e,t,n){return n=n!=null?n.concat([e]):null,ma(4,4,Tg.bind(null,t,e),n)}function Nc(){}function Rg(e,t){var n=It();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Rc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Pg(e,t){var n=It();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Rc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ag(e,t,n){return lr&21?(Bt(n,t)||(n=Om(),xe.lanes|=n,ur|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,it=!0),e.memoizedState=n)}function Jb(e,t){var n=ue;ue=n!==0&&4>n?n:4,e(!0);var r=nl.transition;nl.transition={};try{e(!1),t()}finally{ue=n,nl.transition=r}}function Mg(){return It().memoizedState}function Xb(e,t,n){var r=jn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ng(e))jg(t,n);else if(n=pg(e,t,n,r),n!==null){var i=Ge();zt(n,e,r,i),Dg(n,t,r)}}function Zb(e,t,n){var r=jn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ng(e))jg(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Bt(a,o)){var l=t.interleaved;l===null?(i.next=i,_c(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=pg(e,t,i,r),n!==null&&(i=Ge(),zt(n,e,r,i),Dg(n,t,r))}}function Ng(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function jg(e,t){Oi=Fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Dg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,cc(e,n)}}var Bo={readContext:Tt,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useInsertionEffect:Fe,useLayoutEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useMutableSource:Fe,useSyncExternalStore:Fe,useId:Fe,unstable_isNewReconciler:!1},ek={readContext:Tt,useCallback:function(e,t){return Wt().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Tf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,co(4194308,4,Tg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return co(4194308,4,e,t)},useInsertionEffect:function(e,t){return co(4,2,e,t)},useMemo:function(e,t){var n=Wt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Xb.bind(null,xe,e),[r.memoizedState,e]},useRef:function(e){var t=Wt();return e={current:e},t.memoizedState=e},useState:Ef,useDebugValue:Nc,useDeferredValue:function(e){return Wt().memoizedState=e},useTransition:function(){var e=Ef(!1),t=e[0];return e=Jb.bind(null,e[1]),Wt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xe,i=Wt();if(ye){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),je===null)throw Error(N(349));lr&30||xg(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Tf(Sg.bind(null,r,s,e),[e]),r.flags|=2048,us(9,wg.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Wt(),t=je.identifierPrefix;if(ye){var n=an,r=on;n=(r&~(1<<32-Lt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=as++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Yb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tk={readContext:Tt,useCallback:Rg,useContext:Tt,useEffect:Mc,useImperativeHandle:Ig,useInsertionEffect:Cg,useLayoutEffect:Eg,useMemo:Pg,useReducer:rl,useRef:_g,useState:function(){return rl(ls)},useDebugValue:Nc,useDeferredValue:function(e){var t=It();return Ag(t,Re.memoizedState,e)},useTransition:function(){var e=rl(ls)[0],t=It().memoizedState;return[e,t]},useMutableSource:yg,useSyncExternalStore:vg,useId:Mg,unstable_isNewReconciler:!1},nk={readContext:Tt,useCallback:Rg,useContext:Tt,useEffect:Mc,useImperativeHandle:Ig,useInsertionEffect:Cg,useLayoutEffect:Eg,useMemo:Pg,useReducer:il,useRef:_g,useState:function(){return il(ls)},useDebugValue:Nc,useDeferredValue:function(e){var t=It();return Re===null?t.memoizedState=e:Ag(t,Re.memoizedState,e)},useTransition:function(){var e=il(ls)[0],t=It().memoizedState;return[e,t]},useMutableSource:yg,useSyncExternalStore:vg,useId:Mg,unstable_isNewReconciler:!1};function Mt(e,t){if(e&&e.defaultProps){t=we({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function cu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:we({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ga={isMounted:function(e){return(e=e._reactInternals)?mr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ge(),i=jn(e),s=un(r,i);s.payload=t,n!=null&&(s.callback=n),t=Mn(e,s,i),t!==null&&(zt(t,e,i,r),lo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ge(),i=jn(e),s=un(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Mn(e,s,i),t!==null&&(zt(t,e,i,r),lo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ge(),r=jn(e),i=un(n,r);i.tag=2,t!=null&&(i.callback=t),t=Mn(e,i,r),t!==null&&(zt(t,e,r,n),lo(t,e,r))}};function If(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!ts(n,r)||!ts(i,s):!0}function Og(e,t,n){var r=!1,i=zn,s=t.contextType;return typeof s=="object"&&s!==null?s=Tt(s):(i=ot(t)?or:He.current,r=t.contextTypes,s=(r=r!=null)?Kr(e,i):zn),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ga,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Rf(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&&ga.enqueueReplaceState(t,t.state,null)}function du(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Cc(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Tt(s):(s=ot(t)?or:He.current,i.context=Kr(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(cu(e,t,s,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&&ga.enqueueReplaceState(i,i.state,null),Lo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Jr(e,t){try{var n="",r=t;do n+=PS(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
39
|
-
Error generating stack: `+s.message+`
|
|
40
|
-
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function sl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function fu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var rk=typeof WeakMap=="function"?WeakMap:Map;function Lg(e,t,n){n=un(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){$o||($o=!0,bu=r),fu(e,t)},n}function zg(e,t,n){n=un(-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(){fu(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){fu(e,t),typeof r!="function"&&(Nn===null?Nn=new Set([this]):Nn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rk;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=yk.bind(null,e,t,n),t.then(e,e))}function Af(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 Mf(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=un(-1,1),t.tag=2,Mn(n,t,1))),n.lanes|=1),e)}var ik=pn.ReactCurrentOwner,it=!1;function Ke(e,t,n,r){t.child=e===null?hg(t,null,n,r):Gr(t,e.child,n,r)}function Nf(e,t,n,r,i){n=n.render;var s=t.ref;return $r(t,i),r=Pc(e,t,n,r,s,i),n=Ac(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,hn(e,t,i)):(ye&&n&&vc(t),t.flags|=1,Ke(e,t,r,i),t.child)}function jf(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Uc(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Fg(e,t,s,r,i)):(e=mo(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ts,n(o,r)&&e.ref===t.ref)return hn(e,t,i)}return t.flags|=1,e=Dn(s,r),e.ref=t.ref,e.return=t,t.child=e}function Fg(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(ts(s,r)&&e.ref===t.ref)if(it=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(it=!0);else return t.lanes=e.lanes,hn(e,t,i)}return hu(e,t,n,r,i)}function Bg(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},pe(Lr,ft),ft|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,pe(Lr,ft),ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,pe(Lr,ft),ft|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,pe(Lr,ft),ft|=r;return Ke(e,t,i,n),t.child}function Ug(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function hu(e,t,n,r,i){var s=ot(n)?or:He.current;return s=Kr(t,s),$r(t,i),n=Pc(e,t,n,r,s,i),r=Ac(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,hn(e,t,i)):(ye&&r&&vc(t),t.flags|=1,Ke(e,t,n,i),t.child)}function Df(e,t,n,r,i){if(ot(n)){var s=!0;Mo(t)}else s=!1;if($r(t,i),t.stateNode===null)fo(e,t),Og(t,n,r),du(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Tt(u):(u=ot(n)?or:He.current,u=Kr(t,u));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&Rf(t,o,r,u),bn=!1;var f=t.memoizedState;o.state=f,Lo(t,r,o,i),l=t.memoizedState,a!==r||f!==l||st.current||bn?(typeof d=="function"&&(cu(t,n,d,r),l=t.memoizedState),(a=bn||If(t,n,a,r,f,l,u))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,mg(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Mt(t.type,a),o.props=u,c=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Tt(l):(l=ot(n)?or:He.current,l=Kr(t,l));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==c||f!==l)&&Rf(t,o,r,l),bn=!1,f=t.memoizedState,o.state=f,Lo(t,r,o,i);var m=t.memoizedState;a!==c||f!==m||st.current||bn?(typeof h=="function"&&(cu(t,n,h,r),m=t.memoizedState),(u=bn||If(t,n,u,r,f,m,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return pu(e,t,n,r,s,i)}function pu(e,t,n,r,i,s){Ug(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&wf(t,n,!1),hn(e,t,s);r=t.stateNode,ik.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Gr(t,e.child,null,s),t.child=Gr(t,null,a,s)):Ke(e,t,a,s),t.memoizedState=r.state,i&&wf(t,n,!0),t.child}function $g(e){var t=e.stateNode;t.pendingContext?xf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&xf(e,t.context,!1),Ec(e,t.containerInfo)}function Of(e,t,n,r,i){return Qr(),wc(i),t.flags|=256,Ke(e,t,n,r),t.child}var mu={dehydrated:null,treeContext:null,retryLane:0};function gu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Vg(e,t,n){var r=t.pendingProps,i=ve.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),pe(ve,i&1),e===null)return lu(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):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=xa(o,r,0,null),e=rr(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=gu(n),t.memoizedState=mu,e):jc(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return sk(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Dn(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Dn(a,s):(s=rr(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?gu(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=mu,r}return s=e.child,e=s.sibling,r=Dn(s,{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 jc(e,t){return t=xa({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Vs(e,t,n,r){return r!==null&&wc(r),Gr(t,e.child,null,n),e=jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sk(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=sl(Error(N(422))),Vs(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=xa({mode:"visible",children:r.children},i,0,null),s=rr(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Gr(t,e.child,null,o),t.child.memoizedState=gu(o),t.memoizedState=mu,s);if(!(t.mode&1))return Vs(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(N(419)),r=sl(s,r,void 0),Vs(e,t,o,r)}if(a=(o&e.childLanes)!==0,it||a){if(r=je,r!==null){switch(o&-o){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|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,fn(e,i),zt(r,e,i,-1))}return Bc(),r=sl(Error(N(421))),Vs(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=vk.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,ht=An(i.nextSibling),pt=t,ye=!0,jt=null,e!==null&&(St[bt++]=on,St[bt++]=an,St[bt++]=ar,on=e.id,an=e.overflow,ar=t),t=jc(t,r.children),t.flags|=4096,t)}function Lf(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),uu(e.return,t,n)}function ol(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Hg(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Ke(e,t,r.children,n),r=ve.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&&Lf(e,n,t);else if(e.tag===19)Lf(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(pe(ve,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&&zo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&zo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,s);break;case"together":ol(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function fo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function hn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ur|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(N(153));if(t.child!==null){for(e=t.child,n=Dn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Dn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ok(e,t,n){switch(t.tag){case 3:$g(t),Qr();break;case 5:gg(t);break;case 1:ot(t.type)&&Mo(t);break;case 4:Ec(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;pe(Do,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(pe(ve,ve.current&1),t.flags|=128,null):n&t.child.childLanes?Vg(e,t,n):(pe(ve,ve.current&1),e=hn(e,t,n),e!==null?e.sibling:null);pe(ve,ve.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Hg(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),pe(ve,ve.current),r)break;return null;case 22:case 23:return t.lanes=0,Bg(e,t,n)}return hn(e,t,n)}var Wg,yu,qg,Kg;Wg=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}};yu=function(){};qg=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,tr(Yt.current);var s=null;switch(n){case"input":i=Fl(e,i),r=Fl(e,r),s=[];break;case"select":i=we({},i,{value:void 0}),r=we({},r,{value:void 0}),s=[];break;case"textarea":i=$l(e,i),r=$l(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Po)}Hl(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Qi.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i?.[u],r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Qi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&me("scroll",e),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};Kg=function(e,t,n,r){n!==r&&(t.flags|=4)};function bi(e,t){if(!ye)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 Be(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 ak(e,t,n){var r=t.pendingProps;switch(xc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(t),null;case 1:return ot(t.type)&&Ao(),Be(t),null;case 3:return r=t.stateNode,Yr(),ge(st),ge(He),Ic(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Us(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,jt!==null&&(Cu(jt),jt=null))),yu(e,t),Be(t),null;case 5:Tc(t);var i=tr(os.current);if(n=t.type,e!==null&&t.stateNode!=null)qg(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(N(166));return Be(t),null}if(e=tr(Yt.current),Us(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Kt]=t,r[is]=s,e=(t.mode&1)!==0,n){case"dialog":me("cancel",r),me("close",r);break;case"iframe":case"object":case"embed":me("load",r);break;case"video":case"audio":for(i=0;i<Pi.length;i++)me(Pi[i],r);break;case"source":me("error",r);break;case"img":case"image":case"link":me("error",r),me("load",r);break;case"details":me("toggle",r);break;case"input":Wd(r,s),me("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},me("invalid",r);break;case"textarea":Kd(r,s),me("invalid",r)}Hl(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Bs(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Bs(r.textContent,a,e),i=["children",""+a]):Qi.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&me("scroll",r)}switch(n){case"input":Ms(r),qd(r,s,!0);break;case"textarea":Ms(r),Qd(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Po)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Sm(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Kt]=t,e[is]=r,Wg(e,t,!1,!1),t.stateNode=e;e:{switch(o=Wl(n,r),n){case"dialog":me("cancel",e),me("close",e),i=r;break;case"iframe":case"object":case"embed":me("load",e),i=r;break;case"video":case"audio":for(i=0;i<Pi.length;i++)me(Pi[i],e);i=r;break;case"source":me("error",e),i=r;break;case"img":case"image":case"link":me("error",e),me("load",e),i=r;break;case"details":me("toggle",e),i=r;break;case"input":Wd(e,r),i=Fl(e,r),me("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=we({},r,{value:void 0}),me("invalid",e);break;case"textarea":Kd(e,r),i=$l(e,r),me("invalid",e);break;default:i=r}Hl(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?_m(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&bm(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Gi(e,l):typeof l=="number"&&Gi(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Qi.hasOwnProperty(s)?l!=null&&s==="onScroll"&&me("scroll",e):l!=null&&ic(e,s,l,o))}switch(n){case"input":Ms(e),qd(e,r,!1);break;case"textarea":Ms(e),Qd(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ln(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?zr(e,!!r.multiple,s,!1):r.defaultValue!=null&&zr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Po)}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 Be(t),null;case 6:if(e&&t.stateNode!=null)Kg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(N(166));if(n=tr(os.current),tr(Yt.current),Us(t)){if(r=t.stateNode,n=t.memoizedProps,r[Kt]=t,(s=r.nodeValue!==n)&&(e=pt,e!==null))switch(e.tag){case 3:Bs(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Bs(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Kt]=t,t.stateNode=r}return Be(t),null;case 13:if(ge(ve),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ye&&ht!==null&&t.mode&1&&!(t.flags&128))dg(),Qr(),t.flags|=98560,s=!1;else if(s=Us(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(N(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(N(317));s[Kt]=t}else Qr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Be(t),s=!1}else jt!==null&&(Cu(jt),jt=null),s=!0;if(!s)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||ve.current&1?Pe===0&&(Pe=3):Bc())),t.updateQueue!==null&&(t.flags|=4),Be(t),null);case 4:return Yr(),yu(e,t),e===null&&ns(t.stateNode.containerInfo),Be(t),null;case 10:return kc(t.type._context),Be(t),null;case 17:return ot(t.type)&&Ao(),Be(t),null;case 19:if(ge(ve),s=t.memoizedState,s===null)return Be(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)bi(s,!1);else{if(Pe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=zo(e),o!==null){for(t.flags|=128,bi(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return pe(ve,ve.current&1|2),t.child}e=e.sibling}s.tail!==null&&_e()>Xr&&(t.flags|=128,r=!0,bi(s,!1),t.lanes=4194304)}else{if(!r)if(e=zo(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),bi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ye)return Be(t),null}else 2*_e()-s.renderingStartTime>Xr&&n!==1073741824&&(t.flags|=128,r=!0,bi(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=_e(),t.sibling=null,n=ve.current,pe(ve,r?n&1|2:n&1),t):(Be(t),null);case 22:case 23:return Fc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ft&1073741824&&(Be(t),t.subtreeFlags&6&&(t.flags|=8192)):Be(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function lk(e,t){switch(xc(t),t.tag){case 1:return ot(t.type)&&Ao(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yr(),ge(st),ge(He),Ic(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Tc(t),null;case 13:if(ge(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));Qr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ge(ve),null;case 4:return Yr(),null;case 10:return kc(t.type._context),null;case 22:case 23:return Fc(),null;case 24:return null;default:return null}}var Hs=!1,Ue=!1,uk=typeof WeakSet=="function"?WeakSet:Set,U=null;function Or(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){be(e,t,r)}else n.current=null}function vu(e,t,n){try{n()}catch(r){be(e,t,r)}}var zf=!1;function ck(e,t){if(tu=To,e=Xm(),yc(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,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var h;c!==n||i!==0&&c.nodeType!==3||(a=o+i),c!==s||r!==0&&c.nodeType!==3||(l=o+r),c.nodeType===3&&(o+=c.nodeValue.length),(h=c.firstChild)!==null;)f=c,c=h;for(;;){if(c===e)break t;if(f===n&&++u===i&&(a=o),f===s&&++d===r&&(l=o),(h=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(nu={focusedElem:e,selectionRange:n},To=!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 m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var x=m.memoizedProps,E=m.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?x:Mt(t.type,x),E);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(C){be(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return m=zf,zf=!1,m}function Li(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 s=i.destroy;i.destroy=void 0,s!==void 0&&vu(t,n,s)}i=i.next}while(i!==r)}}function ya(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 xu(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 Qg(e){var t=e.alternate;t!==null&&(e.alternate=null,Qg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[is],delete t[su],delete t[qb],delete t[Kb])),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 Gg(e){return e.tag===5||e.tag===3||e.tag===4}function Ff(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gg(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 wu(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=Po));else if(r!==4&&(e=e.child,e!==null))for(wu(e,t,n),e=e.sibling;e!==null;)wu(e,t,n),e=e.sibling}function Su(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(Su(e,t,n),e=e.sibling;e!==null;)Su(e,t,n),e=e.sibling}var De=null,Nt=!1;function xn(e,t,n){for(n=n.child;n!==null;)Yg(e,t,n),n=n.sibling}function Yg(e,t,n){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(ua,n)}catch{}switch(n.tag){case 5:Ue||Or(n,t);case 6:var r=De,i=Nt;De=null,xn(e,t,n),De=r,Nt=i,De!==null&&(Nt?(e=De,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):De.removeChild(n.stateNode));break;case 18:De!==null&&(Nt?(e=De,n=n.stateNode,e.nodeType===8?Za(e.parentNode,n):e.nodeType===1&&Za(e,n),Zi(e)):Za(De,n.stateNode));break;case 4:r=De,i=Nt,De=n.stateNode.containerInfo,Nt=!0,xn(e,t,n),De=r,Nt=i;break;case 0:case 11:case 14:case 15:if(!Ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&vu(n,t,o),i=i.next}while(i!==r)}xn(e,t,n);break;case 1:if(!Ue&&(Or(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){be(n,t,a)}xn(e,t,n);break;case 21:xn(e,t,n);break;case 22:n.mode&1?(Ue=(r=Ue)||n.memoizedState!==null,xn(e,t,n),Ue=r):xn(e,t,n);break;default:xn(e,t,n)}}function Bf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new uk),t.forEach(function(r){var i=xk.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function At(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:De=a.stateNode,Nt=!1;break e;case 3:De=a.stateNode.containerInfo,Nt=!0;break e;case 4:De=a.stateNode.containerInfo,Nt=!0;break e}a=a.return}if(De===null)throw Error(N(160));Yg(s,o,i),De=null,Nt=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){be(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Jg(t,e),t=t.sibling}function Jg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(At(t,e),Vt(e),r&4){try{Li(3,e,e.return),ya(3,e)}catch(x){be(e,e.return,x)}try{Li(5,e,e.return)}catch(x){be(e,e.return,x)}}break;case 1:At(t,e),Vt(e),r&512&&n!==null&&Or(n,n.return);break;case 5:if(At(t,e),Vt(e),r&512&&n!==null&&Or(n,n.return),e.flags&32){var i=e.stateNode;try{Gi(i,"")}catch(x){be(e,e.return,x)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&xm(i,s),Wl(a,o);var u=Wl(a,s);for(o=0;o<l.length;o+=2){var d=l[o],c=l[o+1];d==="style"?_m(i,c):d==="dangerouslySetInnerHTML"?bm(i,c):d==="children"?Gi(i,c):ic(i,d,c,u)}switch(a){case"input":Bl(i,s);break;case"textarea":wm(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?zr(i,!!s.multiple,h,!1):f!==!!s.multiple&&(s.defaultValue!=null?zr(i,!!s.multiple,s.defaultValue,!0):zr(i,!!s.multiple,s.multiple?[]:"",!1))}i[is]=s}catch(x){be(e,e.return,x)}}break;case 6:if(At(t,e),Vt(e),r&4){if(e.stateNode===null)throw Error(N(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(x){be(e,e.return,x)}}break;case 3:if(At(t,e),Vt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Zi(t.containerInfo)}catch(x){be(e,e.return,x)}break;case 4:At(t,e),Vt(e);break;case 13:At(t,e),Vt(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Lc=_e())),r&4&&Bf(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ue=(u=Ue)||d,At(t,e),Ue=u):At(t,e),Vt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(U=e,d=e.child;d!==null;){for(c=U=d;U!==null;){switch(f=U,h=f.child,f.tag){case 0:case 11:case 14:case 15:Li(4,f,f.return);break;case 1:Or(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(x){be(r,n,x)}}break;case 5:Or(f,f.return);break;case 22:if(f.memoizedState!==null){$f(c);continue}}h!==null?(h.return=f,U=h):$f(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{i=c.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=c.stateNode,l=c.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=km("display",o))}catch(x){be(e,e.return,x)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(x){be(e,e.return,x)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:At(t,e),Vt(e),r&4&&Bf(e);break;case 21:break;default:At(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Gg(n)){var r=n;break e}n=n.return}throw Error(N(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Gi(i,""),r.flags&=-33);var s=Ff(e);Su(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Ff(e);wu(e,a,o);break;default:throw Error(N(161))}}catch(l){be(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dk(e,t,n){U=e,Xg(e)}function Xg(e,t,n){for(var r=(e.mode&1)!==0;U!==null;){var i=U,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Hs;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Ue;a=Hs;var u=Ue;if(Hs=o,(Ue=l)&&!u)for(U=i;U!==null;)o=U,l=o.child,o.tag===22&&o.memoizedState!==null?Vf(i):l!==null?(l.return=o,U=l):Vf(i);for(;s!==null;)U=s,Xg(s),s=s.sibling;U=i,Hs=a,Ue=u}Uf(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,U=s):Uf(e)}}function Uf(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:Ue||ya(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ue)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Mt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Cf(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Cf(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&Zi(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(N(163))}Ue||t.flags&512&&xu(t)}catch(f){be(t,t.return,f)}}if(t===e){U=null;break}if(n=t.sibling,n!==null){n.return=t.return,U=n;break}U=t.return}}function $f(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 Vf(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ya(4,t)}catch(l){be(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){be(t,i,l)}}var s=t.return;try{xu(t)}catch(l){be(t,s,l)}break;case 5:var o=t.return;try{xu(t)}catch(l){be(t,o,l)}}}catch(l){be(t,t.return,l)}if(t===e){U=null;break}var a=t.sibling;if(a!==null){a.return=t.return,U=a;break}U=t.return}}var fk=Math.ceil,Uo=pn.ReactCurrentDispatcher,Dc=pn.ReactCurrentOwner,Ct=pn.ReactCurrentBatchConfig,le=0,je=null,Te=null,Le=0,ft=0,Lr=$n(0),Pe=0,cs=null,ur=0,va=0,Oc=0,zi=null,nt=null,Lc=0,Xr=1/0,rn=null,$o=!1,bu=null,Nn=null,Ws=!1,Tn=null,Vo=0,Fi=0,ku=null,ho=-1,po=0;function Ge(){return le&6?_e():ho!==-1?ho:ho=_e()}function jn(e){return e.mode&1?le&2&&Le!==0?Le&-Le:Gb.transition!==null?(po===0&&(po=Om()),po):(e=ue,e!==0||(e=window.event,e=e===void 0?16:Vm(e.type)),e):1}function zt(e,t,n,r){if(50<Fi)throw Fi=0,ku=null,Error(N(185));xs(e,n,r),(!(le&2)||e!==je)&&(e===je&&(!(le&2)&&(va|=n),Pe===4&&Cn(e,Le)),at(e,r),n===1&&le===0&&!(t.mode&1)&&(Xr=_e()+500,pa&&Vn()))}function at(e,t){var n=e.callbackNode;GS(e,t);var r=Eo(e,e===je?Le:0);if(r===0)n!==null&&Jd(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Jd(n),t===1)e.tag===0?Qb(Hf.bind(null,e)):lg(Hf.bind(null,e)),Hb(function(){!(le&6)&&Vn()}),n=null;else{switch(Lm(r)){case 1:n=uc;break;case 4:n=jm;break;case 16:n=Co;break;case 536870912:n=Dm;break;default:n=Co}n=oy(n,Zg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Zg(e,t){if(ho=-1,po=0,le&6)throw Error(N(327));var n=e.callbackNode;if(Vr()&&e.callbackNode!==n)return null;var r=Eo(e,e===je?Le:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ho(e,r);else{t=r;var i=le;le|=2;var s=ty();(je!==e||Le!==t)&&(rn=null,Xr=_e()+500,nr(e,t));do try{mk();break}catch(a){ey(e,a)}while(!0);bc(),Uo.current=s,le=i,Te!==null?t=0:(je=null,Le=0,t=Pe)}if(t!==0){if(t===2&&(i=Yl(e),i!==0&&(r=i,t=_u(e,i))),t===1)throw n=cs,nr(e,0),Cn(e,r),at(e,_e()),n;if(t===6)Cn(e,r);else{if(i=e.current.alternate,!(r&30)&&!hk(i)&&(t=Ho(e,r),t===2&&(s=Yl(e),s!==0&&(r=s,t=_u(e,s))),t===1))throw n=cs,nr(e,0),Cn(e,r),at(e,_e()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(N(345));case 2:Jn(e,nt,rn);break;case 3:if(Cn(e,r),(r&130023424)===r&&(t=Lc+500-_e(),10<t)){if(Eo(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ge(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=iu(Jn.bind(null,e,nt,rn),t);break}Jn(e,nt,rn);break;case 4:if(Cn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Lt(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fk(r/1960))-r,10<r){e.timeoutHandle=iu(Jn.bind(null,e,nt,rn),r);break}Jn(e,nt,rn);break;case 5:Jn(e,nt,rn);break;default:throw Error(N(329))}}}return at(e,_e()),e.callbackNode===n?Zg.bind(null,e):null}function _u(e,t){var n=zi;return e.current.memoizedState.isDehydrated&&(nr(e,t).flags|=256),e=Ho(e,t),e!==2&&(t=nt,nt=n,t!==null&&Cu(t)),e}function Cu(e){nt===null?nt=e:nt.push.apply(nt,e)}function hk(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],s=i.getSnapshot;i=i.value;try{if(!Bt(s(),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 Cn(e,t){for(t&=~Oc,t&=~va,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Lt(t),r=1<<n;e[n]=-1,t&=~r}}function Hf(e){if(le&6)throw Error(N(327));Vr();var t=Eo(e,0);if(!(t&1))return at(e,_e()),null;var n=Ho(e,t);if(e.tag!==0&&n===2){var r=Yl(e);r!==0&&(t=r,n=_u(e,r))}if(n===1)throw n=cs,nr(e,0),Cn(e,t),at(e,_e()),n;if(n===6)throw Error(N(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Jn(e,nt,rn),at(e,_e()),null}function zc(e,t){var n=le;le|=1;try{return e(t)}finally{le=n,le===0&&(Xr=_e()+500,pa&&Vn())}}function cr(e){Tn!==null&&Tn.tag===0&&!(le&6)&&Vr();var t=le;le|=1;var n=Ct.transition,r=ue;try{if(Ct.transition=null,ue=1,e)return e()}finally{ue=r,Ct.transition=n,le=t,!(le&6)&&Vn()}}function Fc(){ft=Lr.current,ge(Lr)}function nr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Vb(n)),Te!==null)for(n=Te.return;n!==null;){var r=n;switch(xc(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ao();break;case 3:Yr(),ge(st),ge(He),Ic();break;case 5:Tc(r);break;case 4:Yr();break;case 13:ge(ve);break;case 19:ge(ve);break;case 10:kc(r.type._context);break;case 22:case 23:Fc()}n=n.return}if(je=e,Te=e=Dn(e.current,null),Le=ft=t,Pe=0,cs=null,Oc=va=ur=0,nt=zi=null,er!==null){for(t=0;t<er.length;t++)if(n=er[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}er=null}return e}function ey(e,t){do{var n=Te;try{if(bc(),uo.current=Bo,Fo){for(var r=xe.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Fo=!1}if(lr=0,Me=Re=xe=null,Oi=!1,as=0,Dc.current=null,n===null||n.return===null){Pe=1,cs=t,Te=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=Le,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,c=d.tag;if(!(d.mode&1)&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=Af(o);if(h!==null){h.flags&=-257,Mf(h,o,a,s,t),h.mode&1&&Pf(s,u,t),t=h,l=u;var m=t.updateQueue;if(m===null){var x=new Set;x.add(l),t.updateQueue=x}else m.add(l);break e}else{if(!(t&1)){Pf(s,u,t),Bc();break e}l=Error(N(426))}}else if(ye&&a.mode&1){var E=Af(o);if(E!==null){!(E.flags&65536)&&(E.flags|=256),Mf(E,o,a,s,t),wc(Jr(l,a));break e}}s=l=Jr(l,a),Pe!==4&&(Pe=2),zi===null?zi=[s]:zi.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var y=Lg(s,l,t);_f(s,y);break e;case 1:a=l;var v=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Nn===null||!Nn.has(w)))){s.flags|=65536,t&=-t,s.lanes|=t;var C=zg(s,a,t);_f(s,C);break e}}s=s.return}while(s!==null)}ry(n)}catch(I){t=I,Te===n&&n!==null&&(Te=n=n.return);continue}break}while(!0)}function ty(){var e=Uo.current;return Uo.current=Bo,e===null?Bo:e}function Bc(){(Pe===0||Pe===3||Pe===2)&&(Pe=4),je===null||!(ur&268435455)&&!(va&268435455)||Cn(je,Le)}function Ho(e,t){var n=le;le|=2;var r=ty();(je!==e||Le!==t)&&(rn=null,nr(e,t));do try{pk();break}catch(i){ey(e,i)}while(!0);if(bc(),le=n,Uo.current=r,Te!==null)throw Error(N(261));return je=null,Le=0,Pe}function pk(){for(;Te!==null;)ny(Te)}function mk(){for(;Te!==null&&!BS();)ny(Te)}function ny(e){var t=sy(e.alternate,e,ft);e.memoizedProps=e.pendingProps,t===null?ry(e):Te=t,Dc.current=null}function ry(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=lk(n,t),n!==null){n.flags&=32767,Te=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Pe=6,Te=null;return}}else if(n=ak(n,t,ft),n!==null){Te=n;return}if(t=t.sibling,t!==null){Te=t;return}Te=t=e}while(t!==null);Pe===0&&(Pe=5)}function Jn(e,t,n){var r=ue,i=Ct.transition;try{Ct.transition=null,ue=1,gk(e,t,n,r)}finally{Ct.transition=i,ue=r}return null}function gk(e,t,n,r){do Vr();while(Tn!==null);if(le&6)throw Error(N(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(N(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(YS(e,s),e===je&&(Te=je=null,Le=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ws||(Ws=!0,oy(Co,function(){return Vr(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Ct.transition,Ct.transition=null;var o=ue;ue=1;var a=le;le|=4,Dc.current=null,ck(e,n),Jg(n,e),Ob(nu),To=!!tu,nu=tu=null,e.current=n,dk(n),US(),le=a,ue=o,Ct.transition=s}else e.current=n;if(Ws&&(Ws=!1,Tn=e,Vo=i),s=e.pendingLanes,s===0&&(Nn=null),HS(n.stateNode),at(e,_e()),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($o)throw $o=!1,e=bu,bu=null,e;return Vo&1&&e.tag!==0&&Vr(),s=e.pendingLanes,s&1?e===ku?Fi++:(Fi=0,ku=e):Fi=0,Vn(),null}function Vr(){if(Tn!==null){var e=Lm(Vo),t=Ct.transition,n=ue;try{if(Ct.transition=null,ue=16>e?16:e,Tn===null)var r=!1;else{if(e=Tn,Tn=null,Vo=0,le&6)throw Error(N(331));var i=le;for(le|=4,U=e.current;U!==null;){var s=U,o=s.child;if(U.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(U=u;U!==null;){var d=U;switch(d.tag){case 0:case 11:case 15:Li(8,d,s)}var c=d.child;if(c!==null)c.return=d,U=c;else for(;U!==null;){d=U;var f=d.sibling,h=d.return;if(Qg(d),d===u){U=null;break}if(f!==null){f.return=h,U=f;break}U=h}}}var m=s.alternate;if(m!==null){var x=m.child;if(x!==null){m.child=null;do{var E=x.sibling;x.sibling=null,x=E}while(x!==null)}}U=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,U=o;else e:for(;U!==null;){if(s=U,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Li(9,s,s.return)}var y=s.sibling;if(y!==null){y.return=s.return,U=y;break e}U=s.return}}var v=e.current;for(U=v;U!==null;){o=U;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,U=w;else e:for(o=v;U!==null;){if(a=U,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ya(9,a)}}catch(I){be(a,a.return,I)}if(a===o){U=null;break e}var C=a.sibling;if(C!==null){C.return=a.return,U=C;break e}U=a.return}}if(le=i,Vn(),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(ua,e)}catch{}r=!0}return r}finally{ue=n,Ct.transition=t}}return!1}function Wf(e,t,n){t=Jr(n,t),t=Lg(e,t,1),e=Mn(e,t,1),t=Ge(),e!==null&&(xs(e,1,t),at(e,t))}function be(e,t,n){if(e.tag===3)Wf(e,e,n);else for(;t!==null;){if(t.tag===3){Wf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Nn===null||!Nn.has(r))){e=Jr(n,e),e=zg(t,e,1),t=Mn(t,e,1),e=Ge(),t!==null&&(xs(t,1,e),at(t,e));break}}t=t.return}}function yk(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ge(),e.pingedLanes|=e.suspendedLanes&n,je===e&&(Le&n)===n&&(Pe===4||Pe===3&&(Le&130023424)===Le&&500>_e()-Lc?nr(e,0):Oc|=n),at(e,t)}function iy(e,t){t===0&&(e.mode&1?(t=Ds,Ds<<=1,!(Ds&130023424)&&(Ds=4194304)):t=1);var n=Ge();e=fn(e,t),e!==null&&(xs(e,t,n),at(e,n))}function vk(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),iy(e,n)}function xk(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(N(314))}r!==null&&r.delete(t),iy(e,n)}var sy;sy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||st.current)it=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return it=!1,ok(e,t,n);it=!!(e.flags&131072)}else it=!1,ye&&t.flags&1048576&&ug(t,jo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;fo(e,t),e=t.pendingProps;var i=Kr(t,He.current);$r(t,n),i=Pc(null,t,r,e,i,n);var s=Ac();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)?(s=!0,Mo(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Cc(t),i.updater=ga,t.stateNode=i,i._reactInternals=t,du(t,r,e,n),t=pu(null,t,r,!0,s,n)):(t.tag=0,ye&&s&&vc(t),Ke(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(fo(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Sk(r),e=Mt(r,e),i){case 0:t=hu(null,t,r,e,n);break e;case 1:t=Df(null,t,r,e,n);break e;case 11:t=Nf(null,t,r,e,n);break e;case 14:t=jf(null,t,r,Mt(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mt(r,i),hu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mt(r,i),Df(e,t,r,i,n);case 3:e:{if($g(t),e===null)throw Error(N(387));r=t.pendingProps,s=t.memoizedState,i=s.element,mg(e,t),Lo(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Jr(Error(N(423)),t),t=Of(e,t,r,n,i);break e}else if(r!==i){i=Jr(Error(N(424)),t),t=Of(e,t,r,n,i);break e}else for(ht=An(t.stateNode.containerInfo.firstChild),pt=t,ye=!0,jt=null,n=hg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qr(),r===i){t=hn(e,t,n);break e}Ke(e,t,r,n)}t=t.child}return t;case 5:return gg(t),e===null&&lu(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,ru(r,i)?o=null:s!==null&&ru(r,s)&&(t.flags|=32),Ug(e,t),Ke(e,t,o,n),t.child;case 6:return e===null&&lu(t),null;case 13:return Vg(e,t,n);case 4:return Ec(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Gr(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:Mt(r,i),Nf(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,s=t.memoizedProps,o=i.value,pe(Do,r._currentValue),r._currentValue=o,s!==null)if(Bt(s.value,o)){if(s.children===i.children&&!st.current){t=hn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=un(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),uu(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(N(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),uu(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ke(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,$r(t,n),i=Tt(i),r=r(i),t.flags|=1,Ke(e,t,r,n),t.child;case 14:return r=t.type,i=Mt(r,t.pendingProps),i=Mt(r.type,i),jf(e,t,r,i,n);case 15:return Fg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mt(r,i),fo(e,t),t.tag=1,ot(r)?(e=!0,Mo(t)):e=!1,$r(t,n),Og(t,r,i),du(t,r,i,n),pu(null,t,r,!0,e,n);case 19:return Hg(e,t,n);case 22:return Bg(e,t,n)}throw Error(N(156,t.tag))};function oy(e,t){return Nm(e,t)}function wk(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 _t(e,t,n,r){return new wk(e,t,n,r)}function Uc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sk(e){if(typeof e=="function")return Uc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===oc)return 11;if(e===ac)return 14}return 2}function Dn(e,t){var n=e.alternate;return n===null?(n=_t(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 mo(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Uc(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Tr:return rr(n.children,i,s,t);case sc:o=8,i|=8;break;case Dl:return e=_t(12,n,t,i|2),e.elementType=Dl,e.lanes=s,e;case Ol:return e=_t(13,n,t,i),e.elementType=Ol,e.lanes=s,e;case Ll:return e=_t(19,n,t,i),e.elementType=Ll,e.lanes=s,e;case gm:return xa(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pm:o=10;break e;case mm:o=9;break e;case oc:o=11;break e;case ac:o=14;break e;case Sn:o=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=_t(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function rr(e,t,n,r){return e=_t(7,e,r,t),e.lanes=n,e}function xa(e,t,n,r){return e=_t(22,e,r,t),e.elementType=gm,e.lanes=n,e.stateNode={isHidden:!1},e}function al(e,t,n){return e=_t(6,e,null,t),e.lanes=n,e}function ll(e,t,n){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function bk(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=$a(0),this.expirationTimes=$a(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$a(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $c(e,t,n,r,i,s,o,a,l){return e=new bk(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=_t(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cc(s),e}function kk(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Er,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ay(e){if(!e)return zn;e=e._reactInternals;e:{if(mr(e)!==e||e.tag!==1)throw Error(N(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(N(171))}if(e.tag===1){var n=e.type;if(ot(n))return ag(e,n,t)}return t}function ly(e,t,n,r,i,s,o,a,l){return e=$c(n,r,!0,e,i,s,o,a,l),e.context=ay(null),n=e.current,r=Ge(),i=jn(n),s=un(r,i),s.callback=t??null,Mn(n,s,i),e.current.lanes=i,xs(e,i,r),at(e,r),e}function wa(e,t,n,r){var i=t.current,s=Ge(),o=jn(i);return n=ay(n),t.context===null?t.context=n:t.pendingContext=n,t=un(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Mn(i,t,o),e!==null&&(zt(e,i,o,s),lo(e,i,o)),o}function Wo(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 qf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Vc(e,t){qf(e,t),(e=e.alternate)&&qf(e,t)}function _k(){return null}var uy=typeof reportError=="function"?reportError:function(e){console.error(e)};function Hc(e){this._internalRoot=e}Sa.prototype.render=Hc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(N(409));wa(e,t,null,null)};Sa.prototype.unmount=Hc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cr(function(){wa(null,e,null,null)}),t[dn]=null}};function Sa(e){this._internalRoot=e}Sa.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_n.length&&t!==0&&t<_n[n].priority;n++);_n.splice(n,0,e),n===0&&$m(e)}};function Wc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ba(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Kf(){}function Ck(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Wo(o);s.call(u)}}var o=ly(t,r,e,0,null,!1,!1,"",Kf);return e._reactRootContainer=o,e[dn]=o.current,ns(e.nodeType===8?e.parentNode:e),cr(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=Wo(l);a.call(u)}}var l=$c(e,0,!1,null,null,!1,!1,"",Kf);return e._reactRootContainer=l,e[dn]=l.current,ns(e.nodeType===8?e.parentNode:e),cr(function(){wa(t,l,n,r)}),l}function ka(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Wo(o);a.call(l)}}wa(t,o,e,i)}else o=Ck(n,t,e,i,r);return Wo(o)}zm=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ri(t.pendingLanes);n!==0&&(cc(t,n|1),at(t,_e()),!(le&6)&&(Xr=_e()+500,Vn()))}break;case 13:cr(function(){var r=fn(e,1);if(r!==null){var i=Ge();zt(r,e,1,i)}}),Vc(e,1)}};dc=function(e){if(e.tag===13){var t=fn(e,134217728);if(t!==null){var n=Ge();zt(t,e,134217728,n)}Vc(e,134217728)}};Fm=function(e){if(e.tag===13){var t=jn(e),n=fn(e,t);if(n!==null){var r=Ge();zt(n,e,t,r)}Vc(e,t)}};Bm=function(){return ue};Um=function(e,t){var n=ue;try{return ue=e,t()}finally{ue=n}};Kl=function(e,t,n){switch(t){case"input":if(Bl(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=ha(r);if(!i)throw Error(N(90));vm(r),Bl(r,i)}}}break;case"textarea":wm(e,n);break;case"select":t=n.value,t!=null&&zr(e,!!n.multiple,t,!1)}};Tm=zc;Im=cr;var Ek={usingClientEntryPoint:!1,Events:[Ss,Ar,ha,Cm,Em,zc]},ki={findFiberByHostInstance:Zn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Tk={bundleType:ki.bundleType,version:ki.version,rendererPackageName:ki.rendererPackageName,rendererConfig:ki.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:pn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Am(e),e===null?null:e.stateNode},findFiberByHostInstance:ki.findFiberByHostInstance||_k,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 qs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qs.isDisabled&&qs.supportsFiber)try{ua=qs.inject(Tk),Gt=qs}catch{}}vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ek;vt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wc(t))throw Error(N(200));return kk(e,t,null,n)};vt.createRoot=function(e,t){if(!Wc(e))throw Error(N(299));var n=!1,r="",i=uy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=$c(e,1,!1,null,null,n,!1,r,i),e[dn]=t.current,ns(e.nodeType===8?e.parentNode:e),new Hc(t)};vt.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(N(188)):(e=Object.keys(e).join(","),Error(N(268,e)));return e=Am(t),e=e===null?null:e.stateNode,e};vt.flushSync=function(e){return cr(e)};vt.hydrate=function(e,t,n){if(!ba(t))throw Error(N(200));return ka(null,e,t,!0,n)};vt.hydrateRoot=function(e,t,n){if(!Wc(e))throw Error(N(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=uy;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=ly(t,null,e,1,n??null,i,!1,s,o),e[dn]=t.current,ns(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 Sa(t)};vt.render=function(e,t,n){if(!ba(t))throw Error(N(200));return ka(null,e,t,!1,n)};vt.unmountComponentAtNode=function(e){if(!ba(e))throw Error(N(40));return e._reactRootContainer?(cr(function(){ka(null,null,e,!1,function(){e._reactRootContainer=null,e[dn]=null})}),!0):!1};vt.unstable_batchedUpdates=zc;vt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ba(n))throw Error(N(200));if(e==null||e._reactInternals===void 0)throw Error(N(38));return ka(e,t,n,!1,r)};vt.version="18.3.1-next-f1338f8080-20240426";function cy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cy)}catch(e){console.error(e)}}cy(),cm.exports=vt;var Ik=cm.exports,dy,Qf=Ik;dy=Qf.createRoot,Qf.hydrateRoot;function Rk(e,t){const n=e[fy];if(!n)throw new Error("ResourceElement.type is not a valid Resource");return n(t)}const fy=Symbol("fnSymbol");function re(e){const t=n=>({type:t,props:n});return t[fy]=e,t}function Zt(e,t){return{...t,key:e}}let Bi=null;function Pk(e,t){e.currentIndex=0;const n=Bi;Bi=e;try{if(t(),e.isFirstRender=!1,e.cells.length!==e.currentIndex)throw new Error(`Rendered ${e.currentIndex} hooks but expected ${e.cells.length}. Hooks must be called in the exact same order in every render.`)}finally{Bi=n}}function Fn(){if(!Bi)throw new Error("No resource fiber available");return Bi}function Ak(e){return null}const hy=e=>({version:0,committedVersion:0,dispatchUpdate:e,changelog:[],dirtyCells:[]}),qo=e=>{for(const t of e.dirtyCells)t.dirty=!1,t.queue.clear(),t.current=t.workInProgress;e.committedVersion=e.version,e.changelog.length=0,e.dirtyCells.length=0},Ui=(e,t)=>{const n=e.version>t;if(e.version=t,n){for(const r of e.dirtyCells)r.dirty=!1,r.queue.clear(),r.workInProgress=r.current;if(e.dirtyCells.length=0,t===e.committedVersion)e.changelog.length=0;else{if(e.committedVersion>t)throw new Error("Version is less than committed version");for(;e.committedVersion+e.changelog.length>t;)e.changelog.pop();e.changelog.forEach(r=>r()),qo(e)}}},Gf=(e,t)=>{t.dirty||(t.dirty=!0,e.markDirty?.(),e.root.dirtyCells.push(t))},py=(e,t)=>{const n=Fn(),r=n.currentIndex++;if(!n.isFirstRender&&r>=n.cells.length)throw new Error("Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.");let i=n.cells[r];if(i||(i=t(),n.cells[r]=i),i.type!==e)throw new Error("Hook order changed between renders");return i},Mk=e=>{Fn().renderContext.effectTasks.push(e)},Nk=(e,t)=>{if(e.renderContext)throw new Error("Resource updated during render");if(e.isNeverMounted)throw new Error("Resource updated before mount");e.root.dispatchUpdate(()=>{const n=t();return n?(n(),e.root.changelog.push(n),!0):!1})};function my(e,t,n,r){const i=py("reducer",()=>{const a=Fn(),l=r?r(n):n;return{type:"reducer",queue:new Set,dirty:!1,workInProgress:l,current:l,reducer:e,dispatch:u=>{const d={action:u,hasEagerState:!1,eagerState:void 0};Nk(a,()=>a.root.dirtyCells.length===0&&!d.hasEagerState&&(d.eagerState=e(i.workInProgress,u),d.hasEagerState=!0,Object.is(i.current,d.eagerState))?null:()=>{Gf(a,i),i.queue.add(d)})}}}),s=Fn(),o=e===i.reducer;i.reducer=e;for(const a of i.queue)(!a.hasEagerState||!o)&&(a.eagerState=e(i.workInProgress,a.action),a.hasEagerState=!0),i.workInProgress=a.eagerState;if(i.queue.clear(),t){const a=t(i.workInProgress);Object.is(a,i.workInProgress)||(Gf(s,i),i.workInProgress=a)}return[i.workInProgress,i.dispatch]}function jk(e,t,n){return my(e,void 0,t,n)}function Dk(e,t,n,r){return my(e,t,n,r)}const Ok=(e,t)=>typeof t=="function"?t(e):t,Lk=e=>typeof e=="function"?e():e;function yt(e){return jk(Ok,e,Lk)}const gy=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0},zk=()=>({type:"effect",cleanup:void 0,deps:null});function Ce(e,t){const n=py("effect",zk);if(!(t&&n.deps&&gy(n.deps,t))){if(n.deps!==null&&!!t!=!!n.deps)throw new Error("tapEffect called with and without dependencies across re-renders");Mk(()=>{const r=[];try{n.cleanup?.()}catch(i){r.push(i)}finally{n.cleanup=void 0}try{const i=e();if(i!==void 0&&typeof i!="function")throw new Error(`An effect function must either return a cleanup function or nothing. Received: ${typeof i}`);n.cleanup=i}catch(i){r.push(i)}if(n.deps=t,r.length>0){if(r.length===1)throw r[0];for(const i of r)console.error(i);throw new AggregateError(r,"Errors during commit")}})}}function Jt(e){const[t]=yt(()=>({current:e}));return t}function ir(e,t){const[n]=yt(e);return n}const Fk=()=>{throw new Error("Memo reducer should not be called")},X=(e,t)=>{Fn();const[n]=Dk(Fk,r=>r&&gy(r.deps,t)?r:{value:e(),deps:t},null);return n.value},ds=(e,t)=>X(()=>e,t);function Xt(e){const t=Jt(e);Ce(()=>{t.current=e});const n=Fn();return ds((...r)=>t.current(...r),[n])}function Bk(e){const t=[];for(const n of e.effectTasks)try{n()}catch(r){t.push(r)}if(t.length>0){if(t.length===1)throw t[0];for(const n of t)console.error(n);throw new AggregateError(t,"Errors during commit")}}function Uk(e){const t=[];for(const n of e.cells)if(n?.type==="effect"&&(n.deps=null,n.cleanup))try{n.cleanup?.()}catch(r){t.push(r)}finally{n.cleanup=void 0}if(t.length>0){if(t.length===1)throw t[0];for(const n of t)console.error(n);throw new AggregateError(t,"Errors during cleanup")}}function fs(e,t,n=void 0,r=Ak()){return{type:e,root:t,markDirty:n,devStrictMode:r,cells:[],currentIndex:0,renderContext:void 0,isFirstRender:!0,isMounted:!1,isNeverMounted:!0}}function Hr(e){if(!e.isMounted)throw new Error("Tried to unmount a fiber that is already unmounted");e.isMounted=!1,Uk(e)}function On(e,t){const n={effectTasks:[],props:t,output:void 0};return Pk(e,()=>{e.renderContext=n;try{n.output=Rk(e.type,t)}finally{e.renderContext=void 0}}),n}function Zr(e,t){e.isMounted=!0,e.isNeverMounted=!1,Bk(t)}function Oe(e,t){const n=Fn(),r=Jt(0),i=X(()=>(e.key,fs(e.type,n.root,()=>{r.current++,n.markDirty?.()})),[e.type,e.key,n]),s=t?X(()=>On(i,e.props),[i,...t,r.current]):On(i,e.props);return Ce(()=>()=>Hr(i),[i]),Ce(()=>{Zr(i,s)},[i,s]),s.output}function _a(e,t){const n=Jt(0),r=n.current,i=ir(Fn),s=ir(()=>()=>{n.current++,i.markDirty?.()}),o=ir(()=>new Map),a=t?ds(e,t):e,l=X(()=>{const u=a(),d=new Set,c=[];let f=0;for(let h=0;h<u.length;h++){const m=u[h],x=m.key;if(x===void 0)throw new Error(`tapResources did not provide a key for array at index ${h}`);if(d.has(x))throw new Error(`Duplicate key ${x} in tapResources`);d.add(x);let E=o.get(x);if(E)if(E.fiber.type!==m.type){const y=fs(m.type,i.root,s),v=On(y,m.props);E.next=[y,v],c.push(v.output)}else E.next=On(E.fiber,m.props),c.push(E.next.output);else{const y=fs(m.type,i.root,s),v=On(y,m.props);E={fiber:y,next:v},f++,o.set(x,E),c.push(v.output)}}if(o.size>c.length-f)for(const h of o.keys())d.has(h)||(o.get(h).next="delete");return c},[a,r]);return Ce(()=>()=>{for(const u of o.keys()){const d=o.get(u).fiber;Hr(d)}},[]),Ce(()=>{for(const[u,d]of o.entries())d.next==="delete"?(d.fiber.isMounted&&Hr(d.fiber),o.delete(u)):Array.isArray(d.next)?(Hr(d.fiber),d.fiber=d.next[0],Zr(d.fiber,d.next[1])):Zr(d.fiber,d.next)},[l]),l}const $k=50;let Qt={schedulers:new Set([]),isScheduled:!1};var Vk=class{constructor(e){_(this,"_task");_(this,"_isDirty",!1);this._task=e}get isDirty(){return this._isDirty}markDirty(){this._isDirty=!0,Qt.schedulers.add(this),Hk()}runTask(){this._isDirty=!1,this._task()}};const Hk=()=>{Qt.isScheduled||(Qt.isScheduled=!0,Wk())},Eu=()=>{try{const e=[];let t=0;for(const n of Qt.schedulers)if(Qt.schedulers.delete(n),!!n.isDirty){if(t++,t>$k)throw new Error("Maximum update depth exceeded. This can happen when a resource repeatedly calls setState inside tapEffect.");try{n.runTask()}catch(r){e.push(r)}}if(e.length>0){if(e.length===1)throw e[0];for(const n of e)console.error(n);throw new AggregateError(e,"Errors occurred during flushSync")}}finally{Qt.schedulers.clear(),Qt.isScheduled=!1}},Wk=(()=>{if(typeof MessageChannel<"u"){const e=new MessageChannel;return e.port1.onmessage=Eu,()=>e.port2.postMessage(null)}return()=>setTimeout(Eu,0)})(),Yf=e=>{const t=Qt;Qt={schedulers:new Set([]),isScheduled:!0};try{const n=e();return Eu(),n}finally{Qt=t}},qk=e=>{const t=ir(()=>new Vk(()=>u(null))),n=ir(()=>[]),r=X(()=>(e.key,fs(e.type,hy(d=>{!t.isDirty&&!d()||(n.push(d),t.markDirty())}))),[e.type,e.key]);Ui(r.root,r.root.committedVersion);const i=On(r,e.props),s=Jt(!1),o=Jt(e.props),a=Jt(i.output),l=ir(()=>new Set),u=Xt(d=>{if(d===null&&(Ui(r.root,2),Ui(r.root,1),n.forEach(c=>{c()}),d=On(r,o.current)),t.isDirty)throw new Error("Scheduler is dirty, this should never happen");qo(r.root),n.length=0,s.current&&Zr(r,d),!(t.isDirty||a.current===d.output)&&(a.current=d.output,l.forEach(c=>c()))});return Ce(()=>(s.current=!0,()=>{s.current=!1,Hr(r)}),[r]),Ce(()=>{o.current=i.props,qo(r.root),Zr(r,i),!(t.isDirty||a.current===i.output)&&(a.current=i.output,l.forEach(d=>d()))}),X(()=>({getValue:()=>a.current,subscribe:d=>(l.add(d),()=>l.delete(d))}),[])},$i=Symbol("tap.Context"),yy=e=>({[$i]:e}),vy=(e,t,n)=>{const r=e[$i];e[$i]=t;try{return n()}finally{e[$i]=r}},xy=e=>e[$i],Kk=re(()=>{const[e,t]=yt(()=>({renderers:{},fallbacks:[]}));return{getState:()=>e,setDataUI:ds((n,r)=>(t(i=>({...i,renderers:{...i.renderers,[n]:[...i.renderers[n]??[],r]}})),()=>{t(i=>({...i,renderers:{...i.renderers,[n]:i.renderers[n]?.filter(s=>s!==r)??[]}}))}),[]),setFallbackDataUI:ds(n=>(t(r=>({...r,fallbacks:[...r.fallbacks,n]})),()=>{t(r=>({...r,fallbacks:r.fallbacks.filter(i=>i!==n)}))}),[])}}),Qk=e=>{const t=Array.from(e).map(r=>r.getModelContext()).sort((r,i)=>(i.priority??0)-(r.priority??0)),n={};return t.reduce((r,i)=>{const s=i.priority??0;if(i.system&&(r.system?r.system+=`
|
|
41
|
-
|
|
42
|
-
${i.system}`:r.system=i.system),i.tools)for(const[o,a]of Object.entries(i.tools)){const l=r.tools?.[o];if(l&&l!==a){const u=n[o];if(u===s)throw new Error(`You tried to define a tool with the name ${o}, but it already exists.`);const d=u>s?l:a,c=u>s?a:l;r.tools[o]={...c,...d},n[o]=Math.max(u,s);continue}r.tools||(r.tools={}),r.tools[o]=a,n[o]??(n[o]=s)}return i.config&&(r.config={...r.config,...i.config}),i.callSettings&&(r.callSettings={...r.callSettings,...i.callSettings}),r},{})};var qc=class{constructor(){_(this,"_providers",new Set);_(this,"_subscribers",new Set)}getModelContext(){return Qk(this._providers)}registerModelContextProvider(e){this._providers.add(e);const t=e.subscribe?.(()=>{this.notifySubscribers()});return this.notifySubscribers(),()=>{this._providers.delete(e),t?.(),this.notifySubscribers()}}notifySubscribers(){for(const e of this._subscribers)e()}subscribe(e){return this._subscribers.add(e),()=>this._subscribers.delete(e)}};const Tu=[],Gk={modelName:void 0,toolNames:Tu},Yk=(e,t)=>e===t||e.length===t.length&&e.every((n,r)=>n===t[r]),Ks=(e,t)=>{const n=e.getModelContext(),r=n.config?.modelName,i=n.tools?Object.keys(n.tools).sort():Tu,s=i.length?i:Tu;return r===t.modelName&&Yk(s,t.toolNames)?t:{modelName:r,toolNames:s}},wy=re(()=>{const e=X(()=>new qc,[]),[t,n]=yt(()=>Ks(e,Gk));return Ce(()=>(n(r=>Ks(e,r)),e.subscribe(()=>{n(r=>Ks(e,r))})),[e]),{getState:()=>Ks(e,t),getModelContext:()=>e.getModelContext(),subscribe:r=>e.subscribe(r),register:r=>e.registerModelContextProvider(r)}}),Jk=e=>e.display!==void 0?e.display==="standalone":e.type==="human",Xk=(e,t)=>{if(!(t.status?.type==="running"||t.status?.type==="requires-action")){const r=e.complete;return typeof r!="function"?r??null:r({args:t.args,result:t.result})}const n=e.running;return typeof n!="function"?n??null:n({args:t.args})},Zk=e=>function(n){return Xk(e,n)},Iu=Symbol("assistant-ui.store.clientIndex"),e_=e=>e[Iu],Sy=yy([]),Kc=()=>xy(Sy),t_=(e,t)=>{const n=Kc();return vy(Sy,X(()=>[...n,e],[n,e]),t)},n_=new Set(["$$typeof","nodeType","then"]),Ca=(e,t)=>{if(e===Symbol.toStringTag)return t;if(typeof e!="symbol"){if(e==="toJSON")return()=>t;if(!n_.has(e))return!1}};var Qc=class{getOwnPropertyDescriptor(e,t){const n=this.get(e,t);if(n!==void 0)return{value:n,writable:!1,enumerable:!0,configurable:!1}}set(){return!1}setPrototypeOf(){return!1}defineProperty(){return!1}deleteProperty(){return!1}preventExtensions(){return!1}};const by=e=>{const t=re(e);return n=>{const r=t(n);return n.key===void 0?r:Zt(n.key,r)}},Ko=Symbol("assistant-ui.store.getValue"),r_=e=>{const t=e[Ko];if(!t)throw new Error("Client scope contains a non-client resource. Ensure your Derived get() returns a client created with tapClientResource(), not a plain resource.");return t.getState?.()},Jf=new Map;function i_(e){let t=Jf.get(e);return t||(t=function(...n){if(!this||typeof this!="object")throw new Error(`Method "${String(e)}" called without proper context. This may indicate the function was called incorrectly.`);const r=this[Ko];if(!r)throw new Error(`Method "${String(e)}" called on invalid client proxy. Ensure you are calling this method on a valid client instance.`);const i=r[e];if(!i)throw new Error(`Method "${String(e)}" is not implemented.`);if(typeof i!="function")throw new Error(`"${String(e)}" is not a function.`);return i(...n)},Jf.set(e,t)),t}var s_=class extends Qc{constructor(t,n){super();_(this,"outputRef");_(this,"index");_(this,"boundFns");_(this,"cachedReceiver");this.outputRef=t,this.index=n}get(t,n,r){if(n===Ko)return this.outputRef.current;if(n===Iu)return this.index;const i=Ca(n,"ClientProxy");if(i!==!1)return i;const s=this.outputRef.current[n];if(typeof s=="function"){this.cachedReceiver!==r&&(this.boundFns=new Map,this.cachedReceiver=r);let o=this.boundFns.get(n);return o||(o=i_(n).bind(r),this.boundFns.set(n,o)),o}return s}ownKeys(){return Object.keys(this.outputRef.current)}has(t,n){return n===Ko||n===Iu?!0:n in this.outputRef.current}};const ky=by(e=>{const t=Jt(null),n=Kc().length,r=X(()=>new Proxy({},new s_(t,n)),[n]),i=t_(r,()=>Oe(e));return t.current||(t.current=i),Ce(()=>{t.current=i}),{methods:r,state:i.getState?.(),key:e.key}}),Ea=e=>Oe(ky(e)),Vi=Symbol("assistant-ui.store.proxiedAssistantState"),ul=e=>e==="on"||e==="subscribe"||typeof e=="symbol",_y=e=>{class t extends Qc{get(r,i){const s=Ca(i,"AssistantState");if(s!==!1)return s;const o=i;if(!ul(o))return r_(e[o]())}ownKeys(){return Object.keys(e).filter(r=>!ul(r))}has(r,i){return!ul(i)&&i in e}}return new Proxy({},new t)},o_=e=>e[Vi],Xf=()=>()=>{},Cy=e=>{const t=()=>{throw new Error(e)};return t.source=null,t.query=null,t};var a_=class extends Qc{get(e,t){if(t==="subscribe"||t==="on")return Xf;if(t===Vi)return l_;const n=Ca(t,"DefaultAssistantClient");return n!==!1?n:Cy("You are using a component or hook that requires an AuiProvider. Wrap your component in an <AuiProvider> component.")}ownKeys(){return["subscribe","on",Vi]}has(e,t){return t==="subscribe"||t==="on"||t===Vi}};const Ta=new Proxy({},new a_),l_=_y(Ta),u_=()=>new Proxy({},{get(e,t){const n=Ca(t,"AssistantClient");return n!==!1?n:Cy(`The current scope does not have a "${String(t)}" property.`)}}),Ey=g.createContext(Ta),c_=()=>g.useContext(Ey),mn=({value:e,children:t})=>p.jsx(Ey.Provider,{value:e,children:t}),Et=re(e=>null),Ru=Symbol("assistant-ui.transform-scopes");function Ty(e,t){const n=e;if(n[Ru])throw new Error("transformScopes is already attached to this resource");n[Ru]=t}function d_(e){return e[Ru]}const Iy=e=>typeof e=="string"?{scope:e.split(".")[0],event:e}:{scope:e.scope,event:e.event},Ry=yy(null),f_=(e,t)=>vy(Ry,e,t),Py=()=>{const e=xy(Ry);if(!e)throw new Error("AssistantTapContext is not available");return e},Ay=()=>Py().clientRef,Gc=()=>{const{emit:e}=Py(),t=Kc();return Xt((n,r)=>{e(n,r,t)})};function h_(e,t){const n={...e},r=new Set;let i=!0;for(;i;){i=!1;for(const a of Object.values(n)){if(a.type===Et||r.has(a.type))continue;r.add(a.type);const l=d_(a.type);if(l){l(n,t),i=!0;break}}}const s={},o={};for(const[a,l]of Object.entries(n))l.type===Et?o[a]=l:s[a]=l;return{rootClients:s,derivedClients:o}}const Zf=e=>X(()=>e,[...Object.entries(e).flat()]),p_=(e,t)=>{const{rootClients:n,derivedClients:r}=h_(e,t);return{rootClients:Zf(n),derivedClients:Zf(r)}},m_=re(()=>ir(()=>{const e=new Map,t=new Set,n=new Set;return{on(r,i){const s=i;if(r==="*")return t.add(s),()=>t.delete(s);let o=e.get(r);return o||(o=new Set,e.set(r,o)),o.add(s),()=>{o.delete(s),o.size===0&&e.delete(r)}},emit(r,i,s){const o=e.get(r);!o&&t.size===0||queueMicrotask(()=>{const a=[];if(o)for(const l of o)try{l(i,s)}catch(u){a.push(u)}if(t.size>0){const l={event:r,payload:i};for(const u of t)try{u(l,s)}catch(d){a.push(d)}}if(a.length>0){if(a.length===1)throw a[0];for(const l of a)console.error(l);throw new AggregateError(a,"Errors occurred during event emission")}})},subscribe(r){return n.add(r),()=>n.delete(r)},notifySubscribers(){for(const r of n)try{r()}catch(i){console.error("NotificationManager: subscriber callback error",i)}}}})),g_=()=>null;function My(e){const t=g.useMemo(()=>hy(a=>r(a)),[]),[n,r]=g.useReducer((a,l)=>(Ui(t,a),a+(l()?1:0)),0);Ui(t,n);const i=g_(),s=g.useMemo(()=>(e.key,fs(e.type,t,void 0,i)),[e.type,e.key,t,i]),o=On(s,e.props);return g.useLayoutEffect(()=>()=>Hr(s),[s]),g.useLayoutEffect(()=>{qo(t),Zr(s,o)}),o.output}const Ny=e=>X(()=>e,e),y_=re(({element:e,emit:t,clientRef:n})=>{const{methods:r,state:i}=f_({clientRef:n,emit:t},()=>Ea(e));return X(()=>({state:i,methods:r}),[r,i])}),v_=re(({element:e,notifications:t,clientRef:n,name:r})=>{const i=qk(y_({element:e,emit:t.emit,clientRef:n}));return Ce(()=>i.subscribe(t.notifySubscribers),[i,t]),X(()=>{const s=()=>i.getValue().methods;return Object.defineProperties(s,{source:{value:"root",writable:!1},query:{value:{},writable:!1},name:{value:r,configurable:!0}}),s},[i,r])}),x_=re(()=>X(()=>({clients:[],subscribe:void 0,on:void 0}),[])),w_=re(({clients:e,clientRef:t})=>{const n=Oe(m_());Ce(()=>t.parent.subscribe(n.notifySubscribers),[t,n]);const r=Ny(_a(()=>Object.keys(e).map(i=>Zt(i,v_({element:e[i],notifications:n,clientRef:t,name:i}))),[e,n,t]));return X(()=>({clients:r,subscribe:n.subscribe,on:function(i,s){if(!this)throw new Error("const { on } = useAui() is not supported. Use aui.on() instead.");const{scope:o,event:a}=Iy(i);if(o!=="*"&&this[o].source===null)throw new Error(`Scope "${o}" is not available. Use { scope: "*", event: "${a}" } to listen globally.`);const l=n.on(a,(d,c)=>{if(o==="*"){s(d);return}const f=this[o]();f===c[e_(f)]&&s(d)});if(o!=="*"&&t.parent[o].source===null)return l;const u=t.parent.on(i,s);return()=>{l(),u()}}}),[r,n,t])}),S_=re(({element:e,clientRef:t,name:n})=>{const r=Jt(e.props);return r.current=e.props,X(()=>{const i=()=>r.current.get(t.current);return Object.defineProperties(i,{source:{value:r.current.source},query:{value:r.current.query},name:{value:n,configurable:!0}}),i},[t,n])}),b_=(e,t)=>{let n;try{const r={};for(const i of Object.keys(t.query).sort())r[i]=t.query[i];n=JSON.stringify(r)}catch{n=String(t.query)}return`${e}::${t.source}::${n}`},k_=re(({clients:e,clientRef:t})=>Ny(_a(()=>Object.keys(e).map(n=>{const r=n,i=e[r];return Zt(b_(r,i.props),S_({element:i,clientRef:t,name:r}))}),[e,t]))),__=re(({parent:e,clients:t})=>{const{rootClients:n,derivedClients:r}=p_(t,e),i=Jt({parent:e,current:null}).current;Ce(()=>{i.current=a});const s=Oe(Object.keys(n).length>0?w_({clients:n,clientRef:i}):x_()),o=Oe(k_({clients:r,clientRef:i})),a=X(()=>{const l=e===Ta?u_():e,u=Object.create(l);Object.assign(u,{subscribe:s.subscribe??e.subscribe,on:s.on??e.on,[Vi]:_y(u)});for(const d of s.clients)u[d.name]=d;for(const d of o)u[d.name]=d;return u},[e,s,o]);return i.current===null&&(i.current=a),a});function se(e,{parent:t}={parent:c_()}){if(e)return My(__({parent:t??Ta,clients:e}));if(t===null)throw new Error("received null parent, this usage is not allowed");return t}const F=e=>{const t=se(),n=o_(t),r=g.useSyncExternalStore(t.subscribe,()=>e(n),()=>e(n));if(r===n)throw new Error("You tried to return the entire AssistantState. This is not supported due to technical limitations.");return g.useDebugValue(r),r},C_=e=>{const t=se(),n=g.useRef(!1),r=n.current?null:e(t);return F(()=>n.current?e(t):r),()=>(n.current=!0,e(t))},E_=Object.freeze({});function li({getItemState:e,children:t}){return T_(t(C_(e)))}const T_=e=>{const t=typeof e=="object"&&e!=null&&"type"in e?e:null,n=t?.type,r=t?.key;return g.useMemo(()=>t,[n,r,typeof t?.props=="object"&&t.props!=null&&Object.entries(t.props).length===0?E_:t?.props])??e},I_=rt.createContext(!0);function eh(){throw new Error("A function wrapped in useEffectEvent can't be called during rendering.")}const R_="use"in rt?()=>{try{return rt.use(I_)}catch{return!1}}:()=>!1;function P_(e){const t=rt.useRef(eh);return rt.useInsertionEffect(()=>{t.current=e},[e]),(...n)=>{R_()&&eh();const r=t.current;return r(...n)}}const Qo=(e,t)=>{const n=se(),r=P_(t),{scope:i,event:s}=Iy(e);g.useEffect(()=>n.on({scope:i,event:s},r),[n,i,s])},A_=by(e=>{if(e.key===void 0)throw new Error("tapClientResource: Element has no key");return Oe(ky(e))});function ei(e,t){const n=_a(()=>e().map(s=>A_(s)),t),r=X(()=>Object.keys(n),[n]),i=X(()=>n.reduce((s,o,a)=>(s[o.key]=a,s),{}),[n]);return{state:X(()=>n.map(s=>s.state),[n]),get:s=>{if("index"in s){if(s.index<0||s.index>=r.length)throw new Error(`tapClientLookup: Index ${s.index} out of bounds (length: ${r.length})`);return n[s.index].methods}const o=i[s.key];if(o===void 0)throw new Error(`tapClientLookup: Key "${s.key}" not found`);return n[o].methods}}}const jy=re(({toolkit:e,mcpApp:t})=>{const n=_a(()=>t?[Zt("mcpApp",t)]:[],[t])[0],[r,i]=yt(()=>({})),s=X(()=>({toolUIs:r,mcpApp:n,tools:Object.fromEntries(Object.entries(r).map(([l,u])=>[l,u.map(d=>d.render)]))}),[r,n]),o=Ay(),a=ds((l,u,d)=>{const c={render:u,standalone:d?.standalone??!1};return i(f=>({...f,[l]:[...f[l]??[],c]})),()=>{i(f=>{const h=f[l]?.filter(E=>E!==c)??[];if(h.length>0)return{...f,[l]:h};const{[l]:m,...x}=f;return x})}},[]);return Ce(()=>{if(!e)return;const l=[];for(const[d,c]of Object.entries(e)){const f="render"in c?c.render:void 0,h="renderText"in c?c.renderText:void 0,m=f??(h?Zk(h):void 0);m&&l.push(a(d,m,{standalone:Jk(c)}))}const u=Object.entries(e).reduce((d,[c,f])=>{if(f.type==="mcp")return d;const{display:h,render:m,renderText:x,...E}=f;return d[c]=E,d},{});return l.push(o.current.modelContext().register({getModelContext:()=>({tools:u})})),()=>{l.forEach(d=>d())}},[e,a,o]),{getState:()=>s,setToolUI:a}});Ty(jy,(e,t)=>{!e.modelContext&&t.modelContext.source===null&&(e.modelContext=wy())});const gr=e=>{const[,t]=yt(e.getState);return Ce(()=>(t(e.getState()),e.subscribe(()=>{t(e.getState())})),[e]),e.getState()},Dy=re(({runtime:e})=>{const t=gr(e);return{getState:()=>t,remove:e.remove,__internal_getRuntime:()=>e}}),M_=re(({runtime:e,index:t})=>Oe(Dy({runtime:X(()=>e.getAttachmentByIndex(t),[e,t])}))),Oy=re(({threadIdRef:e,messageIdRef:t,runtime:n})=>{const r=gr(n),i=Gc();Ce(()=>{const a=[];for(const l of["send","attachmentAdd"]){const u=n.unstable_on(l,()=>{i(`composer.${l}`,{threadId:e.current,...t&&{messageId:t.current}})});a.push(u)}return a.push(n.unstable_on("attachmentAddError",l=>{i("composer.attachmentAddError",{threadId:e.current,...t&&{messageId:t.current},...l.attachmentId&&{attachmentId:l.attachmentId},reason:l.reason,message:l.message})})),()=>{for(const l of a)l()}},[n,i,e,t]);const s=ei(()=>r.attachments.map((a,l)=>Zt(a.id,M_({runtime:n,index:l}))),[r.attachments,n]),o=X(()=>({text:r.text,role:r.role,attachments:s.state,runConfig:r.runConfig,isEditing:r.isEditing,canCancel:r.canCancel,canSend:r.canSend,attachmentAccept:r.attachmentAccept,isEmpty:r.isEmpty,type:r.type??"thread",dictation:r.dictation,quote:r.quote,queue:[]}),[r,s.state]);return{getState:()=>o,setText:n.setText,setRole:n.setRole,setRunConfig:n.setRunConfig,addAttachment:n.addAttachment,reset:n.reset,clearAttachments:n.clearAttachments,send:n.send,cancel:n.cancel,beginEdit:n.beginEdit??(()=>{throw new Error("beginEdit is not supported in this runtime")}),startDictation:n.startDictation,stopDictation:n.stopDictation,setQuote:n.setQuote,attachment:a=>"id"in a?s.get({key:a.id}):s.get(a),queueItem:()=>{throw new Error("Queue is not supported in this runtime")},__internal_getRuntime:()=>n}}),N_=re(({runtime:e})=>{const t=gr(e);return{getState:()=>t,addToolResult:n=>e.addToolResult(n),resumeToolCall:n=>e.resumeToolCall(n),respondToToolApproval:n=>e.respondToToolApproval(n),__internal_getRuntime:()=>e}}),j_=re(({runtime:e,index:t})=>Oe(Dy({runtime:X(()=>e.getAttachmentByIndex(t),[e,t])}))),D_=re(({runtime:e,index:t})=>Oe(N_({runtime:X(()=>e.getMessagePartByIndex(t),[e,t])}))),O_=re(({runtime:e,threadIdRef:t})=>{const n=gr(e),[r,i]=yt(!1),[s,o]=yt(!1),a=X(()=>({get current(){return e.getState().id}}),[e]),l=Ea(Oy({runtime:e.composer,threadIdRef:t,messageIdRef:a})),u=ei(()=>n.content.map((f,h)=>Zt("toolCallId"in f&&f.toolCallId!=null?`toolCallId-${f.toolCallId}`:`index-${h}`,D_({runtime:e,index:h}))),[n.content,e]),d=ei(()=>(n.attachments??[]).map((f,h)=>Zt(f.id,j_({runtime:e,index:h}))),[n.attachments,e]),c=X(()=>({...n,parts:u.state,composer:l.state,isCopied:r,isHovering:s}),[n,u.state,l.state,r,s]);return{getState:()=>c,composer:()=>l.methods,reload:f=>e.reload(f),speak:()=>e.speak(),stopSpeaking:()=>e.stopSpeaking(),submitFeedback:f=>e.submitFeedback(f),switchToBranch:f=>e.switchToBranch(f),getCopyText:()=>e.unstable_getCopyText(),part:f=>"index"in f?u.get({index:f.index}):u.get({key:`toolCallId-${f.toolCallId}`}),attachment:f=>"id"in f?d.get({key:f.id}):d.get(f),setIsCopied:i,setIsHovering:o,__internal_getRuntime:()=>e}}),L_=re(({runtime:e,id:t,threadIdRef:n})=>Oe(O_({runtime:X(()=>e.getMessageById(t),[e,t]),threadIdRef:n}))),z_=re(({runtime:e})=>{const t=gr(e),n=Gc();Ce(()=>{const a=[];for(const l of["runStart","runEnd","initialize","modelContextUpdate"]){const u=e.unstable_on(l,()=>{const d=e.getState()?.threadId||"unknown";n(`thread.${l}`,{threadId:d})});a.push(u)}return()=>{for(const l of a)l()}},[e,n]);const r=X(()=>({get current(){return e.getState().threadId}}),[e]),i=Ea(Oy({runtime:e.composer,threadIdRef:r})),s=ei(()=>t.messages.map(a=>Zt(a.id,L_({runtime:e,id:a.id,threadIdRef:r}))),[t.messages,e,r]),o=X(()=>({isEmpty:s.state.length===0&&!t.isLoading,isDisabled:t.isDisabled,isLoading:t.isLoading,isRunning:t.isRunning,capabilities:t.capabilities,state:t.state,suggestions:t.suggestions,extras:t.extras,speech:t.speech,voice:t.voice,composer:i.state,messages:s.state}),[t,s,i.state]);return{getState:()=>o,composer:()=>i.methods,append:e.append,startRun:e.startRun,resumeRun:e.resumeRun,cancelRun:e.cancelRun,getModelContext:e.getModelContext,export:e.export,import:e.import,reset:e.reset,stopSpeaking:e.stopSpeaking,connectVoice:e.connectVoice,disconnectVoice:e.disconnectVoice,getVoiceVolume:e.getVoiceVolume,subscribeVoiceVolume:e.subscribeVoiceVolume,muteVoice:e.muteVoice,unmuteVoice:e.unmuteVoice,message:a=>"id"in a?s.get({key:a.id}):s.get(a),__internal_getRuntime:()=>e}}),F_=re(({runtime:e})=>{const t=gr(e),n=Gc();return Ce(()=>{const r=[];for(const i of["switchedTo","switchedAway"]){const s=e.unstable_on(i,()=>{n(`threadListItem.${i}`,{threadId:e.getState().id})});r.push(s)}return()=>{for(const i of r)i()}},[e,n]),{getState:()=>t,switchTo:e.switchTo,rename:e.rename,updateCustom:e.updateCustom,archive:e.archive,unarchive:e.unarchive,delete:e.delete,generateTitle:e.generateTitle,initialize:e.initialize,detach:e.detach,__internal_getRuntime:()=>e}}),B_=re(({runtime:e,id:t})=>Oe(F_({runtime:X(()=>e.getItemById(t),[e,t])}))),U_=re(({runtime:e,__internal_assistantRuntime:t})=>{const n=gr(e),r=Ea(z_({runtime:e.main})),i=ei(()=>Object.keys(n.threadItems).map(o=>Zt(o,B_({runtime:e,id:o}))),[n.threadItems,e]),s=X(()=>({mainThreadId:n.mainThreadId,newThreadId:n.newThreadId??null,isLoading:n.isLoading,isLoadingMore:n.isLoadingMore,hasMore:n.hasMore,threadIds:n.threadIds,archivedThreadIds:n.archivedThreadIds,threadItems:i.state,main:r.state}),[n,i.state,r.state]);return{getState:()=>s,thread:()=>r.methods,item:o=>{if(o==="main")return i.get({key:s.mainThreadId});if("id"in o)return i.get({key:o.id});const{index:a,archived:l=!1}=o,u=l?s.archivedThreadIds[a]:s.threadIds[a];return i.get({key:u})},switchToThread:async(o,a)=>{await e.switchToThread(o,a)},switchToNewThread:async()=>{await e.switchToNewThread()},getLoadThreadsPromise:()=>e.getLoadThreadsPromise(),reload:()=>e.reload(),loadMore:()=>e.loadMore(),__internal_getAssistantRuntime:()=>t}}),$_=re(e=>({getState:()=>e})),V_=re(e=>{const[t]=yt(()=>({suggestions:(e??[]).map(r=>typeof r=="string"?{title:r,label:"",prompt:r}:{title:r.title,label:r.label,prompt:r.prompt})})),n=ei(()=>t.suggestions.map((r,i)=>Zt(i,$_(r))),[t.suggestions]);return{getState:()=>t,suggestion:({index:r})=>n.get({index:r})}}),H_=re(e=>{const t=Ay();return Ce(()=>e.registerModelContextProvider(t.current.modelContext()),[e,t]),Oe(U_({runtime:e.threads,__internal_assistantRuntime:e}))}),W_=(e,t)=>{e.thread??(e.thread=Et({source:"threads",query:{type:"main"},get:n=>n.threads().thread("main")})),e.threadListItem??(e.threadListItem=Et({source:"threads",query:{type:"main"},get:n=>n.threads().item("main")})),e.composer??(e.composer=Et({source:"thread",query:{},get:n=>n.threads().thread("main").composer()})),!e.modelContext&&t.modelContext.source===null&&(e.modelContext=wy()),!e.suggestions&&t.suggestions.source===null&&(e.suggestions=V_())},Ly=re(e=>Oe(H_(e)));Ty(Ly,(e,t)=>{W_(e,t),!e.tools&&t.tools.source===null&&(e.tools=jy({})),!e.dataRenderers&&t.dataRenderers.source===null&&(e.dataRenderers=Kk())});const q_=e=>e._core?.RenderComponent,K_=g.memo(({runtime:e,aui:t=null,children:n})=>{const r=se({threads:Ly(e)},{parent:t}),i=q_(e);return p.jsxs(mn,{value:r,children:[i&&p.jsx(i,{}),n]})}),th=e=>{let t;const n=new Set,r=(u,d)=>{const c=typeof u=="function"?u(t):u;if(!Object.is(c,t)){const f=t;t=d??(typeof c!="object"||c===null)?c:Object.assign({},t,c),n.forEach(h=>h(t,f))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u))},l=t=e(r,i,a);return a},Q_=e=>e?th(e):th,G_=e=>e;function Y_(e,t=G_){const n=rt.useSyncExternalStore(e.subscribe,rt.useCallback(()=>t(e.getState()),[e,t]),rt.useCallback(()=>t(e.getInitialState()),[e,t]));return rt.useDebugValue(n),n}const nh=e=>{const t=Q_(e),n=r=>Y_(t,r);return Object.assign(n,t),n},zy=e=>e?nh(e):nh,Yc=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});if(!e||!t)throw new Error("Failed to create promise");return{promise:n,resolve:e,reject:t}},J_=()=>{const e=[];let t=!1,n,r;const i=s=>{s.promise||(s.promise=s.reader.read().then(({done:o,value:a})=>{s.promise=void 0,o?(e.splice(e.indexOf(s),1),t&&e.length===0&&n.close()):n.enqueue(a),r?.resolve(),r=void 0}).catch(o=>{console.error(o),e.forEach(a=>{a.reader.cancel()}),e.length=0,n.error(o),r?.reject(o),r=void 0}))};return{readable:new ReadableStream({start(s){n=s},pull(){return r=Yc(),e.forEach(s=>{i(s)}),r.promise},cancel(){e.forEach(s=>{s.reader.cancel()}),e.length=0}}),isSealed(){return t},seal(){t=!0,e.length===0&&n.close()},addStream(s){if(t)throw new Error("Cannot add streams after the run callback has settled.");const o={reader:s.getReader()};e.push(o),i(o)},enqueue(s){this.addStream(new ReadableStream({start(o){o.enqueue(s),o.close()}}))}}};var rh=class{constructor(e){_(this,"_controller");_(this,"_isClosed",!1);this._controller=e}append(e){return this._controller.enqueue({type:"text-delta",path:[],textDelta:e}),this}close(){this._isClosed||(this._isClosed=!0,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}};const Fy=e=>new ReadableStream({start(t){return e.start?.(new rh(t))},pull(t){return e.pull?.(new rh(t))},cancel(t){return e.cancel?.(t)}}),ih=()=>{let e;return[Fy({start(t){e=t}}),e]};var sh=class{constructor(e){_(this,"_controller");_(this,"_isClosed",!1);_(this,"_mergeTask");_(this,"_argsTextController");this._controller=e;const t=Fy({start:r=>{this._argsTextController=r}});let n=!1;this._mergeTask=t.pipeTo(new WritableStream({write:r=>{switch(r.type){case"text-delta":n=!0,this._controller.enqueue(r);break;case"part-finish":n||this._controller.enqueue({type:"text-delta",textDelta:"{}",path:[]}),this._controller.enqueue({type:"tool-call-args-text-finish",path:[]});break;default:throw new Error(`Unexpected chunk type: ${r.type}`)}}}))}get argsText(){return this._argsTextController}async setResponse(e){this._argsTextController.close(),await Promise.resolve(),this._controller.enqueue({type:"result",path:[],...e.artifact!==void 0?{artifact:e.artifact}:{},result:e.result,isError:e.isError??!1,...e.modelContent!==void 0?{modelContent:e.modelContent}:{},...e.messages!==void 0?{messages:e.messages}:{}})}async close(){this._isClosed||(this._isClosed=!0,this._argsTextController.close(),await this._mergeTask,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}};const X_=e=>new ReadableStream({start(t){return e.start?.(new sh(t))},pull(t){return e.pull?.(new sh(t))},cancel(t){return e.cancel?.(t)}}),Z_=()=>{let e;return[X_({start(t){e=t}}),e]};var By=class{constructor(){_(this,"value",-1)}up(){return++this.value}},eC=class extends TransformStream{constructor(e){super({transform(t,n){n.enqueue({...t,path:[e,...t.path]})}})}};(class extends TransformStream{constructor(e){super({transform(t,n){const{path:[r,...i]}=t;if(e!==r)throw new Error(`Path mismatch: expected ${e}, got ${r}`);n.enqueue({...t,path:i})}})}});var tC=class extends TransformStream{constructor(e){const t=new By,n=new Map;super({transform(r,i){r.type==="part-start"&&r.path.length===0&&n.set(t.up(),e.up());const[s,...o]=r.path;if(s===void 0){i.enqueue(r);return}const a=n.get(s);if(a===void 0)throw new Error("Path not found");i.enqueue({...r,path:[a,...o]})}})}},nC=class extends TransformStream{constructor(e){super();const t=e(super.readable);Object.defineProperty(this,"readable",{value:t,writable:!1})}},Uy=class extends TransformStream{constructor(){const e=[];super({transform(t,n){if(t.type==="part-start"){if(t.path.length!==0){n.error(new Error("Nested parts are not supported"));return}e.push(t.part),n.enqueue(t);return}if(t.type==="text-delta"||t.type==="result"||t.type==="part-finish"||t.type==="tool-call-args-text-finish"){if(t.path.length!==1){n.error(new Error(`${t.type} chunks must have a path of length 1`));return}const r=t.path[0];if(r<0||r>=e.length){n.error(new Error(`Invalid path index: ${r}`));return}const i=e[r];n.enqueue({...t,meta:i});return}n.enqueue(t)}})}};let $y=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r};const rC=$y("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);var iC=class Vy{constructor(t){_(this,"_state");_(this,"_parentId");this._state=t||{merger:J_(),contentCounter:new By}}get __internal_isClosed(){return this._state.merger.isSealed()}__internal_getReadable(){return this._state.merger.readable}__internal_subscribeToClose(t){this._state.closeSubscriber=t}_addPart(t,n){this._state.append&&(this._state.append.controller.close(),this._state.append=void 0),this.enqueue({type:"part-start",part:t,path:[]}),this._state.merger.addStream(n.pipeThrough(new eC(this._state.contentCounter.value)))}merge(t){this._state.merger.addStream(t.pipeThrough(new tC(this._state.contentCounter)))}appendText(t){(this._state.append?.kind!=="text"||this._state.append.parentId!==this._parentId)&&(this._state.append={kind:"text",parentId:this._parentId,controller:this.addTextPart()}),this._state.append.controller.append(t)}appendReasoning(t){(this._state.append?.kind!=="reasoning"||this._state.append.parentId!==this._parentId)&&(this._state.append={kind:"reasoning",parentId:this._parentId,controller:this.addReasoningPart()}),this._state.append.controller.append(t)}addTextPart(){const[t,n]=ih();return this._addPart(this._withParentIdOption({type:"text"}),t),n}addReasoningPart(){const[t,n]=ih();return this._addPart(this._withParentIdOption({type:"reasoning"}),t),n}addToolCallPart(t){const n=typeof t=="string"?{toolName:t}:t,r=n.toolName,i=n.toolCallId??rC(),[s,o]=Z_();return this._addPart({type:"tool-call",toolName:r,toolCallId:i,...this._parentId&&{parentId:this._parentId}},s),n.argsText!==void 0&&(o.argsText.append(n.argsText),o.argsText.close()),n.args!==void 0&&(o.argsText.append(JSON.stringify(n.args)),o.argsText.close()),n.response!==void 0&&o.setResponse(n.response),o}_finishedPartStream(){return new ReadableStream({start(t){t.enqueue({type:"part-finish",path:[]}),t.close()}})}_withParentIdOption(t){return this._parentId?{...t,parentId:this._parentId}:t}appendSource(t){this._addPart(this._withParentIdOption(t),this._finishedPartStream())}appendFile(t){this._addPart(this._withParentIdOption(t),this._finishedPartStream())}appendData(t){this._addPart(this._withParentIdOption(t),this._finishedPartStream())}enqueue(t){this._state.merger.enqueue(t),t.type==="part-start"&&t.path.length===0&&this._state.contentCounter.up()}withParentId(t){const n=new Vy(this._state);return n._parentId=t,n}close(){this._state.append?.controller?.close(),this._state.merger.seal(),this._state.closeSubscriber?.()}};function sC(e){const t=new iC;return(async()=>{try{await e(t)}catch(r){throw t.__internal_isClosed||t.enqueue({type:"error",path:[],error:String(r)}),r}finally{t.__internal_isClosed||t.close()}})(),t.__internal_getReadable()}function oC(){const{resolve:e,promise:t}=Yc();let n;return[sC(r=>(n=r,n.__internal_subscribeToClose(e),t)),n]}function aC(e){const t=["ROOT"];let n=-1,r=null;const i=[];let s;function o(){s!==void 0&&(i.push(JSON.parse(`"${s}"`)),s=void 0)}function a(c,f,h){switch(c){case'"':n=f,t.pop(),t.push(h),t.push("INSIDE_STRING"),o();break;case"f":case"t":case"n":n=f,r=f,t.pop(),t.push(h),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(h),t.push("INSIDE_NUMBER"),o();break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=f,t.pop(),t.push(h),t.push("INSIDE_NUMBER"),o();break;case"{":n=f,t.pop(),t.push(h),t.push("INSIDE_OBJECT_START"),o();break;case"[":n=f,t.pop(),t.push(h),t.push("INSIDE_ARRAY_START"),o();break}}function l(c,f){switch(c){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=f,t.pop(),s=i.pop();break}}function u(c,f){switch(c){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA"),s=(Number(s)+1).toString();break;case"]":n=f,t.pop(),s=i.pop();break}}for(let c=0;c<e.length;c++){const f=e[c];switch(t[t.length-1]){case"ROOT":a(f,c,"FINISH");break;case"INSIDE_OBJECT_START":switch(f){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY"),s="";break;case"}":n=c,t.pop(),s=i.pop();break}break;case"INSIDE_OBJECT_AFTER_COMMA":switch(f){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY"),s="";break}break;case"INSIDE_OBJECT_KEY":switch(f){case'"':t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break;case"\\":t.push("INSIDE_STRING_ESCAPE"),s+=f;break;default:s+=f;break}break;case"INSIDE_OBJECT_AFTER_KEY":switch(f){case":":t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}break;case"INSIDE_OBJECT_BEFORE_VALUE":a(f,c,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":l(f,c);break;case"INSIDE_STRING":switch(f){case'"':t.pop(),n=c,s=i.pop();break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=c}break;case"INSIDE_ARRAY_START":switch(f){case"]":n=c,t.pop(),s=i.pop();break;default:n=c,s="0",a(f,c,"INSIDE_ARRAY_AFTER_VALUE");break}break;case"INSIDE_ARRAY_AFTER_VALUE":switch(f){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA"),s=(Number(s)+1).toString();break;case"]":n=c,t.pop(),s=i.pop();break;default:n=c;break}break;case"INSIDE_ARRAY_AFTER_COMMA":a(f,c,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),t[t.length-1]==="INSIDE_STRING"?n=c:t[t.length-1]==="INSIDE_OBJECT_KEY"&&(s+=f);break;case"INSIDE_NUMBER":switch(f){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=c;break;case"e":case"E":case"-":case".":break;case",":t.pop(),s=i.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&u(f,c),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&l(f,c);break;case"}":t.pop(),s=i.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&l(f,c);break;case"]":t.pop(),s=i.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&u(f,c);break;default:t.pop(),s=i.pop();break}break;case"INSIDE_LITERAL":{const h=e.substring(r,c+1);!"false".startsWith(h)&&!"true".startsWith(h)&&!"null".startsWith(h)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?l(f,c):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&u(f,c)):n=c;break}}}let d=e.slice(0,n+1);for(let c=t.length-1;c>=0;c--)switch(t[c]){case"INSIDE_STRING":d+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":d+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":d+="]";break;case"INSIDE_LITERAL":{const f=e.substring(r,e.length);"true".startsWith(f)?d+="true".slice(f.length):"false".startsWith(f)?d+="false".slice(f.length):"null".startsWith(f)&&(d+="null".slice(f.length))}}return[d,i]}var ui={exports:{}};const lC=typeof Buffer<"u",oh=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,ah=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Hy(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),lC&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));const r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;const i=n&&n.protoAction||"error",s=n&&n.constructorAction||"error";if(i==="ignore"&&s==="ignore")return r;if(i!=="ignore"&&s!=="ignore"){if(oh.test(e)===!1&&ah.test(e)===!1)return r}else if(i!=="ignore"&&s==="ignore"){if(oh.test(e)===!1)return r}else if(ah.test(e)===!1)return r;return Wy(r,{protoAction:i,constructorAction:s,safe:n&&n.safe})}function Wy(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let i=[e];for(;i.length;){const s=i;i=[];for(const o of s){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(o,"constructor")&&o.constructor!==null&&typeof o.constructor=="object"&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete o.constructor}for(const a in o){const l=o[a];l&&typeof l=="object"&&i.push(l)}}}return e}function Jc(e,t,n){const{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return Hy(e,t,n)}finally{Error.stackTraceLimit=r}}function uC(e,t){const{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return Hy(e,t,{safe:!0})}catch{return}finally{Error.stackTraceLimit=n}}ui.exports=Jc;ui.exports.default=Jc;ui.exports.parse=Jc;ui.exports.safeParse=uC;ui.exports.scan=Wy;var cC=ui.exports;const Pu=ys(cC),go=Symbol("aui.parse-partial-json-object.meta"),dC=e=>e?.[go],Au=e=>{if(e.length===0)return{[go]:{state:"partial",partialPath:[]}};try{const t=Pu.parse(e);if(typeof t!="object"||t===null)throw new Error("argsText is expected to be an object");return t[go]={state:"complete",partialPath:[]},t}catch{try{const[t,n]=aC(e),r=Pu.parse(t);if(typeof r!="object"||r===null)throw new Error("argsText is expected to be an object");return r[go]={state:"partial",partialPath:n},r}catch{return}}},qy=(e,t,n)=>{if(typeof e!="object"||e===null)return t.state;if(t.state==="complete")return"complete";if(n.length===0)return t.state;const[r,...i]=n;if(!Object.hasOwn(e,r))return"partial";const[s,...o]=t.partialPath;if(r!==s)return"complete";const a=e[r];return qy(a,{state:"partial",partialPath:o},i)},ti=(e,t)=>{const n=dC(e);if(!n)throw new Error("unable to determine object state");return qy(e,n,t.map(String))};async function*fC(){const e=this.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{e.releaseLock()}}function cl(e){var t;return e[t=Symbol.asyncIterator]??(e[t]=fC),e}const lh=Symbol.for("aui.tool-response");var ln=class Mu{constructor(t){_(this,"artifact");_(this,"result");_(this,"isError");_(this,"modelContent");_(this,"messages");t.artifact!==void 0&&(this.artifact=t.artifact),this.result=t.result,this.isError=t.isError??!1,t.modelContent!==void 0&&(this.modelContent=t.modelContent),t.messages!==void 0&&(this.messages=t.messages)}get[lh](){return!0}static[Symbol.hasInstance](t){return typeof t=="object"&&t!==null&&lh in t}static toResponse(t){return t instanceof Mu?t:new Mu({result:t===void 0?"<no result>":t})}};function hC(e,t,n){try{const r=e();if(typeof r=="object"&&r!==null&&"then"in r)return r.then(t,n);t(r)}catch(r){n(r)}}function ni(e,t){let n=e;for(const r of t){if(n==null)return;n=n[r]}return n}var pC=class{constructor(e,t,n){_(this,"resolve");_(this,"reject");_(this,"disposed",!1);_(this,"fieldPath");this.resolve=e,this.reject=t,this.fieldPath=n}update(e){if(!this.disposed)try{if(ti(e,this.fieldPath)==="complete"){const t=ni(e,this.fieldPath);t!==void 0&&(this.resolve(t),this.dispose())}}catch(t){this.reject(t),this.dispose()}}end(e){if(!this.disposed)try{const t=ni(e,this.fieldPath);this.resolve(t)}catch(t){this.reject(t)}finally{this.dispose()}}dispose(){this.disposed=!0}},mC=class{constructor(e,t){_(this,"controller");_(this,"disposed",!1);_(this,"fieldPath");this.controller=e,this.fieldPath=t}update(e){if(!this.disposed)try{const t=ni(e,this.fieldPath);t!==void 0&&this.controller.enqueue(t),ti(e,this.fieldPath)==="complete"&&(this.controller.close(),this.dispose())}catch(t){this.controller.error(t),this.dispose()}}end(){this.disposed||(this.controller.close(),this.dispose())}dispose(){this.disposed=!0}},gC=class{constructor(e,t){_(this,"controller");_(this,"disposed",!1);_(this,"fieldPath");_(this,"lastValue");this.controller=e,this.fieldPath=t}update(e){if(!this.disposed)try{const t=ni(e,this.fieldPath);if(t!==void 0&&typeof t=="string"){const n=t.substring(this.lastValue?.length||0);this.lastValue=t,this.controller.enqueue(n)}ti(e,this.fieldPath)==="complete"&&(this.controller.close(),this.dispose())}catch(t){this.controller.error(t),this.dispose()}}end(){this.disposed||(this.controller.close(),this.dispose())}dispose(){this.disposed=!0}},yC=class{constructor(e,t){_(this,"controller");_(this,"disposed",!1);_(this,"fieldPath");_(this,"processedIndexes",new Set);this.controller=e,this.fieldPath=t}update(e){if(!this.disposed)try{const t=ni(e,this.fieldPath);if(!Array.isArray(t))return;for(let n=0;n<t.length;n++)this.processedIndexes.has(n)||ti(e,[...this.fieldPath,n])==="complete"&&(this.controller.enqueue(t[n]),this.processedIndexes.add(n));ti(e,this.fieldPath)==="complete"&&(this.controller.close(),this.dispose())}catch(t){this.controller.error(t),this.dispose()}}end(){this.disposed||(this.controller.close(),this.dispose())}dispose(){this.disposed=!0}},vC=class{constructor(e){_(this,"argTextDeltas");_(this,"handles",new Set);_(this,"args",Au(""));_(this,"finished",!1);this.argTextDeltas=e,this.processStream()}async processStream(){try{let e="";const t=this.argTextDeltas.getReader();for(;;){const{value:n,done:r}=await t.read();if(r)break;e+=n;const i=Au(e);if(i!==void 0){this.args=i;for(const s of this.handles)s.update(i)}}}catch(e){console.error("Error processing argument stream:",e)}finally{this.finished=!0;for(const e of this.handles)e.end(this.args);this.handles.clear()}}get(...e){return new Promise((t,n)=>{const r=new pC(t,n,e);if(this.args&&ti(this.args,e)==="complete"){const i=ni(this.args,e);if(i!==void 0){t(i);return}}if(this.finished){r.end(this.args);return}this.handles.add(r),r.update(this.args)})}streamValues(...e){const t=e;let n;return cl(new ReadableStream({start:r=>{n=new mC(r,t),this.finished||this.handles.add(n),n.update(this.args),this.finished&&n.end()},cancel:()=>{n&&(n.dispose(),this.handles.delete(n))}}))}streamText(...e){const t=e;let n;return cl(new ReadableStream({start:r=>{n=new gC(r,t),this.finished||this.handles.add(n),n.update(this.args),this.finished&&n.end()},cancel:()=>{n&&(n.dispose(),this.handles.delete(n))}}))}forEach(...e){const t=e;let n;return cl(new ReadableStream({start:r=>{n=new yC(r,t),this.finished||this.handles.add(n),n.update(this.args),this.finished&&n.end()},cancel:()=>{n&&(n.dispose(),this.handles.delete(n))}}))}},xC=class{constructor(e){_(this,"promise");this.promise=e}get(){return this.promise}},wC=class{constructor(){_(this,"args");_(this,"response");_(this,"writable");_(this,"resolve");_(this,"argsText","");_(this,"result",{get:async()=>(await this.response.get()).result});const e=new TransformStream;this.writable=e.writable,this.args=new vC(e.readable);const{promise:t,resolve:n}=Yc();this.resolve=n,this.response=new xC(t)}async appendArgsTextDelta(e){const t=this.writable.getWriter();try{await t.write(e)}catch(n){console.warn(n)}finally{t.releaseLock()}this.argsText+=e}async finishArgsText(){const e=this.writable.getWriter();try{await e.close()}catch(t){console.warn(t)}finally{e.releaseLock()}}setResponse(e){this.resolve(e)}},SC=class extends nC{constructor(e){const t=new Map,n=new Map;super(r=>{const i=new TransformStream({async transform(s,o){switch((s.type!=="part-finish"||s.meta.type!=="tool-call")&&o.enqueue(s),s.type){case"part-start":if(s.part.type==="tool-call"){const a=new wC;n.set(s.part.toolCallId,a),e.streamCall({reader:a,toolCallId:s.part.toolCallId,toolName:s.part.toolName})}break;case"text-delta":if(s.meta.type==="tool-call"){const a=s.meta.toolCallId,l=n.get(a);if(!l)throw new Error("No controller found for tool call");await l.appendArgsTextDelta(s.textDelta)}break;case"result":{if(s.meta.type!=="tool-call")break;const{toolCallId:a}=s.meta,l=n.get(a);if(!l)throw new Error("No controller found for tool call");l.setResponse(new ln({result:s.result,artifact:s.artifact,isError:s.isError,modelContent:s.modelContent}));break}case"tool-call-args-text-finish":{if(s.meta.type!=="tool-call")break;const{toolCallId:a,toolName:l}=s.meta,u=n.get(a);if(!u)throw new Error("No controller found for tool call");await u.finishArgsText();let d=!1;const c=hC(()=>{let f;try{f=Pu.parse(u.argsText)}catch(m){throw new Error(`Function parameter parsing failed. ${JSON.stringify(m.message)}`)}const h=e.execute({toolCallId:a,toolName:l,args:f});return h!==void 0&&(d=!0,e.onExecutionStart?.(a,l)),h},f=>{if(d&&e.onExecutionEnd?.(a,l),f===void 0)return;const h=new ln({artifact:f.artifact,result:f.result,isError:f.isError,messages:f.messages,modelContent:f.modelContent});u.setResponse(h),o.enqueue({type:"result",path:s.path,...h})},f=>{d&&e.onExecutionEnd?.(a,l);const h=new ln({result:String(f),isError:!0});u.setResponse(h),o.enqueue({type:"result",path:s.path,...h})});c&&t.set(a,c);break}case"part-finish":{if(s.meta.type!=="tool-call")break;const{toolCallId:a}=s.meta,l=t.get(a);l?l.then(()=>{t.delete(a),n.delete(a),o.enqueue(s)}):o.enqueue(s)}}},async flush(){await Promise.all(t.values())}});return r.pipeThrough(new Uy).pipeThrough(i)})}};const bC=e=>typeof e=="object"&&e!==null&&"~standard"in e&&e["~standard"].version===1;function kC(e,t,n,r){const i=e?.[n.toolName];return i?.execute?(async o=>{if(t.aborted)return new ln({result:"Tool execution was cancelled.",isError:!0});let a=o;if(bC(i.parameters)){let d=i.parameters["~standard"].validate(n.args);d instanceof Promise&&(d=await d),d.issues&&(a=i.experimental_onSchemaValidationError??(()=>{throw new Error(`Function parameter validation failed. ${JSON.stringify(d.issues)}`)}))}const l=new Promise(d=>{const c=()=>{queueMicrotask(()=>{queueMicrotask(()=>{d(new ln({result:"Tool execution was cancelled.",isError:!0}))})})};t.aborted?c():t.addEventListener("abort",c,{once:!0})}),u=(async()=>{const d=await a(n.args,{toolCallId:n.toolCallId,abortSignal:t,human:f=>r(n.toolCallId,f)}),c=ln.toResponse(d);if(i.toModelOutput&&!c.isError&&c.modelContent===void 0)try{const f=await i.toModelOutput({toolCallId:n.toolCallId,input:n.args,output:c.result});return new ln({result:c.result,artifact:c.artifact,isError:c.isError,messages:c.messages,modelContent:f})}catch(f){console.warn(`[assistant-stream] tool "${n.toolName}" toModelOutput threw; falling back to default projection.`,f)}return c})();return Promise.race([u,l])})(i.execute):void 0}function _C(e,t,n,r,i){e?.[r.toolName]?.streamCall?.(n,{toolCallId:r.toolCallId,abortSignal:t,human:s=>i(r.toolCallId,s)})}function CC(e,t,n,r){const i=typeof e=="function"?e:()=>e,s=typeof t=="function"?t:()=>t;return new SC({execute:o=>kC(i(),s(),o,n),streamCall:({reader:o,...a})=>_C(i(),s(),o,a,n),onExecutionStart:r?.onExecutionStart,onExecutionEnd:r?.onExecutionEnd})}const Ky=({index:e,children:t})=>p.jsx(mn,{value:se({attachment:Et({source:"message",query:{type:"index",index:e},get:n=>n.message().attachment({index:e})})}),children:t}),Qy=({index:e,children:t})=>p.jsx(mn,{value:se({attachment:Et({source:"composer",query:{type:"index",index:e},get:n=>n.composer().attachment({index:e})})}),children:t}),Gy=({index:e,children:t})=>p.jsx(mn,{value:se({message:Et({source:"thread",query:{type:"index",index:e},get:n=>n.thread().message({index:e})}),composer:Et({source:"message",query:{},get:n=>n.thread().message({index:e}).composer()})}),children:t}),Xc=({index:e,children:t})=>p.jsx(mn,{value:se({part:Et({source:"message",query:{type:"index",index:e},get:n=>n.message().part({index:e})})}),children:t}),EC=re(({text:e,isRunning:t})=>{const n=X(()=>({type:"text",text:e,status:t?{type:"running"}:{type:"complete"}}),[e,t]);return{getState:()=>n,addToolResult:()=>{throw new Error("Not supported")},resumeToolCall:()=>{throw new Error("Not supported")},respondToToolApproval:()=>{throw new Error("Not supported")}}}),Zc=({text:e,isRunning:t=!1,children:n})=>p.jsx(mn,{value:se({part:EC({text:e,isRunning:t})}),children:n}),TC=Object.freeze({type:"complete"}),IC=re(({parts:e,getMessagePart:t})=>{const[n,r]=yt(!0),i=X(()=>e[e.length-1]?.status??TC,[e]),s=X(()=>({parts:e,collapsed:n,status:i}),[e,n,i]);return{getState:()=>s,setCollapsed:r,part:t}}),RC=({startIndex:e,endIndex:t,children:n})=>{const r=F(s=>s.message.parts).slice(e,t+1),i=se();return p.jsx(mn,{value:se({chainOfThought:IC({parts:r,getMessagePart:({index:s})=>{if(s<0||s>=r.length)throw new Error(`ChainOfThought part index ${s} is out of bounds (0..${r.length-1})`);return i.message().part({index:e+s})}})}),children:n})},Yy=({index:e,children:t})=>p.jsx(mn,{value:se({suggestion:Et({source:"suggestions",query:{index:e},get:n=>n.suggestions().suggestion({index:e})})}),children:t}),PC=({index:e,children:t})=>p.jsx(mn,{value:se({queueItem:Et({source:"composer",query:{index:e},get:n=>n.composer().queueItem({index:e})})}),children:t}),dr=Symbol("innerMessage"),dl=Symbol("innerMessages"),AC=[],MC=(e,t)=>{dr in e||(e[dr]=t)},NC=e=>{const t="messages"in e?e.messages:e,n=t[dl]||t[dr];return n?Array.isArray(n)?n:(t[dl]=[n],t[dl]):AC},Ut=Symbol("skip-update");function jC(e,t){if(e===void 0&&t===void 0)return!0;if(e===void 0||t===void 0)return!1;for(const n of Object.keys(e)){const r=e[n],i=t[n];if(!Object.is(r,i))return!1}return!0}var DC=class{constructor(){_(this,"_subscribers",new Set)}subscribe(e){return this._subscribers.add(e),()=>this._subscribers.delete(e)}waitForUpdate(){return new Promise(e=>{const t=this.subscribe(()=>{t(),e()})})}_notifySubscribers(){const e=[];for(const t of this._subscribers)try{t()}catch(n){e.push(n)}if(e.length>0){if(e.length===1)throw e[0];for(const t of e)console.error(t);throw new AggregateError(e)}}},Ia=class{constructor(){_(this,"_subscriptions",new Set);_(this,"_connection")}get isConnected(){return!!this._connection}notifySubscribers(e){for(const t of this._subscriptions)t(e)}_updateConnection(){if(this._subscriptions.size>0){if(this._connection)return;this._connection=this._connect()}else this._connection?.(),this._connection=void 0}subscribe(e){return this._subscriptions.add(e),this._updateConnection(),()=>{this._subscriptions.delete(e),this._updateConnection()}}},Dt=class extends Ia{constructor(t){super();_(this,"binding");_(this,"_previousState");_(this,"getState",()=>(this.isConnected||this._syncState(),this._previousState));this.binding=t;const n=t.getState();if(n===Ut)throw new Error("Entry not available in the store");this._previousState=n}get path(){return this.binding.path}_syncState(){const t=this.binding.getState();return t===Ut||jC(t,this._previousState)?!1:(this._previousState=t,!0)}_connect(){const t=()=>{this._syncState()&&this.notifySubscribers()};return this.binding.subscribe(t)}},ed=class extends Ia{constructor(t){super();_(this,"binding");_(this,"_previousStateDirty",!0);_(this,"_previousState");_(this,"getState",()=>{if(!this.isConnected||this._previousStateDirty){const t=this.binding.getState();t!==Ut&&(this._previousState=t),this._previousStateDirty=!1}if(this._previousState===void 0)throw new Error("Entry not available in the store");return this._previousState});this.binding=t}get path(){return this.binding.path}_connect(){const t=()=>{this._previousStateDirty=!0,this.notifySubscribers()};return this.binding.subscribe(t)}},Go=class extends Ia{constructor(t){super();_(this,"binding");this.binding=t}get path(){return this.binding.path}getState(){return this.binding.getState()}outerSubscribe(t){return this.binding.subscribe(t)}_connect(){const t=()=>{this.notifySubscribers()};let n=this.binding.getState(),r=n?.subscribe(t);const i=()=>{const o=this.binding.getState();o!==n&&(n=o,r?.(),r=o?.subscribe(t),t())},s=this.outerSubscribe(i);return()=>{s?.(),r?.()}}},Jy=class extends Ia{constructor(t){super();_(this,"config");this.config=t}getState(){return this.config.binding.getState()}outerSubscribe(t){return this.config.binding.subscribe(t)}_connect(){const t=o=>{this.notifySubscribers(o)};let n=this.config.binding.getState(),r=n?.unstable_on(this.config.event,t);const i=()=>{const o=this.config.binding.getState();o!==n&&(n=o,r?.(),r=o?.unstable_on(this.config.event,t))},s=this.outerSubscribe(i);return()=>{s?.(),r?.()}}},Xy=class{constructor(e){_(this,"_core");this._core=e,this.__internal_bindMethods()}get path(){return this._core.path}__internal_bindMethods(){this.getState=this.getState.bind(this),this.remove=this.remove.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this._core.getState()}subscribe(e){return this._core.subscribe(e)}},Zy=class extends Xy{constructor(t,n){super(t);_(this,"_composerApi");this._composerApi=n}remove(){const t=this._composerApi.getState();if(!t)throw new Error("Composer is not available");return t.removeAttachment(this.getState().id)}},OC=class extends Zy{get source(){return"thread-composer"}},LC=class extends Zy{get source(){return"edit-composer"}},zC=class extends Xy{get source(){return"message"}remove(){throw new Error("Message attachments cannot be removed")}};const ev=Object.freeze([]),tv=Object.freeze({}),FC=e=>Object.freeze({type:"thread",isEditing:e?.isEditing??!1,canCancel:e?.canCancel??!1,canSend:e?.canSend??!1,isEmpty:e?.isEmpty??!0,attachments:e?.attachments??ev,text:e?.text??"",role:e?.role??"user",runConfig:e?.runConfig??tv,attachmentAccept:e?.attachmentAccept??"",dictation:e?.dictation,quote:e?.quote,value:e?.text??""}),BC=e=>Object.freeze({type:"edit",isEditing:e?.isEditing??!1,canCancel:e?.canCancel??!1,canSend:e?.canSend??!1,isEmpty:e?.isEmpty??!0,text:e?.text??"",role:e?.role??"user",attachments:e?.attachments??ev,runConfig:e?.runConfig??tv,attachmentAccept:e?.attachmentAccept??"",dictation:e?.dictation,quote:e?.quote,parentId:e?.parentId??null,sourceId:e?.sourceId??null,value:e?.text??""});var nv=class{constructor(e){_(this,"_core");_(this,"_eventSubscriptionSubjects",new Map);this._core=e}get path(){return this._core.path}__internal_bindMethods(){this.setText=this.setText.bind(this),this.setRunConfig=this.setRunConfig.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.addAttachment=this.addAttachment.bind(this),this.reset=this.reset.bind(this),this.clearAttachments=this.clearAttachments.bind(this),this.send=this.send.bind(this),this.cancel=this.cancel.bind(this),this.setRole=this.setRole.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.startDictation=this.startDictation.bind(this),this.stopDictation=this.stopDictation.bind(this),this.setQuote=this.setQuote.bind(this),this.unstable_on=this.unstable_on.bind(this)}setText(e){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.setText(e)}setRunConfig(e){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.setRunConfig(e)}addAttachment(e){const t=this._core.getState();if(!t)throw new Error("Composer is not available");return t.addAttachment(e)}reset(){const e=this._core.getState();if(!e)throw new Error("Composer is not available");return e.reset()}clearAttachments(){const e=this._core.getState();if(!e)throw new Error("Composer is not available");return e.clearAttachments()}send(e){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.send(e)}cancel(){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.cancel()}setRole(e){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.setRole(e)}startDictation(){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.startDictation()}stopDictation(){const e=this._core.getState();if(!e)throw new Error("Composer is not available");e.stopDictation()}setQuote(e){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.setQuote(e)}subscribe(e){return this._core.subscribe(e)}unstable_on(e,t){let n=this._eventSubscriptionSubjects.get(e);return n||(n=new Jy({event:e,binding:this._core}),this._eventSubscriptionSubjects.set(e,n)),n.subscribe(t)}},UC=class extends nv{constructor(t){const n=new ed({path:t.path,getState:()=>FC(t.getState()),subscribe:r=>t.subscribe(r)});super({path:t.path,getState:()=>t.getState(),subscribe:r=>n.subscribe(r)});_(this,"_getState");this._getState=n.getState.bind(n),this.__internal_bindMethods()}get path(){return this._core.path}get type(){return"thread"}getState(){return this._getState()}getAttachmentByIndex(t){return new OC(new Dt({path:{...this.path,attachmentSource:"thread-composer",attachmentSelector:{type:"index",index:t},ref:`${this.path.ref}.attachments[${t}]`},getState:()=>{const n=this.getState().attachments[t];return n?{...n,source:"thread-composer"}:Ut},subscribe:n=>this._core.subscribe(n)}),this._core)}},$C=class extends nv{constructor(t,n){const r=new ed({path:t.path,getState:()=>BC(t.getState()),subscribe:i=>t.subscribe(i)});super({path:t.path,getState:()=>t.getState(),subscribe:i=>r.subscribe(i)});_(this,"_beginEdit");_(this,"_getState");this._beginEdit=n,this._getState=r.getState.bind(r),this.__internal_bindMethods()}get path(){return this._core.path}get type(){return"edit"}__internal_bindMethods(){super.__internal_bindMethods(),this.beginEdit=this.beginEdit.bind(this)}getState(){return this._getState()}beginEdit(){this._beginEdit()}getAttachmentByIndex(t){return new LC(new Dt({path:{...this.path,attachmentSource:"edit-composer",attachmentSelector:{type:"index",index:t},ref:`${this.path.ref}.attachments[${t}]`},getState:()=>{const n=this.getState().attachments[t];return n?{...n,source:"edit-composer"}:Ut},subscribe:n=>this._core.subscribe(n)}),this._core)}};const hs=e=>e.content.filter(t=>t.type==="text").map(t=>t.text).join(`
|
|
43
|
-
|
|
44
|
-
`);var uh=class{constructor(e,t,n){_(this,"contentBinding");_(this,"messageApi");_(this,"threadApi");this.contentBinding=e,this.messageApi=t,this.threadApi=n,this.__internal_bindMethods()}get path(){return this.contentBinding.path}__internal_bindMethods(){this.addToolResult=this.addToolResult.bind(this),this.resumeToolCall=this.resumeToolCall.bind(this),this.respondToToolApproval=this.respondToToolApproval.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this.contentBinding.getState()}addToolResult(e){const t=this.contentBinding.getState();if(!t)throw new Error("Message part is not available");if(t.type!=="tool-call")throw new Error("Tried to add tool result to non-tool message part");if(!this.messageApi)throw new Error("Message API is not available. This is likely a bug in assistant-ui.");if(!this.threadApi)throw new Error("Thread API is not available");const n=this.messageApi.getState();if(!n)throw new Error("Message is not available");const r=t.toolName,i=t.toolCallId,s=ln.toResponse(e);this.threadApi.getState().addToolResult({messageId:n.id,toolName:r,toolCallId:i,result:s.result,artifact:s.artifact,isError:s.isError})}resumeToolCall(e){const t=this.contentBinding.getState();if(!t)throw new Error("Message part is not available");if(t.type!=="tool-call")throw new Error("Tried to resume tool call on non-tool message part");if(!this.threadApi)throw new Error("Thread API is not available");const n=t.toolCallId;this.threadApi.getState().resumeToolCall({toolCallId:n,payload:e})}respondToToolApproval(e){const t=this.contentBinding.getState();if(!t)throw new Error("Message part is not available");if(t.type!=="tool-call")throw new Error("Tried to respond to tool approval on non-tool message part");if(!t.approval||t.approval.approved!==void 0)throw new Error("Tool call has no pending approval");if(!this.threadApi)throw new Error("Thread API is not available");this.threadApi.getState().respondToToolApproval({approvalId:t.approval.id,approved:e.approved,...e.reason!=null&&{reason:e.reason}})}subscribe(e){return this.contentBinding.subscribe(e)}};const Qs=Object.freeze({type:"complete"}),VC=(e,t,n)=>{if(e.role!=="assistant")return Qs;if(n.type==="tool-call")return n.result?Qs:e.status;const r=t===Math.max(0,e.content.length-1);return e.status.type==="requires-action"?Qs:r?e.status:Qs},ch=(e,t)=>{const n=e.content[t];if(!n)return Ut;const r=VC(e,t,n);return Object.freeze({...n,[dr]:n[dr],status:r})};var HC=class{constructor(e,t){_(this,"_core");_(this,"_threadBinding");_(this,"composer");_(this,"_getEditComposerRuntimeCore",()=>this._threadBinding.getState().getEditComposer(this._core.getState().id));this._core=e,this._threadBinding=t,this.composer=new $C(new Go({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.composer`,composerSource:"edit"},getState:this._getEditComposerRuntimeCore,subscribe:n=>this._threadBinding.subscribe(n)}),()=>this._threadBinding.getState().beginEdit(this._core.getState().id)),this.__internal_bindMethods()}get path(){return this._core.path}__internal_bindMethods(){this.reload=this.reload.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getMessagePartByIndex=this.getMessagePartByIndex.bind(this),this.getMessagePartByToolCallId=this.getMessagePartByToolCallId.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_getCopyText=this.unstable_getCopyText.bind(this),this.speak=this.speak.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.submitFeedback=this.submitFeedback.bind(this),this.switchToBranch=this.switchToBranch.bind(this)}getState(){return this._core.getState()}reload(e={}){const t=this._getEditComposerRuntimeCore(),n=t??this._threadBinding.getState().composer,r=t??n,{runConfig:i=r.runConfig}=e,s=this._core.getState();if(s.role!=="assistant")throw new Error("Can only reload assistant messages");this._threadBinding.getState().startRun({parentId:s.parentId,sourceId:s.id,runConfig:i})}speak(){const e=this._core.getState();return this._threadBinding.getState().speak(e.id)}stopSpeaking(){const e=this._core.getState();if(this._threadBinding.getState().speech?.messageId===e.id)this._threadBinding.getState().stopSpeaking();else throw new Error("Message is not being spoken")}submitFeedback({type:e}){const t=this._core.getState();this._threadBinding.getState().submitFeedback({messageId:t.id,type:e})}switchToBranch({position:e,branchId:t}){const n=this._core.getState();if(t&&e)throw new Error("May not specify both branchId and position");if(!t&&!e)throw new Error("Must specify either branchId or position");const r=this._threadBinding.getState().getBranches(n.id);let i=t;if(e==="previous"?i=r[n.branchNumber-2]:e==="next"&&(i=r[n.branchNumber]),!i)throw new Error("Branch not found");this._threadBinding.getState().switchToBranch(i)}unstable_getCopyText(){return hs(this.getState())}subscribe(e){return this._core.subscribe(e)}getMessagePartByIndex(e){if(e<0)throw new Error("Message part index must be >= 0");return new uh(new Dt({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.content[${e}]`,messagePartSelector:{type:"index",index:e}},getState:()=>ch(this.getState(),e),subscribe:t=>this._core.subscribe(t)}),this._core,this._threadBinding)}getMessagePartByToolCallId(e){return new uh(new Dt({path:{...this.path,ref:this.path.ref+`${this.path.ref}.content[toolCallId=${JSON.stringify(e)}]`,messagePartSelector:{type:"toolCallId",toolCallId:e}},getState:()=>{const t=this._core.getState(),n=t.content.findIndex(r=>r.type==="tool-call"&&r.toolCallId===e);return n===-1?Ut:ch(t,n)},subscribe:t=>this._core.subscribe(t)}),this._core,this._threadBinding)}getAttachmentByIndex(e){return new zC(new Dt({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.attachments[${e}]`,attachmentSource:"message",attachmentSelector:{type:"index",index:e}},getState:()=>{const t=this.getState().attachments?.[e];return t?{...t,source:"message"}:Ut},subscribe:t=>this._core.subscribe(t)}))}};const WC=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{},...e.stream?{stream:e.stream}:{}}),qC=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{}}),KC=(e,t)=>typeof t=="string"?{createdAt:new Date,parentId:e.at(-1)?.id??null,sourceId:null,runConfig:{},role:"user",content:[{type:"text",text:t}],attachments:[],metadata:{custom:{}}}:{createdAt:t.createdAt??new Date,parentId:t.parentId??e.at(-1)?.id??null,sourceId:t.sourceId??null,role:t.role??"user",content:t.content,attachments:t.attachments??[],metadata:t.metadata??{custom:{}},runConfig:t.runConfig??{},startRun:t.startRun},QC=(e,t)=>{const n=e.messages.at(-1);return Object.freeze({threadId:t.id,metadata:t,capabilities:e.capabilities,isDisabled:e.isDisabled,isLoading:e.isLoading,isRunning:e.isRunning??(n?.role!=="assistant"?!1:n.status.type==="running"),messages:e.messages,state:e.state,suggestions:e.suggestions,extras:e.extras,speech:e.speech,voice:e.voice})};var rv=class{constructor(e,t){_(this,"_threadBinding");_(this,"composer");_(this,"_eventSubscriptionSubjects",new Map);const n=new Dt({path:e.path,getState:()=>QC(e.getState(),t.getState()),subscribe:r=>{const i=e.subscribe(r),s=t.subscribe(r);return()=>{i(),s()}}});this._threadBinding={path:e.path,getState:()=>e.getState(),getStateState:()=>n.getState(),outerSubscribe:r=>e.outerSubscribe(r),subscribe:r=>e.subscribe(r)},this.composer=new UC(new Go({path:{...this.path,ref:`${this.path.ref}.composer`,composerSource:"thread"},getState:()=>this._threadBinding.getState().composer,subscribe:r=>this._threadBinding.subscribe(r)})),this.__internal_bindMethods()}get path(){return this._threadBinding.path}get __internal_threadBinding(){return this._threadBinding}__internal_bindMethods(){this.append=this.append.bind(this),this.resumeRun=this.resumeRun.bind(this),this.importExternalState=this.importExternalState.bind(this),this.exportExternalState=this.exportExternalState.bind(this),this.startRun=this.startRun.bind(this),this.cancelRun=this.cancelRun.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.connectVoice=this.connectVoice.bind(this),this.disconnectVoice=this.disconnectVoice.bind(this),this.muteVoice=this.muteVoice.bind(this),this.unmuteVoice=this.unmuteVoice.bind(this),this.getVoiceVolume=this.getVoiceVolume.bind(this),this.subscribeVoiceVolume=this.subscribeVoiceVolume.bind(this),this.export=this.export.bind(this),this.import=this.import.bind(this),this.reset=this.reset.bind(this),this.getMessageByIndex=this.getMessageByIndex.bind(this),this.getMessageById=this.getMessageById.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getModelContext=this.getModelContext.bind(this),this.getState=this.getState.bind(this)}getState(){return this._threadBinding.getStateState()}append(e){this._threadBinding.getState().append(KC(this._threadBinding.getState().messages,e))}subscribe(e){return this._threadBinding.subscribe(e)}getModelContext(){return this._threadBinding.getState().getModelContext()}startRun(e){return this._threadBinding.getState().startRun(qC(e))}resumeRun(e){return this._threadBinding.getState().resumeRun(WC(e))}exportExternalState(){return this._threadBinding.getState().exportExternalState()}importExternalState(e){this._threadBinding.getState().importExternalState(e)}cancelRun(){this._threadBinding.getState().cancelRun()}stopSpeaking(){return this._threadBinding.getState().stopSpeaking()}connectVoice(){this._threadBinding.getState().connectVoice()}disconnectVoice(){this._threadBinding.getState().disconnectVoice()}getVoiceVolume(){return this._threadBinding.getState().getVoiceVolume()}subscribeVoiceVolume(e){return this._threadBinding.getState().subscribeVoiceVolume(e)}muteVoice(){this._threadBinding.getState().muteVoice()}unmuteVoice(){this._threadBinding.getState().unmuteVoice()}export(){return this._threadBinding.getState().export()}import(e){this._threadBinding.getState().import(e)}reset(e){this._threadBinding.getState().reset(e)}getMessageByIndex(e){if(e<0)throw new Error("Message index must be >= 0");return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[${e}]`,messageSelector:{type:"index",index:e}},()=>{const t=this._threadBinding.getState().messages,n=t[e];if(n)return{message:n,parentId:t[e-1]?.id??null,index:e}})}getMessageById(e){return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[messageId=${JSON.stringify(e)}]`,messageSelector:{type:"messageId",messageId:e}},()=>this._threadBinding.getState().getMessageById(e))}_getMessageRuntime(e,t){return new HC(new Dt({path:e,getState:()=>{const{message:n,parentId:r,index:i}=t()??{},{messages:s,speech:o}=this._threadBinding.getState();if(!n||r===void 0||i===void 0)return Ut;const a=this._threadBinding.getState().getBranches(n.id);return{...n,[dr]:n[dr],index:i,isLast:s.at(-1)?.id===n.id,parentId:r,branchNumber:a.indexOf(n.id)+1,branchCount:a.length,speech:o?.messageId===n.id?o:void 0}},subscribe:n=>this._threadBinding.subscribe(n)}),this._threadBinding)}unstable_on(e,t){let n=this._eventSubscriptionSubjects.get(e);return n||(n=new Jy({event:e,binding:this._threadBinding}),this._eventSubscriptionSubjects.set(e,n)),n.subscribe(t)}};const GC=g.createContext(null),YC=()=>g.useContext(GC);var Gs=class{constructor(e,t){_(this,"_core");_(this,"_threadListBinding");this._core=e,this._threadListBinding=t,this.__internal_bindMethods()}get path(){return this._core.path}__internal_bindMethods(){this.switchTo=this.switchTo.bind(this),this.rename=this.rename.bind(this),this.updateCustom=this.updateCustom.bind(this),this.archive=this.archive.bind(this),this.unarchive=this.unarchive.bind(this),this.delete=this.delete.bind(this),this.initialize=this.initialize.bind(this),this.generateTitle=this.generateTitle.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getState=this.getState.bind(this),this.detach=this.detach.bind(this)}getState(){return this._core.getState()}switchTo(e){const t=this._core.getState();return this._threadListBinding.switchToThread(t.id,e)}rename(e){const t=this._core.getState();return this._threadListBinding.rename(t.id,e)}updateCustom(e){const t=this._core.getState();if(!this._threadListBinding.updateCustom)throw new Error("Thread list runtime does not support updating custom metadata");return this._threadListBinding.updateCustom(t.id,e)}archive(){const e=this._core.getState();return this._threadListBinding.archive(e.id)}unarchive(){const e=this._core.getState();return this._threadListBinding.unarchive(e.id)}delete(){const e=this._core.getState();return this._threadListBinding.delete(e.id)}initialize(){const e=this._core.getState();return this._threadListBinding.initialize(e.id)}generateTitle(){const e=this._core.getState();return this._threadListBinding.generateTitle(e.id)}unstable_on(e,t){let n=this._core.getState().isMain,r=this._core.getState().id;return this.subscribe(()=>{const i=this._core.getState(),s=i.isMain,o=i.id;n===s&&r===o||(n=s,r=o,!(e==="switchedTo"&&!s)&&(e==="switchedAway"&&s||t({})))})}subscribe(e){return this._core.subscribe(e)}detach(){const e=this._core.getState();this._threadListBinding.detach(e.id)}__internal_getRuntime(){return this}};const dh=Promise.resolve(),JC=e=>({mainThreadId:e.mainThreadId,newThreadId:e.newThreadId,threadIds:e.threadIds,archivedThreadIds:e.archivedThreadIds,isLoading:e.isLoading,isLoadingMore:e.isLoadingMore??!1,hasMore:e.hasMore??!1,threadItems:e.threadItems}),Ys=(e,t)=>{if(t===void 0)return Ut;const n=e.getItemById(t);return n?{id:n.id,remoteId:n.remoteId,externalId:n.externalId,title:n.title,status:n.status,custom:n.custom,isMain:n.id===e.mainThreadId}:Ut};var XC=class{constructor(e,t=rv){_(this,"_core");_(this,"_runtimeFactory");_(this,"_getState");_(this,"_mainThreadListItemRuntime");_(this,"main");this._core=e,this._runtimeFactory=t;const n=new ed({path:{},getState:()=>JC(e),subscribe:r=>e.subscribe(r)});this._getState=n.getState.bind(n),this._mainThreadListItemRuntime=new Gs(new Dt({path:{ref:"threadItems[main]",threadSelector:{type:"main"}},getState:()=>Ys(this._core,this._core.mainThreadId),subscribe:r=>this._core.subscribe(r)}),this._core),this.main=new t(new Go({path:{ref:"threads.main",threadSelector:{type:"main"}},getState:()=>e.getMainThreadRuntimeCore(),subscribe:r=>e.subscribe(r)}),this._mainThreadListItemRuntime),this.__internal_bindMethods()}__internal_bindMethods(){this.switchToThread=this.switchToThread.bind(this),this.switchToNewThread=this.switchToNewThread.bind(this),this.getLoadThreadsPromise=this.getLoadThreadsPromise.bind(this),this.reload=this.reload.bind(this),this.loadMore=this.loadMore.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getById=this.getById.bind(this),this.getItemById=this.getItemById.bind(this),this.getItemByIndex=this.getItemByIndex.bind(this),this.getArchivedItemByIndex=this.getArchivedItemByIndex.bind(this)}switchToThread(e,t){return this._core.switchToThread(e,t)}switchToNewThread(){return this._core.switchToNewThread()}getLoadThreadsPromise(){return this._core.getLoadThreadsPromise()}reload(){return this._core.reload?.()??dh}loadMore(){return this._core.loadMore?.()??dh}getState(){return this._getState()}subscribe(e){return this._core.subscribe(e)}get mainItem(){return this._mainThreadListItemRuntime}getById(e){return new this._runtimeFactory(new Go({path:{ref:`threads[threadId=${JSON.stringify(e)}]`,threadSelector:{type:"threadId",threadId:e}},getState:()=>this._core.getThreadRuntimeCore(e),subscribe:t=>this._core.subscribe(t)}),this.mainItem)}getItemByIndex(e){return new Gs(new Dt({path:{ref:`threadItems[${e}]`,threadSelector:{type:"index",index:e}},getState:()=>Ys(this._core,this._core.threadIds[e]),subscribe:t=>this._core.subscribe(t)}),this._core)}getArchivedItemByIndex(e){return new Gs(new Dt({path:{ref:`archivedThreadItems[${e}]`,threadSelector:{type:"archiveIndex",index:e}},getState:()=>Ys(this._core,this._core.archivedThreadIds[e]),subscribe:t=>this._core.subscribe(t)}),this._core)}getItemById(e){return new Gs(new Dt({path:{ref:`threadItems[threadId=${e}]`,threadSelector:{type:"threadId",threadId:e}},getState:()=>Ys(this._core,e),subscribe:t=>this._core.subscribe(t)}),this._core)}},iv=class{constructor(e){_(this,"_core");_(this,"threads");_(this,"_thread");this._core=e,this.threads=new XC(e.threads),this._thread=this.threads.main,this.__internal_bindMethods()}__internal_bindMethods(){this.registerModelContextProvider=this.registerModelContextProvider.bind(this)}get thread(){return this._thread}registerModelContextProvider(e){return this._core.registerModelContextProvider(e)}},sv=class{constructor(){_(this,"_contextProvider",new qc)}registerModelContextProvider(e){return this._contextProvider.registerModelContextProvider(e)}getModelContextProvider(){return this._contextProvider}};const Qn=Object.freeze([]),Wr="DEFAULT_THREAD_ID",ZC=Object.freeze([Wr]),e0=Object.freeze({id:Wr,remoteId:void 0,externalId:void 0,status:"regular"}),t0=Promise.resolve(),fh=Object.freeze({[Wr]:e0});var n0=class{constructor(e={},t){_(this,"threadFactory");_(this,"_mainThreadId",Wr);_(this,"_threads",ZC);_(this,"_archivedThreads",Qn);_(this,"_threadData",fh);_(this,"adapter",{});_(this,"_mainThread");_(this,"_subscriptions",new Set);this.threadFactory=t,this.__internal_setAdapter(e,!0)}get isLoading(){return this.adapter.isLoading??!1}get newThreadId(){}get threadIds(){return this._threads}get archivedThreadIds(){return this._archivedThreads}get threadItems(){return this._threadData}getLoadThreadsPromise(){return t0}get mainThreadId(){return this._mainThreadId}getMainThreadRuntimeCore(){return this._mainThread}getThreadRuntimeCore(){throw new Error("Method not implemented.")}getItemById(e){return this._threadData[e]}__internal_setAdapter(e,t=!1){const n=this.adapter;this.adapter=e;const r=e.threadId??Wr,i=e.threads??Qn,s=e.archivedThreads??Qn,o=n.threadId??Wr,a=n.threads??Qn,l=n.archivedThreads??Qn;!t&&o===r&&a===i&&l===s||((a!==i||l!==s||o!==r)&&(this._threadData={...fh,...Object.fromEntries(e.threads?.map(u=>[u.id,{...u,remoteId:u.remoteId,externalId:u.externalId,status:"regular"}])??[]),...Object.fromEntries(e.archivedThreads?.map(u=>[u.id,{...u,remoteId:u.remoteId,externalId:u.externalId,status:"archived"}])??[])}),a!==i&&(this._threads=this.adapter.threads?.map(u=>u.id)??Qn),l!==s&&(this._archivedThreads=this.adapter.archivedThreads?.map(u=>u.id)??Qn),(t||o!==r)&&(this._mainThreadId=r,this._mainThread=this.threadFactory()),this._threadData[this._mainThreadId]||(this._threadData={...this._threadData,[this._mainThreadId]:{id:this._mainThreadId,remoteId:void 0,externalId:void 0,status:"regular"}}),this._notifySubscribers())}async switchToThread(e,t){if(this._mainThreadId===e)return;const n=this.adapter.onSwitchToThread;if(!n)throw new Error("External store adapter does not support switching to thread");await n(e)}async switchToNewThread(){const e=this.adapter.onSwitchToNewThread;if(!e)throw new Error("External store adapter does not support switching to new thread");await e()}async rename(e,t){const n=this.adapter.onRename;if(!n)throw new Error("External store adapter does not support renaming");await n(e,t)}async updateCustom(e,t){const n=this.adapter.onUpdateCustom;if(!n)throw new Error("External store adapter does not support updating custom metadata");await n(e,t)}async detach(){}async archive(e){const t=this.adapter.onArchive;if(!t)throw new Error("External store adapter does not support archiving");await t(e)}async unarchive(e){const t=this.adapter.onUnarchive;if(!t)throw new Error("External store adapter does not support unarchiving");await t(e)}async delete(e){const t=this.adapter.onDelete;if(!t)throw new Error("External store adapter does not support deleting");await t(e)}initialize(e){return Promise.resolve({remoteId:e,externalId:void 0})}generateTitle(){throw new Error("Method not implemented.")}subscribe(e){return this._subscriptions.add(e),()=>this._subscriptions.delete(e)}_notifySubscribers(){for(const e of this._subscriptions)e()}};const Bn=$y("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7),ci=Symbol("autoStatus"),r0=Object.freeze(Object.assign({type:"running"},{[ci]:!0})),i0=Object.freeze(Object.assign({type:"complete",reason:"unknown"},{[ci]:!0})),s0=Object.freeze(Object.assign({type:"requires-action",reason:"tool-calls"},{[ci]:!0})),o0=Object.freeze(Object.assign({type:"requires-action",reason:"interrupt"},{[ci]:!0})),a0=e=>e[ci]===!0,Yo=(e,t,n,r,i)=>e&&i?Object.assign({type:"incomplete",reason:"error",error:i},{[ci]:!0}):e&&t?r0:n?o0:r?s0:i0,fl=(e,t)=>{if(e.startsWith("data-"))return{type:"data",name:e.substring(5),data:t}},ps=(e,t,n)=>{const{role:r,id:i,createdAt:s,attachments:o,status:a,metadata:l}=e,u={id:i??t,createdAt:s??new Date},d=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content,c=({image:f,...h})=>f.match(/^data:image\/(png|jpeg|jpg|gif|webp|svg\+xml);base64,(.*)$/)?{...h,image:f}:/^(https:\/\/|blob:)/.test(f)?{...h,image:f}:(console.warn("Invalid image data format detected"),null);if(r!=="user"&&o?.length)throw new Error("attachments are only supported for user messages");if(r!=="assistant"&&a)throw new Error("status is only supported for assistant messages");if(r!=="assistant"&&l?.steps)throw new Error("metadata.steps is only supported for assistant messages");switch(r){case"assistant":return{...u,role:r,content:d.map(f=>{const h=f.type;switch(h){case"text":case"reasoning":return f.text.trim().length===0?null:f;case"file":case"source":return f;case"image":return c(f);case"data":return f;case"generative-ui":return f;case"tool-call":{const{parentId:m,messages:x,...E}=f,y={...E,toolCallId:f.toolCallId??`tool-${Bn()}`,...m!==void 0&&{parentId:m},...x!==void 0&&{messages:x}};return f.args?{...y,args:f.args,argsText:f.argsText??JSON.stringify(f.args)}:{...y,args:Au(f.argsText??"")??{},argsText:f.argsText??""}}default:{const m=fl(h,f.data);if(m)return m;throw new Error(`Unsupported assistant message part type: ${h}`)}}}).filter(f=>!!f),status:a??n,metadata:{unstable_state:l?.unstable_state??null,unstable_annotations:l?.unstable_annotations??[],unstable_data:l?.unstable_data??[],custom:l?.custom??{},steps:l?.steps??[],...l?.timing&&{timing:l.timing},...l?.submittedFeedback&&{submittedFeedback:l.submittedFeedback},...l?.isOptimistic&&{isOptimistic:!0}}};case"user":return{...u,role:r,content:d.map(f=>{const h=f.type;switch(h){case"text":case"image":case"audio":case"file":case"data":return f;default:{const m=fl(h,f.data);if(m)return m;throw new Error(`Unsupported user message part type: ${h}`)}}}),attachments:(o??[]).map(f=>({...f,content:f.content.map(h=>fl(h.type,h.data)??h)})),metadata:{custom:l?.custom??{}}};case"system":if(d.length!==1||d[0].type!=="text")throw new Error("System messages must have exactly one text message part.");return{...u,role:r,content:d,metadata:{custom:l?.custom??{}}};default:throw new Error(`Unknown message role: ${r}`)}},ov={fromArray:e=>{const t=e.map(n=>ps(n,Bn(),Yo(!1,!1,!1,!1,void 0)));return{messages:t.map((n,r)=>({parentId:r>0?t[r-1].id:null,message:n}))}},fromBranchableArray:(e,t)=>{const n=Yo(!1,!1,!1,!1,void 0);return{...t?.headId!==void 0?{headId:t.headId}:void 0,messages:e.map(({message:r,parentId:i})=>{if(!r.id)throw new Error("ExportedMessageRepository.fromBranchableArray: Each message must have an 'id' field set.");return{parentId:i,message:ps(r,r.id,n)}})}}},yo=e=>e.next?yo(e.next):"current"in e?e:null;var l0=class{constructor(e){_(this,"func");_(this,"_value",null);this.func=e}get value(){return this._value===null&&(this._value=this.func()),this._value}dirty(){this._value=null}},td=class{constructor(){_(this,"messages",new Map);_(this,"head",null);_(this,"root",{children:[],next:null});_(this,"_messages",new l0(()=>{const e=new Array((this.head?.level??-1)+1);for(let t=this.head;t;t=t.prev)e[t.level]=t.current;return e}))}updateLevels(e,t){e.level=t;for(const n of e.children){const r=this.messages.get(n);r&&this.updateLevels(r,t+1)}}performOp(e,t,n){const r=t.prev??this.root,i=e??this.root;if(!(n==="relink"&&r===i)){if(n!=="link"&&(r.children=r.children.filter(s=>s!==t.current.id),r.next===t)){const s=r.children.at(-1),o=s?this.messages.get(s):null;if(o===void 0)throw new Error("MessageRepository(performOp/cut): Fallback sibling message not found. This is likely an internal bug in assistant-ui.");r.next=o}if(n!=="cut"){for(let o=e;o;o=o.prev)if(o.current.id===t.current.id)throw new Error("MessageRepository(performOp/link): A message with the same id already exists in the parent tree. This error occurs if the same message id is found multiple times. This is likely an internal bug in assistant-ui.");i.children=[...i.children,t.current.id],(yo(t)===this.head||i.next===null)&&(i.next=t),t.prev=e;const s=e?e.level+1:0;this.updateLevels(t,s)}}}get headId(){return this.head?.current.id??null}getMessages(e){if(e===void 0||e===this.head?.current.id)return this._messages.value;const t=this.messages.get(e);if(!t)throw new Error("MessageRepository(getMessages): Head message not found. This is likely an internal bug in assistant-ui.");const n=new Array(t.level+1);for(let r=t;r;r=r.prev)n[r.level]=r.current;return n}addOrUpdateMessage(e,t){const n=this.messages.get(t.id),r=e?this.messages.get(e):null;if(r===void 0)throw new Error("MessageRepository(addOrUpdateMessage): Parent message not found. This is likely an internal bug in assistant-ui.");if(n){n.current=t,this.performOp(r,n,"relink"),this._messages.dirty();return}const i={prev:r,current:t,next:null,children:[],level:r?r.level+1:0};this.messages.set(t.id,i),this.performOp(r,i,"link"),this.head===r&&(this.head=i),this._messages.dirty()}getMessage(e){const t=this.messages.get(e);if(!t)throw new Error("MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui.");return{parentId:t.prev?.current.id??null,message:t.current,index:t.level}}deleteMessage(e,t){const n=this.messages.get(e);if(!n)throw new Error("MessageRepository(deleteMessage): Message not found. This is likely an internal bug in assistant-ui.");const r=t===void 0?n.prev:t===null?null:this.messages.get(t);if(r===void 0)throw new Error("MessageRepository(deleteMessage): Replacement not found. This is likely an internal bug in assistant-ui.");for(const i of n.children){const s=this.messages.get(i);if(!s)throw new Error("MessageRepository(deleteMessage): Child message not found. This is likely an internal bug in assistant-ui.");this.performOp(r,s,"relink")}this.performOp(null,n,"cut"),this.messages.delete(e),this.head===n&&(this.head=yo(r??this.root)),this._messages.dirty()}getBranches(e){const t=this.messages.get(e);if(!t)throw new Error("MessageRepository(getBranches): Message not found. This is likely an internal bug in assistant-ui.");const{children:n}=t.prev??this.root;return n}evictOffBranchOptimisticMessages(e,t){if(!e)return;const n=new Set;for(let i=t;i;i=i.prev)n.add(i.current.id);const r=[];for(let i=e;i&&!n.has(i.current.id);i=i.prev)i.current.metadata?.isOptimistic&&r.push(i.current.id);for(const i of r)this.messages.has(i)&&this.deleteMessage(i)}switchToBranch(e){const t=this.messages.get(e);if(!t)throw new Error("MessageRepository(switchToBranch): Branch not found. This is likely an internal bug in assistant-ui.");const n=this.head,r=t.prev??this.root;r.next=t,this.head=yo(t),this.evictOffBranchOptimisticMessages(n,this.head),this._messages.dirty()}resetHead(e){if(e===null){this.clear();return}const t=this.messages.get(e);if(!t)throw new Error("MessageRepository(resetHead): Branch not found. This is likely an internal bug in assistant-ui.");const n=this.head;if(t.children.length>0){const r=i=>{for(const s of i.children){const o=this.messages.get(s);o&&(r(o),this.messages.delete(s))}};r(t),t.children=[],t.next=null}this.head=t;for(let r=t;r;r=r.prev)r.prev?r.prev.next=r:this.root.next=r;this.evictOffBranchOptimisticMessages(n,this.head),this._messages.dirty()}clear(){this.messages.clear(),this.head=null,this.root={children:[],next:null},this._messages.dirty()}export(){const e=[];for(const[,n]of this.messages)n.current.metadata?.isOptimistic||e.push({message:n.current,parentId:n.prev?.current.id??null});let t=this.head;for(;t?.current.metadata?.isOptimistic;)t=t.prev;return{headId:t?.current.id??null,messages:e}}import({headId:e,messages:t}){for(const{message:n,parentId:r}of t)this.addOrUpdateMessage(r,n);this.resetHead(e??t.at(-1)?.message.id??null)}};function hh(e,t){if(t==="*")return!0;const n=t.split(",").map(s=>s.trim().toLowerCase()),r=`.${e.name.split(".").pop().toLowerCase()}`,i=e.type.toLowerCase();for(const s of n){if(s.startsWith(".")&&s===r||s.includes("/")&&s===i)return!0;if(s.endsWith("/*")){const o=s.split("/")[0];if(i.startsWith(`${o}/`))return!0}}return!1}function u0(e,t){return e.length!==t.length?!1:e.every((n,r)=>n.id===t[r].id)}function c0(e){const t=Bn();return e.type==="image"?{id:t,type:"image",name:e.filename??"image",content:[e],status:{type:"complete"}}:e.type==="file"?{id:t,type:"document",name:e.filename??"document",contentType:e.mimeType,content:[e],status:{type:"complete"}}:e.type==="audio"?{id:t,type:"audio",name:`audio.${e.audio.format}`,contentType:`audio/${e.audio.format}`,content:[e],status:{type:"complete"}}:{id:t,type:"data",name:e.name,content:[e],status:{type:"complete"}}}function d0(e){const t=[];for(const n of e)n.type!=="text"&&t.push(c0(n));return t}const hl=e=>e.status.type==="complete";var av=class extends DC{constructor(){super(...arguments);_(this,"isEditing",!0);_(this,"_attachments",[]);_(this,"_text","");_(this,"_role","user");_(this,"_runConfig",{});_(this,"_quote");_(this,"_dictation");_(this,"_dictationSession");_(this,"_dictationUnsubscribes",[]);_(this,"_dictationBaseText","");_(this,"_currentInterimText","");_(this,"_dictationSessionIdCounter",0);_(this,"_activeDictationSessionId");_(this,"_isCleaningDictation",!1);_(this,"_eventSubscribers",new Map)}get attachmentAccept(){return this.getAttachmentAdapter()?.accept??"*"}get attachments(){return this._attachments}setAttachments(t){this._attachments=t,this._notifySubscribers()}get isEmpty(){return!this.text.trim()&&!this.attachments.length}get text(){return this._text}get role(){return this._role}get runConfig(){return this._runConfig}get quote(){return this._quote}setQuote(t){this._quote!==t&&(this._quote=t,this._notifySubscribers())}setText(t){if(this._text!==t){if(this._text=t,this._dictation){this._dictationBaseText=t,this._currentInterimText="";const{status:n,inputDisabled:r}=this._dictation;this._dictation=r?{status:n,inputDisabled:r}:{status:n}}this._notifySubscribers()}}setRole(t){this._role!==t&&(this._role=t,this._notifySubscribers())}setRunConfig(t){this._runConfig!==t&&(this._runConfig=t,this._notifySubscribers())}_emptyTextAndAttachments(){this._attachments=[],this._text="",this._notifySubscribers()}async _onClearAttachments(){const t=this.getAttachmentAdapter();if(t){const n=this._attachments.filter(r=>!hl(r));await Promise.all(n.map(r=>t.remove(r)))}}async reset(){if(this._attachments.length===0&&this._text===""&&this._role==="user"&&Object.keys(this._runConfig).length===0&&this._quote===void 0)return;this._role="user",this._runConfig={},this._quote=void 0;const t=this._onClearAttachments();this._emptyTextAndAttachments(),await t}async clearAttachments(){const t=this._onClearAttachments();this.setAttachments([]),await t}async send(t){if(!this.canSend)return;this._dictationSession&&(this._dictationSession.cancel(),this._cleanupDictation());const n=this.getAttachmentAdapter(),r=this.attachments.length>0?Promise.all(this.attachments.map(async a=>{if(hl(a))return a;if(!n)throw new Error("Attachments are not supported");return await n.send(a)})):[],i=this.text,s=this._quote;this._quote=void 0,this._emptyTextAndAttachments();const o={createdAt:new Date,role:this.role,content:i?[{type:"text",text:i}]:[],attachments:await r,runConfig:this.runConfig,metadata:{custom:{...s?{quote:s}:{}}}};this.handleSend(o,t),this._notifyEventSubscribers("send",{})}cancel(){this.handleCancel()}async addAttachment(t){if(!(t instanceof File)){const s=this.getAttachmentAdapter();if(s&&!hh({name:t.name,type:t.contentType??""},s.accept)){const a=`File type ${t.contentType||"unknown"} is not accepted. Accepted types: ${s.accept}`,l=new Error(a);throw this._safeEmitAttachmentAddError("not-accepted",a,void 0,l),l}const o={id:t.id??Bn(),type:t.type??"document",name:t.name,contentType:t.contentType,content:t.content,status:{type:"complete"}};this._attachments=[...this._attachments,o],this._notifySubscribers(),this._notifyEventSubscribers("attachmentAdd",{});return}const n=s=>{const o=this._attachments.findIndex(a=>a.id===s.id);o!==-1?this._attachments=[...this._attachments.slice(0,o),s,...this._attachments.slice(o+1)]:this._attachments=[...this._attachments,s],this._notifySubscribers()},r=this.getAttachmentAdapter();if(!r){const s="Attachments are not supported",o=new Error(s);throw this._safeEmitAttachmentAddError("no-adapter",s,void 0,o),o}if(!hh({name:t.name,type:t.type},r.accept)){const s=`File type ${t.type||"unknown"} is not accepted. Accepted types: ${r.accept}`,o=new Error(s);throw this._safeEmitAttachmentAddError("not-accepted",s,void 0,o),o}let i;try{const s=r.add({file:t});if(Symbol.asyncIterator in s)for await(const o of s)i=o,n(o);else i=await s,n(i)}catch(s){throw i&&n({...i,status:{type:"incomplete",reason:"error"}}),this._safeEmitAttachmentAddError("adapter-error",s instanceof Error?s.message:String(s),i?.id,s instanceof Error?s:void 0),s}i?.status.type==="incomplete"&&i.status.reason==="error"?this._safeEmitAttachmentAddError("adapter-error","Attachment upload did not complete successfully.",i?.id):this._notifyEventSubscribers("attachmentAdd",{})}_safeEmitAttachmentAddError(t,n,r,i){try{this._notifyEventSubscribers("attachmentAddError",{reason:t,message:n,...r!==void 0&&{attachmentId:r},...i!==void 0&&{error:i}})}catch(s){console.error("[assistant-ui] attachmentAddError subscriber threw:",s)}}async removeAttachment(t){const n=this._attachments.findIndex(i=>i.id===t);if(n===-1)throw new Error("Attachment not found");const r=this._attachments[n];if(!hl(r)){const i=this.getAttachmentAdapter();if(!i)throw new Error("Attachments are not supported");await i.remove(r)}this._attachments=this._attachments.filter(i=>i.id!==t),this._notifySubscribers()}get dictation(){return this._dictation}_isActiveSession(t,n){return this._activeDictationSessionId===t&&this._dictationSession===n}startDictation(){const t=this.getDictationAdapter();if(!t)throw new Error("Dictation adapter not configured");if(this._dictationSession){for(const u of this._dictationUnsubscribes)u();this._dictationUnsubscribes=[],this._dictationSession.stop().catch(()=>{}),this._dictationSession=void 0}const n=t.disableInputDuringDictation??!1;this._dictationBaseText=this._text,this._currentInterimText="";const r=t.listen();this._dictationSession=r;const i=++this._dictationSessionIdCounter;this._activeDictationSessionId=i,this._dictation={status:r.status,inputDisabled:n},this._notifySubscribers();const s=r.onSpeech(u=>{if(!this._isActiveSession(i,r))return;const d=u.isFinal!==!1,c=this._dictationBaseText&&!this._dictationBaseText.endsWith(" ")&&u.transcript?" ":"";if(d){if(this._dictationBaseText=this._dictationBaseText+c+u.transcript,this._currentInterimText="",this._text=this._dictationBaseText,this._dictation){const{transcript:f,...h}=this._dictation;this._dictation=h}this._notifySubscribers()}else this._currentInterimText=c+u.transcript,this._text=this._dictationBaseText+this._currentInterimText,this._dictation&&(this._dictation={...this._dictation,transcript:u.transcript}),this._notifySubscribers()});this._dictationUnsubscribes.push(s);const o=r.onSpeechStart(()=>{this._isActiveSession(i,r)&&(this._dictation={status:{type:"running"},inputDisabled:n,...this._dictation?.transcript&&{transcript:this._dictation.transcript}},this._notifySubscribers())});this._dictationUnsubscribes.push(o);const a=r.onSpeechEnd(()=>{this._cleanupDictation({sessionId:i})});this._dictationUnsubscribes.push(a);const l=setInterval(()=>{this._isActiveSession(i,r)&&r.status.type==="ended"&&this._cleanupDictation({sessionId:i})},100);this._dictationUnsubscribes.push(()=>clearInterval(l))}stopDictation(){if(!this._dictationSession)return;const t=this._dictationSession,n=this._activeDictationSessionId;t.stop().finally(()=>{this._cleanupDictation({sessionId:n})})}_cleanupDictation(t){if(!(t?.sessionId!==void 0&&t.sessionId!==this._activeDictationSessionId||this._isCleaningDictation)){this._isCleaningDictation=!0;try{for(const n of this._dictationUnsubscribes)n();this._dictationUnsubscribes=[],this._dictationSession=void 0,this._activeDictationSessionId=void 0,this._dictation=void 0,this._dictationBaseText="",this._currentInterimText="",this._notifySubscribers()}finally{this._isCleaningDictation=!1}}}_notifyEventSubscribers(t,n){const r=this._eventSubscribers.get(t);if(r)for(const i of r)i(n)}unstable_on(t,n){const r=n;let i=this._eventSubscribers.get(t);return i||(i=new Set,this._eventSubscribers.set(t,i)),i.add(r),()=>{this._eventSubscribers.get(t)?.delete(r)}}},lv=class extends av{constructor(t){super();_(this,"runtime");_(this,"_canCancel",!1);this.runtime=t,this.connect()}get canCancel(){return this._canCancel}get canSend(){return!this.isEmpty&&!this.runtime.isSendDisabled}getAttachmentAdapter(){return this.runtime.adapters?.attachments}getDictationAdapter(){return this.runtime.adapters?.dictation}connect(){let t=this.runtime.isSendDisabled;return this.runtime.subscribe(()=>{let n=!1;this.canCancel!==this.runtime.capabilities.cancel&&(this._canCancel=this.runtime.capabilities.cancel,n=!0),t!==this.runtime.isSendDisabled&&(t=this.runtime.isSendDisabled,n=!0),n&&this._notifySubscribers()})}async handleSend(t,n){this.runtime.append({...t,parentId:this.runtime.messages.at(-1)?.id??null,sourceId:null,startRun:n?.startRun})}async handleCancel(){this.runtime.cancelRun()}},f0=class extends av{constructor(t,n,{parentId:r,message:i}){super();_(this,"runtime");_(this,"endEditCallback");_(this,"_previousText");_(this,"_previousAttachments");_(this,"_nonTextPassthrough");_(this,"_parentId");_(this,"_sourceId");this.runtime=t,this.endEditCallback=n,this._parentId=r,this._sourceId=i.id,this._previousText=hs(i),this.setText(this._previousText),this.setRole(i.role),i.role==="user"?(this._previousAttachments=[...i.attachments??[],...d0(i.content)],this._nonTextPassthrough=[]):(this._previousAttachments=i.attachments??[],this._nonTextPassthrough=i.content.filter(s=>s.type!=="text")),this.setAttachments(this._previousAttachments),this.setRunConfig({...t.composer.runConfig})}get canCancel(){return!0}get canSend(){return!this.isEmpty}getAttachmentAdapter(){return this.runtime.adapters?.attachments}getDictationAdapter(){return this.runtime.adapters?.dictation}get parentId(){return this._parentId}get sourceId(){return this._sourceId}async handleSend(t,n){const r=hs(t),i=!u0(t.attachments??[],this._previousAttachments);if(r!==this._previousText||i||n?.startRun){const s=this._nonTextPassthrough.length>0?[...t.content,...this._nonTextPassthrough]:t.content;this.runtime.append({...t,content:s,parentId:this._parentId,sourceId:this._sourceId,startRun:n?.startRun})}this.handleCancel()}handleCancel(){this.endEditCallback(),this._notifySubscribers()}},h0=class{constructor(e){_(this,"_contextProvider");_(this,"_subscriptions",new Set);_(this,"_isInitialized",!1);_(this,"repository",new td);_(this,"_voiceMessages",[]);_(this,"_voiceGeneration",0);_(this,"_cachedMergedMessages",null);_(this,"_cachedVoiceGeneration",-1);_(this,"_cachedMergedBase",null);_(this,"composer",new lv(this));_(this,"_editComposers",new Map);_(this,"_stopSpeaking");_(this,"speech");_(this,"_voiceSession");_(this,"_voiceUnsubs",[]);_(this,"voice");_(this,"_voiceVolume",0);_(this,"_voiceVolumeSubscribers",new Set);_(this,"getVoiceVolume",()=>this._voiceVolume);_(this,"subscribeVoiceVolume",e=>(this._voiceVolumeSubscribers.add(e),()=>this._voiceVolumeSubscribers.delete(e)));_(this,"_currentAssistantMsg",null);_(this,"_eventSubscribers",new Map);this._contextProvider=e}_markVoiceMessagesDirty(){this._voiceGeneration++,this._cachedMergedMessages=null}_getBaseMessages(){return this.repository.getMessages()}get messages(){if(this._voiceMessages.length===0)return this._getBaseMessages();const e=this._getBaseMessages();return(this._cachedVoiceGeneration!==this._voiceGeneration||this._cachedMergedBase!==e)&&(this._cachedMergedMessages=[...e,...this._voiceMessages],this._cachedVoiceGeneration=this._voiceGeneration,this._cachedMergedBase=e),this._cachedMergedMessages}get state(){let e;for(const t of this.messages)t.role==="assistant"&&(e=t);return e?.metadata.unstable_state??null}getModelContext(){return this._contextProvider.getModelContext()}getEditComposer(e){return this._editComposers.get(e)}beginEdit(e){if(this._editComposers.has(e))throw new Error("Edit already in progress");this._editComposers.set(e,new f0(this,()=>this._editComposers.delete(e),this.repository.getMessage(e))),this._notifySubscribers()}getMessageById(e){try{return this.repository.getMessage(e)}catch{const t=this.repository.getMessages(),n=this._voiceMessages.findIndex(r=>r.id===e);return n!==-1?{parentId:n>0?this._voiceMessages[n-1].id:t.at(-1)?.id??null,message:this._voiceMessages[n],index:t.length+n}:void 0}}getBranches(e){return this._voiceMessages.some(t=>t.id===e)?[]:this.repository.getBranches(e)}switchToBranch(e){this.repository.switchToBranch(e),this._notifySubscribers()}_notifySubscribers(){for(const e of this._subscriptions)e()}_notifyEventSubscribers(e,t){const n=this._eventSubscribers.get(e);if(n)for(const r of n)r(t)}subscribe(e){return this._subscriptions.add(e),()=>this._subscriptions.delete(e)}submitFeedback({messageId:e,type:t}){const n=this.adapters?.feedback;if(!n)throw new Error("Feedback adapter not configured");const{message:r,parentId:i}=this.repository.getMessage(e);if(n.submit({message:r,type:t}),r.role==="assistant"){const s={...r,metadata:{...r.metadata,submittedFeedback:{type:t}}};this.repository.addOrUpdateMessage(i,s)}this._notifySubscribers()}speak(e){const t=this.adapters?.speech;if(!t)throw new Error("Speech adapter not configured");const{message:n}=this.repository.getMessage(e);this._stopSpeaking?.();const r=t.speak(hs(n)),i=r.subscribe(()=>{r.status.type==="ended"?(this._stopSpeaking=void 0,this.speech=void 0):this.speech={messageId:e,status:r.status},this._notifySubscribers()});this.speech={messageId:e,status:r.status},this._notifySubscribers(),this._stopSpeaking=()=>{r.cancel(),i(),this.speech=void 0,this._stopSpeaking=void 0}}stopSpeaking(){if(!this._stopSpeaking)throw new Error("No message is being spoken");this._stopSpeaking(),this._notifySubscribers()}connectVoice(){const e=this.adapters?.voice;if(!e)throw new Error("Voice adapter not configured");this.disconnectVoice();const t=e.connect({});this._voiceSession=t;const n=[];let r="listening";this.voice={status:t.status,isMuted:t.isMuted,mode:r},this._voiceVolume=0,this._notifySubscribers(),n.push(t.onStatusChange(i=>{i.type==="ended"?(this._finishVoiceAssistantMessage(),this._voiceSession=void 0,this.voice=void 0):this.voice={status:i,isMuted:t.isMuted,mode:r},this._notifySubscribers()})),n.push(t.onModeChange(i=>{r=i,this.voice&&(this.voice={...this.voice,mode:i},this._notifySubscribers())})),n.push(t.onVolumeChange(i=>{this._voiceVolume=i;for(const s of this._voiceVolumeSubscribers)s()})),n.push(t.onTranscript(i=>{this._handleVoiceTranscript(i)})),this._voiceUnsubs=n}_handleVoiceTranscript(e){if(this.ensureInitialized(),e.role==="user")this._finishVoiceAssistantMessage(),this._currentAssistantMsg=null,e.isFinal&&(this._voiceMessages.push({id:Bn(),role:"user",content:[{type:"text",text:e.text}],metadata:{custom:{}},createdAt:new Date,status:{type:"complete",reason:"unknown"},attachments:[]}),this._markVoiceMessagesDirty(),this._notifySubscribers());else{if(!this._currentAssistantMsg)this._currentAssistantMsg={id:Bn(),role:"assistant",content:[{type:"text",text:e.text}],metadata:{unstable_state:this.state,unstable_annotations:[],unstable_data:[],steps:[],custom:{}},status:{type:"running"},createdAt:new Date},this._voiceMessages.push(this._currentAssistantMsg);else{const t=this._voiceMessages.indexOf(this._currentAssistantMsg);if(t===-1)return;const n={...this._currentAssistantMsg,content:[{type:"text",text:e.text}],...e.isFinal?{status:{type:"complete",reason:"stop"}}:{}};this._voiceMessages[t]=n,this._currentAssistantMsg=n}e.isFinal&&(this._currentAssistantMsg=null),this._markVoiceMessagesDirty(),this._notifySubscribers()}}_finishVoiceAssistantMessage(){const e=this._voiceMessages.at(-1);if(e?.role==="assistant"&&e.status.type==="running"){const t=this._voiceMessages.length-1;this._voiceMessages[t]={...e,status:{type:"complete",reason:"stop"}},this._markVoiceMessagesDirty(),this._notifySubscribers()}}disconnectVoice(){this._finishVoiceAssistantMessage(),this._currentAssistantMsg=null;for(const e of this._voiceUnsubs)e();this._voiceUnsubs=[],this._voiceSession?.disconnect(),this._voiceSession=void 0,this.voice=void 0,this._voiceVolume=0;for(const e of this._voiceVolumeSubscribers)e();this._voiceMessages=[],this._markVoiceMessagesDirty(),this._notifySubscribers()}muteVoice(){if(!this._voiceSession)throw new Error("No active voice session");this._voiceSession.mute(),this.voice={...this.voice,isMuted:!0},this._notifySubscribers()}unmuteVoice(){if(!this._voiceSession)throw new Error("No active voice session");this._voiceSession.unmute(),this.voice={...this.voice,isMuted:!1},this._notifySubscribers()}ensureInitialized(){this._isInitialized||(this._isInitialized=!0,this._notifyEventSubscribers("initialize",{}))}export(){return this.repository.export()}import(e){this.ensureInitialized(),this.repository.clear(),this.repository.import(e),this._notifySubscribers()}reset(e){this.import(ov.fromArray(e??[]))}unstable_on(e,t){const n=t;if(e==="modelContextUpdate")return this._contextProvider.subscribe?.(()=>n({}))??(()=>{});let r=this._eventSubscribers.get(e);return r||(r=new Set,this._eventSubscribers.set(e,r)),r.add(n),e==="initialize"&&this._isInitialized&&queueMicrotask(()=>{r.has(n)&&n({})}),()=>{this._eventSubscribers.get(e)?.delete(n)}}},ph=class{constructor(){_(this,"cache",new WeakMap)}convertMessages(e,t){return e.map((n,r)=>{const i=t(this.cache.get(n),n,r);return this.cache.set(n,i),i})}};function Nu(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function Jo(e,t=0){return t>100?!1:e===null||typeof e=="string"||typeof e=="boolean"?!0:typeof e=="number"?!Number.isNaN(e)&&Number.isFinite(e):Array.isArray(e)?e.every(n=>Jo(n,t+1)):Nu(e)?Object.entries(e).every(([n,r])=>typeof n=="string"&&Jo(r,t+1)):!1}const p0=100,ju=(e,t,n)=>{if(e===t)return!0;if(n>p0||e==null||t==null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((s,o)=>ju(s,t[o],n+1));if(Array.isArray(t)||!Nu(e)||!Nu(t))return!1;const r=Object.keys(e),i=Object.keys(t);return r.length!==i.length?!1:r.every(s=>Object.hasOwn(t,s)&&ju(e[s],t[s],n+1))},m0=(e,t)=>!Jo(e)||!Jo(t)?!1:ju(e,t,0),Js=e=>{try{return JSON.parse(e),!0}catch{return!1}},mh=e=>{try{return JSON.parse(e)}catch{return}},gh=(e,t)=>{const n=mh(e),r=mh(t);return n===void 0||r===void 0?!1:m0(n,r)};var g0=class{constructor(e,t){_(this,"_getTools");_(this,"_callbacks");_(this,"_entries",new Map);_(this,"_skipExecuteStreamIds",new Set);_(this,"_humanInput",new Map);_(this,"_executing",new Set);_(this,"_settledResolvers",[]);_(this,"_statuses",new Map);_(this,"_ac",new AbortController);_(this,"_pendingRestore",!0);_(this,"_lastSnapshot",null);_(this,"_isRunning",!1);_(this,"_controller");_(this,"_pipelineDead",!1);_(this,"_pipelineRestartUsed",!1);this._getTools=e,this._callbacks=t,this._initPipeline()}_initPipeline(){const[e,t]=oC();this._controller=t;const n=CC(()=>this._getWrappedTools(),()=>this._ac.signal,(r,i)=>this._onHumanInput(r,i),{onExecutionStart:r=>this._onExecutionStart(r),onExecutionEnd:r=>this._onExecutionEnd(r)});e.pipeThrough(n).pipeThrough(new Uy).pipeTo(new WritableStream({write:r=>{try{if(r.type!=="result")return;this._handleResultChunk(r)}catch(i){console.error("[ToolInvocationTracker] result chunk handling failed",i)}}})).catch(r=>{console.error("[ToolInvocationTracker] stream pipeline failed; will attempt single restart on next setState",r),this._pipelineDead=!0})}setState(e){try{if(this._pipelineDead){if(this._pipelineRestartUsed)return;this._pipelineRestartUsed=!0,this._pipelineDead=!1,this._demoteEntriesToRestored(),this._executing.clear(),this._ac=new AbortController,this._initPipeline()}if(this._lastSnapshot&&this._lastSnapshot.messages===e.messages&&this._lastSnapshot.isRunning===e.isRunning&&this._lastSnapshot.isLoading===e.isLoading)return;e.isLoading===!0&&(this._pendingRestore=!0);const t=this._isRunning;this._isRunning=e.isRunning;try{this._processMessages(e.messages)}catch(n){throw this._isRunning=t,n}this._lastSnapshot=e,this._pendingRestore=!1}catch(t){console.error("[ToolInvocationTracker] setState failed; snapshot dropped",t)}}reset(){try{this._pendingRestore=!0,this._entries.clear(),this._lastSnapshot=null,this.abort().finally(()=>{this._executing.clear()})}catch(e){console.error("[ToolInvocationTracker] reset failed",e)}}abort(){try{return this._humanInput.forEach(({reject:e})=>{try{e(new Error("Tool execution aborted"))}catch{}}),this._humanInput.clear(),this._ac.abort(),this._ac=new AbortController,this._executing.size===0?Promise.resolve():new Promise(e=>{this._settledResolvers.push(e)})}catch(e){return console.error("[ToolInvocationTracker] abort failed",e),Promise.resolve()}}resume(e,t){try{const n=this._humanInput.get(e);return n?(this._humanInput.delete(e),this._setStatus(e,{type:"executing"}),n.resolve(t),!0):!1}catch(n){return console.error("[ToolInvocationTracker] resume failed",n),!1}}getStatuses(){return this._statuses}_getWrappedTools(){const e=this._getTools();if(e)return Object.fromEntries(Object.entries(e).map(([t,n])=>{const r=n.execute;return r===void 0?[t,n]:[t,{...n,execute:(...[i,s])=>this._skipExecuteStreamIds.has(s.toolCallId)?new Promise(()=>{}):r(i,s)}]}))}_onHumanInput(e,t){return new Promise((n,r)=>{const i=this._humanInput.get(e);if(i)try{i.reject(new Error("Human input request was superseded by a new request"))}catch{}this._humanInput.set(e,{resolve:n,reject:r}),this._setStatus(e,{type:"interrupt",payload:{type:"human",payload:t}})})}_onExecutionStart(e){this._skipExecuteStreamIds.has(e)||(this._executing.add(e),this._setStatus(e,{type:"executing"}))}_onExecutionEnd(e){this._executing.delete(e)&&(this._deleteStatus(e),this._executing.size===0&&this._settledResolvers.splice(0).forEach(t=>{try{t()}catch{}}))}_handleResultChunk(e){const t=e.meta.toolCallId,n=this._entries.get(t);!n&&this._skipExecuteStreamIds.has(t)||n?.hasResult||this._invokeOnResult({type:"add-tool-result",toolCallId:t,toolName:e.meta.toolName,result:e.result,isError:e.isError,...e.artifact!==void 0&&{artifact:e.artifact},...e.modelContent!==void 0&&{modelContent:e.modelContent}})}_invokeOnResult(e){try{this._callbacks.onResult(e)}catch(t){console.error("[ToolInvocationTracker] onResult callback threw; result dropped",t)}}_invokeOnStatusesChange(){try{this._callbacks.onStatusesChange(this._statuses)}catch(e){console.error("[ToolInvocationTracker] onStatusesChange callback threw; status change not propagated",e)}}_setStatus(e,t){const n=new Map(this._statuses);n.set(e,t),this._statuses=n,this._invokeOnStatusesChange()}_deleteStatus(e){if(!this._statuses.has(e))return;const t=new Map(this._statuses);t.delete(e),this._statuses=t,this._invokeOnStatusesChange()}_hasExecutableTool(e){const t=this._getTools()?.[e];return t?.execute!==void 0||t?.streamCall!==void 0}_shouldCloseArgsStream({toolName:e,argsText:t,hasResult:n}){return n?!0:(this._hasExecutableTool(e)||!this._isRunning)&&Js(t)}_startActiveEntry(e,t,n){const r=this._controller.addToolCallPart({toolName:t,toolCallId:e});n&&this._skipExecuteStreamIds.add(e);const i={toolName:t,controller:r,argsText:"",hasResult:!1,argsComplete:!1};return this._entries.set(e,i),i}_demoteEntriesToRestored(){for(const[e,t]of this._entries)t.controller&&this._entries.set(e,{toolName:t.toolName,argsText:t.argsText,hasResult:t.hasResult})}_processArgsText(e,t){if(!e.controller)return;const n=t.result!==void 0;if(t.argsText!==e.argsText){let r=!0;if(e.argsComplete)gh(e.argsText,t.argsText)&&(e.argsText=t.argsText),r=!1;else if(!t.argsText.startsWith(e.argsText))if(Js(e.argsText)&&Js(t.argsText)&&gh(e.argsText,t.argsText)){const i=this._shouldCloseArgsStream({toolName:t.toolName,argsText:t.argsText,hasResult:n});i&&e.controller.argsText.close(),e.argsText=t.argsText,e.argsComplete=i,r=!1}else r=!1;if(r&&e.controller){const i=t.argsText.slice(e.argsText.length);e.controller.argsText.append(i);const s=this._shouldCloseArgsStream({toolName:t.toolName,argsText:t.argsText,hasResult:n});s&&e.controller.argsText.close(),e.argsText=t.argsText,e.argsComplete=s}}!e.argsComplete&&e.controller&&this._shouldCloseArgsStream({toolName:t.toolName,argsText:t.argsText,hasResult:n})&&(e.controller.argsText.close(),e.argsText=t.argsText,e.argsComplete=!0)}_processMessages(e){const t=this._pendingRestore;for(const n of e)if(!(!n||!Array.isArray(n.content)))for(const r of n.content){if(!r||r.type!=="tool-call")continue;const i=this._entries.get(r.toolCallId);if(t){i?.controller||this._entries.set(r.toolCallId,{toolName:r.toolName,argsText:r.argsText,hasResult:r.result!==void 0}),r.messages&&this._processMessages(r.messages);continue}let s=i;if(s&&!s.controller){if(!(r.argsText!==s.argsText||r.result!==void 0!==s.hasResult)){r.messages&&this._processMessages(r.messages);continue}this._entries.delete(r.toolCallId),s=void 0}if(s||(s=this._startActiveEntry(r.toolCallId,r.toolName,r.result!==void 0)),this._processArgsText(s,r),r.result!==void 0&&!s.hasResult){const{controller:o}=s;if(!o)continue;s.hasResult=!0,s.argsComplete=!0,o.setResponse(new ln({result:r.result,artifact:r.artifact,isError:r.isError,...r.modelContent!==void 0?{modelContent:r.modelContent}:{}})),o.close()}r.messages&&this._processMessages(r.messages)}}};const y0=Object.freeze([]),yh=(e,t)=>{const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0},v0=(e,t)=>e&&t[t.length-1]?.role!=="assistant";var x0=class extends h0{constructor(t,n){super(t);_(this,"_capabilities",{switchToBranch:!1,switchBranchDuringRun:!1,edit:!1,reload:!1,cancel:!1,unstable_copy:!1,speech:!1,dictation:!1,voice:!1,attachments:!1,feedback:!1,queue:!1});_(this,"_messages");_(this,"isDisabled");_(this,"isSendDisabled");_(this,"suggestions",[]);_(this,"extras");_(this,"_converter",new ph);_(this,"_store");_(this,"_toolInvocations",null);_(this,"_toolCallToMessageId",new Map);_(this,"_messagesForToolCallIndex",null);_(this,"updateMessages",t=>{this._store.convertMessage!==void 0?this._store.setMessages?.(t.flatMap(NC)):this._store.setMessages?.(t)});this.__internal_setAdapter(n)}get capabilities(){return this._capabilities}get isLoading(){return this._store.isLoading??!1}get isRunning(){return this._store.isRunning}_getBaseMessages(){return this._messages}get state(){return this._store.state??super.state}get adapters(){return this._store.adapters}beginEdit(t){if(!this._store.onEdit)throw new Error("Runtime does not support editing.");super.beginEdit(t)}__internal_setAdapter(t){if(this._store===t)return;const n=t.isRunning??!1;this.isDisabled=t.isDisabled??!1,this.isSendDisabled=t.isSendDisabled??!1;const r=this._store;this._store=t,this.extras!==t.extras&&(this.extras=t.extras);const i=t.suggestions??y0;yh(this.suggestions,i)||(this.suggestions=i);const s={switchToBranch:this._store.setMessages!==void 0,switchBranchDuringRun:!1,edit:this._store.onEdit!==void 0,reload:this._store.onReload!==void 0,cancel:this._store.onCancel!==void 0,speech:this._store.adapters?.speech!==void 0,dictation:this._store.adapters?.dictation!==void 0,voice:this._store.adapters?.voice!==void 0,unstable_copy:this._store.unstable_capabilities?.copy!==!1,attachments:!!this._store.adapters?.attachments,feedback:!!this._store.adapters?.feedback,queue:!1};yh(this._capabilities,s)||(this._capabilities=s);let o;if(t.messageRepository){if(r&&r.isRunning===t.isRunning&&r.messageRepository===t.messageRepository){this._notifySubscribers();return}this.repository.clear(),this.repository.import(t.messageRepository),o=this.repository.getMessages()}else if(t.messages){if(r){if(r.convertMessage!==t.convertMessage)this._converter=new ph;else if(r.isRunning===t.isRunning&&r.messages===t.messages){this._notifySubscribers();return}}o=t.convertMessage?this._converter.convertMessages(t.messages,(l,u,d)=>{if(!t.convertMessage)return u;const c=Yo(d===(t.messages?.length??0)-1,n,!1,!1,void 0);if(l&&(l.role!=="assistant"||!a0(l.status)||l.status===c))return l;const f=ps(t.convertMessage(u,d),d.toString(),c);return MC(f,u),f}):t.messages;for(let l=0;l<o.length;l++){const u=o[l],d=o[l-1];this.repository.addOrUpdateMessage(d?.id??null,u)}}else throw new Error("ExternalStoreAdapter must provide either 'messages' or 'messageRepository'");o.length>0&&this.ensureInitialized(),(r?.isRunning??!1)!==(t.isRunning??!1)&&(t.isRunning?this._notifyEventSubscribers("runStart",{}):this._notifyEventSubscribers("runEnd",{}));let a=null;v0(n,o)&&(a=Bn(),this.repository.addOrUpdateMessage(o.at(-1)?.id??null,ps({role:"assistant",content:[],metadata:{isOptimistic:!0}},a,{type:"running"}))),this.repository.resetHead(a??o.at(-1)?.id??null),this._messages=this.repository.getMessages(),this._driveToolInvocations(),this._notifySubscribers()}_driveToolInvocations(){if(!this._store.unstable_enableToolInvocations){this._toolInvocations&&(this._toolInvocations.reset(),this._toolInvocations=null,this._store.setToolStatuses?.({}));return}this._toolInvocations||(this._toolInvocations=new g0(()=>this.getModelContext().tools,{onResult:t=>{try{const n=this._findMessageIdForToolCall(t.toolCallId);if(n===void 0)return;this._store.onAddToolResult?.({messageId:n,toolCallId:t.toolCallId,toolName:t.toolName,result:t.result,isError:t.isError,...t.artifact!==void 0&&{artifact:t.artifact},...t.modelContent!==void 0&&{modelContent:t.modelContent}})}catch(n){console.error("[ExternalStoreThreadRuntimeCore] onAddToolResult dispatch failed",n)}},onStatusesChange:t=>{this._store.setToolStatuses?.(Object.fromEntries(t))}})),this._toolInvocations.setState({messages:this._messages,isRunning:this._store.isRunning??!1,...this._store.isLoading!==void 0&&{isLoading:this._store.isLoading}})}_findMessageIdForToolCall(t){if(this._messagesForToolCallIndex!==this._messages){this._toolCallToMessageId.clear();const n=r=>{for(const i of r)if(Array.isArray(i.content))for(const s of i.content)!s||s.type!=="tool-call"||(this._toolCallToMessageId.set(s.toolCallId,i.id),s.messages&&n(s.messages))};n(this._messages),this._messagesForToolCallIndex=this._messages}return this._toolCallToMessageId.get(t)}switchToBranch(t){if(!this._store.setMessages)throw new Error("Runtime does not support switching branches.");this._store.isRunning||(this.repository.switchToBranch(t),this.updateMessages(this.repository.getMessages()))}async append(t){if((t.startRun??t.role==="user")&&await this._toolInvocations?.abort(),t.parentId!==(this.messages.at(-1)?.id??null)){if(!this._store.onEdit)throw new Error("Runtime does not support editing messages.");await this._store.onEdit(t)}else await this._store.onNew(t)}async startRun(t){if(!this._store.onReload)throw new Error("Runtime does not support reloading messages.");await this._toolInvocations?.abort(),await this._store.onReload(t.parentId,t)}async resumeRun(t){if(!this._store.onResume)throw new Error("Runtime does not support resuming runs.");await this._store.onResume(t)}exportExternalState(){if(!this._store.onExportExternalState)throw new Error("Runtime does not support exporting external states.");return this._store.onExportExternalState()}importExternalState(t){if(!this._store.onLoadExternalState)throw new Error("Runtime does not support importing external states.");this._toolInvocations&&(this._toolInvocations.reset(),this._store.setToolStatuses?.({})),this._store.onLoadExternalState(t)}cancelRun(){if(!this._store.onCancel)throw new Error("Runtime does not support cancelling runs.");this._toolInvocations?.abort(),this._store.onCancel();const t=this.repository.getMessages().at(-1);t&&t.metadata.isOptimistic&&t.content.length===0&&this.repository.deleteMessage(t.id);let n=this.repository.getMessages();const r=n[n.length-1];r?.role==="user"&&r.id===n.at(-1)?.id?(this.repository.deleteMessage(r.id),this.composer.text.trim()||this.composer.setText(hs(r)),n=this.repository.getMessages()):this._notifySubscribers(),setTimeout(()=>{this.updateMessages(n)},0)}addToolResult(t){if(!this._store.onAddToolResult)throw new Error("Runtime does not support tool results.");this._store.onAddToolResult?.(t)}resumeToolCall(t){if(!(this._toolInvocations?.resume(t.toolCallId,t.payload)??!1)){if(this._store.onResumeToolCall){this._store.onResumeToolCall(t);return}throw new Error(`Tool call ${t.toolCallId} is not waiting for resume.`)}}respondToToolApproval(t){if(!this._store.onRespondToToolApproval)throw new Error("Runtime does not support tool approvals.");this._store.onRespondToToolApproval(t)}reset(t){const n=new td;n.import(ov.fromArray(t??[])),this.updateMessages(n.getMessages())}import(t){super.import(t),this._store.onImport&&this._store.onImport(this.repository.getMessages())}};const vh=e=>e.adapters?.threadList??{};var w0=class extends sv{constructor(t){super();_(this,"threads");this.threads=new n0(vh(t),()=>new x0(this._contextProvider,t))}setAdapter(t){this.threads.__internal_setAdapter(vh(t)),this.threads.getMainThreadRuntimeCore().__internal_setAdapter(t)}};const nd=e=>{const[t]=g.useState(()=>new w0(e));g.useEffect(()=>{t.setAdapter(e)});const{modelContext:n}=YC()??{};return g.useEffect(()=>{if(n)return t.registerModelContextProvider(n)},[n,t]),g.useMemo(()=>new iv(t),[t])},uv=(e,t)=>e.Message===t.Message&&e.EditComposer===t.EditComposer&&e.UserEditComposer===t.UserEditComposer&&e.AssistantEditComposer===t.AssistantEditComposer&&e.SystemEditComposer===t.SystemEditComposer&&e.UserMessage===t.UserMessage&&e.AssistantMessage===t.AssistantMessage&&e.SystemMessage===t.SystemMessage,S0=()=>null,b0=(e,t,n)=>{switch(t){case"user":return n?e.UserEditComposer??e.EditComposer??e.UserMessage??e.Message:e.UserMessage??e.Message;case"assistant":return n?e.AssistantEditComposer??e.EditComposer??e.AssistantMessage??e.Message:e.AssistantMessage??e.Message;case"system":return n?e.SystemEditComposer??e.EditComposer??e.SystemMessage??e.Message:e.SystemMessage??e.Message??S0;default:throw new Error(`Unknown message role: ${t}`)}},cv=({components:e})=>p.jsx(b0(e,F(t=>t.message.role),F(t=>t.message.composer.isEditing)),{}),dv=g.memo(({index:e,components:t})=>p.jsx(Gy,{index:e,children:p.jsx(cv,{components:t})}),(e,t)=>e.index===t.index&&uv(e.components,t.components));dv.displayName="ThreadPrimitive.MessageByIndex";const xh=({children:e})=>{const t=F(n=>n.thread.messages.length);return g.useMemo(()=>t===0?null:Array.from({length:t},(n,r)=>p.jsx(Gy,{index:r,children:p.jsx(li,{getItemState:i=>i.thread().message({index:r}).getState(),children:i=>e({get message(){return i()}})})},r)),[t,e])},fv=({components:e,children:t})=>e?p.jsx(xh,{children:()=>p.jsx(cv,{components:e})}):p.jsx(xh,{children:t});fv.displayName="ThreadPrimitive.Messages";const k0=g.memo(fv,(e,t)=>e.children||t.children?e.children===t.children:uv(e.components,t.components)),hv=e=>{const t=e.message.metadata;if(!(!t||typeof t!="object"))return t.custom?.quote};var _0=class extends Error{constructor(t,n=`Component "${t}" is not in the generative-ui allowlist.`){super(n);_(this,"componentName");this.name="GenerativeUIRenderError",this.componentName=t}};const C0=e=>typeof e=="object"&&e!==null,pv=(e,t,n,r)=>{if(e==null)return null;if(typeof e=="string")return e;if(!C0(e)||!("component"in e))return null;const{component:i,props:s,children:o,key:a}=e,l=t[i];if(!l){if(n)return p.jsx(n,{component:i,props:s},a??r);throw new _0(i)}const u=o?.length?o.map((d,c)=>pv(d,t,n,`${r}/${c}`)):void 0;return g.createElement(l,{...s??{},key:a??r},...u??[])},E0=e=>{if(!e||e.root===void 0||e.root===null)return[];const t=e.root;return Array.isArray(t)?t:[t]},rd=({spec:e,components:t,Fallback:n})=>p.jsx(p.Fragment,{children:g.useMemo(()=>E0(e),[e]).map((r,i)=>pv(r,t,n,`${i}`))});rd.displayName="GenerativeUIRender";const mv=({components:e,spec:t,Fallback:n})=>{const r=F(s=>{const o=s.part;return o?.type==="generative-ui"?o.spec:void 0}),i=t??r;return i?p.jsx(rd,{spec:i,components:e,Fallback:n}):null};mv.displayName="MessagePrimitive.GenerativeUI";const T0="ui://",I0=e=>!!e?.startsWith(T0),wh=e=>Symbol.iterator in e,Sh=e=>"entries"in e,bh=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[i,s]of n)if(!r.has(i)||!Object.is(s,r.get(i)))return!1;return!0},R0=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let i=n.next(),s=r.next();for(;!i.done&&!s.done;){if(!Object.is(i.value,s.value))return!1;i=n.next(),s=r.next()}return!!i.done&&!!s.done};function P0(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:wh(e)&&wh(t)?Sh(e)&&Sh(t)?bh(e,t):R0(e,t):bh({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function gv(e){const t=rt.useRef(void 0);return n=>{const r=e(n);return P0(t.current,r)?t.current:t.current=r}}const pl=e=>{let t=-1;return{startGroup:n=>{t===-1&&(t=n)},endGroup:(n,r)=>{t!==-1&&(r.push({type:e,startIndex:t,endIndex:n}),t=-1)},finalize:(n,r)=>{t!==-1&&r.push({type:e,startIndex:t,endIndex:n})}}},A0=(e,t)=>{const n=[];if(t){const r=pl("chainOfThoughtGroup");for(let i=0;i<e.length;i++){const s=e[i];s==="tool-call"||s==="reasoning"?r.startGroup(i):(r.endGroup(i-1,n),n.push({type:"single",index:i}))}r.finalize(e.length-1,n)}else{const r=pl("toolGroup"),i=pl("reasoningGroup");for(let s=0;s<e.length;s++){const o=e[s];o==="tool-call"?(i.endGroup(s-1,n),r.startGroup(s)):o==="reasoning"?(r.endGroup(s-1,n),i.startGroup(s)):(r.endGroup(s-1,n),i.endGroup(s-1,n),n.push({type:"single",index:s}))}r.finalize(e.length-1,n),i.finalize(e.length-1,n)}return n},M0=e=>{const t=F(gv(n=>n.message.parts.map(r=>r.type)));return g.useMemo(()=>t.length===0?[]:A0(t,e),[t,e])},N0=({Fallback:e,...t})=>{const n=F(r=>r.tools.toolUIs[t.toolName]?.[0]?.render??e);return n?p.jsx(n,{...t}):null},id=(e,t,n)=>{const r=e.renderers[t]?.[0];return r||(e.fallbacks[0]??n)},j0=({Fallback:e,...t})=>{const n=F(r=>id(r.dataRenderers,t.name,e));return n?p.jsx(n,{...t}):null},$e={Text:()=>null,Reasoning:()=>null,Source:()=>null,Image:()=>null,File:()=>null,Unstable_Audio:()=>null,ToolGroup:({children:e})=>e,ReasoningGroup:({children:e})=>e},D0=({components:{Text:e=$e.Text,Reasoning:t=$e.Reasoning,Image:n=$e.Image,Source:r=$e.Source,File:i=$e.File,Unstable_Audio:s=$e.Unstable_Audio,tools:o={},data:a,generativeUI:l}={}})=>{const u=se(),d=F(f=>f.part),c=d.type;if(c==="tool-call"){const f=u.part().addToolResult,h=u.part().resumeToolCall,m=u.part().respondToToolApproval;if("Override"in o)return p.jsx(o.Override,{...d,addResult:f,resume:h,respondToApproval:m});const x=o.by_name?.[d.toolName]??o.Fallback;return p.jsx(N0,{...d,Fallback:x,addResult:f,resume:h,respondToApproval:m})}if(d.status?.type==="requires-action")throw new Error("Encountered unexpected requires-action status");switch(c){case"text":return p.jsx(e,{...d});case"reasoning":return p.jsx(t,{...d});case"source":return p.jsx(r,{...d});case"image":return p.jsx(n,{...d});case"file":return p.jsx(i,{...d});case"audio":return p.jsx(s,{...d});case"data":{const f=a?.by_name?.[d.name]??a?.Fallback;return p.jsx(j0,{...d,Fallback:f})}case"generative-ui":return l?.components?p.jsx(rd,{spec:d.spec,components:l.components,Fallback:l.Fallback}):null;default:return console.warn(`Unknown message part type: ${c}`),null}},Hi=g.memo(({index:e,components:t})=>p.jsx(Xc,{index:e,children:p.jsx(D0,{components:t})}),(e,t)=>e.index===t.index&&e.components?.Text===t.components?.Text&&e.components?.Reasoning===t.components?.Reasoning&&e.components?.Source===t.components?.Source&&e.components?.Image===t.components?.Image&&e.components?.File===t.components?.File&&e.components?.Unstable_Audio===t.components?.Unstable_Audio&&e.components?.tools===t.components?.tools&&e.components?.data===t.components?.data&&e.components?.generativeUI===t.components?.generativeUI&&e.components?.ToolGroup===t.components?.ToolGroup&&e.components?.ReasoningGroup===t.components?.ReasoningGroup);Hi.displayName="MessagePrimitive.PartByIndex";const O0=({status:e,component:t})=>p.jsx(Zc,{text:"",isRunning:e.type==="running",children:p.jsx(t,{type:"text",text:"",status:e})}),L0=Object.freeze({type:"complete"}),z0=Object.freeze({type:"running"}),F0=({components:e})=>{const t=F(n=>n.message.status??L0);return e?.Empty?p.jsx(e.Empty,{status:t}):t.type!=="running"?null:p.jsx(O0,{status:t,component:e?.Text??$e.Text})},yv=g.memo(F0,(e,t)=>e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),B0=({components:e,enabled:t})=>F(n=>{if(!t||n.message.parts.length===0)return!1;const r=n.message.parts[n.message.parts.length-1];return r?.type!=="text"&&r?.type!=="reasoning"})?p.jsx(yv,{components:e}):null,U0=g.memo(B0,(e,t)=>e.enabled===t.enabled&&e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),$0=({Quote:e})=>{const t=F(hv);return t?p.jsx(e,{text:t.text,messageId:t.messageId}):null},V0=g.memo($0);function vv(e,t){const n=e.toolUIs[t.toolName]?.[0]?.render??null;return n||(I0(t.mcp?.app?.resourceUri)&&e.mcpApp?e.mcpApp.render:null)}const xv=()=>{const e=se(),t=F(r=>r.part),n=F(r=>r.part.type==="tool-call"?vv(r.tools,r.part):null);return!n||t.type!=="tool-call"?null:p.jsx(n,{...t,addResult:e.part().addToolResult,resume:e.part().resumeToolCall,respondToApproval:e.part().respondToToolApproval})},wv=()=>{const e=F(n=>n.part),t=F(n=>n.part.type==="data"?id(n.dataRenderers,n.part.name,void 0)??null:null);return!t||e.type!=="data"?null:p.jsx(t,{...e})},H0=()=>{const e=F(t=>t.part.type);return e==="tool-call"?p.jsx(xv,{}):e==="data"?p.jsx(wv,{}):null},W0=Object.freeze({type:"text",text:"",status:z0}),Sv=({index:e,children:t})=>{const n=se(),r=F(i=>i.dataRenderers);return p.jsx(Xc,{index:e,children:p.jsx(li,{getItemState:i=>i.message().part({index:e}).getState(),children:i=>t({get part(){const s=i();if(s.type==="tool-call"){const o=vv(n.tools().getState(),s)!==null,a=n.message().part({index:e});return{...s,toolUI:o?p.jsx(xv,{}):null,addResult:a.addToolResult,resume:a.resumeToolCall,respondToApproval:a.respondToToolApproval}}if(s.type==="data"){const o=id(r,s.name,void 0)!==void 0;return{...s,dataRendererUI:o?p.jsx(wv,{}):null}}return s}})})})},q0=({children:e})=>{const t=F(i=>i.message.parts.length),n=F(i=>(i.message.status?.type??"complete")==="running"),r=t===0&&n;return t===0?r?p.jsx(Zc,{text:"",isRunning:!0,children:e({part:W0})}):null:p.jsx(p.Fragment,{children:Array.from({length:t},(i,s)=>p.jsx(Sv,{index:s,children:o=>e(o)??p.jsx(H0,{})},s))})},Du=({components:e,unstable_showEmptyOnNonTextEnd:t=!0,children:n})=>n?p.jsx(q0,{children:n}):p.jsx(K0,{components:e,unstable_showEmptyOnNonTextEnd:t});Du.displayName="MessagePrimitive.Parts";const K0=({components:e,unstable_showEmptyOnNonTextEnd:t})=>{const n=F(s=>s.message.parts.length),r=M0(!!e?.ChainOfThought),i=g.useMemo(()=>n===0?p.jsx(yv,{components:e}):r.map(s=>{if(s.type==="single")return p.jsx(Hi,{index:s.index,components:e},s.index);if(s.type==="chainOfThoughtGroup"){const o=e?.ChainOfThought;return o?p.jsx(RC,{startIndex:s.startIndex,endIndex:s.endIndex,children:p.jsx(o,{})},`chainOfThought-${s.startIndex}`):null}else return s.type==="toolGroup"?p.jsx(e?.ToolGroup??$e.ToolGroup,{startIndex:s.startIndex,endIndex:s.endIndex,children:Array.from({length:s.endIndex-s.startIndex+1},(o,a)=>{const l=s.startIndex+a;return p.jsx(Hi,{index:l,components:e},`part-${l}`)})},`tool-${s.startIndex}`):p.jsx(e?.ReasoningGroup??$e.ReasoningGroup,{startIndex:s.startIndex,endIndex:s.endIndex,children:Array.from({length:s.endIndex-s.startIndex+1},(o,a)=>{const l=s.startIndex+a;return p.jsx(Hi,{index:l,components:e},`part-${l}`)})},`reasoning-${s.startIndex}`)}),[r,e,n]);return p.jsxs(p.Fragment,{children:[e?.Quote&&p.jsx(V0,{Quote:e.Quote}),i,p.jsx(U0,{components:e,enabled:t})]})},Q0=Symbol.for("@assistant-ui/groupBy.memoKey"),kh=e=>{const t=e.nextChildIdx++;return e.nodeKey===""?String(t):`${e.nodeKey}.${t}`},G0=e=>{const t={key:"",nodeKey:"",indices:[],children:[],nextChildIdx:0},n=[t],r=()=>{const i=n.pop();n[n.length-1].children.push({type:"group",key:i.key,nodeKey:i.nodeKey,indices:i.indices,children:i.children})};for(let i=0;i<e.length;i++){const s=e[i];let o=0;for(;o<n.length-1&&o<s.length&&n[o+1].key===s[o];)o++;for(;n.length-1>o;)r();for(;n.length-1<s.length;){const l=n[n.length-1];n.push({key:s[n.length-1],nodeKey:kh(l),indices:[],children:[],nextChildIdx:0})}const a=n[n.length-1];a.children.push({type:"part",index:i,nodeKey:kh(a)});for(let l=1;l<n.length;l++)n[l].indices.push(i)}for(;n.length>1;)r();return t.children},Y0=Object.freeze({type:"complete"}),J0=(e,t,n)=>{if(!n)return!1;switch(e){case"never":return!1;case"always":return!0;case"empty":return t.length===0;case"no-text":{const r=t[t.length-1];return r!==void 0&&r.type!=="text"&&r.type!=="reasoning"}}},bv=()=>{throw new Error("MessagePrimitive.GroupedParts: rendered `children` under a leaf part. `children` is only meaningful for `group-…` cases — add a matching case for the part type or return `null` to skip it.")},kv=(e,t,n)=>{if(e.type==="part")return p.jsx(Sv,{index:e.index,children:({part:i})=>n({part:i,children:p.jsx(bv,{})})},`part-${e.index}`);const r=t[e.indices.at(-1)]?.status??Y0;return p.jsx(g.Fragment,{children:n({part:{type:e.key,status:r,indices:e.indices},children:p.jsx(p.Fragment,{children:e.children.map(i=>kv(i,t,n))})})},e.nodeKey)},_v=({groupBy:e,indicator:t="no-text",children:n})=>{const r=F(gv(o=>o.message.parts)),i=F(o=>o.tools.toolUIs),s=F(o=>t==="never"?!1:o.message.status?.type==="running");return p.jsxs(p.Fragment,{children:[g.useMemo(()=>{const o={toolUIs:i};return G0(r.map(a=>e(a,o)??[]))},[r,e[Q0]??e,i]).map(o=>kv(o,r,n)),J0(t,r,s)&&n({part:{type:"indicator"},children:p.jsx(bv,{})})]})};_v.displayName="MessagePrimitive.GroupedParts";const X0=({children:e})=>{const t=F(hv);return t?p.jsx(p.Fragment,{children:e(t)}):null},Cv=g.memo(X0);Cv.displayName="MessagePrimitive.Quote";const Ev=(e,t)=>{switch(t.type){case"image":return e?.Image??e?.Attachment;case"document":return e?.Document??e?.Attachment;case"file":return e?.File??e?.Attachment;default:return e?.Attachment}},Z0=({components:e})=>{const t=F(r=>r.attachment);if(!t)return null;const n=Ev(e,t);return n?p.jsx(n,{}):null},Tv=g.memo(({index:e,components:t})=>p.jsx(Ky,{index:e,children:p.jsx(Z0,{components:t})}),(e,t)=>e.index===t.index&&e.components?.Image===t.components?.Image&&e.components?.Document===t.components?.Document&&e.components?.File===t.components?.File&&e.components?.Attachment===t.components?.Attachment);Tv.displayName="MessagePrimitive.AttachmentByIndex";const _h=({children:e})=>{const t=F(n=>n.message.role!=="user"?0:(n.message.attachments??[]).length);return g.useMemo(()=>Array.from({length:t},(n,r)=>p.jsx(Ky,{index:r,children:p.jsx(li,{getItemState:i=>i.message().attachment({index:r}).getState(),children:i=>e({get attachment(){return i()}})})},r)),[t,e])},Iv=({components:e,children:t})=>e?p.jsx(_h,{children:({attachment:n})=>{const r=Ev(e,n);return r?p.jsx(r,{}):null}}):p.jsx(_h,{children:t});Iv.displayName="MessagePrimitive.Attachments";const Rv=(e,t)=>{switch(t.type){case"image":return e?.Image??e?.Attachment;case"document":return e?.Document??e?.Attachment;case"file":return e?.File??e?.Attachment;default:return e?.Attachment}},e1=({components:e})=>{const t=F(r=>r.attachment);if(!t)return null;const n=Rv(e,t);return n?p.jsx(n,{}):null},Pv=g.memo(({index:e,components:t})=>p.jsx(Qy,{index:e,children:p.jsx(e1,{components:t})}),(e,t)=>e.index===t.index&&e.components?.Image===t.components?.Image&&e.components?.Document===t.components?.Document&&e.components?.File===t.components?.File&&e.components?.Attachment===t.components?.Attachment);Pv.displayName="ComposerPrimitive.AttachmentByIndex";const Ch=({children:e})=>{const t=F(n=>n.composer.attachments.length);return g.useMemo(()=>Array.from({length:t},(n,r)=>p.jsx(Qy,{index:r,children:p.jsx(li,{getItemState:i=>i.composer().attachment({index:r}).getState(),children:i=>e({get attachment(){return i()}})})},r)),[t,e])},Av=({components:e,children:t})=>e?p.jsx(Ch,{children:({attachment:n})=>{const r=Rv(e,n);return r?p.jsx(r,{}):null}}):p.jsx(Ch,{children:t});Av.displayName="ComposerPrimitive.Attachments";const t1=({children:e})=>{const t=F(n=>n.composer.queue.length);return g.useMemo(()=>Array.from({length:t},(n,r)=>p.jsx(PC,{index:r,children:p.jsx(li,{getItemState:i=>i.composer().queueItem({index:r}).getState(),children:i=>e({get queueItem(){return i()}})})},r)),[t,e])},Mv=g.memo(t1);Mv.displayName="ComposerPrimitive.Queue";const sd=({children:e})=>F(t=>t.part.status.type==="running")?e:null;sd.displayName="MessagePartPrimitive.InProgress";const Nv=({components:e})=>{const t=e.Suggestion;return p.jsx(t,{})},jv=g.memo(({index:e,components:t})=>p.jsx(Yy,{index:e,children:p.jsx(Nv,{components:t})}),(e,t)=>e.index===t.index&&e.components.Suggestion===t.components.Suggestion);jv.displayName="ThreadPrimitive.SuggestionByIndex";const Eh=({children:e})=>{const t=F(n=>n.suggestions.suggestions.length);return g.useMemo(()=>t===0?null:Array.from({length:t},(n,r)=>p.jsx(Yy,{index:r,children:p.jsx(li,{getItemState:i=>i.suggestions().suggestion({index:r}).getState(),children:i=>e({get suggestion(){return i()}})})},r)),[t,e])},Dv=({components:e,children:t})=>e?p.jsx(Eh,{children:()=>p.jsx(Nv,{components:e})}):p.jsx(Eh,{children:t});Dv.displayName="ThreadPrimitive.Suggestions";const n1=g.memo(Dv,(e,t)=>e.children||t.children?e.children===t.children:e.components.Suggestion===t.components.Suggestion),r1=e=>F(t=>{if(e.editing===!0&&!t.composer.isEditing||e.editing===!1&&t.composer.isEditing)return!1;const n=t.composer.dictation!=null;return!(e.dictation===!0&&!n||e.dictation===!1&&n)}),Ov=({children:e,...t})=>r1(t)?e:null;Ov.displayName="ComposerPrimitive.If";const i1=()=>{const e=se(),t=F(n=>!n.composer.canSend||n.thread.isRunning&&!n.thread.capabilities.queue);return{send:g.useCallback(n=>{e.composer().send(n)},[e]),disabled:t}},s1=()=>{const e=se(),t=F(n=>!n.composer.canCancel);return{cancel:g.useCallback(()=>{e.composer().cancel()},[e]),disabled:t}},o1=()=>{const e=se(),t=F(n=>n.composer.dictation!=null||!n.thread.capabilities.dictation||!n.composer.isEditing);return{startDictation:g.useCallback(()=>{e.composer().startDictation()},[e]),disabled:t}},a1=()=>{const e=se(),t=F(n=>!n.composer.isEditing);return{addAttachment:g.useCallback(n=>e.composer().addAttachment(n),[e]),disabled:t}},l1=({prompt:e,send:t,clearComposer:n=!0})=>{const r=se(),i=F(o=>o.thread.isDisabled),s=t??!1;return{trigger:g.useCallback(()=>{const o=r.thread().getState().isRunning;if(s&&!o)r.thread().append({content:[{type:"text",text:e}],runConfig:r.composer().getState().runConfig}),n&&r.composer().setText("");else if(n)r.composer().setText(e);else{const a=r.composer().getState().text;r.composer().setText(a.trim()?`${a} ${e}`:e)}},[r,s,n,e]),disabled:i}},u1=()=>F(e=>e.message.status?.type==="incomplete"&&e.message.status.reason==="error"?e.message.status.error??"An error occurred":void 0),c1=e=>{const{cloud:t,initialMessages:n,maxSteps:r,adapters:i,unstable_humanToolNames:s,...o}=e;return{localRuntimeOptions:{cloud:t,initialMessages:n,maxSteps:r,adapters:i,unstable_humanToolNames:s},otherOptions:o}},d1=/:([\w-]{1,64})\[([^\]\n]{1,1024})\](?:\{name=([^}\n]{1,1024})\})?/gu,Lv={serialize(e){const t=e.id!==e.label?`{name=${e.id}}`:"";return`:${e.type}[${e.label}]${t}`},parse(e){const t=[];let n=0;for(const r of e.matchAll(d1)){r.index>n&&t.push({kind:"text",text:e.slice(n,r.index)});const i=r[2];t.push({kind:"mention",type:r[1],label:i,id:r[3]??i}),n=r.index+r[0].length}return n<e.length&&t.push({kind:"text",text:e.slice(n)}),t}};function f1(e,t){function n(r){const i=g.useContext(e);if(!r?.optional&&!i)throw new Error(`This component must be used within ${t}.`);return i}return n}function zv(e,t){function n(i){const s=e(i);return s?s[t]:null}function r(i){let s=!1,o;typeof i=="function"?o=i:i&&typeof i=="object"&&(s=!!i.optional,o=i.selector);const a=n({optional:s});return a?o?a(o):a():null}return{[t]:r,[`${t}Store`]:n}}const Fv=g.createContext(null),{useThreadViewport:yr,useThreadViewportStore:vr}=zv(f1(Fv,"ThreadPrimitive.Viewport"),"useThreadViewport"),Th=e=>{const t=new Map,n=()=>{let r=0;for(const i of t.values())r+=i;e(r)};return{register:()=>{const r=Symbol();return t.set(r,0),{setHeight:i=>{t.get(r)!==i&&(t.set(r,i),n())},unregister:()=>{t.delete(r),n()}}}}},h1=(e={})=>{const t=new Set,n=Th(o=>{s.setState({height:{...s.getState().height,viewport:o}})}),r=Th(o=>{s.setState({height:{...s.getState().height,inset:o}})}),i=(o,a)=>(s.setState({element:{...s.getState().element,[o]:a}}),()=>{s.getState().element[o]===a&&s.setState({element:{...s.getState().element,[o]:null}})}),s=zy(()=>({isAtBottom:!0,scrollToBottom:({behavior:o="auto"}={})=>{for(const a of t)a({behavior:o})},onScrollToBottom:o=>(t.add(o),()=>{t.delete(o)}),turnAnchor:e.turnAnchor??"bottom",topAnchorMessageClamp:{tallerThan:e.topAnchorMessageClamp?.tallerThan??"10em",visibleHeight:e.topAnchorMessageClamp?.visibleHeight??"6em"},height:{viewport:0,inset:0},element:{viewport:null,anchor:null,target:null},targetConfig:null,topAnchorTurn:null,registerViewport:n.register,registerContentInset:r.register,registerViewportElement:o=>i("viewport",o),registerAnchorElement:o=>i("anchor",o),registerAnchorTargetElement:(o,a)=>(s.setState({element:{...s.getState().element,target:o},targetConfig:o&&a?a:null}),()=>{s.getState().element.target===o&&s.setState({element:{...s.getState().element,target:null},targetConfig:null})}),setTopAnchorTurn:o=>{s.setState({topAnchorTurn:o})}}));return s},Xo=e=>e,p1=e=>{const t=vr({optional:!0}),[n]=g.useState(()=>h1(e));return g.useEffect(()=>t?.getState().onScrollToBottom(()=>{n.getState().scrollToBottom()}),[t,n]),g.useEffect(()=>{if(t)return n.subscribe(r=>{t.getState().isAtBottom!==r.isAtBottom&&Xo(t).setState({isAtBottom:r.isAtBottom})})},[n,t]),n},od=({children:e,options:t={}})=>{const n=p1(t),[r]=g.useState(()=>({useThreadViewport:n}));return p.jsx(Fv.Provider,{value:r,children:e})},m1=()=>{const e=se();return g.useEffect(()=>{},[e]),null},g1=({children:e,aui:t,runtime:n})=>p.jsxs(K_,{runtime:n,aui:t??null,children:[p.jsx(m1,{}),p.jsx(od,{children:e})]}),ad=g.memo(g1),y1=e=>{const t=e;t.__isBound||(t.__internal_bindMethods?.(),t.__isBound=!0)};function v1(e,t=x1){y1(e);const n=g.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getState()));return g.useDebugValue(n),n}const x1=e=>e;function w1(e){function t(n){let r=!1,i;typeof n=="function"?i=n:n&&(r=!!n.optional,i=n.selector);const s=e({optional:r});return s?v1(s,i):null}return t}function S1(e){const t=se(),n=F(()=>t.composer.source?t.composer().__internal_getRuntime?.()??null:null);if(!n&&!e?.optional)throw new Error("ComposerRuntime is not available");return n}function b1(e){const t=se(),n=F(()=>t.message.source?t.message().__internal_getRuntime?.()??null:null);if(!n&&!e?.optional)throw new Error("MessageRuntime is not available");return n}const k1=w1(b1);function Ih(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _1(...e){return t=>{let n=!1;const r=e.map(i=>{const s=Ih(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():Ih(e[i],null)}}}}function xr(...e){return g.useCallback(_1(...e),e)}var Rh=Object.defineProperty,ks=(e,t)=>{let n={};for(var r in e)Rh(n,r,{get:e[r],enumerable:!0});return Rh(n,Symbol.toStringTag,{value:"Module"}),n};function Bv(e){const t=g.forwardRef((n,r)=>{let{children:i,...s}=n,o=null,a=!1;const l=[];Ph(i)&&typeof Xs=="function"&&(i=Xs(i._payload)),g.Children.forEach(i,f=>{if(R1(f)){a=!0;const h=f;let m="child"in h.props?h.props.child:h.props.children;Ph(m)&&typeof Xs=="function"&&(m=Xs(m._payload)),o=E1(h,m),l.push(o?.props?.children)}else l.push(f)}),o?o=g.cloneElement(o,void 0,l):!a&&g.Children.count(i)===1&&g.isValidElement(i)&&(o=i);const u=o?I1(o):void 0,d=xr(r,u);if(!o){if(i||i===0)throw new Error(a?N1(e):M1(e));return i}const c=T1(s,o.props??{});return o.type!==g.Fragment&&(c.ref=r?d:u),g.cloneElement(o,c)});return t.displayName=`${e}.Slot`,t}var Zo=Bv("Slot"),C1=Symbol.for("radix.slottable"),E1=(e,t)=>{if("child"in e.props){const n=e.props.child;return g.isValidElement(n)?g.cloneElement(n,void 0,e.props.children(n.props.children)):null}return g.isValidElement(t)?t:null};function T1(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function I1(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function R1(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===C1}var P1=Symbol.for("react.lazy");function Ph(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===P1&&"_payload"in e&&A1(e._payload)}function A1(e){return typeof e=="object"&&e!==null&&"then"in e}var M1=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,N1=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Xs=yS[" use ".trim().toString()],j1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D1=j1.reduce((e,t)=>{const n=Bv(`Primitive.${t}`),r=g.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});const O1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"];function L1(e){const t=g.forwardRef(({render:n,asChild:r,children:i,...s},o)=>{const a=e;if(n&&g.isValidElement(n)){const l=i!==void 0?i:n.props.children;return p.jsx(a,{...s,asChild:!0,ref:o,children:g.cloneElement(n,void 0,l)})}return p.jsx(a,{...s,asChild:r,ref:o,children:i})});return t.displayName=typeof e=="string"?e:e.displayName??e.name??"Component",t}function z1(e){const t=D1[e],n=L1(t);return n.displayName=`Primitive.${e}`,n}const Ie=O1.reduce((e,t)=>(e[t]=z1(t),e),{});function Ne(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}const Hn=(e,t,n=[])=>{const r=g.forwardRef((i,s)=>{const o={},a={};Object.keys(i).forEach(u=>{n.includes(u)?o[u]=i[u]:a[u]=i[u]});const l=t(o)??void 0;return p.jsx(Ie.button,{...a,type:"button",ref:s,disabled:a.disabled||!l,onClick:Ne(a.onClick,l)})});return r.displayName=e,r};function fr(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>t.current?.(...n),[])}function F1(e,t=globalThis?.document){const n=fr(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}const Uv=g.forwardRef((e,t)=>p.jsx(Ie.div,{...e,ref:t}));Uv.displayName="AttachmentPrimitive.Root";const $v=g.forwardRef((e,t)=>{const n=F(r=>{const i=r.attachment.name.split(".");return i.length>1?i.pop():""});return p.jsxs(Ie.div,{...e,ref:t,children:[".",n]})});$v.displayName="AttachmentPrimitive.unstable_Thumb";const Vv=()=>p.jsx(p.Fragment,{children:F(e=>e.attachment.name)});Vv.displayName="AttachmentPrimitive.Name";const B1=()=>{const e=se();return g.useCallback(()=>{e.attachment().remove()},[e])},U1=Hn("AttachmentPrimitive.Remove",B1);var Ah=ks({Name:()=>Vv,Remove:()=>U1,Root:()=>Uv,unstable_Thumb:()=>$v});const $1=e=>F(t=>{const{role:n,attachments:r,parts:i,branchCount:s,isLast:o,speech:a,isCopied:l,isHovering:u}=t.message;return!(e.hasBranches===!0&&s<2||e.user&&n!=="user"||e.assistant&&n!=="assistant"||e.system&&n!=="system"||e.lastOrHover===!0&&!u&&!o||e.last!==void 0&&e.last!==o||e.copied===!0&&!l||e.copied===!1&&l||e.speaking===!0&&a==null||e.speaking===!1&&a!=null||e.hasAttachments===!0&&(n!=="user"||!r?.length)||e.hasAttachments===!1&&n==="user"&&r?.length||e.hasContent===!0&&i.length===0||e.hasContent===!1&&i.length>0||e.submittedFeedback!==void 0&&(t.message.metadata.submittedFeedback?.type??null)!==e.submittedFeedback)}),Hv=({children:e,...t})=>$1(t)?e:null;Hv.displayName="MessagePrimitive.If";const Wv=g.createContext(null),Ra=()=>g.useContext(Wv),V1=({children:e})=>{const t=g.useRef(new Map),n=g.useRef([]),r=g.useCallback(()=>{const a=Array.from(t.current.entries());a.sort((l,u)=>u[1]-l[1]),n.current=a.map(([l])=>l)},[]),i=g.useCallback((a,l)=>{const u=l?.priority??0;return t.current.set(a,u),r(),()=>{t.current.delete(a),r()}},[r]),s=g.useCallback(()=>n.current,[]),o=g.useMemo(()=>({register:i,getPlugins:s}),[i,s]);return p.jsx(Wv.Provider,{value:o,children:e})},ld=g.createContext(null),qv=g.createContext(null),ud=()=>{const e=g.useContext(ld);if(!e)throw new Error("useTriggerPopoverRootContext must be used within ComposerPrimitive.TriggerPopoverRoot");return e},cd=()=>g.useContext(ld),H1=()=>{const e=g.useContext(qv);if(!e)throw new Error("useTriggerPopoverAriaPublish must be used within ComposerPrimitive.TriggerPopoverRoot");return e},W1=()=>{const e=ud();return g.useSyncExternalStore(e.subscribe,e.getTriggers,e.getTriggers)},q1=new Map,Kv=()=>()=>{},Mh=()=>q1,K1=()=>{const e=cd();return g.useSyncExternalStore(e?e.subscribe:Kv,e?e.getTriggers:Mh,e?e.getTriggers:Mh)},Nh=()=>null,Q1=()=>{const e=cd();return g.useSyncExternalStore(e?e.subscribeAria:Kv,e?e.getActiveAria:Nh,e?e.getActiveAria:Nh)};function jh(){const e=g.useRef(new Set);return{notify:g.useCallback(()=>{for(const t of e.current)t()},[]),subscribe:g.useCallback(t=>(e.current.add(t),()=>{e.current.delete(t)}),[])}}const Dh=({children:e})=>{const t=g.useRef(new Map),n=g.useRef(new Set),{notify:r,subscribe:i}=jh(),s=g.useCallback(E=>{const{char:y}=E;if(t.current.has(y))return()=>{};const v=new Map(t.current);v.set(y,E),t.current=v,r();for(const w of n.current)w.added(E);return()=>{const w=new Map(t.current);w.delete(y),t.current=w,r();for(const C of n.current)C.removed(y)}},[r]),o=g.useCallback(()=>t.current,[]),a=g.useCallback(E=>(n.current.add(E),()=>{n.current.delete(E)}),[]),l=g.useRef(null),u=g.useRef(null),{notify:d,subscribe:c}=jh(),f=g.useCallback((E,y)=>{if(y===null){if(u.current!==E)return;l.current=null,u.current=null,d();return}const v=l.current;u.current===E&&v!==null&&v.popoverId===y.popoverId&&v.highlightedItemId===y.highlightedItemId||(l.current=y,u.current=E,d())},[d]),h=g.useCallback(()=>l.current,[]),m=g.useMemo(()=>({register:s,getTriggers:o,subscribe:i,subscribeLifecycle:a,getActiveAria:h,subscribeAria:c}),[s,o,i,a,h,c]),x=g.useMemo(()=>({setActiveAria:f}),[f]);return p.jsx(ld.Provider,{value:m,children:p.jsx(qv.Provider,{value:x,children:e})})},Qv=({children:e})=>Ra()?p.jsx(Dh,{children:e}):p.jsx(V1,{children:p.jsx(Dh,{children:e})});Qv.displayName="ComposerPrimitive.TriggerPopoverRoot";const Oh=/\s/u;function G1(e,t,n){const r=e.slice(0,n);for(let i=r.length-1;i>=0;i--){const s=r[i];if(Oh.test(s))return null;if(r.startsWith(t,i)){if(i>0&&!Oh.test(r[i-1]))continue;return{query:r.slice(i+t.length),offset:i}}}return null}const Y1=re(({text:e,triggerChar:t})=>{const[n,r]=yt(e.length),i=X(()=>G1(e,t,Math.min(n,e.length)),[n,e,t]);return{trigger:i,query:i?.query??"",setCursorPosition:r}});function J1(e){return"type"in e}const X1=re(({navigableList:e,isSearchMode:t,activeCategoryId:n,query:r,popoverId:i,open:s,selectItem:o,selectCategory:a,goBack:l,close:u})=>{const[d,c]=yt(0);Ce(()=>{c(0)},[e]),Ce(()=>{c(0)},[t,n]);const f=Xt(x=>{x<0||x>=e.length||x!==d&&c(x)}),h=Xt(x=>{if(!s)return!1;switch(x.key){case"ArrowDown":return x.preventDefault(),c(E=>{const y=e.length;return y===0?0:E<y-1?E+1:0}),!0;case"ArrowUp":return x.preventDefault(),c(E=>{const y=e.length;return y===0?0:E>0?E-1:y-1}),!0;case"Enter":case"Tab":{if(x.shiftKey)return!1;x.preventDefault();const E=e[d];return E&&(J1(E)?o(E):a(E.id)),!0}case"Escape":return x.preventDefault(),u(),!0;case"Backspace":return n&&r===""?(x.preventDefault(),l(),!0):!1;default:return!1}}),m=e[d];return{highlightedIndex:d,highlightedItemId:s&&m?`${i}-option-${m.id}`:void 0,highlightIndex:f,handleKeyDown:h}});function Lh(e,t){return e.id.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)||(e.description?.toLowerCase().includes(t)??!1)}const Z1=re(({adapter:e,query:t,open:n})=>{const[r,i]=yt(null);Ce(()=>{n||i(null)},[n]);const s=X(()=>!n||!e?[]:e.categories(),[n,e]),o=n?r:null,a=X(()=>!o||!e?[]:e.categoryItems(o),[o,e]),l=X(()=>{if(!n||!e||o||!t&&s.length>0)return null;if(e.search)return e.search(t);const f=[],h=t.toLowerCase();for(const m of s)for(const x of e.categoryItems(m.id))Lh(x,h)&&f.push(x);return f},[n,e,t,o,s]),u=l!==null,d=X(()=>{if(u)return[];if(!t)return s;const f=t.toLowerCase();return s.filter(h=>h.label.toLowerCase().includes(f))},[s,t,u]),c=X(()=>{if(u)return l??[];if(!t)return a;const f=t.toLowerCase();return a.filter(h=>Lh(h,f))},[a,t,u,l]);return{categories:d,items:c,isSearchMode:u,activeCategoryId:o,navigableList:X(()=>u?l??[]:o?c:d,[u,l,o,c,d]),selectCategory:Xt(f=>{i(f)}),goBack:Xt(()=>{i(null)})}}),eE=re(({behavior:e,trigger:t,aui:n,triggerChar:r,setCursorPosition:i,onSelected:s})=>{const o=Jt(null),a=Xt(l=>(o.current=l,()=>{o.current===l&&(o.current=null)}));return{selectItem:Xt(l=>{if(!t||!e)return;if(o.current?.(l)){s();return}const u=n.composer().getState().text,d=u.slice(0,t.offset),c=u.slice(t.offset+r.length+t.query.length),f=()=>{const h=e.formatter.serialize(l);n.composer().setText(d+h+(c.startsWith(" ")?c:` ${c}`))};e.kind==="directive"?(f(),e.onInserted?.(l)):(e.removeOnExecute?n.composer().setText(d+(c.startsWith(" ")?c.slice(1):c)):f(),e.onExecute(l)),s()}),close:Xt(()=>{s(),t&&i(t.offset)}),registerSelectItemOverride:a}}),tE=re(({adapter:e,text:t,triggerChar:n,behavior:r,aui:i,popoverId:s})=>{const o=Oe(Y1({text:t,triggerChar:n})),a=o.trigger!==null&&e!==void 0&&r!==void 0,l=Oe(Z1({adapter:e,query:o.query,open:a})),u=Xt(()=>{l.goBack()}),d=Oe(eE({behavior:r,trigger:o.trigger,aui:i,triggerChar:n,setCursorPosition:o.setCursorPosition,onSelected:u})),c=Oe(X1({navigableList:l.navigableList,isSearchMode:l.isSearchMode,activeCategoryId:l.activeCategoryId,query:o.query,popoverId:s,open:a,selectItem:d.selectItem,selectCategory:l.selectCategory,goBack:l.goBack,close:d.close}));return{open:a,query:o.query,activeCategoryId:l.activeCategoryId,categories:l.categories,items:l.items,highlightedIndex:c.highlightedIndex,isSearchMode:l.isSearchMode,popoverId:s,highlightedItemId:c.highlightedItemId,selectCategory:l.selectCategory,goBack:l.goBack,selectItem:d.selectItem,close:d.close,highlightIndex:c.highlightIndex,handleKeyDown:c.handleKeyDown,setCursorPosition:o.setCursorPosition,registerSelectItemOverride:d.registerSelectItemOverride}}),dd=g.createContext(null),di=()=>{const e=g.useContext(dd);if(!e)throw new Error("useTriggerPopoverScopeContext must be used within ComposerPrimitive.TriggerPopover");return e},nE=()=>g.useContext(dd),Gv=g.createContext(null),Yv=()=>{const e=g.useContext(Gv);if(!e)throw new Error("TriggerPopover.Directive / TriggerPopover.Action must be rendered inside ComposerPrimitive.TriggerPopover");return e},Jv=g.forwardRef(({char:e,adapter:t,"aria-label":n,children:r,...i},s)=>{const o=se(),a=F(I=>I.composer.text),l=g.useId(),u=g.useRef(null),[d,c]=g.useState(null),f=g.useRef(0),h=g.useCallback(I=>(f.current+=1,u.current=I,c(I),()=>{f.current=Math.max(0,f.current-1),u.current===I&&(u.current=null,c(null))}),[e]),m=g.useMemo(()=>({register:h}),[h]),x=My(tE({adapter:t,text:a,triggerChar:e,behavior:d??void 0,aui:o,popoverId:l})),E=g.useRef(x);E.current=x;const y=ud();g.useEffect(()=>y.register({char:e,...d?{behavior:d}:{},resource:E.current}),[y,e,d]);const v=Ra();g.useEffect(()=>{if(v)return v.register(E.current)},[v]);const w=d!==null&&x.open,C=H1();return g.useEffect(()=>{if(w)return()=>{C.setActiveAria(e,null)}},[C,e,w]),g.useEffect(()=>{w&&C.setActiveAria(e,{popoverId:l,highlightedItemId:x.highlightedItemId})},[C,e,l,w,x.highlightedItemId]),p.jsx(Gv.Provider,{value:m,children:p.jsx(dd.Provider,{value:x,children:w?p.jsx(Ie.div,{role:"listbox",id:l,"aria-label":n??"Suggestions","aria-activedescendant":x.highlightedItemId,"data-state":"open",...i,ref:s,children:r}):r})})});Jv.displayName="ComposerPrimitive.TriggerPopover";const Xv=()=>{const{disabled:e,send:t}=i1(),n=g.useCallback(()=>t(),[t]);return e?null:n},rE=Hn("ComposerPrimitive.Send",Xv),Zv=g.forwardRef(({onSubmit:e,...t},n)=>{const r=Xv(),i=s=>{s.preventDefault(),r&&r()};return p.jsx(Ie.form,{...t,ref:n,onSubmit:Ne(e,i)})});Zv.displayName="ComposerPrimitive.Root";const ex=e=>{const t=fr(e),n=yr(r=>r.onScrollToBottom);g.useEffect(()=>n(t),[n,t])},iE=()=>!1,sE=()=>{},oE=e=>g.useSyncExternalStore(g.useCallback(t=>{if(typeof window>"u"||e===null)return sE;const n=window.matchMedia(e);return n.addEventListener("change",t),()=>n.removeEventListener("change",t)},[e]),g.useCallback(()=>typeof window>"u"||e===null?!1:window.matchMedia(e).matches,[e]),iE);function Ou(){return Ou=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ou.apply(null,arguments)}function aE(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var lE=g.useLayoutEffect,uE=function(t){var n=rt.useRef(t);return lE(function(){n.current=t}),n},zh=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},cE=function(t,n){var r=rt.useRef();return rt.useCallback(function(i){t.current=i,r.current&&zh(r.current,null),r.current=n,n&&zh(n,i)},[n])},Fh={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},dE=function(t){Object.keys(Fh).forEach(function(n){t.style.setProperty(n,Fh[n],"important")})},Bh=dE,qe=null,Uh=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function fE(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),qe||(qe=document.createElement("textarea"),qe.setAttribute("tabindex","-1"),qe.setAttribute("aria-hidden","true"),Bh(qe)),qe.parentNode===null&&document.body.appendChild(qe);var i=e.paddingSize,s=e.borderSize,o=e.sizingStyle,a=o.boxSizing;Object.keys(o).forEach(function(f){var h=f;qe.style[h]=o[h]}),Bh(qe),qe.value=t;var l=Uh(qe,e);qe.value=t,l=Uh(qe,e),qe.value="x";var u=qe.scrollHeight-i,d=u*n;a==="border-box"&&(d=d+i+s),l=Math.max(d,l);var c=u*r;return a==="border-box"&&(c=c+i+s),l=Math.min(c,l),[l,u]}var $h=function(){},hE=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},pE=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],mE=!!document.documentElement.currentStyle,gE=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=hE(pE,n),i=r.boxSizing;if(i==="")return null;mE&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),o=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:o}},yE=gE;function fd(e,t,n){var r=uE(n);g.useLayoutEffect(function(){var i=function(o){return r.current(o)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var vE=function(t,n){fd(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},xE=function(t){fd(window,"resize",t)},wE=function(t){fd(document.fonts,"loadingdone",t)},SE=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],bE=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,s=t.minRows,o=t.onChange,a=o===void 0?$h:o,l=t.onHeightChange,u=l===void 0?$h:l,d=aE(t,SE),c=d.value!==void 0,f=g.useRef(null),h=cE(f,n),m=g.useRef(0),x=g.useRef(),E=function(){var w=f.current,C=r&&x.current?x.current:yE(w);if(C){x.current=C;var I=fE(C,w.value||w.placeholder||"x",s,i),k=I[0],M=I[1];m.current!==k&&(m.current=k,w.style.setProperty("height",k+"px","important"),u(k,{rowHeight:M}))}},y=function(w){c||E(),a(w)};return g.useLayoutEffect(E),vE(f,function(){if(!c){var v=f.current.value;requestAnimationFrame(function(){var w=f.current;w&&v!==w.value&&E()})}}),xE(E),wE(E),g.createElement("textarea",Ou({},d,{onChange:y,ref:h}))},kE=g.forwardRef(bE);const _E="(pointer: coarse) and (not (any-pointer: fine))",tx=g.forwardRef(({autoFocus:e=!1,asChild:t,render:n,disabled:r,onChange:i,onKeyDown:s,onPaste:o,onSelect:a,submitOnEnter:l,submitMode:u,cancelOnEscape:d=!0,unstable_focusOnRunStart:c=!0,unstable_focusOnScrollToBottom:f=!0,unstable_focusOnThreadSwitched:h=!0,unstable_insertNewlineOnTouchEnter:m=!1,addAttachmentOnPaste:x=!0,...E},y)=>{const v=se(),w=Ra(),C=Q1(),I=u??(l===!1?"none":"enter"),k=oE(m?_E:null),M=m&&k&&I==="enter"?"none":I,D=F(A=>A.composer.isEditing?A.composer.text:""),$=F(A=>A.thread.isDisabled||A.composer.dictation?.inputDisabled)||r,T=g.useRef(null),L=xr(y,T),z=g.useRef(!1);F1(A=>{if(!T.current?.contains(A.target))return;if(w){for(const V of w.getPlugins())if(V.handleKeyDown(A))return}if(!d)return;const S=v.composer();S.getState().canCancel&&(S.cancel(),A.preventDefault())});const Q=A=>{if(!$&&!A.nativeEvent.isComposing){if(w){for(const S of w.getPlugins())if(S.handleKeyDown(A))return}if(A.key==="Enter"){const S=v.thread().getState(),V=S.capabilities.queue;if(A.shiftKey&&(A.ctrlKey||A.metaKey)&&V&&I!=="none"&&v.composer().getState().canSend){A.preventDefault(),v.composer().send({steer:!0});return}if(A.shiftKey||S.isRunning&&!V)return;let q=!1;M==="ctrlEnter"?q=A.ctrlKey||A.metaKey:M==="enter"&&(q=!0),q&&(A.preventDefault(),T.current?.closest("form")?.requestSubmit())}}},ae=async A=>{if(!x)return;const S=v.thread().getState().capabilities,V=Array.from(A.clipboardData?.files||[]);if(S.attachments&&V.length>0)try{A.preventDefault(),await Promise.all(V.map(q=>v.composer().addAttachment(q)))}catch(q){console.error("Error adding attachment:",q)}},Y=e&&!$,W=g.useCallback(()=>{const A=T.current;!A||!Y||(A.focus({preventScroll:!0}),A.setSelectionRange(A.value.length,A.value.length))},[Y]);g.useEffect(()=>W(),[W]),ex(()=>{v.composer().getState().type==="thread"&&f&&W()}),g.useEffect(()=>{if(!(v.composer().getState().type!=="thread"||!c))return v.on("thread.runStart",W)},[c,W,v]),g.useEffect(()=>{if(!(v.composer().getState().type!=="thread"||!h))return v.on("threadListItem.switchedTo",W)},[h,W,v]);const Z=C?{"aria-controls":C.popoverId,"aria-expanded":!0,"aria-haspopup":"listbox","aria-activedescendant":C.highlightedItemId}:{},P={name:"input",value:D,...E,...Z,ref:L,disabled:$,onChange:Ne(i,A=>{if(!v.composer().getState().isEditing)return;const S=A.nativeEvent.isComposing===!0;z.current&&!S&&(z.current=!1);const V=S||z.current;if(Yf(()=>{v.composer().setText(A.target.value)}),V)return;const q=A.target.selectionStart??A.target.value.length;if(w)for(const b of w.getPlugins())b.setCursorPosition(q)}),onKeyDown:Ne(s,Q),onCompositionStart:Ne(E.onCompositionStart,()=>{z.current=!0}),onCompositionEnd:Ne(E.onCompositionEnd,A=>{if(z.current=!1,!v.composer().getState().isEditing)return;const S=A.target;Yf(()=>{v.composer().setText(S.value)});const V=S.selectionStart??S.value.length;if(w)for(const q of w.getPlugins())q.setCursorPosition(V)}),onSelect:Ne(a,A=>{if(z.current)return;const S=A.target,V=S.selectionStart??S.value.length;if(w)for(const q of w.getPlugins())q.setCursorPosition(V)}),onPaste:Ne(o,ae)};if(n&&g.isValidElement(n)){const A=E.children!==void 0?E.children:n.props.children;return p.jsx(Zo,{...P,children:g.cloneElement(n,void 0,A)})}return p.jsx(t?Zo:kE,{...P})});tx.displayName="ComposerPrimitive.Input";const CE=()=>{const{disabled:e,cancel:t}=s1();return e?null:t},EE=Hn("ComposerPrimitive.Cancel",CE),TE=({multiple:e=!0}={})=>{const{disabled:t,addAttachment:n}=a1(),r=se(),i=g.useCallback(()=>{const s=document.createElement("input");s.type="file",s.multiple=e,s.hidden=!0;const o=r.composer().getState().attachmentAccept;o!=="*"&&(s.accept=o),document.body.appendChild(s),s.onchange=a=>{const l=a.target.files;if(l){for(const u of l)n(u);document.body.removeChild(s)}},s.oncancel=()=>{(!s.files||s.files.length===0)&&document.body.removeChild(s)},s.click()},[r,e,n]);return t?null:i},IE=Hn("ComposerPrimitive.AddAttachment",TE,["multiple"]),nx=g.forwardRef(({disabled:e,asChild:t=!1,render:n,children:r,...i},s)=>{const[o,a]=g.useState(!1),l=se(),u=g.useCallback(m=>{e||(m.preventDefault(),a(!0))},[e]),d=g.useCallback(m=>{e||(m.preventDefault(),o||a(!0))},[e,o]),c=g.useCallback(m=>{if(e)return;m.preventDefault();const x=m.relatedTarget;x&&m.currentTarget.contains(x)||a(!1)},[e]),f=g.useCallback(async m=>{if(e)return;m.preventDefault(),a(!1);const x=Array.from(m.dataTransfer.files);await Promise.all(x.map(async E=>{try{await l.composer().addAttachment(E)}catch(y){console.error("Failed to add attachment:",y)}}))},[e,l]),h={...o?{"data-dragging":"true"}:null,...i,onDragEnterCapture:Ne(i.onDragEnterCapture,u),onDragOverCapture:Ne(i.onDragOverCapture,d),onDragLeaveCapture:Ne(i.onDragLeaveCapture,c),onDropCapture:Ne(i.onDropCapture,f),ref:s};if(n&&g.isValidElement(n)){const m=r!==void 0?r:n.props.children;return p.jsx(Zo,{...h,children:g.cloneElement(n,void 0,m)})}return p.jsx(t?Zo:"div",{...h,children:r})});nx.displayName="ComposerPrimitive.AttachmentDropzone";const RE=()=>{const{disabled:e,startDictation:t}=o1();return e?null:t},PE=Hn("ComposerPrimitive.Dictate",RE),AE=()=>{const e=se(),t=F(r=>r.composer.dictation!=null),n=g.useCallback(()=>{e.composer().stopDictation()},[e]);return t?n:null},ME=Hn("ComposerPrimitive.StopDictation",AE),rx=g.forwardRef(({children:e,...t},n)=>{const r=F(i=>i.composer.dictation?.transcript);return r?p.jsx(Ie.span,{...t,ref:n,children:e??r}):null});rx.displayName="ComposerPrimitive.DictationTranscript";const ix=g.forwardRef((e,t)=>F(n=>n.composer.quote)?p.jsx(Ie.div,{...e,ref:t}):null);ix.displayName="ComposerPrimitive.Quote";const sx=g.forwardRef(({children:e,...t},n)=>{const r=F(i=>i.composer.quote?.text);return r?p.jsx(Ie.span,{...t,ref:n,children:e??r}):null});sx.displayName="ComposerPrimitive.QuoteText";const ox=g.forwardRef(({onClick:e,...t},n)=>{const r=se(),i=g.useCallback(()=>{r.composer().setQuote(void 0)},[r]);return p.jsx(Ie.button,{type:"button",...t,ref:n,onClick:Ne(e,i)})});ox.displayName="ComposerPrimitive.QuoteDismiss";const ax=g.forwardRef(({children:e,"aria-label":t,...n},r)=>{const{categories:i,activeCategoryId:s,isSearchMode:o,open:a}=di();return!a||s||o?null:p.jsx(Ie.div,{role:"group","aria-label":t??"Categories",...n,ref:r,children:e(i)})});ax.displayName="ComposerPrimitive.TriggerPopoverCategories";const lx=g.forwardRef(({categoryId:e,onClick:t,onMouseMove:n,...r},i)=>{const{selectCategory:s,highlightIndex:o,categories:a,highlightedIndex:l,activeCategoryId:u,isSearchMode:d,popoverId:c}=di(),f=g.useCallback(()=>{s(e)},[s,e]),h=a.findIndex(E=>E.id===e),m=!u&&!d&&h===l,x=g.useCallback(()=>{o(h)},[o,h]);return p.jsx(Ie.button,{type:"button",role:"option",id:`${c}-option-${e}`,"aria-selected":m,"data-highlighted":m?"":void 0,...r,ref:i,onClick:Ne(t,f),onMouseMove:Ne(n,x)})});lx.displayName="ComposerPrimitive.TriggerPopoverCategoryItem";const ux=g.forwardRef(({children:e,"aria-label":t,...n},r)=>{const{items:i,activeCategoryId:s,isSearchMode:o,open:a}=di();return!a||!s&&!o?null:p.jsx(Ie.div,{role:"group","aria-label":t??"Items",...n,ref:r,children:e(i)})});ux.displayName="ComposerPrimitive.TriggerPopoverItems";const cx=g.forwardRef(({item:e,index:t,onClick:n,onMouseMove:r,...i},s)=>{const{selectItem:o,highlightIndex:a,items:l,highlightedIndex:u,activeCategoryId:d,isSearchMode:c,popoverId:f}=di(),h=g.useCallback(()=>{o(e)},[o,e]),m=t??l.findIndex(y=>y.id===e.id),x=(c||d!==null)&&m===u,E=g.useCallback(()=>{a(m)},[a,m]);return p.jsx(Ie.button,{type:"button",role:"option",id:`${f}-option-${e.id}`,"aria-selected":x,"data-highlighted":x?"":void 0,...i,ref:s,onClick:Ne(n,h),onMouseMove:Ne(r,E)})});cx.displayName="ComposerPrimitive.TriggerPopoverItem";const dx=g.forwardRef(({onClick:e,...t},n)=>{const{activeCategoryId:r,isSearchMode:i,goBack:s,open:o}=di();return!o||!r||i?null:p.jsx(Ie.button,{type:"button",...t,ref:n,onClick:Ne(e,s)})});dx.displayName="ComposerPrimitive.TriggerPopoverBack";const fx=({formatter:e,onExecute:t,removeOnExecute:n})=>{const{register:r}=Yv(),i=g.useRef(t);return i.current=t,g.useEffect(()=>r({kind:"action",formatter:e??Lv,onExecute:s=>i.current(s),...n!==void 0?{removeOnExecute:n}:{}}),[r,e,n]),null};fx.displayName="ComposerPrimitive.TriggerPopoverAction";const hx=({formatter:e,onInserted:t})=>{const{register:n}=Yv(),r=g.useRef(t);return r.current=t,g.useEffect(()=>n({kind:"directive",formatter:e??Lv,onInserted:i=>r.current?.(i)}),[n,e]),null};hx.displayName="ComposerPrimitive.TriggerPopoverDirective";const NE=Object.assign(Jv,{Directive:hx,Action:fx});var _i=ks({AddAttachment:()=>IE,AttachmentByIndex:()=>Pv,AttachmentDropzone:()=>nx,Attachments:()=>Av,Cancel:()=>EE,Dictate:()=>PE,DictationTranscript:()=>rx,If:()=>Ov,Input:()=>tx,Queue:()=>Mv,Quote:()=>ix,QuoteDismiss:()=>ox,QuoteText:()=>sx,Root:()=>Zv,Send:()=>rE,StopDictation:()=>ME,Unstable_TriggerPopover:()=>NE,Unstable_TriggerPopoverBack:()=>dx,Unstable_TriggerPopoverCategories:()=>ax,Unstable_TriggerPopoverCategoryItem:()=>lx,Unstable_TriggerPopoverItem:()=>cx,Unstable_TriggerPopoverItems:()=>ux,Unstable_TriggerPopoverRoot:()=>Qv,unstable_useTriggerPopoverRootContext:()=>ud,unstable_useTriggerPopoverRootContextOptional:()=>cd,unstable_useTriggerPopoverScopeContext:()=>di,unstable_useTriggerPopoverScopeContextOptional:()=>nE,unstable_useTriggerPopoverTriggers:()=>W1,unstable_useTriggerPopoverTriggersOptional:()=>K1});const px=()=>F(e=>{if(e.part.type!=="text"&&e.part.type!=="reasoning")throw new Error("MessagePartText can only be used inside text or reasoning message parts.");return e.part}),jE=()=>F(e=>{if(e.part.type!=="image")throw new Error("MessagePartImage can only be used inside image message parts.");return e.part}),mx=g.createContext(null),DE=e=>({useSmoothStatus:zy(()=>e)}),OE=({children:e})=>{const t=gx({optional:!0}),n=se(),[r]=g.useState(()=>DE(n.part().getState().status));return t?e:p.jsx(mx.Provider,{value:r,children:e})},LE=e=>{const t=g.forwardRef((n,r)=>p.jsx(OE,{children:p.jsx(e,{...n,ref:r})}));return t.displayName=e.displayName,t};function gx(e){const t=g.useContext(mx);if(!e?.optional&&!t)throw new Error("This component must be used within a SmoothContextProvider.");return t}const{useSmoothStatus:zE,useSmoothStatusStore:FE}=zv(gx,"useSmoothStatus");var BE=class{constructor(e,t){_(this,"currentText");_(this,"setText");_(this,"animationFrameId",null);_(this,"lastUpdateTime",Date.now());_(this,"targetText","");_(this,"animate",()=>{const e=Date.now();let t=e-this.lastUpdateTime;const n=this.targetText.length-this.currentText.length,r=Math.min(5,250/n);let i=0;for(;t>=r&&i<n;)i++,t-=r;i!==n?this.animationFrameId=requestAnimationFrame(this.animate):this.animationFrameId=null,i!==0&&(this.currentText=this.targetText.slice(0,this.currentText.length+i),this.lastUpdateTime=e-t,this.setText(this.currentText))});this.currentText=e,this.setText=t}start(){this.animationFrameId===null&&(this.lastUpdateTime=Date.now(),this.animate())}stop(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}};const ml=Object.freeze({type:"running"}),yx=(e,t=!1)=>{const{text:n}=e,[r,i]=g.useState(e.status.type==="running"?"":n),s=se(),o=F(()=>s.part()),[a,l]=g.useState(o);(o!==a||!n.startsWith(r))&&(l(o),i(e.status.type==="running"?"":n));const u=FE({optional:!0}),d=fr(h=>{if(i(h),u){const m=r!==h||e.status.type==="running"?ml:e.status;Xo(u).setState(m,!0)}});g.useEffect(()=>{if(u){const h=t&&(r!==n||e.status.type==="running")?ml:e.status;Xo(u).setState(h,!0)}},[u,t,n,r,e.status]);const[c]=g.useState(new BE(r,d)),f=g.useRef(o);return g.useEffect(()=>{if(!t){c.stop();return}const h=f.current!==o;if(f.current=o,h||!n.startsWith(c.targetText)){e.status.type==="running"?(c.currentText="",c.targetText=n,c.start()):(c.currentText=n,c.targetText=n,c.stop());return}c.targetText=n,c.start()},[c,t,n,e.status.type,o]),g.useEffect(()=>()=>{c.stop()},[c]),g.useMemo(()=>t?{type:"text",text:r,status:n===r?e.status:ml}:e,[t,r,e,n])},hd=g.forwardRef(({smooth:e=!0,component:t="span",...n},r)=>{const{text:i,status:s}=yx(px(),e);return p.jsx(t,{"data-status":s.type,...n,ref:r,children:i})});hd.displayName="MessagePartPrimitive.Text";const pd=g.forwardRef((e,t)=>{const{image:n}=jE();return p.jsx(Ie.img,{src:n,...e,ref:t})});pd.displayName="MessagePartPrimitive.Image";const wr=e=>{const t=g.useRef(void 0);return g.useCallback(n=>{t.current&&(t.current(),t.current=void 0),n&&(t.current=e(n))},[e])},Vh=(e,t)=>{const n=e.trim().match(/^(\d+(?:\.\d+)?|\.\d+)(em|px|rem)$/);if(!n)return Number.POSITIVE_INFINITY;const r=Number(n[1]),i=n[2];return i==="px"?r:i==="em"?r*(parseFloat(getComputedStyle(t).fontSize)||16):i==="rem"?r*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):Number.POSITIVE_INFINITY},UE=e=>e.dataset.messageId,$E=()=>{const e=document.createElement("div");return e.dataset.auiTopAnchorReserve="",e.style.height="0px",e.style.flexShrink="0",e.style.pointerEvents="none",e.setAttribute("aria-hidden","true"),e},Hh=(e,t)=>{const n=`${t}px`;return e.style.height!==n?(e.style.height=n,!0):!1},VE=e=>{const t=window.devicePixelRatio||1;return Math.round(e*t)/t},vx=()=>{const e=se(),t=F(()=>e.message());return wr(g.useCallback(n=>{const r=()=>{t.setIsHovering(!0)},i=()=>{t.setIsHovering(!1)};return n.addEventListener("mouseenter",r),n.addEventListener("mouseleave",i),n.matches(":hover")&&queueMicrotask(()=>t.setIsHovering(!0)),()=>{n.removeEventListener("mouseenter",r),n.removeEventListener("mouseleave",i),t.setIsHovering(!1)}},[t]))},HE=()=>{const e=yr(t=>t.topAnchorTurn?.anchorId);return F(t=>t.message.role==="user"&&t.message.index>0&&t.message.index===t.thread.messages.length-2&&t.thread.messages.at(-1)?.role==="assistant"&&(t.message.id===e||t.thread.isRunning))},WE=()=>{const e=yr(t=>t.topAnchorTurn?.targetId);return F(t=>t.message.isLast&&t.message.role==="assistant"&&t.message.index>=1&&t.thread.messages.at(t.message.index-1)?.role==="user"&&(t.message.id===e||t.thread.isRunning))},qE=(e,t)=>wr(g.useCallback(n=>{if(e)return t.getState().registerAnchorElement(n)},[e,t])),KE=({active:e,threadViewportStore:t})=>wr(g.useCallback(n=>{if(!e)return;const r=t.getState(),i=r.topAnchorMessageClamp;return r.registerAnchorTargetElement(n,{tallerThan:Vh(i.tallerThan,n),visibleHeight:Vh(i.visibleHeight,n)})},[e,t])),QE=({forwardedRef:e,...t})=>{const n=xr(e,vx()),r=F(i=>i.message.id);return p.jsx(Ie.div,{...t,ref:n,"data-message-id":r})},GE=({forwardedRef:e,threadViewportStore:t,...n})=>{const r=vx(),i=HE(),s=WE(),o=xr(e,r,qE(i,t),KE({active:s,threadViewportStore:t})),a=F(l=>l.message.id);return p.jsx(Ie.div,{...n,ref:o,"data-message-id":a,"data-aui-top-anchor-user":i?"":void 0,"data-aui-top-anchor-target":s?"":void 0})},xx=g.forwardRef((e,t)=>{const n=vr();return n.getState().turnAnchor==="top"?p.jsx(GE,{...e,forwardedRef:t,threadViewportStore:n}):p.jsx(QE,{...e,forwardedRef:t})});xx.displayName="MessagePrimitive.Root";const gl={...$e,Text:()=>p.jsxs("p",{style:{whiteSpace:"pre-line"},children:[p.jsx(hd,{}),p.jsx(sd,{children:p.jsx("span",{style:{fontFamily:"revert"},children:" ●"})})]}),Image:()=>p.jsx(pd,{})},Lu=e=>{if("children"in e)return p.jsx(Du,{children:e.children});const{components:t,...n}=e;return p.jsx(Du,{components:t?{Text:t.Text??gl.Text,Image:t.Image??gl.Image,Reasoning:t.Reasoning??$e.Reasoning,Source:t.Source??$e.Source,File:t.File??$e.File,Unstable_Audio:t.Unstable_Audio??$e.Unstable_Audio,..."ChainOfThought"in t?{ChainOfThought:t.ChainOfThought}:{tools:t.tools,data:t.data,ToolGroup:t.ToolGroup??$e.ToolGroup,ReasoningGroup:t.ReasoningGroup??$e.ReasoningGroup},Empty:t.Empty,Quote:t.Quote,generativeUI:t.generativeUI}:gl,...n})};Lu.displayName="MessagePrimitive.Parts";const wx=({children:e})=>u1()!==void 0?e:null;wx.displayName="MessagePrimitive.Error";const YE=e=>{const t=new Map;for(let r=0;r<e.length;r++){const i=e[r]?.parentId??`__ungrouped_${r}`,s=t.get(i)??[];s.push(r),t.set(i,s)}const n=[];for(const[r,i]of t){const s=r.startsWith("__ungrouped_")?void 0:r;n.push({groupKey:s,indices:i})}return n},JE=e=>{const t=F(n=>n.message.parts);return g.useMemo(()=>t.length===0?[]:e(t),[t,e])},XE=({Fallback:e,...t})=>{const n=F(r=>{const i=r.tools.tools[t.toolName]??e;return Array.isArray(i)?i[0]??e:i});return n?p.jsx(n,{...t}):null},ZE=({Fallback:e,...t})=>{const n=F(r=>{const i=r.dataRenderers.renderers[t.name]??e;return Array.isArray(i)?i[0]??e:i});return n?p.jsx(n,{...t}):null},kn={Text:()=>p.jsxs("p",{style:{whiteSpace:"pre-line"},children:[p.jsx(hd,{}),p.jsx(sd,{children:p.jsx("span",{style:{fontFamily:"revert"},children:" ●"})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>p.jsx(pd,{}),File:()=>null,Unstable_Audio:()=>null,Group:({children:e})=>e},eT=({components:{Text:e=kn.Text,Reasoning:t=kn.Reasoning,Image:n=kn.Image,Source:r=kn.Source,File:i=kn.File,Unstable_Audio:s=kn.Unstable_Audio,tools:o={},data:a}={}})=>{const l=se(),u=F(c=>c.part),d=u.type;if(d==="tool-call"){const c=l.part().addToolResult,f=l.part().resumeToolCall,h=l.part().respondToToolApproval;if("Override"in o)return p.jsx(o.Override,{...u,addResult:c,resume:f,respondToApproval:h});const m=o.by_name?.[u.toolName]??o.Fallback;return p.jsx(XE,{...u,Fallback:m,addResult:c,resume:f,respondToApproval:h})}if(u.status?.type==="requires-action")throw new Error("Encountered unexpected requires-action status");switch(d){case"text":return p.jsx(e,{...u});case"reasoning":return p.jsx(t,{...u});case"source":return p.jsx(r,{...u});case"image":return p.jsx(n,{...u});case"file":return p.jsx(i,{...u});case"audio":return p.jsx(s,{...u});case"data":{const c=a?.by_name?.[u.name]??a?.Fallback;return p.jsx(ZE,{...u,Fallback:c})}default:return console.warn(`Unknown message part type: ${d}`),null}},tT=({partIndex:e,components:t})=>p.jsx(Xc,{index:e,children:p.jsx(eT,{components:t})}),nT=g.memo(tT,(e,t)=>e.partIndex===t.partIndex&&e.components?.Text===t.components?.Text&&e.components?.Reasoning===t.components?.Reasoning&&e.components?.Source===t.components?.Source&&e.components?.Image===t.components?.Image&&e.components?.File===t.components?.File&&e.components?.Unstable_Audio===t.components?.Unstable_Audio&&e.components?.tools===t.components?.tools&&e.components?.data===t.components?.data&&e.components?.Group===t.components?.Group),rT=({status:e,component:t})=>p.jsx(Zc,{text:"",isRunning:e.type==="running",children:p.jsx(t,{type:"text",text:"",status:e})}),iT=Object.freeze({type:"complete"}),sT=({components:e})=>{const t=F(n=>n.message.status??iT);return e?.Empty?p.jsx(e.Empty,{status:t}):p.jsx(rT,{status:t,component:e?.Text??kn.Text})},oT=g.memo(sT,(e,t)=>e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),md=({groupingFunction:e,components:t})=>{const n=F(i=>i.message.parts.length),r=JE(e);return p.jsx(p.Fragment,{children:g.useMemo(()=>n===0?p.jsx(oT,{components:t}):r.map((i,s)=>p.jsx(t?.Group??kn.Group,{groupKey:i.groupKey,indices:i.indices,children:i.indices.map(o=>p.jsx(nT,{partIndex:o,components:t},o))},`group-${s}-${i.groupKey??"ungrouped"}`)),[r,t,n])})};md.displayName="MessagePrimitive.Unstable_PartsGrouped";const Sx=({components:e,...t})=>p.jsx(md,{...t,components:e,groupingFunction:YE});Sx.displayName="MessagePrimitive.Unstable_PartsGroupedByParentId";var ea=ks({AttachmentByIndex:()=>Tv,Attachments:()=>Iv,Content:()=>Lu,Error:()=>wx,GenerativeUI:()=>mv,GroupedParts:()=>_v,If:()=>Hv,PartByIndex:()=>Hi,Parts:()=>Lu,Quote:()=>Cv,Root:()=>xx,Unstable_PartsGrouped:()=>md,Unstable_PartsGroupedByParentId:()=>Sx});const aT=e=>{const t=fr(e);return wr(g.useCallback(n=>{const r=new ResizeObserver(()=>{t()}),i=new MutationObserver(s=>{s.some(o=>o.type!=="attributes"||o.attributeName!=="style")&&t()});return r.observe(n),i.observe(n,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{r.disconnect(),i.disconnect()}},[t]))},lT=({autoScroll:e,scrollToBottomOnRunStart:t=!0,scrollToBottomOnInitialize:n=!0,scrollToBottomOnThreadSwitch:r=!0})=>{const i=g.useRef(null),s=F(C=>C.thread.messages.length>0),o=g.useRef(!1),a=g.useRef(null),l=vr();e===void 0&&(e=l.getState().turnAnchor!=="top");const u=g.useRef(0),d=g.useRef(0),c=g.useRef(0),f=g.useRef(0),h=g.useRef(null),m=g.useCallback(C=>{const I=i.current;I&&(h.current=C,I.scrollTo({top:I.scrollHeight,behavior:C}))},[]),x=g.useCallback(C=>{h.current=C,a.current!==null&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{a.current=null,m(C)})},[m]);g.useLayoutEffect(()=>()=>{a.current!==null&&cancelAnimationFrame(a.current)},[]);const E=g.useCallback(()=>{const C=l.getState();return C.turnAnchor==="top"&&C.element.viewport===i.current&&C.element.anchor!==null},[l]),y=()=>{const C=i.current;if(!C)return;const I=l.getState().isAtBottom,k=Math.abs(C.scrollHeight-C.scrollTop-C.clientHeight)<=1||C.scrollHeight<=C.clientHeight;!k&&u.current<C.scrollTop||(k?C.scrollHeight>C.clientHeight+1&&(h.current=null):u.current>C.scrollTop&&d.current===C.scrollHeight&&(h.current=null),(k||h.current===null)&&k!==I&&Xo(l).setState({isAtBottom:k})),u.current=C.scrollTop,d.current=C.scrollHeight},v=aT(()=>{const C=i.current;if(!C)return;const{scrollHeight:I,clientHeight:k}=C;if(I===c.current&&k===f.current)return;c.current=I,f.current=k;const M=h.current;M&&E()?h.current=null:M?m(M):e&&l.getState().isAtBottom&&m("instant"),y()}),w=wr(C=>(C.addEventListener("scroll",y),()=>{C.removeEventListener("scroll",y)}));return g.useLayoutEffect(()=>{if(n){if(!s){o.current=!1;return}o.current||(o.current=!0,h.current===null&&x("instant"))}},[s,x,n]),ex(({behavior:C})=>{m(C)}),Qo("thread.runStart",()=>{t&&l.getState().turnAnchor!=="top"&&x("auto")}),Qo("threadListItem.switchedTo",()=>{r&&x("instant")}),xr(v,w,i)},bx=g.forwardRef((e,t)=>p.jsx(Ie.div,{...e,ref:t}));bx.displayName="ThreadPrimitive.Root";const kx=({children:e})=>F(t=>t.thread.isEmpty)?e:null;kx.displayName="ThreadPrimitive.Empty";const uT=e=>F(t=>!(e.empty===!0&&!t.thread.isEmpty||e.empty===!1&&t.thread.isEmpty||e.running===!0&&!t.thread.isRunning||e.running===!1&&t.thread.isRunning||e.disabled===!0&&!t.thread.isDisabled||e.disabled===!1&&t.thread.isDisabled)),_x=({children:e,...t})=>uT(t)?e:null;_x.displayName="ThreadPrimitive.If";const Cx=(e,t)=>wr(g.useCallback(n=>{if(!e)return;const r=e(),i=()=>{const o=t?t(n):n.offsetHeight;r.setHeight(o)},s=new ResizeObserver(i);return s.observe(n),i(),()=>{s.disconnect(),r.unregister()}},[e,t])),Wh=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},cT=(e,t)=>{let n=0,r=e;for(;r&&r!==t;)n+=r.offsetTop,r=r.offsetParent;return r===t?n:Wh(e)-Wh(t)},Ex=({viewport:e,anchor:t,tallerThan:n,visibleHeight:r})=>{const i=cT(t,e),s=t.offsetHeight;return i+Math.max(0,s-(s<=n?s:r))},dT=({scrollHeight:e,...t})=>{const{viewport:n}=t,r=Ex(t)+n.clientHeight;return Math.max(0,r-e)},fT=({viewport:e,reserve:t,...n})=>dT({viewport:e,...n,scrollHeight:e.scrollHeight-t.offsetHeight}),hT=e=>{const t=new ResizeObserver(e),n=new MutationObserver(e);let r=null,i=null,s=null;const o=()=>{t.disconnect(),n.disconnect(),r=null,i=null,s=null};return{target:(a,l,u)=>{r===a&&i===l&&s===u||(o(),t.observe(a),t.observe(l),t.observe(u),n.observe(u,{childList:!0,subtree:!0,characterData:!0}),r=a,i=l,s=u)},disconnect:o}},pT=e=>{let t=null;return{schedule:()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,e()}))},cancel:()=>{t!==null&&(cancelAnimationFrame(t),t=null)}}},mT=e=>{let t=null,n;function r(){const a=e.getState(),{viewport:l,anchor:u,target:d}=a.element,c=a.targetConfig;if(a.turnAnchor!=="top"||!l||!u||!d||!c){s.disconnect(),t&&(Hh(t,0),t.remove());return}if(t??(t=$E()),(t.parentElement!==d.parentElement||t.previousElementSibling!==d)&&d.after(t),s.target(l,u,d),Hh(t,fT({viewport:l,anchor:u,reserve:t,...c}))){i.schedule();return}const f=UE(u);if(f!==void 0&&n===f)return;const h=VE(Ex({viewport:l,anchor:u,...c}));Math.abs(l.scrollTop-h)>1&&l.scrollTo({top:h,behavior:"smooth"}),f!==void 0&&(n=f)}const i=pT(r),s=hT(i.schedule);i.schedule();const o=e.subscribe(i.schedule);return()=>{i.cancel(),o(),s.disconnect(),t?.remove()}},gT=e=>{const t=vr();g.useLayoutEffect(()=>{if(e)return mT(t)},[e,t])},Tx=({isRunning:e,messages:t})=>{if(!e)return null;const n=t.at(-1),r=t.at(-2);return r?.role!=="user"||n?.role!=="assistant"?null:{anchorId:r.id,targetId:n.id}},yT=e=>Tx(e)?.anchorId,vT=e=>Tx(e)?.targetId,xT=()=>Cx(yr(e=>e.registerViewport),g.useCallback(e=>e.clientHeight,[])),wT=()=>wr(yr(e=>e.registerViewportElement)),ST=e=>{const t=vr(),n=F(o=>{if(e)return yT(o.thread)}),r=F(o=>{if(e)return vT(o.thread)}),i=g.useMemo(()=>!n||!r?null:{anchorId:n,targetId:r},[n,r]);g.useLayoutEffect(()=>{if(!i)return;const o=t.getState(),a=o.topAnchorTurn;a?.anchorId===i.anchorId&&a.targetId===i.targetId||o.setTopAnchorTurn(i)},[i,t]);const s=g.useCallback(()=>{t.getState().setTopAnchorTurn(null)},[t]);Qo("thread.initialize",s),Qo("threadListItem.switchedTo",s)},Ix=g.forwardRef(({autoScroll:e,scrollToBottomOnRunStart:t,scrollToBottomOnInitialize:n,scrollToBottomOnThreadSwitch:r,children:i,...s},o)=>{const a=lT({autoScroll:e,scrollToBottomOnRunStart:t,scrollToBottomOnInitialize:n,scrollToBottomOnThreadSwitch:r}),l=xT(),u=wT(),d=vr().getState().turnAnchor==="top";ST(d),gT(d);const c=xr(o,a,l,u);return p.jsx(Ie.div,{...s,ref:c,children:i})});Ix.displayName="ThreadPrimitive.ViewportScrollable";const Rx=g.forwardRef(({turnAnchor:e,topAnchorMessageClamp:t,...n},r)=>p.jsx(od,{options:{turnAnchor:e,topAnchorMessageClamp:t},children:p.jsx(Ix,{...n,ref:r})}));Rx.displayName="ThreadPrimitive.Viewport";const Px=g.forwardRef((e,t)=>{const n=xr(t,Cx(yr(r=>r.registerContentInset),g.useCallback(r=>{const i=parseFloat(getComputedStyle(r).marginTop)||0;return r.offsetHeight+i},[])));return p.jsx(Ie.div,{...e,ref:n})});Px.displayName="ThreadPrimitive.ViewportFooter";const bT=({behavior:e}={})=>{const t=yr(i=>i.isAtBottom),n=vr(),r=g.useCallback(()=>{n.getState().scrollToBottom({behavior:e})},[n,e]);return t?null:r},kT=Hn("ThreadPrimitive.ScrollToBottom",bT,["behavior"]),_T=({prompt:e,send:t,clearComposer:n,autoSend:r,method:i})=>{const{disabled:s,trigger:o}=l1({prompt:e,send:t??r??!1,clearComposer:n});return s?null:o},CT=Hn("ThreadPrimitive.Suggestion",_T,["prompt","send","clearComposer","autoSend","method"]);var Ot=ks({Empty:()=>kx,If:()=>_x,MessageByIndex:()=>dv,Messages:()=>k0,Root:()=>bx,ScrollToBottom:()=>kT,Suggestion:()=>CT,SuggestionByIndex:()=>jv,Suggestions:()=>n1,Viewport:()=>Rx,ViewportFooter:()=>Px,ViewportProvider:()=>od}),ET=ks({AssistantRuntimeImpl:()=>iv,BaseAssistantRuntimeCore:()=>sv,CompositeContextProvider:()=>qc,DefaultThreadComposerRuntimeCore:()=>lv,MessageRepository:()=>td,ThreadRuntimeImpl:()=>rv,fromThreadMessageLike:()=>ps,generateId:()=>Bn,getAutoStatus:()=>Yo,splitLocalRuntimeOptions:()=>c1,useComposerInputPluginRegistryOptional:()=>Ra,useSmooth:()=>yx,useSmoothStatus:()=>zE,withSmoothContextProvider:()=>LE});const gd="claude-control.token";let ta=null,na=!1;function TT(){try{return window.localStorage.getItem(gd)}catch{return null}}const IT="claude-control";function Pa(){return na||(ta=TT(),na=!0),ta}function Ax(e){ta=e,na=!0;try{window.localStorage.setItem(gd,e)}catch{}}function Mx(){ta=null,na=!0;try{window.localStorage.removeItem(gd)}catch{}}function RT(){if(typeof window>"u"||!window.location)return;let e;try{e=new URLSearchParams(window.location.search)}catch{return}const t=e.get("token");if(!t)return;Ax(t),e.delete("token");const n=e.toString(),r=window.location.pathname+(n?`?${n}`:"")+window.location.hash;try{window.history.replaceState(null,"",r)}catch{}}RT();const zu=new Set;function PT(e){return zu.add(e),()=>zu.delete(e)}function Nx(){Mx();for(const e of zu)e()}function AT(e){const t=Pa(),n={...e??{}};return t&&(n.Authorization=`Bearer ${t}`),n}async function lt(e,t){const n=await fetch(e,{...t,headers:AT(t?.headers)});return n.status===401&&Nx(),n}function MT(e){const t=`/term/${encodeURIComponent(e)}/`,n=Pa();return n?`${t}?token=${encodeURIComponent(n)}`:t}function NT(){const e=window.location;return`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}/`}async function jT(e,t){const n=await lt("/api/pins",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:e,transcriptPath:t})}),r=await n.json().catch(()=>({}));if(!n.ok||!r.ok)throw new Error(r.error||`HTTP ${n.status}`);return r.pins??{}}async function DT(){const e=await lt("/api/transcripts");if(!e.ok)throw new Error(`HTTP ${e.status}`);return(await e.json()).transcripts??[]}async function jx(){try{const e=await lt("/api/version");return e.ok?await e.json():null}catch{return null}}async function OT(){try{const e=await lt("/api/update",{method:"POST"}),t=await e.json().catch(()=>({}));return e.ok&&!!t.ok}catch{return!0}}async function LT(){try{const e=await lt("/api/push/vapid");return e.ok?(await e.json()).publicKey??null:null}catch{return null}}async function zT(e){try{return(await lt("/api/push/subscribe",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})).ok}catch{return!1}}async function FT(e){try{return(await lt("/api/push/unsubscribe",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({endpoint:e})})).ok}catch{return!1}}async function BT(){const e=await lt("/api/config");if(!e.ok)throw new Error(`HTTP ${e.status}`);return await e.json()}async function UT(e){const t=await lt("/api/config",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),n=await t.json().catch(()=>({}));if(!t.ok)throw new Error("error"in n&&n.error||`HTTP ${t.status}`);return n}async function $T(e){const t=await lt("/api/session/new",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),n=await t.json().catch(()=>({}));if(!t.ok||!("ok"in n)||!n.ok){const r="error"in n&&n.error||`HTTP ${t.status}`;throw new Error(r)}return n}async function VT(e,t){const n=await lt("/api/session/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:e,name:t})}),r=await n.json().catch(()=>({}));if(!n.ok||!("ok"in r)||!r.ok){const i="error"in r&&r.error||`HTTP ${n.status}`;throw new Error(i)}}function HT(e){return`/api/uploads/${encodeURIComponent(e)}`}async function WT(e){const t=`/api/upload?name=${encodeURIComponent(e.name)}`,n=await lt(t,{method:"POST",body:e});let r=null;try{r=await n.json()}catch{}const i=r??{};if(!n.ok||!i.ok||!i.path)throw new Error(i.error||`HTTP ${n.status}`);return{ok:!0,path:i.path,name:i.name??e.name}}const qT=1008,qh=1e3,KT=3e4;class QT{constructor(){_(this,"ws",null);_(this,"reconnectTimer",null);_(this,"reconnectDelay",qh);_(this,"selectedId",null);_(this,"closed",!1);_(this,"msgHandlers",new Set);_(this,"stateHandlers",new Set)}connect(){if(this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING))return;this.emitState("connecting");const t=Pa(),n=t?[IT,t]:void 0,r=new WebSocket(NT(),n);this.ws=r,r.addEventListener("open",()=>{this.reconnectDelay=qh,this.emitState("connected"),this.selectedId&&this.send({type:"subscribe",id:this.selectedId})}),r.addEventListener("message",i=>{let s;try{s=JSON.parse(i.data)}catch{return}for(const o of this.msgHandlers)o(s)}),r.addEventListener("close",i=>{if(this.ws=null,this.emitState("disconnected"),i.code===qT){Nx();return}this.closed||this.scheduleReconnect()}),r.addEventListener("error",()=>{})}scheduleReconnect(){this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout(()=>this.connect(),this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*2,KT)}send(t){return this.ws&&this.ws.readyState===WebSocket.OPEN?(this.ws.send(JSON.stringify(t)),!0):!1}isOpen(){return this.ws?.readyState===WebSocket.OPEN}select(t){this.selectedId!==t&&(this.selectedId&&this.send({type:"unsubscribe",id:this.selectedId}),this.selectedId=t,t&&this.send({type:"subscribe",id:t}))}resubscribe(){const t=this.selectedId;t&&(this.send({type:"unsubscribe",id:t}),this.send({type:"subscribe",id:t}))}onMessage(t){return this.msgHandlers.add(t),()=>this.msgHandlers.delete(t)}onState(t){return this.stateHandlers.add(t),()=>this.stateHandlers.delete(t)}emitState(t){for(const n of this.stateHandlers)n(t)}close(){this.closed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.ws?.close(),this.ws=null}}function GT(){const e=g.useRef(null);e.current||(e.current=new QT);const t=e.current,[n,r]=g.useState([]),[i,s]=g.useState(null),[o,a]=g.useState("connecting"),[l,u]=g.useState({snapshot:null,warning:null}),[d,c]=g.useState(null),[f,h]=g.useState({}),[m,x]=g.useState({}),[E,y]=g.useState({}),[v,w]=g.useState({}),C=g.useRef(null);C.current=i,g.useEffect(()=>{const W=t.onState(a),Z=t.onMessage(P=>{switch(P.type){case"sessions":r(P.sessions??[]);break;case"messages":h(A=>({...A,[P.id]:P.messages??[]})),x(A=>({...A,[P.id]:P.pending??null}));break;case"append":h(A=>({...A,[P.id]:[...A[P.id]??[],...P.messages??[]]}));break;case"pending":x(A=>({...A,[P.id]:P.pending})),r(A=>A.map(S=>S.id===P.id?{...S,pending:!!P.pending}:S));break;case"resources":u({snapshot:P.snapshot??null,warning:P.warning??null});break;case"capture":P.id===C.current&&c(P.text??"");break;case"prompt":w(A=>({...A,[P.id]:P.prompt}));break;case"subagents":y(A=>({...A,[P.id]:Object.fromEntries((P.subagents??[]).map(S=>[S.agentId,S]))}));break;case"subagent":y(A=>({...A,[P.id]:{...A[P.id]??{},[P.subagent.agentId]:P.subagent}}));break;case"ack":window.dispatchEvent(new CustomEvent("cockpit:ack",{detail:P}));break}});return t.connect(),()=>{W(),Z()}},[t]),g.useEffect(()=>()=>t.close(),[t]);const I=g.useCallback(W=>{W!==C.current&&(s(W),c(null),t.select(W))},[t]),k=g.useCallback(W=>{const Z=C.current;return!Z||!W.trim()?!1:t.send({type:"reply",id:Z,text:W})},[t]),M=g.useCallback((W,Z)=>{const P=C.current;return P?t.send({type:"answer",id:P,toolUseId:W,selections:Z}):!1},[t]),D=g.useCallback(W=>{const Z=C.current;return Z?t.send({type:"capture",id:Z,lines:W}):!1},[t]),$=g.useCallback(()=>c(null),[]),T=g.useCallback(()=>t.resubscribe(),[t]),L=g.useCallback(W=>{const Z=C.current;return Z?t.send({type:"promptkey",id:Z,key:W}):!1},[t]),z=g.useMemo(()=>i?f[i]??[]:[],[i,f]),Q=g.useMemo(()=>i?m[i]??null:null,[i,m]),ae=g.useMemo(()=>i?v[i]??null:null,[i,v]),Y=g.useMemo(()=>{const W=i?E[i]:null;return W?Object.values(W).sort((Z,P)=>(P.createdAt??-1/0)-(Z.createdAt??-1/0)):[]},[i,E]);return{sessions:n,selectedId:i,messages:z,pending:Q,prompt:ae,subagents:Y,conn:o,resources:l,capture:d,select:I,resubscribe:T,sendReply:k,sendPromptKey:L,sendAnswer:M,requestCapture:D,clearCapture:$}}const yl="cc:push:intent";function YT(){return typeof window>"u"||!("serviceWorker"in navigator)||!("PushManager"in window)||!("Notification"in window)?!1:window.isSecureContext===!0}function JT(){if(typeof navigator>"u")return!1;const e=navigator.userAgent||"",t=/iPad|iPhone|iPod/.test(e),n=navigator.platform==="MacIntel"&&typeof navigator.maxTouchPoints=="number"&&navigator.maxTouchPoints>1;return t||n}function XT(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(n),i=new ArrayBuffer(r.length),s=new Uint8Array(i);for(let o=0;o<r.length;o+=1)s[o]=r.charCodeAt(o);return i}function ZT(){const e=YT(),t=JT(),[n,r]=g.useState(e?"off":"unsupported"),i=g.useCallback(async()=>{const a=await navigator.serviceWorker.register("/sw.js");if(await navigator.serviceWorker.ready,await Notification.requestPermission()!=="granted")return r("denied"),!1;const u=await LT();if(!u)return r("off"),!1;let d=await a.pushManager.getSubscription();return d||(d=await a.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:XT(u)})),await zT(d.toJSON())},[]),s=g.useCallback(async()=>{if(e){r("working");try{await i()?(localStorage.setItem(yl,"1"),r("on")):r(l=>l==="denied"?"denied":"off")}catch{r("off")}}},[e,i]),o=g.useCallback(async()=>{r("working"),localStorage.removeItem(yl);try{const l=await(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription();l&&(await FT(l.endpoint),await l.unsubscribe())}catch{}r("off")},[]);return g.useEffect(()=>{if(!e||localStorage.getItem(yl)!=="1")return;if(Notification.permission!=="granted"){r(Notification.permission==="denied"?"denied":"off");return}let a=!1;return(async()=>{try{const l=await i();a||r(l?"on":"off")}catch{a||r("off")}})(),()=>{a=!0}},[e,i]),{status:n,supported:e,iosHint:t,enable:s,disable:o}}const ra="__cockpitSummary";function eI(e){if(e&&typeof e=="object"&&ra in e){const t=e[ra];return typeof t=="string"?t:""}return""}function tI(e){if(!e||typeof e!="object")return e;const t={};for(const[n,r]of Object.entries(e))n!==ra&&(t[n]=r);return t}function nI(e){if(e&&typeof e=="object"&&"text"in e){const t=e;return{text:String(t.text??""),isError:!!t.isError}}return null}function Dx(e){const t=new Map;for(const r of e)for(const i of r.blocks??[])i.kind==="tool_result"&&t.set(i.forId,{text:i.text??"",isError:!!i.isError});const n=[];return e.forEach((r,i)=>{const s=iI(r.blocks??[],t,r.role==="user");if(s.length===0)return;const o=r.role==="user"?"user":"assistant";n.push({role:o,id:r.uuid||`m-${i}`,createdAt:r.ts?new Date(r.ts):void 0,content:s,metadata:{custom:{cockpitRole:r.role}}})}),n}function rI(e){const t=e.trimStart();if(!t.startsWith("<"))return null;const n=/<summary>([\s\S]*?)<\/summary>/.exec(t)?.[1]?.trim();return t.startsWith("<task-notification")?`⚙ background task ${n?`— ${n}`:"update"}`:t.startsWith("<system-reminder")?"⚙ system reminder":t.startsWith("<command-name")||t.startsWith("<command-message")?"⌘ slash command":t.startsWith("<local-command-stdout")?"⌘ command output":t.startsWith("<user-prompt-submit-hook")||t.startsWith("<session-")?"⚙ session hook":null}function iI(e,t,n=!1){const r=[];for(const i of e)switch(i.kind){case"text":{if(i.text&&i.text.length>0){const s=n?rI(i.text):null;r.push({type:"text",text:s??i.text})}break}case"thinking":{i.text&&i.text.trim().length>0&&r.push({type:"reasoning",text:i.text});break}case"tool_use":{const s=t.get(i.id),o=i.input&&typeof i.input=="object"?i.input:i.input!=null?{value:i.input}:{};r.push({type:"tool-call",toolCallId:i.id,toolName:i.name||"tool",args:{...o,[ra]:i.inputSummary??""},argsText:i.inputSummary??"",result:s??void 0,isError:s?.isError});break}}return r}const sI="image/*,application/pdf,text/*,.md,.json,.csv,.log",Fu=" cockpit-path:";function oI(e){return Fu+e}const vo=new Map;function aI(e){return vo.get(e)??null}function lI(e){for(const t of e.content??[])if(t.type==="text"&&t.text.startsWith(Fu))return t.text.slice(Fu.length);return aI(e.id)}function uI(e){return`${e.name}-${e.size}-${e.lastModified}`}function cI(e){return{accept:sI,async add({file:t}){const n=uI(t),r=t.type.startsWith("image/"),i=t.type==="application/pdf",s={id:n,type:r?"image":i?"document":"file",name:t.name,contentType:t.type||"application/octet-stream",file:t};e(`Uploading ${t.name}…`);try{const o=await WT(t);return vo.set(n,o.path),e(`Attached ${o.name}`,"ok"),{...s,status:{type:"requires-action",reason:"composer-send"}}}catch(o){const a=o instanceof Error?o.message:String(o);return e(`Attach failed: ${a}`,"error"),{...s,status:{type:"incomplete",reason:"error"}}}},async send(t){const n=vo.get(t.id);if(!n)throw new Error(`attachment ${t.name} was not uploaded`);return{...t,status:{type:"complete"},content:[{type:"text",text:oI(n)}]}},async remove(t){vo.delete(t.id)}}}function dI(e){const t=e.windowIndex!=null&&e.sessionName!=null?`${e.sessionName}:${e.windowIndex}`:e.id,n=e.paneIndex!=null?` · p${e.paneIndex}`:"";return`${t}${n}`}function fI(e,t){return!!e.active!=!!t.active?e.active?-1:1:(t.lastActivity??0)-(e.lastActivity??0)}function hI({sessions:e,selectedId:t,onSelect:n}){const r=[...e].sort(fI);return p.jsxs("ul",{className:"session-list",role:"listbox","aria-label":"Sessions",children:[r.map(i=>{const s=i.id===t;return p.jsxs("li",{role:"option","aria-selected":s,tabIndex:0,className:"session-item","data-active":i.active?"true":"false","data-selected":s?"true":"false",onClick:()=>n(i.id),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(i.id))},children:[p.jsxs("div",{className:"session-top",children:[p.jsx("span",{className:"active-dot","data-on":i.active?"true":"false","aria-hidden":"true"}),p.jsx("span",{className:"session-name",children:i.name||i.id}),i.pending?p.jsx("span",{className:"ask-badge","aria-label":"pending question",children:"ASK"}):null]}),p.jsxs("div",{className:"session-meta",children:[p.jsx("span",{className:"meta-prov",children:dI(i)}),i.model?p.jsx("span",{className:"meta-model",children:i.model}):null,i.ctxPct!=null?p.jsxs("span",{className:"meta-ctx",children:["ctx:",Math.round(i.ctxPct),"%"]}):null]})]},i.id)}),r.length===0?p.jsx("li",{className:"session-empty",children:"no Claude sessions"}):null]})}const pI={on:"Notifications on",off:"Enable notifications",denied:"Notifications blocked",unsupported:"Notifications unsupported",working:"Working…"};function mI({push:e}){const{status:t,supported:n,enable:r,disable:i}=e,s=t==="on",o=!n||t==="unsupported"||t==="working"||t==="denied",a=pI[t]??"Notifications",l=()=>{o||(s?i():r())};return p.jsx("button",{type:"button",className:"notify-bell","data-state":t,"aria-pressed":s,"aria-label":a,title:a,disabled:o,onClick:l,children:p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24","aria-hidden":"true",children:[p.jsx("path",{d:"M12 22a2.5 2.5 0 0 0 2.45-2h-4.9A2.5 2.5 0 0 0 12 22Zm7-5-1.6-1.6V10a5.4 5.4 0 0 0-4-5.2V4a1.4 1.4 0 0 0-2.8 0v.8A5.4 5.4 0 0 0 6.6 10v5.4L5 17v1h14Z",fill:s?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),t==="denied"||t==="unsupported"?p.jsx("line",{x1:"4",y1:"4",x2:"20",y2:"20",stroke:"currentColor",strokeWidth:"1.8"}):null]})})}function gI({size:e=18}){return p.jsxs("svg",{width:e,height:Math.round(e*1.2),viewBox:"0 0 10 12","aria-hidden":"true",focusable:"false",style:{display:"block",flexShrink:0},children:[p.jsx("rect",{x:"1",y:"2",width:"8",height:"7",fill:"#c97c5a"}),p.jsx("rect",{x:"0",y:"3",width:"1",height:"2",fill:"#c97c5a"}),p.jsx("rect",{x:"9",y:"3",width:"1",height:"2",fill:"#c97c5a"}),p.jsx("rect",{x:"2",y:"4",width:"2",height:"2",fill:"var(--bg)"}),p.jsx("rect",{x:"6",y:"4",width:"2",height:"2",fill:"var(--bg)"}),p.jsx("rect",{x:"2",y:"9",width:"2",height:"2",fill:"#c97c5a"}),p.jsx("rect",{x:"6",y:"9",width:"2",height:"2",fill:"#c97c5a"})]})}function Kh(e,t=""){return e!=null?`${Math.round(e)}${t}`:"—"}function yI({resources:e,conn:t,push:n}){const r=e.snapshot,i=r?.self??{},s=r?.system??{},o=!!r?.overLimit||!!e.warning,a=s.loadavg?.[0];return p.jsxs("div",{className:"hud","data-warn":o?"true":"false",role:"status",children:[p.jsxs("span",{className:"hud-brand",children:[p.jsx(gI,{size:18}),"claude control"]}),p.jsx("span",{className:`conn-dot conn-${t}`,title:t,"aria-label":t}),p.jsxs("span",{className:"hud-group",children:[p.jsx("span",{className:"hud-k",children:"cpu"}),p.jsx("span",{className:"hud-v",children:i.cpuPct!=null?`${i.cpuPct.toFixed(0)}%`:"—"})]}),p.jsxs("span",{className:"hud-group",children:[p.jsx("span",{className:"hud-k",children:"rss"}),p.jsx("span",{className:"hud-v",children:Kh(i.rssMB,"m")})]}),p.jsxs("span",{className:"hud-group",children:[p.jsx("span",{className:"hud-k",children:"load"}),p.jsx("span",{className:"hud-v",children:a!=null?a.toFixed(2):"—"})]}),p.jsxs("span",{className:"hud-group",children:[p.jsx("span",{className:"hud-k",children:"mem"}),p.jsx("span",{className:"hud-v",children:Kh(s.memUsedPct,"%")})]}),o?p.jsx("span",{className:"hud-warn-text",children:e.warning||"over limit"}):null,p.jsx("span",{className:"hud-spacer"}),p.jsx(mI,{push:n})]})}const vI=(e,t)=>typeof e=="string"?e===t:JSON.stringify(e)===JSON.stringify(t),xI=(e,t)=>{if(!e||!t)return!1;const n=r=>{const{position:i,data:s,...o}=r||{};return o};return JSON.stringify(n(e.properties))===JSON.stringify(n(t.properties))&&vI(e.children,t.children)},Ox=(e,t)=>xI(e.node,t.node),yd=g.createContext(null),wI=()=>g.useContext(yd)!==null,SI=({children:e,...t})=>p.jsx(yd.Provider,{value:t,children:e}),bI=g.memo(SI,Ox),kI=({node:e,...t})=>p.jsx("pre",{...t}),_I=({node:e,...t})=>p.jsx("code",{...t}),vd=({node:e,components:{Pre:t,Code:n},code:r})=>p.jsx(t,{children:p.jsx(n,{node:e,children:r})}),CI=()=>null,EI=({node:e,components:{Pre:t,Code:n,SyntaxHighlighter:r,CodeHeader:i},language:s,code:o})=>{const a=g.useMemo(()=>({Pre:t,Code:n}),[t,n]);return p.jsxs(p.Fragment,{children:[p.jsx(i,{node:e,language:s,code:o}),p.jsx(s?r:vd,{node:e,components:a,language:s??"unknown",code:o})]})};var Lx={exports:{}};/*!
|
|
45
|
-
Copyright (c) 2018 Jed Watson.
|
|
46
|
-
Licensed under the MIT License (MIT), see
|
|
47
|
-
http://jedwatson.github.io/classnames
|
|
48
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Lx);var TI=Lx.exports;const zx=ys(TI),Qh=({className:e,...t})=>({className:n,...r})=>({className:zx(e,n),...t,...r}),II=({node:e,components:{Pre:t,Code:n,SyntaxHighlighter:r,CodeHeader:i},componentsByLanguage:s={},children:o,...a})=>{const l=Qh(g.useContext(yd)),u=fr(h=>p.jsx(t,{...l(h)})),d=Qh(a),c=fr(h=>p.jsx(n,{...d(h)})),f=/language-(\w+)/.exec(a.className||"")?.[1]??"";return typeof o!="string"?p.jsx(vd,{node:e,components:{Pre:u,Code:c},code:o}):p.jsx(EI,{node:e,components:{Pre:u,Code:c,SyntaxHighlighter:s[f]?.SyntaxHighlighter??r,CodeHeader:s[f]?.CodeHeader??i},language:f||"unknown",code:o})},RI=({node:e,components:t,componentsByLanguage:n,...r})=>wI()?p.jsx(II,{node:e,components:t,componentsByLanguage:n,...r}):p.jsx(t.Code,{...r}),PI=g.memo(RI,(e,t)=>e.components===t.components&&e.componentsByLanguage===t.componentsByLanguage&&Ox(e,t));function AI(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const MI=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NI=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jI={};function Gh(e,t){return(jI.jsx?NI:MI).test(e)}const DI=/[ \t\n\f\r]/g;function OI(e){return typeof e=="object"?e.type==="text"?Yh(e.value):!1:Yh(e)}function Yh(e){return e.replace(DI,"")===""}class _s{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}_s.prototype.normal={};_s.prototype.property={};_s.prototype.space=void 0;function Fx(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new _s(n,r,t)}function Bu(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 LI=0;const K=Sr(),Ee=Sr(),Uu=Sr(),j=Sr(),fe=Sr(),sr=Sr(),dt=Sr();function Sr(){return 2**++LI}const $u=Object.freeze(Object.defineProperty({__proto__:null,boolean:K,booleanish:Ee,commaOrSpaceSeparated:dt,commaSeparated:sr,number:j,overloadedBoolean:Uu,spaceSeparated:fe},Symbol.toStringTag,{value:"Module"})),vl=Object.keys($u);class xd extends ut{constructor(t,n,r,i){let s=-1;if(super(t,n),Jh(this,"space",i),typeof r=="number")for(;++s<vl.length;){const o=vl[s];Jh(this,vl[s],(r&$u[o])===$u[o])}}}xd.prototype.defined=!0;function Jh(e,t,n){n&&(e[t]=n)}function fi(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new xd(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Bu(r)]=r,n[Bu(s.attribute)]=r}return new _s(t,n,e.space)}const Bx=fi({properties:{ariaActiveDescendant:null,ariaAtomic:Ee,ariaAutoComplete:null,ariaBusy:Ee,ariaChecked:Ee,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:fe,ariaCurrent:null,ariaDescribedBy:fe,ariaDetails:null,ariaDisabled:Ee,ariaDropEffect:fe,ariaErrorMessage:null,ariaExpanded:Ee,ariaFlowTo:fe,ariaGrabbed:Ee,ariaHasPopup:null,ariaHidden:Ee,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:fe,ariaLevel:j,ariaLive:null,ariaModal:Ee,ariaMultiLine:Ee,ariaMultiSelectable:Ee,ariaOrientation:null,ariaOwns:fe,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:Ee,ariaReadOnly:Ee,ariaRelevant:null,ariaRequired:Ee,ariaRoleDescription:fe,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:Ee,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ux(e,t){return t in e?e[t]:t}function $x(e,t){return Ux(e,t.toLowerCase())}const zI=fi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:sr,acceptCharset:fe,accessKey:fe,action:null,allow:null,allowFullScreen:K,allowPaymentRequest:K,allowUserMedia:K,alpha:K,alt:null,as:null,async:K,autoCapitalize:null,autoComplete:fe,autoFocus:K,autoPlay:K,blocking:fe,capture:null,charSet:null,checked:K,cite:null,className:fe,closedBy:null,colorSpace:null,cols:j,colSpan:j,command:null,commandFor:null,content:null,contentEditable:Ee,controls:K,controlsList:fe,coords:j|sr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:K,defer:K,dir:null,dirName:null,disabled:K,download:Uu,draggable:Ee,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:K,formTarget:null,headers:fe,height:j,hidden:Uu,high:j,href:null,hrefLang:null,htmlFor:fe,httpEquiv:fe,id:null,imageSizes:null,imageSrcSet:null,inert:K,inputMode:null,integrity:null,is:null,isMap:K,itemId:null,itemProp:fe,itemRef:fe,itemScope:K,itemType:fe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:K,low:j,manifest:null,max:null,maxLength:j,media:null,method:null,min:null,minLength:j,multiple:K,muted:K,name:null,nonce:null,noModule:K,noValidate:K,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:K,optimum:j,pattern:null,ping:fe,placeholder:null,playsInline:K,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:K,referrerPolicy:null,rel:fe,required:K,reversed:K,rows:j,rowSpan:j,sandbox:fe,scope:null,scoped:K,seamless:K,selected:K,shadowRootClonable:K,shadowRootCustomElementRegistry:K,shadowRootDelegatesFocus:K,shadowRootMode:null,shadowRootSerializable:K,shape:null,size:j,sizes:null,slot:null,span:j,spellCheck:Ee,src:null,srcDoc:null,srcLang:null,srcSet:null,start:j,step:null,style:null,tabIndex:j,target:null,title:null,translate:null,type:null,typeMustMatch:K,useMap:null,value:Ee,width:j,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:fe,axis:null,background:null,bgColor:null,border:j,borderColor:null,bottomMargin:j,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:K,declare:K,event:null,face:null,frame:null,frameBorder:null,hSpace:j,leftMargin:j,link:null,longDesc:null,lowSrc:null,marginHeight:j,marginWidth:j,noResize:K,noHref:K,noShade:K,noWrap:K,object:null,profile:null,prompt:null,rev:null,rightMargin:j,rules:null,scheme:null,scrolling:Ee,standby:null,summary:null,text:null,topMargin:j,valueType:null,version:null,vAlign:null,vLink:null,vSpace:j,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:K,disablePictureInPicture:K,disableRemotePlayback:K,exportParts:sr,part:fe,prefix:null,property:null,results:j,security:null,unselectable:null},space:"html",transform:$x}),FI=fi({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:j,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:j,amplitude:j,arabicForm:null,ascent:j,attributeName:null,attributeType:null,azimuth:j,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:j,by:null,calcMode:null,capHeight:j,className:fe,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:j,diffuseConstant:j,direction:null,display:null,dur:null,divisor:j,dominantBaseline:null,download:K,dx:null,dy:null,edgeMode:null,editable:null,elevation:j,enableBackground:null,end:null,event:null,exponent:j,externalResourcesRequired:null,fill:null,fillOpacity:j,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:sr,g2:sr,glyphName:sr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:j,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:j,horizOriginX:j,horizOriginY:j,id:null,ideographic:j,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:j,k:j,k1:j,k2:j,k3:j,k4:j,kernelMatrix:dt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:j,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:j,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:j,overlineThickness:j,paintOrder:null,panose1:null,path:null,pathLength:j,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:fe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:j,pointsAtY:j,pointsAtZ:j,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:j,specularExponent:j,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:j,strikethroughThickness:j,string:null,stroke:null,strokeDashArray:dt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:j,strokeOpacity:j,strokeWidth:null,style:null,surfaceScale:j,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dt,tabIndex:j,tableValues:null,target:null,targetX:j,targetY:j,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:j,underlineThickness:j,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:j,values:null,vAlphabetic:j,vMathematical:j,vectorEffect:null,vHanging:j,vIdeographic:j,version:null,vertAdvY:j,vertOriginX:j,vertOriginY:j,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:j,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ux}),Vx=fi({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()}}),Hx=fi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$x}),Wx=fi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),BI={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"},UI=/[A-Z]/g,Xh=/-[a-z]/g,$I=/^data[-\w.:]+$/i;function VI(e,t){const n=Bu(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"&&$I.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Xh,WI);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Xh.test(s)){let o=s.replace(UI,HI);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=xd}return new i(r,t)}function HI(e){return"-"+e.toLowerCase()}function WI(e){return e.charAt(1).toUpperCase()}const qI=Fx([Bx,zI,Vx,Hx,Wx],"html"),wd=Fx([Bx,FI,Vx,Hx,Wx],"svg");function KI(e){return e.join(" ").trim()}var Sd={},Zh=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,QI=/\n/g,GI=/^\s*/,YI=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,JI=/^:\s*/,XI=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ZI=/^[;\s]*/,eR=/^\s+|\s+$/g,tR=`
|
|
49
|
-
`,ep="/",tp="*",Xn="",nR="comment",rR="declaration";function iR(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var x=m.match(QI);x&&(n+=x.length);var E=m.lastIndexOf(tR);r=~E?m.length-E:r+m.length}function s(){var m={line:n,column:r};return function(x){return x.position=new o(m),u(),x}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var x=new Error(t.source+":"+n+":"+r+": "+m);if(x.reason=m,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function l(m){var x=m.exec(e);if(x){var E=x[0];return i(E),e=e.slice(E.length),x}}function u(){l(GI)}function d(m){var x;for(m=m||[];x=c();)x!==!1&&m.push(x);return m}function c(){var m=s();if(!(ep!=e.charAt(0)||tp!=e.charAt(1))){for(var x=2;Xn!=e.charAt(x)&&(tp!=e.charAt(x)||ep!=e.charAt(x+1));)++x;if(x+=2,Xn===e.charAt(x-1))return a("End of comment missing");var E=e.slice(2,x-2);return r+=2,i(E),e=e.slice(x),r+=2,m({type:nR,comment:E})}}function f(){var m=s(),x=l(YI);if(x){if(c(),!l(JI))return a("property missing ':'");var E=l(XI),y=m({type:rR,property:np(x[0].replace(Zh,Xn)),value:E?np(E[0].replace(Zh,Xn)):Xn});return l(ZI),y}}function h(){var m=[];d(m);for(var x;x=f();)x!==!1&&(m.push(x),d(m));return m}return u(),h()}function np(e){return e?e.replace(eR,Xn):Xn}var sR=iR,oR=So&&So.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sd,"__esModule",{value:!0});Sd.default=lR;const aR=oR(sR);function lR(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,aR.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(n=n||{},n[o]=a)}),n}var Aa={};Object.defineProperty(Aa,"__esModule",{value:!0});Aa.camelCase=void 0;var uR=/^--[a-zA-Z0-9_-]+$/,cR=/-([a-z])/g,dR=/^[^-]+$/,fR=/^-(webkit|moz|ms|o|khtml)-/,hR=/^-(ms)-/,pR=function(e){return!e||dR.test(e)||uR.test(e)},mR=function(e,t){return t.toUpperCase()},rp=function(e,t){return"".concat(t,"-")},gR=function(e,t){return t===void 0&&(t={}),pR(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(hR,rp):e=e.replace(fR,rp),e.replace(cR,mR))};Aa.camelCase=gR;var yR=So&&So.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},vR=yR(Sd),xR=Aa;function Vu(e,t){var n={};return!e||typeof e!="string"||(0,vR.default)(e,function(r,i){r&&i&&(n[(0,xR.camelCase)(r,t)]=i)}),n}Vu.default=Vu;var wR=Vu;const SR=ys(wR),qx=Kx("end"),bd=Kx("start");function Kx(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 bR(e){const t=bd(e),n=qx(e);if(t&&n)return{start:t,end:n}}function Wi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ip(e.position):"start"in e||"end"in e?ip(e):"line"in e||"column"in e?Hu(e):""}function Hu(e){return sp(e&&e.line)+":"+sp(e&&e.column)}function ip(e){return Hu(e&&e.start)+"-"+Hu(e&&e.end)}function sp(e){return e&&typeof e=="number"?e:1}class We extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Wi(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}We.prototype.file="";We.prototype.name="";We.prototype.reason="";We.prototype.message="";We.prototype.stack="";We.prototype.column=void 0;We.prototype.line=void 0;We.prototype.ancestors=void 0;We.prototype.cause=void 0;We.prototype.fatal=void 0;We.prototype.place=void 0;We.prototype.ruleId=void 0;We.prototype.source=void 0;const kd={}.hasOwnProperty,kR=new Map,_R=/[A-Z]/g,CR=new Set(["table","tbody","thead","tfoot","tr"]),ER=new Set(["td","th"]),Qx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function TR(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=DR(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=jR(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"?wd:qI,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Gx(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Gx(e,t,n){if(t.type==="element")return IR(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return RR(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return AR(e,t,n);if(t.type==="mdxjsEsm")return PR(e,t);if(t.type==="root")return MR(e,t,n);if(t.type==="text")return NR(e,t)}function IR(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=wd,e.schema=i),e.ancestors.push(t);const s=Jx(e,t.tagName,!1),o=OR(e,t);let a=Cd(e,t);return CR.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!OI(l):!0})),Yx(e,o,s,t),_d(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function RR(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)}ms(e,t.position)}function PR(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ms(e,t.position)}function AR(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=wd,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Jx(e,t.name,!0),o=LR(e,t),a=Cd(e,t);return Yx(e,o,s,t),_d(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function MR(e,t,n){const r={};return _d(r,Cd(e,t)),e.create(t,e.Fragment,r,n)}function NR(e,t){return t.value}function Yx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function _d(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function jR(e,t,n){return r;function r(i,s,o,a){const u=Array.isArray(o.children)?n:t;return a?u(s,o,a):u(s,o)}}function DR(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=bd(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function OR(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&kd.call(t.properties,i)){const s=zR(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&ER.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function LR(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ms(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else ms(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Cd(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:kR;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;o=l+"-"+u,i.set(l,u+1)}}const a=Gx(e,s,o);a!==void 0&&n.push(a)}return n}function zR(e,t,n){const r=VI(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?AI(n):KI(n)),r.property==="style"){let i=typeof n=="object"?n:FR(e,String(n));return e.stylePropertyNameCase==="css"&&(i=BR(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?BI[r.property]||r.property:r.attribute,n]}}function FR(e,t){try{return SR(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new We("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=Qx+"#cannot-parse-style-attribute",i}}function Jx(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=Gh(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=Gh(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return kd.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ms(e)}function ms(e,t){const n=new We("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=Qx+"#cannot-handle-mdx-estrees-without-createevaluater",n}function BR(e){const t={};let n;for(n in e)kd.call(e,n)&&(t[UR(n)]=e[n]);return t}function UR(e){let t=e.replace(_R,$R);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function $R(e){return"-"+e.toLowerCase()}const xl={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"]},VR={};function Ed(e,t){const n=VR,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Xx(e,r,i)}function Xx(e,t,n){if(HR(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 op(e.children,t,n)}return Array.isArray(e)?op(e,t,n):""}function op(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Xx(e[i],t,n);return r.join("")}function HR(e){return!!(e&&typeof e=="object")}const ap=document.createElement("i");function Td(e){const t="&"+e+";";ap.innerHTML=t;const n=ap.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mt(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function kt(e,t){return e.length>0?(mt(e,e.length,0,t),e):t}const lp={}.hasOwnProperty;function Zx(e){const t={};let n=-1;for(;++n<e.length;)WR(t,e[n]);return t}function WR(e,t){let n;for(n in t){const i=(lp.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){lp.call(i,o)||(i[o]=[]);const a=s[o];qR(i[o],Array.isArray(a)?a:a?[a]:[])}}}function qR(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);mt(e,0,0,r)}function ew(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 Ft(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qe=Wn(/[A-Za-z]/),Ve=Wn(/[\dA-Za-z]/),KR=Wn(/[#-'*+\--9=?A-Z^-~]/);function ia(e){return e!==null&&(e<32||e===127)}const Wu=Wn(/\d/),QR=Wn(/[\dA-Fa-f]/),GR=Wn(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function he(e){return e!==null&&(e<0||e===32)}function te(e){return e===-2||e===-1||e===32}const Ma=Wn(/\p{P}|\p{S}/u),hr=Wn(/\s/);function Wn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function hi(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&Ve(e.charCodeAt(n+1))&&Ve(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function oe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return te(l)?(e.enter(n),a(l)):t(l)}function a(l){return te(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const YR={tokenize:JR};function JR(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),oe(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return H(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const XR={tokenize:ZR},up={tokenize:eP};function ZR(e){const t=this,n=[];let r=0,i,s,o;return a;function a(w){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,l,u)(w)}return u(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const C=t.events.length;let I=C,k;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){k=t.events[I][1].end;break}y(r);let M=C;for(;M<t.events.length;)t.events[M][1].end={...k},M++;return mt(t.events,I+1,0,t.events.slice(C)),t.events.length=M,u(w)}return a(w)}function u(w){if(r===n.length){if(!i)return f(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(up,d,c)(w)}function d(w){return i&&v(),y(r),f(w)}function c(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(w)}function f(w){return t.containerState={},e.attempt(up,h,m)(w)}function h(w){return r++,n.push([t.currentConstruct,t.containerState]),f(w)}function m(w){if(w===null){i&&v(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),x(w)}function x(w){if(w===null){E(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return H(w)?(e.consume(w),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),x)}function E(w,C){const I=t.sliceStream(w);if(C&&I.push(null),w.previous=s,s&&(s.next=w),s=w,i.defineSkip(w.start),i.write(I),t.parser.lazy[w.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const M=t.events.length;let D=M,$,T;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if($){T=t.events[D][1].end;break}$=!0}for(y(r),k=M;k<t.events.length;)t.events[k][1].end={...T},k++;mt(t.events,D+1,0,t.events.slice(M)),t.events.length=k}}function y(w){let C=n.length;for(;C-- >w;){const I=n[C];t.containerState=I[1],I[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function eP(e,t,n){return oe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ri(e){if(e===null||he(e)||hr(e))return 1;if(Ma(e))return 2}function Na(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const qu={name:"attention",resolveAll:tP,tokenize:nP};function tP(e,t){let n=-1,r,i,s,o,a,l,u,d;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;l=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 c={...e[r][1].end},f={...e[n][1].start};cp(c,-l),cp(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=kt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=kt(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=kt(u,Na(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=kt(u,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=kt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,mt(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function nP(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ri(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const u=e.exit("attentionSequence"),d=ri(l),c=!d||d===2&&i||n.includes(l),f=!i||i===2&&d||n.includes(r);return u._open=!!(s===42?c:c&&(i||!f)),u._close=!!(s===42?f:f&&(d||!c)),t(l)}}function cp(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const rP={name:"autolink",tokenize:iP};function iP(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(h){return Qe(h)?(e.consume(h),o):h===64?n(h):u(h)}function o(h){return h===43||h===45||h===46||Ve(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||Ve(h))&&r++<32?(e.consume(h),a):(r=0,u(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||ia(h)?n(h):(e.consume(h),l)}function u(h){return h===64?(e.consume(h),d):KR(h)?(e.consume(h),u):n(h)}function d(h){return Ve(h)?c(h):n(h)}function c(h){return h===46?(e.consume(h),r=0,d):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):f(h)}function f(h){if((h===45||Ve(h))&&r++<63){const m=h===45?f:c;return e.consume(h),m}return n(h)}}const Cs={partial:!0,tokenize:sP};function sP(e,t,n){return r;function r(s){return te(s)?oe(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||H(s)?t(s):n(s)}}const tw={continuation:{tokenize:aP},exit:lP,name:"blockQuote",tokenize:oP};function oP(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return te(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function aP(e,t,n){const r=this;return i;function i(o){return te(o)?oe(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(tw,t,n)(o)}}function lP(e){e.exit("blockQuote")}const nw={name:"characterEscape",tokenize:uP};function uP(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return GR(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const rw={name:"characterReference",tokenize:cP};function cP(e,t,n){const r=this;let i=0,s,o;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,o=Ve,d(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=QR,d):(e.enter("characterReferenceValue"),s=7,o=Wu,d(c))}function d(c){if(c===59&&i){const f=e.exit("characterReferenceValue");return o===Ve&&!Td(r.sliceSerialize(f))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(c)&&i++<s?(e.consume(c),d):n(c)}}const dp={partial:!0,tokenize:fP},fp={concrete:!0,name:"codeFenced",tokenize:dP};function dP(e,t,n){const r=this,i={partial:!0,tokenize:I};let s=0,o=0,a;return l;function l(k){return u(k)}function u(k){const M=r.events[r.events.length-1];return s=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===a?(o++,e.consume(k),d):o<3?n(k):(e.exit("codeFencedFenceSequence"),te(k)?oe(e,c,"whitespace")(k):c(k))}function c(k){return k===null||H(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(dp,x,C)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||H(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(k)):te(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),oe(e,h,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),f)}function h(k){return k===null||H(k)?c(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||H(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(k)):k===96&&k===a?n(k):(e.consume(k),m)}function x(k){return e.attempt(i,C,E)(k)}function E(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y}function y(k){return s>0&&te(k)?oe(e,v,"linePrefix",s+1)(k):v(k)}function v(k){return k===null||H(k)?e.check(dp,x,C)(k):(e.enter("codeFlowValue"),w(k))}function w(k){return k===null||H(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),w)}function C(k){return e.exit("codeFenced"),t(k)}function I(k,M,D){let $=0;return T;function T(Y){return k.enter("lineEnding"),k.consume(Y),k.exit("lineEnding"),L}function L(Y){return k.enter("codeFencedFence"),te(Y)?oe(k,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):z(Y)}function z(Y){return Y===a?(k.enter("codeFencedFenceSequence"),Q(Y)):D(Y)}function Q(Y){return Y===a?($++,k.consume(Y),Q):$>=o?(k.exit("codeFencedFenceSequence"),te(Y)?oe(k,ae,"whitespace")(Y):ae(Y)):D(Y)}function ae(Y){return Y===null||H(Y)?(k.exit("codeFencedFence"),M(Y)):D(Y)}}}function fP(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const wl={name:"codeIndented",tokenize:pP},hP={partial:!0,tokenize:mP};function pP(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),oe(e,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):H(u)?e.attempt(hP,o,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||H(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function mP(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):H(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):oe(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):H(o)?i(o):n(o)}}const gP={name:"codeText",previous:vP,resolve:yP,tokenize:xP};function yP(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 vP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function xP(e,t,n){let r=0,i,s;return o;function o(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(s=e.enter("codeTextSequence"),i=0,d(c)):H(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||H(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function d(c){return c===96?(e.consume(c),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(s.type="codeTextData",u(c))}}class wP{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 s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ci(this.left,r),s.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),Ci(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ci(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);Ci(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ci(this.left,n.reverse())}}}function Ci(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 iw(e){const t={};let n=-1,r,i,s,o,a,l,u;const d=new wP(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,SP(d,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=d.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},a=d.slice(i,n),a.unshift(r),d.splice(i,n-i+1,a))}}return mt(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function SP(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],u={};let d,c,f=-1,h=n,m=0,x=0;const E=[x];for(;h;){for(;e.get(++i)[1]!==h;);s.push(i),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),c&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(x=f+1,E.push(x),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):E.pop(),f=E.length;f--;){const y=a.slice(E[f],E[f+1]),v=s.pop();l.push([v,v+y.length-1]),e.splice(v,2,y)}for(l.reverse(),f=-1;++f<l.length;)u[m+l[f][0]]=m+l[f][1],m+=l[f][1]-l[f][0]-1;return u}const bP={resolve:_P,tokenize:CP},kP={partial:!0,tokenize:EP};function _P(e){return iw(e),e}function CP(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):H(a)?e.check(kP,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function EP(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),oe(e,s,"linePrefix")}function s(o){if(o===null||H(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function sw(e,t,n,r,i,s,o,a,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),f):y===null||y===32||y===41||ia(y)?n(y):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function f(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),f(y)):y===null||y===60||H(y)?n(y):(e.consume(y),y===92?m:h)}function m(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function x(y){return!d&&(y===null||y===41||he(y))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(y)):d<u&&y===40?(e.consume(y),d++,x):y===41?(e.consume(y),d--,x):y===null||y===32||y===40||ia(y)?n(y):(e.consume(y),y===92?E:x)}function E(y){return y===40||y===41||y===92?(e.consume(y),x):x(y)}}function ow(e,t,n,r,i,s){const o=this;let a=0,l;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(s),d}function d(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):h===93?(e.exit(s),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):H(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||H(h)||a++>999?(e.exit("chunkString"),d(h)):(e.consume(h),l||(l=!te(h)),h===92?f:c)}function f(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function aw(e,t,n,r,i,s){let o;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,l):n(f)}function l(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),u(f))}function u(f){return f===o?(e.exit(s),l(o)):f===null?n(f):H(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),oe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===o||f===null||H(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?c:d)}function c(f){return f===o||f===92?(e.consume(f),d):d(f)}}function qi(e,t){let n;return r;function r(i){return H(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):te(i)?oe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const TP={name:"definition",tokenize:RP},IP={partial:!0,tokenize:PP};function RP(e,t,n){const r=this;let i;return s;function s(h){return e.enter("definition"),o(h)}function o(h){return ow.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=Ft(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return he(h)?qi(e,u)(h):u(h)}function u(h){return sw(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(IP,c,c)(h)}function c(h){return te(h)?oe(e,f,"whitespace")(h):f(h)}function f(h){return h===null||H(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function PP(e,t,n){return r;function r(a){return he(a)?qi(e,i)(a):n(a)}function i(a){return aw(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return te(a)?oe(e,o,"whitespace")(a):o(a)}function o(a){return a===null||H(a)?t(a):n(a)}}const AP={name:"hardBreakEscape",tokenize:MP};function MP(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return H(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const NP={name:"headingAtx",resolve:jP,tokenize:DP};function jP(e,t){let n=e.length-2,r=3,i,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},mt(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function DP(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||he(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||H(d)?(e.exit("atxHeading"),t(d)):te(d)?oe(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||he(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}const OP=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],hp=["pre","script","style","textarea"],LP={concrete:!0,name:"htmlFlow",resolveTo:BP,tokenize:UP},zP={partial:!0,tokenize:VP},FP={partial:!0,tokenize:$P};function BP(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 UP(e,t,n){const r=this;let i,s,o,a,l;return u;function u(b){return d(b)}function d(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),c}function c(b){return b===33?(e.consume(b),f):b===47?(e.consume(b),s=!0,x):b===63?(e.consume(b),i=3,r.interrupt?t:S):Qe(b)?(e.consume(b),o=String.fromCharCode(b),E):n(b)}function f(b){return b===45?(e.consume(b),i=2,h):b===91?(e.consume(b),i=5,a=0,m):Qe(b)?(e.consume(b),i=4,r.interrupt?t:S):n(b)}function h(b){return b===45?(e.consume(b),r.interrupt?t:S):n(b)}function m(b){const Se="CDATA[";return b===Se.charCodeAt(a++)?(e.consume(b),a===Se.length?r.interrupt?t:z:m):n(b)}function x(b){return Qe(b)?(e.consume(b),o=String.fromCharCode(b),E):n(b)}function E(b){if(b===null||b===47||b===62||he(b)){const Se=b===47,Xe=o.toLowerCase();return!Se&&!s&&hp.includes(Xe)?(i=1,r.interrupt?t(b):z(b)):OP.includes(o.toLowerCase())?(i=6,Se?(e.consume(b),y):r.interrupt?t(b):z(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):s?v(b):w(b))}return b===45||Ve(b)?(e.consume(b),o+=String.fromCharCode(b),E):n(b)}function y(b){return b===62?(e.consume(b),r.interrupt?t:z):n(b)}function v(b){return te(b)?(e.consume(b),v):T(b)}function w(b){return b===47?(e.consume(b),T):b===58||b===95||Qe(b)?(e.consume(b),C):te(b)?(e.consume(b),w):T(b)}function C(b){return b===45||b===46||b===58||b===95||Ve(b)?(e.consume(b),C):I(b)}function I(b){return b===61?(e.consume(b),k):te(b)?(e.consume(b),I):w(b)}function k(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),l=b,M):te(b)?(e.consume(b),k):D(b)}function M(b){return b===l?(e.consume(b),l=null,$):b===null||H(b)?n(b):(e.consume(b),M)}function D(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||he(b)?I(b):(e.consume(b),D)}function $(b){return b===47||b===62||te(b)?w(b):n(b)}function T(b){return b===62?(e.consume(b),L):n(b)}function L(b){return b===null||H(b)?z(b):te(b)?(e.consume(b),L):n(b)}function z(b){return b===45&&i===2?(e.consume(b),W):b===60&&i===1?(e.consume(b),Z):b===62&&i===4?(e.consume(b),V):b===63&&i===3?(e.consume(b),S):b===93&&i===5?(e.consume(b),A):H(b)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(zP,q,Q)(b)):b===null||H(b)?(e.exit("htmlFlowData"),Q(b)):(e.consume(b),z)}function Q(b){return e.check(FP,ae,q)(b)}function ae(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Y}function Y(b){return b===null||H(b)?Q(b):(e.enter("htmlFlowData"),z(b))}function W(b){return b===45?(e.consume(b),S):z(b)}function Z(b){return b===47?(e.consume(b),o="",P):z(b)}function P(b){if(b===62){const Se=o.toLowerCase();return hp.includes(Se)?(e.consume(b),V):z(b)}return Qe(b)&&o.length<8?(e.consume(b),o+=String.fromCharCode(b),P):z(b)}function A(b){return b===93?(e.consume(b),S):z(b)}function S(b){return b===62?(e.consume(b),V):b===45&&i===2?(e.consume(b),S):z(b)}function V(b){return b===null||H(b)?(e.exit("htmlFlowData"),q(b)):(e.consume(b),V)}function q(b){return e.exit("htmlFlow"),t(b)}}function $P(e,t,n){const r=this;return i;function i(o){return H(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function VP(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Cs,t,n)}}const HP={name:"htmlText",tokenize:WP};function WP(e,t,n){const r=this;let i,s,o;return a;function a(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),l}function l(S){return S===33?(e.consume(S),u):S===47?(e.consume(S),I):S===63?(e.consume(S),w):Qe(S)?(e.consume(S),D):n(S)}function u(S){return S===45?(e.consume(S),d):S===91?(e.consume(S),s=0,m):Qe(S)?(e.consume(S),v):n(S)}function d(S){return S===45?(e.consume(S),h):n(S)}function c(S){return S===null?n(S):S===45?(e.consume(S),f):H(S)?(o=c,Z(S)):(e.consume(S),c)}function f(S){return S===45?(e.consume(S),h):c(S)}function h(S){return S===62?W(S):S===45?f(S):c(S)}function m(S){const V="CDATA[";return S===V.charCodeAt(s++)?(e.consume(S),s===V.length?x:m):n(S)}function x(S){return S===null?n(S):S===93?(e.consume(S),E):H(S)?(o=x,Z(S)):(e.consume(S),x)}function E(S){return S===93?(e.consume(S),y):x(S)}function y(S){return S===62?W(S):S===93?(e.consume(S),y):x(S)}function v(S){return S===null||S===62?W(S):H(S)?(o=v,Z(S)):(e.consume(S),v)}function w(S){return S===null?n(S):S===63?(e.consume(S),C):H(S)?(o=w,Z(S)):(e.consume(S),w)}function C(S){return S===62?W(S):w(S)}function I(S){return Qe(S)?(e.consume(S),k):n(S)}function k(S){return S===45||Ve(S)?(e.consume(S),k):M(S)}function M(S){return H(S)?(o=M,Z(S)):te(S)?(e.consume(S),M):W(S)}function D(S){return S===45||Ve(S)?(e.consume(S),D):S===47||S===62||he(S)?$(S):n(S)}function $(S){return S===47?(e.consume(S),W):S===58||S===95||Qe(S)?(e.consume(S),T):H(S)?(o=$,Z(S)):te(S)?(e.consume(S),$):W(S)}function T(S){return S===45||S===46||S===58||S===95||Ve(S)?(e.consume(S),T):L(S)}function L(S){return S===61?(e.consume(S),z):H(S)?(o=L,Z(S)):te(S)?(e.consume(S),L):$(S)}function z(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,Q):H(S)?(o=z,Z(S)):te(S)?(e.consume(S),z):(e.consume(S),ae)}function Q(S){return S===i?(e.consume(S),i=void 0,Y):S===null?n(S):H(S)?(o=Q,Z(S)):(e.consume(S),Q)}function ae(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||he(S)?$(S):(e.consume(S),ae)}function Y(S){return S===47||S===62||he(S)?$(S):n(S)}function W(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function Z(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),P}function P(S){return te(S)?oe(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):A(S)}function A(S){return e.enter("htmlTextData"),o(S)}}const Id={name:"labelEnd",resolveAll:GP,resolveTo:YP,tokenize:JP},qP={tokenize:XP},KP={tokenize:ZP},QP={tokenize:eA};function GP(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&&mt(e,0,e.length,n),e}function YP(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=kt(a,e.slice(s+1,s+r+3)),a=kt(a,[["enter",d,t]]),a=kt(a,Na(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=kt(a,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),a=kt(a,e.slice(o+1)),a=kt(a,[["exit",l,t]]),mt(e,s,e.length,a),e}function JP(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(f){return s?s._inactive?c(f):(o=r.parser.defined.includes(Ft(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(qP,d,o?d:c)(f):f===91?e.attempt(KP,d,o?u:c)(f):o?d(f):c(f)}function u(f){return e.attempt(QP,d,c)(f)}function d(f){return t(f)}function c(f){return s._balanced=!0,n(f)}}function XP(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return he(c)?qi(e,s)(c):s(c)}function s(c){return c===41?d(c):sw(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function o(c){return he(c)?qi(e,l)(c):d(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?aw(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):d(c)}function u(c){return he(c)?qi(e,d)(c):d(c)}function d(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function ZP(e,t,n){const r=this;return i;function i(a){return ow.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Ft(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function eA(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const tA={name:"labelStartImage",resolveAll:Id.resolveAll,tokenize:nA};function nA(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const rA={name:"labelStartLink",resolveAll:Id.resolveAll,tokenize:iA};function iA(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Sl={name:"lineEnding",tokenize:sA};function sA(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),oe(e,t,"linePrefix")}}const xo={name:"thematicBreak",tokenize:oA};function oA(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||H(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),te(u)?oe(e,a,"whitespace")(u):a(u))}}const tt={continuation:{tokenize:cA},exit:fA,name:"list",tokenize:uA},aA={partial:!0,tokenize:hA},lA={partial:!0,tokenize:dA};function uA(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Wu(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(xo,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return Wu(h)&&++o<10?(e.consume(h),l):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Cs,r.interrupt?n:d,e.attempt(aA,f,c))}function d(h){return r.containerState.initialBlankLine=!0,s++,f(h)}function c(h){return te(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function cA(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Cs,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,oe(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!te(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(lA,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,oe(e,e.attempt(tt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function dA(e,t,n){const r=this;return oe(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function fA(e){e.exit(this.containerState.type)}function hA(e,t,n){const r=this;return oe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!te(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const pp={name:"setextUnderline",resolveTo:pA,tokenize:mA};function pA(e,t){let n=e.length,r,i,s;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),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function mA(e,t,n){const r=this;let i;return s;function s(u){let d=r.events.length,c;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){c=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),te(u)?oe(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||H(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const gA={tokenize:yA};function yA(e){const t=this,n=e.attempt(Cs,r,e.attempt(this.parser.constructs.flowInitial,i,oe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bP,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const vA={resolveAll:uw()},xA=lw("string"),wA=lw("text");function lw(e){return{resolveAll:uw(e==="text"?SA:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(d){return u(d)?s(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const c=i[d];let f=-1;if(c)for(;++f<c.length;){const h=c[f];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function uw(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function SA(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 s=i.length,o=-1,a=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)l=!0,a++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const bA={42:tt,43:tt,45:tt,48:tt,49:tt,50:tt,51:tt,52:tt,53:tt,54:tt,55:tt,56:tt,57:tt,62:tw},kA={91:TP},_A={[-2]:wl,[-1]:wl,32:wl},CA={35:NP,42:xo,45:[pp,xo],60:LP,61:pp,95:xo,96:fp,126:fp},EA={38:rw,92:nw},TA={[-5]:Sl,[-4]:Sl,[-3]:Sl,33:tA,38:rw,42:qu,60:[rP,HP],91:rA,92:[AP,nw],93:Id,95:qu,96:gP},IA={null:[qu,vA]},RA={null:[42,95]},PA={null:[]},AA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:RA,contentInitial:kA,disable:PA,document:bA,flow:CA,flowInitial:_A,insideSpan:IA,string:EA,text:TA},Symbol.toStringTag,{value:"Module"}));function MA(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={},s=[];let o=[],a=[];const l={attempt:M(I),check:M(k),consume:v,enter:w,exit:C,interrupt:M(k,{interrupt:!0})},u={code:null,containerState:{},defineSkip:x,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:h,write:c};let d=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function c(L){return o=kt(o,L),E(),o[o.length-1]!==null?[]:(D(t,0),u.events=Na(s,u.events,u),u.events)}function f(L,z){return jA(h(L),z)}function h(L){return NA(o,L)}function m(){const{_bufferIndex:L,_index:z,line:Q,column:ae,offset:Y}=r;return{_bufferIndex:L,_index:z,line:Q,column:ae,offset:Y}}function x(L){i[L.line]=L.column,T()}function E(){let L;for(;r._index<o.length;){const z=o[r._index];if(typeof z=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<z.length;)y(z.charCodeAt(r._bufferIndex));else y(z)}}function y(L){d=d(L)}function v(L){H(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,T()):L!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=L}function w(L,z){const Q=z||{};return Q.type=L,Q.start=m(),u.events.push(["enter",Q,u]),a.push(Q),Q}function C(L){const z=a.pop();return z.end=m(),u.events.push(["exit",z,u]),z}function I(L,z){D(L,z.from)}function k(L,z){z.restore()}function M(L,z){return Q;function Q(ae,Y,W){let Z,P,A,S;return Array.isArray(ae)?q(ae):"tokenize"in ae?q([ae]):V(ae);function V(ce){return Ze;function Ze(wt){const yn=wt!==null&&ce[wt],vn=wt!==null&&ce.null,qn=[...Array.isArray(yn)?yn:yn?[yn]:[],...Array.isArray(vn)?vn:vn?[vn]:[]];return q(qn)(wt)}}function q(ce){return Z=ce,P=0,ce.length===0?W:b(ce[P])}function b(ce){return Ze;function Ze(wt){return S=$(),A=ce,ce.partial||(u.currentConstruct=ce),ce.name&&u.parser.constructs.disable.null.includes(ce.name)?Xe():ce.tokenize.call(z?Object.assign(Object.create(u),z):u,l,Se,Xe)(wt)}}function Se(ce){return L(A,S),Y}function Xe(ce){return S.restore(),++P<Z.length?b(Z[P]):W}}}function D(L,z){L.resolveAll&&!s.includes(L)&&s.push(L),L.resolve&&mt(u.events,z,u.events.length-z,L.resolve(u.events.slice(z),u)),L.resolveTo&&(u.events=L.resolveTo(u.events,u))}function $(){const L=m(),z=u.previous,Q=u.currentConstruct,ae=u.events.length,Y=Array.from(a);return{from:ae,restore:W};function W(){r=L,u.previous=z,u.currentConstruct=Q,u.events.length=ae,a=Y,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function NA(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function jA(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
50
|
-
`;break}case-3:{o=`\r
|
|
51
|
-
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function DA(e){const r={constructs:Zx([AA,...(e||{}).extensions||[]]),content:i(YR),defined:[],document:i(XR),flow:i(gA),lazy:{},string:i(xA),text:i(wA)};return r;function i(s){return o;function o(a){return MA(r,s,a)}}}function OA(e){for(;!iw(e););return e}const mp=/[\0\t\n\r]/g;function LA(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let u,d,c,f,h;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),c=0,t="",n&&(s.charCodeAt(0)===65279&&c++,n=void 0);c<s.length;){if(mp.lastIndex=c,u=mp.exec(s),f=u&&u.index!==void 0?u.index:s.length,h=s.charCodeAt(f),!u){t=s.slice(c);break}if(h===10&&c===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<f&&(l.push(s.slice(c,f)),e+=f-c),h){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=f+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const zA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function FA(e){return e.replace(zA,BA)}function BA(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return ew(n.slice(s?2:1),s?16:10)}return Td(n)||e}const cw={}.hasOwnProperty;function UA(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),$A(n)(OA(DA(n).document().write(LA()(e,t,!0))))}function $A(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Rt),autolinkProtocol:$,autolinkEmail:$,atxHeading:s(ee),blockQuote:s(vn),characterEscape:$,characterReference:$,codeFenced:s(qn),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(qn,o),codeText:s(Ae,o),codeTextData:$,data:$,codeFlowValue:$,definition:s(B),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(J),hardBreakEscape:s(ke),hardBreakTrailing:s(ke),htmlFlow:s($t,o),htmlFlowData:$,htmlText:s($t,o),htmlTextData:$,image:s(et),label:o,link:s(Rt),listItem:s(Is),listItemValue:f,listOrdered:s(Ts,c),listUnordered:s(Ts),paragraph:s(Rs),reference:b,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(ee),strong:s(Yw),thematicBreak:s(Xw)},exit:{atxHeading:l(),atxHeadingSequence:I,autolink:l(),autolinkEmail:yn,autolinkProtocol:wt,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:Xe,characterReferenceMarkerNumeric:Xe,characterReferenceValue:ce,characterReference:Ze,codeFenced:l(E),codeFencedFence:x,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(y),codeText:l(Y),codeTextData:T,data:T,definition:l(),definitionDestinationString:C,definitionLabelString:v,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(z),hardBreakTrailing:l(z),htmlFlow:l(Q),htmlFlowData:T,htmlText:l(ae),htmlTextData:T,image:l(Z),label:A,labelText:P,lineEnding:L,link:l(W),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Se,resourceDestinationString:S,resourceTitleString:V,resource:q,setextHeading:l(D),setextHeadingLineSequence:M,setextHeadingText:k,strong:l(),thematicBreak:l()}};dw(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(R){let O={type:"root",children:[]};const G={stack:[O],tokenStack:[],config:t,enter:a,exit:u,buffer:o,resume:d,data:n},ie=[];let de=-1;for(;++de<R.length;)if(R[de][1].type==="listOrdered"||R[de][1].type==="listUnordered")if(R[de][0]==="enter")ie.push(de);else{const Pt=ie.pop();de=i(R,Pt,de)}for(de=-1;++de<R.length;){const Pt=t[R[de][0]];cw.call(Pt,R[de][1].type)&&Pt[R[de][1].type].call(Object.assign({sliceSerialize:R[de][2].sliceSerialize},G),R[de][1])}if(G.tokenStack.length>0){const Pt=G.tokenStack[G.tokenStack.length-1];(Pt[1]||gp).call(G,void 0,Pt[0])}for(O.position={start:wn(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:wn(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},de=-1;++de<t.transforms.length;)O=t.transforms[de](O)||O;return O}function i(R,O,G){let ie=O-1,de=-1,Pt=!1,Kn,tn,pi,mi;for(;++ie<=G;){const ct=R[ie];switch(ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ct[0]==="enter"?de++:de--,mi=void 0;break}case"lineEndingBlank":{ct[0]==="enter"&&(Kn&&!mi&&!de&&!pi&&(pi=ie),mi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:mi=void 0}if(!de&&ct[0]==="enter"&&ct[1].type==="listItemPrefix"||de===-1&&ct[0]==="exit"&&(ct[1].type==="listUnordered"||ct[1].type==="listOrdered")){if(Kn){let br=ie;for(tn=void 0;br--;){const nn=R[br];if(nn[1].type==="lineEnding"||nn[1].type==="lineEndingBlank"){if(nn[0]==="exit")continue;tn&&(R[tn][1].type="lineEndingBlank",Pt=!0),nn[1].type="lineEnding",tn=br}else if(!(nn[1].type==="linePrefix"||nn[1].type==="blockQuotePrefix"||nn[1].type==="blockQuotePrefixWhitespace"||nn[1].type==="blockQuoteMarker"||nn[1].type==="listItemIndent"))break}pi&&(!tn||pi<tn)&&(Kn._spread=!0),Kn.end=Object.assign({},tn?R[tn][1].start:ct[1].end),R.splice(tn||ie,0,["exit",Kn,ct[2]]),ie++,G++}if(ct[1].type==="listItemPrefix"){const br={type:"listItem",_spread:!1,start:Object.assign({},ct[1].start),end:void 0};Kn=br,R.splice(ie,0,["enter",br,ct[2]]),ie++,G++,pi=void 0,mi=!0}}}return R[O][1]._spread=Pt,G}function s(R,O){return G;function G(ie){a.call(this,R(ie),ie),O&&O.call(this,ie)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(R,O,G){this.stack[this.stack.length-1].children.push(R),this.stack.push(R),this.tokenStack.push([O,G||void 0]),R.position={start:wn(O.start),end:void 0}}function l(R){return O;function O(G){R&&R.call(this,G),u.call(this,G)}}function u(R,O){const G=this.stack.pop(),ie=this.tokenStack.pop();if(ie)ie[0].type!==R.type&&(O?O.call(this,R,ie[0]):(ie[1]||gp).call(this,R,ie[0]));else throw new Error("Cannot close `"+R.type+"` ("+Wi({start:R.start,end:R.end})+"): it’s not open");G.position.end=wn(R.end)}function d(){return Ed(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function f(R){if(this.data.expectingFirstListItemValue){const O=this.stack[this.stack.length-2];O.start=Number.parseInt(this.sliceSerialize(R),10),this.data.expectingFirstListItemValue=void 0}}function h(){const R=this.resume(),O=this.stack[this.stack.length-1];O.lang=R}function m(){const R=this.resume(),O=this.stack[this.stack.length-1];O.meta=R}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const R=this.resume(),O=this.stack[this.stack.length-1];O.value=R.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const R=this.resume(),O=this.stack[this.stack.length-1];O.value=R.replace(/(\r?\n|\r)$/g,"")}function v(R){const O=this.resume(),G=this.stack[this.stack.length-1];G.label=O,G.identifier=Ft(this.sliceSerialize(R)).toLowerCase()}function w(){const R=this.resume(),O=this.stack[this.stack.length-1];O.title=R}function C(){const R=this.resume(),O=this.stack[this.stack.length-1];O.url=R}function I(R){const O=this.stack[this.stack.length-1];if(!O.depth){const G=this.sliceSerialize(R).length;O.depth=G}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function M(R){const O=this.stack[this.stack.length-1];O.depth=this.sliceSerialize(R).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function $(R){const G=this.stack[this.stack.length-1].children;let ie=G[G.length-1];(!ie||ie.type!=="text")&&(ie=Jw(),ie.position={start:wn(R.start),end:void 0},G.push(ie)),this.stack.push(ie)}function T(R){const O=this.stack.pop();O.value+=this.sliceSerialize(R),O.position.end=wn(R.end)}function L(R){const O=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=O.children[O.children.length-1];G.position.end=wn(R.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(O.type)&&($.call(this,R),T.call(this,R))}function z(){this.data.atHardBreak=!0}function Q(){const R=this.resume(),O=this.stack[this.stack.length-1];O.value=R}function ae(){const R=this.resume(),O=this.stack[this.stack.length-1];O.value=R}function Y(){const R=this.resume(),O=this.stack[this.stack.length-1];O.value=R}function W(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const O=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=O,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function Z(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const O=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=O,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function P(R){const O=this.sliceSerialize(R),G=this.stack[this.stack.length-2];G.label=FA(O),G.identifier=Ft(O).toLowerCase()}function A(){const R=this.stack[this.stack.length-1],O=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const ie=R.children;G.children=ie}else G.alt=O}function S(){const R=this.resume(),O=this.stack[this.stack.length-1];O.url=R}function V(){const R=this.resume(),O=this.stack[this.stack.length-1];O.title=R}function q(){this.data.inReference=void 0}function b(){this.data.referenceType="collapsed"}function Se(R){const O=this.resume(),G=this.stack[this.stack.length-1];G.label=O,G.identifier=Ft(this.sliceSerialize(R)).toLowerCase(),this.data.referenceType="full"}function Xe(R){this.data.characterReferenceType=R.type}function ce(R){const O=this.sliceSerialize(R),G=this.data.characterReferenceType;let ie;G?(ie=ew(O,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ie=Td(O);const de=this.stack[this.stack.length-1];de.value+=ie}function Ze(R){const O=this.stack.pop();O.position.end=wn(R.end)}function wt(R){T.call(this,R);const O=this.stack[this.stack.length-1];O.url=this.sliceSerialize(R)}function yn(R){T.call(this,R);const O=this.stack[this.stack.length-1];O.url="mailto:"+this.sliceSerialize(R)}function vn(){return{type:"blockquote",children:[]}}function qn(){return{type:"code",lang:null,meta:null,value:""}}function Ae(){return{type:"inlineCode",value:""}}function B(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function J(){return{type:"emphasis",children:[]}}function ee(){return{type:"heading",depth:0,children:[]}}function ke(){return{type:"break"}}function $t(){return{type:"html",value:""}}function et(){return{type:"image",title:null,url:"",alt:null}}function Rt(){return{type:"link",title:null,url:"",children:[]}}function Ts(R){return{type:"list",ordered:R.type==="listOrdered",start:null,spread:R._spread,children:[]}}function Is(R){return{type:"listItem",spread:R._spread,checked:null,children:[]}}function Rs(){return{type:"paragraph",children:[]}}function Yw(){return{type:"strong",children:[]}}function Jw(){return{type:"text",value:""}}function Xw(){return{type:"thematicBreak"}}}function wn(e){return{line:e.line,column:e.column,offset:e.offset}}function dw(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?dw(e,r):VA(e,r)}}function VA(e,t){let n;for(n in t)if(cw.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 gp(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is still open")}function HA(e){const t=this;t.parser=n;function n(r){return UA(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function WA(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 qA(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
52
|
-
`}]}function KA(e,t){const n=t.value?t.value+`
|
|
53
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function QA(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GA(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YA(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=hi(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function JA(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 XA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function fw(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),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function ZA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fw(e,t);const i={src:hi(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function eM(e,t){const n={src:hi(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 tM(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 nM(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fw(e,t);const i={href:hi(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function rM(e,t){const n={href:hi(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 iM(e,t,n){const r=e.all(t),i=n?sM(n):hw(t),s={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let c;d&&d.type==="element"&&d.tagName==="p"?c=d:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const d=r[a];(i||a!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
|
|
54
|
-
`}),d.type==="element"&&d.tagName==="p"&&!i?o.push(...d.children):o.push(d)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
|
|
55
|
-
`});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function sM(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=hw(n[r])}return t}function hw(e){const t=e.spread;return t??e.children.length>1}function oM(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 o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function aM(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lM(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function uM(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cM(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=bd(t.children[1]),l=qx(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function dM(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const c=t.children[l],f={},h=o?o[l]:void 0;h&&(f.align=h);let m={type:"element",tagName:s,properties:f,children:[]};c&&(m.children=e.all(c),e.patch(c,m),m=e.applyData(c,m)),u.push(m)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function fM(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const yp=9,vp=32;function hM(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(xp(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(xp(t.slice(i),i>0,!1)),s.join("")}function xp(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===yp||s===vp;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===yp||s===vp;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function pM(e,t){const n={type:"text",value:hM(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function mM(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const gM={blockquote:WA,break:qA,code:KA,delete:QA,emphasis:GA,footnoteReference:YA,heading:JA,html:XA,imageReference:ZA,image:eM,inlineCode:tM,linkReference:nM,link:rM,listItem:iM,list:oM,paragraph:aM,root:lM,strong:uM,table:cM,tableCell:fM,tableRow:dM,text:pM,thematicBreak:mM,toml:Zs,yaml:Zs,definition:Zs,footnoteDefinition:Zs};function Zs(){}const pw=-1,ja=0,Ki=1,sa=2,Rd=3,Pd=4,Ad=5,Md=6,mw=7,gw=8,yM=typeof self=="object"?self:globalThis,wp=(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 yM[e](t)},vM=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case ja:case pw:return n(o,i);case Ki:{const a=n([],i);for(const l of o)a.push(r(l));return a}case sa:{const a=n({},i);for(const[l,u]of o)a[r(l)]=r(u);return a}case Rd:return n(new Date(o),i);case Pd:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case Ad:{const a=n(new Map,i);for(const[l,u]of o)a.set(r(l),r(u));return a}case Md:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case mw:{const{name:a,message:l}=o;return n(wp(a,l),i)}case gw:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(wp(s,o),i)};return r},Sp=e=>vM(new Map,e)(0),_r="",{toString:xM}={},{keys:wM}=Object,Ei=e=>{const t=typeof e;if(t!=="object"||!e)return[ja,t];const n=xM.call(e).slice(8,-1);switch(n){case"Array":return[Ki,_r];case"Object":return[sa,_r];case"Date":return[Rd,_r];case"RegExp":return[Pd,_r];case"Map":return[Ad,_r];case"Set":return[Md,_r];case"DataView":return[Ki,n]}return n.includes("Array")?[Ki,n]:n.includes("Error")?[mw,n]:[sa,n]},eo=([e,t])=>e===ja&&(t==="function"||t==="symbol"),SM=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=Ei(o);switch(a){case ja:{let d=o;switch(l){case"bigint":a=gw,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return i([pw],o)}return i([a,d],o)}case Ki:{if(l){let f=o;return l==="DataView"?f=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(o)),i([l,[...f]],o)}const d=[],c=i([a,d],o);for(const f of o)d.push(s(f));return c}case sa:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],c=i([a,d],o);for(const f of wM(o))(e||!eo(Ei(o[f])))&&d.push([s(f),s(o[f])]);return c}case Rd:return i([a,o.toISOString()],o);case Pd:{const{source:d,flags:c}=o;return i([a,{source:d,flags:c}],o)}case Ad:{const d=[],c=i([a,d],o);for(const[f,h]of o)(e||!(eo(Ei(f))||eo(Ei(h))))&&d.push([s(f),s(h)]);return c}case Md:{const d=[],c=i([a,d],o);for(const f of o)(e||!eo(Ei(f)))&&d.push(s(f));return c}}const{message:u}=o;return i([a,{name:l,message:u}],o)};return s},bp=(e,{json:t,lossy:n}={})=>{const r=[];return SM(!(t||n),!!t,new Map,r)(e),r},oa=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Sp(bp(e,t)):structuredClone(e):(e,t)=>Sp(bp(e,t));function bM(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 kM(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function _M(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||bM,r=e.options.footnoteBackLabel||kM,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const d=e.all(u),c=String(u.identifier).toUpperCase(),f=hi(c.toLowerCase());let h=0;const m=[],x=e.footnoteCounts.get(c);for(;x!==void 0&&++h<=x;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,h);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const E=d[d.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const v=E.children[E.children.length-1];v&&v.type==="text"?v.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...m)}else d.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(d,!0)};e.patch(u,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...oa(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
56
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
57
|
-
`}]}}const Da=function(e){if(e==null)return IM;if(typeof e=="function")return Oa(e);if(typeof e=="object")return Array.isArray(e)?CM(e):EM(e);if(typeof e=="string")return TM(e);throw new Error("Expected function, string, or object as test")};function CM(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Da(e[n]);return Oa(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function EM(e){const t=e;return Oa(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function TM(e){return Oa(t);function t(n){return n&&n.type===e}}function Oa(e){return t;function t(n,r,i){return!!(RM(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function IM(){return!0}function RM(e){return e!==null&&typeof e=="object"&&"type"in e}const yw=[],PM=!0,Ku=!1,AM="skip";function vw(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Da(i),o=r?-1:1;a(e,void 0,[])();function a(l,u,d){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const h=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return f;function f(){let h=yw,m,x,E;if((!t||s(l,u,d[d.length-1]||void 0))&&(h=MM(n(l,d)),h[0]===Ku))return h;if("children"in l&&l.children){const y=l;if(y.children&&h[0]!==AM)for(x=(r?y.children.length:-1)+o,E=d.concat(y);x>-1&&x<y.children.length;){const v=y.children[x];if(m=a(v,x,E)(),m[0]===Ku)return m;x=typeof m[1]=="number"?m[1]:x+o}}return h}}}function MM(e){return Array.isArray(e)?e:typeof e=="number"?[PM,e]:e==null?yw:[e]}function Nd(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),vw(e,s,a,i);function a(l,u){const d=u[u.length-1],c=d?d.children.indexOf(l):void 0;return o(l,c,d)}}const Qu={}.hasOwnProperty,NM={};function jM(e,t){const n=t||NM,r=new Map,i=new Map,s=new Map,o={...gM,...n.handlers},a={all:u,applyData:OM,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:DM,wrap:zM};return Nd(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const c=d.type==="definition"?r:i,f=String(d.identifier).toUpperCase();c.has(f)||c.set(f,d)}}),a;function l(d,c){const f=d.type,h=a.handlers[f];if(Qu.call(a.handlers,f)&&h)return h(a,d,c);if(a.options.passThrough&&a.options.passThrough.includes(f)){if("children"in d){const{children:x,...E}=d,y=oa(E);return y.children=a.all(d),y}return oa(d)}return(a.options.unknownHandler||LM)(a,d,c)}function u(d){const c=[];if("children"in d){const f=d.children;let h=-1;for(;++h<f.length;){const m=a.one(f[h],d);if(m){if(h&&f[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=kp(m.value)),!Array.isArray(m)&&m.type==="element")){const x=m.children[0];x&&x.type==="text"&&(x.value=kp(x.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function DM(e,t){e.position&&(t.position=bR(e))}function OM(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,oa(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function LM(e,t){const n=t.data||{},r="value"in t&&!(Qu.call(n,"hProperties")||Qu.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 zM(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
58
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
59
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
60
|
-
`}),n}function kp(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _p(e,t){const n=jM(e,t),r=n.one(e,void 0),i=_M(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
61
|
-
`},i),s}function FM(e,t){return e&&"run"in e?async function(n,r){const i=_p(n,{file:r,...t});await e.run(i,r)}:function(n,r){return _p(n,{file:r,...e||t})}}function Cp(e){if(e)throw e}var wo=Object.prototype.hasOwnProperty,xw=Object.prototype.toString,Ep=Object.defineProperty,Tp=Object.getOwnPropertyDescriptor,Ip=function(t){return typeof Array.isArray=="function"?Array.isArray(t):xw.call(t)==="[object Array]"},Rp=function(t){if(!t||xw.call(t)!=="[object Object]")return!1;var n=wo.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&wo.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||wo.call(t,i)},Pp=function(t,n){Ep&&n.name==="__proto__"?Ep(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ap=function(t,n){if(n==="__proto__")if(wo.call(t,n)){if(Tp)return Tp(t,n).value}else return;return t[n]},BM=function e(){var t,n,r,i,s,o,a=arguments[0],l=1,u=arguments.length,d=!1;for(typeof a=="boolean"&&(d=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=Ap(a,n),i=Ap(t,n),a!==i&&(d&&i&&(Rp(i)||(s=Ip(i)))?(s?(s=!1,o=r&&Ip(r)?r:[]):o=r&&Rp(r)?r:{},Pp(a,{name:n,newValue:e(d,o,i)})):typeof i<"u"&&Pp(a,{name:n,newValue:i}));return a};const bl=ys(BM);function Gu(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 UM(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...u){const d=e[++s];let c=-1;if(l){o(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,d?$M(d,a)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function $M(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(u){const d=u;if(a&&n)throw d;return i(d)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const qt={basename:VM,dirname:HM,extname:WM,join:qM,sep:"/"};function VM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Es(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function HM(e){if(Es(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 WM(e){Es(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function qM(...e){let t=-1,n;for(;++t<e.length;)Es(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":KM(n)}function KM(e){Es(e);const t=e.codePointAt(0)===47;let n=QM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function QM(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function Es(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const GM={cwd:YM};function YM(){return"/"}function Yu(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function JM(e){if(typeof e=="string")e=new URL(e);else if(!Yu(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 XM(e)}function XM(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 kl=["history","path","basename","stem","extname","dirname"];class ww{constructor(t){let n;t?Yu(t)?n={path:t}:typeof t=="string"||ZM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":GM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<kl.length;){const s=kl[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)kl.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?qt.basename(this.path):void 0}set basename(t){Cl(t,"basename"),_l(t,"basename"),this.path=qt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?qt.dirname(this.path):void 0}set dirname(t){Mp(this.basename,"dirname"),this.path=qt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?qt.extname(this.path):void 0}set extname(t){if(_l(t,"extname"),Mp(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=qt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Yu(t)&&(t=JM(t)),Cl(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?qt.basename(this.path,this.extname):void 0}set stem(t){Cl(t,"stem"),_l(t,"stem"),this.path=qt.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 We(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 _l(e,t){if(e&&e.includes(qt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+qt.sep+"`")}function Cl(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Mp(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ZM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eN=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},tN={}.hasOwnProperty;class jd extends eN{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=UM()}copy(){const t=new jd;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(bl(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Il("data",this.frozen),this.namespace[t]=n,this):tN.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Il("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=to(t),r=this.parser||this.Parser;return El("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),El("process",this.parser||this.Parser),Tl("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=to(t),l=r.parse(a);r.run(l,a,function(d,c,f){if(d||!c||!f)return u(d);const h=c,m=r.stringify(h,f);iN(m)?f.value=m:f.result=m,u(d,f)});function u(d,c){d||!c?o(d):s?s(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),El("processSync",this.parser||this.Parser),Tl("processSync",this.compiler||this.Compiler),this.process(t,i),jp("processSync","process",n),r;function i(s,o){n=!0,Cp(s),r=o}}run(t,n,r){Np(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=to(n);i.run(t,l,u);function u(d,c,f){const h=c||t;d?a(d):o?o(h):r(void 0,h,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),jp("runSync","run",r),i;function s(o,a){Cp(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=to(n),i=this.compiler||this.Compiler;return Tl("stringify",i),Np(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Il("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...c]=u;l(d,c)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))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");a(u.plugins),u.settings&&(i.settings=bl(!0,i.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const c=u[d];s(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let c=-1,f=-1;for(;++c<r.length;)if(r[c][0]===u){f=c;break}if(f===-1)r.push([u,...d]);else if(d.length>0){let[h,...m]=d;const x=r[f][1];Gu(x)&&Gu(h)&&(h=bl(!0,x,h)),r[f]=[u,h,...m]}}}}const nN=new jd().freeze();function El(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Tl(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Il(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 Np(e){if(!Gu(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function jp(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function to(e){return rN(e)?e:new ww(e)}function rN(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function iN(e){return typeof e=="string"||sN(e)}function sN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Dp=[],Op={allowDangerousHtml:!0},aN=/^(https?|ircs?|mailto|xmpp)$/i,lN=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function uN(e){const t=cN(e),n=dN(e);return fN(t.runSync(t.parse(n),n),e)}function cN(e){const t=e.rehypePlugins||Dp,n=e.remarkPlugins||Dp,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Op}:Op;return nN().use(HA).use(n).use(FM,r).use(t)}function dN(e){const t=e.children||"",n=new ww;return typeof t=="string"&&(n.value=t),n}function fN(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||hN;for(const d of lN)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+oN+d.id,void 0);return Nd(e,u),TR(e,{Fragment:p.Fragment,components:i,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function u(d,c,f){if(d.type==="raw"&&f&&typeof c=="number")return o?f.children.splice(c,1):f.children[c]={type:"text",value:d.value},c;if(d.type==="element"){let h;for(h in xl)if(Object.hasOwn(xl,h)&&Object.hasOwn(d.properties,h)){const m=d.properties[h],x=xl[h];(x===null||x.includes(d.tagName))&&(d.properties[h]=l(String(m||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(d,c,f)),h&&f&&typeof c=="number")return a&&d.children?f.children.splice(c,1,...d.children):f.children.splice(c,1),c}}}function hN(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||aN.test(e.slice(0,t))?e:""}const{useSmooth:pN,useSmoothStatus:mN,withSmoothContextProvider:gN}=ET,yN=({components:e,componentsByLanguage:t,smooth:n=!0,preprocess:r,...i})=>{const s=px(),{text:o}=pN(g.useMemo(()=>r?{...s,text:r(s.text)}:s,[s,r]),n),{pre:a=kI,code:l=_I,SyntaxHighlighter:u=vd,CodeHeader:d=CI}=e??{},c=g.useMemo(()=>({Pre:a,Code:l,SyntaxHighlighter:u,CodeHeader:d}),[a,l,u,d]),f=fr(h=>p.jsx(PI,{components:c,componentsByLanguage:t,...h}));return p.jsx(uN,{components:g.useMemo(()=>{const{pre:h,code:m,SyntaxHighlighter:x,CodeHeader:E,...y}=e??{};return{...y,pre:bI,code:f}},[f,e]),...i,children:o})},Sw=g.forwardRef(({className:e,containerProps:t,containerComponent:n="div",...r},i)=>p.jsx(n,{"data-status":mN().type,...t,className:zx(e,t?.className),ref:i,children:p.jsx(yN,{...r})}));Sw.displayName="MarkdownTextPrimitive";const vN=gN(Sw);function Lp(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 xN(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wN(e,t,n){const i=Da((n||{}).ignore||[]),s=SN(t);let o=-1;for(;++o<s.length;)vw(e,"text",a);function a(u,d){let c=-1,f;for(;++c<d.length;){const h=d[c],m=f?f.children:void 0;if(i(h,m?m.indexOf(h):void 0,f))return;f=h}if(f)return l(u,d)}function l(u,d){const c=d[d.length-1],f=s[o][0],h=s[o][1];let m=0;const E=c.children.indexOf(u);let y=!1,v=[];f.lastIndex=0;let w=f.exec(u.value);for(;w;){const C=w.index,I={index:w.index,input:w.input,stack:[...d,u]};let k=h(...w,I);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?f.lastIndex=C+1:(m!==C&&v.push({type:"text",value:u.value.slice(m,C)}),Array.isArray(k)?v.push(...k):k&&v.push(k),m=C+w[0].length,y=!0),!f.global)break;w=f.exec(u.value)}return y?(m<u.value.length&&v.push({type:"text",value:u.value.slice(m)}),c.children.splice(E,1,...v)):v=[u],E+v.length}}function SN(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([bN(i[0]),kN(i[1])])}return t}function bN(e){return typeof e=="string"?new RegExp(xN(e),"g"):e}function kN(e){return typeof e=="function"?e:function(){return e}}const Rl="phrasing",Pl=["autolink","link","image","label"];function _N(){return{transforms:[AN],enter:{literalAutolink:EN,literalAutolinkEmail:Al,literalAutolinkHttp:Al,literalAutolinkWww:Al},exit:{literalAutolink:PN,literalAutolinkEmail:RN,literalAutolinkHttp:TN,literalAutolinkWww:IN}}}function CN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Rl,notInConstruct:Pl},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Rl,notInConstruct:Pl},{character:":",before:"[ps]",after:"\\/",inConstruct:Rl,notInConstruct:Pl}]}}function EN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Al(e){this.config.enter.autolinkProtocol.call(this,e)}function TN(e){this.config.exit.autolinkProtocol.call(this,e)}function IN(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 RN(e){this.config.exit.autolinkEmail.call(this,e)}function PN(e){this.exit(e)}function AN(e){wN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,MN],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,NN]],{ignore:["link","linkReference"]})}function MN(e,t,n,r,i){let s="";if(!bw(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!jN(n)))return!1;const o=DN(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function NN(e,t,n,r){return!bw(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function jN(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 DN(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=Lp(e,"(");let s=Lp(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function bw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||hr(n)||Ma(n))&&(!t||n!==47)}kw.peek=HN;function ON(){this.buffer()}function LN(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function zN(){this.buffer()}function FN(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function BN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ft(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UN(e){this.exit(e)}function $N(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ft(this.sliceSerialize(e)).toLowerCase(),n.label=t}function VN(e){this.exit(e)}function HN(){return"["}function kw(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function WN(){return{enter:{gfmFootnoteCallString:ON,gfmFootnoteCall:LN,gfmFootnoteDefinitionLabelString:zN,gfmFootnoteDefinition:FN},exit:{gfmFootnoteCallString:BN,gfmFootnoteCall:UN,gfmFootnoteDefinitionLabelString:$N,gfmFootnoteDefinition:VN}}}function qN(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),d(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
|
|
62
|
-
`:" ")+s.indentLines(s.containerFlow(r,a.current()),t?_w:KN))),u(),l}}function KN(e,t,n){return t===0?e:_w(e,t,n)}function _w(e,t,n){return(n?"":" ")+e}const QN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Cw.peek=ZN;function GN(){return{canContainEols:["delete"],enter:{strikethrough:JN},exit:{strikethrough:XN}}}function YN(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:QN}],handlers:{delete:Cw}}}function JN(e){this.enter({type:"delete",children:[]},e)}function XN(e){this.exit(e)}function Cw(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function ZN(){return"~"}function ej(e){return e.length}function tj(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ej,s=[],o=[],a=[],l=[];let u=0,d=-1;for(;++d<e.length;){const x=[],E=[];let y=-1;for(e[d].length>u&&(u=e[d].length);++y<e[d].length;){const v=nj(e[d][y]);if(n.alignDelimiters!==!1){const w=i(v);E[y]=w,(l[y]===void 0||w>l[y])&&(l[y]=w)}x.push(v)}o[d]=x,a[d]=E}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)s[c]=zp(r[c]);else{const x=zp(r);for(;++c<u;)s[c]=x}c=-1;const f=[],h=[];for(;++c<u;){const x=s[c];let E="",y="";x===99?(E=":",y=":"):x===108?E=":":x===114&&(y=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[c]-E.length-y.length);const w=E+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=E.length+v+y.length,v>l[c]&&(l[c]=v),h[c]=v),f[c]=w}o.splice(1,0,f),a.splice(1,0,h),d=-1;const m=[];for(;++d<o.length;){const x=o[d],E=a[d];c=-1;const y=[];for(;++c<u;){const v=x[c]||"";let w="",C="";if(n.alignDelimiters!==!1){const I=l[c]-(E[c]||0),k=s[c];k===114?w=" ".repeat(I):k===99?I%2?(w=" ".repeat(I/2+.5),C=" ".repeat(I/2-.5)):(w=" ".repeat(I/2),C=w):C=" ".repeat(I)}n.delimiterStart!==!1&&!c&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||c)&&y.push(" "),n.alignDelimiters!==!1&&y.push(w),y.push(v),n.alignDelimiters!==!1&&y.push(C),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&y.push("|")}m.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return m.join(`
|
|
63
|
-
`)}function nj(e){return e==null?"":String(e)}function zp(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 rj(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),ij);return i(),o}function ij(e,t,n){return">"+(n?"":" ")+e}function sj(e,t){return Fp(e,t.inConstruct,!0)&&!Fp(e,t.notInConstruct,!1)}function Fp(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 Bp(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
64
|
-
`&&sj(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
65
|
-
`}function oj(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function aj(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 lj(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 uj(e,t,n,r){const i=lj(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(aj(e,n)){const c=n.enter("codeIndented"),f=n.indentLines(s,cj);return c(),f}const a=n.createTracker(r),l=i.repeat(Math.max(oj(s,i)+1,3)),u=n.enter("codeFenced");let d=a.move(l);if(e.lang){const c=n.enter(`codeFencedLang${o}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${o}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:`
|
|
66
|
-
`,encode:["`"],...a.current()})),c()}return d+=a.move(`
|
|
67
|
-
`),s&&(d+=a.move(s+`
|
|
68
|
-
`)),d+=a.move(l),u(),d}function cj(e,t,n){return(n?"":" ")+e}function Dd(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function dj(e,t,n,r){const i=Dd(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
69
|
-
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),o(),u}function fj(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 gs(e){return"&#x"+e.toString(16).toUpperCase()+";"}function aa(e,t,n){const r=ri(e),i=ri(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}}Ew.peek=hj;function Ew(e,t,n,r){const i=fj(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const u=l.charCodeAt(0),d=aa(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(l=gs(u)+l.slice(1));const c=l.charCodeAt(l.length-1),f=aa(r.after.charCodeAt(0),c,i);f.inside&&(l=l.slice(0,-1)+gs(c));const h=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},a+l+h}function hj(e,t,n){return n.options.emphasis||"*"}function pj(e,t){let n=!1;return Nd(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ku}),!!((!e.depth||e.depth<3)&&Ed(e)&&(t.options.setext||n))}function mj(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(pj(e,n)){const d=n.enter("headingSetext"),c=n.enter("phrasing"),f=n.containerPhrasing(e,{...s.current(),before:`
|
|
70
|
-
`,after:`
|
|
71
|
-
`});return c(),d(),f+`
|
|
72
|
-
`+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
|
|
73
|
-
`))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
74
|
-
`,...s.current()});return/^[\t ]/.test(u)&&(u=gs(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),l(),a(),u}Tw.peek=gj;function Tw(e){return e.value||""}function gj(){return"<"}Iw.peek=yj;function Iw(e,t,n,r){const i=Dd(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),o(),u}function yj(){return"!"}Rw.peek=vj;function Rw(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=d,s(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function vj(){return"!"}Pw.peek=xj;function Pw(e,t,n){let r=e.value||"",i="`",s=-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+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function xj(){return"`"}function Aw(e,t){const n=Ed(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))}Mw.peek=wj;function Mw(e,t,n,r){const i=Dd(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(Aw(e,n)){const d=n.stack;n.stack=[],a=n.enter("autolink");let c=o.move("<");return c+=o.move(n.containerPhrasing(e,{before:c,after:">",...o.current()})),c+=o.move(">"),a(),n.stack=d,c}a=n.enter("link"),l=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(l=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=o.move(" "+i),u+=o.move(n.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),l()),u+=o.move(")"),a(),u}function wj(e,t,n){return Aw(e,n)?"<":"["}Nw.peek=Sj;function Nw(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=d,s(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Sj(){return"["}function Od(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 bj(e){const t=Od(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 kj(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 jw(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 _j(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?kj(n):Od(n);const a=e.ordered?o==="."?")":".":bj(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.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&&(l=!0),jw(n)===o&&d){let c=-1;for(;++c<e.children.length;){const f=e.children[c];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),u}function Cj(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 Ej(e,t,n,r){const i=Cj(n);let s=n.bulletCurrent||Od(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),d);return l(),u;function d(c,f,h){return f?(h?"":" ".repeat(o))+c:(h?s:s+" ".repeat(o-s.length))+c}}function Tj(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const Ij=Da(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Rj(e,t,n,r){return(e.children.some(function(o){return Ij(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Pj(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Dw.peek=Aj;function Dw(e,t,n,r){const i=Pj(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const u=l.charCodeAt(0),d=aa(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(l=gs(u)+l.slice(1));const c=l.charCodeAt(l.length-1),f=aa(r.after.charCodeAt(0),c,i);f.inside&&(l=l.slice(0,-1)+gs(c));const h=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},a+l+h}function Aj(e,t,n){return n.options.strong||"*"}function Mj(e,t,n,r){return n.safe(e.value,r)}function Nj(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 jj(e,t,n){const r=(jw(n)+(n.options.ruleSpaces?" ":"")).repeat(Nj(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ow={blockquote:rj,break:Bp,code:uj,definition:dj,emphasis:Ew,hardBreak:Bp,heading:mj,html:Tw,image:Iw,imageReference:Rw,inlineCode:Pw,link:Mw,linkReference:Nw,list:_j,listItem:Ej,paragraph:Tj,root:Rj,strong:Dw,text:Mj,thematicBreak:jj};function Dj(){return{enter:{table:Oj,tableData:Up,tableHeader:Up,tableRow:zj},exit:{codeText:Fj,table:Lj,tableData:Ml,tableHeader:Ml,tableRow:Ml}}}function Oj(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 Lj(e){this.exit(e),this.data.inTable=void 0}function zj(e){this.enter({type:"tableRow",children:[]},e)}function Ml(e){this.exit(e)}function Up(e){this.enter({type:"tableCell",children:[]},e)}function Fj(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Bj));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Bj(e,t){return t==="|"?t:e}function Uj(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
75
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:o,tableCell:l,tableRow:a}};function o(h,m,x,E){return u(d(h,x,E),h.align)}function a(h,m,x,E){const y=c(h,x,E),v=u([y]);return v.slice(0,v.indexOf(`
|
|
76
|
-
`))}function l(h,m,x,E){const y=x.enter("tableCell"),v=x.enter("phrasing"),w=x.containerPhrasing(h,{...E,before:s,after:s});return v(),y(),w}function u(h,m){return tj(h,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function d(h,m,x){const E=h.children;let y=-1;const v=[],w=m.enter("table");for(;++y<E.length;)v[y]=c(E[y],m,x);return w(),v}function c(h,m,x){const E=h.children;let y=-1;const v=[],w=m.enter("tableRow");for(;++y<E.length;)v[y]=l(E[y],h,m,x);return w(),v}function f(h,m,x){let E=Ow.inlineCode(h,m,x);return x.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function $j(){return{exit:{taskListCheckValueChecked:$p,taskListCheckValueUnchecked:$p,paragraph:Hj}}}function Vj(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Wj}}}function $p(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Hj(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 s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===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 Wj(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=Ow.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+o}}function qj(){return[_N(),WN(),GN(),Dj(),$j()]}function Kj(e){return{extensions:[CN(),qN(e),YN(),Uj(e),Vj()]}}const Qj={tokenize:eD,partial:!0},Lw={tokenize:tD,partial:!0},zw={tokenize:nD,partial:!0},Fw={tokenize:rD,partial:!0},Gj={tokenize:iD,partial:!0},Bw={name:"wwwAutolink",tokenize:Xj,previous:$w},Uw={name:"protocolAutolink",tokenize:Zj,previous:Vw},gn={name:"emailAutolink",tokenize:Jj,previous:Hw},en={};function Yj(){return{text:en}}let Gn=48;for(;Gn<123;)en[Gn]=gn,Gn++,Gn===58?Gn=65:Gn===91&&(Gn=97);en[43]=gn;en[45]=gn;en[46]=gn;en[95]=gn;en[72]=[gn,Uw];en[104]=[gn,Uw];en[87]=[gn,Bw];en[119]=[gn,Bw];function Jj(e,t,n){const r=this;let i,s;return o;function o(c){return!Ju(c)||!Hw.call(r,r.previous)||Ld(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Ju(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(Gj,d,u)(c):c===45||c===95||Ve(c)?(s=!0,e.consume(c),l):d(c)}function u(c){return e.consume(c),i=!0,l}function d(c){return s&&i&&Qe(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Xj(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!$w.call(r,r.previous)||Ld(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Qj,e.attempt(Lw,e.attempt(zw,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Zj(e,t,n){const r=this;let i="",s=!1;return o;function o(c){return(c===72||c===104)&&Vw.call(r,r.previous)&&!Ld(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(Qe(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),s?u:(s=!0,l)):n(c)}function u(c){return c===null||ia(c)||he(c)||hr(c)||Ma(c)?n(c):e.attempt(Lw,e.attempt(zw,d),n)(c)}function d(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function eD(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function tD(e,t,n){let r,i,s;return o;function o(u){return u===46||u===95?e.check(Fw,l,a)(u):u===null||he(u)||hr(u)||u!==45&&Ma(u)?l(u):(s=!0,e.consume(u),o)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),o}function l(u){return i||r||!s?n(u):t(u)}}function nD(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Fw,t,s)(o):o===null||he(o)||hr(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function rD(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||he(a)||hr(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||he(a)||hr(a)?t(a):r(a)}function s(a){return Qe(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):Qe(a)?(e.consume(a),o):n(a)}}function iD(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Ve(s)?n(s):t(s)}}function $w(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||he(e)}function Vw(e){return!Qe(e)}function Hw(e){return!(e===47||Ju(e))}function Ju(e){return e===43||e===45||e===46||e===95||Ve(e)}function Ld(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 sD={tokenize:hD,partial:!0};function oD(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cD,continuation:{tokenize:dD},exit:fD}},text:{91:{name:"gfmFootnoteCall",tokenize:uD},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aD,resolveTo:lD}}}}function aD(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const u=Ft(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function lD(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 s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function uD(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(s>999||c===93&&!o||c===null||c===91||he(c))return n(c);if(c===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(Ft(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return he(c)||(o=!0),s++,e.consume(c),c===92?d:u}function d(c){return c===91||c===92||c===93?(e.consume(c),s++,u):u(c)}}function cD(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(o>999||m===93&&!a||m===null||m===91||he(m))return n(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return s=Ft(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return he(m)||(a=!0),o++,e.consume(m),m===92?c:d}function c(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}function f(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),oe(e,h,"gfmFootnoteDefinitionWhitespace")):n(m)}function h(m){return t(m)}}function dD(e,t,n){return e.check(Cs,t,e.attempt(sD,t,n))}function fD(e){e.exit("gfmFootnoteDefinition")}function hD(e,t,n){const r=this;return oe(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function pD(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let u=l;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[l][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[l][1].end)},c={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[l][1].start)},f=[["enter",d,a],["enter",o[u][1],a],["exit",o[u][1],a],["enter",c,a]],h=a.parser.constructs.insideSpan.null;h&&mt(f,f.length,0,Na(h,o.slice(u+1,l),a)),mt(f,f.length,0,[["exit",c,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",d,a]]),mt(o,u-1,l-u+3,f),l=u+f.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const u=this.previous,d=this.events;let c=0;return f;function f(m){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(m):(o.enter("strikethroughSequenceTemporary"),h(m))}function h(m){const x=ri(u);if(m===126)return c>1?l(m):(o.consume(m),c++,h);if(c<2&&!n)return l(m);const E=o.exit("strikethroughSequenceTemporary"),y=ri(m);return E._open=!y||y===2&&!!x,E._close=!x||x===2&&!!y,a(m)}}}class mD{constructor(){this.map=[]}add(t,n,r){gD(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[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 s of i)t.push(s);i=r.pop()}this.map.length=0}}function gD(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 yD(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 s=r.length-1;r[s]=r[s]==="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 vD(){return{flow:{null:{name:"table",tokenize:xD,resolveAll:wD}}}}function xD(e,t,n){const r=this;let i=0,s=0,o;return a;function a(T){let L=r.events.length-1;for(;L>-1;){const ae=r.events[L][1].type;if(ae==="lineEnding"||ae==="linePrefix")L--;else break}const z=L>-1?r.events[L][1].type:null,Q=z==="tableHead"||z==="tableRow"?k:l;return Q===k&&r.parser.lazy[r.now().line]?n(T):Q(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,s+=1),d(T)}function d(T){return T===null?n(T):H(T)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),h):n(T):te(T)?oe(e,d,"whitespace")(T):(s+=1,o&&(o=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),c(T)))}function c(T){return T===null||T===124||he(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?f:c)}function f(T){return T===92||T===124?(e.consume(T),c):c(T)}function h(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,te(T)?oe(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):m(T))}function m(T){return T===45||T===58?E(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),x):I(T)}function x(T){return te(T)?oe(e,E,"whitespace")(T):E(T)}function E(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(s+=1,y(T)):T===null||H(T)?C(T):I(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),v(T)):I(T)}function v(T){return T===45?(e.consume(T),v):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return te(T)?oe(e,C,"whitespace")(T):C(T)}function C(T){return T===124?m(T):T===null||H(T)?!o||i!==s?I(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):I(T)}function I(T){return n(T)}function k(T){return e.enter("tableRow"),M(T)}function M(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),M):T===null||H(T)?(e.exit("tableRow"),t(T)):te(T)?oe(e,M,"whitespace")(T):(e.enter("data"),D(T))}function D(T){return T===null||T===124||he(T)?(e.exit("data"),M(T)):(e.consume(T),T===92?$:D)}function $(T){return T===92||T===124?(e.consume(T),D):D(T)}}function wD(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,u,d,c;const f=new mD;for(;++n<e.length;){const h=e[n],m=h[1];h[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(Vp(f,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[["enter",d,t]])),i=m.type==="tableDelimiterRow"?2:d?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],c=no(f,t,s,i,void 0,c),s=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],c=no(f,t,s,i,void 0,c)),s=o,o=[s[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],c=no(f,t,s,i,n,c)):o[1]!==0&&(c=no(f,t,o,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&Vp(f,t,l,u,d),f.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=yD(t.events,n))}return e}function no(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Cr(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Cr(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Cr(t.events,n[2]),d=Cr(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const f=t.events[n[2]],h=t.events[n[3]];if(f[1].end=Object.assign({},h[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,x=n[3]-n[2]-1;e.add(m,x,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(s.end=Object.assign({},Cr(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Vp(e,t,n,r,i){const s=[],o=Cr(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Cr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const SD={name:"tasklistCheck",tokenize:kD};function bD(){return{text:{91:SD}}}function kD(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return he(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return H(l)?t(l):te(l)?e.check({tokenize:_D},t,n)(l):n(l)}}function _D(e,t,n){return oe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function CD(e){return Zx([Yj(),oD(),pD(e),vD(),bD()])}const ED={};function TD(e){const t=this,n=e||ED,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(CD(n)),s.push(qj()),o.push(Kj(n))}const ID="modulepreload",RD=function(e,t){return new URL(e,t).href},Hp={},Ht=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=Promise.allSettled(n.map(u=>{if(u=RD(u,r),u in Hp)return;Hp[u]=!0;const d=u.endsWith(".css"),c=d?'[rel="stylesheet"]':"";if(!!r)for(let m=o.length-1;m>=0;m--){const x=o[m];if(x.href===u&&(!d||x.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${c}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":ID,d||(h.as="script"),h.crossOrigin="",h.href=u,l&&h.setAttribute("nonce",l),document.head.appendChild(h),d)return new Promise((m,x)=>{h.addEventListener("load",m),h.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},PD={ts:"typescript",typescript:"typescript",tsx:"typescript",js:"javascript",javascript:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",sh:"bash",bash:"bash",shell:"bash",zsh:"bash",py:"python",python:"python",diff:"diff",patch:"diff",md:"markdown",markdown:"markdown",html:"xml",xml:"xml",css:"css"};function Ww(e){return e?PD[e.trim().toLowerCase()]??null:null}let Nl=null;async function AD(){return Nl||(Nl=(async()=>{const{default:e}=await Ht(async()=>{const{default:d}=await import("./core-BtNQjjpA.js");return{default:d}},[],import.meta.url),[t,n,r,i,s,o,a,l,u]=await Promise.all([Ht(()=>import("./typescript-C2FFdlUC.js"),[],import.meta.url),Ht(()=>import("./javascript-BKRaQes9.js"),[],import.meta.url),Ht(()=>import("./json-DIYVocXf.js"),[],import.meta.url),Ht(()=>import("./bash-I8pq0VWm.js"),[],import.meta.url),Ht(()=>import("./python-sE43i1Pi.js"),[],import.meta.url),Ht(()=>import("./diff-DiTmLxSS.js"),[],import.meta.url),Ht(()=>import("./markdown-BrP960CR.js"),[],import.meta.url),Ht(()=>import("./xml-BXBhIUeX.js"),[],import.meta.url),Ht(()=>import("./css-DazXZka4.js"),[],import.meta.url)]);return e.registerLanguage("typescript",t.default),e.registerLanguage("javascript",n.default),e.registerLanguage("json",r.default),e.registerLanguage("bash",i.default),e.registerLanguage("python",s.default),e.registerLanguage("diff",o.default),e.registerLanguage("markdown",a.default),e.registerLanguage("xml",l.default),e.registerLanguage("css",u.default),e})()),Nl}async function MD(e,t){const n=Ww(e);if(!n)return null;try{const r=await AD(),{value:i}=r.highlight(t,{language:n,ignoreIllegals:!0});return i}catch{return null}}const ND=({language:e})=>e?p.jsx("div",{className:"aui-md-code-lang",children:e}):null,jD=({components:e,language:t,code:n})=>{const{Pre:r,Code:i}=e,s=Ww(t)!==null,[o,a]=g.useState(null);return g.useEffect(()=>{if(!s){a(null);return}let l=!0;return a(null),MD(t,n).then(u=>{l&&a(u)}).catch(()=>{l&&a(null)}),()=>{l=!1}},[s,t,n]),s&&o!=null?p.jsx(r,{children:p.jsx(i,{className:"hljs",dangerouslySetInnerHTML:{__html:o}})}):p.jsx(r,{children:p.jsx(i,{className:s?"hljs":void 0,children:n})})},DD=()=>p.jsx(vN,{className:"aui-md",remarkPlugins:[TD],components:{CodeHeader:ND,SyntaxHighlighter:jD}}),OD=g.memo(DD);function LD(e){const[t,n]=g.useState(null);return g.useEffect(()=>{let r=!1,i=null;return lt(HT(e)).then(s=>s.ok?s.blob():null).then(s=>{!s||r||(i=URL.createObjectURL(s),n(i))}).catch(()=>{}),()=>{r=!0,i&&URL.revokeObjectURL(i),n(null)}},[e]),t}const zD=new Set([".jpg",".jpeg",".png",".gif",".webp",".avif",".heic",".heif",".svg"]),Wp=/(?:^|\s)(\/[^\s]*\/\.claude-control\/uploads\/([^\s]+))/g;function FD(e){const t=[],n=new Set;let r;for(Wp.lastIndex=0;(r=Wp.exec(e))!==null;){const i=r[1].trim();if(n.has(i))continue;n.add(i);const s=r[2],o=s.slice(s.lastIndexOf(".")).toLowerCase();t.push({fullPath:i,basename:s,isImage:zD.has(o)})}return t}function BD({src:e,alt:t,onClose:n}){const r=g.useRef(null);g.useEffect(()=>{r.current?.focus()},[]);const i=g.useCallback(s=>{s.key==="Escape"&&(s.preventDefault(),n())},[n]);return p.jsx("div",{className:"lightbox-backdrop",role:"dialog","aria-modal":"true","aria-label":`Preview: ${t}`,ref:r,tabIndex:-1,onClick:n,onKeyDown:i,children:p.jsx("img",{className:"lightbox-img",src:e,alt:t,onClick:s=>s.stopPropagation()})})}function UD({ref_:e}){const[t,n]=g.useState(!1),r=LD(e.basename);return e.isImage?p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"transcript-thumb-btn","aria-label":`Preview ${e.basename}`,title:e.basename,onClick:()=>n(!0),children:r?p.jsx("img",{className:"transcript-thumb",src:r,alt:e.basename,loading:"lazy"}):p.jsx("span",{className:"transcript-thumb transcript-thumb-loading","aria-hidden":"true"})}),t&&r?p.jsx(BD,{src:r,alt:e.basename,onClose:()=>n(!1)}):null]}):p.jsxs("a",{className:"transcript-file-chip",href:r??void 0,download:e.basename,"aria-label":`Download ${e.basename}`,title:e.basename,"aria-disabled":r?void 0:!0,children:[p.jsx("span",{className:"chip-icon","aria-hidden":"true",children:"📎"}),p.jsx("span",{className:"chip-name",children:e.basename})]})}function $D({text:e}){const t=FD(e);return t.length===0?null:p.jsx("div",{className:"transcript-attachments","aria-label":"Attachments",children:t.map(n=>p.jsx(UD,{ref_:n},n.fullPath))})}const VD=/^\s*working…?\s*$/i,HD=e=>typeof e.text=="string"&&VD.test(e.text)?p.jsxs("span",{className:"working-indicator",role:"status","aria-live":"polite",children:[p.jsx("span",{className:"working-spinner","aria-hidden":"true"}),"Working…"]}):p.jsxs(p.Fragment,{children:[p.jsx(OD,{...e}),typeof e.text=="string"?p.jsx($D,{text:e.text}):null]}),WD=({text:e})=>!e||!e.trim()?null:p.jsxs("details",{className:"block-thinking",children:[p.jsx("summary",{children:"thinking"}),p.jsx("div",{className:"thinking-text",children:e})]});function qD(e){const t=tI(e);if(t==null||typeof t=="object"&&Object.keys(t).length===0)return"";try{return JSON.stringify(t,null,2)}catch{return String(t)}}const KD=({toolName:e,args:t,result:n})=>{const r=eI(t),i=qD(t),s=nI(n),o=i.length>0||s!=null,a=p.jsxs("span",{className:"tool-head",children:[p.jsx("span",{className:"tool-arrow","aria-hidden":"true",children:"▸"}),p.jsx("span",{className:"tool-name",children:e}),r?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"tool-sep",children:"—"}),p.jsx("span",{className:"tool-input",children:r})]}):null]});return o?p.jsxs("details",{className:"block-tool",children:[p.jsx("summary",{className:"block-tool-use",children:a}),p.jsxs("div",{className:"block-tool-body",children:[i?p.jsx("pre",{className:"block-tool-args",children:i}):null,s!=null?p.jsx("div",{className:"block-tool-result","data-error":s.isError?"true":"false",children:s.text}):null]})]}):p.jsx("div",{className:"block-tool",children:p.jsx("div",{className:"block-tool-use",children:a})})},qw={Text:HD,Reasoning:WD,tools:{Fallback:KD}};function zd(){return p.jsxs(ea.Root,{className:"msg-row","data-role":"user",children:[p.jsx("div",{className:"msg-role",children:"user"}),p.jsx("div",{className:"msg-body",children:p.jsx(ea.Parts,{components:qw})})]})}function ii(){const e=k1(t=>t.metadata?.custom?.cockpitRole)??"assistant";return p.jsxs(ea.Root,{className:"msg-row","data-role":e,children:[p.jsx("div",{className:"msg-role",children:e}),p.jsx("div",{className:"msg-body",children:p.jsx(ea.Parts,{components:qw})})]})}function QD({file:e}){const[t,n]=g.useState(null);return g.useEffect(()=>{const r=URL.createObjectURL(e);return n(r),()=>URL.revokeObjectURL(r)},[e]),t?p.jsx("img",{className:"chip-thumb",src:t,alt:"",role:"button",tabIndex:0,title:"Open preview",onClick:()=>window.open(t,"_blank","noopener"),onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),window.open(t,"_blank","noopener"))}}):p.jsx("div",{className:"chip-thumb chip-thumb-empty"})}function GD({attachment:e}){const t=e.type==="image",n=e.status.type==="running";return p.jsxs(Ah.Root,{className:"attach-chip","data-pending":n,children:[t&&e.file?p.jsx(QD,{file:e.file}):p.jsx("span",{className:"chip-icon","aria-hidden":"true",children:e.type==="document"?"📄":"📎"}),p.jsx("span",{className:"chip-name",title:e.name,children:e.name}),n?p.jsx("span",{className:"chip-spinner","aria-hidden":"true"}):null,p.jsx(Ah.Remove,{className:"chip-remove","aria-label":`Remove ${e.name}`,children:"×"})]})}function Kw({disabled:e}){const t=S1();return p.jsxs(_i.Root,{className:"composer",children:[p.jsx("div",{className:"composer-attachments",children:p.jsx(_i.Attachments,{children:({attachment:n})=>p.jsx(GD,{attachment:n})})}),p.jsxs("div",{className:"composer-row",children:[p.jsx(_i.AddAttachment,{className:"composer-attach","aria-label":"Attach a file",title:"Attach a file",multiple:!0,disabled:e,children:"📎"}),p.jsx(_i.Input,{className:"composer-input",placeholder:e?"select a session…":"reply… (⌘/Ctrl+↵ to send · Enter = newline)",submitOnEnter:!1,onKeyDown:n=>{n.key==="Enter"&&(n.metaKey||n.ctrlKey)&&(n.preventDefault(),e||t.send())},rows:1,disabled:e,autoComplete:"off"}),p.jsx(_i.Send,{className:"composer-send","aria-label":"Send reply",disabled:e,children:"↑"})]})]})}const YD={UserMessage:zd,AssistantMessage:ii,SystemMessage:ii};function JD({hasSelection:e,hiddenCount:t,onLoadEarlier:n}){return p.jsxs(Ot.Root,{className:"thread-root",children:[p.jsxs(Ot.Viewport,{className:"thread-viewport",autoScroll:!0,children:[e?p.jsx(Ot.Empty,{children:p.jsx("div",{className:"thread-empty",children:"no messages yet"})}):p.jsx("div",{className:"thread-empty",children:"select a session"}),e&&t>0?p.jsxs("button",{type:"button",className:"load-earlier",onClick:n,children:["Load earlier messages (",t," hidden)"]}):null,p.jsx(Ot.Messages,{components:YD})]}),p.jsx(Kw,{disabled:!e})]})}const qp=200,XD=2e3;function ZD({sessionId:e,capture:t,requestCapture:n,clearCapture:r}){const i=g.useRef(null),s=g.useRef(!0);g.useEffect(()=>{n(qp);const a=setInterval(()=>n(qp),XD);return()=>{clearInterval(a),r()}},[e,n,r]),g.useLayoutEffect(()=>{const a=i.current;a&&s.current&&(a.scrollTop=a.scrollHeight)},[t]);const o=()=>{const a=i.current;a&&(s.current=a.scrollHeight-a.scrollTop-a.clientHeight<24)};return p.jsxs("div",{className:"live-pane",children:[p.jsx("div",{className:"live-pane-head",children:"live pane (no transcript)"}),p.jsx("pre",{className:"live-pane-body",ref:i,onScroll:o,children:t??"capturing live pane…"})]})}function Kp(e){return e.questions.map(()=>new Set)}function eO({pending:e,capture:t,onAnswer:n,onCapture:r,onClose:i}){const[s,o]=g.useState(()=>Kp(e)),a=g.useRef(null),l=g.useRef(null);g.useEffect(()=>{o(Kp(e))},[e]),g.useEffect(()=>(l.current=document.activeElement,(a.current?.querySelector("button:not([disabled]), [tabindex]")??a.current)?.focus(),()=>{l.current?.focus?.()}),[]);const u=g.useMemo(()=>s.length>0&&s.every(h=>h.size>0),[s]),d=(h,m,x)=>{o(E=>{const y=E.map(w=>new Set(w)),v=y[h];return x?v.has(m)?v.delete(m):v.add(m):y[h]=new Set([m]),y})},c=h=>{if(h.key==="Escape"){h.preventDefault(),i();return}if(h.key!=="Tab")return;const m=a.current?.querySelectorAll('button:not([disabled]), [tabindex="0"]');if(!m||m.length===0)return;const x=m[0],E=m[m.length-1];h.shiftKey&&document.activeElement===x?(h.preventDefault(),E.focus()):!h.shiftKey&&document.activeElement===E&&(h.preventDefault(),x.focus())},f=()=>{u&&n(e.toolUseId,s.map(h=>[...h]))};return p.jsx("div",{className:"modal-backdrop",onClick:h=>{h.target===h.currentTarget&&i()},children:p.jsxs("div",{ref:a,className:"modal",role:"dialog","aria-modal":"true","aria-label":"Question from Claude",tabIndex:-1,onKeyDown:c,children:[p.jsxs("div",{className:"modal-head",children:[p.jsx("span",{className:"modal-title",children:"Claude is asking"}),p.jsx("button",{type:"button",className:"modal-close","aria-label":"Close",onClick:i,children:"✕"})]}),p.jsxs("div",{className:"modal-body",children:[e.questions.map((h,m)=>p.jsxs("div",{className:"question",children:[h.header?p.jsx("div",{className:"q-header",children:h.header}):null,p.jsx("div",{className:"q-text",children:h.question}),h.multiSelect?p.jsx("div",{className:"q-hint",children:"select one or more"}):null,p.jsx("div",{className:"q-options",children:h.options.map(x=>{const E=s[m]?.has(x.label);return p.jsxs("button",{type:"button",className:"option-btn","data-on":E?"true":"false","aria-pressed":E,onClick:()=>d(m,x.label,!!h.multiSelect),children:[p.jsx("span",{className:"option-label",children:x.label}),x.description?p.jsx("span",{className:"option-desc",children:x.description}):null]},x.label)})})]},m)),t!=null?p.jsx("pre",{className:"capture-output",children:t}):null]}),p.jsxs("div",{className:"modal-foot",children:[p.jsx("button",{type:"button",className:"btn-secondary",onClick:r,children:"show terminal"}),p.jsx("span",{className:"modal-foot-spacer"}),p.jsx("button",{type:"button",className:"btn-secondary",onClick:i,children:"Cancel"}),p.jsx("button",{type:"button",className:"btn-primary",disabled:!u,onClick:f,children:"send answer"})]})]})})}function tO({toast:e}){const[t,n]=g.useState(!1);return g.useEffect(()=>{if(!e)return;n(!0);const r=setTimeout(()=>n(!1),2200);return()=>clearTimeout(r)},[e]),e?p.jsx("div",{className:`toast ${t?"show":""} ${e.kind?`toast-${e.kind}`:""}`,role:"status","aria-live":"polite",children:e.text}):null}const Qp="claude-control-update-dismissed";function nO(e){if(e.latest&&e.latest!==e.current)return`Update available — v${e.latest} (you’re on v${e.current}).`;const t=e.behind||1;return`Update available — ${t} new commit${t===1?"":"s"} (v${e.current}).`}function rO(){const[e,t]=g.useState(null),[n,r]=g.useState(!1);return g.useEffect(()=>{let i=!0;return jx().then(s=>{if(!i||!s?.updateAvailable)return;const o=s.latest??`behind-${s.behind??0}`;localStorage.getItem(Qp)!==o&&t({current:s.current,latest:s.latest,behind:s.behind??0})}),()=>{i=!1}},[]),e?n?p.jsx("div",{className:"update-banner",role:"status",children:p.jsx("span",{children:"Updating… the page will reconnect shortly."})}):p.jsxs("div",{className:"update-banner",role:"status",children:[p.jsx("span",{children:nO(e)}),p.jsxs("span",{className:"update-actions",children:[p.jsx("button",{type:"button",className:"update-now",onClick:()=>{r(!0),OT()},children:"Update now"}),p.jsx("button",{type:"button",className:"update-dismiss","aria-label":"Dismiss update notice",onClick:()=>{localStorage.setItem(Qp,e.latest??`behind-${e.behind}`),t(null)},children:"×"})]})]}):null}function iO({onClose:e,onToast:t}){const[n,r]=g.useState(""),[i,s]=g.useState(""),[o,a]=g.useState(!0),[l,u]=g.useState(!1),[d,c]=g.useState(null);g.useEffect(()=>{let h=!0;return jx().then(m=>h&&m&&c(m)).catch(()=>{}),()=>{h=!1}},[]),g.useEffect(()=>{let h=!0;return BT().then(m=>{h&&(r(m.launchCommand),s(m.defaultCwd))}).catch(m=>t(`Load config failed: ${m.message}`,"error")).finally(()=>{h&&a(!1)}),()=>{h=!1}},[t]),g.useEffect(()=>{const h=m=>{m.key==="Escape"&&e()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[e]);const f=async()=>{u(!0);try{const h=await UT({launchCommand:n,defaultCwd:i});r(h.launchCommand),s(h.defaultCwd),t("Config saved","ok"),e()}catch(h){t(`Save failed: ${h.message}`,"error")}finally{u(!1)}};return p.jsx("div",{className:"config-overlay",role:"presentation",onClick:h=>{h.target===h.currentTarget&&e()},children:p.jsxs("div",{className:"config-modal",role:"dialog","aria-modal":"true","aria-label":"Settings",children:[p.jsxs("div",{className:"config-head",children:[p.jsx("span",{className:"config-title",children:"Settings"}),p.jsx("button",{type:"button",className:"config-close","aria-label":"Close settings",onClick:e,children:"×"})]}),p.jsxs("label",{className:"config-field",children:[p.jsx("span",{className:"config-label",children:"Launch command"}),p.jsx("input",{className:"config-input",type:"text",placeholder:"claude",value:n,disabled:o,onChange:h=>r(h.target.value),autoCapitalize:"off",autoCorrect:"off",spellCheck:!1}),p.jsxs("span",{className:"config-hint",children:["Run in each new session's pane (e.g. ",p.jsx("code",{children:"yolo"})," or"," ",p.jsx("code",{children:"claude --flags"}),")."]})]}),p.jsxs("label",{className:"config-field",children:[p.jsx("span",{className:"config-label",children:"Default cwd"}),p.jsx("input",{className:"config-input",type:"text",value:i,disabled:o,onChange:h=>s(h.target.value),autoCapitalize:"off",autoCorrect:"off",spellCheck:!1}),p.jsx("span",{className:"config-hint",children:"Must be an existing directory. New sessions start here."})]}),p.jsx("div",{className:"config-version",children:d?p.jsxs(p.Fragment,{children:[p.jsxs("span",{children:["claude-control v",d.current]}),d.updateAvailable&&d.latest?p.jsxs("span",{className:"config-version-update",children:["· update available: v",d.latest]}):null]}):null}),p.jsxs("div",{className:"config-actions",children:[p.jsx("button",{type:"button",className:"config-cancel",onClick:e,disabled:l,children:"Cancel"}),p.jsx("button",{type:"button",className:"config-save",onClick:f,disabled:o||l,children:l?"Saving…":"Save"})]})]})})}function Gp(e=Date.now()){return`session-${e.toString(36).slice(-6)}`}function sO({onToast:e,onOpenSettings:t}){const[n,r]=g.useState(!1),[i,s]=g.useState(""),[o,a]=g.useState(!1),[l,u]=g.useState(Gp),d=g.useRef(null);g.useEffect(()=>{n&&(u(Gp()),d.current?.focus())},[n]);const c=g.useCallback(()=>{r(!1),s("")},[]),f=g.useCallback(async()=>{if(o)return;a(!0);const h=i.trim()||l;e("Creating session…");try{const m=await $T({name:h});e(`Session created → ${m.name}`,"ok"),c()}catch(m){e(`New session failed: ${m.message}`,"error")}finally{a(!1)}},[o,i,l,e,c]);return n?p.jsxs("form",{className:"rail-new-form","aria-label":"Create session",onSubmit:h=>{h.preventDefault(),f()},children:[p.jsx("input",{ref:d,className:"rail-new-name",type:"text",value:i,placeholder:l,disabled:o,onChange:h=>s(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),c())},"aria-label":"Session name",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1}),p.jsxs("div",{className:"rail-new-actions",children:[p.jsx("button",{type:"button",className:"rail-new-cancel",onClick:c,disabled:o,children:"Cancel"}),p.jsx("button",{type:"submit",className:"rail-new-create",disabled:o,children:o?"Creating…":"Create"})]})]}):p.jsxs("div",{className:"rail-head",children:[p.jsx("button",{type:"button",className:"rail-new",onClick:()=>r(!0),children:"+ New session"}),p.jsx("button",{type:"button",className:"rail-gear","aria-label":"Settings",title:"Settings",onClick:t,children:"⚙"})]})}function oO({sessionId:e,label:t,onClose:n}){const r=MT(e),i=g.useRef(null);return g.useEffect(()=>{i.current?.focus();const s=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[n]),p.jsxs("div",{className:"term-overlay",role:"dialog","aria-modal":"true","aria-label":`Raw terminal — ${t}`,children:[p.jsxs("header",{className:"term-head",children:[p.jsxs("span",{className:"term-title",children:[p.jsx("span",{"aria-hidden":"true",children:"⛶"})," ",t]}),p.jsxs("span",{className:"term-actions",children:[p.jsx("a",{className:"term-newtab",href:r,target:"_blank",rel:"noopener noreferrer",title:"Open in a new tab",children:"↗ New tab"}),p.jsx("button",{ref:i,type:"button",className:"term-close","aria-label":"Close terminal",onClick:n,children:"✕"})]})]}),p.jsx("iframe",{className:"term-frame",src:r,title:`Raw terminal for ${t}`})]})}function aO({children:e}){const[t,n]=g.useState("probing"),[r,i]=g.useState(null),[s,o]=g.useState(""),a=g.useCallback(async()=>{try{return(await lt("/api/health")).ok?(n("authed"),i(null),!0):!1}catch{return i("Cannot reach the server. Check the connection and retry."),!1}},[]);g.useEffect(()=>{let u=!1;return(async()=>{const d=await a();u||d||n("needs-token")})(),()=>{u=!0}},[a]),g.useEffect(()=>PT(()=>{n("needs-token"),o(""),i("Session expired — enter your access token again.")}),[]);const l=g.useCallback(async u=>{u.preventDefault();const d=s.trim();if(!d){i("Enter an access token.");return}n("submitting"),i(null),Ax(d),await a()||(Mx(),n("needs-token"),i("Invalid token."))},[s,a]);return t==="authed"?p.jsx(p.Fragment,{children:e}):t==="probing"?p.jsx("div",{className:"gate-root",role:"status","aria-live":"polite",children:p.jsxs("div",{className:"gate-card gate-card--probing",children:[p.jsx("span",{className:"gate-spinner","aria-hidden":"true"}),p.jsx("span",{className:"gate-probing-text",children:"Connecting…"})]})}):(Pa(),p.jsx("div",{className:"gate-root",children:p.jsxs("form",{className:"gate-card",onSubmit:l,"aria-label":"Sign in",children:[p.jsxs("div",{className:"gate-brand",children:[p.jsx("span",{className:"gate-glyph","aria-hidden":"true",children:"◧"}),p.jsx("span",{className:"gate-title",children:"claude control"})]}),p.jsx("label",{className:"gate-label",htmlFor:"gate-token",children:"Access token"}),p.jsx("input",{id:"gate-token",className:"gate-input",type:"password",autoComplete:"current-password",autoFocus:!0,spellCheck:!1,value:s,onChange:u=>{o(u.target.value),r&&i(null)},"aria-invalid":r?!0:void 0,"aria-describedby":r?"gate-error":void 0,placeholder:"••••••••••••"}),r?p.jsx("p",{id:"gate-error",className:"gate-error",role:"alert",children:r}):null,p.jsx("button",{type:"submit",className:"gate-submit",disabled:t==="submitting",children:t==="submitting"?"Connecting…":"Connect"})]})}))}function lO(e){if(!e)return"";const t=Date.parse(e);return Number.isNaN(t)?"":new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function uO({session:e,onClose:t,onToast:n,onPinned:r}){const[i,s]=g.useState(null),[o,a]=g.useState(""),[l,u]=g.useState(!1);g.useEffect(()=>{let f=!0;return DT().then(h=>f&&s(h)).catch(h=>{f&&(s([]),n(`Couldn't load transcripts: ${h.message}`,"error"))}),()=>{f=!1}},[n]);const d=g.useMemo(()=>{if(!i)return[];const f=o.trim().toLowerCase();return f?i.filter(h=>[h.title,h.cwd,h.sessionId].some(m=>m?.toLowerCase().includes(f))):i},[i,o]),c=async f=>{if(!l){u(!0);try{await jT(e.id,f),n(f?"Pinned →":"Unpinned","ok"),r(),t()}catch(h){n(`Pin failed: ${h.message}`,"error")}finally{u(!1)}}};return p.jsx("div",{className:"modal-backdrop",role:"dialog","aria-modal":"true",onClick:t,children:p.jsxs("div",{className:"modal pin-modal",onClick:f=>f.stopPropagation(),children:[p.jsxs("header",{className:"modal-head",children:[p.jsxs("span",{className:"modal-title",children:["Pin transcript — ",e.name||e.id]}),p.jsx("button",{type:"button",className:"modal-close","aria-label":"Close",onClick:t,children:"×"})]}),e.pinned?p.jsx("button",{type:"button",className:"pin-unpin",disabled:l,onClick:()=>c(null),children:"Unpin (return to auto-match)"}):null,p.jsx("input",{className:"pin-search",type:"text",placeholder:"filter by title, cwd, or session id…",value:o,onChange:f=>a(f.target.value),autoFocus:!0}),p.jsx("div",{className:"pin-list",children:i===null?p.jsx("div",{className:"pin-empty",children:"loading…"}):d.length===0?p.jsx("div",{className:"pin-empty",children:"no transcripts match"}):d.map(f=>{const h=f.transcriptPath===e.transcriptPath;return p.jsxs("button",{type:"button",className:"pin-row","data-current":h?"true":void 0,disabled:l,onClick:()=>c(f.transcriptPath),children:[p.jsxs("span",{className:"pin-row-title",children:[f.title||f.sessionId||f.transcriptPath,h?p.jsx("span",{className:"pin-row-cur",children:" · current"}):null]}),p.jsxs("span",{className:"pin-row-meta",children:[f.cwd?p.jsx("span",{className:"pin-row-cwd",children:f.cwd}):null,p.jsx("span",{className:"pin-row-when",children:lO(f.lastActivity)})]})]},f.transcriptPath)})})]})})}function Yp({children:e}){return p.jsx("kbd",{className:"kbd",children:e})}const cO={UserMessage:zd,AssistantMessage:ii,SystemMessage:ii};function dO({markdown:e}){const t=g.useMemo(()=>[{role:"assistant",id:"plan",content:[{type:"text",text:e}],metadata:{custom:{cockpitRole:"assistant"}}}],[e]),n=nd({messages:t,isDisabled:!0,convertMessage:r=>r,onNew:async()=>{}});return p.jsx(ad,{runtime:n,children:p.jsx(Ot.Root,{className:"plan-review",children:p.jsx(Ot.Viewport,{className:"plan-review-viewport",children:p.jsx(Ot.Messages,{components:cO})})})})}function fO({prompt:e,onKey:t,onClose:n,planMarkdown:r}){const i=g.useMemo(()=>e.options.find(x=>x.selected)?.key??e.options[0]?.key??null,[e]),[s,o]=g.useState(i),[a,l]=g.useState(null),u=JSON.stringify(e);g.useEffect(()=>{o(i),l(null)},[u,i]);const d=m=>{a||(l(m),t(m))},c=()=>{s&&d(s)};g.useEffect(()=>{const m=x=>{if(!a){if(x.key==="Escape"){x.preventDefault(),n();return}if(x.key==="Enter"){x.preventDefault(),s&&d(s);return}e.options.some(E=>E.key===x.key)&&(x.preventDefault(),o(x.key))}};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[n,a,s,u]);const f=a!==null,h=!!r;return p.jsx("div",{className:"modal-backdrop",onClick:m=>{m.target===m.currentTarget&&!f&&n()},children:p.jsxs("div",{className:h?"modal modal-plan":"modal",role:"dialog","aria-modal":"true","aria-label":h?"Review plan":"Terminal prompt",children:[p.jsxs("div",{className:"modal-head",children:[p.jsx("span",{className:"modal-title",children:h?"Review plan":"Claude needs a choice"}),p.jsx("button",{type:"button",className:"modal-close","aria-label":"Hide",onClick:n,children:"✕"})]}),p.jsxs("div",{className:"modal-body",children:[h?p.jsx(dO,{markdown:r}):null,p.jsxs("div",{className:"question",children:[h?null:p.jsx("div",{className:"q-text",children:e.question}),p.jsx("div",{className:"q-options",role:"radiogroup","aria-label":"Options",children:e.options.map(m=>p.jsxs("button",{type:"button",className:"option-btn",role:"radio","aria-checked":s===m.key,"data-on":s===m.key?"true":"false","data-sending":a===m.key?"true":void 0,disabled:f,onClick:()=>o(m.key),children:[p.jsxs("span",{className:"option-label",children:[m.key,". ",m.label]}),a===m.key?p.jsxs("span",{className:"option-sending","aria-live":"polite",children:[p.jsx("span",{className:"working-spinner","aria-hidden":"true"})," sending…"]}):null]},m.key))})]})]}),p.jsxs("div",{className:"modal-foot",children:[p.jsxs("button",{type:"button",className:"btn-secondary",disabled:f,onClick:()=>d("Escape"),children:["Cancel ",p.jsx(Yp,{children:"Esc"})]}),p.jsx("span",{className:"modal-foot-spacer"}),f?p.jsx("span",{className:"prompt-status",children:"submitting your answer…"}):null,p.jsxs("button",{type:"button",className:"btn-primary",disabled:f||!s,onClick:c,children:["Confirm ",p.jsx(Yp,{children:"↵"})]})]})]})})}const hO={UserMessage:zd,AssistantMessage:ii,SystemMessage:ii};function pO({messages:e}){const t=g.useMemo(()=>Dx(e),[e]),n=nd({messages:t,isDisabled:!0,convertMessage:r=>r,onNew:async()=>{}});return p.jsx(ad,{runtime:n,children:p.jsx(Ot.Root,{className:"sa-thread-root",children:p.jsxs(Ot.Viewport,{className:"sa-thread-viewport",autoScroll:!0,children:[p.jsx(Ot.Empty,{children:p.jsx("div",{className:"thread-empty",children:"no output yet…"})}),p.jsx(Ot.Messages,{components:hO})]})})})}const mO={active:"Active",completed:"Completed",all:"All"};function Jp({agent:e}){return p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"sa-dot","data-status":e.status,"aria-hidden":"true"}),p.jsx("span",{className:"sa-type",children:e.agentType||"sub-agent"}),e.description?p.jsx("span",{className:"sa-desc",children:e.description}):null,p.jsx("span",{className:"sa-status",children:e.status==="running"?"· running":"· done"})]})}function gO({subagents:e,open:t,onClose:n}){const[r,i]=g.useState("active"),[s,o]=g.useState(null),a=e.filter(c=>c.status==="running").length,l={active:a,completed:e.length-a,all:e.length},u=s?e.find(c=>c.agentId===s)??null:null,d=g.useMemo(()=>e.filter(c=>r==="all"?!0:r==="active"?c.status==="running":c.status==="done"),[e,r]);return t?u?p.jsxs("div",{className:"sa-panel",role:"complementary","aria-label":"Sub-agent transcript",children:[p.jsxs("header",{className:"sa-panel-head",children:[p.jsx("button",{type:"button",className:"sa-back","aria-label":"Back to list",onClick:()=>o(null),children:"‹"}),p.jsx("span",{className:"sa-panel-title sa-detail-title",children:p.jsx(Jp,{agent:u})}),p.jsx("button",{type:"button",className:"sa-panel-close","aria-label":"Close",onClick:n,children:"×"})]}),p.jsx(pO,{messages:u.messages})]}):p.jsxs("div",{className:"sa-panel",role:"complementary","aria-label":"Sub-agents",children:[p.jsxs("header",{className:"sa-panel-head",children:[p.jsxs("span",{className:"sa-panel-title",children:["Sub-agents ",p.jsx("span",{className:"sa-count",children:e.length}),a?p.jsxs("span",{className:"sa-count-running",children:[a," running"]}):null]}),p.jsx("button",{type:"button",className:"sa-panel-close","aria-label":"Close sub-agents panel",onClick:n,children:"×"})]}),p.jsx("div",{className:"sa-tabs",role:"tablist",children:["active","completed","all"].map(c=>p.jsxs("button",{type:"button",role:"tab","aria-selected":r===c,className:"sa-tab","data-on":r===c?"true":void 0,onClick:()=>i(c),children:[mO[c],p.jsx("span",{className:"sa-tab-count",children:l[c]})]},c))}),p.jsx("div",{className:"sa-panel-body",children:d.length===0?p.jsxs("div",{className:"sa-empty",children:["No ",r==="all"?"":`${r} `,"sub-agents."]}):d.map(c=>p.jsxs("button",{type:"button",className:"sa-item-row",onClick:()=>o(c.agentId),children:[p.jsx(Jp,{agent:c}),p.jsx("span",{className:"sa-chevron","aria-hidden":"true",children:"›"})]},c.agentId))})]}):null}function yO(e){return(e.blocks??[]).filter(t=>t.kind==="text").map(t=>t.text).join(" ")}const vO=12e4,Qw="cc_drafts";function xO(){try{return JSON.parse(localStorage.getItem(Qw)||"{}")||{}}catch{return{}}}function wO(e){try{localStorage.setItem(Qw,JSON.stringify(e))}catch{}}const Xp=150,SO=150;function bO(e){return typeof e.content=="string"?e.content:e.content.filter(t=>t.type==="text").map(t=>t.text).join(`
|
|
77
|
-
`)}function kO(){const e=GT(),t=ZT(),[n,r]=g.useState(null),i=g.useRef(0),s=g.useCallback((B,J="")=>{r({id:++i.current,text:B,kind:J})},[]);g.useEffect(()=>{const B=J=>{const ee=J.detail;ee.ok?ee.op==="answer"&&s("Answer sent →","ok"):s(`${ee.op} failed: ${ee.error??"error"}`,"error")};return window.addEventListener("cockpit:ack",B),()=>window.removeEventListener("cockpit:ack",B)},[s]);const o=g.useMemo(()=>cI(s),[s]),[a,l]=g.useState([]),u=g.useRef(0),[d,c]=g.useState(null),f=g.useCallback(async B=>{const J=bO(B).trim(),ee=(B.attachments??[]).map(et=>lI(et)).filter(et=>!!et),ke=[J,...ee].filter(Boolean).join(" ");if(!ke)return;const $t=e.sendReply(ke);if(s($t?"Sent →":"Not connected — reconnecting…",$t?"ok":"error"),$t&&e.selectedId){const et=J||(ee.length?`📎 ${ee.length} attachment(s)`:ke);l(Rt=>[...Rt,{key:++u.current,sessionId:e.selectedId,text:ke,label:et,at:Date.now()}])}},[e,s]),h=g.useRef({});g.useEffect(()=>{const B=e.selectedId;if(!B)return;const J=e.messages,ee=h.current[B],ke=ee==null?J.length:Math.min(ee,J.length);if(J.length>ke){const $t=[];for(let et=ke;et<J.length;et++){if(J[et].role!=="user")continue;const Rt=yO(J[et]).trim();Rt&&$t.push(Rt)}$t.length&&l(et=>{const Rt=[...et];for(const Ts of $t){const Is=Rt.findIndex(Rs=>Rs.sessionId===B&&Rs.text.trim()===Ts);Is>=0&&Rt.splice(Is,1)}return Rt})}h.current[B]=J.length},[e.selectedId,e.messages]),g.useEffect(()=>{if(a.length===0)return;const B=setInterval(()=>{const J=Date.now()-vO;l(ee=>ee.some(ke=>ke.at<J)?ee.filter(ke=>ke.at>=J):ee)},5e3);return()=>clearInterval(B)},[a.length]),g.useEffect(()=>{if(!d)return;if(e.selectedId!==d.sessionId||e.messages.length>d.baseCount){c(null);return}const B=setTimeout(()=>c(null),9e4);return()=>clearTimeout(B)},[d,e.selectedId,e.messages.length]);const[m,x]=g.useState(Xp);g.useEffect(()=>{x(Xp)},[e.selectedId]);const E=g.useMemo(()=>Dx(e.messages),[e.messages]),y=Math.max(0,E.length-m),v=g.useMemo(()=>a.filter(B=>B.sessionId===e.selectedId),[a,e.selectedId]),w=g.useMemo(()=>{if(!e.prompt)return null;const B=e.messages;for(let J=B.length-1;J>=0;J--)for(const ee of B[J].blocks??[])if(ee.kind==="tool_use"&&ee.name==="ExitPlanMode"){const ke=ee.input?.plan;if(typeof ke=="string"&&ke.trim())return ke}return null},[e.prompt,e.messages]),C=g.useMemo(()=>{const B=y>0?E.slice(y):E.slice();for(const ee of v)B.push({role:"user",id:`queued-${ee.key}`,content:[{type:"text",text:ee.label}],metadata:{custom:{cockpitRole:"user",optimistic:!0}}});return(v.length>0||d!==null&&d.sessionId===e.selectedId)&&B.push({role:"assistant",id:"optimistic-working",content:[{type:"text",text:"Working…"}],metadata:{custom:{cockpitRole:"assistant",working:!0}}}),B},[E,y,e.selectedId,v,d]),I=g.useCallback(()=>{x(B=>B+SO)},[]),k=nd({messages:C,isDisabled:!e.selectedId,convertMessage:B=>B,onNew:f,adapters:{attachments:o}}),M=g.useRef(xO()),D=g.useRef(e.selectedId);g.useEffect(()=>{const B=k.thread.composer,J=()=>{const ee=D.current;if(!ee)return;const ke=B.getState().text??"";ke?M.current[ee]=ke:delete M.current[ee],wO(M.current)};return B.subscribe(J)},[k]),g.useEffect(()=>{const B=k.thread.composer,J=e.selectedId,ee=J?M.current[J]??"":"";D.current=J;try{B.reset(),ee&&B.setText(ee)}catch{}},[e.selectedId,k]);const[$,T]=g.useState(null),[L,z]=g.useState(!1),[Q,ae]=g.useState(null),[Y,W]=g.useState(!1),[Z,P]=g.useState(!1),[A,S]=g.useState(null);g.useEffect(()=>{W(!1),P(!1)},[e.selectedId]);const[V,q]=g.useState(null),b=g.useRef(null),Se=V!==null;g.useEffect(()=>{Se&&b.current?.select()},[Se]);const Xe=g.useCallback(async()=>{const B=e.selectedId,J=(V??"").trim();if(q(null),!(!B||!J))try{await VT(B,J),s("Renamed →","ok")}catch(ee){s(`rename failed: ${ee instanceof Error?ee.message:"error"}`,"error")}},[e.selectedId,V,s]),[ce,Ze]=g.useState(!0),wt=g.useCallback(B=>{e.select(B),Ze(!1),window.location.hash=encodeURIComponent(B)},[e]);g.useEffect(()=>{if(!("serviceWorker"in navigator))return;const B=J=>{const ee=J.data;ee?.type==="open-session"&&ee.id&&wt(ee.id)};return navigator.serviceWorker.addEventListener("message",B),()=>navigator.serviceWorker.removeEventListener("message",B)},[wt]);const yn=typeof window<"u"&&(window.matchMedia?.("(display-mode: standalone)").matches||navigator.standalone===!0),vn=t.iosHint&&!yn&&t.status!=="on",qn=g.useRef(!1);g.useEffect(()=>{const B=()=>{const J=decodeURIComponent(window.location.hash.replace(/^#/,""));J&&J!==e.selectedId&&e.sessions.some(ee=>ee.id===J)&&(e.select(J),Ze(!1))};return!qn.current&&e.sessions.length>0&&(qn.current=!0,B()),window.addEventListener("hashchange",B),()=>window.removeEventListener("hashchange",B)},[e,e.sessions,e.selectedId]);const Ae=e.sessions.find(B=>B.id===e.selectedId);return p.jsx(ad,{runtime:k,children:p.jsxs("div",{className:"app","data-detail":e.selectedId&&!ce?"open":"closed",children:[p.jsx(yI,{resources:e.resources,conn:e.conn,push:t}),p.jsx(rO,{}),vn?p.jsx("div",{className:"ios-push-hint",role:"note",children:"On iPhone/iPad, add this site to your Home Screen to receive push notifications."}):null,p.jsxs("div",{className:"app-body",children:[p.jsxs("aside",{className:"rail",children:[p.jsx(sO,{onToast:s,onOpenSettings:()=>z(!0)}),p.jsx(hI,{sessions:e.sessions,selectedId:e.selectedId,onSelect:wt})]}),p.jsxs("main",{className:"detail",children:[p.jsxs("header",{className:"detail-head",children:[p.jsx("button",{type:"button",className:"back-btn","aria-label":"Back to sessions",onClick:()=>Ze(!0),children:"‹"}),p.jsxs("div",{className:"detail-title",children:[V!==null?p.jsx("input",{ref:b,className:"detail-rename-input",type:"text",value:V,"aria-label":"Session name",onChange:B=>q(B.target.value),onKeyDown:B=>{B.key==="Enter"?(B.preventDefault(),Xe()):B.key==="Escape"&&(B.preventDefault(),q(null))},onBlur:()=>void Xe()}):p.jsxs("span",{className:"detail-name-row",children:[p.jsx("span",{className:"detail-name",children:Ae?.name||e.selectedId||"claude control"}),Ae?p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"rename-btn","aria-label":"Rename session",title:"Rename session",onClick:()=>q(Ae.name??Ae.id),children:"✎"}),p.jsx("button",{type:"button",className:"rename-btn term-btn","aria-label":"Open raw terminal",title:"Raw terminal",onClick:()=>ae(Ae.id),children:"⛶"}),p.jsx("button",{type:"button",className:"rename-btn pin-btn","aria-pressed":!!Ae.pinned,"aria-label":Ae.pinned?"Transcript pinned":"Pin a transcript",title:Ae.pinned?"Transcript pinned":"Pin a transcript",onClick:()=>W(!0),children:Ae.pinned?"📌":"📍"}),e.subagents.length>0?p.jsxs("button",{type:"button",className:"rename-btn agents-btn","aria-pressed":Z,title:"Sub-agents",onClick:()=>P(B=>!B),children:["🤖 ",e.subagents.length]}):null]}):null]}),Ae?.cwd?p.jsx("span",{className:"detail-cwd",children:Ae.cwd}):null]})]}),Ae&&!Ae.transcriptPath?p.jsxs("div",{className:"thread-root",children:[p.jsx(ZD,{sessionId:Ae.id,capture:e.capture,requestCapture:e.requestCapture,clearCapture:e.clearCapture}),p.jsx(Kw,{disabled:!1})]}):p.jsx(JD,{hasSelection:!!e.selectedId,hiddenCount:y,onLoadEarlier:I})]})]}),e.pending&&e.pending.toolUseId!==$?p.jsx(eO,{pending:e.pending,capture:e.capture,onAnswer:(B,J)=>{e.sendAnswer(B,J),T(B),e.clearCapture(),e.selectedId&&c({sessionId:e.selectedId,baseCount:e.messages.length})},onCapture:e.requestCapture,onClose:()=>{T(e.pending?.toolUseId??null),e.clearCapture()}},e.pending.toolUseId):null,L?p.jsx(iO,{onClose:()=>z(!1),onToast:s}):null,Q?p.jsx(oO,{sessionId:Q,label:e.sessions.find(B=>B.id===Q)?.name??Q,onClose:()=>ae(null)},Q):null,p.jsx(gO,{subagents:e.subagents,open:Z&&e.subagents.length>0,onClose:()=>P(!1)}),Y&&Ae?p.jsx(uO,{session:Ae,onClose:()=>W(!1),onToast:s,onPinned:()=>e.resubscribe()}):null,e.prompt&&!e.pending&&JSON.stringify(e.prompt)!==A?p.jsx(fO,{prompt:e.prompt,planMarkdown:w,onKey:B=>e.sendPromptKey(B),onClose:()=>S(JSON.stringify(e.prompt))}):null,p.jsx(tO,{toast:n})]})})}function _O(){return p.jsx(aO,{children:p.jsx(kO,{})})}const Gw=document.getElementById("root");if(!Gw)throw new Error("#root not found");dy(Gw).render(p.jsx(g.StrictMode,{children:p.jsx(_O,{})}));export{ys as g};
|