@jyork0828/pi-pilot 0.0.3 → 0.0.6
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 +1935 -714
- 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-CsC5-YPT.js +506 -0
- package/public/assets/index-R8FKUxOS.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,506 @@
|
|
|
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 Kk=Object.defineProperty;var Xk=Object.getPrototypeOf;var Yk=Reflect.get;var wm=e=>{throw TypeError(e)};var Jk=(e,t,n)=>t in e?Kk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var A=(e,t,n)=>Jk(e,typeof t!="symbol"?t+"":t,n),Tc=(e,t,n)=>t.has(e)||wm("Cannot "+n);var _=(e,t,n)=>(Tc(e,t,"read from private field"),n?n.call(e):t.get(e)),V=(e,t,n)=>t.has(e)?wm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),B=(e,t,n,r)=>(Tc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),re=(e,t,n)=>(Tc(e,t,"access private method"),n);var Wl=(e,t,n,r)=>({set _(s){B(e,t,s,n)},get _(){return _(e,t,r)}}),km=(e,t,n)=>Yk(Xk(e),n,t);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var qa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mb={exports:{}},Uu={},gb={exports:{}},fe={};/**
|
|
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 Il=Symbol.for("react.element"),Zk=Symbol.for("react.portal"),eS=Symbol.for("react.fragment"),tS=Symbol.for("react.strict_mode"),nS=Symbol.for("react.profiler"),rS=Symbol.for("react.provider"),sS=Symbol.for("react.context"),iS=Symbol.for("react.forward_ref"),oS=Symbol.for("react.suspense"),lS=Symbol.for("react.memo"),aS=Symbol.for("react.lazy"),Sm=Symbol.iterator;function uS(e){return e===null||typeof e!="object"?null:(e=Sm&&e[Sm]||e["@@iterator"],typeof e=="function"?e:null)}var xb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yb=Object.assign,bb={};function Bi(e,t,n){this.props=e,this.context=t,this.refs=bb,this.updater=n||xb}Bi.prototype.isReactComponent={};Bi.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")};Bi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vb(){}vb.prototype=Bi.prototype;function Mh(e,t,n){this.props=e,this.context=t,this.refs=bb,this.updater=n||xb}var Oh=Mh.prototype=new vb;Oh.constructor=Mh;yb(Oh,Bi.prototype);Oh.isPureReactComponent=!0;var Cm=Array.isArray,wb=Object.prototype.hasOwnProperty,Dh={current:null},kb={key:!0,ref:!0,__self:!0,__source:!0};function Sb(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)wb.call(t,r)&&!kb.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];s.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:Il,type:e,key:i,ref:o,props:s,_owner:Dh.current}}function cS(e,t){return{$$typeof:Il,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Fh(e){return typeof e=="object"&&e!==null&&e.$$typeof===Il}function dS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var _m=/\/+/g;function Pc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?dS(""+e.key):t.toString(36)}function _a(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Il:case Zk:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Pc(o,0):r,Cm(s)?(n="",e!=null&&(n=e.replace(_m,"$&/")+"/"),_a(s,t,n,"",function(u){return u})):s!=null&&(Fh(s)&&(s=cS(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(_m,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Cm(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+Pc(i,l);o+=_a(i,t,n,a,s)}else if(a=uS(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+Pc(i,l++),o+=_a(i,t,n,a,s);else if(i==="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 Vl(e,t,n){if(e==null)return e;var r=[],s=0;return _a(e,r,"","",function(i){return t.call(n,i,s++)}),r}function fS(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 kt={current:null},Na={transition:null},hS={ReactCurrentDispatcher:kt,ReactCurrentBatchConfig:Na,ReactCurrentOwner:Dh};function Cb(){throw Error("act(...) is not supported in production builds of React.")}fe.Children={map:Vl,forEach:function(e,t,n){Vl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Vl(e,function(){t++}),t},toArray:function(e){return Vl(e,function(t){return t})||[]},only:function(e){if(!Fh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};fe.Component=Bi;fe.Fragment=eS;fe.Profiler=nS;fe.PureComponent=Mh;fe.StrictMode=tS;fe.Suspense=oS;fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hS;fe.act=Cb;fe.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=yb({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Dh.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)wb.call(t,a)&&!kb.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:Il,type:e.type,key:s,ref:i,props:r,_owner:o}};fe.createContext=function(e){return e={$$typeof:sS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:rS,_context:e},e.Consumer=e};fe.createElement=Sb;fe.createFactory=function(e){var t=Sb.bind(null,e);return t.type=e,t};fe.createRef=function(){return{current:null}};fe.forwardRef=function(e){return{$$typeof:iS,render:e}};fe.isValidElement=Fh;fe.lazy=function(e){return{$$typeof:aS,_payload:{_status:-1,_result:e},_init:fS}};fe.memo=function(e,t){return{$$typeof:lS,type:e,compare:t===void 0?null:t}};fe.startTransition=function(e){var t=Na.transition;Na.transition={};try{e()}finally{Na.transition=t}};fe.unstable_act=Cb;fe.useCallback=function(e,t){return kt.current.useCallback(e,t)};fe.useContext=function(e){return kt.current.useContext(e)};fe.useDebugValue=function(){};fe.useDeferredValue=function(e){return kt.current.useDeferredValue(e)};fe.useEffect=function(e,t){return kt.current.useEffect(e,t)};fe.useId=function(){return kt.current.useId()};fe.useImperativeHandle=function(e,t,n){return kt.current.useImperativeHandle(e,t,n)};fe.useInsertionEffect=function(e,t){return kt.current.useInsertionEffect(e,t)};fe.useLayoutEffect=function(e,t){return kt.current.useLayoutEffect(e,t)};fe.useMemo=function(e,t){return kt.current.useMemo(e,t)};fe.useReducer=function(e,t,n){return kt.current.useReducer(e,t,n)};fe.useRef=function(e){return kt.current.useRef(e)};fe.useState=function(e){return kt.current.useState(e)};fe.useSyncExternalStore=function(e,t,n){return kt.current.useSyncExternalStore(e,t,n)};fe.useTransition=function(){return kt.current.useTransition()};fe.version="18.3.1";gb.exports=fe;var S=gb.exports;const Ql=Lh(S);/**
|
|
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 pS=S,mS=Symbol.for("react.element"),gS=Symbol.for("react.fragment"),xS=Object.prototype.hasOwnProperty,yS=pS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bS={key:!0,ref:!0,__self:!0,__source:!0};function _b(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)xS.call(t,r)&&!bS.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:mS,type:e,key:i,ref:o,props:s,_owner:yS.current}}Uu.Fragment=gS;Uu.jsx=_b;Uu.jsxs=_b;mb.exports=Uu;var c=mb.exports,Nb={exports:{}},Ht={},Eb={exports:{}},jb={};/**
|
|
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(O,H){var C=O.length;O.push(H);e:for(;0<C;){var X=C-1>>>1,J=O[X];if(0<s(J,H))O[X]=H,O[C]=J,C=X;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var H=O[0],C=O.pop();if(C!==H){O[0]=C;e:for(var X=0,J=O.length,j=J>>>1;X<j;){var we=2*(X+1)-1,te=O[we],ie=we+1,Xe=O[ie];if(0>s(te,C))ie<J&&0>s(Xe,te)?(O[X]=Xe,O[ie]=C,X=ie):(O[X]=te,O[we]=C,X=we);else if(ie<J&&0>s(Xe,C))O[X]=Xe,O[ie]=C,X=ie;else break e}}return H}function s(O,H){var C=O.sortIndex-H.sortIndex;return C!==0?C:O.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.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,y=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(O){for(var H=n(u);H!==null;){if(H.callback===null)r(u);else if(H.startTime<=O)r(u),H.sortIndex=H.expirationTime,t(a,H);else break;H=n(u)}}function w(O){if(y=!1,b(O),!m)if(n(a)!==null)m=!0,z(N);else{var H=n(u);H!==null&&ee(w,H.startTime-O)}}function N(O,H){m=!1,y&&(y=!1,g(T),T=-1),p=!0;var C=h;try{for(b(H),d=n(a);d!==null&&(!(d.expirationTime>H)||O&&!M());){var X=d.callback;if(typeof X=="function"){d.callback=null,h=d.priorityLevel;var J=X(d.expirationTime<=H);H=e.unstable_now(),typeof J=="function"?d.callback=J:d===n(a)&&r(a),b(H)}else r(a);d=n(a)}if(d!==null)var j=!0;else{var we=n(u);we!==null&&ee(w,we.startTime-H),j=!1}return j}finally{d=null,h=C,p=!1}}var k=!1,I=null,T=-1,P=5,E=-1;function M(){return!(e.unstable_now()-E<P)}function R(){if(I!==null){var O=e.unstable_now();E=O;var H=!0;try{H=I(!0,O)}finally{H?Q():(k=!1,I=null)}}else k=!1}var Q;if(typeof x=="function")Q=function(){x(R)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,G=q.port2;q.port1.onmessage=R,Q=function(){G.postMessage(null)}}else Q=function(){v(R,0)};function z(O){I=O,k||(k=!0,Q())}function ee(O,H){T=v(function(){O(e.unstable_now())},H)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,z(N))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(O){switch(h){case 1:case 2:case 3:var H=3;break;default:H=h}var C=h;h=H;try{return O()}finally{h=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,H){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var C=h;h=O;try{return H()}finally{h=C}},e.unstable_scheduleCallback=function(O,H,C){var X=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?X+C:X):C=X,O){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=C+J,O={id:f++,callback:H,priorityLevel:O,startTime:C,expirationTime:J,sortIndex:-1},C>X?(O.sortIndex=C,t(u,O),n(a)===null&&O===n(u)&&(y?(g(T),T=-1):y=!0,ee(w,C-X))):(O.sortIndex=J,t(a,O),m||p||(m=!0,z(N))),O},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(O){var H=h;return function(){var C=h;h=H;try{return O.apply(this,arguments)}finally{h=C}}}})(jb);Eb.exports=jb;var vS=Eb.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 wS=S,Ut=vS;function F(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 Ib=new Set,Uo={};function Os(e,t){Pi(e,t),Pi(e+"Capture",t)}function Pi(e,t){for(Uo[e]=t,e=0;e<t.length;e++)Ib.add(t[e])}var nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qd=Object.prototype.hasOwnProperty,kS=/^[: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]*$/,Nm={},Em={};function SS(e){return qd.call(Em,e)?!0:qd.call(Nm,e)?!1:kS.test(e)?Em[e]=!0:(Nm[e]=!0,!1)}function CS(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 _S(e,t,n,r){if(t===null||typeof t>"u"||CS(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 St(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var rt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rt[e]=new St(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rt[t]=new St(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rt[e]=new St(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rt[e]=new St(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){rt[e]=new St(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rt[e]=new St(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rt[e]=new St(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rt[e]=new St(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rt[e]=new St(e,5,!1,e.toLowerCase(),null,!1,!1)});var $h=/[\-:]([a-z])/g;function zh(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($h,zh);rt[t]=new St(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($h,zh);rt[t]=new St(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($h,zh);rt[t]=new St(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rt[e]=new St(e,1,!1,e.toLowerCase(),null,!1,!1)});rt.xlinkHref=new St("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rt[e]=new St(e,1,!1,e.toLowerCase(),null,!0,!0)});function Bh(e,t,n,r){var s=rt.hasOwnProperty(t)?rt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(_S(t,n,s,r)&&(n=null),r||s===null?SS(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var lr=wS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Kl=Symbol.for("react.element"),Xs=Symbol.for("react.portal"),Ys=Symbol.for("react.fragment"),Uh=Symbol.for("react.strict_mode"),Wd=Symbol.for("react.profiler"),Tb=Symbol.for("react.provider"),Pb=Symbol.for("react.context"),Hh=Symbol.for("react.forward_ref"),Vd=Symbol.for("react.suspense"),Qd=Symbol.for("react.suspense_list"),Gh=Symbol.for("react.memo"),yr=Symbol.for("react.lazy"),Ab=Symbol.for("react.offscreen"),jm=Symbol.iterator;function ro(e){return e===null||typeof e!="object"?null:(e=jm&&e[jm]||e["@@iterator"],typeof e=="function"?e:null)}var Me=Object.assign,Ac;function yo(e){if(Ac===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ac=t&&t[1]||""}return`
|
|
35
|
+
`+Ac+e}var Rc=!1;function Lc(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 s=u.stack.split(`
|
|
36
|
+
`),i=r.stack.split(`
|
|
37
|
+
`),o=s.length-1,l=i.length-1;1<=o&&0<=l&&s[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==i[l]){var a=`
|
|
38
|
+
`+s[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:"")?yo(e):""}function NS(e){switch(e.tag){case 5:return yo(e.type);case 16:return yo("Lazy");case 13:return yo("Suspense");case 19:return yo("SuspenseList");case 0:case 2:case 15:return e=Lc(e.type,!1),e;case 11:return e=Lc(e.type.render,!1),e;case 1:return e=Lc(e.type,!0),e;default:return""}}function Kd(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 Ys:return"Fragment";case Xs:return"Portal";case Wd:return"Profiler";case Uh:return"StrictMode";case Vd:return"Suspense";case Qd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Pb:return(e.displayName||"Context")+".Consumer";case Tb:return(e._context.displayName||"Context")+".Provider";case Hh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Gh:return t=e.displayName||null,t!==null?t:Kd(e.type)||"Memo";case yr:t=e._payload,e=e._init;try{return Kd(e(t))}catch{}}return null}function ES(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 Kd(t);case 8:return t===Uh?"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 Vr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Rb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function jS(e){var t=Rb(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 s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.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 Xl(e){e._valueTracker||(e._valueTracker=jS(e))}function Lb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Rb(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Wa(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 Xd(e,t){var n=t.checked;return Me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Im(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vr(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 Mb(e,t){t=t.checked,t!=null&&Bh(e,"checked",t,!1)}function Yd(e,t){Mb(e,t);var n=Vr(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")?Jd(e,t.type,n):t.hasOwnProperty("defaultValue")&&Jd(e,t.type,Vr(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 Jd(e,t,n){(t!=="number"||Wa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bo=Array.isArray;function ai(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Vr(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Zd(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return Me({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pm(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(F(92));if(bo(n)){if(1<n.length)throw Error(F(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Vr(n)}}function Ob(e,t){var n=Vr(t.value),r=Vr(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 Am(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Db(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 ef(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Db(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Yl,Fb=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Yl=Yl||document.createElement("div"),Yl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Yl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ho(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _o={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},IS=["Webkit","ms","Moz","O"];Object.keys(_o).forEach(function(e){IS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_o[t]=_o[e]})});function $b(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_o.hasOwnProperty(e)&&_o[e]?(""+t).trim():t+"px"}function zb(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=$b(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var TS=Me({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 tf(e,t){if(t){if(TS[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function nf(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 rf=null;function qh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sf=null,ui=null,ci=null;function Rm(e){if(e=Al(e)){if(typeof sf!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Vu(t),sf(e.stateNode,e.type,t))}}function Bb(e){ui?ci?ci.push(e):ci=[e]:ui=e}function Ub(){if(ui){var e=ui,t=ci;if(ci=ui=null,Rm(e),t)for(e=0;e<t.length;e++)Rm(t[e])}}function Hb(e,t){return e(t)}function Gb(){}var Mc=!1;function qb(e,t,n){if(Mc)return e(t,n);Mc=!0;try{return Hb(e,t,n)}finally{Mc=!1,(ui!==null||ci!==null)&&(Gb(),Ub())}}function Go(e,t){var n=e.stateNode;if(n===null)return null;var r=Vu(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(F(231,t,typeof n));return n}var of=!1;if(nr)try{var so={};Object.defineProperty(so,"passive",{get:function(){of=!0}}),window.addEventListener("test",so,so),window.removeEventListener("test",so,so)}catch{of=!1}function PS(e,t,n,r,s,i,o,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(f){this.onError(f)}}var No=!1,Va=null,Qa=!1,lf=null,AS={onError:function(e){No=!0,Va=e}};function RS(e,t,n,r,s,i,o,l,a){No=!1,Va=null,PS.apply(AS,arguments)}function LS(e,t,n,r,s,i,o,l,a){if(RS.apply(this,arguments),No){if(No){var u=Va;No=!1,Va=null}else throw Error(F(198));Qa||(Qa=!0,lf=u)}}function Ds(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 Wb(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 Lm(e){if(Ds(e)!==e)throw Error(F(188))}function MS(e){var t=e.alternate;if(!t){if(t=Ds(e),t===null)throw Error(F(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Lm(s),e;if(i===r)return Lm(s),t;i=i.sibling}throw Error(F(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,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){for(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)throw Error(F(189))}}if(n.alternate!==r)throw Error(F(190))}if(n.tag!==3)throw Error(F(188));return n.stateNode.current===n?e:t}function Vb(e){return e=MS(e),e!==null?Qb(e):null}function Qb(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Qb(e);if(t!==null)return t;e=e.sibling}return null}var Kb=Ut.unstable_scheduleCallback,Mm=Ut.unstable_cancelCallback,OS=Ut.unstable_shouldYield,DS=Ut.unstable_requestPaint,Be=Ut.unstable_now,FS=Ut.unstable_getCurrentPriorityLevel,Wh=Ut.unstable_ImmediatePriority,Xb=Ut.unstable_UserBlockingPriority,Ka=Ut.unstable_NormalPriority,$S=Ut.unstable_LowPriority,Yb=Ut.unstable_IdlePriority,Hu=null,In=null;function zS(e){if(In&&typeof In.onCommitFiberRoot=="function")try{In.onCommitFiberRoot(Hu,e,void 0,(e.current.flags&128)===128)}catch{}}var hn=Math.clz32?Math.clz32:HS,BS=Math.log,US=Math.LN2;function HS(e){return e>>>=0,e===0?32:31-(BS(e)/US|0)|0}var Jl=64,Zl=4194304;function vo(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 Xa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~s;l!==0?r=vo(l):(i&=o,i!==0&&(r=vo(i)))}else o=n&~s,o!==0?r=vo(o):i!==0&&(r=vo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&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-hn(t),s=1<<n,r|=e[n],t&=~s;return r}function GS(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 qS(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-hn(i),l=1<<o,a=s[o];a===-1?(!(l&n)||l&r)&&(s[o]=GS(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function af(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Jb(){var e=Jl;return Jl<<=1,!(Jl&4194240)&&(Jl=64),e}function Oc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Tl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-hn(t),e[t]=n}function WS(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 s=31-hn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function Vh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-hn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ve=0;function Zb(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var e0,Qh,t0,n0,r0,uf=!1,ea=[],Or=null,Dr=null,Fr=null,qo=new Map,Wo=new Map,wr=[],VS="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 Om(e,t){switch(e){case"focusin":case"focusout":Or=null;break;case"dragenter":case"dragleave":Dr=null;break;case"mouseover":case"mouseout":Fr=null;break;case"pointerover":case"pointerout":qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wo.delete(t.pointerId)}}function io(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Al(t),t!==null&&Qh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function QS(e,t,n,r,s){switch(t){case"focusin":return Or=io(Or,e,t,n,r,s),!0;case"dragenter":return Dr=io(Dr,e,t,n,r,s),!0;case"mouseover":return Fr=io(Fr,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return qo.set(i,io(qo.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Wo.set(i,io(Wo.get(i)||null,e,t,n,r,s)),!0}return!1}function s0(e){var t=us(e.target);if(t!==null){var n=Ds(t);if(n!==null){if(t=n.tag,t===13){if(t=Wb(n),t!==null){e.blockedOn=t,r0(e.priority,function(){t0(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 Ea(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=cf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);rf=r,n.target.dispatchEvent(r),rf=null}else return t=Al(n),t!==null&&Qh(t),e.blockedOn=n,!1;t.shift()}return!0}function Dm(e,t,n){Ea(e)&&n.delete(t)}function KS(){uf=!1,Or!==null&&Ea(Or)&&(Or=null),Dr!==null&&Ea(Dr)&&(Dr=null),Fr!==null&&Ea(Fr)&&(Fr=null),qo.forEach(Dm),Wo.forEach(Dm)}function oo(e,t){e.blockedOn===t&&(e.blockedOn=null,uf||(uf=!0,Ut.unstable_scheduleCallback(Ut.unstable_NormalPriority,KS)))}function Vo(e){function t(s){return oo(s,e)}if(0<ea.length){oo(ea[0],e);for(var n=1;n<ea.length;n++){var r=ea[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Or!==null&&oo(Or,e),Dr!==null&&oo(Dr,e),Fr!==null&&oo(Fr,e),qo.forEach(t),Wo.forEach(t),n=0;n<wr.length;n++)r=wr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<wr.length&&(n=wr[0],n.blockedOn===null);)s0(n),n.blockedOn===null&&wr.shift()}var di=lr.ReactCurrentBatchConfig,Ya=!0;function XS(e,t,n,r){var s=ve,i=di.transition;di.transition=null;try{ve=1,Kh(e,t,n,r)}finally{ve=s,di.transition=i}}function YS(e,t,n,r){var s=ve,i=di.transition;di.transition=null;try{ve=4,Kh(e,t,n,r)}finally{ve=s,di.transition=i}}function Kh(e,t,n,r){if(Ya){var s=cf(e,t,n,r);if(s===null)Wc(e,t,r,Ja,n),Om(e,r);else if(QS(s,e,t,n,r))r.stopPropagation();else if(Om(e,r),t&4&&-1<VS.indexOf(e)){for(;s!==null;){var i=Al(s);if(i!==null&&e0(i),i=cf(e,t,n,r),i===null&&Wc(e,t,r,Ja,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Wc(e,t,r,null,n)}}var Ja=null;function cf(e,t,n,r){if(Ja=null,e=qh(r),e=us(e),e!==null)if(t=Ds(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Wb(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 Ja=e,null}function i0(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(FS()){case Wh:return 1;case Xb:return 4;case Ka:case $S:return 16;case Yb:return 536870912;default:return 16}default:return 16}}var Lr=null,Xh=null,ja=null;function o0(){if(ja)return ja;var e,t=Xh,n=t.length,r,s="value"in Lr?Lr.value:Lr.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return ja=s.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 ta(){return!0}function Fm(){return!1}function Gt(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ta:Fm,this.isPropagationStopped=Fm,this}return Me(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=ta)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ta)},persist:function(){},isPersistent:ta}),t}var Ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yh=Gt(Ui),Pl=Me({},Ui,{view:0,detail:0}),JS=Gt(Pl),Dc,Fc,lo,Gu=Me({},Pl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jh,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!==lo&&(lo&&e.type==="mousemove"?(Dc=e.screenX-lo.screenX,Fc=e.screenY-lo.screenY):Fc=Dc=0,lo=e),Dc)},movementY:function(e){return"movementY"in e?e.movementY:Fc}}),$m=Gt(Gu),ZS=Me({},Gu,{dataTransfer:0}),eC=Gt(ZS),tC=Me({},Pl,{relatedTarget:0}),$c=Gt(tC),nC=Me({},Ui,{animationName:0,elapsedTime:0,pseudoElement:0}),rC=Gt(nC),sC=Me({},Ui,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),iC=Gt(sC),oC=Me({},Ui,{data:0}),zm=Gt(oC),lC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aC={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"},uC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cC(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uC[e])?!!t[e]:!1}function Jh(){return cC}var dC=Me({},Pl,{key:function(e){if(e.key){var t=lC[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"?aC[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jh,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}}),fC=Gt(dC),hC=Me({},Gu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bm=Gt(hC),pC=Me({},Pl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jh}),mC=Gt(pC),gC=Me({},Ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),xC=Gt(gC),yC=Me({},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}),bC=Gt(yC),vC=[9,13,27,32],Zh=nr&&"CompositionEvent"in window,Eo=null;nr&&"documentMode"in document&&(Eo=document.documentMode);var wC=nr&&"TextEvent"in window&&!Eo,l0=nr&&(!Zh||Eo&&8<Eo&&11>=Eo),Um=" ",Hm=!1;function a0(e,t){switch(e){case"keyup":return vC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function u0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Js=!1;function kC(e,t){switch(e){case"compositionend":return u0(t);case"keypress":return t.which!==32?null:(Hm=!0,Um);case"textInput":return e=t.data,e===Um&&Hm?null:e;default:return null}}function SC(e,t){if(Js)return e==="compositionend"||!Zh&&a0(e,t)?(e=o0(),ja=Xh=Lr=null,Js=!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 l0&&t.locale!=="ko"?null:t.data;default:return null}}var CC={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 Gm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!CC[e.type]:t==="textarea"}function c0(e,t,n,r){Bb(r),t=Za(t,"onChange"),0<t.length&&(n=new Yh("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var jo=null,Qo=null;function _C(e){w0(e,0)}function qu(e){var t=ti(e);if(Lb(t))return e}function NC(e,t){if(e==="change")return t}var d0=!1;if(nr){var zc;if(nr){var Bc="oninput"in document;if(!Bc){var qm=document.createElement("div");qm.setAttribute("oninput","return;"),Bc=typeof qm.oninput=="function"}zc=Bc}else zc=!1;d0=zc&&(!document.documentMode||9<document.documentMode)}function Wm(){jo&&(jo.detachEvent("onpropertychange",f0),Qo=jo=null)}function f0(e){if(e.propertyName==="value"&&qu(Qo)){var t=[];c0(t,Qo,e,qh(e)),qb(_C,t)}}function EC(e,t,n){e==="focusin"?(Wm(),jo=t,Qo=n,jo.attachEvent("onpropertychange",f0)):e==="focusout"&&Wm()}function jC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qu(Qo)}function IC(e,t){if(e==="click")return qu(t)}function TC(e,t){if(e==="input"||e==="change")return qu(t)}function PC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xn=typeof Object.is=="function"?Object.is:PC;function Ko(e,t){if(xn(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 s=n[r];if(!qd.call(t,s)||!xn(e[s],t[s]))return!1}return!0}function Vm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qm(e,t){var n=Vm(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=Vm(n)}}function h0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?h0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function p0(){for(var e=window,t=Wa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wa(e.document)}return t}function ep(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 AC(e){var t=p0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&h0(n.ownerDocument.documentElement,n)){if(r!==null&&ep(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 s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Qm(n,i);var o=Qm(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>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 RC=nr&&"documentMode"in document&&11>=document.documentMode,Zs=null,df=null,Io=null,ff=!1;function Km(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ff||Zs==null||Zs!==Wa(r)||(r=Zs,"selectionStart"in r&&ep(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}),Io&&Ko(Io,r)||(Io=r,r=Za(df,"onSelect"),0<r.length&&(t=new Yh("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zs)))}function na(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ei={animationend:na("Animation","AnimationEnd"),animationiteration:na("Animation","AnimationIteration"),animationstart:na("Animation","AnimationStart"),transitionend:na("Transition","TransitionEnd")},Uc={},m0={};nr&&(m0=document.createElement("div").style,"AnimationEvent"in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),"TransitionEvent"in window||delete ei.transitionend.transition);function Wu(e){if(Uc[e])return Uc[e];if(!ei[e])return e;var t=ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in m0)return Uc[e]=t[n];return e}var g0=Wu("animationend"),x0=Wu("animationiteration"),y0=Wu("animationstart"),b0=Wu("transitionend"),v0=new Map,Xm="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 Kr(e,t){v0.set(e,t),Os(t,[e])}for(var Hc=0;Hc<Xm.length;Hc++){var Gc=Xm[Hc],LC=Gc.toLowerCase(),MC=Gc[0].toUpperCase()+Gc.slice(1);Kr(LC,"on"+MC)}Kr(g0,"onAnimationEnd");Kr(x0,"onAnimationIteration");Kr(y0,"onAnimationStart");Kr("dblclick","onDoubleClick");Kr("focusin","onFocus");Kr("focusout","onBlur");Kr(b0,"onTransitionEnd");Pi("onMouseEnter",["mouseout","mouseover"]);Pi("onMouseLeave",["mouseout","mouseover"]);Pi("onPointerEnter",["pointerout","pointerover"]);Pi("onPointerLeave",["pointerout","pointerover"]);Os("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Os("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Os("onBeforeInput",["compositionend","keypress","textInput","paste"]);Os("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Os("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Os("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wo="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(" "),OC=new Set("cancel close invalid load scroll toggle".split(" ").concat(wo));function Ym(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,LS(r,t,void 0,e),e.currentTarget=null}function w0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=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!==i&&s.isPropagationStopped())break e;Ym(s,l,u),i=a}else for(o=0;o<r.length;o++){if(l=r[o],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&s.isPropagationStopped())break e;Ym(s,l,u),i=a}}}if(Qa)throw e=lf,Qa=!1,lf=null,e}function je(e,t){var n=t[xf];n===void 0&&(n=t[xf]=new Set);var r=e+"__bubble";n.has(r)||(k0(t,e,2,!1),n.add(r))}function qc(e,t,n){var r=0;t&&(r|=4),k0(n,e,r,t)}var ra="_reactListening"+Math.random().toString(36).slice(2);function Xo(e){if(!e[ra]){e[ra]=!0,Ib.forEach(function(n){n!=="selectionchange"&&(OC.has(n)||qc(n,!1,e),qc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ra]||(t[ra]=!0,qc("selectionchange",!1,t))}}function k0(e,t,n,r){switch(i0(t)){case 1:var s=XS;break;case 4:s=YS;break;default:s=Kh}n=s.bind(null,t,n,e),s=void 0,!of||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Wc(e,t,n,r,s){var i=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===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var a=o.tag;if((a===3||a===4)&&(a=o.stateNode.containerInfo,a===s||a.nodeType===8&&a.parentNode===s))return;o=o.return}for(;l!==null;){if(o=us(l),o===null)return;if(a=o.tag,a===5||a===6){r=i=o;continue e}l=l.parentNode}}r=r.return}qb(function(){var u=i,f=qh(n),d=[];e:{var h=v0.get(e);if(h!==void 0){var p=Yh,m=e;switch(e){case"keypress":if(Ia(n)===0)break e;case"keydown":case"keyup":p=fC;break;case"focusin":m="focus",p=$c;break;case"focusout":m="blur",p=$c;break;case"beforeblur":case"afterblur":p=$c;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=$m;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=eC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=mC;break;case g0:case x0:case y0:p=rC;break;case b0:p=xC;break;case"scroll":p=JS;break;case"wheel":p=bC;break;case"copy":case"cut":case"paste":p=iC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Bm}var y=(t&4)!==0,v=!y&&e==="scroll",g=y?h!==null?h+"Capture":null:h;y=[];for(var x=u,b;x!==null;){b=x;var w=b.stateNode;if(b.tag===5&&w!==null&&(b=w,g!==null&&(w=Go(x,g),w!=null&&y.push(Yo(x,w,b)))),v)break;x=x.return}0<y.length&&(h=new p(h,m,null,n,f),d.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==rf&&(m=n.relatedTarget||n.fromElement)&&(us(m)||m[rr]))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?us(m):null,m!==null&&(v=Ds(m),m!==v||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(y=$m,w="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=Bm,w="onPointerLeave",g="onPointerEnter",x="pointer"),v=p==null?h:ti(p),b=m==null?h:ti(m),h=new y(w,x+"leave",p,n,f),h.target=v,h.relatedTarget=b,w=null,us(f)===u&&(y=new y(g,x+"enter",m,n,f),y.target=b,y.relatedTarget=v,w=y),v=w,p&&m)t:{for(y=p,g=m,x=0,b=y;b;b=Bs(b))x++;for(b=0,w=g;w;w=Bs(w))b++;for(;0<x-b;)y=Bs(y),x--;for(;0<b-x;)g=Bs(g),b--;for(;x--;){if(y===g||g!==null&&y===g.alternate)break t;y=Bs(y),g=Bs(g)}y=null}else y=null;p!==null&&Jm(d,h,p,y,!1),m!==null&&v!==null&&Jm(d,v,m,y,!0)}}e:{if(h=u?ti(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var N=NC;else if(Gm(h))if(d0)N=TC;else{N=jC;var k=EC}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(N=IC);if(N&&(N=N(e,u))){c0(d,N,n,f);break e}k&&k(e,h,u),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&Jd(h,"number",h.value)}switch(k=u?ti(u):window,e){case"focusin":(Gm(k)||k.contentEditable==="true")&&(Zs=k,df=u,Io=null);break;case"focusout":Io=df=Zs=null;break;case"mousedown":ff=!0;break;case"contextmenu":case"mouseup":case"dragend":ff=!1,Km(d,n,f);break;case"selectionchange":if(RC)break;case"keydown":case"keyup":Km(d,n,f)}var I;if(Zh)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Js?a0(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(l0&&n.locale!=="ko"&&(Js||T!=="onCompositionStart"?T==="onCompositionEnd"&&Js&&(I=o0()):(Lr=f,Xh="value"in Lr?Lr.value:Lr.textContent,Js=!0)),k=Za(u,T),0<k.length&&(T=new zm(T,e,null,n,f),d.push({event:T,listeners:k}),I?T.data=I:(I=u0(n),I!==null&&(T.data=I)))),(I=wC?kC(e,n):SC(e,n))&&(u=Za(u,"onBeforeInput"),0<u.length&&(f=new zm("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:u}),f.data=I))}w0(d,t)})}function Yo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Za(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Go(e,n),i!=null&&r.unshift(Yo(e,i,s)),i=Go(e,t),i!=null&&r.push(Yo(e,i,s))),e=e.return}return r}function Bs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Jm(e,t,n,r,s){for(var i=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,s?(a=Go(n,i),a!=null&&o.unshift(Yo(n,a,l))):s||(a=Go(n,i),a!=null&&o.push(Yo(n,a,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var DC=/\r\n?/g,FC=/\u0000|\uFFFD/g;function Zm(e){return(typeof e=="string"?e:""+e).replace(DC,`
|
|
39
|
+
`).replace(FC,"")}function sa(e,t,n){if(t=Zm(t),Zm(e)!==t&&n)throw Error(F(425))}function eu(){}var hf=null,pf=null;function mf(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 gf=typeof setTimeout=="function"?setTimeout:void 0,$C=typeof clearTimeout=="function"?clearTimeout:void 0,eg=typeof Promise=="function"?Promise:void 0,zC=typeof queueMicrotask=="function"?queueMicrotask:typeof eg<"u"?function(e){return eg.resolve(null).then(e).catch(BC)}:gf;function BC(e){setTimeout(function(){throw e})}function Vc(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Vo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Vo(t)}function $r(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 tg(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 Hi=Math.random().toString(36).slice(2),En="__reactFiber$"+Hi,Jo="__reactProps$"+Hi,rr="__reactContainer$"+Hi,xf="__reactEvents$"+Hi,UC="__reactListeners$"+Hi,HC="__reactHandles$"+Hi;function us(e){var t=e[En];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rr]||n[En]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=tg(e);e!==null;){if(n=e[En])return n;e=tg(e)}return t}e=n,n=e.parentNode}return null}function Al(e){return e=e[En]||e[rr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ti(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function Vu(e){return e[Jo]||null}var yf=[],ni=-1;function Xr(e){return{current:e}}function Ie(e){0>ni||(e.current=yf[ni],yf[ni]=null,ni--)}function _e(e,t){ni++,yf[ni]=e.current,e.current=t}var Qr={},ht=Xr(Qr),Tt=Xr(!1),js=Qr;function Ai(e,t){var n=e.type.contextTypes;if(!n)return Qr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Pt(e){return e=e.childContextTypes,e!=null}function tu(){Ie(Tt),Ie(ht)}function ng(e,t,n){if(ht.current!==Qr)throw Error(F(168));_e(ht,t),_e(Tt,n)}function S0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(F(108,ES(e)||"Unknown",s));return Me({},n,r)}function nu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qr,js=ht.current,_e(ht,e),_e(Tt,Tt.current),!0}function rg(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=S0(e,t,js),r.__reactInternalMemoizedMergedChildContext=e,Ie(Tt),Ie(ht),_e(ht,e)):Ie(Tt),_e(Tt,n)}var Bn=null,Qu=!1,Qc=!1;function C0(e){Bn===null?Bn=[e]:Bn.push(e)}function GC(e){Qu=!0,C0(e)}function Yr(){if(!Qc&&Bn!==null){Qc=!0;var e=0,t=ve;try{var n=Bn;for(ve=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Bn=null,Qu=!1}catch(s){throw Bn!==null&&(Bn=Bn.slice(e+1)),Kb(Wh,Yr),s}finally{ve=t,Qc=!1}}return null}var ri=[],si=0,ru=null,su=0,Qt=[],Kt=0,Is=null,Kn=1,Xn="";function is(e,t){ri[si++]=su,ri[si++]=ru,ru=e,su=t}function _0(e,t,n){Qt[Kt++]=Kn,Qt[Kt++]=Xn,Qt[Kt++]=Is,Is=e;var r=Kn;e=Xn;var s=32-hn(r)-1;r&=~(1<<s),n+=1;var i=32-hn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Kn=1<<32-hn(t)+s|n<<s|r,Xn=i+e}else Kn=1<<i|n<<s|r,Xn=e}function tp(e){e.return!==null&&(is(e,1),_0(e,1,0))}function np(e){for(;e===ru;)ru=ri[--si],ri[si]=null,su=ri[--si],ri[si]=null;for(;e===Is;)Is=Qt[--Kt],Qt[Kt]=null,Xn=Qt[--Kt],Qt[Kt]=null,Kn=Qt[--Kt],Qt[Kt]=null}var zt=null,$t=null,Pe=!1,dn=null;function N0(e,t){var n=en(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 sg(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,zt=e,$t=$r(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,zt=e,$t=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Is!==null?{id:Kn,overflow:Xn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=en(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,zt=e,$t=null,!0):!1;default:return!1}}function bf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function vf(e){if(Pe){var t=$t;if(t){var n=t;if(!sg(e,t)){if(bf(e))throw Error(F(418));t=$r(n.nextSibling);var r=zt;t&&sg(e,t)?N0(r,n):(e.flags=e.flags&-4097|2,Pe=!1,zt=e)}}else{if(bf(e))throw Error(F(418));e.flags=e.flags&-4097|2,Pe=!1,zt=e}}}function ig(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;zt=e}function ia(e){if(e!==zt)return!1;if(!Pe)return ig(e),Pe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!mf(e.type,e.memoizedProps)),t&&(t=$t)){if(bf(e))throw E0(),Error(F(418));for(;t;)N0(e,t),t=$r(t.nextSibling)}if(ig(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){$t=$r(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}$t=null}}else $t=zt?$r(e.stateNode.nextSibling):null;return!0}function E0(){for(var e=$t;e;)e=$r(e.nextSibling)}function Ri(){$t=zt=null,Pe=!1}function rp(e){dn===null?dn=[e]:dn.push(e)}var qC=lr.ReactCurrentBatchConfig;function ao(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(F(309));var r=n.stateNode}if(!r)throw Error(F(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=s.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(F(284));if(!n._owner)throw Error(F(290,e))}return e}function oa(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function og(e){var t=e._init;return t(e._payload)}function j0(e){function t(g,x){if(e){var b=g.deletions;b===null?(g.deletions=[x],g.flags|=16):b.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function r(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function s(g,x){return g=Hr(g,x),g.index=0,g.sibling=null,g}function i(g,x,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<x?(g.flags|=2,x):b):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,x,b,w){return x===null||x.tag!==6?(x=td(b,g.mode,w),x.return=g,x):(x=s(x,b),x.return=g,x)}function a(g,x,b,w){var N=b.type;return N===Ys?f(g,x,b.props.children,w,b.key):x!==null&&(x.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===yr&&og(N)===x.type)?(w=s(x,b.props),w.ref=ao(g,x,b),w.return=g,w):(w=Oa(b.type,b.key,b.props,null,g.mode,w),w.ref=ao(g,x,b),w.return=g,w)}function u(g,x,b,w){return x===null||x.tag!==4||x.stateNode.containerInfo!==b.containerInfo||x.stateNode.implementation!==b.implementation?(x=nd(b,g.mode,w),x.return=g,x):(x=s(x,b.children||[]),x.return=g,x)}function f(g,x,b,w,N){return x===null||x.tag!==7?(x=Es(b,g.mode,w,N),x.return=g,x):(x=s(x,b),x.return=g,x)}function d(g,x,b){if(typeof x=="string"&&x!==""||typeof x=="number")return x=td(""+x,g.mode,b),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Kl:return b=Oa(x.type,x.key,x.props,null,g.mode,b),b.ref=ao(g,null,x),b.return=g,b;case Xs:return x=nd(x,g.mode,b),x.return=g,x;case yr:var w=x._init;return d(g,w(x._payload),b)}if(bo(x)||ro(x))return x=Es(x,g.mode,b,null),x.return=g,x;oa(g,x)}return null}function h(g,x,b,w){var N=x!==null?x.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return N!==null?null:l(g,x,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Kl:return b.key===N?a(g,x,b,w):null;case Xs:return b.key===N?u(g,x,b,w):null;case yr:return N=b._init,h(g,x,N(b._payload),w)}if(bo(b)||ro(b))return N!==null?null:f(g,x,b,w,null);oa(g,b)}return null}function p(g,x,b,w,N){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(b)||null,l(x,g,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Kl:return g=g.get(w.key===null?b:w.key)||null,a(x,g,w,N);case Xs:return g=g.get(w.key===null?b:w.key)||null,u(x,g,w,N);case yr:var k=w._init;return p(g,x,b,k(w._payload),N)}if(bo(w)||ro(w))return g=g.get(b)||null,f(x,g,w,N,null);oa(x,w)}return null}function m(g,x,b,w){for(var N=null,k=null,I=x,T=x=0,P=null;I!==null&&T<b.length;T++){I.index>T?(P=I,I=null):P=I.sibling;var E=h(g,I,b[T],w);if(E===null){I===null&&(I=P);break}e&&I&&E.alternate===null&&t(g,I),x=i(E,x,T),k===null?N=E:k.sibling=E,k=E,I=P}if(T===b.length)return n(g,I),Pe&&is(g,T),N;if(I===null){for(;T<b.length;T++)I=d(g,b[T],w),I!==null&&(x=i(I,x,T),k===null?N=I:k.sibling=I,k=I);return Pe&&is(g,T),N}for(I=r(g,I);T<b.length;T++)P=p(I,g,T,b[T],w),P!==null&&(e&&P.alternate!==null&&I.delete(P.key===null?T:P.key),x=i(P,x,T),k===null?N=P:k.sibling=P,k=P);return e&&I.forEach(function(M){return t(g,M)}),Pe&&is(g,T),N}function y(g,x,b,w){var N=ro(b);if(typeof N!="function")throw Error(F(150));if(b=N.call(b),b==null)throw Error(F(151));for(var k=N=null,I=x,T=x=0,P=null,E=b.next();I!==null&&!E.done;T++,E=b.next()){I.index>T?(P=I,I=null):P=I.sibling;var M=h(g,I,E.value,w);if(M===null){I===null&&(I=P);break}e&&I&&M.alternate===null&&t(g,I),x=i(M,x,T),k===null?N=M:k.sibling=M,k=M,I=P}if(E.done)return n(g,I),Pe&&is(g,T),N;if(I===null){for(;!E.done;T++,E=b.next())E=d(g,E.value,w),E!==null&&(x=i(E,x,T),k===null?N=E:k.sibling=E,k=E);return Pe&&is(g,T),N}for(I=r(g,I);!E.done;T++,E=b.next())E=p(I,g,T,E.value,w),E!==null&&(e&&E.alternate!==null&&I.delete(E.key===null?T:E.key),x=i(E,x,T),k===null?N=E:k.sibling=E,k=E);return e&&I.forEach(function(R){return t(g,R)}),Pe&&is(g,T),N}function v(g,x,b,w){if(typeof b=="object"&&b!==null&&b.type===Ys&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Kl:e:{for(var N=b.key,k=x;k!==null;){if(k.key===N){if(N=b.type,N===Ys){if(k.tag===7){n(g,k.sibling),x=s(k,b.props.children),x.return=g,g=x;break e}}else if(k.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===yr&&og(N)===k.type){n(g,k.sibling),x=s(k,b.props),x.ref=ao(g,k,b),x.return=g,g=x;break e}n(g,k);break}else t(g,k);k=k.sibling}b.type===Ys?(x=Es(b.props.children,g.mode,w,b.key),x.return=g,g=x):(w=Oa(b.type,b.key,b.props,null,g.mode,w),w.ref=ao(g,x,b),w.return=g,g=w)}return o(g);case Xs:e:{for(k=b.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===b.containerInfo&&x.stateNode.implementation===b.implementation){n(g,x.sibling),x=s(x,b.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=nd(b,g.mode,w),x.return=g,g=x}return o(g);case yr:return k=b._init,v(g,x,k(b._payload),w)}if(bo(b))return m(g,x,b,w);if(ro(b))return y(g,x,b,w);oa(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,x!==null&&x.tag===6?(n(g,x.sibling),x=s(x,b),x.return=g,g=x):(n(g,x),x=td(b,g.mode,w),x.return=g,g=x),o(g)):n(g,x)}return v}var Li=j0(!0),I0=j0(!1),iu=Xr(null),ou=null,ii=null,sp=null;function ip(){sp=ii=ou=null}function op(e){var t=iu.current;Ie(iu),e._currentValue=t}function wf(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 fi(e,t){ou=e,sp=ii=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(It=!0),e.firstContext=null)}function rn(e){var t=e._currentValue;if(sp!==e)if(e={context:e,memoizedValue:t,next:null},ii===null){if(ou===null)throw Error(F(308));ii=e,ou.dependencies={lanes:0,firstContext:e}}else ii=ii.next=e;return t}var cs=null;function lp(e){cs===null?cs=[e]:cs.push(e)}function T0(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,lp(t)):(n.next=s.next,s.next=n),t.interleaved=n,sr(e,r)}function sr(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 br=!1;function ap(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function P0(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 Jn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function zr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,xe&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,sr(e,n)}return s=r.interleaved,s===null?(t.next=t,lp(r)):(t.next=s.next,s.next=t),r.interleaved=t,sr(e,n)}function Ta(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,Vh(e,n)}}function lg(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=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};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,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 lu(e,t,n,r){var s=e.updateQueue;br=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var a=l,u=a.next;a.next=null,o===null?i=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(i!==null){var d=s.baseState;o=0,f=u=a=null,l=i;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,y=l;switch(h=t,p=n,y.tag){case 1:if(m=y.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=y.payload,h=typeof m=="function"?m.call(p,d,h):m,h==null)break e;d=Me({},d,h);break e;case 2:br=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.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=s.shared.pending,l===null)break;h=l,l=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(f===null&&(a=d),s.baseState=a,s.firstBaseUpdate=u,s.lastBaseUpdate=f,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Ps|=o,e.lanes=o,e.memoizedState=d}}function ag(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(F(191,s));s.call(r)}}}var Rl={},Tn=Xr(Rl),Zo=Xr(Rl),el=Xr(Rl);function ds(e){if(e===Rl)throw Error(F(174));return e}function up(e,t){switch(_e(el,t),_e(Zo,e),_e(Tn,Rl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ef(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ef(t,e)}Ie(Tn),_e(Tn,t)}function Mi(){Ie(Tn),Ie(Zo),Ie(el)}function A0(e){ds(el.current);var t=ds(Tn.current),n=ef(t,e.type);t!==n&&(_e(Zo,e),_e(Tn,n))}function cp(e){Zo.current===e&&(Ie(Tn),Ie(Zo))}var Re=Xr(0);function au(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 Kc=[];function dp(){for(var e=0;e<Kc.length;e++)Kc[e]._workInProgressVersionPrimary=null;Kc.length=0}var Pa=lr.ReactCurrentDispatcher,Xc=lr.ReactCurrentBatchConfig,Ts=0,Le=null,qe=null,Je=null,uu=!1,To=!1,tl=0,WC=0;function it(){throw Error(F(321))}function fp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xn(e[n],t[n]))return!1;return!0}function hp(e,t,n,r,s,i){if(Ts=i,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Pa.current=e===null||e.memoizedState===null?XC:YC,e=n(r,s),To){i=0;do{if(To=!1,tl=0,25<=i)throw Error(F(301));i+=1,Je=qe=null,t.updateQueue=null,Pa.current=JC,e=n(r,s)}while(To)}if(Pa.current=cu,t=qe!==null&&qe.next!==null,Ts=0,Je=qe=Le=null,uu=!1,t)throw Error(F(300));return e}function pp(){var e=tl!==0;return tl=0,e}function wn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?Le.memoizedState=Je=e:Je=Je.next=e,Je}function sn(){if(qe===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=Je===null?Le.memoizedState:Je.next;if(t!==null)Je=t,qe=e;else{if(e===null)throw Error(F(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},Je===null?Le.memoizedState=Je=e:Je=Je.next=e}return Je}function nl(e,t){return typeof t=="function"?t(e):t}function Yc(e){var t=sn(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=qe,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var l=o=null,a=null,u=i;do{var f=u.lane;if((Ts&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,Le.lanes|=f,Ps|=f}u=u.next}while(u!==null&&u!==i);a===null?o=r:a.next=l,xn(r,t.memoizedState)||(It=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Le.lanes|=i,Ps|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Jc(e){var t=sn(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);xn(i,t.memoizedState)||(It=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function R0(){}function L0(e,t){var n=Le,r=sn(),s=t(),i=!xn(r.memoizedState,s);if(i&&(r.memoizedState=s,It=!0),r=r.queue,mp(D0.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Je!==null&&Je.memoizedState.tag&1){if(n.flags|=2048,rl(9,O0.bind(null,n,r,s,t),void 0,null),et===null)throw Error(F(349));Ts&30||M0(n,t,s)}return s}function M0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Le.updateQueue,t===null?(t={lastEffect:null,stores:null},Le.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function O0(e,t,n,r){t.value=n,t.getSnapshot=r,F0(t)&&$0(e)}function D0(e,t,n){return n(function(){F0(t)&&$0(e)})}function F0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xn(e,n)}catch{return!0}}function $0(e){var t=sr(e,1);t!==null&&pn(t,e,1,-1)}function ug(e){var t=wn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:nl,lastRenderedState:e},t.queue=e,e=e.dispatch=KC.bind(null,Le,e),[t.memoizedState,e]}function rl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Le.updateQueue,t===null?(t={lastEffect:null,stores:null},Le.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 sn().memoizedState}function Aa(e,t,n,r){var s=wn();Le.flags|=e,s.memoizedState=rl(1|t,n,void 0,r===void 0?null:r)}function Ku(e,t,n,r){var s=sn();r=r===void 0?null:r;var i=void 0;if(qe!==null){var o=qe.memoizedState;if(i=o.destroy,r!==null&&fp(r,o.deps)){s.memoizedState=rl(t,n,i,r);return}}Le.flags|=e,s.memoizedState=rl(1|t,n,i,r)}function cg(e,t){return Aa(8390656,8,e,t)}function mp(e,t){return Ku(2048,8,e,t)}function B0(e,t){return Ku(4,2,e,t)}function U0(e,t){return Ku(4,4,e,t)}function H0(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 G0(e,t,n){return n=n!=null?n.concat([e]):null,Ku(4,4,H0.bind(null,t,e),n)}function gp(){}function q0(e,t){var n=sn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&fp(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function W0(e,t){var n=sn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&fp(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function V0(e,t,n){return Ts&21?(xn(n,t)||(n=Jb(),Le.lanes|=n,Ps|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,It=!0),e.memoizedState=n)}function VC(e,t){var n=ve;ve=n!==0&&4>n?n:4,e(!0);var r=Xc.transition;Xc.transition={};try{e(!1),t()}finally{ve=n,Xc.transition=r}}function Q0(){return sn().memoizedState}function QC(e,t,n){var r=Ur(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},K0(e))X0(t,n);else if(n=T0(e,t,n,r),n!==null){var s=vt();pn(n,e,r,s),Y0(n,t,r)}}function KC(e,t,n){var r=Ur(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(K0(e))X0(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(s.hasEagerState=!0,s.eagerState=l,xn(l,o)){var a=t.interleaved;a===null?(s.next=s,lp(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}n=T0(e,t,s,r),n!==null&&(s=vt(),pn(n,e,r,s),Y0(n,t,r))}}function K0(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function X0(e,t){To=uu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Y0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vh(e,n)}}var cu={readContext:rn,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},XC={readContext:rn,useCallback:function(e,t){return wn().memoizedState=[e,t===void 0?null:t],e},useContext:rn,useEffect:cg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Aa(4194308,4,H0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Aa(4194308,4,e,t)},useInsertionEffect:function(e,t){return Aa(4,2,e,t)},useMemo:function(e,t){var n=wn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=wn();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=QC.bind(null,Le,e),[r.memoizedState,e]},useRef:function(e){var t=wn();return e={current:e},t.memoizedState=e},useState:ug,useDebugValue:gp,useDeferredValue:function(e){return wn().memoizedState=e},useTransition:function(){var e=ug(!1),t=e[0];return e=VC.bind(null,e[1]),wn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Le,s=wn();if(Pe){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),et===null)throw Error(F(349));Ts&30||M0(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,cg(D0.bind(null,r,i,e),[e]),r.flags|=2048,rl(9,O0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=wn(),t=et.identifierPrefix;if(Pe){var n=Xn,r=Kn;n=(r&~(1<<32-hn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=tl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=WC++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},YC={readContext:rn,useCallback:q0,useContext:rn,useEffect:mp,useImperativeHandle:G0,useInsertionEffect:B0,useLayoutEffect:U0,useMemo:W0,useReducer:Yc,useRef:z0,useState:function(){return Yc(nl)},useDebugValue:gp,useDeferredValue:function(e){var t=sn();return V0(t,qe.memoizedState,e)},useTransition:function(){var e=Yc(nl)[0],t=sn().memoizedState;return[e,t]},useMutableSource:R0,useSyncExternalStore:L0,useId:Q0,unstable_isNewReconciler:!1},JC={readContext:rn,useCallback:q0,useContext:rn,useEffect:mp,useImperativeHandle:G0,useInsertionEffect:B0,useLayoutEffect:U0,useMemo:W0,useReducer:Jc,useRef:z0,useState:function(){return Jc(nl)},useDebugValue:gp,useDeferredValue:function(e){var t=sn();return qe===null?t.memoizedState=e:V0(t,qe.memoizedState,e)},useTransition:function(){var e=Jc(nl)[0],t=sn().memoizedState;return[e,t]},useMutableSource:R0,useSyncExternalStore:L0,useId:Q0,unstable_isNewReconciler:!1};function an(e,t){if(e&&e.defaultProps){t=Me({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function kf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Me({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xu={isMounted:function(e){return(e=e._reactInternals)?Ds(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=vt(),s=Ur(e),i=Jn(r,s);i.payload=t,n!=null&&(i.callback=n),t=zr(e,i,s),t!==null&&(pn(t,e,s,r),Ta(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=vt(),s=Ur(e),i=Jn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=zr(e,i,s),t!==null&&(pn(t,e,s,r),Ta(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=vt(),r=Ur(e),s=Jn(n,r);s.tag=2,t!=null&&(s.callback=t),t=zr(e,s,r),t!==null&&(pn(t,e,r,n),Ta(t,e,r))}};function dg(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Ko(n,r)||!Ko(s,i):!0}function J0(e,t,n){var r=!1,s=Qr,i=t.contextType;return typeof i=="object"&&i!==null?i=rn(i):(s=Pt(t)?js:ht.current,r=t.contextTypes,i=(r=r!=null)?Ai(e,s):Qr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function fg(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&&Xu.enqueueReplaceState(t,t.state,null)}function Sf(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},ap(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=rn(i):(i=Pt(t)?js:ht.current,s.context=Ai(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(kf(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Xu.enqueueReplaceState(s,s.state,null),lu(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Oi(e,t){try{var n="",r=t;do n+=NS(r),r=r.return;while(r);var s=n}catch(i){s=`
|
|
40
|
+
Error generating stack: `+i.message+`
|
|
41
|
+
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function Zc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Cf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ZC=typeof WeakMap=="function"?WeakMap:Map;function Z0(e,t,n){n=Jn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){fu||(fu=!0,Lf=r),Cf(e,t)},n}function e1(e,t,n){n=Jn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Cf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Cf(e,t),typeof r!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function hg(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ZC;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=h_.bind(null,e,t,n),t.then(e,e))}function pg(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 mg(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,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=Jn(-1,1),t.tag=2,zr(n,t,1))),n.lanes|=1),e)}var e_=lr.ReactCurrentOwner,It=!1;function xt(e,t,n,r){t.child=e===null?I0(t,null,n,r):Li(t,e.child,n,r)}function gg(e,t,n,r,s){n=n.render;var i=t.ref;return fi(t,s),r=hp(e,t,n,r,i,s),n=pp(),e!==null&&!It?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ir(e,t,s)):(Pe&&n&&tp(t),t.flags|=1,xt(e,t,r,s),t.child)}function xg(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Cp(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,t1(e,t,i,r,s)):(e=Oa(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ko,n(o,r)&&e.ref===t.ref)return ir(e,t,s)}return t.flags|=1,e=Hr(i,r),e.ref=t.ref,e.return=t,t.child=e}function t1(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Ko(i,r)&&e.ref===t.ref)if(It=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(It=!0);else return t.lanes=e.lanes,ir(e,t,s)}return _f(e,t,n,r,s)}function n1(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(li,Ot),Ot|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_e(li,Ot),Ot|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,_e(li,Ot),Ot|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,_e(li,Ot),Ot|=r;return xt(e,t,s,n),t.child}function r1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function _f(e,t,n,r,s){var i=Pt(n)?js:ht.current;return i=Ai(t,i),fi(t,s),n=hp(e,t,n,r,i,s),r=pp(),e!==null&&!It?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ir(e,t,s)):(Pe&&r&&tp(t),t.flags|=1,xt(e,t,n,s),t.child)}function yg(e,t,n,r,s){if(Pt(n)){var i=!0;nu(t)}else i=!1;if(fi(t,s),t.stateNode===null)Ra(e,t),J0(t,n,r),Sf(t,n,r,s),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=rn(u):(u=Pt(n)?js:ht.current,u=Ai(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)&&fg(t,o,r,u),br=!1;var h=t.memoizedState;o.state=h,lu(t,r,o,s),a=t.memoizedState,l!==r||h!==a||Tt.current||br?(typeof f=="function"&&(kf(t,n,f,r),a=t.memoizedState),(l=br||dg(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,P0(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:an(t.type,l),o.props=u,d=t.pendingProps,h=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=rn(a):(a=Pt(n)?js:ht.current,a=Ai(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)&&fg(t,o,r,a),br=!1,h=t.memoizedState,o.state=h,lu(t,r,o,s);var m=t.memoizedState;l!==d||h!==m||Tt.current||br?(typeof p=="function"&&(kf(t,n,p,r),m=t.memoizedState),(u=br||dg(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 Nf(e,t,n,r,i,s)}function Nf(e,t,n,r,s,i){r1(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&rg(t,n,!1),ir(e,t,i);r=t.stateNode,e_.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Li(t,e.child,null,i),t.child=Li(t,null,l,i)):xt(e,t,l,i),t.memoizedState=r.state,s&&rg(t,n,!0),t.child}function s1(e){var t=e.stateNode;t.pendingContext?ng(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ng(e,t.context,!1),up(e,t.containerInfo)}function bg(e,t,n,r,s){return Ri(),rp(s),t.flags|=256,xt(e,t,n,r),t.child}var Ef={dehydrated:null,treeContext:null,retryLane:0};function jf(e){return{baseLanes:e,cachePool:null,transitions:null}}function i1(e,t,n){var r=t.pendingProps,s=Re.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),_e(Re,s&1),e===null)return vf(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,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Zu(o,r,0,null),e=Es(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=jf(n),t.memoizedState=Ef,e):xp(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return t_(e,t,o,r,l,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,l=s.sibling;var a={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Hr(s,a),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=Hr(l,i):(i=Es(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?jf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Ef,r}return i=e.child,e=i.sibling,r=Hr(i,{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 xp(e,t){return t=Zu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function la(e,t,n,r){return r!==null&&rp(r),Li(t,e.child,null,n),e=xp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function t_(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=Zc(Error(F(422))),la(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Zu({mode:"visible",children:r.children},s,0,null),i=Es(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Li(t,e.child,null,o),t.child.memoizedState=jf(o),t.memoizedState=Ef,i);if(!(t.mode&1))return la(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(F(419)),r=Zc(i,r,void 0),la(e,t,o,r)}if(l=(o&e.childLanes)!==0,It||l){if(r=et,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,sr(e,s),pn(r,e,s,-1))}return Sp(),r=Zc(Error(F(421))),la(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=p_.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,$t=$r(s.nextSibling),zt=t,Pe=!0,dn=null,e!==null&&(Qt[Kt++]=Kn,Qt[Kt++]=Xn,Qt[Kt++]=Is,Kn=e.id,Xn=e.overflow,Is=t),t=xp(t,r.children),t.flags|=4096,t)}function vg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),wf(e.return,t,n)}function ed(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function o1(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(xt(e,t,r.children,n),r=Re.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&&vg(e,n,t);else if(e.tag===19)vg(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(_e(Re,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&au(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),ed(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&au(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}ed(t,!0,n,null,i);break;case"together":ed(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ra(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ir(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ps|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,n=Hr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Hr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function n_(e,t,n){switch(t.tag){case 3:s1(t),Ri();break;case 5:A0(t);break;case 1:Pt(t.type)&&nu(t);break;case 4:up(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;_e(iu,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(_e(Re,Re.current&1),t.flags|=128,null):n&t.child.childLanes?i1(e,t,n):(_e(Re,Re.current&1),e=ir(e,t,n),e!==null?e.sibling:null);_e(Re,Re.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return o1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),_e(Re,Re.current),r)break;return null;case 22:case 23:return t.lanes=0,n1(e,t,n)}return ir(e,t,n)}var l1,If,a1,u1;l1=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}};If=function(){};a1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,ds(Tn.current);var i=null;switch(n){case"input":s=Xd(e,s),r=Xd(e,r),i=[];break;case"select":s=Me({},s,{value:void 0}),r=Me({},r,{value:void 0}),i=[];break;case"textarea":s=Zd(e,s),r=Zd(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=eu)}tf(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Uo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=s!=null?s[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||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Uo.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&je("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};u1=function(e,t,n,r){n!==r&&(t.flags|=4)};function uo(e,t){if(!Pe)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 ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function r_(e,t,n){var r=t.pendingProps;switch(np(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return Pt(t.type)&&tu(),ot(t),null;case 3:return r=t.stateNode,Mi(),Ie(Tt),Ie(ht),dp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ia(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,dn!==null&&(Df(dn),dn=null))),If(e,t),ot(t),null;case 5:cp(t);var s=ds(el.current);if(n=t.type,e!==null&&t.stateNode!=null)a1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(F(166));return ot(t),null}if(e=ds(Tn.current),ia(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[En]=t,r[Jo]=i,e=(t.mode&1)!==0,n){case"dialog":je("cancel",r),je("close",r);break;case"iframe":case"object":case"embed":je("load",r);break;case"video":case"audio":for(s=0;s<wo.length;s++)je(wo[s],r);break;case"source":je("error",r);break;case"img":case"image":case"link":je("error",r),je("load",r);break;case"details":je("toggle",r);break;case"input":Im(r,i),je("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},je("invalid",r);break;case"textarea":Pm(r,i),je("invalid",r)}tf(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&sa(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&sa(r.textContent,l,e),s=["children",""+l]):Uo.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&je("scroll",r)}switch(n){case"input":Xl(r),Tm(r,i,!0);break;case"textarea":Xl(r),Am(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=eu)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Db(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[En]=t,e[Jo]=r,l1(e,t,!1,!1),t.stateNode=e;e:{switch(o=nf(n,r),n){case"dialog":je("cancel",e),je("close",e),s=r;break;case"iframe":case"object":case"embed":je("load",e),s=r;break;case"video":case"audio":for(s=0;s<wo.length;s++)je(wo[s],e);s=r;break;case"source":je("error",e),s=r;break;case"img":case"image":case"link":je("error",e),je("load",e),s=r;break;case"details":je("toggle",e),s=r;break;case"input":Im(e,r),s=Xd(e,r),je("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Me({},r,{value:void 0}),je("invalid",e);break;case"textarea":Pm(e,r),s=Zd(e,r),je("invalid",e);break;default:s=r}tf(n,s),l=s;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?zb(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Fb(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Ho(e,a):typeof a=="number"&&Ho(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Uo.hasOwnProperty(i)?a!=null&&i==="onScroll"&&je("scroll",e):a!=null&&Bh(e,i,a,o))}switch(n){case"input":Xl(e),Tm(e,r,!1);break;case"textarea":Xl(e),Am(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Vr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?ai(e,!!r.multiple,i,!1):r.defaultValue!=null&&ai(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=eu)}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 ot(t),null;case 6:if(e&&t.stateNode!=null)u1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(F(166));if(n=ds(el.current),ds(Tn.current),ia(t)){if(r=t.stateNode,n=t.memoizedProps,r[En]=t,(i=r.nodeValue!==n)&&(e=zt,e!==null))switch(e.tag){case 3:sa(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&sa(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[En]=t,t.stateNode=r}return ot(t),null;case 13:if(Ie(Re),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Pe&&$t!==null&&t.mode&1&&!(t.flags&128))E0(),Ri(),t.flags|=98560,i=!1;else if(i=ia(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(F(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(F(317));i[En]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ot(t),i=!1}else dn!==null&&(Df(dn),dn=null),i=!0;if(!i)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||Re.current&1?Qe===0&&(Qe=3):Sp())),t.updateQueue!==null&&(t.flags|=4),ot(t),null);case 4:return Mi(),If(e,t),e===null&&Xo(t.stateNode.containerInfo),ot(t),null;case 10:return op(t.type._context),ot(t),null;case 17:return Pt(t.type)&&tu(),ot(t),null;case 19:if(Ie(Re),i=t.memoizedState,i===null)return ot(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)uo(i,!1);else{if(Qe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=au(e),o!==null){for(t.flags|=128,uo(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _e(Re,Re.current&1|2),t.child}e=e.sibling}i.tail!==null&&Be()>Di&&(t.flags|=128,r=!0,uo(i,!1),t.lanes=4194304)}else{if(!r)if(e=au(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),uo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Pe)return ot(t),null}else 2*Be()-i.renderingStartTime>Di&&n!==1073741824&&(t.flags|=128,r=!0,uo(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Be(),t.sibling=null,n=Re.current,_e(Re,r?n&1|2:n&1),t):(ot(t),null);case 22:case 23:return kp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ot&1073741824&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function s_(e,t){switch(np(t),t.tag){case 1:return Pt(t.type)&&tu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mi(),Ie(Tt),Ie(ht),dp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return cp(t),null;case 13:if(Ie(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Re),null;case 4:return Mi(),null;case 10:return op(t.type._context),null;case 22:case 23:return kp(),null;case 24:return null;default:return null}}var aa=!1,ut=!1,i_=typeof WeakSet=="function"?WeakSet:Set,W=null;function oi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Fe(e,t,r)}else n.current=null}function Tf(e,t,n){try{n()}catch(r){Fe(e,t,r)}}var wg=!1;function o_(e,t){if(hf=Ya,e=p0(),ep(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 s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.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||s!==0&&d.nodeType!==3||(l=o+s),d!==i||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===s&&(l=o),h===i&&++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(pf={focusedElem:e,selectionRange:n},Ya=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;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 y=m.memoizedProps,v=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:an(t.type,y),v);g.__reactInternalSnapshotBeforeUpdate=x}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(F(163))}}catch(w){Fe(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return m=wg,wg=!1,m}function Po(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Tf(t,n,i)}s=s.next}while(s!==r)}}function Yu(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 Pf(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 c1(e){var t=e.alternate;t!==null&&(e.alternate=null,c1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[En],delete t[Jo],delete t[xf],delete t[UC],delete t[HC])),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 d1(e){return e.tag===5||e.tag===3||e.tag===4}function kg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||d1(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 Af(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=eu));else if(r!==4&&(e=e.child,e!==null))for(Af(e,t,n),e=e.sibling;e!==null;)Af(e,t,n),e=e.sibling}function Rf(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(Rf(e,t,n),e=e.sibling;e!==null;)Rf(e,t,n),e=e.sibling}var tt=null,cn=!1;function dr(e,t,n){for(n=n.child;n!==null;)f1(e,t,n),n=n.sibling}function f1(e,t,n){if(In&&typeof In.onCommitFiberUnmount=="function")try{In.onCommitFiberUnmount(Hu,n)}catch{}switch(n.tag){case 5:ut||oi(n,t);case 6:var r=tt,s=cn;tt=null,dr(e,t,n),tt=r,cn=s,tt!==null&&(cn?(e=tt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):tt.removeChild(n.stateNode));break;case 18:tt!==null&&(cn?(e=tt,n=n.stateNode,e.nodeType===8?Vc(e.parentNode,n):e.nodeType===1&&Vc(e,n),Vo(e)):Vc(tt,n.stateNode));break;case 4:r=tt,s=cn,tt=n.stateNode.containerInfo,cn=!0,dr(e,t,n),tt=r,cn=s;break;case 0:case 11:case 14:case 15:if(!ut&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Tf(n,t,o),s=s.next}while(s!==r)}dr(e,t,n);break;case 1:if(!ut&&(oi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Fe(n,t,l)}dr(e,t,n);break;case 21:dr(e,t,n);break;case 22:n.mode&1?(ut=(r=ut)||n.memoizedState!==null,dr(e,t,n),ut=r):dr(e,t,n);break;default:dr(e,t,n)}}function Sg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new i_),t.forEach(function(r){var s=m_.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ln(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:tt=l.stateNode,cn=!1;break e;case 3:tt=l.stateNode.containerInfo,cn=!0;break e;case 4:tt=l.stateNode.containerInfo,cn=!0;break e}l=l.return}if(tt===null)throw Error(F(160));f1(i,o,s),tt=null,cn=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(u){Fe(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)h1(t,e),t=t.sibling}function h1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ln(t,e),bn(e),r&4){try{Po(3,e,e.return),Yu(3,e)}catch(y){Fe(e,e.return,y)}try{Po(5,e,e.return)}catch(y){Fe(e,e.return,y)}}break;case 1:ln(t,e),bn(e),r&512&&n!==null&&oi(n,n.return);break;case 5:if(ln(t,e),bn(e),r&512&&n!==null&&oi(n,n.return),e.flags&32){var s=e.stateNode;try{Ho(s,"")}catch(y){Fe(e,e.return,y)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Mb(s,i),nf(l,o);var u=nf(l,i);for(o=0;o<a.length;o+=2){var f=a[o],d=a[o+1];f==="style"?zb(s,d):f==="dangerouslySetInnerHTML"?Fb(s,d):f==="children"?Ho(s,d):Bh(s,f,d,u)}switch(l){case"input":Yd(s,i);break;case"textarea":Ob(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?ai(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?ai(s,!!i.multiple,i.defaultValue,!0):ai(s,!!i.multiple,i.multiple?[]:"",!1))}s[Jo]=i}catch(y){Fe(e,e.return,y)}}break;case 6:if(ln(t,e),bn(e),r&4){if(e.stateNode===null)throw Error(F(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(y){Fe(e,e.return,y)}}break;case 3:if(ln(t,e),bn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vo(t.containerInfo)}catch(y){Fe(e,e.return,y)}break;case 4:ln(t,e),bn(e);break;case 13:ln(t,e),bn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(vp=Be())),r&4&&Sg(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(ut=(u=ut)||f,ln(t,e),ut=u):ln(t,e),bn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(W=e,f=e.child;f!==null;){for(d=W=f;W!==null;){switch(h=W,p=h.child,h.tag){case 0:case 11:case 14:case 15:Po(4,h,h.return);break;case 1:oi(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(y){Fe(r,n,y)}}break;case 5:oi(h,h.return);break;case 22:if(h.memoizedState!==null){_g(d);continue}}p!==null?(p.return=h,W=p):_g(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{s=d.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,a=d.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=$b("display",o))}catch(y){Fe(e,e.return,y)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){Fe(e,e.return,y)}}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:ln(t,e),bn(e),r&4&&Sg(e);break;case 21:break;default:ln(t,e),bn(e)}}function bn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(d1(n)){var r=n;break e}n=n.return}throw Error(F(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Ho(s,""),r.flags&=-33);var i=kg(e);Rf(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,l=kg(e);Af(e,l,o);break;default:throw Error(F(161))}}catch(a){Fe(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function l_(e,t,n){W=e,p1(e)}function p1(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var s=W,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||aa;if(!o){var l=s.alternate,a=l!==null&&l.memoizedState!==null||ut;l=aa;var u=ut;if(aa=o,(ut=a)&&!u)for(W=s;W!==null;)o=W,a=o.child,o.tag===22&&o.memoizedState!==null?Ng(s):a!==null?(a.return=o,W=a):Ng(s);for(;i!==null;)W=i,p1(i),i=i.sibling;W=s,aa=l,ut=u}Cg(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,W=i):Cg(e)}}function Cg(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ut||Yu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ut)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:an(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&ag(t,i,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}ag(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&&Vo(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}ut||t.flags&512&&Pf(t)}catch(h){Fe(t,t.return,h)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function _g(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function Ng(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Yu(4,t)}catch(a){Fe(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(a){Fe(t,s,a)}}var i=t.return;try{Pf(t)}catch(a){Fe(t,i,a)}break;case 5:var o=t.return;try{Pf(t)}catch(a){Fe(t,o,a)}}}catch(a){Fe(t,t.return,a)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var a_=Math.ceil,du=lr.ReactCurrentDispatcher,yp=lr.ReactCurrentOwner,nn=lr.ReactCurrentBatchConfig,xe=0,et=null,Ge=null,nt=0,Ot=0,li=Xr(0),Qe=0,sl=null,Ps=0,Ju=0,bp=0,Ao=null,jt=null,vp=0,Di=1/0,zn=null,fu=!1,Lf=null,Br=null,ua=!1,Mr=null,hu=0,Ro=0,Mf=null,La=-1,Ma=0;function vt(){return xe&6?Be():La!==-1?La:La=Be()}function Ur(e){return e.mode&1?xe&2&&nt!==0?nt&-nt:qC.transition!==null?(Ma===0&&(Ma=Jb()),Ma):(e=ve,e!==0||(e=window.event,e=e===void 0?16:i0(e.type)),e):1}function pn(e,t,n,r){if(50<Ro)throw Ro=0,Mf=null,Error(F(185));Tl(e,n,r),(!(xe&2)||e!==et)&&(e===et&&(!(xe&2)&&(Ju|=n),Qe===4&&kr(e,nt)),At(e,r),n===1&&xe===0&&!(t.mode&1)&&(Di=Be()+500,Qu&&Yr()))}function At(e,t){var n=e.callbackNode;qS(e,t);var r=Xa(e,e===et?nt:0);if(r===0)n!==null&&Mm(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Mm(n),t===1)e.tag===0?GC(Eg.bind(null,e)):C0(Eg.bind(null,e)),zC(function(){!(xe&6)&&Yr()}),n=null;else{switch(Zb(r)){case 1:n=Wh;break;case 4:n=Xb;break;case 16:n=Ka;break;case 536870912:n=Yb;break;default:n=Ka}n=k1(n,m1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function m1(e,t){if(La=-1,Ma=0,xe&6)throw Error(F(327));var n=e.callbackNode;if(hi()&&e.callbackNode!==n)return null;var r=Xa(e,e===et?nt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=pu(e,r);else{t=r;var s=xe;xe|=2;var i=x1();(et!==e||nt!==t)&&(zn=null,Di=Be()+500,Ns(e,t));do try{d_();break}catch(l){g1(e,l)}while(!0);ip(),du.current=i,xe=s,Ge!==null?t=0:(et=null,nt=0,t=Qe)}if(t!==0){if(t===2&&(s=af(e),s!==0&&(r=s,t=Of(e,s))),t===1)throw n=sl,Ns(e,0),kr(e,r),At(e,Be()),n;if(t===6)kr(e,r);else{if(s=e.current.alternate,!(r&30)&&!u_(s)&&(t=pu(e,r),t===2&&(i=af(e),i!==0&&(r=i,t=Of(e,i))),t===1))throw n=sl,Ns(e,0),kr(e,r),At(e,Be()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(F(345));case 2:os(e,jt,zn);break;case 3:if(kr(e,r),(r&130023424)===r&&(t=vp+500-Be(),10<t)){if(Xa(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){vt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=gf(os.bind(null,e,jt,zn),t);break}os(e,jt,zn);break;case 4:if(kr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-hn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=Be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*a_(r/1960))-r,10<r){e.timeoutHandle=gf(os.bind(null,e,jt,zn),r);break}os(e,jt,zn);break;case 5:os(e,jt,zn);break;default:throw Error(F(329))}}}return At(e,Be()),e.callbackNode===n?m1.bind(null,e):null}function Of(e,t){var n=Ao;return e.current.memoizedState.isDehydrated&&(Ns(e,t).flags|=256),e=pu(e,t),e!==2&&(t=jt,jt=n,t!==null&&Df(t)),e}function Df(e){jt===null?jt=e:jt.push.apply(jt,e)}function u_(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 s=n[r],i=s.getSnapshot;s=s.value;try{if(!xn(i(),s))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 kr(e,t){for(t&=~bp,t&=~Ju,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-hn(t),r=1<<n;e[n]=-1,t&=~r}}function Eg(e){if(xe&6)throw Error(F(327));hi();var t=Xa(e,0);if(!(t&1))return At(e,Be()),null;var n=pu(e,t);if(e.tag!==0&&n===2){var r=af(e);r!==0&&(t=r,n=Of(e,r))}if(n===1)throw n=sl,Ns(e,0),kr(e,t),At(e,Be()),n;if(n===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,os(e,jt,zn),At(e,Be()),null}function wp(e,t){var n=xe;xe|=1;try{return e(t)}finally{xe=n,xe===0&&(Di=Be()+500,Qu&&Yr())}}function As(e){Mr!==null&&Mr.tag===0&&!(xe&6)&&hi();var t=xe;xe|=1;var n=nn.transition,r=ve;try{if(nn.transition=null,ve=1,e)return e()}finally{ve=r,nn.transition=n,xe=t,!(xe&6)&&Yr()}}function kp(){Ot=li.current,Ie(li)}function Ns(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,$C(n)),Ge!==null)for(n=Ge.return;n!==null;){var r=n;switch(np(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&tu();break;case 3:Mi(),Ie(Tt),Ie(ht),dp();break;case 5:cp(r);break;case 4:Mi();break;case 13:Ie(Re);break;case 19:Ie(Re);break;case 10:op(r.type._context);break;case 22:case 23:kp()}n=n.return}if(et=e,Ge=e=Hr(e.current,null),nt=Ot=t,Qe=0,sl=null,bp=Ju=Ps=0,jt=Ao=null,cs!==null){for(t=0;t<cs.length;t++)if(n=cs[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}cs=null}return e}function g1(e,t){do{var n=Ge;try{if(ip(),Pa.current=cu,uu){for(var r=Le.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}uu=!1}if(Ts=0,Je=qe=Le=null,To=!1,tl=0,yp.current=null,n===null||n.return===null){Qe=1,sl=t,Ge=null;break}e:{var i=e,o=n.return,l=n,a=t;if(t=nt,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=pg(o);if(p!==null){p.flags&=-257,mg(p,o,l,i,t),p.mode&1&&hg(i,u,t),t=p,a=u;var m=t.updateQueue;if(m===null){var y=new Set;y.add(a),t.updateQueue=y}else m.add(a);break e}else{if(!(t&1)){hg(i,u,t),Sp();break e}a=Error(F(426))}}else if(Pe&&l.mode&1){var v=pg(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),mg(v,o,l,i,t),rp(Oi(a,l));break e}}i=a=Oi(a,l),Qe!==4&&(Qe=2),Ao===null?Ao=[i]:Ao.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=Z0(i,a,t);lg(i,g);break e;case 1:l=a;var x=i.type,b=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Br===null||!Br.has(b)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=e1(i,l,t);lg(i,w);break e}}i=i.return}while(i!==null)}b1(n)}catch(N){t=N,Ge===n&&n!==null&&(Ge=n=n.return);continue}break}while(!0)}function x1(){var e=du.current;return du.current=cu,e===null?cu:e}function Sp(){(Qe===0||Qe===3||Qe===2)&&(Qe=4),et===null||!(Ps&268435455)&&!(Ju&268435455)||kr(et,nt)}function pu(e,t){var n=xe;xe|=2;var r=x1();(et!==e||nt!==t)&&(zn=null,Ns(e,t));do try{c_();break}catch(s){g1(e,s)}while(!0);if(ip(),xe=n,du.current=r,Ge!==null)throw Error(F(261));return et=null,nt=0,Qe}function c_(){for(;Ge!==null;)y1(Ge)}function d_(){for(;Ge!==null&&!OS();)y1(Ge)}function y1(e){var t=w1(e.alternate,e,Ot);e.memoizedProps=e.pendingProps,t===null?b1(e):Ge=t,yp.current=null}function b1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=s_(n,t),n!==null){n.flags&=32767,Ge=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qe=6,Ge=null;return}}else if(n=r_(n,t,Ot),n!==null){Ge=n;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);Qe===0&&(Qe=5)}function os(e,t,n){var r=ve,s=nn.transition;try{nn.transition=null,ve=1,f_(e,t,n,r)}finally{nn.transition=s,ve=r}return null}function f_(e,t,n,r){do hi();while(Mr!==null);if(xe&6)throw Error(F(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(F(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(WS(e,i),e===et&&(Ge=et=null,nt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ua||(ua=!0,k1(Ka,function(){return hi(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=nn.transition,nn.transition=null;var o=ve;ve=1;var l=xe;xe|=4,yp.current=null,o_(e,n),h1(n,e),AC(pf),Ya=!!hf,pf=hf=null,e.current=n,l_(n),DS(),xe=l,ve=o,nn.transition=i}else e.current=n;if(ua&&(ua=!1,Mr=e,hu=s),i=e.pendingLanes,i===0&&(Br=null),zS(n.stateNode),At(e,Be()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(fu)throw fu=!1,e=Lf,Lf=null,e;return hu&1&&e.tag!==0&&hi(),i=e.pendingLanes,i&1?e===Mf?Ro++:(Ro=0,Mf=e):Ro=0,Yr(),null}function hi(){if(Mr!==null){var e=Zb(hu),t=nn.transition,n=ve;try{if(nn.transition=null,ve=16>e?16:e,Mr===null)var r=!1;else{if(e=Mr,Mr=null,hu=0,xe&6)throw Error(F(331));var s=xe;for(xe|=4,W=e.current;W!==null;){var i=W,o=i.child;if(W.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(W=u;W!==null;){var f=W;switch(f.tag){case 0:case 11:case 15:Po(8,f,i)}var d=f.child;if(d!==null)d.return=f,W=d;else for(;W!==null;){f=W;var h=f.sibling,p=f.return;if(c1(f),f===u){W=null;break}if(h!==null){h.return=p,W=h;break}W=p}}}var m=i.alternate;if(m!==null){var y=m.child;if(y!==null){m.child=null;do{var v=y.sibling;y.sibling=null,y=v}while(y!==null)}}W=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,W=o;else e:for(;W!==null;){if(i=W,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Po(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,W=g;break e}W=i.return}}var x=e.current;for(W=x;W!==null;){o=W;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,W=b;else e:for(o=x;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Yu(9,l)}}catch(N){Fe(l,l.return,N)}if(l===o){W=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,W=w;break e}W=l.return}}if(xe=s,Yr(),In&&typeof In.onPostCommitFiberRoot=="function")try{In.onPostCommitFiberRoot(Hu,e)}catch{}r=!0}return r}finally{ve=n,nn.transition=t}}return!1}function jg(e,t,n){t=Oi(n,t),t=Z0(e,t,1),e=zr(e,t,1),t=vt(),e!==null&&(Tl(e,1,t),At(e,t))}function Fe(e,t,n){if(e.tag===3)jg(e,e,n);else for(;t!==null;){if(t.tag===3){jg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Br===null||!Br.has(r))){e=Oi(n,e),e=e1(t,e,1),t=zr(t,e,1),e=vt(),t!==null&&(Tl(t,1,e),At(t,e));break}}t=t.return}}function h_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=vt(),e.pingedLanes|=e.suspendedLanes&n,et===e&&(nt&n)===n&&(Qe===4||Qe===3&&(nt&130023424)===nt&&500>Be()-vp?Ns(e,0):bp|=n),At(e,t)}function v1(e,t){t===0&&(e.mode&1?(t=Zl,Zl<<=1,!(Zl&130023424)&&(Zl=4194304)):t=1);var n=vt();e=sr(e,t),e!==null&&(Tl(e,t,n),At(e,n))}function p_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),v1(e,n)}function m_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(F(314))}r!==null&&r.delete(t),v1(e,n)}var w1;w1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Tt.current)It=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return It=!1,n_(e,t,n);It=!!(e.flags&131072)}else It=!1,Pe&&t.flags&1048576&&_0(t,su,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ra(e,t),e=t.pendingProps;var s=Ai(t,ht.current);fi(t,n),s=hp(null,t,r,e,s,n);var i=pp();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Pt(r)?(i=!0,nu(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,ap(t),s.updater=Xu,t.stateNode=s,s._reactInternals=t,Sf(t,r,e,n),t=Nf(null,t,r,!0,i,n)):(t.tag=0,Pe&&i&&tp(t),xt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ra(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=x_(r),e=an(r,e),s){case 0:t=_f(null,t,r,e,n);break e;case 1:t=yg(null,t,r,e,n);break e;case 11:t=gg(null,t,r,e,n);break e;case 14:t=xg(null,t,r,an(r.type,e),n);break e}throw Error(F(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:an(r,s),_f(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:an(r,s),yg(e,t,r,s,n);case 3:e:{if(s1(t),e===null)throw Error(F(387));r=t.pendingProps,i=t.memoizedState,s=i.element,P0(e,t),lu(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Oi(Error(F(423)),t),t=bg(e,t,r,n,s);break e}else if(r!==s){s=Oi(Error(F(424)),t),t=bg(e,t,r,n,s);break e}else for($t=$r(t.stateNode.containerInfo.firstChild),zt=t,Pe=!0,dn=null,n=I0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ri(),r===s){t=ir(e,t,n);break e}xt(e,t,r,n)}t=t.child}return t;case 5:return A0(t),e===null&&vf(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,mf(r,s)?o=null:i!==null&&mf(r,i)&&(t.flags|=32),r1(e,t),xt(e,t,o,n),t.child;case 6:return e===null&&vf(t),null;case 13:return i1(e,t,n);case 4:return up(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Li(t,null,r,n):xt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:an(r,s),gg(e,t,r,s,n);case 7:return xt(e,t,t.pendingProps,n),t.child;case 8:return xt(e,t,t.pendingProps.children,n),t.child;case 12:return xt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,_e(iu,r._currentValue),r._currentValue=o,i!==null)if(xn(i.value,o)){if(i.children===s.children&&!Tt.current){t=ir(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=Jn(-1,n&-n),a.tag=2;var u=i.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}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),wf(i.return,n,t),l.lanes|=n;break}a=a.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(F(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),wf(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}xt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,fi(t,n),s=rn(s),r=r(s),t.flags|=1,xt(e,t,r,n),t.child;case 14:return r=t.type,s=an(r,t.pendingProps),s=an(r.type,s),xg(e,t,r,s,n);case 15:return t1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:an(r,s),Ra(e,t),t.tag=1,Pt(r)?(e=!0,nu(t)):e=!1,fi(t,n),J0(t,r,s),Sf(t,r,s,n),Nf(null,t,r,!0,e,n);case 19:return o1(e,t,n);case 22:return n1(e,t,n)}throw Error(F(156,t.tag))};function k1(e,t){return Kb(e,t)}function g_(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 en(e,t,n,r){return new g_(e,t,n,r)}function Cp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function x_(e){if(typeof e=="function")return Cp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Hh)return 11;if(e===Gh)return 14}return 2}function Hr(e,t){var n=e.alternate;return n===null?(n=en(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 Oa(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Cp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ys:return Es(n.children,s,i,t);case Uh:o=8,s|=8;break;case Wd:return e=en(12,n,t,s|2),e.elementType=Wd,e.lanes=i,e;case Vd:return e=en(13,n,t,s),e.elementType=Vd,e.lanes=i,e;case Qd:return e=en(19,n,t,s),e.elementType=Qd,e.lanes=i,e;case Ab:return Zu(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Tb:o=10;break e;case Pb:o=9;break e;case Hh:o=11;break e;case Gh:o=14;break e;case yr:o=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=en(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Es(e,t,n,r){return e=en(7,e,r,t),e.lanes=n,e}function Zu(e,t,n,r){return e=en(22,e,r,t),e.elementType=Ab,e.lanes=n,e.stateNode={isHidden:!1},e}function td(e,t,n){return e=en(6,e,null,t),e.lanes=n,e}function nd(e,t,n){return t=en(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function y_(e,t,n,r,s){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=s,this.mutableSourceEagerHydrationData=null}function _p(e,t,n,r,s,i,o,l,a){return e=new y_(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=en(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ap(i),e}function b_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function S1(e){if(!e)return Qr;e=e._reactInternals;e:{if(Ds(e)!==e||e.tag!==1)throw Error(F(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Pt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(F(171))}if(e.tag===1){var n=e.type;if(Pt(n))return S0(e,n,t)}return t}function C1(e,t,n,r,s,i,o,l,a){return e=_p(n,r,!0,e,s,i,o,l,a),e.context=S1(null),n=e.current,r=vt(),s=Ur(n),i=Jn(r,s),i.callback=t??null,zr(n,i,s),e.current.lanes=s,Tl(e,s,r),At(e,r),e}function ec(e,t,n,r){var s=t.current,i=vt(),o=Ur(s);return n=S1(n),t.context===null?t.context=n:t.pendingContext=n,t=Jn(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=zr(s,t,o),e!==null&&(pn(e,s,o,i),Ta(e,s,o)),o}function mu(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 Ig(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Np(e,t){Ig(e,t),(e=e.alternate)&&Ig(e,t)}function v_(){return null}var _1=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ep(e){this._internalRoot=e}tc.prototype.render=Ep.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));ec(e,t,null,null)};tc.prototype.unmount=Ep.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;As(function(){ec(null,e,null,null)}),t[rr]=null}};function tc(e){this._internalRoot=e}tc.prototype.unstable_scheduleHydration=function(e){if(e){var t=n0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wr.length&&t!==0&&t<wr[n].priority;n++);wr.splice(n,0,e),n===0&&s0(e)}};function jp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function nc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Tg(){}function w_(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=mu(o);i.call(u)}}var o=C1(t,r,e,0,null,!1,!1,"",Tg);return e._reactRootContainer=o,e[rr]=o.current,Xo(e.nodeType===8?e.parentNode:e),As(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var u=mu(a);l.call(u)}}var a=_p(e,0,!1,null,null,!1,!1,"",Tg);return e._reactRootContainer=a,e[rr]=a.current,Xo(e.nodeType===8?e.parentNode:e),As(function(){ec(t,a,n,r)}),a}function rc(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var l=s;s=function(){var a=mu(o);l.call(a)}}ec(t,o,e,s)}else o=w_(n,t,e,s,r);return mu(o)}e0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=vo(t.pendingLanes);n!==0&&(Vh(t,n|1),At(t,Be()),!(xe&6)&&(Di=Be()+500,Yr()))}break;case 13:As(function(){var r=sr(e,1);if(r!==null){var s=vt();pn(r,e,1,s)}}),Np(e,1)}};Qh=function(e){if(e.tag===13){var t=sr(e,134217728);if(t!==null){var n=vt();pn(t,e,134217728,n)}Np(e,134217728)}};t0=function(e){if(e.tag===13){var t=Ur(e),n=sr(e,t);if(n!==null){var r=vt();pn(n,e,t,r)}Np(e,t)}};n0=function(){return ve};r0=function(e,t){var n=ve;try{return ve=e,t()}finally{ve=n}};sf=function(e,t,n){switch(t){case"input":if(Yd(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 s=Vu(r);if(!s)throw Error(F(90));Lb(r),Yd(r,s)}}}break;case"textarea":Ob(e,n);break;case"select":t=n.value,t!=null&&ai(e,!!n.multiple,t,!1)}};Hb=wp;Gb=As;var k_={usingClientEntryPoint:!1,Events:[Al,ti,Vu,Bb,Ub,wp]},co={findFiberByHostInstance:us,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},S_={bundleType:co.bundleType,version:co.version,rendererPackageName:co.rendererPackageName,rendererConfig:co.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:lr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Vb(e),e===null?null:e.stateNode},findFiberByHostInstance:co.findFiberByHostInstance||v_,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 ca=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ca.isDisabled&&ca.supportsFiber)try{Hu=ca.inject(S_),In=ca}catch{}}Ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k_;Ht.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!jp(t))throw Error(F(200));return b_(e,t,null,n)};Ht.createRoot=function(e,t){if(!jp(e))throw Error(F(299));var n=!1,r="",s=_1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=_p(e,1,!1,null,null,n,!1,r,s),e[rr]=t.current,Xo(e.nodeType===8?e.parentNode:e),new Ep(t)};Ht.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(F(188)):(e=Object.keys(e).join(","),Error(F(268,e)));return e=Vb(t),e=e===null?null:e.stateNode,e};Ht.flushSync=function(e){return As(e)};Ht.hydrate=function(e,t,n){if(!nc(t))throw Error(F(200));return rc(null,e,t,!0,n)};Ht.hydrateRoot=function(e,t,n){if(!jp(e))throw Error(F(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=_1;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=C1(t,null,e,1,n??null,s,!1,i,o),e[rr]=t.current,Xo(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new tc(t)};Ht.render=function(e,t,n){if(!nc(t))throw Error(F(200));return rc(null,e,t,!1,n)};Ht.unmountComponentAtNode=function(e){if(!nc(e))throw Error(F(40));return e._reactRootContainer?(As(function(){rc(null,null,e,!1,function(){e._reactRootContainer=null,e[rr]=null})}),!0):!1};Ht.unstable_batchedUpdates=wp;Ht.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!nc(n))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return rc(e,t,n,!1,r)};Ht.version="18.3.1-next-f1338f8080-20240426";function N1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(N1)}catch(e){console.error(e)}}N1(),Nb.exports=Ht;var C_=Nb.exports,E1,Pg=C_;E1=Pg.createRoot,Pg.hydrateRoot;var Gi=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(){}},ms,Sr,yi,sb,__=(sb=class extends Gi{constructor(){super();V(this,ms);V(this,Sr);V(this,yi);B(this,yi,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Sr)||this.setEventListener(_(this,yi))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Sr))==null||t.call(this),B(this,Sr,void 0))}setEventListener(t){var n;B(this,yi,t),(n=_(this,Sr))==null||n.call(this),B(this,Sr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,ms)!==t&&(B(this,ms,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,ms)=="boolean"?_(this,ms):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ms=new WeakMap,Sr=new WeakMap,yi=new WeakMap,sb),Ip=new __,N_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Cr,Rh,ib,E_=(ib=class{constructor(){V(this,Cr,N_);V(this,Rh,!1)}setTimeoutProvider(e){B(this,Cr,e)}setTimeout(e,t){return _(this,Cr).setTimeout(e,t)}clearTimeout(e){_(this,Cr).clearTimeout(e)}setInterval(e,t){return _(this,Cr).setInterval(e,t)}clearInterval(e){_(this,Cr).clearInterval(e)}},Cr=new WeakMap,Rh=new WeakMap,ib),fs=new E_;function j_(e){setTimeout(e,0)}var I_=typeof window>"u"||"Deno"in globalThis;function yt(){}function T_(e,t){return typeof e=="function"?e(t):e}function Ff(e){return typeof e=="number"&&e>=0&&e!==1/0}function j1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Gr(e,t){return typeof e=="function"?e(t):e}function Ft(e,t){return typeof e=="function"?e(t):e}function Ag(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Tp(o,t.options))return!1}else if(!il(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||s&&s!==t.state.fetchStatus||i&&!i(t))}function Rg(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Rs(t.options.mutationKey)!==Rs(i))return!1}else if(!il(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Tp(e,t){return((t==null?void 0:t.queryKeyHashFn)||Rs)(e)}function Rs(e){return JSON.stringify(e,(t,n)=>$f(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function il(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>il(e[n],t[n])):!1}var P_=Object.prototype.hasOwnProperty;function I1(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Lg(e)&&Lg(t);if(!r&&!($f(e)&&$f(t)))return t;const i=(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<i:P_.call(e,d))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){a[d]=p;continue}const m=I1(h,p,n+1);a[d]=m,m===h&&u++}return i===l&&u===i?e:a}function gu(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 Lg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $f(e){if(!Mg(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Mg(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Mg(e){return Object.prototype.toString.call(e)==="[object Object]"}function A_(e){return new Promise(t=>{fs.setTimeout(t,e)})}function zf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?I1(e,t):t}function R_(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function L_(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Pp=Symbol();function T1(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Pp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ap(e,t){return typeof e=="function"?e(...t):!!e}function M_(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var ol=(()=>{let e=()=>I_;return{isServer(){return e()},setIsServer(t){e=t}}})();function Bf(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var O_=j_;function D_(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=O_;const i=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||o()}return a},batchCalls:l=>(...a)=>{i(()=>{l(...a)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Ve=D_(),bi,_r,vi,ob,F_=(ob=class extends Gi{constructor(){super();V(this,bi,!0);V(this,_r);V(this,vi);B(this,vi,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,_r)||this.setEventListener(_(this,vi))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,_r))==null||t.call(this),B(this,_r,void 0))}setEventListener(t){var n;B(this,vi,t),(n=_(this,_r))==null||n.call(this),B(this,_r,t(this.setOnline.bind(this)))}setOnline(t){_(this,bi)!==t&&(B(this,bi,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,bi)}},bi=new WeakMap,_r=new WeakMap,vi=new WeakMap,ob),xu=new F_;function $_(e){return Math.min(1e3*2**e,3e4)}function P1(e){return(e??"online")==="online"?xu.isOnline():!0}var Uf=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function A1(e){let t=!1,n=0,r;const s=Bf(),i=()=>s.status!=="pending",o=y=>{var v;if(!i()){const g=new Uf(y);h(g),(v=e.onCancel)==null||v.call(e,g)}},l=()=>{t=!0},a=()=>{t=!1},u=()=>Ip.isFocused()&&(e.networkMode==="always"||xu.isOnline())&&e.canRun(),f=()=>P1(e.networkMode)&&e.canRun(),d=y=>{i()||(r==null||r(),s.resolve(y))},h=y=>{i()||(r==null||r(),s.reject(y))},p=()=>new Promise(y=>{var v;r=g=>{(i()||u())&&y(g)},(v=e.onPause)==null||v.call(e)}).then(()=>{var y;r=void 0,i()||(y=e.onContinue)==null||y.call(e)}),m=()=>{if(i())return;let y;const v=n===0?e.initialPromise:void 0;try{y=v??e.fn()}catch(g){y=Promise.reject(g)}Promise.resolve(y).then(d).catch(g=>{var k;if(i())return;const x=e.retry??(ol.isServer()?0:3),b=e.retryDelay??$_,w=typeof b=="function"?b(n,g):b,N=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,g);if(t||!N){h(g);return}n++,(k=e.onFail)==null||k.call(e,n,g),A_(w).then(()=>u()?void 0:p()).then(()=>{t?h(g):m()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:l,continueRetry:a,canStart:f,start:()=>(f()?m():p().then(m),s)}}var gs,lb,R1=(lb=class{constructor(){V(this,gs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ff(this.gcTime)&&B(this,gs,fs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ol.isServer()?1/0:5*60*1e3))}clearGcTimeout(){_(this,gs)!==void 0&&(fs.clearTimeout(_(this,gs)),B(this,gs,void 0))}},gs=new WeakMap,lb);function z_(e){return{onFetch:(t,n)=>{var f,d,h,p,m;const r=t.options,s=(h=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((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 y=!1;const v=b=>{M_(b,()=>t.signal,()=>y=!0)},g=T1(t.options,t.fetchOptions),x=async(b,w,N)=>{if(y)return Promise.reject(t.signal.reason);if(w==null&&b.pages.length)return Promise.resolve(b);const I=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:w,direction:N?"backward":"forward",meta:t.options.meta};return v(M),M})(),T=await g(I),{maxPages:P}=t.options,E=N?L_:R_;return{pages:E(b.pages,T,P),pageParams:E(b.pageParams,w,P)}};if(s&&i.length){const b=s==="backward",w=b?B_:Og,N={pages:i,pageParams:o},k=w(r,N);l=await x(N,k,b)}else{const b=e??i.length;do{const w=a===0?o[0]??r.initialPageParam:Og(r,l);if(a>0&&w==null)break;l=await x(l,w),a++}while(a<b)}return l};t.options.persister?t.fetchFn=()=>{var y,v;return(v=(y=t.options).persister)==null?void 0:v.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Og(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 B_(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 wi,xs,ki,Vt,ys,Ye,Sl,bs,Dt,L1,$n,ab,U_=(ab=class extends R1{constructor(t){super();V(this,Dt);V(this,wi);V(this,xs);V(this,ki);V(this,Vt);V(this,ys);V(this,Ye);V(this,Sl);V(this,bs);B(this,bs,!1),B(this,Sl,t.defaultOptions),this.setOptions(t.options),this.observers=[],B(this,ys,t.client),B(this,Vt,_(this,ys).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,B(this,xs,Fg(this.options)),this.state=t.state??_(this,xs),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return _(this,wi)}get promise(){var t;return(t=_(this,Ye))==null?void 0:t.promise}setOptions(t){if(this.options={..._(this,Sl),...t},t!=null&&t._type&&B(this,wi,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Fg(this.options);n.data!==void 0&&(this.setState(Dg(n.data,n.dataUpdatedAt)),B(this,xs,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Vt).remove(this)}setData(t,n){const r=zf(this.state.data,t,this.options);return re(this,Dt,$n).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){re(this,Dt,$n).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=_(this,Ye))==null?void 0:r.promise;return(s=_(this,Ye))==null||s.cancel(t),n?n.then(yt).catch(yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return _(this,xs)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ft(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Pp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Gr(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:!j1(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,Ye))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,Ye))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Vt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,Ye)&&(_(this,bs)||re(this,Dt,L1).call(this)?_(this,Ye).cancel({revert:!0}):_(this,Ye).cancelRetry()),this.scheduleGc()),_(this,Vt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||re(this,Dt,$n).call(this,{type:"invalidate"})}async fetch(t,n){var u,f,d,h,p,m,y,v,g,x,b;if(this.state.fetchStatus!=="idle"&&((u=_(this,Ye))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,Ye))return _(this,Ye).continueRetry(),_(this,Ye).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(N=>N.options.queryFn);w&&this.setOptions(w.options)}const r=new AbortController,s=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(B(this,bs,!0),r.signal)})},i=()=>{const w=T1(this.options,n),k=(()=>{const I={client:_(this,ys),queryKey:this.queryKey,meta:this.meta};return s(I),I})();return B(this,bs,!1),this.options.persister?this.options.persister(w,k,this):w(k)},l=(()=>{const w={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,ys),state:this.state,fetchFn:i};return s(w),w})(),a=_(this,wi)==="infinite"?z_(this.options.pages):this.options.behavior;a==null||a.onFetch(l,this),B(this,ki,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&re(this,Dt,$n).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),B(this,Ye,A1({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:w=>{w instanceof Uf&&w.revert&&this.setState({..._(this,ki),fetchStatus:"idle"}),r.abort()},onFail:(w,N)=>{re(this,Dt,$n).call(this,{type:"failed",failureCount:w,error:N})},onPause:()=>{re(this,Dt,$n).call(this,{type:"pause"})},onContinue:()=>{re(this,Dt,$n).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const w=await _(this,Ye).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(p=(h=_(this,Vt).config).onSuccess)==null||p.call(h,w,this),(y=(m=_(this,Vt).config).onSettled)==null||y.call(m,w,this.state.error,this),w}catch(w){if(w instanceof Uf){if(w.silent)return _(this,Ye).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw re(this,Dt,$n).call(this,{type:"error",error:w}),(g=(v=_(this,Vt).config).onError)==null||g.call(v,w,this),(b=(x=_(this,Vt).config).onSettled)==null||b.call(x,this.state.data,w,this),w}finally{this.scheduleGc()}}},wi=new WeakMap,xs=new WeakMap,ki=new WeakMap,Vt=new WeakMap,ys=new WeakMap,Ye=new WeakMap,Sl=new WeakMap,bs=new WeakMap,Dt=new WeakSet,L1=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},$n=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,...M1(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...Dg(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return B(this,ki,t.manual?s:void 0),s;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ve.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,Vt).notify({query:this,type:"updated",action:t})})},ab);function M1(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:P1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Dg(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Fg(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 Nt,pe,Cl,mt,vs,Si,Un,Nr,_l,Ci,_i,ws,ks,Er,Ni,be,ko,Hf,Gf,qf,Wf,Vf,Qf,Kf,O1,ub,H_=(ub=class extends Gi{constructor(t,n){super();V(this,be);V(this,Nt);V(this,pe);V(this,Cl);V(this,mt);V(this,vs);V(this,Si);V(this,Un);V(this,Nr);V(this,_l);V(this,Ci);V(this,_i);V(this,ws);V(this,ks);V(this,Er);V(this,Ni,new Set);this.options=n,B(this,Nt,t),B(this,Nr,null),B(this,Un,Bf()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,pe).addObserver(this),$g(_(this,pe),this.options)?re(this,be,ko).call(this):this.updateResult(),re(this,be,Wf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xf(_(this,pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xf(_(this,pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,re(this,be,Vf).call(this),re(this,be,Qf).call(this),_(this,pe).removeObserver(this)}setOptions(t){const n=this.options,r=_(this,pe);if(this.options=_(this,Nt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ft(this.options.enabled,_(this,pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");re(this,be,Kf).call(this),_(this,pe).setOptions(this.options),n._defaulted&&!gu(this.options,n)&&_(this,Nt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,pe),observer:this});const s=this.hasListeners();s&&zg(_(this,pe),r,this.options,n)&&re(this,be,ko).call(this),this.updateResult(),s&&(_(this,pe)!==r||Ft(this.options.enabled,_(this,pe))!==Ft(n.enabled,_(this,pe))||Gr(this.options.staleTime,_(this,pe))!==Gr(n.staleTime,_(this,pe)))&&re(this,be,Hf).call(this);const i=re(this,be,Gf).call(this);s&&(_(this,pe)!==r||Ft(this.options.enabled,_(this,pe))!==Ft(n.enabled,_(this,pe))||i!==_(this,Er))&&re(this,be,qf).call(this,i)}getOptimisticResult(t){const n=_(this,Nt).getQueryCache().build(_(this,Nt),t),r=this.createResult(n,t);return q_(this,r)&&(B(this,mt,r),B(this,Si,this.options),B(this,vs,_(this,pe).state)),r}getCurrentResult(){return _(this,mt)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&_(this,Un).status==="pending"&&_(this,Un).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){_(this,Ni).add(t)}getCurrentQuery(){return _(this,pe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,Nt).defaultQueryOptions(t),r=_(this,Nt).getQueryCache().build(_(this,Nt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return re(this,be,ko).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,mt)))}createResult(t,n){var P;const r=_(this,pe),s=this.options,i=_(this,mt),o=_(this,vs),l=_(this,Si),u=t!==r?t.state:_(this,Cl),{state:f}=t;let d={...f},h=!1,p;if(n._optimisticResults){const E=this.hasListeners(),M=!E&&$g(t,n),R=E&&zg(t,r,n,s);(M||R)&&(d={...d,...M1(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:y,status:v}=d;p=d.data;let g=!1;if(n.placeholderData!==void 0&&p===void 0&&v==="pending"){let E;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(E=i.data,g=!0):E=typeof n.placeholderData=="function"?n.placeholderData((P=_(this,_i))==null?void 0:P.state.data,_(this,_i)):n.placeholderData,E!==void 0&&(v="success",p=zf(i==null?void 0:i.data,E,n),h=!0)}if(n.select&&p!==void 0&&!g)if(i&&p===(o==null?void 0:o.data)&&n.select===_(this,_l))p=_(this,Ci);else try{B(this,_l,n.select),p=n.select(p),p=zf(i==null?void 0:i.data,p,n),B(this,Ci,p),B(this,Nr,null)}catch(E){B(this,Nr,E)}_(this,Nr)&&(m=_(this,Nr),p=_(this,Ci),y=Date.now(),v="error");const x=d.fetchStatus==="fetching",b=v==="pending",w=v==="error",N=b&&x,k=p!==void 0,T={status:v,fetchStatus:d.fetchStatus,isPending:b,isSuccess:v==="success",isError:w,isInitialLoading:N,isLoading:N,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!b,isLoadingError:w&&!k,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:w&&k,isStale:Rp(t,n),refetch:this.refetch,promise:_(this,Un),isEnabled:Ft(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=T.data!==void 0,M=T.status==="error"&&!E,R=G=>{M?G.reject(T.error):E&&G.resolve(T.data)},Q=()=>{const G=B(this,Un,T.promise=Bf());R(G)},q=_(this,Un);switch(q.status){case"pending":t.queryHash===r.queryHash&&R(q);break;case"fulfilled":(M||T.data!==q.value)&&Q();break;case"rejected":(!M||T.error!==q.reason)&&Q();break}}return T}updateResult(){const t=_(this,mt),n=this.createResult(_(this,pe),this.options);if(B(this,vs,_(this,pe).state),B(this,Si,this.options),_(this,vs).data!==void 0&&B(this,_i,_(this,pe)),gu(n,t))return;B(this,mt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!_(this,Ni).size)return!0;const o=new Set(i??_(this,Ni));return this.options.throwOnError&&o.add("error"),Object.keys(_(this,mt)).some(l=>{const a=l;return _(this,mt)[a]!==t[a]&&o.has(a)})};re(this,be,O1).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&re(this,be,Wf).call(this)}},Nt=new WeakMap,pe=new WeakMap,Cl=new WeakMap,mt=new WeakMap,vs=new WeakMap,Si=new WeakMap,Un=new WeakMap,Nr=new WeakMap,_l=new WeakMap,Ci=new WeakMap,_i=new WeakMap,ws=new WeakMap,ks=new WeakMap,Er=new WeakMap,Ni=new WeakMap,be=new WeakSet,ko=function(t){re(this,be,Kf).call(this);let n=_(this,pe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(yt)),n},Hf=function(){re(this,be,Vf).call(this);const t=Gr(this.options.staleTime,_(this,pe));if(ol.isServer()||_(this,mt).isStale||!Ff(t))return;const r=j1(_(this,mt).dataUpdatedAt,t)+1;B(this,ws,fs.setTimeout(()=>{_(this,mt).isStale||this.updateResult()},r))},Gf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,pe)):this.options.refetchInterval)??!1},qf=function(t){re(this,be,Qf).call(this),B(this,Er,t),!(ol.isServer()||Ft(this.options.enabled,_(this,pe))===!1||!Ff(_(this,Er))||_(this,Er)===0)&&B(this,ks,fs.setInterval(()=>{(this.options.refetchIntervalInBackground||Ip.isFocused())&&re(this,be,ko).call(this)},_(this,Er)))},Wf=function(){re(this,be,Hf).call(this),re(this,be,qf).call(this,re(this,be,Gf).call(this))},Vf=function(){_(this,ws)!==void 0&&(fs.clearTimeout(_(this,ws)),B(this,ws,void 0))},Qf=function(){_(this,ks)!==void 0&&(fs.clearInterval(_(this,ks)),B(this,ks,void 0))},Kf=function(){const t=_(this,Nt).getQueryCache().build(_(this,Nt),this.options);if(t===_(this,pe))return;const n=_(this,pe);B(this,pe,t),B(this,Cl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},O1=function(t){Ve.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,mt))}),_(this,Nt).getQueryCache().notify({query:_(this,pe),type:"observerResultsUpdated"})})},ub);function G_(e,t){return Ft(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ft(t.retryOnMount,e)===!1)}function $g(e,t){return G_(e,t)||e.state.data!==void 0&&Xf(e,t,t.refetchOnMount)}function Xf(e,t,n){if(Ft(t.enabled,e)!==!1&&Gr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Rp(e,t)}return!1}function zg(e,t,n,r){return(e!==t||Ft(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Rp(e,n)}function Rp(e,t){return Ft(t.enabled,e)!==!1&&e.isStaleByTime(Gr(t.staleTime,e))}function q_(e,t){return!gu(e.getCurrentResult(),t)}var Nl,Cn,at,Ss,_n,mr,cb,W_=(cb=class extends R1{constructor(t){super();V(this,_n);V(this,Nl);V(this,Cn);V(this,at);V(this,Ss);B(this,Nl,t.client),this.mutationId=t.mutationId,B(this,at,t.mutationCache),B(this,Cn,[]),this.state=t.state||D1(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,Cn).includes(t)||(_(this,Cn).push(t),this.clearGcTimeout(),_(this,at).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){B(this,Cn,_(this,Cn).filter(n=>n!==t)),this.scheduleGc(),_(this,at).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,Cn).length||(this.state.status==="pending"?this.scheduleGc():_(this,at).remove(this))}continue(){var t;return((t=_(this,Ss))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,a,u,f,d,h,p,m,y,v,g,x,b,w,N,k,I;const n=()=>{re(this,_n,mr).call(this,{type:"continue"})},r={client:_(this,Nl),meta:this.options.meta,mutationKey:this.options.mutationKey};B(this,Ss,A1({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(T,P)=>{re(this,_n,mr).call(this,{type:"failed",failureCount:T,error:P})},onPause:()=>{re(this,_n,mr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,at).canRun(this)}));const s=this.state.status==="pending",i=!_(this,Ss).canStart();try{if(s)n();else{re(this,_n,mr).call(this,{type:"pending",variables:t,isPaused:i}),_(this,at).config.onMutate&&await _(this,at).config.onMutate(t,this,r);const P=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));P!==this.state.context&&re(this,_n,mr).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const T=await _(this,Ss).start();return await((u=(a=_(this,at).config).onSuccess)==null?void 0:u.call(a,T,t,this.state.context,this,r)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,T,t,this.state.context,r)),await((p=(h=_(this,at).config).onSettled)==null?void 0:p.call(h,T,null,this.state.variables,this.state.context,this,r)),await((y=(m=this.options).onSettled)==null?void 0:y.call(m,T,null,t,this.state.context,r)),re(this,_n,mr).call(this,{type:"success",data:T}),T}catch(T){try{await((g=(v=_(this,at).config).onError)==null?void 0:g.call(v,T,t,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((b=(x=this.options).onError)==null?void 0:b.call(x,T,t,this.state.context,r))}catch(P){Promise.reject(P)}try{await((N=(w=_(this,at).config).onSettled)==null?void 0:N.call(w,void 0,T,this.state.variables,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((I=(k=this.options).onSettled)==null?void 0:I.call(k,void 0,T,t,this.state.context,r))}catch(P){Promise.reject(P)}throw re(this,_n,mr).call(this,{type:"error",error:T}),T}finally{_(this,at).runNext(this)}}},Nl=new WeakMap,Cn=new WeakMap,at=new WeakMap,Ss=new WeakMap,_n=new WeakSet,mr=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),Ve.batch(()=>{_(this,Cn).forEach(r=>{r.onMutationUpdate(t)}),_(this,at).notify({mutation:this,type:"updated",action:t})})},cb);function D1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Hn,un,El,db,V_=(db=class extends Gi{constructor(t={}){super();V(this,Hn);V(this,un);V(this,El);this.config=t,B(this,Hn,new Set),B(this,un,new Map),B(this,El,0)}build(t,n,r){const s=new W_({client:t,mutationCache:this,mutationId:++Wl(this,El)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){_(this,Hn).add(t);const n=da(t);if(typeof n=="string"){const r=_(this,un).get(n);r?r.push(t):_(this,un).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,Hn).delete(t)){const n=da(t);if(typeof n=="string"){const r=_(this,un).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&_(this,un).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=da(t);if(typeof n=="string"){const r=_(this,un).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=da(t);if(typeof n=="string"){const s=(r=_(this,un).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ve.batch(()=>{_(this,Hn).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,Hn).clear(),_(this,un).clear()})}getAll(){return Array.from(_(this,Hn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Rg(n,r))}findAll(t={}){return this.getAll().filter(n=>Rg(t,n))}notify(t){Ve.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ve.batch(()=>Promise.all(t.map(n=>n.continue().catch(yt))))}},Hn=new WeakMap,un=new WeakMap,El=new WeakMap,db);function da(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Gn,jr,Et,qn,tr,Da,Yf,fb,Q_=(fb=class extends Gi{constructor(n,r){super();V(this,tr);V(this,Gn);V(this,jr);V(this,Et);V(this,qn);B(this,Gn,n),this.setOptions(r),this.bindMethods(),re(this,tr,Da).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=_(this,Gn).defaultMutationOptions(n),gu(this.options,r)||_(this,Gn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Et),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Rs(r.mutationKey)!==Rs(this.options.mutationKey)?this.reset():((s=_(this,Et))==null?void 0:s.state.status)==="pending"&&_(this,Et).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=_(this,Et))==null||n.removeObserver(this)}onMutationUpdate(n){re(this,tr,Da).call(this),re(this,tr,Yf).call(this,n)}getCurrentResult(){return _(this,jr)}reset(){var n;(n=_(this,Et))==null||n.removeObserver(this),B(this,Et,void 0),re(this,tr,Da).call(this),re(this,tr,Yf).call(this)}mutate(n,r){var s;return B(this,qn,r),(s=_(this,Et))==null||s.removeObserver(this),B(this,Et,_(this,Gn).getMutationCache().build(_(this,Gn),this.options)),_(this,Et).addObserver(this),_(this,Et).execute(n)}},Gn=new WeakMap,jr=new WeakMap,Et=new WeakMap,qn=new WeakMap,tr=new WeakSet,Da=function(){var r;const n=((r=_(this,Et))==null?void 0:r.state)??D1();B(this,jr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Yf=function(n){Ve.batch(()=>{var r,s,i,o,l,a,u,f;if(_(this,qn)&&this.hasListeners()){const d=_(this,jr).variables,h=_(this,jr).context,p={client:_(this,Gn),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=_(this,qn)).onSuccess)==null||s.call(r,n.data,d,h,p)}catch(m){Promise.reject(m)}try{(o=(i=_(this,qn)).onSettled)==null||o.call(i,n.data,null,d,h,p)}catch(m){Promise.reject(m)}}else if((n==null?void 0:n.type)==="error"){try{(a=(l=_(this,qn)).onError)==null||a.call(l,n.error,d,h,p)}catch(m){Promise.reject(m)}try{(f=(u=_(this,qn)).onSettled)==null||f.call(u,void 0,n.error,d,h,p)}catch(m){Promise.reject(m)}}}this.listeners.forEach(d=>{d(_(this,jr))})})},fb),Nn,hb,K_=(hb=class extends Gi{constructor(t={}){super();V(this,Nn);this.config=t,B(this,Nn,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??Tp(s,n);let o=this.get(i);return o||(o=new U_({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){_(this,Nn).has(t.queryHash)||(_(this,Nn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,Nn).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,Nn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ve.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,Nn).get(t)}getAll(){return[..._(this,Nn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ag(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ag(t,r)):n}notify(t){Ve.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ve.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ve.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Nn=new WeakMap,hb),De,Ir,Tr,Ei,ji,Pr,Ii,Ti,pb,X_=(pb=class{constructor(e={}){V(this,De);V(this,Ir);V(this,Tr);V(this,Ei);V(this,ji);V(this,Pr);V(this,Ii);V(this,Ti);B(this,De,e.queryCache||new K_),B(this,Ir,e.mutationCache||new V_),B(this,Tr,e.defaultOptions||{}),B(this,Ei,new Map),B(this,ji,new Map),B(this,Pr,0)}mount(){Wl(this,Pr)._++,_(this,Pr)===1&&(B(this,Ii,Ip.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,De).onFocus())})),B(this,Ti,xu.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,De).onOnline())})))}unmount(){var e,t;Wl(this,Pr)._--,_(this,Pr)===0&&((e=_(this,Ii))==null||e.call(this),B(this,Ii,void 0),(t=_(this,Ti))==null||t.call(this),B(this,Ti,void 0))}isFetching(e){return _(this,De).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,Ir).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,De).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=_(this,De).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Gr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return _(this,De).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=_(this,De).get(r.queryHash),i=s==null?void 0:s.state.data,o=T_(t,i);if(o!==void 0)return _(this,De).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Ve.batch(()=>_(this,De).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,De).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,De);Ve.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,De);return Ve.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ve.batch(()=>_(this,De).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(yt).catch(yt)}invalidateQueries(e,t={}){return Ve.batch(()=>(_(this,De).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=Ve.batch(()=>_(this,De).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(yt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(yt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,De).build(this,t);return n.isStaleByTime(Gr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(yt).catch(yt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(yt).catch(yt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return xu.isOnline()?_(this,Ir).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,De)}getMutationCache(){return _(this,Ir)}getDefaultOptions(){return _(this,Tr)}setDefaultOptions(e){B(this,Tr,e)}setQueryDefaults(e,t){_(this,Ei).set(Rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Ei).values()],n={};return t.forEach(r=>{il(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){_(this,ji).set(Rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,ji).values()],n={};return t.forEach(r=>{il(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Tr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Tp(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===Pp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Tr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,De).clear(),_(this,Ir).clear()}},De=new WeakMap,Ir=new WeakMap,Tr=new WeakMap,Ei=new WeakMap,ji=new WeakMap,Pr=new WeakMap,Ii=new WeakMap,Ti=new WeakMap,pb),F1=S.createContext(void 0),Ne=e=>{const t=S.useContext(F1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Y_=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(F1.Provider,{value:e,children:t})),$1=S.createContext(!1),J_=()=>S.useContext($1);$1.Provider;function Z_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var eN=S.createContext(Z_()),tN=()=>S.useContext(eN),nN=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Ap(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},rN=e=>{S.useEffect(()=>{e.clearReset()},[e])},sN=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Ap(n,[e.error,r])),iN=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},oN=(e,t)=>e.isLoading&&e.isFetching&&!t,lN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Bg=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function aN(e,t,n){var h,p,m,y;const r=J_(),s=tN(),i=Ne(),o=i.defaultQueryOptions(e);(p=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||p.call(h,o);const l=i.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",iN(o),nN(o,s,l),rN(s);const a=!i.getQueryCache().get(o.queryHash),[u]=S.useState(()=>new t(i,o)),f=u.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(v=>{const g=d?u.subscribe(Ve.batchCalls(v)):yt;return u.updateResult(),g},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),S.useEffect(()=>{u.setOptions(o)},[o,u]),lN(o,f))throw Bg(o,u,s);if(sN({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;if((y=(m=i.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||y.call(m,o,f),o.experimental_prefetchInRender&&!ol.isServer()&&oN(f,r)){const v=a?Bg(o,u,s):l==null?void 0:l.promise;v==null||v.catch(yt).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?f:u.trackResult(f)}function Pn(e,t){return aN(e,H_)}function $e(e,t){const n=Ne(),[r]=S.useState(()=>new Q_(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);const s=S.useSyncExternalStore(S.useCallback(o=>r.subscribe(Ve.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=S.useCallback((o,l)=>{r.mutate(o,l).catch(yt)},[r]);if(s.error&&Ap(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}class uN{constructor(){A(this,"ws");A(this,"listeners",new Set);A(this,"reconnectListeners",new Set);A(this,"reconnectAttempt",0);A(this,"shouldRun",!1);A(this,"url");A(this,"outbox",[]);A(this,"lastSubscribe");A(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 s of this.listeners)s(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 Te=new uN,cN=3e4;async function ge(e,t){const{timeout:n,...r}=t??{},s=r.signal??AbortSignal.timeout(n??cN);return dN(e,r,s)}async function dN(e,t,n){const r=await fetch(e,{...t,signal:n,headers:{"Content-Type":"application/json",...t.headers??{}}});if(!r.ok){const s=await r.text().catch(()=>"");throw new Error(fN(s)??`${r.status} ${r.statusText}${s?`: ${s}`:""}`)}return await r.json()}function fN(e){if(e)try{const t=JSON.parse(e);if(t&&typeof t.error=="string"&&t.error.length>0)return t.error}catch{}}const Ll=e=>["config",e],hN=(e,t)=>["config",e,t??"__none__"];function z1(e,t){return Pn({queryKey:hN(e,t),queryFn:()=>{if(!e)throw new Error("workspaceId required");return ge(`/api/workspaces/${encodeURIComponent(e)}/config`)},enabled:!!e})}function B1(e){const t=Ne();return $e({mutationFn:n=>ge(`/api/workspaces/${encodeURIComponent(e)}/config/model`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Ll(e)})})}function U1(e){const t=Ne();return $e({mutationFn:n=>ge(`/api/workspaces/${encodeURIComponent(e)}/config/thinking-level`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Ll(e)})})}function pN(e){const t=Ne();return $e({mutationFn:n=>ge(`/api/workspaces/${encodeURIComponent(e)}/config/tools`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Ll(e)})})}function mN(e,t){const n=Ne();return $e({mutationFn:r=>{const s=`/api/workspaces/${encodeURIComponent(e)}/config/session-name`,i=t?`${s}?sessionPath=${encodeURIComponent(t)}`:s;return ge(i,{method:"PUT",body:JSON.stringify(r)})},onSuccess:()=>{n.invalidateQueries({queryKey:Ll(e)}),n.invalidateQueries({queryKey:["workspace-sessions",e]})}})}function gN(){const e=Ne();S.useEffect(()=>Te.on(n=>{n.type==="event"&&(n.payload.kind!=="session_info_changed"&&n.payload.kind!=="thinking_level_changed"||e.invalidateQueries({queryKey:Ll(n.workspaceId)}))}),[e])}function H1(e){const t=Ne(),{queryKey:n,messageTypes:r,eventKinds:s}=e,i=S.useRef(n);i.current=n,S.useEffect(()=>{const o=r?new Set(r):void 0,l=s?new Set(s):void 0;return Te.on(u=>{if(o&&u.type!=="event"&&o.has(u.type)){const f=u.workspaceId;f&&t.invalidateQueries({queryKey:i.current(f)});return}l&&u.type==="event"&&l.has(u.payload.kind)&&t.invalidateQueries({queryKey:i.current(u.workspaceId)})})},[t,r,s])}function Lp(e){return["workspace-sessions",e]}function G1(e){return{queryKey:Lp(e),queryFn:()=>ge(`/api/workspaces/${encodeURIComponent(e)}/sessions`).then(t=>t.sessions),staleTime:3e4}}function xN(e){return Pn({...G1(e??""),enabled:!!e})}function yN(e){const t=Ne();return $e({mutationFn:n=>{if(!e)throw new Error("workspaceId required");const r=`?path=${encodeURIComponent(n)}`;return ge(`/api/workspaces/${encodeURIComponent(e)}/sessions${r}`,{method:"DELETE"})},onSuccess:()=>t.invalidateQueries({queryKey:Lp(e)})})}function bN(e,t){return $e({mutationFn:async()=>{const n=`/api/workspaces/${encodeURIComponent(e)}/export`,r=t?`${n}?sessionPath=${encodeURIComponent(t)}`:n,s=await ge(r),i=new Blob([s.html],{type:"text/html"}),o=URL.createObjectURL(i),l=document.createElement("a");l.href=o,l.download=s.filename,l.click(),URL.revokeObjectURL(o)}})}const vN=["subscribed"],wN=["agent_start","agent_end","compaction_end","session_info_changed"];function kN(){H1({queryKey:e=>Lp(e),messageTypes:vN,eventKinds:wN})}function q1(e){return["session-tree",e]}function SN(e,t){return Pn({queryKey:q1(e),enabled:!!e&&t,staleTime:2e3,queryFn:()=>{if(!e)throw new Error("workspaceId required");return ge(`/api/workspaces/${encodeURIComponent(e)}/tree`)}})}const CN=["subscribed","navigate_tree_result"],_N=["agent_end","compaction_end"];function NN(){H1({queryKey:e=>q1(e),messageTypes:CN,eventKinds:_N})}const ar=e=>["resources",e],sc=e=>["resources",e,"skill-body"],ic=e=>["resources",e,"prompt-body"];function yn(e,t=""){return`/api/workspaces/${encodeURIComponent(e)}/resources${t}`}function Mp(e){return Pn({queryKey:ar(e),queryFn:()=>{if(!e)throw new Error("workspaceId required");return ge(yn(e))},enabled:!!e})}function W1(e){const t=Ne();return $e({mutationFn:()=>ge(yn(e,"/reload"),{method:"POST"}),onSuccess:n=>{t.setQueryData(ar(e),n),t.invalidateQueries({queryKey:sc(e)}),t.invalidateQueries({queryKey:ic(e)})}})}function EN(e){const t=Ne();return $e({mutationFn:n=>ge(yn(e,"/builtin-extensions"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(ar(e),n)})}function jN(e,t){return Pn({queryKey:[...sc(e),t],queryFn:()=>{if(!t)throw new Error("filePath required");return ge(`${yn(e,"/skill")}?path=${encodeURIComponent(t)}`)},enabled:!!t,refetchOnWindowFocus:!1,staleTime:1/0})}function IN(e){const t=Ne();return $e({mutationFn:n=>ge(yn(e,"/skills"),{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(ar(e),n)})}function TN(e){const t=Ne();return $e({mutationFn:n=>ge(yn(e,"/skills"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>{t.setQueryData(ar(e),n),t.invalidateQueries({queryKey:sc(e)})}})}function PN(e){const t=Ne();return $e({mutationFn:({filePath:n})=>ge(`${yn(e,"/skills")}?path=${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:n=>{t.setQueryData(ar(e),n),t.invalidateQueries({queryKey:sc(e)})}})}function AN(e,t){return Pn({queryKey:[...ic(e),t],queryFn:()=>{if(!t)throw new Error("filePath required");return ge(`${yn(e,"/prompt")}?path=${encodeURIComponent(t)}`)},enabled:!!t,refetchOnWindowFocus:!1,staleTime:1/0})}function RN(e){const t=Ne();return $e({mutationFn:n=>ge(yn(e,"/prompts"),{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(ar(e),n)})}function LN(e){const t=Ne();return $e({mutationFn:n=>ge(yn(e,"/prompts"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>{t.setQueryData(ar(e),n),t.invalidateQueries({queryKey:ic(e)})}})}function MN(e){const t=Ne();return $e({mutationFn:({filePath:n})=>ge(`${yn(e,"/prompts")}?path=${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:n=>{t.setQueryData(ar(e),n),t.invalidateQueries({queryKey:ic(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 ON=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),V1=(...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 DN={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 FN=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...l},a)=>S.createElement("svg",{ref:a,...DN,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:V1("lucide",s),...l},[...o.map(([u,f])=>S.createElement(u,f)),...Array.isArray(i)?i:[i]]));/**
|
|
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 oe=(e,t)=>{const n=S.forwardRef(({className:r,...s},i)=>S.createElement(FN,{ref:i,iconNode:t,className:V1(`lucide-${ON(e)}`,r),...s}));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 $N=oe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
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 Jf=oe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
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 zN=oe("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
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 ll=oe("Blocks",[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]]);/**
|
|
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 qi=oe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 Jr=oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 Q1=oe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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 Wi=oe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 BN=oe("ChevronsDown",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]);/**
|
|
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 UN=oe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 HN=oe("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
|
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 K1=oe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
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 X1=oe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
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 Op=oe("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"}]]);/**
|
|
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 GN=oe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
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 qN=oe("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
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 Y1=oe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
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 WN=oe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
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 VN=oe("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"}]]);/**
|
|
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 Dp=oe("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"}]]);/**
|
|
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 Fp=oe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
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 Ug=oe("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"}]]);/**
|
|
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 QN=oe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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 wt=oe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 KN=oe("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
|
|
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 XN=oe("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"}]]);/**
|
|
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 YN=oe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 JN=oe("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
|
|
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 yu=oe("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"}]]);/**
|
|
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 oc=oe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
212
|
+
* @license lucide-react v0.468.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const J1=oe("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"}]]);/**
|
|
217
|
+
* @license lucide-react v0.468.0 - ISC
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the ISC license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const ZN=oe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
222
|
+
* @license lucide-react v0.468.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const eE=oe("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"}]]);/**
|
|
227
|
+
* @license lucide-react v0.468.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const Hg=oe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
232
|
+
* @license lucide-react v0.468.0 - ISC
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the ISC license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const tE=oe("Shrink",[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]]);/**
|
|
237
|
+
* @license lucide-react v0.468.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const nE=oe("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"}]]);/**
|
|
242
|
+
* @license lucide-react v0.468.0 - ISC
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the ISC license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const rE=oe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
247
|
+
* @license lucide-react v0.468.0 - ISC
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the ISC license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const sE=oe("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"}]]);/**
|
|
252
|
+
* @license lucide-react v0.468.0 - ISC
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the ISC license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const al=oe("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"}]]);/**
|
|
257
|
+
* @license lucide-react v0.468.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const Zf=oe("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"}]]);/**
|
|
262
|
+
* @license lucide-react v0.468.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const iE=oe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
267
|
+
* @license lucide-react v0.468.0 - ISC
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the ISC license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const Zr=oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Z1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Z1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function oE(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Z1(e))&&(r&&(r+=" "),r+=t);return r}const $p="-",lE=e=>{const t=uE(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split($p);return l[0]===""&&l.length!==1&&l.shift(),ev(l,t)||aE(o)},getConflictingClassGroupIds:(o,l)=>{const a=n[o]||[];return l&&r[o]?[...a,...r[o]]:a}}},ev=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?ev(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join($p);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Gg=/^\[(.+)\]$/,aE=e=>{if(Gg.test(e)){const t=Gg.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},uE=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return dE(Object.entries(e.classGroups),n).forEach(([i,o])=>{eh(o,r,i,t)}),r},eh=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:qg(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(cE(s)){eh(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{eh(o,qg(t,i),n,r)})})},qg=(e,t)=>{let n=e;return t.split($p).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},cE=e=>e.isThemeGetter,dE=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,s]}):e,fE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},tv="!",hE=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=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===s&&(r||l.slice(v,v+i)===t)){a.push(l.slice(f,v)),f=v+i;continue}if(g==="/"){d=v;continue}}g==="["?u++:g==="]"&&u--}const h=a.length===0?l:l.substring(f),p=h.startsWith(tv),m=p?h.substring(1):h,y=d&&d>f?d-f:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}};return n?l=>n({className:l,parseClassName:o}):o},pE=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},mE=e=>({cache:fE(e.cacheSize),parseClassName:hE(e),...lE(e)}),gE=/\s+/,xE=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(gE);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,y=r(m?h.substring(0,p):h);if(!y){if(!m){l=u+(l.length>0?" "+l:l);continue}if(y=r(h),!y){l=u+(l.length>0?" "+l:l);continue}m=!1}const v=pE(f).join(":"),g=d?v+tv:v,x=g+y;if(i.includes(x))continue;i.push(x);const b=s(y,m);for(let w=0;w<b.length;++w){const N=b[w];i.push(g+N)}l=u+(l.length>0?" "+l:l)}return l};function yE(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=nv(t))&&(r&&(r+=" "),r+=n);return r}const nv=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=nv(e[r]))&&(n&&(n+=" "),n+=t);return n};function bE(e,...t){let n,r,s,i=o;function o(a){const u=t.reduce((f,d)=>d(f),e());return n=mE(u),r=n.cache.get,s=n.cache.set,i=l,l(a)}function l(a){const u=r(a);if(u)return u;const f=xE(a,n);return s(a,f),f}return function(){return i(yE.apply(null,arguments))}}const Ee=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},rv=/^\[(?:([a-z-]+):)?(.+)\]$/i,vE=/^\d+\/\d+$/,wE=new Set(["px","full","screen"]),kE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,SE=/\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$/,CE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_E=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,NE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,On=e=>pi(e)||wE.has(e)||vE.test(e),fr=e=>Vi(e,"length",LE),pi=e=>!!e&&!Number.isNaN(Number(e)),rd=e=>Vi(e,"number",pi),fo=e=>!!e&&Number.isInteger(Number(e)),EE=e=>e.endsWith("%")&&pi(e.slice(0,-1)),le=e=>rv.test(e),hr=e=>kE.test(e),jE=new Set(["length","size","percentage"]),IE=e=>Vi(e,jE,sv),TE=e=>Vi(e,"position",sv),PE=new Set(["image","url"]),AE=e=>Vi(e,PE,OE),RE=e=>Vi(e,"",ME),ho=()=>!0,Vi=(e,t,n)=>{const r=rv.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},LE=e=>SE.test(e)&&!CE.test(e),sv=()=>!1,ME=e=>_E.test(e),OE=e=>NE.test(e),DE=()=>{const e=Ee("colors"),t=Ee("spacing"),n=Ee("blur"),r=Ee("brightness"),s=Ee("borderColor"),i=Ee("borderRadius"),o=Ee("borderSpacing"),l=Ee("borderWidth"),a=Ee("contrast"),u=Ee("grayscale"),f=Ee("hueRotate"),d=Ee("invert"),h=Ee("gap"),p=Ee("gradientColorStops"),m=Ee("gradientColorStopPositions"),y=Ee("inset"),v=Ee("margin"),g=Ee("opacity"),x=Ee("padding"),b=Ee("saturate"),w=Ee("scale"),N=Ee("sepia"),k=Ee("skew"),I=Ee("space"),T=Ee("translate"),P=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",le,t],R=()=>[le,t],Q=()=>["",On,fr],q=()=>["auto",pi,le],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",le],C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[pi,le];return{cacheSize:500,separator:":",theme:{colors:[ho],spacing:[On,fr],blur:["none","",hr,le],brightness:X(),borderColor:[e],borderRadius:["none","","full",hr,le],borderSpacing:R(),borderWidth:Q(),contrast:X(),grayscale:H(),hueRotate:X(),invert:H(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[EE,fr],inset:M(),margin:M(),opacity:X(),padding:R(),saturate:X(),scale:X(),sepia:H(),skew:X(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[hr]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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(),le]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fo,le]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",fo,le]}],"grid-cols":[{"grid-cols":[ho]}],"col-start-end":[{col:["auto",{span:["full",fo,le]},le]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[ho]}],"row-start-end":[{row:["auto",{span:[fo,le]},le]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[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":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,t]}],"min-w":[{"min-w":[le,t,"min","max","fit"]}],"max-w":[{"max-w":[le,t,"none","full","min","max","fit","prose",{screen:[hr]},hr]}],h:[{h:[le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",hr,fr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",rd]}],"font-family":[{font:[ho]}],"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",le]}],"line-clamp":[{"line-clamp":["none",pi,rd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",On,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"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:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",On,fr]}],"underline-offset":[{"underline-offset":["auto",On,le]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le]}],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",le]}],"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(),TE]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",IE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},AE]}],"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:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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:[...z(),"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:z()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[On,le]}],"outline-w":[{outline:[On,fr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[On,fr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",hr,RE]}],"shadow-color":[{shadow:[ho]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",hr,le]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[N]}],"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":[N]}],"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",le]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[fo,le]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"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",le]}],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",le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[On,fr,rd]}],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"]}}},FE=bE(DE);function D(...e){return FE(oE(e))}const $E={online:"bg-signal-ok",streaming:"bg-brand",idle:"bg-muted-foreground/40",error:"bg-signal-error",warning:"bg-signal-warn"};function zE({state:e}){return c.jsx("span",{className:D("inline-block h-1.5 w-1.5 shrink-0 rounded-full",$E[e],e==="streaming"&&"animate-[v2-halo-brand_2.4s_ease-out_infinite]")})}const BE={default:"text-muted-foreground bg-muted border-border",brand:"text-brand bg-brand-ghost border-brand-ghost",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-error-ghost border-transparent",ghost:"text-muted-foreground bg-transparent border-border-soft"};function ft({tone:e="default",mono:t=!1,className:n,title:r,children:s}){return c.jsx("span",{title:r,className:D("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]",BE[e],n),children:s})}function Vn({children:e,className:t}){return c.jsx("kbd",{className:D("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 Zn({active:e,title:t,onClick:n,disabled:r,className:s,children:i,...o}){return c.jsx("button",{type:"button",title:t,onClick:n,disabled:r,"aria-label":o["aria-label"]??t,className:D("inline-flex h-[30px] w-[30px] shrink-0 items-center justify-center rounded-full border text-[13px] transition-[color,background-color,border-color,transform] duration-200 ring-brand-focus disabled:cursor-not-allowed disabled:opacity-50 active:scale-[0.9]",e?"border-brand-ghost bg-brand-ghost text-brand":"border-transparent text-muted-foreground hover:bg-accent/70 hover:text-foreground hover:border-border-soft",s),children:i})}function Fs({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"todo":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 Us(e){return e==null?"—":e<1e3?`${Math.round(e)}ms`:e<1e4?`${(e/1e3).toFixed(1)}s`:`${Math.round(e/1e3)}s`}function Wg(e){if(e!=null)return e>=3e3?"text-signal-error":e>=1500?"text-signal-warn":"text-brand"}const iv="w-[320px]",UE=480,HE="pi-pilot-artifact-width",GE=320,bu={compact:"max-w-[920px]",comfortable:"max-w-[860px]"},lc="max-h-80",ov="w-[48px]",lv=272,av="pi-pilot-sidebar-width",qE=200,WE=100;function uv(e){if(!e||typeof e!="object")return[];const n=e.tasks;return Array.isArray(n)?n.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r;if(typeof s.id!="number"||typeof s.subject!="string")return[];if(!s.subject.trim())return[];const i=s.status;return i!=="pending"&&i!=="in_progress"&&i!=="completed"&&i!=="deleted"?[]:[{id:s.id,subject:s.subject,status:i,description:typeof s.description=="string"?s.description:void 0}]}):[]}function cv(e){return e.filter(t=>t.status!=="deleted")}const Vg=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))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=t=e(r,s,l);return l},VE=e=>e?Vg(e):Vg,QE=e=>e;function KE(e,t=QE){const n=Ql.useSyncExternalStore(e.subscribe,Ql.useCallback(()=>t(e.getState()),[e,t]),Ql.useCallback(()=>t(e.getInitialState()),[e,t]));return Ql.useDebugValue(n),n}const Qg=e=>{const t=VE(e),n=r=>KE(t,r);return Object.assign(n,t),n},Qi=e=>e?Qg(e):Qg,XE=12;function vu(e,t){return`${e}\0${t??""}`}function Lo(){return{steer:[],followUp:[],deliveryOrder:[]}}function Kg(e){return{steer:[...e.steer],followUp:[...e.followUp],deliveryOrder:[...e.deliveryOrder]}}function YE(e,t,n){return{...e,[n]:[...e[n],t]}}const kn=new Map;let th=!1;function JE(){const e=th;return th=!1,e}function ZE(e){const t=kn.get(vu(e.workspaceId,e.sessionPath));t&&(tj(t,e.payload),t.backgroundFresh=!0)}function ej(e,t){const n=kn.get(vu(e,t));n&&(n.backgroundFresh=!1)}function tj(e,t){switch(t.kind){case"agent_start":e.running=!0;return;case"agent_end":e.running=!1;return;case"message_start":{if(t.role==="user"){if(t.text!==void 0){const n=fv(e.items,t.text,e.queuedOriginals);e.items=n.items,e.queuedOriginals=n.queuedOriginals}return}t.role==="assistant"&&(e.items=[...e.items,{id:jn(),kind:"assistant",text:"",thinking:"",streaming:!0,firstTokenMs:void 0,totalMs:void 0}]);return}case"message_end":{if(t.role!=="assistant")return;const n=ul(e.items);if(n<0)return;const r=e.items.slice();r[n]={...r[n],streaming:!1},e.items=r;return}case"message_update":{if(t.delta.kind==="other")return;const n=ul(e.items);if(n<0)return;const r=e.items[n],s=e.items.slice();s[n]=t.delta.kind==="text"?{...r,text:r.text+t.delta.text}:{...r,thinking:r.thinking+t.delta.text},e.items=s;return}case"tool_execution_start":e.items=[...e.items,{id:jn(),kind:"tool",toolCallId:t.toolCallId,toolName:t.toolName,args:t.args,text:"",status:"running"}];return;case"tool_execution_update":e.items=e.items.map(n=>n.kind==="tool"&&n.toolCallId===t.toolCallId?{...n,text:t.partialText??n.text}:n);return;case"tool_execution_end":e.items=e.items.map(n=>n.kind==="tool"&&n.toolCallId===t.toolCallId?{...n,text:t.text??n.text,status:t.isError?"error":"ok",...t.details!==void 0?{details:t.details}:{}}:n);return;case"queue_update":e.queuedOriginals=dv(e.queuedOriginals,e.queueSteering,e.queueFollowUp,t.steering,t.followUp),e.queueSteering=t.steering,e.queueFollowUp=t.followUp;return;case"compaction_start":e.compaction={reason:t.reason};return;case"compaction_end":e.compaction=void 0;return;case"context_usage":e.contextUsage={tokens:t.tokens,contextWindow:t.contextWindow,percent:t.percent};return;case"assistant_timing":{for(let n=e.items.length-1;n>=0;n--){const r=e.items[n];if(r.kind==="assistant"&&!r.streaming&&r.totalMs===void 0){const s=e.items.slice();s[n]={...r,firstTokenMs:t.firstTokenMs,totalMs:t.totalMs},e.items=s;break}}return}default:return}}let nj=1;const jn=()=>String(nj++),rj=100,vr=new Map;function Xg(e,t){if(e!==t){for(vr.has(e)&&vr.delete(e);vr.size>=rj;){const n=vr.keys().next().value;if(n!==void 0)vr.delete(n);else break}vr.set(e,t)}}function dv(e,t,n,r,s){const i=Math.max(0,t.length-r.length),o=Math.max(0,n.length-s.length),l=[];if(i>0&&o===0)for(let a=0;a<i;a++)l.push("steer");else if(o>0&&i===0)for(let a=0;a<o;a++)l.push("followUp");return l.length===0?e:{...e,deliveryOrder:[...e.deliveryOrder,...l]}}function sj(e){const t=e.deliveryOrder[0];if(!t)return{original:void 0,queuedOriginals:e};const n=e.deliveryOrder.slice(1),r=e[t],s=r[0],i=s===void 0?r:r.slice(1);return t==="steer"?{original:s,queuedOriginals:{steer:i,followUp:e.followUp,deliveryOrder:n}}:{original:s,queuedOriginals:{steer:e.steer,followUp:i,deliveryOrder:n}}}function fv(e,t,n){const r=e.findIndex(o=>o.kind==="user"&&o.pending===!0);if(r>=0){const o=e.slice(),l=o[r];return Xg(t,l.text),o[r]={...l,pending:!1},{items:o,queuedOriginals:n}}const s=sj(n),i=s.original??t;return s.original!==void 0&&Xg(t,s.original),{items:[...e,{id:jn(),kind:"user",text:i}],queuedOriginals:s.queuedOriginals}}let Mo="",Oo="",er=null;function wu(){if(er!==null&&(cancelAnimationFrame(er),er=null),Mo===""&&Oo==="")return;const e=Mo,t=Oo;Mo="",Oo="",ce.setState(n=>{const r=ul(n.items);if(r<0)return{};const s=n.items[r],i=n.items.slice();return i[r]={...s,text:e?s.text+e:s.text,thinking:t?s.thinking+t:s.thinking},{items:i}})}function Yg(){if(er===null){if(typeof requestAnimationFrame!="function"){wu();return}er=requestAnimationFrame(()=>{er=null,wu()})}}function nh(){er!==null&&(cancelAnimationFrame(er),er=null),Mo="",Oo=""}const rh={scrollTop:0,stickToBottom:!0},ce=Qi(e=>({sessionPath:void 0,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],queuedOriginals:Lo(),compaction:void 0,contextUsage:void 0,latency:void 0,composerDraft:"",scrollInfo:rh,reset:()=>{nh(),vr.clear(),kn.clear(),e({sessionPath:void 0,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],queuedOriginals:Lo(),compaction:void 0,contextUsage:void 0,latency:void 0,composerDraft:"",scrollInfo:rh})},pushUser:t=>e(n=>({items:[...n.items,{id:jn(),kind:"user",text:t,pending:!0}]})),rememberQueuedUser:(t,n)=>e(r=>({queuedOriginals:YE(r.queuedOriginals,t,n)})),apply:t=>{if(t.type==="event"&&t.payload.kind==="message_update"){const n=t.payload.delta;n.kind==="text"?(Mo+=n.text,Yg()):n.kind==="thinking"&&(Oo+=n.text,Yg());return}wu(),e(n=>oj(n,t))},setSwitching:t=>e({switching:t}),setComposerDraft:t=>e({composerDraft:t}),setScrollInfo:t=>e({scrollInfo:t}),applyHistory:(t,n)=>{nh(),e({latency:void 0,items:t.map(r=>{if(r.kind==="user"){const s=vr.get(r.text)??r.text;return{id:jn(),kind:"user",text:s,entryId:r.entryId}}return r.kind==="assistant"?{id:jn(),kind:"assistant",text:r.text,thinking:r.thinking,streaming:!1,firstTokenMs:void 0,totalMs:void 0}:r.kind==="tool"?{id:jn(),kind:"tool",toolCallId:r.toolCallId,toolName:r.toolName,args:ij(r.args),text:r.text,status:r.isError?"error":"ok",...r.details!==void 0?{details:r.details}:{}}:{id:jn(),kind:"bash",command:r.command,output:r.output,exitCode:r.exitCode}}),running:n,...n?{}:{queueSteering:[],queueFollowUp:[],queuedOriginals:Lo()}})},saveSnapshot:t=>{const n=ce.getState();wu();const r=vu(t,n.sessionPath),s={sessionPath:n.sessionPath,items:n.items,running:n.running,queueSteering:n.queueSteering,queueFollowUp:n.queueFollowUp,queuedOriginals:Kg(n.queuedOriginals),compaction:n.compaction,contextUsage:n.contextUsage,latency:n.latency,composerDraft:n.composerDraft,scrollInfo:n.scrollInfo,backgroundFresh:!1};for(kn.has(r)&&kn.delete(r);kn.size>=XE;){const i=kn.keys().next().value;if(i!==void 0)kn.delete(i);else break}kn.set(r,s)},restoreSnapshot:(t,n)=>{const r=kn.get(vu(t,n));if(!r)return{restored:!1,wasFresh:!1};const s=r.backgroundFresh;return ce.setState({items:r.items,running:r.running,queueSteering:r.queueSteering,queueFollowUp:r.queueFollowUp,queuedOriginals:Kg(r.queuedOriginals),compaction:r.compaction,contextUsage:r.contextUsage,latency:r.latency,composerDraft:r.composerDraft,scrollInfo:r.scrollInfo}),r.backgroundFresh=!1,{restored:!0,wasFresh:s}}}));function ij(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 oj(e,t){if(t.type==="subscribed"){nh();const n=ce.getState().restoreSnapshot(t.workspaceId,t.sessionPath);return th=n.restored?n.wasFresh:!1,n.restored?{sessionPath:t.sessionPath,switching:!1}:{sessionPath:t.sessionPath,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],queuedOriginals:Lo(),compaction:void 0,latency:void 0,composerDraft:"",scrollInfo:rh}}if(t.type==="error"){const n={};if(e.switching&&(n.switching=!1),t.command==="prompt"){const r=e.items.findIndex(s=>s.kind==="user"&&s.pending===!0);if(r>=0){const s=e.items.slice(),i=s[r];s[r]={...i,pending:!1},n.items=s}else n.queuedOriginals=Lo()}return n}return t.type==="navigate_tree_result"?{}:t.type!=="event"?{}:lj(e,t.payload)}function lj(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=fv(e.items,t.text,e.queuedOriginals);return{items:r.items,queuedOriginals:r.queuedOriginals}}return t.role!=="assistant"?{}:{items:[...e.items,{id:jn(),kind:"assistant",text:"",thinking:"",streaming:!0,firstTokenMs:void 0,totalMs:void 0}]}}case"message_end":{if(t.role!=="assistant")return{};const r=ul(e.items);if(r<0)return{};const s=e.items.slice();return s[r]={...s[r],streaming:!1},{items:s}}case"message_update":{if(t.delta.kind==="other")return{};const r=ul(e.items);if(r<0)return{};const s=e.items[r],i=t.delta.kind==="text"?{...s,text:s.text+t.delta.text}:{...s,thinking:s.thinking+t.delta.text},o=e.items.slice();return o[r]=i,{items:o}}case"tool_execution_start":return{items:[...e.items,{id:jn(),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,queuedOriginals:dv(e.queuedOriginals,e.queueSteering,e.queueFollowUp,t.steering,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)??[],s=t.firstTokenMs==null?r:[...r,t.firstTokenMs].slice(-5),i={lastFirstTokenMs:t.firstTokenMs,lastTotalMs:t.totalMs,rollingFirstTokenMs:s};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:i};const l=e.items.slice();return l[o]={...l[o],firstTokenMs:t.firstTokenMs,totalMs:t.totalMs},{items:l,latency:i}}default:return{}}}function ul(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 aj(){const e=ce(f=>{for(let d=f.items.length-1;d>=0;d--){const h=f.items[d];if(h&&h.kind==="tool"&&h.toolName==="todo"&&h.details)return h.details}}),[t,n]=S.useState(!1),r=S.useId(),s=uv(e),i=cv(s);if(i.length===0)return null;const o=i.length,l=i.filter(f=>f.status==="completed").length,a=o===0?0:l/o,u=i.find(f=>f.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(f=>!f),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(Jr,{className:D("h-3 w-3 shrink-0 text-muted-foreground transition-transform",t&&"rotate-180"),"aria-hidden":!0}),c.jsx(Fs,{tool:"todo",className:"shrink-0 text-muted-foreground"}),c.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Todos"}),c.jsxs("span",{className:"shrink-0 font-mono text-[11.5px] tabular-nums text-muted-foreground",children:[l,"/",o]}),c.jsx("span",{className:`inline-block h-1 ${ov} shrink-0 overflow-hidden rounded-full bg-border-soft`,role:"progressbar","aria-valuemin":0,"aria-valuenow":l,"aria-valuemax":o,"aria-label":`Todo progress: ${l} of ${o} completed`,children:c.jsx("span",{className:"block h-full rounded-full bg-brand transition-[width] duration-300",style:{width:`${a*100}%`}})}),u&&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(wt,{className:"mr-1 inline-block h-3 w-3 text-brand align-[-2px] animate-v2-spin","aria-hidden":!0}),u.subject]}),!u&&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":"Todo items",children:i.map(f=>c.jsxs("li",{className:"flex items-start gap-2 py-[3px]",children:[c.jsx("span",{className:"mt-[2px] shrink-0",children:f.status==="completed"?c.jsx(qi,{className:"h-3.5 w-3.5 text-signal-ok","aria-hidden":!0}):f.status==="in_progress"?c.jsx(wt,{className:"h-3.5 w-3.5 text-brand animate-v2-spin","aria-label":"In progress"}):c.jsx(K1,{className:"h-3.5 w-3.5 text-muted-foreground/40","aria-hidden":!0})}),c.jsxs("span",{className:D("min-w-0 flex-1 text-[12.5px] leading-[1.5]",f.status==="completed"?"text-muted-foreground line-through decoration-muted-foreground/30":f.status==="in_progress"?"text-foreground font-medium":"text-muted-foreground"),children:[c.jsxs("span",{className:"mr-1.5 font-mono text-[11px] text-muted-foreground/50",children:["#",f.id]}),f.subject]})]},f.id))})]})}function uj(){const e=ce(n=>n.compaction),t=ce(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",className:"animate-v2-spin",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:cj(e)}),t!=null&&c.jsxs("span",{className:"font-mono text-[11px] tabular-nums",children:["Context ",Math.round(t),"%"]})]}):null}function cj(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 dj(e,t,n=!0){return Pn({queryKey:["fs","browse",e??"~",t],queryFn:()=>{const r=new URLSearchParams;e!==void 0&&r.set("path",e),t&&r.set("showHidden","1");const s=r.toString();return ge(`/api/fs/browse${s?`?${s}`:""}`)},enabled:n,staleTime:3e4})}function fj(e,t,n=!0){const r=t.toLowerCase();return Pn({queryKey:["fs","search-files",e??"",r],queryFn:()=>{if(!e)throw new Error("workspaceId required");const s=new URLSearchParams;return r&&s.set("q",r),ge(`/api/workspaces/${encodeURIComponent(e)}/files/search${s.toString()?`?${s.toString()}`:""}`)},enabled:n&&!!e,staleTime:5e3})}const sh="pi-pilot-density";function hj(){try{const e=localStorage.getItem(sh);if(e==="compact"||e==="comfortable")return e}catch{}return"comfortable"}const ku=Qi((e,t)=>({density:hj(),setDensity:n=>{try{localStorage.setItem(sh,n)}catch{}e({density:n})},toggle:()=>{const n=t().density==="compact"?"comfortable":"compact";try{localStorage.setItem(sh,n)}catch{}e({density:n})}}));function Jg(e,t){if(t<=0)return null;const n=e.slice(0,t),r=/(?:^|\s)([/@])(\S*)$/.exec(n);if(!r)return null;const s=r[1]??"",i=r[2]??"",o=(r.index??0)+(r[0].length-1-i.length);return{kind:s==="/"?"slash":"at",tokenStart:o,query:i}}function pj(e){const t=[],n=/(^|\s)([/@])(\S+)/g;let r;for(;(r=n.exec(e))!==null;){const s=r[1]??"",i=r[2]??"",o=r[3]??"",l=(r.index??0)+s.length,a=l+1+o.length;t.push({kind:i==="/"?"slash":"at",start:l,end:a,body:e.slice(l,a)})}return t}const hv=[{value:"followUp",label:"Follow-up",description:"Queue after the current reply"},{value:"steer",label:"Steer",description:"Guide the current reply"}];function fa(e){var t;return((t=hv.find(n=>n.value===e))==null?void 0:t.label)??e}const Zg=50,mj=/\$\{@:\d+(?::\d+)?\}|\$ARGUMENTS|\$@|\$\d+/;function gj(e){return!!e.argumentHint||mj.test(e.content)}function xj(e,t){if(!e)return[];const n=t.toLowerCase(),r=[];for(const s of e.skills)n&&!s.name.toLowerCase().includes(n)||r.push({key:`skill:${s.filePath}`,label:`/skill:${s.name}`,description:s.description||void 0,insertText:`/skill:${s.name} `});for(const s of e.prompts){if(n&&!s.name.toLowerCase().includes(n))continue;const i={key:`prompt:${s.filePath}`,label:`/${s.name}`,description:s.argumentHint?`${s.description??"prompt"} · ${s.argumentHint}`:s.description||"prompt"};gj(s)?i.insertText=`/${s.name} `:i.prompt={name:s.name,description:s.description},r.push(i)}for(const s of e.extensions){const i=s.source.label==="inline";for(const o of s.commands)n&&!o.toLowerCase().includes(n)||r.push({key:`cmd:${s.resolvedPath}:${o}`,label:`/${o}`,description:i?`pi-pilot · ${o}`:`extension · ${s.source.label}`,insertText:`/${o} `})}return r.length>Zg?r.slice(0,Zg):r}function yj(e){return e?e.entries.map(t=>({key:t.path,label:t.relPath,insertText:`@${t.relPath} `})):[]}function bj({workspaceId:e,onSend:t,onAbort:n,running:r,disabled:s}){var Xe;const i=ce(K=>K.composerDraft),o=ce(K=>K.setComposerDraft),l=i,a=o,[u,f]=S.useState(0),[d,h]=S.useState(!1),[p,m]=S.useState(0),[y,v]=S.useState(null),[g,x]=S.useState(null),[b,w]=S.useState("followUp"),N=S.useRef(null),k=S.useRef(null),I=S.useRef(!1),T=ku(K=>K.density)==="compact",P=S.useMemo(()=>Jg(l,u),[l,u]),E=P==null?void 0:P.kind,M=(P==null?void 0:P.query)??"",R=Mp(E==="slash"?e:void 0),Q=fj(e,E==="at"?M:"",E==="at"),q=S.useMemo(()=>E?E==="slash"?xj(R.data,M):yj(Q.data):[],[E,M,R.data,Q.data]),G=P?`${P.kind}:${P.tokenStart}:${P.query}`:null,z=!!P&&q.length>0&&y!==G;S.useEffect(()=>{m(0)},[G]),S.useEffect(()=>{y&&y!==G&&v(null)},[G,y]),S.useEffect(()=>{x(null)},[e]),S.useEffect(()=>{r||w("followUp")},[r]),S.useEffect(()=>{var K;g&&((K=k.current)==null||K.focus())},[g]);const ee=()=>requestAnimationFrame(()=>{var K;return(K=N.current)==null?void 0:K.focus()}),O=()=>{if(s)return;const K=r?b:void 0;if(g){t(`/${g.name}`,K),x(null),a(""),f(0),ee();return}const ye=l.trim();ye&&(t(ye,K),a(""),f(0))},H=()=>{x(null),ee()},C=K=>{K.key==="Enter"&&!K.shiftKey?(K.preventDefault(),O()):(K.key==="Backspace"||K.key==="Delete"||K.key==="Escape")&&(K.preventDefault(),H())},X=K=>{if(K.prompt){x(K.prompt),a(""),f(0),v(null),I.current=!1;return}const ye=N.current,qt=(ye==null?void 0:ye.value)??l,cr=(ye==null?void 0:ye.selectionStart)??u,Rn=Jg(qt,cr);if(!Rn)return;const ts=K.insertText??"",Zi=Rn.tokenStart+1+Rn.query.length,ue=qt.slice(0,Rn.tokenStart),Oe=qt.slice(Zi),Ue=`${ue}${ts}${Oe}`,Ct=Rn.tokenStart+ts.length;a(Ue),f(Ct),v(null),requestAnimationFrame(()=>{const st=N.current;st&&(st.focus(),st.setSelectionRange(Ct,Ct))})},J=()=>{I.current=!0},j=()=>{I.current=!1},we=K=>{if(!(I.current||K.nativeEvent.isComposing||K.nativeEvent.keyCode===229)){if(z){if(K.key==="ArrowDown"){K.preventDefault(),m(ye=>(ye+1)%q.length);return}if(K.key==="ArrowUp"){K.preventDefault(),m(ye=>(ye-1+q.length)%q.length);return}if(K.key==="Enter"||K.key==="Tab"){K.preventDefault();const ye=q[p]??q[0];ye&&X(ye);return}if(K.key==="Escape"){K.preventDefault(),G&&v(G);return}}K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),O())}},te=s?"Switching session…":r?`Agent is running — ${fa(b)} on Enter…`:"Write a message…",ie=g!==null||!!l.trim();return c.jsx("div",{className:"relative shrink-0 pb-5 pt-3 v2-rise-in",children:c.jsxs("div",{className:D("pointer-events-auto mx-auto w-full px-6",T?bu.compact:bu.comfortable),children:[c.jsxs("div",{className:D("relative rounded-[14px] border bg-card transition-shadow",d?"border-brand-ghost 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:[!g&&z&&P&&c.jsx(Sj,{kind:P.kind,query:P.query,items:q,selectedIdx:p,loading:P.kind==="slash"?R.isPending:Q.isPending,truncated:P.kind==="at"?!!((Xe=Q.data)!=null&&Xe.truncated):!1,onPick:X,onHover:m}),g?c.jsx("div",{ref:k,tabIndex:0,role:"group","aria-label":`Loaded prompt /${g.name}`,onKeyDown:C,onFocus:()=>h(!0),onBlur:()=>h(!1),className:D("block w-full p-2 outline-none ring-brand-focus",r?"pr-28":"pr-20"),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(nE,{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:["/",g.name]}),g.description&&c.jsx("div",{className:"mt-0.5 truncate text-[12px] text-muted-foreground",children:g.description})]})]})}):c.jsx(vj,{textareaRef:N,text:l,onTextChange:(K,ye)=>{a(K),f(ye)},onCaretChange:f,onFocus:()=>h(!0),onBlur:()=>h(!1),onKeyDown:we,onCompositionStart:J,onCompositionEnd:j,disabled:s,placeholder:te}),c.jsxs("div",{className:"absolute bottom-2 right-2 z-10 flex items-center gap-1.5",children:[g&&c.jsx("button",{type:"button",onClick:H,disabled:s,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(Zr,{className:"h-3.5 w-3.5"})}),r?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:O,disabled:s||!ie,title:`Send as ${fa(b).toLowerCase()}`,"aria-label":`Send as ${fa(b)}`,className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-border-soft bg-card text-foreground transition-[color,background-color,transform] duration-200 hover:bg-accent active:scale-[0.9] disabled:cursor-not-allowed disabled:opacity-50 ring-brand-focus",children:c.jsx(Jf,{className:"h-3.5 w-3.5",strokeWidth:2.5})}),c.jsx("button",{type:"button",onClick:n,disabled:s,title:"Stop streaming",className:"inline-flex h-7 w-7 items-center justify-center rounded-full bg-error-ghost text-signal-error transition-[color,background-color,transform] duration-200 hover:bg-error-subtle active:scale-[0.9] disabled:opacity-50 ring-brand-focus",children:c.jsx(rE,{className:"h-3 w-3",fill:"currentColor"})})]}):c.jsx("button",{type:"button",onClick:O,disabled:s||!ie,title:"Send",className:"inline-flex h-7 w-7 items-center justify-center rounded-full bg-brand text-[hsl(var(--brand-foreground))] transition-[color,background-color,transform] duration-200 hover:bg-brand-strong active:scale-[0.9] disabled:cursor-not-allowed disabled:bg-border-soft disabled:text-muted-foreground ring-brand-focus",children:c.jsx(Jf,{className:"h-3.5 w-3.5",strokeWidth:2.5})})]})]}),c.jsxs("div",{className:D("mt-1.5 flex flex-wrap items-center gap-2 text-[11.5px] text-muted-foreground",r?"justify-between":"justify-center"),children:[r&&c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"text-muted-foreground/80",children:"while running"}),c.jsx("div",{role:"radiogroup","aria-label":"Prompt behavior while running",className:"inline-flex rounded-full border border-border-soft bg-muted/60 p-0.5",children:hv.map(K=>{const ye=K.value===b;return c.jsx("button",{type:"button",role:"radio","aria-checked":ye,onClick:()=>w(K.value),title:K.description,className:D("rounded-full px-2 py-0.5 text-[11px] transition-colors ring-brand-focus",ye?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:K.label},K.value)})})]}),c.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[c.jsx(Vn,{children:"⏎"}),c.jsx("span",{children:r?fa(b).toLowerCase():"send"}),c.jsx("span",{className:"text-muted-foreground/50",children:"·"}),g?c.jsxs(c.Fragment,{children:[c.jsx(Vn,{children:"⌫"}),c.jsx("span",{children:"remove"})]}):c.jsxs(c.Fragment,{children:[c.jsx(Vn,{children:"⇧⏎"}),c.jsx("span",{children:"newline"}),c.jsx("span",{className:"text-muted-foreground/50",children:"·"}),c.jsx(Vn,{children:"/"}),c.jsx("span",{children:"commands"}),c.jsx("span",{className:"text-muted-foreground/50",children:"·"}),c.jsx(Vn,{children:"@"}),c.jsx("span",{children:"files"})]})]})]})]})})}const ex="block max-h-[180px] min-h-[44px] w-full resize-none pl-4 pr-24 pt-3 pb-3 font-sans text-[14px] leading-[1.55] tracking-[-0.005em] whitespace-pre-wrap break-words",tx=180;function vj({textareaRef:e,text:t,onTextChange:n,onCaretChange:r,onFocus:s,onBlur:i,onKeyDown:o,onCompositionStart:l,onCompositionEnd:a,disabled:u,placeholder:f}){const d=S.useRef(null),[h,p]=S.useState(!1),m=S.useMemo(()=>pj(t),[t]),y=S.useCallback(()=>{const N=e.current;N&&r(N.selectionStart??0)},[e,r]),v=S.useCallback(()=>{const N=e.current,k=d.current;!N||!k||(k.scrollTop=N.scrollTop,k.scrollLeft=N.scrollLeft)},[e,d]);S.useLayoutEffect(()=>{const N=e.current;if(!N)return;N.style.height="auto";const k=Math.min(N.scrollHeight,tx);N.style.height=`${k}px`,N.style.overflowY=N.scrollHeight>tx?"auto":"hidden",v()},[t,e,v]);const g=S.useMemo(()=>wj(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:D(ex,"pointer-events-none absolute inset-0 overflow-hidden whitespace-pre-wrap"),children:[g.map((N,k)=>N.kind==="text"?c.jsx("span",{className:w,children:N.text},k):c.jsx(kj,{body:N.text,hideText:h},k)),""]}),c.jsx("textarea",{ref:e,value:t,onChange:N=>n(N.target.value,N.target.selectionStart??N.target.value.length),onSelect:y,onClick:y,onKeyUp:y,onScroll:v,onCompositionStart:()=>{p(!0),l==null||l()},onCompositionEnd:()=>{p(!1),a==null||a()},onFocus:s,onBlur:i,onKeyDown:o,disabled:u,placeholder:f,spellCheck:!1,autoCorrect:"off",rows:1,className:D(ex,"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 wj(e,t){if(t.length===0)return[{kind:"text",text:e}];const n=[];let r=0;for(const s of t)s.start>r&&n.push({kind:"text",text:e.slice(r,s.start)}),n.push({kind:s.kind,text:e.slice(s.start,s.end)}),r=s.end;return r<e.length&&n.push({kind:"text",text:e.slice(r)}),n}function kj({body:e,hideText:t=!1}){return c.jsx("span",{className:D("inline rounded-[3px] bg-brand-ghost [box-decoration-break:clone] [-webkit-box-decoration-break:clone]",t?"text-transparent":"text-brand"),children:e})}function Sj({kind:e,query:t,items:n,selectedIdx:r,loading:s,truncated:i,onPick:o,onHover:l}){const a=S.useRef(null);S.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:s?"…":`${n.length}${i?"+":""}`})]}),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:D("flex w-full flex-col gap-0.5 px-3 py-1.5 text-left text-[12.5px] transition-colors",p?"bg-brand-ghost 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:D("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(Vn,{children:"↑↓"}),"nav",c.jsx(Vn,{children:"⏎"}),"insert",c.jsx(Vn,{children:"Esc"}),"dismiss"]})]})}function ac({size:e=28,running:t=!1,filled:n,className:r,title:s="pi-pilot"}){const i=n??t;return c.jsx("span",{role:"img","aria-label":s,title:s,className:D("inline-flex shrink-0 items-center justify-center rounded-full",i?"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 Cj({className:e}){return c.jsx("span",{className:D("font-sans text-[15px] font-medium tracking-[-0.01em] text-foreground",e),children:"pi-pilot"})}function pv({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 v2-hero-in",children:[c.jsxs("div",{className:"relative",children:[c.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 -m-3 rounded-full bg-brand/[0.12] blur-xl v2-glow-breathe"}),c.jsx(ac,{size:56,filled:!0})]}),c.jsx("h2",{className:"mt-5 font-serif text-[36px] italic font-normal leading-[1.05] tracking-[-0.02em] bg-gradient-to-b from-foreground to-foreground/70 bg-clip-text text-transparent",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/80 backdrop-blur-sm px-3.5 py-2 text-[12.5px] text-muted-foreground shadow-sm",children:[n.keys.map(r=>c.jsx(Vn,{children:r},r)),c.jsx("span",{children:n.label})]})]})}function mv(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const _j=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ej={};function nx(e,t){return(Ej.jsx?Nj:_j).test(e)}const jj=/[ \t\n\f\r]/g;function uc(e){return typeof e=="object"?e.type==="text"?rx(e.value):!1:rx(e)}function rx(e){return e.replace(jj,"")===""}class Ml{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ml.prototype.normal={};Ml.prototype.property={};Ml.prototype.space=void 0;function gv(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Ml(n,r,t)}function ih(e){return e.toLowerCase()}class Rt{constructor(t,n){this.attribute=n,this.property=t}}Rt.prototype.attribute="";Rt.prototype.booleanish=!1;Rt.prototype.boolean=!1;Rt.prototype.commaOrSpaceSeparated=!1;Rt.prototype.commaSeparated=!1;Rt.prototype.defined=!1;Rt.prototype.mustUseProperty=!1;Rt.prototype.number=!1;Rt.prototype.overloadedBoolean=!1;Rt.prototype.property="";Rt.prototype.spaceSeparated=!1;Rt.prototype.space=void 0;let Ij=0;const ae=$s(),He=$s(),oh=$s(),$=$s(),Ce=$s(),mi=$s(),Mt=$s();function $s(){return 2**++Ij}const lh=Object.freeze(Object.defineProperty({__proto__:null,boolean:ae,booleanish:He,commaOrSpaceSeparated:Mt,commaSeparated:mi,number:$,overloadedBoolean:oh,spaceSeparated:Ce},Symbol.toStringTag,{value:"Module"})),sd=Object.keys(lh);class zp extends Rt{constructor(t,n,r,s){let i=-1;if(super(t,n),sx(this,"space",s),typeof r=="number")for(;++i<sd.length;){const o=sd[i];sx(this,sd[i],(r&lh[o])===lh[o])}}}zp.prototype.defined=!0;function sx(e,t,n){n&&(e[t]=n)}function Ki(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new zp(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[ih(r)]=r,n[ih(i.attribute)]=r}return new Ml(t,n,e.space)}const xv=Ki({properties:{ariaActiveDescendant:null,ariaAtomic:He,ariaAutoComplete:null,ariaBusy:He,ariaChecked:He,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:Ce,ariaCurrent:null,ariaDescribedBy:Ce,ariaDetails:null,ariaDisabled:He,ariaDropEffect:Ce,ariaErrorMessage:null,ariaExpanded:He,ariaFlowTo:Ce,ariaGrabbed:He,ariaHasPopup:null,ariaHidden:He,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ce,ariaLevel:$,ariaLive:null,ariaModal:He,ariaMultiLine:He,ariaMultiSelectable:He,ariaOrientation:null,ariaOwns:Ce,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:He,ariaReadOnly:He,ariaRelevant:null,ariaRequired:He,ariaRoleDescription:Ce,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:He,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function yv(e,t){return t in e?e[t]:t}function bv(e,t){return yv(e,t.toLowerCase())}const Tj=Ki({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mi,acceptCharset:Ce,accessKey:Ce,action:null,allow:null,allowFullScreen:ae,allowPaymentRequest:ae,allowUserMedia:ae,alt:null,as:null,async:ae,autoCapitalize:null,autoComplete:Ce,autoFocus:ae,autoPlay:ae,blocking:Ce,capture:null,charSet:null,checked:ae,cite:null,className:Ce,cols:$,colSpan:null,content:null,contentEditable:He,controls:ae,controlsList:Ce,coords:$|mi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ae,defer:ae,dir:null,dirName:null,disabled:ae,download:oh,draggable:He,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ae,formTarget:null,headers:Ce,height:$,hidden:oh,high:$,href:null,hrefLang:null,htmlFor:Ce,httpEquiv:Ce,id:null,imageSizes:null,imageSrcSet:null,inert:ae,inputMode:null,integrity:null,is:null,isMap:ae,itemId:null,itemProp:Ce,itemRef:Ce,itemScope:ae,itemType:Ce,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ae,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:ae,muted:ae,name:null,nonce:null,noModule:ae,noValidate:ae,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:ae,optimum:$,pattern:null,ping:Ce,placeholder:null,playsInline:ae,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ae,referrerPolicy:null,rel:Ce,required:ae,reversed:ae,rows:$,rowSpan:$,sandbox:Ce,scope:null,scoped:ae,seamless:ae,selected:ae,shadowRootClonable:ae,shadowRootDelegatesFocus:ae,shadowRootMode:null,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:He,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:ae,useMap:null,value:He,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ce,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ae,declare:ae,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:ae,noHref:ae,noShade:ae,noWrap:ae,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:He,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ae,disableRemotePlayback:ae,prefix:null,property:null,results:$,security:null,unselectable:null},space:"html",transform:bv}),Pj=Ki({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Mt,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:Ce,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:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:ae,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:mi,g2:mi,glyphName:mi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:Mt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,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:$,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:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ce,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mt,rev:Mt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mt,requiredFeatures:Mt,requiredFonts:Mt,requiredFormats:Mt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:Mt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Mt,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Mt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:yv}),vv=Ki({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()}}),wv=Ki({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:bv}),kv=Ki({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Aj={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"},Rj=/[A-Z]/g,ix=/-[a-z]/g,Lj=/^data[-\w.:]+$/i;function Sv(e,t){const n=ih(t);let r=t,s=Rt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Lj.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ix,Oj);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ix.test(i)){let o=i.replace(Rj,Mj);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=zp}return new s(r,t)}function Mj(e){return"-"+e.toLowerCase()}function Oj(e){return e.charAt(1).toUpperCase()}const Cv=gv([xv,Tj,vv,wv,kv],"html"),Ol=gv([xv,Pj,vv,wv,kv],"svg");function _v(e){return e.join(" ").trim()}var Bp={},ox=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Dj=/\n/g,Fj=/^\s*/,$j=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,zj=/^:\s*/,Bj=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Uj=/^[;\s]*/,Hj=/^\s+|\s+$/g,Gj=`
|
|
272
|
+
`,lx="/",ax="*",ls="",qj="comment",Wj="declaration";function Vj(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 s(m){var y=m.match(Dj);y&&(n+=y.length);var v=m.lastIndexOf(Gj);r=~v?m.length-v:r+m.length}function i(){var m={line:n,column:r};return function(y){return y.position=new o(m),u(),y}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function a(m){var y=m.exec(e);if(y){var v=y[0];return s(v),e=e.slice(v.length),y}}function u(){a(Fj)}function f(m){var y;for(m=m||[];y=d();)y!==!1&&m.push(y);return m}function d(){var m=i();if(!(lx!=e.charAt(0)||ax!=e.charAt(1))){for(var y=2;ls!=e.charAt(y)&&(ax!=e.charAt(y)||lx!=e.charAt(y+1));)++y;if(y+=2,ls===e.charAt(y-1))return l("End of comment missing");var v=e.slice(2,y-2);return r+=2,s(v),e=e.slice(y),r+=2,m({type:qj,comment:v})}}function h(){var m=i(),y=a($j);if(y){if(d(),!a(zj))return l("property missing ':'");var v=a(Bj),g=m({type:Wj,property:ux(y[0].replace(ox,ls)),value:v?ux(v[0].replace(ox,ls)):ls});return a(Uj),g}}function p(){var m=[];f(m);for(var y;y=h();)y!==!1&&(m.push(y),f(m));return m}return u(),p()}function ux(e){return e?e.replace(Hj,ls):ls}var Qj=Vj,Kj=qa&&qa.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bp,"__esModule",{value:!0});Bp.default=Yj;const Xj=Kj(Qj);function Yj(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Xj.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:o,value:l}=i;s?t(o,l,i):l&&(n=n||{},n[o]=l)}),n}var cc={};Object.defineProperty(cc,"__esModule",{value:!0});cc.camelCase=void 0;var Jj=/^--[a-zA-Z0-9_-]+$/,Zj=/-([a-z])/g,e2=/^[^-]+$/,t2=/^-(webkit|moz|ms|o|khtml)-/,n2=/^-(ms)-/,r2=function(e){return!e||e2.test(e)||Jj.test(e)},s2=function(e,t){return t.toUpperCase()},cx=function(e,t){return"".concat(t,"-")},i2=function(e,t){return t===void 0&&(t={}),r2(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(n2,cx):e=e.replace(t2,cx),e.replace(Zj,s2))};cc.camelCase=i2;var o2=qa&&qa.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},l2=o2(Bp),a2=cc;function ah(e,t){var n={};return!e||typeof e!="string"||(0,l2.default)(e,function(r,s){r&&s&&(n[(0,a2.camelCase)(r,t)]=s)}),n}ah.default=ah;var u2=ah;const c2=Lh(u2),Nv=Ev("end"),Up=Ev("start");function Ev(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 d2(e){const t=Up(e),n=Nv(e);if(t&&n)return{start:t,end:n}}function Do(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?dx(e.position):"start"in e||"end"in e?dx(e):"line"in e||"column"in e?uh(e):""}function uh(e){return fx(e&&e.line)+":"+fx(e&&e.column)}function dx(e){return uh(e&&e.start)+"-"+uh(e&&e.end)}function fx(e){return e&&typeof e=="number"?e:1}class pt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(o=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?i.ruleId=r:(i.source=r.slice(0,a),i.ruleId=r.slice(a+1))}if(!i.place&&i.ancestors&&i.ancestors){const a=i.ancestors[i.ancestors.length-1];a&&(i.place=a.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Do(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}pt.prototype.file="";pt.prototype.name="";pt.prototype.reason="";pt.prototype.message="";pt.prototype.stack="";pt.prototype.column=void 0;pt.prototype.line=void 0;pt.prototype.ancestors=void 0;pt.prototype.cause=void 0;pt.prototype.fatal=void 0;pt.prototype.place=void 0;pt.prototype.ruleId=void 0;pt.prototype.source=void 0;const Hp={}.hasOwnProperty,f2=new Map,h2=/[A-Z]/g,p2=new Set(["table","tbody","thead","tfoot","tr"]),m2=new Set(["td","th"]),jv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function g2(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=C2(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=S2(n,t.jsx,t.jsxs)}const s={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"?Ol:Cv,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Iv(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Iv(e,t,n){if(t.type==="element")return x2(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return y2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return v2(e,t,n);if(t.type==="mdxjsEsm")return b2(e,t);if(t.type==="root")return w2(e,t,n);if(t.type==="text")return k2(e,t)}function x2(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Ol,e.schema=s),e.ancestors.push(t);const i=Pv(e,t.tagName,!1),o=_2(e,t);let l=qp(e,t);return p2.has(t.tagName)&&(l=l.filter(function(a){return typeof a=="string"?!uc(a):!0})),Tv(e,o,i,t),Gp(o,l),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function y2(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)}cl(e,t.position)}function b2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cl(e,t.position)}function v2(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Ol,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Pv(e,t.name,!0),o=N2(e,t),l=qp(e,t);return Tv(e,o,i,t),Gp(o,l),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function w2(e,t,n){const r={};return Gp(r,qp(e,t)),e.create(t,e.Fragment,r,n)}function k2(e,t){return t.value}function Tv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Gp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function S2(e,t,n){return r;function r(s,i,o,l){const u=Array.isArray(o.children)?n:t;return l?u(i,o,l):u(i,o)}}function C2(e,t){return n;function n(r,s,i,o){const l=Array.isArray(i.children),a=Up(r);return t(s,i,o,l,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function _2(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Hp.call(t.properties,s)){const i=E2(e,s,t.properties[s]);if(i){const[o,l]=i;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&m2.has(t.tagName)?r=l:n[o]=l}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function N2(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const o=i.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else cl(e,t.position);else{const s=r.name;let i;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,i=e.evaluater.evaluateExpression(l.expression)}else cl(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function qp(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:f2;for(;++r<t.children.length;){const i=t.children[r];let o;if(e.passKeys){const a=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(a){const u=s.get(a)||0;o=a+"-"+u,s.set(a,u+1)}}const l=Iv(e,i,o);l!==void 0&&n.push(l)}return n}function E2(e,t,n){const r=Sv(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?mv(n):_v(n)),r.property==="style"){let s=typeof n=="object"?n:j2(e,String(n));return e.stylePropertyNameCase==="css"&&(s=I2(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?Aj[r.property]||r.property:r.attribute,n]}}function j2(e,t){try{return c2(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new pt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=jv+"#cannot-parse-style-attribute",s}}function Pv(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,o;for(;++i<s.length;){const l=nx(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(i&&l.type==="Literal"),optional:!1}:l}r=o}else r=nx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return Hp.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);cl(e)}function cl(e,t){const n=new pt("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=jv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function I2(e){const t={};let n;for(n in e)Hp.call(e,n)&&(t[T2(n)]=e[n]);return t}function T2(e){let t=e.replace(h2,P2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function P2(e){return"-"+e.toLowerCase()}const id={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"]},A2={};function Wp(e,t){const n=A2,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Av(e,r,s)}function Av(e,t,n){if(R2(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 hx(e.children,t,n)}return Array.isArray(e)?hx(e,t,n):""}function hx(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Av(e[s],t,n);return r.join("")}function R2(e){return!!(e&&typeof e=="object")}const px=document.createElement("i");function Vp(e){const t="&"+e+";";px.innerHTML=t;const n=px.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Bt(e,t,n,r){const s=e.length;let i=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s: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);i<r.length;)o=r.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function Xt(e,t){return e.length>0?(Bt(e,e.length,0,t),e):t}const mx={}.hasOwnProperty;function Rv(e){const t={};let n=-1;for(;++n<e.length;)L2(t,e[n]);return t}function L2(e,t){let n;for(n in t){const s=(mx.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){mx.call(s,o)||(s[o]=[]);const l=i[o];M2(s[o],Array.isArray(l)?l:l?[l]:[])}}}function M2(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Bt(e,0,0,r)}function Lv(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 mn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bt=es(/[A-Za-z]/),dt=es(/[\dA-Za-z]/),O2=es(/[#-'*+\--9=?A-Z^-~]/);function Su(e){return e!==null&&(e<32||e===127)}const ch=es(/\d/),D2=es(/[\dA-Fa-f]/),F2=es(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function Se(e){return e!==null&&(e<0||e===32)}function de(e){return e===-2||e===-1||e===32}const dc=es(new RegExp("\\p{P}|\\p{S}","u")),Ls=es(/\s/);function es(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Xi(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&dt(e.charCodeAt(n+1))&&dt(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const l=e.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(o=String.fromCharCode(i,l),s=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function me(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(a){return de(a)?(e.enter(n),l(a)):t(a)}function l(a){return de(a)&&i++<s?(e.consume(a),l):(e.exit(n),t(a))}}const $2={tokenize:z2};function z2(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),me(e,t,"linePrefix")}function s(l){return e.enter("paragraph"),i(l)}function i(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 Y(l)?(e.consume(l),e.exit("chunkText"),i):(e.consume(l),o)}}const B2={tokenize:U2},gx={tokenize:H2};function U2(e){const t=this,n=[];let r=0,s,i,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,s&&x();const w=t.events.length;let N=w,k;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){k=t.events[N][1].end;break}g(r);let I=w;for(;I<t.events.length;)t.events[I][1].end={...k},I++;return Bt(t.events,N+1,0,t.events.slice(w)),t.events.length=I,u(b)}return l(b)}function u(b){if(r===n.length){if(!s)return h(b);if(s.currentConstruct&&s.currentConstruct.concrete)return m(b);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gx,f,d)(b)}function f(b){return s&&x(),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(gx,p,m)(b)}function p(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function m(b){if(b===null){s&&x(),g(0),e.consume(b);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),y(b)}function y(b){if(b===null){v(e.exit("chunkFlow"),!0),g(0),e.consume(b);return}return Y(b)?(e.consume(b),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(b),y)}function v(b,w){const N=t.sliceStream(b);if(w&&N.push(null),b.previous=i,i&&(i.next=b),i=b,s.defineSkip(b.start),s.write(N),t.parser.lazy[b.start.line]){let k=s.events.length;for(;k--;)if(s.events[k][1].start.offset<o&&(!s.events[k][1].end||s.events[k][1].end.offset>o))return;const I=t.events.length;let T=I,P,E;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(P){E=t.events[T][1].end;break}P=!0}for(g(r),k=I;k<t.events.length;)t.events[k][1].end={...E},k++;Bt(t.events,T+1,0,t.events.slice(I)),t.events.length=k}}function g(b){let w=n.length;for(;w-- >b;){const N=n[w];t.containerState=N[1],N[0].exit.call(t,e)}n.length=b}function x(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function H2(e,t,n){return me(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Fi(e){if(e===null||Se(e)||Ls(e))return 1;if(dc(e))return 2}function fc(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const dh={name:"attention",resolveAll:G2,tokenize:q2};function G2(e,t){let n=-1,r,s,i,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};xx(d,-a),xx(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},i={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={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=Xt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Xt(u,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),u=Xt(u,fc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Xt(u,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=Xt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Bt(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 q2(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Fi(r);let i;return o;function o(a){return i=a,e.enter("attentionSequence"),l(a)}function l(a){if(a===i)return e.consume(a),l;const u=e.exit("attentionSequence"),f=Fi(a),d=!f||f===2&&s||n.includes(a),h=!s||s===2&&f||n.includes(r);return u._open=!!(i===42?d:d&&(s||!h)),u._close=!!(i===42?h:h&&(f||!d)),t(a)}}function xx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const W2={name:"autolink",tokenize:V2};function V2(e,t,n){let r=0;return s;function s(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return bt(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||dt(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||dt(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||Su(p)?n(p):(e.consume(p),a)}function u(p){return p===64?(e.consume(p),f):O2(p)?(e.consume(p),u):n(p)}function f(p){return dt(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||dt(p))&&r++<63){const m=p===45?h:d;return e.consume(p),m}return n(p)}}const Dl={partial:!0,tokenize:Q2};function Q2(e,t,n){return r;function r(i){return de(i)?me(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||Y(i)?t(i):n(i)}}const Mv={continuation:{tokenize:X2},exit:Y2,name:"blockQuote",tokenize:K2};function K2(e,t,n){const r=this;return s;function s(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"),i}return n(o)}function i(o){return de(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function X2(e,t,n){const r=this;return s;function s(o){return de(o)?me(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(Mv,t,n)(o)}}function Y2(e){e.exit("blockQuote")}const Ov={name:"characterEscape",tokenize:J2};function J2(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return F2(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Dv={name:"characterReference",tokenize:Z2};function Z2(e,t,n){const r=this;let s=0,i,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"),i=31,o=dt,f(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=D2,f):(e.enter("characterReferenceValue"),i=7,o=ch,f(d))}function f(d){if(d===59&&s){const h=e.exit("characterReferenceValue");return o===dt&&!Vp(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&s++<i?(e.consume(d),f):n(d)}}const yx={partial:!0,tokenize:tI},bx={concrete:!0,name:"codeFenced",tokenize:eI};function eI(e,t,n){const r=this,s={partial:!0,tokenize:N};let i=0,o=0,l;return a;function a(k){return u(k)}function u(k){const I=r.events[r.events.length-1];return i=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[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"),de(k)?me(e,d,"whitespace")(k):d(k))}function d(k){return k===null||Y(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(yx,y,w)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||Y(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):de(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),me(e,p,"whitespace")(k)):k===96&&k===l?n(k):(e.consume(k),h)}function p(k){return k===null||Y(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||Y(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===l?n(k):(e.consume(k),m)}function y(k){return e.attempt(s,w,v)(k)}function v(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),g}function g(k){return i>0&&de(k)?me(e,x,"linePrefix",i+1)(k):x(k)}function x(k){return k===null||Y(k)?e.check(yx,y,w)(k):(e.enter("codeFlowValue"),b(k))}function b(k){return k===null||Y(k)?(e.exit("codeFlowValue"),x(k)):(e.consume(k),b)}function w(k){return e.exit("codeFenced"),t(k)}function N(k,I,T){let P=0;return E;function E(G){return k.enter("lineEnding"),k.consume(G),k.exit("lineEnding"),M}function M(G){return k.enter("codeFencedFence"),de(G)?me(k,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):R(G)}function R(G){return G===l?(k.enter("codeFencedFenceSequence"),Q(G)):T(G)}function Q(G){return G===l?(P++,k.consume(G),Q):P>=o?(k.exit("codeFencedFenceSequence"),de(G)?me(k,q,"whitespace")(G):q(G)):T(G)}function q(G){return G===null||Y(G)?(k.exit("codeFencedFence"),I(G)):T(G)}}}function tI(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const od={name:"codeIndented",tokenize:rI},nI={partial:!0,tokenize:sI};function rI(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),me(e,i,"linePrefix",5)(u)}function i(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):Y(u)?e.attempt(nI,o,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Y(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function sI(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):Y(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):me(e,i,"linePrefix",5)(o)}function i(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):Y(o)?s(o):n(o)}}const iI={name:"codeText",previous:lI,resolve:oI,tokenize:aI};function oI(e){let t=e.length-4,n=3,r,s;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;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function lI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function aI(e,t,n){let r=0,s,i;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?(i=e.enter("codeTextSequence"),s=0,f(d)):Y(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||Y(d)?(e.exit("codeTextData"),a(d)):(e.consume(d),u)}function f(d){return d===96?(e.consume(d),s++,f):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",u(d))}}class uI{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 s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&po(this.left,r),i.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),po(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),po(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);po(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);po(this.left,n.reverse())}}}function po(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 Fv(e){const t={};let n=-1,r,s,i,o,l,a,u;const f=new uI(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,i=0,i<a.length&&a[i][1].type==="lineEndingBlank"&&(i+=2),i<a.length&&a[i][1].type==="content"))for(;++i<a.length&&a[i][1].type!=="content";)a[i][1].type==="chunkText"&&(a[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,cI(f,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(o=f.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(f.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=i);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...f.get(s)[1].start},l=f.slice(s,n),l.unshift(r),f.splice(s,n-s+1,l))}}return Bt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function cI(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];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,y=0;const v=[y];for(;p;){for(;e.get(++s)[1]!==p;);i.push(s),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&&(y=h+1,v.push(y),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]),x=i.pop();a.push([x,x+g.length-1]),e.splice(x,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 dI={resolve:hI,tokenize:pI},fI={partial:!0,tokenize:mI};function hI(e){return Fv(e),e}function pI(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?i(l):Y(l)?e.check(fI,o,i)(l):(e.consume(l),s)}function i(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,s}}function mI(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),me(e,i,"linePrefix")}function i(o){if(o===null||Y(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 $v(e,t,n,r,s,i,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(s),e.enter(i),e.consume(g),e.exit(i),h):g===null||g===32||g===41||Su(g)?n(g):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),y(g))}function h(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(s),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||Y(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 y(g){return!f&&(g===null||g===41||Se(g))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(g)):f<u&&g===40?(e.consume(g),f++,y):g===41?(e.consume(g),f--,y):g===null||g===32||g===40||Su(g)?n(g):(e.consume(g),g===92?v:y)}function v(g){return g===40||g===41||g===92?(e.consume(g),y):y(g)}}function zv(e,t,n,r,s,i){const o=this;let l=0,a;return u;function u(p){return e.enter(r),e.enter(s),e.consume(p),e.exit(s),e.enter(i),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(i),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):Y(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||Y(p)||l++>999?(e.exit("chunkString"),f(p)):(e.consume(p),a||(a=!de(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}function Bv(e,t,n,r,s,i){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,a):n(h)}function a(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),u(h))}function u(h){return h===o?(e.exit(i),a(o)):h===null?n(h):Y(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),me(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===o||h===null||Y(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 Fo(e,t){let n;return r;function r(s){return Y(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):de(s)?me(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const gI={name:"definition",tokenize:yI},xI={partial:!0,tokenize:bI};function yI(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return zv.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=mn(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 Se(p)?Fo(e,u)(p):u(p)}function u(p){return $v(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(xI,d,d)(p)}function d(p){return de(p)?me(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Y(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function bI(e,t,n){return r;function r(l){return Se(l)?Fo(e,s)(l):n(l)}function s(l){return Bv(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return de(l)?me(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Y(l)?t(l):n(l)}}const vI={name:"hardBreakEscape",tokenize:wI};function wI(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return Y(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const kI={name:"headingAtx",resolve:SI,tokenize:CI};function SI(e,t){let n=e.length-2,r=3,s,i;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&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Bt(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function CI(e,t,n){let r=0;return s;function s(f){return e.enter("atxHeading"),i(f)}function i(f){return e.enter("atxHeadingSequence"),o(f)}function o(f){return f===35&&r++<6?(e.consume(f),o):f===null||Se(f)?(e.exit("atxHeadingSequence"),l(f)):n(f)}function l(f){return f===35?(e.enter("atxHeadingSequence"),a(f)):f===null||Y(f)?(e.exit("atxHeading"),t(f)):de(f)?me(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||Se(f)?(e.exit("atxHeadingText"),l(f)):(e.consume(f),u)}}const _I=["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"],vx=["pre","script","style","textarea"],NI={concrete:!0,name:"htmlFlow",resolveTo:II,tokenize:TI},EI={partial:!0,tokenize:AI},jI={partial:!0,tokenize:PI};function II(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 TI(e,t,n){const r=this;let s,i,o,l,a;return u;function u(j){return f(j)}function f(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),d}function d(j){return j===33?(e.consume(j),h):j===47?(e.consume(j),i=!0,y):j===63?(e.consume(j),s=3,r.interrupt?t:C):bt(j)?(e.consume(j),o=String.fromCharCode(j),v):n(j)}function h(j){return j===45?(e.consume(j),s=2,p):j===91?(e.consume(j),s=5,l=0,m):bt(j)?(e.consume(j),s=4,r.interrupt?t:C):n(j)}function p(j){return j===45?(e.consume(j),r.interrupt?t:C):n(j)}function m(j){const we="CDATA[";return j===we.charCodeAt(l++)?(e.consume(j),l===we.length?r.interrupt?t:R:m):n(j)}function y(j){return bt(j)?(e.consume(j),o=String.fromCharCode(j),v):n(j)}function v(j){if(j===null||j===47||j===62||Se(j)){const we=j===47,te=o.toLowerCase();return!we&&!i&&vx.includes(te)?(s=1,r.interrupt?t(j):R(j)):_I.includes(o.toLowerCase())?(s=6,we?(e.consume(j),g):r.interrupt?t(j):R(j)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):i?x(j):b(j))}return j===45||dt(j)?(e.consume(j),o+=String.fromCharCode(j),v):n(j)}function g(j){return j===62?(e.consume(j),r.interrupt?t:R):n(j)}function x(j){return de(j)?(e.consume(j),x):E(j)}function b(j){return j===47?(e.consume(j),E):j===58||j===95||bt(j)?(e.consume(j),w):de(j)?(e.consume(j),b):E(j)}function w(j){return j===45||j===46||j===58||j===95||dt(j)?(e.consume(j),w):N(j)}function N(j){return j===61?(e.consume(j),k):de(j)?(e.consume(j),N):b(j)}function k(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),a=j,I):de(j)?(e.consume(j),k):T(j)}function I(j){return j===a?(e.consume(j),a=null,P):j===null||Y(j)?n(j):(e.consume(j),I)}function T(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||Se(j)?N(j):(e.consume(j),T)}function P(j){return j===47||j===62||de(j)?b(j):n(j)}function E(j){return j===62?(e.consume(j),M):n(j)}function M(j){return j===null||Y(j)?R(j):de(j)?(e.consume(j),M):n(j)}function R(j){return j===45&&s===2?(e.consume(j),z):j===60&&s===1?(e.consume(j),ee):j===62&&s===4?(e.consume(j),X):j===63&&s===3?(e.consume(j),C):j===93&&s===5?(e.consume(j),H):Y(j)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(EI,J,Q)(j)):j===null||Y(j)?(e.exit("htmlFlowData"),Q(j)):(e.consume(j),R)}function Q(j){return e.check(jI,q,J)(j)}function q(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),G}function G(j){return j===null||Y(j)?Q(j):(e.enter("htmlFlowData"),R(j))}function z(j){return j===45?(e.consume(j),C):R(j)}function ee(j){return j===47?(e.consume(j),o="",O):R(j)}function O(j){if(j===62){const we=o.toLowerCase();return vx.includes(we)?(e.consume(j),X):R(j)}return bt(j)&&o.length<8?(e.consume(j),o+=String.fromCharCode(j),O):R(j)}function H(j){return j===93?(e.consume(j),C):R(j)}function C(j){return j===62?(e.consume(j),X):j===45&&s===2?(e.consume(j),C):R(j)}function X(j){return j===null||Y(j)?(e.exit("htmlFlowData"),J(j)):(e.consume(j),X)}function J(j){return e.exit("htmlFlow"),t(j)}}function PI(e,t,n){const r=this;return s;function s(o){return Y(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):n(o)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function AI(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Dl,t,n)}}const RI={name:"htmlText",tokenize:LI};function LI(e,t,n){const r=this;let s,i,o;return l;function l(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),a}function a(C){return C===33?(e.consume(C),u):C===47?(e.consume(C),N):C===63?(e.consume(C),b):bt(C)?(e.consume(C),T):n(C)}function u(C){return C===45?(e.consume(C),f):C===91?(e.consume(C),i=0,m):bt(C)?(e.consume(C),x):n(C)}function f(C){return C===45?(e.consume(C),p):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),h):Y(C)?(o=d,ee(C)):(e.consume(C),d)}function h(C){return C===45?(e.consume(C),p):d(C)}function p(C){return C===62?z(C):C===45?h(C):d(C)}function m(C){const X="CDATA[";return C===X.charCodeAt(i++)?(e.consume(C),i===X.length?y:m):n(C)}function y(C){return C===null?n(C):C===93?(e.consume(C),v):Y(C)?(o=y,ee(C)):(e.consume(C),y)}function v(C){return C===93?(e.consume(C),g):y(C)}function g(C){return C===62?z(C):C===93?(e.consume(C),g):y(C)}function x(C){return C===null||C===62?z(C):Y(C)?(o=x,ee(C)):(e.consume(C),x)}function b(C){return C===null?n(C):C===63?(e.consume(C),w):Y(C)?(o=b,ee(C)):(e.consume(C),b)}function w(C){return C===62?z(C):b(C)}function N(C){return bt(C)?(e.consume(C),k):n(C)}function k(C){return C===45||dt(C)?(e.consume(C),k):I(C)}function I(C){return Y(C)?(o=I,ee(C)):de(C)?(e.consume(C),I):z(C)}function T(C){return C===45||dt(C)?(e.consume(C),T):C===47||C===62||Se(C)?P(C):n(C)}function P(C){return C===47?(e.consume(C),z):C===58||C===95||bt(C)?(e.consume(C),E):Y(C)?(o=P,ee(C)):de(C)?(e.consume(C),P):z(C)}function E(C){return C===45||C===46||C===58||C===95||dt(C)?(e.consume(C),E):M(C)}function M(C){return C===61?(e.consume(C),R):Y(C)?(o=M,ee(C)):de(C)?(e.consume(C),M):P(C)}function R(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,Q):Y(C)?(o=R,ee(C)):de(C)?(e.consume(C),R):(e.consume(C),q)}function Q(C){return C===s?(e.consume(C),s=void 0,G):C===null?n(C):Y(C)?(o=Q,ee(C)):(e.consume(C),Q)}function q(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||Se(C)?P(C):(e.consume(C),q)}function G(C){return C===47||C===62||Se(C)?P(C):n(C)}function z(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function ee(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),O}function O(C){return de(C)?me(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):H(C)}function H(C){return e.enter("htmlTextData"),o(C)}}const Qp={name:"labelEnd",resolveAll:FI,resolveTo:$I,tokenize:zI},MI={tokenize:BI},OI={tokenize:UI},DI={tokenize:HI};function FI(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 s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Bt(e,0,e.length,n),e}function $I(e,t){let n=e.length,r=0,s,i,o,l;for(;n--;)if(s=e[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const a={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[o][1].end}},f={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",a,t],["enter",u,t]],l=Xt(l,e.slice(i+1,i+r+3)),l=Xt(l,[["enter",f,t]]),l=Xt(l,fc(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),l=Xt(l,[["exit",f,t],e[o-2],e[o-1],["exit",u,t]]),l=Xt(l,e.slice(o+1)),l=Xt(l,[["exit",a,t]]),Bt(e,i,e.length,l),e}function zI(e,t,n){const r=this;let s=r.events.length,i,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return l;function l(h){return i?i._inactive?d(h):(o=r.parser.defined.includes(mn(r.sliceSerialize({start:i.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(MI,f,o?f:d)(h):h===91?e.attempt(OI,f,o?u:d)(h):o?f(h):d(h)}function u(h){return e.attempt(DI,f,d)(h)}function f(h){return t(h)}function d(h){return i._balanced=!0,n(h)}}function BI(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),s}function s(d){return Se(d)?Fo(e,i)(d):i(d)}function i(d){return d===41?f(d):$v(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return Se(d)?Fo(e,a)(d):f(d)}function l(d){return n(d)}function a(d){return d===34||d===39||d===40?Bv(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function u(d){return Se(d)?Fo(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 UI(e,t,n){const r=this;return s;function s(l){return zv.call(r,e,i,o,"reference","referenceMarker","referenceString")(l)}function i(l){return r.parser.defined.includes(mn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function HI(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const GI={name:"labelStartImage",resolveAll:Qp.resolveAll,tokenize:qI};function qI(e,t,n){const r=this;return s;function s(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),i}function i(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 WI={name:"labelStartLink",resolveAll:Qp.resolveAll,tokenize:VI};function VI(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const ld={name:"lineEnding",tokenize:QI};function QI(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),me(e,t,"linePrefix")}}const Fa={name:"thematicBreak",tokenize:KI};function KI(e,t,n){let r=0,s;return i;function i(u){return e.enter("thematicBreak"),o(u)}function o(u){return s=u,l(u)}function l(u){return u===s?(e.enter("thematicBreakSequence"),a(u)):r>=3&&(u===null||Y(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===s?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),de(u)?me(e,l,"whitespace")(u):l(u))}}const _t={continuation:{tokenize:ZI},exit:tT,name:"list",tokenize:JI},XI={partial:!0,tokenize:nT},YI={partial:!0,tokenize:eT};function JI(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[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:ch(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(Fa,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 ch(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(Dl,r.interrupt?n:f,e.attempt(XI,h,d))}function f(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function d(p){return de(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function ZI(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Dl,s,i);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,me(e,t,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!de(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(YI,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,me(e,e.attempt(_t,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function eT(e,t,n){const r=this;return me(e,s,"listItemIndent",r.containerState.size+1);function s(i){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(i):n(i)}}function tT(e){e.exit(this.containerState.type)}function nT(e,t,n){const r=this;return me(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const o=r.events[r.events.length-1];return!de(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const wx={name:"setextUnderline",resolveTo:rT,tokenize:sT};function rT(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",o,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function sT(e,t,n){const r=this;let s;return i;function i(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"),s=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===s?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),de(u)?me(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Y(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const iT={tokenize:oT};function oT(e){const t=this,n=e.attempt(Dl,r,e.attempt(this.parser.constructs.flowInitial,s,me(e,e.attempt(this.parser.constructs.flow,s,e.attempt(dI,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const lT={resolveAll:Hv()},aT=Uv("string"),uT=Uv("text");function Uv(e){return{resolveAll:Hv(e==="text"?cT:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,o,l);return o;function o(f){return u(f)?i(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"),i(f)):(n.consume(f),a)}function u(f){if(f===null)return!0;const d=s[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 Hv(e){return t;function t(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(n,r):n}}function cT(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],s=t.sliceStream(r);let i=s.length,o=-1,l=0,a;for(;i--;){const u=s[i];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){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||a||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:r.start._bufferIndex+o,_index:r.start._index+i,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 dT={42:_t,43:_t,45:_t,48:_t,49:_t,50:_t,51:_t,52:_t,53:_t,54:_t,55:_t,56:_t,57:_t,62:Mv},fT={91:gI},hT={[-2]:od,[-1]:od,32:od},pT={35:kI,42:Fa,45:[wx,Fa],60:NI,61:wx,95:Fa,96:bx,126:bx},mT={38:Dv,92:Ov},gT={[-5]:ld,[-4]:ld,[-3]:ld,33:GI,38:Dv,42:dh,60:[W2,RI],91:WI,92:[vI,Ov],93:Qp,95:dh,96:iI},xT={null:[dh,lT]},yT={null:[42,95]},bT={null:[]},vT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:yT,contentInitial:fT,disable:bT,document:dT,flow:pT,flowInitial:hT,insideSpan:xT,string:mT,text:gT},Symbol.toStringTag,{value:"Module"}));function wT(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 s={},i=[];let o=[],l=[];const a={attempt:I(N),check:I(k),consume:x,enter:b,exit:w,interrupt:I(k,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:d};let f=t.tokenize.call(u,a);return t.resolveAll&&i.push(t),u;function d(M){return o=Xt(o,M),v(),o[o.length-1]!==null?[]:(T(t,0),u.events=fc(i,u.events,u),u.events)}function h(M,R){return ST(p(M),R)}function p(M){return kT(o,M)}function m(){const{_bufferIndex:M,_index:R,line:Q,column:q,offset:G}=r;return{_bufferIndex:M,_index:R,line:Q,column:q,offset:G}}function y(M){s[M.line]=M.column,E()}function v(){let M;for(;r._index<o.length;){const R=o[r._index];if(typeof R=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<R.length;)g(R.charCodeAt(r._bufferIndex));else g(R)}}function g(M){f=f(M)}function x(M){Y(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,E()):M!==-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=M}function b(M,R){const Q=R||{};return Q.type=M,Q.start=m(),u.events.push(["enter",Q,u]),l.push(Q),Q}function w(M){const R=l.pop();return R.end=m(),u.events.push(["exit",R,u]),R}function N(M,R){T(M,R.from)}function k(M,R){R.restore()}function I(M,R){return Q;function Q(q,G,z){let ee,O,H,C;return Array.isArray(q)?J(q):"tokenize"in q?J([q]):X(q);function X(ie){return Xe;function Xe(K){const ye=K!==null&&ie[K],qt=K!==null&&ie.null,cr=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(qt)?qt:qt?[qt]:[]];return J(cr)(K)}}function J(ie){return ee=ie,O=0,ie.length===0?z:j(ie[O])}function j(ie){return Xe;function Xe(K){return C=P(),H=ie,ie.partial||(u.currentConstruct=ie),ie.name&&u.parser.constructs.disable.null.includes(ie.name)?te():ie.tokenize.call(R?Object.assign(Object.create(u),R):u,a,we,te)(K)}}function we(ie){return M(H,C),G}function te(ie){return C.restore(),++O<ee.length?j(ee[O]):z}}}function T(M,R){M.resolveAll&&!i.includes(M)&&i.push(M),M.resolve&&Bt(u.events,R,u.events.length-R,M.resolve(u.events.slice(R),u)),M.resolveTo&&(u.events=M.resolveTo(u.events,u))}function P(){const M=m(),R=u.previous,Q=u.currentConstruct,q=u.events.length,G=Array.from(l);return{from:q,restore:z};function z(){r=M,u.previous=R,u.currentConstruct=Q,u.events.length=q,l=G,E()}}function E(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function kT(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,i)];else{if(o=e.slice(n,s),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}i>0&&o.push(e[s].slice(0,i))}return o}function ST(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
|
|
273
|
+
`;break}case-3:{o=`\r
|
|
274
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(i)}s=i===-2,r.push(o)}return r.join("")}function CT(e){const r={constructs:Rv([vT,...(e||{}).extensions||[]]),content:s($2),defined:[],document:s(B2),flow:s(iT),lazy:{},string:s(aT),text:s(uT)};return r;function s(i){return o;function o(l){return wT(r,i,l)}}}function _T(e){for(;!Fv(e););return e}const kx=/[\0\t\n\r]/g;function NT(){let e=1,t="",n=!0,r;return s;function s(i,o,l){const a=[];let u,f,d,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(kx.lastIndex=d,u=kx.exec(i),h=u&&u.index!==void 0?u.index:i.length,p=i.charCodeAt(h),!u){t=i.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(i.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 ET=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jT(e){return e.replace(ET,IT)}function IT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Lv(n.slice(i?2:1),i?16:10)}return Vp(n)||e}const Gv={}.hasOwnProperty;function TT(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),PT(n)(_T(CT(n).document().write(NT()(e,t,!0))))}function PT(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(st),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(ue),blockQuote:i(qt),characterEscape:P,characterReference:P,codeFenced:i(cr),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(cr,o),codeText:i(Rn,o),codeTextData:P,data:P,codeFlowValue:P,definition:i(ts),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Zi),hardBreakEscape:i(Oe),hardBreakTrailing:i(Oe),htmlFlow:i(Ue,o),htmlFlowData:P,htmlText:i(Ue,o),htmlTextData:P,image:i(Ct),label:o,link:i(st),listItem:i(Gl),listItemValue:h,listOrdered:i(eo,d),listUnordered:i(eo),paragraph:i(ql),reference:j,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(ue),strong:i(Ic),thematicBreak:i(Qk)},exit:{atxHeading:a(),atxHeadingSequence:N,autolink:a(),autolinkEmail:ye,autolinkProtocol:K,blockQuote:a(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ie,characterReference:Xe,codeFenced:a(v),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:a(g),codeText:a(G),codeTextData:E,data:E,definition:a(),definitionDestinationString:w,definitionLabelString:x,definitionTitleString:b,emphasis:a(),hardBreakEscape:a(R),hardBreakTrailing:a(R),htmlFlow:a(Q),htmlFlowData:E,htmlText:a(q),htmlTextData:E,image:a(ee),label:H,labelText:O,lineEnding:M,link:a(z),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:we,resourceDestinationString:C,resourceTitleString:X,resource:J,setextHeading:a(T),setextHeadingLineSequence:I,setextHeadingText:k,strong:a(),thematicBreak:a()}};qv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(L){let U={type:"root",children:[]};const ne={stack:[U],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:f,data:n},he=[];let ke=-1;for(;++ke<L.length;)if(L[ke][1].type==="listOrdered"||L[ke][1].type==="listUnordered")if(L[ke][0]==="enter")he.push(ke);else{const on=he.pop();ke=s(L,on,ke)}for(ke=-1;++ke<L.length;){const on=t[L[ke][0]];Gv.call(on,L[ke][1].type)&&on[L[ke][1].type].call(Object.assign({sliceSerialize:L[ke][2].sliceSerialize},ne),L[ke][1])}if(ne.tokenStack.length>0){const on=ne.tokenStack[ne.tokenStack.length-1];(on[1]||Sx).call(ne,void 0,on[0])}for(U.position={start:pr(L.length>0?L[0][1].start:{line:1,column:1,offset:0}),end:pr(L.length>0?L[L.length-2][1].end:{line:1,column:1,offset:0})},ke=-1;++ke<t.transforms.length;)U=t.transforms[ke](U)||U;return U}function s(L,U,ne){let he=U-1,ke=-1,on=!1,ns,Ln,to,no;for(;++he<=ne;){const Lt=L[he];switch(Lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Lt[0]==="enter"?ke++:ke--,no=void 0;break}case"lineEndingBlank":{Lt[0]==="enter"&&(ns&&!no&&!ke&&!to&&(to=he),no=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:no=void 0}if(!ke&&Lt[0]==="enter"&&Lt[1].type==="listItemPrefix"||ke===-1&&Lt[0]==="exit"&&(Lt[1].type==="listUnordered"||Lt[1].type==="listOrdered")){if(ns){let zs=he;for(Ln=void 0;zs--;){const Mn=L[zs];if(Mn[1].type==="lineEnding"||Mn[1].type==="lineEndingBlank"){if(Mn[0]==="exit")continue;Ln&&(L[Ln][1].type="lineEndingBlank",on=!0),Mn[1].type="lineEnding",Ln=zs}else if(!(Mn[1].type==="linePrefix"||Mn[1].type==="blockQuotePrefix"||Mn[1].type==="blockQuotePrefixWhitespace"||Mn[1].type==="blockQuoteMarker"||Mn[1].type==="listItemIndent"))break}to&&(!Ln||to<Ln)&&(ns._spread=!0),ns.end=Object.assign({},Ln?L[Ln][1].start:Lt[1].end),L.splice(Ln||he,0,["exit",ns,Lt[2]]),he++,ne++}if(Lt[1].type==="listItemPrefix"){const zs={type:"listItem",_spread:!1,start:Object.assign({},Lt[1].start),end:void 0};ns=zs,L.splice(he,0,["enter",zs,Lt[2]]),he++,ne++,to=void 0,no=!0}}}return L[U][1]._spread=on,ne}function i(L,U){return ne;function ne(he){l.call(this,L(he),he),U&&U.call(this,he)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(L,U,ne){this.stack[this.stack.length-1].children.push(L),this.stack.push(L),this.tokenStack.push([U,ne||void 0]),L.position={start:pr(U.start),end:void 0}}function a(L){return U;function U(ne){L&&L.call(this,ne),u.call(this,ne)}}function u(L,U){const ne=this.stack.pop(),he=this.tokenStack.pop();if(he)he[0].type!==L.type&&(U?U.call(this,L,he[0]):(he[1]||Sx).call(this,L,he[0]));else throw new Error("Cannot close `"+L.type+"` ("+Do({start:L.start,end:L.end})+"): it’s not open");ne.position.end=pr(L.end)}function f(){return Wp(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(L){if(this.data.expectingFirstListItemValue){const U=this.stack[this.stack.length-2];U.start=Number.parseInt(this.sliceSerialize(L),10),this.data.expectingFirstListItemValue=void 0}}function p(){const L=this.resume(),U=this.stack[this.stack.length-1];U.lang=L}function m(){const L=this.resume(),U=this.stack[this.stack.length-1];U.meta=L}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const L=this.resume(),U=this.stack[this.stack.length-1];U.value=L.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const L=this.resume(),U=this.stack[this.stack.length-1];U.value=L.replace(/(\r?\n|\r)$/g,"")}function x(L){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.label=U,ne.identifier=mn(this.sliceSerialize(L)).toLowerCase()}function b(){const L=this.resume(),U=this.stack[this.stack.length-1];U.title=L}function w(){const L=this.resume(),U=this.stack[this.stack.length-1];U.url=L}function N(L){const U=this.stack[this.stack.length-1];if(!U.depth){const ne=this.sliceSerialize(L).length;U.depth=ne}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function I(L){const U=this.stack[this.stack.length-1];U.depth=this.sliceSerialize(L).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function P(L){const ne=this.stack[this.stack.length-1].children;let he=ne[ne.length-1];(!he||he.type!=="text")&&(he=Vk(),he.position={start:pr(L.start),end:void 0},ne.push(he)),this.stack.push(he)}function E(L){const U=this.stack.pop();U.value+=this.sliceSerialize(L),U.position.end=pr(L.end)}function M(L){const U=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ne=U.children[U.children.length-1];ne.position.end=pr(L.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(U.type)&&(P.call(this,L),E.call(this,L))}function R(){this.data.atHardBreak=!0}function Q(){const L=this.resume(),U=this.stack[this.stack.length-1];U.value=L}function q(){const L=this.resume(),U=this.stack[this.stack.length-1];U.value=L}function G(){const L=this.resume(),U=this.stack[this.stack.length-1];U.value=L}function z(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=U,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function ee(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=U,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function O(L){const U=this.sliceSerialize(L),ne=this.stack[this.stack.length-2];ne.label=jT(U),ne.identifier=mn(U).toLowerCase()}function H(){const L=this.stack[this.stack.length-1],U=this.resume(),ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,ne.type==="link"){const he=L.children;ne.children=he}else ne.alt=U}function C(){const L=this.resume(),U=this.stack[this.stack.length-1];U.url=L}function X(){const L=this.resume(),U=this.stack[this.stack.length-1];U.title=L}function J(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function we(L){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.label=U,ne.identifier=mn(this.sliceSerialize(L)).toLowerCase(),this.data.referenceType="full"}function te(L){this.data.characterReferenceType=L.type}function ie(L){const U=this.sliceSerialize(L),ne=this.data.characterReferenceType;let he;ne?(he=Lv(U,ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):he=Vp(U);const ke=this.stack[this.stack.length-1];ke.value+=he}function Xe(L){const U=this.stack.pop();U.position.end=pr(L.end)}function K(L){E.call(this,L);const U=this.stack[this.stack.length-1];U.url=this.sliceSerialize(L)}function ye(L){E.call(this,L);const U=this.stack[this.stack.length-1];U.url="mailto:"+this.sliceSerialize(L)}function qt(){return{type:"blockquote",children:[]}}function cr(){return{type:"code",lang:null,meta:null,value:""}}function Rn(){return{type:"inlineCode",value:""}}function ts(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Zi(){return{type:"emphasis",children:[]}}function ue(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function Ue(){return{type:"html",value:""}}function Ct(){return{type:"image",title:null,url:"",alt:null}}function st(){return{type:"link",title:null,url:"",children:[]}}function eo(L){return{type:"list",ordered:L.type==="listOrdered",start:null,spread:L._spread,children:[]}}function Gl(L){return{type:"listItem",spread:L._spread,checked:null,children:[]}}function ql(){return{type:"paragraph",children:[]}}function Ic(){return{type:"strong",children:[]}}function Vk(){return{type:"text",value:""}}function Qk(){return{type:"thematicBreak"}}}function pr(e){return{line:e.line,column:e.column,offset:e.offset}}function qv(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?qv(e,r):AT(e,r)}}function AT(e,t){let n;for(n in t)if(Gv.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 Sx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Do({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Do({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Do({start:t.start,end:t.end})+") is still open")}function RT(e){const t=this;t.parser=n;function n(r){return TT(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function LT(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 MT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
275
|
+
`}]}function OT(e,t){const n=t.value?t.value+`
|
|
276
|
+
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function DT(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FT(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $T(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Xi(r.toLowerCase()),i=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=i+1,l+=1,e.footnoteCounts.set(r,l);const a={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(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 zT(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 BT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Wv(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 s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function UT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wv(e,t);const s={src:Xi(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function HT(e,t){const n={src:Xi(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 GT(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 qT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wv(e,t);const s={href:Xi(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function WT(e,t){const n={href:Xi(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 VT(e,t,n){const r=e.all(t),s=n?QT(n):Vv(t),i={},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:[]}),i.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const f=r[l];(s||l!==0||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
|
|
277
|
+
`}),f.type==="element"&&f.tagName==="p"&&!s?o.push(...f.children):o.push(f)}const a=r[r.length-1];a&&(s||a.type!=="element"||a.tagName!=="p")&&o.push({type:"text",value:`
|
|
278
|
+
`});const u={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,u),e.applyData(t,u)}function QT(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=Vv(n[r])}return t}function Vv(e){const t=e.spread;return t??e.children.length>1}function KT(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const o=r[s];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 i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function XT(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YT(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function JT(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZT(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Up(t.children[1]),a=Nv(t.children[t.children.length-1]);l&&a&&(o.position={start:l,end:a}),s.push(o)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function eP(e,t,n){const r=n?n.children:void 0,i=(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:i,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 tP(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Cx=9,_x=32;function nP(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(Nx(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(Nx(t.slice(s),s>0,!1)),i.join("")}function Nx(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===Cx||i===_x;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===Cx||i===_x;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function rP(e,t){const n={type:"text",value:nP(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function sP(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const iP={blockquote:LT,break:MT,code:OT,delete:DT,emphasis:FT,footnoteReference:$T,heading:zT,html:BT,imageReference:UT,image:HT,inlineCode:GT,linkReference:qT,link:WT,listItem:VT,list:KT,paragraph:XT,root:YT,strong:JT,table:ZT,tableCell:tP,tableRow:eP,text:rP,thematicBreak:sP,toml:ha,yaml:ha,definition:ha,footnoteDefinition:ha};function ha(){}const Qv=-1,hc=0,$o=1,Cu=2,Kp=3,Xp=4,Yp=5,Jp=6,Kv=7,Xv=8,oP=typeof self=="object"?self:globalThis,Ex=(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 oP[e](t)},lP=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,o]=t[s];switch(i){case hc:case Qv:return n(o,s);case $o:{const l=n([],s);for(const a of o)l.push(r(a));return l}case Cu:{const l=n({},s);for(const[a,u]of o)l[r(a)]=r(u);return l}case Kp:return n(new Date(o),s);case Xp:{const{source:l,flags:a}=o;return n(new RegExp(l,a),s)}case Yp:{const l=n(new Map,s);for(const[a,u]of o)l.set(r(a),r(u));return l}case Jp:{const l=n(new Set,s);for(const a of o)l.add(r(a));return l}case Kv:{const{name:l,message:a}=o;return n(Ex(l,a),s)}case Xv:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);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(Ex(i,o),s)};return r},jx=e=>lP(new Map,e)(0),Hs="",{toString:aP}={},{keys:uP}=Object,mo=e=>{const t=typeof e;if(t!=="object"||!e)return[hc,t];const n=aP.call(e).slice(8,-1);switch(n){case"Array":return[$o,Hs];case"Object":return[Cu,Hs];case"Date":return[Kp,Hs];case"RegExp":return[Xp,Hs];case"Map":return[Yp,Hs];case"Set":return[Jp,Hs];case"DataView":return[$o,n]}return n.includes("Array")?[$o,n]:n.includes("Error")?[Kv,n]:[Cu,n]},pa=([e,t])=>e===hc&&(t==="function"||t==="symbol"),cP=(e,t,n,r)=>{const s=(o,l)=>{const a=r.push(o)-1;return n.set(l,a),a},i=o=>{if(n.has(o))return n.get(o);let[l,a]=mo(o);switch(l){case hc:{let f=o;switch(a){case"bigint":l=Xv,f=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);f=null;break;case"undefined":return s([Qv],o)}return s([l,f],o)}case $o:{if(a){let h=o;return a==="DataView"?h=new Uint8Array(o.buffer):a==="ArrayBuffer"&&(h=new Uint8Array(o)),s([a,[...h]],o)}const f=[],d=s([l,f],o);for(const h of o)f.push(i(h));return d}case Cu:{if(a)switch(a){case"BigInt":return s([a,o.toString()],o);case"Boolean":case"Number":case"String":return s([a,o.valueOf()],o)}if(t&&"toJSON"in o)return i(o.toJSON());const f=[],d=s([l,f],o);for(const h of uP(o))(e||!pa(mo(o[h])))&&f.push([i(h),i(o[h])]);return d}case Kp:return s([l,o.toISOString()],o);case Xp:{const{source:f,flags:d}=o;return s([l,{source:f,flags:d}],o)}case Yp:{const f=[],d=s([l,f],o);for(const[h,p]of o)(e||!(pa(mo(h))||pa(mo(p))))&&f.push([i(h),i(p)]);return d}case Jp:{const f=[],d=s([l,f],o);for(const h of o)(e||!pa(mo(h)))&&f.push(i(h));return d}}const{message:u}=o;return s([l,{name:a,message:u}],o)};return i},Ix=(e,{json:t,lossy:n}={})=>{const r=[];return cP(!(t||n),!!t,new Map,r)(e),r},_u=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?jx(Ix(e,t)):structuredClone(e):(e,t)=>jx(Ix(e,t));function dP(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 hP(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||dP,r=e.options.footnoteBackLabel||fP,s=e.options.footnoteLabel||"Footnotes",i=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=Xi(d.toLowerCase());let p=0;const m=[],y=e.footnoteCounts.get(d);for(;y!==void 0&&++p<=y;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(a,p);typeof x=="string"&&(x={type:"text",value:x}),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(x)?x:[x]})}const v=f[f.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.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:i,properties:{..._u(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
279
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
280
|
+
`}]}}const pc=function(e){if(e==null)return xP;if(typeof e=="function")return mc(e);if(typeof e=="object")return Array.isArray(e)?pP(e):mP(e);if(typeof e=="string")return gP(e);throw new Error("Expected function, string, or object as test")};function pP(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=pc(e[n]);return mc(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function mP(e){const t=e;return mc(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function gP(e){return mc(t);function t(n){return n&&n.type===e}}function mc(e){return t;function t(n,r,s){return!!(yP(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function xP(){return!0}function yP(e){return e!==null&&typeof e=="object"&&"type"in e}const Yv=[],bP=!0,fh=!1,vP="skip";function Jv(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=pc(s),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=Yv,m,y,v;if((!t||i(a,u,f[f.length-1]||void 0))&&(p=wP(n(a,f)),p[0]===fh))return p;if("children"in a&&a.children){const g=a;if(g.children&&p[0]!==vP)for(y=(r?g.children.length:-1)+o,v=f.concat(g);y>-1&&y<g.children.length;){const x=g.children[y];if(m=l(x,y,v)(),m[0]===fh)return m;y=typeof m[1]=="number"?m[1]:y+o}}return p}}}function wP(e){return Array.isArray(e)?e:typeof e=="number"?[bP,e]:e==null?Yv:[e]}function Zp(e,t,n,r){let s,i,o;typeof t=="function"&&typeof n!="function"?(i=void 0,o=t,s=n):(i=t,o=n,s=r),Jv(e,i,l,s);function l(a,u){const f=u[u.length-1],d=f?f.children.indexOf(a):void 0;return o(a,d,f)}}const hh={}.hasOwnProperty,kP={};function SP(e,t){const n=t||kP,r=new Map,s=new Map,i=new Map,o={...iP,...n.handlers},l={all:u,applyData:_P,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:a,options:n,patch:CP,wrap:EP};return Zp(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const d=f.type==="definition"?r:s,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(hh.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:y,...v}=f,g=_u(v);return g.children=l.all(f),g}return _u(f)}return(l.options.unknownHandler||NP)(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=Tx(m.value)),!Array.isArray(m)&&m.type==="element")){const y=m.children[0];y&&y.type==="text"&&(y.value=Tx(y.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function CP(e,t){e.position&&(t.position=d2(e))}function _P(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,i=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"&&i&&Object.assign(n.properties,_u(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function NP(e,t){const n=t.data||{},r="value"in t&&!(hh.call(n,"hProperties")||hh.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 EP(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
281
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
282
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
283
|
+
`}),n}function Tx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Px(e,t){const n=SP(e,t),r=n.one(e,void 0),s=hP(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
|
284
|
+
`},s),i}function jP(e,t){return e&&"run"in e?async function(n,r){const s=Px(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Px(n,{file:r,...e||t})}}function Ax(e){if(e)throw e}var $a=Object.prototype.hasOwnProperty,Zv=Object.prototype.toString,Rx=Object.defineProperty,Lx=Object.getOwnPropertyDescriptor,Mx=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Zv.call(t)==="[object Array]"},Ox=function(t){if(!t||Zv.call(t)!=="[object Object]")return!1;var n=$a.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&$a.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||$a.call(t,s)},Dx=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},Fx=function(t,n){if(n==="__proto__")if($a.call(t,n)){if(Lx)return Lx(t,n).value}else return;return t[n]},IP=function e(){var t,n,r,s,i,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=Fx(l,n),s=Fx(t,n),l!==s&&(f&&s&&(Ox(s)||(i=Mx(s)))?(i?(i=!1,o=r&&Mx(r)?r:[]):o=r&&Ox(r)?r:{},Dx(l,{name:n,newValue:e(f,o,s)})):typeof s<"u"&&Dx(l,{name:n,newValue:s}));return l};const ad=Lh(IP);function ph(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 TP(){const e=[],t={run:n,use:r};return t;function n(...s){let i=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...s);function l(a,...u){const f=e[++i];let d=-1;if(a){o(a);return}for(;++d<s.length;)(u[d]===null||u[d]===void 0)&&(u[d]=s[d]);s=u,f?PP(f,l)(...u):o(null,...u)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function PP(e,t){let n;return r;function r(...o){const l=e.length>o.length;let a;l&&o.push(s);try{a=e.apply(this,o)}catch(u){const f=u;if(l&&n)throw f;return s(f)}l||(a&&a.then&&typeof a.then=="function"?a.then(i,s):a instanceof Error?s(a):i(a))}function s(o,...l){n||(n=!0,t(o,...l))}function i(o){s(null,o)}}const Sn={basename:AP,dirname:RP,extname:LP,join:MP,sep:"/"};function AP(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fl(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else o<0&&(i=!0,o=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function RP(e){if(Fl(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 LP(e){Fl(e);let t=e.length,n=-1,r=0,s=-1,i=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?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function MP(...e){let t=-1,n;for(;++t<e.length;)Fl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":OP(n)}function OP(e){Fl(e);const t=e.codePointAt(0)===47;let n=DP(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function DP(e,t){let n="",r=0,s=-1,i=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(!(s===o-1||i===1))if(s!==o-1&&i===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("/")),s=o,i=0;continue}}else if(n.length>0){n="",r=0,s=o,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,i=0}else l===46&&i>-1?i++:i=-1}return n}function Fl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const FP={cwd:$P};function $P(){return"/"}function mh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function zP(e){if(typeof e=="string")e=new URL(e);else if(!mh(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 BP(e)}function BP(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const ud=["history","path","basename","stem","extname","dirname"];class ew{constructor(t){let n;t?mh(t)?n={path:t}:typeof t=="string"||UP(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":FP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ud.length;){const i=ud[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)ud.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Sn.basename(this.path):void 0}set basename(t){dd(t,"basename"),cd(t,"basename"),this.path=Sn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Sn.dirname(this.path):void 0}set dirname(t){$x(this.basename,"dirname"),this.path=Sn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Sn.extname(this.path):void 0}set extname(t){if(cd(t,"extname"),$x(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=Sn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){mh(t)&&(t=zP(t)),dd(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Sn.basename(this.path,this.extname):void 0}set stem(t){dd(t,"stem"),cd(t,"stem"),this.path=Sn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new pt(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function cd(e,t){if(e&&e.includes(Sn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Sn.sep+"`")}function dd(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function $x(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function UP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const HP=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},GP={}.hasOwnProperty;class em extends HP{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=TP()}copy(){const t=new em;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ad(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(pd("data",this.frozen),this.namespace[t]=n,this):GP.call(this.namespace,t)&&this.namespace[t]||void 0:t?(pd("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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ma(t),r=this.parser||this.Parser;return fd("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),fd("process",this.parser||this.Parser),hd("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const l=ma(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);VP(m)?h.value=m:h.result=m,u(f,h)});function u(f,d){f||!d?o(f):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),fd("processSync",this.parser||this.Parser),hd("processSync",this.compiler||this.Compiler),this.process(t,s),Bx("processSync","process",n),r;function s(i,o){n=!0,Ax(i),r=o}}run(t,n,r){zx(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(o,l){const a=ma(n);s.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,s;return this.run(t,n,i),Bx("runSync","run",r),s;function i(o,l){Ax(o),s=l,r=!0}}stringify(t,n){this.freeze();const r=ma(n),s=this.compiler||this.Compiler;return hd("stringify",s),zx(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(pd("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 i(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&&(s.settings=ad(!0,s.settings,u.settings))}function l(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const d=u[f];i(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 y=r[h][1];ph(y)&&ph(p)&&(p=ad(!0,y,p)),r[h]=[u,p,...m]}}}}const qP=new em().freeze();function fd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hd(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pd(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 zx(e){if(!ph(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Bx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ma(e){return WP(e)?e:new ew(e)}function WP(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function VP(e){return typeof e=="string"||QP(e)}function QP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const KP="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ux=[],Hx={allowDangerousHtml:!0},XP=/^(https?|ircs?|mailto|xmpp)$/i,YP=[{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 JP(e){const t=ZP(e),n=eA(e);return tA(t.runSync(t.parse(n),n),e)}function ZP(e){const t=e.rehypePlugins||Ux,n=e.remarkPlugins||Ux,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Hx}:Hx;return qP().use(RT).use(n).use(jP,r).use(t)}function eA(e){const t=e.children||"",n=new ew;return typeof t=="string"&&(n.value=t),n}function tA(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,a=t.urlTransform||nA;for(const f of YP)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+KP+f.id,void 0);return Zp(e,u),g2(e,{Fragment:c.Fragment,components:s,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 id)if(Object.hasOwn(id,p)&&Object.hasOwn(f.properties,p)){const m=f.properties[p],y=id[p];(y===null||y.includes(f.tagName))&&(f.properties[p]=a(String(m||""),p,f))}}if(f.type==="element"){let p=n?!n.includes(f.tagName):i?i.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 nA(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||XP.test(e.slice(0,t))?e:""}function Nu(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function rA(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function sA(e,t,n){const s=pc((n||{}).ignore||[]),i=iA(t);let o=-1;for(;++o<i.length;)Jv(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(s(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=i[o][0],p=i[o][1];let m=0;const v=d.children.indexOf(u);let g=!1,x=[];h.lastIndex=0;let b=h.exec(u.value);for(;b;){const w=b.index,N={index:b.index,input:b.input,stack:[...f,u]};let k=p(...b,N);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?h.lastIndex=w+1:(m!==w&&x.push({type:"text",value:u.value.slice(m,w)}),Array.isArray(k)?x.push(...k):k&&x.push(k),m=w+b[0].length,g=!0),!h.global)break;b=h.exec(u.value)}return g?(m<u.value.length&&x.push({type:"text",value:u.value.slice(m)}),d.children.splice(v,1,...x)):x=[u],v+x.length}}function iA(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 s=n[r];t.push([oA(s[0]),lA(s[1])])}return t}function oA(e){return typeof e=="string"?new RegExp(rA(e),"g"):e}function lA(e){return typeof e=="function"?e:function(){return e}}const md="phrasing",gd=["autolink","link","image","label"];function aA(){return{transforms:[mA],enter:{literalAutolink:cA,literalAutolinkEmail:xd,literalAutolinkHttp:xd,literalAutolinkWww:xd},exit:{literalAutolink:pA,literalAutolinkEmail:hA,literalAutolinkHttp:dA,literalAutolinkWww:fA}}}function uA(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:md,notInConstruct:gd},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:md,notInConstruct:gd},{character:":",before:"[ps]",after:"\\/",inConstruct:md,notInConstruct:gd}]}}function cA(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xd(e){this.config.enter.autolinkProtocol.call(this,e)}function dA(e){this.config.exit.autolinkProtocol.call(this,e)}function fA(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 hA(e){this.config.exit.autolinkEmail.call(this,e)}function pA(e){this.exit(e)}function mA(e){sA(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,gA],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),xA]],{ignore:["link","linkReference"]})}function gA(e,t,n,r,s){let i="";if(!tw(s)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!yA(n)))return!1;const o=bA(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:i+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function xA(e,t,n,r){return!tw(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function yA(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 bA(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 s=Nu(e,"(");let i=Nu(e,")");for(;r!==-1&&s>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function tw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ls(n)||dc(n))&&(!t||n!==47)}nw.peek=jA;function vA(){this.buffer()}function wA(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function kA(){this.buffer()}function SA(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function CA(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _A(e){this.exit(e)}function NA(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function EA(e){this.exit(e)}function jA(){return"["}function nw(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),l(),o(),i+=s.move("]"),i}function IA(){return{enter:{gfmFootnoteCallString:vA,gfmFootnoteCall:wA,gfmFootnoteDefinitionLabelString:kA,gfmFootnoteDefinition:SA},exit:{gfmFootnoteCallString:CA,gfmFootnoteCall:_A,gfmFootnoteDefinitionLabelString:NA,gfmFootnoteDefinition:EA}}}function TA(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:nw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,o){const l=i.createTracker(o);let a=l.move("[^");const u=i.enter("footnoteDefinition"),f=i.enter("label");return a+=l.move(i.safe(i.associationId(r),{before:a,after:"]"})),f(),a+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),a+=l.move((t?`
|
|
285
|
+
`:" ")+i.indentLines(i.containerFlow(r,l.current()),t?rw:PA))),u(),a}}function PA(e,t,n){return t===0?e:rw(e,t,n)}function rw(e,t,n){return(n?"":" ")+e}const AA=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];sw.peek=DA;function RA(){return{canContainEols:["delete"],enter:{strikethrough:MA},exit:{strikethrough:OA}}}function LA(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:AA}],handlers:{delete:sw}}}function MA(e){this.enter({type:"delete",children:[]},e)}function OA(e){this.exit(e)}function sw(e,t,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),i(),o}function DA(){return"~"}function FA(e){return e.length}function $A(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||FA,i=[],o=[],l=[],a=[];let u=0,f=-1;for(;++f<e.length;){const y=[],v=[];let g=-1;for(e[f].length>u&&(u=e[f].length);++g<e[f].length;){const x=zA(e[f][g]);if(n.alignDelimiters!==!1){const b=s(x);v[g]=b,(a[g]===void 0||b>a[g])&&(a[g]=b)}y.push(x)}o[f]=y,l[f]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<u;)i[d]=Gx(r[d]);else{const y=Gx(r);for(;++d<u;)i[d]=y}d=-1;const h=[],p=[];for(;++d<u;){const y=i[d];let v="",g="";y===99?(v=":",g=":"):y===108?v=":":y===114&&(g=":");let x=n.alignDelimiters===!1?1:Math.max(1,a[d]-v.length-g.length);const b=v+"-".repeat(x)+g;n.alignDelimiters!==!1&&(x=v.length+x+g.length,x>a[d]&&(a[d]=x),p[d]=x),h[d]=b}o.splice(1,0,h),l.splice(1,0,p),f=-1;const m=[];for(;++f<o.length;){const y=o[f],v=l[f];d=-1;const g=[];for(;++d<u;){const x=y[d]||"";let b="",w="";if(n.alignDelimiters!==!1){const N=a[d]-(v[d]||0),k=i[d];k===114?b=" ".repeat(N):k===99?N%2?(b=" ".repeat(N/2+.5),w=" ".repeat(N/2-.5)):(b=" ".repeat(N/2),w=b):w=" ".repeat(N)}n.delimiterStart!==!1&&!d&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&g.push(" "),n.alignDelimiters!==!1&&g.push(b),g.push(x),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(`
|
|
286
|
+
`)}function zA(e){return e==null?"":String(e)}function Gx(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 qx={}.hasOwnProperty;function BA(e,t){const n=t||{};function r(s,...i){let o=r.invalid;const l=r.handlers;if(s&&qx.call(s,e)){const a=String(s[e]);o=qx.call(l,a)?l[a]:r.unknown}if(o)return o.call(this,s,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function UA(e,t,n,r){const s=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const o=n.indentLines(n.containerFlow(e,i.current()),HA);return s(),o}function HA(e,t,n){return">"+(n?"":" ")+e}function GA(e,t){return Wx(e,t.inConstruct,!0)&&!Wx(e,t.notInConstruct,!1)}function Wx(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 Vx(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
287
|
+
`&&GA(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
288
|
+
`}function qA(e,t){const n=String(e);let r=n.indexOf(t),s=r,i=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++i>o&&(o=i):i=1,s=r+t.length,r=n.indexOf(t,s);return o}function WA(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 VA(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 QA(e,t,n,r){const s=VA(n),i=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(WA(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(i,KA);return d(),h}const l=n.createTracker(r),a=s.repeat(Math.max(qA(i,s)+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:`
|
|
289
|
+
`,encode:["`"],...l.current()})),d()}return f+=l.move(`
|
|
290
|
+
`),i&&(f+=l.move(i+`
|
|
291
|
+
`)),f+=l.move(a),u(),f}function KA(e,t,n){return(n?"":" ")+e}function tm(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 XA(e,t,n,r){const s=tm(n),i=s==='"'?"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?" ":`
|
|
292
|
+
`,...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(n.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),o(),u}function YA(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 dl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Eu(e,t,n){const r=Fi(e),s=Fi(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}iw.peek=JA;function iw(e,t,n,r){const s=YA(n),i=n.enter("emphasis"),o=n.createTracker(r),l=o.move(s);let a=o.move(n.containerPhrasing(e,{after:s,before:l,...o.current()}));const u=a.charCodeAt(0),f=Eu(r.before.charCodeAt(r.before.length-1),u,s);f.inside&&(a=dl(u)+a.slice(1));const d=a.charCodeAt(a.length-1),h=Eu(r.after.charCodeAt(0),d,s);h.inside&&(a=a.slice(0,-1)+dl(d));const p=o.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},l+a+p}function JA(e,t,n){return n.options.emphasis||"*"}function ZA(e,t){let n=!1;return Zp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,fh}),!!((!e.depth||e.depth<3)&&Wp(e)&&(t.options.setext||n))}function eR(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(ZA(e,n)){const f=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...i.current(),before:`
|
|
293
|
+
`,after:`
|
|
294
|
+
`});return d(),f(),h+`
|
|
295
|
+
`+(s===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
296
|
+
`))+1))}const o="#".repeat(s),l=n.enter("headingAtx"),a=n.enter("phrasing");i.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
297
|
+
`,...i.current()});return/^[\t ]/.test(u)&&(u=dl(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),a(),l(),u}ow.peek=tR;function ow(e){return e.value||""}function tR(){return"<"}lw.peek=nR;function lw(e,t,n,r){const s=tm(n),i=s==='"'?"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${i}`),u+=a.move(" "+s),u+=a.move(n.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function nR(){return"!"}aw.peek=rR;function aw(e,t,n,r){const s=e.referenceType,i=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,i(),s==="full"||!u||u!==d?a+=l.move(d+"]"):s==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function rR(){return"!"}uw.peek=sR;function uw(e,t,n){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const o=n.unsafe[i],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 s+r+s}function sR(){return"`"}function cw(e,t){const n=Wp(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))}dw.peek=iR;function dw(e,t,n,r){const s=tm(n),i=s==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,a;if(cw(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${i}`),u+=o.move(" "+s),u+=o.move(n.safe(e.title,{before:u,after:s,...o.current()})),u+=o.move(s),a()),u+=o.move(")"),l(),u}function iR(e,t,n){return cw(e,n)?"<":"["}fw.peek=oR;function fw(e,t,n,r){const s=e.referenceType,i=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,i(),s==="full"||!u||u!==d?a+=l.move(d+"]"):s==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function oR(){return"["}function nm(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 lR(e){const t=nm(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 aR(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 hw(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 uR(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let o=e.ordered?aR(n):nm(n);const l=e.ordered?o==="."?")":".":lR(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),hw(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=i,s(),u}function cR(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 dR(e,t,n,r){const s=cR(n);let i=n.bulletCurrent||nm(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let o=i.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(i+" ".repeat(o-i.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?i:i+" ".repeat(o-i.length))+d}}function fR(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),o=n.containerPhrasing(e,r);return i(),s(),o}const hR=pc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function pR(e,t,n,r){return(e.children.some(function(o){return hR(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function mR(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}pw.peek=gR;function pw(e,t,n,r){const s=mR(n),i=n.enter("strong"),o=n.createTracker(r),l=o.move(s+s);let a=o.move(n.containerPhrasing(e,{after:s,before:l,...o.current()}));const u=a.charCodeAt(0),f=Eu(r.before.charCodeAt(r.before.length-1),u,s);f.inside&&(a=dl(u)+a.slice(1));const d=a.charCodeAt(a.length-1),h=Eu(r.after.charCodeAt(0),d,s);h.inside&&(a=a.slice(0,-1)+dl(d));const p=o.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},l+a+p}function gR(e,t,n){return n.options.strong||"*"}function xR(e,t,n,r){return n.safe(e.value,r)}function yR(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 bR(e,t,n){const r=(hw(n)+(n.options.ruleSpaces?" ":"")).repeat(yR(n));return n.options.ruleSpaces?r.slice(0,-1):r}const mw={blockquote:UA,break:Vx,code:QA,definition:XA,emphasis:iw,hardBreak:Vx,heading:eR,html:ow,image:lw,imageReference:aw,inlineCode:uw,link:dw,linkReference:fw,list:uR,listItem:dR,paragraph:fR,root:pR,strong:pw,text:xR,thematicBreak:bR};function vR(){return{enter:{table:wR,tableData:Qx,tableHeader:Qx,tableRow:SR},exit:{codeText:CR,table:kR,tableData:yd,tableHeader:yd,tableRow:yd}}}function wR(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 kR(e){this.exit(e),this.data.inTable=void 0}function SR(e){this.enter({type:"tableRow",children:[]},e)}function yd(e){this.exit(e)}function Qx(e){this.enter({type:"tableCell",children:[]},e)}function CR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_R));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function _R(e,t){return t==="|"?t:e}function NR(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
298
|
+
`,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,y,v){return u(f(p,y,v),p.align)}function l(p,m,y,v){const g=d(p,y,v),x=u([g]);return x.slice(0,x.indexOf(`
|
|
299
|
+
`))}function a(p,m,y,v){const g=y.enter("tableCell"),x=y.enter("phrasing"),b=y.containerPhrasing(p,{...v,before:i,after:i});return x(),g(),b}function u(p,m){return $A(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function f(p,m,y){const v=p.children;let g=-1;const x=[],b=m.enter("table");for(;++g<v.length;)x[g]=d(v[g],m,y);return b(),x}function d(p,m,y){const v=p.children;let g=-1;const x=[],b=m.enter("tableRow");for(;++g<v.length;)x[g]=a(v[g],p,m,y);return b(),x}function h(p,m,y){let v=mw.inlineCode(p,m,y);return y.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function ER(){return{exit:{taskListCheckValueChecked:Kx,taskListCheckValueUnchecked:Kx,paragraph:IR}}}function jR(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:TR}}}function Kx(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function IR(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 s=t.children;let i=-1,o;for(;++i<s.length;){const l=s[i];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 TR(e,t,n,r){const s=e.children[0],i=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);i&&l.move(o);let a=mw.listItem(e,t,n,{...r,...l.current()});return i&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),a;function u(f){return f+o}}function PR(){return[aA(),IA(),RA(),vR(),ER()]}function AR(e){return{extensions:[uA(),TA(e),LA(),NR(e),jR()]}}const RR={tokenize:$R,partial:!0},gw={tokenize:zR,partial:!0},xw={tokenize:BR,partial:!0},yw={tokenize:UR,partial:!0},LR={tokenize:HR,partial:!0},bw={name:"wwwAutolink",tokenize:DR,previous:ww},vw={name:"protocolAutolink",tokenize:FR,previous:kw},ur={name:"emailAutolink",tokenize:OR,previous:Sw},An={};function MR(){return{text:An}}let rs=48;for(;rs<123;)An[rs]=ur,rs++,rs===58?rs=65:rs===91&&(rs=97);An[43]=ur;An[45]=ur;An[46]=ur;An[95]=ur;An[72]=[ur,vw];An[104]=[ur,vw];An[87]=[ur,bw];An[119]=[ur,bw];function OR(e,t,n){const r=this;let s,i;return o;function o(d){return!gh(d)||!Sw.call(r,r.previous)||rm(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return gh(d)?(e.consume(d),l):d===64?(e.consume(d),a):n(d)}function a(d){return d===46?e.check(LR,f,u)(d):d===45||d===95||dt(d)?(i=!0,e.consume(d),a):f(d)}function u(d){return e.consume(d),s=!0,a}function f(d){return i&&s&&bt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function DR(e,t,n){const r=this;return s;function s(o){return o!==87&&o!==119||!ww.call(r,r.previous)||rm(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(RR,e.attempt(gw,e.attempt(xw,i),n),n)(o))}function i(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function FR(e,t,n){const r=this;let s="",i=!1;return o;function o(d){return(d===72||d===104)&&kw.call(r,r.previous)&&!rm(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(d),e.consume(d),l):n(d)}function l(d){if(bt(d)&&s.length<5)return s+=String.fromCodePoint(d),e.consume(d),l;if(d===58){const h=s.toLowerCase();if(h==="http"||h==="https")return e.consume(d),a}return n(d)}function a(d){return d===47?(e.consume(d),i?u:(i=!0,a)):n(d)}function u(d){return d===null||Su(d)||Se(d)||Ls(d)||dc(d)?n(d):e.attempt(gw,e.attempt(xw,f),n)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function $R(e,t,n){let r=0;return s;function s(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),s):o===46&&r===3?(e.consume(o),i):n(o)}function i(o){return o===null?n(o):t(o)}}function zR(e,t,n){let r,s,i;return o;function o(u){return u===46||u===95?e.check(yw,a,l)(u):u===null||Se(u)||Ls(u)||u!==45&&dc(u)?a(u):(i=!0,e.consume(u),o)}function l(u){return u===95?r=!0:(s=r,r=void 0),e.consume(u),o}function a(u){return s||r||!i?n(u):t(u)}}function BR(e,t){let n=0,r=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&r<n?i(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(yw,t,i)(o):o===null||Se(o)||Ls(o)?t(o):(e.consume(o),s)}function i(o){return o===41&&r++,e.consume(o),s}}function UR(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),i):l===93?(e.consume(l),s):l===60||l===null||Se(l)||Ls(l)?t(l):n(l)}function s(l){return l===null||l===40||l===91||Se(l)||Ls(l)?t(l):r(l)}function i(l){return bt(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):bt(l)?(e.consume(l),o):n(l)}}function HR(e,t,n){return r;function r(i){return e.consume(i),s}function s(i){return dt(i)?n(i):t(i)}}function ww(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Se(e)}function kw(e){return!bt(e)}function Sw(e){return!(e===47||gh(e))}function gh(e){return e===43||e===45||e===46||e===95||dt(e)}function rm(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 GR={tokenize:JR,partial:!0};function qR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:KR,continuation:{tokenize:XR},exit:YR}},text:{91:{name:"gfmFootnoteCall",tokenize:QR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:WR,resolveTo:VR}}}}function WR(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;s--;){const a=r.events[s][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=mn(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(a):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a))}}function VR(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)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function QR(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=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(i>999||d===93&&!o||d===null||d===91||Se(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(mn(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Se(d)||(o=!0),i++,e.consume(d),d===92?f:u}function f(d){return d===91||d===92||d===93?(e.consume(d),i++,u):u(d)}}function KR(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,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||Se(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return i=mn(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Se(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"),s.includes(i)||s.push(i),me(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function XR(e,t,n){return e.check(Dl,t,e.attempt(GR,t,n))}function YR(e){e.exit("gfmFootnoteDefinition")}function JR(e,t,n){const r=this;return me(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(i):n(i)}}function ZR(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(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&&Bt(h,h.length,0,fc(p,o.slice(u+1,a),l)),Bt(h,h.length,0,[["exit",d,l],["enter",o[a][1],l],["exit",o[a][1],l],["exit",f,l]]),Bt(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 i(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 y=Fi(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=Fi(m);return v._open=!g||g===2&&!!y,v._close=!y||y===2&&!!g,l(m)}}}class e3{constructor(){this.map=[]}add(t,n,r){t3(this,t,n,r)}consume(t){if(this.map.sort(function(i,o){return i[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 s=r.pop();for(;s;){for(const i of s)t.push(i);s=r.pop()}this.map.length=0}}function t3(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function n3(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function r3(){return{flow:{null:{name:"table",tokenize:s3,resolveAll:i3}}}}function s3(e,t,n){const r=this;let s=0,i=0,o;return l;function l(E){let M=r.events.length-1;for(;M>-1;){const q=r.events[M][1].type;if(q==="lineEnding"||q==="linePrefix")M--;else break}const R=M>-1?r.events[M][1].type:null,Q=R==="tableHead"||R==="tableRow"?k:a;return Q===k&&r.parser.lazy[r.now().line]?n(E):Q(E)}function a(E){return e.enter("tableHead"),e.enter("tableRow"),u(E)}function u(E){return E===124||(o=!0,i+=1),f(E)}function f(E){return E===null?n(E):Y(E)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),p):n(E):de(E)?me(e,f,"whitespace")(E):(i+=1,o&&(o=!1,s+=1),E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),o=!0,f):(e.enter("data"),d(E)))}function d(E){return E===null||E===124||Se(E)?(e.exit("data"),f(E)):(e.consume(E),E===92?h:d)}function h(E){return E===92||E===124?(e.consume(E),d):d(E)}function p(E){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(E):(e.enter("tableDelimiterRow"),o=!1,de(E)?me(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):m(E))}function m(E){return E===45||E===58?v(E):E===124?(o=!0,e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),y):N(E)}function y(E){return de(E)?me(e,v,"whitespace")(E):v(E)}function v(E){return E===58?(i+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),g):E===45?(i+=1,g(E)):E===null||Y(E)?w(E):N(E)}function g(E){return E===45?(e.enter("tableDelimiterFiller"),x(E)):N(E)}function x(E){return E===45?(e.consume(E),x):E===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(E))}function b(E){return de(E)?me(e,w,"whitespace")(E):w(E)}function w(E){return E===124?m(E):E===null||Y(E)?!o||s!==i?N(E):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(E)):N(E)}function N(E){return n(E)}function k(E){return e.enter("tableRow"),I(E)}function I(E){return E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),I):E===null||Y(E)?(e.exit("tableRow"),t(E)):de(E)?me(e,I,"whitespace")(E):(e.enter("data"),T(E))}function T(E){return E===null||E===124||Se(E)?(e.exit("data"),I(E)):(e.consume(E),E===92?P:T)}function P(E){return E===92||E===124?(e.consume(E),T):T(E)}}function i3(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],o=[0,0,0,0],l=!1,a=0,u,f,d;const h=new e3;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,a!==0&&(Xx(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,i=[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]])),s=m.type==="tableDelimiterRow"?2:f?3:1):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(i[1]!==0&&(o[0]=o[1],d=ga(h,t,i,s,void 0,d),i=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(o[0]=o[1],d=ga(h,t,i,s,void 0,d)),i=o,o=[i[1],n,0,0])):m.type==="tableHead"?(l=!0,a=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(a=n,i[1]!==0?(o[0]=o[1],d=ga(h,t,i,s,n,d)):o[1]!==0&&(d=ga(h,t,o,s,n,d)),s=0):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(a!==0&&Xx(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=n3(t.events,n))}return e}function ga(e,t,n,r,s,i){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(i.end=Object.assign({},Vs(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const a=Vs(t.events,n[1]);if(i={type:o,start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const u=Vs(t.events,n[2]),f=Vs(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,y=n[3]-n[2]-1;e.add(m,y,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return s!==void 0&&(i.end=Object.assign({},Vs(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function Xx(e,t,n,r,s){const i=[],o=Vs(t.events,n);s&&(s.end=Object.assign({},o),i.push(["exit",s,t])),r.end=Object.assign({},o),i.push(["exit",r,t]),e.add(n+1,0,i)}function Vs(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const o3={name:"tasklistCheck",tokenize:a3};function l3(){return{text:{91:o3}}}function a3(e,t,n){const r=this;return s;function s(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),i)}function i(a){return Se(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 Y(a)?t(a):de(a)?e.check({tokenize:u3},t,n)(a):n(a)}}function u3(e,t,n){return me(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function c3(e){return Rv([MR(),qR(),ZR(e),r3(),l3()])}const d3={};function f3(e){const t=this,n=e||d3,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(c3(n)),i.push(PR()),o.push(AR(n))}const or=Qi(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})})),h3="modulepreload",p3=function(e){return"/"+e},Yx={},Z=function(t,n,r){let s=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"));s=Promise.allSettled(n.map(a=>{if(a=p3(a),a in Yx)return;Yx[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":h3,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 i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};var Ae=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function m3(e){return sm(e)}function sm(e){return Array.isArray(e)?g3(e):e instanceof RegExp?e:typeof e=="object"?x3(e):e}function g3(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=sm(e[n]);return t}function x3(e){let t={};for(let n in e)t[n]=sm(e[n]);return t}function Cw(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function _w(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?_w(e.substring(0,e.length-1)):e.substr(~t+1)}var bd=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,xa=class{static hasCaptures(e){return e===null?!1:(bd.lastIndex=0,bd.test(e))}static replaceCaptures(e,t,n){return e.replace(bd,(r,s,i,o)=>{let l=n[parseInt(s||i,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 Nw(e,t){return e<t?-1:e>t?1:0}function Ew(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 s=0;s<n;s++){let i=Nw(e[s],t[s]);if(i!==0)return i}return 0}return n-r}function Jx(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 jw(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Iw=class{constructor(e){A(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}},ju=class{constructor(e,t,n){A(this,"_cachedMatchRoot",new Iw(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(v3(e),t)}static createFromParsedTheme(e,t){return k3(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(s=>y3(e.parent,s.parentScopes));return r?new Tw(r.fontStyle,r.foreground,r.background):null}},vd=class za{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new za(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new za(n,t[r]);return n}push(t){return new za(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 y3(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],s=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],s=!0}for(;e&&!b3(e.scopeName,r);){if(s)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function b3(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Tw=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function v3(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let s=0,i=t.length;s<i;s++){let o=t[s];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"&&Jx(o.settings.foreground)&&(u=o.settings.foreground);let f=null;typeof o.settings.background=="string"&&Jx(o.settings.background)&&(f=o.settings.background);for(let d=0,h=l.length;d<h;d++){let m=l[d].trim().split(" "),y=m[m.length-1],v=null;m.length>1&&(v=m.slice(0,m.length-1),v.reverse()),n[r++]=new w3(y,v,s,a,u,f)}}return n}var w3=class{constructor(e,t,n,r,s,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=s,this.background=i}},ct=(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))(ct||{});function k3(e,t){e.sort((a,u)=>{let f=Nw(a.scope,u.scope);return f!==0||(f=Ew(a.parentScopes,u.parentScopes),f!==0)?f:a.index-u.index});let n=0,r="#000000",s="#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&&(s=a.background)}let i=new S3(t),o=new Tw(n,i.getId(r),i.getId(s)),l=new _3(new xh(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,i.getId(f.foreground),i.getId(f.background))}return new ju(i,o,l)}var S3=class{constructor(e){A(this,"_isFrozen");A(this,"_lastColorId");A(this,"_id2color");A(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)}},C3=Object.freeze([]),xh=class Pw{constructor(t,n,r,s,i){A(this,"scopeDepth");A(this,"parentScopes");A(this,"fontStyle");A(this,"foreground");A(this,"background");this.scopeDepth=t,this.parentScopes=n||C3,this.fontStyle=r,this.foreground=s,this.background=i}clone(){return new Pw(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,s=t.length;r<s;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,s){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},_3=class yh{constructor(t,n=[],r={}){A(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,s=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=t.parentScopes.length||s>=n.parentScopes.length);){const i=n.parentScopes[s].length-t.parentScopes[r].length;if(i!==0)return i;r++,s++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),s,i;if(r===-1?(s=t,i=""):(s=t.substring(0,r),i=t.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(yh._cmpBySpecificity),n}insert(t,n,r,s,i,o){if(n===""){this._doInsertHere(t,r,s,i,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 yh(this._mainRule.clone(),xh.cloneArr(this._rulesWithParentScopes)),this._children[a]=f),f.insert(t+1,u,r,s,i,o)}_doInsertHere(t,n,r,s,i){if(n===null){this._mainRule.acceptOverwrite(t,r,s,i);return}for(let o=0,l=this._rulesWithParentScopes.length;o<l;o++){let a=this._rulesWithParentScopes[o];if(Ew(a.parentScopes,n)===0){a.acceptOverwrite(t,r,s,i);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new xh(t,n,r,s,i))}},$i=class Wt{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Wt.getLanguageId(t),r=Wt.getTokenType(t),s=Wt.getFontStyle(t),i=Wt.getForeground(t),o=Wt.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:i,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,s,i,o,l){let a=Wt.getLanguageId(t),u=Wt.getTokenType(t),f=Wt.containsBalancedBrackets(t)?1:0,d=Wt.getFontStyle(t),h=Wt.getForeground(t),p=Wt.getBackground(t);return n!==0&&(a=n),r!==8&&(u=r),s!==null&&(f=s?1:0),i!==-1&&(d=i),o!==0&&(h=o),l!==0&&(p=l),(a<<0|u<<8|f<<10|d<<11|h<<15|p<<24)>>>0}};function Iu(e,t){const n=[],r=N3(e);let s=r.next();for(;s!==null;){let a=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let u=o();if(n.push({matcher:u,priority:a}),s!==",")break;s=r.next()}return n;function i(){if(s==="-"){s=r.next();const a=i();return u=>!!a&&!a(u)}if(s==="("){s=r.next();const a=l();return s===")"&&(s=r.next()),a}if(Zx(s)){const a=[];do a.push(s),s=r.next();while(Zx(s));return u=>t(a,u)}return null}function o(){const a=[];let u=i();for(;u;)a.push(u),u=i();return f=>a.every(d=>d(f))}function l(){const a=[];let u=o();for(;u&&(a.push(u),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");u=o()}return f=>a.some(d=>d(f))}}function Zx(e){return!!e&&!!e.match(/[\w\.:]+/)}function N3(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 Aw(e){typeof e.dispose=="function"&&e.dispose()}var fl=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},E3=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},j3=class{constructor(){A(this,"_references",[]);A(this,"_seenReferenceKeys",new Set);A(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))}},I3=class{constructor(e,t){A(this,"seenFullScopeRequests",new Set);A(this,"seenPartialScopeRequests",new Set);A(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new fl(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new j3;for(const n of e)T3(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof fl){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 T3(e,t,n,r){const s=n.lookup(e.scopeName);if(!s){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const i=n.lookup(t);e instanceof fl?Ba({baseGrammar:i,selfGrammar:s},r):bh(e.ruleName,{baseGrammar:i,selfGrammar:s,repository:s.repository},r);const o=n.injections(e.scopeName);if(o)for(const l of o)r.add(new fl(l))}function bh(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];Tu([r],t,n)}}function Ba(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Tu(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Tu(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Tu(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?Cw({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Tu(r.patterns,{...t,repository:s},n);const i=r.include;if(!i)continue;const o=Rw(i);switch(o.kind){case 0:Ba({...t,selfGrammar:t.baseGrammar},n);break;case 1:Ba(t,n);break;case 2:bh(o.ruleName,{...t,repository:s},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:s};o.kind===4?bh(o.ruleName,a,n):Ba(a,n)}else o.kind===4?n.add(new E3(o.scopeName,o.ruleName)):n.add(new fl(o.scopeName));break}}}var P3=class{constructor(){A(this,"kind",0)}},A3=class{constructor(){A(this,"kind",1)}},R3=class{constructor(e){A(this,"kind",2);this.ruleName=e}},L3=class{constructor(e){A(this,"kind",3);this.scopeName=e}},M3=class{constructor(e,t){A(this,"kind",4);this.scopeName=e,this.ruleName=t}};function Rw(e){if(e==="$base")return new P3;if(e==="$self")return new A3;const t=e.indexOf("#");if(t===-1)return new L3(e);if(t===0)return new R3(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new M3(n,r)}}var O3=/\\(\d+)/,ey=/\\(\d+)/g,D3=-1,Lw=-2;var $l=class{constructor(e,t,n,r){A(this,"$location");A(this,"id");A(this,"_nameIsCapturing");A(this,"_name");A(this,"_contentNameIsCapturing");A(this,"_contentName");this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=xa.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=xa.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${_w(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:xa.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:xa.replaceCaptures(this._contentName,e,t)}},F3=class extends $l{constructor(t,n,r,s,i){super(t,n,r,s);A(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,n){throw new Error("Not supported!")}compile(t,n){throw new Error("Not supported!")}compileAG(t,n,r,s){throw new Error("Not supported!")}},$3=class extends $l{constructor(t,n,r,s,i){super(t,n,r,null);A(this,"_match");A(this,"captures");A(this,"_cachedCompiledPatterns");this._match=new hl(s,this.id),this.captures=i,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,s){return this._getCachedCompiledPatterns(t).compileAG(t,r,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new pl,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ty=class extends $l{constructor(t,n,r,s,i){super(t,n,r,s);A(this,"hasMissingPatterns");A(this,"patterns");A(this,"_cachedCompiledPatterns");this.patterns=i.patterns,this.hasMissingPatterns=i.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,s){return this._getCachedCompiledPatterns(t).compileAG(t,r,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new pl,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},vh=class extends $l{constructor(t,n,r,s,i,o,l,a,u,f){super(t,n,r,s);A(this,"_begin");A(this,"beginCaptures");A(this,"_end");A(this,"endHasBackReferences");A(this,"endCaptures");A(this,"applyEndPatternLast");A(this,"hasMissingPatterns");A(this,"patterns");A(this,"_cachedCompiledPatterns");this._begin=new hl(i,this.id),this.beginCaptures=o,this._end=new hl(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,s){return this._getCachedCompiledPatterns(t,n).compileAG(t,r,s)}_getCachedCompiledPatterns(t,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new pl;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}},Pu=class extends $l{constructor(t,n,r,s,i,o,l,a,u){super(t,n,r,s);A(this,"_begin");A(this,"beginCaptures");A(this,"whileCaptures");A(this,"_while");A(this,"whileHasBackReferences");A(this,"hasMissingPatterns");A(this,"patterns");A(this,"_cachedCompiledPatterns");A(this,"_cachedCompiledWhilePatterns");this._begin=new hl(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new hl(l,Lw),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,s){return this._getCachedCompiledPatterns(t).compileAG(t,r,s)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new pl;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,s){return this._getCachedCompiledWhilePatterns(t,n).compileAG(t,r,s)}_getCachedCompiledWhilePatterns(t,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new pl,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||""),this._cachedCompiledWhilePatterns}},Mw=class lt{static createCaptureRule(t,n,r,s,i){return t.registerRule(o=>new F3(n,o,r,s,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(s=>{if(t.id=s,t.match)return new $3(t.$vscodeTextmateLocation,t.id,t.name,t.match,lt._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Cw({},r,t.repository));let i=t.patterns;return typeof i>"u"&&t.include&&(i=[{include:t.include}]),new ty(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,lt._compilePatterns(i,n,r))}return t.while?new Pu(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,lt._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,lt._compileCaptures(t.whileCaptures||t.captures,n,r),lt._compilePatterns(t.patterns,n,r)):new vh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,lt._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,lt._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,lt._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let s=[];if(t){let i=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const l=parseInt(o,10);l>i&&(i=l)}for(let o=0;o<=i;o++)s[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const l=parseInt(o,10);let a=0;t[o].patterns&&(a=lt.getCompiledRuleId(t[o],n,r)),s[l]=lt.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,a)}}return s}static _compilePatterns(t,n,r){let s=[];if(t)for(let i=0,o=t.length;i<o;i++){const l=t[i];let a=-1;if(l.include){const u=Rw(l.include);switch(u.kind){case 0:case 1:a=lt.getCompiledRuleId(r[l.include],n,r);break;case 2:let f=r[u.ruleName];f&&(a=lt.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=lt.getCompiledRuleId(m,n,p.repository))}else a=lt.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else a=lt.getCompiledRuleId(l,n,r);if(a!==-1){const u=n.getRule(a);let f=!1;if((u instanceof ty||u instanceof vh||u instanceof Pu)&&u.hasMissingPatterns&&u.patterns.length===0&&(f=!0),f)continue;s.push(a)}}return{patterns:s,hasMissingPatterns:(t?t.length:0)!==s.length}}},hl=class Ow{constructor(t,n){A(this,"source");A(this,"ruleId");A(this,"hasAnchor");A(this,"hasBackReferences");A(this,"_anchorCache");if(t&&typeof t=="string"){const r=t.length;let s=0,i=[],o=!1;for(let l=0;l<r;l++)if(t.charAt(l)==="\\"&&l+1<r){const u=t.charAt(l+1);u==="z"?(i.push(t.substring(s,l)),i.push("$(?!\\n)(?<!\\n)"),s=l+2):(u==="A"||u==="G")&&(o=!0),l++}this.hasAnchor=o,s===0?this.source=t:(i.push(t.substring(s,r)),this.source=i.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=O3.test(this.source):this.hasBackReferences=!1}clone(){return new Ow(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(s=>t.substring(s.start,s.end));return ey.lastIndex=0,this.source.replace(ey,(s,i)=>jw(r[parseInt(i,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=[],s=[],i,o,l,a;for(i=0,o=this.source.length;i<o;i++)l=this.source.charAt(i),t[i]=l,n[i]=l,r[i]=l,s[i]=l,l==="\\"&&i+1<o&&(a=this.source.charAt(i+1),a==="A"?(t[i+1]="",n[i+1]="",r[i+1]="A",s[i+1]="A"):a==="G"?(t[i+1]="",n[i+1]="G",r[i+1]="",s[i+1]="G"):(t[i+1]=a,n[i+1]=a,r[i+1]=a,s[i+1]=a),i++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.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}},pl=class{constructor(){A(this,"_items");A(this,"_hasAnchors");A(this,"_cached");A(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 ny(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(s=>s.resolveAnchors(t,n));return new ny(e,r,this._items.map(s=>s.ruleId))}},ny=class{constructor(e,t,n){A(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(`
|
|
300
|
+
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},wd=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Qn,z3=(Qn=class{constructor(t,n){A(this,"_defaultAttributes");A(this,"_embeddedLanguagesMatcher");A(this,"_getBasicScopeAttributes",new Iw(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new wd(n,r)}));this._defaultAttributes=new wd(t,8),this._embeddedLanguagesMatcher=new B3(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Qn._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Qn.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!")}},A(Qn,"_NULL_SCOPE_METADATA",new wd(0,0)),A(Qn,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),Qn),B3=class{constructor(e){A(this,"values");A(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>jw(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])}},ry=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Dw(e,t,n,r,s,i,o,l){const a=t.content.length;let u=!1,f=-1;if(o){const p=U3(e,t,n,r,s,i);s=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 ry(s,!0);h()}return new ry(s,!1);function h(){const p=H3(e,t,n,r,s,f);if(!p){i.produce(s,a),u=!0;return}const m=p.captureIndices,y=p.matchedRuleId,v=m&&m.length>0?m[0].end>r:!1;if(y===D3){const g=s.getRule(e);i.produce(s,m[0].start),s=s.withContentNameScopesList(s.nameScopesList),So(e,t,n,s,i,g.endCaptures,m),i.produce(s,m[0].end);const x=s;if(s=s.parent,f=x.getAnchorPos(),!v&&x.getEnterPos()===r){s=x,i.produce(s,a),u=!0;return}}else{const g=e.getRule(y);i.produce(s,m[0].start);const x=s,b=g.getName(t.content,m),w=s.contentNameScopesList.pushAttributed(b,e);if(s=s.push(y,r,f,m[0].end===a,null,w,w),g instanceof vh){const N=g;So(e,t,n,s,i,N.beginCaptures,m),i.produce(s,m[0].end),f=m[0].end;const k=N.getContentName(t.content,m),I=w.pushAttributed(k,e);if(s=s.withContentNameScopesList(I),N.endHasBackReferences&&(s=s.withEndRule(N.getEndWithResolvedBackReferences(t.content,m))),!v&&x.hasSameRuleAs(s)){s=s.pop(),i.produce(s,a),u=!0;return}}else if(g instanceof Pu){const N=g;So(e,t,n,s,i,N.beginCaptures,m),i.produce(s,m[0].end),f=m[0].end;const k=N.getContentName(t.content,m),I=w.pushAttributed(k,e);if(s=s.withContentNameScopesList(I),N.whileHasBackReferences&&(s=s.withEndRule(N.getWhileWithResolvedBackReferences(t.content,m))),!v&&x.hasSameRuleAs(s)){s=s.pop(),i.produce(s,a),u=!0;return}}else if(So(e,t,n,s,i,g.captures,m),i.produce(s,m[0].end),s=s.pop(),!v){s=s.safePop(),i.produce(s,a),u=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function U3(e,t,n,r,s,i){let o=s.beginRuleCapturedEOL?0:-1;const l=[];for(let a=s;a;a=a.pop()){const u=a.getRule(e);u instanceof Pu&&l.push({rule:u,stack:a})}for(let a=l.pop();a;a=l.pop()){const{ruleScanner:u,findOptions:f}=W3(a.rule,e,a.stack.endRule,n,r===o),d=u.findNextMatchSync(t,r,f);if(d){if(d.ruleId!==Lw){s=a.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(i.produce(a.stack,d.captureIndices[0].start),So(e,t,n,a.stack,i,a.rule.whileCaptures,d.captureIndices),i.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{s=a.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:o,isFirstLine:n}}function H3(e,t,n,r,s,i){const o=G3(e,t,n,r,s,i),l=e.getInjections();if(l.length===0)return o;const a=q3(l,e,t,n,r,s,i);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 G3(e,t,n,r,s,i){const o=s.getRule(e),{ruleScanner:l,findOptions:a}=Fw(o,e,s.endRule,n,r===i),u=l.findNextMatchSync(t,r,a);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function q3(e,t,n,r,s,i,o){let l=Number.MAX_VALUE,a=null,u,f=0;const d=i.contentNameScopesList.getScopeNames();for(let h=0,p=e.length;h<p;h++){const m=e[h];if(!m.matcher(d))continue;const y=t.getRule(m.ruleId),{ruleScanner:v,findOptions:g}=Fw(y,t,null,r,s===o),x=v.findNextMatchSync(n,s,g);if(!x)continue;const b=x.captureIndices[0].start;if(!(b>=l)&&(l=b,a=x.captureIndices,u=x.ruleId,f=m.priority,l===s))break}return a?{priorityMatch:f===-1,captureIndices:a,matchedRuleId:u}:null}function Fw(e,t,n,r,s){return{ruleScanner:e.compileAG(t,n,r,s),findOptions:0}}function W3(e,t,n,r,s){return{ruleScanner:e.compileWhileAG(t,n,r,s),findOptions:0}}function So(e,t,n,r,s,i,o){if(i.length===0)return;const l=t.content,a=Math.min(i.length,o.length),u=[],f=o[0].end;for(let d=0;d<a;d++){const h=i[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;)s.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?s.produceFromScopes(u[u.length-1].scopes,p.start):s.produce(r,p.start),h.retokenizeCapturedWithRuleId){const y=h.getName(l,o),v=r.contentNameScopesList.pushAttributed(y,e),g=h.getContentName(l,o),x=v.pushAttributed(g,e),b=r.push(h.retokenizeCapturedWithRuleId,p.start,-1,!1,null,v,x),w=e.createOnigString(l.substring(0,p.end));Dw(e,w,n&&p.start===0,p.start,b,s,!1,0),Aw(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 V3(v,p.end))}}for(;u.length>0;)s.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var V3=class{constructor(e,t){A(this,"scopes");A(this,"endPos");this.scopes=e,this.endPos=t}};function Q3(e,t,n,r,s,i,o,l){return new X3(e,t,n,r,s,i,o,l)}function sy(e,t,n,r,s){const i=Iu(t,Au),o=Mw.getCompiledRuleId(n,r,s.repository);for(const l of i)e.push({debugSelector:t,matcher:l.matcher,ruleId:o,grammar:s,priority:l.priority})}function Au(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let s=n;s<t.length;s++)if(K3(t[s],r))return n=s+1,!0;return!1})}function K3(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 X3=class{constructor(e,t,n,r,s,i,o,l){A(this,"_rootId");A(this,"_lastRuleId");A(this,"_ruleId2desc");A(this,"_includedGrammars");A(this,"_grammarRepository");A(this,"_grammar");A(this,"_injections");A(this,"_basicScopeAttributesProvider");A(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=l,this._basicScopeAttributesProvider=new z3(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=iy(t,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const a of Object.keys(s)){const u=Iu(a,Au);for(const f of u)this._tokenTypeMatchers.push({matcher:f.matcher,type:s[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:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const s=r.injections;if(s)for(let o in s)sy(t,o,s[o],this,r);const i=this._grammarRepository.injections(n);i&&i.forEach(o=>{const l=this.getExternalGrammar(o);if(l){const a=l.injectionSelector;a&&sy(t,a,l,this,l)}})}return t.sort((s,i)=>s.priority-i.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]=iy(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=Mw.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!t||t===wh.NULL){s=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),f=this.themeProvider.getDefaults(),d=$i.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=zo.createRootAndLookUpScopeName(h,d,this):p=zo.createRoot("unknown",d),t=new wh(null,this._rootId,-1,-1,!1,null,p,p)}else s=!1,t.reset();e=e+`
|
|
301
|
+
`;const i=this.createOnigString(e),o=i.content.length,l=new J3(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),a=Dw(this,i,s,0,t,l,!0,r);return Aw(i),{lineLength:o,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function iy(e,t){return e=m3(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 zo=class vn{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,s=(t==null?void 0:t.scopePath)??null;for(const i of n)s=vd.push(s,i.scopeNames),r=new vn(r,s,i.encodedTokenAttributes);return r}static createRoot(t,n){return new vn(null,new vd(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const s=r.getMetadataForScope(t),i=new vd(null,t),o=r.themeProvider.themeMatch(i),l=vn.mergeAttributes(n,s,o);return new vn(null,i,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return vn.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 s=-1,i=0,o=0;return r!==null&&(s=r.fontStyle,i=r.foregroundId,o=r.backgroundId),$i.set(t,n.languageId,n.tokenType,null,s,i,o)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return vn._pushAttributed(this,t,n);const r=t.split(/ /g);let s=this;for(const i of r)s=vn._pushAttributed(s,i,n);return s}static _pushAttributed(t,n,r){const s=r.getMetadataForScope(n),i=t.scopePath.push(n),o=r.themeProvider.themeMatch(i),l=vn.mergeAttributes(t.tokenAttributes,s,o);return new vn(t,i,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var s;const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((s=r.parent)==null?void 0:s.scopePath)??null)}),r=r.parent;return r===t?n.reverse():void 0}},Yt,wh=(Yt=class{constructor(t,n,r,s,i,o,l,a){A(this,"_stackElementBrand");A(this,"_enterPos");A(this,"_anchorPos");A(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}equals(t){return t===null?!1:Yt._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?zo.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(){Yt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,s,i,o,l){return new Yt(this,t,n,r,s,i,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,s;return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(s=this.contentNameScopesList)==null?void 0:s.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 Yt(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=zo.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new Yt(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,zo.fromExtension(r,n.contentNameScopesList))}},A(Yt,"NULL",new Yt(null,0,0,0,!1,null,null,null)),Yt),Y3=class{constructor(e,t){A(this,"balancedBracketScopes");A(this,"unbalancedBracketScopes");A(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Iu(n,Au).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Iu(n,Au).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}},J3=class{constructor(e,t,n,r){A(this,"_emitBinaryTokens");A(this,"_lineText");A(this,"_tokens");A(this,"_binaryTokens");A(this,"_lastTokenEndIndex");A(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 s=(e==null?void 0:e.tokenAttributes)??0,i=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(i=!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)&&(s=$i.set(s,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(s=$i.set(s,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),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,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},Z3=class{constructor(e,t){A(this,"_grammars",new Map);A(this,"_rawGrammars",new Map);A(this,"_injectionGrammars",new Map);A(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,s){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,Q3(e,i,t,n,r,s,this,this._onigLib))}return this._grammars.get(e)}},eL=class{constructor(t){A(this,"_options");A(this,"_syncRegistry");A(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new Z3(ju.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(ju.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 Y3(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,s,i){const o=new I3(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(l=>this._loadSingleGrammar(l.scopeName)),o.processQueue();return this._grammarForScopeName(t,n,r,s,i)}_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,s=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,s)}_grammarForScopeName(t,n=0,r=null,s=null,i=null){return this._syncRegistry.grammarForScopeName(t,n,r,s,i)}},kh=wh.NULL;function Ru(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[s,i]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof i=="string"?n[s]=i:s===r&&Object.assign(n,i);return n}function qr(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function tL(e){return Array.isArray(e)?e:[e]}async function $w(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function gc(e){return!e||["plaintext","txt","text","plain"].includes(e)}function nL(e){return e==="ansi"||gc(e)}function xc(e){return e==="none"}function rL(e){return xc(e)}const sL=/(\r?\n)/g;function yc(e,t=!1){var i;if(e.length===0)return[["",0]];const n=e.split(sL);let r=0;const s=[];for(let o=0;o<n.length;o+=2){const l=t?n[o]+(n[o+1]||""):n[o];s.push([l,r]),r+=n[o].length,r+=((i=n[o+1])==null?void 0:i.length)||0}return s}const oy={light:"#333333",dark:"#bbbbbb"},ly={light:"#fffffe",dark:"#1e1e1e"},ay="__shiki_resolved";function im(e){var l,a,u,f,d;if(e!=null&&e[ay])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"?oy.light:oy.dark),n||(n=t.type==="light"?ly.light:ly.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 s=0;const i=new Map;function o(h){var m;if(i.has(h))return i.get(h);s+=1;const p=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return(m=t.colorReplacements)!=null&&m[`#${p}`]?o(h):(i.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 y={...h,settings:{...h.settings}};if(p){const x=o(h.settings.foreground);t.colorReplacements[x]=h.settings.foreground,y.settings.foreground=x}if(m){const x=o(h.settings.background);t.colorReplacements[x]=h.settings.background,y.settings.background=x}return y});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,ay,{enumerable:!1,writable:!1,value:!0}),t}async function zw(e){return[...new Set((await Promise.all(e.filter(t=>!nL(t)).map(async t=>await $w(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Bw(e){return(await Promise.all(e.map(async t=>rL(t)?null:im(await $w(t))))).filter(t=>!!t)}function Uw(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 Ae(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var iL=class extends eL{constructor(t,n,r,s={}){super(t);A(this,"_resolver");A(this,"_themes");A(this,"_langs");A(this,"_alias");A(this,"_resolvedThemes",new Map);A(this,"_resolvedGrammars",new Map);A(this,"_langMap",new Map);A(this,"_langGraph",new Map);A(this,"_textmateThemeCache",new WeakMap);A(this,"_loadedThemesCache",null);A(this,"_loadedLanguagesCache",null);this._resolver=t,this._themes=n,this._langs=r,this._alias=s,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=im(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=ju.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=Uw(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){var i,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 s=this.loadGrammarWithConfiguration(t.scopeName,1,r);if(s.name=t.name,this._resolvedGrammars.set(t.name,s),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=(i=this._syncRegistry)==null?void 0:i._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 s of t)this.resolveEmbeddedLanguages(s);const n=[...this._langGraph.entries()],r=n.filter(([s,i])=>!i);if(r.length){const s=n.filter(([i,o])=>{var l;return o?(l=o.embeddedLanguages||o.embeddedLangs)==null?void 0:l.some(a=>r.map(([u])=>u).includes(a)):!1}).filter(i=>!r.includes(i));throw new Ae(`Missing languages ${r.map(([i])=>`\`${i}\``).join(", ")}, required by ${s.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[s,i]of n)this._resolver.addLanguage(i);for(const[s,i]of n)this.loadLanguage(i)}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))}},oL=class{constructor(e,t){A(this,"_langs",new Map);A(this,"_scopeToLang",new Map);A(this,"_injections",new Map);A(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 s=t.slice(0,r).join(".");n=[...n,...this._injections.get(s)||[]]}return n}};let go=0;function lL(e){go+=1,e.warnings!==!1&&go>=10&&go%10===0&&console.warn(`[Shiki] ${go} 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 Ae("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(im),s=new iL(new oL(e.engine,n),r,n,e.langAlias);let i;function o(x){return Uw(x,e.langAlias)}function l(x){v();const b=s.getGrammar(typeof x=="string"?x:x.name);if(!b)throw new Ae(`Language \`${x}\` not found, you may need to load it first`);return b}function a(x){if(x==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};v();const b=s.getTheme(x);if(!b)throw new Ae(`Theme \`${x}\` not found, you may need to load it first`);return b}function u(x){v();const b=a(x);return i!==x&&(s.setTheme(b),i=x),{theme:b,colorMap:s.getColorMap()}}function f(){return v(),s.getLoadedThemes()}function d(){return v(),s.getLoadedLanguages()}function h(...x){v(),s.loadLanguages(x.flat(1))}async function p(...x){return h(await zw(x))}function m(...x){v();for(const b of x.flat(1))s.loadTheme(b)}async function y(...x){return v(),m(await Bw(x))}function v(){if(t)throw new Ae("Shiki instance has been disposed")}function g(){t||(t=!0,s.dispose(),go-=1)}return{setTheme:u,getTheme:a,getLanguage:l,getLoadedThemes:f,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:h,loadTheme:y,loadThemeSync:m,dispose:g,[Symbol.dispose]:g}}async function aL(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Bw(e.themes||[]),zw(e.langs||[]),e.engine]);return lL({...e,themes:t,langs:n,engine:r})}const Hw=new WeakMap;function bc(e,t){Hw.set(e,t)}function ml(e){return Hw.get(e)}var vc=class Gw{constructor(...t){A(this,"_stacks",{});A(this,"lang");if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,s]=t;this.lang=r,this._stacks={[s]: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 Gw(Object.fromEntries(tL(n).map(r=>[r,kh])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return uL(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function uL(e){const t=[],n=new Set;function r(s){var o;if(n.has(s))return;n.add(s);const i=(o=s==null?void 0:s.nameScopesList)==null?void 0:o.scopeName;i&&t.push(i),s.parent&&r(s.parent)}return r(e),t}function cL(e,t){if(!(e instanceof vc))throw new Ae("Invalid grammar state");return e.getInternalStack(t)}const dL=/,/,fL=/ /;function qw(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(gc(e.resolveLangAlias(n.lang||"text"))||xc(r))return yc(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:s,colorMap:i}=e.setTheme(r),o=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Ae(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Ae(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return pL(t,o,s,i,n)}function hL(...e){if(e.length===2)return ml(e[1]);const[t,n,r={}]=e,{lang:s="text",theme:i=t.getLoadedThemes()[0]}=r;if(gc(s)||xc(i))throw new Ae("Plain language does not have grammar state");if(s==="ansi")throw new Ae("ANSI language does not have grammar state");const{theme:o,colorMap:l}=t.setTheme(i),a=t.getLanguage(s);return new vc(om(n,a,o,l,r).stateStack,a.name,o.name)}function pL(e,t,n,r,s){const i=om(e,t,n,r,s),o=new vc(i.stateStack,t.name,n.name);return bc(i.tokens,o),i.tokens}function om(e,t,n,r,s){const i=Ru(n,s),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:l=500}=s,a=yc(e);let u=s.grammarState?cL(s.grammarState,n.name)??kh:s.grammarContextCode!=null?om(s.grammarContextCode,t,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:kh,f=[];const d=[];for(let h=0,p=a.length;h<p;h++){const[m,y]=a[h];if(m===""){f=[],d.push([]);continue}if(o>0&&m.length>=o){f=[],d.push([{content:m,offset:y,color:"",fontStyle:0}]);continue}let v,g,x;s.includeExplanation&&(v=t.tokenizeLine(m,u,l),g=v.tokens,x=0);const b=t.tokenizeLine2(m,u,l),w=b.tokens.length/2;for(let N=0;N<w;N++){const k=b.tokens[2*N],I=N+1<w?b.tokens[2*N+2]:m.length;if(k===I)continue;const T=b.tokens[2*N+1],P=qr(r[$i.getForeground(T)],i),E=$i.getFontStyle(T),M={content:m.substring(k,I),offset:y+k,color:P,fontStyle:E};if(s.includeExplanation){const R=[];if(s.includeExplanation!=="scopeName")for(const q of n.settings){let G;switch(typeof q.scope){case"string":G=q.scope.split(dL).map(z=>z.trim());break;case"object":G=q.scope;break;default:continue}R.push({settings:q,selectors:G.map(z=>z.split(fL))})}M.explanation=[];let Q=0;for(;k+Q<I;){const q=g[x],G=m.substring(q.startIndex,q.endIndex);Q+=G.length,M.explanation.push({content:G,scopes:s.includeExplanation==="scopeName"?mL(q.scopes):gL(R,q.scopes)}),x+=1}}f.push(M)}d.push(f),f=[],u=b.ruleStack}return{tokens:d,stateStack:u}}function mL(e){return e.map(t=>({scopeName:t}))}function gL(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const i=t[r];n[r]={scopeName:i,themeMatches:yL(e,i,t.slice(0,r))}}return n}function uy(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function xL(e,t,n){if(!uy(e.at(-1),t))return!1;let r=e.length-2,s=n.length-1;for(;r>=0&&s>=0;)uy(e[r],n[s])&&(r-=1),s-=1;return r===-1}function yL(e,t,n){const r=[];for(const{selectors:s,settings:i}of e)for(const o of s)if(xL(o,t,n)){r.push(i);break}return r}function Ww(e,t,n,r=qw){const s=Object.entries(n.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),i=s.map(u=>{const f=r(e,t,{...n,theme:u.theme});return{tokens:f,state:ml(f),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),o=bL(...i.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,y)=>{const{content:v,explanation:g,offset:x,...b}=m[f][h];p.variants[s[y].color]=b}),p})),a=i[0].state?new vc(Object.fromEntries(i.map(u=>{var f;return[u.theme,(f=u.state)==null?void 0:f.getInternalStack(u.theme)]})),i[0].state.lang):void 0;return a&&bc(l,a),l}function bL(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const s=e.map(a=>a[r]),i=t.map(()=>[]);t.forEach((a,u)=>a.push(i[u]));const o=s.map(()=>0),l=s.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?(i[u].push(f),o[u]+=1,l[u]=s[u][o[u]]):(i[u].push({...f,content:f.content.slice(0,a)}),l[u]={...f,content:f.content.slice(a),offset:f.offset+a})}}}return t}const vL=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],wL=/["&'<>`]/g,kL=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,SL=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,CL=/[|\\{}()[\]^$+*?.]/g,cy=new WeakMap;function _L(e,t){if(e=e.replace(t.subset?NL(t.subset):wL,r),t.subset||t.escapeOnly)return e;return e.replace(kL,n).replace(SL,r);function n(s,i,o){return t.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,o.charCodeAt(i+2),t)}function r(s,i,o){return t.format(s.charCodeAt(0),o.charCodeAt(i+1),t)}}function NL(e){let t=cy.get(e);return t||(t=EL(e),cy.set(e,t)),t}function EL(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(CL,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const jL=/[\dA-Fa-f]/;function IL(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!jL.test(String.fromCharCode(t))?r:r+";"}const TL=/\d/;function PL(e,t,n){const r="&#"+String(e);return n&&t&&!TL.test(String.fromCharCode(t))?r:r+";"}const AL=["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"],kd={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:"€"},RL=["cent","copy","divide","gt","lt","not","para","times"],Vw={}.hasOwnProperty,Sh={};let ya;for(ya in kd)Vw.call(kd,ya)&&(Sh[kd[ya]]=ya);const LL=/[^\dA-Za-z]/;function ML(e,t,n,r){const s=String.fromCharCode(e);if(Vw.call(Sh,s)){const i=Sh[s],o="&"+i;return n&&AL.includes(i)&&!RL.includes(i)&&(!r||t&&t!==61&&LL.test(String.fromCharCode(t)))?o:o+";"}return""}function OL(e,t,n){let r=IL(e,t,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=ML(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const i=PL(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function gi(e,t){return _L(e,Object.assign({format:OL},t))}const DL=/^>|^->|<!--|-->|--!>|<!-$/g,FL=[">"],$L=["<",">"];function zL(e,t,n,r){return r.settings.bogusComments?"<?"+gi(e.value,Object.assign({},r.settings.characterReferences,{subset:FL}))+">":"<!--"+e.value.replace(DL,s)+"-->";function s(i){return gi(i,Object.assign({},r.settings.characterReferences,{subset:$L}))}}function BL(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}const Ke=Kw(1),Qw=Kw(-1),UL=[];function Kw(e){return t;function t(n,r,s){const i=n?n.children:UL;let o=(r||0)+e,l=i[o];if(!s)for(;l&&uc(l);)o+=e,l=i[o];return l}}const HL={}.hasOwnProperty;function Xw(e){return t;function t(n,r,s){return HL.call(e,n.tagName)&&e[n.tagName](n,r,s)}}const lm=Xw({body:qL,caption:Sd,colgroup:Sd,dd:KL,dt:QL,head:Sd,html:GL,li:VL,optgroup:XL,option:YL,p:WL,rp:dy,rt:dy,tbody:ZL,td:fy,tfoot:e5,th:fy,thead:JL,tr:t5});function Sd(e,t,n){const r=Ke(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&uc(r.value.charAt(0)))}function GL(e,t,n){const r=Ke(n,t);return!r||r.type!=="comment"}function qL(e,t,n){const r=Ke(n,t);return!r||r.type!=="comment"}function WL(e,t,n){const r=Ke(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=Ke(n,t);return!r||r.type==="element"&&r.tagName==="li"}function QL(e,t,n){const r=Ke(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function KL(e,t,n){const r=Ke(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function dy(e,t,n){const r=Ke(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function XL(e,t,n){const r=Ke(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function YL(e,t,n){const r=Ke(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function JL(e,t,n){const r=Ke(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function ZL(e,t,n){const r=Ke(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function e5(e,t,n){return!Ke(n,t)}function t5(e,t,n){const r=Ke(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function fy(e,t,n){const r=Ke(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const n5=Xw({body:i5,colgroup:o5,head:s5,html:r5,tbody:l5});function r5(e){const t=Ke(e,-1);return!t||t.type!=="comment"}function s5(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 i5(e){const t=Ke(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&uc(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function o5(e,t,n){const r=Qw(n,t),s=Ke(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&lm(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function l5(e,t,n){const r=Qw(n,t),s=Ke(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&lm(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const ba={name:[[`
|
|
302
|
+
\f\r &/=>`.split(""),`
|
|
303
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
304
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
305
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
306
|
+
\f\r &>`.split(""),`\0
|
|
307
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
308
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
309
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function a5(e,t,n,r){const s=r.schema,i=s.space==="svg"?!1:r.settings.omitOptionalTags;let o=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const l=[];let a;s.space==="html"&&e.tagName==="svg"&&(r.schema=Ol);const u=u5(r,e.properties),f=r.all(s.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=s,f&&(o=!1),(u||!i||!n5(e,t,n))&&(l.push("<",e.tagName,u?" "+u:""),o&&(s.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&&(!i||!lm(e,t,n))&&l.push("</"+e.tagName+">"),l.join("")}function u5(e,t){const n=[];let r=-1,s;if(t){for(s in t)if(t[s]!==null&&t[s]!==void 0){const i=c5(e,s,t[s]);i&&n.push(i)}}for(;++r<n.length;){const i=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&i!=='"'&&i!=="'"&&(n[r]+=" ")}return n.join("")}function c5(e,t,n){const r=Sv(e.schema,t),s=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,i=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=gi(r.attribute,Object.assign({},e.settings.characterReferences,{subset:ba.name[s][i]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?mv:_v)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?a:(e.settings.preferUnquoted&&(l=gi(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:ba.unquoted[s][i]}))),l!==n&&(e.settings.quoteSmart&&Nu(n,o)>Nu(n,e.alternative)&&(o=e.alternative),l=o+gi(n,Object.assign({},e.settings.characterReferences,{subset:(o==="'"?ba.single:ba.double)[s][i],attribute:!0}))+o),a+(l&&"="+l))}const d5=["<","&"];function Yw(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:gi(e.value,Object.assign({},r.settings.characterReferences,{subset:d5}))}function f5(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Yw(e,t,n,r)}function h5(e,t,n,r){return r.all(e)}const p5=BA("type",{invalid:m5,unknown:g5,handlers:{comment:zL,doctype:BL,element:a5,raw:f5,root:h5,text:Yw}});function m5(e){throw new Error("Expected node, not `"+e+"`")}function g5(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const x5={},y5={},b5=[];function v5(e,t){const n=t||x5,r=n.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:w5,all:k5,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||vL,characterReferences:n.characterReferences||y5,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Ol:Cv,quote:r,alternative:s}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function w5(e,t,n){return p5(e,t,n,this)}function k5(e){const t=[],n=e&&e.children||b5;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}const hy=/\s+/g;function Jw(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(hy)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(hy);for(const s of n)s&&!e.properties.class.includes(s)&&e.properties.class.push(s);return e}function S5(e){const t=yc(e,!0).map(([s])=>s);function n(s){if(s===e.length)return{line:t.length-1,character:t.at(-1).length};let i=s,o=0;for(const l of t){if(i<l.length)break;i-=l.length,o++}return{line:o,character:i}}function r(s,i){let o=0;for(let l=0;l<s;l++)o+=t[l].length;return o+=i,o}return{lines:t,indexToPos:n,posToIndex:r}}const C5=["color","background-color"];function _5(e,t){let n=0;const r=[];for(const s of t)s>n&&r.push({...e,content:e.content.slice(n,s),offset:e.offset+n}),n=s;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function N5(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((r,s)=>r-s);return n.length?e.map(r=>r.flatMap(s=>{const i=n.filter(o=>s.offset<o&&o<s.offset+s.content.length).map(o=>o-s.offset).sort((o,l)=>o-l);return i.length?_5(s,i):s})):e}function E5(e,t,n,r,s="css-vars"){const i={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(f=>Lu(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&&C5.includes(h))if(r==="light-dark()"&&o.length>1){const m=t.findIndex(v=>v==="light"),y=t.findIndex(v=>v==="dark");if(m===-1||y===-1)throw new Ae('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');a[h]=`light-dark(${o[m][h]||"inherit"}, ${o[y][h]||"inherit"})`,s==="css-vars"&&(a[u(d,h)]=p)}else a[h]=p;else s==="css-vars"&&(a[u(d,h)]=p)}}),i.htmlStyle=a,i}function Lu(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&ct.Italic&&(t["font-style"]="italic"),e.fontStyle&ct.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&ct.Underline&&n.push("underline"),e.fontStyle&ct.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Ch(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function j5(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let i=function(l){if(typeof l=="number"){if(l<0||l>n.source.length)throw new Ae(`Invalid decoration offset: ${l}. Code length: ${n.source.length}`);return{...s.indexToPos(l),offset:l}}else{const a=s.lines[l.line];if(a===void 0)throw new Ae(`Invalid decoration position ${JSON.stringify(l)}. Lines length: ${s.lines.length}`);let u=l.character;if(u<0&&(u=a.length+u),u<0||u>a.length)throw new Ae(`Invalid decoration position ${JSON.stringify(l)}. Line ${l.line} length: ${a.length}`);return{...l,character:u,offset:s.posToIndex(l.line,u)}}};var r=i;const s=S5(n.source),o=(n.options.decorations||[]).map(l=>({...l,start:i(l.start),end:i(l.end)}));I5(o),e.set(n.meta,{decorations:o,converter:s,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 N5(n,t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]))},code(n){var f;if(!((f=this.options.decorations)!=null&&f.length))return;const r=t(this),s=[...n.children].filter(d=>d.type==="element"&&d.tagName==="span");if(s.length!==r.converter.lines.length)throw new Ae(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function i(d,h,p,m){const y=s[d];let v="",g=-1,x=-1;if(h===0&&(g=0),p===0&&(x=0),p===Number.POSITIVE_INFINITY&&(x=y.children.length),g===-1||x===-1)for(let w=0;w<y.children.length;w++)v+=Zw(y.children[w]),g===-1&&v.length===h&&(g=w+1),x===-1&&v.length===p&&(x=w+1);if(g===-1)throw new Ae(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(x===-1)throw new Ae(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const b=y.children.slice(g,x);if(!m.alwaysWrap&&b.length===y.children.length)l(y,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"),y.children.splice(g,b.length,w)}}function o(d,h){s[d]=l(s[d],h,"line")}function l(d,h,p){var v;const m=h.properties||{},y=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&&Jw(d,h.properties.class),d=y(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)i(h.line,h.character,p.character,d);else if(h.line<p.line){i(h.line,h.character,Number.POSITIVE_INFINITY,d);for(let m=h.line+1;m<p.line;m++)a.unshift(()=>o(m,d));i(p.line,0,p.character,d)}}a.forEach(d=>d())}}}function I5(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Ae(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const s=e[r],i=n.start.offset<=s.start.offset&&s.start.offset<n.end.offset,o=n.start.offset<s.end.offset&&s.end.offset<=n.end.offset,l=s.start.offset<=n.start.offset&&n.start.offset<s.end.offset,a=s.start.offset<n.end.offset&&n.end.offset<=s.end.offset;if(i||o||l||a){if(i&&o||l&&a||l&&n.start.offset===n.end.offset||o&&s.start.offset===s.end.offset)continue;throw new Ae(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function Zw(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Zw).join(""):""}const T5=[j5()];function Mu(e){const t=P5(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...T5]}function P5(e){const t=[],n=[],r=[];for(const s of e)switch(s.enforce){case"pre":t.push(s);break;case"post":n.push(s);break;default:r.push(s)}return{pre:t,post:n,normal:r}}var hs=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Cd={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function A5(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 py(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 R5(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)Cd[r]&&t.push({type:"setDecoration",value:Cd[r]});else if(r<=29){const s=Cd[r-20];s&&(t.push({type:"resetDecoration",value:s}),s==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:hs[r-30]}});else if(r===38){const s=py(e);s&&t.push({type:"setForegroundColor",value:s})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:hs[r-40]}});else if(r===48){const s=py(e);s&&t.push({type:"setBackgroundColor",value:s})}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:hs[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:hs[r-100+8]}})}return t}function L5(){let e=null,t=null,n=new Set;return{parse(r){const s=[];let i=0;do{const o=A5(r,i),l=o.sequence?r.substring(i,o.startPosition):r.substring(i);if(l.length>0&&s.push({value:l,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const a=R5(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)}i=o.position}while(i<r.length);return s}}}var M5={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 O5(e=M5){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 s(){if(r)return r;r=[];for(let u=0;u<hs.length;u++)r.push(t(hs[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 i(l){return s()[l]}function o(l){switch(l.type){case"named":return t(l.name);case"rgb":return n(l.rgb);case"table":return i(l.index)}}return{value:o}}const D5=/#([0-9a-f]{3,8})/i,F5=/var\((--[\w-]+-ansi-[\w-]+)\)/,$5={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 z5(e,t,n){const r=Ru(e,n),s=yc(t),i=O5(Object.fromEntries(hs.map(l=>{var u;const a=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`;return[l,((u=e.colors)==null?void 0:u[a])||$5[l]]}))),o=L5();return s.map(l=>o.parse(l[0]).map(a=>{let u,f;a.decorations.has("reverse")?(u=a.background?i.value(a.background):e.bg,f=a.foreground?i.value(a.foreground):e.fg):(u=a.foreground?i.value(a.foreground):e.fg,f=a.background?i.value(a.background):void 0),u=qr(u,r),f=qr(f,r),a.decorations.has("dim")&&(u=B5(u));let d=ct.None;return a.decorations.has("bold")&&(d|=ct.Bold),a.decorations.has("italic")&&(d|=ct.Italic),a.decorations.has("underline")&&(d|=ct.Underline),a.decorations.has("strikethrough")&&(d|=ct.Strikethrough),{content:a.value,offset:l[1],color:u,bgColor:f,fontStyle:d}}))}function B5(e){const t=e.match(D5);if(t){const r=t[1];if(r.length===8){const s=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${s}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const s=r[0],i=r[1],o=r[2],l=r[3];return`#${s}${s}${i}${i}${o}${o}${Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const s=r[0],i=r[1],o=r[2];return`#${s}${s}${i}${i}${o}${o}80`}}}const n=e.match(F5);return n?`var(${n[1]}-dim)`:e}function _h(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:s=e.getLoadedThemes()[0]}=n;if(!gc(r)&&!xc(s)&&r==="ansi"){const{theme:i}=e.setTheme(s);return z5(i,t,n)}return qw(e,t,n)}function Ou(e,t,n){let r,s,i,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,x)=>g.color===u?-1:x.color===u?1:0);if(h.length===0)throw new Ae("`themes` option must not be empty");const p=Ww(e,t,n,_h);if(a=ml(p),u&&u!=="light-dark()"&&!h.some(g=>g.color===u))throw new Ae(`\`themes\` option must contain the defaultColor key \`${u}\``);const m=h.map(g=>e.getTheme(g.theme)),y=h.map(g=>g.color);i=p.map(g=>g.map(x=>E5(x,y,f,u,d))),a&&bc(i,a);const v=h.map(g=>Ru(g.theme,n));s=my(h,m,v,f,u,"fg",d),r=my(h,m,v,f,u,"bg",d),o=`shiki-themes ${m.map(g=>g.name).join(" ")}`,l=u?void 0:[s,r].join(";")}else if("theme"in n){const u=Ru(n.theme,n);i=_h(e,t,n);const f=e.getTheme(n.theme);r=qr(f.bg,u),s=qr(f.fg,u),o=f.name,a=ml(i)}else throw new Ae("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:s,bg:r,themeName:o,rootStyle:l,grammarState:a}}function my(e,t,n,r,s,i,o){return e.map((l,a)=>{const u=qr(t[a][i],n[a])||"inherit",f=`${r+l.color}${i==="bg"?"-bg":""}:${u}`;if(a===0&&s){if(s==="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 Ae('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${qr(t[d][i],n[d])||"inherit"}, ${qr(t[h][i],n[h])||"inherit"});${f}`}return u}return o==="css-vars"?f:null}).filter(l=>!!l).join(";")}const ek=/^\s+$/,U5=/^(\s*)(.*?)(\s*)$/;function Du(e,t,n,r={meta:{},options:n,codeToHast:(s,i)=>Du(e,s,i),codeToTokens:(s,i)=>Ou(e,s,i)}){var m,y;let s=t;for(const v of Mu(n))s=((m=v.preprocess)==null?void 0:m.call(r,s,n))||s;let{tokens:i,fg:o,bg:l,themeName:a,rootStyle:u,grammarState:f}=Ou(e,s,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=n;d===!0?i=G5(i):d==="never"&&(i=q5(i)),h&&(i=W5(i));const p={...r,get source(){return s}};for(const v of Mu(n))i=((y=v.tokens)==null?void 0:y.call(p,i))||i;return H5(i,{...n,fg:o,bg:l,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},p,f)}function H5(e,t,n,r=ml(e)){var y,v,g,x;const s=Mu(t),i=[],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:i};const h=[],p={...n,structure:l,addClassToHast:Jw,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 I,T;w&&(l==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&i.push({type:"text",value:`
|
|
310
|
+
`}));let N={type:"element",tagName:"span",properties:{class:"line"},children:[]},k=0;for(const P of b){let E={type:"element",tagName:"span",properties:{...P.htmlAttrs},children:[{type:"text",value:P.content}]};const M=Ch(P.htmlStyle||Lu(P));M&&(E.properties.style=M);for(const R of s)E=((I=R==null?void 0:R.span)==null?void 0:I.call(p,E,w+1,k,N,P))||E;l==="inline"?o.children.push(E):l==="classic"&&N.children.push(E),k+=P.content.length}if(l==="classic"){for(const P of s)N=((T=P==null?void 0:P.line)==null?void 0:T.call(p,N,w+1))||N;h.push(N),i.push(N)}else l==="inline"&&h.push(N)}),l==="classic"){for(const b of s)d=((y=b==null?void 0:b.code)==null?void 0:y.call(p,d))||d;f.children.push(d);for(const b of s)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 N={type:"element",tagName:"code",properties:{},children:b};for(const k of s)N=((g=k==null?void 0:k.code)==null?void 0:g.call(p,N))||N;o.children=[];for(let k=0;k<N.children.length;k++){k>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const I=N.children[k];I.type==="element"&&o.children.push(...I.children)}}let m=o;for(const b of s)m=((x=b==null?void 0:b.root)==null?void 0:x.call(p,m))||m;return r&&bc(m,r),m}function G5(e){return e.map(t=>{const n=[];let r="",s;return t.forEach((i,o)=>{const l=!(i.fontStyle&&(i.fontStyle&ct.Underline||i.fontStyle&ct.Strikethrough));l&&ek.test(i.content)&&t[o+1]?(s===void 0&&(s=i.offset),r+=i.content):r?(l?n.push({...i,offset:s,content:r+i.content}):n.push({content:r,offset:s},i),s=void 0,r=""):n.push(i)}),n})}function q5(e){return e.map(t=>t.flatMap(n=>{if(ek.test(n.content))return n;const r=n.content.match(U5);if(!r)return n;const[,s,i,o]=r;if(!s&&!o)return n;const l=[{...n,offset:n.offset+s.length,content:i}];return s&&l.unshift({content:s,offset:n.offset}),o&&l.push({content:o,offset:n.offset+s.length+i.length}),l}))}function W5(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const s=n.at(-1),i=Ch(s.htmlStyle||Lu(s)),o=Ch(r.htmlStyle||Lu(r)),l=s.fontStyle&&(s.fontStyle&ct.Underline||s.fontStyle&ct.Strikethrough),a=r.fontStyle&&(r.fontStyle&ct.Underline||r.fontStyle&ct.Strikethrough);!l&&!a&&i===o?s.content+=r.content:n.push({...r})}return n})}const V5=v5;function Q5(e,t,n){var i;const r={meta:{},options:n,codeToHast:(o,l)=>Du(e,o,l),codeToTokens:(o,l)=>Ou(e,o,l)};let s=V5(Du(e,t,n,r));for(const o of Mu(n))s=((i=o.postprocess)==null?void 0:i.call(r,s,n))||s;return s}async function K5(e){const t=await aL(e);return{getLastGrammarState:(...n)=>hL(t,...n),codeToTokensBase:(n,r)=>_h(t,n,r),codeToTokensWithThemes:(n,r)=>Ww(t,n,r),codeToTokens:(n,r)=>Ou(t,n,r),codeToHast:(n,r)=>Du(t,n,r),codeToHtml:(n,r)=>Q5(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}const gy=4294967295;var X5=class{constructor(e,t={}){A(this,"patterns");A(this,"options");A(this,"regexps");this.patterns=e,this.options=t;const{forgiving:n=!1,cache:r,regexConstructor:s}=t;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(i=>{if(typeof i!="string")return i;const o=r==null?void 0:r.get(i);if(o){if(o instanceof RegExp)return o;if(n)return null;throw o}try{const l=s(i);return r==null||r.set(i,l),l}catch(l){if(r==null||r.set(i,l),n)return null;throw l}})}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,s=[];function i(o,l,a=0){return{index:o,captureIndices:l.indices.map(u=>u==null?{start:gy,end:gy,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 i(o,a,0);s.push([o,a,0])}catch(a){if(this.options.forgiving)continue;throw a}}if(s.length){const o=Math.min(...s.map(l=>l[1].index));for(const[l,a,u]of s)if(a.index===o)return i(l,a,u)}return null}};function Yi(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Y5(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const am=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Ze=String.raw;function Ji(e,t){if(e==null)throw new Error(t??"Value expected");return e}const tk=Ze`\[\^?`,nk=`c.? | C(?:-.?)?|${Ze`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Ze`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Ze`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Ze`o\{[^\}]*\}?`}|${Ze`\d{1,3}`}`,um=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,va=new RegExp(Ze`
|
|
311
|
+
\\ (?:
|
|
312
|
+
${nk}
|
|
313
|
+
| [gk]<[^>]*>?
|
|
314
|
+
| [gk]'[^']*'?
|
|
315
|
+
| .
|
|
316
|
+
)
|
|
317
|
+
| \( (?:
|
|
318
|
+
\? (?:
|
|
319
|
+
[:=!>({]
|
|
320
|
+
| <[=!]
|
|
321
|
+
| <[^>]*>
|
|
322
|
+
| '[^']*'
|
|
323
|
+
| ~\|?
|
|
324
|
+
| #(?:[^)\\]|\\.?)*
|
|
325
|
+
| [^:)]*[:)]
|
|
326
|
+
)?
|
|
327
|
+
| \*[^\)]*\)?
|
|
328
|
+
)?
|
|
329
|
+
| (?:${um.source})+
|
|
330
|
+
| ${tk}
|
|
331
|
+
| .
|
|
332
|
+
`.replace(/\s+/g,""),"gsu"),_d=new RegExp(Ze`
|
|
333
|
+
\\ (?:
|
|
334
|
+
${nk}
|
|
335
|
+
| .
|
|
336
|
+
)
|
|
337
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
338
|
+
| ${tk}
|
|
339
|
+
| &&
|
|
340
|
+
| .
|
|
341
|
+
`.replace(/\s+/g,""),"gsu");function J5(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=xM(n.flags),s=[r.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return s.at(-1)},numOpenGroups:0,popModX(){s.pop()},pushModX(d){s.push(d)},replaceCurrentModX(d){s[s.length-1]=d},singleline:n.rules.singleline};let o=[],l;for(va.lastIndex=0;l=va.exec(e);){const d=Z5(i,e,l[0],va.lastIndex);d.tokens?o.push(...d.tokens):d.token&&o.push(d.token),d.lastIndex!==void 0&&(va.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"?bM(d,f):d).flat(),flags:r}}function Z5(e,t,n,r){const[s,i]=n;if(n==="["||n==="[^"){const o=eM(t,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(s==="\\"){if("AbBGyYzZ".includes(i))return{token:xy(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:cM(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:sk(n)}}if(i==="K")return{token:ik("keep",n)};if(i==="N"||i==="R")return{token:ps("newline",n,{negate:i==="N"})};if(i==="O")return{token:ps("any",n)};if(i==="X")return{token:ps("text_segment",n)};const o=rk(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(s==="("){if(i==="*")return{token:pM(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:hM(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Qs("group",n)};if(n==="(?>")return{token:Qs("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Qs(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Qs("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Qs("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:lM(n)}}if(e.getCurrentModX()){if(n==="#"){const o=t.indexOf(`
|
|
342
|
+
`,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:ps("dot",n)};if(n==="^"||n==="$"){const o=e.singleline?{"^":Ze`\A`,$:Ze`\Z`}[n]:n;return{token:xy(o,n)}}return n==="|"?{token:nM(n)}:um.test(n)?{tokens:vM(n)}:{token:Yn(Yi(n),n)}}function eM(e,t,n){const r=[yy(t[1]==="^",t)];let s=1,i;for(_d.lastIndex=n;i=_d.exec(e);){const o=i[0];if(o[0]==="["&&o[1]!==":")s++,r.push(yy(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Yn(93,o));else if(s--,r.push(rM(o)),!s)break}else{const l=tM(o);Array.isArray(l)?r.push(...l):r.push(l)}}return{tokens:r,lastIndex:_d.lastIndex||e.length}}function tM(e){if(e[0]==="\\")return rk(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!am.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return ps("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?sM(e):e==="&&"?iM(e):Yn(Yi(e),e)}function rk(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return fM(e);if("dDhHsSwW".includes(n))return mM(e);if(e.startsWith(Ze`\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 gM(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)),s=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),i=new TextEncoder;return[...s].map(o=>{const l=[...i.encode(o)].map(a=>`\\x${a.toString(16)}`).join("");return Yn(Yi(o),l)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Yn(yM(e),e);if(by.has(n))return Yn(by.get(n),e);if(/\d/.test(n))return oM(t,e);if(e==="\\")throw new Error(Ze`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Yn(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function nM(e){return{type:"Alternator",raw:e}}function xy(e,t){return{type:"Assertion",kind:e,raw:t}}function sk(e){return{type:"Backreference",raw:e}}function Yn(e,t){return{type:"Character",value:e,raw:t}}function rM(e){return{type:"CharacterClassClose",raw:e}}function sM(e){return{type:"CharacterClassHyphen",raw:e}}function iM(e){return{type:"CharacterClassIntersector",raw:e}}function yy(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function ps(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function ik(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ji(n.flags),raw:t}}function oM(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function lM(e){return{type:"GroupClose",raw:e}}function Qs(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function aM(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function uM(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function cM(e){return{type:"Subroutine",raw:e}}const dM=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),by=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function fM(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 Yn(Yi(t.toUpperCase())-64,e)}function hM(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??(r="");const s=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),i=wy(n),o=wy(r),l={};if(i&&(l.enable=i),o&&(l.disable=o),e.endsWith(")"))return t.replaceCurrentModX(s),ik("flags",e,{flags:l});if(e.endsWith(":"))return t.pushModX(s),t.numOpenGroups++,Qs("group",e,{...(i||o)&&{flags:l}});throw new Error(`Unexpected flag modifier "${e}"`)}function pM(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:s}=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 i=s?s.split(",").filter(f=>f!=="").map(f=>/^[+-]?\d+$/.test(f)?+f:f):[],[o,l,a]=i,u=dM.has(n)?n.toLowerCase():"custom";switch(u){case"fail":case"mismatch":case"skip":if(i.length>0)throw new Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!i.length||i.length>2)throw new Error(`Named callout must have one or two arguments "${i}"`);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(i.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(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(i.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(i.length!==3)throw new Error(`Named callout must have three arguments "${i}"`);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 aM(u,r??null,(s==null?void 0:s.split(","))??null,e)}function vy(e){let t=null,n,r;if(e[0]==="{"){const{minStr:s,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+s>o||i&&+i>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+s,r=i===void 0?+s:i===""?1/0:+i,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 uM(t,n,r,e)}function mM(e){const t=e[1].toLowerCase();return ps({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function gM(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return ps("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function wy(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 xM(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 yM(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 bM(e,t){const{raw:n,inCharClass:r}=e,s=n.slice(1);if(!r&&(s!=="0"&&s.length===1||s[0]!=="0"&&+s<=t))return[sk(n)];const i=[],o=s.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(Ze`Octal encoded byte above 177 unsupported "${n}"`)}else u=Yi(a);i.push(Yn(u,(l===0?"\\":"")+a))}return i}function vM(e){const t=[],n=new RegExp(um,"gy");let r;for(;r=n.exec(e);){const s=r[0];if(s[0]==="{"){const i=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(s);if(i){const{min:o,max:l}=i.groups;if(+o>+l&&s.endsWith("?")){n.lastIndex--,t.push(vy(s.slice(0,-1)));continue}}}t.push(vy(s))}return t}function ok(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 wM(e){return kM.has(e.type)}const kM=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function lk(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=J5(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),s=(h,p)=>{const m=r.tokens[i.nextIndex];switch(i.parent=h,i.nextIndex++,m.type){case"Alternator":return Ms();case"Assertion":return SM(m);case"Backreference":return CM(m,i);case"Character":return wc(m.value,{useLastValid:!!p.isCheckingRangeEnd});case"CharacterClassHyphen":return _M(m,i,p);case"CharacterClassOpen":return NM(m,i,p);case"CharacterSet":return EM(m,i);case"Directive":return RM(m.kind,{flags:m.flags});case"GroupOpen":return jM(m,i,p);case"NamedCallout":return MM(m.kind,m.tag,m.arguments);case"Quantifier":return IM(m,i);case"Subroutine":return TM(m,i);default:throw new Error(`Unexpected token type "${m.type}"`)}},i={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:s},o=DM(LM(r.flags));let l=o.body[0];for(;i.nextIndex<r.tokens.length;){const h=s(l,{});h.type==="Alternative"?(o.body.push(h),l=h):l.body.push(h)}const{capturingGroups:a,hasNumberedRef:u,namedGroupsByName:f,subroutines:d}=i;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(Ze`Subroutine uses a duplicate group name "\g<${h}>"`);f.get(h)[0].isSubroutined=!0}else throw new Error(Ze`Subroutine uses a group name that's not defined "\g<${h}>"`);return o}function SM({kind:e}){return Nh(Ji({"^":"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===Ze`\B`||e===Ze`\Y`})}function CM({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),s=(i,o=!1)=>{const l=t.capturingGroups.length;let a=!1;if(i>l)if(t.skipBackrefValidation)a=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Eh(o?l+1-i:i,{orphan:a})};if(n){const i=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(i)return s(+i.groups.num,!!i.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 Eh(r)}return s(+r)}function _M(e,t,n){const{tokens:r,walk:s}=t,i=t.parent,o=i.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=s(i,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&a.type==="Character")return i.body.pop(),AM(o,a);throw new Error("Invalid character class range")}return wc(Yi("-"))}function NM({negate:e},t,n){const{tokens:r,walk:s}=t,i=[Ua()],o=r[t.nextIndex];let l=Cy(o);for(;l.type!=="CharacterClassClose";){if(l.type==="CharacterClassIntersector")i.push(Ua()),t.nextIndex++;else{const u=i.at(-1);u.body.push(s(u,n))}l=Cy(r[t.nextIndex],o)}const a=Ua({negate:e});return i.length===1?a.body=i[0].body:(a.kind="intersection",a.body=i.map(u=>u.body.length===1?u.body[0]:u)),t.nextIndex++,a}function EM({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:s,skipPropertyNameValidation:i,unicodePropertyMap:o}=r;if(e==="property"){const l=kc(n);if(am.has(l)&&!(o!=null&&o.has(l)))e="posix",n=l;else return Ks(n,{negate:t,normalizeUnknownPropertyNames:s,skipPropertyNameValidation:i,unicodePropertyMap:o})}return e==="posix"?OM(n,{negate:t}):jh(e,{negate:t})}function jM(e,t,n){const{tokens:r,capturingGroups:s,namedGroupsByName:i,skipLookbehindValidation:o,walk:l}=t,a=FM(e),u=a.type==="AbsenceFunction",f=Sy(a),d=f&&a.negate;if(a.type==="CapturingGroup"&&(s.push(a),a.name&&Y5(i,a.name,[]).push(a)),u&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=_y(r[t.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")a.body.push(Ms()),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 y="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(ky(m)||m.type==="CapturingGroup")throw new Error(y)}else if(ky(m)||Sy(m)&&m.negate)throw new Error(y)}}h=_y(r[t.nextIndex])}return t.nextIndex++,a}function IM({kind:e,min:t,max:n},r){const s=r.parent,i=s.body.at(-1);if(!i||!wM(i))throw new Error("Quantifier requires a repeatable token");const o=uk(e,t,n,i);return s.body.pop(),o}function TM({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let s=e.slice(3,-1);const i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(s);if(i){const l=+i.groups.num,a=n.length;if(t.hasNumberedRef=!0,s={"":l,"+":a+l,"-":a+1-l}[i.groups.sign],s<1)throw new Error("Invalid subroutine number")}else s==="0"&&(s=0);const o=ck(s);return r.push(o),o}function PM(e,t){return{type:"AbsenceFunction",kind:e,body:zl(t==null?void 0:t.body)}}function Ms(e){return{type:"Alternative",body:dk(e==null?void 0:e.body)}}function Nh(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!(t!=null&&t.negate)),n}function Eh(e,t){const n=!!(t!=null&&t.orphan);return{type:"Backreference",ref:e,...n&&{orphan:n}}}function ak(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!$M(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:zl(t==null?void 0:t.body)}}function wc(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 Ua(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:dk(e==null?void 0:e.body)}}function AM(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function jh(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 RM(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Ji(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function LM(e){return{type:"Flags",...e}}function fn(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:zl(e==null?void 0:e.body)}}function as(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:zl(e==null?void 0:e.body)}}function MM(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function OM(e,t){const n=!!(t!=null&&t.negate);if(!am.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function uk(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 DM(e,t){return{type:"Regex",body:zl(t==null?void 0:t.body),flags:e}}function ck(e){return{type:"Subroutine",ref:e}}function Ks(e,t){var s;const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=(s=n.unicodePropertyMap)==null?void 0:s.get(kc(e));if(!r){if(n.normalizeUnknownPropertyNames)r=zM(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Ze`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function FM({flags:e,kind:t,name:n,negate:r,number:s}){switch(t){case"absence_repeater":return PM("repeater");case"atomic":return fn({atomic:!0});case"capturing":return ak(s,{name:n});case"group":return fn({flags:e});case"lookahead":case"lookbehind":return as({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function zl(e){if(e===void 0)e=[Ms()];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 dk(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 ky(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Sy(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function $M(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function zM(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 kc(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Cy(e,t){const n=t;return Ji(e,`Unclosed character class${(n==null?void 0:n.type)==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function _y(e){return Ji(e,"Unclosed group")}function Bo(e,t,n=null){function r(i,o){for(let l=0;l<i.length;l++){const a=s(i[l],o,l,i);l=Math.max(-1,l+a)}}function s(i,o=null,l=null,a=null){var g,x;let u=0,f=!1;const d={node:i,parent:o,key:l,container:a,root:e,remove(){wa(a).splice(Math.max(0,Gs(l)+u),1),u--,f=!0},removeAllNextSiblings(){return wa(a).splice(Gs(l)+1)},removeAllPrevSiblings(){const b=Gs(l)+u;return u-=b,wa(a).splice(0,Math.max(0,b))},replaceWith(b,w={}){const N=!!w.traverse;a?a[Math.max(0,Gs(l)+u)]=b:Ji(o,"Can't replace root node")[l]=b,N&&s(b,o,l,a),f=!0},replaceWithMultiple(b,w={}){const N=!!w.traverse;if(wa(a).splice(Math.max(0,Gs(l)+u),1,...b),u+=b.length-1,N){let k=0;for(let I=0;I<b.length;I++)k+=s(b[I],o,Gs(l)+I+k,a)}f=!0},skip(){f=!0}},{type:h}=i,p=t["*"],m=t[h],y=typeof p=="function"?p:p==null?void 0:p.enter,v=typeof m=="function"?m:m==null?void 0:m.enter;if(y==null||y(d,n),v==null||v(d,n),!f)switch(h){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":s(i.min,i,"min"),s(i.max,i,"max");break;case"Quantifier":s(i.body,i,"body");break;case"Regex":r(i.body,i),s(i.flags,i,"flags");break;default:throw new Error(`Unexpected node type "${h}"`)}return(g=m==null?void 0:m.exit)==null||g.call(m,d,n),(x=p==null?void 0:p.exit)==null||x.call(p,d,n),u}return s(e),e}function wa(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function Gs(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const BM=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function UM(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function HM(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const tn=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function cm(e,t,n,r){const s=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1];let o=0,l="";for(const a of e.matchAll(s)){const{0:u,groups:{$skip:f}}=a;if(!f&&(!r||r===tn.DEFAULT==!o)){n instanceof Function?l+=n(a,{context:o?tn.CHAR_CLASS:tn.DEFAULT,negated:i[i.length-1]}):l+=n;continue}u[0]==="["?(o++,i.push(u[1]==="^")):u==="]"&&o&&(o--,i.pop()),l+=u}return l}function fk(e,t,n,r){cm(e,t,n,r)}function GM(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const s=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let i=0,o;for(;o=s.exec(e);){const{0:l,groups:{$skip:a}}=o;if(!a&&(!r||r===tn.DEFAULT==!i))return o;l==="["?i++:l==="]"&&i&&i--,s.lastIndex==o.index&&s.lastIndex++}return null}function ka(e,t,n){return!!GM(e,t,0,n)}function qM(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,s=0,i=1,o;for(;o=n.exec(e);){const[l]=o;if(l==="[")s++;else if(s)l==="]"&&s--;else if(l==="(")i++;else if(l===")"&&(i--,!i)){r=o.index;break}}return e.slice(t,r)}const Ny=new RegExp(String.raw`(?<noncapturingStart>${BM})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function WM(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 s="(?>",i="(?:(?=(",o=[0],l=[];let a=0,u=0,f=NaN,d;do{d=!1;let h=0,p=0,m=!1,y;for(Ny.lastIndex=Number.isNaN(f)?0:f+i.length;y=Ny.exec(e);){const{0:v,index:g,groups:{capturingStart:x,noncapturingStart:b}}=y;if(v==="[")h++;else if(h)v==="]"&&h--;else if(v===s&&!m)f=g,m=!0;else if(m&&b)p++;else if(x)m?p++:(a++,o.push(a+u));else if(v===")"&&m){if(!p){u++;const w=a+u;if(e=`${e.slice(0,f)}${i}${e.slice(f+s.length,g)}))<$$${w}>)${e.slice(g+1)}`,d=!0,l.push(w),UM(n,w),r.size){const N=new Map;r.forEach((k,I)=>{N.set(I>=w?I+1:I,k.map(T=>T>=w?T+1:T))}),r=N}break}p--}}}while(d);return n.push(...l),e=cm(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:p,wrappedBackrefNum:m}})=>{if(p){const y=+p;if(y>o.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${o[y]}`}return`\\${m}`},tn.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const hk=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Nd=new RegExp(String.raw`
|
|
343
|
+
\\(?: \d+
|
|
344
|
+
| c[A-Za-z]
|
|
345
|
+
| [gk]<[^>]+>
|
|
346
|
+
| [pPu]\{[^\}]+\}
|
|
347
|
+
| u[A-Fa-f\d]{4}
|
|
348
|
+
| x[A-Fa-f\d]{2}
|
|
349
|
+
)
|
|
350
|
+
| \((?: \? (?: [:=!>]
|
|
351
|
+
| <(?:[=!]|[^>]+>)
|
|
352
|
+
| [A-Za-z\-]+:
|
|
353
|
+
| \(DEFINE\)
|
|
354
|
+
))?
|
|
355
|
+
| (?<qBase>${hk})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
356
|
+
| \\?.
|
|
357
|
+
`.replace(/\s+/g,""),"gsu");function VM(e){if(!new RegExp(`${hk}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,s="",i=0,o;for(Nd.lastIndex=0;o=Nd.exec(e);){const{0:l,index:a,groups:{qBase:u,qMod:f,invalidQ:d}}=o;if(l==="[")i||(r=a),i++;else if(l==="]")i?i--:r=null;else if(!i)if(f==="+"&&s&&!s.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${l}"`);let h=-1;if(/^\{\d+\}$/.test(u))e=HM(e,a+u.length,f,"");else{if(s===")"||s==="]"){const p=s===")"?n:r;if(p===null)throw new Error(`Invalid unmatched "${s}"`);e=`${e.slice(0,p)}(?>${e.slice(p,a)}${u})${e.slice(a+l.length)}`}else e=`${e.slice(0,a-s.length)}(?>${s}${u})${e.slice(a+l.length)}`;h+=4}Nd.lastIndex+=h}else l[0]==="("?t.push(a):l===")"&&(n=t.length?t.pop():null);s=l}return{pattern:e}}const Jt=String.raw,QM=Jt`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Ih=Jt`\(\?R=(?<rDepth>[^\)]+)\)|${QM}`,Sc=Jt`\(\?<(?![=!])(?<captureName>[^>]+)>`,pk=Jt`${Sc}|(?<unnamed>\()(?!\?)`,ss=new RegExp(Jt`${Sc}|${Ih}|\(\?|\\?.`,"gsu"),Ed="Cannot use multiple overlapping recursions";function KM(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let s=(t==null?void 0:t.captureTransfers)??new Map;if(!new RegExp(Ih,"su").test(e))return{pattern:e,captureTransfers:s,hiddenCaptures:n};if(r==="plugin"&&ka(e,Jt`\(\?\(DEFINE\)`,tn.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const i=[],o=ka(e,Jt`\\[1-9]`,tn.DEFAULT),l=new Map,a=[];let u=!1,f=0,d=0,h;for(ss.lastIndex=0;h=ss.exec(e);){const{0:p,groups:{captureName:m,rDepth:y,gRNameOrNum:v,gRDepth:g}}=h;if(p==="[")f++;else if(f)p==="]"&&f--;else if(y){if(Ey(y),u)throw new Error(Ed);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const x=e.slice(0,h.index),b=e.slice(ss.lastIndex);if(ka(b,Ih,tn.DEFAULT))throw new Error(Ed);const w=+y-1;e=jy(x,b,w,!1,n,i,d),s=Ty(s,x,w,i.length,0,d);break}else if(v){Ey(g);let x=!1;for(const R of a)if(R.name===v||R.num===+v){if(x=!0,R.hasRecursedWithin)throw new Error(Ed);break}if(!x)throw new Error(Jt`Recursive \g cannot be used outside the referenced group "${r==="external"?v:Jt`\g<${v}&R=${g}>`}"`);const b=l.get(v),w=qM(e,b);if(o&&ka(w,Jt`${Sc}|\((?!\?)`,tn.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const N=e.slice(b,h.index),k=w.slice(N.length+p.length),I=i.length,T=+g-1,P=jy(N,k,T,!0,n,i,d);s=Ty(s,N,T,i.length-I,I,d);const E=e.slice(0,b),M=e.slice(b+w.length);e=`${E}${P}${M}`,ss.lastIndex+=P.length-p.length-N.length-k.length,a.forEach(R=>R.hasRecursedWithin=!0),u=!0}else if(m)d++,l.set(String(d),ss.lastIndex),l.set(m,ss.lastIndex),a.push({num:d,name:m});else if(p[0]==="("){const x=p==="(";x&&(d++,l.set(String(d),ss.lastIndex)),a.push(x?{num:d}:{})}else p===")"&&a.pop()}return n.push(...i),{pattern:e,captureTransfers:s,hiddenCaptures:n}}function Ey(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 jy(e,t,n,r,s,i,o){const l=new Set;r&&fk(e+t,Sc,({groups:{captureName:u}})=>{l.add(u)},tn.DEFAULT);const a=[n,r?l:null,s,i,o];return`${e}${Iy(`(?:${e}`,"forward",...a)}(?:)${Iy(`${t})`,"backward",...a)}${t}`}function Iy(e,t,n,r,s,i,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+=cm(e,Jt`${pk}|\\k<(?<backref>[^>]+)>`,({0:h,groups:{captureName:p,unnamed:m,backref:y}})=>{if(y&&r&&!r.has(y))return h;const v=`_$${d}`;if(m||p){const g=o+i.length+1;return i.push(g),XM(s,g),m?h:`(?<${p}${v}>`}return Jt`\k<${y}${v}>`},tn.DEFAULT)}return u}function XM(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Ty(e,t,n,r,s,i){if(e.size&&r){let o=0;fk(t,pk,()=>o++,tn.DEFAULT);const l=i-o+s,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 y of u)if(y<=l)m.push(y);else if(y>l+o+d)m.push(y+r);else if(y<=l+o)for(let v=0;v<=n;v++)m.push(y+o*v);else for(let v=0;v<=n;v++)m.push(y+h+d*v);a.set(p,m)}),a}return e}var We=String.fromCodePoint,se=String.raw,gn={},Cc=globalThis.RegExp;gn.flagGroups=(()=>{try{new Cc("(?i:)")}catch{return!1}return!0})();gn.unicodeSets=(()=>{try{new Cc("[[]]","v")}catch{return!1}return!0})();gn.bugFlagVLiteralHyphenIsRange=gn.unicodeSets?(()=>{try{new Cc(se`[\d\-a]`,"v")}catch{return!0}return!1})():!1;gn.bugNestedClassIgnoresNegation=gn.unicodeSets&&new Cc("[[^a]]","v").test("a");function Fu(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 gl(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Th(e,t){return Py[e]>=Py[t]}function YM(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Py={ES2025:2025,ES2024:2024,ES2018:2018},JM={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function mk(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!JM[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=gn.flagGroups?"ES2025":gn.unicodeSets?"ES2024":"ES2018"),t}var ZM="[ -\r ]",e4=new Set([We(304),We(305)]),Dn=se`[\p{L}\p{M}\p{N}\p{Pc}]`;function gk(e){if(e4.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),s=r4.get(n),i=t4.get(n),o=n4.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),s&&t.add(s),t.add(n),i&&t.add(i),[...t]}var dm=new Map(`C Other
|
|
358
|
+
Cc Control cntrl
|
|
359
|
+
Cf Format
|
|
360
|
+
Cn Unassigned
|
|
361
|
+
Co Private_Use
|
|
362
|
+
Cs Surrogate
|
|
363
|
+
L Letter
|
|
364
|
+
LC Cased_Letter
|
|
365
|
+
Ll Lowercase_Letter
|
|
366
|
+
Lm Modifier_Letter
|
|
367
|
+
Lo Other_Letter
|
|
368
|
+
Lt Titlecase_Letter
|
|
369
|
+
Lu Uppercase_Letter
|
|
370
|
+
M Mark Combining_Mark
|
|
371
|
+
Mc Spacing_Mark
|
|
372
|
+
Me Enclosing_Mark
|
|
373
|
+
Mn Nonspacing_Mark
|
|
374
|
+
N Number
|
|
375
|
+
Nd Decimal_Number digit
|
|
376
|
+
Nl Letter_Number
|
|
377
|
+
No Other_Number
|
|
378
|
+
P Punctuation punct
|
|
379
|
+
Pc Connector_Punctuation
|
|
380
|
+
Pd Dash_Punctuation
|
|
381
|
+
Pe Close_Punctuation
|
|
382
|
+
Pf Final_Punctuation
|
|
383
|
+
Pi Initial_Punctuation
|
|
384
|
+
Po Other_Punctuation
|
|
385
|
+
Ps Open_Punctuation
|
|
386
|
+
S Symbol
|
|
387
|
+
Sc Currency_Symbol
|
|
388
|
+
Sk Modifier_Symbol
|
|
389
|
+
Sm Math_Symbol
|
|
390
|
+
So Other_Symbol
|
|
391
|
+
Z Separator
|
|
392
|
+
Zl Line_Separator
|
|
393
|
+
Zp Paragraph_Separator
|
|
394
|
+
Zs Space_Separator
|
|
395
|
+
ASCII
|
|
396
|
+
ASCII_Hex_Digit AHex
|
|
397
|
+
Alphabetic Alpha
|
|
398
|
+
Any
|
|
399
|
+
Assigned
|
|
400
|
+
Bidi_Control Bidi_C
|
|
401
|
+
Bidi_Mirrored Bidi_M
|
|
402
|
+
Case_Ignorable CI
|
|
403
|
+
Cased
|
|
404
|
+
Changes_When_Casefolded CWCF
|
|
405
|
+
Changes_When_Casemapped CWCM
|
|
406
|
+
Changes_When_Lowercased CWL
|
|
407
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
408
|
+
Changes_When_Titlecased CWT
|
|
409
|
+
Changes_When_Uppercased CWU
|
|
410
|
+
Dash
|
|
411
|
+
Default_Ignorable_Code_Point DI
|
|
412
|
+
Deprecated Dep
|
|
413
|
+
Diacritic Dia
|
|
414
|
+
Emoji
|
|
415
|
+
Emoji_Component EComp
|
|
416
|
+
Emoji_Modifier EMod
|
|
417
|
+
Emoji_Modifier_Base EBase
|
|
418
|
+
Emoji_Presentation EPres
|
|
419
|
+
Extended_Pictographic ExtPict
|
|
420
|
+
Extender Ext
|
|
421
|
+
Grapheme_Base Gr_Base
|
|
422
|
+
Grapheme_Extend Gr_Ext
|
|
423
|
+
Hex_Digit Hex
|
|
424
|
+
IDS_Binary_Operator IDSB
|
|
425
|
+
IDS_Trinary_Operator IDST
|
|
426
|
+
ID_Continue IDC
|
|
427
|
+
ID_Start IDS
|
|
428
|
+
Ideographic Ideo
|
|
429
|
+
Join_Control Join_C
|
|
430
|
+
Logical_Order_Exception LOE
|
|
431
|
+
Lowercase Lower
|
|
432
|
+
Math
|
|
433
|
+
Noncharacter_Code_Point NChar
|
|
434
|
+
Pattern_Syntax Pat_Syn
|
|
435
|
+
Pattern_White_Space Pat_WS
|
|
436
|
+
Quotation_Mark QMark
|
|
437
|
+
Radical
|
|
438
|
+
Regional_Indicator RI
|
|
439
|
+
Sentence_Terminal STerm
|
|
440
|
+
Soft_Dotted SD
|
|
441
|
+
Terminal_Punctuation Term
|
|
442
|
+
Unified_Ideograph UIdeo
|
|
443
|
+
Uppercase Upper
|
|
444
|
+
Variation_Selector VS
|
|
445
|
+
White_Space space
|
|
446
|
+
XID_Continue XIDC
|
|
447
|
+
XID_Start XIDS`.split(/\s/).map(e=>[kc(e),e])),t4=new Map([["s",We(383)],[We(383),"s"]]),n4=new Map([[We(223),We(7838)],[We(107),We(8490)],[We(229),We(8491)],[We(969),We(8486)]]),r4=new Map([gr(453),gr(456),gr(459),gr(498),...jd(8072,8079),...jd(8088,8095),...jd(8104,8111),gr(8124),gr(8140),gr(8188)]),s4=new Map([["alnum",se`[\p{Alpha}\p{Nd}]`],["alpha",se`\p{Alpha}`],["ascii",se`\p{ASCII}`],["blank",se`[\p{Zs}\t]`],["cntrl",se`\p{Cc}`],["digit",se`\p{Nd}`],["graph",se`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",se`\p{Lower}`],["print",se`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",se`[\p{P}\p{S}]`],["space",se`\p{space}`],["upper",se`\p{Upper}`],["word",se`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",se`\p{AHex}`]]);function i4(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function gr(e){const t=We(e);return[t.toLowerCase(),t]}function jd(e,t){return i4(e,t).map(n=>gr(n))}var xk=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function o4(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};yk(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Th(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};Bo(e,l4,r);const s={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},i={currentFlags:s,prevFlags:null,globalFlags:s,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Bo(e,a4,i);const o={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return Bo(e,u4,o),e._originMap=i.groupOriginByCopy,e._strategy=r.strategy,e}var l4={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:s}=e;if(s==="repeater"){const i=fn();i.body[0].body.push(as({negate:!0,body:r}),Ks("Any"));const o=fn();o.body[0].body.push(uk("greedy",0,1/0,i)),n(ze(o,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const s=e.body.filter(i=>i.kind==="flags");for(let i=n+1;i<t.body.length;i++){const o=t.body[i];gl(r,o,[]).push(...s)}},exit({node:e},{flagDirectivesByAlt:t}){var n;if((n=t.get(e))!=null&&n.length){const r=vk(t.get(e));if(r){const s=fn({flags:r});s.body[0].body=e.body,e.body=[ze(s,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:s,remove:i,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(ze(as({body:[Ms({body:[Nh("string_end")]}),Ms({body:[wc(10)]})]}),t));else if(a==="line_start")o(ze(Fn(se`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(a==="search_start")if(h.has(e))s.flags.sticky=!0,i();else{const m=r[n-1];if(m&&m4(m))o(ze(as({negate:!0}),t));else{if(d)throw new Error(se`Uses "\G" in a way that requires a subclass`);o(xr(Nh("string_start"),t)),l.strategy="clip_search"}}else if(!(a==="string_end"||a==="string_start"))if(a==="string_end_newline")o(ze(Fn(se`(?=\n?\z)`),t));else if(a==="word_boundary"){if(!p&&!f){const m=`(?:(?<=${Dn})(?!${Dn})|(?<!${Dn})(?=${Dn}))`,y=`(?:(?<=${Dn})(?=${Dn})|(?<!${Dn})(?!${Dn}))`;o(ze(Fn(u?y:m),t))}}else throw new Error(`Unexpected assertion kind "${a}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Td(n)&&(n=Id(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Td(r)&&(r=Id(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=Ua({body:[e]});n(ze(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:s,digitIsAscii:i,spaceIsAscii:o,wordIsAscii:l}){const{kind:a,negate:u,value:f}=e;if(i&&(a==="digit"||f==="digit")){n(xr(jh("digit",{negate:u}),t));return}if(o&&(a==="space"||f==="space")){n(ze(Pd(Fn(ZM),u),t));return}if(l&&(a==="word"||f==="word")){n(xr(jh("word",{negate:u}),t));return}if(a==="any")n(xr(Ks("Any"),t));else if(a==="digit")n(xr(Ks("Nd",{negate:u}),t));else if(a!=="dot")if(a==="text_segment"){if(r==="strict")throw new Error(se`Use of "\X" requires non-strict accuracy`);const d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=se`\p{RI}{2}|${d}(?:\u200D${d})*`;n(ze(Fn(se`(?>\r\n|${s?se`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(a==="hex")n(xr(Ks("AHex",{negate:u}),t));else if(a==="newline")n(ze(Fn(u?`[^
|
|
448
|
+
]`:`(?>\r
|
|
449
|
+
?|[
|
|
450
|
+
\v\f
\u2028\u2029])`),t));else if(a==="posix")if(!s&&(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-${We(d.codePointAt(0)-1)}${We(d.codePointAt(2)+1)}-`),n(ze(Fn(`[${d}]`),t))}else n(ze(Pd(Fn(s4.get(f)),u),t));else if(a==="property")dm.has(kc(f))||(e.key="sc");else if(a==="space")n(xr(Ks("space",{negate:u}),t));else if(a==="word")n(ze(Pd(Fn(Dn),u),t));else throw new Error(`Unexpected character set kind "${a}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:s,removeAllPrevSiblings:i,removeAllNextSiblings:o}){const{kind:l,flags:a}=e;if(l==="flags")if(!a.enable&&!a.disable)r();else{const u=fn({flags:a});u.body[0].body=o(),s(ze(u,t),{traverse:!0})}else if(l==="keep"){const u=n.body[0],d=n.body.length===1&&ok(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:n;if(t.parent!==d||d.body.length>1)throw new Error(se`Uses "\K" in a way that's unsupported`);const h=as({behind:!0});h.body[0].body=i(),s(ze(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(ze(as({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=fn();t.body[0].body.push(e.body),e.body=ze(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,s=!1;for(const i of e.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{const o=kk(i.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):s=!0}r&&!s&&n.forEach(i=>t.add(i))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(se`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Td(n)&&(n=Id(n,t),e.ref=n)}},a4={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:s}=e;r||n.set(e,[...t.get(s).map(({node:i})=>i)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:s,groupsByName:i,multiplexCapturesToLeftByRef:o,openRefs:l,reffedNodesByReferencer:a}){const u=s.get(e);if(u&&l.has(e.number)){const d=xr(Ay(e.number),t);a.set(d,l.get(e.number)),n(d);return}l.set(e.number,e),o.set(e.number,[]),e.name&&gl(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=gl(i,e.name,new Map);let h=!1;if(u)h=!0;else for(const p of d.values())if(!p.hasDuplicateNameToRemove){h=!0;break}i.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=Fu(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:s,ref:i}=e;if(s){let f=t;for(;(f=f.parent)&&!(f.type==="CapturingGroup"&&(f.name===i||f.number===i)););r.reffedNodesByReferencer.set(e,f);return}const o=r.subroutineRefMap.get(i),l=i===0,a=l?Ay(0):bk(o,r.groupOriginByCopy,null);let u=a;if(!l){const f=vk(f4(o,h=>h.type==="Group"&&!!h.flags)),d=f?Fu(r.globalFlags,f):r.globalFlags;c4(d,r.currentFlags)||(u=fn({flags:h4(d)}),u.body[0].body.push(a))}n(ze(u,t),{traverse:!l})}},u4={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const i=r.reffedNodesByReferencer.get(e).filter(o=>d4(o,e));if(!i.length)n(ze(as({negate:!0}),t));else if(i.length>1){const o=fn({atomic:!0,body:i.reverse().map(l=>Ms({body:[Eh(l.number)]}))});n(ze(o,t))}else e.ref=i[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 s=ak();e.body.at(-1).body.push(s)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function yk(e){Bo(e,{"*"({node:t,parent:n}){t.parent=n}})}function c4(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function d4(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=wk(n.parent);for(const s of r){if(s===n)break;if(s===e||Sk(s,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function bk(e,t,n,r){const s=Array.isArray(e)?[]:{};for(const[i,o]of Object.entries(e))i==="parent"?s.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?s[i]=bk(o,t,s,n):(i==="type"&&o==="CapturingGroup"&&t.set(s,t.get(e)??e),s[i]=o);return s}function Ay(e){const t=ck(e);return t.isRecursive=!0,t}function f4(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Id(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 vk(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(s=>{var i,o;(i=r.enable)!=null&&i[s]&&(delete n.disable[s],n.enable[s]=!0),(o=r.disable)!=null&&o[s]&&(n.disable[s]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function h4({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 wk(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function kk(e){const t=e.find(n=>n.kind==="search_start"||g4(n,{negate:!1})||!p4(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 s=kk(r.body);if(!s)return null;Array.isArray(s)?n.push(...s):n.push(s)}return n}return null}function Sk(e,t){const n=wk(e)??[];for(const r of n)if(r===t||Sk(r,t))return!0;return!1}function p4({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function m4(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function g4(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&ok(e.body[0],{type:"Assertion",kind:"search_start"})}function Td(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Fn(e,t){const r=lk(e,{...t,unicodePropertyMap:dm}).body;return r.length>1||r[0].body.length>1?fn({body:r}):r[0].body[0]}function Pd(e,t){return e.negate=t,e}function xr(e,t){return e.parent=t,e}function ze(e,t){return yk(e),e.parent=t,e}function x4(e,t){const n=mk(t),r=Th(n.target,"ES2024"),s=Th(n.target,"ES2025"),i=n.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,l=null;if(!s){const p=[e.flags.ignoreCase];Bo(e,y4,{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:i,useAppliedIgnoreCase:!!(!s&&o&&l),useFlagMods:s,useFlagV:r,verbose:n.verbose};function d(p){return f.lastNode=u,u=p,YM(b4[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&&gl(h._captureTransfers,p.transferTo,[]).push(m)}),h}var y4={"*":{enter({node:e},t){if(Ly(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Fu({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Ly(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){fm(We(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Ck(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&xk.has(e.value)&&t.setHasCasedChar()}},b4={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?se`\B`:se`\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:s,number:i}=e,o={ignoreCase:t.currentFlags.ignoreCase},l=t.originMap.get(e);return l&&(o.hidden=!0,i>l.number&&(o.transferTo=l.number)),t.captureMap.set(i,o),`(${s?`?<${s}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=We(e),r=qs(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&fm(n)){const s=gk(n);return t.inCharClass?s.join(""):s.length>1?`[${s.join("")}]`:s[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:s,parent:i}=e;let{body:o}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");gn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(My)&&(o=[wc(45),...o.filter(u=>!My(u))]);const l=()=>`[${s?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||gn.bugNestedClassIgnoresNegation)&&!s){const f=o.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(f.length){const d=fn(),h=d.body[0];return d.parent=i,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=Ms({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"&&!s&&a&&((!t.useFlagV||!t.verbose)&&i.kind==="union"&&!(gn.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&i.kind==="intersection"&&o.length===1&&a.type!=="CharacterClassRange"))return o.map(n).join("");if(!t.useFlagV&&i.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,s={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},i=qs(n,s),o=qs(r,s),l=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const a=Ck(e);C4(a).forEach(f=>{l.add(Array.isArray(f)?`${qs(f[0],s)}-${qs(f[1],s)}`:qs(f,s))})}return`${i}-${o}${[...l].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},s){if(e==="dot")return s.currentFlags.dotAll?s.appliedGlobalFlags.dotAll||s.useFlagMods?".":"[^]":se`[^\n]`;if(e==="digit")return t?se`\D`:se`\d`;if(e==="property"){if(s.useAppliedIgnoreCase&&s.currentFlags.ignoreCase&&xk.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?se`\P`:se`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?se`\W`:se`\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},s,i){const o=s.currentFlags;n&&(s.currentFlags=Fu(o,n));const l=t.map(i).join("|"),a=!s.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!s.useFlagMods||!n)?l:`(?${_4(e,n,s.useFlagMods)}${l})`;return s.currentFlags=o,a},LookaroundAssertion({body:e,kind:t,negate:n},r,s){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(s).join("|")})`},Quantifier(e,t,n){return n(e.body)+N4(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})`:se`\g<${t}&R=${r}>`}},v4=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),w4=new Set(["-","\\","]","^","["]),k4=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Ry=new Map([[9,se`\t`],[10,se`\n`],[11,se`\v`],[12,se`\f`],[13,se`\r`],[8232,se`\u2028`],[8233,se`\u2029`],[65279,se`\uFEFF`]]),S4=new RegExp("^\\p{Cased}$","u");function fm(e){return S4.test(e)}function Ck(e,t){const n=!!(t!=null&&t.firstOnly),r=e.min.value,s=e.max.value,i=[];if(r<65&&(s===65535||s>=131071)||r===65536&&s>=131071)return i;for(let o=r;o<=s;o++){const l=We(o);if(!fm(l))continue;const a=gk(l).filter(u=>{const f=u.codePointAt(0);return f<r||f>s});if(a.length&&(i.push(...a),n))break}return i}function qs(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&&E4(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const s=n?r?k4:w4:v4,i=We(e);return(s.has(i)?"\\":"")+i}function C4(e){const t=e.map(s=>s.codePointAt(0)).sort((s,i)=>s-i),n=[];let r=null;for(let s=0;s<t.length;s++)t[s+1]===t[s]+1?r??(r=t[s]):r===null?n.push(t[s]):(n.push([r,t[s]]),r=null);return n}function _4(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:s,disable:i}=t;r=(s!=null&&s.ignoreCase?"i":"")+(s!=null&&s.dotAll?"s":"")+(i?"-":"")+(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")}return`${r}:`}function N4({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 Ly({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function E4(e){return e>47&&e<58}function My({type:e,value:t}){return e==="Character"&&t===45}var Ar,Wn,Cs,Rr,_s,jl,Ph,Wr,j4=(Wr=class extends RegExp{constructor(n,r,s){var t=(...j$)=>(super(...j$),V(this,jl),V(this,Ar,new Map),V(this,Wn,null),V(this,Cs),V(this,Rr,null),V(this,_s,null),A(this,"rawOptions",{}),this);const i=!!(s!=null&&s.lazyCompile);if(n instanceof RegExp){if(s)throw new Error("Cannot provide options when copying a regexp");const o=n;t(o,r),B(this,Cs,o.source),o instanceof Wr&&(B(this,Ar,_(o,Ar)),B(this,Rr,_(o,Rr)),B(this,_s,_(o,_s)),this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...s};t(i?"":n,r),B(this,Cs,n),B(this,Ar,T4(o.hiddenCaptures,o.transfers)),B(this,_s,o.strategy),this.rawOptions=s??{}}i||B(this,Wn,this)}get source(){return _(this,Cs)||"(?:)"}exec(n){if(!_(this,Wn)){const{lazyCompile:i,...o}=this.rawOptions;B(this,Wn,new Wr(_(this,Cs),this.flags,o))}const r=this.global||this.sticky,s=this.lastIndex;if(_(this,_s)==="clip_search"&&r&&s){this.lastIndex=0;const i=re(this,jl,Ph).call(this,n.slice(s));return i&&(I4(i,s,n,this.hasIndices),this.lastIndex+=s),i}return re(this,jl,Ph).call(this,n)}},Ar=new WeakMap,Wn=new WeakMap,Cs=new WeakMap,Rr=new WeakMap,_s=new WeakMap,jl=new WeakSet,Ph=function(n){_(this,Wn).lastIndex=this.lastIndex;const r=km(Wr.prototype,this,"exec").call(_(this,Wn),n);if(this.lastIndex=_(this,Wn).lastIndex,!r||!_(this,Ar).size)return r;const s=[...r];r.length=1;let i;this.hasIndices&&(i=[...r.indices],r.indices.length=1);const o=[0];for(let l=1;l<s.length;l++){const{hidden:a,transferTo:u}=_(this,Ar).get(l)??{};if(a?o.push(null):(o.push(r.length),r.push(s[l]),this.hasIndices&&r.indices.push(i[l])),u&&s[l]!==void 0){const f=o[u];if(!f)throw new Error(`Invalid capture transfer to "${f}"`);if(r[f]=s[l],this.hasIndices&&(r.indices[f]=i[l]),r.groups){_(this,Rr)||B(this,Rr,P4(this.source));const d=_(this,Rr).get(u);d&&(r.groups[d]=s[l],this.hasIndices&&(r.indices.groups[d]=i[l]))}}}return r},Wr);function I4(e,t,n,r){if(e.index+=t,e.input=n,r){const s=e.indices;for(let o=0;o<s.length;o++){const l=s[o];l&&(s[o]=[l[0]+t,l[1]+t])}const i=s.groups;i&&Object.keys(i).forEach(o=>{const l=i[o];l&&(i[o]=[l[0]+t,l[1]+t])})}}function T4(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,s]of t)for(const i of s)gl(n,i,{}).transferTo=r;return n}function P4(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,s=0,i;for(;i=t.exec(e);){const{0:o,groups:{capture:l,name:a}}=i;o==="["?r++:r?o==="]"&&r--:l&&(s++,a&&n.set(s,a))}return n}function A4(e,t){const n=R4(e,t);return n.options?new j4(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function R4(e,t){const n=mk(t),r=lk(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:dm}),s=o4(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=x4(s,n),o=KM(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),l=VM(o.pattern),a=WM(l.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),u={pattern:a.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${i.flags}${i.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,y)=>m-y),d=Array.from(a.captureTransfers),h=s._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 L4(e,t){return A4(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function M4(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||(t.regexConstructor=n=>L4(n,{target:t.target})),{createScanner(n){return new X5(n,t)},createString(n){return{content:n}}}}const O4=1500,_k={typescript:()=>Z(()=>import("./typescript-BPQ3VLAy.js"),[]),tsx:()=>Z(()=>import("./tsx-COt5Ahok.js"),[]),javascript:()=>Z(()=>import("./javascript-wDzz0qaB.js"),[]),jsx:()=>Z(()=>import("./jsx-g9-lgVsj.js"),[]),json:()=>Z(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>Z(()=>import("./jsonc-Des-eS-w.js"),[]),yaml:()=>Z(()=>import("./yaml-Buea-lGh.js"),[]),toml:()=>Z(()=>import("./toml-vGWfd6FD.js"),[]),markdown:()=>Z(()=>import("./markdown-Cvjx9yec.js"),[]),mdx:()=>Z(()=>import("./mdx-Cmh6b_Ma.js"),[]),html:()=>Z(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2])),css:()=>Z(()=>import("./css-CLj8gQPS.js"),[]),scss:()=>Z(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([3,2])),less:()=>Z(()=>import("./less-B1dDrJ26.js"),[]),python:()=>Z(()=>import("./python-B6aJPvgy.js"),[]),ruby:()=>Z(()=>import("./ruby-CV7NnX5q.js"),__vite__mapDeps([4,0,1,2,5,6,7,8,9,10,11,12,13,14,15,16])),go:()=>Z(()=>import("./go-C27-OAKa.js"),[]),rust:()=>Z(()=>import("./rust-B1yitclQ.js"),[]),java:()=>Z(()=>import("./java-CylS5w8V.js"),[]),kotlin:()=>Z(()=>import("./kotlin-BdnUsdx6.js"),[]),swift:()=>Z(()=>import("./swift-D82vCrfD.js"),[]),csharp:()=>Z(()=>import("./csharp-DSvCPggb.js"),[]),c:()=>Z(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>Z(()=>import("./cpp-DIPi6g--.js"),__vite__mapDeps([12,13,7])),"objective-c":()=>Z(()=>import("./objective-c-DXmwc3jG.js"),[]),php:()=>Z(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([17,0,1,2,5,6,7,18])),shellscript:()=>Z(()=>import("./shellscript-Yzrsuije.js"),[]),sql:()=>Z(()=>import("./sql-CRqJ_cUM.js"),[]),dockerfile:()=>Z(()=>import("./dockerfile-BcOcwvcX.js"),[]),xml:()=>Z(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([5,6])),vue:()=>Z(()=>import("./vue-DMJtu8ND.js"),__vite__mapDeps([19,2,1,9,18,0])),svelte:()=>Z(()=>import("./svelte-DR4MIrkg.js"),__vite__mapDeps([20,1,9,2])),graphql:()=>Z(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([8,1,9,10,11])),diff:()=>Z(()=>import("./diff-D97Zzqfu.js"),[]),ini:()=>Z(()=>import("./ini-BEwlwnbL.js"),[]),make:()=>Z(()=>import("./make-CHLpvVh8.js"),[]),lua:()=>Z(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([15,13])),r:()=>Z(()=>import("./r-Dspwwk_N.js"),[]),scala:()=>Z(()=>import("./scala-C151Ov-r.js"),[]),dart:()=>Z(()=>import("./dart-bE4Kk8sk.js"),[]),elixir:()=>Z(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([21,0,1,2])),haskell:()=>Z(()=>import("./haskell-Df6bDoY_.js"),[])},D4={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",makefile:"make",gnumakefile:"make",mk:"make",docker:"dockerfile","docker-compose":"yaml"};function F4(e){if(!e)return null;const t=e.toLowerCase().trim();return t?t in _k?t:D4[t]??null:null}let Ad=null;const Oy=new Set,Rd=new Map;async function Nk(){return Ad||(Ad=(async()=>{const[e,t]=await Promise.all([Z(()=>import("./github-light-DAi9KRSo.js"),[]),Z(()=>import("./github-dark-DHJKELXO.js"),[])]);return K5({themes:[e.default,t.default],langs:[],engine:M4()})})()),Ad}async function $4(e){if(Oy.has(e))return;const t=Rd.get(e);if(t)return t;const n=_k[e];if(!n)return;const r=(async()=>{try{const s=await Nk(),i=await n();await s.loadLanguage(i),Oy.add(e)}finally{Rd.delete(e)}})();return Rd.set(e,r),r}async function z4(e,t,n){const r=F4(t);if(!r||e.length===0)return null;let s=0;for(let o=0;o<e.length;o++)e.charCodeAt(o)===10&&s++;return s+1>O4?null:(await $4(r),(await Nk()).codeToHtml(e,{lang:r,themes:{light:"github-light",dark:"github-dark"},defaultColor:!1,transformers:n==null?void 0:n.transformers}))}function zi({code:e,lang:t,wrap:n=!1,tone:r="default",transformers:s,className:i,defer:o=!1,diffRoles:l}){const[a,u]=S.useState(null),f=S.useMemo(()=>l?[B4(l),...s??[]]:s,[l,s]);S.useEffect(()=>{let m=!1;if(u(null),!o)return z4(e,t,{transformers:f}).then(y=>{m||u(y)}).catch(y=>{}),()=>{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(`
|
|
451
|
+
`);return c.jsx("pre",{className:D("diff-unified overflow-auto",p,d,h,i),children:m.map((y,v)=>{const g=l[v]??"context",x=g==="add"?"+":g==="del"?"−":" ";return c.jsxs("div",{className:D("flex",Ek(g)),children:[c.jsx("span",{className:"diff-marker-cell",children:x}),c.jsx("span",{className:"flex-1 pr-2",children:y||" "})]},v)})})}return c.jsx("pre",{className:D("overflow-auto",p,d,h,i),children:e})}return c.jsx("div",{className:D("shiki-mount overflow-auto",p,n&&"shiki-wrap",h,l&&"diff-unified",i),dangerouslySetInnerHTML:{__html:a}})}function Ek(e){return e==="add"?"diff-line-add":e==="del"?"diff-line-del":void 0}function B4(e){return{name:"pi-pilot-unified-diff",line(t,n){const r=e[n-1]??"context",s=r==="add"?"+":r==="del"?"−":" ";t.children.unshift({type:"element",tagName:"span",properties:{class:"diff-marker-cell"},children:[{type:"text",value:s}]});const i=Ek(r);if(i){const o=t.properties??(t.properties={}),l=typeof o.class=="string"?o.class:Array.isArray(o.class)?o.class.join(" "):"";o.class=l?`${l} ${i}`:i}}}}const jk="pi-pilot-theme",xi=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):void 0;function Ld(e){return e!=="system"?e:xi!=null&&xi.matches?"dark":"light"}function U4(){try{const e=localStorage.getItem(jk);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function Md(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 hm=Qi((e,t)=>{const n=U4(),r=Ld(n);Md(r);const s=()=>{const{choice:i}=t();if(i!=="system")return;const o=Ld("system");Md(o),e({resolved:o})};return xi==null||xi.addEventListener("change",s),{choice:n,resolved:r,setTheme:i=>{const o=Ld(i);Md(o);try{localStorage.setItem(jk,i)}catch{}e({choice:i,resolved:o})}}});hm.getState();const Dy=80,H4=600;function Ik({code:e,lang:t,className:n}){const r=S.useRef(null),[s,i]=S.useState(Dy),o=hm(l=>l.resolved);return S.useEffect(()=>{const l=a=>{var f;if(a.source!==((f=r.current)==null?void 0:f.contentWindow))return;const u=a.data;!u||u.type!=="pi-preview-height"||typeof u.height=="number"&&i(Math.max(Dy,Math.min(H4,Math.ceil(u.height))))};return window.addEventListener("message",l),()=>window.removeEventListener("message",l)},[]),c.jsx("iframe",{ref:r,title:`${t??"html"} preview`,sandbox:"allow-scripts",srcDoc:G4(e,o),className:D("block w-full border-0 bg-transparent",n),style:{height:s}})}function G4(e,t){return`<!doctype html>
|
|
452
|
+
<html>
|
|
453
|
+
<head>
|
|
454
|
+
<meta charset="utf-8">
|
|
455
|
+
<meta http-equiv="Content-Security-Policy" content="${["default-src 'none'","img-src data: blob:","media-src data: blob:","style-src 'unsafe-inline'","font-src data:","script-src 'unsafe-inline'","connect-src 'none'","form-action 'none'","base-uri 'none'","frame-src 'none'"].join("; ")}">
|
|
456
|
+
<meta name="color-scheme" content="${t}">
|
|
457
|
+
<style>
|
|
458
|
+
html { color-scheme: ${t}; }
|
|
459
|
+
html, body { margin: 0; padding: 0; background: Canvas; color: CanvasText; }
|
|
460
|
+
body { font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; }
|
|
461
|
+
</style>
|
|
462
|
+
</head>
|
|
463
|
+
<body>
|
|
464
|
+
${e}
|
|
465
|
+
<script>
|
|
466
|
+
(function () {
|
|
467
|
+
// Measure <body>, not <html>: documentElement.scrollHeight is floored at
|
|
468
|
+
// the iframe's own viewport height, which feeds back on itself and never
|
|
469
|
+
// shrinks. body sizes to its content.
|
|
470
|
+
function report() {
|
|
471
|
+
var body = document.body;
|
|
472
|
+
if (!body) return;
|
|
473
|
+
var h = Math.max(body.scrollHeight, Math.ceil(body.getBoundingClientRect().height));
|
|
474
|
+
parent.postMessage({ type: "pi-preview-height", height: h }, "*");
|
|
475
|
+
}
|
|
476
|
+
window.addEventListener("load", report);
|
|
477
|
+
if (window.ResizeObserver) {
|
|
478
|
+
try {
|
|
479
|
+
new ResizeObserver(report).observe(document.body);
|
|
480
|
+
} catch (e) {}
|
|
481
|
+
}
|
|
482
|
+
report();
|
|
483
|
+
})();
|
|
484
|
+
<\/script>
|
|
485
|
+
</body>
|
|
486
|
+
</html>`}const Tk=S.createContext(!1);function xl({text:e,streaming:t,className:n}){return c.jsxs("div",{className:D("font-sans text-[14px] leading-[1.5] tracking-[-0.005em] text-foreground","[&>p:last-child]:inline","[overflow-wrap:anywhere]",n),children:[c.jsx(Tk.Provider,{value:t??!1,children:c.jsx(JP,{remarkPlugins:[f3],components:q4,children:e})}),t&&c.jsx("span",{className:"ml-1 inline-block h-[14px] w-[7px] translate-y-[2px] rounded-[1px] bg-brand align-baseline animate-v2-blink","aria-hidden":!0})]})}const q4={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 [&>li::before]:!content-none",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:D("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-subtle 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=W4(e);return n?c.jsx(K4,{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 W4(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,s=r?r.slice(9):void 0;let i="";for(const l of t.children||[])l.type==="text"&&typeof l.value=="string"&&(i+=l.value);return i.endsWith(`
|
|
487
|
+
`)&&(i=i.slice(0,-1)),{code:i,lang:s}}const V4=new Set(["html","svg"]),Q4="code";function K4({code:e,lang:t}){const n=or(h=>h.pushToast),[r,s]=S.useState(!1),[i,o]=S.useState(Q4),l=S.useContext(Tk),u=!!t&&V4.has(t.toLowerCase())&&!l,f=u&&i==="preview",d=async()=>{if(e)try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!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:[f?c.jsx(Ik,{code:e,lang:t}):c.jsx(zi,{code:e,lang:t,className:"px-3 py-2.5",defer:l}),c.jsxs("div",{className:"absolute right-1.5 top-1.5 flex items-center gap-1",children:[u&&c.jsxs("div",{className:"flex items-center gap-0.5 rounded-md border border-border-soft bg-card p-0.5 text-[11px] font-medium",children:[c.jsxs("button",{type:"button",onClick:()=>o("code"),"aria-pressed":i==="code",className:D("flex items-center gap-1 rounded-[5px] px-1.5 py-0.5 transition-colors",i==="code"?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:text-foreground"),children:[c.jsx(X1,{className:"h-3 w-3"}),"Code"]}),c.jsxs("button",{type:"button",onClick:()=>o("preview"),"aria-pressed":i==="preview",className:D("flex items-center gap-1 rounded-[5px] px-1.5 py-0.5 transition-colors",i==="preview"?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:text-foreground"),children:[c.jsx(Y1,{className:"h-3 w-3"}),"Preview"]})]}),c.jsx("button",{type:"button",onClick:d,title:"Copy code","aria-label":"Copy code",className:"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(qi,{className:"h-3 w-3 text-signal-ok"}):c.jsx(Op,{className:"h-3 w-3"})})]})]})}function X4(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,s=n&&n.length>0,i=r&&r.length>0;return!s&&!i?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 Y4(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 J4(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 s of n){if(!s||typeof s!="object")continue;const i=s;typeof i.label=="string"&&r.push({label:i.label,description:typeof i.description=="string"?i.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 Z4({item:e,onSubmit:t}){const n=S.useMemo(()=>J4(e.args),[e.args]);return n?e.status==="error"?c.jsxs($u,{children:[c.jsx(zu,{header:n.header,statusPill:c.jsx(ft,{tone:"warn",children:"aborted"})}),c.jsx(pm,{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(rO,{parsed:n,details:e.details,resultText:e.text}):c.jsx(eO,{parsed:n,onSubmit:t}):c.jsxs($u,{children:[c.jsx(zu,{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 eO({parsed:e,onSubmit:t}){const[n,r]=S.useState(new Set),[s,i]=S.useState(!1),[o,l]=S.useState(""),[a,u]=S.useState(!1);S.useEffect(()=>{if(!a)return;const y=setTimeout(()=>u(!1),12e3);return()=>clearTimeout(y)},[a]);const f=y=>{r(v=>{if(e.multiSelect){const g=new Set(v);return g.has(y)?g.delete(y):g.add(y),g.size>0&&i(!1),g}return i(!1),new Set([y])})},d=()=>{i(y=>{const v=!y;return v&&r(new Set),v})},h=s?o.trim().length>0:n.size>0,p=()=>{!h||a||(u(!0),t(s?{kind:"other",text:o.trim()}:{kind:"option",indices:[...n].sort((y,v)=>y-v)}))},m=()=>{a||(u(!0),t({kind:"skip"}))};return c.jsxs($u,{children:[c.jsx(zu,{header:e.header,statusPill:a?c.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground",children:[c.jsx(wt,{className:"h-3 w-3 text-brand animate-v2-spin"}),"sending"]}):c.jsx(ft,{tone:"brand",children:"awaiting"})}),c.jsx(pm,{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((y,v)=>c.jsx("li",{children:c.jsx(tO,{option:y,checked:n.has(v),disabled:a,multi:e.multiSelect,onToggle:()=>f(v)})},v)),e.allowOther&&c.jsx("li",{children:c.jsx(nO,{checked:s,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:D("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 tO({option:e,checked:t,disabled:n,multi:r,onToggle:s}){return c.jsxs("button",{type:"button",onClick:s,disabled:n,className:D("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-ghost":"border-border-soft bg-card hover:border-border hover:bg-accent/40",n&&"cursor-not-allowed opacity-60"),children:[c.jsx("span",{className:D("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:D("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:D("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 nO({checked:e,value:t,disabled:n,onToggle:r,onChange:s,onEnter:i}){return c.jsxs("div",{className:D("flex items-start gap-2.5 rounded-md border px-2.5 py-1.5",e?"border-brand bg-brand-ghost":"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:D("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=>s(o.target.value),onFocus:()=>{e||r()},onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),i())},className:D("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 rO({parsed:e,details:t,resultText:n}){const r=S.useMemo(()=>X4(t)??Y4(n),[t,n]),s=S.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]),i=r.kind==="skip"?c.jsx(ft,{tone:"warn",children:"skipped"}):r.kind==="timeout"?c.jsx(ft,{tone:"warn",children:"timed out"}):c.jsx(ft,{tone:"ok",children:"answered"});return c.jsxs($u,{children:[c.jsx(zu,{header:e.header,statusPill:i}),c.jsx(pm,{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=s.has(l);return c.jsxs("li",{className:D("flex items-start gap-2.5 rounded-md border px-2.5 py-1.5",a?"border-brand bg-brand-ghost":"border-border-soft bg-card opacity-60"),children:[c.jsx("span",{className:D("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:D("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:D("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:D("flex items-start gap-2.5 rounded-md border border-brand bg-brand-ghost 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 $u({children:e}){return c.jsx("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:e})}function zu({header:e,statusPill:t}){return c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[c.jsx(Fs,{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(ft,{tone:"ghost",className:"shrink-0 max-w-[120px] truncate",children:e}),c.jsx("span",{className:"min-w-0 flex-1"}),t]})}function pm({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 _c="create_artifact",sO=new Set(["html","svg","markdown","code"]);function iO(e){return e.kind==="tool"&&e.toolName===_c}function Pk(e){const t=e.args;if(!t||typeof t!="object")return null;const n=t,{type:r,title:s,content:i}=n;if(typeof r!="string"||!sO.has(r)||typeof s!="string"||!s.trim()||typeof i!="string")return null;const o=typeof n.id=="string"&&n.id.trim()?n.id.trim():e.toolCallId,l=typeof n.language=="string"?n.language:void 0;return{toolCallId:e.toolCallId,id:o,type:r,title:s,content:i,...l?{language:l}:{}}}function oO(e){const t=[];for(const n of e){if(!iO(n))continue;const r=Pk(n);r&&t.push(r)}return t}function lO(e){return e.length?e[e.length-1]:null}function aO(e,t){if(!t)return null;for(let n=e.length-1;n>=0;n--)if(e[n].toolCallId===t)return e[n];return null}function Ak(e,t){return e.filter(n=>n.id===t)}function uO(e,t){const n=Ak(e,t.id),r=n.findIndex(s=>s.toolCallId===t.toolCallId);return{index:r>=0?r+1:n.length,count:n.length}}function cO(e){const t=[],n=new Map;for(const r of e)n.has(r.id)||t.push(r.id),n.set(r.id,r);return t.map(r=>n.get(r))}const yl=Qi(e=>({rightPanel:null,togglePanel:t=>e(n=>({rightPanel:n.rightPanel===t?null:t})),openPanel:t=>e({rightPanel:t}),closePanel:()=>e({rightPanel:null})})),bl=Qi(e=>({selectedToolCallId:null,open:t=>{e({selectedToolCallId:t}),yl.getState().openPanel("artifact")},select:t=>e({selectedToolCallId:t}),clear:()=>e({selectedToolCallId:null})})),dO=25e4;function fO(e,t){if(e===t)return Od(e).map(d=>({role:"context",text:d}));const n=Od(e),r=Od(t);let s=0;const i=Math.min(n.length,r.length);for(;s<i&&n[s]===r[s];)s++;let o=n.length,l=r.length;for(;o>s&&l>s&&n[o-1]===r[l-1];)o--,l--;const a=[];for(let d=0;d<s;d++)a.push({role:"context",text:n[d]});const u=n.slice(s,o),f=r.slice(s,l);if(u.length*f.length>dO){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(...mO(u,f));for(let d=o;d<n.length;d++)a.push({role:"context",text:n[d]});return a}function hO(e){return{code:e.map(t=>t.text).join(`
|
|
488
|
+
`),roles:e.map(t=>t.role)}}function pO(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 Od(e){return e===""?[]:e.split(`
|
|
489
|
+
`)}function mO(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 s=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--)s[a][u]=e[a]===t[u]?s[a+1][u+1]+1:Math.max(s[a+1][u],s[a][u+1]);const i=[];let o=0,l=0;for(;o<n&&l<r;)e[o]===t[l]?(i.push({role:"context",text:e[o]}),o++,l++):s[o+1][l]>=s[o][l+1]?(i.push({role:"del",text:e[o]}),o++):(i.push({role:"add",text:t[l]}),l++);for(;o<n;)i.push({role:"del",text:e[o++]});for(;l<r;)i.push({role:"add",text:t[l++]});return i}function vl({children:e}){return c.jsx("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:e})}function wl({children:e,tone:t="muted-foreground"}){return c.jsx("pre",{className:D(`${lc} 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 Bl({hasBody:e,header:t,body:n}){const[r,s]=S.useState(!1),i=S.useId();return e?c.jsxs(vl,{children:[c.jsx("div",{role:"button",tabIndex:0,"aria-label":"Toggle details","aria-expanded":r,"aria-controls":i,onClick:()=>s(o=>!o),onKeyDown:o=>{o.target===o.currentTarget&&(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),s(l=>!l))},className:"w-full cursor-pointer text-left ring-brand-focus transition-colors hover:bg-accent/30",children:t}),r&&n&&c.jsx("div",{id:i,children:n})]}):c.jsx(vl,{children:t})}function mm({name:e,verb:t,path:n,status:r,suffix:s,stats:i}){return c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[c.jsx(Fs,{tool:e,className:"shrink-0 text-muted-foreground"}),c.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:t}),n?c.jsx(gO,{path:n}):c.jsx("span",{className:"flex-1 text-muted-foreground",children:"…"}),s&&c.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:s}),i&&(i.adds>0||i.dels>0)&&c.jsxs("span",{className:"shrink-0 font-mono text-[11.5px] tabular-nums",children:[i.adds>0&&c.jsxs("span",{className:"text-signal-ok",children:["+",i.adds]}),i.adds>0&&i.dels>0&&" ",i.dels>0&&c.jsxs("span",{className:"text-signal-error",children:["−",i.dels]})]}),c.jsx(gm,{status:r})]})}function gm({status:e}){return e==="ok"?c.jsx(ft,{tone:"ok",children:"done"}):e==="error"?c.jsx(ft,{tone:"error",children:"error"}):c.jsx(ft,{tone:"warn",children:"running"})}function gO({path:e}){const t=or(o=>o.pushToast),[n,r]=S.useState(!1),s=Ha(e),i=async o=>{o.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1200),t({id:`copy-${Date.now()}`,workspaceId:"",message:`Copied: ${s}`,notifyType:"info"})}catch{t({id:`copy-${Date.now()}`,workspaceId:"",message:"Copy failed — clipboard not available",notifyType:"warning"})}};return c.jsxs("button",{type:"button",onClick:i,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:s}),n?c.jsx(qi,{className:"h-3 w-3 shrink-0 text-signal-ok"}):c.jsx(Op,{className:"h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60"})]})}function xO({index:e,rows:t,multi:n,lang:r}){const{code:s,roles:i}=S.useMemo(()=>hO(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(zi,{code:s,lang:r,diffRoles:i})]})}function Ha(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 Rk(e){return e&&typeof e=="object"?e:void 0}function Zt(e){return typeof e=="string"?e:void 0}function Fy(e){return typeof e=="number"?e:void 0}function xm(e){return Zt(e==null?void 0:e.path)??Zt(e==null?void 0:e.file_path)}function yO(e){if(!e)return[];if(Array.isArray(e.edits))return e.edits.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r.oldText??r.old_string,i=r.newText??r.new_string;return typeof s=="string"&&typeof i=="string"?[{oldText:s,newText:i}]:[]});const t=Zt(e.old_string)??Zt(e.oldText),n=Zt(e.new_string)??Zt(e.newText);return typeof t=="string"&&typeof n=="string"?[{oldText:t,newText:n}]:[]}function bO(e,t){if(!t)return;if(e==="grep"){const r=Zt(t.pattern),s=Zt(t.path);if(r)return`/${r}/${s?` in ${Ha(s)}`:""}`}if(e==="find"){const r=Zt(t.pattern),s=Zt(t.path);if(r)return`${r}${s?` in ${Ha(s)}`:""}`}if(e==="ls"){const r=Zt(t.path);return r?Ha(r):"."}const n=Object.keys(t);if(n.length!==0)return`(${n.slice(0,4).join(", ")}${n.length>4?", …":""})`}function vO({item:e}){const t=bl(i=>i.open),n=bl(i=>i.selectedToolCallId),r=Pk(e);if(!r)return c.jsx(vl,{children:c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 text-[12.5px] text-muted-foreground",children:[c.jsx(ll,{className:"h-3.5 w-3.5 shrink-0"}),"Artifact"]})});const s=n===r.toolCallId;return c.jsx(vl,{children:c.jsxs("button",{type:"button",onClick:()=>t(r.toolCallId),className:D("flex w-full items-center gap-2.5 px-3 py-2 text-left ring-brand-focus transition-colors hover:bg-accent/40",s&&"bg-brand-ghost/40"),children:[c.jsx(ll,{className:"h-4 w-4 shrink-0 text-brand"}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-[12.5px] font-medium text-foreground",children:r.title}),c.jsx(ft,{tone:"ghost",children:r.type}),e.status==="running"?c.jsx(ft,{tone:"warn",children:"saving"}):e.status==="error"?c.jsx(ft,{tone:"error",children:"error"}):c.jsxs("span",{className:"inline-flex shrink-0 items-center gap-0.5 text-[11.5px] font-medium text-brand",children:["Open",c.jsx(Wi,{className:"h-3 w-3"})]})]})})}const Dd={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 wO(e){if(e<0||e>255||e<16)return;if(e<232){const n=e-16,r=Math.floor(n/36),s=Math.floor(n%36/6),i=n%6,o=[0,95,135,175,215,255];return`rgb(${o[r]},${o[s]},${o[i]})`}const t=8+(e-232)*10;return`rgb(${t},${t},${t})`}function kO(e,t){const n={...e};for(let r=0;r<t.length;r++){const s=t[r];switch(s){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 i=t[r+1];if(i===5){const o=t[r+2];if(typeof o=="number"){const l=wO(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=Dd[a],n.fgStyle=void 0}}r+=2}else if(i===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:Dd[s]&&(n.fgClass=Dd[s],n.fgStyle=void 0)}}return n}const $y=/\x1b(?:\[([0-9;]*)([a-zA-Z])|\][^\x07\x1b]*(?:\x07|\x1b\\))/g;function SO(e){return e.includes("\r")?e.split(`
|
|
490
|
+
`).map(t=>{if(!t.includes("\r"))return t;const n=t.split("\r");return n[n.length-1]??""}).join(`
|
|
491
|
+
`):e}function kl(e){const t=SO(e),n=[];let r={},s=0,i=0;const o=a=>{if(!a)return;if(!CO(r)){n.push(a);return}const u=_O(r),f=NO(r);n.push(c.jsx("span",{className:u||void 0,style:f,children:a},i++))};$y.lastIndex=0;let l;for(;(l=$y.exec(t))!==null;){const a=l.index;if(a>s&&o(t.slice(s,a)),l[2]==="m"){const u=l[1]?l[1].split(";").map(f=>f===""?0:Number(f)):[0];r=kO(r,u)}s=a+l[0].length}return s<t.length&&o(t.slice(s)),n}function CO(e){return!!(e.fgClass||e.fgStyle||e.bold||e.dim||e.italic||e.underline)}function _O(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 NO(e){return e.fgStyle?{color:e.fgStyle}:void 0}const EO={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"},jO={dockerfile:"dockerfile",makefile:"make",gnumakefile:"make"};function ym(e){if(!e)return;const t=e.lastIndexOf("/"),n=(t>=0?e.slice(t+1):e).toLowerCase();if(!n)return;const r=jO[n];if(r)return r;const s=n.lastIndexOf(".");if(s<=0)return;const i=n.slice(s+1);return EO[i]}function IO({item:e,args:t}){const n=xm(t),r=ym(n),s=S.useMemo(()=>yO(t),[t]),i=S.useMemo(()=>s.map(u=>fO(u.oldText,u.newText)),[s]),o=e.status==="error",l=S.useMemo(()=>{let u=0,f=0;for(const d of i){const h=pO(d);u+=h.adds,f+=h.dels}return{adds:u,dels:f}},[i]),a=i.length>0||!!e.text;return c.jsx(Bl,{hasBody:a,header:c.jsx(mm,{name:"edit",verb:"Edited",path:n,status:e.status,stats:l}),body:c.jsxs(c.Fragment,{children:[i.length>0&&c.jsx("div",{className:`${lc} flex flex-col gap-2 overflow-auto border-t border-border-soft bg-background p-2`,children:i.map((u,f)=>c.jsx(xO,{index:f,rows:u,multi:i.length>1,lang:r},f))}),e.text&&(i.length===0||o)&&c.jsx(wl,{children:kl(e.text)})]})})}function TO({item:e,args:t}){const n=xm(t),r=Zt(t==null?void 0:t.content)??"",s=ym(n),i=e.status==="error",o=!!r||!!e.text,l=r?r.split(`
|
|
492
|
+
`).length:void 0;return c.jsx(Bl,{hasBody:o,header:c.jsx(mm,{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:`${lc} overflow-auto border-t border-border-soft bg-background px-3 py-2`,children:c.jsx(zi,{code:r,lang:s})}),!r&&e.text&&c.jsx(wl,{children:kl(e.text)}),r&&i&&e.text&&c.jsx(wl,{children:kl(e.text)})]})})}function PO({item:e,args:t}){const n=xm(t),r=ym(n),s=Fy(t==null?void 0:t.offset),i=Fy(t==null?void 0:t.limit),o=i!==void 0?`lines ${s??1}–${(s??1)+i-1}`:s!==void 0?`from line ${s}`:void 0,l=!!e.text;return c.jsx(Bl,{hasBody:l,header:c.jsx(mm,{name:"read",verb:"Read",path:n,status:e.status,suffix:o}),body:e.text?c.jsx("div",{className:`${lc} overflow-auto border-t border-border-soft bg-background px-3 py-2`,children:c.jsx(zi,{code:e.text,lang:r,wrap:!0,tone:"muted"})}):void 0})}function zy({command:e,output:t,exitCode:n,running:r,errored:s}){const o=r?"running":s===!0||n!==void 0&&n!==0?"error":"ok",l=!!t,a=t?t.split(`
|
|
493
|
+
`).length:void 0;return c.jsx(Bl,{hasBody:l,header:c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[c.jsx(Fs,{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(gm,{status:o})]}),body:t?c.jsx(wl,{tone:"foreground",children:kl(t)}):void 0})}function Lk({item:e,args:t}){const n=bO(e.toolName,t),r=!!e.text;return c.jsx(Bl,{hasBody:r,header:c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[c.jsx(Fs,{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(gm,{status:e.status})]}),body:e.text?c.jsx(wl,{children:kl(e.text)}):void 0})}function AO({item:e,isCurrent:t}){const n=S.useMemo(()=>cv(uv(e.details)),[e.details]),r=n.length,[s,i]=S.useState(!1),o=S.useId();if(r===0)return c.jsx(Lk,{item:e,args:Rk(e.args)});const l=n.filter(d=>d.status==="completed").length,a=l/r,u=t||s,f=c.jsxs(c.Fragment,{children:[!t&&c.jsx(Jr,{className:D("h-3 w-3 shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")}),c.jsx(Fs,{tool:"todo",className:"shrink-0 text-muted-foreground"}),c.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Todos"}),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:[l,"/",r]}),c.jsx("span",{className:`inline-block h-1 ${ov} overflow-hidden rounded-full bg-border-soft`,role:"progressbar","aria-valuemin":0,"aria-valuenow":l,"aria-valuemax":r,"aria-label":`Todo progress: ${l} of ${r} completed`,children:c.jsx("span",{className:"block h-full rounded-full bg-brand transition-[width] duration-300",style:{width:`${a*100}%`}})})]})]});return c.jsxs(vl,{children:[t?c.jsx("div",{className:"flex items-center gap-2.5 px-3 py-2",children:f}):c.jsx("button",{type:"button","aria-expanded":s,"aria-controls":o,onClick:()=>i(d=>!d),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:f}),u&&c.jsx("ul",{id:o,className:"border-t border-border-soft bg-background px-3 py-1.5","aria-label":"Todo items",children:n.map(d=>c.jsxs("li",{className:"flex items-start gap-2 py-[3px]",children:[c.jsx("span",{className:"mt-[2px] shrink-0",children:d.status==="completed"?c.jsx(qi,{className:"h-3.5 w-3.5 text-signal-ok","aria-hidden":!0}):d.status==="in_progress"?t?c.jsx(wt,{className:"h-3.5 w-3.5 text-brand animate-v2-spin","aria-label":"In progress"}):c.jsx(HN,{className:"h-3.5 w-3.5 text-muted-foreground/70","aria-label":"Was in progress"}):c.jsx(K1,{className:"h-3.5 w-3.5 text-muted-foreground/40","aria-hidden":!0})}),c.jsxs("span",{className:D("min-w-0 flex-1 text-[12.5px] leading-[1.5]",d.status==="completed"?"text-muted-foreground line-through decoration-muted-foreground/30":d.status==="in_progress"&&t?"text-foreground font-medium":"text-muted-foreground"),children:[c.jsxs("span",{className:"mr-1.5 font-mono text-[11px] text-muted-foreground/50",children:["#",d.id]}),d.subject]})]},d.id))})]})}function Mk({item:e,isCurrentTodo:t=!0}){if(e.kind==="bash")return c.jsx(zy,{command:e.command,output:e.output,exitCode:e.exitCode,running:!1});const n=Rk(e.args),r=e.toolName;if(r==="edit")return c.jsx(IO,{item:e,args:n});if(r==="write")return c.jsx(TO,{item:e,args:n});if(r==="read")return c.jsx(PO,{item:e,args:n});if(r==="bash")return c.jsx(zy,{command:MO(n==null?void 0:n.command)??"",output:e.text,exitCode:void 0,running:e.status==="running",errored:e.status==="error"});if(r==="todo")return c.jsx(AO,{item:e,isCurrent:t});if(r==="ask_user"){const s=i=>{Te.send({type:"answer_question",toolCallId:e.toolCallId,answer:i})};return c.jsx(Z4,{item:e,onSubmit:s})}return r==="create_artifact"?c.jsx(vO,{item:e}):c.jsx(Lk,{item:e,args:n})}function RO({items:e}){const[t,n]=S.useState(!1),r=S.useId(),s=LO(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(i=>!i),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(Jr,{className:D("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:s.map(i=>`${i.count} ${i.name}`).join(" · ")}),c.jsx(ft,{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(i=>c.jsx(Mk,{item:i,isCurrentTodo:!1},i.id))})]})}function LO(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 MO(e){return typeof e=="string"?e:void 0}function OO(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 s of e)if(s.kind==="tool"||s.kind==="bash")$O(s)||Bu(s)||zO(s)||BO(s)?(r(),t.push({kind:"single",item:s})):n.push(s);else{if(FO(s))continue;r(),t.push({kind:"single",item:s})}return r(),HO(t)}function DO(e){const t=[];let n=!1;for(const r of e){if(r.kind==="single"&&r.item.kind==="user"){n=!1,t.push({entry:r,leadHeader:!1,showHeader:!1});continue}if(r.kind==="single"&&r.item.kind==="assistant"){const i=!n;r.item.text&&(n=!0),t.push({entry:r,leadHeader:!1,showHeader:i});continue}const s=!n;n=!0,t.push({entry:r,leadHeader:s,showHeader:!1})}return t}function FO(e){return e.kind==="assistant"&&e.text.length===0}function $O(e){return e.kind==="tool"?e.status==="error":e.exitCode!==void 0&&e.exitCode!==0}function Bu(e){return e.kind==="tool"&&e.toolName==="todo"}function zO(e){return e.kind==="tool"&&e.toolName==="ask_user"}function BO(e){return e.kind==="tool"&&e.toolName===_c}function UO(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="single"&&Bu(n.item))return n.item.id}}function HO(e){const t=new Set;let n=0;for(let r=0;r<=e.length;r++){const s=r===e.length,i=!s&&e[r].kind==="single"&&e[r].item.kind==="user";if(s||i){let o=-1;for(let l=r-1;l>=n;l--){const a=e[l];if(a.kind==="single"&&Bu(a.item)){o=l;break}}if(o!==-1)for(let l=n;l<r;l++){const a=e[l];l!==o&&a.kind==="single"&&Bu(a.item)&&t.add(l)}n=r}}return t.size===0?e:e.filter((r,s)=>!t.has(s))}function GO({items:e,running:t,bottomPad:n,workspaceId:r,onFork:s}){const i=ku(h=>h.density)==="compact",o=S.useRef(null),l=S.useRef(!0);S.useLayoutEffect(()=>{const h=o.current;if(!h)return;const{scrollInfo:p}=ce.getState();l.current=p.stickToBottom,p.stickToBottom?h.scrollTop=h.scrollHeight:h.scrollTop=p.scrollTop},[]);const a=S.useCallback(()=>{const h=o.current;h&&(l.current=h.scrollHeight-h.scrollTop-h.clientHeight<30,ce.getState().setScrollInfo({scrollTop:h.scrollTop,stickToBottom:l.current}))},[]);S.useEffect(()=>{const h=o.current;!h||!l.current||(h.scrollTop=h.scrollHeight)},[e,t]),S.useEffect(()=>{const h=o.current;!h||!l.current||(h.scrollTop=h.scrollHeight)},[n]);const{rows:u,currentTodoId:f}=S.useMemo(()=>{const h=OO(e);return{rows:DO(h),currentTodoId:UO(h)}},[e]),d=e.length===0&&!t;return c.jsx("div",{ref:o,onScroll:a,className:D("relative z-10 min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain",d?"flex items-center justify-center":"pt-4"),style:d?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:d?c.jsx(pv,{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:D("mx-auto flex w-full flex-col px-6",i?`${bu.compact} gap-1`:`${bu.comfortable} gap-3`),style:{paddingBottom:n},children:u.flatMap(({entry:h,leadHeader:p,showHeader:m})=>{if(h.kind==="single"&&h.item.kind==="user")return[c.jsx(Fd,{item:h.item,isCurrentTodo:h.item.id===f,compact:i,onFork:s},h.item.id)];if(h.kind==="single"&&h.item.kind==="assistant")return[c.jsx(Fd,{item:h.item,isCurrentTodo:h.item.id===f,compact:i,showHeader:m},h.item.id)];const y=[];if(p){const v=h.kind==="group"?h.items[0].id:h.item.id;y.push(c.jsx(WO,{compact:i},`pilot-hdr:${v}`))}if(h.kind==="single")y.push(c.jsx(Fd,{item:h.item,isCurrentTodo:h.item.id===f,compact:i},h.item.id));else{const v=`group:${h.items[0].id}`;y.push(c.jsx(qO,{group:h,compact:i},v))}return y})})})}const Fd=S.memo(function({item:t,isCurrentTodo:n,compact:r=!1,showHeader:s=!0,onFork:i}){return t.kind==="user"?c.jsx(VO,{item:t,compact:r,onFork:i}):t.kind==="assistant"?c.jsx(QO,{item:t,compact:r,showHeader:s}):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(Mk,{item:t,isCurrentTodo:n})}):null});function qO({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(RO,{items:e.items})})}function WO({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(ac,{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 VO({item:e,compact:t=!1,onFork:n}){const r=n&&e.entryId&&!e.pending;return t?c.jsxs("div",{className:"group/user 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(xl,{text:e.text})}),r&&c.jsx("button",{type:"button",onClick:()=>n(e.entryId),title:"Fork from here",className:"shrink-0 opacity-0 group-hover/user:opacity-100 transition-opacity duration-150 text-muted-foreground hover:text-brand",children:c.jsx(Ug,{className:"h-3 w-3"})})]}):c.jsxs("div",{className:"group/user flex flex-col items-end gap-1.5",children:[c.jsxs("div",{className:"relative max-w-[78%] rounded-[14px] rounded-br-[4px] border border-brand-ghost bg-brand-ghost px-3.5 py-2.5 text-[14px] leading-[1.5] text-foreground [overflow-wrap:anywhere]",children:[c.jsx(xl,{text:e.text}),r&&c.jsx("button",{type:"button",onClick:()=>n(e.entryId),title:"Fork from here",className:"absolute -left-7 bottom-2 opacity-0 group-hover/user:opacity-100 transition-opacity duration-150 rounded-full p-1 text-muted-foreground hover:text-brand hover:bg-brand-ghost",children:c.jsx(Ug,{className:"h-3 w-3"})})]}),c.jsx(Co,{children:"You"})]})}function QO({item:e,compact:t=!1,showHeader:n=!0}){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:[n&&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(Co,{className:D(Wg(e.firstTokenMs)),title:e.totalMs!=null?`first token ${Us(e.firstTokenMs)} · total ${Us(e.totalMs)}`:void 0,children:Us(e.firstTokenMs)}),e.streaming&&c.jsx(Co,{className:"text-brand",children:"streaming…"})]}),c.jsx(xl,{text:e.text,streaming:e.streaming,className:"text-[13.5px] leading-[1.45]"})]})]}):c.jsxs("div",{className:"flex gap-3",children:[n?c.jsx(ac,{size:28,filled:!0}):c.jsx("div",{"aria-hidden":!0,className:"w-7 shrink-0"}),c.jsxs("div",{className:"min-w-0 flex-1 pt-0.5 [overflow-wrap:anywhere]",children:[n&&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(Co,{className:D(Wg(e.firstTokenMs)),title:e.totalMs!=null?`first token ${Us(e.firstTokenMs)} · total ${Us(e.totalMs)}`:void 0,children:Us(e.firstTokenMs)}),e.streaming&&c.jsx(Co,{className:"text-brand",children:"streaming…"})]}),c.jsx(xl,{text:e.text,streaming:e.streaming})]})]}):null}function Co({children:e,className:t,title:n}){return c.jsx("span",{title:n,className:D("text-[11px] tracking-[-0.005em] text-muted-foreground",t),children:e})}function KO({workspaceId:e,sessionPath:t,running:n,onCompact:r}){const s=ce(d=>{var h;return(h=d.contextUsage)==null?void 0:h.percent}),i=ce(d=>d.compaction),{data:o}=z1(e,t),l=yl(d=>d.rightPanel),a=yl(d=>d.togglePanel),u=ce(d=>d.items.some(h=>h.kind==="tool"&&h.toolName===_c)),f=s!=null?Math.round(s):null;return c.jsx("header",{className:"relative z-20 shrink-0 border-b border-border/60 bg-popover/80 backdrop-blur-md",children:c.jsxs("div",{className:"flex items-center gap-2 px-4 py-[10px]",children:[c.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children: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 animate-v2-pulse"}),c.jsx("span",{children:"thinking…"})]})}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[o&&c.jsx(ZO,{workspaceId:e,currentModel:o.currentModel,availableModels:o.availableModels,thinkingLevel:o.thinkingLevel,availableThinkingLevels:o.availableThinkingLevels,disabled:n}),(o==null?void 0:o.currentModel)&&f!=null&&c.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),f!=null&&c.jsxs(ft,{tone:"ghost",className:"hidden md:inline-flex",title:`Context · ${f}%`,children:[c.jsx("span",{className:"text-muted-foreground",children:"Context"}),c.jsxs("span",{className:"font-mono text-[11px] tabular-nums text-foreground",children:[f,"%"]}),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,f)}%`}})})]}),c.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),c.jsx(Zn,{active:l==="tree",onClick:()=>a("tree"),title:"Session Tree",children:c.jsx(Fp,{className:"h-3.5 w-3.5"})}),c.jsx(Zn,{active:l==="resources",onClick:()=>a("resources"),title:"Resources",children:c.jsx(VN,{className:"h-3.5 w-3.5"})}),(u||l==="artifact")&&c.jsx(Zn,{active:l==="artifact",onClick:()=>a("artifact"),title:"Artifacts",children:c.jsx(ll,{className:"h-3.5 w-3.5"})}),c.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),c.jsx(XO,{workspaceId:e,sessionPath:t,running:n,compacting:!!i,onCompact:r})]})]})})}function XO({workspaceId:e,sessionPath:t,running:n,compacting:r,onCompact:s}){const[i,o]=S.useState(!1),[l,a]=S.useState(!1),[u,f]=S.useState(""),d=S.useRef(null),h=S.useRef(null),p=bN(e,t),m=W1(e),y=mN(e,t);S.useEffect(()=>{if(!i)return;const g=x=>{d.current&&!d.current.contains(x.target)&&(o(!1),a(!1))};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[i]),S.useEffect(()=>{var g;l&&((g=h.current)==null||g.focus())},[l]);const v=()=>{const g=u.trim();g&&y.mutate({name:g}),a(!1),o(!1)};return c.jsxs("div",{ref:d,className:"relative",children:[c.jsx(Zn,{active:i,onClick:()=>o(g=>!g),title:"Session actions",children:c.jsx(qN,{className:"h-3.5 w-3.5"})}),i&&c.jsx("div",{className:"absolute right-0 top-[calc(100%+6px)] z-50 w-[200px] origin-top-right animate-in fade-in zoom-in-95 overflow-hidden rounded-xl border border-border/80 bg-popover shadow-menu",children:c.jsx("div",{className:"py-1",children:l?c.jsx("div",{className:"px-3 py-2",children:c.jsx("input",{ref:h,type:"text",value:u,onChange:g=>f(g.target.value),onKeyDown:g=>{g.key==="Enter"&&v(),g.key==="Escape"&&(a(!1),o(!1))},placeholder:"Session name…",className:"w-full rounded-md border border-border bg-card px-2 py-1 text-[12px] text-foreground outline-none focus:border-brand/50"})}):c.jsxs(c.Fragment,{children:[c.jsx(Sa,{icon:c.jsx(tE,{className:"h-3.5 w-3.5"}),label:"Compact context",disabled:n||r,onClick:()=>{s(),o(!1)}}),c.jsx(Sa,{icon:c.jsx(GN,{className:"h-3.5 w-3.5"}),label:"Export HTML",disabled:p.isPending,onClick:()=>{p.mutate(),o(!1)}}),c.jsx(Sa,{icon:c.jsx(yu,{className:"h-3.5 w-3.5"}),label:"Rename session",onClick:()=>{f(""),a(!0)}}),c.jsx(Sa,{icon:c.jsx(J1,{className:"h-3.5 w-3.5"}),label:"Reload resources",disabled:m.isPending,onClick:()=>{m.mutate(),o(!1)}})]})})})]})}function Sa({icon:e,label:t,disabled:n,onClick:r}){return c.jsxs("button",{type:"button",disabled:n,onClick:r,className:D("flex w-full items-center gap-2.5 px-3 py-[7px] text-left text-[12px] text-foreground transition-colors",n?"cursor-not-allowed opacity-40":"hover:bg-accent/50"),children:[c.jsx("span",{className:"shrink-0 text-muted-foreground",children:e}),c.jsx("span",{children:t})]})}function $d(e){return`${e.provider}/${e.modelId}`}function YO(e){const t=new Map;for(const n of e){const r=t.get(n.provider);r?r.push(n):t.set(n.provider,[n])}return Array.from(t.entries())}const JO={off:"Off",minimal:"Min",low:"Low",medium:"Med",high:"High",xhigh:"Max"};function ZO({workspaceId:e,currentModel:t,availableModels:n,thinkingLevel:r,availableThinkingLevels:s,disabled:i}){const[o,l]=S.useState(!1),[a,u]=S.useState(-1),f=S.useRef(null),d=S.useRef(null),h=S.useRef(null),p=B1(e),m=U1(e),y=t?$d(t):"",v=YO(n),g=n.map($d),x=g.indexOf(y);if(S.useEffect(()=>{if(!o)return;const w=N=>{f.current&&!f.current.contains(N.target)&&l(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[o]),S.useEffect(()=>{if(!o)return;const w=N=>{var k,I;switch(N.key){case"Escape":N.preventDefault(),l(!1),(k=h.current)==null||k.focus();break;case"ArrowDown":N.preventDefault(),u(T=>{const P=T<g.length-1?T+1:0;return zd(d.current,P),P});break;case"ArrowUp":N.preventDefault(),u(T=>{const P=T>0?T-1:g.length-1;return zd(d.current,P),P});break;case"Enter":{N.preventDefault();const T=g[a],P=n[a];T&&P&&T!==y&&p.mutate({provider:P.provider,modelId:P.modelId}),l(!1),(I=h.current)==null||I.focus();break}}};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[o,a,g,y,n,p]),S.useEffect(()=>{if(o){const w=x>=0?x:0;u(w),requestAnimationFrame(()=>zd(d.current,w))}},[o,x]),!t)return null;let b=0;return c.jsxs("div",{ref:f,className:"relative hidden md:block",children:[c.jsxs("button",{ref:h,type:"button",onClick:()=>l(w=>!w),disabled:i,title:t.modelId,className:D("inline-flex items-center gap-1 rounded-full border px-2.5 py-[2.5px] text-[11.5px] font-medium leading-[1.5] tracking-[-0.005em] transition-all duration-150",o?"border-brand/30 bg-brand-ghost/50 text-brand-strong":"border-border-soft bg-transparent text-foreground",i?"cursor-not-allowed opacity-50":"cursor-pointer hover:border-border-hi hover:bg-accent/40"),children:[c.jsx("span",{className:"max-w-[180px] truncate",children:t.name}),c.jsx(Jr,{className:D("h-2.5 w-2.5 shrink-0 opacity-50 transition-transform duration-150",o&&"rotate-180 opacity-80")})]}),o&&c.jsxs("div",{className:"absolute right-0 top-[calc(100%+6px)] z-50 w-[260px] origin-top-right animate-in fade-in zoom-in-95 overflow-hidden rounded-xl border border-border/80 bg-popover shadow-menu",role:"listbox","aria-label":"Switch model",children:[c.jsxs("div",{ref:d,className:"max-h-[320px] overflow-y-auto overscroll-contain py-1",children:[n.length===0&&c.jsx("div",{className:"px-4 py-6 text-center text-[12px] text-muted-foreground",children:"No models available. Add one in Settings → Models."}),v.map(([w,N],k)=>c.jsxs("div",{children:[k>0&&c.jsx("div",{className:"mx-3 my-1 h-px bg-border-soft"}),c.jsx("div",{className:"px-3 pb-0.5 pt-2",children:c.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.06em] text-muted-foreground/70",children:w})}),N.map(I=>{const T=$d(I),P=T===y,E=b++,M=E===a;return c.jsx("button",{type:"button",role:"option","aria-selected":P,"data-option-index":E,onMouseEnter:()=>u(E),onClick:()=>{l(!1),P||p.mutate({provider:I.provider,modelId:I.modelId})},className:D("flex w-[calc(100%-8px)] items-center rounded-lg mx-1 px-2 py-[6px] text-left transition-colors duration-100",P?"bg-brand-ghost font-medium text-brand-strong":M?"bg-accent/50 text-foreground":"text-foreground"),children:c.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px]",children:I.name})},T)})]},w))]}),s.length>0&&c.jsxs("div",{className:"border-t border-border-soft bg-popover/95 px-2 py-2",children:[c.jsx("div",{className:"px-1 pb-1.5",children:c.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.06em] text-muted-foreground/70",children:"Thinking effort"})}),c.jsx("div",{className:"flex gap-0.5 rounded-lg border border-border-soft bg-card/40 p-0.5",children:s.map(w=>c.jsx("button",{type:"button",onClick:()=>m.mutate({level:w}),disabled:i||m.isPending,className:D("min-w-0 flex-1 truncate rounded-md px-1 py-1 text-[10.5px] font-medium transition-colors",w===r?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:bg-accent/50 hover:text-foreground",(i||m.isPending)&&"cursor-not-allowed opacity-50"),children:JO[w]??w},w))})]})]})]})}function zd(e,t){if(!e)return;const n=e.querySelector(`[data-option-index="${t}"]`);n==null||n.scrollIntoView({block:"nearest"})}function eD(e,t){const n=ce(p=>p.apply),r=ce(p=>p.pushUser),s=ce(p=>p.rememberQueuedUser),i=ce(p=>p.reset),o=ce(p=>p.setSwitching),l=ce(p=>p.applyHistory),a=ce(p=>p.switching),u=S.useRef(null),f=S.useRef(null),d=S.useRef(0),h=S.useRef(e);return h.current=e,S.useEffect(()=>(Te.start(),()=>{}),[]),S.useEffect(()=>Te.on(m=>{if(m.type==="background_evicted"){ej(m.workspaceId,m.sessionPath);return}const y=f.current;if(m.type==="event"){const v=y?y.expectedWorkspaceId:h.current,g=y?y.expectedSessionPath:ce.getState().sessionPath??null;if(m.workspaceId!==v||m.sessionPath!==g){ZE(m);return}if(y){y.buffer.push(m);return}}if(m.type==="subscribed"){const v=ce.getState();if(v.sessionPath!==void 0&&v.sessionPath===m.sessionPath&&h.current===m.workspaceId)return}n(m),Ok(m)}),[n]),S.useEffect(()=>{if(!e){i();return}t&&o(!0),Te.send({type:"subscribe",workspaceId:e,...t?{sessionPath:t.path}:{}})},[e,t,i,o]),S.useEffect(()=>Te.onReconnect(()=>{u.current=null}),[]),S.useEffect(()=>{const p=y=>{if(y.type!=="subscribed")return;const v=y.workspaceId,g=y.sessionPath,x=u.current;if(x&&x.wsId===v&&x.sp===g)return;const b=f.current;if(b&&b.controller.abort(),u.current={wsId:v,sp:g},JE()){f.current=null;return}const w=++d.current,N=new AbortController,k={token:w,expectedWorkspaceId:v,expectedSessionPath:g,controller:N,buffer:[]};f.current=k;const I=Te.connectionEpoch,T=g?`?sessionPath=${encodeURIComponent(g)}`:"";ge(`/api/workspaces/${v}/history${T}`,{signal:N.signal}).then(P=>{var R;if(((R=f.current)==null?void 0:R.token)!==w)return;const E=()=>{var Q;((Q=f.current)==null?void 0:Q.token)===w&&(f.current=null)};if(Te.connectionEpoch!==I){E();return}if(ce.getState().sessionPath!==g){E();return}l(P.items,P.isStreaming),xo(k),f.current=null}).catch(P=>{var E;(P==null?void 0:P.name)!=="AbortError"&&((E=f.current)==null?void 0:E.token)===w&&(console.error("[useSessionStream] history fetch failed:",P),xo(k),f.current=null)})},m=Te.on(p);return()=>{m();const y=f.current;y&&(y.controller.abort(),f.current=null,xo(y))}},[l]),S.useEffect(()=>{const p=y=>{if(y.type!=="navigate_tree_result")return;if(y.cancelled){o(!1);return}const v=h.current;if(!v){o(!1);return}const x=ce.getState().sessionPath,b=f.current;b&&b.controller.abort();const w=++d.current,N=new AbortController,k={token:w,expectedWorkspaceId:v,expectedSessionPath:x??null,controller:N,buffer:[]};f.current=k;const I=y.editorText,T=Te.connectionEpoch,P=x?`?sessionPath=${encodeURIComponent(x)}`:"";ge(`/api/workspaces/${v}/history${P}`,{signal:N.signal}).then(E=>{var M;if(((M=f.current)==null?void 0:M.token)===w){if(Te.connectionEpoch!==T){f.current=null,o(!1);return}l(E.items,E.isStreaming),xo(k),f.current=null,I&&ce.getState().setComposerDraft(I),o(!1)}}).catch(E=>{var M;(E==null?void 0:E.name)!=="AbortError"&&((M=f.current)==null?void 0:M.token)===w&&(console.error("[useSessionStream] navigate history fetch failed:",E),xo(k),f.current=null,o(!1))})};return Te.on(p)},[l,o]),S.useMemo(()=>({sendPrompt(p,m){!e||a||(m!=null&&m.skipOptimistic||(m!=null&&m.streamingBehavior?s(p,m.streamingBehavior):r(p)),Te.send({type:"prompt",message:p,...m!=null&&m.streamingBehavior?{streamingBehavior:m.streamingBehavior}:{}}))},abort(){e&&Te.send({type:"abort"})},newSession(){e&&(o(!0),Te.send({type:"new_session",workspaceId:e}))},fork(p){e&&(o(!0),Te.send({type:"fork",workspaceId:e,entryId:p}))},navigateTree(p,m){!e||a||(o(!0),Te.send({type:"navigate_tree",workspaceId:e,targetId:p,summarize:m==null?void 0:m.summarize,customInstructions:m==null?void 0:m.customInstructions}))},compact(){e&&Te.send({type:"compact"})}}),[e,r,s,o,a])}function xo(e){const{expectedWorkspaceId:t,expectedSessionPath:n,buffer:r}=e;for(const s of r)s.type==="event"&&s.workspaceId===t&&s.sessionPath===n&&(ce.getState().apply(s),Ok(s))}function Ok(e){if(e.type!=="event")return;const t=e.payload;t.kind==="tool_execution_end"&&(t.toolName!==_c||t.isError||bl.getState().open(t.toolCallId))}function tD({workspaceId:e,sessionRequest:t}){const n=ce(v=>v.items),r=ce(v=>v.running),s=ce(v=>v.switching),i=ce(v=>v.sessionPath),{sendPrompt:o,abort:l,fork:a,compact:u}=eD(e,t),f=Mp(e).data,d=S.useMemo(()=>nD(f),[f]),h=S.useCallback((v,g)=>{const x=rD(v,d);o(v,{skipOptimistic:x,streamingBehavior:g})},[o,d]),p=S.useRef(null),[m,y]=S.useState(0);return S.useLayoutEffect(()=>{const v=p.current;if(!v)return;y(v.getBoundingClientRect().height);const g=new ResizeObserver(x=>{const b=x[0];b&&y(b.contentRect.height)});return g.observe(v),()=>g.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(KO,{workspaceId:e,sessionPath:i,running:r,onCompact:u}),c.jsx(uj,{}),c.jsx(aj,{}),c.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[c.jsx(GO,{items:n,running:r,bottomPad:m,workspaceId:e,onFork:a}),c.jsx("div",{ref:p,className:"pointer-events-none absolute inset-x-0 bottom-0 z-20 flex flex-col",children:c.jsx(bj,{workspaceId:e,onSend:h,onAbort:l,running:r,disabled:s})})]})]}):c.jsx("main",{className:"relative flex flex-1 items-center justify-center bg-background",children:c.jsx(pv,{title:"Ready when you are.",tagline:"Pick or add a workspace from the left to begin a session."})})}function nD(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 rD(e,t){if(t.size===0||!e.startsWith("/"))return!1;const n=e.slice(1),r=n.search(/\s/),s=r===-1?n:n.slice(0,r);return t.has(s)}function sD(e,t,n=null){if(t==="all")return e.slice();const r=new Set;for(const l of e)(iD(l,t)||l.id===n)&&r.add(l.id);const s=new Map;for(const l of e)s.set(l.id,l);const i=t==="labeled",o=new Set(r);for(const l of r){let a=s.get(l);for(;a!=null&&a.parentId;){const u=s.get(a.parentId);if(!u)break;(i||u.childCount>1)&&o.add(u.id),a=u}}return e.filter(l=>o.has(l.id))}function iD(e,t){switch(t){case"default":return By(e)||oD(e)&&lD(e)||e.entryType==="compaction"||e.entryType==="branch_summary"||e.label!=null;case"user-only":return By(e);case"labeled":return e.label!=null;case"all":return!0}}function By(e){return e.entryType==="message"&&e.messageRole==="user"}function oD(e){return e.entryType==="message"&&e.messageRole==="assistant"}function lD(e){return e.preview.trim().length>0}function Nc(e){const t=new Map;for(const n of e)t.set(n.id,n);return t}function aD(e,t=Nc(e)){const n=new Map;for(const r of e){if(!r.parentId){n.set(r.id,0);continue}const s=t.get(r.parentId);if(!s){n.set(r.id,0);continue}const i=n.get(s.id)??0;s.childCount>1&&!r.active?n.set(r.id,i+1):n.set(r.id,i)}return n}function uD(e,t,n=Nc(e)){const r=new Map;for(const s of e){if(!s.parentId){r.set(s.id,!0);continue}const i=n.get(s.parentId);if(!i){r.set(s.id,!0);continue}const o=r.get(i.id)??!0,a=!(i.childCount>1&&!s.active)||t.has(i.id);r.set(s.id,o&&a)}return r}function cD(e,t=Nc(e)){const n=new Map;for(const r of e){if(!r.parentId||r.active)continue;const s=t.get(r.parentId);!s||s.childCount<=1||n.set(r.parentId,(n.get(r.parentId)??0)+1)}return n}function dD(e,t){if(e==="message")switch(t){case"user":return"User";case"assistant":return"Assistant";case"toolResult":return"Tool result";case"bashExecution":return"Bash";case"custom":return"Extension";case"branchSummary":return"Branch summary";case"compactionSummary":return"Compaction summary";default:return"Message"}switch(e){case"compaction":return"Compaction";case"branch_summary":return"Branch summary";case"model_change":return"Model change";case"thinking_level_change":return"Thinking";case"custom":return"Custom";case"custom_message":return"Extension";case"label":return"Label";case"session_info":return"Session info";default:return e}}function fD(e,t,n){const r=n?"":" opacity-50";if(e==="message")switch(t){case"user":return"text-brand"+r;case"assistant":return"text-foreground"+r;default:return"text-muted-foreground"+r}switch(e){case"compaction":return"text-signal-warn"+r;case"branch_summary":return"text-signal-ok"+r;default:return"text-muted-foreground"+r}}const hD=[{value:"default",label:"Default"},{value:"user-only",label:"User only"},{value:"all",label:"All entries"},{value:"labeled",label:"Labeled"}];function pD({workspaceId:e,open:t,onClose:n}){const r=ce(z=>z.running),s=ce(z=>z.switching),i=ce(z=>z.setSwitching),{data:o,isFetching:l}=SN(e,t),[a,u]=S.useState("user-only"),[f,d]=S.useState(null),[h,p]=S.useState(()=>new Set),m=S.useRef(null),y=S.useRef(0);S.useEffect(()=>()=>{var z;(z=m.current)==null||z.call(m),m.current=null},[]);const v=S.useMemo(()=>o?sD(o.nodes,a,o.leafId):[],[o,a]),g=S.useMemo(()=>o?Nc(o.nodes):new Map,[o]),x=S.useMemo(()=>o?aD(o.nodes,g):new Map,[o,g]),b=S.useMemo(()=>o?cD(o.nodes,g):new Map,[o,g]),w=S.useMemo(()=>o?o.nodes.filter(z=>z.childCount>1).map(z=>z.id):[],[o]),N=w.some(z=>h.has(z)),k=S.useMemo(()=>o?uD(o.nodes,h,g):new Map,[o,h,g]),I=S.useMemo(()=>v.filter(z=>k.get(z.id)??!0),[v,k]),T=S.useMemo(()=>{let z=null;for(const ee of(o==null?void 0:o.nodes)??[])(!z||ee.timestamp>z.timestamp)&&(z=ee);return z},[o]),P=S.useCallback(z=>{p(ee=>{const O=new Set(ee);return O.has(z)?O.delete(z):O.add(z),O})},[]),E=S.useCallback(()=>p(new Set(w)),[w]),M=S.useCallback(()=>p(new Set),[]),R=S.useCallback(z=>{var X;if(r||s||f)return;const ee=++y.current;d(z.id),i(!0),Te.send({type:"navigate_tree",workspaceId:e,targetId:z.id}),(X=m.current)==null||X.call(m);const O=setTimeout(()=>{ee===y.current&&(d(null),i(!1),C())},3e4),H=Te.on(J=>{if(J.type==="navigate_tree_result"){if(ee!==y.current)return;d(null),J.cancelled&&or.getState().pushToast({id:`nav-cancelled-${Date.now()}`,workspaceId:e,message:"Tree navigation was cancelled.",notifyType:"info"}),C();return}if(J.type==="error"&&J.command==="navigate_tree"){if(ee!==y.current)return;d(null),i(!1),C()}}),C=()=>{clearTimeout(O),H(),m.current===C&&(m.current=null)};m.current=C},[e,r,s,f,i]);if(!t)return null;const Q=r||s||!!f,q=!T||T.id===(o==null?void 0:o.leafId),G=!!o&&o.nodes.some(z=>z.entryType==="message");return c.jsxs("aside",{className:`flex h-full ${iv} shrink-0 flex-col border-l border-border bg-popover`,children:[c.jsxs("header",{className:"flex h-[44px] items-center justify-between border-b border-border-soft px-4",children:[c.jsxs("div",{className:"flex items-center gap-2 text-[13px] font-medium tracking-[-0.005em] text-foreground",children:[c.jsx(Fp,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("span",{children:"Session Tree"}),l&&c.jsx(wt,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),c.jsxs("div",{className:"flex items-center gap-0.5",children:[T&&c.jsx(Zn,{onClick:()=>{T&&R(T)},disabled:Q||q,title:q?"Already at the latest":"Jump to latest",children:c.jsx(BN,{className:"h-3.5 w-3.5"})}),c.jsx(Zn,{onClick:n,title:"Close",children:c.jsx(Zr,{className:"h-3.5 w-3.5"})})]})]}),c.jsxs("div",{className:"flex items-center gap-2 border-b border-border-soft px-3 py-1.5",children:[c.jsx(WN,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),c.jsx("select",{value:a,onChange:z=>u(z.target.value),className:"flex-1 bg-transparent text-[11.5px] text-foreground outline-none",children:hD.map(z=>c.jsx("option",{value:z.value,children:z.label},z.value))}),w.length>0&&c.jsx("button",{type:"button",onClick:N?M:E,title:N?"Collapse all branches":"Expand all branches",className:"shrink-0 rounded px-1.5 py-0.5 text-[10.5px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground ring-brand-focus",children:N?"Collapse all":"Expand all"}),o&&c.jsxs("span",{className:"shrink-0 font-mono text-[10.5px] tabular-nums text-muted-foreground",children:[I.length,"/",o.nodes.length]})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto py-1",children:[!o&&!l&&c.jsx(Bd,{children:"No session tree available."}),o&&!G&&c.jsx(Bd,{children:"No conversation yet — send a message and it’ll appear here."}),G&&v.length===0&&c.jsx(Bd,{children:"Nothing matches this filter — try “All entries”."}),G&&v.length>0&&I.length===0&&c.jsxs("div",{className:"px-4 py-6 text-center text-[11.5px] leading-relaxed text-muted-foreground",children:["Matching entries are inside collapsed branches."," ",c.jsx("button",{type:"button",onClick:E,className:"rounded font-medium text-brand transition-colors hover:underline ring-brand-focus",children:"Expand all"})]}),I.map(z=>c.jsx(mD,{node:z,indent:x.get(z.id)??0,isFork:z.childCount>1,collapsed:z.childCount>1&&!h.has(z.id),hiddenCount:b.get(z.id)??0,onToggle:P,isNavigating:f===z.id,disabled:Q,onNavigate:R},z.id))]}),(r||s)&&c.jsx("div",{className:"border-t border-border-soft px-3 py-2 text-[10.5px] text-muted-foreground",children:r?"Navigation disabled while agent is running.":"Navigating…"})]})}function Bd({children:e}){return c.jsx("div",{className:"px-4 py-6 text-center text-[11.5px] leading-relaxed text-muted-foreground",children:e})}const Uy=14;function mD({node:e,indent:t,isFork:n,collapsed:r,hiddenCount:s,onToggle:i,isNavigating:o,disabled:l,onNavigate:a}){const u=e.isLeaf,f=fD(e.entryType,e.messageRole,e.active),d=dD(e.entryType,e.messageRole),h=10+t*Uy,p=l||u;return c.jsxs("div",{className:D("group/tree-row relative flex w-full items-center text-left transition-colors","hover:bg-accent/60",u&&"bg-brand-ghost hover:bg-brand-subtle"),style:{paddingLeft:`${h}px`},children:[t>0&&c.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 w-px bg-border-soft",style:{left:`${10+(t-1)*Uy+5}px`}}),n?c.jsx("button",{type:"button",onClick:()=>i(e.id),"aria-expanded":!r,title:r?`Expand ${s} branch${s===1?"":"es"}`:"Collapse branches",className:"flex w-[18px] shrink-0 items-center justify-center self-stretch text-muted-foreground transition-colors hover:text-foreground ring-brand-focus",children:r?c.jsx(Wi,{className:"h-3 w-3"}):c.jsx(Jr,{className:"h-3 w-3"})}):c.jsx("span",{"aria-hidden":!0,className:"w-[18px] shrink-0"}),c.jsxs("button",{type:"button",onClick:()=>a(e),disabled:p,"aria-current":u?"location":void 0,title:u?"Current position":l?"Navigation unavailable right now":`Navigate to this ${d.toLowerCase()}`,className:D("flex min-w-0 flex-1 items-center gap-2 py-[5px] pr-2.5 text-left","focus:outline-none focus-visible:bg-accent/60","disabled:cursor-default"),children:[c.jsx("span",{className:D("h-[7px] w-[7px] shrink-0 rounded-full bg-current",f)}),c.jsx("span",{className:D("shrink-0 text-[9.5px] font-medium uppercase tracking-wide",e.active?"text-muted-foreground":"text-muted-foreground/60"),children:d}),n&&c.jsxs("span",{title:`${s} alternate branch${s===1?"":"es"}`,className:"inline-flex shrink-0 items-center gap-0.5 text-[9px] font-medium text-muted-foreground tabular-nums",children:[c.jsx(Fp,{className:"h-2.5 w-2.5"}),s]}),c.jsx("span",{className:D("min-w-0 flex-1 truncate text-[11px]",e.active?"text-foreground/90":"text-muted-foreground"),children:e.preview||"—"}),e.label&&c.jsx("span",{className:"shrink-0 rounded bg-brand-tint px-1 py-px text-[9px] font-medium text-brand",children:e.label}),u&&c.jsx(KN,{className:"h-3 w-3 shrink-0 text-brand"}),o&&c.jsx(wt,{className:"h-3 w-3 shrink-0 animate-spin text-brand"}),c.jsx("span",{className:"shrink-0 font-mono text-[9.5px] tabular-nums text-muted-foreground opacity-0 transition-opacity group-hover/tree-row:opacity-100",children:gD(e.timestamp)})]})]})}function gD(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}let xD=0,yD=0;function bD(e){const t=or(n=>n.pushToast);S.useEffect(()=>Te.on(r=>{if(r.type!=="error")return;const s=r.command?`${r.command}: ${r.message}`:r.message;t({id:`wserr-${++xD}`,workspaceId:e??"",message:s,notifyType:"error"})}),[t,e])}function vD(){const e=or(t=>t.pushToast);S.useEffect(()=>Te.on(n=>{if(n.type!=="extension_error")return;const r=kD(n.extensionPath);e({id:`exterr-${++yD}`,workspaceId:n.workspaceId,message:`${r}: ${n.event}: ${n.message}`,notifyType:"error"})}),[e])}function wD(e){const t=or(n=>n.pushToast);S.useEffect(()=>{},[t,e])}function kD(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 SD(){const e=or(n=>n.toasts),t=or(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(CD,{toast:n,onClose:()=>t(n.id)},n.id))})}function CD({toast:e,onClose:t}){S.useEffect(()=>{const s=e.notifyType==="error"?8e3:4e3,i=setTimeout(t,s);return()=>clearTimeout(i)},[t,e.notifyType]);const n=e.notifyType==="error"||e.notifyType==="warning"?Zf:e.notifyType==="info"?QN:UN,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:D("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:D("mt-0.5 h-3.5 w-3.5 shrink-0",e.notifyType==="info"&&"text-brand")}),c.jsx("div",{className:"min-w-0 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(Zr,{className:"h-3 w-3"})})]})}function Ec({open:e,onClose:t,zIndex:n=100,className:r,role:s="dialog",ariaLabelledBy:i,ariaDescribedBy:o,children:l}){return S.useEffect(()=>{if(!e)return;const a=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),t())};return document.addEventListener("keydown",a,!0),()=>document.removeEventListener("keydown",a,!0)},[e,t]),e?c.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:n},children:[c.jsx("div",{className:"absolute inset-0 bg-background/60 backdrop-blur-[2px] v2-fade-in",onClick:t,onMouseDown:a=>a.stopPropagation()}),c.jsx("div",{role:s,"aria-modal":"true","aria-labelledby":i,"aria-describedby":o,className:D("relative z-10 flex flex-col overflow-hidden rounded-xl border border-border bg-card shadow-panel v2-dialog-in",r),onMouseDown:a=>a.stopPropagation(),children:l})]}):null}function _D({workspaceId:e,request:t,onClose:n}){return c.jsxs(Ec,{open:!0,onClose:n,className:"m-4 h-full max-h-[90vh] w-full max-w-3xl",children:[c.jsx(ND,{kind:t.kind,mode:t.mode,onClose:n}),t.mode==="create"?c.jsx(ED,{workspaceId:e,kind:t.kind,defaultScope:t.defaultScope,onDone:n}):c.jsx(jD,{workspaceId:e,kind:t.kind,filePath:t.filePath,onDone:n})]})}function ND({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(Zr,{className:"h-4 w-4"})})]})}function ED({workspaceId:e,kind:t,defaultScope:n,onDone:r}){var k,I;const[s,i]=S.useState(n),[o,l]=S.useState(""),[a,u]=S.useState(""),[f,d]=S.useState(""),[h,p]=S.useState(!1),[m,y]=S.useState(t==="skill"?ID:""),v=IN(e),g=RN(e),x=v.isPending||g.isPending,b=((k=v.error)==null?void 0:k.message)??((I=g.error)==null?void 0:I.message),w=async()=>{try{t==="skill"?await v.mutateAsync({scope:s,name:o.trim(),description:a.trim(),body:m,disableModelInvocation:h||void 0}):await g.mutateAsync({scope:s,name:o.trim(),description:a.trim(),argumentHint:f.trim()||void 0,body:m}),r()}catch{}},N=!x&&o.trim().length>0&&a.trim().length>0&&m.length>0;return c.jsx(Dk,{kind:t,scope:s,onScopeChange:i,scopeLocked:!1,name:o,onNameChange:l,description:a,onDescriptionChange:u,argumentHint:f,onArgumentHintChange:d,disableModelInvocation:h,onDisableModelInvocationChange:p,body:m,onBodyChange:y,submitLabel:"Create",canSubmit:N,pending:x,error:b,onSubmit:w,onCancel:r})}function jD({workspaceId:e,kind:t,filePath:n,onDone:r}){var R,Q,q;const s=jN(e,t==="skill"?n:void 0),i=AN(e,t==="prompt"?n:void 0),o=t==="skill"?s.data:i.data,l=(R=t==="skill"?s.error:i.error)==null?void 0:R.message,a=t==="skill"?s.isLoading:i.isLoading,[u,f]=S.useState(!1),[d]=S.useState(void 0),[h,p]=S.useState(""),[m,y]=S.useState(""),[v,g]=S.useState(""),[x,b]=S.useState(!1),[w,N]=S.useState("");S.useEffect(()=>{!o||u||(p(o.name),y(o.description),g(o.argumentHint??""),b(!!o.disableModelInvocation),N(o.body),f(!0))},[o,u]);const k=TN(e),I=LN(e),T=k.isPending||I.isPending,P=((Q=k.error)==null?void 0:Q.message)??((q=I.error)==null?void 0:q.message),E=async()=>{try{t==="skill"?await k.mutateAsync({filePath:n,name:h.trim(),description:m.trim(),body:w,disableModelInvocation:x||void 0}):await I.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(wt,{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-error",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 M=u&&!T&&h.trim().length>0&&m.trim().length>0&&w.length>0;return c.jsx(Dk,{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:y,argumentHint:v,onArgumentHintChange:g,disableModelInvocation:x,onDisableModelInvocationChange:b,body:w,onBodyChange:N,filePath:o.filePath,submitLabel:"Save",canSubmit:M,pending:T,error:P,onSubmit:E,onCancel:r})}function Dk(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(Ws,{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(Ws,{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(Ws,{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(Ws,{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(Ws,{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(Ws,{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 text-sm font-mono 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-error-ghost bg-error-ghost px-3 py-1.5 text-xs text-signal-error",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(wt,{className:"h-3.5 w-3.5 animate-spin"}),e.submitLabel]})]})]})}function Ws({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:D("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 ID=`# Skill name
|
|
494
|
+
|
|
495
|
+
Describe what the skill does, when to use it, and any setup steps.
|
|
496
|
+
|
|
497
|
+
## Usage
|
|
498
|
+
|
|
499
|
+
\`\`\`bash
|
|
500
|
+
./scripts/example.sh <input>
|
|
501
|
+
\`\`\`
|
|
502
|
+
`;function TD({open:e,title:t,message:n,confirmLabel:r="Confirm",cancelLabel:s="Cancel",variant:i="default",onConfirm:o,onCancel:l}){const a=S.useRef(null),u=S.useRef(null);S.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]),S.useEffect(()=>{if(!e)return;const d=h=>{h.key==="Enter"&&(h.preventDefault(),h.stopPropagation(),o())};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[e,o]);const f=i==="danger";return c.jsxs(Ec,{open:e,onClose:l,zIndex:200,role:"alertdialog",ariaLabelledBy:"confirm-dialog-title",ariaDescribedBy:"confirm-dialog-message",className:"mx-4 w-full max-w-sm",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-error-subtle",children:c.jsx(Zf,{className:"h-4 w-4 text-signal-error"})}),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:[s!==null&&c.jsx("button",{type:"button",onClick:l,className:D("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:s}),c.jsx("button",{ref:a,type:"button",onClick:o,className:D("rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors","focus:outline-none focus:ring-2",f?"bg-signal-error text-white hover:bg-signal-error/90 focus:ring-signal-error/40":"bg-brand text-brand-foreground hover:bg-brand-strong focus:ring-brand/40"),children:r})]})]})}const Fk=S.createContext(null);function Ul(){const e=S.useContext(Fk);if(!e)throw new Error("useConfirm must be used within a <ConfirmProvider />");return e}function PD({children:e}){const[t,n]=S.useState(null),r=S.useRef(null),s=S.useCallback(o=>(r.current&&(r.current(!1),r.current=null),new Promise(l=>{r.current=l,n({...o,open:!0})})),[]),i=S.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(Fk.Provider,{value:s,children:[e,c.jsx(TD,{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:()=>i(!0),onCancel:()=>i(!1)})]})}function AD({workspaceId:e,open:t,onClose:n}){return t?c.jsx("aside",{className:`flex h-full ${iv} shrink-0 flex-col border-l border-border bg-popover`,children:c.jsx(RD,{workspaceId:e,onClose:n})}):null}function RD({workspaceId:e,onClose:t}){const{data:n,isLoading:r,error:s}=Mp(e),i=W1(e),[o,l]=S.useState("skills"),[a,u]=S.useState(null),f=m=>u({kind:m,mode:"create",defaultScope:"project"}),d=(m,y)=>u({kind:m,mode:"edit",filePath:y}),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(Ud,{total:0,onReload:()=>i.mutate(),reloading:i.isPending,onClose:t}),c.jsxs("div",{className:"flex flex-1 items-center justify-center text-[12px] text-muted-foreground",children:[c.jsx(wt,{className:"h-3.5 w-3.5 animate-spin"}),c.jsx("span",{className:"ml-2",children:"Loading resources…"})]})]}):s||!n?c.jsxs(c.Fragment,{children:[c.jsx(Ud,{total:0,onReload:()=>i.mutate(),reloading:i.isPending,onClose:t}),c.jsx("p",{className:"px-4 py-4 text-center text-[12.5px] text-signal-error",children:(s==null?void 0:s.message)??"Failed to load resources"})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ud,{total:p,onReload:()=>i.mutate(),reloading:i.isPending,onClose:t}),i.isError&&c.jsx("p",{className:"border-b border-error-ghost bg-error-ghost px-4 py-1.5 text-[11.5px] text-signal-error",children:i.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(Hd,{active:o==="skills",onClick:()=>l("skills"),label:"Skills",count:h.skills}),c.jsx(Hd,{active:o==="prompts",onClick:()=>l("prompts"),label:"Prompts",count:h.prompts}),c.jsx(Hd,{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(LD,{workspaceId:e,skills:n.skills,onNew:()=>f("skill"),onEdit:m=>d("skill",m.filePath)}),o==="prompts"&&c.jsx(MD,{workspaceId:e,prompts:n.prompts,onNew:()=>f("prompt"),onEdit:m=>d("prompt",m.filePath)}),o==="extensions"&&c.jsx(OD,{workspaceId:e,builtinExtensions:n.builtinExtensions,extensionsEnabled:n.extensionsEnabled,extensions:n.extensions,errors:n.extensionErrors,disabledExtensions:n.disabledExtensions})]})]}),a&&c.jsx(_D,{workspaceId:e,request:a,onClose:()=>u(null)})]})}function Ud({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(Zn,{onClick:t,disabled:n,title:"Reload resources","aria-label":"Reload resources",children:c.jsx(J1,{className:D("h-3.5 w-3.5",n&&"animate-spin")})}),c.jsx(Zn,{onClick:r,title:"Close","aria-label":"Close resources panel",children:c.jsx(Zr,{className:"h-3.5 w-3.5"})})]})}function Hd({active:e,onClick:t,label:n,count:r}){return c.jsxs("button",{type:"button",onClick:t,className:D("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-ghost 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 LD({workspaceId:e,skills:t,onNew:n,onEdit:r}){const s=PN(e),i=Ul(),o=async l=>{await i({title:"Delete skill",message:`Delete skill "${l.name}"?
|
|
503
|
+
|
|
504
|
+
This removes ${l.filePath} and any sibling files in its directory.`,confirmLabel:"Delete",variant:"danger"})&&s.mutate({filePath:l.filePath})};return c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(zk,{label:"New skill",onClick:n}),s.isError&&c.jsx("p",{className:"rounded-md border border-error-ghost bg-error-ghost px-2.5 py-1.5 text-[11.5px] text-signal-error",children:s.error.message}),t.length===0?c.jsx(Hk,{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(bm,{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(vm,{path:l.filePath}),l.managed?c.jsx(Uk,{onEdit:()=>r(l),onDelete:()=>o(l),deleting:s.isPending&&((a=s.variables)==null?void 0:a.filePath)===l.filePath}):c.jsx(Bk,{kind:"skill",source:l.source})]},l.filePath)})})]})}function MD({workspaceId:e,prompts:t,onNew:n,onEdit:r}){const s=MN(e),i=Ul(),o=async l=>{await i({title:"Delete prompt",message:`Delete prompt template /${l.name}?
|
|
505
|
+
|
|
506
|
+
${l.filePath}`,confirmLabel:"Delete",variant:"danger"})&&s.mutate({filePath:l.filePath})};return c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(zk,{label:"New prompt",onClick:n}),s.isError&&c.jsx("p",{className:"rounded-md border border-error-ghost bg-error-ghost px-2.5 py-1.5 text-[11.5px] text-signal-error",children:s.error.message}),t.length===0?c.jsx(Hk,{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(bm,{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(vm,{path:l.filePath}),l.managed?c.jsx(Uk,{onEdit:()=>r(l),onDelete:()=>o(l),deleting:s.isPending&&((a=s.variables)==null?void 0:a.filePath)===l.filePath}):c.jsx(Bk,{kind:"prompt",source:l.source})]},l.filePath)})})]})}function OD({workspaceId:e,builtinExtensions:t,extensionsEnabled:n,extensions:r,errors:s,disabledExtensions:i}){const o=r.filter(l=>l.source.label!=="inline");return c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsx(DD,{workspaceId:e,builtins:t}),c.jsx($D,{extensionsEnabled:n,extensions:o,errors:s,disabledExtensions:i})]})}function DD({workspaceId:e,builtins:t}){var s;const n=EN(e),r=n.isPending?(s=n.variables)==null?void 0:s.id:void 0;return c.jsxs("section",{className:"flex flex-col gap-2",children:[c.jsx(Ah,{children:"Built-in"}),n.isError&&c.jsx("p",{className:"rounded-md border border-error-ghost bg-error-ghost 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(i=>{const o=r===i.id,l=o&&n.variables?n.variables.enabled:i.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(Fs,{tool:i.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:i.name})]}),c.jsx(FD,{checked:l,disabled:o,onChange:a=>n.mutate({id:i.id,enabled:a}),label:`${l?"Disable":"Enable"} ${i.name}`})]}),c.jsx("p",{className:"mt-1 text-[12px] leading-relaxed text-muted-foreground",children:i.description}),c.jsx($k,{facets:[{label:"tools",items:i.tools},{label:"commands",items:i.commands.map(a=>`/${a}`)}].filter(a=>a.items.length>0)})]},i.id)})})]})}function FD({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:D("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-subtle bg-brand":"border-border bg-muted"),children:c.jsx("span",{className:D("inline-block h-3 w-3 rounded-full bg-white shadow-sm transition-transform",e?"translate-x-[15px]":"translate-x-[2px]")})})}function $D({extensionsEnabled:e,extensions:t,errors:n,disabledExtensions:r}){return e?c.jsxs("section",{className:"flex flex-col gap-2",children:[c.jsx(Ah,{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(s=>c.jsxs("div",{className:"rounded-[10px] border border-error-ghost bg-error-ghost 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:s.path}),c.jsx("p",{className:"mt-1 break-words",children:s.error})]},s.path)),t.map(s=>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:Gy(s.path)}),c.jsx(bm,{source:s.source})]}),c.jsx(zD,{ext:s}),c.jsx(vm,{path:s.resolvedPath})]},s.resolvedPath))]}):c.jsxs("section",{className:"flex flex-col gap-3",children:[c.jsx(Ah,{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(s=>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:s,children:[c.jsx(zN,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),c.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:Gy(s)})]},s))]})]})}function Ah({children:e}){return c.jsx("h3",{className:"text-[11.5px] font-medium text-muted-foreground",children:e})}function zD({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($k,{facets:t})}function $k({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 zk({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-subtle hover:text-brand ring-brand-focus",children:[c.jsx(oc,{className:"h-3 w-3 transition-transform group-hover:rotate-90"}),e]})}function Bk({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 Uk({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-subtle hover:text-brand ring-brand-focus",children:[c.jsx(yu,{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-error-ghost bg-card px-2.5 py-1 text-[11.5px] font-medium text-signal-error transition-colors hover:bg-error-ghost disabled:opacity-50 ring-brand-focus",children:[n?c.jsx(wt,{className:"h-3 w-3 animate-spin"}):c.jsx(al,{className:"h-3 w-3"})," ","Delete"]})]})}function bm({source:e}){const t=e.scope==="user"?"default":e.scope==="project"?"brand":"warn";return c.jsx(ft,{tone:t,className:"shrink-0",children:c.jsx("span",{title:e.label,children:e.scope})})}function vm({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 Hk({text:e}){return c.jsx("p",{className:"py-8 text-center text-[12.5px] text-muted-foreground",children:e})}function Gy(e){return e.replace(/\/+$/,"").split("/").at(-1)||e}const Gd=e=>typeof e=="function"?e():e;function Gk({storageKey:e,defaultWidth:t,min:n,max:r,side:s="right",enabled:i=!0,onResizeEnd:o}){const[l,a]=S.useState(()=>{try{const k=localStorage.getItem(e);if(k){const I=parseInt(k,10);if(!isNaN(I)&&I>=n&&I<=Gd(r))return I}}catch{}return t}),[u,f]=S.useState(!1),d=S.useRef(!1),h=S.useRef(0),p=S.useRef(l),m=S.useRef(l),y=S.useRef(l),v=S.useRef(Gd(r)),g=S.useRef(s),x=S.useRef(n),b=S.useRef(o);S.useEffect(()=>{g.current=s,x.current=n,b.current=o},[s,n,o]),S.useEffect(()=>{m.current=l},[l]),S.useEffect(()=>{if(!i)return;const k=()=>{const I=Gd(r);v.current=I,a(T=>Math.min(T,I))};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[i,r]),S.useEffect(()=>{if(!u)try{localStorage.setItem(e,String(l))}catch{}},[l,u,e]);const w=S.useCallback(k=>{k.preventDefault(),d.current=!0,f(!0),h.current=k.clientX,p.current=m.current,y.current=m.current,document.documentElement.classList.add("is-col-resizing")},[]),N=S.useCallback(()=>{a(t)},[t]);return S.useEffect(()=>{if(!i)return;const k=T=>{if(!d.current)return;const P=g.current==="left"?h.current-T.clientX:T.clientX-h.current,E=p.current+P;y.current=E,a(Math.max(x.current,Math.min(v.current,E)))},I=()=>{var T;d.current&&(d.current=!1,f(!1),document.documentElement.classList.remove("is-col-resizing"),(T=b.current)==null||T.call(b,y.current))};return document.addEventListener("mousemove",k),document.addEventListener("mouseup",I),()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",I),d.current&&(d.current=!1,document.documentElement.classList.remove("is-col-resizing"))}},[i]),{width:l,isResizing:u,onMouseDown:w,onDoubleClick:N}}const BD=()=>Math.min(window.innerWidth*.7,960);function UD({open:e,onClose:t}){const{width:n,isResizing:r,onMouseDown:s,onDoubleClick:i}=Gk({storageKey:HE,defaultWidth:UE,min:GE,max:BD,side:"left",enabled:e});return e?c.jsxs("aside",{className:"relative flex h-full shrink-0 flex-col border-l border-border bg-popover",style:{width:`${n}px`},children:[c.jsx("div",{onMouseDown:s,onDoubleClick:i,className:D("absolute left-0 top-0 z-30 h-full w-px cursor-col-resize","bg-transparent hover:bg-brand/60 transition-colors",r&&"bg-brand"),"aria-label":"Resize artifacts panel",title:"Drag to resize · double-click to reset",children:c.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2"})}),c.jsx(HD,{onClose:t})]}):null}function HD({onClose:e}){const t=ce(p=>p.items),n=bl(p=>p.selectedToolCallId),r=bl(p=>p.select),s=S.useMemo(()=>oO(t),[t]),i=aO(s,n)??lO(s),[o,l]=S.useState("preview"),a=i==null?void 0:i.toolCallId;if(S.useEffect(()=>{l("preview")},[a]),!i)return c.jsxs(c.Fragment,{children:[c.jsx(qy,{title:"Artifacts",onClose:e}),c.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-8 text-center",children:[c.jsx(ll,{className:"h-6 w-6 text-muted-foreground/50"}),c.jsxs("p",{className:"text-[12.5px] leading-relaxed text-muted-foreground",children:["No artifacts yet. When the agent publishes one with"," ",c.jsx("span",{className:"font-mono text-[11.5px]",children:"create_artifact"}),", it shows up here."]})]})]});const u=cO(s),f=Ak(s,i.id),d=uO(s,i),h=p=>{const m=f.findIndex(v=>v.toolCallId===i.toolCallId),y=f[m+p];y&&r(y.toolCallId)};return c.jsxs(c.Fragment,{children:[c.jsx(qy,{title:i.title,onClose:e}),u.length>1&&c.jsx("div",{className:"flex gap-1 overflow-x-auto border-b border-border-soft px-2 py-1.5",children:u.map(p=>c.jsx("button",{type:"button",onClick:()=>r(p.toolCallId),title:p.title,className:D("max-w-[160px] shrink-0 truncate rounded-md px-2 py-0.5 text-[11.5px] font-medium transition-colors",p.id===i.id?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:p.title},p.id))}),c.jsxs("div",{className:"flex items-center gap-2 border-b border-border-soft px-3 py-1.5",children:[c.jsx(ft,{tone:"ghost",children:i.type}),d.count>1&&c.jsxs("div",{className:"flex items-center gap-0.5 text-muted-foreground",children:[c.jsx(Vy,{dir:"prev",disabled:d.index<=1,onClick:()=>h(-1)}),c.jsxs("span",{className:"font-mono text-[11px] tabular-nums",children:["v",d.index,"/",d.count]}),c.jsx(Vy,{dir:"next",disabled:d.index>=d.count,onClick:()=>h(1)})]}),c.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[(i.type==="html"||i.type==="svg")&&c.jsxs("div",{className:"flex items-center gap-0.5 rounded-md border border-border-soft bg-card p-0.5 text-[11px] font-medium",children:[c.jsx(Wy,{active:o==="preview",onClick:()=>l("preview"),icon:c.jsx(Y1,{className:"h-3 w-3"}),label:"Preview"}),c.jsx(Wy,{active:o==="code",onClick:()=>l("code"),icon:c.jsx(X1,{className:"h-3 w-3"}),label:"Code"})]}),c.jsx(qD,{content:i.content})]})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:c.jsx(GD,{record:i,view:o})})]})}function GD({record:e,view:t}){const{type:n,content:r,language:s}=e;return n==="markdown"?c.jsx("div",{className:"px-4 py-3",children:c.jsx(xl,{text:r})}):n==="code"?c.jsx(zi,{code:r,lang:s,className:"px-4 py-3"}):t==="code"?c.jsx(zi,{code:r,lang:n,className:"px-4 py-3"}):c.jsx(Ik,{code:r,lang:n})}function qy({title:e,onClose:t}){return c.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[c.jsx(ll,{className:"h-3.5 w-3.5 shrink-0 text-brand"}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium text-foreground",title:e,children:e}),c.jsx(Zn,{title:"Close",onClick:t,"aria-label":"Close artifacts panel",children:c.jsx(Zr,{className:"h-3.5 w-3.5"})})]})}function Wy({active:e,onClick:t,icon:n,label:r}){return c.jsxs("button",{type:"button",onClick:t,"aria-pressed":e,className:D("flex items-center gap-1 rounded-[5px] px-1.5 py-0.5 transition-colors",e?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:text-foreground"),children:[n,r]})}function Vy({dir:e,disabled:t,onClick:n}){return c.jsx("button",{type:"button",onClick:n,disabled:t,"aria-label":e==="prev"?"Previous version":"Next version",className:"rounded p-0.5 transition-colors hover:text-foreground disabled:cursor-not-allowed disabled:opacity-30",children:e==="prev"?c.jsx(Q1,{className:"h-3.5 w-3.5"}):c.jsx(Wi,{className:"h-3.5 w-3.5"})})}function qD({content:e}){const t=or(i=>i.pushToast),[n,r]=S.useState(!1),s=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1200)}catch{t({id:`copy-${Date.now()}`,workspaceId:"",message:"Copy failed — clipboard not available",notifyType:"warning"})}};return c.jsx("button",{type:"button",onClick:s,title:"Copy content","aria-label":"Copy artifact content",className:"rounded-md border border-border-soft bg-card p-1 text-muted-foreground transition-colors hover:text-foreground",children:n?c.jsx(qi,{className:"h-3 w-3 text-signal-ok"}):c.jsx(Op,{className:"h-3 w-3"})})}const qk=["model-configs"];function Hl(e){e.invalidateQueries({queryKey:qk}),e.invalidateQueries({queryKey:["config"]})}function WD(){return Pn({queryKey:qk,queryFn:()=>ge("/api/model-configs")})}function VD(){const e=Ne();return $e({mutationFn:t=>ge("/api/model-configs/providers",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>Hl(e)})}function QD(){const e=Ne();return $e({mutationFn:t=>ge(`/api/model-configs/providers?name=${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>Hl(e)})}function KD(){const e=Ne();return $e({mutationFn:({provider:t,model:n})=>ge(`/api/model-configs/providers/${encodeURIComponent(t)}/models`,{method:"POST",body:JSON.stringify({model:n})}),onSuccess:()=>Hl(e)})}function XD(){const e=Ne();return $e({mutationFn:({provider:t,modelId:n,model:r})=>ge(`/api/model-configs/providers/${encodeURIComponent(t)}/models/${encodeURIComponent(n)}`,{method:"PUT",body:JSON.stringify({model:r})}),onSuccess:()=>Hl(e)})}function YD(){const e=Ne();return $e({mutationFn:({provider:t,modelId:n})=>ge(`/api/model-configs/providers/${encodeURIComponent(t)}/models/${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:()=>Hl(e)})}const Qy=["anthropic-messages","openai-completions","openai-responses","azure-openai-responses","openai-codex-responses","mistral-conversations","bedrock-converse-stream","google-generative-ai","google-vertex"];function JD(e){return e.embedded?c.jsx("div",{className:"overflow-hidden rounded-lg border border-border-soft bg-background/60",children:c.jsx(Ky,{})}):c.jsxs(Ec,{open:e.open,onClose:e.onClose,className:"max-h-[85vh] w-[600px] max-w-[90vw]",children:[c.jsx(ZD,{onClose:e.onClose}),c.jsx(Ky,{})]})}function ZD({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:"text-[13px] font-semibold text-foreground",children:"Model Configuration"}),c.jsx("button",{type:"button",onClick:e,className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":"Close",children:c.jsx(Zr,{className:"h-4 w-4"})})]})}function Ky(){const{data:e,isLoading:t,error:n}=WD(),[r,s]=S.useState(null),[i,o]=S.useState(!1),[l,a]=S.useState(null),[u,f]=S.useState(null);if(t)return c.jsxs("div",{className:"flex items-center justify-center py-8",children:[c.jsx(wt,{className:"h-4 w-4 animate-spin text-muted-foreground"}),c.jsx("span",{className:"ml-2 text-[12px] text-muted-foreground",children:"Loading…"})]});if(n||!e)return c.jsx("p",{className:"m-4 rounded-md border border-error-ghost bg-error-ghost px-3 py-2 text-center text-[12px] text-signal-error",children:(n==null?void 0:n.message)??"Failed to load model config"});const d=e.config.providers;return r?c.jsx(Xy,{initialName:r.name,initialConfig:r.config,onDone:()=>s(null)}):i?c.jsx(Xy,{initialName:"",initialConfig:null,onDone:()=>o(!1)}):l?c.jsx(Yy,{provider:l.provider,initialModel:l.model,onDone:()=>a(null)}):u?c.jsx(Yy,{provider:u,initialModel:null,onDone:()=>f(null)}):c.jsxs("div",{className:"flex-1 overflow-y-auto",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[c.jsxs("span",{className:"text-[12px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:["Providers (",Object.keys(d).length,")"]}),c.jsxs("button",{type:"button",onClick:()=>o(!0),className:"flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-[13px] font-medium text-brand transition-colors hover:bg-brand-tint",children:[c.jsx(oc,{className:"h-3.5 w-3.5"})," Add Provider"]})]}),Object.keys(d).length===0&&c.jsx("p",{className:"px-4 py-6 text-center text-[13px] text-muted-foreground",children:"No providers configured. Click “Add Provider” to get started."}),Object.entries(d).map(([h,p])=>c.jsx(eF,{name:h,config:p,onEditProvider:()=>s({name:h,config:p}),onEditModel:m=>a({provider:h,model:m}),onAddModel:()=>f(h)},h))]})}function eF({name:e,config:t,onEditProvider:n,onEditModel:r,onAddModel:s}){const[i,o]=S.useState(!1),l=QD(),a=YD(),u=Ul();return c.jsxs("div",{className:"mx-4 mb-3 overflow-hidden rounded-lg border border-border-soft bg-card",children:[c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5",children:[c.jsx("button",{type:"button",onClick:()=>o(f=>!f),className:"p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:i?c.jsx(Jr,{className:"h-3.5 w-3.5"}):c.jsx(Wi,{className:"h-3.5 w-3.5"})}),c.jsx("span",{className:"flex-1 text-[13px] font-semibold text-foreground",children:e}),c.jsx("span",{className:"rounded-md bg-muted/60 px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:t.api}),c.jsx("button",{type:"button",onClick:n,className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:"Edit provider",children:c.jsx(yu,{className:"h-3.5 w-3.5"})}),c.jsx("button",{type:"button",onClick:async()=>{await u({title:"Delete provider",message:`Delete provider "${e}" and all its models?`,confirmLabel:"Delete",variant:"danger"})&&l.mutate(e)},className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-error-subtle hover:text-signal-error",title:"Delete provider",children:c.jsx(al,{className:"h-3.5 w-3.5"})})]}),i&&c.jsxs("div",{className:"border-t border-border-soft px-4 pb-3 pt-2",children:[c.jsxs("div",{className:"mb-2 text-[12px] text-muted-foreground",children:["Base URL: ",c.jsx("span",{className:"font-mono text-foreground/70",children:t.baseUrl})]}),t.models.length===0&&c.jsx("p",{className:"py-2 text-[12px] text-muted-foreground",children:"No models configured."}),c.jsx("div",{className:"flex flex-col gap-1",children:t.models.map(f=>c.jsxs("div",{className:"flex items-center gap-2 rounded-lg px-3 py-2 transition-colors hover:bg-muted/50",children:[c.jsx("span",{className:"flex-1 text-[13px] text-foreground",children:f.name}),c.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:f.id}),f.reasoning&&c.jsx("span",{className:"rounded-md bg-brand-tint px-1.5 py-0.5 text-[10px] font-medium text-brand",children:"Reasoning"}),c.jsx("button",{type:"button",onClick:()=>r(f),className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:"Edit model",children:c.jsx(yu,{className:"h-3 w-3"})}),c.jsx("button",{type:"button",onClick:async()=>{await u({title:"Delete model",message:`Delete model "${f.name}"?`,confirmLabel:"Delete",variant:"danger"})&&a.mutate({provider:e,modelId:f.id})},className:"rounded-md p-1 text-muted-foreground transition-colors hover:text-signal-error",title:"Delete model",children:c.jsx(al,{className:"h-3 w-3"})})]},f.id))}),c.jsxs("button",{type:"button",onClick:s,className:"mt-2 flex items-center gap-1.5 text-[12px] font-medium text-brand/80 transition-colors hover:text-brand",children:[c.jsx(oc,{className:"h-3 w-3"})," Add Model"]})]})]})}function Xy({initialName:e,initialConfig:t,onDone:n}){var w,N;const r=!!t,[s,i]=S.useState(e),[o,l]=S.useState((t==null?void 0:t.baseUrl)??""),[a,u]=S.useState(t!=null&&t.api&&!Qy.includes(t.api)?"__custom__":(t==null?void 0:t.api)??"anthropic-messages"),[f,d]=S.useState(t!=null&&t.api&&!Qy.includes(t.api)?t.api:""),[h,p]=S.useState((t==null?void 0:t.apiKey)??""),[m,y]=S.useState(((w=t==null?void 0:t.compat)==null?void 0:w.forceAdaptiveThinking)===!0),v=VD(),[g,x]=S.useState(null),b=k=>{k.preventDefault(),x(null);const I=a==="__custom__"?f:a;if(!I){x("API type is required.");return}const T={baseUrl:o,api:I,apiKey:h,...m?{compat:{forceAdaptiveThinking:!0}}:{},models:(t==null?void 0:t.models)??[]};v.mutate({name:s,provider:T},{onSuccess:()=>n()})};return c.jsxs("form",{onSubmit:b,className:"flex flex-1 flex-col overflow-y-auto",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border-soft px-4 py-3",children:[c.jsx("span",{className:"text-[13px] font-semibold text-foreground",children:r?"Edit Provider":"New Provider"}),c.jsx("button",{type:"button",onClick:n,className:"text-[13px] text-muted-foreground transition-colors hover:text-foreground",children:"Cancel"})]}),c.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[c.jsx(gt,{label:"Name",required:!0,children:c.jsx("input",{value:s,onChange:k=>i(k.target.value),placeholder:"e.g. my-provider",disabled:r,className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40 disabled:opacity-50",required:!0})}),c.jsx(gt,{label:"Base URL",required:!0,children:c.jsx("input",{value:o,onChange:k=>l(k.target.value),placeholder:"https://api.example.com",className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40",required:!0})}),c.jsxs(gt,{label:"API Type",required:!0,children:[c.jsxs("select",{value:a,onChange:k=>u(k.target.value),className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 text-[13px] text-foreground outline-none transition-colors 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…"})]}),a==="__custom__"&&c.jsx("input",{value:f,onChange:k=>d(k.target.value),placeholder:"custom-api-type",className:"mt-2 w-full rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40",required:!0})]}),c.jsx(gt,{label:"API Key",required:!0,children:c.jsx("input",{type:"password",value:h,onChange:k=>p(k.target.value),placeholder:"sk-...",className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40",required:!0})}),c.jsxs("label",{className:"flex items-center gap-2.5",children:[c.jsx("input",{type:"checkbox",checked:m,onChange:k=>y(k.target.checked),className:"h-3.5 w-3.5 accent-[hsl(var(--brand))]"}),c.jsx("span",{className:"text-[13px] text-muted-foreground",children:"Force Adaptive Thinking"})]})]}),c.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-soft px-4 py-3",children:[c.jsx("button",{type:"button",onClick:n,className:"rounded-lg border border-border-soft px-4 py-2 text-[13px] font-medium text-muted-foreground transition-colors hover:text-foreground",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:v.isPending,className:"rounded-lg bg-brand px-4 py-2 text-[13px] font-medium text-brand-foreground transition-colors hover:bg-brand-strong disabled:opacity-50",children:v.isPending?"Saving…":r?"Update":"Create"})]}),(g||v.isError)&&c.jsx("p",{className:"mx-4 mb-3 rounded-md border border-error-ghost bg-error-ghost px-3 py-1.5 text-[12px] text-signal-error",children:g??((N=v.error)==null?void 0:N.message)})]})}function Yy({provider:e,initialModel:t,onDone:n}){var O,H,C,X,J,j,we;const r=!!t,[s,i]=S.useState((t==null?void 0:t.id)??""),[o,l]=S.useState((t==null?void 0:t.name)??""),[a,u]=S.useState((t==null?void 0:t.reasoning)??!0),[f,d]=S.useState(String((t==null?void 0:t.contextWindow)??2e5)),[h,p]=S.useState(String((t==null?void 0:t.maxTokens)??32e3)),[m,y]=S.useState(String(((O=t==null?void 0:t.cost)==null?void 0:O.input)??0)),[v,g]=S.useState(String(((H=t==null?void 0:t.cost)==null?void 0:H.output)??0)),[x,b]=S.useState(String(((C=t==null?void 0:t.cost)==null?void 0:C.cacheRead)??0)),[w,N]=S.useState(String(((X=t==null?void 0:t.cost)==null?void 0:X.cacheWrite)??0)),[k,I]=S.useState(((J=t==null?void 0:t.thinkingLevelMap)==null?void 0:J.high)??"high"),[T,P]=S.useState(((j=t==null?void 0:t.thinkingLevelMap)==null?void 0:j.xhigh)??"max"),[E,M]=S.useState(t!=null&&t.headers?JSON.stringify(t.headers,null,2):""),R=KD(),Q=XD(),q=r?Q:R,[G,z]=S.useState(null),ee=te=>{te.preventDefault(),z(null);let ie;if(E.trim())try{ie=JSON.parse(E)}catch{z("Headers must be valid JSON.");return}const Xe={id:s,name:o,reasoning:a,input:["text"],contextWindow:Number(f),maxTokens:Number(h),cost:{input:Number(m),output:Number(v),cacheRead:Number(x),cacheWrite:Number(w)},...a?{thinkingLevelMap:{high:k,xhigh:T}}:{},...ie?{headers:ie}:{}};r?Q.mutate({provider:e,modelId:t.id,model:Xe},{onSuccess:()=>n()}):R.mutate({provider:e,model:Xe},{onSuccess:()=>n()})};return c.jsxs("form",{onSubmit:ee,className:"flex flex-1 flex-col overflow-y-auto",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border-soft px-4 py-3",children:[c.jsxs("span",{className:"text-[13px] font-semibold text-foreground",children:[r?"Edit Model":"New Model",c.jsxs("span",{className:"ml-1.5 font-normal text-muted-foreground",children:["· ",e]})]}),c.jsx("button",{type:"button",onClick:n,className:"text-[13px] text-muted-foreground transition-colors hover:text-foreground",children:"Cancel"})]}),c.jsxs("div",{className:"flex flex-col gap-4 overflow-y-auto p-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(gt,{label:"Model ID",required:!0,children:c.jsx("input",{value:s,onChange:te=>i(te.target.value),placeholder:"claude-opus-4-7",disabled:r,className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40 disabled:opacity-50",required:!0})}),c.jsx(gt,{label:"Display Name",required:!0,children:c.jsx("input",{value:o,onChange:te=>l(te.target.value),placeholder:"Claude Opus 4.7",className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 text-[13px] text-foreground outline-none transition-colors focus:border-brand/40",required:!0})})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(gt,{label:"Context Window",children:c.jsx("input",{type:"number",value:f,onChange:te=>d(te.target.value),className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40"})}),c.jsx(gt,{label:"Max Tokens",children:c.jsx("input",{type:"number",value:h,onChange:te=>p(te.target.value),className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40"})})]}),c.jsxs("label",{className:"flex items-center gap-2.5",children:[c.jsx("input",{type:"checkbox",checked:a,onChange:te=>u(te.target.checked),className:"h-3.5 w-3.5 accent-[hsl(var(--brand))]"}),c.jsx("span",{className:"text-[13px] text-muted-foreground",children:"Supports Reasoning"})]}),a&&c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(gt,{label:"Thinking High maps to",children:c.jsx("input",{value:k,onChange:te=>I(te.target.value),placeholder:"high",className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 text-[13px] text-foreground outline-none transition-colors focus:border-brand/40"})}),c.jsx(gt,{label:"Thinking XHigh maps to",children:c.jsx("input",{value:T,onChange:te=>P(te.target.value),placeholder:"max",className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 text-[13px] text-foreground outline-none transition-colors focus:border-brand/40"})})]}),c.jsxs("fieldset",{className:"rounded-lg border border-border-soft p-4",children:[c.jsx("legend",{className:"px-1 text-[12px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:"Cost (per million tokens)"}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(gt,{label:"Input",children:c.jsx("input",{type:"number",step:"0.01",value:m,onChange:te=>y(te.target.value),className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40"})}),c.jsx(gt,{label:"Output",children:c.jsx("input",{type:"number",step:"0.01",value:v,onChange:te=>g(te.target.value),className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40"})}),c.jsx(gt,{label:"Cache Read",children:c.jsx("input",{type:"number",step:"0.01",value:x,onChange:te=>b(te.target.value),className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40"})}),c.jsx(gt,{label:"Cache Write",children:c.jsx("input",{type:"number",step:"0.01",value:w,onChange:te=>N(te.target.value),className:"w-full rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40"})})]})]}),c.jsx(gt,{label:"Custom Headers (JSON)",children:c.jsx("textarea",{value:E,onChange:te=>M(te.target.value),placeholder:'{"User-Agent": "..."}',rows:3,className:"w-full resize-none rounded-lg border border-border-soft bg-background px-3 py-2 font-mono text-[13px] text-foreground outline-none transition-colors focus:border-brand/40"})})]}),c.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-soft px-4 py-3",children:[c.jsx("button",{type:"button",onClick:n,className:"rounded-lg border border-border-soft px-4 py-2 text-[13px] font-medium text-muted-foreground transition-colors hover:text-foreground",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:q.isPending,className:"rounded-lg bg-brand px-4 py-2 text-[13px] font-medium text-brand-foreground transition-colors hover:bg-brand-strong disabled:opacity-50",children:q.isPending?"Saving…":r?"Update":"Create"})]}),(G||q.isError)&&c.jsx("p",{className:"mx-4 mb-3 rounded-md border border-error-ghost bg-error-ghost px-3 py-1.5 text-[12px] text-signal-error",children:G??((we=q.error)==null?void 0:we.message)})]})}function gt({label:e,required:t,children:n}){return c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1.5 block text-[12px] font-medium text-muted-foreground",children:[e,t&&c.jsx("span",{className:"text-signal-error",children:" *"})]}),n]})}const Jy=[{id:"general",label:"General",icon:JN},{id:"session",label:"Session",icon:iE},{id:"models",label:"Models",icon:ZN}];function tF({workspaceId:e,onBack:t}){var i;const[n,r]=S.useState("general"),[s]=S.useState(()=>{try{const o=localStorage.getItem(av);if(o){const l=parseInt(o,10);if(!isNaN(l)&&l>=200)return l}}catch{}return lv});return c.jsxs("div",{className:"flex h-full w-full bg-background",children:[c.jsxs("nav",{className:"flex shrink-0 flex-col border-r border-border bg-popover/60",style:{width:`${s}px`},children:[c.jsx("header",{className:"flex h-[54px] shrink-0 items-center gap-2 px-3",children:c.jsxs("button",{type:"button",onClick:t,className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-[13px] font-medium text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",children:[c.jsx($N,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Back"})]})}),c.jsx("div",{className:"flex flex-1 flex-col gap-0.5 px-2 py-1",children:Jy.map(o=>c.jsxs("button",{type:"button",onClick:()=>r(o.id),className:D("flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] font-medium transition-colors",n===o.id?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:[c.jsx(o.icon,{className:"h-4 w-4"}),o.label]},o.id))})]}),c.jsxs("main",{className:"flex min-w-0 flex-1 flex-col overflow-y-auto",children:[c.jsx("header",{className:"flex h-[54px] shrink-0 items-center border-b border-border-soft px-8",children:c.jsx("h1",{className:"text-[15px] font-semibold tracking-[-0.01em] text-foreground",children:((i=Jy.find(o=>o.id===n))==null?void 0:i.label)??"Settings"})}),c.jsxs("div",{className:"mx-auto w-full max-w-2xl px-8 py-6",children:[n==="general"&&c.jsx(sF,{}),n==="session"&&c.jsx(iF,{workspaceId:e}),n==="models"&&c.jsx(dF,{})]})]})]})}const nF=[{value:"system",label:"System",icon:XN},{value:"light",label:"Light",icon:sE},{value:"dark",label:"Dark",icon:YN}],rF=[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}];function sF(){const{choice:e,setTheme:t}=hm(),n=ku(s=>s.density),r=ku(s=>s.setDensity);return c.jsx("div",{className:"flex flex-col gap-5",children:c.jsxs(Ga,{title:"Appearance",children:[c.jsx(Zy,{label:"Theme",children:c.jsx(eb,{options:nF.map(s=>({value:s.value,label:c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx(s.icon,{className:"h-3 w-3"}),c.jsx("span",{children:s.label})]})})),value:e,onChange:s=>t(s)})}),c.jsx(Zy,{label:"Density",children:c.jsx(eb,{options:rF.map(s=>({value:s.value,label:s.label})),value:n,onChange:s=>r(s)})})]})})}function iF({workspaceId:e}){const t=ce(r=>r.sessionPath),n=ce(r=>r.running);return e?c.jsx(oF,{workspaceId:e,sessionPath:t,running:n}):c.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[c.jsx(eE,{className:"mb-3 h-8 w-8 text-muted-foreground/40"}),c.jsx("p",{className:"text-[13px] text-muted-foreground",children:"Select a workspace first to configure the active session."})]})}function oF({workspaceId:e,sessionPath:t,running:n}){const{data:r,isLoading:s,error:i}=z1(e,t);return s?c.jsxs("div",{className:"flex items-center justify-center py-16 text-[12px] text-muted-foreground",children:[c.jsx(wt,{className:"h-4 w-4 animate-spin"}),c.jsx("span",{className:"ml-2",children:"Loading config…"})]}):i||!r?c.jsx("p",{className:"rounded-md border border-error-ghost bg-error-ghost px-4 py-3 text-center text-[12px] text-signal-error",children:(i==null?void 0:i.message)??"Failed to load config"}):c.jsxs("div",{className:"flex flex-col gap-5",children:[n&&c.jsx("p",{className:"rounded-md border border-brand-ghost bg-brand-ghost px-4 py-2 text-center text-[12px] text-brand",children:"Read-only while the agent is running"}),c.jsx(Ga,{title:"Model",children:c.jsx(lF,{workspaceId:e,currentModel:r.currentModel,availableModels:r.availableModels,disabled:n})}),c.jsx(Ga,{title:"Thinking level",children:c.jsx(uF,{workspaceId:e,level:r.thinkingLevel,availableLevels:r.availableThinkingLevels,disabled:n})}),c.jsx(Ga,{title:"Tools",children:c.jsx(cF,{workspaceId:e,activeTools:r.activeTools,allTools:r.allTools,disabled:n})})]})}function lF({workspaceId:e,currentModel:t,availableModels:n,disabled:r}){const s=B1(e),[i,o]=S.useState(!1),l=t?`${t.provider}/${t.modelId}`:"";return c.jsxs("div",{className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>o(a=>!a),disabled:r||s.isPending,className:D("flex w-full items-center gap-2 rounded-lg border bg-card px-4 py-2.5 text-[13px] text-foreground transition-colors","disabled:cursor-not-allowed disabled:opacity-50",i?"border-brand-subtle":"border-border-soft hover:border-border"),children:[c.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:(t==null?void 0:t.name)??"Select model"}),c.jsx(Jr,{className:D("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",i&&"rotate-180")})]}),i&&c.jsx("div",{className:"absolute left-0 right-0 top-full z-50 mt-1 max-h-72 overflow-y-auto rounded-lg border border-border bg-popover shadow-panel",children:n.map(a=>{const u=`${a.provider}/${a.modelId}`,f=u===l;return c.jsxs("button",{type:"button",onClick:()=>{o(!1),f||s.mutate({provider:a.provider,modelId:a.modelId})},title:`${a.provider}/${a.modelId}`,className:D("flex w-full items-center gap-2.5 px-4 py-2 text-left text-[13px] transition-colors",f?"bg-brand-ghost text-brand-strong":"text-foreground hover:bg-accent/60"),children:[c.jsx(qi,{className:D("h-3 w-3 shrink-0",f?"opacity-100":"opacity-0")}),c.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[c.jsx("span",{className:"truncate",children:a.name}),c.jsxs("span",{className:D("truncate font-mono text-[11px]",f?"text-brand":"text-muted-foreground"),children:[a.provider,"/",a.modelId]})]})]},u)})}),s.isError&&c.jsx("p",{className:"mt-1.5 text-[11.5px] text-signal-error",children:s.error.message})]})}const aF={off:"Off",minimal:"Min",low:"Low",medium:"Med",high:"High",xhigh:"Max"};function uF({workspaceId:e,level:t,availableLevels:n,disabled:r}){const s=U1(e);return n.length===0?c.jsx("p",{className:"text-[13px] text-muted-foreground",children:"Current model has no thinking support."}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex gap-0.5 rounded-lg border border-border bg-card p-1",children:n.map(i=>c.jsx("button",{type:"button",onClick:()=>s.mutate({level:i}),disabled:r||s.isPending,className:D("min-w-0 flex-1 truncate rounded-md px-2 py-2 text-[12.5px] font-medium transition-colors",i===t?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:text-foreground",(r||s.isPending)&&"opacity-50"),children:aF[i]??i},i))}),s.isError&&c.jsx("p",{className:"mt-1.5 text-[11.5px] text-signal-error",children:s.error.message})]})}function cF({workspaceId:e,activeTools:t,allTools:n,disabled:r}){const s=pN(e),i=new Set(t),o=(l,a)=>{const u=a?[...t,l]:t.filter(f=>f!==l);s.mutate({tools:u})};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mb-2 flex items-center justify-between",children:c.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[t.length," of ",n.length," enabled"]})}),c.jsx("ul",{className:"flex flex-col gap-1.5",children:n.map(l=>c.jsx("li",{children:c.jsxs("label",{className:D("flex cursor-pointer items-start gap-3 rounded-lg border border-border-soft bg-card px-4 py-2.5 transition-colors hover:border-border",i.has(l.name)&&"border-brand-whisper bg-brand-whisper",(r||s.isPending)&&"pointer-events-none opacity-50"),children:[c.jsx("input",{type:"checkbox",checked:i.has(l.name),onChange:a=>o(l.name,a.target.checked),disabled:r||s.isPending,className:"mt-[3px] h-3.5 w-3.5 shrink-0 accent-[hsl(var(--brand))]"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block font-mono text-[12.5px] text-foreground",children:l.name}),l.description&&c.jsx("span",{className:"mt-0.5 block text-[12px] text-muted-foreground",children:l.description})]})]})},l.name))}),s.isError&&c.jsx("p",{className:"mt-1.5 text-[11.5px] text-signal-error",children:s.error.message})]})}function dF(){return c.jsx(JD,{embedded:!0})}function Ga({title:e,children:t}){return c.jsxs("section",{children:[c.jsx("h3",{className:"mb-3 text-[12px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:e}),c.jsx("div",{className:"flex flex-col gap-3",children:t})]})}function Zy({label:e,children:t}){return c.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border-soft bg-card px-4 py-3",children:[c.jsx("span",{className:"text-[13px] text-foreground",children:e}),t]})}function eb({options:e,value:t,onChange:n}){return c.jsx("div",{className:"flex gap-0.5 rounded-md border border-border bg-card p-0.5",children:e.map(r=>c.jsx("button",{type:"button",onClick:()=>n(r.value),className:D("rounded-[5px] px-2.5 py-1 text-[12px] font-medium transition-colors",r.value===t?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:text-foreground"),children:r.label},r.value))})}const jc=["workspaces"];function fF(){return Pn({queryKey:jc,queryFn:()=>ge("/api/workspaces").then(e=>e.workspaces)})}function hF(){const e=Ne();return $e({mutationFn:async t=>(await ge("/api/workspaces",{method:"POST",body:JSON.stringify(t)})).workspace,onSuccess:()=>e.invalidateQueries({queryKey:jc})})}function pF(){const e=Ne();return $e({mutationFn:t=>ge(`/api/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>e.invalidateQueries({queryKey:jc})})}function mF(){const e=Ne();return $e({mutationFn:async t=>(await ge("/api/workspaces/reorder",{method:"PUT",body:JSON.stringify(t)})).workspaces,onSuccess:t=>{e.setQueryData(jc,t)}})}function gF({open:e,initialPath:t,onClose:n,onPick:r,error:s,busy:i}){const[o,l]=S.useState(t),[a,u]=S.useState(t??""),[f,d]=S.useState(!1),{data:h,isFetching:p,error:m}=dj(o,f,e),y=h==null?void 0:h.path;S.useEffect(()=>{y&&y!==o&&(l(y),u(y))},[y,o]),S.useEffect(()=>{e&&(l(t),u(t??""))},[e,t]);const v=(h==null?void 0:h.path)??o??"",g=s??(m instanceof Error?m.message:void 0);return c.jsxs(Ec,{open:e,onClose:n,className:"m-4 h-[32rem] w-full max-w-2xl",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(Dp,{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(Zr,{className:"h-4 w-4"})})]}),c.jsx(xF,{value:a,onChange:u,onSubmit:()=>{const x=a.trim();x&&l(x)}}),c.jsx(yF,{path:v,onJump:l}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:c.jsx(bF,{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:x=>d(x.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:v||"—"}),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:!v||i,onClick:()=>void r(v),className:D("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ring-brand-focus",!v||i?"bg-muted text-muted-foreground/70 cursor-not-allowed":"bg-brand text-brand-foreground hover:bg-brand-strong shadow-glow-sm"),children:[i&&c.jsx(wt,{className:"h-3 w-3 animate-spin"}),"Add this folder"]})]})]}),g&&c.jsx("p",{className:"mt-2 rounded-md border border-error-ghost bg-error-ghost px-2 py-1 text-xs text-signal-error",children:g})]})]})}function xF({value:e,onChange:t,onSubmit:n}){const r=S.useRef(null);return S.useEffect(()=>{var s;(s=r.current)==null||s.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:s=>t(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.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 yF({path:e,onJump:t}){const n=S.useMemo(()=>vF(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,s)=>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}),s<n.length-1&&c.jsx(Wi,{className:"h-3 w-3 text-muted-foreground"})]},r.path))]})}function bF({entries:e,parent:t,loading:n,error:r,onEnter:s}){return n?c.jsxs("div",{className:"flex h-full items-center justify-center text-xs text-muted-foreground",children:[c.jsx(wt,{className:"mr-2 h-3 w-3 animate-spin"}),"Loading…"]}):r?c.jsx("div",{className:"p-4 text-xs text-signal-error",children:r}):c.jsxs("ul",{className:"p-1.5",children:[t&&c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>s(t),className:tb,children:[c.jsx(Jf,{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(i=>c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>s(i.path),className:tb,children:[c.jsx(Dp,{className:"h-4 w-4 shrink-0 text-brand/70 opacity-80"}),c.jsx("span",{className:"truncate",children:i.name})]})},i.path))]})}const tb=D("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 vF(e){if(!e)return[];const t=e.split("/").filter(Boolean),n=[{label:"/",path:"/"}];let r="";for(const s of t)r+=`/${s}`,n.push({label:s,path:r});return n}const wF=()=>Math.min(window.innerWidth*.6,500);function kF({activeId:e,onSelect:t,onSelectSession:n,onNewSession:r,collapsed:s,onToggleCollapse:i,onOpenSettings:o}){const{data:l,isLoading:a}=fF(),u=Ne(),f=hF(),d=pF(),h=mF(),p=Ul(),[m,y]=S.useState(!1),[v,g]=S.useState(void 0),[x,b]=S.useState(new Set),{width:w,isResizing:N,onMouseDown:k,onDoubleClick:I}=Gk({storageKey:av,defaultWidth:lv,min:qE,max:wF,side:"right",onResizeEnd:ue=>{ue<WE&&!s&&i()}}),T=S.useCallback(ue=>{u.prefetchQuery(G1(ue))},[u]),P=S.useCallback(ue=>{b(Oe=>{const Ue=new Set(Oe);return Ue.has(ue)?Ue.delete(ue):Ue.add(ue),Ue})},[]),E=S.useRef(p);E.current=p;const M=S.useRef(d);M.current=d;const R=S.useCallback(async(ue,Oe)=>{await E.current({title:"Remove workspace",message:`Remove "${Oe}" from the list? (Files are not deleted.)`,confirmLabel:"Remove",variant:"danger"})&&M.current.mutateAsync(ue)},[]),Q=ce(ue=>ue.running),[q,G]=S.useState(null),[z,ee]=S.useState(null),[O,H]=S.useState(null),C=S.useRef(null),X=S.useRef(null),J=S.useRef(null),[j,we]=S.useState(null),te=S.useRef(0),ie=S.useMemo(()=>{if(!l)return;if(!j)return l;const ue=new Map(l.map(Ct=>[Ct.id,Ct])),Oe=new Set(j),Ue=[];for(const Ct of j){const st=ue.get(Ct);st&&Ue.push(st)}for(const Ct of l)Oe.has(Ct.id)||Ue.push(Ct);return Ue},[l,j]),Xe=S.useCallback(ue=>{C.current=ue,G(ue)},[]),K=S.useCallback(()=>{C.current=null,X.current=null,J.current=null,G(null),ee(null),H(null)},[]),ye=S.useCallback((ue,Oe)=>{const Ue=C.current;!Ue||ue===Ue||(X.current=ue,J.current=Oe,ee(ue),H(Oe))},[]),qt=S.useCallback(()=>{const ue=C.current,Oe=X.current,Ue=J.current;if(!ue||!Oe||!Ue||!l)return;const st=[...j??l.map(Ic=>Ic.id)],eo=st.indexOf(ue);if(eo===-1)return;st.splice(eo,1);let Gl=st.indexOf(Oe);Ue==="after"&&(Gl+=1),st.splice(Gl,0,ue);const ql=++te.current;we(st),h.mutate({ids:st},{onSuccess:()=>{te.current===ql&&we(null)},onError:()=>{te.current===ql&&we(null)}}),C.current=null,X.current=null,J.current=null,G(null),ee(null),H(null)},[l,j,h]),cr=S.useCallback(()=>{X.current=null,J.current=null,ee(null),H(null)},[]),Rn=async ue=>{g(void 0);try{const Oe=await f.mutateAsync({path:ue});y(!1),t(Oe.id)}catch(Oe){g(Oe instanceof Error?Oe.message:String(Oe))}},ts=(ie==null?void 0:ie.length)??0,Zi=s?56:w;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:D("relative h-full shrink-0",!N&&"transition-[width] duration-300 ease-out"),style:{width:`${Zi}px`},children:[c.jsx("div",{className:"absolute inset-0 overflow-clip border-r border-border",children:c.jsxs("aside",{className:"flex h-full flex-col overflow-hidden bg-popover will-change-transform",style:{width:`${w}px`,contain:"layout style"},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(ac,{size:28,filled:Q})}),c.jsx("div",{className:D("flex min-w-0 flex-1 items-center pr-3 transition-opacity duration-200 ease-out",s?"opacity-0":"opacity-100"),children:c.jsx(Cj,{})})]}),c.jsxs("div",{className:"relative flex h-[40px] shrink-0 items-center",children:[c.jsxs("div",{className:D("flex w-full items-center justify-between px-4 transition-opacity duration-200 ease-out",s?"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",ts>0&&c.jsx("span",{className:"ml-1.5 text-muted-foreground/60",children:ts})]}),c.jsxs("button",{type:"button",tabIndex:s?-1:0,onClick:()=>{g(void 0),y(!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"})]})]}),s&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:c.jsx("button",{type:"button",onClick:()=>{g(void 0),y(!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",onDragLeave:cr,children:[c.jsx(nb,{show:!!a,collapsed:s,label:"Loading…"}),c.jsx(nb,{show:!a&&(ie==null?void 0:ie.length)===0,collapsed:s,label:"No workspaces yet",variant:"dashed"}),ie==null?void 0:ie.map(ue=>c.jsx(SF,{id:ue.id,name:ue.name,active:e===ue.id,expanded:x.has(ue.id),collapsed:s,isDragging:q===ue.id,showDropBefore:z===ue.id&&O==="before",showDropAfter:z===ue.id&&O==="after",onSelect:t,onToggleExpand:P,onSelectSession:n,onNewSession:r,onDeleteWorkspace:R,onPrefetch:T,onDragStart:Xe,onDragOver:ye,onDragEnd:K,onDrop:qt},ue.id))]}),c.jsx(EF,{collapsed:s,onOpenSettings:o})]})}),!s&&c.jsx("div",{onMouseDown:k,onDoubleClick:I,className:D("absolute right-0 top-0 z-30 h-full w-px cursor-col-resize","bg-transparent hover:bg-brand/60 transition-colors",N&&"bg-brand"),"aria-label":"Resize sidebar",title:"Drag to resize · double-click to reset",children:c.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2"})}),c.jsx("button",{type:"button",onClick:i,className:"absolute right-0 top-1/2 z-40 -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":s?"Expand sidebar (Ctrl+B)":"Collapse sidebar (Ctrl+B)",title:s?"Expand sidebar (Ctrl+B)":"Collapse sidebar (Ctrl+B)",children:s?c.jsx(Wi,{className:"h-3.5 w-3.5"}):c.jsx(Q1,{className:"h-3.5 w-3.5"})})]}),c.jsx(gF,{open:m,onClose:()=>y(!1),onPick:Rn,error:v,busy:f.isPending})]})}function nb({show:e,collapsed:t,label:n,variant:r}){return e?c.jsx("li",{className:D("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}const SF=S.memo(function({id:t,name:n,active:r,expanded:s,collapsed:i,isDragging:o,showDropBefore:l,showDropAfter:a,onSelect:u,onToggleExpand:f,onSelectSession:d,onNewSession:h,onDeleteWorkspace:p,onPrefetch:m,onDragStart:y,onDragOver:v,onDragEnd:g,onDrop:x}){return c.jsxs("li",{className:D("group/ws relative",o&&"opacity-40"),draggable:!i,onMouseEnter:()=>m(t),onDragStart:b=>{y(t),b.dataTransfer.effectAllowed="move",b.dataTransfer.setData("text/plain",t)},onDragOver:b=>{b.preventDefault(),b.dataTransfer.dropEffect="move";const w=b.currentTarget.getBoundingClientRect(),N=w.top+w.height/2;v(t,b.clientY<N?"before":"after")},onDragLeave:()=>{},onDrop:b=>{b.preventDefault(),x()},onDragEnd:g,children:[l&&c.jsx("span",{className:"pointer-events-none absolute inset-x-1 top-0 z-10 h-[2px] rounded-full bg-brand"}),c.jsxs("div",{className:"relative flex h-[30px] items-center",children:[c.jsxs("button",{type:"button",onClick:()=>{r||u(t),f(t)},title:i?n:void 0,"aria-label":n,className:D("flex h-full w-full items-center gap-1.5 rounded-md px-2 text-left text-[13px] transition-colors",r?"text-foreground":"text-muted-foreground hover:bg-accent/40 hover:text-foreground"),children:[c.jsx(Dp,{className:"h-[14px] w-[14px] shrink-0 opacity-70"}),c.jsx("span",{className:D("min-w-0 flex-1 truncate transition-opacity duration-300 ease-out",i?"pointer-events-none opacity-0":"opacity-100"),children:n}),!i&&c.jsx(Jr,{className:D("h-3 w-3 shrink-0 opacity-40 transition-transform duration-200",!s&&"-rotate-90")})]}),!i&&c.jsx("button",{type:"button",onClick:b=>{b.stopPropagation(),h(t)},title:"New session","aria-label":"New session",className:"absolute right-6 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground opacity-40 transition-[opacity,background,color] hover:bg-accent/70 hover:text-foreground hover:opacity-100",children:c.jsx(oc,{className:"h-3.5 w-3.5"})})]}),c.jsx("button",{type:"button",onClick:b=>{b.stopPropagation(),p(t,n)},className:D("pointer-events-none absolute right-2 top-[15px] -translate-y-1/2 rounded p-0.5 text-muted-foreground transition-opacity duration-150","opacity-0 hover:bg-error-ghost hover:text-signal-error",!i&&"group-hover/ws:pointer-events-auto group-hover/ws:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100"),"aria-label":"Remove workspace",title:"Remove workspace",tabIndex:i?-1:0,children:c.jsx(al,{className:"h-3 w-3"})}),c.jsx(CF,{workspaceId:t,expanded:s,collapsed:i,onSelectSession:d}),a&&c.jsx("span",{className:"pointer-events-none absolute inset-x-1 bottom-0 z-10 h-[2px] rounded-full bg-brand"})]})}),rb=5;function CF({workspaceId:e,expanded:t,collapsed:n,onSelectSession:r}){const s=t&&!n,[i,o]=S.useState(!1),[l,a]=S.useState(!1);if(S.useEffect(()=>{if(!s){a(!1);return}o(!0),a(!1);const f=requestAnimationFrame(()=>{requestAnimationFrame(()=>a(!0))});return()=>cancelAnimationFrame(f)},[s]),!i)return null;const u=l&&s;return c.jsx("div",{className:D("grid ease-out transition-[grid-template-rows,opacity] duration-200",u?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),...u?void 0:{inert:""},children:c.jsx("div",{className:"min-h-0 overflow-hidden",children:c.jsx(_F,{workspaceId:e,onSelectSession:r})})})}function _F({workspaceId:e,onSelectSession:t}){const{data:n,isLoading:r}=xN(e),s=yN(e),i=Ul(),o=ce(h=>h.sessionPath),[l,a]=S.useState(rb),u=S.useCallback(async h=>{if(s.isPending)return;const p=Ca(h);await i({title:"Delete session",message:`Delete session "${p}"? This cannot be undone.`,confirmLabel:"Delete",variant:"danger"})&&s.mutate(h.path,{onError:async y=>{await i({title:"Delete failed",message:`Failed to delete session: ${y.message}`,confirmLabel:"OK",cancelLabel:null})}})},[i,s]),f=(n==null?void 0:n.slice(0,l))??[],d=((n==null?void 0:n.length)??0)>l;return r&&!n?c.jsx("div",{className:"flex flex-col gap-0.5 pb-1",children:Array.from({length:3}).map((h,p)=>c.jsx("div",{className:"flex h-[28px] items-center pl-7 pr-6",children:c.jsx("div",{className:"h-2.5 w-full animate-pulse rounded bg-muted/60"})},p))}):c.jsxs("div",{className:"pb-1",children:[f.map(h=>{const p=h.path===o,m=s.isPending&&s.variables===h.path;return c.jsxs("div",{className:"group/session relative",children:[c.jsxs("button",{type:"button",onClick:()=>{p||t(e,h.path)},title:Ca(h),className:D("relative flex h-[28px] w-full items-center gap-1.5 rounded-md pl-7 pr-6 text-left text-[12.5px] transition-colors",p?"bg-accent/60 font-medium text-foreground":"text-muted-foreground hover:bg-accent/40 hover:text-foreground"),children:[h.running?c.jsx("span",{title:"Running",className:"absolute left-[13px] top-1/2 h-1.5 w-1.5 -translate-y-1/2 rounded-full bg-brand animate-v2-pulse"}):p?c.jsx("span",{className:"absolute left-[14px] top-1/2 h-[14px] w-[2px] -translate-y-1/2 rounded-full bg-brand"}):c.jsx("span",{className:"absolute left-[14px] top-1/2 -translate-y-1/2 text-[6px] leading-none opacity-40",children:"●"}),c.jsx("span",{className:"truncate",children:Ca(h)})]}),!p&&c.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),u(h)},disabled:s.isPending,title:"Delete session","aria-label":`Delete session ${Ca(h)}`,className:D("absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground transition-opacity","hover:bg-error-ghost hover:text-signal-error",m?"opacity-100":"opacity-0 group-hover/session:opacity-100"),children:m?c.jsx(wt,{className:"h-3 w-3 animate-spin"}):c.jsx(al,{className:"h-3 w-3"})})]},h.path)}),d&&c.jsx("button",{type:"button",onClick:()=>a(h=>h+rb),className:"flex h-[26px] w-full items-center pl-7 pr-2 text-[12px] text-muted-foreground/60 transition-colors hover:text-muted-foreground",children:"See more"})]})}function Ca(e){return e.name?e.name:e.preview?e.preview:NF(e.path)}function NF(e){return e.split("/").at(-1)??e}function EF({collapsed:e,onOpenSettings:t}){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:D("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(zE,{state:"online"}),c.jsx("span",{children:"Online"}),c.jsx("span",{className:"flex-1"}),c.jsx("button",{type:"button",onClick:t,title:"Settings","aria-label":"Settings",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground",children:c.jsx(Hg,{className:"h-3.5 w-3.5"})})]}),e&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:c.jsx("button",{type:"button",onClick:t,title:"Settings","aria-label":"Settings",className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground",children:c.jsx(Hg,{className:"h-3.5 w-3.5"})})})]})}function jF(){const[e,t]=S.useState(void 0),[n,r]=S.useState(!1),[s,i]=S.useState("chat"),[o,l]=S.useState(void 0),a=yl(g=>g.rightPanel),u=yl(g=>g.closePanel),f=S.useRef(void 0),d=S.useCallback(g=>{const x=f.current;x&&ce.getState().saveSnapshot(x),f.current=g},[]),h=S.useCallback(g=>{d(g),t(g),l(void 0)},[d]),p=S.useCallback((g,x)=>{d(g),t(g),l(b=>({path:x,nonce:((b==null?void 0:b.nonce)??0)+1}))},[d]),m=S.useCallback(g=>{d(g),t(g),l(void 0),Te.send({type:"new_session",workspaceId:g})},[d]);bD(e),vD(),gN(),NN(),kN(),wD(e);const y=S.useCallback(()=>{r(g=>!g)},[]);S.useEffect(()=>{const g=x=>{(x.ctrlKey||x.metaKey)&&x.key==="b"&&(x.preventDefault(),y())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[y]);const v=s==="settings";return c.jsxs(PD,{children:[c.jsx("div",{className:v?"contents":"hidden",children:c.jsx(tF,{workspaceId:e,onBack:()=>i("chat")})}),c.jsxs("div",{className:v?"hidden":"flex h-full",children:[c.jsx(kF,{activeId:e,onSelect:h,onSelectSession:p,onNewSession:m,collapsed:n,onToggleCollapse:y,onOpenSettings:()=>i("settings")}),c.jsx(tD,{workspaceId:e,sessionRequest:o},e??"none"),e&&c.jsxs(c.Fragment,{children:[c.jsx(AD,{workspaceId:e,open:a==="resources",onClose:u},`res-${e}`),c.jsx(pD,{workspaceId:e,open:a==="tree",onClose:u},`tree-${e}`),c.jsx(UD,{open:a==="artifact",onClose:u},`art-${e}`)]})]}),c.jsx(SD,{})]})}class IF extends S.Component{constructor(){super(...arguments);A(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary]",n,r.componentStack)}render(){return this.state.error?this.props.fallback?this.props.fallback:c.jsx(TF,{error:this.state.error,onReset:()=>this.setState({error:null})}):this.props.children}}function TF({error:e,onReset:t}){return c.jsx("div",{className:"flex h-full items-center justify-center bg-background text-foreground",children:c.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 p-8 text-center",children:[c.jsx("div",{className:"text-4xl",children:"⚠"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Something went wrong"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:e.message||"An unexpected error occurred."}),c.jsx("button",{onClick:t,className:"rounded-md bg-brand px-4 py-2 text-sm font-medium text-brand-foreground hover:bg-brand-strong transition-colors",children:"Try again"})]})})}const PF=new X_({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:1,staleTime:5e3,gcTime:3e5}}}),Wk=document.getElementById("root");if(!Wk)throw new Error("missing #root");E1(Wk).render(c.jsx(S.StrictMode,{children:c.jsx(Y_,{client:PF,children:c.jsx(IF,{children:c.jsx(jF,{})})})}));
|