@jyork0828/pi-pilot 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +641 -165
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
- package/public/assets/c-BIGW1oBm.js +1 -0
- package/public/assets/cpp-DIPi6g--.js +1 -0
- package/public/assets/csharp-DSvCPggb.js +1 -0
- package/public/assets/css-CLj8gQPS.js +1 -0
- package/public/assets/dart-bE4Kk8sk.js +1 -0
- package/public/assets/diff-D97Zzqfu.js +1 -0
- package/public/assets/dockerfile-BcOcwvcX.js +1 -0
- package/public/assets/elixir-CkH2-t6x.js +1 -0
- package/public/assets/github-dark-DHJKELXO.js +1 -0
- package/public/assets/github-light-DAi9KRSo.js +1 -0
- package/public/assets/go-C27-OAKa.js +1 -0
- package/public/assets/graphql-ChdNCCLP.js +1 -0
- package/public/assets/haskell-Df6bDoY_.js +1 -0
- package/public/assets/html-pp8916En.js +1 -0
- package/public/assets/index-CBa7EReb.js +411 -0
- package/public/assets/index-DeSNeuE1.css +1 -0
- package/public/assets/ini-BEwlwnbL.js +1 -0
- package/public/assets/java-CylS5w8V.js +1 -0
- package/public/assets/javascript-wDzz0qaB.js +1 -0
- package/public/assets/json-Cp-IABpG.js +1 -0
- package/public/assets/jsonc-Des-eS-w.js +1 -0
- package/public/assets/jsx-g9-lgVsj.js +1 -0
- package/public/assets/kotlin-BdnUsdx6.js +1 -0
- package/public/assets/less-B1dDrJ26.js +1 -0
- package/public/assets/lua-BaeVxFsk.js +1 -0
- package/public/assets/make-CHLpvVh8.js +1 -0
- package/public/assets/markdown-Cvjx9yec.js +1 -0
- package/public/assets/mdx-Cmh6b_Ma.js +1 -0
- package/public/assets/objective-c-DXmwc3jG.js +1 -0
- package/public/assets/php-Csjmro_R.js +1 -0
- package/public/assets/python-B6aJPvgy.js +1 -0
- package/public/assets/r-Dspwwk_N.js +1 -0
- package/public/assets/ruby-CV7NnX5q.js +1 -0
- package/public/assets/rust-B1yitclQ.js +1 -0
- package/public/assets/scala-C151Ov-r.js +1 -0
- package/public/assets/scss-D5BDwBP9.js +1 -0
- package/public/assets/shellscript-Yzrsuije.js +1 -0
- package/public/assets/sql-CRqJ_cUM.js +1 -0
- package/public/assets/svelte-DR4MIrkg.js +1 -0
- package/public/assets/swift-D82vCrfD.js +1 -0
- package/public/assets/toml-vGWfd6FD.js +1 -0
- package/public/assets/tsx-COt5Ahok.js +1 -0
- package/public/assets/typescript-BPQ3VLAy.js +1 -0
- package/public/assets/vue-DMJtu8ND.js +1 -0
- package/public/assets/xml-sdJ4AIDG.js +1 -0
- package/public/assets/yaml-Buea-lGh.js +1 -0
- package/public/favicon.svg +15 -0
- package/public/index.html +12 -3
- package/public/assets/index-CXMCsN3t.js +0 -228
- package/public/assets/index-D9--qZLP.css +0 -1
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/scss-D5BDwBP9.js","assets/ruby-CV7NnX5q.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/sql-CRqJ_cUM.js","assets/graphql-ChdNCCLP.js","assets/typescript-BPQ3VLAy.js","assets/jsx-g9-lgVsj.js","assets/tsx-COt5Ahok.js","assets/cpp-DIPi6g--.js","assets/c-BIGW1oBm.js","assets/shellscript-Yzrsuije.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/php-Csjmro_R.js","assets/json-Cp-IABpG.js","assets/vue-DMJtu8ND.js","assets/svelte-DR4MIrkg.js","assets/elixir-CkH2-t6x.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Kw=Object.defineProperty;var Xw=Object.getPrototypeOf;var Yw=Reflect.get;var Wp=e=>{throw TypeError(e)};var Jw=(e,t,n)=>t in e?Kw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var T=(e,t,n)=>Jw(e,typeof t!="symbol"?t+"":t,n),ec=(e,t,n)=>t.has(e)||Wp("Cannot "+n);var E=(e,t,n)=>(ec(e,t,"read from private field"),n?n.call(e):t.get(e)),H=(e,t,n)=>t.has(e)?Wp("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),F=(e,t,n,r)=>(ec(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Z=(e,t,n)=>(ec(e,t,"access private method"),n);var Cl=(e,t,n,r)=>({set _(i){F(e,t,i,n)},get _(){return E(e,t,r)}}),Vp=(e,t,n)=>Yw(Xw(e),n,t);(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 ba=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jy={exports:{}},pu={},Py={exports:{}},oe={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var dl=Symbol.for("react.element"),Zw=Symbol.for("react.portal"),ek=Symbol.for("react.fragment"),tk=Symbol.for("react.strict_mode"),nk=Symbol.for("react.profiler"),rk=Symbol.for("react.provider"),ik=Symbol.for("react.context"),sk=Symbol.for("react.forward_ref"),ok=Symbol.for("react.suspense"),lk=Symbol.for("react.memo"),ak=Symbol.for("react.lazy"),Qp=Symbol.iterator;function uk(e){return e===null||typeof e!="object"?null:(e=Qp&&e[Qp]||e["@@iterator"],typeof e=="function"?e:null)}var Iy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ty=Object.assign,Ay={};function Ts(e,t,n){this.props=e,this.context=t,this.refs=Ay,this.updater=n||Iy}Ts.prototype.isReactComponent={};Ts.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")};Ts.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ry(){}Ry.prototype=Ts.prototype;function ih(e,t,n){this.props=e,this.context=t,this.refs=Ay,this.updater=n||Iy}var sh=ih.prototype=new Ry;sh.constructor=ih;Ty(sh,Ts.prototype);sh.isPureReactComponent=!0;var Kp=Array.isArray,Ly=Object.prototype.hasOwnProperty,oh={current:null},My={key:!0,ref:!0,__self:!0,__source:!0};function Oy(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)Ly.call(t,r)&&!My.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];i.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:dl,type:e,key:s,ref:o,props:i,_owner:oh.current}}function ck(e,t){return{$$typeof:dl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function lh(e){return typeof e=="object"&&e!==null&&e.$$typeof===dl}function dk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Xp=/\/+/g;function tc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?dk(""+e.key):t.toString(36)}function ea(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 dl:case Zw:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+tc(o,0):r,Kp(i)?(n="",e!=null&&(n=e.replace(Xp,"$&/")+"/"),ea(i,t,n,"",function(u){return u})):i!=null&&(lh(i)&&(i=ck(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Xp,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",Kp(e))for(var l=0;l<e.length;l++){s=e[l];var a=r+tc(s,l);o+=ea(s,t,n,a,i)}else if(a=uk(e),typeof a=="function")for(e=a.call(e),l=0;!(s=e.next()).done;)s=s.value,a=r+tc(s,l++),o+=ea(s,t,n,a,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 _l(e,t,n){if(e==null)return e;var r=[],i=0;return ea(e,r,"","",function(s){return t.call(n,s,i++)}),r}function fk(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 pt={current:null},ta={transition:null},hk={ReactCurrentDispatcher:pt,ReactCurrentBatchConfig:ta,ReactCurrentOwner:oh};function Dy(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:_l,forEach:function(e,t,n){_l(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return _l(e,function(){t++}),t},toArray:function(e){return _l(e,function(t){return t})||[]},only:function(e){if(!lh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=Ts;oe.Fragment=ek;oe.Profiler=nk;oe.PureComponent=ih;oe.StrictMode=tk;oe.Suspense=ok;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hk;oe.act=Dy;oe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Ty({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=oh.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)Ly.call(t,a)&&!My.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:dl,type:e.type,key:i,ref:s,props:r,_owner:o}};oe.createContext=function(e){return e={$$typeof:ik,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:rk,_context:e},e.Consumer=e};oe.createElement=Oy;oe.createFactory=function(e){var t=Oy.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:sk,render:e}};oe.isValidElement=lh;oe.lazy=function(e){return{$$typeof:ak,_payload:{_status:-1,_result:e},_init:fk}};oe.memo=function(e,t){return{$$typeof:lk,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=ta.transition;ta.transition={};try{e()}finally{ta.transition=t}};oe.unstable_act=Dy;oe.useCallback=function(e,t){return pt.current.useCallback(e,t)};oe.useContext=function(e){return pt.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return pt.current.useDeferredValue(e)};oe.useEffect=function(e,t){return pt.current.useEffect(e,t)};oe.useId=function(){return pt.current.useId()};oe.useImperativeHandle=function(e,t,n){return pt.current.useImperativeHandle(e,t,n)};oe.useInsertionEffect=function(e,t){return pt.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return pt.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return pt.current.useMemo(e,t)};oe.useReducer=function(e,t,n){return pt.current.useReducer(e,t,n)};oe.useRef=function(e){return pt.current.useRef(e)};oe.useState=function(e){return pt.current.useState(e)};oe.useSyncExternalStore=function(e,t,n){return pt.current.useSyncExternalStore(e,t,n)};oe.useTransition=function(){return pt.current.useTransition()};oe.version="18.3.1";Py.exports=oe;var j=Py.exports;const El=rh(j);/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-jsx-runtime.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var pk=j,mk=Symbol.for("react.element"),gk=Symbol.for("react.fragment"),xk=Object.prototype.hasOwnProperty,yk=pk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bk={key:!0,ref:!0,__self:!0,__source:!0};function $y(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)xk.call(t,r)&&!bk.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:mk,type:e,key:s,ref:o,props:i,_owner:yk.current}}pu.Fragment=gk;pu.jsx=$y;pu.jsxs=$y;jy.exports=pu;var c=jy.exports,Fy={exports:{}},$t={},zy={exports:{}},By={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/(function(e){function t($,q){var S=$.length;$.push(q);e:for(;0<S;){var X=S-1>>>1,ue=$[X];if(0<i(ue,q))$[X]=q,$[S]=ue,S=X;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var q=$[0],S=$.pop();if(S!==q){$[0]=S;e:for(var X=0,ue=$.length,_=ue>>>1;X<_;){var ie=2*(X+1)-1,He=$[ie],Q=ie+1,Me=$[Q];if(0>i(He,S))Q<ue&&0>i(Me,He)?($[X]=Me,$[Q]=S,X=Q):($[X]=He,$[ie]=S,X=ie);else if(Q<ue&&0>i(Me,S))$[X]=Me,$[Q]=S,X=Q;else break e}}return q}function i($,q){var S=$.sortIndex-q.sortIndex;return S!==0?S:$.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var a=[],u=[],f=1,d=null,h=3,p=!1,m=!1,x=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b($){for(var q=n(u);q!==null;){if(q.callback===null)r(u);else if(q.startTime<=$)r(u),q.sortIndex=q.expirationTime,t(a,q);else break;q=n(u)}}function w($){if(x=!1,b($),!m)if(n(a)!==null)m=!0,re(C);else{var q=n(u);q!==null&&fe(w,q.startTime-$)}}function C($,q){m=!1,x&&(x=!1,g(I),I=-1),p=!0;var S=h;try{for(b(q),d=n(a);d!==null&&(!(d.expirationTime>q)||$&&!R());){var X=d.callback;if(typeof X=="function"){d.callback=null,h=d.priorityLevel;var ue=X(d.expirationTime<=q);q=e.unstable_now(),typeof ue=="function"?d.callback=ue:d===n(a)&&r(a),b(q)}else r(a);d=n(a)}if(d!==null)var _=!0;else{var ie=n(u);ie!==null&&fe(w,ie.startTime-q),_=!1}return _}finally{d=null,h=S,p=!1}}var k=!1,P=null,I=-1,A=5,N=-1;function R(){return!(e.unstable_now()-N<A)}function L(){if(P!==null){var $=e.unstable_now();N=$;var q=!0;try{q=P(!0,$)}finally{q?V():(k=!1,P=null)}}else k=!1}var V;if(typeof y=="function")V=function(){y(L)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,G=W.port2;W.port1.onmessage=L,V=function(){G.postMessage(null)}}else V=function(){v(L,0)};function re($){P=$,k||(k=!0,V())}function fe($,q){I=v(function(){$(e.unstable_now())},q)}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($){$.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,re(C))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function($){switch(h){case 1:case 2:case 3:var q=3;break;default:q=h}var S=h;h=q;try{return $()}finally{h=S}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,q){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var S=h;h=$;try{return q()}finally{h=S}},e.unstable_scheduleCallback=function($,q,S){var X=e.unstable_now();switch(typeof S=="object"&&S!==null?(S=S.delay,S=typeof S=="number"&&0<S?X+S:X):S=X,$){case 1:var ue=-1;break;case 2:ue=250;break;case 5:ue=1073741823;break;case 4:ue=1e4;break;default:ue=5e3}return ue=S+ue,$={id:f++,callback:q,priorityLevel:$,startTime:S,expirationTime:ue,sortIndex:-1},S>X?($.sortIndex=S,t(u,$),n(a)===null&&$===n(u)&&(x?(g(I),I=-1):x=!0,fe(w,S-X))):($.sortIndex=ue,t(a,$),m||p||(m=!0,re(C))),$},e.unstable_shouldYield=R,e.unstable_wrapCallback=function($){var q=h;return function(){var S=h;h=q;try{return $.apply(this,arguments)}finally{h=S}}}})(By);zy.exports=By;var vk=zy.exports;/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var wk=j,Dt=vk;function O(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 Uy=new Set,Io={};function Ci(e,t){ks(e,t),ks(e+"Capture",t)}function ks(e,t){for(Io[e]=t,e=0;e<t.length;e++)Uy.add(t[e])}var qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pd=Object.prototype.hasOwnProperty,kk=/^[: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]*$/,Yp={},Jp={};function Sk(e){return pd.call(Jp,e)?!0:pd.call(Yp,e)?!1:kk.test(e)?Jp[e]=!0:(Yp[e]=!0,!1)}function Ck(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 _k(e,t,n,r){if(t===null||typeof t>"u"||Ck(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 mt(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 Ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ye[e]=new mt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ye[t]=new mt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ye[e]=new mt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ye[e]=new mt(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){Ye[e]=new mt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ye[e]=new mt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ye[e]=new mt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ye[e]=new mt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ye[e]=new mt(e,5,!1,e.toLowerCase(),null,!1,!1)});var ah=/[\-:]([a-z])/g;function uh(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(ah,uh);Ye[t]=new mt(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(ah,uh);Ye[t]=new mt(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(ah,uh);Ye[t]=new mt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ye[e]=new mt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ye.xlinkHref=new mt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ye[e]=new mt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ch(e,t,n,r){var i=Ye.hasOwnProperty(t)?Ye[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(_k(t,n,i,r)&&(n=null),r||i===null?Sk(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 Kn=wk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Nl=Symbol.for("react.element"),zi=Symbol.for("react.portal"),Bi=Symbol.for("react.fragment"),dh=Symbol.for("react.strict_mode"),md=Symbol.for("react.profiler"),Gy=Symbol.for("react.provider"),Hy=Symbol.for("react.context"),fh=Symbol.for("react.forward_ref"),gd=Symbol.for("react.suspense"),xd=Symbol.for("react.suspense_list"),hh=Symbol.for("react.memo"),lr=Symbol.for("react.lazy"),qy=Symbol.for("react.offscreen"),Zp=Symbol.iterator;function Vs(e){return e===null||typeof e!="object"?null:(e=Zp&&e[Zp]||e["@@iterator"],typeof e=="function"?e:null)}var je=Object.assign,nc;function oo(e){if(nc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);nc=t&&t[1]||""}return`
|
|
35
|
+
`+nc+e}var rc=!1;function ic(e,t){if(!e||rc)return"";rc=!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(`
|
|
36
|
+
`),s=r.stack.split(`
|
|
37
|
+
`),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var a=`
|
|
38
|
+
`+i[o].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=o&&0<=l);break}}}finally{rc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?oo(e):""}function Ek(e){switch(e.tag){case 5:return oo(e.type);case 16:return oo("Lazy");case 13:return oo("Suspense");case 19:return oo("SuspenseList");case 0:case 2:case 15:return e=ic(e.type,!1),e;case 11:return e=ic(e.type.render,!1),e;case 1:return e=ic(e.type,!0),e;default:return""}}function yd(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 Bi:return"Fragment";case zi:return"Portal";case md:return"Profiler";case dh:return"StrictMode";case gd:return"Suspense";case xd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Hy:return(e.displayName||"Context")+".Consumer";case Gy:return(e._context.displayName||"Context")+".Provider";case fh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case hh:return t=e.displayName||null,t!==null?t:yd(e.type)||"Memo";case lr:t=e._payload,e=e._init;try{return yd(e(t))}catch{}}return null}function Nk(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 yd(t);case 8:return t===dh?"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 Dr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function jk(e){var t=Wy(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 jl(e){e._valueTracker||(e._valueTracker=jk(e))}function Vy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Wy(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function va(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 bd(e,t){var n=t.checked;return je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function em(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Dr(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 Qy(e,t){t=t.checked,t!=null&&ch(e,"checked",t,!1)}function vd(e,t){Qy(e,t);var n=Dr(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")?wd(e,t.type,n):t.hasOwnProperty("defaultValue")&&wd(e,t.type,Dr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function tm(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 wd(e,t,n){(t!=="number"||va(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var lo=Array.isArray;function Ji(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=""+Dr(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 kd(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(O(91));return je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function nm(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(O(92));if(lo(n)){if(1<n.length)throw Error(O(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Dr(n)}}function Ky(e,t){var n=Dr(t.value),r=Dr(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 rm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Xy(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 Sd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Xy(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Pl,Yy=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(Pl=Pl||document.createElement("div"),Pl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Pl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function To(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var po={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Pk=["Webkit","ms","Moz","O"];Object.keys(po).forEach(function(e){Pk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),po[t]=po[e]})});function Jy(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||po.hasOwnProperty(e)&&po[e]?(""+t).trim():t+"px"}function Zy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Jy(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Ik=je({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Cd(e,t){if(t){if(Ik[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(O(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(O(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(O(61))}if(t.style!=null&&typeof t.style!="object")throw Error(O(62))}}function _d(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 Ed=null;function ph(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nd=null,Zi=null,es=null;function im(e){if(e=pl(e)){if(typeof Nd!="function")throw Error(O(280));var t=e.stateNode;t&&(t=bu(t),Nd(e.stateNode,e.type,t))}}function e0(e){Zi?es?es.push(e):es=[e]:Zi=e}function t0(){if(Zi){var e=Zi,t=es;if(es=Zi=null,im(e),t)for(e=0;e<t.length;e++)im(t[e])}}function n0(e,t){return e(t)}function r0(){}var sc=!1;function i0(e,t,n){if(sc)return e(t,n);sc=!0;try{return n0(e,t,n)}finally{sc=!1,(Zi!==null||es!==null)&&(r0(),t0())}}function Ao(e,t){var n=e.stateNode;if(n===null)return null;var r=bu(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(O(231,t,typeof n));return n}var jd=!1;if(qn)try{var Qs={};Object.defineProperty(Qs,"passive",{get:function(){jd=!0}}),window.addEventListener("test",Qs,Qs),window.removeEventListener("test",Qs,Qs)}catch{jd=!1}function Tk(e,t,n,r,i,s,o,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(f){this.onError(f)}}var mo=!1,wa=null,ka=!1,Pd=null,Ak={onError:function(e){mo=!0,wa=e}};function Rk(e,t,n,r,i,s,o,l,a){mo=!1,wa=null,Tk.apply(Ak,arguments)}function Lk(e,t,n,r,i,s,o,l,a){if(Rk.apply(this,arguments),mo){if(mo){var u=wa;mo=!1,wa=null}else throw Error(O(198));ka||(ka=!0,Pd=u)}}function _i(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 s0(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 sm(e){if(_i(e)!==e)throw Error(O(188))}function Mk(e){var t=e.alternate;if(!t){if(t=_i(e),t===null)throw Error(O(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 sm(i),e;if(s===r)return sm(i),t;s=s.sibling}throw Error(O(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o)throw Error(O(189))}}if(n.alternate!==r)throw Error(O(190))}if(n.tag!==3)throw Error(O(188));return n.stateNode.current===n?e:t}function o0(e){return e=Mk(e),e!==null?l0(e):null}function l0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=l0(e);if(t!==null)return t;e=e.sibling}return null}var a0=Dt.unstable_scheduleCallback,om=Dt.unstable_cancelCallback,Ok=Dt.unstable_shouldYield,Dk=Dt.unstable_requestPaint,Le=Dt.unstable_now,$k=Dt.unstable_getCurrentPriorityLevel,mh=Dt.unstable_ImmediatePriority,u0=Dt.unstable_UserBlockingPriority,Sa=Dt.unstable_NormalPriority,Fk=Dt.unstable_LowPriority,c0=Dt.unstable_IdlePriority,mu=null,vn=null;function zk(e){if(vn&&typeof vn.onCommitFiberRoot=="function")try{vn.onCommitFiberRoot(mu,e,void 0,(e.current.flags&128)===128)}catch{}}var on=Math.clz32?Math.clz32:Gk,Bk=Math.log,Uk=Math.LN2;function Gk(e){return e>>>=0,e===0?32:31-(Bk(e)/Uk|0)|0}var Il=64,Tl=4194304;function ao(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 Ca(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 l=o&~i;l!==0?r=ao(l):(s&=o,s!==0&&(r=ao(s)))}else o=n&~i,o!==0?r=ao(o):s!==0&&(r=ao(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-on(t),i=1<<n,r|=e[n],t&=~i;return r}function Hk(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 qk(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-on(s),l=1<<o,a=i[o];a===-1?(!(l&n)||l&r)&&(i[o]=Hk(l,t)):a<=t&&(e.expiredLanes|=l),s&=~l}}function Id(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function d0(){var e=Il;return Il<<=1,!(Il&4194240)&&(Il=64),e}function oc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function fl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-on(t),e[t]=n}function Wk(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-on(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function gh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-on(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ge=0;function f0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var h0,xh,p0,m0,g0,Td=!1,Al=[],Er=null,Nr=null,jr=null,Ro=new Map,Lo=new Map,cr=[],Vk="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 lm(e,t){switch(e){case"focusin":case"focusout":Er=null;break;case"dragenter":case"dragleave":Nr=null;break;case"mouseover":case"mouseout":jr=null;break;case"pointerover":case"pointerout":Ro.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lo.delete(t.pointerId)}}function Ks(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=pl(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Qk(e,t,n,r,i){switch(t){case"focusin":return Er=Ks(Er,e,t,n,r,i),!0;case"dragenter":return Nr=Ks(Nr,e,t,n,r,i),!0;case"mouseover":return jr=Ks(jr,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Ro.set(s,Ks(Ro.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Lo.set(s,Ks(Lo.get(s)||null,e,t,n,r,i)),!0}return!1}function x0(e){var t=Xr(e.target);if(t!==null){var n=_i(t);if(n!==null){if(t=n.tag,t===13){if(t=s0(n),t!==null){e.blockedOn=t,g0(e.priority,function(){p0(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 na(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ad(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ed=r,n.target.dispatchEvent(r),Ed=null}else return t=pl(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function am(e,t,n){na(e)&&n.delete(t)}function Kk(){Td=!1,Er!==null&&na(Er)&&(Er=null),Nr!==null&&na(Nr)&&(Nr=null),jr!==null&&na(jr)&&(jr=null),Ro.forEach(am),Lo.forEach(am)}function Xs(e,t){e.blockedOn===t&&(e.blockedOn=null,Td||(Td=!0,Dt.unstable_scheduleCallback(Dt.unstable_NormalPriority,Kk)))}function Mo(e){function t(i){return Xs(i,e)}if(0<Al.length){Xs(Al[0],e);for(var n=1;n<Al.length;n++){var r=Al[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Er!==null&&Xs(Er,e),Nr!==null&&Xs(Nr,e),jr!==null&&Xs(jr,e),Ro.forEach(t),Lo.forEach(t),n=0;n<cr.length;n++)r=cr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<cr.length&&(n=cr[0],n.blockedOn===null);)x0(n),n.blockedOn===null&&cr.shift()}var ts=Kn.ReactCurrentBatchConfig,_a=!0;function Xk(e,t,n,r){var i=ge,s=ts.transition;ts.transition=null;try{ge=1,yh(e,t,n,r)}finally{ge=i,ts.transition=s}}function Yk(e,t,n,r){var i=ge,s=ts.transition;ts.transition=null;try{ge=4,yh(e,t,n,r)}finally{ge=i,ts.transition=s}}function yh(e,t,n,r){if(_a){var i=Ad(e,t,n,r);if(i===null)gc(e,t,r,Ea,n),lm(e,r);else if(Qk(i,e,t,n,r))r.stopPropagation();else if(lm(e,r),t&4&&-1<Vk.indexOf(e)){for(;i!==null;){var s=pl(i);if(s!==null&&h0(s),s=Ad(e,t,n,r),s===null&&gc(e,t,r,Ea,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else gc(e,t,r,null,n)}}var Ea=null;function Ad(e,t,n,r){if(Ea=null,e=ph(r),e=Xr(e),e!==null)if(t=_i(e),t===null)e=null;else if(n=t.tag,n===13){if(e=s0(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 Ea=e,null}function y0(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($k()){case mh:return 1;case u0:return 4;case Sa:case Fk:return 16;case c0:return 536870912;default:return 16}default:return 16}}var Cr=null,bh=null,ra=null;function b0(){if(ra)return ra;var e,t=bh,n=t.length,r,i="value"in Cr?Cr.value:Cr.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 ra=i.slice(e,1<r?1-r:void 0)}function ia(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 Rl(){return!0}function um(){return!1}function Ft(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 l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Rl:um,this.isPropagationStopped=um,this}return je(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Rl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Rl)},persist:function(){},isPersistent:Rl}),t}var As={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vh=Ft(As),hl=je({},As,{view:0,detail:0}),Jk=Ft(hl),lc,ac,Ys,gu=je({},hl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wh,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!==Ys&&(Ys&&e.type==="mousemove"?(lc=e.screenX-Ys.screenX,ac=e.screenY-Ys.screenY):ac=lc=0,Ys=e),lc)},movementY:function(e){return"movementY"in e?e.movementY:ac}}),cm=Ft(gu),Zk=je({},gu,{dataTransfer:0}),eS=Ft(Zk),tS=je({},hl,{relatedTarget:0}),uc=Ft(tS),nS=je({},As,{animationName:0,elapsedTime:0,pseudoElement:0}),rS=Ft(nS),iS=je({},As,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sS=Ft(iS),oS=je({},As,{data:0}),dm=Ft(oS),lS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aS={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"},uS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uS[e])?!!t[e]:!1}function wh(){return cS}var dS=je({},hl,{key:function(e){if(e.key){var t=lS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ia(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?aS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wh,charCode:function(e){return e.type==="keypress"?ia(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ia(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fS=Ft(dS),hS=je({},gu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fm=Ft(hS),pS=je({},hl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wh}),mS=Ft(pS),gS=je({},As,{propertyName:0,elapsedTime:0,pseudoElement:0}),xS=Ft(gS),yS=je({},gu,{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}),bS=Ft(yS),vS=[9,13,27,32],kh=qn&&"CompositionEvent"in window,go=null;qn&&"documentMode"in document&&(go=document.documentMode);var wS=qn&&"TextEvent"in window&&!go,v0=qn&&(!kh||go&&8<go&&11>=go),hm=" ",pm=!1;function w0(e,t){switch(e){case"keyup":return vS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function k0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ui=!1;function kS(e,t){switch(e){case"compositionend":return k0(t);case"keypress":return t.which!==32?null:(pm=!0,hm);case"textInput":return e=t.data,e===hm&&pm?null:e;default:return null}}function SS(e,t){if(Ui)return e==="compositionend"||!kh&&w0(e,t)?(e=b0(),ra=bh=Cr=null,Ui=!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 v0&&t.locale!=="ko"?null:t.data;default:return null}}var CS={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 mm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!CS[e.type]:t==="textarea"}function S0(e,t,n,r){e0(r),t=Na(t,"onChange"),0<t.length&&(n=new vh("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var xo=null,Oo=null;function _S(e){L0(e,0)}function xu(e){var t=qi(e);if(Vy(t))return e}function ES(e,t){if(e==="change")return t}var C0=!1;if(qn){var cc;if(qn){var dc="oninput"in document;if(!dc){var gm=document.createElement("div");gm.setAttribute("oninput","return;"),dc=typeof gm.oninput=="function"}cc=dc}else cc=!1;C0=cc&&(!document.documentMode||9<document.documentMode)}function xm(){xo&&(xo.detachEvent("onpropertychange",_0),Oo=xo=null)}function _0(e){if(e.propertyName==="value"&&xu(Oo)){var t=[];S0(t,Oo,e,ph(e)),i0(_S,t)}}function NS(e,t,n){e==="focusin"?(xm(),xo=t,Oo=n,xo.attachEvent("onpropertychange",_0)):e==="focusout"&&xm()}function jS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xu(Oo)}function PS(e,t){if(e==="click")return xu(t)}function IS(e,t){if(e==="input"||e==="change")return xu(t)}function TS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cn=typeof Object.is=="function"?Object.is:TS;function Do(e,t){if(cn(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(!pd.call(t,i)||!cn(e[i],t[i]))return!1}return!0}function ym(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bm(e,t){var n=ym(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=ym(n)}}function E0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?E0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function N0(){for(var e=window,t=va();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=va(e.document)}return t}function Sh(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 AS(e){var t=N0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&E0(n.ownerDocument.documentElement,n)){if(r!==null&&Sh(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=bm(n,s);var o=bm(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 RS=qn&&"documentMode"in document&&11>=document.documentMode,Gi=null,Rd=null,yo=null,Ld=!1;function vm(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ld||Gi==null||Gi!==va(r)||(r=Gi,"selectionStart"in r&&Sh(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}),yo&&Do(yo,r)||(yo=r,r=Na(Rd,"onSelect"),0<r.length&&(t=new vh("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Gi)))}function Ll(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Hi={animationend:Ll("Animation","AnimationEnd"),animationiteration:Ll("Animation","AnimationIteration"),animationstart:Ll("Animation","AnimationStart"),transitionend:Ll("Transition","TransitionEnd")},fc={},j0={};qn&&(j0=document.createElement("div").style,"AnimationEvent"in window||(delete Hi.animationend.animation,delete Hi.animationiteration.animation,delete Hi.animationstart.animation),"TransitionEvent"in window||delete Hi.transitionend.transition);function yu(e){if(fc[e])return fc[e];if(!Hi[e])return e;var t=Hi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in j0)return fc[e]=t[n];return e}var P0=yu("animationend"),I0=yu("animationiteration"),T0=yu("animationstart"),A0=yu("transitionend"),R0=new Map,wm="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 Fr(e,t){R0.set(e,t),Ci(t,[e])}for(var hc=0;hc<wm.length;hc++){var pc=wm[hc],LS=pc.toLowerCase(),MS=pc[0].toUpperCase()+pc.slice(1);Fr(LS,"on"+MS)}Fr(P0,"onAnimationEnd");Fr(I0,"onAnimationIteration");Fr(T0,"onAnimationStart");Fr("dblclick","onDoubleClick");Fr("focusin","onFocus");Fr("focusout","onBlur");Fr(A0,"onTransitionEnd");ks("onMouseEnter",["mouseout","mouseover"]);ks("onMouseLeave",["mouseout","mouseover"]);ks("onPointerEnter",["pointerout","pointerover"]);ks("onPointerLeave",["pointerout","pointerover"]);Ci("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ci("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ci("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ci("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ci("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ci("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uo="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(" "),OS=new Set("cancel close invalid load scroll toggle".split(" ").concat(uo));function km(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Lk(r,t,void 0,e),e.currentTarget=null}function L0(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 l=r[o],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==s&&i.isPropagationStopped())break e;km(i,l,u),s=a}else for(o=0;o<r.length;o++){if(l=r[o],a=l.instance,u=l.currentTarget,l=l.listener,a!==s&&i.isPropagationStopped())break e;km(i,l,u),s=a}}}if(ka)throw e=Pd,ka=!1,Pd=null,e}function ke(e,t){var n=t[Fd];n===void 0&&(n=t[Fd]=new Set);var r=e+"__bubble";n.has(r)||(M0(t,e,2,!1),n.add(r))}function mc(e,t,n){var r=0;t&&(r|=4),M0(n,e,r,t)}var Ml="_reactListening"+Math.random().toString(36).slice(2);function $o(e){if(!e[Ml]){e[Ml]=!0,Uy.forEach(function(n){n!=="selectionchange"&&(OS.has(n)||mc(n,!1,e),mc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ml]||(t[Ml]=!0,mc("selectionchange",!1,t))}}function M0(e,t,n,r){switch(y0(t)){case 1:var i=Xk;break;case 4:i=Yk;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!jd||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 gc(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 l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var a=o.tag;if((a===3||a===4)&&(a=o.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;o=o.return}for(;l!==null;){if(o=Xr(l),o===null)return;if(a=o.tag,a===5||a===6){r=s=o;continue e}l=l.parentNode}}r=r.return}i0(function(){var u=s,f=ph(n),d=[];e:{var h=R0.get(e);if(h!==void 0){var p=vh,m=e;switch(e){case"keypress":if(ia(n)===0)break e;case"keydown":case"keyup":p=fS;break;case"focusin":m="focus",p=uc;break;case"focusout":m="blur",p=uc;break;case"beforeblur":case"afterblur":p=uc;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":p=cm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=eS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=mS;break;case P0:case I0:case T0:p=rS;break;case A0:p=xS;break;case"scroll":p=Jk;break;case"wheel":p=bS;break;case"copy":case"cut":case"paste":p=sS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=fm}var x=(t&4)!==0,v=!x&&e==="scroll",g=x?h!==null?h+"Capture":null:h;x=[];for(var y=u,b;y!==null;){b=y;var w=b.stateNode;if(b.tag===5&&w!==null&&(b=w,g!==null&&(w=Ao(y,g),w!=null&&x.push(Fo(y,w,b)))),v)break;y=y.return}0<x.length&&(h=new p(h,m,null,n,f),d.push({event:h,listeners:x}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Ed&&(m=n.relatedTarget||n.fromElement)&&(Xr(m)||m[Wn]))break e;if((p||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?Xr(m):null,m!==null&&(v=_i(m),m!==v||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(x=cm,w="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=fm,w="onPointerLeave",g="onPointerEnter",y="pointer"),v=p==null?h:qi(p),b=m==null?h:qi(m),h=new x(w,y+"leave",p,n,f),h.target=v,h.relatedTarget=b,w=null,Xr(f)===u&&(x=new x(g,y+"enter",m,n,f),x.target=b,x.relatedTarget=v,w=x),v=w,p&&m)t:{for(x=p,g=m,y=0,b=x;b;b=Ti(b))y++;for(b=0,w=g;w;w=Ti(w))b++;for(;0<y-b;)x=Ti(x),y--;for(;0<b-y;)g=Ti(g),b--;for(;y--;){if(x===g||g!==null&&x===g.alternate)break t;x=Ti(x),g=Ti(g)}x=null}else x=null;p!==null&&Sm(d,h,p,x,!1),m!==null&&v!==null&&Sm(d,v,m,x,!0)}}e:{if(h=u?qi(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var C=ES;else if(mm(h))if(C0)C=IS;else{C=jS;var k=NS}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=PS);if(C&&(C=C(e,u))){S0(d,C,n,f);break e}k&&k(e,h,u),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&wd(h,"number",h.value)}switch(k=u?qi(u):window,e){case"focusin":(mm(k)||k.contentEditable==="true")&&(Gi=k,Rd=u,yo=null);break;case"focusout":yo=Rd=Gi=null;break;case"mousedown":Ld=!0;break;case"contextmenu":case"mouseup":case"dragend":Ld=!1,vm(d,n,f);break;case"selectionchange":if(RS)break;case"keydown":case"keyup":vm(d,n,f)}var P;if(kh)e:{switch(e){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else Ui?w0(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(v0&&n.locale!=="ko"&&(Ui||I!=="onCompositionStart"?I==="onCompositionEnd"&&Ui&&(P=b0()):(Cr=f,bh="value"in Cr?Cr.value:Cr.textContent,Ui=!0)),k=Na(u,I),0<k.length&&(I=new dm(I,e,null,n,f),d.push({event:I,listeners:k}),P?I.data=P:(P=k0(n),P!==null&&(I.data=P)))),(P=wS?kS(e,n):SS(e,n))&&(u=Na(u,"onBeforeInput"),0<u.length&&(f=new dm("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:u}),f.data=P))}L0(d,t)})}function Fo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Na(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Ao(e,n),s!=null&&r.unshift(Fo(e,s,i)),s=Ao(e,t),s!=null&&r.push(Fo(e,s,i))),e=e.return}return r}function Ti(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Sm(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,i?(a=Ao(n,s),a!=null&&o.unshift(Fo(n,a,l))):i||(a=Ao(n,s),a!=null&&o.push(Fo(n,a,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var DS=/\r\n?/g,$S=/\u0000|\uFFFD/g;function Cm(e){return(typeof e=="string"?e:""+e).replace(DS,`
|
|
39
|
+
`).replace($S,"")}function Ol(e,t,n){if(t=Cm(t),Cm(e)!==t&&n)throw Error(O(425))}function ja(){}var Md=null,Od=null;function Dd(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 $d=typeof setTimeout=="function"?setTimeout:void 0,FS=typeof clearTimeout=="function"?clearTimeout:void 0,_m=typeof Promise=="function"?Promise:void 0,zS=typeof queueMicrotask=="function"?queueMicrotask:typeof _m<"u"?function(e){return _m.resolve(null).then(e).catch(BS)}:$d;function BS(e){setTimeout(function(){throw e})}function xc(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),Mo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Mo(t)}function Pr(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 Em(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 Rs=Math.random().toString(36).slice(2),bn="__reactFiber$"+Rs,zo="__reactProps$"+Rs,Wn="__reactContainer$"+Rs,Fd="__reactEvents$"+Rs,US="__reactListeners$"+Rs,GS="__reactHandles$"+Rs;function Xr(e){var t=e[bn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Wn]||n[bn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Em(e);e!==null;){if(n=e[bn])return n;e=Em(e)}return t}e=n,n=e.parentNode}return null}function pl(e){return e=e[bn]||e[Wn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(O(33))}function bu(e){return e[zo]||null}var zd=[],Wi=-1;function zr(e){return{current:e}}function Se(e){0>Wi||(e.current=zd[Wi],zd[Wi]=null,Wi--)}function ve(e,t){Wi++,zd[Wi]=e.current,e.current=t}var $r={},st=zr($r),kt=zr(!1),mi=$r;function Ss(e,t){var n=e.type.contextTypes;if(!n)return $r;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 St(e){return e=e.childContextTypes,e!=null}function Pa(){Se(kt),Se(st)}function Nm(e,t,n){if(st.current!==$r)throw Error(O(168));ve(st,t),ve(kt,n)}function O0(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(O(108,Nk(e)||"Unknown",i));return je({},n,r)}function Ia(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$r,mi=st.current,ve(st,e),ve(kt,kt.current),!0}function jm(e,t,n){var r=e.stateNode;if(!r)throw Error(O(169));n?(e=O0(e,t,mi),r.__reactInternalMemoizedMergedChildContext=e,Se(kt),Se(st),ve(st,e)):Se(kt),ve(kt,n)}var Tn=null,vu=!1,yc=!1;function D0(e){Tn===null?Tn=[e]:Tn.push(e)}function HS(e){vu=!0,D0(e)}function Br(){if(!yc&&Tn!==null){yc=!0;var e=0,t=ge;try{var n=Tn;for(ge=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Tn=null,vu=!1}catch(i){throw Tn!==null&&(Tn=Tn.slice(e+1)),a0(mh,Br),i}finally{ge=t,yc=!1}}return null}var Vi=[],Qi=0,Ta=null,Aa=0,Ut=[],Gt=0,gi=null,Fn=1,zn="";function Wr(e,t){Vi[Qi++]=Aa,Vi[Qi++]=Ta,Ta=e,Aa=t}function $0(e,t,n){Ut[Gt++]=Fn,Ut[Gt++]=zn,Ut[Gt++]=gi,gi=e;var r=Fn;e=zn;var i=32-on(r)-1;r&=~(1<<i),n+=1;var s=32-on(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Fn=1<<32-on(t)+i|n<<i|r,zn=s+e}else Fn=1<<s|n<<i|r,zn=e}function Ch(e){e.return!==null&&(Wr(e,1),$0(e,1,0))}function _h(e){for(;e===Ta;)Ta=Vi[--Qi],Vi[Qi]=null,Aa=Vi[--Qi],Vi[Qi]=null;for(;e===gi;)gi=Ut[--Gt],Ut[Gt]=null,zn=Ut[--Gt],Ut[Gt]=null,Fn=Ut[--Gt],Ut[Gt]=null}var Mt=null,Lt=null,Ce=!1,rn=null;function F0(e,t){var n=Vt(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 Pm(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Mt=e,Lt=Pr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Mt=e,Lt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=gi!==null?{id:Fn,overflow:zn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Vt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Mt=e,Lt=null,!0):!1;default:return!1}}function Bd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ud(e){if(Ce){var t=Lt;if(t){var n=t;if(!Pm(e,t)){if(Bd(e))throw Error(O(418));t=Pr(n.nextSibling);var r=Mt;t&&Pm(e,t)?F0(r,n):(e.flags=e.flags&-4097|2,Ce=!1,Mt=e)}}else{if(Bd(e))throw Error(O(418));e.flags=e.flags&-4097|2,Ce=!1,Mt=e}}}function Im(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Mt=e}function Dl(e){if(e!==Mt)return!1;if(!Ce)return Im(e),Ce=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Dd(e.type,e.memoizedProps)),t&&(t=Lt)){if(Bd(e))throw z0(),Error(O(418));for(;t;)F0(e,t),t=Pr(t.nextSibling)}if(Im(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Lt=Pr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Lt=null}}else Lt=Mt?Pr(e.stateNode.nextSibling):null;return!0}function z0(){for(var e=Lt;e;)e=Pr(e.nextSibling)}function Cs(){Lt=Mt=null,Ce=!1}function Eh(e){rn===null?rn=[e]:rn.push(e)}var qS=Kn.ReactCurrentBatchConfig;function Js(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(O(309));var r=n.stateNode}if(!r)throw Error(O(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 l=i.refs;o===null?delete l[s]:l[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(O(284));if(!n._owner)throw Error(O(290,e))}return e}function $l(e,t){throw e=Object.prototype.toString.call(t),Error(O(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Tm(e){var t=e._init;return t(e._payload)}function B0(e){function t(g,y){if(e){var b=g.deletions;b===null?(g.deletions=[y],g.flags|=16):b.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function r(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function i(g,y){return g=Rr(g,y),g.index=0,g.sibling=null,g}function s(g,y,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<y?(g.flags|=2,y):b):(g.flags|=2,y)):(g.flags|=1048576,y)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,y,b,w){return y===null||y.tag!==6?(y=_c(b,g.mode,w),y.return=g,y):(y=i(y,b),y.return=g,y)}function a(g,y,b,w){var C=b.type;return C===Bi?f(g,y,b.props.children,w,b.key):y!==null&&(y.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===lr&&Tm(C)===y.type)?(w=i(y,b.props),w.ref=Js(g,y,b),w.return=g,w):(w=da(b.type,b.key,b.props,null,g.mode,w),w.ref=Js(g,y,b),w.return=g,w)}function u(g,y,b,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=Ec(b,g.mode,w),y.return=g,y):(y=i(y,b.children||[]),y.return=g,y)}function f(g,y,b,w,C){return y===null||y.tag!==7?(y=pi(b,g.mode,w,C),y.return=g,y):(y=i(y,b),y.return=g,y)}function d(g,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=_c(""+y,g.mode,b),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Nl:return b=da(y.type,y.key,y.props,null,g.mode,b),b.ref=Js(g,null,y),b.return=g,b;case zi:return y=Ec(y,g.mode,b),y.return=g,y;case lr:var w=y._init;return d(g,w(y._payload),b)}if(lo(y)||Vs(y))return y=pi(y,g.mode,b,null),y.return=g,y;$l(g,y)}return null}function h(g,y,b,w){var C=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return C!==null?null:l(g,y,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Nl:return b.key===C?a(g,y,b,w):null;case zi:return b.key===C?u(g,y,b,w):null;case lr:return C=b._init,h(g,y,C(b._payload),w)}if(lo(b)||Vs(b))return C!==null?null:f(g,y,b,w,null);$l(g,b)}return null}function p(g,y,b,w,C){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(b)||null,l(y,g,""+w,C);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Nl:return g=g.get(w.key===null?b:w.key)||null,a(y,g,w,C);case zi:return g=g.get(w.key===null?b:w.key)||null,u(y,g,w,C);case lr:var k=w._init;return p(g,y,b,k(w._payload),C)}if(lo(w)||Vs(w))return g=g.get(b)||null,f(y,g,w,C,null);$l(y,w)}return null}function m(g,y,b,w){for(var C=null,k=null,P=y,I=y=0,A=null;P!==null&&I<b.length;I++){P.index>I?(A=P,P=null):A=P.sibling;var N=h(g,P,b[I],w);if(N===null){P===null&&(P=A);break}e&&P&&N.alternate===null&&t(g,P),y=s(N,y,I),k===null?C=N:k.sibling=N,k=N,P=A}if(I===b.length)return n(g,P),Ce&&Wr(g,I),C;if(P===null){for(;I<b.length;I++)P=d(g,b[I],w),P!==null&&(y=s(P,y,I),k===null?C=P:k.sibling=P,k=P);return Ce&&Wr(g,I),C}for(P=r(g,P);I<b.length;I++)A=p(P,g,I,b[I],w),A!==null&&(e&&A.alternate!==null&&P.delete(A.key===null?I:A.key),y=s(A,y,I),k===null?C=A:k.sibling=A,k=A);return e&&P.forEach(function(R){return t(g,R)}),Ce&&Wr(g,I),C}function x(g,y,b,w){var C=Vs(b);if(typeof C!="function")throw Error(O(150));if(b=C.call(b),b==null)throw Error(O(151));for(var k=C=null,P=y,I=y=0,A=null,N=b.next();P!==null&&!N.done;I++,N=b.next()){P.index>I?(A=P,P=null):A=P.sibling;var R=h(g,P,N.value,w);if(R===null){P===null&&(P=A);break}e&&P&&R.alternate===null&&t(g,P),y=s(R,y,I),k===null?C=R:k.sibling=R,k=R,P=A}if(N.done)return n(g,P),Ce&&Wr(g,I),C;if(P===null){for(;!N.done;I++,N=b.next())N=d(g,N.value,w),N!==null&&(y=s(N,y,I),k===null?C=N:k.sibling=N,k=N);return Ce&&Wr(g,I),C}for(P=r(g,P);!N.done;I++,N=b.next())N=p(P,g,I,N.value,w),N!==null&&(e&&N.alternate!==null&&P.delete(N.key===null?I:N.key),y=s(N,y,I),k===null?C=N:k.sibling=N,k=N);return e&&P.forEach(function(L){return t(g,L)}),Ce&&Wr(g,I),C}function v(g,y,b,w){if(typeof b=="object"&&b!==null&&b.type===Bi&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Nl:e:{for(var C=b.key,k=y;k!==null;){if(k.key===C){if(C=b.type,C===Bi){if(k.tag===7){n(g,k.sibling),y=i(k,b.props.children),y.return=g,g=y;break e}}else if(k.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===lr&&Tm(C)===k.type){n(g,k.sibling),y=i(k,b.props),y.ref=Js(g,k,b),y.return=g,g=y;break e}n(g,k);break}else t(g,k);k=k.sibling}b.type===Bi?(y=pi(b.props.children,g.mode,w,b.key),y.return=g,g=y):(w=da(b.type,b.key,b.props,null,g.mode,w),w.ref=Js(g,y,b),w.return=g,g=w)}return o(g);case zi:e:{for(k=b.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){n(g,y.sibling),y=i(y,b.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else t(g,y);y=y.sibling}y=Ec(b,g.mode,w),y.return=g,g=y}return o(g);case lr:return k=b._init,v(g,y,k(b._payload),w)}if(lo(b))return m(g,y,b,w);if(Vs(b))return x(g,y,b,w);$l(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(n(g,y.sibling),y=i(y,b),y.return=g,g=y):(n(g,y),y=_c(b,g.mode,w),y.return=g,g=y),o(g)):n(g,y)}return v}var _s=B0(!0),U0=B0(!1),Ra=zr(null),La=null,Ki=null,Nh=null;function jh(){Nh=Ki=La=null}function Ph(e){var t=Ra.current;Se(Ra),e._currentValue=t}function Gd(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 ns(e,t){La=e,Nh=Ki=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(wt=!0),e.firstContext=null)}function Xt(e){var t=e._currentValue;if(Nh!==e)if(e={context:e,memoizedValue:t,next:null},Ki===null){if(La===null)throw Error(O(308));Ki=e,La.dependencies={lanes:0,firstContext:e}}else Ki=Ki.next=e;return t}var Yr=null;function Ih(e){Yr===null?Yr=[e]:Yr.push(e)}function G0(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ih(t)):(n.next=i.next,i.next=n),t.interleaved=n,Vn(e,r)}function Vn(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 ar=!1;function Th(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function H0(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 Ir(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Vn(e,n)}return i=r.interleaved,i===null?(t.next=t,Ih(r)):(t.next=i.next,i.next=t),r.interleaved=t,Vn(e,n)}function sa(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,gh(e,n)}}function Am(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 Ma(e,t,n,r){var i=e.updateQueue;ar=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,u=a.next;a.next=null,o===null?s=u:o.next=u,o=a;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=u:l.next=u,f.lastBaseUpdate=a))}if(s!==null){var d=i.baseState;o=0,f=u=a=null,l=s;do{var h=l.lane,p=l.eventTime;if((r&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,x=l;switch(h=t,p=n,x.tag){case 1:if(m=x.payload,typeof m=="function"){d=m.call(p,d,h);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=x.payload,h=typeof m=="function"?m.call(p,d,h):m,h==null)break e;d=je({},d,h);break e;case 2:ar=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=p,a=d):f=f.next=p,o|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(f===null&&(a=d),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=f,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);yi|=o,e.lanes=o,e.memoizedState=d}}function Rm(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(O(191,i));i.call(r)}}}var ml={},wn=zr(ml),Bo=zr(ml),Uo=zr(ml);function Jr(e){if(e===ml)throw Error(O(174));return e}function Ah(e,t){switch(ve(Uo,t),ve(Bo,e),ve(wn,ml),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Sd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Sd(t,e)}Se(wn),ve(wn,t)}function Es(){Se(wn),Se(Bo),Se(Uo)}function q0(e){Jr(Uo.current);var t=Jr(wn.current),n=Sd(t,e.type);t!==n&&(ve(Bo,e),ve(wn,n))}function Rh(e){Bo.current===e&&(Se(wn),Se(Bo))}var Ee=zr(0);function Oa(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 bc=[];function Lh(){for(var e=0;e<bc.length;e++)bc[e]._workInProgressVersionPrimary=null;bc.length=0}var oa=Kn.ReactCurrentDispatcher,vc=Kn.ReactCurrentBatchConfig,xi=0,Ne=null,$e=null,We=null,Da=!1,bo=!1,Go=0,WS=0;function Je(){throw Error(O(321))}function Mh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cn(e[n],t[n]))return!1;return!0}function Oh(e,t,n,r,i,s){if(xi=s,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oa.current=e===null||e.memoizedState===null?XS:YS,e=n(r,i),bo){s=0;do{if(bo=!1,Go=0,25<=s)throw Error(O(301));s+=1,We=$e=null,t.updateQueue=null,oa.current=JS,e=n(r,i)}while(bo)}if(oa.current=$a,t=$e!==null&&$e.next!==null,xi=0,We=$e=Ne=null,Da=!1,t)throw Error(O(300));return e}function Dh(){var e=Go!==0;return Go=0,e}function pn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?Ne.memoizedState=We=e:We=We.next=e,We}function Yt(){if($e===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=We===null?Ne.memoizedState:We.next;if(t!==null)We=t,$e=e;else{if(e===null)throw Error(O(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},We===null?Ne.memoizedState=We=e:We=We.next=e}return We}function Ho(e,t){return typeof t=="function"?t(e):t}function wc(e){var t=Yt(),n=t.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=e;var r=$e,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 l=o=null,a=null,u=s;do{var f=u.lane;if((xi&f)===f)a!==null&&(a=a.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 d={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=d,o=r):a=a.next=d,Ne.lanes|=f,yi|=f}u=u.next}while(u!==null&&u!==s);a===null?o=r:a.next=l,cn(r,t.memoizedState)||(wt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Ne.lanes|=s,yi|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function kc(e){var t=Yt(),n=t.queue;if(n===null)throw Error(O(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);cn(s,t.memoizedState)||(wt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function W0(){}function V0(e,t){var n=Ne,r=Yt(),i=t(),s=!cn(r.memoizedState,i);if(s&&(r.memoizedState=i,wt=!0),r=r.queue,$h(X0.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||We!==null&&We.memoizedState.tag&1){if(n.flags|=2048,qo(9,K0.bind(null,n,r,i,t),void 0,null),Qe===null)throw Error(O(349));xi&30||Q0(n,t,i)}return i}function Q0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function K0(e,t,n,r){t.value=n,t.getSnapshot=r,Y0(t)&&J0(e)}function X0(e,t,n){return n(function(){Y0(t)&&J0(e)})}function Y0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cn(e,n)}catch{return!0}}function J0(e){var t=Vn(e,1);t!==null&&ln(t,e,1,-1)}function Lm(e){var t=pn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:e},t.queue=e,e=e.dispatch=KS.bind(null,Ne,e),[t.memoizedState,e]}function qo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.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 Z0(){return Yt().memoizedState}function la(e,t,n,r){var i=pn();Ne.flags|=e,i.memoizedState=qo(1|t,n,void 0,r===void 0?null:r)}function wu(e,t,n,r){var i=Yt();r=r===void 0?null:r;var s=void 0;if($e!==null){var o=$e.memoizedState;if(s=o.destroy,r!==null&&Mh(r,o.deps)){i.memoizedState=qo(t,n,s,r);return}}Ne.flags|=e,i.memoizedState=qo(1|t,n,s,r)}function Mm(e,t){return la(8390656,8,e,t)}function $h(e,t){return wu(2048,8,e,t)}function eb(e,t){return wu(4,2,e,t)}function tb(e,t){return wu(4,4,e,t)}function nb(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 rb(e,t,n){return n=n!=null?n.concat([e]):null,wu(4,4,nb.bind(null,t,e),n)}function Fh(){}function ib(e,t){var n=Yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function sb(e,t){var n=Yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ob(e,t,n){return xi&21?(cn(n,t)||(n=d0(),Ne.lanes|=n,yi|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,wt=!0),e.memoizedState=n)}function VS(e,t){var n=ge;ge=n!==0&&4>n?n:4,e(!0);var r=vc.transition;vc.transition={};try{e(!1),t()}finally{ge=n,vc.transition=r}}function lb(){return Yt().memoizedState}function QS(e,t,n){var r=Ar(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ab(e))ub(t,n);else if(n=G0(e,t,n,r),n!==null){var i=ht();ln(n,e,r,i),cb(n,t,r)}}function KS(e,t,n){var r=Ar(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ab(e))ub(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,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,cn(l,o)){var a=t.interleaved;a===null?(i.next=i,Ih(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=G0(e,t,i,r),n!==null&&(i=ht(),ln(n,e,r,i),cb(n,t,r))}}function ab(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function ub(e,t){bo=Da=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cb(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gh(e,n)}}var $a={readContext:Xt,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useInsertionEffect:Je,useLayoutEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useMutableSource:Je,useSyncExternalStore:Je,useId:Je,unstable_isNewReconciler:!1},XS={readContext:Xt,useCallback:function(e,t){return pn().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:Mm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,la(4194308,4,nb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return la(4194308,4,e,t)},useInsertionEffect:function(e,t){return la(4,2,e,t)},useMemo:function(e,t){var n=pn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=pn();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=QS.bind(null,Ne,e),[r.memoizedState,e]},useRef:function(e){var t=pn();return e={current:e},t.memoizedState=e},useState:Lm,useDebugValue:Fh,useDeferredValue:function(e){return pn().memoizedState=e},useTransition:function(){var e=Lm(!1),t=e[0];return e=VS.bind(null,e[1]),pn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ne,i=pn();if(Ce){if(n===void 0)throw Error(O(407));n=n()}else{if(n=t(),Qe===null)throw Error(O(349));xi&30||Q0(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Mm(X0.bind(null,r,s,e),[e]),r.flags|=2048,qo(9,K0.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=pn(),t=Qe.identifierPrefix;if(Ce){var n=zn,r=Fn;n=(r&~(1<<32-on(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Go++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=WS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},YS={readContext:Xt,useCallback:ib,useContext:Xt,useEffect:$h,useImperativeHandle:rb,useInsertionEffect:eb,useLayoutEffect:tb,useMemo:sb,useReducer:wc,useRef:Z0,useState:function(){return wc(Ho)},useDebugValue:Fh,useDeferredValue:function(e){var t=Yt();return ob(t,$e.memoizedState,e)},useTransition:function(){var e=wc(Ho)[0],t=Yt().memoizedState;return[e,t]},useMutableSource:W0,useSyncExternalStore:V0,useId:lb,unstable_isNewReconciler:!1},JS={readContext:Xt,useCallback:ib,useContext:Xt,useEffect:$h,useImperativeHandle:rb,useInsertionEffect:eb,useLayoutEffect:tb,useMemo:sb,useReducer:kc,useRef:Z0,useState:function(){return kc(Ho)},useDebugValue:Fh,useDeferredValue:function(e){var t=Yt();return $e===null?t.memoizedState=e:ob(t,$e.memoizedState,e)},useTransition:function(){var e=kc(Ho)[0],t=Yt().memoizedState;return[e,t]},useMutableSource:W0,useSyncExternalStore:V0,useId:lb,unstable_isNewReconciler:!1};function en(e,t){if(e&&e.defaultProps){t=je({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Hd(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ku={isMounted:function(e){return(e=e._reactInternals)?_i(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ht(),i=Ar(e),s=Un(r,i);s.payload=t,n!=null&&(s.callback=n),t=Ir(e,s,i),t!==null&&(ln(t,e,i,r),sa(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ht(),i=Ar(e),s=Un(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Ir(e,s,i),t!==null&&(ln(t,e,i,r),sa(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ht(),r=Ar(e),i=Un(n,r);i.tag=2,t!=null&&(i.callback=t),t=Ir(e,i,r),t!==null&&(ln(t,e,r,n),sa(t,e,r))}};function Om(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?!Do(n,r)||!Do(i,s):!0}function db(e,t,n){var r=!1,i=$r,s=t.contextType;return typeof s=="object"&&s!==null?s=Xt(s):(i=St(t)?mi:st.current,r=t.contextTypes,s=(r=r!=null)?Ss(e,i):$r),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ku,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Dm(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&&ku.enqueueReplaceState(t,t.state,null)}function qd(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Th(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Xt(s):(s=St(t)?mi:st.current,i.context=Ss(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Hd(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&&ku.enqueueReplaceState(i,i.state,null),Ma(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Ns(e,t){try{var n="",r=t;do n+=Ek(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
40
|
+
Error generating stack: `+s.message+`
|
|
41
|
+
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function Sc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Wd(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ZS=typeof WeakMap=="function"?WeakMap:Map;function fb(e,t,n){n=Un(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){za||(za=!0,nf=r),Wd(e,t)},n}function hb(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(){Wd(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Wd(e,t),typeof r!="function"&&(Tr===null?Tr=new Set([this]):Tr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function $m(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ZS;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=hC.bind(null,e,t,n),t.then(e,e))}function Fm(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 zm(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,Ir(n,t,1))),n.lanes|=1),e)}var eC=Kn.ReactCurrentOwner,wt=!1;function ct(e,t,n,r){t.child=e===null?U0(t,null,n,r):_s(t,e.child,n,r)}function Bm(e,t,n,r,i){n=n.render;var s=t.ref;return ns(t,i),r=Oh(e,t,n,r,s,i),n=Dh(),e!==null&&!wt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qn(e,t,i)):(Ce&&n&&Ch(t),t.flags|=1,ct(e,t,r,i),t.child)}function Um(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Vh(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,pb(e,t,s,r,i)):(e=da(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:Do,n(o,r)&&e.ref===t.ref)return Qn(e,t,i)}return t.flags|=1,e=Rr(s,r),e.ref=t.ref,e.return=t,t.child=e}function pb(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Do(s,r)&&e.ref===t.ref)if(wt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(wt=!0);else return t.lanes=e.lanes,Qn(e,t,i)}return Vd(e,t,n,r,i)}function mb(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},ve(Yi,It),It|=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,ve(Yi,It),It|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ve(Yi,It),It|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ve(Yi,It),It|=r;return ct(e,t,i,n),t.child}function gb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Vd(e,t,n,r,i){var s=St(n)?mi:st.current;return s=Ss(t,s),ns(t,i),n=Oh(e,t,n,r,s,i),r=Dh(),e!==null&&!wt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qn(e,t,i)):(Ce&&r&&Ch(t),t.flags|=1,ct(e,t,n,i),t.child)}function Gm(e,t,n,r,i){if(St(n)){var s=!0;Ia(t)}else s=!1;if(ns(t,i),t.stateNode===null)aa(e,t),db(t,n,r),qd(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var a=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Xt(u):(u=St(n)?mi:st.current,u=Ss(t,u));var f=n.getDerivedStateFromProps,d=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||a!==u)&&Dm(t,o,r,u),ar=!1;var h=t.memoizedState;o.state=h,Ma(t,r,o,i),a=t.memoizedState,l!==r||h!==a||kt.current||ar?(typeof f=="function"&&(Hd(t,n,f,r),a=t.memoizedState),(l=ar||Om(t,n,l,r,h,a,u))?(d||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=a),o.props=r,o.state=a,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,H0(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:en(t.type,l),o.props=u,d=t.pendingProps,h=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=Xt(a):(a=St(n)?mi:st.current,a=Ss(t,a));var p=n.getDerivedStateFromProps;(f=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||h!==a)&&Dm(t,o,r,a),ar=!1,h=t.memoizedState,o.state=h,Ma(t,r,o,i);var m=t.memoizedState;l!==d||h!==m||kt.current||ar?(typeof p=="function"&&(Hd(t,n,p,r),m=t.memoizedState),(u=ar||Om(t,n,u,r,h,m,a)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,a)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=a,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Qd(e,t,n,r,s,i)}function Qd(e,t,n,r,i,s){gb(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&jm(t,n,!1),Qn(e,t,s);r=t.stateNode,eC.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=_s(t,e.child,null,s),t.child=_s(t,null,l,s)):ct(e,t,l,s),t.memoizedState=r.state,i&&jm(t,n,!0),t.child}function xb(e){var t=e.stateNode;t.pendingContext?Nm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Nm(e,t.context,!1),Ah(e,t.containerInfo)}function Hm(e,t,n,r,i){return Cs(),Eh(i),t.flags|=256,ct(e,t,n,r),t.child}var Kd={dehydrated:null,treeContext:null,retryLane:0};function Xd(e){return{baseLanes:e,cachePool:null,transitions:null}}function yb(e,t,n){var r=t.pendingProps,i=Ee.current,s=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ve(Ee,i&1),e===null)return Ud(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=_u(o,r,0,null),e=pi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Xd(n),t.memoizedState=Kd,e):zh(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return tC(e,t,o,r,l,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,l=i.sibling;var a={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Rr(i,a),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=Rr(l,s):(s=pi(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?Xd(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Kd,r}return s=e.child,e=s.sibling,r=Rr(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 zh(e,t){return t=_u({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Fl(e,t,n,r){return r!==null&&Eh(r),_s(t,e.child,null,n),e=zh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tC(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Sc(Error(O(422))),Fl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=_u({mode:"visible",children:r.children},i,0,null),s=pi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&_s(t,e.child,null,o),t.child.memoizedState=Xd(o),t.memoizedState=Kd,s);if(!(t.mode&1))return Fl(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(O(419)),r=Sc(s,r,void 0),Fl(e,t,o,r)}if(l=(o&e.childLanes)!==0,wt||l){if(r=Qe,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,Vn(e,i),ln(r,e,i,-1))}return Wh(),r=Sc(Error(O(421))),Fl(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=pC.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Lt=Pr(i.nextSibling),Mt=t,Ce=!0,rn=null,e!==null&&(Ut[Gt++]=Fn,Ut[Gt++]=zn,Ut[Gt++]=gi,Fn=e.id,zn=e.overflow,gi=t),t=zh(t,r.children),t.flags|=4096,t)}function qm(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gd(e.return,t,n)}function Cc(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 bb(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(ct(e,t,r.children,n),r=Ee.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&&qm(e,n,t);else if(e.tag===19)qm(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(ve(Ee,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&&Oa(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(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&&Oa(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,s);break;case"together":Cc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function aa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Qn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),yi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(O(153));if(t.child!==null){for(e=t.child,n=Rr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Rr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function nC(e,t,n){switch(t.tag){case 3:xb(t),Cs();break;case 5:q0(t);break;case 1:St(t.type)&&Ia(t);break;case 4:Ah(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ve(Ra,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ve(Ee,Ee.current&1),t.flags|=128,null):n&t.child.childLanes?yb(e,t,n):(ve(Ee,Ee.current&1),e=Qn(e,t,n),e!==null?e.sibling:null);ve(Ee,Ee.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return bb(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ve(Ee,Ee.current),r)break;return null;case 22:case 23:return t.lanes=0,mb(e,t,n)}return Qn(e,t,n)}var vb,Yd,wb,kb;vb=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}};Yd=function(){};wb=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Jr(wn.current);var s=null;switch(n){case"input":i=bd(e,i),r=bd(e,r),s=[];break;case"select":i=je({},i,{value:void 0}),r=je({},r,{value:void 0}),s=[];break;case"textarea":i=kd(e,i),r=kd(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ja)}Cd(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Io.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var a=r[u];if(l=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in a)a.hasOwnProperty(o)&&l[o]!==a[o]&&(n||(n={}),n[o]=a[o])}else n||(s||(s=[]),s.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(s=s||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(s=s||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Io.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&ke("scroll",e),s||l===a||(s=[])):(s=s||[]).push(u,a))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};kb=function(e,t,n,r){n!==r&&(t.flags|=4)};function Zs(e,t){if(!Ce)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 Ze(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 rC(e,t,n){var r=t.pendingProps;switch(_h(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return St(t.type)&&Pa(),Ze(t),null;case 3:return r=t.stateNode,Es(),Se(kt),Se(st),Lh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Dl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,rn!==null&&(of(rn),rn=null))),Yd(e,t),Ze(t),null;case 5:Rh(t);var i=Jr(Uo.current);if(n=t.type,e!==null&&t.stateNode!=null)wb(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(O(166));return Ze(t),null}if(e=Jr(wn.current),Dl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[bn]=t,r[zo]=s,e=(t.mode&1)!==0,n){case"dialog":ke("cancel",r),ke("close",r);break;case"iframe":case"object":case"embed":ke("load",r);break;case"video":case"audio":for(i=0;i<uo.length;i++)ke(uo[i],r);break;case"source":ke("error",r);break;case"img":case"image":case"link":ke("error",r),ke("load",r);break;case"details":ke("toggle",r);break;case"input":em(r,s),ke("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ke("invalid",r);break;case"textarea":nm(r,s),ke("invalid",r)}Cd(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&Ol(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&Ol(r.textContent,l,e),i=["children",""+l]):Io.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ke("scroll",r)}switch(n){case"input":jl(r),tm(r,s,!0);break;case"textarea":jl(r),rm(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=ja)}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=Xy(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[bn]=t,e[zo]=r,vb(e,t,!1,!1),t.stateNode=e;e:{switch(o=_d(n,r),n){case"dialog":ke("cancel",e),ke("close",e),i=r;break;case"iframe":case"object":case"embed":ke("load",e),i=r;break;case"video":case"audio":for(i=0;i<uo.length;i++)ke(uo[i],e);i=r;break;case"source":ke("error",e),i=r;break;case"img":case"image":case"link":ke("error",e),ke("load",e),i=r;break;case"details":ke("toggle",e),i=r;break;case"input":em(e,r),i=bd(e,r),ke("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=je({},r,{value:void 0}),ke("invalid",e);break;case"textarea":nm(e,r),i=kd(e,r),ke("invalid",e);break;default:i=r}Cd(n,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var a=l[s];s==="style"?Zy(e,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Yy(e,a)):s==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&To(e,a):typeof a=="number"&&To(e,""+a):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Io.hasOwnProperty(s)?a!=null&&s==="onScroll"&&ke("scroll",e):a!=null&&ch(e,s,a,o))}switch(n){case"input":jl(e),tm(e,r,!1);break;case"textarea":jl(e),rm(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Dr(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Ji(e,!!r.multiple,s,!1):r.defaultValue!=null&&Ji(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=ja)}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 Ze(t),null;case 6:if(e&&t.stateNode!=null)kb(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(O(166));if(n=Jr(Uo.current),Jr(wn.current),Dl(t)){if(r=t.stateNode,n=t.memoizedProps,r[bn]=t,(s=r.nodeValue!==n)&&(e=Mt,e!==null))switch(e.tag){case 3:Ol(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ol(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[bn]=t,t.stateNode=r}return Ze(t),null;case 13:if(Se(Ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ce&&Lt!==null&&t.mode&1&&!(t.flags&128))z0(),Cs(),t.flags|=98560,s=!1;else if(s=Dl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(O(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(O(317));s[bn]=t}else Cs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ze(t),s=!1}else rn!==null&&(of(rn),rn=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||Ee.current&1?Be===0&&(Be=3):Wh())),t.updateQueue!==null&&(t.flags|=4),Ze(t),null);case 4:return Es(),Yd(e,t),e===null&&$o(t.stateNode.containerInfo),Ze(t),null;case 10:return Ph(t.type._context),Ze(t),null;case 17:return St(t.type)&&Pa(),Ze(t),null;case 19:if(Se(Ee),s=t.memoizedState,s===null)return Ze(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Zs(s,!1);else{if(Be!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Oa(e),o!==null){for(t.flags|=128,Zs(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 ve(Ee,Ee.current&1|2),t.child}e=e.sibling}s.tail!==null&&Le()>js&&(t.flags|=128,r=!0,Zs(s,!1),t.lanes=4194304)}else{if(!r)if(e=Oa(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Zs(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ce)return Ze(t),null}else 2*Le()-s.renderingStartTime>js&&n!==1073741824&&(t.flags|=128,r=!0,Zs(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=Le(),t.sibling=null,n=Ee.current,ve(Ee,r?n&1|2:n&1),t):(Ze(t),null);case 22:case 23:return qh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?It&1073741824&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),null;case 24:return null;case 25:return null}throw Error(O(156,t.tag))}function iC(e,t){switch(_h(t),t.tag){case 1:return St(t.type)&&Pa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Es(),Se(kt),Se(st),Lh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Rh(t),null;case 13:if(Se(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));Cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(Ee),null;case 4:return Es(),null;case 10:return Ph(t.type._context),null;case 22:case 23:return qh(),null;case 24:return null;default:return null}}var zl=!1,nt=!1,sC=typeof WeakSet=="function"?WeakSet:Set,U=null;function Xi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ie(e,t,r)}else n.current=null}function Jd(e,t,n){try{n()}catch(r){Ie(e,t,r)}}var Wm=!1;function oC(e,t){if(Md=_a,e=N0(),Sh(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,l=-1,a=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(l=o+i),d!==s||r!==0&&d.nodeType!==3||(a=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===n&&++u===i&&(l=o),h===s&&++f===r&&(a=o),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Od={focusedElem:e,selectionRange:n},_a=!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,v=m.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:en(t.type,x),v);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(w){Ie(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return m=Wm,Wm=!1,m}function vo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Jd(t,n,s)}i=i.next}while(i!==r)}}function Su(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 Zd(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 Sb(e){var t=e.alternate;t!==null&&(e.alternate=null,Sb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bn],delete t[zo],delete t[Fd],delete t[US],delete t[GS])),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 Cb(e){return e.tag===5||e.tag===3||e.tag===4}function Vm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cb(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 ef(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=ja));else if(r!==4&&(e=e.child,e!==null))for(ef(e,t,n),e=e.sibling;e!==null;)ef(e,t,n),e=e.sibling}function tf(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(tf(e,t,n),e=e.sibling;e!==null;)tf(e,t,n),e=e.sibling}var Ke=null,nn=!1;function er(e,t,n){for(n=n.child;n!==null;)_b(e,t,n),n=n.sibling}function _b(e,t,n){if(vn&&typeof vn.onCommitFiberUnmount=="function")try{vn.onCommitFiberUnmount(mu,n)}catch{}switch(n.tag){case 5:nt||Xi(n,t);case 6:var r=Ke,i=nn;Ke=null,er(e,t,n),Ke=r,nn=i,Ke!==null&&(nn?(e=Ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ke.removeChild(n.stateNode));break;case 18:Ke!==null&&(nn?(e=Ke,n=n.stateNode,e.nodeType===8?xc(e.parentNode,n):e.nodeType===1&&xc(e,n),Mo(e)):xc(Ke,n.stateNode));break;case 4:r=Ke,i=nn,Ke=n.stateNode.containerInfo,nn=!0,er(e,t,n),Ke=r,nn=i;break;case 0:case 11:case 14:case 15:if(!nt&&(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)&&Jd(n,t,o),i=i.next}while(i!==r)}er(e,t,n);break;case 1:if(!nt&&(Xi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ie(n,t,l)}er(e,t,n);break;case 21:er(e,t,n);break;case 22:n.mode&1?(nt=(r=nt)||n.memoizedState!==null,er(e,t,n),nt=r):er(e,t,n);break;default:er(e,t,n)}}function Qm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new sC),t.forEach(function(r){var i=mC.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Zt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Ke=l.stateNode,nn=!1;break e;case 3:Ke=l.stateNode.containerInfo,nn=!0;break e;case 4:Ke=l.stateNode.containerInfo,nn=!0;break e}l=l.return}if(Ke===null)throw Error(O(160));_b(s,o,i),Ke=null,nn=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(u){Ie(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Eb(t,e),t=t.sibling}function Eb(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Zt(t,e),fn(e),r&4){try{vo(3,e,e.return),Su(3,e)}catch(x){Ie(e,e.return,x)}try{vo(5,e,e.return)}catch(x){Ie(e,e.return,x)}}break;case 1:Zt(t,e),fn(e),r&512&&n!==null&&Xi(n,n.return);break;case 5:if(Zt(t,e),fn(e),r&512&&n!==null&&Xi(n,n.return),e.flags&32){var i=e.stateNode;try{To(i,"")}catch(x){Ie(e,e.return,x)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&Qy(i,s),_d(l,o);var u=_d(l,s);for(o=0;o<a.length;o+=2){var f=a[o],d=a[o+1];f==="style"?Zy(i,d):f==="dangerouslySetInnerHTML"?Yy(i,d):f==="children"?To(i,d):ch(i,f,d,u)}switch(l){case"input":vd(i,s);break;case"textarea":Ky(i,s);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Ji(i,!!s.multiple,p,!1):h!==!!s.multiple&&(s.defaultValue!=null?Ji(i,!!s.multiple,s.defaultValue,!0):Ji(i,!!s.multiple,s.multiple?[]:"",!1))}i[zo]=s}catch(x){Ie(e,e.return,x)}}break;case 6:if(Zt(t,e),fn(e),r&4){if(e.stateNode===null)throw Error(O(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(x){Ie(e,e.return,x)}}break;case 3:if(Zt(t,e),fn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Mo(t.containerInfo)}catch(x){Ie(e,e.return,x)}break;case 4:Zt(t,e),fn(e);break;case 13:Zt(t,e),fn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Gh=Le())),r&4&&Qm(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(nt=(u=nt)||f,Zt(t,e),nt=u):Zt(t,e),fn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(U=e,f=e.child;f!==null;){for(d=U=f;U!==null;){switch(h=U,p=h.child,h.tag){case 0:case 11:case 14:case 15:vo(4,h,h.return);break;case 1:Xi(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(x){Ie(r,n,x)}}break;case 5:Xi(h,h.return);break;case 22:if(h.memoizedState!==null){Xm(d);continue}}p!==null?(p.return=h,U=p):Xm(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{i=d.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=d.stateNode,a=d.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Jy("display",o))}catch(x){Ie(e,e.return,x)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){Ie(e,e.return,x)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Zt(t,e),fn(e),r&4&&Qm(e);break;case 21:break;default:Zt(t,e),fn(e)}}function fn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Cb(n)){var r=n;break e}n=n.return}throw Error(O(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(To(i,""),r.flags&=-33);var s=Vm(e);tf(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Vm(e);ef(e,l,o);break;default:throw Error(O(161))}}catch(a){Ie(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function lC(e,t,n){U=e,Nb(e)}function Nb(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||zl;if(!o){var l=i.alternate,a=l!==null&&l.memoizedState!==null||nt;l=zl;var u=nt;if(zl=o,(nt=a)&&!u)for(U=i;U!==null;)o=U,a=o.child,o.tag===22&&o.memoizedState!==null?Ym(i):a!==null?(a.return=o,U=a):Ym(i);for(;s!==null;)U=s,Nb(s),s=s.sibling;U=i,zl=l,nt=u}Km(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,U=s):Km(e)}}function Km(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:nt||Su(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!nt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:en(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Rm(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}Rm(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&Mo(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(O(163))}nt||t.flags&512&&Zd(t)}catch(h){Ie(t,t.return,h)}}if(t===e){U=null;break}if(n=t.sibling,n!==null){n.return=t.return,U=n;break}U=t.return}}function Xm(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 Ym(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Su(4,t)}catch(a){Ie(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(a){Ie(t,i,a)}}var s=t.return;try{Zd(t)}catch(a){Ie(t,s,a)}break;case 5:var o=t.return;try{Zd(t)}catch(a){Ie(t,o,a)}}}catch(a){Ie(t,t.return,a)}if(t===e){U=null;break}var l=t.sibling;if(l!==null){l.return=t.return,U=l;break}U=t.return}}var aC=Math.ceil,Fa=Kn.ReactCurrentDispatcher,Bh=Kn.ReactCurrentOwner,Kt=Kn.ReactCurrentBatchConfig,de=0,Qe=null,De=null,Xe=0,It=0,Yi=zr(0),Be=0,Wo=null,yi=0,Cu=0,Uh=0,wo=null,vt=null,Gh=0,js=1/0,In=null,za=!1,nf=null,Tr=null,Bl=!1,_r=null,Ba=0,ko=0,rf=null,ua=-1,ca=0;function ht(){return de&6?Le():ua!==-1?ua:ua=Le()}function Ar(e){return e.mode&1?de&2&&Xe!==0?Xe&-Xe:qS.transition!==null?(ca===0&&(ca=d0()),ca):(e=ge,e!==0||(e=window.event,e=e===void 0?16:y0(e.type)),e):1}function ln(e,t,n,r){if(50<ko)throw ko=0,rf=null,Error(O(185));fl(e,n,r),(!(de&2)||e!==Qe)&&(e===Qe&&(!(de&2)&&(Cu|=n),Be===4&&dr(e,Xe)),Ct(e,r),n===1&&de===0&&!(t.mode&1)&&(js=Le()+500,vu&&Br()))}function Ct(e,t){var n=e.callbackNode;qk(e,t);var r=Ca(e,e===Qe?Xe:0);if(r===0)n!==null&&om(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&om(n),t===1)e.tag===0?HS(Jm.bind(null,e)):D0(Jm.bind(null,e)),zS(function(){!(de&6)&&Br()}),n=null;else{switch(f0(r)){case 1:n=mh;break;case 4:n=u0;break;case 16:n=Sa;break;case 536870912:n=c0;break;default:n=Sa}n=Mb(n,jb.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function jb(e,t){if(ua=-1,ca=0,de&6)throw Error(O(327));var n=e.callbackNode;if(rs()&&e.callbackNode!==n)return null;var r=Ca(e,e===Qe?Xe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ua(e,r);else{t=r;var i=de;de|=2;var s=Ib();(Qe!==e||Xe!==t)&&(In=null,js=Le()+500,hi(e,t));do try{dC();break}catch(l){Pb(e,l)}while(!0);jh(),Fa.current=s,de=i,De!==null?t=0:(Qe=null,Xe=0,t=Be)}if(t!==0){if(t===2&&(i=Id(e),i!==0&&(r=i,t=sf(e,i))),t===1)throw n=Wo,hi(e,0),dr(e,r),Ct(e,Le()),n;if(t===6)dr(e,r);else{if(i=e.current.alternate,!(r&30)&&!uC(i)&&(t=Ua(e,r),t===2&&(s=Id(e),s!==0&&(r=s,t=sf(e,s))),t===1))throw n=Wo,hi(e,0),dr(e,r),Ct(e,Le()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(O(345));case 2:Vr(e,vt,In);break;case 3:if(dr(e,r),(r&130023424)===r&&(t=Gh+500-Le(),10<t)){if(Ca(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){ht(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=$d(Vr.bind(null,e,vt,In),t);break}Vr(e,vt,In);break;case 4:if(dr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-on(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=Le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*aC(r/1960))-r,10<r){e.timeoutHandle=$d(Vr.bind(null,e,vt,In),r);break}Vr(e,vt,In);break;case 5:Vr(e,vt,In);break;default:throw Error(O(329))}}}return Ct(e,Le()),e.callbackNode===n?jb.bind(null,e):null}function sf(e,t){var n=wo;return e.current.memoizedState.isDehydrated&&(hi(e,t).flags|=256),e=Ua(e,t),e!==2&&(t=vt,vt=n,t!==null&&of(t)),e}function of(e){vt===null?vt=e:vt.push.apply(vt,e)}function uC(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(!cn(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 dr(e,t){for(t&=~Uh,t&=~Cu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-on(t),r=1<<n;e[n]=-1,t&=~r}}function Jm(e){if(de&6)throw Error(O(327));rs();var t=Ca(e,0);if(!(t&1))return Ct(e,Le()),null;var n=Ua(e,t);if(e.tag!==0&&n===2){var r=Id(e);r!==0&&(t=r,n=sf(e,r))}if(n===1)throw n=Wo,hi(e,0),dr(e,t),Ct(e,Le()),n;if(n===6)throw Error(O(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Vr(e,vt,In),Ct(e,Le()),null}function Hh(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(js=Le()+500,vu&&Br())}}function bi(e){_r!==null&&_r.tag===0&&!(de&6)&&rs();var t=de;de|=1;var n=Kt.transition,r=ge;try{if(Kt.transition=null,ge=1,e)return e()}finally{ge=r,Kt.transition=n,de=t,!(de&6)&&Br()}}function qh(){It=Yi.current,Se(Yi)}function hi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,FS(n)),De!==null)for(n=De.return;n!==null;){var r=n;switch(_h(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Pa();break;case 3:Es(),Se(kt),Se(st),Lh();break;case 5:Rh(r);break;case 4:Es();break;case 13:Se(Ee);break;case 19:Se(Ee);break;case 10:Ph(r.type._context);break;case 22:case 23:qh()}n=n.return}if(Qe=e,De=e=Rr(e.current,null),Xe=It=t,Be=0,Wo=null,Uh=Cu=yi=0,vt=wo=null,Yr!==null){for(t=0;t<Yr.length;t++)if(n=Yr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Yr=null}return e}function Pb(e,t){do{var n=De;try{if(jh(),oa.current=$a,Da){for(var r=Ne.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Da=!1}if(xi=0,We=$e=Ne=null,bo=!1,Go=0,Bh.current=null,n===null||n.return===null){Be=1,Wo=t,De=null;break}e:{var s=e,o=n.return,l=n,a=t;if(t=Xe,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,f=l,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var p=Fm(o);if(p!==null){p.flags&=-257,zm(p,o,l,s,t),p.mode&1&&$m(s,u,t),t=p,a=u;var m=t.updateQueue;if(m===null){var x=new Set;x.add(a),t.updateQueue=x}else m.add(a);break e}else{if(!(t&1)){$m(s,u,t),Wh();break e}a=Error(O(426))}}else if(Ce&&l.mode&1){var v=Fm(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),zm(v,o,l,s,t),Eh(Ns(a,l));break e}}s=a=Ns(a,l),Be!==4&&(Be=2),wo===null?wo=[s]:wo.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var g=fb(s,a,t);Am(s,g);break e;case 1:l=a;var y=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Tr===null||!Tr.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var w=hb(s,l,t);Am(s,w);break e}}s=s.return}while(s!==null)}Ab(n)}catch(C){t=C,De===n&&n!==null&&(De=n=n.return);continue}break}while(!0)}function Ib(){var e=Fa.current;return Fa.current=$a,e===null?$a:e}function Wh(){(Be===0||Be===3||Be===2)&&(Be=4),Qe===null||!(yi&268435455)&&!(Cu&268435455)||dr(Qe,Xe)}function Ua(e,t){var n=de;de|=2;var r=Ib();(Qe!==e||Xe!==t)&&(In=null,hi(e,t));do try{cC();break}catch(i){Pb(e,i)}while(!0);if(jh(),de=n,Fa.current=r,De!==null)throw Error(O(261));return Qe=null,Xe=0,Be}function cC(){for(;De!==null;)Tb(De)}function dC(){for(;De!==null&&!Ok();)Tb(De)}function Tb(e){var t=Lb(e.alternate,e,It);e.memoizedProps=e.pendingProps,t===null?Ab(e):De=t,Bh.current=null}function Ab(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=iC(n,t),n!==null){n.flags&=32767,De=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Be=6,De=null;return}}else if(n=rC(n,t,It),n!==null){De=n;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Be===0&&(Be=5)}function Vr(e,t,n){var r=ge,i=Kt.transition;try{Kt.transition=null,ge=1,fC(e,t,n,r)}finally{Kt.transition=i,ge=r}return null}function fC(e,t,n,r){do rs();while(_r!==null);if(de&6)throw Error(O(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(O(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(Wk(e,s),e===Qe&&(De=Qe=null,Xe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Bl||(Bl=!0,Mb(Sa,function(){return rs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Kt.transition,Kt.transition=null;var o=ge;ge=1;var l=de;de|=4,Bh.current=null,oC(e,n),Eb(n,e),AS(Od),_a=!!Md,Od=Md=null,e.current=n,lC(n),Dk(),de=l,ge=o,Kt.transition=s}else e.current=n;if(Bl&&(Bl=!1,_r=e,Ba=i),s=e.pendingLanes,s===0&&(Tr=null),zk(n.stateNode),Ct(e,Le()),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(za)throw za=!1,e=nf,nf=null,e;return Ba&1&&e.tag!==0&&rs(),s=e.pendingLanes,s&1?e===rf?ko++:(ko=0,rf=e):ko=0,Br(),null}function rs(){if(_r!==null){var e=f0(Ba),t=Kt.transition,n=ge;try{if(Kt.transition=null,ge=16>e?16:e,_r===null)var r=!1;else{if(e=_r,_r=null,Ba=0,de&6)throw Error(O(331));var i=de;for(de|=4,U=e.current;U!==null;){var s=U,o=s.child;if(U.flags&16){var l=s.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(U=u;U!==null;){var f=U;switch(f.tag){case 0:case 11:case 15:vo(8,f,s)}var d=f.child;if(d!==null)d.return=f,U=d;else for(;U!==null;){f=U;var h=f.sibling,p=f.return;if(Sb(f),f===u){U=null;break}if(h!==null){h.return=p,U=h;break}U=p}}}var m=s.alternate;if(m!==null){var x=m.child;if(x!==null){m.child=null;do{var v=x.sibling;x.sibling=null,x=v}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:vo(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,U=g;break e}U=s.return}}var y=e.current;for(U=y;U!==null;){o=U;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,U=b;else e:for(o=y;U!==null;){if(l=U,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Su(9,l)}}catch(C){Ie(l,l.return,C)}if(l===o){U=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,U=w;break e}U=l.return}}if(de=i,Br(),vn&&typeof vn.onPostCommitFiberRoot=="function")try{vn.onPostCommitFiberRoot(mu,e)}catch{}r=!0}return r}finally{ge=n,Kt.transition=t}}return!1}function Zm(e,t,n){t=Ns(n,t),t=fb(e,t,1),e=Ir(e,t,1),t=ht(),e!==null&&(fl(e,1,t),Ct(e,t))}function Ie(e,t,n){if(e.tag===3)Zm(e,e,n);else for(;t!==null;){if(t.tag===3){Zm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Tr===null||!Tr.has(r))){e=Ns(n,e),e=hb(t,e,1),t=Ir(t,e,1),e=ht(),t!==null&&(fl(t,1,e),Ct(t,e));break}}t=t.return}}function hC(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ht(),e.pingedLanes|=e.suspendedLanes&n,Qe===e&&(Xe&n)===n&&(Be===4||Be===3&&(Xe&130023424)===Xe&&500>Le()-Gh?hi(e,0):Uh|=n),Ct(e,t)}function Rb(e,t){t===0&&(e.mode&1?(t=Tl,Tl<<=1,!(Tl&130023424)&&(Tl=4194304)):t=1);var n=ht();e=Vn(e,t),e!==null&&(fl(e,t,n),Ct(e,n))}function pC(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Rb(e,n)}function mC(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(O(314))}r!==null&&r.delete(t),Rb(e,n)}var Lb;Lb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||kt.current)wt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return wt=!1,nC(e,t,n);wt=!!(e.flags&131072)}else wt=!1,Ce&&t.flags&1048576&&$0(t,Aa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;aa(e,t),e=t.pendingProps;var i=Ss(t,st.current);ns(t,n),i=Oh(null,t,r,e,i,n);var s=Dh();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,St(r)?(s=!0,Ia(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Th(t),i.updater=ku,t.stateNode=i,i._reactInternals=t,qd(t,r,e,n),t=Qd(null,t,r,!0,s,n)):(t.tag=0,Ce&&s&&Ch(t),ct(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(aa(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=xC(r),e=en(r,e),i){case 0:t=Vd(null,t,r,e,n);break e;case 1:t=Gm(null,t,r,e,n);break e;case 11:t=Bm(null,t,r,e,n);break e;case 14:t=Um(null,t,r,en(r.type,e),n);break e}throw Error(O(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:en(r,i),Vd(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:en(r,i),Gm(e,t,r,i,n);case 3:e:{if(xb(t),e===null)throw Error(O(387));r=t.pendingProps,s=t.memoizedState,i=s.element,H0(e,t),Ma(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=Ns(Error(O(423)),t),t=Hm(e,t,r,n,i);break e}else if(r!==i){i=Ns(Error(O(424)),t),t=Hm(e,t,r,n,i);break e}else for(Lt=Pr(t.stateNode.containerInfo.firstChild),Mt=t,Ce=!0,rn=null,n=U0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Cs(),r===i){t=Qn(e,t,n);break e}ct(e,t,r,n)}t=t.child}return t;case 5:return q0(t),e===null&&Ud(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Dd(r,i)?o=null:s!==null&&Dd(r,s)&&(t.flags|=32),gb(e,t),ct(e,t,o,n),t.child;case 6:return e===null&&Ud(t),null;case 13:return yb(e,t,n);case 4:return Ah(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=_s(t,null,r,n):ct(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:en(r,i),Bm(e,t,r,i,n);case 7:return ct(e,t,t.pendingProps,n),t.child;case 8:return ct(e,t,t.pendingProps.children,n),t.child;case 12:return ct(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,ve(Ra,r._currentValue),r._currentValue=o,s!==null)if(cn(s.value,o)){if(s.children===i.children&&!kt.current){t=Qn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=Un(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?a.next=a:(a.next=f.next,f.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Gd(s.return,n,t),l.lanes|=n;break}a=a.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(O(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Gd(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}ct(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ns(t,n),i=Xt(i),r=r(i),t.flags|=1,ct(e,t,r,n),t.child;case 14:return r=t.type,i=en(r,t.pendingProps),i=en(r.type,i),Um(e,t,r,i,n);case 15:return pb(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:en(r,i),aa(e,t),t.tag=1,St(r)?(e=!0,Ia(t)):e=!1,ns(t,n),db(t,r,i),qd(t,r,i,n),Qd(null,t,r,!0,e,n);case 19:return bb(e,t,n);case 22:return mb(e,t,n)}throw Error(O(156,t.tag))};function Mb(e,t){return a0(e,t)}function gC(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 Vt(e,t,n,r){return new gC(e,t,n,r)}function Vh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xC(e){if(typeof e=="function")return Vh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fh)return 11;if(e===hh)return 14}return 2}function Rr(e,t){var n=e.alternate;return n===null?(n=Vt(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 da(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Vh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Bi:return pi(n.children,i,s,t);case dh:o=8,i|=8;break;case md:return e=Vt(12,n,t,i|2),e.elementType=md,e.lanes=s,e;case gd:return e=Vt(13,n,t,i),e.elementType=gd,e.lanes=s,e;case xd:return e=Vt(19,n,t,i),e.elementType=xd,e.lanes=s,e;case qy:return _u(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Gy:o=10;break e;case Hy:o=9;break e;case fh:o=11;break e;case hh:o=14;break e;case lr:o=16,r=null;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=Vt(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function pi(e,t,n,r){return e=Vt(7,e,r,t),e.lanes=n,e}function _u(e,t,n,r){return e=Vt(22,e,r,t),e.elementType=qy,e.lanes=n,e.stateNode={isHidden:!1},e}function _c(e,t,n){return e=Vt(6,e,null,t),e.lanes=n,e}function Ec(e,t,n){return t=Vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function yC(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=oc(0),this.expirationTimes=oc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oc(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Qh(e,t,n,r,i,s,o,l,a){return e=new yC(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Vt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Th(s),e}function bC(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:zi,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Ob(e){if(!e)return $r;e=e._reactInternals;e:{if(_i(e)!==e||e.tag!==1)throw Error(O(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(St(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(O(171))}if(e.tag===1){var n=e.type;if(St(n))return O0(e,n,t)}return t}function Db(e,t,n,r,i,s,o,l,a){return e=Qh(n,r,!0,e,i,s,o,l,a),e.context=Ob(null),n=e.current,r=ht(),i=Ar(n),s=Un(r,i),s.callback=t??null,Ir(n,s,i),e.current.lanes=i,fl(e,i,r),Ct(e,r),e}function Eu(e,t,n,r){var i=t.current,s=ht(),o=Ar(i);return n=Ob(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=Ir(i,t,o),e!==null&&(ln(e,i,o,s),sa(e,i,o)),o}function Ga(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 eg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Kh(e,t){eg(e,t),(e=e.alternate)&&eg(e,t)}function vC(){return null}var $b=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xh(e){this._internalRoot=e}Nu.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(O(409));Eu(e,t,null,null)};Nu.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bi(function(){Eu(null,e,null,null)}),t[Wn]=null}};function Nu(e){this._internalRoot=e}Nu.prototype.unstable_scheduleHydration=function(e){if(e){var t=m0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<cr.length&&t!==0&&t<cr[n].priority;n++);cr.splice(n,0,e),n===0&&x0(e)}};function Yh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ju(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function tg(){}function wC(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Ga(o);s.call(u)}}var o=Db(t,r,e,0,null,!1,!1,"",tg);return e._reactRootContainer=o,e[Wn]=o.current,$o(e.nodeType===8?e.parentNode:e),bi(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=Ga(a);l.call(u)}}var a=Qh(e,0,!1,null,null,!1,!1,"",tg);return e._reactRootContainer=a,e[Wn]=a.current,$o(e.nodeType===8?e.parentNode:e),bi(function(){Eu(t,a,n,r)}),a}function Pu(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var l=i;i=function(){var a=Ga(o);l.call(a)}}Eu(t,o,e,i)}else o=wC(n,t,e,i,r);return Ga(o)}h0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ao(t.pendingLanes);n!==0&&(gh(t,n|1),Ct(t,Le()),!(de&6)&&(js=Le()+500,Br()))}break;case 13:bi(function(){var r=Vn(e,1);if(r!==null){var i=ht();ln(r,e,1,i)}}),Kh(e,1)}};xh=function(e){if(e.tag===13){var t=Vn(e,134217728);if(t!==null){var n=ht();ln(t,e,134217728,n)}Kh(e,134217728)}};p0=function(e){if(e.tag===13){var t=Ar(e),n=Vn(e,t);if(n!==null){var r=ht();ln(n,e,t,r)}Kh(e,t)}};m0=function(){return ge};g0=function(e,t){var n=ge;try{return ge=e,t()}finally{ge=n}};Nd=function(e,t,n){switch(t){case"input":if(vd(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=bu(r);if(!i)throw Error(O(90));Vy(r),vd(r,i)}}}break;case"textarea":Ky(e,n);break;case"select":t=n.value,t!=null&&Ji(e,!!n.multiple,t,!1)}};n0=Hh;r0=bi;var kC={usingClientEntryPoint:!1,Events:[pl,qi,bu,e0,t0,Hh]},eo={findFiberByHostInstance:Xr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},SC={bundleType:eo.bundleType,version:eo.version,rendererPackageName:eo.rendererPackageName,rendererConfig:eo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Kn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=o0(e),e===null?null:e.stateNode},findFiberByHostInstance:eo.findFiberByHostInstance||vC,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 Ul=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ul.isDisabled&&Ul.supportsFiber)try{mu=Ul.inject(SC),vn=Ul}catch{}}$t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=kC;$t.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yh(t))throw Error(O(200));return bC(e,t,null,n)};$t.createRoot=function(e,t){if(!Yh(e))throw Error(O(299));var n=!1,r="",i=$b;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Qh(e,1,!1,null,null,n,!1,r,i),e[Wn]=t.current,$o(e.nodeType===8?e.parentNode:e),new Xh(t)};$t.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(O(188)):(e=Object.keys(e).join(","),Error(O(268,e)));return e=o0(t),e=e===null?null:e.stateNode,e};$t.flushSync=function(e){return bi(e)};$t.hydrate=function(e,t,n){if(!ju(t))throw Error(O(200));return Pu(null,e,t,!0,n)};$t.hydrateRoot=function(e,t,n){if(!Yh(e))throw Error(O(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=$b;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Db(t,null,e,1,n??null,i,!1,s,o),e[Wn]=t.current,$o(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 Nu(t)};$t.render=function(e,t,n){if(!ju(t))throw Error(O(200));return Pu(null,e,t,!1,n)};$t.unmountComponentAtNode=function(e){if(!ju(e))throw Error(O(40));return e._reactRootContainer?(bi(function(){Pu(null,null,e,!1,function(){e._reactRootContainer=null,e[Wn]=null})}),!0):!1};$t.unstable_batchedUpdates=Hh;$t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ju(n))throw Error(O(200));if(e==null||e._reactInternals===void 0)throw Error(O(38));return Pu(e,t,n,!1,r)};$t.version="18.3.1-next-f1338f8080-20240426";function Fb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Fb)}catch(e){console.error(e)}}Fb(),Fy.exports=$t;var CC=Fy.exports,zb,ng=CC;zb=ng.createRoot,ng.hydrateRoot;var Ls=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ni,hr,us,xy,_C=(xy=class extends Ls{constructor(){super();H(this,ni);H(this,hr);H(this,us);F(this,us,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){E(this,hr)||this.setEventListener(E(this,us))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,hr))==null||t.call(this),F(this,hr,void 0))}setEventListener(t){var n;F(this,us,t),(n=E(this,hr))==null||n.call(this),F(this,hr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){E(this,ni)!==t&&(F(this,ni,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof E(this,ni)=="boolean"?E(this,ni):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ni=new WeakMap,hr=new WeakMap,us=new WeakMap,xy),Jh=new _C,EC={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pr,nh,yy,NC=(yy=class{constructor(){H(this,pr,EC);H(this,nh,!1)}setTimeoutProvider(e){F(this,pr,e)}setTimeout(e,t){return E(this,pr).setTimeout(e,t)}clearTimeout(e){E(this,pr).clearTimeout(e)}setInterval(e,t){return E(this,pr).setInterval(e,t)}clearInterval(e){E(this,pr).clearInterval(e)}},pr=new WeakMap,nh=new WeakMap,yy),Zr=new NC;function jC(e){setTimeout(e,0)}var PC=typeof window>"u"||"Deno"in globalThis;function dt(){}function IC(e,t){return typeof e=="function"?e(t):e}function lf(e){return typeof e=="number"&&e>=0&&e!==1/0}function Bb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Lr(e,t){return typeof e=="function"?e(t):e}function At(e,t){return typeof e=="function"?e(t):e}function rg(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Zh(o,t.options))return!1}else if(!Vo(t.queryKey,o))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||s&&!s(t))}function ig(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(vi(t.options.mutationKey)!==vi(s))return!1}else if(!Vo(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Zh(e,t){return((t==null?void 0:t.queryKeyHashFn)||vi)(e)}function vi(e){return JSON.stringify(e,(t,n)=>af(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Vo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Vo(e[n],t[n])):!1}var TC=Object.prototype.hasOwnProperty;function Ub(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=sg(e)&&sg(t);if(!r&&!(af(e)&&af(t)))return t;const s=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),l=o.length,a=r?new Array(l):{};let u=0;for(let f=0;f<l;f++){const d=r?f:o[f],h=e[d],p=t[d];if(h===p){a[d]=h,(r?f<s:TC.call(e,d))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){a[d]=p;continue}const m=Ub(h,p,n+1);a[d]=m,m===h&&u++}return s===l&&u===s?e:a}function Ha(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function sg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function af(e){if(!og(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!og(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function og(e){return Object.prototype.toString.call(e)==="[object Object]"}function AC(e){return new Promise(t=>{Zr.setTimeout(t,e)})}function uf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Ub(e,t):t}function RC(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function LC(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ep=Symbol();function Gb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ep?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function tp(e,t){return typeof e=="function"?e(...t):!!e}function MC(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Qo=(()=>{let e=()=>PC;return{isServer(){return e()},setIsServer(t){e=t}}})();function cf(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var OC=jC;function DC(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=OC;const s=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||o()}return a},batchCalls:l=>(...a)=>{s(()=>{l(...a)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var ze=DC(),cs,mr,ds,by,$C=(by=class extends Ls{constructor(){super();H(this,cs,!0);H(this,mr);H(this,ds);F(this,ds,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){E(this,mr)||this.setEventListener(E(this,ds))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,mr))==null||t.call(this),F(this,mr,void 0))}setEventListener(t){var n;F(this,ds,t),(n=E(this,mr))==null||n.call(this),F(this,mr,t(this.setOnline.bind(this)))}setOnline(t){E(this,cs)!==t&&(F(this,cs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return E(this,cs)}},cs=new WeakMap,mr=new WeakMap,ds=new WeakMap,by),qa=new $C;function FC(e){return Math.min(1e3*2**e,3e4)}function Hb(e){return(e??"online")==="online"?qa.isOnline():!0}var df=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function qb(e){let t=!1,n=0,r;const i=cf(),s=()=>i.status!=="pending",o=x=>{var v;if(!s()){const g=new df(x);h(g),(v=e.onCancel)==null||v.call(e,g)}},l=()=>{t=!0},a=()=>{t=!1},u=()=>Jh.isFocused()&&(e.networkMode==="always"||qa.isOnline())&&e.canRun(),f=()=>Hb(e.networkMode)&&e.canRun(),d=x=>{s()||(r==null||r(),i.resolve(x))},h=x=>{s()||(r==null||r(),i.reject(x))},p=()=>new Promise(x=>{var v;r=g=>{(s()||u())&&x(g)},(v=e.onPause)==null||v.call(e)}).then(()=>{var x;r=void 0,s()||(x=e.onContinue)==null||x.call(e)}),m=()=>{if(s())return;let x;const v=n===0?e.initialPromise:void 0;try{x=v??e.fn()}catch(g){x=Promise.reject(g)}Promise.resolve(x).then(d).catch(g=>{var k;if(s())return;const y=e.retry??(Qo.isServer()?0:3),b=e.retryDelay??FC,w=typeof b=="function"?b(n,g):b,C=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,g);if(t||!C){h(g);return}n++,(k=e.onFail)==null||k.call(e,n,g),AC(w).then(()=>u()?void 0:p()).then(()=>{t?h(g):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:a,canStart:f,start:()=>(f()?m():p().then(m),i)}}var ri,vy,Wb=(vy=class{constructor(){H(this,ri)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lf(this.gcTime)&&F(this,ri,Zr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Qo.isServer()?1/0:5*60*1e3))}clearGcTimeout(){E(this,ri)!==void 0&&(Zr.clearTimeout(E(this,ri)),F(this,ri,void 0))}},ri=new WeakMap,vy);function zC(e){return{onFetch:(t,n)=>{var f,d,h,p,m;const r=t.options,i=(h=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],o=((m=t.state.data)==null?void 0:m.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const u=async()=>{let x=!1;const v=b=>{MC(b,()=>t.signal,()=>x=!0)},g=Gb(t.options,t.fetchOptions),y=async(b,w,C)=>{if(x)return Promise.reject(t.signal.reason);if(w==null&&b.pages.length)return Promise.resolve(b);const P=(()=>{const R={client:t.client,queryKey:t.queryKey,pageParam:w,direction:C?"backward":"forward",meta:t.options.meta};return v(R),R})(),I=await g(P),{maxPages:A}=t.options,N=C?LC:RC;return{pages:N(b.pages,I,A),pageParams:N(b.pageParams,w,A)}};if(i&&s.length){const b=i==="backward",w=b?BC:lg,C={pages:s,pageParams:o},k=w(r,C);l=await y(C,k,b)}else{const b=e??s.length;do{const w=a===0?o[0]??r.initialPageParam:lg(r,l);if(a>0&&w==null)break;l=await y(l,w),a++}while(a<b)}return l};t.options.persister?t.fetchFn=()=>{var x,v;return(v=(x=t.options).persister)==null?void 0:v.call(x,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function lg(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function BC(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var fs,ii,hs,Bt,si,qe,sl,oi,Tt,Vb,Pn,wy,UC=(wy=class extends Wb{constructor(t){super();H(this,Tt);H(this,fs);H(this,ii);H(this,hs);H(this,Bt);H(this,si);H(this,qe);H(this,sl);H(this,oi);F(this,oi,!1),F(this,sl,t.defaultOptions),this.setOptions(t.options),this.observers=[],F(this,si,t.client),F(this,Bt,E(this,si).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,F(this,ii,ug(this.options)),this.state=t.state??E(this,ii),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return E(this,fs)}get promise(){var t;return(t=E(this,qe))==null?void 0:t.promise}setOptions(t){if(this.options={...E(this,sl),...t},t!=null&&t._type&&F(this,fs,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=ug(this.options);n.data!==void 0&&(this.setState(ag(n.data,n.dataUpdatedAt)),F(this,ii,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,Bt).remove(this)}setData(t,n){const r=uf(this.state.data,t,this.options);return Z(this,Tt,Pn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Z(this,Tt,Pn).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=E(this,qe))==null?void 0:r.promise;return(i=E(this,qe))==null||i.cancel(t),n?n.then(dt).catch(dt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return E(this,ii)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>At(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ep||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Lr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Bb(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,qe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,qe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,Bt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(E(this,qe)&&(E(this,oi)||Z(this,Tt,Vb).call(this)?E(this,qe).cancel({revert:!0}):E(this,qe).cancelRetry()),this.scheduleGc()),E(this,Bt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Z(this,Tt,Pn).call(this,{type:"invalidate"})}async fetch(t,n){var u,f,d,h,p,m,x,v,g,y,b;if(this.state.fetchStatus!=="idle"&&((u=E(this,qe))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(E(this,qe))return E(this,qe).continueRetry(),E(this,qe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(C=>C.options.queryFn);w&&this.setOptions(w.options)}const r=new AbortController,i=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(F(this,oi,!0),r.signal)})},s=()=>{const w=Gb(this.options,n),k=(()=>{const P={client:E(this,si),queryKey:this.queryKey,meta:this.meta};return i(P),P})();return F(this,oi,!1),this.options.persister?this.options.persister(w,k,this):w(k)},l=(()=>{const w={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:E(this,si),state:this.state,fetchFn:s};return i(w),w})(),a=E(this,fs)==="infinite"?zC(this.options.pages):this.options.behavior;a==null||a.onFetch(l,this),F(this,hs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&Z(this,Tt,Pn).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),F(this,qe,qb({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:w=>{w instanceof df&&w.revert&&this.setState({...E(this,hs),fetchStatus:"idle"}),r.abort()},onFail:(w,C)=>{Z(this,Tt,Pn).call(this,{type:"failed",failureCount:w,error:C})},onPause:()=>{Z(this,Tt,Pn).call(this,{type:"pause"})},onContinue:()=>{Z(this,Tt,Pn).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const w=await E(this,qe).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(p=(h=E(this,Bt).config).onSuccess)==null||p.call(h,w,this),(x=(m=E(this,Bt).config).onSettled)==null||x.call(m,w,this.state.error,this),w}catch(w){if(w instanceof df){if(w.silent)return E(this,qe).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw Z(this,Tt,Pn).call(this,{type:"error",error:w}),(g=(v=E(this,Bt).config).onError)==null||g.call(v,w,this),(b=(y=E(this,Bt).config).onSettled)==null||b.call(y,this.state.data,w,this),w}finally{this.scheduleGc()}}},fs=new WeakMap,ii=new WeakMap,hs=new WeakMap,Bt=new WeakMap,si=new WeakMap,qe=new WeakMap,sl=new WeakMap,oi=new WeakMap,Tt=new WeakSet,Vb=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Pn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Qb(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...ag(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return F(this,hs,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ze.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),E(this,Bt).notify({query:this,type:"updated",action:t})})},wy);function Qb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Hb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ag(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ug(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var yt,ae,ol,lt,li,ps,An,gr,ll,ms,gs,ai,ui,xr,xs,he,co,ff,hf,pf,mf,gf,xf,yf,Kb,ky,GC=(ky=class extends Ls{constructor(t,n){super();H(this,he);H(this,yt);H(this,ae);H(this,ol);H(this,lt);H(this,li);H(this,ps);H(this,An);H(this,gr);H(this,ll);H(this,ms);H(this,gs);H(this,ai);H(this,ui);H(this,xr);H(this,xs,new Set);this.options=n,F(this,yt,t),F(this,gr,null),F(this,An,cf()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,ae).addObserver(this),cg(E(this,ae),this.options)?Z(this,he,co).call(this):this.updateResult(),Z(this,he,mf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bf(E(this,ae),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bf(E(this,ae),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Z(this,he,gf).call(this),Z(this,he,xf).call(this),E(this,ae).removeObserver(this)}setOptions(t){const n=this.options,r=E(this,ae);if(this.options=E(this,yt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof At(this.options.enabled,E(this,ae))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Z(this,he,yf).call(this),E(this,ae).setOptions(this.options),n._defaulted&&!Ha(this.options,n)&&E(this,yt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,ae),observer:this});const i=this.hasListeners();i&&dg(E(this,ae),r,this.options,n)&&Z(this,he,co).call(this),this.updateResult(),i&&(E(this,ae)!==r||At(this.options.enabled,E(this,ae))!==At(n.enabled,E(this,ae))||Lr(this.options.staleTime,E(this,ae))!==Lr(n.staleTime,E(this,ae)))&&Z(this,he,ff).call(this);const s=Z(this,he,hf).call(this);i&&(E(this,ae)!==r||At(this.options.enabled,E(this,ae))!==At(n.enabled,E(this,ae))||s!==E(this,xr))&&Z(this,he,pf).call(this,s)}getOptimisticResult(t){const n=E(this,yt).getQueryCache().build(E(this,yt),t),r=this.createResult(n,t);return qC(this,r)&&(F(this,lt,r),F(this,ps,this.options),F(this,li,E(this,ae).state)),r}getCurrentResult(){return E(this,lt)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&E(this,An).status==="pending"&&E(this,An).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){E(this,xs).add(t)}getCurrentQuery(){return E(this,ae)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=E(this,yt).defaultQueryOptions(t),r=E(this,yt).getQueryCache().build(E(this,yt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Z(this,he,co).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,lt)))}createResult(t,n){var A;const r=E(this,ae),i=this.options,s=E(this,lt),o=E(this,li),l=E(this,ps),u=t!==r?t.state:E(this,ol),{state:f}=t;let d={...f},h=!1,p;if(n._optimisticResults){const N=this.hasListeners(),R=!N&&cg(t,n),L=N&&dg(t,r,n,i);(R||L)&&(d={...d,...Qb(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:v}=d;p=d.data;let g=!1;if(n.placeholderData!==void 0&&p===void 0&&v==="pending"){let N;s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(N=s.data,g=!0):N=typeof n.placeholderData=="function"?n.placeholderData((A=E(this,gs))==null?void 0:A.state.data,E(this,gs)):n.placeholderData,N!==void 0&&(v="success",p=uf(s==null?void 0:s.data,N,n),h=!0)}if(n.select&&p!==void 0&&!g)if(s&&p===(o==null?void 0:o.data)&&n.select===E(this,ll))p=E(this,ms);else try{F(this,ll,n.select),p=n.select(p),p=uf(s==null?void 0:s.data,p,n),F(this,ms,p),F(this,gr,null)}catch(N){F(this,gr,N)}E(this,gr)&&(m=E(this,gr),p=E(this,ms),x=Date.now(),v="error");const y=d.fetchStatus==="fetching",b=v==="pending",w=v==="error",C=b&&y,k=p!==void 0,I={status:v,fetchStatus:d.fetchStatus,isPending:b,isSuccess:v==="success",isError:w,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:w&&!k,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:w&&k,isStale:np(t,n),refetch:this.refetch,promise:E(this,An),isEnabled:At(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const N=I.data!==void 0,R=I.status==="error"&&!N,L=G=>{R?G.reject(I.error):N&&G.resolve(I.data)},V=()=>{const G=F(this,An,I.promise=cf());L(G)},W=E(this,An);switch(W.status){case"pending":t.queryHash===r.queryHash&&L(W);break;case"fulfilled":(R||I.data!==W.value)&&V();break;case"rejected":(!R||I.error!==W.reason)&&V();break}}return I}updateResult(){const t=E(this,lt),n=this.createResult(E(this,ae),this.options);if(F(this,li,E(this,ae).state),F(this,ps,this.options),E(this,li).data!==void 0&&F(this,gs,E(this,ae)),Ha(n,t))return;F(this,lt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!E(this,xs).size)return!0;const o=new Set(s??E(this,xs));return this.options.throwOnError&&o.add("error"),Object.keys(E(this,lt)).some(l=>{const a=l;return E(this,lt)[a]!==t[a]&&o.has(a)})};Z(this,he,Kb).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Z(this,he,mf).call(this)}},yt=new WeakMap,ae=new WeakMap,ol=new WeakMap,lt=new WeakMap,li=new WeakMap,ps=new WeakMap,An=new WeakMap,gr=new WeakMap,ll=new WeakMap,ms=new WeakMap,gs=new WeakMap,ai=new WeakMap,ui=new WeakMap,xr=new WeakMap,xs=new WeakMap,he=new WeakSet,co=function(t){Z(this,he,yf).call(this);let n=E(this,ae).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(dt)),n},ff=function(){Z(this,he,gf).call(this);const t=Lr(this.options.staleTime,E(this,ae));if(Qo.isServer()||E(this,lt).isStale||!lf(t))return;const r=Bb(E(this,lt).dataUpdatedAt,t)+1;F(this,ai,Zr.setTimeout(()=>{E(this,lt).isStale||this.updateResult()},r))},hf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,ae)):this.options.refetchInterval)??!1},pf=function(t){Z(this,he,xf).call(this),F(this,xr,t),!(Qo.isServer()||At(this.options.enabled,E(this,ae))===!1||!lf(E(this,xr))||E(this,xr)===0)&&F(this,ui,Zr.setInterval(()=>{(this.options.refetchIntervalInBackground||Jh.isFocused())&&Z(this,he,co).call(this)},E(this,xr)))},mf=function(){Z(this,he,ff).call(this),Z(this,he,pf).call(this,Z(this,he,hf).call(this))},gf=function(){E(this,ai)!==void 0&&(Zr.clearTimeout(E(this,ai)),F(this,ai,void 0))},xf=function(){E(this,ui)!==void 0&&(Zr.clearInterval(E(this,ui)),F(this,ui,void 0))},yf=function(){const t=E(this,yt).getQueryCache().build(E(this,yt),this.options);if(t===E(this,ae))return;const n=E(this,ae);F(this,ae,t),F(this,ol,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Kb=function(t){ze.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(E(this,lt))}),E(this,yt).getQueryCache().notify({query:E(this,ae),type:"observerResultsUpdated"})})},ky);function HC(e,t){return At(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&At(t.retryOnMount,e)===!1)}function cg(e,t){return HC(e,t)||e.state.data!==void 0&&bf(e,t,t.refetchOnMount)}function bf(e,t,n){if(At(t.enabled,e)!==!1&&Lr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&np(e,t)}return!1}function dg(e,t,n,r){return(e!==t||At(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&np(e,n)}function np(e,t){return At(t.enabled,e)!==!1&&e.isStaleByTime(Lr(t.staleTime,e))}function qC(e,t){return!Ha(e.getCurrentResult(),t)}var al,gn,tt,ci,xn,ir,Sy,WC=(Sy=class extends Wb{constructor(t){super();H(this,xn);H(this,al);H(this,gn);H(this,tt);H(this,ci);F(this,al,t.client),this.mutationId=t.mutationId,F(this,tt,t.mutationCache),F(this,gn,[]),this.state=t.state||Xb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,gn).includes(t)||(E(this,gn).push(t),this.clearGcTimeout(),E(this,tt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){F(this,gn,E(this,gn).filter(n=>n!==t)),this.scheduleGc(),E(this,tt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,gn).length||(this.state.status==="pending"?this.scheduleGc():E(this,tt).remove(this))}continue(){var t;return((t=E(this,ci))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,a,u,f,d,h,p,m,x,v,g,y,b,w,C,k,P;const n=()=>{Z(this,xn,ir).call(this,{type:"continue"})},r={client:E(this,al),meta:this.options.meta,mutationKey:this.options.mutationKey};F(this,ci,qb({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,A)=>{Z(this,xn,ir).call(this,{type:"failed",failureCount:I,error:A})},onPause:()=>{Z(this,xn,ir).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,tt).canRun(this)}));const i=this.state.status==="pending",s=!E(this,ci).canStart();try{if(i)n();else{Z(this,xn,ir).call(this,{type:"pending",variables:t,isPaused:s}),E(this,tt).config.onMutate&&await E(this,tt).config.onMutate(t,this,r);const A=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));A!==this.state.context&&Z(this,xn,ir).call(this,{type:"pending",context:A,variables:t,isPaused:s})}const I=await E(this,ci).start();return await((u=(a=E(this,tt).config).onSuccess)==null?void 0:u.call(a,I,t,this.state.context,this,r)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,I,t,this.state.context,r)),await((p=(h=E(this,tt).config).onSettled)==null?void 0:p.call(h,I,null,this.state.variables,this.state.context,this,r)),await((x=(m=this.options).onSettled)==null?void 0:x.call(m,I,null,t,this.state.context,r)),Z(this,xn,ir).call(this,{type:"success",data:I}),I}catch(I){try{await((g=(v=E(this,tt).config).onError)==null?void 0:g.call(v,I,t,this.state.context,this,r))}catch(A){Promise.reject(A)}try{await((b=(y=this.options).onError)==null?void 0:b.call(y,I,t,this.state.context,r))}catch(A){Promise.reject(A)}try{await((C=(w=E(this,tt).config).onSettled)==null?void 0:C.call(w,void 0,I,this.state.variables,this.state.context,this,r))}catch(A){Promise.reject(A)}try{await((P=(k=this.options).onSettled)==null?void 0:P.call(k,void 0,I,t,this.state.context,r))}catch(A){Promise.reject(A)}throw Z(this,xn,ir).call(this,{type:"error",error:I}),I}finally{E(this,tt).runNext(this)}}},al=new WeakMap,gn=new WeakMap,tt=new WeakMap,ci=new WeakMap,xn=new WeakSet,ir=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ze.batch(()=>{E(this,gn).forEach(r=>{r.onMutationUpdate(t)}),E(this,tt).notify({mutation:this,type:"updated",action:t})})},Sy);function Xb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Rn,tn,ul,Cy,VC=(Cy=class extends Ls{constructor(t={}){super();H(this,Rn);H(this,tn);H(this,ul);this.config=t,F(this,Rn,new Set),F(this,tn,new Map),F(this,ul,0)}build(t,n,r){const i=new WC({client:t,mutationCache:this,mutationId:++Cl(this,ul)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){E(this,Rn).add(t);const n=Gl(t);if(typeof n=="string"){const r=E(this,tn).get(n);r?r.push(t):E(this,tn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,Rn).delete(t)){const n=Gl(t);if(typeof n=="string"){const r=E(this,tn).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&E(this,tn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Gl(t);if(typeof n=="string"){const r=E(this,tn).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Gl(t);if(typeof n=="string"){const i=(r=E(this,tn).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ze.batch(()=>{E(this,Rn).forEach(t=>{this.notify({type:"removed",mutation:t})}),E(this,Rn).clear(),E(this,tn).clear()})}getAll(){return Array.from(E(this,Rn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ig(n,r))}findAll(t={}){return this.getAll().filter(n=>ig(t,n))}notify(t){ze.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ze.batch(()=>Promise.all(t.map(n=>n.continue().catch(dt))))}},Rn=new WeakMap,tn=new WeakMap,ul=new WeakMap,Cy);function Gl(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ln,yr,bt,Mn,Hn,fa,vf,_y,QC=(_y=class extends Ls{constructor(n,r){super();H(this,Hn);H(this,Ln);H(this,yr);H(this,bt);H(this,Mn);F(this,Ln,n),this.setOptions(r),this.bindMethods(),Z(this,Hn,fa).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=E(this,Ln).defaultMutationOptions(n),Ha(this.options,r)||E(this,Ln).getMutationCache().notify({type:"observerOptionsUpdated",mutation:E(this,bt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&vi(r.mutationKey)!==vi(this.options.mutationKey)?this.reset():((i=E(this,bt))==null?void 0:i.state.status)==="pending"&&E(this,bt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=E(this,bt))==null||n.removeObserver(this)}onMutationUpdate(n){Z(this,Hn,fa).call(this),Z(this,Hn,vf).call(this,n)}getCurrentResult(){return E(this,yr)}reset(){var n;(n=E(this,bt))==null||n.removeObserver(this),F(this,bt,void 0),Z(this,Hn,fa).call(this),Z(this,Hn,vf).call(this)}mutate(n,r){var i;return F(this,Mn,r),(i=E(this,bt))==null||i.removeObserver(this),F(this,bt,E(this,Ln).getMutationCache().build(E(this,Ln),this.options)),E(this,bt).addObserver(this),E(this,bt).execute(n)}},Ln=new WeakMap,yr=new WeakMap,bt=new WeakMap,Mn=new WeakMap,Hn=new WeakSet,fa=function(){var r;const n=((r=E(this,bt))==null?void 0:r.state)??Xb();F(this,yr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},vf=function(n){ze.batch(()=>{var r,i,s,o,l,a,u,f;if(E(this,Mn)&&this.hasListeners()){const d=E(this,yr).variables,h=E(this,yr).context,p={client:E(this,Ln),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=E(this,Mn)).onSuccess)==null||i.call(r,n.data,d,h,p)}catch(m){Promise.reject(m)}try{(o=(s=E(this,Mn)).onSettled)==null||o.call(s,n.data,null,d,h,p)}catch(m){Promise.reject(m)}}else if((n==null?void 0:n.type)==="error"){try{(a=(l=E(this,Mn)).onError)==null||a.call(l,n.error,d,h,p)}catch(m){Promise.reject(m)}try{(f=(u=E(this,Mn)).onSettled)==null||f.call(u,void 0,n.error,d,h,p)}catch(m){Promise.reject(m)}}}this.listeners.forEach(d=>{d(E(this,yr))})})},_y),yn,Ey,KC=(Ey=class extends Ls{constructor(t={}){super();H(this,yn);this.config=t,F(this,yn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??Zh(i,n);let o=this.get(s);return o||(o=new UC({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){E(this,yn).has(t.queryHash)||(E(this,yn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=E(this,yn).get(t.queryHash);n&&(t.destroy(),n===t&&E(this,yn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ze.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,yn).get(t)}getAll(){return[...E(this,yn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>rg(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>rg(t,r)):n}notify(t){ze.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ze.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ze.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},yn=new WeakMap,Ey),Pe,br,vr,ys,bs,wr,vs,ws,Ny,XC=(Ny=class{constructor(e={}){H(this,Pe);H(this,br);H(this,vr);H(this,ys);H(this,bs);H(this,wr);H(this,vs);H(this,ws);F(this,Pe,e.queryCache||new KC),F(this,br,e.mutationCache||new VC),F(this,vr,e.defaultOptions||{}),F(this,ys,new Map),F(this,bs,new Map),F(this,wr,0)}mount(){Cl(this,wr)._++,E(this,wr)===1&&(F(this,vs,Jh.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,Pe).onFocus())})),F(this,ws,qa.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,Pe).onOnline())})))}unmount(){var e,t;Cl(this,wr)._--,E(this,wr)===0&&((e=E(this,vs))==null||e.call(this),F(this,vs,void 0),(t=E(this,ws))==null||t.call(this),F(this,ws,void 0))}isFetching(e){return E(this,Pe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return E(this,br).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=E(this,Pe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=E(this,Pe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Lr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return E(this,Pe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=E(this,Pe).get(r.queryHash),s=i==null?void 0:i.state.data,o=IC(t,s);if(o!==void 0)return E(this,Pe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ze.batch(()=>E(this,Pe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=E(this,Pe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=E(this,Pe);ze.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=E(this,Pe);return ze.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ze.batch(()=>E(this,Pe).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(dt).catch(dt)}invalidateQueries(e,t={}){return ze.batch(()=>(E(this,Pe).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ze.batch(()=>E(this,Pe).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(dt)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(dt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=E(this,Pe).build(this,t);return n.isStaleByTime(Lr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(dt).catch(dt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(dt).catch(dt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return qa.isOnline()?E(this,br).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,Pe)}getMutationCache(){return E(this,br)}getDefaultOptions(){return E(this,vr)}setDefaultOptions(e){F(this,vr,e)}setQueryDefaults(e,t){E(this,ys).set(vi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...E(this,ys).values()],n={};return t.forEach(r=>{Vo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){E(this,bs).set(vi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...E(this,bs).values()],n={};return t.forEach(r=>{Vo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...E(this,vr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Zh(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ep&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...E(this,vr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){E(this,Pe).clear(),E(this,br).clear()}},Pe=new WeakMap,br=new WeakMap,vr=new WeakMap,ys=new WeakMap,bs=new WeakMap,wr=new WeakMap,vs=new WeakMap,ws=new WeakMap,Ny),Yb=j.createContext(void 0),Te=e=>{const t=j.useContext(Yb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},YC=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Yb.Provider,{value:e,children:t})),Jb=j.createContext(!1),JC=()=>j.useContext(Jb);Jb.Provider;function ZC(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var e_=j.createContext(ZC()),t_=()=>j.useContext(e_),n_=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?tp(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},r_=e=>{j.useEffect(()=>{e.clearReset()},[e])},i_=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||tp(n,[e.error,r])),s_=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},o_=(e,t)=>e.isLoading&&e.isFetching&&!t,l_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,fg=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function a_(e,t,n){var h,p,m,x;const r=JC(),i=t_(),s=Te(),o=s.defaultQueryOptions(e);(p=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||p.call(h,o);const l=s.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",s_(o),n_(o,i,l),r_(i);const a=!s.getQueryCache().get(o.queryHash),[u]=j.useState(()=>new t(s,o)),f=u.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(v=>{const g=d?u.subscribe(ze.batchCalls(v)):dt;return u.updateResult(),g},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),j.useEffect(()=>{u.setOptions(o)},[o,u]),l_(o,f))throw fg(o,u,i);if(i_({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;if((x=(m=s.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||x.call(m,o,f),o.experimental_prefetchInRender&&!Qo.isServer()&&o_(f,r)){const v=a?fg(o,u,i):l==null?void 0:l.promise;v==null||v.catch(dt).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?f:u.trackResult(f)}function kn(e,t){return a_(e,GC)}function Ue(e,t){const n=Te(),[r]=j.useState(()=>new QC(n,e));j.useEffect(()=>{r.setOptions(e)},[r,e]);const i=j.useSyncExternalStore(j.useCallback(o=>r.subscribe(ze.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=j.useCallback((o,l)=>{r.mutate(o,l).catch(dt)},[r]);if(i.error&&tp(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}class u_{constructor(){T(this,"ws");T(this,"listeners",new Set);T(this,"reconnectListeners",new Set);T(this,"reconnectAttempt",0);T(this,"shouldRun",!1);T(this,"url");T(this,"outbox",[]);T(this,"lastSubscribe");T(this,"_connectionEpoch",0);const t=location.protocol==="https:"?"wss:":"ws:";this.url=`${t}//${location.host}/ws`}start(){this.shouldRun||(this.shouldRun=!0,this.connect())}stop(){var t;this.shouldRun=!1,this.outbox=[],this.lastSubscribe=void 0,this._connectionEpoch=0,(t=this.ws)==null||t.close(),this.ws=void 0}send(t){var n;if(t.type==="subscribe"&&(this.lastSubscribe=t),((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){this.ws.send(JSON.stringify(t));return}this.outbox.push(t),this.shouldRun||this.start()}on(t){return this.listeners.add(t),()=>this.listeners.delete(t)}onReconnect(t){return this.reconnectListeners.add(t),()=>this.reconnectListeners.delete(t)}get readyState(){var t;return((t=this.ws)==null?void 0:t.readyState)??WebSocket.CLOSED}get connectionEpoch(){return this._connectionEpoch}connect(){const t=new WebSocket(this.url);this.ws=t,t.addEventListener("open",()=>{if(this.reconnectAttempt=0,this._connectionEpoch+=1,this._connectionEpoch>1&&this.lastSubscribe&&t.send(JSON.stringify(this.lastSubscribe)),this._connectionEpoch>1)for(const r of this.reconnectListeners)try{r()}catch{}const n=this.outbox;this.outbox=[];for(const r of n)t.send(JSON.stringify(r))}),t.addEventListener("message",n=>{let r;try{r=JSON.parse(n.data)}catch{return}for(const i of this.listeners)i(r)}),t.addEventListener("close",()=>{if(this.ws=void 0,!this.shouldRun)return;const n=Math.min(15e3,500*2**this.reconnectAttempt);this.reconnectAttempt+=1,setTimeout(()=>{this.shouldRun&&this.connect()},n)}),t.addEventListener("error",()=>{})}}const at=new u_;async function pe(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...(t==null?void 0:t.headers)??{}}});if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(c_(r)??`${n.status} ${n.statusText}${r?`: ${r}`:""}`)}return await n.json()}function c_(e){if(e)try{const t=JSON.parse(e);if(t&&typeof t.error=="string"&&t.error.length>0)return t.error}catch{}}const Iu=e=>["config",e],d_=(e,t)=>["config",e,t??"__none__"];function Zb(e,t){return kn({queryKey:d_(e,t),queryFn:()=>{if(!e)throw new Error("workspaceId required");return pe(`/api/workspaces/${encodeURIComponent(e)}/config`)},enabled:!!e})}function f_(e){const t=Te();return Ue({mutationFn:n=>pe(`/api/workspaces/${encodeURIComponent(e)}/config/model`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Iu(e)})})}function h_(e){const t=Te();return Ue({mutationFn:n=>pe(`/api/workspaces/${encodeURIComponent(e)}/config/thinking-level`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Iu(e)})})}function p_(e){const t=Te();return Ue({mutationFn:n=>pe(`/api/workspaces/${encodeURIComponent(e)}/config/tools`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Iu(e)})})}function m_(){const e=Te();j.useEffect(()=>at.on(n=>{n.type==="event"&&(n.payload.kind!=="session_info_changed"&&n.payload.kind!=="thinking_level_changed"||e.invalidateQueries({queryKey:Iu(n.workspaceId)}))}),[e])}const Xn=e=>["resources",e],Tu=e=>["resources",e,"skill-body"],Au=e=>["resources",e,"prompt-body"];function dn(e,t=""){return`/api/workspaces/${encodeURIComponent(e)}/resources${t}`}function rp(e){return kn({queryKey:Xn(e),queryFn:()=>{if(!e)throw new Error("workspaceId required");return pe(dn(e))},enabled:!!e})}function g_(e){const t=Te();return Ue({mutationFn:()=>pe(dn(e,"/reload"),{method:"POST"}),onSuccess:n=>{t.setQueryData(Xn(e),n),t.invalidateQueries({queryKey:Tu(e)}),t.invalidateQueries({queryKey:Au(e)})}})}function x_(e){const t=Te();return Ue({mutationFn:n=>pe(dn(e,"/builtin-extensions"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(Xn(e),n)})}function y_(e,t){return kn({queryKey:[...Tu(e),t],queryFn:()=>{if(!t)throw new Error("filePath required");return pe(`${dn(e,"/skill")}?path=${encodeURIComponent(t)}`)},enabled:!!t,refetchOnWindowFocus:!1,staleTime:1/0})}function b_(e){const t=Te();return Ue({mutationFn:n=>pe(dn(e,"/skills"),{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(Xn(e),n)})}function v_(e){const t=Te();return Ue({mutationFn:n=>pe(dn(e,"/skills"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>{t.setQueryData(Xn(e),n),t.invalidateQueries({queryKey:Tu(e)})}})}function w_(e){const t=Te();return Ue({mutationFn:({filePath:n})=>pe(`${dn(e,"/skills")}?path=${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:n=>{t.setQueryData(Xn(e),n),t.invalidateQueries({queryKey:Tu(e)})}})}function k_(e,t){return kn({queryKey:[...Au(e),t],queryFn:()=>{if(!t)throw new Error("filePath required");return pe(`${dn(e,"/prompt")}?path=${encodeURIComponent(t)}`)},enabled:!!t,refetchOnWindowFocus:!1,staleTime:1/0})}function S_(e){const t=Te();return Ue({mutationFn:n=>pe(dn(e,"/prompts"),{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(Xn(e),n)})}function C_(e){const t=Te();return Ue({mutationFn:n=>pe(dn(e,"/prompts"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>{t.setQueryData(Xn(e),n),t.invalidateQueries({queryKey:Au(e)})}})}function __(e){const t=Te();return Ue({mutationFn:({filePath:n})=>pe(`${dn(e,"/prompts")}?path=${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:n=>{t.setQueryData(Xn(e),n),t.invalidateQueries({queryKey:Au(e)})}})}/**
|
|
42
|
+
* @license lucide-react v0.468.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const E_=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),e1=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
47
|
+
* @license lucide-react v0.468.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/var N_={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
52
|
+
* @license lucide-react v0.468.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const j_=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...l},a)=>j.createElement("svg",{ref:a,...N_,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:e1("lucide",i),...l},[...o.map(([u,f])=>j.createElement(u,f)),...Array.isArray(s)?s:[s]]));/**
|
|
57
|
+
* @license lucide-react v0.468.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const me=(e,t)=>{const n=j.forwardRef(({className:r,...i},s)=>j.createElement(j_,{ref:s,iconNode:t,className:e1(`lucide-${E_(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
|
62
|
+
* @license lucide-react v0.468.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const t1=me("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
67
|
+
* @license lucide-react v0.468.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const P_=me("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
72
|
+
* @license lucide-react v0.468.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const Ms=me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
77
|
+
* @license lucide-react v0.468.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const Os=me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
82
|
+
* @license lucide-react v0.468.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const n1=me("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
87
|
+
* @license lucide-react v0.468.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const ip=me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
92
|
+
* @license lucide-react v0.468.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const I_=me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
97
|
+
* @license lucide-react v0.468.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const T_=me("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
|
102
|
+
* @license lucide-react v0.468.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const r1=me("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
107
|
+
* @license lucide-react v0.468.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const i1=me("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
112
|
+
* @license lucide-react v0.468.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const A_=me("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
117
|
+
* @license lucide-react v0.468.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const s1=me("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
122
|
+
* @license lucide-react v0.468.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const R_=me("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
|
|
127
|
+
* @license lucide-react v0.468.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const L_=me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
132
|
+
* @license lucide-react v0.468.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const Et=me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
137
|
+
* @license lucide-react v0.468.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const M_=me("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
142
|
+
* @license lucide-react v0.468.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const O_=me("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
147
|
+
* @license lucide-react v0.468.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const wf=me("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
152
|
+
* @license lucide-react v0.468.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const Ru=me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
157
|
+
* @license lucide-react v0.468.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const D_=me("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
162
|
+
* @license lucide-react v0.468.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const $_=me("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
167
|
+
* @license lucide-react v0.468.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const F_=me("Rows3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);/**
|
|
172
|
+
* @license lucide-react v0.468.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const z_=me("Rows4",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 7.5H3",key:"1hm9pq"}],["path",{d:"M21 12H3",key:"2avoz0"}],["path",{d:"M21 16.5H3",key:"n7jzkj"}]]);/**
|
|
177
|
+
* @license lucide-react v0.468.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const o1=me("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
182
|
+
* @license lucide-react v0.468.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const B_=me("SquareSlash",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]);/**
|
|
187
|
+
* @license lucide-react v0.468.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const U_=me("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
192
|
+
* @license lucide-react v0.468.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const G_=me("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
197
|
+
* @license lucide-react v0.468.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const Ko=me("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
202
|
+
* @license lucide-react v0.468.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const kf=me("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
207
|
+
* @license lucide-react v0.468.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const Ei=me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function l1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=l1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function H_(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=l1(e))&&(r&&(r+=" "),r+=t);return r}const sp="-",q_=e=>{const t=V_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(sp);return l[0]===""&&l.length!==1&&l.shift(),a1(l,t)||W_(o)},getConflictingClassGroupIds:(o,l)=>{const a=n[o]||[];return l&&r[o]?[...a,...r[o]]:a}}},a1=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?a1(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(sp);return(o=t.validators.find(({validator:l})=>l(s)))==null?void 0:o.classGroupId},hg=/^\[(.+)\]$/,W_=e=>{if(hg.test(e)){const t=hg.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},V_=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return K_(Object.entries(e.classGroups),n).forEach(([s,o])=>{Sf(o,r,s,t)}),r},Sf=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:pg(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(Q_(i)){Sf(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Sf(o,pg(t,s),n,r)})})},pg=(e,t)=>{let n=e;return t.split(sp).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Q_=e=>e.isThemeGetter,K_=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,l])=>[t+o,l])):s);return[n,i]}):e,X_=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},u1="!",Y_=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,o=l=>{const a=[];let u=0,f=0,d;for(let v=0;v<l.length;v++){let g=l[v];if(u===0){if(g===i&&(r||l.slice(v,v+s)===t)){a.push(l.slice(f,v)),f=v+s;continue}if(g==="/"){d=v;continue}}g==="["?u++:g==="]"&&u--}const h=a.length===0?l:l.substring(f),p=h.startsWith(u1),m=p?h.substring(1):h,x=d&&d>f?d-f:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:x}};return n?l=>n({className:l,parseClassName:o}):o},J_=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Z_=e=>({cache:X_(e.cacheSize),parseClassName:Y_(e),...q_(e)}),eE=/\s+/,tE=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(eE);let l="";for(let a=o.length-1;a>=0;a-=1){const u=o[a],{modifiers:f,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let m=!!p,x=r(m?h.substring(0,p):h);if(!x){if(!m){l=u+(l.length>0?" "+l:l);continue}if(x=r(h),!x){l=u+(l.length>0?" "+l:l);continue}m=!1}const v=J_(f).join(":"),g=d?v+u1:v,y=g+x;if(s.includes(y))continue;s.push(y);const b=i(x,m);for(let w=0;w<b.length;++w){const C=b[w];s.push(g+C)}l=u+(l.length>0?" "+l:l)}return l};function nE(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=c1(t))&&(r&&(r+=" "),r+=n);return r}const c1=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=c1(e[r]))&&(n&&(n+=" "),n+=t);return n};function rE(e,...t){let n,r,i,s=o;function o(a){const u=t.reduce((f,d)=>d(f),e());return n=Z_(u),r=n.cache.get,i=n.cache.set,s=l,l(a)}function l(a){const u=r(a);if(u)return u;const f=tE(a,n);return i(a,f),f}return function(){return s(nE.apply(null,arguments))}}const we=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},d1=/^\[(?:([a-z-]+):)?(.+)\]$/i,iE=/^\d+\/\d+$/,sE=new Set(["px","full","screen"]),oE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,aE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,En=e=>is(e)||sE.has(e)||iE.test(e),tr=e=>Ds(e,"length",yE),is=e=>!!e&&!Number.isNaN(Number(e)),Nc=e=>Ds(e,"number",is),to=e=>!!e&&Number.isInteger(Number(e)),dE=e=>e.endsWith("%")&&is(e.slice(0,-1)),te=e=>d1.test(e),nr=e=>oE.test(e),fE=new Set(["length","size","percentage"]),hE=e=>Ds(e,fE,f1),pE=e=>Ds(e,"position",f1),mE=new Set(["image","url"]),gE=e=>Ds(e,mE,vE),xE=e=>Ds(e,"",bE),no=()=>!0,Ds=(e,t,n)=>{const r=d1.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},yE=e=>lE.test(e)&&!aE.test(e),f1=()=>!1,bE=e=>uE.test(e),vE=e=>cE.test(e),wE=()=>{const e=we("colors"),t=we("spacing"),n=we("blur"),r=we("brightness"),i=we("borderColor"),s=we("borderRadius"),o=we("borderSpacing"),l=we("borderWidth"),a=we("contrast"),u=we("grayscale"),f=we("hueRotate"),d=we("invert"),h=we("gap"),p=we("gradientColorStops"),m=we("gradientColorStopPositions"),x=we("inset"),v=we("margin"),g=we("opacity"),y=we("padding"),b=we("saturate"),w=we("scale"),C=we("sepia"),k=we("skew"),P=we("space"),I=we("translate"),A=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",te,t],L=()=>[te,t],V=()=>["",En,tr],W=()=>["auto",is,te],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",te],S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[is,te];return{cacheSize:500,separator:":",theme:{colors:[no],spacing:[En,tr],blur:["none","",nr,te],brightness:X(),borderColor:[e],borderRadius:["none","","full",nr,te],borderSpacing:L(),borderWidth:V(),contrast:X(),grayscale:q(),hueRotate:X(),invert:q(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[dE,tr],inset:R(),margin:R(),opacity:X(),padding:L(),saturate:X(),scale:X(),sepia:q(),skew:X(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",te]}],container:["container"],columns:[{columns:[nr]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...G(),te]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",to,te]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",te]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",to,te]}],"grid-cols":[{"grid-cols":[no]}],"col-start-end":[{col:["auto",{span:["full",to,te]},te]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[no]}],"row-start-end":[{row:["auto",{span:[to,te]},te]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",te]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",te,t]}],"min-w":[{"min-w":[te,t,"min","max","fit"]}],"max-w":[{"max-w":[te,t,"none","full","min","max","fit","prose",{screen:[nr]},nr]}],h:[{h:[te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",nr,tr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Nc]}],"font-family":[{font:[no]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",te]}],"line-clamp":[{"line-clamp":["none",is,Nc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",En,te]}],"list-image":[{"list-image":["none",te]}],"list-style-type":[{list:["none","disc","decimal",te]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",En,tr]}],"underline-offset":[{"underline-offset":["auto",En,te]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),pE]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gE]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:re()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[En,te]}],"outline-w":[{outline:[En,tr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[En,tr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",nr,xE]}],"shadow-color":[{shadow:[no]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...fe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":fe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",nr,te]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",te]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",te]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[to,te]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",te]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[En,tr,Nc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},kE=rE(wE);function B(...e){return kE(H_(e))}const SE={online:"bg-signal-ok",streaming:"bg-brand",idle:"bg-muted-foreground/40",error:"bg-signal-error",warning:"bg-signal-warn"};function mg({state:e}){return c.jsx("span",{className:B("inline-block h-1.5 w-1.5 shrink-0 rounded-full",SE[e],e==="streaming"&&"animate-[v2-halo-brand_2.4s_ease-out_infinite]")})}const CE={default:"text-muted-foreground bg-muted border-border",brand:"text-brand bg-brand/[0.08] border-brand/[0.22]",ok:"text-signal-ok bg-signal-ok/[0.10] border-transparent",warn:"text-signal-warn bg-signal-warn/[0.10] border-transparent",error:"text-signal-error bg-signal-error/[0.10] border-transparent",ghost:"text-muted-foreground bg-transparent border-border-soft"};function _t({tone:e="default",mono:t=!1,className:n,title:r,children:i}){return c.jsx("span",{title:r,className:B("inline-flex items-center gap-1.5 rounded-full border px-[9px] py-[2px] text-[11.5px] font-medium leading-[1.5]",t?"font-mono tracking-normal":"tracking-[-0.005em]",CE[e],n),children:i})}function Dn({children:e,className:t}){return c.jsx("kbd",{className:B("inline-flex min-w-[18px] items-center justify-center rounded-[5px] border border-border bg-card px-1.5 py-px text-[10.5px] font-medium leading-none text-muted-foreground","border-b-[1.5px] border-b-border-hi",t),children:e})}function ss({active:e,title:t,onClick:n,disabled:r,className:i,children:s,...o}){return c.jsx("button",{type:"button",title:t,onClick:n,disabled:r,"aria-label":o["aria-label"]??t,className:B("inline-flex h-[30px] w-[30px] shrink-0 items-center justify-center rounded-full border text-[13px] transition-colors ring-brand-focus disabled:cursor-not-allowed disabled:opacity-50",e?"border-brand/[0.22] bg-brand/[0.08] text-brand":"border-transparent text-muted-foreground hover:bg-accent/70 hover:text-foreground",i),children:s})}function Ni({tool:e,className:t}){const n="currentColor";switch(e){case"read":return c.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M2 3h7l3 3v5a1 1 0 0 1-1 1H2zM9 3v3h3"})});case"edit":return c.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M2 10l7-7 2 2-7 7H2zM8.5 3.5L10.5 5.5"})});case"write":return c.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M3 2h6l3 3v7H3zM7 2v9M3 7h9"})});case"bash":return c.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M2 4l3 3-3 3M7 10h5"})});case"grep":case"find":return c.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"6",cy:"6",r:"3.5"}),c.jsx("path",{d:"M9 9l3 3"})]});case"ls":return c.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M2 4h10M2 7h10M2 10h6"})});case"plan":return c.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M3 4l1.5 1.5L7 3M3 8l1.5 1.5L7 7M9 4.5h3M9 8.5h3"})});case"ask_user":return c.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"7",cy:"7",r:"5"}),c.jsx("path",{d:"M5.5 5.5a1.5 1.5 0 0 1 3 0c0 .9-.9 1.2-1.5 1.7v.6"}),c.jsx("circle",{cx:"7",cy:"10",r:"0.4",fill:n})]});default:return c.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,children:c.jsx("circle",{cx:"7",cy:"7",r:"3"})})}}function gg(){const e=new Date,t=n=>String(n).padStart(2,"0");return`${t(e.getUTCHours())}:${t(e.getUTCMinutes())}:${t(e.getUTCSeconds())}Z`}function _E(){const[e,t]=j.useState(gg);return j.useEffect(()=>{const n=setInterval(()=>t(gg()),1e3);return()=>clearInterval(n)},[]),e}function Ai(e){return e==null?"—":e<1e3?`${Math.round(e)}ms`:e<1e4?`${(e/1e3).toFixed(1)}s`:`${Math.round(e/1e3)}s`}function xg(e){if(e!=null)return e>=3e3?"text-signal-error":e>=1500?"text-signal-warn":"text-brand"}function h1(e){if(!e)return[];const t=e.items;if(!Array.isArray(t))return[];const n=new Set;return t.flatMap(r=>{if(!r||typeof r!="object")return[];const i=r;if(typeof i.id!="string"||typeof i.title!="string")return[];if(!i.title.trim()||n.has(i.id))return[];const s=i.status;return s!=="pending"&&s!=="in_progress"&&s!=="completed"?[]:(n.add(i.id),[{id:i.id,title:i.title,status:s,note:typeof i.note=="string"?i.note:void 0}])})}const yg=e=>{let t;const n=new Set,r=(u,f)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const h=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(p=>p(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=t=e(r,i,l);return l},EE=e=>e?yg(e):yg,NE=e=>e;function jE(e,t=NE){const n=El.useSyncExternalStore(e.subscribe,El.useCallback(()=>t(e.getState()),[e,t]),El.useCallback(()=>t(e.getInitialState()),[e,t]));return El.useDebugValue(n),n}const bg=e=>{const t=EE(e),n=r=>jE(t,r);return Object.assign(n,t),n},Lu=e=>e?bg(e):bg;let PE=1;const fr=()=>String(PE++),IE=100,ur=new Map;function TE(e,t){if(e!==t&&(ur.has(e)&&ur.delete(e),ur.set(e,t),ur.size>IE)){const n=ur.keys().next().value;n!==void 0&&ur.delete(n)}}let So="",Co="",Gn=null;function Cf(){if(Gn!==null&&(cancelAnimationFrame(Gn),Gn=null),So===""&&Co==="")return;const e=So,t=Co;So="",Co="",Re.setState(n=>{const r=_f(n.items);if(r<0)return{};const i=n.items[r],s=n.items.slice();return s[r]={...i,text:e?i.text+e:i.text,thinking:t?i.thinking+t:i.thinking},{items:s}})}function vg(){if(Gn===null){if(typeof requestAnimationFrame!="function"){Cf();return}Gn=requestAnimationFrame(()=>{Gn=null,Cf()})}}function wg(){Gn!==null&&(cancelAnimationFrame(Gn),Gn=null),So="",Co=""}const Re=Lu(e=>({sessionPath:void 0,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],compaction:void 0,contextUsage:void 0,latency:void 0,reset:()=>{wg(),ur.clear(),e({sessionPath:void 0,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],compaction:void 0,contextUsage:void 0,latency:void 0})},pushUser:t=>e(n=>({items:[...n.items,{id:fr(),kind:"user",text:t,pending:!0}]})),apply:t=>{if(t.type==="event"&&t.payload.kind==="message_update"){const n=t.payload.delta;n.kind==="text"?(So+=n.text,vg()):n.kind==="thinking"&&(Co+=n.text,vg());return}Cf(),e(n=>RE(n,t))},setSwitching:t=>e({switching:t}),applyHistory:(t,n)=>{wg(),e({latency:void 0,items:t.map(r=>{if(r.kind==="user"){const i=ur.get(r.text)??r.text;return{id:fr(),kind:"user",text:i}}return r.kind==="assistant"?{id:fr(),kind:"assistant",text:r.text,thinking:r.thinking,streaming:!1,firstTokenMs:void 0,totalMs:void 0}:r.kind==="tool"?{id:fr(),kind:"tool",toolCallId:r.toolCallId,toolName:r.toolName,args:AE(r.args),text:r.text,status:r.isError?"error":"ok",...r.details!==void 0?{details:r.details}:{}}:{id:fr(),kind:"bash",command:r.command,output:r.output,exitCode:r.exitCode}}),running:n})}}));function AE(e){if(!(e==null||e==="")){if(typeof e=="object"&&!Array.isArray(e))return e;if(typeof e=="string")try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch{return}}}function RE(e,t){if(t.type==="subscribed")return{sessionPath:t.sessionPath,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],compaction:void 0,latency:void 0};if(t.type==="error"){const n={};if(e.switching&&(n.switching=!1),t.command==="prompt"){const r=e.items.findIndex(i=>i.kind==="user"&&i.pending===!0);if(r>=0){const i=e.items.slice(),s=i[r];i[r]={...s,pending:!1},n.items=i}}return n}return t.type!=="event"?{}:LE(e,t.payload)}function LE(e,t){var n;switch(t.kind){case"agent_start":return{running:!0};case"agent_end":return{running:!1};case"message_start":{if(t.role==="user"){if(t.text===void 0)return{};const r=e.items.findIndex(i=>i.kind==="user"&&i.pending===!0);if(r>=0){const i=e.items.slice(),s=i[r];return TE(t.text,s.text),i[r]={...s,pending:!1},{items:i}}return{items:[...e.items,{id:fr(),kind:"user",text:t.text}]}}return t.role!=="assistant"?{}:{items:[...e.items,{id:fr(),kind:"assistant",text:"",thinking:"",streaming:!0,firstTokenMs:void 0,totalMs:void 0}]}}case"message_end":{if(t.role!=="assistant")return{};const r=_f(e.items);if(r<0)return{};const i=e.items.slice();return i[r]={...i[r],streaming:!1},{items:i}}case"message_update":{if(t.delta.kind==="other")return{};const r=_f(e.items);if(r<0)return{};const i=e.items[r],s=t.delta.kind==="text"?{...i,text:i.text+t.delta.text}:{...i,thinking:i.thinking+t.delta.text},o=e.items.slice();return o[r]=s,{items:o}}case"tool_execution_start":return{items:[...e.items,{id:fr(),kind:"tool",toolCallId:t.toolCallId,toolName:t.toolName,args:t.args,text:"",status:"running"}]};case"tool_execution_update":return{items:e.items.map(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId?{...r,text:t.partialText??r.text}:r)};case"tool_execution_end":return{items:e.items.map(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId?{...r,text:t.text??r.text,status:t.isError?"error":"ok",...t.details!==void 0?{details:t.details}:{}}:r)};case"queue_update":return{queueSteering:t.steering,queueFollowUp:t.followUp};case"compaction_start":return{compaction:{reason:t.reason}};case"compaction_end":return{compaction:void 0};case"context_usage":return{contextUsage:{tokens:t.tokens,contextWindow:t.contextWindow,percent:t.percent}};case"assistant_timing":{const r=((n=e.latency)==null?void 0:n.rollingFirstTokenMs)??[],i=t.firstTokenMs==null?r:[...r,t.firstTokenMs].slice(-5),s={lastFirstTokenMs:t.firstTokenMs,lastTotalMs:t.totalMs,rollingFirstTokenMs:i};let o=-1;for(let a=e.items.length-1;a>=0;a--){const u=e.items[a];if(u.kind==="assistant"&&!u.streaming&&u.totalMs===void 0){o=a;break}}if(o<0)return{latency:s};const l=e.items.slice();return l[o]={...l[o],firstTokenMs:t.firstTokenMs,totalMs:t.totalMs},{items:l,latency:s}}default:return{}}}function _f(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="assistant"&&n.streaming)return t}return-1}function ME(){const e=Re(u=>{for(let f=u.items.length-1;f>=0;f--){const d=u.items[f];if(d&&d.kind==="tool"&&d.toolName==="update_plan")return d.args}}),[t,n]=j.useState(!1),r=j.useId(),i=h1(e);if(i.length===0)return null;const s=i.length,o=i.filter(u=>u.status==="completed").length,l=s===0?0:o/s,a=i.find(u=>u.status==="in_progress");return c.jsxs("div",{className:"relative z-10 shrink-0 border-b border-border bg-popover",children:[c.jsxs("button",{type:"button","aria-expanded":t,"aria-controls":r,onClick:()=>n(u=>!u),className:"flex w-full items-center gap-2.5 px-4 py-1.5 text-left transition-colors hover:bg-accent/40 ring-brand-focus",children:[c.jsx(Os,{className:B("h-3 w-3 shrink-0 text-muted-foreground transition-transform",t&&"rotate-180"),"aria-hidden":!0}),c.jsx(Ni,{tool:"plan",className:"shrink-0 text-muted-foreground"}),c.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Plan"}),c.jsxs("span",{className:"shrink-0 font-mono text-[11.5px] tabular-nums text-muted-foreground",children:[o,"/",s]}),c.jsx("span",{className:"inline-block h-1 w-[48px] shrink-0 overflow-hidden rounded-full bg-border-soft",role:"progressbar","aria-valuemin":0,"aria-valuenow":o,"aria-valuemax":s,"aria-label":`Plan progress: ${o} of ${s} completed`,children:c.jsx("span",{className:"block h-full rounded-full bg-brand transition-[width] duration-300",style:{width:`${l*100}%`}})}),a&&c.jsxs("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:[c.jsx("span",{className:"text-muted-foreground/70",children:"· "}),c.jsx(Et,{className:"mr-1 inline-block h-3 w-3 text-brand align-[-2px]",style:{animation:"v2-spin 1.4s linear infinite"},"aria-hidden":!0}),a.title]}),!a&&c.jsx("span",{className:"flex-1","aria-hidden":!0})]}),t&&c.jsx("ul",{id:r,className:"border-t border-border-soft bg-background px-4 py-1.5","aria-label":"Plan items",children:i.map(u=>c.jsxs("li",{className:"flex items-start gap-2 py-[3px]",children:[c.jsx("span",{className:"mt-[2px] shrink-0",children:u.status==="completed"?c.jsx(Ms,{className:"h-3.5 w-3.5 text-signal-ok","aria-hidden":!0}):u.status==="in_progress"?c.jsx(Et,{className:"h-3.5 w-3.5 text-brand",style:{animation:"v2-spin 1.4s linear infinite"},"aria-label":"In progress"}):c.jsx(r1,{className:"h-3.5 w-3.5 text-muted-foreground/40","aria-hidden":!0})}),c.jsxs("span",{className:B("min-w-0 flex-1 text-[12.5px] leading-[1.5]",u.status==="completed"?"text-muted-foreground line-through decoration-muted-foreground/30":u.status==="in_progress"?"text-foreground font-medium":"text-muted-foreground"),children:[u.title,u.note&&c.jsxs("span",{className:"ml-1.5 text-[11.5px] text-muted-foreground/60",children:["— ",u.note]})]})]},u.id))})]})}function OE(){const e=Re(n=>n.compaction),t=Re(n=>{var r;return(r=n.contextUsage)==null?void 0:r.percent});return e?c.jsxs("div",{className:"relative z-10 flex shrink-0 items-center gap-3 border-b border-border bg-signal-warn/[0.10] px-4 py-2 text-[12.5px] text-signal-warn",children:[c.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{animation:"v2-spin 1.4s linear infinite"},children:c.jsx("circle",{cx:"7",cy:"7",r:"5",stroke:"currentColor",strokeWidth:"1.4",strokeDasharray:"3 3"})}),c.jsx("span",{className:"flex-1",children:DE(e)}),t!=null&&c.jsxs("span",{className:"font-mono text-[11px] tabular-nums",children:["Context ",Math.round(t),"%"]})]}):null}function DE(e){switch(e.reason){case"manual":return"Compacting context (manual)…";case"threshold":return"Compacting context — threshold reached";case"overflow":return"Compacting context (overflow) — will retry the prompt";default:return"Compacting context…"}}function $E(e,t,n=!0){return kn({queryKey:["fs","browse",e??"~",t],queryFn:()=>{const r=new URLSearchParams;e!==void 0&&r.set("path",e),t&&r.set("showHidden","1");const i=r.toString();return pe(`/api/fs/browse${i?`?${i}`:""}`)},enabled:n,staleTime:3e4})}function FE(e,t,n=!0){const r=t.toLowerCase();return kn({queryKey:["fs","search-files",e??"",r],queryFn:()=>{if(!e)throw new Error("workspaceId required");const i=new URLSearchParams;return r&&i.set("q",r),pe(`/api/workspaces/${encodeURIComponent(e)}/files/search${i.toString()?`?${i.toString()}`:""}`)},enabled:n&&!!e,staleTime:5e3})}const Ef="pi-pilot-density";function zE(){try{const e=localStorage.getItem(Ef);if(e==="compact"||e==="comfortable")return e}catch{}return"comfortable"}const Wa=Lu((e,t)=>({density:zE(),setDensity:n=>{try{localStorage.setItem(Ef,n)}catch{}e({density:n})},toggle:()=>{const n=t().density==="compact"?"comfortable":"compact";try{localStorage.setItem(Ef,n)}catch{}e({density:n})}}));function kg(e,t){if(t<=0)return null;const n=e.slice(0,t),r=/(?:^|\s)([/@])(\S*)$/.exec(n);if(!r)return null;const i=r[1]??"",s=r[2]??"",o=(r.index??0)+(r[0].length-1-s.length);return{kind:i==="/"?"slash":"at",tokenStart:o,query:s}}function BE(e){const t=[],n=/(^|\s)([/@])(\S+)/g;let r;for(;(r=n.exec(e))!==null;){const i=r[1]??"",s=r[2]??"",o=r[3]??"",l=(r.index??0)+i.length,a=l+1+o.length;t.push({kind:s==="/"?"slash":"at",start:l,end:a,body:e.slice(l,a)})}return t}const Sg=50,UE=/\$\{@:\d+(?::\d+)?\}|\$ARGUMENTS|\$@|\$\d+/;function GE(e){return!!e.argumentHint||UE.test(e.content)}function HE(e,t){if(!e)return[];const n=t.toLowerCase(),r=[];for(const i of e.skills)n&&!i.name.toLowerCase().includes(n)||r.push({key:`skill:${i.filePath}`,label:`/skill:${i.name}`,description:i.description||void 0,insertText:`/skill:${i.name} `});for(const i of e.prompts){if(n&&!i.name.toLowerCase().includes(n))continue;const s={key:`prompt:${i.filePath}`,label:`/${i.name}`,description:i.argumentHint?`${i.description??"prompt"} · ${i.argumentHint}`:i.description||"prompt"};GE(i)?s.insertText=`/${i.name} `:s.prompt={name:i.name,description:i.description},r.push(s)}for(const i of e.extensions){const s=i.source.label==="inline";for(const o of i.commands)n&&!o.toLowerCase().includes(n)||r.push({key:`cmd:${i.resolvedPath}:${o}`,label:`/${o}`,description:s?`pi-pilot · ${o}`:`extension · ${i.source.label}`,insertText:`/${o} `})}return r.length>Sg?r.slice(0,Sg):r}function qE(e){return e?e.entries.map(t=>({key:t.path,label:t.relPath,insertText:`@${t.relPath} `})):[]}function WE({workspaceId:e,onSend:t,onAbort:n,running:r,disabled:i}){var ue;const[s,o]=j.useState(""),[l,a]=j.useState(0),[u,f]=j.useState(!1),[d,h]=j.useState(0),[p,m]=j.useState(null),[x,v]=j.useState(null),g=j.useRef(null),y=j.useRef(null),b=j.useRef(!1),w=Wa(_=>_.density)==="compact",C=j.useMemo(()=>kg(s,l),[s,l]),k=C==null?void 0:C.kind,P=(C==null?void 0:C.query)??"",I=rp(k==="slash"?e:void 0),A=FE(e,k==="at"?P:"",k==="at"),N=j.useMemo(()=>k?k==="slash"?HE(I.data,P):qE(A.data):[],[k,P,I.data,A.data]),R=C?`${C.kind}:${C.tokenStart}:${C.query}`:null,L=!!C&&N.length>0&&p!==R;j.useEffect(()=>{h(0)},[R]),j.useEffect(()=>{p&&p!==R&&m(null)},[R,p]),j.useEffect(()=>{v(null)},[e]),j.useEffect(()=>{var _;x&&((_=y.current)==null||_.focus())},[x]);const V=()=>requestAnimationFrame(()=>{var _;return(_=g.current)==null?void 0:_.focus()}),W=()=>{if(i)return;if(x){t(`/${x.name}`),v(null),o(""),a(0),V();return}const _=s.trim();_&&(t(_),o(""),a(0))},G=()=>{v(null),V()},re=_=>{_.key==="Enter"&&!_.shiftKey?(_.preventDefault(),W()):(_.key==="Backspace"||_.key==="Delete"||_.key==="Escape")&&(_.preventDefault(),G())},fe=_=>{if(_.prompt){v(_.prompt),o(""),a(0),m(null),b.current=!1;return}const ie=g.current,He=(ie==null?void 0:ie.value)??s,Q=(ie==null?void 0:ie.selectionStart)??l,Me=kg(He,Q);if(!Me)return;const gt=_.insertText??"",Jn=Me.tokenStart+1+Me.query.length,Zn=He.slice(0,Me.tokenStart),Pi=He.slice(Jn),Zu=`${Zn}${gt}${Pi}`,Gs=Me.tokenStart+gt.length;o(Zu),a(Gs),m(null),requestAnimationFrame(()=>{const Hs=g.current;Hs&&(Hs.focus(),Hs.setSelectionRange(Gs,Gs))})},$=()=>{b.current=!0},q=()=>{b.current=!1},S=_=>{if(!(b.current||_.nativeEvent.isComposing||_.nativeEvent.keyCode===229)){if(L){if(_.key==="ArrowDown"){_.preventDefault(),h(ie=>(ie+1)%N.length);return}if(_.key==="ArrowUp"){_.preventDefault(),h(ie=>(ie-1+N.length)%N.length);return}if(_.key==="Enter"||_.key==="Tab"){_.preventDefault();const ie=N[d]??N[0];ie&&fe(ie);return}if(_.key==="Escape"){_.preventDefault(),R&&m(R);return}}_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),W())}},X=i?"Switching session…":r?"Agent is running…":"Write a message…";return c.jsx("div",{className:"relative shrink-0 pb-5 pt-3",children:c.jsxs("div",{className:B("pointer-events-auto mx-auto w-full px-6",w?"max-w-[920px]":"max-w-[860px]"),children:[c.jsxs("div",{className:B("relative rounded-[14px] border bg-card transition-shadow",u?"border-brand/[0.22] shadow-[0_2px_18px_-6px_hsl(var(--brand)/0.18),0_0_0_3px_hsl(var(--brand)/0.08)]":"border-border shadow-[0_2px_14px_-6px_hsl(var(--foreground)/0.10),0_1px_3px_-1px_hsl(var(--foreground)/0.06)]"),children:[!x&&L&&C&&c.jsx(XE,{kind:C.kind,query:C.query,items:N,selectedIdx:d,loading:C.kind==="slash"?I.isPending:A.isPending,truncated:C.kind==="at"?!!((ue=A.data)!=null&&ue.truncated):!1,onPick:fe,onHover:h}),x?c.jsx("div",{ref:y,tabIndex:0,role:"group","aria-label":`Loaded prompt /${x.name}`,onKeyDown:re,onFocus:()=>f(!0),onBlur:()=>f(!1),className:"block w-full p-2 pr-20 outline-none ring-brand-focus",children:c.jsxs("div",{className:"flex items-start gap-2.5 rounded-[10px] border border-border-soft bg-muted/60 px-3 py-2.5",children:[c.jsx(B_,{className:"mt-px h-4 w-4 shrink-0 text-brand"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"font-mono text-[13px] leading-tight text-foreground",children:["/",x.name]}),x.description&&c.jsx("div",{className:"mt-0.5 truncate text-[12px] text-muted-foreground",children:x.description})]})]})}):c.jsx(VE,{textareaRef:g,text:s,onTextChange:(_,ie)=>{o(_),a(ie)},onCaretChange:a,onFocus:()=>f(!0),onBlur:()=>f(!1),onKeyDown:S,onCompositionStart:$,onCompositionEnd:q,disabled:i,placeholder:X}),c.jsxs("div",{className:"absolute bottom-2 right-2 z-10 flex items-center gap-1.5",children:[x&&c.jsx("button",{type:"button",onClick:G,disabled:i,title:"Remove","aria-label":"Remove loaded prompt",className:"inline-flex h-7 w-7 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50 ring-brand-focus",children:c.jsx(Ei,{className:"h-3.5 w-3.5"})}),r?c.jsx("button",{type:"button",onClick:n,disabled:i,title:"Stop streaming",className:"inline-flex h-7 w-7 items-center justify-center rounded-full bg-signal-error/[0.12] text-signal-error transition-colors hover:bg-signal-error/[0.18] disabled:opacity-50 ring-brand-focus",children:c.jsx(U_,{className:"h-3 w-3",fill:"currentColor"})}):c.jsx("button",{type:"button",onClick:W,disabled:i||!x&&!s.trim(),title:"Send",className:"inline-flex h-7 w-7 items-center justify-center rounded-full bg-brand text-[hsl(var(--brand-foreground))] transition-colors hover:bg-brand-strong disabled:cursor-not-allowed disabled:bg-border-soft disabled:text-muted-foreground ring-brand-focus",children:c.jsx(t1,{className:"h-3.5 w-3.5",strokeWidth:2.5})})]})]}),c.jsxs("div",{className:"mt-1.5 flex items-center justify-center gap-2 text-[11.5px] text-muted-foreground",children:[c.jsx(Dn,{children:"⏎"}),c.jsx("span",{children:"send"}),c.jsx("span",{className:"text-muted-foreground/50",children:"·"}),x?c.jsxs(c.Fragment,{children:[c.jsx(Dn,{children:"⌫"}),c.jsx("span",{children:"remove"})]}):c.jsxs(c.Fragment,{children:[c.jsx(Dn,{children:"⇧⏎"}),c.jsx("span",{children:"newline"}),c.jsx("span",{className:"text-muted-foreground/50",children:"·"}),c.jsx(Dn,{children:"/"}),c.jsx("span",{children:"commands"}),c.jsx("span",{className:"text-muted-foreground/50",children:"·"}),c.jsx(Dn,{children:"@"}),c.jsx("span",{children:"files"})]})]})]})})}const Cg="block max-h-[180px] min-h-[44px] w-full resize-none pl-4 pr-12 pt-3 pb-3 font-sans text-[14px] leading-[1.55] tracking-[-0.005em] whitespace-pre-wrap break-words",_g=180;function VE({textareaRef:e,text:t,onTextChange:n,onCaretChange:r,onFocus:i,onBlur:s,onKeyDown:o,onCompositionStart:l,onCompositionEnd:a,disabled:u,placeholder:f}){const d=j.useRef(null),[h,p]=j.useState(!1),m=j.useMemo(()=>BE(t),[t]),x=j.useCallback(()=>{const C=e.current;C&&r(C.selectionStart??0)},[e,r]),v=j.useCallback(()=>{const C=e.current,k=d.current;!C||!k||(k.scrollTop=C.scrollTop,k.scrollLeft=C.scrollLeft)},[e,d]);j.useLayoutEffect(()=>{const C=e.current;if(!C)return;C.style.height="auto";const k=Math.min(C.scrollHeight,_g);C.style.height=`${k}px`,C.style.overflowY=C.scrollHeight>_g?"auto":"hidden",v()},[t,e,v]);const g=j.useMemo(()=>QE(t,m),[t,m]),b=m.length>0,w=h?"text-transparent":"text-foreground";return c.jsxs("div",{className:"relative",children:[b&&c.jsxs("div",{ref:d,"aria-hidden":!0,className:B(Cg,"pointer-events-none absolute inset-0 overflow-hidden whitespace-pre-wrap"),children:[g.map((C,k)=>C.kind==="text"?c.jsx("span",{className:w,children:C.text},k):c.jsx(KE,{body:C.text,hideText:h},k)),""]}),c.jsx("textarea",{ref:e,value:t,onChange:C=>n(C.target.value,C.target.selectionStart??C.target.value.length),onSelect:x,onClick:x,onKeyUp:x,onScroll:v,onCompositionStart:()=>{p(!0),l==null||l()},onCompositionEnd:()=>{p(!1),a==null||a()},onFocus:i,onBlur:s,onKeyDown:o,disabled:u,placeholder:f,spellCheck:!1,autoCorrect:"off",rows:1,className:B(Cg,"relative bg-transparent caret-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",b&&!h?"text-transparent selection:text-transparent selection:bg-brand/20":"text-foreground")})]})}function QE(e,t){if(t.length===0)return[{kind:"text",text:e}];const n=[];let r=0;for(const i of t)i.start>r&&n.push({kind:"text",text:e.slice(r,i.start)}),n.push({kind:i.kind,text:e.slice(i.start,i.end)}),r=i.end;return r<e.length&&n.push({kind:"text",text:e.slice(r)}),n}function KE({body:e,hideText:t=!1}){return c.jsx("span",{className:B("inline rounded-[3px] bg-brand/[0.08] [box-decoration-break:clone] [-webkit-box-decoration-break:clone]",t?"text-transparent":"text-brand"),children:e})}function XE({kind:e,query:t,items:n,selectedIdx:r,loading:i,truncated:s,onPick:o,onHover:l}){const a=j.useRef(null);j.useEffect(()=>{const d=a.current;if(!d)return;const h=d.querySelector(`[data-idx="${r}"]`);h==null||h.scrollIntoView({block:"nearest"})},[r]);const u=e==="slash"?"Commands":"Files",f=t?`"${t}"`:"";return c.jsxs("div",{className:"absolute bottom-full left-0 right-0 z-30 mb-2 overflow-hidden rounded-[10px] border border-border bg-popover shadow-panel",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border-soft bg-muted px-3 py-2 text-[11.5px] text-muted-foreground",children:[c.jsxs("span",{children:[c.jsx("span",{className:"font-medium text-foreground",children:u}),f&&c.jsx("span",{className:"ml-1.5 font-mono text-muted-foreground",children:f})]}),c.jsx("span",{className:"font-mono text-[10.5px] tabular-nums",children:i?"…":`${n.length}${s?"+":""}`})]}),c.jsx("div",{ref:a,className:"max-h-64 overflow-y-auto py-1",children:n.map((d,h)=>{const p=h===r;return c.jsxs("button",{type:"button","data-idx":h,onMouseDown:m=>{m.preventDefault(),o(d)},onMouseEnter:()=>l(h),className:B("flex w-full flex-col gap-0.5 px-3 py-1.5 text-left text-[12.5px] transition-colors",p?"bg-brand/[0.08] text-foreground":"hover:bg-accent/60"),children:[c.jsx("span",{className:"truncate font-mono text-foreground",children:d.label}),d.description&&c.jsx("span",{className:B("truncate text-[11px]",p?"text-brand-strong":"text-muted-foreground"),children:d.description})]},d.key)})}),c.jsxs("div",{className:"flex items-center gap-2 border-t border-border-soft bg-muted px-3 py-1.5 text-[11px] text-muted-foreground",children:[c.jsx(Dn,{children:"↑↓"}),"nav",c.jsx(Dn,{children:"⏎"}),"insert",c.jsx(Dn,{children:"Esc"}),"dismiss"]})]})}function Mu({size:e=28,running:t=!1,filled:n,className:r,title:i="pi-pilot"}){const s=n??t;return c.jsx("span",{role:"img","aria-label":i,title:i,className:B("inline-flex shrink-0 items-center justify-center rounded-full",s?"bg-brand text-[hsl(var(--brand-foreground))] border border-brand":"bg-card text-brand border border-border-hi",r),style:{width:e,height:e,fontFamily:'"Instrument Serif", "Times New Roman", serif',fontSize:Math.round(e*.5),fontStyle:"italic",lineHeight:1,letterSpacing:"-0.02em"},children:"π"})}function YE({className:e}){return c.jsx("span",{className:B("font-sans text-[15px] font-medium tracking-[-0.01em] text-foreground",e),children:"pi-pilot"})}function p1({title:e,tagline:t,hint:n}){return c.jsxs("div",{className:"relative z-10 flex max-w-[480px] flex-col items-center px-8 text-center",children:[c.jsx(Mu,{size:56,filled:!0}),c.jsx("h2",{className:"mt-5 font-serif text-[36px] italic font-normal leading-[1.05] tracking-[-0.02em] text-foreground",children:e}),c.jsx("p",{className:"mt-2 text-[14.5px] leading-[1.6] tracking-[-0.005em] text-muted-foreground",children:t}),n&&c.jsxs("div",{className:"mt-6 inline-flex items-center gap-2 rounded-[10px] border border-border bg-card px-3.5 py-2 text-[12.5px] text-muted-foreground",children:[n.keys.map(r=>c.jsx(Dn,{children:r},r)),c.jsx("span",{children:n.label})]})]})}function m1(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const JE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZE=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eN={};function Eg(e,t){return(eN.jsx?ZE:JE).test(e)}const tN=/[ \t\n\f\r]/g;function Ou(e){return typeof e=="object"?e.type==="text"?Ng(e.value):!1:Ng(e)}function Ng(e){return e.replace(tN,"")===""}class gl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}gl.prototype.normal={};gl.prototype.property={};gl.prototype.space=void 0;function g1(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new gl(n,r,t)}function Nf(e){return e.toLowerCase()}class Nt{constructor(t,n){this.attribute=n,this.property=t}}Nt.prototype.attribute="";Nt.prototype.booleanish=!1;Nt.prototype.boolean=!1;Nt.prototype.commaOrSpaceSeparated=!1;Nt.prototype.commaSeparated=!1;Nt.prototype.defined=!1;Nt.prototype.mustUseProperty=!1;Nt.prototype.number=!1;Nt.prototype.overloadedBoolean=!1;Nt.prototype.property="";Nt.prototype.spaceSeparated=!1;Nt.prototype.space=void 0;let nN=0;const ne=ji(),Oe=ji(),jf=ji(),D=ji(),be=ji(),os=ji(),Pt=ji();function ji(){return 2**++nN}const Pf=Object.freeze(Object.defineProperty({__proto__:null,boolean:ne,booleanish:Oe,commaOrSpaceSeparated:Pt,commaSeparated:os,number:D,overloadedBoolean:jf,spaceSeparated:be},Symbol.toStringTag,{value:"Module"})),jc=Object.keys(Pf);class op extends Nt{constructor(t,n,r,i){let s=-1;if(super(t,n),jg(this,"space",i),typeof r=="number")for(;++s<jc.length;){const o=jc[s];jg(this,jc[s],(r&Pf[o])===Pf[o])}}}op.prototype.defined=!0;function jg(e,t,n){n&&(e[t]=n)}function $s(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new op(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Nf(r)]=r,n[Nf(s.attribute)]=r}return new gl(t,n,e.space)}const x1=$s({properties:{ariaActiveDescendant:null,ariaAtomic:Oe,ariaAutoComplete:null,ariaBusy:Oe,ariaChecked:Oe,ariaColCount:D,ariaColIndex:D,ariaColSpan:D,ariaControls:be,ariaCurrent:null,ariaDescribedBy:be,ariaDetails:null,ariaDisabled:Oe,ariaDropEffect:be,ariaErrorMessage:null,ariaExpanded:Oe,ariaFlowTo:be,ariaGrabbed:Oe,ariaHasPopup:null,ariaHidden:Oe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:be,ariaLevel:D,ariaLive:null,ariaModal:Oe,ariaMultiLine:Oe,ariaMultiSelectable:Oe,ariaOrientation:null,ariaOwns:be,ariaPlaceholder:null,ariaPosInSet:D,ariaPressed:Oe,ariaReadOnly:Oe,ariaRelevant:null,ariaRequired:Oe,ariaRoleDescription:be,ariaRowCount:D,ariaRowIndex:D,ariaRowSpan:D,ariaSelected:Oe,ariaSetSize:D,ariaSort:null,ariaValueMax:D,ariaValueMin:D,ariaValueNow:D,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function y1(e,t){return t in e?e[t]:t}function b1(e,t){return y1(e,t.toLowerCase())}const rN=$s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:os,acceptCharset:be,accessKey:be,action:null,allow:null,allowFullScreen:ne,allowPaymentRequest:ne,allowUserMedia:ne,alt:null,as:null,async:ne,autoCapitalize:null,autoComplete:be,autoFocus:ne,autoPlay:ne,blocking:be,capture:null,charSet:null,checked:ne,cite:null,className:be,cols:D,colSpan:null,content:null,contentEditable:Oe,controls:ne,controlsList:be,coords:D|os,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ne,defer:ne,dir:null,dirName:null,disabled:ne,download:jf,draggable:Oe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ne,formTarget:null,headers:be,height:D,hidden:jf,high:D,href:null,hrefLang:null,htmlFor:be,httpEquiv:be,id:null,imageSizes:null,imageSrcSet:null,inert:ne,inputMode:null,integrity:null,is:null,isMap:ne,itemId:null,itemProp:be,itemRef:be,itemScope:ne,itemType:be,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ne,low:D,manifest:null,max:null,maxLength:D,media:null,method:null,min:null,minLength:D,multiple:ne,muted:ne,name:null,nonce:null,noModule:ne,noValidate:ne,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:ne,optimum:D,pattern:null,ping:be,placeholder:null,playsInline:ne,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ne,referrerPolicy:null,rel:be,required:ne,reversed:ne,rows:D,rowSpan:D,sandbox:be,scope:null,scoped:ne,seamless:ne,selected:ne,shadowRootClonable:ne,shadowRootDelegatesFocus:ne,shadowRootMode:null,shape:null,size:D,sizes:null,slot:null,span:D,spellCheck:Oe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:D,step:null,style:null,tabIndex:D,target:null,title:null,translate:null,type:null,typeMustMatch:ne,useMap:null,value:Oe,width:D,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:be,axis:null,background:null,bgColor:null,border:D,borderColor:null,bottomMargin:D,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ne,declare:ne,event:null,face:null,frame:null,frameBorder:null,hSpace:D,leftMargin:D,link:null,longDesc:null,lowSrc:null,marginHeight:D,marginWidth:D,noResize:ne,noHref:ne,noShade:ne,noWrap:ne,object:null,profile:null,prompt:null,rev:null,rightMargin:D,rules:null,scheme:null,scrolling:Oe,standby:null,summary:null,text:null,topMargin:D,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ne,disableRemotePlayback:ne,prefix:null,property:null,results:D,security:null,unselectable:null},space:"html",transform:b1}),iN=$s({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Pt,accentHeight:D,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:D,amplitude:D,arabicForm:null,ascent:D,attributeName:null,attributeType:null,azimuth:D,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:D,by:null,calcMode:null,capHeight:D,className:be,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:D,diffuseConstant:D,direction:null,display:null,dur:null,divisor:D,dominantBaseline:null,download:ne,dx:null,dy:null,edgeMode:null,editable:null,elevation:D,enableBackground:null,end:null,event:null,exponent:D,externalResourcesRequired:null,fill:null,fillOpacity:D,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:os,g2:os,glyphName:os,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:D,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:D,horizOriginX:D,horizOriginY:D,id:null,ideographic:D,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:D,k:D,k1:D,k2:D,k3:D,k4:D,kernelMatrix:Pt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:D,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:D,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:D,overlineThickness:D,paintOrder:null,panose1:null,path:null,pathLength:D,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:be,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:D,pointsAtY:D,pointsAtZ:D,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Pt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Pt,rev:Pt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Pt,requiredFeatures:Pt,requiredFonts:Pt,requiredFormats:Pt,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:D,specularExponent:D,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:D,strikethroughThickness:D,string:null,stroke:null,strokeDashArray:Pt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:D,strokeOpacity:D,strokeWidth:null,style:null,surfaceScale:D,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Pt,tabIndex:D,tableValues:null,target:null,targetX:D,targetY:D,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Pt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:D,underlineThickness:D,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:D,values:null,vAlphabetic:D,vMathematical:D,vectorEffect:null,vHanging:D,vIdeographic:D,version:null,vertAdvY:D,vertOriginX:D,vertOriginY:D,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:D,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:y1}),v1=$s({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()}}),w1=$s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:b1}),k1=$s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),sN={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"},oN=/[A-Z]/g,Pg=/-[a-z]/g,lN=/^data[-\w.:]+$/i;function S1(e,t){const n=Nf(t);let r=t,i=Nt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&lN.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Pg,uN);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Pg.test(s)){let o=s.replace(oN,aN);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=op}return new i(r,t)}function aN(e){return"-"+e.toLowerCase()}function uN(e){return e.charAt(1).toUpperCase()}const C1=g1([x1,rN,v1,w1,k1],"html"),xl=g1([x1,iN,v1,w1,k1],"svg");function _1(e){return e.join(" ").trim()}var lp={},Ig=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,cN=/\n/g,dN=/^\s*/,fN=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,hN=/^:\s*/,pN=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,mN=/^[;\s]*/,gN=/^\s+|\s+$/g,xN=`
|
|
212
|
+
`,Tg="/",Ag="*",Qr="",yN="comment",bN="declaration";function vN(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(cN);x&&(n+=x.length);var v=m.lastIndexOf(xN);r=~v?m.length-v: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 l(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 a(m){var x=m.exec(e);if(x){var v=x[0];return i(v),e=e.slice(v.length),x}}function u(){a(dN)}function f(m){var x;for(m=m||[];x=d();)x!==!1&&m.push(x);return m}function d(){var m=s();if(!(Tg!=e.charAt(0)||Ag!=e.charAt(1))){for(var x=2;Qr!=e.charAt(x)&&(Ag!=e.charAt(x)||Tg!=e.charAt(x+1));)++x;if(x+=2,Qr===e.charAt(x-1))return l("End of comment missing");var v=e.slice(2,x-2);return r+=2,i(v),e=e.slice(x),r+=2,m({type:yN,comment:v})}}function h(){var m=s(),x=a(fN);if(x){if(d(),!a(hN))return l("property missing ':'");var v=a(pN),g=m({type:bN,property:Rg(x[0].replace(Ig,Qr)),value:v?Rg(v[0].replace(Ig,Qr)):Qr});return a(mN),g}}function p(){var m=[];f(m);for(var x;x=h();)x!==!1&&(m.push(x),f(m));return m}return u(),p()}function Rg(e){return e?e.replace(gN,Qr):Qr}var wN=vN,kN=ba&&ba.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lp,"__esModule",{value:!0});lp.default=CN;const SN=kN(wN);function CN(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,SN.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;i?t(o,l,s):l&&(n=n||{},n[o]=l)}),n}var Du={};Object.defineProperty(Du,"__esModule",{value:!0});Du.camelCase=void 0;var _N=/^--[a-zA-Z0-9_-]+$/,EN=/-([a-z])/g,NN=/^[^-]+$/,jN=/^-(webkit|moz|ms|o|khtml)-/,PN=/^-(ms)-/,IN=function(e){return!e||NN.test(e)||_N.test(e)},TN=function(e,t){return t.toUpperCase()},Lg=function(e,t){return"".concat(t,"-")},AN=function(e,t){return t===void 0&&(t={}),IN(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(PN,Lg):e=e.replace(jN,Lg),e.replace(EN,TN))};Du.camelCase=AN;var RN=ba&&ba.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},LN=RN(lp),MN=Du;function If(e,t){var n={};return!e||typeof e!="string"||(0,LN.default)(e,function(r,i){r&&i&&(n[(0,MN.camelCase)(r,t)]=i)}),n}If.default=If;var ON=If;const DN=rh(ON),E1=N1("end"),ap=N1("start");function N1(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 $N(e){const t=ap(e),n=E1(e);if(t&&n)return{start:t,end:n}}function _o(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Mg(e.position):"start"in e||"end"in e?Mg(e):"line"in e||"column"in e?Tf(e):""}function Tf(e){return Og(e&&e.line)+":"+Og(e&&e.column)}function Mg(e){return Tf(e&&e.start)+"-"+Tf(e&&e.end)}function Og(e){return e&&typeof e=="number"?e:1}class ot 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 a=r.indexOf(":");a===-1?s.ruleId=r:(s.source=r.slice(0,a),s.ruleId=r.slice(a+1))}if(!s.place&&s.ancestors&&s.ancestors){const a=s.ancestors[s.ancestors.length-1];a&&(s.place=a.position)}const l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=_o(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}}ot.prototype.file="";ot.prototype.name="";ot.prototype.reason="";ot.prototype.message="";ot.prototype.stack="";ot.prototype.column=void 0;ot.prototype.line=void 0;ot.prototype.ancestors=void 0;ot.prototype.cause=void 0;ot.prototype.fatal=void 0;ot.prototype.place=void 0;ot.prototype.ruleId=void 0;ot.prototype.source=void 0;const up={}.hasOwnProperty,FN=new Map,zN=/[A-Z]/g,BN=new Set(["table","tbody","thead","tfoot","tr"]),UN=new Set(["td","th"]),j1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function GN(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=YN(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=XN(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"?xl:C1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=P1(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function P1(e,t,n){if(t.type==="element")return HN(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return qN(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return VN(e,t,n);if(t.type==="mdxjsEsm")return WN(e,t);if(t.type==="root")return QN(e,t,n);if(t.type==="text")return KN(e,t)}function HN(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=xl,e.schema=i),e.ancestors.push(t);const s=T1(e,t.tagName,!1),o=JN(e,t);let l=dp(e,t);return BN.has(t.tagName)&&(l=l.filter(function(a){return typeof a=="string"?!Ou(a):!0})),I1(e,o,s,t),cp(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function qN(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)}Xo(e,t.position)}function WN(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Xo(e,t.position)}function VN(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=xl,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:T1(e,t.name,!0),o=ZN(e,t),l=dp(e,t);return I1(e,o,s,t),cp(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function QN(e,t,n){const r={};return cp(r,dp(e,t)),e.create(t,e.Fragment,r,n)}function KN(e,t){return t.value}function I1(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function XN(e,t,n){return r;function r(i,s,o,l){const u=Array.isArray(o.children)?n:t;return l?u(s,o,l):u(s,o)}}function YN(e,t){return n;function n(r,i,s,o){const l=Array.isArray(s.children),a=ap(r);return t(i,s,o,l,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function JN(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&up.call(t.properties,i)){const s=ej(e,i,t.properties[i]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&UN.has(t.tagName)?r=l:n[o]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ZN(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 l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Xo(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 l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else Xo(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function dp(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:FN;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const a=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(a){const u=i.get(a)||0;o=a+"-"+u,i.set(a,u+1)}}const l=P1(e,s,o);l!==void 0&&n.push(l)}return n}function ej(e,t,n){const r=S1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?m1(n):_1(n)),r.property==="style"){let i=typeof n=="object"?n:tj(e,String(n));return e.stylePropertyNameCase==="css"&&(i=nj(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?sN[r.property]||r.property:r.attribute,n]}}function tj(e,t){try{return DN(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ot("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=j1+"#cannot-parse-style-attribute",i}}function T1(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 l=Eg(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=o}else r=Eg(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return up.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Xo(e)}function Xo(e,t){const n=new ot("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=j1+"#cannot-handle-mdx-estrees-without-createevaluater",n}function nj(e){const t={};let n;for(n in e)up.call(e,n)&&(t[rj(n)]=e[n]);return t}function rj(e){let t=e.replace(zN,ij);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ij(e){return"-"+e.toLowerCase()}const Pc={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"]},sj={};function fp(e,t){const n=sj,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return A1(e,r,i)}function A1(e,t,n){if(oj(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 Dg(e.children,t,n)}return Array.isArray(e)?Dg(e,t,n):""}function Dg(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=A1(e[i],t,n);return r.join("")}function oj(e){return!!(e&&typeof e=="object")}const $g=document.createElement("i");function hp(e){const t="&"+e+";";$g.innerHTML=t;const n=$g.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ot(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 Ht(e,t){return e.length>0?(Ot(e,e.length,0,t),e):t}const Fg={}.hasOwnProperty;function R1(e){const t={};let n=-1;for(;++n<e.length;)lj(t,e[n]);return t}function lj(e,t){let n;for(n in t){const i=(Fg.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){Fg.call(i,o)||(i[o]=[]);const l=s[o];aj(i[o],Array.isArray(l)?l:l?[l]:[])}}}function aj(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ot(e,0,0,r)}function L1(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 an(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ft=Ur(/[A-Za-z]/),it=Ur(/[\dA-Za-z]/),uj=Ur(/[#-'*+\--9=?A-Z^-~]/);function Va(e){return e!==null&&(e<32||e===127)}const Af=Ur(/\d/),cj=Ur(/[\dA-Fa-f]/),dj=Ur(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function ye(e){return e!==null&&(e<0||e===32)}function se(e){return e===-2||e===-1||e===32}const $u=Ur(new RegExp("\\p{P}|\\p{S}","u")),wi=Ur(/\s/);function Ur(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fs(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&it(e.charCodeAt(n+1))&&it(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 l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),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 ce(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(a){return se(a)?(e.enter(n),l(a)):t(a)}function l(a){return se(a)&&s++<i?(e.consume(a),l):(e.exit(n),t(a))}}const fj={tokenize:hj};function hj(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ce(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),s(l)}function s(l){const a=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=a),n=a,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return K(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),o)}}const pj={tokenize:mj},zg={tokenize:gj};function mj(e){const t=this,n=[];let r=0,i,s,o;return l;function l(b){if(r<n.length){const w=n[r];return t.containerState=w[1],e.attempt(w[0].continuation,a,u)(b)}return u(b)}function a(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const w=t.events.length;let C=w,k;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){k=t.events[C][1].end;break}g(r);let P=w;for(;P<t.events.length;)t.events[P][1].end={...k},P++;return Ot(t.events,C+1,0,t.events.slice(w)),t.events.length=P,u(b)}return l(b)}function u(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return m(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(zg,f,d)(b)}function f(b){return i&&y(),g(r),h(b)}function d(b){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(b)}function h(b){return t.containerState={},e.attempt(zg,p,m)(b)}function p(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function m(b){if(b===null){i&&y(),g(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),x(b)}function x(b){if(b===null){v(e.exit("chunkFlow"),!0),g(0),e.consume(b);return}return K(b)?(e.consume(b),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(b),x)}function v(b,w){const C=t.sliceStream(b);if(w&&C.push(null),b.previous=s,s&&(s.next=b),s=b,i.defineSkip(b.start),i.write(C),t.parser.lazy[b.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 P=t.events.length;let I=P,A,N;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(A){N=t.events[I][1].end;break}A=!0}for(g(r),k=P;k<t.events.length;)t.events[k][1].end={...N},k++;Ot(t.events,I+1,0,t.events.slice(P)),t.events.length=k}}function g(b){let w=n.length;for(;w-- >b;){const C=n[w];t.containerState=C[1],C[0].exit.call(t,e)}n.length=b}function y(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function gj(e,t,n){return ce(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ps(e){if(e===null||ye(e)||wi(e))return 1;if($u(e))return 2}function Fu(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 Rf={name:"attention",resolveAll:xj,tokenize:yj};function xj(e,t){let n=-1,r,i,s,o,l,a,u,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;a=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};Bg(d,-a),Bg(h,a),o={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ht(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ht(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=Ht(u,Fu(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ht(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=Ht(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Ot(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yj(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ps(r);let s;return o;function o(a){return s=a,e.enter("attentionSequence"),l(a)}function l(a){if(a===s)return e.consume(a),l;const u=e.exit("attentionSequence"),f=Ps(a),d=!f||f===2&&i||n.includes(a),h=!i||i===2&&f||n.includes(r);return u._open=!!(s===42?d:d&&(i||!h)),u._close=!!(s===42?h:h&&(f||!d)),t(a)}}function Bg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const bj={name:"autolink",tokenize:vj};function vj(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return ft(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||it(p)?(r=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),r=0,a):(p===43||p===45||p===46||it(p))&&r++<32?(e.consume(p),l):(r=0,u(p))}function a(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Va(p)?n(p):(e.consume(p),a)}function u(p){return p===64?(e.consume(p),f):uj(p)?(e.consume(p),u):n(p)}function f(p){return it(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||it(p))&&r++<63){const m=p===45?h:d;return e.consume(p),m}return n(p)}}const yl={partial:!0,tokenize:wj};function wj(e,t,n){return r;function r(s){return se(s)?ce(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||K(s)?t(s):n(s)}}const M1={continuation:{tokenize:Sj},exit:Cj,name:"blockQuote",tokenize:kj};function kj(e,t,n){const r=this;return i;function i(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return se(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Sj(e,t,n){const r=this;return i;function i(o){return se(o)?ce(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(M1,t,n)(o)}}function Cj(e){e.exit("blockQuote")}const O1={name:"characterEscape",tokenize:_j};function _j(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 dj(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const D1={name:"characterReference",tokenize:Ej};function Ej(e,t,n){const r=this;let i=0,s,o;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),a}function a(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,o=it,f(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=cj,f):(e.enter("characterReferenceValue"),s=7,o=Af,f(d))}function f(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return o===it&&!hp(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),f):n(d)}}const Ug={partial:!0,tokenize:jj},Gg={concrete:!0,name:"codeFenced",tokenize:Nj};function Nj(e,t,n){const r=this,i={partial:!0,tokenize:C};let s=0,o=0,l;return a;function a(k){return u(k)}function u(k){const P=r.events[r.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,l=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(k)}function f(k){return k===l?(o++,e.consume(k),f):o<3?n(k):(e.exit("codeFencedFenceSequence"),se(k)?ce(e,d,"whitespace")(k):d(k))}function d(k){return k===null||K(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(Ug,x,w)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||K(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):se(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ce(e,p,"whitespace")(k)):k===96&&k===l?n(k):(e.consume(k),h)}function p(k){return k===null||K(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||K(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===l?n(k):(e.consume(k),m)}function x(k){return e.attempt(i,w,v)(k)}function v(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),g}function g(k){return s>0&&se(k)?ce(e,y,"linePrefix",s+1)(k):y(k)}function y(k){return k===null||K(k)?e.check(Ug,x,w)(k):(e.enter("codeFlowValue"),b(k))}function b(k){return k===null||K(k)?(e.exit("codeFlowValue"),y(k)):(e.consume(k),b)}function w(k){return e.exit("codeFenced"),t(k)}function C(k,P,I){let A=0;return N;function N(G){return k.enter("lineEnding"),k.consume(G),k.exit("lineEnding"),R}function R(G){return k.enter("codeFencedFence"),se(G)?ce(k,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):L(G)}function L(G){return G===l?(k.enter("codeFencedFenceSequence"),V(G)):I(G)}function V(G){return G===l?(A++,k.consume(G),V):A>=o?(k.exit("codeFencedFenceSequence"),se(G)?ce(k,W,"whitespace")(G):W(G)):I(G)}function W(G){return G===null||K(G)?(k.exit("codeFencedFence"),P(G)):I(G)}}}function jj(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 Ic={name:"codeIndented",tokenize:Ij},Pj={partial:!0,tokenize:Tj};function Ij(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ce(e,s,"linePrefix",5)(u)}function s(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?a(u):K(u)?e.attempt(Pj,o,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||K(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function Tj(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):K(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):ce(e,s,"linePrefix",5)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):K(o)?i(o):n(o)}}const Aj={name:"codeText",previous:Lj,resolve:Rj,tokenize:Mj};function Rj(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 Lj(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Mj(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),r++,l):(e.exit("codeTextSequence"),a(d))}function a(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),a):d===96?(s=e.enter("codeTextSequence"),i=0,f(d)):K(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),a):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||K(d)?(e.exit("codeTextData"),a(d)):(e.consume(d),u)}function f(d){return d===96?(e.consume(d),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",u(d))}}class Oj{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&&ro(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),ro(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ro(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ro(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ro(this.left,n.reverse())}}}function ro(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $1(e){const t={};let n=-1,r,i,s,o,l,a,u;const f=new Oj(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(a=r[1]._tokenizer.events,s=0,s<a.length&&a[s][1].type==="lineEndingBlank"&&(s+=2),s<a.length&&a[s][1].type==="content"))for(;++s<a.length&&a[s][1].type!=="content";)a[s][1].type==="chunkText"&&(a[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Dj(f,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=f.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(f.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={...f.get(i)[1].start},l=f.slice(i,n),l.unshift(r),f.splice(i,n-i+1,l))}}return Ot(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function Dj(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 l=o.events,a=[],u={};let f,d,h=-1,p=n,m=0,x=0;const v=[x];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(f),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(x=h+1,v.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):v.pop(),h=v.length;h--;){const g=l.slice(v[h],v[h+1]),y=s.pop();a.push([y,y+g.length-1]),e.splice(y,2,g)}for(a.reverse(),h=-1;++h<a.length;)u[m+a[h][0]]=m+a[h][1],m+=a[h][1]-a[h][0]-1;return u}const $j={resolve:zj,tokenize:Bj},Fj={partial:!0,tokenize:Uj};function zj(e){return $1(e),e}function Bj(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?s(l):K(l)?e.check(Fj,o,s)(l):(e.consume(l),i)}function s(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Uj(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ce(e,s,"linePrefix")}function s(o){if(o===null||K(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function F1(e,t,n,r,i,s,o,l,a){const u=a||Number.POSITIVE_INFINITY;let f=0;return d;function d(g){return g===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(g),e.exit(s),h):g===null||g===32||g===41||Va(g)?n(g):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(g))}function h(g){return g===62?(e.enter(s),e.consume(g),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(l),h(g)):g===null||g===60||K(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function x(g){return!f&&(g===null||g===41||ye(g))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(g)):f<u&&g===40?(e.consume(g),f++,x):g===41?(e.consume(g),f--,x):g===null||g===32||g===40||Va(g)?n(g):(e.consume(g),g===92?v:x)}function v(g){return g===40||g===41||g===92?(e.consume(g),x):x(g)}}function z1(e,t,n,r,i,s){const o=this;let l=0,a;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),f}function f(p){return l>999||p===null||p===91||p===93&&!a||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):K(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||K(p)||l++>999?(e.exit("chunkString"),f(p)):(e.consume(p),a||(a=!se(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}function B1(e,t,n,r,i,s){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,a):n(h)}function a(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),u(h))}function u(h){return h===o?(e.exit(s),a(o)):h===null?n(h):K(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ce(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===o||h===null||K(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?d:f)}function d(h){return h===o||h===92?(e.consume(h),f):f(h)}}function Eo(e,t){let n;return r;function r(i){return K(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):se(i)?ce(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Gj={name:"definition",tokenize:qj},Hj={partial:!0,tokenize:Wj};function qj(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return z1.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=an(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),a):n(p)}function a(p){return ye(p)?Eo(e,u)(p):u(p)}function u(p){return F1(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(Hj,d,d)(p)}function d(p){return se(p)?ce(e,h,"whitespace")(p):h(p)}function h(p){return p===null||K(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function Wj(e,t,n){return r;function r(l){return ye(l)?Eo(e,i)(l):n(l)}function i(l){return B1(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return se(l)?ce(e,o,"whitespace")(l):o(l)}function o(l){return l===null||K(l)?t(l):n(l)}}const Vj={name:"hardBreakEscape",tokenize:Qj};function Qj(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return K(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Kj={name:"headingAtx",resolve:Xj,tokenize:Yj};function Xj(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"},Ot(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Yj(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),s(f)}function s(f){return e.enter("atxHeadingSequence"),o(f)}function o(f){return f===35&&r++<6?(e.consume(f),o):f===null||ye(f)?(e.exit("atxHeadingSequence"),l(f)):n(f)}function l(f){return f===35?(e.enter("atxHeadingSequence"),a(f)):f===null||K(f)?(e.exit("atxHeading"),t(f)):se(f)?ce(e,l,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function a(f){return f===35?(e.consume(f),a):(e.exit("atxHeadingSequence"),l(f))}function u(f){return f===null||f===35||ye(f)?(e.exit("atxHeadingText"),l(f)):(e.consume(f),u)}}const Jj=["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"],Hg=["pre","script","style","textarea"],Zj={concrete:!0,name:"htmlFlow",resolveTo:n2,tokenize:r2},e2={partial:!0,tokenize:s2},t2={partial:!0,tokenize:i2};function n2(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 r2(e,t,n){const r=this;let i,s,o,l,a;return u;function u(_){return f(_)}function f(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),d}function d(_){return _===33?(e.consume(_),h):_===47?(e.consume(_),s=!0,x):_===63?(e.consume(_),i=3,r.interrupt?t:S):ft(_)?(e.consume(_),o=String.fromCharCode(_),v):n(_)}function h(_){return _===45?(e.consume(_),i=2,p):_===91?(e.consume(_),i=5,l=0,m):ft(_)?(e.consume(_),i=4,r.interrupt?t:S):n(_)}function p(_){return _===45?(e.consume(_),r.interrupt?t:S):n(_)}function m(_){const ie="CDATA[";return _===ie.charCodeAt(l++)?(e.consume(_),l===ie.length?r.interrupt?t:L:m):n(_)}function x(_){return ft(_)?(e.consume(_),o=String.fromCharCode(_),v):n(_)}function v(_){if(_===null||_===47||_===62||ye(_)){const ie=_===47,He=o.toLowerCase();return!ie&&!s&&Hg.includes(He)?(i=1,r.interrupt?t(_):L(_)):Jj.includes(o.toLowerCase())?(i=6,ie?(e.consume(_),g):r.interrupt?t(_):L(_)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):s?y(_):b(_))}return _===45||it(_)?(e.consume(_),o+=String.fromCharCode(_),v):n(_)}function g(_){return _===62?(e.consume(_),r.interrupt?t:L):n(_)}function y(_){return se(_)?(e.consume(_),y):N(_)}function b(_){return _===47?(e.consume(_),N):_===58||_===95||ft(_)?(e.consume(_),w):se(_)?(e.consume(_),b):N(_)}function w(_){return _===45||_===46||_===58||_===95||it(_)?(e.consume(_),w):C(_)}function C(_){return _===61?(e.consume(_),k):se(_)?(e.consume(_),C):b(_)}function k(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),a=_,P):se(_)?(e.consume(_),k):I(_)}function P(_){return _===a?(e.consume(_),a=null,A):_===null||K(_)?n(_):(e.consume(_),P)}function I(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||ye(_)?C(_):(e.consume(_),I)}function A(_){return _===47||_===62||se(_)?b(_):n(_)}function N(_){return _===62?(e.consume(_),R):n(_)}function R(_){return _===null||K(_)?L(_):se(_)?(e.consume(_),R):n(_)}function L(_){return _===45&&i===2?(e.consume(_),re):_===60&&i===1?(e.consume(_),fe):_===62&&i===4?(e.consume(_),X):_===63&&i===3?(e.consume(_),S):_===93&&i===5?(e.consume(_),q):K(_)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(e2,ue,V)(_)):_===null||K(_)?(e.exit("htmlFlowData"),V(_)):(e.consume(_),L)}function V(_){return e.check(t2,W,ue)(_)}function W(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),G}function G(_){return _===null||K(_)?V(_):(e.enter("htmlFlowData"),L(_))}function re(_){return _===45?(e.consume(_),S):L(_)}function fe(_){return _===47?(e.consume(_),o="",$):L(_)}function $(_){if(_===62){const ie=o.toLowerCase();return Hg.includes(ie)?(e.consume(_),X):L(_)}return ft(_)&&o.length<8?(e.consume(_),o+=String.fromCharCode(_),$):L(_)}function q(_){return _===93?(e.consume(_),S):L(_)}function S(_){return _===62?(e.consume(_),X):_===45&&i===2?(e.consume(_),S):L(_)}function X(_){return _===null||K(_)?(e.exit("htmlFlowData"),ue(_)):(e.consume(_),X)}function ue(_){return e.exit("htmlFlow"),t(_)}}function i2(e,t,n){const r=this;return i;function i(o){return K(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 s2(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yl,t,n)}}const o2={name:"htmlText",tokenize:l2};function l2(e,t,n){const r=this;let i,s,o;return l;function l(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),a}function a(S){return S===33?(e.consume(S),u):S===47?(e.consume(S),C):S===63?(e.consume(S),b):ft(S)?(e.consume(S),I):n(S)}function u(S){return S===45?(e.consume(S),f):S===91?(e.consume(S),s=0,m):ft(S)?(e.consume(S),y):n(S)}function f(S){return S===45?(e.consume(S),p):n(S)}function d(S){return S===null?n(S):S===45?(e.consume(S),h):K(S)?(o=d,fe(S)):(e.consume(S),d)}function h(S){return S===45?(e.consume(S),p):d(S)}function p(S){return S===62?re(S):S===45?h(S):d(S)}function m(S){const X="CDATA[";return S===X.charCodeAt(s++)?(e.consume(S),s===X.length?x:m):n(S)}function x(S){return S===null?n(S):S===93?(e.consume(S),v):K(S)?(o=x,fe(S)):(e.consume(S),x)}function v(S){return S===93?(e.consume(S),g):x(S)}function g(S){return S===62?re(S):S===93?(e.consume(S),g):x(S)}function y(S){return S===null||S===62?re(S):K(S)?(o=y,fe(S)):(e.consume(S),y)}function b(S){return S===null?n(S):S===63?(e.consume(S),w):K(S)?(o=b,fe(S)):(e.consume(S),b)}function w(S){return S===62?re(S):b(S)}function C(S){return ft(S)?(e.consume(S),k):n(S)}function k(S){return S===45||it(S)?(e.consume(S),k):P(S)}function P(S){return K(S)?(o=P,fe(S)):se(S)?(e.consume(S),P):re(S)}function I(S){return S===45||it(S)?(e.consume(S),I):S===47||S===62||ye(S)?A(S):n(S)}function A(S){return S===47?(e.consume(S),re):S===58||S===95||ft(S)?(e.consume(S),N):K(S)?(o=A,fe(S)):se(S)?(e.consume(S),A):re(S)}function N(S){return S===45||S===46||S===58||S===95||it(S)?(e.consume(S),N):R(S)}function R(S){return S===61?(e.consume(S),L):K(S)?(o=R,fe(S)):se(S)?(e.consume(S),R):A(S)}function L(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,V):K(S)?(o=L,fe(S)):se(S)?(e.consume(S),L):(e.consume(S),W)}function V(S){return S===i?(e.consume(S),i=void 0,G):S===null?n(S):K(S)?(o=V,fe(S)):(e.consume(S),V)}function W(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||ye(S)?A(S):(e.consume(S),W)}function G(S){return S===47||S===62||ye(S)?A(S):n(S)}function re(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function fe(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),$}function $(S){return se(S)?ce(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):q(S)}function q(S){return e.enter("htmlTextData"),o(S)}}const pp={name:"labelEnd",resolveAll:d2,resolveTo:f2,tokenize:h2},a2={tokenize:p2},u2={tokenize:m2},c2={tokenize:g2};function d2(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&&Ot(e,0,e.length,n),e}function f2(e,t){let n=e.length,r=0,i,s,o,l;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 a={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}},f={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",a,t],["enter",u,t]],l=Ht(l,e.slice(s+1,s+r+3)),l=Ht(l,[["enter",f,t]]),l=Ht(l,Fu(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),l=Ht(l,[["exit",f,t],e[o-2],e[o-1],["exit",u,t]]),l=Ht(l,e.slice(o+1)),l=Ht(l,[["exit",a,t]]),Ot(e,s,e.length,l),e}function h2(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 l;function l(h){return s?s._inactive?d(h):(o=r.parser.defined.includes(an(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),a):n(h)}function a(h){return h===40?e.attempt(a2,f,o?f:d)(h):h===91?e.attempt(u2,f,o?u:d)(h):o?f(h):d(h)}function u(h){return e.attempt(c2,f,d)(h)}function f(h){return t(h)}function d(h){return s._balanced=!0,n(h)}}function p2(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return ye(d)?Eo(e,s)(d):s(d)}function s(d){return d===41?f(d):F1(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return ye(d)?Eo(e,a)(d):f(d)}function l(d){return n(d)}function a(d){return d===34||d===39||d===40?B1(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function u(d){return ye(d)?Eo(e,f)(d):f(d)}function f(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function m2(e,t,n){const r=this;return i;function i(l){return z1.call(r,e,s,o,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(an(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function g2(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 x2={name:"labelStartImage",resolveAll:pp.resolveAll,tokenize:y2};function y2(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const b2={name:"labelStartLink",resolveAll:pp.resolveAll,tokenize:v2};function v2(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 Tc={name:"lineEnding",tokenize:w2};function w2(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ce(e,t,"linePrefix")}}const ha={name:"thematicBreak",tokenize:k2};function k2(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,l(u)}function l(u){return u===i?(e.enter("thematicBreakSequence"),a(u)):r>=3&&(u===null||K(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),se(u)?ce(e,l,"whitespace")(u):l(u))}}const xt={continuation:{tokenize:E2},exit:j2,name:"list",tokenize:_2},S2={partial:!0,tokenize:P2},C2={partial:!0,tokenize:N2};function _2(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 l;function l(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Af(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ha,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(p)}return n(p)}function a(p){return Af(p)&&++o<10?(e.consume(p),a):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(yl,r.interrupt?n:f,e.attempt(S2,h,d))}function f(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function d(p){return se(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function E2(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yl,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ce(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!se(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(C2,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ce(e,e.attempt(xt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function N2(e,t,n){const r=this;return ce(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 j2(e){e.exit(this.containerState.type)}function P2(e,t,n){const r=this;return ce(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!se(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const qg={name:"setextUnderline",resolveTo:I2,tokenize:T2};function I2(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 T2(e,t,n){const r=this;let i;return s;function s(u){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),se(u)?ce(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||K(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const A2={tokenize:R2};function R2(e){const t=this,n=e.attempt(yl,r,e.attempt(this.parser.constructs.flowInitial,i,ce(e,e.attempt(this.parser.constructs.flow,i,e.attempt($j,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 L2={resolveAll:G1()},M2=U1("string"),O2=U1("text");function U1(e){return{resolveAll:G1(e==="text"?D2:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,l);return o;function o(f){return u(f)?s(f):l(f)}function l(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),a}function a(f){return u(f)?(n.exit("data"),s(f)):(n.consume(f),a)}function u(f){if(f===null)return!0;const d=i[f];let h=-1;if(d)for(;++h<d.length;){const p=d[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function G1(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 D2(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,l=0,a;for(;s--;){const u=i[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)a=!0,l++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||a||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},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 $2={42:xt,43:xt,45:xt,48:xt,49:xt,50:xt,51:xt,52:xt,53:xt,54:xt,55:xt,56:xt,57:xt,62:M1},F2={91:Gj},z2={[-2]:Ic,[-1]:Ic,32:Ic},B2={35:Kj,42:ha,45:[qg,ha],60:Zj,61:qg,95:ha,96:Gg,126:Gg},U2={38:D1,92:O1},G2={[-5]:Tc,[-4]:Tc,[-3]:Tc,33:x2,38:D1,42:Rf,60:[bj,o2],91:b2,92:[Vj,O1],93:pp,95:Rf,96:Aj},H2={null:[Rf,L2]},q2={null:[42,95]},W2={null:[]},V2=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:q2,contentInitial:F2,disable:W2,document:$2,flow:B2,flowInitial:z2,insideSpan:H2,string:U2,text:G2},Symbol.toStringTag,{value:"Module"}));function Q2(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=[],l=[];const a={attempt:P(C),check:P(k),consume:y,enter:b,exit:w,interrupt:P(k,{interrupt:!0})},u={code:null,containerState:{},defineSkip:x,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:d};let f=t.tokenize.call(u,a);return t.resolveAll&&s.push(t),u;function d(R){return o=Ht(o,R),v(),o[o.length-1]!==null?[]:(I(t,0),u.events=Fu(s,u.events,u),u.events)}function h(R,L){return X2(p(R),L)}function p(R){return K2(o,R)}function m(){const{_bufferIndex:R,_index:L,line:V,column:W,offset:G}=r;return{_bufferIndex:R,_index:L,line:V,column:W,offset:G}}function x(R){i[R.line]=R.column,N()}function v(){let R;for(;r._index<o.length;){const L=o[r._index];if(typeof L=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<L.length;)g(L.charCodeAt(r._bufferIndex));else g(L)}}function g(R){f=f(R)}function y(R){K(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,N()):R!==-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=R}function b(R,L){const V=L||{};return V.type=R,V.start=m(),u.events.push(["enter",V,u]),l.push(V),V}function w(R){const L=l.pop();return L.end=m(),u.events.push(["exit",L,u]),L}function C(R,L){I(R,L.from)}function k(R,L){L.restore()}function P(R,L){return V;function V(W,G,re){let fe,$,q,S;return Array.isArray(W)?ue(W):"tokenize"in W?ue([W]):X(W);function X(Q){return Me;function Me(gt){const Jn=gt!==null&&Q[gt],Zn=gt!==null&&Q.null,Pi=[...Array.isArray(Jn)?Jn:Jn?[Jn]:[],...Array.isArray(Zn)?Zn:Zn?[Zn]:[]];return ue(Pi)(gt)}}function ue(Q){return fe=Q,$=0,Q.length===0?re:_(Q[$])}function _(Q){return Me;function Me(gt){return S=A(),q=Q,Q.partial||(u.currentConstruct=Q),Q.name&&u.parser.constructs.disable.null.includes(Q.name)?He():Q.tokenize.call(L?Object.assign(Object.create(u),L):u,a,ie,He)(gt)}}function ie(Q){return R(q,S),G}function He(Q){return S.restore(),++$<fe.length?_(fe[$]):re}}}function I(R,L){R.resolveAll&&!s.includes(R)&&s.push(R),R.resolve&&Ot(u.events,L,u.events.length-L,R.resolve(u.events.slice(L),u)),R.resolveTo&&(u.events=R.resolveTo(u.events,u))}function A(){const R=m(),L=u.previous,V=u.currentConstruct,W=u.events.length,G=Array.from(l);return{from:W,restore:re};function re(){r=R,u.previous=L,u.currentConstruct=V,u.events.length=W,l=G,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function K2(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 l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function X2(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=`
|
|
213
|
+
`;break}case-3:{o=`\r
|
|
214
|
+
`;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 Y2(e){const r={constructs:R1([V2,...(e||{}).extensions||[]]),content:i(fj),defined:[],document:i(pj),flow:i(A2),lazy:{},string:i(M2),text:i(O2)};return r;function i(s){return o;function o(l){return Q2(r,s,l)}}}function J2(e){for(;!$1(e););return e}const Wg=/[\0\t\n\r]/g;function Z2(){let e=1,t="",n=!0,r;return i;function i(s,o,l){const a=[];let u,f,d,h,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(Wg.lastIndex=d,u=Wg.exec(s),h=u&&u.index!==void 0?u.index:s.length,p=s.charCodeAt(h),!u){t=s.slice(d);break}if(p===10&&d===h&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),d<h&&(a.push(s.slice(d,h)),e+=h-d),p){case 0:{a.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,a.push(-2);e++<f;)a.push(-1);break}case 10:{a.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return l&&(r&&a.push(-5),t&&a.push(t),a.push(null)),a}}const eP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tP(e){return e.replace(eP,nP)}function nP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return L1(n.slice(s?2:1),s?16:10)}return hp(n)||e}const H1={}.hasOwnProperty;function rP(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),iP(n)(J2(Y2(n).document().write(Z2()(e,t,!0))))}function iP(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Hp),autolinkProtocol:A,autolinkEmail:A,atxHeading:s(Bp),blockQuote:s(Zn),characterEscape:A,characterReference:A,codeFenced:s(Pi),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Pi,o),codeText:s(Zu,o),codeTextData:A,data:A,codeFlowValue:A,definition:s(Gs),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Hs),hardBreakEscape:s(Up),hardBreakTrailing:s(Up),htmlFlow:s(Gp,o),htmlFlowData:A,htmlText:s(Gp,o),htmlTextData:A,image:s(Gw),label:o,link:s(Hp),listItem:s(Hw),listItemValue:h,listOrdered:s(qp,d),listUnordered:s(qp),paragraph:s(qw),reference:_,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Bp),strong:s(Ww),thematicBreak:s(Qw)},exit:{atxHeading:a(),atxHeadingSequence:C,autolink:a(),autolinkEmail:Jn,autolinkProtocol:gt,blockQuote:a(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:He,characterReferenceMarkerNumeric:He,characterReferenceValue:Q,characterReference:Me,codeFenced:a(v),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:N,codeIndented:a(g),codeText:a(G),codeTextData:N,data:N,definition:a(),definitionDestinationString:w,definitionLabelString:y,definitionTitleString:b,emphasis:a(),hardBreakEscape:a(L),hardBreakTrailing:a(L),htmlFlow:a(V),htmlFlowData:N,htmlText:a(W),htmlTextData:N,image:a(fe),label:q,labelText:$,lineEnding:R,link:a(re),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:ie,resourceDestinationString:S,resourceTitleString:X,resource:ue,setextHeading:a(I),setextHeadingLineSequence:P,setextHeadingText:k,strong:a(),thematicBreak:a()}};q1(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(M){let z={type:"root",children:[]};const J={stack:[z],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:f,data:n},le=[];let xe=-1;for(;++xe<M.length;)if(M[xe][1].type==="listOrdered"||M[xe][1].type==="listUnordered")if(M[xe][0]==="enter")le.push(xe);else{const Jt=le.pop();xe=i(M,Jt,xe)}for(xe=-1;++xe<M.length;){const Jt=t[M[xe][0]];H1.call(Jt,M[xe][1].type)&&Jt[M[xe][1].type].call(Object.assign({sliceSerialize:M[xe][2].sliceSerialize},J),M[xe][1])}if(J.tokenStack.length>0){const Jt=J.tokenStack[J.tokenStack.length-1];(Jt[1]||Vg).call(J,void 0,Jt[0])}for(z.position={start:rr(M.length>0?M[0][1].start:{line:1,column:1,offset:0}),end:rr(M.length>0?M[M.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe<t.transforms.length;)z=t.transforms[xe](z)||z;return z}function i(M,z,J){let le=z-1,xe=-1,Jt=!1,Gr,Cn,qs,Ws;for(;++le<=J;){const jt=M[le];switch(jt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{jt[0]==="enter"?xe++:xe--,Ws=void 0;break}case"lineEndingBlank":{jt[0]==="enter"&&(Gr&&!Ws&&!xe&&!qs&&(qs=le),Ws=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ws=void 0}if(!xe&&jt[0]==="enter"&&jt[1].type==="listItemPrefix"||xe===-1&&jt[0]==="exit"&&(jt[1].type==="listUnordered"||jt[1].type==="listOrdered")){if(Gr){let Ii=le;for(Cn=void 0;Ii--;){const _n=M[Ii];if(_n[1].type==="lineEnding"||_n[1].type==="lineEndingBlank"){if(_n[0]==="exit")continue;Cn&&(M[Cn][1].type="lineEndingBlank",Jt=!0),_n[1].type="lineEnding",Cn=Ii}else if(!(_n[1].type==="linePrefix"||_n[1].type==="blockQuotePrefix"||_n[1].type==="blockQuotePrefixWhitespace"||_n[1].type==="blockQuoteMarker"||_n[1].type==="listItemIndent"))break}qs&&(!Cn||qs<Cn)&&(Gr._spread=!0),Gr.end=Object.assign({},Cn?M[Cn][1].start:jt[1].end),M.splice(Cn||le,0,["exit",Gr,jt[2]]),le++,J++}if(jt[1].type==="listItemPrefix"){const Ii={type:"listItem",_spread:!1,start:Object.assign({},jt[1].start),end:void 0};Gr=Ii,M.splice(le,0,["enter",Ii,jt[2]]),le++,J++,qs=void 0,Ws=!0}}}return M[z][1]._spread=Jt,J}function s(M,z){return J;function J(le){l.call(this,M(le),le),z&&z.call(this,le)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(M,z,J){this.stack[this.stack.length-1].children.push(M),this.stack.push(M),this.tokenStack.push([z,J||void 0]),M.position={start:rr(z.start),end:void 0}}function a(M){return z;function z(J){M&&M.call(this,J),u.call(this,J)}}function u(M,z){const J=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==M.type&&(z?z.call(this,M,le[0]):(le[1]||Vg).call(this,M,le[0]));else throw new Error("Cannot close `"+M.type+"` ("+_o({start:M.start,end:M.end})+"): it’s not open");J.position.end=rr(M.end)}function f(){return fp(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(M){if(this.data.expectingFirstListItemValue){const z=this.stack[this.stack.length-2];z.start=Number.parseInt(this.sliceSerialize(M),10),this.data.expectingFirstListItemValue=void 0}}function p(){const M=this.resume(),z=this.stack[this.stack.length-1];z.lang=M}function m(){const M=this.resume(),z=this.stack[this.stack.length-1];z.meta=M}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const M=this.resume(),z=this.stack[this.stack.length-1];z.value=M.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const M=this.resume(),z=this.stack[this.stack.length-1];z.value=M.replace(/(\r?\n|\r)$/g,"")}function y(M){const z=this.resume(),J=this.stack[this.stack.length-1];J.label=z,J.identifier=an(this.sliceSerialize(M)).toLowerCase()}function b(){const M=this.resume(),z=this.stack[this.stack.length-1];z.title=M}function w(){const M=this.resume(),z=this.stack[this.stack.length-1];z.url=M}function C(M){const z=this.stack[this.stack.length-1];if(!z.depth){const J=this.sliceSerialize(M).length;z.depth=J}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function P(M){const z=this.stack[this.stack.length-1];z.depth=this.sliceSerialize(M).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function A(M){const J=this.stack[this.stack.length-1].children;let le=J[J.length-1];(!le||le.type!=="text")&&(le=Vw(),le.position={start:rr(M.start),end:void 0},J.push(le)),this.stack.push(le)}function N(M){const z=this.stack.pop();z.value+=this.sliceSerialize(M),z.position.end=rr(M.end)}function R(M){const z=this.stack[this.stack.length-1];if(this.data.atHardBreak){const J=z.children[z.children.length-1];J.position.end=rr(M.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(z.type)&&(A.call(this,M),N.call(this,M))}function L(){this.data.atHardBreak=!0}function V(){const M=this.resume(),z=this.stack[this.stack.length-1];z.value=M}function W(){const M=this.resume(),z=this.stack[this.stack.length-1];z.value=M}function G(){const M=this.resume(),z=this.stack[this.stack.length-1];z.value=M}function re(){const M=this.stack[this.stack.length-1];if(this.data.inReference){const z=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=z,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function fe(){const M=this.stack[this.stack.length-1];if(this.data.inReference){const z=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=z,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function $(M){const z=this.sliceSerialize(M),J=this.stack[this.stack.length-2];J.label=tP(z),J.identifier=an(z).toLowerCase()}function q(){const M=this.stack[this.stack.length-1],z=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){const le=M.children;J.children=le}else J.alt=z}function S(){const M=this.resume(),z=this.stack[this.stack.length-1];z.url=M}function X(){const M=this.resume(),z=this.stack[this.stack.length-1];z.title=M}function ue(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function ie(M){const z=this.resume(),J=this.stack[this.stack.length-1];J.label=z,J.identifier=an(this.sliceSerialize(M)).toLowerCase(),this.data.referenceType="full"}function He(M){this.data.characterReferenceType=M.type}function Q(M){const z=this.sliceSerialize(M),J=this.data.characterReferenceType;let le;J?(le=L1(z,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=hp(z);const xe=this.stack[this.stack.length-1];xe.value+=le}function Me(M){const z=this.stack.pop();z.position.end=rr(M.end)}function gt(M){N.call(this,M);const z=this.stack[this.stack.length-1];z.url=this.sliceSerialize(M)}function Jn(M){N.call(this,M);const z=this.stack[this.stack.length-1];z.url="mailto:"+this.sliceSerialize(M)}function Zn(){return{type:"blockquote",children:[]}}function Pi(){return{type:"code",lang:null,meta:null,value:""}}function Zu(){return{type:"inlineCode",value:""}}function Gs(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Hs(){return{type:"emphasis",children:[]}}function Bp(){return{type:"heading",depth:0,children:[]}}function Up(){return{type:"break"}}function Gp(){return{type:"html",value:""}}function Gw(){return{type:"image",title:null,url:"",alt:null}}function Hp(){return{type:"link",title:null,url:"",children:[]}}function qp(M){return{type:"list",ordered:M.type==="listOrdered",start:null,spread:M._spread,children:[]}}function Hw(M){return{type:"listItem",spread:M._spread,checked:null,children:[]}}function qw(){return{type:"paragraph",children:[]}}function Ww(){return{type:"strong",children:[]}}function Vw(){return{type:"text",value:""}}function Qw(){return{type:"thematicBreak"}}}function rr(e){return{line:e.line,column:e.column,offset:e.offset}}function q1(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?q1(e,r):sP(e,r)}}function sP(e,t){let n;for(n in t)if(H1.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 Vg(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_o({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_o({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_o({start:t.start,end:t.end})+") is still open")}function oP(e){const t=this;t.parser=n;function n(r){return rP(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function lP(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 aP(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
215
|
+
`}]}function uP(e,t){const n=t.value?t.value+`
|
|
216
|
+
`:"",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 cP(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dP(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fP(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Fs(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(r,l);const a={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function hP(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 pP(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function W1(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 mP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return W1(e,t);const i={src:Fs(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 gP(e,t){const n={src:Fs(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 xP(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 yP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return W1(e,t);const i={href:Fs(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 bP(e,t){const n={href:Fs(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 vP(e,t,n){const r=e.all(t),i=n?wP(n):V1(t),s={},o=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const f=r[l];(i||l!==0||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
|
|
217
|
+
`}),f.type==="element"&&f.tagName==="p"&&!i?o.push(...f.children):o.push(f)}const a=r[r.length-1];a&&(i||a.type!=="element"||a.tagName!=="p")&&o.push({type:"text",value:`
|
|
218
|
+
`});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function wP(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=V1(n[r])}return t}function V1(e){const t=e.spread;return t??e.children.length>1}function kP(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 SP(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CP(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function _P(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EP(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)},l=ap(t.children[1]),a=E1(t.children[t.children.length-1]);l&&a&&(o.position={start:l,end:a}),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 NP(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,l=o?o.length:t.children.length;let a=-1;const u=[];for(;++a<l;){const d=t.children[a],h={},p=o?o[a]:void 0;p&&(h.align=p);let m={type:"element",tagName:s,properties:h,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),u.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function jP(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Qg=9,Kg=32;function PP(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Xg(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Xg(t.slice(i),i>0,!1)),s.join("")}function Xg(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Qg||s===Kg;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Qg||s===Kg;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function IP(e,t){const n={type:"text",value:PP(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function TP(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const AP={blockquote:lP,break:aP,code:uP,delete:cP,emphasis:dP,footnoteReference:fP,heading:hP,html:pP,imageReference:mP,image:gP,inlineCode:xP,linkReference:yP,link:bP,listItem:vP,list:kP,paragraph:SP,root:CP,strong:_P,table:EP,tableCell:jP,tableRow:NP,text:IP,thematicBreak:TP,toml:Hl,yaml:Hl,definition:Hl,footnoteDefinition:Hl};function Hl(){}const Q1=-1,zu=0,No=1,Qa=2,mp=3,gp=4,xp=5,yp=6,K1=7,X1=8,RP=typeof self=="object"?self:globalThis,Yg=(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 RP[e](t)},LP=(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 zu:case Q1:return n(o,i);case No:{const l=n([],i);for(const a of o)l.push(r(a));return l}case Qa:{const l=n({},i);for(const[a,u]of o)l[r(a)]=r(u);return l}case mp:return n(new Date(o),i);case gp:{const{source:l,flags:a}=o;return n(new RegExp(l,a),i)}case xp:{const l=n(new Map,i);for(const[a,u]of o)l.set(r(a),r(u));return l}case yp:{const l=n(new Set,i);for(const a of o)l.add(r(a));return l}case K1:{const{name:l,message:a}=o;return n(Yg(l,a),i)}case X1: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:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(Yg(s,o),i)};return r},Jg=e=>LP(new Map,e)(0),Ri="",{toString:MP}={},{keys:OP}=Object,io=e=>{const t=typeof e;if(t!=="object"||!e)return[zu,t];const n=MP.call(e).slice(8,-1);switch(n){case"Array":return[No,Ri];case"Object":return[Qa,Ri];case"Date":return[mp,Ri];case"RegExp":return[gp,Ri];case"Map":return[xp,Ri];case"Set":return[yp,Ri];case"DataView":return[No,n]}return n.includes("Array")?[No,n]:n.includes("Error")?[K1,n]:[Qa,n]},ql=([e,t])=>e===zu&&(t==="function"||t==="symbol"),DP=(e,t,n,r)=>{const i=(o,l)=>{const a=r.push(o)-1;return n.set(l,a),a},s=o=>{if(n.has(o))return n.get(o);let[l,a]=io(o);switch(l){case zu:{let f=o;switch(a){case"bigint":l=X1,f=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);f=null;break;case"undefined":return i([Q1],o)}return i([l,f],o)}case No:{if(a){let h=o;return a==="DataView"?h=new Uint8Array(o.buffer):a==="ArrayBuffer"&&(h=new Uint8Array(o)),i([a,[...h]],o)}const f=[],d=i([l,f],o);for(const h of o)f.push(s(h));return d}case Qa:{if(a)switch(a){case"BigInt":return i([a,o.toString()],o);case"Boolean":case"Number":case"String":return i([a,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const f=[],d=i([l,f],o);for(const h of OP(o))(e||!ql(io(o[h])))&&f.push([s(h),s(o[h])]);return d}case mp:return i([l,o.toISOString()],o);case gp:{const{source:f,flags:d}=o;return i([l,{source:f,flags:d}],o)}case xp:{const f=[],d=i([l,f],o);for(const[h,p]of o)(e||!(ql(io(h))||ql(io(p))))&&f.push([s(h),s(p)]);return d}case yp:{const f=[],d=i([l,f],o);for(const h of o)(e||!ql(io(h)))&&f.push(s(h));return d}}const{message:u}=o;return i([l,{name:a,message:u}],o)};return s},Zg=(e,{json:t,lossy:n}={})=>{const r=[];return DP(!(t||n),!!t,new Map,r)(e),r},Ka=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Jg(Zg(e,t)):structuredClone(e):(e,t)=>Jg(Zg(e,t));function $P(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 FP(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function zP(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||$P,r=e.options.footnoteBackLabel||FP,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let a=-1;for(;++a<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[a]);if(!u)continue;const f=e.all(u),d=String(u.identifier).toUpperCase(),h=Fs(d.toLowerCase());let p=0;const m=[],x=e.footnoteCounts.get(d);for(;x!==void 0&&++p<=x;){m.length>0&&m.push({type:"text",value:" "});let y=typeof n=="string"?n:n(a,p);typeof y=="string"&&(y={type:"text",value:y}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,p),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const v=f[f.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const y=v.children[v.children.length-1];y&&y.type==="text"?y.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else f.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(u,g),l.push(g)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Ka(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
219
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
220
|
+
`}]}}const Bu=function(e){if(e==null)return HP;if(typeof e=="function")return Uu(e);if(typeof e=="object")return Array.isArray(e)?BP(e):UP(e);if(typeof e=="string")return GP(e);throw new Error("Expected function, string, or object as test")};function BP(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Bu(e[n]);return Uu(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function UP(e){const t=e;return Uu(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function GP(e){return Uu(t);function t(n){return n&&n.type===e}}function Uu(e){return t;function t(n,r,i){return!!(qP(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function HP(){return!0}function qP(e){return e!==null&&typeof e=="object"&&"type"in e}const Y1=[],WP=!0,Lf=!1,VP="skip";function J1(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Bu(i),o=r?-1:1;l(e,void 0,[])();function l(a,u,f){const d=a&&typeof a=="object"?a:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(a.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Y1,m,x,v;if((!t||s(a,u,f[f.length-1]||void 0))&&(p=QP(n(a,f)),p[0]===Lf))return p;if("children"in a&&a.children){const g=a;if(g.children&&p[0]!==VP)for(x=(r?g.children.length:-1)+o,v=f.concat(g);x>-1&&x<g.children.length;){const y=g.children[x];if(m=l(y,x,v)(),m[0]===Lf)return m;x=typeof m[1]=="number"?m[1]:x+o}}return p}}}function QP(e){return Array.isArray(e)?e:typeof e=="number"?[WP,e]:e==null?Y1:[e]}function bp(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),J1(e,s,l,i);function l(a,u){const f=u[u.length-1],d=f?f.children.indexOf(a):void 0;return o(a,d,f)}}const Mf={}.hasOwnProperty,KP={};function XP(e,t){const n=t||KP,r=new Map,i=new Map,s=new Map,o={...AP,...n.handlers},l={all:u,applyData:JP,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:a,options:n,patch:YP,wrap:eI};return bp(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const d=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();d.has(h)||d.set(h,f)}}),l;function a(f,d){const h=f.type,p=l.handlers[h];if(Mf.call(l.handlers,h)&&p)return p(l,f,d);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in f){const{children:x,...v}=f,g=Ka(v);return g.children=l.all(f),g}return Ka(f)}return(l.options.unknownHandler||ZP)(l,f,d)}function u(f){const d=[];if("children"in f){const h=f.children;let p=-1;for(;++p<h.length;){const m=l.one(h[p],f);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=ex(m.value)),!Array.isArray(m)&&m.type==="element")){const x=m.children[0];x&&x.type==="text"&&(x.value=ex(x.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function YP(e,t){e.position&&(t.position=$N(e))}function JP(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,Ka(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function ZP(e,t){const n=t.data||{},r="value"in t&&!(Mf.call(n,"hProperties")||Mf.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 eI(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
221
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
222
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
223
|
+
`}),n}function ex(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function tx(e,t){const n=XP(e,t),r=n.one(e,void 0),i=zP(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
224
|
+
`},i),s}function tI(e,t){return e&&"run"in e?async function(n,r){const i=tx(n,{file:r,...t});await e.run(i,r)}:function(n,r){return tx(n,{file:r,...e||t})}}function nx(e){if(e)throw e}var pa=Object.prototype.hasOwnProperty,Z1=Object.prototype.toString,rx=Object.defineProperty,ix=Object.getOwnPropertyDescriptor,sx=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Z1.call(t)==="[object Array]"},ox=function(t){if(!t||Z1.call(t)!=="[object Object]")return!1;var n=pa.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&pa.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||pa.call(t,i)},lx=function(t,n){rx&&n.name==="__proto__"?rx(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ax=function(t,n){if(n==="__proto__")if(pa.call(t,n)){if(ix)return ix(t,n).value}else return;return t[n]},nI=function e(){var t,n,r,i,s,o,l=arguments[0],a=1,u=arguments.length,f=!1;for(typeof l=="boolean"&&(f=l,l=arguments[1]||{},a=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});a<u;++a)if(t=arguments[a],t!=null)for(n in t)r=ax(l,n),i=ax(t,n),l!==i&&(f&&i&&(ox(i)||(s=sx(i)))?(s?(s=!1,o=r&&sx(r)?r:[]):o=r&&ox(r)?r:{},lx(l,{name:n,newValue:e(f,o,i)})):typeof i<"u"&&lx(l,{name:n,newValue:i}));return l};const Ac=rh(nI);function Of(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 rI(){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);l(null,...i);function l(a,...u){const f=e[++s];let d=-1;if(a){o(a);return}for(;++d<i.length;)(u[d]===null||u[d]===void 0)&&(u[d]=i[d]);i=u,f?iI(f,l)(...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 iI(e,t){let n;return r;function r(...o){const l=e.length>o.length;let a;l&&o.push(i);try{a=e.apply(this,o)}catch(u){const f=u;if(l&&n)throw f;return i(f)}l||(a&&a.then&&typeof a.then=="function"?a.then(s,i):a instanceof Error?i(a):s(a))}function i(o,...l){n||(n=!0,t(o,...l))}function s(o){i(null,o)}}const mn={basename:sI,dirname:oI,extname:lI,join:aI,sep:"/"};function sI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bl(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,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function oI(e){if(bl(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 lI(e){bl(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===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 aI(...e){let t=-1,n;for(;++t<e.length;)bl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":uI(n)}function uI(e){bl(e);const t=e.codePointAt(0)===47;let n=cI(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function cI(e,t){let n="",r=0,i=-1,s=0,o=-1,l,a;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===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(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),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 l===46&&s>-1?s++:s=-1}return n}function bl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dI={cwd:fI};function fI(){return"/"}function Df(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function hI(e){if(typeof e=="string")e=new URL(e);else if(!Df(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 pI(e)}function pI(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 Rc=["history","path","basename","stem","extname","dirname"];class ev{constructor(t){let n;t?Df(t)?n={path:t}:typeof t=="string"||mI(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":dI.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Rc.length;){const s=Rc[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)Rc.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?mn.basename(this.path):void 0}set basename(t){Mc(t,"basename"),Lc(t,"basename"),this.path=mn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?mn.dirname(this.path):void 0}set dirname(t){ux(this.basename,"dirname"),this.path=mn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?mn.extname(this.path):void 0}set extname(t){if(Lc(t,"extname"),ux(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=mn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Df(t)&&(t=hI(t)),Mc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?mn.basename(this.path,this.extname):void 0}set stem(t){Mc(t,"stem"),Lc(t,"stem"),this.path=mn.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 ot(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 Lc(e,t){if(e&&e.includes(mn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+mn.sep+"`")}function Mc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ux(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function mI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const gI=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},xI={}.hasOwnProperty;class vp extends gI{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=rI()}copy(){const t=new vp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ac(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?($c("data",this.frozen),this.namespace[t]=n,this):xI.call(this.namespace,t)&&this.namespace[t]||void 0:t?($c("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=Wl(t),r=this.parser||this.Parser;return Oc("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Oc("process",this.parser||this.Parser),Dc("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const l=Wl(t),a=r.parse(l);r.run(a,l,function(f,d,h){if(f||!d||!h)return u(f);const p=d,m=r.stringify(p,h);vI(m)?h.value=m:h.result=m,u(f,h)});function u(f,d){f||!d?o(f):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Oc("processSync",this.parser||this.Parser),Dc("processSync",this.compiler||this.Compiler),this.process(t,i),dx("processSync","process",n),r;function i(s,o){n=!0,nx(s),r=o}}run(t,n,r){cx(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,l){const a=Wl(n);i.run(t,a,u);function u(f,d,h){const p=d||t;f?l(f):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),dx("runSync","run",r),i;function s(o,l){nx(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=Wl(n),i=this.compiler||this.Compiler;return Dc("stringify",i),cx(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if($c("use",this.frozen),t!=null)if(typeof t=="function")a(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")a(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...d]=u;a(f,d)}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");l(u.plugins),u.settings&&(i.settings=Ac(!0,i.settings,u.settings))}function l(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const d=u[f];s(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function a(u,f){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===u){h=d;break}if(h===-1)r.push([u,...f]);else if(f.length>0){let[p,...m]=f;const x=r[h][1];Of(x)&&Of(p)&&(p=Ac(!0,x,p)),r[h]=[u,p,...m]}}}}const yI=new vp().freeze();function Oc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Dc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $c(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 cx(e){if(!Of(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wl(e){return bI(e)?e:new ev(e)}function bI(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vI(e){return typeof e=="string"||wI(e)}function wI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kI="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",fx=[],hx={allowDangerousHtml:!0},SI=/^(https?|ircs?|mailto|xmpp)$/i,CI=[{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 _I(e){const t=EI(e),n=NI(e);return jI(t.runSync(t.parse(n),n),e)}function EI(e){const t=e.rehypePlugins||fx,n=e.remarkPlugins||fx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hx}:hx;return yI().use(oP).use(n).use(tI,r).use(t)}function NI(e){const t=e.children||"",n=new ev;return typeof t=="string"&&(n.value=t),n}function jI(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,a=t.urlTransform||PI;for(const f of CI)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+kI+f.id,void 0);return bp(e,u),GN(e,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(f,d,h){if(f.type==="raw"&&h&&typeof d=="number")return o?h.children.splice(d,1):h.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let p;for(p in Pc)if(Object.hasOwn(Pc,p)&&Object.hasOwn(f.properties,p)){const m=f.properties[p],x=Pc[p];(x===null||x.includes(f.tagName))&&(f.properties[p]=a(String(m||""),p,f))}}if(f.type==="element"){let p=n?!n.includes(f.tagName):s?s.includes(f.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(f,d,h)),p&&h&&typeof d=="number")return l&&f.children?h.children.splice(d,1,...f.children):h.children.splice(d,1),d}}}function PI(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||SI.test(e.slice(0,t))?e:""}function Xa(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 II(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function TI(e,t,n){const i=Bu((n||{}).ignore||[]),s=AI(t);let o=-1;for(;++o<s.length;)J1(e,"text",l);function l(u,f){let d=-1,h;for(;++d<f.length;){const p=f[d],m=h?h.children:void 0;if(i(p,m?m.indexOf(p):void 0,h))return;h=p}if(h)return a(u,f)}function a(u,f){const d=f[f.length-1],h=s[o][0],p=s[o][1];let m=0;const v=d.children.indexOf(u);let g=!1,y=[];h.lastIndex=0;let b=h.exec(u.value);for(;b;){const w=b.index,C={index:b.index,input:b.input,stack:[...f,u]};let k=p(...b,C);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?h.lastIndex=w+1:(m!==w&&y.push({type:"text",value:u.value.slice(m,w)}),Array.isArray(k)?y.push(...k):k&&y.push(k),m=w+b[0].length,g=!0),!h.global)break;b=h.exec(u.value)}return g?(m<u.value.length&&y.push({type:"text",value:u.value.slice(m)}),d.children.splice(v,1,...y)):y=[u],v+y.length}}function AI(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([RI(i[0]),LI(i[1])])}return t}function RI(e){return typeof e=="string"?new RegExp(II(e),"g"):e}function LI(e){return typeof e=="function"?e:function(){return e}}const Fc="phrasing",zc=["autolink","link","image","label"];function MI(){return{transforms:[UI],enter:{literalAutolink:DI,literalAutolinkEmail:Bc,literalAutolinkHttp:Bc,literalAutolinkWww:Bc},exit:{literalAutolink:BI,literalAutolinkEmail:zI,literalAutolinkHttp:$I,literalAutolinkWww:FI}}}function OI(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fc,notInConstruct:zc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fc,notInConstruct:zc},{character:":",before:"[ps]",after:"\\/",inConstruct:Fc,notInConstruct:zc}]}}function DI(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Bc(e){this.config.enter.autolinkProtocol.call(this,e)}function $I(e){this.config.exit.autolinkProtocol.call(this,e)}function FI(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 zI(e){this.config.exit.autolinkEmail.call(this,e)}function BI(e){this.exit(e)}function UI(e){TI(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,GI],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),HI]],{ignore:["link","linkReference"]})}function GI(e,t,n,r,i){let s="";if(!tv(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!qI(n)))return!1;const o=WI(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function HI(e,t,n,r){return!tv(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function qI(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 WI(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=Xa(e,"(");let s=Xa(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 tv(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||wi(n)||$u(n))&&(!t||n!==47)}nv.peek=tT;function VI(){this.buffer()}function QI(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function KI(){this.buffer()}function XI(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function YI(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=an(this.sliceSerialize(e)).toLowerCase(),n.label=t}function JI(e){this.exit(e)}function ZI(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=an(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eT(e){this.exit(e)}function tT(){return"["}function nv(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=i.move("]"),s}function nT(){return{enter:{gfmFootnoteCallString:VI,gfmFootnoteCall:QI,gfmFootnoteDefinitionLabelString:KI,gfmFootnoteDefinition:XI},exit:{gfmFootnoteCallString:YI,gfmFootnoteCall:JI,gfmFootnoteDefinitionLabelString:ZI,gfmFootnoteDefinition:eT}}}function rT(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:nv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const l=s.createTracker(o);let a=l.move("[^");const u=s.enter("footnoteDefinition"),f=s.enter("label");return a+=l.move(s.safe(s.associationId(r),{before:a,after:"]"})),f(),a+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),a+=l.move((t?`
|
|
225
|
+
`:" ")+s.indentLines(s.containerFlow(r,l.current()),t?rv:iT))),u(),a}}function iT(e,t,n){return t===0?e:rv(e,t,n)}function rv(e,t,n){return(n?"":" ")+e}const sT=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];iv.peek=cT;function oT(){return{canContainEols:["delete"],enter:{strikethrough:aT},exit:{strikethrough:uT}}}function lT(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:sT}],handlers:{delete:iv}}}function aT(e){this.enter({type:"delete",children:[]},e)}function uT(e){this.exit(e)}function iv(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 cT(){return"~"}function dT(e){return e.length}function fT(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||dT,s=[],o=[],l=[],a=[];let u=0,f=-1;for(;++f<e.length;){const x=[],v=[];let g=-1;for(e[f].length>u&&(u=e[f].length);++g<e[f].length;){const y=hT(e[f][g]);if(n.alignDelimiters!==!1){const b=i(y);v[g]=b,(a[g]===void 0||b>a[g])&&(a[g]=b)}x.push(y)}o[f]=x,l[f]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<u;)s[d]=px(r[d]);else{const x=px(r);for(;++d<u;)s[d]=x}d=-1;const h=[],p=[];for(;++d<u;){const x=s[d];let v="",g="";x===99?(v=":",g=":"):x===108?v=":":x===114&&(g=":");let y=n.alignDelimiters===!1?1:Math.max(1,a[d]-v.length-g.length);const b=v+"-".repeat(y)+g;n.alignDelimiters!==!1&&(y=v.length+y+g.length,y>a[d]&&(a[d]=y),p[d]=y),h[d]=b}o.splice(1,0,h),l.splice(1,0,p),f=-1;const m=[];for(;++f<o.length;){const x=o[f],v=l[f];d=-1;const g=[];for(;++d<u;){const y=x[d]||"";let b="",w="";if(n.alignDelimiters!==!1){const C=a[d]-(v[d]||0),k=s[d];k===114?b=" ".repeat(C):k===99?C%2?(b=" ".repeat(C/2+.5),w=" ".repeat(C/2-.5)):(b=" ".repeat(C/2),w=b):w=" ".repeat(C)}n.delimiterStart!==!1&&!d&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||d)&&g.push(" "),n.alignDelimiters!==!1&&g.push(b),g.push(y),n.alignDelimiters!==!1&&g.push(w),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||d!==u-1)&&g.push("|")}m.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return m.join(`
|
|
226
|
+
`)}function hT(e){return e==null?"":String(e)}function px(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}const mx={}.hasOwnProperty;function pT(e,t){const n=t||{};function r(i,...s){let o=r.invalid;const l=r.handlers;if(i&&mx.call(i,e)){const a=String(i[e]);o=mx.call(l,a)?l[a]:r.unknown}if(o)return o.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function mT(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()),gT);return i(),o}function gT(e,t,n){return">"+(n?"":" ")+e}function xT(e,t){return gx(e,t.inConstruct,!0)&&!gx(e,t.notInConstruct,!1)}function gx(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 xx(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
227
|
+
`&&xT(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
228
|
+
`}function yT(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 bT(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 vT(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 wT(e,t,n,r){const i=vT(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(bT(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(s,kT);return d(),h}const l=n.createTracker(r),a=i.repeat(Math.max(yT(s,i)+1,3)),u=n.enter("codeFenced");let f=l.move(a);if(e.lang){const d=n.enter(`codeFencedLang${o}`);f+=l.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);f+=l.move(" "),f+=l.move(n.safe(e.meta,{before:f,after:`
|
|
229
|
+
`,encode:["`"],...l.current()})),d()}return f+=l.move(`
|
|
230
|
+
`),s&&(f+=l.move(s+`
|
|
231
|
+
`)),f+=l.move(a),u(),f}function kT(e,t,n){return(n?"":" ")+e}function wp(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 ST(e,t,n,r){const i=wp(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const a=n.createTracker(r);let u=a.move("[");return u+=a.move(n.safe(n.associationId(e),{before:u,after:"]",...a.current()})),u+=a.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
232
|
+
`,...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),o(),u}function CT(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 Yo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ya(e,t,n){const r=Ps(e),i=Ps(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}}sv.peek=_T;function sv(e,t,n,r){const i=CT(n),s=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let a=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const u=a.charCodeAt(0),f=Ya(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(a=Yo(u)+a.slice(1));const d=a.charCodeAt(a.length-1),h=Ya(r.after.charCodeAt(0),d,i);h.inside&&(a=a.slice(0,-1)+Yo(d));const p=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},l+a+p}function _T(e,t,n){return n.options.emphasis||"*"}function ET(e,t){let n=!1;return bp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Lf}),!!((!e.depth||e.depth<3)&&fp(e)&&(t.options.setext||n))}function NT(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(ET(e,n)){const f=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
|
|
233
|
+
`,after:`
|
|
234
|
+
`});return d(),f(),h+`
|
|
235
|
+
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
236
|
+
`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),a=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
237
|
+
`,...s.current()});return/^[\t ]/.test(u)&&(u=Yo(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),a(),l(),u}ov.peek=jT;function ov(e){return e.value||""}function jT(){return"<"}lv.peek=PT;function lv(e,t,n,r){const i=wp(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const a=n.createTracker(r);let u=a.move("![");return u+=a.move(n.safe(e.alt,{before:u,after:"]",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),o(),u}function PT(){return"!"}av.peek=IT;function av(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let a=l.move("![");const u=n.safe(e.alt,{before:a,after:"]",...l.current()});a+=l.move(u+"]["),o();const f=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:a,after:"]",...l.current()});return o(),n.stack=f,s(),i==="full"||!u||u!==d?a+=l.move(d+"]"):i==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function IT(){return"!"}uv.peek=TT;function uv(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],l=n.compilePattern(o);let a;if(o.atBreak)for(;a=l.exec(r);){let u=a.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(a.index+1)}}return i+r+i}function TT(){return"`"}function cv(e,t){const n=fp(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))}dv.peek=AT;function dv(e,t,n,r){const i=wp(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,a;if(cv(e,n)){const f=n.stack;n.stack=[],l=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),l(),n.stack=f,d}l=n.enter("link"),a=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(a=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),a(),e.title&&(a=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),a()),u+=o.move(")"),l(),u}function AT(e,t,n){return cv(e,n)?"<":"["}fv.peek=RT;function fv(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let a=l.move("[");const u=n.containerPhrasing(e,{before:a,after:"]",...l.current()});a+=l.move(u+"]["),o();const f=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:a,after:"]",...l.current()});return o(),n.stack=f,s(),i==="full"||!u||u!==d?a+=l.move(d+"]"):i==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function RT(){return"["}function kp(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 LT(e){const t=kp(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 MT(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 hv(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 OT(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?MT(n):kp(n);const l=e.ordered?o==="."?")":".":LT(n);let a=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(a=!0),hv(n)===o&&f){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){a=!0;break}}}}a&&(o=l),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),u}function DT(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 $T(e,t,n,r){const i=DT(n);let s=n.bulletCurrent||kp(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 l=n.createTracker(r);l.move(s+" ".repeat(o-s.length)),l.shift(o);const a=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),f);return a(),u;function f(d,h,p){return h?(p?"":" ".repeat(o))+d:(p?s:s+" ".repeat(o-s.length))+d}}function FT(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const zT=Bu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function BT(e,t,n,r){return(e.children.some(function(o){return zT(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function UT(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}pv.peek=GT;function pv(e,t,n,r){const i=UT(n),s=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let a=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const u=a.charCodeAt(0),f=Ya(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(a=Yo(u)+a.slice(1));const d=a.charCodeAt(a.length-1),h=Ya(r.after.charCodeAt(0),d,i);h.inside&&(a=a.slice(0,-1)+Yo(d));const p=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},l+a+p}function GT(e,t,n){return n.options.strong||"*"}function HT(e,t,n,r){return n.safe(e.value,r)}function qT(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 WT(e,t,n){const r=(hv(n)+(n.options.ruleSpaces?" ":"")).repeat(qT(n));return n.options.ruleSpaces?r.slice(0,-1):r}const mv={blockquote:mT,break:xx,code:wT,definition:ST,emphasis:sv,hardBreak:xx,heading:NT,html:ov,image:lv,imageReference:av,inlineCode:uv,link:dv,linkReference:fv,list:OT,listItem:$T,paragraph:FT,root:BT,strong:pv,text:HT,thematicBreak:WT};function VT(){return{enter:{table:QT,tableData:yx,tableHeader:yx,tableRow:XT},exit:{codeText:YT,table:KT,tableData:Uc,tableHeader:Uc,tableRow:Uc}}}function QT(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 KT(e){this.exit(e),this.data.inTable=void 0}function XT(e){this.enter({type:"tableRow",children:[]},e)}function Uc(e){this.exit(e)}function yx(e){this.enter({type:"tableCell",children:[]},e)}function YT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,JT));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function JT(e,t){return t==="|"?t:e}function ZT(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
238
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:a,tableRow:l}};function o(p,m,x,v){return u(f(p,x,v),p.align)}function l(p,m,x,v){const g=d(p,x,v),y=u([g]);return y.slice(0,y.indexOf(`
|
|
239
|
+
`))}function a(p,m,x,v){const g=x.enter("tableCell"),y=x.enter("phrasing"),b=x.containerPhrasing(p,{...v,before:s,after:s});return y(),g(),b}function u(p,m){return fT(p,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(p,m,x){const v=p.children;let g=-1;const y=[],b=m.enter("table");for(;++g<v.length;)y[g]=d(v[g],m,x);return b(),y}function d(p,m,x){const v=p.children;let g=-1;const y=[],b=m.enter("tableRow");for(;++g<v.length;)y[g]=a(v[g],p,m,x);return b(),y}function h(p,m,x){let v=mv.inlineCode(p,m,x);return x.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function eA(){return{exit:{taskListCheckValueChecked:bx,taskListCheckValueUnchecked:bx,paragraph:nA}}}function tA(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rA}}}function bx(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function nA(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 l=i[s];if(l.type==="paragraph"){o=l;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 rA(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);s&&l.move(o);let a=mv.listItem(e,t,n,{...r,...l.current()});return s&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),a;function u(f){return f+o}}function iA(){return[MI(),nT(),oT(),VT(),eA()]}function sA(e){return{extensions:[OI(),rT(e),lT(),ZT(e),tA()]}}const oA={tokenize:fA,partial:!0},gv={tokenize:hA,partial:!0},xv={tokenize:pA,partial:!0},yv={tokenize:mA,partial:!0},lA={tokenize:gA,partial:!0},bv={name:"wwwAutolink",tokenize:cA,previous:wv},vv={name:"protocolAutolink",tokenize:dA,previous:kv},Yn={name:"emailAutolink",tokenize:uA,previous:Sv},Sn={};function aA(){return{text:Sn}}let Hr=48;for(;Hr<123;)Sn[Hr]=Yn,Hr++,Hr===58?Hr=65:Hr===91&&(Hr=97);Sn[43]=Yn;Sn[45]=Yn;Sn[46]=Yn;Sn[95]=Yn;Sn[72]=[Yn,vv];Sn[104]=[Yn,vv];Sn[87]=[Yn,bv];Sn[119]=[Yn,bv];function uA(e,t,n){const r=this;let i,s;return o;function o(d){return!$f(d)||!Sv.call(r,r.previous)||Sp(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return $f(d)?(e.consume(d),l):d===64?(e.consume(d),a):n(d)}function a(d){return d===46?e.check(lA,f,u)(d):d===45||d===95||it(d)?(s=!0,e.consume(d),a):f(d)}function u(d){return e.consume(d),i=!0,a}function f(d){return s&&i&&ft(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function cA(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!wv.call(r,r.previous)||Sp(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(oA,e.attempt(gv,e.attempt(xv,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function dA(e,t,n){const r=this;let i="",s=!1;return o;function o(d){return(d===72||d===104)&&kv.call(r,r.previous)&&!Sp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),l):n(d)}function l(d){if(ft(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),l;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),a}return n(d)}function a(d){return d===47?(e.consume(d),s?u:(s=!0,a)):n(d)}function u(d){return d===null||Va(d)||ye(d)||wi(d)||$u(d)?n(d):e.attempt(gv,e.attempt(xv,f),n)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function fA(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 hA(e,t,n){let r,i,s;return o;function o(u){return u===46||u===95?e.check(yv,a,l)(u):u===null||ye(u)||wi(u)||u!==45&&$u(u)?a(u):(s=!0,e.consume(u),o)}function l(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),o}function a(u){return i||r||!s?n(u):t(u)}}function pA(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(yv,t,s)(o):o===null||ye(o)||wi(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function mA(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),s):l===93?(e.consume(l),i):l===60||l===null||ye(l)||wi(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||ye(l)||wi(l)?t(l):r(l)}function s(l){return ft(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):ft(l)?(e.consume(l),o):n(l)}}function gA(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return it(s)?n(s):t(s)}}function wv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ye(e)}function kv(e){return!ft(e)}function Sv(e){return!(e===47||$f(e))}function $f(e){return e===43||e===45||e===46||e===95||it(e)}function Sp(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 xA={tokenize:_A,partial:!0};function yA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:kA,continuation:{tokenize:SA},exit:CA}},text:{91:{name:"gfmFootnoteCall",tokenize:wA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:bA,resolveTo:vA}}}}function bA(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const a=r.events[i][1];if(a.type==="labelImage"){o=a;break}if(a.type==="gfmFootnoteCall"||a.type==="labelLink"||a.type==="label"||a.type==="image"||a.type==="link")break}return l;function l(a){if(!o||!o._balanced)return n(a);const u=an(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(a):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a))}}function vA(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)},l=[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,...l),e}function wA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),a}function a(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(s>999||d===93&&!o||d===null||d===91||ye(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(an(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return ye(d)||(o=!0),s++,e.consume(d),d===92?f:u}function f(d){return d===91||d===92||d===93?(e.consume(d),s++,u):u(d)}}function kA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,l;return a;function a(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(o>999||m===93&&!l||m===null||m===91||ye(m))return n(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return s=an(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ye(m)||(l=!0),o++,e.consume(m),m===92?d:f}function d(m){return m===91||m===92||m===93?(e.consume(m),o++,f):f(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),ce(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function SA(e,t,n){return e.check(yl,t,e.attempt(xA,t,n))}function CA(e){e.exit("gfmFootnoteDefinition")}function _A(e,t,n){const r=this;return ce(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 EA(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,l){let a=-1;for(;++a<o.length;)if(o[a][0]==="enter"&&o[a][1].type==="strikethroughSequenceTemporary"&&o[a][1]._close){let u=a;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[a][1].end.offset-o[a][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[a][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[a][1].end)},d={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[a][1].start)},h=[["enter",f,l],["enter",o[u][1],l],["exit",o[u][1],l],["enter",d,l]],p=l.parser.constructs.insideSpan.null;p&&Ot(h,h.length,0,Fu(p,o.slice(u+1,a),l)),Ot(h,h.length,0,[["exit",d,l],["enter",o[a][1],l],["exit",o[a][1],l],["exit",f,l]]),Ot(o,u-1,a-u+3,h),a=u+h.length-2;break}}for(a=-1;++a<o.length;)o[a][1].type==="strikethroughSequenceTemporary"&&(o[a][1].type="data");return o}function s(o,l,a){const u=this.previous,f=this.events;let d=0;return h;function h(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?a(m):(o.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const x=Ps(u);if(m===126)return d>1?a(m):(o.consume(m),d++,p);if(d<2&&!n)return a(m);const v=o.exit("strikethroughSequenceTemporary"),g=Ps(m);return v._open=!g||g===2&&!!x,v._close=!x||x===2&&!!g,l(m)}}}class NA{constructor(){this.map=[]}add(t,n,r){jA(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 jA(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 PA(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 IA(){return{flow:{null:{name:"table",tokenize:TA,resolveAll:AA}}}}function TA(e,t,n){const r=this;let i=0,s=0,o;return l;function l(N){let R=r.events.length-1;for(;R>-1;){const W=r.events[R][1].type;if(W==="lineEnding"||W==="linePrefix")R--;else break}const L=R>-1?r.events[R][1].type:null,V=L==="tableHead"||L==="tableRow"?k:a;return V===k&&r.parser.lazy[r.now().line]?n(N):V(N)}function a(N){return e.enter("tableHead"),e.enter("tableRow"),u(N)}function u(N){return N===124||(o=!0,s+=1),f(N)}function f(N){return N===null?n(N):K(N)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),p):n(N):se(N)?ce(e,f,"whitespace")(N):(s+=1,o&&(o=!1,i+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),o=!0,f):(e.enter("data"),d(N)))}function d(N){return N===null||N===124||ye(N)?(e.exit("data"),f(N)):(e.consume(N),N===92?h:d)}function h(N){return N===92||N===124?(e.consume(N),d):d(N)}function p(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),o=!1,se(N)?ce(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):m(N))}function m(N){return N===45||N===58?v(N):N===124?(o=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),x):C(N)}function x(N){return se(N)?ce(e,v,"whitespace")(N):v(N)}function v(N){return N===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),g):N===45?(s+=1,g(N)):N===null||K(N)?w(N):C(N)}function g(N){return N===45?(e.enter("tableDelimiterFiller"),y(N)):C(N)}function y(N){return N===45?(e.consume(N),y):N===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(N))}function b(N){return se(N)?ce(e,w,"whitespace")(N):w(N)}function w(N){return N===124?m(N):N===null||K(N)?!o||i!==s?C(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):C(N)}function C(N){return n(N)}function k(N){return e.enter("tableRow"),P(N)}function P(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),P):N===null||K(N)?(e.exit("tableRow"),t(N)):se(N)?ce(e,P,"whitespace")(N):(e.enter("data"),I(N))}function I(N){return N===null||N===124||ye(N)?(e.exit("data"),P(N)):(e.consume(N),N===92?A:I)}function A(N){return N===92||N===124?(e.consume(N),I):I(N)}}function AA(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,a=0,u,f,d;const h=new NA;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,a!==0&&(vx(h,t,a,u,f),f=void 0,a=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],d=Vl(h,t,s,i,void 0,d),s=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],d=Vl(h,t,s,i,void 0,d)),s=o,o=[s[1],n,0,0])):m.type==="tableHead"?(l=!0,a=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(a=n,s[1]!==0?(o[0]=o[1],d=Vl(h,t,s,i,n,d)):o[1]!==0&&(d=Vl(h,t,o,i,n,d)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(a!==0&&vx(h,t,a,u,f),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=PA(t.events,n))}return e}function Vl(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(s.end=Object.assign({},Di(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const a=Di(t.events,n[1]);if(s={type:o,start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Di(t.events,n[2]),f=Di(t.events,n[3]),d={type:l,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[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",d,t]])}return i!==void 0&&(s.end=Object.assign({},Di(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function vx(e,t,n,r,i){const s=[],o=Di(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 Di(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const RA={name:"tasklistCheck",tokenize:MA};function LA(){return{text:{91:RA}}}function MA(e,t,n){const r=this;return i;function i(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),s)}function s(a){return ye(a)?(e.enter("taskListCheckValueUnchecked"),e.consume(a),e.exit("taskListCheckValueUnchecked"),o):a===88||a===120?(e.enter("taskListCheckValueChecked"),e.consume(a),e.exit("taskListCheckValueChecked"),o):n(a)}function o(a){return a===93?(e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(a)}function l(a){return K(a)?t(a):se(a)?e.check({tokenize:OA},t,n)(a):n(a)}}function OA(e,t,n){return ce(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function DA(e){return R1([aA(),yA(),EA(e),IA(),LA()])}const $A={};function FA(e){const t=this,n=e||$A,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(DA(n)),s.push(iA()),o.push(sA(n))}const ki=Lu(e=>({toasts:[],errSeen:0,warnSeen:0,pushToast:t=>e(n=>({toasts:[...n.toasts,t],errSeen:n.errSeen+(t.notifyType==="error"?1:0),warnSeen:n.warnSeen+(t.notifyType==="warning"?1:0)})),dismissToast:t=>e(n=>({toasts:n.toasts.filter(r=>r.id!==t)})),resetCounters:()=>e({errSeen:0,warnSeen:0})})),zA="modulepreload",BA=function(e){return"/"+e},wx={},Y=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(a=>{if(a=BA(a),a in wx)return;wx[a]=!0;const u=a.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${f}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":zA,u||(d.as="script"),d.crossOrigin="",d.href=a,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((h,p)=>{d.addEventListener("load",h),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var _e=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function UA(e){return Cp(e)}function Cp(e){return Array.isArray(e)?GA(e):e instanceof RegExp?e:typeof e=="object"?HA(e):e}function GA(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Cp(e[n]);return t}function HA(e){let t={};for(let n in e)t[n]=Cp(e[n]);return t}function Cv(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function _v(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?_v(e.substring(0,e.length-1)):e.substr(~t+1)}var Gc=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ql=class{static hasCaptures(e){return e===null?!1:(Gc.lastIndex=0,Gc.test(e))}static replaceCaptures(e,t,n){return e.replace(Gc,(r,i,s,o)=>{let l=n[parseInt(i||s,10)];if(l){let a=t.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(o){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return r})}};function Ev(e,t){return e<t?-1:e>t?1:0}function Nv(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;i<n;i++){let s=Ev(e[i],t[i]);if(s!==0)return s}return 0}return n-r}function kx(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function jv(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Pv=class{constructor(e){T(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Ja=class{constructor(e,t,n){T(this,"_cachedMatchRoot",new Pv(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(VA(e),t)}static createFromParsedTheme(e,t){return KA(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>qA(e.parent,i.parentScopes));return r?new Iv(r.fontStyle,r.foreground,r.background):null}},Hc=class ma{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new ma(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new ma(n,t[r]);return n}push(t){return new ma(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function qA(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!WA(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function WA(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Iv=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function VA(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,s=t.length;i<s;i++){let o=t[i];if(!o.settings)continue;let l;if(typeof o.scope=="string"){let d=o.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),l=d.split(",")}else Array.isArray(o.scope)?l=o.scope:l=[""];let a=-1;if(typeof o.settings.fontStyle=="string"){a=0;let d=o.settings.fontStyle.split(" ");for(let h=0,p=d.length;h<p;h++)switch(d[h]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let u=null;typeof o.settings.foreground=="string"&&kx(o.settings.foreground)&&(u=o.settings.foreground);let f=null;typeof o.settings.background=="string"&&kx(o.settings.background)&&(f=o.settings.background);for(let d=0,h=l.length;d<h;d++){let m=l[d].trim().split(" "),x=m[m.length-1],v=null;m.length>1&&(v=m.slice(0,m.length-1),v.reverse()),n[r++]=new QA(x,v,i,a,u,f)}}return n}var QA=class{constructor(e,t,n,r,i,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},rt=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(rt||{});function KA(e,t){e.sort((a,u)=>{let f=Ev(a.scope,u.scope);return f!==0||(f=Nv(a.parentScopes,u.parentScopes),f!==0)?f:a.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let a=e.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(r=a.foreground),a.background!==null&&(i=a.background)}let s=new XA(t),o=new Iv(n,s.getId(r),s.getId(i)),l=new JA(new Ff(0,null,-1,0,0),[]);for(let a=0,u=e.length;a<u;a++){let f=e[a];l.insert(0,f.scope,f.parentScopes,f.fontStyle,s.getId(f.foreground),s.getId(f.background))}return new Ja(s,o,l)}var XA=class{constructor(e){T(this,"_isFrozen");T(this,"_lastColorId");T(this,"_id2color");T(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},YA=Object.freeze([]),Ff=class Tv{constructor(t,n,r,i,s){T(this,"scopeDepth");T(this,"parentScopes");T(this,"fontStyle");T(this,"foreground");T(this,"background");this.scopeDepth=t,this.parentScopes=n||YA,this.fontStyle=r,this.foreground=i,this.background=s}clone(){return new Tv(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,i=t.length;r<i;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},JA=class zf{constructor(t,n=[],r={}){T(this,"_rulesWithParentScopes");this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const s=n.parentScopes[i].length-t.parentScopes[r].length;if(s!==0)return s;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,s;if(r===-1?(i=t,s=""):(i=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(zf._cmpBySpecificity),n}insert(t,n,r,i,s,o){if(n===""){this._doInsertHere(t,r,i,s,o);return}let l=n.indexOf("."),a,u;l===-1?(a=n,u=""):(a=n.substring(0,l),u=n.substring(l+1));let f;this._children.hasOwnProperty(a)?f=this._children[a]:(f=new zf(this._mainRule.clone(),Ff.cloneArr(this._rulesWithParentScopes)),this._children[a]=f),f.insert(t+1,u,r,i,s,o)}_doInsertHere(t,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(t,r,i,s);return}for(let o=0,l=this._rulesWithParentScopes.length;o<l;o++){let a=this._rulesWithParentScopes[o];if(Nv(a.parentScopes,n)===0){a.acceptOverwrite(t,r,i,s);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Ff(t,n,r,i,s))}},Is=class zt{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=zt.getLanguageId(t),r=zt.getTokenType(t),i=zt.getFontStyle(t),s=zt.getForeground(t),o=zt.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:s,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,s,o,l){let a=zt.getLanguageId(t),u=zt.getTokenType(t),f=zt.containsBalancedBrackets(t)?1:0,d=zt.getFontStyle(t),h=zt.getForeground(t),p=zt.getBackground(t);return n!==0&&(a=n),r!==8&&(u=r),i!==null&&(f=i?1:0),s!==-1&&(d=s),o!==0&&(h=o),l!==0&&(p=l),(a<<0|u<<8|f<<10|d<<11|h<<15|p<<24)>>>0}};function Za(e,t){const n=[],r=ZA(e);let i=r.next();for(;i!==null;){let a=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=o();if(n.push({matcher:u,priority:a}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();const a=s();return u=>!!a&&!a(u)}if(i==="("){i=r.next();const a=l();return i===")"&&(i=r.next()),a}if(Sx(i)){const a=[];do a.push(i),i=r.next();while(Sx(i));return u=>t(a,u)}return null}function o(){const a=[];let u=s();for(;u;)a.push(u),u=s();return f=>a.every(d=>d(f))}function l(){const a=[];let u=o();for(;u&&(a.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=o()}return f=>a.some(d=>d(f))}}function Sx(e){return!!e&&!!e.match(/[\w\.:]+/)}function ZA(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Av(e){typeof e.dispose=="function"&&e.dispose()}var Jo=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},eR=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},tR=class{constructor(){T(this,"_references",[]);T(this,"_seenReferenceKeys",new Set);T(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},nR=class{constructor(e,t){T(this,"seenFullScopeRequests",new Set);T(this,"seenPartialScopeRequests",new Set);T(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Jo(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new tR;for(const n of e)rR(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Jo){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function rR(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof Jo?ga({baseGrammar:s,selfGrammar:i},r):Bf(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const l of o)r.add(new Jo(l))}function Bf(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];eu([r],t,n)}}function ga(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&eu(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&eu(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function eu(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Cv({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&eu(r.patterns,{...t,repository:i},n);const s=r.include;if(!s)continue;const o=Rv(s);switch(o.kind){case 0:ga({...t,selfGrammar:t.baseGrammar},n);break;case 1:ga(t,n);break;case 2:Bf(o.ruleName,{...t,repository:i},n);break;case 3:case 4:const l=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(l){const a={baseGrammar:t.baseGrammar,selfGrammar:l,repository:i};o.kind===4?Bf(o.ruleName,a,n):ga(a,n)}else o.kind===4?n.add(new eR(o.scopeName,o.ruleName)):n.add(new Jo(o.scopeName));break}}}var iR=class{constructor(){T(this,"kind",0)}},sR=class{constructor(){T(this,"kind",1)}},oR=class{constructor(e){T(this,"kind",2);this.ruleName=e}},lR=class{constructor(e){T(this,"kind",3);this.scopeName=e}},aR=class{constructor(e,t){T(this,"kind",4);this.scopeName=e,this.ruleName=t}};function Rv(e){if(e==="$base")return new iR;if(e==="$self")return new sR;const t=e.indexOf("#");if(t===-1)return new lR(e);if(t===0)return new oR(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new aR(n,r)}}var uR=/\\(\d+)/,Cx=/\\(\d+)/g,cR=-1,Lv=-2;var vl=class{constructor(e,t,n,r){T(this,"$location");T(this,"id");T(this,"_nameIsCapturing");T(this,"_name");T(this,"_contentNameIsCapturing");T(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ql.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ql.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${_v(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Ql.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ql.replaceCaptures(this._contentName,e,t)}},dR=class extends vl{constructor(t,n,r,i,s){super(t,n,r,i);T(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,n){throw new Error("Not supported!")}compile(t,n){throw new Error("Not supported!")}compileAG(t,n,r,i){throw new Error("Not supported!")}},fR=class extends vl{constructor(t,n,r,i,s){super(t,n,r,null);T(this,"_match");T(this,"captures");T(this,"_cachedCompiledPatterns");this._match=new Zo(i,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,n){n.push(this._match)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new el,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_x=class extends vl{constructor(t,n,r,i,s){super(t,n,r,i);T(this,"hasMissingPatterns");T(this,"patterns");T(this,"_cachedCompiledPatterns");this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,n){for(const r of this.patterns)t.getRule(r).collectPatterns(t,n)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new el,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Uf=class extends vl{constructor(t,n,r,i,s,o,l,a,u,f){super(t,n,r,i);T(this,"_begin");T(this,"beginCaptures");T(this,"_end");T(this,"endHasBackReferences");T(this,"endCaptures");T(this,"applyEndPatternLast");T(this,"hasMissingPatterns");T(this,"patterns");T(this,"_cachedCompiledPatterns");this._begin=new Zo(s,this.id),this.beginCaptures=o,this._end=new Zo(l||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=u||!1,this.patterns=f.patterns,this.hasMissingPatterns=f.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,n){return this._end.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t,n).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t,n).compileAG(t,r,i)}_getCachedCompiledPatterns(t,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new el;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},tu=class extends vl{constructor(t,n,r,i,s,o,l,a,u){super(t,n,r,i);T(this,"_begin");T(this,"beginCaptures");T(this,"whileCaptures");T(this,"_while");T(this,"whileHasBackReferences");T(this,"hasMissingPatterns");T(this,"patterns");T(this,"_cachedCompiledPatterns");T(this,"_cachedCompiledWhilePatterns");this._begin=new Zo(s,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Zo(l,Lv),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,n){return this._while.resolveBackReferences(t,n)}collectPatterns(t,n){n.push(this._begin)}compile(t,n){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,n,r,i){return this._getCachedCompiledPatterns(t).compileAG(t,r,i)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new el;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,n){return this._getCachedCompiledWhilePatterns(t,n).compile(t)}compileWhileAG(t,n,r,i){return this._getCachedCompiledWhilePatterns(t,n).compileAG(t,r,i)}_getCachedCompiledWhilePatterns(t,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new el,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},Mv=class et{static createCaptureRule(t,n,r,i,s){return t.registerRule(o=>new dR(n,o,r,i,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new fR(t.$vscodeTextmateLocation,t.id,t.name,t.match,et._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Cv({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new _x(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,et._compilePatterns(s,n,r))}return t.while?new tu(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,et._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,et._compileCaptures(t.whileCaptures||t.captures,n,r),et._compilePatterns(t.patterns,n,r)):new Uf(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,et._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,et._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,et._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let s=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const l=parseInt(o,10);l>s&&(s=l)}for(let o=0;o<=s;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const l=parseInt(o,10);let a=0;t[o].patterns&&(a=et.getCompiledRuleId(t[o],n,r)),i[l]=et.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,a)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let s=0,o=t.length;s<o;s++){const l=t[s];let a=-1;if(l.include){const u=Rv(l.include);switch(u.kind){case 0:case 1:a=et.getCompiledRuleId(r[l.include],n,r);break;case 2:let f=r[u.ruleName];f&&(a=et.getCompiledRuleId(f,n,r));break;case 3:case 4:const d=u.scopeName,h=u.kind===4?u.ruleName:null,p=n.getExternalGrammar(d,r);if(p)if(h){let m=p.repository[h];m&&(a=et.getCompiledRuleId(m,n,p.repository))}else a=et.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else a=et.getCompiledRuleId(l,n,r);if(a!==-1){const u=n.getRule(a);let f=!1;if((u instanceof _x||u instanceof Uf||u instanceof tu)&&u.hasMissingPatterns&&u.patterns.length===0&&(f=!0),f)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Zo=class Ov{constructor(t,n){T(this,"source");T(this,"ruleId");T(this,"hasAnchor");T(this,"hasBackReferences");T(this,"_anchorCache");if(t&&typeof t=="string"){const r=t.length;let i=0,s=[],o=!1;for(let l=0;l<r;l++)if(t.charAt(l)==="\\"&&l+1<r){const u=t.charAt(l+1);u==="z"?(s.push(t.substring(i,l)),s.push("$(?!\\n)(?<!\\n)"),i=l+2):(u==="A"||u==="G")&&(o=!0),l++}this.hasAnchor=o,i===0?this.source=t:(s.push(t.substring(i,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=uR.test(this.source):this.hasBackReferences=!1}clone(){return new Ov(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>t.substring(i.start,i.end));return Cx.lastIndex=0,this.source.replace(Cx,(i,s)=>jv(r[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],s,o,l,a;for(s=0,o=this.source.length;s<o;s++)l=this.source.charAt(s),t[s]=l,n[s]=l,r[s]=l,i[s]=l,l==="\\"&&s+1<o&&(a=this.source.charAt(s+1),a==="A"?(t[s+1]="",n[s+1]="",r[s+1]="A",i[s+1]="A"):a==="G"?(t[s+1]="",n[s+1]="G",r[s+1]="",i[s+1]="G"):(t[s+1]=a,n[s+1]=a,r[s+1]=a,i[s+1]=a),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},el=class{constructor(){T(this,"_items");T(this,"_hasAnchors");T(this,"_cached");T(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Ex(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new Ex(e,r,this._items.map(i=>i.ruleId))}},Ex=class{constructor(e,t,n){T(this,"scanner");this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
240
|
+
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},qc=class{constructor(e,t){this.languageId=e,this.tokenType=t}},$n,hR=($n=class{constructor(t,n){T(this,"_defaultAttributes");T(this,"_embeddedLanguagesMatcher");T(this,"_getBasicScopeAttributes",new Pv(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new qc(n,r)}));this._defaultAttributes=new qc(t,8),this._embeddedLanguagesMatcher=new pR(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?$n._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match($n.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},T($n,"_NULL_SCOPE_METADATA",new qc(0,0)),T($n,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),$n),pR=class{constructor(e){T(this,"values");T(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>jv(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Nx=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Dv(e,t,n,r,i,s,o,l){const a=t.content.length;let u=!1,f=-1;if(o){const p=mR(e,t,n,r,i,s);i=p.stack,r=p.linePos,n=p.isFirstLine,f=p.anchorPosition}const d=Date.now();for(;!u;){if(l!==0&&Date.now()-d>l)return new Nx(i,!0);h()}return new Nx(i,!1);function h(){const p=gR(e,t,n,r,i,f);if(!p){s.produce(i,a),u=!0;return}const m=p.captureIndices,x=p.matchedRuleId,v=m&&m.length>0?m[0].end>r:!1;if(x===cR){const g=i.getRule(e);s.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),fo(e,t,n,i,s,g.endCaptures,m),s.produce(i,m[0].end);const y=i;if(i=i.parent,f=y.getAnchorPos(),!v&&y.getEnterPos()===r){i=y,s.produce(i,a),u=!0;return}}else{const g=e.getRule(x);s.produce(i,m[0].start);const y=i,b=g.getName(t.content,m),w=i.contentNameScopesList.pushAttributed(b,e);if(i=i.push(x,r,f,m[0].end===a,null,w,w),g instanceof Uf){const C=g;fo(e,t,n,i,s,C.beginCaptures,m),s.produce(i,m[0].end),f=m[0].end;const k=C.getContentName(t.content,m),P=w.pushAttributed(k,e);if(i=i.withContentNameScopesList(P),C.endHasBackReferences&&(i=i.withEndRule(C.getEndWithResolvedBackReferences(t.content,m))),!v&&y.hasSameRuleAs(i)){i=i.pop(),s.produce(i,a),u=!0;return}}else if(g instanceof tu){const C=g;fo(e,t,n,i,s,C.beginCaptures,m),s.produce(i,m[0].end),f=m[0].end;const k=C.getContentName(t.content,m),P=w.pushAttributed(k,e);if(i=i.withContentNameScopesList(P),C.whileHasBackReferences&&(i=i.withEndRule(C.getWhileWithResolvedBackReferences(t.content,m))),!v&&y.hasSameRuleAs(i)){i=i.pop(),s.produce(i,a),u=!0;return}}else if(fo(e,t,n,i,s,g.captures,m),s.produce(i,m[0].end),i=i.pop(),!v){i=i.safePop(),s.produce(i,a),u=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function mR(e,t,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const l=[];for(let a=i;a;a=a.pop()){const u=a.getRule(e);u instanceof tu&&l.push({rule:u,stack:a})}for(let a=l.pop();a;a=l.pop()){const{ruleScanner:u,findOptions:f}=bR(a.rule,e,a.stack.endRule,n,r===o),d=u.findNextMatchSync(t,r,f);if(d){if(d.ruleId!==Lv){i=a.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(a.stack,d.captureIndices[0].start),fo(e,t,n,a.stack,s,a.rule.whileCaptures,d.captureIndices),s.produce(a.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{i=a.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function gR(e,t,n,r,i,s){const o=xR(e,t,n,r,i,s),l=e.getInjections();if(l.length===0)return o;const a=yR(l,e,t,n,r,i,s);if(!a)return o;if(!o)return a;const u=o.captureIndices[0].start,f=a.captureIndices[0].start;return f<u||a.priorityMatch&&f===u?a:o}function xR(e,t,n,r,i,s){const o=i.getRule(e),{ruleScanner:l,findOptions:a}=$v(o,e,i.endRule,n,r===s),u=l.findNextMatchSync(t,r,a);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function yR(e,t,n,r,i,s,o){let l=Number.MAX_VALUE,a=null,u,f=0;const d=s.contentNameScopesList.getScopeNames();for(let h=0,p=e.length;h<p;h++){const m=e[h];if(!m.matcher(d))continue;const x=t.getRule(m.ruleId),{ruleScanner:v,findOptions:g}=$v(x,t,null,r,i===o),y=v.findNextMatchSync(n,i,g);if(!y)continue;const b=y.captureIndices[0].start;if(!(b>=l)&&(l=b,a=y.captureIndices,u=y.ruleId,f=m.priority,l===i))break}return a?{priorityMatch:f===-1,captureIndices:a,matchedRuleId:u}:null}function $v(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function bR(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function fo(e,t,n,r,i,s,o){if(s.length===0)return;const l=t.content,a=Math.min(s.length,o.length),u=[],f=o[0].end;for(let d=0;d<a;d++){const h=s[d];if(h===null)continue;const p=o[d];if(p.length===0)continue;if(p.start>f)break;for(;u.length>0&&u[u.length-1].endPos<=p.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,p.start):i.produce(r,p.start),h.retokenizeCapturedWithRuleId){const x=h.getName(l,o),v=r.contentNameScopesList.pushAttributed(x,e),g=h.getContentName(l,o),y=v.pushAttributed(g,e),b=r.push(h.retokenizeCapturedWithRuleId,p.start,-1,!1,null,v,y),w=e.createOnigString(l.substring(0,p.end));Dv(e,w,n&&p.start===0,p.start,b,i,!1,0),Av(w);continue}const m=h.getName(l,o);if(m!==null){const v=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);u.push(new vR(v,p.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var vR=class{constructor(e,t){T(this,"scopes");T(this,"endPos");this.scopes=e,this.endPos=t}};function wR(e,t,n,r,i,s,o,l){return new SR(e,t,n,r,i,s,o,l)}function jx(e,t,n,r,i){const s=Za(t,nu),o=Mv.getCompiledRuleId(n,r,i.repository);for(const l of s)e.push({debugSelector:t,matcher:l.matcher,ruleId:o,grammar:i,priority:l.priority})}function nu(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let i=n;i<t.length;i++)if(kR(t[i],r))return n=i+1,!0;return!1})}function kR(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var SR=class{constructor(e,t,n,r,i,s,o,l){T(this,"_rootId");T(this,"_lastRuleId");T(this,"_ruleId2desc");T(this,"_includedGrammars");T(this,"_grammarRepository");T(this,"_grammar");T(this,"_injections");T(this,"_basicScopeAttributesProvider");T(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=l,this._basicScopeAttributesProvider=new hR(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Px(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const a of Object.keys(i)){const u=Za(a,nu);for(const f of u)this._tokenTypeMatchers.push({matcher:f.matcher,type:i[a]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)jx(t,o,i[o],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(o=>{const l=this.getExternalGrammar(o);if(l){const a=l.injectionSelector;a&&jx(t,a,l,this,l)}})}return t.sort((i,s)=>i.priority-s.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Px(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Mv.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Gf.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),f=this.themeProvider.getDefaults(),d=Is.set(0,u.languageId,u.tokenType,null,f.fontStyle,f.foregroundId,f.backgroundId),h=this.getRule(this._rootId).getName(null,null);let p;h?p=jo.createRootAndLookUpScopeName(h,d,this):p=jo.createRoot("unknown",d),t=new Gf(null,this._rootId,-1,-1,!1,null,p,p)}else i=!1,t.reset();e=e+`
|
|
241
|
+
`;const s=this.createOnigString(e),o=s.content.length,l=new _R(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),a=Dv(this,s,i,0,t,l,!0,r);return Av(s),{lineLength:o,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function Px(e,t){return e=UA(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var jo=class hn{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=(t==null?void 0:t.scopePath)??null;for(const s of n)i=Hc.push(i,s.scopeNames),r=new hn(r,i,s.encodedTokenAttributes);return r}static createRoot(t,n){return new hn(null,new Hc(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),s=new Hc(null,t),o=r.themeProvider.themeMatch(s),l=hn.mergeAttributes(n,i,o);return new hn(null,s,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return hn.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,s=0,o=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,o=r.backgroundId),Is.set(t,n.languageId,n.tokenType,null,i,s,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return hn._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const s of r)i=hn._pushAttributed(i,s,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),s=t.scopePath.push(n),o=r.themeProvider.themeMatch(s),l=hn.mergeAttributes(t.tokenAttributes,i,o);return new hn(t,s,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var i;const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((i=r.parent)==null?void 0:i.scopePath)??null)}),r=r.parent;return r===t?n.reverse():void 0}},qt,Gf=(qt=class{constructor(t,n,r,i,s,o,l,a){T(this,"_stackElementBrand");T(this,"_enterPos");T(this,"_anchorPos");T(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}equals(t){return t===null?!1:qt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?jo.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){qt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,s,o,l){return new qt(this,t,n,r,i,s,o,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){var r,i;return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(i=this.contentNameScopesList)==null?void 0:i.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new qt(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var t,n,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,n){const r=jo.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new qt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,jo.fromExtension(r,n.contentNameScopesList))}},T(qt,"NULL",new qt(null,0,0,0,!1,null,null,null)),qt),CR=class{constructor(e,t){T(this,"balancedBracketScopes");T(this,"unbalancedBracketScopes");T(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Za(n,nu).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Za(n,nu).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},_R=class{constructor(e,t,n,r){T(this,"_emitBinaryTokens");T(this,"_lineText");T(this,"_tokens");T(this,"_binaryTokens");T(this,"_lastTokenEndIndex");T(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var r;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=(e==null?void 0:e.tokenAttributes)??0,s=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=(e==null?void 0:e.getScopeNames())??[];for(const l of this._tokenTypeOverrides)l.matcher(o)&&(i=Is.set(i,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(o))}if(s&&(i=Is.set(i,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const n=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},ER=class{constructor(e,t){T(this,"_grammars",new Map);T(this,"_rawGrammars",new Map);T(this,"_injectionGrammars",new Map);T(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,wR(e,s,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},NR=class{constructor(t){T(this,"_options");T(this,"_syncRegistry");T(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new ER(Ja.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Ja.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new CR(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,i,s){const o=new nR(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(l=>this._loadSingleGrammar(l.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,i,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,s)}},Hf=Gf.NULL;function ru(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,s]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof s=="string"?n[i]=s:i===r&&Object.assign(n,s);return n}function Mr(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function jR(e){return Array.isArray(e)?e:[e]}async function Fv(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Gu(e){return!e||["plaintext","txt","text","plain"].includes(e)}function PR(e){return e==="ansi"||Gu(e)}function Hu(e){return e==="none"}function IR(e){return Hu(e)}const TR=/(\r?\n)/g;function qu(e,t=!1){var s;if(e.length===0)return[["",0]];const n=e.split(TR);let r=0;const i=[];for(let o=0;o<n.length;o+=2){const l=t?n[o]+(n[o+1]||""):n[o];i.push([l,r]),r+=n[o].length,r+=((s=n[o+1])==null?void 0:s.length)||0}return i}const Ix={light:"#333333",dark:"#bbbbbb"},Tx={light:"#fffffe",dark:"#1e1e1e"},Ax="__shiki_resolved";function _p(e){var l,a,u,f,d;if(e!=null&&e[Ax])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||(t.type="dark"),t.colorReplacements={...t.colorReplacements},t.settings||(t.settings=[]);let{bg:n,fg:r}=t;if(!n||!r){const h=t.settings?t.settings.find(p=>!p.name&&!p.scope):void 0;(l=h==null?void 0:h.settings)!=null&&l.foreground&&(r=h.settings.foreground),(a=h==null?void 0:h.settings)!=null&&a.background&&(n=h.settings.background),!r&&((u=t==null?void 0:t.colors)!=null&&u["editor.foreground"])&&(r=t.colors["editor.foreground"]),!n&&((f=t==null?void 0:t.colors)!=null&&f["editor.background"])&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?Ix.light:Ix.dark),n||(n=t.type==="light"?Tx.light:Tx.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const s=new Map;function o(h){var m;if(s.has(h))return s.get(h);i+=1;const p=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return(m=t.colorReplacements)!=null&&m[`#${p}`]?o(h):(s.set(h,p),p)}t.settings=t.settings.map(h=>{var v,g;const p=((v=h.settings)==null?void 0:v.foreground)&&!h.settings.foreground.startsWith("#"),m=((g=h.settings)==null?void 0:g.background)&&!h.settings.background.startsWith("#");if(!p&&!m)return h;const x={...h,settings:{...h.settings}};if(p){const y=o(h.settings.foreground);t.colorReplacements[y]=h.settings.foreground,x.settings.foreground=y}if(m){const y=o(h.settings.background);t.colorReplacements[y]=h.settings.background,x.settings.background=y}return x});for(const h of Object.keys(t.colors||{}))if((h==="editor.foreground"||h==="editor.background"||h.startsWith("terminal.ansi"))&&!((d=t.colors[h])!=null&&d.startsWith("#"))){const p=o(t.colors[h]);t.colorReplacements[p]=t.colors[h],t.colors[h]=p}return Object.defineProperty(t,Ax,{enumerable:!1,writable:!1,value:!0}),t}async function zv(e){return[...new Set((await Promise.all(e.filter(t=>!PR(t)).map(async t=>await Fv(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Bv(e){return(await Promise.all(e.map(async t=>IR(t)?null:_p(await Fv(t))))).filter(t=>!!t)}function Uv(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new _e(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var AR=class extends NR{constructor(t,n,r,i={}){super(t);T(this,"_resolver");T(this,"_themes");T(this,"_langs");T(this,"_alias");T(this,"_resolvedThemes",new Map);T(this,"_resolvedGrammars",new Map);T(this,"_langMap",new Map);T(this,"_langGraph",new Map);T(this,"_textmateThemeCache",new WeakMap);T(this,"_loadedThemesCache",null);T(this,"_loadedLanguagesCache",null);this._resolver=t,this._themes=n,this._langs=r,this._alias=i,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=_p(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=Ja.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=Uv(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){var s,o,l,a;if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(u=>{var f;return(f=u.embeddedLangsLazy)==null?void 0:f.includes(t.name)}));this._resolver.addLanguage(t);const r={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const i=this.loadGrammarWithConfiguration(t.scopeName,1,r);if(i.name=t.name,this._resolvedGrammars.set(t.name,i),t.aliases&&t.aliases.forEach(u=>{this._alias[u]=t.name}),this._loadedLanguagesCache=null,n.size)for(const u of n)this._resolvedGrammars.delete(u.name),this._loadedLanguagesCache=null,(o=(s=this._syncRegistry)==null?void 0:s._injectionGrammars)==null||o.delete(u.scopeName),(a=(l=this._syncRegistry)==null?void 0:l._grammars)==null||a.delete(u.scopeName),this.loadLanguage(this._langMap.get(u.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const i of t)this.resolveEmbeddedLanguages(i);const n=[...this._langGraph.entries()],r=n.filter(([i,s])=>!s);if(r.length){const i=n.filter(([s,o])=>{var l;return o?(l=o.embeddedLanguages||o.embeddedLangs)==null?void 0:l.some(a=>r.map(([u])=>u).includes(a)):!1}).filter(s=>!r.includes(s));throw new _e(`Missing languages ${r.map(([s])=>`\`${s}\``).join(", ")}, required by ${i.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[i,s]of n)this._resolver.addLanguage(s);for(const[i,s]of n)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const r of n)this._langGraph.set(r,this._langMap.get(r))}},RR=class{constructor(e,t){T(this,"_langs",new Map);T(this,"_scopeToLang",new Map);T(this,"_injections",new Map);T(this,"_onigLib");this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const i=t.slice(0,r).join(".");n=[...n,...this._injections.get(i)||[]]}return n}};let so=0;function LR(e){so+=1,e.warnings!==!1&&so>=10&&so%10===0&&console.warn(`[Shiki] ${so} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new _e("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(_p),i=new AR(new RR(e.engine,n),r,n,e.langAlias);let s;function o(y){return Uv(y,e.langAlias)}function l(y){v();const b=i.getGrammar(typeof y=="string"?y:y.name);if(!b)throw new _e(`Language \`${y}\` not found, you may need to load it first`);return b}function a(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};v();const b=i.getTheme(y);if(!b)throw new _e(`Theme \`${y}\` not found, you may need to load it first`);return b}function u(y){v();const b=a(y);return s!==y&&(i.setTheme(b),s=y),{theme:b,colorMap:i.getColorMap()}}function f(){return v(),i.getLoadedThemes()}function d(){return v(),i.getLoadedLanguages()}function h(...y){v(),i.loadLanguages(y.flat(1))}async function p(...y){return h(await zv(y))}function m(...y){v();for(const b of y.flat(1))i.loadTheme(b)}async function x(...y){return v(),m(await Bv(y))}function v(){if(t)throw new _e("Shiki instance has been disposed")}function g(){t||(t=!0,i.dispose(),so-=1)}return{setTheme:u,getTheme:a,getLanguage:l,getLoadedThemes:f,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:h,loadTheme:x,loadThemeSync:m,dispose:g,[Symbol.dispose]:g}}async function MR(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Bv(e.themes||[]),zv(e.langs||[]),e.engine]);return LR({...e,themes:t,langs:n,engine:r})}const Gv=new WeakMap;function Wu(e,t){Gv.set(e,t)}function tl(e){return Gv.get(e)}var Vu=class Hv{constructor(...t){T(this,"_stacks",{});T(this,"lang");if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Hv(Object.fromEntries(jR(n).map(r=>[r,Hf])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return OR(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function OR(e){const t=[],n=new Set;function r(i){var o;if(n.has(i))return;n.add(i);const s=(o=i==null?void 0:i.nameScopesList)==null?void 0:o.scopeName;s&&t.push(s),i.parent&&r(i.parent)}return r(e),t}function DR(e,t){if(!(e instanceof Vu))throw new _e("Invalid grammar state");return e.getInternalStack(t)}const $R=/,/,FR=/ /;function qv(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(Gu(e.resolveLangAlias(n.lang||"text"))||Hu(r))return qu(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:i,colorMap:s}=e.setTheme(r),o=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new _e(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new _e(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return BR(t,o,i,s,n)}function zR(...e){if(e.length===2)return tl(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=r;if(Gu(i)||Hu(s))throw new _e("Plain language does not have grammar state");if(i==="ansi")throw new _e("ANSI language does not have grammar state");const{theme:o,colorMap:l}=t.setTheme(s),a=t.getLanguage(i);return new Vu(Ep(n,a,o,l,r).stateStack,a.name,o.name)}function BR(e,t,n,r,i){const s=Ep(e,t,n,r,i),o=new Vu(s.stateStack,t.name,n.name);return Wu(s.tokens,o),s.tokens}function Ep(e,t,n,r,i){const s=ru(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:l=500}=i,a=qu(e);let u=i.grammarState?DR(i.grammarState,n.name)??Hf:i.grammarContextCode!=null?Ep(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Hf,f=[];const d=[];for(let h=0,p=a.length;h<p;h++){const[m,x]=a[h];if(m===""){f=[],d.push([]);continue}if(o>0&&m.length>=o){f=[],d.push([{content:m,offset:x,color:"",fontStyle:0}]);continue}let v,g,y;i.includeExplanation&&(v=t.tokenizeLine(m,u,l),g=v.tokens,y=0);const b=t.tokenizeLine2(m,u,l),w=b.tokens.length/2;for(let C=0;C<w;C++){const k=b.tokens[2*C],P=C+1<w?b.tokens[2*C+2]:m.length;if(k===P)continue;const I=b.tokens[2*C+1],A=Mr(r[Is.getForeground(I)],s),N=Is.getFontStyle(I),R={content:m.substring(k,P),offset:x+k,color:A,fontStyle:N};if(i.includeExplanation){const L=[];if(i.includeExplanation!=="scopeName")for(const W of n.settings){let G;switch(typeof W.scope){case"string":G=W.scope.split($R).map(re=>re.trim());break;case"object":G=W.scope;break;default:continue}L.push({settings:W,selectors:G.map(re=>re.split(FR))})}R.explanation=[];let V=0;for(;k+V<P;){const W=g[y],G=m.substring(W.startIndex,W.endIndex);V+=G.length,R.explanation.push({content:G,scopes:i.includeExplanation==="scopeName"?UR(W.scopes):GR(L,W.scopes)}),y+=1}}f.push(R)}d.push(f),f=[],u=b.ruleStack}return{tokens:d,stateStack:u}}function UR(e){return e.map(t=>({scopeName:t}))}function GR(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r];n[r]={scopeName:s,themeMatches:qR(e,s,t.slice(0,r))}}return n}function Rx(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function HR(e,t,n){if(!Rx(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Rx(e[r],n[i])&&(r-=1),i-=1;return r===-1}function qR(e,t,n){const r=[];for(const{selectors:i,settings:s}of e)for(const o of i)if(HR(o,t,n)){r.push(s);break}return r}function Wv(e,t,n,r=qv){const i=Object.entries(n.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),s=i.map(u=>{const f=r(e,t,{...n,theme:u.theme});return{tokens:f,state:tl(f),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),o=WR(...s.map(u=>u.tokens)),l=o[0].map((u,f)=>u.map((d,h)=>{const p={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in n&&n.includeExplanation&&(p.explanation=d.explanation),o.forEach((m,x)=>{const{content:v,explanation:g,offset:y,...b}=m[f][h];p.variants[i[x].color]=b}),p})),a=s[0].state?new Vu(Object.fromEntries(s.map(u=>{var f;return[u.theme,(f=u.state)==null?void 0:f.getInternalStack(u.theme)]})),s[0].state.lang):void 0;return a&&Wu(l,a),l}function WR(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(a=>a[r]),s=t.map(()=>[]);t.forEach((a,u)=>a.push(s[u]));const o=i.map(()=>0),l=i.map(a=>a[0]);for(;l.every(a=>a);){const a=Math.min(...l.map(u=>u.content.length));for(let u=0;u<n;u++){const f=l[u];f.content.length===a?(s[u].push(f),o[u]+=1,l[u]=i[u][o[u]]):(s[u].push({...f,content:f.content.slice(0,a)}),l[u]={...f,content:f.content.slice(a),offset:f.offset+a})}}}return t}const VR=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],QR=/["&'<>`]/g,KR=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,XR=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,YR=/[|\\{}()[\]^$+*?.]/g,Lx=new WeakMap;function JR(e,t){if(e=e.replace(t.subset?ZR(t.subset):QR,r),t.subset||t.escapeOnly)return e;return e.replace(KR,n).replace(XR,r);function n(i,s,o){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),t)}function r(i,s,o){return t.format(i.charCodeAt(0),o.charCodeAt(s+1),t)}}function ZR(e){let t=Lx.get(e);return t||(t=eL(e),Lx.set(e,t)),t}function eL(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(YR,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const tL=/[\dA-Fa-f]/;function nL(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!tL.test(String.fromCharCode(t))?r:r+";"}const rL=/\d/;function iL(e,t,n){const r="&#"+String(e);return n&&t&&!rL.test(String.fromCharCode(t))?r:r+";"}const sL=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Wc={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},oL=["cent","copy","divide","gt","lt","not","para","times"],Vv={}.hasOwnProperty,qf={};let Kl;for(Kl in Wc)Vv.call(Wc,Kl)&&(qf[Wc[Kl]]=Kl);const lL=/[^\dA-Za-z]/;function aL(e,t,n,r){const i=String.fromCharCode(e);if(Vv.call(qf,i)){const s=qf[i],o="&"+s;return n&&sL.includes(s)&&!oL.includes(s)&&(!r||t&&t!==61&&lL.test(String.fromCharCode(t)))?o:o+";"}return""}function uL(e,t,n){let r=nL(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=aL(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=iL(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function ls(e,t){return JR(e,Object.assign({format:uL},t))}const cL=/^>|^->|<!--|-->|--!>|<!-$/g,dL=[">"],fL=["<",">"];function hL(e,t,n,r){return r.settings.bogusComments?"<?"+ls(e.value,Object.assign({},r.settings.characterReferences,{subset:dL}))+">":"<!--"+e.value.replace(cL,i)+"-->";function i(s){return ls(s,Object.assign({},r.settings.characterReferences,{subset:fL}))}}function pL(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}const Ge=Kv(1),Qv=Kv(-1),mL=[];function Kv(e){return t;function t(n,r,i){const s=n?n.children:mL;let o=(r||0)+e,l=s[o];if(!i)for(;l&&Ou(l);)o+=e,l=s[o];return l}}const gL={}.hasOwnProperty;function Xv(e){return t;function t(n,r,i){return gL.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const Np=Xv({body:yL,caption:Vc,colgroup:Vc,dd:kL,dt:wL,head:Vc,html:xL,li:vL,optgroup:SL,option:CL,p:bL,rp:Mx,rt:Mx,tbody:EL,td:Ox,tfoot:NL,th:Ox,thead:_L,tr:jL});function Vc(e,t,n){const r=Ge(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Ou(r.value.charAt(0)))}function xL(e,t,n){const r=Ge(n,t);return!r||r.type!=="comment"}function yL(e,t,n){const r=Ge(n,t);return!r||r.type!=="comment"}function bL(e,t,n){const r=Ge(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function vL(e,t,n){const r=Ge(n,t);return!r||r.type==="element"&&r.tagName==="li"}function wL(e,t,n){const r=Ge(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function kL(e,t,n){const r=Ge(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Mx(e,t,n){const r=Ge(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function SL(e,t,n){const r=Ge(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function CL(e,t,n){const r=Ge(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function _L(e,t,n){const r=Ge(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function EL(e,t,n){const r=Ge(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function NL(e,t,n){return!Ge(n,t)}function jL(e,t,n){const r=Ge(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Ox(e,t,n){const r=Ge(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const PL=Xv({body:AL,colgroup:RL,head:TL,html:IL,tbody:LL});function IL(e){const t=Ge(e,-1);return!t||t.type!=="comment"}function TL(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function AL(e){const t=Ge(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Ou(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function RL(e,t,n){const r=Qv(n,t),i=Ge(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Np(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function LL(e,t,n){const r=Qv(n,t),i=Ge(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Np(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Xl={name:[[`
|
|
242
|
+
\f\r &/=>`.split(""),`
|
|
243
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
244
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
245
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
246
|
+
\f\r &>`.split(""),`\0
|
|
247
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
248
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
249
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function ML(e,t,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const l=[];let a;i.space==="html"&&e.tagName==="svg"&&(r.schema=xl);const u=OL(r,e.properties),f=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,f&&(o=!1),(u||!s||!PL(e,t,n))&&(l.push("<",e.tagName,u?" "+u:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(a=u.charAt(u.length-1),(!r.settings.tightSelfClosing||a==="/"||a&&a!=='"'&&a!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(f),!o&&(!s||!Np(e,t,n))&&l.push("</"+e.tagName+">"),l.join("")}function OL(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const s=DL(e,i,t[i]);s&&n.push(s)}}for(;++r<n.length;){const s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function DL(e,t,n){const r=S1(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let o=e.quote,l;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const a=ls(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Xl.name[i][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?m1:_1)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?a:(e.settings.preferUnquoted&&(l=ls(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Xl.unquoted[i][s]}))),l!==n&&(e.settings.quoteSmart&&Xa(n,o)>Xa(n,e.alternative)&&(o=e.alternative),l=o+ls(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?Xl.single:Xl.double)[i][s],attribute:!0}))+o),a+(l&&"="+l))}const $L=["<","&"];function Yv(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:ls(e.value,Object.assign({},r.settings.characterReferences,{subset:$L}))}function FL(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Yv(e,t,n,r)}function zL(e,t,n,r){return r.all(e)}const BL=pT("type",{invalid:UL,unknown:GL,handlers:{comment:hL,doctype:pL,element:ML,raw:FL,root:zL,text:Yv}});function UL(e){throw new Error("Expected node, not `"+e+"`")}function GL(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const HL={},qL={},WL=[];function VL(e,t){const n=t||HL,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:QL,all:KL,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||VR,characterReferences:n.characterReferences||qL,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?xl:C1,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function QL(e,t,n){return BL(e,t,n,this)}function KL(e){const t=[],n=e&&e.children||WL;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}const Dx=/\s+/g;function Jv(e,t){var r;if(!t)return e;e.properties||(e.properties={}),(r=e.properties).class||(r.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(Dx)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(Dx);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function XL(e){const t=qu(e,!0).map(([i])=>i);function n(i){if(i===e.length)return{line:t.length-1,character:t.at(-1).length};let s=i,o=0;for(const l of t){if(s<l.length)break;s-=l.length,o++}return{line:o,character:s}}function r(i,s){let o=0;for(let l=0;l<i;l++)o+=t[l].length;return o+=s,o}return{lines:t,indexToPos:n,posToIndex:r}}const YL=["color","background-color"];function JL(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function ZL(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const s=n.filter(o=>i.offset<o&&o<i.offset+i.content.length).map(o=>o-i.offset).sort((o,l)=>o-l);return s.length?JL(i,s):i})):e}function e3(e,t,n,r,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(f=>iu(e.variants[f])),l=new Set(o.flatMap(f=>Object.keys(f))),a={},u=(f,d)=>{const h=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[f]+(d==="color"?"":h)};return o.forEach((f,d)=>{for(const h of l){const p=f[h]||"inherit";if(d===0&&r&&YL.includes(h))if(r==="light-dark()"&&o.length>1){const m=t.findIndex(v=>v==="light"),x=t.findIndex(v=>v==="dark");if(m===-1||x===-1)throw new _e('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');a[h]=`light-dark(${o[m][h]||"inherit"}, ${o[x][h]||"inherit"})`,i==="css-vars"&&(a[u(d,h)]=p)}else a[h]=p;else i==="css-vars"&&(a[u(d,h)]=p)}}),s.htmlStyle=a,s}function iu(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&rt.Italic&&(t["font-style"]="italic"),e.fontStyle&rt.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&rt.Underline&&n.push("underline"),e.fontStyle&rt.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Wf(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function t3(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let s=function(l){if(typeof l=="number"){if(l<0||l>n.source.length)throw new _e(`Invalid decoration offset: ${l}. Code length: ${n.source.length}`);return{...i.indexToPos(l),offset:l}}else{const a=i.lines[l.line];if(a===void 0)throw new _e(`Invalid decoration position ${JSON.stringify(l)}. Lines length: ${i.lines.length}`);let u=l.character;if(u<0&&(u=a.length+u),u<0||u>a.length)throw new _e(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${a.length}`);return{...l,character:u,offset:i.posToIndex(l.line,u)}}};var r=s;const i=XL(n.source),o=(n.options.decorations||[]).map(l=>({...l,start:s(l.start),end:s(l.end)}));n3(o),e.set(n.meta,{decorations:o,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var r;if((r=this.options.decorations)!=null&&r.length)return ZL(n,t(this).decorations.flatMap(i=>[i.start.offset,i.end.offset]))},code(n){var f;if(!((f=this.options.decorations)!=null&&f.length))return;const r=t(this),i=[...n.children].filter(d=>d.type==="element"&&d.tagName==="span");if(i.length!==r.converter.lines.length)throw new _e(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function s(d,h,p,m){const x=i[d];let v="",g=-1,y=-1;if(h===0&&(g=0),p===0&&(y=0),p===Number.POSITIVE_INFINITY&&(y=x.children.length),g===-1||y===-1)for(let w=0;w<x.children.length;w++)v+=Zv(x.children[w]),g===-1&&v.length===h&&(g=w+1),y===-1&&v.length===p&&(y=w+1);if(g===-1)throw new _e(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(y===-1)throw new _e(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const b=x.children.slice(g,y);if(!m.alwaysWrap&&b.length===x.children.length)l(x,m,"line");else if(!m.alwaysWrap&&b.length===1&&b[0].type==="element")l(b[0],m,"token");else{const w={type:"element",tagName:"span",properties:{},children:b};l(w,m,"wrapper"),x.children.splice(g,b.length,w)}}function o(d,h){i[d]=l(i[d],h,"line")}function l(d,h,p){var v;const m=h.properties||{},x=h.transform||(g=>g);return d.tagName=h.tagName||"span",d.properties={...d.properties,...m,class:d.properties.class},(v=h.properties)!=null&&v.class&&Jv(d,h.properties.class),d=x(d,p)||d,d}const a=[],u=r.decorations.sort((d,h)=>h.start.offset-d.start.offset||d.end.offset-h.end.offset);for(const d of u){const{start:h,end:p}=d;if(h.line===p.line)s(h.line,h.character,p.character,d);else if(h.line<p.line){s(h.line,h.character,Number.POSITIVE_INFINITY,d);for(let m=h.line+1;m<p.line;m++)a.unshift(()=>o(m,d));s(p.line,0,p.character,d)}}a.forEach(d=>d())}}}function n3(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new _e(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const i=e[r],s=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,o=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,l=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,a=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(s||o||l||a){if(s&&o||l&&a||l&&n.start.offset===n.end.offset||o&&i.start.offset===i.end.offset)continue;throw new _e(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function Zv(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Zv).join(""):""}const r3=[t3()];function su(e){const t=i3(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...r3]}function i3(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var ei=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Qc={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function s3(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function $x(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function o3(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)Qc[r]&&t.push({type:"setDecoration",value:Qc[r]});else if(r<=29){const i=Qc[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:ei[r-30]}});else if(r===38){const i=$x(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:ei[r-40]}});else if(r===48){const i=$x(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:ei[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:ei[r-100+8]}})}return t}function l3(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=s3(r,s),l=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(l.length>0&&i.push({value:l,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const a=o3(o.sequence);for(const u of a)u.type==="resetAll"?(e=null,t=null,n.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of a)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&n.add(u.value)}s=o.position}while(s<r.length);return i}}}var a3={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function u3(e=a3){function t(l){return e[l]}function n(l){return`#${l.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let u=0;u<ei.length;u++)r.push(t(ei[u]));let l=[0,95,135,175,215,255];for(let u=0;u<6;u++)for(let f=0;f<6;f++)for(let d=0;d<6;d++)r.push(n([l[u],l[f],l[d]]));let a=8;for(let u=0;u<24;u++,a+=10)r.push(n([a,a,a]));return r}function s(l){return i()[l]}function o(l){switch(l.type){case"named":return t(l.name);case"rgb":return n(l.rgb);case"table":return s(l.index)}}return{value:o}}const c3=/#([0-9a-f]{3,8})/i,d3=/var\((--[\w-]+-ansi-[\w-]+)\)/,f3={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function h3(e,t,n){const r=ru(e,n),i=qu(t),s=u3(Object.fromEntries(ei.map(l=>{var u;const a=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`;return[l,((u=e.colors)==null?void 0:u[a])||f3[l]]}))),o=l3();return i.map(l=>o.parse(l[0]).map(a=>{let u,f;a.decorations.has("reverse")?(u=a.background?s.value(a.background):e.bg,f=a.foreground?s.value(a.foreground):e.fg):(u=a.foreground?s.value(a.foreground):e.fg,f=a.background?s.value(a.background):void 0),u=Mr(u,r),f=Mr(f,r),a.decorations.has("dim")&&(u=p3(u));let d=rt.None;return a.decorations.has("bold")&&(d|=rt.Bold),a.decorations.has("italic")&&(d|=rt.Italic),a.decorations.has("underline")&&(d|=rt.Underline),a.decorations.has("strikethrough")&&(d|=rt.Strikethrough),{content:a.value,offset:l[1],color:u,bgColor:f,fontStyle:d}}))}function p3(e){const t=e.match(c3);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],s=r[1],o=r[2],l=r[3];return`#${i}${i}${s}${s}${o}${o}${Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const i=r[0],s=r[1],o=r[2];return`#${i}${i}${s}${s}${o}${o}80`}}}const n=e.match(d3);return n?`var(${n[1]}-dim)`:e}function Vf(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:i=e.getLoadedThemes()[0]}=n;if(!Gu(r)&&!Hu(i)&&r==="ansi"){const{theme:s}=e.setTheme(i);return h3(s,t,n)}return qv(e,t,n)}function ou(e,t,n){let r,i,s,o,l,a;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:f="--shiki-",colorsRendering:d="css-vars"}=n,h=Object.entries(n.themes).filter(g=>g[1]).map(g=>({color:g[0],theme:g[1]})).sort((g,y)=>g.color===u?-1:y.color===u?1:0);if(h.length===0)throw new _e("`themes` option must not be empty");const p=Wv(e,t,n,Vf);if(a=tl(p),u&&u!=="light-dark()"&&!h.some(g=>g.color===u))throw new _e(`\`themes\` option must contain the defaultColor key \`${u}\``);const m=h.map(g=>e.getTheme(g.theme)),x=h.map(g=>g.color);s=p.map(g=>g.map(y=>e3(y,x,f,u,d))),a&&Wu(s,a);const v=h.map(g=>ru(g.theme,n));i=Fx(h,m,v,f,u,"fg",d),r=Fx(h,m,v,f,u,"bg",d),o=`shiki-themes ${m.map(g=>g.name).join(" ")}`,l=u?void 0:[i,r].join(";")}else if("theme"in n){const u=ru(n.theme,n);s=Vf(e,t,n);const f=e.getTheme(n.theme);r=Mr(f.bg,u),i=Mr(f.fg,u),o=f.name,a=tl(s)}else throw new _e("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:l,grammarState:a}}function Fx(e,t,n,r,i,s,o){return e.map((l,a)=>{const u=Mr(t[a][s],n[a])||"inherit",f=`${r+l.color}${s==="bg"?"-bg":""}:${u}`;if(a===0&&i){if(i==="light-dark()"&&e.length>1){const d=e.findIndex(p=>p.color==="light"),h=e.findIndex(p=>p.color==="dark");if(d===-1||h===-1)throw new _e('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Mr(t[d][s],n[d])||"inherit"}, ${Mr(t[h][s],n[h])||"inherit"});${f}`}return u}return o==="css-vars"?f:null}).filter(l=>!!l).join(";")}const ew=/^\s+$/,m3=/^(\s*)(.*?)(\s*)$/;function lu(e,t,n,r={meta:{},options:n,codeToHast:(i,s)=>lu(e,i,s),codeToTokens:(i,s)=>ou(e,i,s)}){var m,x;let i=t;for(const v of su(n))i=((m=v.preprocess)==null?void 0:m.call(r,i,n))||i;let{tokens:s,fg:o,bg:l,themeName:a,rootStyle:u,grammarState:f}=ou(e,i,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=n;d===!0?s=x3(s):d==="never"&&(s=y3(s)),h&&(s=b3(s));const p={...r,get source(){return i}};for(const v of su(n))s=((x=v.tokens)==null?void 0:x.call(p,s))||s;return g3(s,{...n,fg:o,bg:l,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},p,f)}function g3(e,t,n,r=tl(e)){var x,v,g,y;const i=su(t),s=[],o={type:"root",children:[]},{structure:l="classic",tabindex:a="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),a!==!1&&a!=null&&(u.tabindex=a.toString());for(const[b,w]of Object.entries(t.meta||{}))b.startsWith("_")||(u[b]=w);let f={type:"element",tagName:"pre",properties:u,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:s};const h=[],p={...n,structure:l,addClassToHast:Jv,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return f},get code(){return d},get lines(){return h}};if(e.forEach((b,w)=>{var P,I;w&&(l==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&s.push({type:"text",value:`
|
|
250
|
+
`}));let C={type:"element",tagName:"span",properties:{class:"line"},children:[]},k=0;for(const A of b){let N={type:"element",tagName:"span",properties:{...A.htmlAttrs},children:[{type:"text",value:A.content}]};const R=Wf(A.htmlStyle||iu(A));R&&(N.properties.style=R);for(const L of i)N=((P=L==null?void 0:L.span)==null?void 0:P.call(p,N,w+1,k,C,A))||N;l==="inline"?o.children.push(N):l==="classic"&&C.children.push(N),k+=A.content.length}if(l==="classic"){for(const A of i)C=((I=A==null?void 0:A.line)==null?void 0:I.call(p,C,w+1))||C;h.push(C),s.push(C)}else l==="inline"&&h.push(C)}),l==="classic"){for(const b of i)d=((x=b==null?void 0:b.code)==null?void 0:x.call(p,d))||d;f.children.push(d);for(const b of i)f=((v=b==null?void 0:b.pre)==null?void 0:v.call(p,f))||f;o.children.push(f)}else if(l==="inline"){const b=[];let w={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const k of o.children)k.type==="element"&&k.tagName==="br"?(b.push(w),w={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(k.type==="element"||k.type==="text")&&w.children.push(k);b.push(w);let C={type:"element",tagName:"code",properties:{},children:b};for(const k of i)C=((g=k==null?void 0:k.code)==null?void 0:g.call(p,C))||C;o.children=[];for(let k=0;k<C.children.length;k++){k>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const P=C.children[k];P.type==="element"&&o.children.push(...P.children)}}let m=o;for(const b of i)m=((y=b==null?void 0:b.root)==null?void 0:y.call(p,m))||m;return r&&Wu(m,r),m}function x3(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((s,o)=>{const l=!(s.fontStyle&&(s.fontStyle&rt.Underline||s.fontStyle&rt.Strikethrough));l&&ew.test(s.content)&&t[o+1]?(i===void 0&&(i=s.offset),r+=s.content):r?(l?n.push({...s,offset:i,content:r+s.content}):n.push({content:r,offset:i},s),i=void 0,r=""):n.push(s)}),n})}function y3(e){return e.map(t=>t.flatMap(n=>{if(ew.test(n.content))return n;const r=n.content.match(m3);if(!r)return n;const[,i,s,o]=r;if(!i&&!o)return n;const l=[{...n,offset:n.offset+i.length,content:s}];return i&&l.unshift({content:i,offset:n.offset}),o&&l.push({content:o,offset:n.offset+i.length+s.length}),l}))}function b3(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n.at(-1),s=Wf(i.htmlStyle||iu(i)),o=Wf(r.htmlStyle||iu(r)),l=i.fontStyle&&(i.fontStyle&rt.Underline||i.fontStyle&rt.Strikethrough),a=r.fontStyle&&(r.fontStyle&rt.Underline||r.fontStyle&rt.Strikethrough);!l&&!a&&s===o?i.content+=r.content:n.push({...r})}return n})}const v3=VL;function w3(e,t,n){var s;const r={meta:{},options:n,codeToHast:(o,l)=>lu(e,o,l),codeToTokens:(o,l)=>ou(e,o,l)};let i=v3(lu(e,t,n,r));for(const o of su(n))i=((s=o.postprocess)==null?void 0:s.call(r,i,n))||i;return i}async function k3(e){const t=await MR(e);return{getLastGrammarState:(...n)=>zR(t,...n),codeToTokensBase:(n,r)=>Vf(t,n,r),codeToTokensWithThemes:(n,r)=>Wv(t,n,r),codeToTokens:(n,r)=>ou(t,n,r),codeToHast:(n,r)=>lu(t,n,r),codeToHtml:(n,r)=>w3(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}const zx=4294967295;var S3=class{constructor(e,t={}){T(this,"patterns");T(this,"options");T(this,"regexps");this.patterns=e,this.options=t;const{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;const o=r==null?void 0:r.get(s);if(o){if(o instanceof RegExp)return o;if(n)return null;throw o}try{const l=i(s);return r==null||r.set(s,l),l}catch(l){if(r==null||r.set(s,l),n)return null;throw l}})}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,i=[];function s(o,l,a=0){return{index:o,captureIndices:l.indices.map(u=>u==null?{start:zx,end:zx,length:0}:{start:u[0]+a,end:u[1]+a,length:u[1]-u[0]})}}for(let o=0;o<this.regexps.length;o++){const l=this.regexps[o];if(l)try{l.lastIndex=t;const a=l.exec(r);if(!a)continue;if(a.index===t)return s(o,a,0);i.push([o,a,0])}catch(a){if(this.options.forgiving)continue;throw a}}if(i.length){const o=Math.min(...i.map(l=>l[1].index));for(const[l,a,u]of i)if(a.index===o)return s(l,a,u)}return null}};function zs(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function C3(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const jp=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Ve=String.raw;function Bs(e,t){if(e==null)throw new Error(t??"Value expected");return e}const tw=Ve`\[\^?`,nw=`c.? | C(?:-.?)?|${Ve`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Ve`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Ve`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Ve`o\{[^\}]*\}?`}|${Ve`\d{1,3}`}`,Pp=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Yl=new RegExp(Ve`
|
|
251
|
+
\\ (?:
|
|
252
|
+
${nw}
|
|
253
|
+
| [gk]<[^>]*>?
|
|
254
|
+
| [gk]'[^']*'?
|
|
255
|
+
| .
|
|
256
|
+
)
|
|
257
|
+
| \( (?:
|
|
258
|
+
\? (?:
|
|
259
|
+
[:=!>({]
|
|
260
|
+
| <[=!]
|
|
261
|
+
| <[^>]*>
|
|
262
|
+
| '[^']*'
|
|
263
|
+
| ~\|?
|
|
264
|
+
| #(?:[^)\\]|\\.?)*
|
|
265
|
+
| [^:)]*[:)]
|
|
266
|
+
)?
|
|
267
|
+
| \*[^\)]*\)?
|
|
268
|
+
)?
|
|
269
|
+
| (?:${Pp.source})+
|
|
270
|
+
| ${tw}
|
|
271
|
+
| .
|
|
272
|
+
`.replace(/\s+/g,""),"gsu"),Kc=new RegExp(Ve`
|
|
273
|
+
\\ (?:
|
|
274
|
+
${nw}
|
|
275
|
+
| .
|
|
276
|
+
)
|
|
277
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
278
|
+
| ${tw}
|
|
279
|
+
| &&
|
|
280
|
+
| .
|
|
281
|
+
`.replace(/\s+/g,""),"gsu");function _3(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=H3(n.flags),i=[r.extended],s={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(d){i.push(d)},replaceCurrentModX(d){i[i.length-1]=d},singleline:n.rules.singleline};let o=[],l;for(Yl.lastIndex=0;l=Yl.exec(e);){const d=E3(s,e,l[0],Yl.lastIndex);d.tokens?o.push(...d.tokens):d.token&&o.push(d.token),d.lastIndex!==void 0&&(Yl.lastIndex=d.lastIndex)}const a=[];let u=0;o.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++u:d.raw==="("&&a.push(d)}),u||a.forEach((d,h)=>{d.kind="capturing",d.number=h+1});const f=u||a.length;return{tokens:o.map(d=>d.type==="EscapedNumber"?W3(d,f):d).flat(),flags:r}}function E3(e,t,n,r){const[i,s]=n;if(n==="["||n==="[^"){const o=N3(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(s))return{token:Bx(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:D3(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:iw(n)}}if(s==="K")return{token:sw("keep",n)};if(s==="N"||s==="R")return{token:ti("newline",n,{negate:s==="N"})};if(s==="O")return{token:ti("any",n)};if(s==="X")return{token:ti("text_segment",n)};const o=rw(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(s==="*")return{token:B3(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:z3(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:$i("group",n)};if(n==="(?>")return{token:$i("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:$i(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:$i("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:$i("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:L3(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(`
|
|
282
|
+
`,r);return{lastIndex:o===-1?t.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(t)?o.lastIndex:r}}}if(n===".")return{token:ti("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":Ve`\A`,$:Ve`\Z`}[n]:n;return{token:Bx(o,n)}}return n==="|"?{token:P3(n)}:Pp.test(n)?{tokens:V3(n)}:{token:Bn(zs(n),n)}}function N3(e,t,n){const r=[Ux(t[1]==="^",t)];let i=1,s;for(Kc.lastIndex=n;s=Kc.exec(e);){const o=s[0];if(o[0]==="["&&o[1]!==":")i++,r.push(Ux(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Bn(93,o));else if(i--,r.push(I3(o)),!i)break}else{const l=j3(o);Array.isArray(l)?r.push(...l):r.push(l)}}return{tokens:r,lastIndex:Kc.lastIndex||e.length}}function j3(e){if(e[0]==="\\")return rw(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!jp.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return ti("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?T3(e):e==="&&"?A3(e):Bn(zs(e),e)}function rw(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return F3(e);if("dDhHsSwW".includes(n))return U3(e);if(e.startsWith(Ve`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return G3(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),s=new TextEncoder;return[...i].map(o=>{const l=[...s.encode(o)].map(a=>`\\x${a.toString(16)}`).join("");return Bn(zs(o),l)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Bn(q3(e),e);if(Gx.has(n))return Bn(Gx.get(n),e);if(/\d/.test(n))return R3(t,e);if(e==="\\")throw new Error(Ve`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Bn(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function P3(e){return{type:"Alternator",raw:e}}function Bx(e,t){return{type:"Assertion",kind:e,raw:t}}function iw(e){return{type:"Backreference",raw:e}}function Bn(e,t){return{type:"Character",value:e,raw:t}}function I3(e){return{type:"CharacterClassClose",raw:e}}function T3(e){return{type:"CharacterClassHyphen",raw:e}}function A3(e){return{type:"CharacterClassIntersector",raw:e}}function Ux(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function ti(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function sw(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Bs(n.flags),raw:t}}function R3(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function L3(e){return{type:"GroupClose",raw:e}}function $i(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function M3(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function O3(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function D3(e){return{type:"Subroutine",raw:e}}const $3=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Gx=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function F3(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Bn(zs(t.toUpperCase())-64,e)}function z3(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??(r="");const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),s=qx(n),o=qx(r),l={};if(s&&(l.enable=s),o&&(l.disable=o),e.endsWith(")"))return t.replaceCurrentModX(i),sw("flags",e,{flags:l});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,$i("group",e,{...(s||o)&&{flags:l}});throw new Error(`Unexpected flag modifier "${e}"`)}function B3(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const s=i?i.split(",").filter(f=>f!=="").map(f=>/^[+-]?\d+$/.test(f)?+f:f):[],[o,l,a]=s,u=$3.has(n)?n.toLowerCase():"custom";switch(u){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.length===2&&(typeof l=="number"||!/^[<>X]$/.test(l)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${l}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof l=="number"||!/^(?:[<>!=]=|[<>])$/.test(l))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${l}"`);if(typeof a=="string"&&!/^[A-Za-z_]\w*$/.test(a))throw new Error(`Named callout argument three must be a tag or number "${a}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${u}"`)}return M3(u,r??null,(i==null?void 0:i.split(","))??null,e)}function Hx(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=s===void 0?+i:s===""?1/0:+s,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return O3(t,n,r,e)}function U3(e){const t=e[1].toLowerCase();return ti({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function G3(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return ti("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function qx(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function H3(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function q3(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function W3(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[iw(n)];const s=[],o=i.match(/^[0-7]+|\d/g);for(let l=0;l<o.length;l++){const a=o[l];let u;if(l===0&&a!=="8"&&a!=="9"){if(u=parseInt(a,8),u>127)throw new Error(Ve`Octal encoded byte above 177 unsupported "${n}"`)}else u=zs(a);s.push(Bn(u,(l===0?"\\":"")+a))}return s}function V3(e){const t=[],n=new RegExp(Pp,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(s){const{min:o,max:l}=s.groups;if(+o>+l&&i.endsWith("?")){n.lastIndex--,t.push(Hx(i.slice(0,-1)));continue}}}t.push(Hx(i))}return t}function ow(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function Q3(e){return K3.has(e.type)}const K3=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function lw(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=_3(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(h,p)=>{const m=r.tokens[s.nextIndex];switch(s.parent=h,s.nextIndex++,m.type){case"Alternator":return Si();case"Assertion":return X3(m);case"Backreference":return Y3(m,s);case"Character":return Qu(m.value,{useLastValid:!!p.isCheckingRangeEnd});case"CharacterClassHyphen":return J3(m,s,p);case"CharacterClassOpen":return Z3(m,s,p);case"CharacterSet":return e5(m,s);case"Directive":return o5(m.kind,{flags:m.flags});case"GroupOpen":return t5(m,s,p);case"NamedCallout":return a5(m.kind,m.tag,m.arguments);case"Quantifier":return n5(m,s);case"Subroutine":return r5(m,s);default:throw new Error(`Unexpected token type "${m.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=c5(l5(r.flags));let l=o.body[0];for(;s.nextIndex<r.tokens.length;){const h=i(l,{});h.type==="Alternative"?(o.body.push(h),l=h):l.body.push(h)}const{capturingGroups:a,hasNumberedRef:u,namedGroupsByName:f,subroutines:d}=s;if(u&&f.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:h}of d)if(typeof h=="number"){if(h>a.length)throw new Error("Subroutine uses a group number that's not defined");h&&(a[h-1].isSubroutined=!0)}else if(f.has(h)){if(f.get(h).length>1)throw new Error(Ve`Subroutine uses a duplicate group name "\g<${h}>"`);f.get(h)[0].isSubroutined=!0}else throw new Error(Ve`Subroutine uses a group name that's not defined "\g<${h}>"`);return o}function X3({kind:e}){return Qf(Bs({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===Ve`\B`||e===Ve`\Y`})}function Y3({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(s,o=!1)=>{const l=t.capturingGroups.length;let a=!1;if(s>l)if(t.skipBackrefValidation)a=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Kf(o?l+1-s:s,{orphan:a})};if(n){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(s)return i(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return Kf(r)}return i(+r)}function J3(e,t,n){const{tokens:r,walk:i}=t,s=t.parent,o=s.body.at(-1),l=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&l&&l.type!=="CharacterClassOpen"&&l.type!=="CharacterClassClose"&&l.type!=="CharacterClassIntersector"){const a=i(s,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&a.type==="Character")return s.body.pop(),s5(o,a);throw new Error("Invalid character class range")}return Qu(zs("-"))}function Z3({negate:e},t,n){const{tokens:r,walk:i}=t,s=[xa()],o=r[t.nextIndex];let l=Qx(o);for(;l.type!=="CharacterClassClose";){if(l.type==="CharacterClassIntersector")s.push(xa()),t.nextIndex++;else{const u=s.at(-1);u.body.push(i(u,n))}l=Qx(r[t.nextIndex],o)}const a=xa({negate:e});return s.length===1?a.body=s[0].body:(a.kind="intersection",a.body=s.map(u=>u.body.length===1?u.body[0]:u)),t.nextIndex++,a}function e5({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o}=r;if(e==="property"){const l=Ku(n);if(jp.has(l)&&!(o!=null&&o.has(l)))e="posix",n=l;else return Fi(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o})}return e==="posix"?u5(n,{negate:t}):Xf(e,{negate:t})}function t5(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:s,skipLookbehindValidation:o,walk:l}=t,a=d5(e),u=a.type==="AbsenceFunction",f=Vx(a),d=f&&a.negate;if(a.type==="CapturingGroup"&&(i.push(a),a.name&&C3(s,a.name,[]).push(a)),u&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=Kx(r[t.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")a.body.push(Si()),t.nextIndex++;else{const p=a.body.at(-1),m=l(p,{...n,isInAbsenceFunction:n.isInAbsenceFunction||u,isInLookbehind:n.isInLookbehind||f,isInNegLookbehind:n.isInNegLookbehind||d});if(p.body.push(m),(f||n.isInLookbehind)&&!o){const x="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(Wx(m)||m.type==="CapturingGroup")throw new Error(x)}else if(Wx(m)||Vx(m)&&m.negate)throw new Error(x)}}h=Kx(r[t.nextIndex])}return t.nextIndex++,a}function n5({kind:e,min:t,max:n},r){const i=r.parent,s=i.body.at(-1);if(!s||!Q3(s))throw new Error("Quantifier requires a repeatable token");const o=uw(e,t,n,s);return i.body.pop(),o}function r5({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(s){const l=+s.groups.num,a=n.length;if(t.hasNumberedRef=!0,i={"":l,"+":a+l,"-":a+1-l}[s.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=cw(i);return r.push(o),o}function i5(e,t){return{type:"AbsenceFunction",kind:e,body:wl(t==null?void 0:t.body)}}function Si(e){return{type:"Alternative",body:dw(e==null?void 0:e.body)}}function Qf(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!(t!=null&&t.negate)),n}function Kf(e,t){const n=!!(t!=null&&t.orphan);return{type:"Backreference",ref:e,...n&&{orphan:n}}}function aw(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!f5(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:wl(t==null?void 0:t.body)}}function Qu(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function xa(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:dw(e==null?void 0:e.body)}}function s5(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Xf(e,t){const n=!!(t!=null&&t.negate),r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function o5(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Bs(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function l5(e){return{type:"Flags",...e}}function sn(e){const t=e==null?void 0:e.atomic,n=e==null?void 0:e.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:wl(e==null?void 0:e.body)}}function Kr(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:wl(e==null?void 0:e.body)}}function a5(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function u5(e,t){const n=!!(t!=null&&t.negate);if(!jp.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function uw(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function c5(e,t){return{type:"Regex",body:wl(t==null?void 0:t.body),flags:e}}function cw(e){return{type:"Subroutine",ref:e}}function Fi(e,t){var i;const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=(i=n.unicodePropertyMap)==null?void 0:i.get(Ku(e));if(!r){if(n.normalizeUnknownPropertyNames)r=h5(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Ve`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function d5({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return i5("repeater");case"atomic":return sn({atomic:!0});case"capturing":return aw(i,{name:n});case"group":return sn({flags:e});case"lookahead":case"lookbehind":return Kr({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function wl(e){if(e===void 0)e=[Si()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function dw(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function Wx(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Vx(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function f5(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function h5(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Ku(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Qx(e,t){const n=t;return Bs(e,`Unclosed character class${(n==null?void 0:n.type)==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function Kx(e){return Bs(e,"Unclosed group")}function Po(e,t,n=null){function r(s,o){for(let l=0;l<s.length;l++){const a=i(s[l],o,l,s);l=Math.max(-1,l+a)}}function i(s,o=null,l=null,a=null){var g,y;let u=0,f=!1;const d={node:s,parent:o,key:l,container:a,root:e,remove(){Jl(a).splice(Math.max(0,Li(l)+u),1),u--,f=!0},removeAllNextSiblings(){return Jl(a).splice(Li(l)+1)},removeAllPrevSiblings(){const b=Li(l)+u;return u-=b,Jl(a).splice(0,Math.max(0,b))},replaceWith(b,w={}){const C=!!w.traverse;a?a[Math.max(0,Li(l)+u)]=b:Bs(o,"Can't replace root node")[l]=b,C&&i(b,o,l,a),f=!0},replaceWithMultiple(b,w={}){const C=!!w.traverse;if(Jl(a).splice(Math.max(0,Li(l)+u),1,...b),u+=b.length-1,C){let k=0;for(let P=0;P<b.length;P++)k+=i(b[P],o,Li(l)+P+k,a)}f=!0},skip(){f=!0}},{type:h}=s,p=t["*"],m=t[h],x=typeof p=="function"?p:p==null?void 0:p.enter,v=typeof m=="function"?m:m==null?void 0:m.enter;if(x==null||x(d,n),v==null||v(d,n),!f)switch(h){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(s.min,s,"min"),i(s.max,s,"max");break;case"Quantifier":i(s.body,s,"body");break;case"Regex":r(s.body,s),i(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${h}"`)}return(g=m==null?void 0:m.exit)==null||g.call(m,d,n),(y=p==null?void 0:p.exit)==null||y.call(p,d,n),u}return i(e),e}function Jl(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Li(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const p5=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function m5(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function g5(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const Qt=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Ip(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,l="";for(const a of e.matchAll(i)){const{0:u,groups:{$skip:f}}=a;if(!f&&(!r||r===Qt.DEFAULT==!o)){n instanceof Function?l+=n(a,{context:o?Qt.CHAR_CLASS:Qt.DEFAULT,negated:s[s.length-1]}):l+=n;continue}u[0]==="["?(o++,s.push(u[1]==="^")):u==="]"&&o&&(o--,s.pop()),l+=u}return l}function fw(e,t,n,r){Ip(e,t,n,r)}function x5(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let s=0,o;for(;o=i.exec(e);){const{0:l,groups:{$skip:a}}=o;if(!a&&(!r||r===Qt.DEFAULT==!s))return o;l==="["?s++:l==="]"&&s&&s--,i.lastIndex==o.index&&i.lastIndex++}return null}function Zl(e,t,n){return!!x5(e,t,0,n)}function y5(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,s=1,o;for(;o=n.exec(e);){const[l]=o;if(l==="[")i++;else if(i)l==="]"&&i--;else if(l==="(")s++;else if(l===")"&&(s--,!s)){r=o.index;break}}return e.slice(t,r)}const Xx=new RegExp(String.raw`(?<noncapturingStart>${p5})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function b5(e,t){const n=(t==null?void 0:t.hiddenCaptures)??[];let r=(t==null?void 0:t.captureTransfers)??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",s="(?:(?=(",o=[0],l=[];let a=0,u=0,f=NaN,d;do{d=!1;let h=0,p=0,m=!1,x;for(Xx.lastIndex=Number.isNaN(f)?0:f+s.length;x=Xx.exec(e);){const{0:v,index:g,groups:{capturingStart:y,noncapturingStart:b}}=x;if(v==="[")h++;else if(h)v==="]"&&h--;else if(v===i&&!m)f=g,m=!0;else if(m&&b)p++;else if(y)m?p++:(a++,o.push(a+u));else if(v===")"&&m){if(!p){u++;const w=a+u;if(e=`${e.slice(0,f)}${s}${e.slice(f+i.length,g)}))<$$${w}>)${e.slice(g+1)}`,d=!0,l.push(w),m5(n,w),r.size){const C=new Map;r.forEach((k,P)=>{C.set(P>=w?P+1:P,k.map(I=>I>=w?I+1:I))}),r=C}break}p--}}}while(d);return n.push(...l),e=Ip(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:p,wrappedBackrefNum:m}})=>{if(p){const x=+p;if(x>o.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${o[x]}`}return`\\${m}`},Qt.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const hw=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Xc=new RegExp(String.raw`
|
|
283
|
+
\\(?: \d+
|
|
284
|
+
| c[A-Za-z]
|
|
285
|
+
| [gk]<[^>]+>
|
|
286
|
+
| [pPu]\{[^\}]+\}
|
|
287
|
+
| u[A-Fa-f\d]{4}
|
|
288
|
+
| x[A-Fa-f\d]{2}
|
|
289
|
+
)
|
|
290
|
+
| \((?: \? (?: [:=!>]
|
|
291
|
+
| <(?:[=!]|[^>]+>)
|
|
292
|
+
| [A-Za-z\-]+:
|
|
293
|
+
| \(DEFINE\)
|
|
294
|
+
))?
|
|
295
|
+
| (?<qBase>${hw})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
296
|
+
| \\?.
|
|
297
|
+
`.replace(/\s+/g,""),"gsu");function v5(e){if(!new RegExp(`${hw}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",s=0,o;for(Xc.lastIndex=0;o=Xc.exec(e);){const{0:l,index:a,groups:{qBase:u,qMod:f,invalidQ:d}}=o;if(l==="[")s||(r=a),s++;else if(l==="]")s?s--:r=null;else if(!s)if(f==="+"&&i&&!i.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${l}"`);let h=-1;if(/^\{\d+\}$/.test(u))e=g5(e,a+u.length,f,"");else{if(i===")"||i==="]"){const p=i===")"?n:r;if(p===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,p)}(?>${e.slice(p,a)}${u})${e.slice(a+l.length)}`}else e=`${e.slice(0,a-i.length)}(?>${i}${u})${e.slice(a+l.length)}`;h+=4}Xc.lastIndex+=h}else l[0]==="("?t.push(a):l===")"&&(n=t.length?t.pop():null);i=l}return{pattern:e}}const Wt=String.raw,w5=Wt`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Yf=Wt`\(\?R=(?<rDepth>[^\)]+)\)|${w5}`,Xu=Wt`\(\?<(?![=!])(?<captureName>[^>]+)>`,pw=Wt`${Xu}|(?<unnamed>\()(?!\?)`,qr=new RegExp(Wt`${Xu}|${Yf}|\(\?|\\?.`,"gsu"),Yc="Cannot use multiple overlapping recursions";function k5(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=(t==null?void 0:t.captureTransfers)??new Map;if(!new RegExp(Yf,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&Zl(e,Wt`\(\?\(DEFINE\)`,Qt.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],o=Zl(e,Wt`\\[1-9]`,Qt.DEFAULT),l=new Map,a=[];let u=!1,f=0,d=0,h;for(qr.lastIndex=0;h=qr.exec(e);){const{0:p,groups:{captureName:m,rDepth:x,gRNameOrNum:v,gRDepth:g}}=h;if(p==="[")f++;else if(f)p==="]"&&f--;else if(x){if(Yx(x),u)throw new Error(Yc);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const y=e.slice(0,h.index),b=e.slice(qr.lastIndex);if(Zl(b,Yf,Qt.DEFAULT))throw new Error(Yc);const w=+x-1;e=Jx(y,b,w,!1,n,s,d),i=ey(i,y,w,s.length,0,d);break}else if(v){Yx(g);let y=!1;for(const L of a)if(L.name===v||L.num===+v){if(y=!0,L.hasRecursedWithin)throw new Error(Yc);break}if(!y)throw new Error(Wt`Recursive \g cannot be used outside the referenced group "${r==="external"?v:Wt`\g<${v}&R=${g}>`}"`);const b=l.get(v),w=y5(e,b);if(o&&Zl(w,Wt`${Xu}|\((?!\?)`,Qt.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const C=e.slice(b,h.index),k=w.slice(C.length+p.length),P=s.length,I=+g-1,A=Jx(C,k,I,!0,n,s,d);i=ey(i,C,I,s.length-P,P,d);const N=e.slice(0,b),R=e.slice(b+w.length);e=`${N}${A}${R}`,qr.lastIndex+=A.length-p.length-C.length-k.length,a.forEach(L=>L.hasRecursedWithin=!0),u=!0}else if(m)d++,l.set(String(d),qr.lastIndex),l.set(m,qr.lastIndex),a.push({num:d,name:m});else if(p[0]==="("){const y=p==="(";y&&(d++,l.set(String(d),qr.lastIndex)),a.push(y?{num:d}:{})}else p===")"&&a.pop()}return n.push(...s),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Yx(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function Jx(e,t,n,r,i,s,o){const l=new Set;r&&fw(e+t,Xu,({groups:{captureName:u}})=>{l.add(u)},Qt.DEFAULT);const a=[n,r?l:null,i,s,o];return`${e}${Zx(`(?:${e}`,"forward",...a)}(?:)${Zx(`${t})`,"backward",...a)}${t}`}function Zx(e,t,n,r,i,s,o){const a=f=>t==="forward"?f+2:n-f+2-1;let u="";for(let f=0;f<n;f++){const d=a(f);u+=Ip(e,Wt`${pw}|\\k<(?<backref>[^>]+)>`,({0:h,groups:{captureName:p,unnamed:m,backref:x}})=>{if(x&&r&&!r.has(x))return h;const v=`_$${d}`;if(m||p){const g=o+s.length+1;return s.push(g),S5(i,g),m?h:`(?<${p}${v}>`}return Wt`\k<${x}${v}>`},Qt.DEFAULT)}return u}function S5(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function ey(e,t,n,r,i,s){if(e.size&&r){let o=0;fw(t,pw,()=>o++,Qt.DEFAULT);const l=s-o+i,a=new Map;return e.forEach((u,f)=>{const d=(r-o*n)/n,h=o*n,p=f>l+o?f+r:f,m=[];for(const x of u)if(x<=l)m.push(x);else if(x>l+o+d)m.push(x+r);else if(x<=l+o)for(let v=0;v<=n;v++)m.push(x+o*v);else for(let v=0;v<=n;v++)m.push(x+h+d*v);a.set(p,m)}),a}return e}var Fe=String.fromCodePoint,ee=String.raw,un={},Yu=globalThis.RegExp;un.flagGroups=(()=>{try{new Yu("(?i:)")}catch{return!1}return!0})();un.unicodeSets=(()=>{try{new Yu("[[]]","v")}catch{return!1}return!0})();un.bugFlagVLiteralHyphenIsRange=un.unicodeSets?(()=>{try{new Yu(ee`[\d\-a]`,"v")}catch{return!0}return!1})():!1;un.bugNestedClassIgnoresNegation=un.unicodeSets&&new Yu("[[^a]]","v").test("a");function au(e,{enable:t,disable:n}){return{dotAll:!(n!=null&&n.dotAll)&&!!(t!=null&&t.dotAll||e.dotAll),ignoreCase:!(n!=null&&n.ignoreCase)&&!!(t!=null&&t.ignoreCase||e.ignoreCase)}}function nl(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Jf(e,t){return ty[e]>=ty[t]}function C5(e,t){if(e==null)throw new Error(t??"Value expected");return e}var ty={ES2025:2025,ES2024:2024,ES2018:2018},_5={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function mw(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!_5[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=un.flagGroups?"ES2025":un.unicodeSets?"ES2024":"ES2018"),t}var E5="[ -\r ]",N5=new Set([Fe(304),Fe(305)]),Nn=ee`[\p{L}\p{M}\p{N}\p{Pc}]`;function gw(e){if(N5.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=I5.get(n),s=j5.get(n),o=P5.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),s&&t.add(s),[...t]}var Tp=new Map(`C Other
|
|
298
|
+
Cc Control cntrl
|
|
299
|
+
Cf Format
|
|
300
|
+
Cn Unassigned
|
|
301
|
+
Co Private_Use
|
|
302
|
+
Cs Surrogate
|
|
303
|
+
L Letter
|
|
304
|
+
LC Cased_Letter
|
|
305
|
+
Ll Lowercase_Letter
|
|
306
|
+
Lm Modifier_Letter
|
|
307
|
+
Lo Other_Letter
|
|
308
|
+
Lt Titlecase_Letter
|
|
309
|
+
Lu Uppercase_Letter
|
|
310
|
+
M Mark Combining_Mark
|
|
311
|
+
Mc Spacing_Mark
|
|
312
|
+
Me Enclosing_Mark
|
|
313
|
+
Mn Nonspacing_Mark
|
|
314
|
+
N Number
|
|
315
|
+
Nd Decimal_Number digit
|
|
316
|
+
Nl Letter_Number
|
|
317
|
+
No Other_Number
|
|
318
|
+
P Punctuation punct
|
|
319
|
+
Pc Connector_Punctuation
|
|
320
|
+
Pd Dash_Punctuation
|
|
321
|
+
Pe Close_Punctuation
|
|
322
|
+
Pf Final_Punctuation
|
|
323
|
+
Pi Initial_Punctuation
|
|
324
|
+
Po Other_Punctuation
|
|
325
|
+
Ps Open_Punctuation
|
|
326
|
+
S Symbol
|
|
327
|
+
Sc Currency_Symbol
|
|
328
|
+
Sk Modifier_Symbol
|
|
329
|
+
Sm Math_Symbol
|
|
330
|
+
So Other_Symbol
|
|
331
|
+
Z Separator
|
|
332
|
+
Zl Line_Separator
|
|
333
|
+
Zp Paragraph_Separator
|
|
334
|
+
Zs Space_Separator
|
|
335
|
+
ASCII
|
|
336
|
+
ASCII_Hex_Digit AHex
|
|
337
|
+
Alphabetic Alpha
|
|
338
|
+
Any
|
|
339
|
+
Assigned
|
|
340
|
+
Bidi_Control Bidi_C
|
|
341
|
+
Bidi_Mirrored Bidi_M
|
|
342
|
+
Case_Ignorable CI
|
|
343
|
+
Cased
|
|
344
|
+
Changes_When_Casefolded CWCF
|
|
345
|
+
Changes_When_Casemapped CWCM
|
|
346
|
+
Changes_When_Lowercased CWL
|
|
347
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
348
|
+
Changes_When_Titlecased CWT
|
|
349
|
+
Changes_When_Uppercased CWU
|
|
350
|
+
Dash
|
|
351
|
+
Default_Ignorable_Code_Point DI
|
|
352
|
+
Deprecated Dep
|
|
353
|
+
Diacritic Dia
|
|
354
|
+
Emoji
|
|
355
|
+
Emoji_Component EComp
|
|
356
|
+
Emoji_Modifier EMod
|
|
357
|
+
Emoji_Modifier_Base EBase
|
|
358
|
+
Emoji_Presentation EPres
|
|
359
|
+
Extended_Pictographic ExtPict
|
|
360
|
+
Extender Ext
|
|
361
|
+
Grapheme_Base Gr_Base
|
|
362
|
+
Grapheme_Extend Gr_Ext
|
|
363
|
+
Hex_Digit Hex
|
|
364
|
+
IDS_Binary_Operator IDSB
|
|
365
|
+
IDS_Trinary_Operator IDST
|
|
366
|
+
ID_Continue IDC
|
|
367
|
+
ID_Start IDS
|
|
368
|
+
Ideographic Ideo
|
|
369
|
+
Join_Control Join_C
|
|
370
|
+
Logical_Order_Exception LOE
|
|
371
|
+
Lowercase Lower
|
|
372
|
+
Math
|
|
373
|
+
Noncharacter_Code_Point NChar
|
|
374
|
+
Pattern_Syntax Pat_Syn
|
|
375
|
+
Pattern_White_Space Pat_WS
|
|
376
|
+
Quotation_Mark QMark
|
|
377
|
+
Radical
|
|
378
|
+
Regional_Indicator RI
|
|
379
|
+
Sentence_Terminal STerm
|
|
380
|
+
Soft_Dotted SD
|
|
381
|
+
Terminal_Punctuation Term
|
|
382
|
+
Unified_Ideograph UIdeo
|
|
383
|
+
Uppercase Upper
|
|
384
|
+
Variation_Selector VS
|
|
385
|
+
White_Space space
|
|
386
|
+
XID_Continue XIDC
|
|
387
|
+
XID_Start XIDS`.split(/\s/).map(e=>[Ku(e),e])),j5=new Map([["s",Fe(383)],[Fe(383),"s"]]),P5=new Map([[Fe(223),Fe(7838)],[Fe(107),Fe(8490)],[Fe(229),Fe(8491)],[Fe(969),Fe(8486)]]),I5=new Map([sr(453),sr(456),sr(459),sr(498),...Jc(8072,8079),...Jc(8088,8095),...Jc(8104,8111),sr(8124),sr(8140),sr(8188)]),T5=new Map([["alnum",ee`[\p{Alpha}\p{Nd}]`],["alpha",ee`\p{Alpha}`],["ascii",ee`\p{ASCII}`],["blank",ee`[\p{Zs}\t]`],["cntrl",ee`\p{Cc}`],["digit",ee`\p{Nd}`],["graph",ee`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",ee`\p{Lower}`],["print",ee`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",ee`[\p{P}\p{S}]`],["space",ee`\p{space}`],["upper",ee`\p{Upper}`],["word",ee`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",ee`\p{AHex}`]]);function A5(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function sr(e){const t=Fe(e);return[t.toLowerCase(),t]}function Jc(e,t){return A5(e,t).map(n=>sr(n))}var xw=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function R5(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};yw(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Jf(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Po(e,L5,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Po(e,M5,s);const o={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return Po(e,O5,o),e._originMap=s.groupOriginByCopy,e._strategy=r.strategy,e}var L5={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const s=sn();s.body[0].body.push(Kr({negate:!0,body:r}),Fi("Any"));const o=sn();o.body[0].body.push(uw("greedy",0,1/0,s)),n(Ae(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(s=>s.kind==="flags");for(let s=n+1;s<t.body.length;s++){const o=t.body[s];nl(r,o,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){var n;if((n=t.get(e))!=null&&n.length){const r=vw(t.get(e));if(r){const i=sn({flags:r});i.body[0].body=e.body,e.body=[Ae(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:s,replaceWith:o},l){const{kind:a,negate:u}=e,{asciiWordBoundaries:f,avoidSubclass:d,supportedGNodes:h,wordIsAscii:p}=l;if(a==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${u?"Y":"y"}"`);if(a==="line_end")o(Ae(Kr({body:[Si({body:[Qf("string_end")]}),Si({body:[Qu(10)]})]}),t));else if(a==="line_start")o(Ae(jn(ee`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(a==="search_start")if(h.has(e))i.flags.sticky=!0,s();else{const m=r[n-1];if(m&&U5(m))o(Ae(Kr({negate:!0}),t));else{if(d)throw new Error(ee`Uses "\G" in a way that requires a subclass`);o(or(Qf("string_start"),t)),l.strategy="clip_search"}}else if(!(a==="string_end"||a==="string_start"))if(a==="string_end_newline")o(Ae(jn(ee`(?=\n?\z)`),t));else if(a==="word_boundary"){if(!p&&!f){const m=`(?:(?<=${Nn})(?!${Nn})|(?<!${Nn})(?=${Nn}))`,x=`(?:(?<=${Nn})(?=${Nn})|(?<!${Nn})(?!${Nn}))`;o(Ae(jn(u?x:m),t))}}else throw new Error(`Unexpected assertion kind "${a}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!ed(n)&&(n=Zc(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!ed(r)&&(r=Zc(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=xa({body:[e]});n(Ae(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:s,spaceIsAscii:o,wordIsAscii:l}){const{kind:a,negate:u,value:f}=e;if(s&&(a==="digit"||f==="digit")){n(or(Xf("digit",{negate:u}),t));return}if(o&&(a==="space"||f==="space")){n(Ae(td(jn(E5),u),t));return}if(l&&(a==="word"||f==="word")){n(or(Xf("word",{negate:u}),t));return}if(a==="any")n(or(Fi("Any"),t));else if(a==="digit")n(or(Fi("Nd",{negate:u}),t));else if(a!=="dot")if(a==="text_segment"){if(r==="strict")throw new Error(ee`Use of "\X" requires non-strict accuracy`);const d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=ee`\p{RI}{2}|${d}(?:\u200D${d})*`;n(Ae(jn(ee`(?>\r\n|${i?ee`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(a==="hex")n(or(Fi("AHex",{negate:u}),t));else if(a==="newline")n(Ae(jn(u?`[^
|
|
388
|
+
]`:`(?>\r
|
|
389
|
+
?|[
|
|
390
|
+
\v\f
\u2028\u2029])`),t));else if(a==="posix")if(!i&&(f==="graph"||f==="print")){if(r==="strict")throw new Error(`POSIX class "${f}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[f];u&&(d=`\0-${Fe(d.codePointAt(0)-1)}${Fe(d.codePointAt(2)+1)}-`),n(Ae(jn(`[${d}]`),t))}else n(Ae(td(jn(T5.get(f)),u),t));else if(a==="property")Tp.has(Ku(f))||(e.key="sc");else if(a==="space")n(or(Fi("space",{negate:u}),t));else if(a==="word")n(Ae(td(jn(Nn),u),t));else throw new Error(`Unexpected character set kind "${a}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:l,flags:a}=e;if(l==="flags")if(!a.enable&&!a.disable)r();else{const u=sn({flags:a});u.body[0].body=o(),i(Ae(u,t),{traverse:!0})}else if(l==="keep"){const u=n.body[0],d=n.body.length===1&&ow(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:n;if(t.parent!==d||d.body.length>1)throw new Error(ee`Uses "\K" in a way that's unsupported`);const h=Kr({behind:!0});h.body[0].body=s(),i(Ae(h,t))}else throw new Error(`Unexpected directive kind "${l}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t!=null&&t.extended&&delete t.extended,n!=null&&n.extended&&delete n.extended,t!=null&&t.dotAll&&(n!=null&&n.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(n!=null&&n.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(Ae(Kr({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=sn();t.body[0].body.push(e.body),e.body=Ae(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=kw(s.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):i=!0}r&&!i&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(ee`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!ed(n)&&(n=Zc(n,t),e.ref=n)}},M5={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:l,reffedNodesByReferencer:a}){const u=i.get(e);if(u&&l.has(e.number)){const d=or(ny(e.number),t);a.set(d,l.get(e.number)),n(d);return}l.set(e.number,e),o.set(e.number,[]),e.name&&nl(o,e.name,[]);const f=o.get(e.name??e.number);for(let d=0;d<f.length;d++){const h=f[d];if(u===h.node||u&&u===h.origin||e===h.origin){f.splice(d,1);break}}if(o.get(e.number).push({node:e,origin:u}),e.name&&o.get(e.name).push({node:e,origin:u}),e.name){const d=nl(s,e.name,new Map);let h=!1;if(u)h=!0;else for(const p of d.values())if(!p.hasDuplicateNameToRemove){h=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:h})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=au(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:i,ref:s}=e;if(i){let f=t;for(;(f=f.parent)&&!(f.type==="CapturingGroup"&&(f.name===s||f.number===s)););r.reffedNodesByReferencer.set(e,f);return}const o=r.subroutineRefMap.get(s),l=s===0,a=l?ny(0):bw(o,r.groupOriginByCopy,null);let u=a;if(!l){const f=vw(F5(o,h=>h.type==="Group"&&!!h.flags)),d=f?au(r.globalFlags,f):r.globalFlags;D5(d,r.currentFlags)||(u=sn({flags:z5(d)}),u.body[0].body.push(a))}n(Ae(u,t),{traverse:!l})}},O5={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const s=r.reffedNodesByReferencer.get(e).filter(o=>$5(o,e));if(!s.length)n(Ae(Kr({negate:!0}),t));else if(s.length>1){const o=sn({atomic:!0,body:s.reverse().map(l=>Si({body:[Kf(l.number)]}))});n(Ae(o,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const i=aw();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function yw(e){Po(e,{"*"({node:t,parent:n}){t.parent=n}})}function D5(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function $5(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=ww(n.parent);for(const i of r){if(i===n)break;if(i===e||Sw(i,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function bw(e,t,n,r){const i=Array.isArray(e)?[]:{};for(const[s,o]of Object.entries(e))s==="parent"?i.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?i[s]=bw(o,t,i,n):(s==="type"&&o==="CapturingGroup"&&t.set(i,t.get(e)??e),i[s]=o);return i}function ny(e){const t=cw(e);return t.isRecursive=!0,t}function F5(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Zc(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function vw(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(i=>{var s,o;(s=r.enable)!=null&&s[i]&&(delete n.disable[i],n.enable[i]=!0),(o=r.disable)!=null&&o[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function z5({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function ww(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function kw(e){const t=e.find(n=>n.kind==="search_start"||G5(n,{negate:!1})||!B5(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const i=kw(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function Sw(e,t){const n=ww(e)??[];for(const r of n)if(r===t||Sw(r,t))return!0;return!1}function B5({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function U5(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function G5(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&ow(e.body[0],{type:"Assertion",kind:"search_start"})}function ed(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function jn(e,t){const r=lw(e,{...t,unicodePropertyMap:Tp}).body;return r.length>1||r[0].body.length>1?sn({body:r}):r[0].body[0]}function td(e,t){return e.negate=t,e}function or(e,t){return e.parent=t,e}function Ae(e,t){return yw(e),e.parent=t,e}function H5(e,t){const n=mw(t),r=Jf(n.target,"ES2024"),i=Jf(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,l=null;if(!i){const p=[e.flags.ignoreCase];Po(e,q5,{getCurrentModI:()=>p.at(-1),popModI(){p.pop()},pushModI(m){p.push(m)},setHasCasedChar(){p.at(-1)?o=!0:l=!0}})}const a={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!l)};let u=e;const f={accuracy:n.accuracy,appliedGlobalFlags:a,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&o&&l),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(p){return f.lastNode=u,u=p,C5(W5[p.type],`Unexpected node type "${p.type}"`)(p,f,d)}const h={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return r||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],f.captureMap.forEach((p,m)=>{p.hidden&&h._hiddenCaptures.push(m),p.transferTo&&nl(h._captureTransfers,p.transferTo,[]).push(m)}),h}var q5={"*":{enter({node:e},t){if(iy(e)){const n=t.getCurrentModI();t.pushModI(e.flags?au({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){iy(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Ap(Fe(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Cw(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&xw.has(e.value)&&t.setHasCasedChar()}},W5={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?ee`\B`:ee`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:i,number:s}=e,o={ignoreCase:t.currentFlags.ignoreCase},l=t.originMap.get(e);return l&&(o.hidden=!0,s>l.number&&(o.transferTo=l.number)),t.captureMap.set(s,o),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=Fe(e),r=Mi(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Ap(n)){const i=gw(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:s}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");un.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(sy)&&(o=[Qu(45),...o.filter(u=>!sy(u))]);const l=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||un.bugNestedClassIgnoresNegation)&&!i){const f=o.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(f.length){const d=sn(),h=d.body[0];return d.parent=s,h.parent=d,o=o.filter(p=>!f.includes(p)),e.body=o,o.length?(e.parent=h,h.body.push(e)):d.body.pop(),f.forEach(p=>{const m=Si({body:[p]});p.parent=m,m.parent=d,d.body.push(m)}),n(d)}}t.inCharClass=!0;const u=l();return t.inCharClass=!1,u}const a=o[0];if(r==="union"&&!i&&a&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(un.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&o.length===1&&a.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return l()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=Mi(n,i),o=Mi(r,i),l=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const a=Cw(e);Y5(a).forEach(f=>{l.add(Array.isArray(f)?`${Mi(f[0],i)}-${Mi(f[1],i)}`:Mi(f,i))})}return`${s}-${o}${[...l].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":ee`[^\n]`;if(e==="digit")return t?ee`\D`:ee`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&xw.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?ee`\P`:ee`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?ee`\W`:ee`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},i,s){const o=i.currentFlags;n&&(i.currentFlags=au(o,n));const l=t.map(s).join("|"),a=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?l:`(?${J5(e,n,i.useFlagMods)}${l})`;return i.currentFlags=o,a},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+Z5(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:ee`\g<${t}&R=${r}>`}},V5=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Q5=new Set(["-","\\","]","^","["]),K5=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),ry=new Map([[9,ee`\t`],[10,ee`\n`],[11,ee`\v`],[12,ee`\f`],[13,ee`\r`],[8232,ee`\u2028`],[8233,ee`\u2029`],[65279,ee`\uFEFF`]]),X5=new RegExp("^\\p{Cased}$","u");function Ap(e){return X5.test(e)}function Cw(e,t){const n=!!(t!=null&&t.firstOnly),r=e.min.value,i=e.max.value,s=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return s;for(let o=r;o<=i;o++){const l=Fe(o);if(!Ap(l))continue;const a=gw(l).filter(u=>{const f=u.codePointAt(0);return f<r||f>i});if(a.length&&(s.push(...a),n))break}return s}function Mi(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(ry.has(e))return ry.get(e);if(e<32||e>126&&e<160||e>262143||t&&eM(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?K5:Q5:V5,s=Fe(e);return(i.has(s)?"\\":"")+s}function Y5(e){const t=e.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),n=[];let r=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?r??(r=t[i]):r===null?n.push(t[i]):(n.push([r,t[i]]),r=null);return n}function J5(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:i,disable:s}=t;r=(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")+(s?"-":"")+(s!=null&&s.ignoreCase?"i":"")+(s!=null&&s.dotAll?"s":"")}return`${r}:`}function Z5({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function iy({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function eM(e){return e>47&&e<58}function sy({type:e,value:t}){return e==="Character"&&t===45}var kr,On,di,Sr,fi,cl,Zf,Or,tM=(Or=class extends RegExp{constructor(n,r,i){var t=(...kD)=>(super(...kD),H(this,cl),H(this,kr,new Map),H(this,On,null),H(this,di),H(this,Sr,null),H(this,fi,null),T(this,"rawOptions",{}),this);const s=!!(i!=null&&i.lazyCompile);if(n instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const o=n;t(o,r),F(this,di,o.source),o instanceof Or&&(F(this,kr,E(o,kr)),F(this,Sr,E(o,Sr)),F(this,fi,E(o,fi)),this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...i};t(s?"":n,r),F(this,di,n),F(this,kr,rM(o.hiddenCaptures,o.transfers)),F(this,fi,o.strategy),this.rawOptions=i??{}}s||F(this,On,this)}get source(){return E(this,di)||"(?:)"}exec(n){if(!E(this,On)){const{lazyCompile:s,...o}=this.rawOptions;F(this,On,new Or(E(this,di),this.flags,o))}const r=this.global||this.sticky,i=this.lastIndex;if(E(this,fi)==="clip_search"&&r&&i){this.lastIndex=0;const s=Z(this,cl,Zf).call(this,n.slice(i));return s&&(nM(s,i,n,this.hasIndices),this.lastIndex+=i),s}return Z(this,cl,Zf).call(this,n)}},kr=new WeakMap,On=new WeakMap,di=new WeakMap,Sr=new WeakMap,fi=new WeakMap,cl=new WeakSet,Zf=function(n){E(this,On).lastIndex=this.lastIndex;const r=Vp(Or.prototype,this,"exec").call(E(this,On),n);if(this.lastIndex=E(this,On).lastIndex,!r||!E(this,kr).size)return r;const i=[...r];r.length=1;let s;this.hasIndices&&(s=[...r.indices],r.indices.length=1);const o=[0];for(let l=1;l<i.length;l++){const{hidden:a,transferTo:u}=E(this,kr).get(l)??{};if(a?o.push(null):(o.push(r.length),r.push(i[l]),this.hasIndices&&r.indices.push(s[l])),u&&i[l]!==void 0){const f=o[u];if(!f)throw new Error(`Invalid capture transfer to "${f}"`);if(r[f]=i[l],this.hasIndices&&(r.indices[f]=s[l]),r.groups){E(this,Sr)||F(this,Sr,iM(this.source));const d=E(this,Sr).get(u);d&&(r.groups[d]=i[l],this.hasIndices&&(r.indices.groups[d]=s[l]))}}}return r},Or);function nM(e,t,n,r){if(e.index+=t,e.input=n,r){const i=e.indices;for(let o=0;o<i.length;o++){const l=i[o];l&&(i[o]=[l[0]+t,l[1]+t])}const s=i.groups;s&&Object.keys(s).forEach(o=>{const l=s[o];l&&(s[o]=[l[0]+t,l[1]+t])})}}function rM(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const s of i)nl(n,s,{}).transferTo=r;return n}function iM(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,s;for(;s=t.exec(e);){const{0:o,groups:{capture:l,name:a}}=s;o==="["?r++:r?o==="]"&&r--:l&&(i++,a&&n.set(i,a))}return n}function sM(e,t){const n=oM(e,t);return n.options?new tM(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function oM(e,t){const n=mw(t),r=lw(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Tp}),i=R5(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=H5(i,n),o=k5(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),l=v5(o.pattern),a=b5(l.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),u={pattern:a.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const f=a.hiddenCaptures.sort((m,x)=>m-x),d=Array.from(a.captureTransfers),h=i._strategy,p=u.pattern.length>=n.lazyCompileLength;(f.length||d.length||h||p)&&(u.options={...f.length&&{hiddenCaptures:f},...d.length&&{transfers:d},...h&&{strategy:h},...p&&{lazyCompile:p}})}return u}function lM(e,t){return sM(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function aM(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||(t.regexConstructor=n=>lM(n,{target:t.target})),{createScanner(n){return new S3(n,t)},createString(n){return{content:n}}}}const uM=1500,_w={typescript:()=>Y(()=>import("./typescript-BPQ3VLAy.js"),[]),tsx:()=>Y(()=>import("./tsx-COt5Ahok.js"),[]),javascript:()=>Y(()=>import("./javascript-wDzz0qaB.js"),[]),jsx:()=>Y(()=>import("./jsx-g9-lgVsj.js"),[]),json:()=>Y(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>Y(()=>import("./jsonc-Des-eS-w.js"),[]),yaml:()=>Y(()=>import("./yaml-Buea-lGh.js"),[]),toml:()=>Y(()=>import("./toml-vGWfd6FD.js"),[]),markdown:()=>Y(()=>import("./markdown-Cvjx9yec.js"),[]),mdx:()=>Y(()=>import("./mdx-Cmh6b_Ma.js"),[]),html:()=>Y(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2])),css:()=>Y(()=>import("./css-CLj8gQPS.js"),[]),scss:()=>Y(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([3,2])),less:()=>Y(()=>import("./less-B1dDrJ26.js"),[]),python:()=>Y(()=>import("./python-B6aJPvgy.js"),[]),ruby:()=>Y(()=>import("./ruby-CV7NnX5q.js"),__vite__mapDeps([4,0,1,2,5,6,7,8,9,10,11,12,13,14,15,16])),go:()=>Y(()=>import("./go-C27-OAKa.js"),[]),rust:()=>Y(()=>import("./rust-B1yitclQ.js"),[]),java:()=>Y(()=>import("./java-CylS5w8V.js"),[]),kotlin:()=>Y(()=>import("./kotlin-BdnUsdx6.js"),[]),swift:()=>Y(()=>import("./swift-D82vCrfD.js"),[]),csharp:()=>Y(()=>import("./csharp-DSvCPggb.js"),[]),c:()=>Y(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>Y(()=>import("./cpp-DIPi6g--.js"),__vite__mapDeps([12,13,7])),"objective-c":()=>Y(()=>import("./objective-c-DXmwc3jG.js"),[]),php:()=>Y(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([17,0,1,2,5,6,7,18])),shellscript:()=>Y(()=>import("./shellscript-Yzrsuije.js"),[]),sql:()=>Y(()=>import("./sql-CRqJ_cUM.js"),[]),dockerfile:()=>Y(()=>import("./dockerfile-BcOcwvcX.js"),[]),xml:()=>Y(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([5,6])),vue:()=>Y(()=>import("./vue-DMJtu8ND.js"),__vite__mapDeps([19,2,1,9,18,0])),svelte:()=>Y(()=>import("./svelte-DR4MIrkg.js"),__vite__mapDeps([20,1,9,2])),graphql:()=>Y(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([8,1,9,10,11])),diff:()=>Y(()=>import("./diff-D97Zzqfu.js"),[]),ini:()=>Y(()=>import("./ini-BEwlwnbL.js"),[]),make:()=>Y(()=>import("./make-CHLpvVh8.js"),[]),lua:()=>Y(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([15,13])),r:()=>Y(()=>import("./r-Dspwwk_N.js"),[]),scala:()=>Y(()=>import("./scala-C151Ov-r.js"),[]),dart:()=>Y(()=>import("./dart-bE4Kk8sk.js"),[]),elixir:()=>Y(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([21,0,1,2])),haskell:()=>Y(()=>import("./haskell-Df6bDoY_.js"),[])},cM={ts:"typescript",js:"javascript",py:"python",rb:"ruby",rs:"rust",kt:"kotlin","c++":"cpp",cs:"csharp",objc:"objective-c",sh:"shellscript",shell:"shellscript",bash:"shellscript",zsh:"shellscript",fish:"shellscript",yml:"yaml",md:"markdown"};function dM(e){if(!e)return null;const t=e.toLowerCase().trim();return t?t in _w?t:cM[t]??null:null}let nd=null;const oy=new Set,rd=new Map;async function Ew(){return nd||(nd=(async()=>{const[e,t]=await Promise.all([Y(()=>import("./github-light-DAi9KRSo.js"),[]),Y(()=>import("./github-dark-DHJKELXO.js"),[])]);return k3({themes:[e.default,t.default],langs:[],engine:aM()})})()),nd}async function fM(e){if(oy.has(e))return;const t=rd.get(e);if(t)return t;const n=_w[e];if(!n)return;const r=(async()=>{try{const i=await Ew(),s=await n();await i.loadLanguage(s),oy.add(e)}finally{rd.delete(e)}})();return rd.set(e,r),r}async function hM(e,t,n){const r=dM(t);if(!r||e.length===0)return null;let i=0;for(let o=0;o<e.length;o++)e.charCodeAt(o)===10&&i++;return i+1>uM?null:(await fM(r),(await Ew()).codeToHtml(e,{lang:r,themes:{light:"github-light",dark:"github-dark"},defaultColor:!1,transformers:n==null?void 0:n.transformers}))}function Ju({code:e,lang:t,wrap:n=!1,tone:r="default",transformers:i,className:s,defer:o=!1,diffRoles:l}){const[a,u]=j.useState(null),f=j.useMemo(()=>l?[pM(l),...i??[]]:i,[l,i]);j.useEffect(()=>{let m=!1;if(u(null),!o)return hM(e,t,{transformers:f}).then(x=>{m||u(x)}).catch(x=>{}),()=>{m=!0}},[e,t,f,o]);const d=n?"whitespace-pre-wrap break-words":"whitespace-pre",h=r==="muted"?"text-muted-foreground":"text-foreground",p="font-mono text-[12px] leading-relaxed";if(a===null){if(l){const m=e.length===0?[""]:e.split(`
|
|
391
|
+
`);return c.jsx("pre",{className:B("diff-unified overflow-auto",p,d,h,s),children:m.map((x,v)=>{const g=l[v]??"context",y=g==="add"?"+":g==="del"?"−":" ";return c.jsxs("div",{className:B("flex",Nw(g)),children:[c.jsx("span",{className:"diff-marker-cell",children:y}),c.jsx("span",{className:"flex-1 pr-2",children:x||" "})]},v)})})}return c.jsx("pre",{className:B("overflow-auto",p,d,h,s),children:e})}return c.jsx("div",{className:B("shiki-mount overflow-auto",p,n&&"shiki-wrap",h,l&&"diff-unified",s),dangerouslySetInnerHTML:{__html:a}})}function Nw(e){return e==="add"?"diff-line-add":e==="del"?"diff-line-del":void 0}function pM(e){return{name:"pi-pilot-unified-diff",line(t,n){const r=e[n-1]??"context",i=r==="add"?"+":r==="del"?"−":" ";t.children.unshift({type:"element",tagName:"span",properties:{class:"diff-marker-cell"},children:[{type:"text",value:i}]});const s=Nw(r);if(s){const o=t.properties??(t.properties={}),l=typeof o.class=="string"?o.class:Array.isArray(o.class)?o.class.join(" "):"";o.class=l?`${l} ${s}`:s}}}}const jw=j.createContext(!1);function uu({text:e,streaming:t,className:n}){return c.jsxs("div",{className:B("font-sans text-[14px] leading-[1.5] tracking-[-0.005em] text-foreground","[&>p:last-child]:inline","[overflow-wrap:anywhere]",n),children:[c.jsx(jw.Provider,{value:t??!1,children:c.jsx(_I,{remarkPlugins:[FA],components:mM,children:e})}),t&&c.jsx("span",{className:"ml-1 inline-block h-[14px] w-[7px] translate-y-[2px] rounded-[1px] bg-brand align-baseline",style:{animation:"v2-blink 1s steps(2) infinite"},"aria-hidden":!0})]})}const mM={h1:({children:e})=>c.jsx("h1",{className:"mb-2 mt-5 text-[18px] font-medium tracking-[-0.015em] text-foreground first:mt-0",children:e}),h2:({children:e})=>c.jsx("h2",{className:"mb-2 mt-4 text-[16px] font-medium tracking-[-0.01em] text-foreground first:mt-0",children:e}),h3:({children:e})=>c.jsx("h3",{className:"mb-1.5 mt-3 text-[14.5px] font-medium tracking-[-0.005em] text-foreground first:mt-0",children:e}),h4:({children:e})=>c.jsx("h4",{className:"mb-1.5 mt-3 text-[13.5px] font-medium text-foreground first:mt-0",children:e}),h5:({children:e})=>c.jsx("h5",{className:"mb-1 mt-3 text-[13px] font-medium text-foreground first:mt-0",children:e}),h6:({children:e})=>c.jsx("h6",{className:"mb-1 mt-3 text-[12.5px] font-medium uppercase tracking-[0.04em] text-muted-foreground first:mt-0",children:e}),strong:({children:e})=>c.jsx("strong",{className:"font-medium text-foreground",children:e}),em:({children:e})=>c.jsx("em",{className:"italic text-foreground",children:e}),p:({children:e})=>c.jsx("p",{className:"my-2 first:mt-0 last:mb-0",children:e}),a:({href:e,children:t})=>c.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-brand underline underline-offset-2 transition-colors hover:text-brand-strong",children:t}),hr:()=>c.jsx("hr",{className:"my-3 border-t border-border-soft"}),ul:({children:e})=>c.jsx("ul",{className:"my-2 flex list-none flex-col gap-[3px] pl-5",children:e}),ol:({children:e,start:t})=>c.jsx("ol",{className:"my-2 flex list-decimal flex-col gap-[3px] pl-6 marker:font-mono marker:text-[12px] marker:text-muted-foreground",start:t??void 0,children:e}),li:({children:e,...t})=>{const n=typeof t.className=="string"&&t.className.includes("task-list-item");return c.jsx("li",{className:B("relative",!n&&"pl-3 before:absolute before:left-0 before:top-0 before:text-muted-foreground before:content-['·']"),children:e})},blockquote:({children:e})=>c.jsx("blockquote",{className:"my-2 border-l-2 border-brand/[0.30] pl-3 text-muted-foreground",children:e}),table:({children:e})=>c.jsx("div",{className:"my-3 overflow-x-auto rounded-md border border-border-soft",children:c.jsx("table",{className:"w-full border-collapse text-[12.5px]",children:e})}),thead:({children:e})=>c.jsx("thead",{className:"border-b border-border-soft bg-muted",children:e}),tbody:({children:e})=>c.jsx("tbody",{children:e}),tr:({children:e})=>c.jsx("tr",{className:"border-b border-border-soft/60 last:border-b-0",children:e}),th:({children:e,style:t})=>c.jsx("th",{style:t,className:"px-2.5 py-1.5 text-left text-[11.5px] font-medium text-muted-foreground",children:e}),td:({children:e,style:t})=>c.jsx("td",{style:t,className:"px-2.5 py-1.5 align-top text-foreground",children:e}),img:({src:e,alt:t})=>c.jsx("img",{src:e,alt:t,className:"my-2 max-w-full rounded-md border border-border-soft"}),pre:({node:e,children:t})=>{const n=gM(e);return n?c.jsx(xM,{code:n.code,lang:n.lang}):c.jsx("pre",{className:"my-3 overflow-x-auto rounded-md border border-border-soft bg-muted px-3 py-2.5 font-mono text-[12px] leading-relaxed text-foreground",children:t})},code:({className:e,children:t,...n})=>typeof e=="string"&&/\blanguage-/.test(e)?c.jsx("code",{className:e,...n,children:t}):c.jsx("code",{className:"rounded-[5px] border border-border-soft bg-muted px-1.5 py-px font-mono text-[12px] text-foreground",...n,children:t})};function gM(e){var o;if(!e||!Array.isArray(e.children))return null;const t=e.children.find(l=>l.type==="element"&&l.tagName==="code");if(!t)return null;const n=(o=t.properties)==null?void 0:o.className,r=Array.isArray(n)?n.find(l=>typeof l=="string"&&l.startsWith("language-")):void 0,i=r?r.slice(9):void 0;let s="";for(const l of t.children||[])l.type==="text"&&typeof l.value=="string"&&(s+=l.value);return s.endsWith(`
|
|
392
|
+
`)&&(s=s.slice(0,-1)),{code:s,lang:i}}function xM({code:e,lang:t}){const n=ki(l=>l.pushToast),[r,i]=j.useState(!1),s=j.useContext(jw),o=async()=>{if(e)try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1200)}catch{n({id:`copy-${Date.now()}`,workspaceId:"",message:"Copy failed — clipboard not available",notifyType:"warning"})}};return c.jsxs("div",{className:"group/code relative my-3 overflow-hidden rounded-md border border-border-soft bg-muted",children:[c.jsx(Ju,{code:e,lang:t,className:"px-3 py-2.5",defer:s}),c.jsx("button",{type:"button",onClick:o,title:"Copy code","aria-label":"Copy code",className:"absolute right-1.5 top-1.5 rounded-md border border-border-soft bg-card p-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover/code:opacity-100 focus-visible:opacity-100",children:r?c.jsx(Ms,{className:"h-3 w-3 text-signal-ok"}):c.jsx(i1,{className:"h-3 w-3"})})]})}const id={30:"text-zinc-800 dark:text-zinc-200",31:"text-red-600 dark:text-red-400",32:"text-green-600 dark:text-green-400",33:"text-yellow-600 dark:text-yellow-400",34:"text-blue-600 dark:text-blue-400",35:"text-purple-600 dark:text-purple-400",36:"text-cyan-600 dark:text-cyan-400",37:"text-zinc-500 dark:text-zinc-400",90:"text-zinc-500 dark:text-zinc-500",91:"text-red-500 dark:text-red-300",92:"text-green-500 dark:text-green-300",93:"text-yellow-500 dark:text-yellow-300",94:"text-blue-500 dark:text-blue-300",95:"text-purple-500 dark:text-purple-300",96:"text-cyan-500 dark:text-cyan-300",97:"text-zinc-100"};function yM(e){if(e<0||e>255||e<16)return;if(e<232){const n=e-16,r=Math.floor(n/36),i=Math.floor(n%36/6),s=n%6,o=[0,95,135,175,215,255];return`rgb(${o[r]},${o[i]},${o[s]})`}const t=8+(e-232)*10;return`rgb(${t},${t},${t})`}function bM(e,t){const n={...e};for(let r=0;r<t.length;r++){const i=t[r];switch(i){case 0:n.fgClass=void 0,n.fgStyle=void 0,n.bold=!1,n.dim=!1,n.italic=!1,n.underline=!1;break;case 1:n.bold=!0;break;case 2:n.dim=!0;break;case 3:n.italic=!0;break;case 4:n.underline=!0;break;case 22:n.bold=!1,n.dim=!1;break;case 23:n.italic=!1;break;case 24:n.underline=!1;break;case 39:n.fgClass=void 0,n.fgStyle=void 0;break;case 38:{const s=t[r+1];if(s===5){const o=t[r+2];if(typeof o=="number"){const l=yM(o);if(l)n.fgStyle=l,n.fgClass=void 0;else if(o<16){const a=o<8?30+o:90+(o-8);n.fgClass=id[a],n.fgStyle=void 0}}r+=2}else if(s===2){const o=t[r+2],l=t[r+3],a=t[r+4];typeof o=="number"&&typeof l=="number"&&typeof a=="number"&&(n.fgStyle=`rgb(${o},${l},${a})`,n.fgClass=void 0),r+=4}break}default:id[i]&&(n.fgClass=id[i],n.fgStyle=void 0)}}return n}const ly=/\x1b(?:\[([0-9;]*)([a-zA-Z])|\][^\x07\x1b]*(?:\x07|\x1b\\))/g;function vM(e){return e.includes("\r")?e.split(`
|
|
393
|
+
`).map(t=>{if(!t.includes("\r"))return t;const n=t.split("\r");return n[n.length-1]??""}).join(`
|
|
394
|
+
`):e}function rl(e){const t=vM(e),n=[];let r={},i=0,s=0;const o=a=>{if(!a)return;if(!wM(r)){n.push(a);return}const u=kM(r),f=SM(r);n.push(c.jsx("span",{className:u||void 0,style:f,children:a},s++))};ly.lastIndex=0;let l;for(;(l=ly.exec(t))!==null;){const a=l.index;if(a>i&&o(t.slice(i,a)),l[2]==="m"){const u=l[1]?l[1].split(";").map(f=>f===""?0:Number(f)):[0];r=bM(r,u)}i=a+l[0].length}return i<t.length&&o(t.slice(i)),n}function wM(e){return!!(e.fgClass||e.fgStyle||e.bold||e.dim||e.italic||e.underline)}function kM(e){const t=[];return e.fgClass&&t.push(e.fgClass),e.bold&&t.push("font-bold"),e.dim&&t.push("opacity-60"),e.italic&&t.push("italic"),e.underline&&t.push("underline"),t.join(" ")}function SM(e){return e.fgStyle?{color:e.fgStyle}:void 0}function CM(e){if(!e||typeof e!="object")return null;const t=e;if(t.kind==="option"){const n=Array.isArray(t.indices)?t.indices.filter(o=>typeof o=="number"):void 0,r=Array.isArray(t.labels)?t.labels.filter(o=>typeof o=="string"):void 0,i=n&&n.length>0,s=r&&r.length>0;return!i&&!s?null:{kind:"option",indices:n,labels:r}}return t.kind==="other"&&typeof t.text=="string"?{kind:"other",text:t.text}:t.kind==="skip"?{kind:"skip"}:t.kind==="timeout"?{kind:"timeout"}:null}function _M(e){if(e.startsWith("User selected:")){const t=[],n=/"([^"]+)"/g;let r;for(;(r=n.exec(e))!==null;)t.push(r[1]);return t.length>0?{kind:"option",labels:t}:{kind:"unknown"}}if(e.startsWith("User answered (freeform):")){const t=e.match(/"([\s\S]*)"\s*$/);return{kind:"other",text:t?t[1]:""}}return e.startsWith("User chose to skip")?{kind:"skip"}:e.startsWith("No answer within")?{kind:"timeout"}:{kind:"unknown"}}function EM(e){if(!e)return null;const t=typeof e.question=="string"?e.question:null;if(!t)return null;const n=Array.isArray(e.options)?e.options:[],r=[];for(const i of n){if(!i||typeof i!="object")continue;const s=i;typeof s.label=="string"&&r.push({label:s.label,description:typeof s.description=="string"?s.description:void 0})}return r.length<2?null:{question:t,header:typeof e.header=="string"?e.header:void 0,options:r,multiSelect:e.multiSelect===!0,allowOther:e.allowOther!==!1}}function NM({item:e,onSubmit:t}){const n=j.useMemo(()=>EM(e.args),[e.args]);return n?e.status==="error"?c.jsxs(cu,{children:[c.jsx(du,{header:n.header,statusPill:c.jsx(_t,{tone:"warn",children:"aborted"})}),c.jsx(Rp,{text:n.question}),c.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[12px] text-muted-foreground",children:"Question dismissed before an answer was recorded."})]}):e.status==="ok"?c.jsx(TM,{parsed:n,details:e.details,resultText:e.text}):c.jsx(jM,{parsed:n,onSubmit:t}):c.jsxs(cu,{children:[c.jsx(du,{header:void 0}),c.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[12.5px] text-muted-foreground",children:e.text||"ask_user: malformed arguments"})]})}function jM({parsed:e,onSubmit:t}){const[n,r]=j.useState(new Set),[i,s]=j.useState(!1),[o,l]=j.useState(""),[a,u]=j.useState(!1);j.useEffect(()=>{if(!a)return;const x=setTimeout(()=>u(!1),12e3);return()=>clearTimeout(x)},[a]);const f=x=>{r(v=>{if(e.multiSelect){const g=new Set(v);return g.has(x)?g.delete(x):g.add(x),g.size>0&&s(!1),g}return s(!1),new Set([x])})},d=()=>{s(x=>{const v=!x;return v&&r(new Set),v})},h=i?o.trim().length>0:n.size>0,p=()=>{!h||a||(u(!0),t(i?{kind:"other",text:o.trim()}:{kind:"option",indices:[...n].sort((x,v)=>x-v)}))},m=()=>{a||(u(!0),t({kind:"skip"}))};return c.jsxs(cu,{children:[c.jsx(du,{header:e.header,statusPill:a?c.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground",children:[c.jsx(Et,{className:"h-3 w-3 text-brand",style:{animation:"v2-spin 1.4s linear infinite"}}),"sending"]}):c.jsx(_t,{tone:"brand",children:"awaiting"})}),c.jsx(Rp,{text:e.question}),c.jsxs("ul",{className:"flex flex-col gap-1.5 border-t border-border-soft bg-background px-3 py-2",children:[e.options.map((x,v)=>c.jsx("li",{children:c.jsx(PM,{option:x,checked:n.has(v),disabled:a,multi:e.multiSelect,onToggle:()=>f(v)})},v)),e.allowOther&&c.jsx("li",{children:c.jsx(IM,{checked:i,value:o,disabled:a,onToggle:d,onChange:l,onEnter:p})})]}),c.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border-soft bg-muted/50 px-3 py-2",children:[c.jsx("button",{type:"button",onClick:m,disabled:a,className:"rounded-md px-3 py-1 text-[12px] text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground disabled:opacity-50 ring-brand-focus",children:"Skip"}),c.jsx("button",{type:"button",onClick:p,disabled:!h||a,className:B("rounded-md px-3 py-1 text-[12px] font-medium transition-colors ring-brand-focus",h&&!a?"bg-brand text-brand-foreground hover:bg-brand/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:"Submit"})]})]})}function PM({option:e,checked:t,disabled:n,multi:r,onToggle:i}){return c.jsxs("button",{type:"button",onClick:i,disabled:n,className:B("flex w-full items-start gap-2.5 rounded-md border px-2.5 py-1.5 text-left transition-colors ring-brand-focus",t?"border-brand bg-brand/[0.08]":"border-border-soft bg-card hover:border-border hover:bg-accent/40",n&&"cursor-not-allowed opacity-60"),children:[c.jsx("span",{className:B("mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center border",r?"rounded-[3px]":"rounded-full",t?"border-brand bg-brand":"border-muted-foreground/40 bg-background"),"aria-hidden":!0,children:t&&c.jsx("span",{className:B("block bg-brand-foreground",r?"h-2 w-2 rounded-[1px]":"h-1.5 w-1.5 rounded-full")})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:B("block text-[12.5px] leading-[1.4]",t?"font-medium text-foreground":"text-foreground"),children:e.label}),e.description&&c.jsx("span",{className:"mt-0.5 block text-[11.5px] leading-[1.45] text-muted-foreground",children:e.description})]})]})}function IM({checked:e,value:t,disabled:n,onToggle:r,onChange:i,onEnter:s}){return c.jsxs("div",{className:B("flex items-start gap-2.5 rounded-md border px-2.5 py-1.5",e?"border-brand bg-brand/[0.08]":"border-border-soft bg-card",n&&"cursor-not-allowed opacity-60"),children:[c.jsx("button",{type:"button",onClick:r,disabled:n,"aria-pressed":e,"aria-label":"Other",className:B("mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border ring-brand-focus transition-colors",e?"border-brand bg-brand":"border-muted-foreground/40 bg-background"),children:e&&c.jsx("span",{className:"block h-1.5 w-1.5 rounded-full bg-brand-foreground"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block text-[12.5px] leading-[1.4] text-foreground",children:"Other"}),c.jsx("input",{type:"text",value:t,placeholder:"Type your answer",disabled:n||!e,onChange:o=>i(o.target.value),onFocus:()=>{e||r()},onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),s())},className:B("mt-1 block w-full rounded-md border border-border-soft bg-background px-2 py-1 text-[12px] text-foreground placeholder:text-muted-foreground/60 ring-brand-focus disabled:opacity-50")})]})]})}function TM({parsed:e,details:t,resultText:n}){const r=j.useMemo(()=>CM(t)??_M(n),[t,n]),i=j.useMemo(()=>{if(r.kind!=="option")return new Set;if(r.indices)return new Set(r.indices);const o=new Set;return e.options.forEach((l,a)=>{var u;(u=r.labels)!=null&&u.includes(l.label)&&o.add(a)}),o},[r,e.options]),s=r.kind==="skip"?c.jsx(_t,{tone:"warn",children:"skipped"}):r.kind==="timeout"?c.jsx(_t,{tone:"warn",children:"timed out"}):c.jsx(_t,{tone:"ok",children:"answered"});return c.jsxs(cu,{children:[c.jsx(du,{header:e.header,statusPill:s}),c.jsx(Rp,{text:e.question}),c.jsxs("ul",{className:"flex flex-col gap-1.5 border-t border-border-soft bg-background px-3 py-2",children:[e.options.map((o,l)=>{const a=i.has(l);return c.jsxs("li",{className:B("flex items-start gap-2.5 rounded-md border px-2.5 py-1.5",a?"border-brand bg-brand/[0.08]":"border-border-soft bg-card opacity-60"),children:[c.jsx("span",{className:B("mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center border",e.multiSelect?"rounded-[3px]":"rounded-full",a?"border-brand bg-brand":"border-muted-foreground/30 bg-background"),"aria-hidden":!0,children:a&&c.jsx("span",{className:B("block bg-brand-foreground",e.multiSelect?"h-2 w-2 rounded-[1px]":"h-1.5 w-1.5 rounded-full")})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:B("block text-[12.5px] leading-[1.4]",a?"font-medium text-foreground":"text-muted-foreground"),children:o.label}),o.description&&c.jsx("span",{className:"mt-0.5 block text-[11.5px] leading-[1.45] text-muted-foreground/80",children:o.description})]})]},l)}),r.kind==="other"&&c.jsxs("li",{className:B("flex items-start gap-2.5 rounded-md border border-brand bg-brand/[0.08] px-2.5 py-1.5"),children:[c.jsx("span",{className:"mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border border-brand bg-brand","aria-hidden":!0,children:c.jsx("span",{className:"block h-1.5 w-1.5 rounded-full bg-brand-foreground"})}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block text-[12.5px] font-medium leading-[1.4] text-foreground",children:"Other"}),c.jsx("span",{className:"mt-0.5 block text-[12px] leading-[1.45] text-muted-foreground [overflow-wrap:anywhere]",children:r.text||"(empty)"})]})]})]}),(r.kind==="skip"||r.kind==="timeout"||r.kind==="unknown")&&c.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[12px] text-muted-foreground",children:n})]})}function cu({children:e}){return c.jsx("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:e})}function du({header:e,statusPill:t}){return c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[c.jsx(Ni,{tool:"ask_user",className:"shrink-0 text-muted-foreground"}),c.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Ask user"}),e&&c.jsx(_t,{tone:"ghost",className:"shrink-0 max-w-[120px] truncate",children:e}),c.jsx("span",{className:"min-w-0 flex-1"}),t]})}function Rp({text:e}){return c.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[13px] leading-[1.5] text-foreground",children:e})}const AM={ts:"typescript",mts:"typescript",cts:"typescript",tsx:"tsx",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",json:"json",jsonc:"jsonc",yaml:"yaml",yml:"yaml",toml:"toml",md:"markdown",mdx:"mdx",html:"html",htm:"html",css:"css",scss:"scss",less:"less",py:"python",pyi:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",kts:"kotlin",swift:"swift",cs:"csharp",c:"c",h:"c",cc:"cpp",cpp:"cpp",cxx:"cpp",hpp:"cpp",hh:"cpp",m:"objective-c",mm:"objective-c",php:"php",sh:"shellscript",bash:"shellscript",zsh:"shellscript",fish:"shellscript",sql:"sql",xml:"xml",vue:"vue",svelte:"svelte",graphql:"graphql",gql:"graphql",diff:"diff",patch:"diff",ini:"ini",cfg:"ini",conf:"ini",lua:"lua",r:"r",scala:"scala",dart:"dart",ex:"elixir",exs:"elixir",hs:"haskell"},RM={dockerfile:"dockerfile",makefile:"make",gnumakefile:"make"};function Lp(e){if(!e)return;const t=e.lastIndexOf("/"),n=(t>=0?e.slice(t+1):e).toLowerCase();if(!n)return;const r=RM[n];if(r)return r;const i=n.lastIndexOf(".");if(i<=0)return;const s=n.slice(i+1);return AM[s]}const LM=25e4;function MM(e,t){if(e===t)return sd(e).map(d=>({role:"context",text:d}));const n=sd(e),r=sd(t);let i=0;const s=Math.min(n.length,r.length);for(;i<s&&n[i]===r[i];)i++;let o=n.length,l=r.length;for(;o>i&&l>i&&n[o-1]===r[l-1];)o--,l--;const a=[];for(let d=0;d<i;d++)a.push({role:"context",text:n[d]});const u=n.slice(i,o),f=r.slice(i,l);if(u.length*f.length>LM){for(const d of u)a.push({role:"del",text:d});for(const d of f)a.push({role:"add",text:d})}else a.push(...$M(u,f));for(let d=o;d<n.length;d++)a.push({role:"context",text:n[d]});return a}function OM(e){return{code:e.map(t=>t.text).join(`
|
|
395
|
+
`),roles:e.map(t=>t.role)}}function DM(e){let t=0,n=0;for(const r of e)r.role==="add"?t++:r.role==="del"&&n++;return{adds:t,dels:n}}function sd(e){return e===""?[]:e.split(`
|
|
396
|
+
`)}function $M(e,t){const n=e.length,r=t.length;if(n===0)return t.map(a=>({role:"add",text:a}));if(r===0)return e.map(a=>({role:"del",text:a}));const i=Array.from({length:n+1},()=>new Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let u=r-1;u>=0;u--)i[a][u]=e[a]===t[u]?i[a+1][u+1]+1:Math.max(i[a+1][u],i[a][u+1]);const s=[];let o=0,l=0;for(;o<n&&l<r;)e[o]===t[l]?(s.push({role:"context",text:e[o]}),o++,l++):i[o+1][l]>=i[o][l+1]?(s.push({role:"del",text:e[o]}),o++):(s.push({role:"add",text:t[l]}),l++);for(;o<n;)s.push({role:"del",text:e[o++]});for(;l<r;)s.push({role:"add",text:t[l++]});return s}function Pw({item:e,isCurrentPlan:t=!0}){if(e.kind==="bash")return c.jsx(ay,{command:e.command,output:e.output,exitCode:e.exitCode,running:!1});const n=VM(e.args),r=e.toolName;if(r==="edit")return c.jsx(BM,{item:e,args:n});if(r==="write")return c.jsx(UM,{item:e,args:n});if(r==="read")return c.jsx(GM,{item:e,args:n});if(r==="bash")return c.jsx(ay,{command:Rt(n==null?void 0:n.command)??"",output:e.text,exitCode:void 0,running:e.status==="running",errored:e.status==="error"});if(r==="update_plan")return c.jsx(HM,{item:e,args:n,isCurrent:t});if(r==="ask_user"){const i=s=>{at.send({type:"answer_question",toolCallId:e.toolCallId,answer:s})};return c.jsx(NM,{item:e,onSubmit:i})}return c.jsx(Iw,{item:e,args:n})}function FM({items:e}){const[t,n]=j.useState(!1),r=j.useId(),i=zM(e);return c.jsxs("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:[c.jsxs("button",{type:"button","aria-expanded":t,"aria-controls":r,onClick:()=>n(s=>!s),className:"flex w-full items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-accent/40 ring-brand-focus",children:[c.jsx(Os,{className:B("h-3 w-3 shrink-0 text-muted-foreground transition-transform",t&&"rotate-180")}),c.jsxs("span",{className:"shrink-0 text-[12.5px] font-medium text-foreground",children:[e.length," actions"]}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:i.map(s=>`${s.count} ${s.name}`).join(" · ")}),c.jsx(_t,{tone:"ghost",children:t?"open":"batched"})]}),t&&c.jsx("div",{id:r,className:"flex flex-col gap-2 border-t border-border-soft bg-card p-2",children:e.map(s=>c.jsx(Pw,{item:s,isCurrentPlan:!1},s.id))})]})}function zM(e){const t=new Map;for(const n of e){const r=n.kind==="bash"?"bash":n.toolName;t.set(r,(t.get(r)??0)+1)}return Array.from(t.entries()).sort((n,r)=>r[1]-n[1]).map(([n,r])=>({name:n,count:r}))}function BM({item:e,args:t}){const n=Dp(t),r=Lp(n),i=j.useMemo(()=>QM(t),[t]),s=j.useMemo(()=>i.map(u=>MM(u.oldText,u.newText)),[i]),o=e.status==="error",l=j.useMemo(()=>{let u=0,f=0;for(const d of s){const h=DM(d);u+=h.adds,f+=h.dels}return{adds:u,dels:f}},[s]),a=s.length>0||!!e.text;return c.jsx(kl,{hasBody:a,header:c.jsx(Mp,{name:"edit",verb:"Edited",path:n,status:e.status,stats:l}),body:c.jsxs(c.Fragment,{children:[s.length>0&&c.jsx("div",{className:"max-h-80 flex flex-col gap-2 overflow-auto border-t border-border-soft bg-background p-2",children:s.map((u,f)=>c.jsx(WM,{index:f,rows:u,multi:s.length>1,lang:r},f))}),e.text&&(s.length===0||o)&&c.jsx(il,{children:rl(e.text)})]})})}function UM({item:e,args:t}){const n=Dp(t),r=Rt(t==null?void 0:t.content)??"",i=Lp(n),s=e.status==="error",o=!!r||!!e.text,l=r?r.split(`
|
|
397
|
+
`).length:void 0;return c.jsx(kl,{hasBody:o,header:c.jsx(Mp,{name:"write",verb:"Wrote",path:n,status:e.status,suffix:l?`${l} ln`:void 0}),body:c.jsxs(c.Fragment,{children:[r&&c.jsx("div",{className:"max-h-80 overflow-auto border-t border-border-soft bg-background px-3 py-2",children:c.jsx(Ju,{code:r,lang:i})}),!r&&e.text&&c.jsx(il,{children:rl(e.text)}),r&&s&&e.text&&c.jsx(il,{children:rl(e.text)})]})})}function GM({item:e,args:t}){const n=Dp(t),r=Lp(n),i=uy(t==null?void 0:t.offset),s=uy(t==null?void 0:t.limit),o=s!==void 0?`lines ${i??1}–${(i??1)+s-1}`:i!==void 0?`from line ${i}`:void 0,l=!!e.text;return c.jsx(kl,{hasBody:l,header:c.jsx(Mp,{name:"read",verb:"Read",path:n,status:e.status,suffix:o}),body:e.text?c.jsx("div",{className:"max-h-80 overflow-auto border-t border-border-soft bg-background px-3 py-2",children:c.jsx(Ju,{code:e.text,lang:r,wrap:!0,tone:"muted"})}):void 0})}function ay({command:e,output:t,exitCode:n,running:r,errored:i}){const o=r?"running":i===!0||n!==void 0&&n!==0?"error":"ok",l=!!t,a=t?t.split(`
|
|
398
|
+
`).length:void 0;return c.jsx(kl,{hasBody:l,header:c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[c.jsx(Ni,{tool:"bash",className:"shrink-0 text-muted-foreground"}),c.jsx("span",{className:"text-[12.5px] text-foreground",children:"Ran"}),c.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11.5px] tracking-[-0.005em] text-muted-foreground",children:e}),a!=null&&c.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:[a," ln"]}),n!==void 0&&n!==0&&c.jsxs("span",{className:"font-mono text-[11px] text-signal-error",children:["exit ",n]}),c.jsx(Op,{status:o})]}),body:t?c.jsx(il,{tone:"foreground",children:rl(t)}):void 0})}function Iw({item:e,args:t}){const n=KM(e.toolName,t),r=!!e.text;return c.jsx(kl,{hasBody:r,header:c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[c.jsx(Ni,{tool:e.toolName,className:"shrink-0 text-muted-foreground"}),c.jsxs("span",{className:"min-w-0 flex-1 truncate text-[12.5px] text-muted-foreground",children:[c.jsx("span",{className:"text-foreground",children:e.toolName}),n&&c.jsx("span",{className:"ml-2 font-mono text-[11.5px]",children:n})]}),c.jsx(Op,{status:e.status})]}),body:e.text?c.jsx(il,{children:rl(e.text)}):void 0})}function HM({item:e,args:t,isCurrent:n}){const r=j.useMemo(()=>h1(t),[t]),i=r.length,[s,o]=j.useState(!1),l=j.useId();if(i===0)return c.jsx(Iw,{item:e,args:t});const a=r.filter(h=>h.status==="completed").length,u=a/i,f=n||s,d=c.jsxs(c.Fragment,{children:[!n&&c.jsx(Os,{className:B("h-3 w-3 shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")}),c.jsx(Ni,{tool:"plan",className:"shrink-0 text-muted-foreground"}),c.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Plan"}),c.jsxs("span",{className:"inline-flex min-w-0 flex-1 items-center gap-2 text-[12px] text-muted-foreground",children:[c.jsxs("span",{className:"font-mono text-[11.5px] tabular-nums",children:[a,"/",i]}),c.jsx("span",{className:"inline-block h-1 w-[48px] overflow-hidden rounded-full bg-border-soft",role:"progressbar","aria-valuemin":0,"aria-valuenow":a,"aria-valuemax":i,"aria-label":`Plan progress: ${a} of ${i} completed`,children:c.jsx("span",{className:"block h-full rounded-full bg-brand transition-[width] duration-300",style:{width:`${u*100}%`}})})]})]});return c.jsxs(eh,{children:[n?c.jsx("div",{className:"flex items-center gap-2.5 px-3 py-2",children:d}):c.jsx("button",{type:"button","aria-expanded":s,"aria-controls":l,onClick:()=>o(h=>!h),className:"flex w-full items-center gap-2.5 px-3 py-2 text-left transition-colors hover:bg-accent/40 ring-brand-focus",children:d}),f&&c.jsx("ul",{id:l,className:"border-t border-border-soft bg-background px-3 py-1.5","aria-label":"Plan items",children:r.map(h=>c.jsxs("li",{className:"flex items-start gap-2 py-[3px]",children:[c.jsx("span",{className:"mt-[2px] shrink-0",children:h.status==="completed"?c.jsx(Ms,{className:"h-3.5 w-3.5 text-signal-ok","aria-hidden":!0}):h.status==="in_progress"?n?c.jsx(Et,{className:"h-3.5 w-3.5 text-brand",style:{animation:"v2-spin 1.4s linear infinite"},"aria-label":"In progress"}):c.jsx(T_,{className:"h-3.5 w-3.5 text-muted-foreground/70","aria-label":"Was in progress"}):c.jsx(r1,{className:"h-3.5 w-3.5 text-muted-foreground/40","aria-hidden":!0})}),c.jsxs("span",{className:B("min-w-0 flex-1 text-[12.5px] leading-[1.5]",h.status==="completed"?"text-muted-foreground line-through decoration-muted-foreground/30":h.status==="in_progress"&&n?"text-foreground font-medium":"text-muted-foreground"),children:[h.title,h.note&&c.jsxs("span",{className:"ml-1.5 text-[11.5px] text-muted-foreground/60",children:["— ",h.note]})]})]},h.id))})]})}function eh({children:e}){return c.jsx("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:e})}function il({children:e,tone:t="muted-foreground"}){return c.jsx("pre",{className:B("max-h-80 overflow-auto whitespace-pre-wrap break-words border-t border-border-soft bg-background px-3 py-2 font-mono text-[12px] leading-relaxed",t==="foreground"?"text-foreground":"text-muted-foreground"),children:e})}function kl({hasBody:e,header:t,body:n}){const[r,i]=j.useState(!1),s=j.useId();return e?c.jsxs(eh,{children:[c.jsx("button",{type:"button","aria-expanded":r,"aria-controls":s,onClick:()=>i(o=>!o),className:"w-full cursor-pointer text-left ring-brand-focus transition-colors hover:bg-accent/30",children:t}),r&&n&&c.jsx("div",{id:s,children:n})]}):c.jsx(eh,{children:t})}function Mp({name:e,verb:t,path:n,status:r,suffix:i,stats:s}){return c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[c.jsx(Ni,{tool:e,className:"shrink-0 text-muted-foreground"}),c.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:t}),n?c.jsx(qM,{path:n}):c.jsx("span",{className:"flex-1 text-muted-foreground",children:"…"}),i&&c.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:i}),s&&(s.adds>0||s.dels>0)&&c.jsxs("span",{className:"shrink-0 font-mono text-[11.5px] tabular-nums",children:[s.adds>0&&c.jsxs("span",{className:"text-signal-ok",children:["+",s.adds]}),s.adds>0&&s.dels>0&&" ",s.dels>0&&c.jsxs("span",{className:"text-signal-error",children:["−",s.dels]})]}),c.jsx(Op,{status:r})]})}function Op({status:e}){return e==="ok"?c.jsx(_t,{tone:"ok",children:"done"}):e==="error"?c.jsx(_t,{tone:"error",children:"error"}):c.jsx(_t,{tone:"warn",children:"running"})}function qM({path:e}){const t=ki(o=>o.pushToast),[n,r]=j.useState(!1),i=ya(e),s=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1200),t({id:`copy-${Date.now()}`,workspaceId:"",message:`Copied: ${e}`,notifyType:"info"})}catch{t({id:`copy-${Date.now()}`,workspaceId:"",message:"Copy failed — clipboard not available",notifyType:"warning"})}};return c.jsxs("button",{type:"button",onClick:s,title:`${e} — click to copy`,className:"group inline-flex min-w-0 flex-1 items-center gap-1 truncate text-left font-mono text-[11.5px] tracking-[-0.005em] text-muted-foreground transition-colors hover:text-foreground",children:[c.jsx("span",{className:"truncate",children:i}),n?c.jsx(Ms,{className:"h-3 w-3 shrink-0 text-signal-ok"}):c.jsx(i1,{className:"h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60"})]})}function WM({index:e,rows:t,multi:n,lang:r}){const{code:i,roles:s}=j.useMemo(()=>OM(t),[t]);return t.length===0?null:c.jsxs("div",{className:"overflow-hidden rounded-md border border-border-soft bg-card",children:[n&&c.jsxs("div",{className:"border-b border-border-soft bg-muted px-2.5 py-1 text-[11px] text-muted-foreground",children:["Edit ",e+1]}),c.jsx(Ju,{code:i,lang:r,diffRoles:s})]})}function VM(e){return e&&typeof e=="object"?e:void 0}function Rt(e){return typeof e=="string"?e:void 0}function uy(e){return typeof e=="number"?e:void 0}function Dp(e){return Rt(e==null?void 0:e.path)??Rt(e==null?void 0:e.file_path)}function QM(e){if(!e)return[];if(Array.isArray(e.edits))return e.edits.flatMap(r=>{if(!r||typeof r!="object")return[];const i=r.oldText??r.old_string,s=r.newText??r.new_string;return typeof i=="string"&&typeof s=="string"?[{oldText:i,newText:s}]:[]});const t=Rt(e.old_string)??Rt(e.oldText),n=Rt(e.new_string)??Rt(e.newText);return typeof t=="string"&&typeof n=="string"?[{oldText:t,newText:n}]:[]}function ya(e){const t="/Users/";if(e.startsWith(t)){const n=e.slice(t.length),r=n.indexOf("/");if(r>0)return"~/"+n.slice(r+1)}if(e.length>60){const n=e.split("/").filter(Boolean);if(n.length>2)return".../"+n.slice(-2).join("/")}return e}function KM(e,t){if(!t)return;if(e==="grep"){const r=Rt(t.pattern),i=Rt(t.path);if(r)return`/${r}/${i?` in ${ya(i)}`:""}`}if(e==="find"){const r=Rt(t.pattern),i=Rt(t.path);if(r)return`${r}${i?` in ${ya(i)}`:""}`}if(e==="ls"){const r=Rt(t.path);return r?ya(r):"."}const n=Object.keys(t);if(n.length!==0)return`(${n.slice(0,4).join(", ")}${n.length>4?", …":""})`}function XM(e){const t=[];let n=[];const r=()=>{n.length!==0&&(n.length===1?t.push({kind:"single",item:n[0]}):t.push({kind:"group",items:n}),n=[])};for(const i of e)if(i.kind==="tool"||i.kind==="bash")JM(i)||fu(i)||ZM(i)?(r(),t.push({kind:"single",item:i})):n.push(i);else{if(YM(i))continue;r(),t.push({kind:"single",item:i})}return r(),tO(t)}function YM(e){return e.kind==="assistant"&&e.text.length===0}function JM(e){return e.kind==="tool"?e.status==="error":e.exitCode!==void 0&&e.exitCode!==0}function fu(e){return e.kind==="tool"&&e.toolName==="update_plan"}function ZM(e){return e.kind==="tool"&&e.toolName==="ask_user"}function eO(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="single"&&fu(n.item))return n.item.id}}function tO(e){const t=new Set;let n=0;for(let r=0;r<=e.length;r++){const i=r===e.length,s=!i&&e[r].kind==="single"&&e[r].item.kind==="user";if(i||s){let o=-1;for(let l=r-1;l>=n;l--){const a=e[l];if(a.kind==="single"&&fu(a.item)){o=l;break}}if(o!==-1)for(let l=n;l<r;l++){const a=e[l];l!==o&&a.kind==="single"&&fu(a.item)&&t.add(l)}n=r}}return t.size===0?e:e.filter((r,i)=>!t.has(i))}function nO({items:e,running:t,bottomPad:n}){const r=Wa(f=>f.density)==="compact",i=j.useRef(null),s=j.useRef(!0),o=j.useCallback(()=>{const f=i.current;f&&(s.current=f.scrollHeight-f.scrollTop-f.clientHeight<30)},[]);j.useEffect(()=>{const f=i.current;!f||!s.current||(f.scrollTop=f.scrollHeight)},[e,t]),j.useEffect(()=>{const f=i.current;!f||!s.current||(f.scrollTop=f.scrollHeight)},[n]);const{entries:l,currentPlanId:a}=j.useMemo(()=>{const f=XM(e);return{entries:f,currentPlanId:eO(f)}},[e]),u=e.length===0&&!t;return c.jsx("div",{ref:i,onScroll:o,className:B("relative z-10 min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain",u?"flex items-center justify-center":"pt-4"),style:u?void 0:{maskImage:"linear-gradient(to bottom, black calc(100% - 56px), transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black calc(100% - 56px), transparent 100%)"},children:u?c.jsx(p1,{title:"Ready when you are.",tagline:"Send a message to brief your co-pilot. Enter submits, Shift+Enter inserts a newline.",hint:{keys:["⏎"],label:"Send"}}):c.jsx("div",{className:B("mx-auto flex w-full flex-col px-6",r?"max-w-[920px] gap-1":"max-w-[860px] gap-3"),style:{paddingBottom:n},children:(()=>{let f=!1;return l.flatMap(d=>{if(d.kind==="single"&&d.item.kind==="user")return f=!1,[c.jsx(od,{item:d.item,isCurrentPlan:d.item.id===a,compact:r},d.item.id)];if(d.kind==="single"&&d.item.kind==="assistant")return d.item.text&&(f=!0),[c.jsx(od,{item:d.item,isCurrentPlan:d.item.id===a,compact:r},d.item.id)];const h=[];if(!f){const p=d.kind==="group"?d.items[0].id:d.item.id;h.push(c.jsx(iO,{compact:r},`pilot-hdr:${p}`)),f=!0}if(d.kind==="single")h.push(c.jsx(od,{item:d.item,isCurrentPlan:d.item.id===a,compact:r},d.item.id));else{const p=`group:${d.items[0].id}`;h.push(c.jsx(rO,{group:d,compact:r},p))}return h})})()})})}const od=j.memo(function({item:t,isCurrentPlan:n,compact:r=!1}){return t.kind==="user"?c.jsx(sO,{item:t,compact:r}):t.kind==="assistant"?c.jsx(oO,{item:t,compact:r}):t.kind==="tool"||t.kind==="bash"?c.jsx("div",{className:r?"pl-4 border-l-2 border-border-soft ml-0.5":"pl-10",children:c.jsx(Pw,{item:t,isCurrentPlan:n})}):null});function rO({group:e,compact:t=!1}){return c.jsx("div",{className:t?"pl-4 border-l-2 border-border-soft ml-0.5":"pl-10",children:c.jsx(FM,{items:e.items})})}function iO({compact:e=!1}){return e?c.jsxs("div",{className:"flex items-center gap-2 pt-1.5",children:[c.jsx("span",{className:"h-px flex-1 bg-border-soft"}),c.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Pilot"}),c.jsx("span",{className:"h-px flex-1 bg-border-soft"})]}):c.jsxs("div",{className:"-mb-[6px] flex gap-3",children:[c.jsx(Mu,{size:28,filled:!0}),c.jsx("div",{className:"min-w-0 flex-1 pt-0.5",children:c.jsx("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Pilot"})})]})}function sO({item:e,compact:t=!1}){return t?c.jsxs("div",{className:"flex items-baseline gap-2 pt-2",children:[c.jsx("span",{className:"shrink-0 text-[11.5px] font-medium text-brand",children:"You"}),c.jsx("div",{className:"min-w-0 flex-1 text-[13.5px] leading-[1.45] text-foreground [overflow-wrap:anywhere]",children:c.jsx(uu,{text:e.text})})]}):c.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[c.jsx("div",{className:"max-w-[78%] rounded-[14px] rounded-br-[4px] border border-brand/[0.22] bg-brand/[0.08] px-3.5 py-2.5 text-[14px] leading-[1.5] text-foreground [overflow-wrap:anywhere]",children:c.jsx(uu,{text:e.text})}),c.jsx(ho,{children:"You"})]})}function oO({item:e,compact:t=!1}){return e.text?t?c.jsxs("div",{className:"flex gap-0",children:[c.jsx("div",{className:"mr-4 flex w-0.5 shrink-0 self-stretch rounded-full bg-brand/30"}),c.jsxs("div",{className:"min-w-0 flex-1 py-0.5 [overflow-wrap:anywhere]",children:[c.jsxs("div",{className:"mb-0.5 flex items-baseline gap-2",children:[c.jsx("span",{className:"text-[11.5px] font-medium text-brand",children:"Pilot"}),!e.streaming&&typeof e.firstTokenMs=="number"&&c.jsx(ho,{className:B(xg(e.firstTokenMs)),title:e.totalMs!=null?`first token ${Ai(e.firstTokenMs)} · total ${Ai(e.totalMs)}`:void 0,children:Ai(e.firstTokenMs)}),e.streaming&&c.jsx(ho,{className:"text-brand",children:"streaming…"})]}),c.jsx(uu,{text:e.text,streaming:e.streaming,className:"text-[13.5px] leading-[1.45]"})]})]}):c.jsxs("div",{className:"flex gap-3",children:[c.jsx(Mu,{size:28,filled:!0}),c.jsxs("div",{className:"min-w-0 flex-1 pt-0.5 [overflow-wrap:anywhere]",children:[c.jsxs("div",{className:"mb-1 flex items-baseline gap-2",children:[c.jsx("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Pilot"}),!e.streaming&&typeof e.firstTokenMs=="number"&&c.jsx(ho,{className:B(xg(e.firstTokenMs)),title:e.totalMs!=null?`first token ${Ai(e.firstTokenMs)} · total ${Ai(e.totalMs)}`:void 0,children:Ai(e.firstTokenMs)}),e.streaming&&c.jsx(ho,{className:"text-brand",children:"streaming…"})]}),c.jsx(uu,{text:e.text,streaming:e.streaming})]})]}):null}function ho({children:e,className:t,title:n}){return c.jsx("span",{title:n,className:B("text-[11px] tracking-[-0.005em] text-muted-foreground",t),children:e})}function Tw(e){return["workspace-sessions",e]}function lO(e){return kn({queryKey:Tw(e),enabled:!!e,staleTime:1e4,queryFn:()=>{if(!e)throw new Error("workspaceId required");return pe(`/api/workspaces/${encodeURIComponent(e)}/sessions`).then(t=>t.sessions)}})}function aO(e){const t=Te();return Ue({mutationFn:n=>{if(!e)throw new Error("workspaceId required");const r=`?path=${encodeURIComponent(n)}`;return pe(`/api/workspaces/${encodeURIComponent(e)}/sessions${r}`,{method:"DELETE"})},onSuccess:()=>t.invalidateQueries({queryKey:Tw(e)})})}function uO(e,t,n){return kn({queryKey:["fork-points",e,t??"__none__"],enabled:!!e&&!!t&&n,staleTime:0,queryFn:()=>{if(!e)throw new Error("workspaceId required");return pe(`/api/workspaces/${encodeURIComponent(e)}/fork-points`).then(r=>r.points)}})}function cO({open:e,title:t,message:n,confirmLabel:r="Confirm",cancelLabel:i="Cancel",variant:s="default",onConfirm:o,onCancel:l}){const a=j.useRef(null),u=j.useRef(null);if(j.useEffect(()=>{if(e)u.current=document.activeElement,requestAnimationFrame(()=>{var d;return(d=a.current)==null?void 0:d.focus()});else if(u.current){const d=u.current;u.current=null,d.isConnected&&d.focus()}},[e]),j.useEffect(()=>{if(!e)return;const d=h=>{h.key==="Escape"?(h.preventDefault(),h.stopPropagation(),l()):h.key==="Enter"&&(h.preventDefault(),h.stopPropagation(),o())};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[e,l,o]),!e)return null;const f=s==="danger";return c.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center",children:[c.jsx("div",{className:"absolute inset-0 bg-background/60 backdrop-blur-[2px] v2-fade-in",onClick:l,onMouseDown:d=>d.stopPropagation()}),c.jsxs("div",{role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-message",className:"relative z-10 mx-4 w-full max-w-sm overflow-hidden rounded-xl border border-border bg-card shadow-panel v2-dialog-in",onMouseDown:d=>d.stopPropagation(),children:[c.jsx("div",{className:"px-5 pt-5 pb-4",children:c.jsxs("div",{className:"flex items-start gap-3",children:[f&&c.jsx("span",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-signal-rose/10",children:c.jsx(kf,{className:"h-4 w-4 text-signal-rose"})}),c.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[c.jsx("h2",{id:"confirm-dialog-title",className:"text-sm font-semibold text-foreground",children:t}),c.jsx("p",{id:"confirm-dialog-message",className:"whitespace-pre-line text-[13px] leading-relaxed text-muted-foreground",children:n})]})]})}),c.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border bg-muted/40 px-5 py-3",children:[i!==null&&c.jsx("button",{type:"button",onClick:l,className:B("rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors","border border-border bg-card text-foreground/80","hover:bg-accent hover:text-foreground","focus:outline-none focus:ring-2 focus:ring-brand/40"),children:i}),c.jsx("button",{ref:a,type:"button",onClick:o,className:B("rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors","focus:outline-none focus:ring-2",f?"bg-signal-rose text-white hover:bg-signal-rose/90 focus:ring-signal-rose/40":"bg-brand text-brand-foreground hover:bg-brand-strong focus:ring-brand/40"),children:r})]})]})]})}const Aw=j.createContext(null);function Sl(){const e=j.useContext(Aw);if(!e)throw new Error("useConfirm must be used within a <ConfirmProvider />");return e}function dO({children:e}){const[t,n]=j.useState(null),r=j.useRef(null),i=j.useCallback(o=>(r.current&&(r.current(!1),r.current=null),new Promise(l=>{r.current=l,n({...o,open:!0})})),[]),s=j.useCallback(o=>{var l;n(a=>a?{...a,open:!1}:null),(l=r.current)==null||l.call(r,o),r.current=null},[]);return c.jsxs(Aw.Provider,{value:i,children:[e,c.jsx(cO,{open:(t==null?void 0:t.open)??!1,title:(t==null?void 0:t.title)??"",message:(t==null?void 0:t.message)??"",confirmLabel:t==null?void 0:t.confirmLabel,cancelLabel:t==null?void 0:t.cancelLabel,variant:t==null?void 0:t.variant,onConfirm:()=>s(!0),onCancel:()=>s(!1)})]})}function fO({workspaceId:e,sessionPath:t,disabled:n=!1,onSelect:r,onNewSession:i,onFork:s}){const{data:o,isFetching:l,refetch:a}=lO(e),u=aO(e),f=Sl(),[d,h]=j.useState(!1),[p,m]=j.useState("sessions"),{data:x}=uO(e,t,p==="fork"&&d),v=j.useRef(null),g=j.useRef(null),y=j.useRef(null),b=j.useRef(null),w=j.useRef(!1);j.useEffect(()=>{d||m("sessions")},[d]),j.useEffect(()=>{m("sessions")},[t]),j.useEffect(()=>{!e||t===void 0||a()},[e,t,a]),j.useEffect(()=>{if(!d)return;const A=R=>{v.current&&!v.current.contains(R.target)&&h(!1)},N=R=>{var L,V;if(R.key==="Escape"){R.preventDefault(),w.current=!0,p==="fork"?m("sessions"):h(!1);return}if(R.key==="Tab"){(L=g.current)==null||L.focus(),h(!1);return}if(p==="sessions"&&(R.key==="ArrowDown"||R.key==="ArrowUp"||R.key==="Home"||R.key==="End")){const W=y.current;if(!W)return;const G=Array.from(W.querySelectorAll('[role="option"]'));if(G.length===0)return;R.preventDefault();const re=G.indexOf(document.activeElement),fe=R.key==="ArrowDown"?re<0?0:Math.min(re+1,G.length-1):R.key==="ArrowUp"?re<0?G.length-1:Math.max(re-1,0):R.key==="Home"?0:G.length-1;(V=G[fe])==null||V.focus()}};return document.addEventListener("mousedown",A),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("keydown",N)}},[d,p]),j.useLayoutEffect(()=>{var A,N;if(d&&p==="sessions"){const R=b.current??((A=y.current)==null?void 0:A.querySelector('[role="option"]'));R==null||R.scrollIntoView({block:"nearest"}),R==null||R.focus({preventScroll:!0})}else!d&&w.current&&(w.current=!1,(N=g.current)==null||N.focus())},[d,p]);const C=n||!e,k=u.isPending?u.variables??null:null,P=async A=>{if(u.isPending||A===t)return;const N=o==null?void 0:o.find(V=>V.path===A),R=N?ad(N):Rw(A);await f({title:"Delete session",message:`Delete session "${R}"? This cannot be undone.`,confirmLabel:"Delete",variant:"danger"})&&u.mutate(A,{onError:async V=>{await f({title:"Delete failed",message:`Failed to delete session: ${V.message}`,confirmLabel:"OK",cancelLabel:null})}})},I=o==null?void 0:o.find(A=>A.path===t);return c.jsxs("div",{ref:v,className:"relative",children:[c.jsxs("button",{ref:g,type:"button",onClick:()=>h(A=>!A),disabled:C,"aria-label":"Session","aria-haspopup":"menu","aria-expanded":d,title:t===void 0?"Session — connecting":t===null?"Session — new":t,className:B("flex items-center gap-1.5 rounded-md px-2 py-1 text-[12.5px] text-muted-foreground transition-colors ring-brand-focus","border border-transparent bg-transparent","hover:bg-muted hover:text-foreground","disabled:cursor-not-allowed disabled:opacity-50",d&&"bg-muted text-foreground"),children:[c.jsx("span",{children:"Session"}),I&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-foreground/40",children:"·"}),c.jsx("span",{className:"font-mono tabular-nums text-foreground",children:hO(I.updatedAt)})]}),t===void 0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-foreground/40",children:"·"}),c.jsx("span",{className:"text-foreground/60",children:"Connecting…"})]}),t===null&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-foreground/40",children:"·"}),c.jsx("span",{className:"text-foreground/60",children:"New"})]}),typeof t=="string"&&!I&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-foreground/40",children:"·"}),c.jsx("span",{className:"text-foreground/60",children:"…"})]}),c.jsx(Os,{className:B("h-3 w-3 shrink-0 opacity-50 transition-transform",d&&"rotate-180")})]}),d&&c.jsx("div",{ref:y,role:"menu","aria-label":"Session menu",className:"absolute left-0 top-full z-50 mt-1.5 w-80 overflow-hidden rounded-md border border-border bg-card shadow-menu",children:p==="sessions"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"py-1",children:[c.jsx(ld,{icon:c.jsx(Ru,{className:"h-3.5 w-3.5"}),onClick:()=>{w.current=!0,h(!1),i()},children:"New session"}),c.jsx(ld,{icon:c.jsx(R_,{className:"h-3.5 w-3.5"}),onClick:()=>m("fork"),children:"Fork from message…"}),c.jsx(ld,{icon:l?c.jsx(Et,{className:"h-3.5 w-3.5 animate-spin"}):c.jsx($_,{className:"h-3.5 w-3.5"}),onClick:()=>void a(),disabled:l,children:"Reload"})]}),c.jsxs("div",{className:"flex items-center justify-between border-t border-border bg-muted/60 px-3 py-1.5 text-[11.5px] text-muted-foreground",children:[c.jsx("span",{className:"font-medium text-foreground/80",children:"Session history"}),o&&c.jsx("span",{className:"font-mono tabular-nums",children:o.length})]}),c.jsxs("div",{className:"max-h-72 overflow-y-auto py-1",children:[!o&&c.jsx("div",{className:"px-3 py-3 text-xs text-muted-foreground",children:l?"Loading…":"No sessions."}),o&&o.length===0&&c.jsx("div",{className:"px-3 py-3 text-xs text-muted-foreground",children:"No sessions yet."}),o==null?void 0:o.map(A=>{const N=A.path===t,R=k===A.path;return c.jsxs("div",{className:"group/row relative flex items-stretch px-1.5",children:[c.jsxs("button",{ref:N?b:void 0,type:"button",role:"option","aria-selected":N,onClick:()=>{w.current=!0,h(!1),N||r(A.path)},title:A.path,className:B("flex w-full items-start gap-2.5 rounded-md px-2 py-1.5 pr-9 text-left text-xs transition-colors ring-brand-focus focus:outline-none","text-foreground/90 hover:bg-accent hover:text-foreground focus:bg-accent focus:text-foreground"),children:[c.jsx(Ms,{className:B("mt-0.5 h-3.5 w-3.5 shrink-0",N?"text-brand opacity-100":"opacity-0")}),c.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[c.jsx("span",{className:"truncate font-normal text-foreground",children:ad(A)}),c.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:pO(A.updatedAt)})]})]}),!N&&c.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),P(A.path)},disabled:u.isPending,"aria-label":`Delete session ${ad(A)}`,title:u.isPending&&!R?"Another delete is in progress":"Delete session",className:B("absolute right-3 top-1/2 -translate-y-1/2 rounded p-1 text-muted-foreground transition-opacity ring-brand-focus","hover:bg-signal-rose/15 hover:text-signal-rose","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted-foreground",R?"opacity-100":"opacity-0 group-hover/row:opacity-100 focus:opacity-100"),children:R?c.jsx(Et,{className:"h-3 w-3 animate-spin"}):c.jsx(Ko,{className:"h-3 w-3"})})]},A.path)})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-1 border-b border-border bg-muted/60 px-2 py-1.5",children:[c.jsx("button",{type:"button",onClick:()=>m("sessions"),"aria-label":"Back to sessions",title:"Back",className:"rounded p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground ring-brand-focus",children:c.jsx(n1,{className:"h-3.5 w-3.5"})}),c.jsx("span",{className:"text-[11.5px] font-medium text-foreground/80",children:"Fork from message"})]}),c.jsxs("div",{className:"max-h-72 overflow-y-auto py-1",children:[!x&&c.jsx("div",{className:"px-3 py-3 text-xs text-muted-foreground",children:"Loading…"}),x&&x.length===0&&c.jsx("div",{className:"px-3 py-3 text-xs text-muted-foreground",children:"No messages to fork from."}),x==null?void 0:x.map(A=>c.jsx("button",{type:"button",onClick:()=>{w.current=!0,h(!1),s(A.entryId)},className:"w-full truncate px-3 py-1.5 text-left text-xs text-foreground/90 transition-colors hover:bg-accent hover:text-foreground ring-brand-focus",title:A.text,children:A.text},A.entryId))]})]})})]})}function ld({icon:e,children:t,onClick:n,disabled:r}){return c.jsxs("button",{type:"button",role:"menuitem",onClick:n,disabled:r,className:B("flex w-full items-center gap-2.5 px-3 py-1.5 text-left text-[12.5px] text-foreground/90 transition-colors ring-brand-focus","hover:bg-accent hover:text-foreground","disabled:cursor-not-allowed disabled:opacity-50"),children:[c.jsx("span",{className:"shrink-0 text-muted-foreground",children:e}),c.jsx("span",{children:t})]})}function ad(e){return e.name??e.preview??Rw(e.path)}function Rw(e){return e.split("/").at(-1)??e}function hO(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1}).format(t)}function pO(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t)}function mO({workspaceId:e,sessionPath:t,running:n,switching:r,onSelectSession:i,onNewSession:s,onFork:o,rightPanel:l,onToggleConfig:a,onToggleResources:u}){const f=Re(x=>{var v;return(v=x.contextUsage)==null?void 0:v.percent}),{data:d}=Zb(e,t),h=Wa(x=>x.density),p=Wa(x=>x.toggle),m=f!=null?Math.round(f):null;return c.jsx("header",{className:"relative z-20 shrink-0 border-b border-border bg-popover",children:c.jsxs("div",{className:"flex items-center gap-2 px-4 py-[10px]",children:[c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[c.jsx(fO,{workspaceId:e,sessionPath:t,disabled:n||r,onSelect:i,onNewSession:s,onFork:o}),n&&c.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-[11.5px] text-brand",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-brand",style:{animation:"v2-pulse 1.6s ease-in-out infinite"}}),c.jsx("span",{children:"thinking…"})]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[(d==null?void 0:d.currentModel)&&c.jsx(_t,{tone:"ghost",className:"hidden md:inline-flex",title:d.currentModel.modelId,children:c.jsx("span",{className:"max-w-[180px] truncate text-foreground",children:d.currentModel.name})}),(d==null?void 0:d.currentModel)&&m!=null&&c.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),m!=null&&c.jsxs(_t,{tone:"ghost",className:"hidden md:inline-flex",title:`Context · ${m}%`,children:[c.jsx("span",{className:"text-muted-foreground",children:"Context"}),c.jsxs("span",{className:"font-mono text-[11px] tabular-nums text-foreground",children:[m,"%"]}),c.jsx("span",{className:"inline-block h-1 w-[22px] overflow-hidden rounded-full bg-border-soft",children:c.jsx("span",{className:"block h-full bg-brand",style:{width:`${Math.min(100,m)}%`}})})]}),(u||a)&&c.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),c.jsx(ss,{active:h==="compact",onClick:p,title:h==="compact"?"Comfortable":"Compact",children:h==="compact"?c.jsx(z_,{className:"h-3.5 w-3.5"}):c.jsx(F_,{className:"h-3.5 w-3.5"})}),u&&c.jsx(ss,{active:l==="resources",onClick:u,title:"Resources",children:c.jsx(A_,{className:"h-3.5 w-3.5"})}),a&&c.jsx(ss,{active:l==="config",onClick:a,title:"Configuration",children:c.jsx(o1,{className:"h-3.5 w-3.5"})})]})]})})}function gO(e,t){const n=Re(d=>d.apply),r=Re(d=>d.pushUser),i=Re(d=>d.reset),s=Re(d=>d.setSwitching),o=Re(d=>d.applyHistory),l=Re(d=>d.switching),a=j.useRef(null),u=j.useRef(null),f=j.useRef(0);return j.useEffect(()=>(at.start(),()=>{}),[]),j.useEffect(()=>at.on(h=>{const p=u.current;if(p&&h.type==="event"&&h.workspaceId===p.expectedWorkspaceId&&h.sessionPath===p.expectedSessionPath){p.buffer.push(h);return}if(h.type==="subscribed"){const m=Re.getState().sessionPath;if(m!==void 0&&m===h.sessionPath)return}n(h)}),[n]),j.useEffect(()=>{if(!e){i();return}t&&s(!0),at.send({type:"subscribe",workspaceId:e,...t?{sessionPath:t.path}:{}})},[e,t,i,s]),j.useEffect(()=>at.onReconnect(()=>{a.current=null}),[]),j.useEffect(()=>{const d=p=>{if(p.type!=="subscribed")return;const m=p.workspaceId,x=p.sessionPath,v=a.current;if(v&&v.wsId===m&&v.sp===x)return;const g=u.current;g&&g.controller.abort(),a.current={wsId:m,sp:x};const y=++f.current,b=new AbortController,w={token:y,expectedWorkspaceId:m,expectedSessionPath:x,controller:b,buffer:[]};u.current=w;const C=at.connectionEpoch,k=x?`?sessionPath=${encodeURIComponent(x)}`:"";pe(`/api/workspaces/${m}/history${k}`,{signal:b.signal}).then(P=>{var N;if(((N=u.current)==null?void 0:N.token)!==y)return;const I=()=>{var R;((R=u.current)==null?void 0:R.token)===y&&(u.current=null)};if(at.connectionEpoch!==C){I();return}if(Re.getState().sessionPath!==x){I();return}o(P.items,P.isStreaming),ud(w),u.current=null}).catch(P=>{var I;(P==null?void 0:P.name)!=="AbortError"&&((I=u.current)==null?void 0:I.token)===y&&(console.error("[useSessionStream] history fetch failed:",P),ud(w),u.current=null)})},h=at.on(d);return()=>{h();const p=u.current;p&&(p.controller.abort(),u.current=null,ud(p))}},[o]),j.useMemo(()=>({sendPrompt(d,h){!e||l||(h!=null&&h.skipOptimistic||r(d),at.send({type:"prompt",message:d}))},abort(){e&&at.send({type:"abort"})},newSession(){e&&(s(!0),at.send({type:"new_session",workspaceId:e}))},fork(d){e&&(s(!0),at.send({type:"fork",workspaceId:e,entryId:d}))}}),[e,r,s,l])}function ud(e){const{expectedWorkspaceId:t,expectedSessionPath:n,buffer:r}=e;for(const i of r)i.type==="event"&&i.workspaceId===t&&i.sessionPath===n&&Re.getState().apply(i)}function xO({workspaceId:e,rightPanel:t,onToggleConfig:n,onToggleResources:r}){const i=Re(C=>C.items),s=Re(C=>C.running),o=Re(C=>C.switching),l=Re(C=>C.sessionPath),[a,u]=j.useState(void 0),{sendPrompt:f,abort:d,newSession:h,fork:p}=gO(e,a),m=rp(e).data,x=j.useMemo(()=>yO(m),[m]),v=j.useCallback(C=>{const k=bO(C,x);f(C,{skipOptimistic:k})},[f,x]),g=j.useCallback(C=>{u(k=>({path:C,nonce:((k==null?void 0:k.nonce)??0)+1}))},[]),y=j.useRef(null),[b,w]=j.useState(0);return j.useLayoutEffect(()=>{const C=y.current;if(!C)return;w(C.getBoundingClientRect().height);const k=new ResizeObserver(P=>{const I=P[0];I&&w(I.contentRect.height)});return k.observe(C),()=>k.disconnect()},[e]),e?c.jsxs("main",{className:"relative flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-clip bg-background",children:[c.jsx(mO,{workspaceId:e,sessionPath:l,running:s,switching:o,onSelectSession:g,onNewSession:h,onFork:p,rightPanel:t,onToggleConfig:n,onToggleResources:r}),c.jsx(OE,{}),c.jsx(ME,{}),c.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[c.jsx(nO,{items:i,running:s,bottomPad:b}),c.jsx("div",{ref:y,className:"pointer-events-none absolute inset-x-0 bottom-0 z-20 flex flex-col",children:c.jsx(WE,{workspaceId:e,onSend:v,onAbort:d,running:s,disabled:o})})]})]}):c.jsx("main",{className:"relative flex flex-1 items-center justify-center bg-background",children:c.jsx(p1,{title:"Ready when you are.",tagline:"Pick or add a workspace from the left to begin a session."})})}function yO(e){const t=new Set;if(!e)return t;for(const n of e.extensions)for(const r of n.commands)t.add(r);return t}function bO(e,t){if(t.size===0||!e.startsWith("/"))return!1;const n=e.slice(1),r=n.search(/\s/),i=r===-1?n:n.slice(0,r);return t.has(i)}const Us=["model-configs"];function vO(){return kn({queryKey:Us,queryFn:()=>pe("/api/model-configs")})}function wO(e){const t=Te(),n=e?`?workspaceId=${encodeURIComponent(e)}`:"";return Ue({mutationFn:r=>pe(`/api/model-configs/providers${n}`,{method:"POST",body:JSON.stringify(r)}),onSuccess:()=>{t.invalidateQueries({queryKey:Us}),t.invalidateQueries({queryKey:["config"]})}})}function kO(e){const t=Te(),n=e?`?workspaceId=${encodeURIComponent(e)}`:"";return Ue({mutationFn:r=>pe(`/api/model-configs/providers?name=${encodeURIComponent(r)}${n?"&"+n.slice(1):""}`,{method:"DELETE"}),onSuccess:()=>{t.invalidateQueries({queryKey:Us}),t.invalidateQueries({queryKey:["config"]})}})}function SO(e){const t=Te(),n=e?`?workspaceId=${encodeURIComponent(e)}`:"";return Ue({mutationFn:({provider:r,model:i})=>pe(`/api/model-configs/providers/${encodeURIComponent(r)}/models${n}`,{method:"POST",body:JSON.stringify({model:i})}),onSuccess:()=>{t.invalidateQueries({queryKey:Us}),t.invalidateQueries({queryKey:["config"]})}})}function CO(e){const t=Te(),n=e?`?workspaceId=${encodeURIComponent(e)}`:"";return Ue({mutationFn:({provider:r,modelId:i,model:s})=>pe(`/api/model-configs/providers/${encodeURIComponent(r)}/models/${encodeURIComponent(i)}${n}`,{method:"PUT",body:JSON.stringify({model:s})}),onSuccess:()=>{t.invalidateQueries({queryKey:Us}),t.invalidateQueries({queryKey:["config"]})}})}function _O(e){const t=Te(),n=e?`?workspaceId=${encodeURIComponent(e)}`:"";return Ue({mutationFn:({provider:r,modelId:i})=>pe(`/api/model-configs/providers/${encodeURIComponent(r)}/models/${encodeURIComponent(i)}${n}`,{method:"DELETE"}),onSuccess:()=>{t.invalidateQueries({queryKey:Us}),t.invalidateQueries({queryKey:["config"]})}})}const cy=["anthropic-messages","openai-completions","openai-responses","azure-openai-responses","openai-codex-responses","mistral-conversations","bedrock-converse-stream","google-generative-ai","google-vertex"];function EO({workspaceId:e,open:t,onClose:n}){return t?c.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/50",children:c.jsxs("div",{className:"flex max-h-[85vh] w-[600px] max-w-[90vw] flex-col overflow-hidden rounded-md border border-border bg-card shadow-panel",children:[c.jsx(NO,{onClose:n}),c.jsx(jO,{workspaceId:e})]})}):null}function NO({onClose:e}){return c.jsxs("header",{className:"flex items-center justify-between border-b border-border-soft px-4 py-3",children:[c.jsx("span",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.2em] text-brand",children:"Model Configuration"}),c.jsx("button",{type:"button",onClick:e,className:"rounded-[2px] p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":"Close",children:c.jsx(Ei,{className:"h-4 w-4"})})]})}function jO({workspaceId:e}){const{data:t,isLoading:n,error:r}=vO(),[i,s]=j.useState(null),[o,l]=j.useState(!1),[a,u]=j.useState(null),[f,d]=j.useState(null);if(n)return c.jsxs("div",{className:"flex items-center justify-center py-8",children:[c.jsx(Et,{className:"h-4 w-4 animate-spin text-muted-foreground"}),c.jsx("span",{className:"ml-2 font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:"Loading..."})]});if(r||!t)return c.jsx("p",{className:"m-4 border border-signal-rose/40 bg-signal-rose/10 px-3 py-2 text-center font-mono text-[11px] text-signal-rose",children:(r==null?void 0:r.message)??"Failed to load model config"});const h=t.config.providers;return i?c.jsx(dy,{workspaceId:e,initialName:i.name,initialConfig:i.config,onDone:()=>s(null)}):o?c.jsx(dy,{workspaceId:e,initialName:"",initialConfig:null,onDone:()=>l(!1)}):a?c.jsx(fy,{workspaceId:e,provider:a.provider,initialModel:a.model,onDone:()=>u(null)}):f?c.jsx(fy,{workspaceId:e,provider:f,initialModel:null,onDone:()=>d(null)}):c.jsxs("div",{className:"flex-1 overflow-y-auto",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/50 px-4 py-2",children:[c.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:["Providers (",Object.keys(h).length,")"]}),c.jsxs("button",{type:"button",onClick:()=>l(!0),className:"flex items-center gap-1 rounded-[2px] px-2 py-1 font-mono text-[10px] uppercase tracking-[0.12em] text-brand transition-colors hover:bg-brand/10",children:[c.jsx(Ru,{className:"h-3 w-3"})," Add Provider"]})]}),Object.keys(h).length===0&&c.jsx("p",{className:"px-4 py-6 text-center font-mono text-[11px] text-muted-foreground",children:'No providers configured. Click "Add Provider" to get started.'}),Object.entries(h).map(([p,m])=>c.jsx(PO,{name:p,config:m,workspaceId:e,onEditProvider:()=>s({name:p,config:m}),onEditModel:x=>u({provider:p,model:x}),onAddModel:()=>d(p)},p))]})}function PO({name:e,config:t,workspaceId:n,onEditProvider:r,onEditModel:i,onAddModel:s}){const[o,l]=j.useState(!0),a=kO(n),u=_O(n),f=Sl();return c.jsxs("div",{className:"border-b border-border/30",children:[c.jsxs("div",{className:"flex items-center gap-1 px-4 py-2",children:[c.jsx("button",{type:"button",onClick:()=>l(d=>!d),className:"p-0.5 text-muted-foreground hover:text-foreground",children:o?c.jsx(Os,{className:"h-3 w-3"}):c.jsx(ip,{className:"h-3 w-3"})}),c.jsx("span",{className:"flex-1 font-mono text-[12px] font-semibold text-foreground",children:e}),c.jsx("span",{className:"font-mono text-[9px] uppercase text-muted-foreground",children:t.api}),c.jsx("button",{type:"button",onClick:r,className:"rounded-[2px] p-1 text-muted-foreground hover:bg-muted hover:text-foreground",title:"Edit provider",children:c.jsx(wf,{className:"h-3 w-3"})}),c.jsx("button",{type:"button",onClick:async()=>{await f({title:"Delete provider",message:`Delete provider "${e}" and all its models?`,confirmLabel:"Delete",variant:"danger"})&&a.mutate(e)},className:"rounded-[2px] p-1 text-muted-foreground hover:bg-signal-rose/10 hover:text-signal-rose",title:"Delete provider",children:c.jsx(Ko,{className:"h-3 w-3"})})]}),o&&c.jsxs("div",{className:"pb-2 pl-8 pr-4",children:[c.jsxs("div",{className:"mb-1 font-mono text-[9px] uppercase tracking-[0.12em] text-muted-foreground",children:["Base URL: ",c.jsx("span",{className:"text-foreground/70",children:t.baseUrl})]}),t.models.length===0&&c.jsx("p",{className:"py-1 font-mono text-[10px] text-muted-foreground",children:"No models."}),t.models.map(d=>c.jsxs("div",{className:"flex items-center gap-2 rounded-[2px] px-2 py-1 transition-colors hover:bg-muted/50",children:[c.jsx("span",{className:"flex-1 font-mono text-[11px] text-foreground",children:d.name}),c.jsx("span",{className:"font-mono text-[9px] text-muted-foreground",children:d.id}),d.reasoning&&c.jsx("span",{className:"rounded-sm bg-brand/10 px-1 py-0.5 font-mono text-[8px] uppercase text-brand",children:"reasoning"}),c.jsx("button",{type:"button",onClick:()=>i(d),className:"rounded-[2px] p-0.5 text-muted-foreground hover:text-foreground",title:"Edit model",children:c.jsx(wf,{className:"h-2.5 w-2.5"})}),c.jsx("button",{type:"button",onClick:async()=>{await f({title:"Delete model",message:`Delete model "${d.name}"?`,confirmLabel:"Delete",variant:"danger"})&&u.mutate({provider:e,modelId:d.id})},className:"rounded-[2px] p-0.5 text-muted-foreground hover:text-signal-rose",title:"Delete model",children:c.jsx(Ko,{className:"h-2.5 w-2.5"})})]},d.id)),c.jsxs("button",{type:"button",onClick:s,className:"mt-1 flex items-center gap-1 font-mono text-[10px] text-brand/70 transition-colors hover:text-brand",children:[c.jsx(Ru,{className:"h-2.5 w-2.5"})," Add Model"]})]})]})}function dy({workspaceId:e,initialName:t,initialConfig:n,onDone:r}){var C,k;const i=!!n,[s,o]=j.useState(t),[l,a]=j.useState((n==null?void 0:n.baseUrl)??""),[u,f]=j.useState(n!=null&&n.api&&!cy.includes(n.api)?"__custom__":(n==null?void 0:n.api)??"anthropic-messages"),[d,h]=j.useState(n!=null&&n.api&&!cy.includes(n.api)?n.api:""),[p,m]=j.useState((n==null?void 0:n.apiKey)??""),[x,v]=j.useState(((C=n==null?void 0:n.compat)==null?void 0:C.forceAdaptiveThinking)===!0),g=wO(e),[y,b]=j.useState(null),w=P=>{P.preventDefault(),b(null);const I=u==="__custom__"?d:u;if(!I){b("API type is required.");return}const A={baseUrl:l,api:I,apiKey:p,...x?{compat:{forceAdaptiveThinking:!0}}:{},models:(n==null?void 0:n.models)??[]};g.mutate({name:s,provider:A},{onSuccess:()=>r()})};return c.jsxs("form",{onSubmit:w,className:"flex flex-1 flex-col overflow-y-auto",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/50 px-4 py-2",children:[c.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:i?"Edit Provider":"New Provider"}),c.jsx("button",{type:"button",onClick:r,className:"font-mono text-[10px] text-muted-foreground hover:text-foreground",children:"Cancel"})]}),c.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[c.jsx(ut,{label:"Name",required:!0,children:c.jsx("input",{value:s,onChange:P=>o(P.target.value),placeholder:"e.g. my-provider",disabled:i,className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40 disabled:opacity-50",required:!0})}),c.jsx(ut,{label:"Base URL",required:!0,children:c.jsx("input",{value:l,onChange:P=>a(P.target.value),placeholder:"https://api.example.com",className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40",required:!0})}),c.jsxs(ut,{label:"API Type",required:!0,children:[c.jsxs("select",{value:u,onChange:P=>f(P.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40",children:[c.jsx("option",{value:"anthropic-messages",children:"anthropic-messages"}),c.jsx("option",{value:"openai-completions",children:"openai-completions"}),c.jsx("option",{value:"openai-responses",children:"openai-responses"}),c.jsx("option",{value:"azure-openai-responses",children:"azure-openai-responses"}),c.jsx("option",{value:"openai-codex-responses",children:"openai-codex-responses"}),c.jsx("option",{value:"mistral-conversations",children:"mistral-conversations"}),c.jsx("option",{value:"bedrock-converse-stream",children:"bedrock-converse-stream"}),c.jsx("option",{value:"google-generative-ai",children:"google-generative-ai"}),c.jsx("option",{value:"google-vertex",children:"google-vertex"}),c.jsx("option",{value:"__custom__",children:"Custom..."})]}),u==="__custom__"&&c.jsx("input",{value:d,onChange:P=>h(P.target.value),placeholder:"custom-api-type",className:"mt-1.5 w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40",required:!0})]}),c.jsx(ut,{label:"API Key",required:!0,children:c.jsx("input",{type:"password",value:p,onChange:P=>m(P.target.value),placeholder:"sk-...",className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40",required:!0})}),c.jsxs("label",{className:"flex items-center gap-2",children:[c.jsx("input",{type:"checkbox",checked:x,onChange:P=>v(P.target.checked),className:"h-3 w-3 accent-[hsl(var(--brand))]"}),c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:"Force Adaptive Thinking"})]})]}),c.jsxs("div",{className:"flex justify-end gap-2 border-t border-border/50 px-4 py-3",children:[c.jsx("button",{type:"button",onClick:r,className:"rounded-[2px] border border-border-soft px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground hover:text-foreground",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:g.isPending,className:"rounded-[2px] bg-brand/10 px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.12em] text-brand hover:bg-brand/20 disabled:opacity-50",children:g.isPending?"Saving...":i?"Update":"Create"})]}),(y||g.isError)&&c.jsx("p",{className:"mx-4 mb-3 font-mono text-[10px] text-signal-rose",children:y??((k=g.error)==null?void 0:k.message)})]})}function fy({workspaceId:e,provider:t,initialModel:n,onDone:r}){var q,S,X,ue,_,ie,He;const i=!!n,[s,o]=j.useState((n==null?void 0:n.id)??""),[l,a]=j.useState((n==null?void 0:n.name)??""),[u,f]=j.useState((n==null?void 0:n.reasoning)??!0),[d,h]=j.useState(String((n==null?void 0:n.contextWindow)??2e5)),[p,m]=j.useState(String((n==null?void 0:n.maxTokens)??32e3)),[x,v]=j.useState(String(((q=n==null?void 0:n.cost)==null?void 0:q.input)??0)),[g,y]=j.useState(String(((S=n==null?void 0:n.cost)==null?void 0:S.output)??0)),[b,w]=j.useState(String(((X=n==null?void 0:n.cost)==null?void 0:X.cacheRead)??0)),[C,k]=j.useState(String(((ue=n==null?void 0:n.cost)==null?void 0:ue.cacheWrite)??0)),[P,I]=j.useState(((_=n==null?void 0:n.thinkingLevelMap)==null?void 0:_.high)??"high"),[A,N]=j.useState(((ie=n==null?void 0:n.thinkingLevelMap)==null?void 0:ie.xhigh)??"max"),[R,L]=j.useState(n!=null&&n.headers?JSON.stringify(n.headers,null,2):""),V=SO(e),W=CO(e),G=i?W:V,[re,fe]=j.useState(null),$=Q=>{Q.preventDefault(),fe(null);let Me;if(R.trim())try{Me=JSON.parse(R)}catch{fe("Headers must be valid JSON.");return}const gt={id:s,name:l,reasoning:u,input:["text"],contextWindow:Number(d),maxTokens:Number(p),cost:{input:Number(x),output:Number(g),cacheRead:Number(b),cacheWrite:Number(C)},...u?{thinkingLevelMap:{high:P,xhigh:A}}:{},...Me?{headers:Me}:{}};i?W.mutate({provider:t,modelId:n.id,model:gt},{onSuccess:()=>r()}):V.mutate({provider:t,model:gt},{onSuccess:()=>r()})};return c.jsxs("form",{onSubmit:$,className:"flex flex-1 flex-col overflow-y-auto",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/50 px-4 py-2",children:[c.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:[i?"Edit Model":"New Model"," · ",t]}),c.jsx("button",{type:"button",onClick:r,className:"font-mono text-[10px] text-muted-foreground hover:text-foreground",children:"Cancel"})]}),c.jsxs("div",{className:"flex flex-col gap-3 overflow-y-auto p-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(ut,{label:"Model ID",required:!0,children:c.jsx("input",{value:s,onChange:Q=>o(Q.target.value),placeholder:"claude-opus-4-7",disabled:i,className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40 disabled:opacity-50",required:!0})}),c.jsx(ut,{label:"Display Name",required:!0,children:c.jsx("input",{value:l,onChange:Q=>a(Q.target.value),placeholder:"Claude Opus 4.7",className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40",required:!0})})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(ut,{label:"Context Window",children:c.jsx("input",{type:"number",value:d,onChange:Q=>h(Q.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})}),c.jsx(ut,{label:"Max Tokens",children:c.jsx("input",{type:"number",value:p,onChange:Q=>m(Q.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})})]}),c.jsxs("label",{className:"flex items-center gap-2",children:[c.jsx("input",{type:"checkbox",checked:u,onChange:Q=>f(Q.target.checked),className:"h-3 w-3 accent-[hsl(var(--brand))]"}),c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:"Supports Reasoning"})]}),u&&c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(ut,{label:"Thinking High maps to",children:c.jsx("input",{value:P,onChange:Q=>I(Q.target.value),placeholder:"high",className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})}),c.jsx(ut,{label:"Thinking XHigh maps to",children:c.jsx("input",{value:A,onChange:Q=>N(Q.target.value),placeholder:"max",className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})})]}),c.jsxs("fieldset",{className:"rounded-[2px] border border-border/50 p-3",children:[c.jsx("legend",{className:"px-1 font-mono text-[9px] uppercase tracking-[0.16em] text-muted-foreground",children:"Cost (per million tokens)"}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsx(ut,{label:"Input",children:c.jsx("input",{type:"number",step:"0.01",value:x,onChange:Q=>v(Q.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})}),c.jsx(ut,{label:"Output",children:c.jsx("input",{type:"number",step:"0.01",value:g,onChange:Q=>y(Q.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})}),c.jsx(ut,{label:"Cache Read",children:c.jsx("input",{type:"number",step:"0.01",value:b,onChange:Q=>w(Q.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})}),c.jsx(ut,{label:"Cache Write",children:c.jsx("input",{type:"number",step:"0.01",value:C,onChange:Q=>k(Q.target.value),className:"w-full rounded-[2px] border border-border-soft bg-background px-2 py-1 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})})]})]}),c.jsx(ut,{label:"Custom Headers (JSON)",children:c.jsx("textarea",{value:R,onChange:Q=>L(Q.target.value),placeholder:'{"User-Agent": "..."}',rows:3,className:"w-full resize-none rounded-[2px] border border-border-soft bg-background px-2 py-1.5 font-mono text-[11px] text-foreground outline-none focus:border-brand/40"})})]}),c.jsxs("div",{className:"flex justify-end gap-2 border-t border-border/50 px-4 py-3",children:[c.jsx("button",{type:"button",onClick:r,className:"rounded-[2px] border border-border-soft px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground hover:text-foreground",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:G.isPending,className:"rounded-[2px] bg-brand/10 px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.12em] text-brand hover:bg-brand/20 disabled:opacity-50",children:G.isPending?"Saving...":i?"Update":"Create"})]}),(re||G.isError)&&c.jsx("p",{className:"mx-4 mb-3 font-mono text-[10px] text-signal-rose",children:re??((He=G.error)==null?void 0:He.message)})]})}function ut({label:e,required:t,children:n}){return c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block font-mono text-[9px] uppercase tracking-[0.16em] text-muted-foreground",children:[e,t&&c.jsx("span",{className:"text-signal-rose",children:" *"})]}),n]})}function IO({workspaceId:e,open:t,onClose:n}){return t?c.jsxs("aside",{className:"flex h-full w-[320px] shrink-0 flex-col border-l border-border bg-popover",children:[c.jsx(TO,{onClose:n}),c.jsx("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-4",children:c.jsx(AO,{workspaceId:e})})]}):null}function TO({onClose:e}){return c.jsxs("header",{className:"flex h-[44px] items-center justify-between border-b border-border-soft px-4",children:[c.jsx("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Configuration"}),c.jsx(ss,{onClick:e,title:"Close","aria-label":"Close config panel",children:c.jsx(Ei,{className:"h-3.5 w-3.5"})})]})}function AO({workspaceId:e}){const t=Re(o=>o.sessionPath),n=Re(o=>o.running),{data:r,isLoading:i,error:s}=Zb(e,t);return i?c.jsxs("div",{className:"flex items-center justify-center py-8 text-[12px] text-muted-foreground",children:[c.jsx(Et,{className:"h-3.5 w-3.5 animate-spin"}),c.jsx("span",{className:"ml-2",children:"Loading config…"})]}):s||!r?c.jsx("p",{className:"rounded-md border border-signal-error/[0.30] bg-signal-error/[0.08] px-3 py-2 text-center text-[12px] text-signal-error",children:(s==null?void 0:s.message)??"Failed to load config"}):c.jsxs(c.Fragment,{children:[n&&c.jsx("p",{className:"rounded-md border border-brand/[0.22] bg-brand/[0.08] px-3 py-1.5 text-center text-[11.5px] text-brand",children:"Read-only · agent running"}),c.jsx(RO,{workspaceId:e,currentModel:r.currentModel,availableModels:r.availableModels,disabled:n}),c.jsx(DO,{workspaceId:e,level:r.thinkingLevel,availableLevels:r.availableThinkingLevels,disabled:n}),c.jsx($O,{workspaceId:e,activeTools:r.activeTools,allTools:r.allTools,disabled:n})]})}function RO({workspaceId:e,currentModel:t,availableModels:n,disabled:r}){const i=f_(e),[s,o]=j.useState(!1),l=t?`${t.provider}/${t.modelId}`:"";return c.jsxs("section",{children:[c.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[c.jsx(hu,{children:"Model"}),c.jsxs("button",{type:"button",onClick:()=>o(!0),className:"inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[11.5px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",title:"Manage model configurations",children:[c.jsx(o1,{className:"h-3 w-3"})," Manage"]})]}),c.jsx(LO,{currentKey:l,availableModels:n,disabled:r||i.isPending,onSelect:(a,u)=>i.mutate({provider:a,modelId:u})}),i.isError&&c.jsx("p",{className:"mt-1.5 text-[11.5px] text-signal-error",children:i.error.message}),c.jsx(EO,{workspaceId:e,open:s,onClose:()=>o(!1)})]})}function LO({currentKey:e,availableModels:t,disabled:n,onSelect:r}){const[i,s]=j.useState(!1),o=j.useRef(null),l=j.useRef(null),a=j.useRef(null),u=j.useRef(null),f=j.useRef(!1);j.useEffect(()=>{if(!i)return;const m=v=>{o.current&&!o.current.contains(v.target)&&s(!1)},x=v=>{var g,y;if(v.key==="Escape"){v.preventDefault(),f.current=!0,s(!1);return}if(v.key==="Tab"){(g=l.current)==null||g.focus(),s(!1);return}if(v.key==="ArrowDown"||v.key==="ArrowUp"||v.key==="Home"||v.key==="End"){const b=a.current;if(!b)return;const w=Array.from(b.querySelectorAll('[role="option"]'));if(w.length===0)return;v.preventDefault();const C=w.indexOf(document.activeElement),k=v.key==="ArrowDown"?C<0?0:Math.min(C+1,w.length-1):v.key==="ArrowUp"?C<0?w.length-1:Math.max(C-1,0):v.key==="Home"?0:w.length-1;(y=w[k])==null||y.focus()}};return document.addEventListener("mousedown",m),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",x)}},[i]),j.useLayoutEffect(()=>{var m,x;if(i){const v=u.current??((m=a.current)==null?void 0:m.querySelector('[role="option"]'));v==null||v.scrollIntoView({block:"nearest"}),v==null||v.focus({preventScroll:!0})}else f.current&&(f.current=!1,(x=l.current)==null||x.focus())},[i]);const d=t.find(m=>`${m.provider}/${m.modelId}`===e),h=(d==null?void 0:d.name)??"Select model",p=(d==null?void 0:d.modelId)??h;return c.jsxs("div",{ref:o,className:"relative",children:[c.jsxs("button",{ref:l,type:"button",onClick:()=>s(m=>!m),disabled:n,"aria-label":"Model","aria-haspopup":"listbox","aria-expanded":i,title:p,className:B("flex w-full items-center gap-1.5 rounded-md border bg-card px-3 py-2 text-[12.5px] text-foreground outline-none ring-brand-focus transition-colors","disabled:cursor-not-allowed disabled:opacity-50",i?"border-brand/[0.30]":"border-border hover:border-border-hi"),children:[c.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:h}),c.jsx(Os,{className:B("h-3 w-3 shrink-0 text-muted-foreground transition-transform",i&&"rotate-180")})]}),i&&c.jsxs("div",{ref:a,role:"listbox","aria-label":"Available models",className:"absolute left-0 right-0 top-full z-50 mt-1.5 overflow-hidden rounded-md border border-border bg-popover shadow-panel",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border-soft bg-muted px-3 py-2 text-[11.5px] text-muted-foreground",children:[c.jsx("span",{className:"font-medium text-foreground",children:"Available models"}),t.length>0&&c.jsx("span",{className:"font-mono tabular-nums",children:t.length})]}),c.jsxs("div",{className:"max-h-72 overflow-y-auto py-1",children:[t.length===0&&c.jsx("div",{className:"px-3 py-3 text-[12px] text-muted-foreground",children:"No models available."}),t.map(m=>{const x=`${m.provider}/${m.modelId}`,v=x===e;return c.jsxs("button",{ref:v?u:void 0,type:"button",role:"option","aria-selected":v,onClick:()=>{f.current=!0,s(!1),v||r(m.provider,m.modelId)},title:`${m.provider}/${m.modelId}`,className:B("flex w-full items-start gap-2 px-3 py-1.5 text-left text-[12.5px] transition-colors ring-brand-focus focus:bg-accent/60 focus:outline-none",v?"bg-brand/[0.08] text-brand-strong":"text-foreground hover:bg-accent/60"),children:[c.jsx(Ms,{className:B("mt-0.5 h-3 w-3 shrink-0",v?"opacity-100":"opacity-0")}),c.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[c.jsx("span",{className:"truncate",children:m.name}),c.jsxs("span",{className:B("truncate font-mono text-[11px]",v?"text-brand":"text-muted-foreground"),children:[m.provider,"/",m.modelId]})]})]},x)})]})]})]})}const MO={off:"Off",minimal:"Min",low:"Low",medium:"Med",high:"High",xhigh:"Max"},OO={off:"Off",minimal:"Minimal",low:"Low",medium:"Medium",high:"High",xhigh:"Extra high"};function DO({workspaceId:e,level:t,availableLevels:n,disabled:r}){const i=h_(e);return n.length===0?c.jsxs("section",{children:[c.jsx(hu,{children:"Thinking"}),c.jsx("p",{className:"text-[12px] text-muted-foreground",children:"Model has no thinking support."})]}):c.jsxs("section",{children:[c.jsx(hu,{children:"Thinking"}),c.jsx("div",{className:"flex gap-0.5 rounded-md border border-border bg-card p-1",children:n.map(s=>c.jsx("button",{type:"button",onClick:()=>i.mutate({level:s}),disabled:r||i.isPending,title:OO[s]??s,className:B("min-w-0 flex-1 truncate rounded-[6px] px-1.5 py-1.5 text-[12px] font-medium transition-colors ring-brand-focus",s===t?"bg-brand/[0.08] text-brand-strong":"text-muted-foreground hover:text-foreground",(r||i.isPending)&&"opacity-50"),children:MO[s]??s},s))}),i.isError&&c.jsx("p",{className:"mt-1.5 text-[11.5px] text-signal-error",children:i.error.message})]})}function $O({workspaceId:e,activeTools:t,allTools:n,disabled:r}){const i=p_(e),s=new Set(t),o=(l,a)=>{const u=a?[...t,l]:t.filter(f=>f!==l);i.mutate({tools:u})};return c.jsxs("section",{children:[c.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[c.jsx(hu,{children:"Tools"}),c.jsx(_t,{tone:"ghost",children:c.jsxs("span",{className:"font-mono text-[10.5px] tabular-nums",children:[t.length,"/",n.length]})})]}),c.jsx("ul",{className:"flex flex-col gap-1.5",children:n.map(l=>c.jsx("li",{children:c.jsxs("label",{className:B("flex cursor-pointer items-start gap-2.5 rounded-md border border-border-soft bg-card px-3 py-2 transition-colors hover:border-border",s.has(l.name)&&"border-brand/[0.22] bg-brand/[0.04]",(r||i.isPending)&&"pointer-events-none opacity-50"),children:[c.jsx("input",{type:"checkbox",checked:s.has(l.name),onChange:a=>o(l.name,a.target.checked),disabled:r||i.isPending,className:"mt-[3px] h-3 w-3 shrink-0 accent-[hsl(var(--brand))]"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block font-mono text-[12px] text-foreground",children:l.name}),l.description&&c.jsx("span",{className:"mt-0.5 block truncate text-[11.5px] text-muted-foreground",children:l.description})]})]})},l.name))}),i.isError&&c.jsx("p",{className:"mt-1.5 text-[11.5px] text-signal-error",children:i.error.message})]})}function hu({children:e}){return c.jsx("h3",{className:"mb-1.5 text-[11.5px] font-medium text-muted-foreground",children:e})}let FO=0,zO=0;function BO(e){const t=ki(n=>n.pushToast);j.useEffect(()=>at.on(r=>{if(r.type!=="error")return;const i=r.command?`${r.command}: ${r.message}`:r.message;t({id:`wserr-${++FO}`,workspaceId:e??"",message:i,notifyType:"error"})}),[t,e])}function UO(){const e=ki(t=>t.pushToast);j.useEffect(()=>at.on(n=>{if(n.type!=="extension_error")return;const r=HO(n.extensionPath);e({id:`exterr-${++zO}`,workspaceId:n.workspaceId,message:`${r}: ${n.event}: ${n.message}`,notifyType:"error"})}),[e])}function GO(e){const t=ki(n=>n.pushToast);j.useEffect(()=>{},[t,e])}function HO(e){if(!e)return"extension";const t=e.replace(/\/+$/,""),n=t.split("/"),r=n.at(-1)||t;return/^(index|extension)\.(ts|js|mjs|cjs)$/.test(r)&&n.length>=2?n[n.length-2]:r.replace(/\.(ts|js|mjs|cjs)$/,"")}function qO(){const e=ki(n=>n.toasts),t=ki(n=>n.dismissToast);return c.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-40 flex w-72 flex-col gap-2",children:e.map(n=>c.jsx(WO,{toast:n,onClose:()=>t(n.id)},n.id))})}function WO({toast:e,onClose:t}){j.useEffect(()=>{const i=e.notifyType==="error"?8e3:4e3,s=setTimeout(t,i);return()=>clearTimeout(s)},[t,e.notifyType]);const n=e.notifyType==="error"||e.notifyType==="warning"?kf:e.notifyType==="info"?L_:I_,r=e.notifyType==="error"?"border-l-signal-error text-signal-error":e.notifyType==="warning"?"border-l-signal-warn text-signal-warn":"border-l-brand text-foreground";return c.jsxs("div",{className:B("pointer-events-auto flex items-start gap-2 rounded-[10px] border border-border bg-card p-3 text-[12.5px] shadow-glow-lg","border-l-[3px]",r),children:[c.jsx(n,{className:B("mt-0.5 h-3.5 w-3.5 shrink-0",e.notifyType==="info"&&"text-brand")}),c.jsx("div",{className:"flex-1 whitespace-pre-wrap break-words text-foreground",children:e.message}),c.jsx("button",{type:"button",onClick:t,className:"text-muted-foreground transition-colors hover:text-foreground","aria-label":"Dismiss",children:c.jsx(Ei,{className:"h-3 w-3"})})]})}function VO({workspaceId:e,request:t,onClose:n}){return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onMouseDown:r=>{r.target===r.currentTarget&&n()},children:c.jsxs("div",{className:"flex h-full max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-lg border border-border bg-card shadow-xl",children:[c.jsx(QO,{kind:t.kind,mode:t.mode,onClose:n}),t.mode==="create"?c.jsx(KO,{workspaceId:e,kind:t.kind,defaultScope:t.defaultScope,onDone:n}):c.jsx(XO,{workspaceId:e,kind:t.kind,filePath:t.filePath,onDone:n})]})})}function QO({kind:e,mode:t,onClose:n}){const r=t==="create"?e==="skill"?"New skill":"New prompt template":e==="skill"?"Edit skill":"Edit prompt template";return c.jsxs("header",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[c.jsx("h2",{className:"text-sm font-semibold text-foreground",children:r}),c.jsx("button",{type:"button",onClick:n,className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-label":"Close editor",children:c.jsx(Ei,{className:"h-4 w-4"})})]})}function KO({workspaceId:e,kind:t,defaultScope:n,onDone:r}){var k,P;const[i,s]=j.useState(n),[o,l]=j.useState(""),[a,u]=j.useState(""),[f,d]=j.useState(""),[h,p]=j.useState(!1),[m,x]=j.useState(t==="skill"?YO:""),v=b_(e),g=S_(e),y=v.isPending||g.isPending,b=((k=v.error)==null?void 0:k.message)??((P=g.error)==null?void 0:P.message),w=async()=>{try{t==="skill"?await v.mutateAsync({scope:i,name:o.trim(),description:a.trim(),body:m,disableModelInvocation:h||void 0}):await g.mutateAsync({scope:i,name:o.trim(),description:a.trim(),argumentHint:f.trim()||void 0,body:m}),r()}catch{}},C=!y&&o.trim().length>0&&a.trim().length>0&&m.length>0;return c.jsx(Lw,{kind:t,scope:i,onScopeChange:s,scopeLocked:!1,name:o,onNameChange:l,description:a,onDescriptionChange:u,argumentHint:f,onArgumentHintChange:d,disableModelInvocation:h,onDisableModelInvocationChange:p,body:m,onBodyChange:x,submitLabel:"Create",canSubmit:C,pending:y,error:b,onSubmit:w,onCancel:r})}function XO({workspaceId:e,kind:t,filePath:n,onDone:r}){var L,V,W;const i=y_(e,t==="skill"?n:void 0),s=k_(e,t==="prompt"?n:void 0),o=t==="skill"?i.data:s.data,l=(L=t==="skill"?i.error:s.error)==null?void 0:L.message,a=t==="skill"?i.isLoading:s.isLoading,[u,f]=j.useState(!1),[d]=j.useState(void 0),[h,p]=j.useState(""),[m,x]=j.useState(""),[v,g]=j.useState(""),[y,b]=j.useState(!1),[w,C]=j.useState("");j.useEffect(()=>{!o||u||(p(o.name),x(o.description),g(o.argumentHint??""),b(!!o.disableModelInvocation),C(o.body),f(!0))},[o,u]);const k=v_(e),P=C_(e),I=k.isPending||P.isPending,A=((V=k.error)==null?void 0:V.message)??((W=P.error)==null?void 0:W.message),N=async()=>{try{t==="skill"?await k.mutateAsync({filePath:n,name:h.trim(),description:m.trim(),body:w,disableModelInvocation:y||void 0}):await P.mutateAsync({filePath:n,name:h.trim(),description:m.trim(),argumentHint:v.trim()||void 0,body:w}),r()}catch{}};if(a)return c.jsxs("div",{className:"flex flex-1 items-center justify-center text-muted-foreground",children:[c.jsx(Et,{className:"h-4 w-4 animate-spin"}),c.jsx("span",{className:"ml-2 text-xs",children:"Loading file\\u2026"})]});if(l||!o)return c.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-4 text-xs text-signal-rose",children:[c.jsx("p",{children:l??"Failed to load file"}),c.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-input bg-background px-3 py-1.5 text-foreground",children:"Close"})]});const R=u&&!I&&h.trim().length>0&&m.trim().length>0&&w.length>0;return c.jsx(Lw,{kind:t,scope:d??o.scope,onScopeChange:()=>{},scopeLocked:!0,scopeLockedReason:"Move the file on disk to change scope.",name:h,onNameChange:p,description:m,onDescriptionChange:x,argumentHint:v,onArgumentHintChange:g,disableModelInvocation:y,onDisableModelInvocationChange:b,body:w,onBodyChange:C,filePath:o.filePath,submitLabel:"Save",canSubmit:R,pending:I,error:A,onSubmit:N,onCancel:r})}function Lw(e){return c.jsxs("form",{className:"flex min-h-0 flex-1 flex-col",onSubmit:t=>{t.preventDefault(),e.canSubmit&&e.onSubmit()},children:[c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-4",children:[e.filePath&&c.jsx("p",{className:"truncate font-mono text-[10px] text-muted-foreground",title:e.filePath,children:e.filePath}),c.jsxs(Oi,{label:"Scope",children:[c.jsxs("div",{className:"flex gap-1",children:[c.jsx(hy,{active:e.scope==="project",onClick:()=>e.onScopeChange("project"),disabled:e.scopeLocked,children:"Project"}),c.jsx(hy,{active:e.scope==="user",onClick:()=>e.onScopeChange("user"),disabled:e.scopeLocked,children:"User"})]}),c.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:e.scopeLocked?e.scopeLockedReason??"Scope is fixed for existing files.":e.scope==="project"?`Lives in <workspace>/.pi/${e.kind==="skill"?"skills":"prompts"}/`:`Lives in ~/.pi/agent/${e.kind==="skill"?"skills":"prompts"}/`})]}),c.jsxs(Oi,{label:e.kind==="skill"?"Name":"Name (becomes /name)",children:[c.jsx("input",{type:"text",value:e.name,onChange:t=>e.onNameChange(t.target.value),placeholder:e.kind==="skill"?"pdf-tools":"review-pr",className:"w-full rounded-md border border-input bg-background px-3 py-1.5 text-sm font-mono outline-none focus:ring-1 focus:ring-ring"}),c.jsxs("p",{className:"mt-1 text-[11px] text-muted-foreground",children:["Lowercase a-z, 0-9, hyphens",e.kind==="prompt"?" or underscores":"","; 1\\u201364 chars."]})]}),c.jsx(Oi,{label:"Description",children:c.jsx("textarea",{value:e.description,onChange:t=>e.onDescriptionChange(t.target.value),rows:2,placeholder:e.kind==="skill"?"What this skill does and when to use it. Be specific.":"What this prompt template does.",className:"w-full resize-y rounded-md border border-input bg-background px-3 py-1.5 text-sm outline-none focus:ring-1 focus:ring-ring"})}),e.kind==="skill"?c.jsx(Oi,{label:"",children:c.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-xs",children:[c.jsx("input",{type:"checkbox",checked:e.disableModelInvocation,onChange:t=>e.onDisableModelInvocationChange(t.target.checked),className:"mt-0.5 accent-primary"}),c.jsxs("span",{children:[c.jsx("span",{className:"font-medium text-foreground",children:"Manual invocation only"}),c.jsxs("span",{className:"block text-muted-foreground",children:["Hide from the system prompt. Users must explicitly run /skill:",e.name||"name","."]})]})]})}):c.jsxs(Oi,{label:"Argument hint (optional)",children:[c.jsx("input",{type:"text",value:e.argumentHint,onChange:t=>e.onArgumentHintChange(t.target.value),placeholder:"<file> [--flag]",className:"w-full rounded-md border border-input bg-background px-3 py-1.5 text-sm font-mono outline-none focus:ring-1 focus:ring-ring"}),c.jsxs("p",{className:"mt-1 text-[11px] text-muted-foreground",children:["Shown in autocomplete, e.g. ",c.jsx("code",{className:"font-mono",children:"<PR-URL>"}),"."]})]}),c.jsxs(Oi,{label:"Body (markdown)",children:[c.jsx("textarea",{value:e.body,onChange:t=>e.onBodyChange(t.target.value),rows:14,spellCheck:!1,className:"w-full resize-y rounded-md border border-input bg-background px-3 py-1.5 font-mono text-xs outline-none focus:ring-1 focus:ring-ring"}),e.kind==="prompt"&&c.jsxs("p",{className:"mt-1 text-[11px] text-muted-foreground",children:["Use ",c.jsx("code",{className:"font-mono",children:"$1"}),", ",c.jsx("code",{className:"font-mono",children:"$2"}),", ",c.jsx("code",{className:"font-mono",children:"$@"}),", ",c.jsxs("code",{className:"font-mono",children:["$","{@:N}"]}),", ",c.jsxs("code",{className:"font-mono",children:["$","{@:N:L}"]})," for arguments."]})]}),e.error&&c.jsx("p",{className:"rounded-md border border-signal-rose/40 bg-signal-rose/10 px-3 py-1.5 text-xs text-signal-rose",children:e.error})]}),c.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-border px-4 py-2",children:[c.jsx("button",{type:"button",onClick:e.onCancel,disabled:e.pending,className:"rounded-md border border-input bg-background px-3 py-1.5 text-sm text-foreground hover:bg-accent disabled:opacity-50",children:"Cancel"}),c.jsxs("button",{type:"submit",disabled:!e.canSubmit,className:"inline-flex items-center gap-1 rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground disabled:opacity-50",children:[e.pending&&c.jsx(Et,{className:"h-3.5 w-3.5 animate-spin"}),e.submitLabel]})]})]})}function Oi({label:e,children:t}){return c.jsxs("div",{children:[e&&c.jsx("label",{className:"mb-1 block text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e}),t]})}function hy({active:e,disabled:t,onClick:n,children:r}){return c.jsx("button",{type:"button",onClick:n,disabled:t,className:B("rounded-md border px-3 py-1 text-xs transition-colors",e?"border-primary bg-primary text-primary-foreground":"border-input bg-background text-foreground hover:bg-accent",t&&"cursor-not-allowed opacity-60 hover:bg-background"),children:r})}const YO=`# Skill name
|
|
399
|
+
|
|
400
|
+
Describe what the skill does, when to use it, and any setup steps.
|
|
401
|
+
|
|
402
|
+
## Usage
|
|
403
|
+
|
|
404
|
+
\`\`\`bash
|
|
405
|
+
./scripts/example.sh <input>
|
|
406
|
+
\`\`\`
|
|
407
|
+
`;function JO({workspaceId:e,open:t,onClose:n}){return t?c.jsx("aside",{className:"flex h-full w-[320px] shrink-0 flex-col border-l border-border bg-popover",children:c.jsx(ZO,{workspaceId:e,onClose:n})}):null}function ZO({workspaceId:e,onClose:t}){const{data:n,isLoading:r,error:i}=rp(e),s=g_(e),[o,l]=j.useState("skills"),[a,u]=j.useState(null),f=m=>u({kind:m,mode:"create",defaultScope:"project"}),d=(m,x)=>u({kind:m,mode:"edit",filePath:x}),h={skills:(n==null?void 0:n.skills.length)??0,prompts:(n==null?void 0:n.prompts.length)??0,extensions:((n==null?void 0:n.builtinExtensions.length)??0)+((n==null?void 0:n.extensions.filter(m=>m.source.label!=="inline").length)??0)},p=h.skills+h.prompts+h.extensions;return r?c.jsxs(c.Fragment,{children:[c.jsx(cd,{total:0,onReload:()=>s.mutate(),reloading:s.isPending,onClose:t}),c.jsxs("div",{className:"flex flex-1 items-center justify-center text-[12px] text-muted-foreground",children:[c.jsx(Et,{className:"h-3.5 w-3.5 animate-spin"}),c.jsx("span",{className:"ml-2",children:"Loading resources…"})]})]}):i||!n?c.jsxs(c.Fragment,{children:[c.jsx(cd,{total:0,onReload:()=>s.mutate(),reloading:s.isPending,onClose:t}),c.jsx("p",{className:"px-4 py-4 text-center text-[12.5px] text-signal-error",children:(i==null?void 0:i.message)??"Failed to load resources"})]}):c.jsxs(c.Fragment,{children:[c.jsx(cd,{total:p,onReload:()=>s.mutate(),reloading:s.isPending,onClose:t}),s.isError&&c.jsx("p",{className:"border-b border-signal-error/[0.30] bg-signal-error/[0.08] px-4 py-1.5 text-[11.5px] text-signal-error",children:s.error.message}),c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[c.jsxs("div",{className:"flex gap-1 border-b border-border-soft px-3 pb-1 pt-2",children:[c.jsx(dd,{active:o==="skills",onClick:()=>l("skills"),label:"Skills",count:h.skills}),c.jsx(dd,{active:o==="prompts",onClick:()=>l("prompts"),label:"Prompts",count:h.prompts}),c.jsx(dd,{active:o==="extensions",onClick:()=>l("extensions"),label:"Extensions",count:h.extensions})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[o==="skills"&&c.jsx(e4,{workspaceId:e,skills:n.skills,onNew:()=>f("skill"),onEdit:m=>d("skill",m.filePath)}),o==="prompts"&&c.jsx(t4,{workspaceId:e,prompts:n.prompts,onNew:()=>f("prompt"),onEdit:m=>d("prompt",m.filePath)}),o==="extensions"&&c.jsx(n4,{workspaceId:e,builtinExtensions:n.builtinExtensions,extensionsEnabled:n.extensionsEnabled,extensions:n.extensions,errors:n.extensionErrors,disabledExtensions:n.disabledExtensions})]})]}),a&&c.jsx(VO,{workspaceId:e,request:a,onClose:()=>u(null)})]})}function cd({total:e,onReload:t,reloading:n,onClose:r}){return c.jsxs("header",{className:"flex h-[44px] items-center gap-1 border-b border-border-soft px-4",children:[c.jsxs("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:["Resources",e>0&&c.jsx("span",{className:"ml-1.5 text-muted-foreground/60",children:e})]}),c.jsx("span",{className:"flex-1"}),c.jsx(ss,{onClick:t,disabled:n,title:"Reload resources","aria-label":"Reload resources",children:c.jsx(D_,{className:B("h-3.5 w-3.5",n&&"animate-spin")})}),c.jsx(ss,{onClick:r,title:"Close","aria-label":"Close resources panel",children:c.jsx(Ei,{className:"h-3.5 w-3.5"})})]})}function dd({active:e,onClick:t,label:n,count:r}){return c.jsxs("button",{type:"button",onClick:t,className:B("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors ring-brand-focus",e?"bg-brand/[0.08] text-brand-strong":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:[c.jsx("span",{children:n}),c.jsx("span",{className:"font-mono text-[10.5px] tabular-nums opacity-70",children:r})]})}function e4({workspaceId:e,skills:t,onNew:n,onEdit:r}){const i=w_(e),s=Sl(),o=async l=>{await s({title:"Delete skill",message:`Delete skill "${l.name}"?
|
|
408
|
+
|
|
409
|
+
This removes ${l.filePath} and any sibling files in its directory.`,confirmLabel:"Delete",variant:"danger"})&&i.mutate({filePath:l.filePath})};return c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(Ow,{label:"New skill",onClick:n}),i.isError&&c.jsx("p",{className:"rounded-md border border-signal-error/[0.30] bg-signal-error/[0.08] px-2.5 py-1.5 text-[11.5px] text-signal-error",children:i.error.message}),t.length===0?c.jsx(Fw,{text:"No skills discovered."}):c.jsx("ul",{className:"flex flex-col gap-2",children:t.map(l=>{var a;return c.jsxs("li",{className:"rounded-[10px] border border-border-soft bg-card px-3 py-2.5 transition-colors hover:border-border",children:[c.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[c.jsx("span",{className:"truncate text-[13px] font-medium text-foreground",children:l.name}),c.jsx($p,{source:l.source})]}),l.description&&c.jsx("p",{className:"mt-1 text-[12px] text-muted-foreground",children:l.description}),l.disableModelInvocation&&c.jsxs("p",{className:"mt-1 text-[11.5px] italic text-muted-foreground",children:["Manual invocation only (/skill:",l.name,")"]}),c.jsx(Fp,{path:l.filePath}),l.managed?c.jsx($w,{onEdit:()=>r(l),onDelete:()=>o(l),deleting:i.isPending&&((a=i.variables)==null?void 0:a.filePath)===l.filePath}):c.jsx(Dw,{kind:"skill",source:l.source})]},l.filePath)})})]})}function t4({workspaceId:e,prompts:t,onNew:n,onEdit:r}){const i=__(e),s=Sl(),o=async l=>{await s({title:"Delete prompt",message:`Delete prompt template /${l.name}?
|
|
410
|
+
|
|
411
|
+
${l.filePath}`,confirmLabel:"Delete",variant:"danger"})&&i.mutate({filePath:l.filePath})};return c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(Ow,{label:"New prompt",onClick:n}),i.isError&&c.jsx("p",{className:"rounded-md border border-signal-error/[0.30] bg-signal-error/[0.08] px-2.5 py-1.5 text-[11.5px] text-signal-error",children:i.error.message}),t.length===0?c.jsx(Fw,{text:"No prompt templates discovered."}):c.jsx("ul",{className:"flex flex-col gap-2",children:t.map(l=>{var a;return c.jsxs("li",{className:"rounded-[10px] border border-border-soft bg-card px-3 py-2.5 transition-colors hover:border-border",children:[c.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[c.jsxs("span",{className:"truncate text-[13px] font-medium text-foreground",children:["/",l.name,l.argumentHint&&c.jsx("span",{className:"ml-1 font-normal text-muted-foreground",children:l.argumentHint})]}),c.jsx($p,{source:l.source})]}),l.description&&c.jsx("p",{className:"mt-1 text-[12px] text-muted-foreground",children:l.description}),c.jsxs("details",{className:"mt-1.5 text-[12px]",children:[c.jsx("summary",{className:"cursor-pointer select-none rounded px-1 -mx-1 text-muted-foreground hover:text-foreground",children:"View template"}),c.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md border border-border-soft bg-muted p-2 font-mono text-[11.5px] leading-relaxed text-foreground",children:l.content})]}),c.jsx(Fp,{path:l.filePath}),l.managed?c.jsx($w,{onEdit:()=>r(l),onDelete:()=>o(l),deleting:i.isPending&&((a=i.variables)==null?void 0:a.filePath)===l.filePath}):c.jsx(Dw,{kind:"prompt",source:l.source})]},l.filePath)})})]})}function n4({workspaceId:e,builtinExtensions:t,extensionsEnabled:n,extensions:r,errors:i,disabledExtensions:s}){const o=r.filter(l=>l.source.label!=="inline");return c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsx(r4,{workspaceId:e,builtins:t}),c.jsx(s4,{extensionsEnabled:n,extensions:o,errors:i,disabledExtensions:s})]})}function r4({workspaceId:e,builtins:t}){var i;const n=x_(e),r=n.isPending?(i=n.variables)==null?void 0:i.id:void 0;return c.jsxs("section",{className:"flex flex-col gap-2",children:[c.jsx(th,{children:"Built-in"}),n.isError&&c.jsx("p",{className:"rounded-md border border-signal-error/[0.30] bg-signal-error/[0.08] px-2.5 py-1.5 text-[11.5px] text-signal-error",children:n.error.message}),c.jsx("ul",{className:"flex flex-col gap-2",children:t.map(s=>{const o=r===s.id,l=o&&n.variables?n.variables.enabled:s.enabled;return c.jsxs("li",{className:"rounded-[10px] border border-border-soft bg-card px-3 py-2.5 transition-colors hover:border-border",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(Ni,{tool:s.id,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),c.jsx("span",{className:"truncate text-[13px] font-medium text-foreground",children:s.name})]}),c.jsx(i4,{checked:l,disabled:o,onChange:a=>n.mutate({id:s.id,enabled:a}),label:`${l?"Disable":"Enable"} ${s.name}`})]}),c.jsx("p",{className:"mt-1 text-[12px] leading-relaxed text-muted-foreground",children:s.description}),c.jsx(Mw,{facets:[{label:"tools",items:s.tools},{label:"commands",items:s.commands.map(a=>`/${a}`)}].filter(a=>a.items.length>0)})]},s.id)})})]})}function i4({checked:e,disabled:t,onChange:n,label:r}){return c.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":r,title:r,disabled:t,onClick:()=>n(!e),className:B("relative inline-flex h-[18px] w-[32px] shrink-0 items-center rounded-full border transition-colors ring-brand-focus disabled:cursor-not-allowed disabled:opacity-60",e?"border-brand/[0.30] bg-brand":"border-border bg-muted"),children:c.jsx("span",{className:B("inline-block h-3 w-3 rounded-full bg-white shadow-sm transition-transform",e?"translate-x-[15px]":"translate-x-[2px]")})})}function s4({extensionsEnabled:e,extensions:t,errors:n,disabledExtensions:r}){return e?c.jsxs("section",{className:"flex flex-col gap-2",children:[c.jsx(th,{children:"Third-party"}),t.length===0&&n.length===0&&c.jsxs("div",{className:"rounded-[10px] border border-border-soft bg-card px-3 py-3",children:[c.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Extensions enabled, none installed"}),c.jsxs("p",{className:"mt-1.5 text-[12px] leading-relaxed text-muted-foreground",children:[c.jsx("code",{className:"rounded bg-muted px-1 font-mono",children:"PI_PILOT_ENABLE_EXTENSIONS=1"})," is set but no extension modules were discovered under"," ",c.jsx("code",{className:"rounded bg-muted px-1 font-mono",children:"~/.pi/agent/extensions/"})," or"," ",c.jsx("code",{className:"rounded bg-muted px-1 font-mono",children:".pi/extensions/"}),"."]})]}),n.map(i=>c.jsxs("div",{className:"rounded-[10px] border border-signal-error/[0.30] bg-signal-error/[0.08] px-3 py-2.5 text-[12px] text-signal-error",children:[c.jsx("p",{className:"text-[11.5px] font-medium",children:"Failed to load"}),c.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-signal-error/80",children:i.path}),c.jsx("p",{className:"mt-1 break-words",children:i.error})]},i.path)),t.map(i=>c.jsxs("div",{className:"rounded-[10px] border border-border-soft bg-card px-3 py-2.5 transition-colors hover:border-border",children:[c.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[c.jsx("span",{className:"truncate text-[13px] font-medium text-foreground",children:py(i.path)}),c.jsx($p,{source:i.source})]}),c.jsx(o4,{ext:i}),c.jsx(Fp,{path:i.resolvedPath})]},i.resolvedPath))]}):c.jsxs("section",{className:"flex flex-col gap-3",children:[c.jsx(th,{children:"Third-party"}),c.jsxs("div",{className:"rounded-[10px] border border-border-soft bg-card px-3 py-3",children:[c.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Third-party extensions are not supported"}),c.jsx("p",{className:"mt-1.5 text-[12px] leading-relaxed text-muted-foreground",children:"The pi extension system is built for a terminal UI (custom renderers, ANSI themes, keyboard overlays). These APIs cannot be bridged to the Web in any meaningful way, so pi-pilot does not load extensions from disk by default."}),c.jsx("p",{className:"mt-2 text-[12px] leading-relaxed text-muted-foreground",children:"Skills, prompts, and the built-in extensions above work as usual; only third-party extension modules are skipped."})]}),r.length>0&&c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("p",{className:"px-1 text-[12px] font-medium text-muted-foreground",children:"Detected but disabled"}),r.map(i=>c.jsxs("div",{className:"flex items-center gap-2 rounded-[8px] border border-border-soft bg-muted/50 px-2.5 py-1.5",title:i,children:[c.jsx(P_,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),c.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:py(i)})]},i))]})]})}function th({children:e}){return c.jsx("h3",{className:"text-[11.5px] font-medium text-muted-foreground",children:e})}function o4({ext:e}){const t=[{label:"tools",items:e.tools},{label:"commands",items:e.commands.map(n=>`/${n}`)},{label:"flags",items:e.flags.map(n=>`--${n}`)},{label:"shortcuts",items:e.shortcuts}].filter(n=>n.items.length>0);return t.length===0?c.jsx("p",{className:"mt-1.5 text-[11.5px] italic text-muted-foreground",children:"No registrations."}):c.jsx(Mw,{facets:t})}function Mw({facets:e}){return c.jsx("dl",{className:"mt-1.5 flex flex-col gap-1 text-[11.5px]",children:e.map(t=>c.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[c.jsxs("dt",{className:"shrink-0 text-muted-foreground",children:[t.label,":"]}),c.jsx("dd",{className:"flex flex-wrap gap-1",children:t.items.map(n=>c.jsx("span",{className:"rounded border border-border-soft bg-muted px-1.5 py-px font-mono text-[10.5px] text-foreground",children:n},n))})]},t.label))})}function Ow({label:e,onClick:t}){return c.jsxs("button",{type:"button",onClick:t,className:"group inline-flex items-center justify-center gap-1.5 rounded-md border border-dashed border-border bg-transparent px-2 py-2 text-[12px] font-medium text-muted-foreground transition-colors hover:border-brand/[0.30] hover:text-brand ring-brand-focus",children:[c.jsx(Ru,{className:"h-3 w-3 transition-transform group-hover:rotate-90"}),e]})}function Dw({kind:e,source:t}){return c.jsxs("p",{className:"mt-1.5 text-[11px] text-muted-foreground",children:["Read-only · ",e," from ",t.label]})}function $w({onEdit:e,onDelete:t,deleting:n}){return c.jsxs("div",{className:"mt-2 flex justify-end gap-1.5",children:[c.jsxs("button",{type:"button",onClick:e,className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1 text-[11.5px] font-medium text-foreground transition-colors hover:border-brand/[0.30] hover:text-brand ring-brand-focus",children:[c.jsx(wf,{className:"h-3 w-3"})," Edit"]}),c.jsxs("button",{type:"button",onClick:t,disabled:n,className:"inline-flex items-center gap-1.5 rounded-md border border-signal-error/[0.30] bg-card px-2.5 py-1 text-[11.5px] font-medium text-signal-error transition-colors hover:bg-signal-error/[0.08] disabled:opacity-50 ring-brand-focus",children:[n?c.jsx(Et,{className:"h-3 w-3 animate-spin"}):c.jsx(Ko,{className:"h-3 w-3"})," ","Delete"]})]})}function $p({source:e}){const t=e.scope==="user"?"default":e.scope==="project"?"brand":"warn";return c.jsx(_t,{tone:t,className:"shrink-0",children:c.jsx("span",{title:e.label,children:e.scope})})}function Fp({path:e}){return c.jsx("p",{className:"mt-1.5 truncate font-mono text-[10.5px] tracking-[-0.005em] text-muted-foreground",title:e,children:e})}function Fw({text:e}){return c.jsx("p",{className:"py-8 text-center text-[12.5px] text-muted-foreground",children:e})}function py(e){return e.replace(/\/+$/,"").split("/").at(-1)||e}const zp=["workspaces"];function l4(){return kn({queryKey:zp,queryFn:()=>pe("/api/workspaces").then(e=>e.workspaces)})}function a4(){const e=Te();return Ue({mutationFn:async t=>(await pe("/api/workspaces",{method:"POST",body:JSON.stringify(t)})).workspace,onSuccess:()=>e.invalidateQueries({queryKey:zp})})}function u4(){const e=Te();return Ue({mutationFn:t=>pe(`/api/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>e.invalidateQueries({queryKey:zp})})}function c4({open:e,initialPath:t,onClose:n,onPick:r,error:i,busy:s}){const[o,l]=j.useState(t),[a,u]=j.useState(t??""),[f,d]=j.useState(!1),{data:h,isFetching:p,error:m}=$E(o,f,e),x=h==null?void 0:h.path;j.useEffect(()=>{x&&x!==o&&(l(x),u(x))},[x,o]),j.useEffect(()=>{e&&(l(t),u(t??""))},[e,t]);const v=j.useRef(n);if(j.useEffect(()=>{v.current=n},[n]),j.useEffect(()=>{if(!e)return;const b=w=>{w.key==="Escape"&&v.current()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[e]),!e)return null;const g=(h==null?void 0:h.path)??o??"",y=i??(m instanceof Error?m.message:void 0);return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onMouseDown:b=>{b.target===b.currentTarget&&n()},children:c.jsxs("div",{className:"flex h-[32rem] w-full max-w-2xl flex-col overflow-hidden rounded-xl border border-border bg-popover shadow-panel",children:[c.jsxs("header",{className:"flex items-center justify-between border-b border-border/70 bg-card/40 px-4 py-3",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[c.jsx(s1,{className:"h-4 w-4 text-brand"}),"Add workspace"]}),c.jsx("button",{type:"button",onClick:n,className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground ring-brand-focus","aria-label":"Close",children:c.jsx(Ei,{className:"h-4 w-4"})})]}),c.jsx(d4,{value:a,onChange:u,onSubmit:()=>{const b=a.trim();b&&l(b)}}),c.jsx(f4,{path:g,onJump:l}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:c.jsx(h4,{entries:(h==null?void 0:h.entries)??[],parent:(h==null?void 0:h.parent)??null,loading:p&&!h,error:m instanceof Error&&!h?m.message:void 0,onEnter:l})}),c.jsxs("footer",{className:"border-t border-border/70 bg-card/40 px-4 py-3",children:[c.jsxs("label",{className:"mb-2 flex items-center gap-2 text-xs text-muted-foreground",children:[c.jsx("input",{type:"checkbox",checked:f,onChange:b=>d(b.target.checked),className:"h-3.5 w-3.5 accent-[hsl(var(--brand))]"}),"Show hidden directories"]}),c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("p",{className:"flex-1 truncate font-mono text-xs text-foreground",children:g||"—"}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c.jsx("button",{type:"button",onClick:n,className:"rounded-md px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground ring-brand-focus",children:"Cancel"}),c.jsxs("button",{type:"button",disabled:!g||s,onClick:()=>void r(g),className:B("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ring-brand-focus",!g||s?"bg-muted text-muted-foreground/70 cursor-not-allowed":"bg-brand text-brand-foreground hover:bg-brand-strong shadow-glow-sm"),children:[s&&c.jsx(Et,{className:"h-3 w-3 animate-spin"}),"Add this folder"]})]})]}),y&&c.jsx("p",{className:"mt-2 rounded-md border border-signal-rose/40 bg-signal-rose/10 px-2 py-1 text-xs text-signal-rose",children:y})]})]})})}function d4({value:e,onChange:t,onSubmit:n}){const r=j.useRef(null);return j.useEffect(()=>{var i;(i=r.current)==null||i.focus()},[]),c.jsx("div",{className:"border-b border-border/70 bg-background/30 px-4 py-2",children:c.jsx("input",{ref:r,type:"text",value:e,onChange:i=>t(i.target.value),onKeyDown:i=>{i.key==="Enter"&&(i.preventDefault(),n())},placeholder:"/absolute/path (Enter to jump)",className:"w-full rounded-md border border-input bg-card/60 px-2.5 py-1.5 font-mono text-xs text-foreground outline-none transition-colors focus:border-brand/40 focus:ring-1 focus:ring-brand/40"})})}function f4({path:e,onJump:t}){const n=j.useMemo(()=>p4(e),[e]);return c.jsxs("nav",{className:"flex items-center gap-0.5 overflow-x-auto border-b border-border/70 bg-background/20 px-3 py-1.5 text-xs",children:[n.length===0&&c.jsx("span",{className:"text-muted-foreground",children:"—"}),n.map((r,i)=>c.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[c.jsx("button",{type:"button",onClick:()=>t(r.path),className:"rounded px-1.5 py-0.5 text-foreground/90 transition-colors hover:bg-accent hover:text-foreground",children:r.label}),i<n.length-1&&c.jsx(ip,{className:"h-3 w-3 text-muted-foreground"})]},r.path))]})}function h4({entries:e,parent:t,loading:n,error:r,onEnter:i}){return n?c.jsxs("div",{className:"flex h-full items-center justify-center text-xs text-muted-foreground",children:[c.jsx(Et,{className:"mr-2 h-3 w-3 animate-spin"}),"Loading…"]}):r?c.jsx("div",{className:"p-4 text-xs text-signal-rose",children:r}):c.jsxs("ul",{className:"p-1.5",children:[t&&c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>i(t),className:my,children:[c.jsx(t1,{className:"h-4 w-4 shrink-0 opacity-70"}),c.jsx("span",{className:"text-muted-foreground",children:".. (parent)"})]})}),e.length===0&&c.jsx("li",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"(no subdirectories)"}),e.map(s=>c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>i(s.path),className:my,children:[c.jsx(s1,{className:"h-4 w-4 shrink-0 text-brand/70 opacity-80"}),c.jsx("span",{className:"truncate",children:s.name})]})},s.path))]})}const my=B("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm","text-foreground/90 transition-colors hover:bg-accent hover:text-foreground");function p4(e){if(!e)return[];const t=e.split("/").filter(Boolean),n=[{label:"/",path:"/"}];let r="";for(const i of t)r+=`/${i}`,n.push({label:i,path:r});return n}const zw="pi-pilot-theme",as=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):void 0;function fd(e){return e!=="system"?e:as!=null&&as.matches?"dark":"light"}function m4(){try{const e=localStorage.getItem(zw);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function hd(e){const t=document.documentElement.classList;e==="dark"?t.add("dark"):t.remove("dark");const n=document.querySelector('meta[name="theme-color"]');n&&n.setAttribute("content",e==="dark"?"#13151B":"#F4EFE5")}const Bw=Lu((e,t)=>{const n=m4(),r=fd(n);return hd(r),as==null||as.addEventListener("change",()=>{const{choice:i}=t();if(i!=="system")return;const s=fd("system");hd(s),e({resolved:s})}),{choice:n,resolved:r,setTheme:i=>{const s=fd(i);hd(s);try{localStorage.setItem(zw,i)}catch{}e({choice:i,resolved:s})}}});Bw.getState();function g4({activeId:e,onSelect:t,collapsed:n,onToggleCollapse:r}){const{data:i,isLoading:s}=l4(),o=a4(),l=u4(),a=Sl(),[u,f]=j.useState(!1),[d,h]=j.useState(void 0),p=Re(v=>v.running),m=async v=>{h(void 0);try{const g=await o.mutateAsync({path:v});f(!1),t(g.id)}catch(g){h(g instanceof Error?g.message:String(g))}},x=(i==null?void 0:i.length)??0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"relative h-full shrink-0",children:[c.jsxs("aside",{className:B("flex h-full flex-col overflow-hidden border-r border-border bg-popover","transition-[width] duration-300 ease-out",n?"w-[56px]":"w-[272px]"),children:[c.jsxs("header",{className:"flex h-[54px] shrink-0 items-center",children:[c.jsx("div",{className:"flex h-full w-[56px] shrink-0 items-center justify-center",children:c.jsx(Mu,{size:28,filled:p})}),c.jsx("div",{className:B("flex min-w-0 flex-1 items-center pr-3 transition-opacity duration-200 ease-out",n?"opacity-0":"opacity-100"),children:c.jsx(YE,{})})]}),c.jsxs("div",{className:"relative flex h-[40px] shrink-0 items-center",children:[c.jsxs("div",{className:B("flex w-full items-center justify-between px-4 transition-opacity duration-200 ease-out",n?"pointer-events-none opacity-0":"opacity-100"),children:[c.jsxs("h2",{className:"m-0 whitespace-nowrap text-[11.5px] font-medium text-muted-foreground",children:["Workspaces",x>0&&c.jsx("span",{className:"ml-1.5 text-muted-foreground/60",children:x})]}),c.jsxs("button",{type:"button",tabIndex:n?-1:0,onClick:()=>{h(void 0),f(!0)},className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[12px] text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground",children:[c.jsx("span",{className:"text-[15px] leading-none text-brand",children:"+"}),c.jsx("span",{children:"Add"})]})]}),n&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:c.jsx("button",{type:"button",onClick:()=>{h(void 0),f(!0)},className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-[16px] leading-none text-brand transition-colors hover:bg-accent/70",title:"Add workspace","aria-label":"Add workspace",children:"+"})})]}),c.jsxs("ul",{className:"flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto overflow-x-hidden px-2 pb-3",children:[c.jsx(gy,{show:!!s,collapsed:n,label:"Loading…"}),c.jsx(gy,{show:!s&&(i==null?void 0:i.length)===0,collapsed:n,label:"No workspaces yet",variant:"dashed"}),i==null?void 0:i.map(v=>{const g=e===v.id;return c.jsx(x4,{name:v.name,path:v.path,active:g,collapsed:n,onSelect:()=>t(v.id),onDelete:async()=>{await a({title:"Remove workspace",message:`Remove "${v.name}" from the list? (Files are not deleted.)`,confirmLabel:"Remove",variant:"danger"})&&l.mutateAsync(v.id)}},v.id)})]}),c.jsx(k4,{collapsed:n})]}),c.jsx("button",{type:"button",onClick:r,className:"absolute right-0 top-1/2 z-30 -translate-y-1/2 translate-x-1/2 rounded-full border border-border bg-card p-1 text-muted-foreground shadow-glow transition-colors hover:text-foreground","aria-label":n?"Expand sidebar (Ctrl+B)":"Collapse sidebar (Ctrl+B)",title:n?"Expand sidebar (Ctrl+B)":"Collapse sidebar (Ctrl+B)",children:n?c.jsx(ip,{className:"h-3.5 w-3.5"}):c.jsx(n1,{className:"h-3.5 w-3.5"})})]}),c.jsx(c4,{open:u,onClose:()=>f(!1),onPick:m,error:d,busy:o.isPending})]})}function gy({show:e,collapsed:t,label:n,variant:r}){return e?c.jsx("li",{className:B("overflow-hidden text-center text-[12px] text-muted-foreground","transition-[opacity,max-height,margin,padding] duration-300 ease-out",r==="dashed"&&"rounded-lg border border-dashed border-border-soft bg-background/60",t?"pointer-events-none my-0 max-h-0 py-0 opacity-0":r==="dashed"?"mt-1 max-h-[80px] px-3 py-5 opacity-100":"max-h-[40px] px-3 py-2 opacity-100"),children:n}):null}function x4({name:e,path:t,active:n,collapsed:r,onSelect:i,onDelete:s}){return c.jsxs("li",{className:"group relative",children:[c.jsxs("button",{type:"button",onClick:i,title:r?e:void 0,"aria-label":e,className:B("relative flex h-[52px] w-full items-center justify-center overflow-hidden rounded-[10px] border text-left transition-colors duration-300",n?"border-border bg-card":"border-transparent hover:bg-accent/40"),children:[c.jsx("span",{className:"flex w-[40px] shrink-0 items-center justify-center",children:c.jsx(y4,{name:e,active:n})}),c.jsxs("span",{className:B("flex min-w-0 flex-1 flex-col justify-center gap-[3px] transition-opacity duration-300 ease-out",r?"pointer-events-none pr-0 opacity-0":"pr-7 opacity-100"),children:[c.jsx("span",{className:B("truncate text-[13.5px] tracking-[-0.005em]",n?"font-medium text-foreground":"text-foreground"),children:e}),c.jsx("span",{className:"truncate font-mono text-[10.5px] tracking-[-0.005em] text-muted-foreground",children:S4(t)})]})]}),c.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),s()},className:B("pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 rounded-md p-1 text-muted-foreground transition-opacity duration-150","opacity-0 hover:bg-signal-error/[0.10] hover:text-signal-error",!r&&"group-hover:pointer-events-auto group-hover:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100"),"aria-label":"Remove workspace",title:"Remove workspace",tabIndex:r?-1:0,children:c.jsx(Ko,{className:"h-3 w-3"})})]})}function y4({name:e,active:t}){const n=([...e.trim()][0]??"?").toUpperCase();return c.jsx("span",{className:B("inline-flex h-[32px] w-[32px] items-center justify-center rounded-[9px] border text-[13px] font-medium transition-colors duration-300",t?"border-brand/30 bg-brand/[0.12] text-brand":"border-border-soft bg-card/50 text-muted-foreground"),children:n})}const b4={system:"light",light:"dark",dark:"system"},v4={system:M_,light:G_,dark:O_},w4={system:"System",light:"Light",dark:"Dark"};function k4({collapsed:e}){const t=_E(),{choice:n,setTheme:r}=Bw(),i=()=>r(b4[n]),s=v4[n],o=w4[n];return c.jsxs("footer",{className:"relative flex h-[40px] shrink-0 items-center gap-2 border-t border-border-soft px-4",children:[c.jsxs("div",{className:B("flex w-full items-center gap-2 text-[11.5px] text-muted-foreground transition-opacity",e?"pointer-events-none opacity-0":"opacity-100"),children:[c.jsx(mg,{state:"online"}),c.jsx("span",{children:"Online"}),c.jsx("span",{className:"flex-1"}),c.jsx("button",{type:"button",onClick:i,title:`Theme: ${o}`,"aria-label":`Theme: ${o}. Click to cycle.`,className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground",children:c.jsx(s,{className:"h-3 w-3"})}),c.jsx("span",{className:"font-mono text-[10.5px] tracking-[-0.005em] text-muted-foreground",children:t})]}),e&&c.jsxs("div",{className:"absolute left-0 right-0 flex items-center justify-center gap-2",children:[c.jsx(mg,{state:"online"}),c.jsx("button",{type:"button",onClick:i,title:`Theme: ${o}`,"aria-label":`Theme: ${o}. Click to cycle.`,className:"rounded-md p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:c.jsx(s,{className:"h-3 w-3"})})]})]})}function S4(e){const t=e.match(/^\/(?:Users|home)\/[^/]+/);if(!t)return e;const n=e.slice(t[0].length);return n===""||n.startsWith("/")?"~"+n:e}function C4(){const[e,t]=j.useState(void 0),[n,r]=j.useState(null),[i,s]=j.useState(!1);BO(e),UO(),m_(),GO(e);const o=a=>r(u=>u===a?null:a),l=j.useCallback(()=>{s(a=>!a)},[]);return j.useEffect(()=>{const a=u=>{(u.ctrlKey||u.metaKey)&&u.key==="b"&&(u.preventDefault(),l())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[l]),c.jsx(dO,{children:c.jsxs("div",{className:"flex h-full",children:[c.jsx(g4,{activeId:e,onSelect:t,collapsed:i,onToggleCollapse:l}),c.jsx(xO,{workspaceId:e,rightPanel:n,onToggleConfig:()=>o("config"),onToggleResources:()=>o("resources")},e??"none"),e&&c.jsxs(c.Fragment,{children:[c.jsx(IO,{workspaceId:e,open:n==="config",onClose:()=>r(null)},`cfg-${e}`),c.jsx(JO,{workspaceId:e,open:n==="resources",onClose:()=>r(null)},`res-${e}`)]}),c.jsx(qO,{})]})})}const _4=new XC({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Uw=document.getElementById("root");if(!Uw)throw new Error("missing #root");zb(Uw).render(c.jsx(j.StrictMode,{children:c.jsx(YC,{client:_4,children:c.jsx(C4,{})})}));
|